From fc6fa9d42542a0084d803380c9ef015853dca6dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Verstraeten?= Date: Mon, 9 Mar 2026 21:18:52 +0100 Subject: [PATCH] Format Media.jsx and add newline Reformat code in ui/src/pages/Media/Media.jsx for readability: wrap long argument lists (getTimestampFromInput, buildEventFilter) and reflow the appliedFilter ternary onto multiple lines. Also add the missing trailing newline to ui/public/locales/en/translation.json. No functional changes. --- ui/public/locales/en/translation.json | 2 +- ui/src/pages/Media/Media.jsx | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/ui/public/locales/en/translation.json b/ui/public/locales/en/translation.json index 8d03564..f05f08e 100644 --- a/ui/public/locales/en/translation.json +++ b/ui/public/locales/en/translation.json @@ -237,4 +237,4 @@ "remove_after_upload_enabled": "Enable delete on upload" } } -} \ No newline at end of file +} diff --git a/ui/src/pages/Media/Media.jsx b/ui/src/pages/Media/Media.jsx index caae819..7d90c92 100644 --- a/ui/src/pages/Media/Media.jsx +++ b/ui/src/pages/Media/Media.jsx @@ -133,7 +133,10 @@ class Media extends React.Component { const { appliedFilter } = this.state; return { - timestamp_offset_start: this.getTimestampFromInput(startDateTime, 'start'), + timestamp_offset_start: this.getTimestampFromInput( + startDateTime, + 'start' + ), timestamp_offset_end: this.getTimestampFromInput(endDateTime, 'end'), number_of_elements: appliedFilter.number_of_elements, }; @@ -145,8 +148,12 @@ class Media extends React.Component { const normalizedValue = normalizeInputValue(value); const nextStartDateTime = field === 'startDateTime' ? normalizedValue : startDateTime; - const nextEndDateTime = field === 'endDateTime' ? normalizedValue : endDateTime; - const nextFilter = this.buildEventFilter(nextStartDateTime, nextEndDateTime); + const nextEndDateTime = + field === 'endDateTime' ? normalizedValue : endDateTime; + const nextFilter = this.buildEventFilter( + nextStartDateTime, + nextEndDateTime + ); const shouldApplyFilter = (nextStartDateTime === '' || nextStartDateTime.length === 16) && (nextEndDateTime === '' || nextEndDateTime.length === 16); @@ -154,7 +161,9 @@ class Media extends React.Component { this.setState( { [field]: normalizedValue, - appliedFilter: shouldApplyFilter ? nextFilter : this.state.appliedFilter, + appliedFilter: shouldApplyFilter + ? nextFilter + : this.state.appliedFilter, isScrolling: false, }, () => {