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.
This commit is contained in:
Cédric Verstraeten
2026-03-09 21:18:52 +01:00
parent aa183ee0fb
commit fc6fa9d425
2 changed files with 14 additions and 5 deletions
+1 -1
View File
@@ -237,4 +237,4 @@
"remove_after_upload_enabled": "Enable delete on upload"
}
}
}
}
+13 -4
View File
@@ -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,
},
() => {