Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export default [
"no-tabs": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-floating-promises": "off",
"@typescript-eslint/no-misused-promises": "off",
},
},
];
Expand Down
4 changes: 2 additions & 2 deletions src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ const Header = () => {
// Fetching health status information at mount
loadHealthStatus().then(r => console.info(r));
// Fetch health status every minute
const interval = setInterval(() => dispatch(fetchHealthStatus()), 5000);
const interval = setInterval(() => { dispatch(fetchHealthStatus()); }, 5000);

// Event listener for handle a click outside of dropdown menu
window.addEventListener("mousedown", handleClickOutside);
Expand Down Expand Up @@ -334,7 +334,7 @@ const MenuNotify = ({
<li key={key}>
{!!service.status && (
<ButtonLikeAnchor
onClick={() => redirectToServices()}
onClick={() => { redirectToServices(); }}
>
<span> {service.name} </span>
{service.error ? (
Expand Down
4 changes: 2 additions & 2 deletions src/components/NavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const NavBar = ({

useHotkeys(
(create && create.hotkeySequence) ?? [],
() => showNewResourceModal(),
() => { showNewResourceModal(); },
{ description: create && create.hotkeyDescription ? t(create.hotkeyDescription) : undefined },
[showNewResourceModal],
);
Expand Down Expand Up @@ -115,7 +115,7 @@ const NavBar = ({
{hasAccess(create.accessRole, user) && (
<BaseButton
className="add"
onClick={showNewResourceModal}
onClick={() => { showNewResourceModal(); }}
style={{ display: "flex", alignItems: "center" }}
>
<LuPlus className="btn-group-icon" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const ThemesActionsCell = ({
<>
{/* edit themes */}
<ButtonLikeAnchor
onClick={() => showThemeDetails()}
onClick={() => { showThemeDetails(); }}
className={"action-cell-button"}
editAccessRole={"ROLE_UI_THEMES_EDIT"}
// tooltipText={"CONFIGURATION.THEMES.TABLE.TOOLTIP.DETAILS"} // Disabled due to performance concerns
Expand Down
2 changes: 1 addition & 1 deletion src/components/events/partials/EventActionCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const EventActionCell = ({
{/* If event belongs to a series then the corresponding series details can be opened */}
{!!row.series && (
<ButtonLikeAnchor
onClick={onClickSeriesDetails}
onClick={() => { onClickSeriesDetails(); }}
className={"action-cell-button more-series"}
editAccessRole={"ROLE_UI_SERIES_DETAILS_VIEW"}
// tooltipText={"EVENTS.SERIES.TABLE.TOOLTIP.DETAILS"} // Disabled due to performance concerns
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ const DetailsTobiraTab = ({ kind, id }: DetailsTobiraTabProps) => {
return <>
<div className="modal-content">
{tabHierarchy === "edit-path" && <EventDetailsTabHierarchyNavigation
openSubTab={openSubTab}
openSubTab={(tabType: TobiraTabHierarchy) => {
void openSubTab(tabType);
}}
hierarchyDepth={0}
translationKey0="EVENTS.SERIES.DETAILS.TOBIRA.DISCARD"
subTabArgument0="main"
Expand Down Expand Up @@ -216,7 +218,7 @@ const TobiraTable = ({ tobiraData, i18nKey, openSubTab, handleDelete }: TobiraTa
{i18nKey === "SERIES" && <ButtonLikeAnchor
style={{ margin: 5 }}
className="edit pull-right"
onClick={() => openSubTab("edit-path")}
onClick={() => { openSubTab("edit-path"); }}
tooltipText="EVENTS.SERIES.DETAILS.TOBIRA.MOUNT_SERIES"
>
<LuSquarePen className="pen" />
Expand Down Expand Up @@ -257,7 +259,7 @@ const TobiraTable = ({ tobiraData, i18nKey, openSubTab, handleDelete }: TobiraTa
<ButtonLikeAnchor
style={{ margin: 5 }}
className="edit pull-right"
onClick={() => openSubTab("edit-path", hostPage)}
onClick={() => { openSubTab("edit-path", hostPage); }}
tooltipText="EVENTS.SERIES.DETAILS.TOBIRA.EDIT_PATH"
>
<LuSquarePen className="pen" />
Expand All @@ -266,7 +268,7 @@ const TobiraTable = ({ tobiraData, i18nKey, openSubTab, handleDelete }: TobiraTa
close={() => deleteConfirmationModalRef.current?.close?.()}
resourceName={hostPage.path}
resourceId={null}
deleteMethod={() => handleDelete(hostPage)}
deleteMethod={() => { handleDelete(hostPage); }}
resourceType="TOBIRA_PATH"
modalRef={deleteConfirmationModalRef}
/>
Expand Down
24 changes: 13 additions & 11 deletions src/components/events/partials/ModalTabsAndPages/NewSourcePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,18 @@ const NewSourcePage = <T extends RequiredFormProps>({
return inputDevices.length > 0 && hasAnyDeviceAccess(user, inputDevices);
};

const nextPageWithCheck = async () => {
removeOldNotifications();
const noConflicts = await dispatch(checkConflicts(formik.values));
if (Array.isArray(noConflicts)) {
setConflicts(noConflicts);
}
if ((typeof noConflicts == "boolean" && noConflicts)
|| (Array.isArray(noConflicts) && noConflicts.length === 0)) {
nextPage(formik.values);
}
};

return (
<>
<ModalContentTable>
Expand Down Expand Up @@ -210,17 +222,7 @@ const NewSourcePage = <T extends RequiredFormProps>({
{/* Button for navigation to next page and previous page */}
<WizardNavigationButtons
formik={formik}
nextPage={async () => {
removeOldNotifications();
const noConflicts = await dispatch(checkConflicts(formik.values));
if (Array.isArray(noConflicts)) {
setConflicts(noConflicts);
}
if ((typeof noConflicts == "boolean" && noConflicts)
|| (Array.isArray(noConflicts) && noConflicts.length === 0)) {
nextPage(formik.values);
}
}}
nextPage={() => { nextPageWithCheck(); }}
previousPage={previousPage}
/>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ const NewTobiraPage = <T extends TobiraFormProps>({
{/* Render buttons for saving or resetting updated path */}
{mode.edit && <SaveEditFooter
active={formik.values.selectedPage !== undefined}
reset={() => formik.setFieldValue("selectedPage", undefined)}
reset={() => { formik.setFieldValue("selectedPage", undefined); }}
submit={() => formik.handleSubmit()}
{...{ isValid }}
/>}
Expand Down
4 changes: 2 additions & 2 deletions src/components/events/partials/SeriesActionsCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const SeriesActionsCell = ({
<>
{/* series details */}
<ButtonLikeAnchor
onClick={() => showSeriesDetailsModal()}
onClick={() => { showSeriesDetailsModal(); }}
className={"action-cell-button more-series"}
editAccessRole={"ROLE_UI_SERIES_DETAILS_VIEW"}
// tooltipText={"EVENTS.SERIES.TABLE.TOOLTIP.DETAILS"} // Disabled due to performance concerns
Expand All @@ -78,7 +78,7 @@ const SeriesActionsCell = ({

{/* delete series */}
<ButtonLikeAnchor
onClick={() => showDeleteConfirmation()}
onClick={() => { showDeleteConfirmation(); }}
className={"action-cell-button remove"}
editAccessRole={"ROLE_UI_SERIES_DELETE"}
// tooltipText={"EVENTS.SERIES.TABLE.TOOLTIP.DELETE"} // Disabled due to performance concerns
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const RecordingsActionCell = ({
<>
{/* view details location/recording */}
<ButtonLikeAnchor
onClick={() => showRecordingDetails()}
onClick={() => { showRecordingDetails(); }}
className={"action-cell-button"}
editAccessRole={"ROLE_UI_LOCATIONS_DETAILS_VIEW"}
// tooltipText={"RECORDINGS.RECORDINGS.TABLE.TOOLTIP.DETAILS"} // Disabled due to performance concerns
Expand Down
2 changes: 1 addition & 1 deletion src/components/shared/DateTimeCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const DateTimeCell = ({
return (
// Link template for start date of event
<ButtonLikeAnchor
onClick={() => addFilter(date)}
onClick={() => { addFilter(date); }}
className={"crosslink"}
tooltipText={tooltipText}
>
Expand Down
5 changes: 3 additions & 2 deletions src/components/shared/DropDown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,13 @@ const DropDown = <T, >({
};

const loadOptionsAsync = (inputValue: string, callback: (options: DropDownOption[]) => void) => {
setTimeout(async () => {
const timeout = async () => {
callback(formatOptions(
fetchOptions ? await fetchOptions(inputValue) : filterOptions(inputValue),
required,
));
}, 1000);
};
setTimeout(() => { timeout(); }, 1000);
};

const loadOptions = (
Expand Down
2 changes: 1 addition & 1 deletion src/components/shared/FilterCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const FilterCell = <T, >({
filterItems.map((item, key) => (
<ButtonLikeAnchor
key={key}
onClick={() => addFilter(item.filterValue)}
onClick={() => { addFilter(item.filterValue); }}
className={"crosslink"}
tooltipText={item.cellTooltipText}
>
Expand Down
4 changes: 2 additions & 2 deletions src/components/shared/MainNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ const MainNav = ({

useHotkeys(
availableHotkeys.general.EVENT_VIEW.sequence,
() => navigate("/events/events"),
() => { navigate("/events/events"); },
{ description: t(availableHotkeys.general.EVENT_VIEW.description) ?? undefined },
[],
);

useHotkeys(
availableHotkeys.general.SERIES_VIEW.sequence,
() => navigate("/events/series"),
() => { navigate("/events/series"); },
{ description: t(availableHotkeys.general.SERIES_VIEW.description) ?? undefined },
[],
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/shared/MultiValueCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const MultiValueCell = ({
values.map((value, key) => (
<ButtonLikeAnchor
key={key}
onClick={() => addFilter(value)}
onClick={() => { addFilter(value); }}
className={"metadata-entry"}
tooltipText={tooltipText}
>
Expand Down
2 changes: 1 addition & 1 deletion src/components/shared/RedirectCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const RedirectCell = ({
<ButtonLikeAnchor
className="button-like-anchor crosslink"
tooltipText={tooltipText}
onClick={() => redirectToResource(filterValue)}
onClick={() => { redirectToResource(filterValue); }}
>
{children}
</ButtonLikeAnchor>
Expand Down
4 changes: 2 additions & 2 deletions src/components/shared/Stats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const Stats = () => {
// Load stats on mount
loadStats();

const fetchEventsInterval = setInterval(() => loadStats(), 5000);
const fetchEventsInterval = setInterval(() => { loadStats(); }, 5000);

return () => clearInterval(fetchEventsInterval);
// eslint-disable-next-line react-hooks/exhaustive-deps
Expand All @@ -76,7 +76,7 @@ const Stats = () => {
tooltipText={"DASHBOARD.BUTTON_TOOLTIP"}
tooltipParams={{ filterName: t(st.description as ParseKeys) }}
aria-label={t("DASHBOARD.BUTTON_TOOLTIP", { filterName: t(st.description as ParseKeys) })}
onClick={() => showStatsFilter(st)}
onClick={() => { showStatsFilter(st); }}
>
<div>{st.count}</div>
{/* Show the description of the status, if defined,
Expand Down
2 changes: 1 addition & 1 deletion src/components/shared/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const Table = ({
loadResource();

// Fetch resources every minute
const fetchResourceInterval = setInterval(loadResource, 5000);
const fetchResourceInterval = setInterval(() => { loadResource(); }, 5000);

return () => {
allowLoadIntoTable = false;
Expand Down
8 changes: 4 additions & 4 deletions src/components/shared/TableFilters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ const TableFilters = ({
useEffect(() => {
if (itemValue) {
// Call to apply filter changes with 600MS debounce!
const applyFilterChangesDebouncedTimeoutId = setTimeout(applyFilterChangesDebounced, 600);
const applyFilterChangesDebouncedTimeoutId = setTimeout(() => { applyFilterChangesDebounced(); }, 600);

return () => clearTimeout(applyFilterChangesDebouncedTimeoutId);
}
Expand Down Expand Up @@ -225,7 +225,7 @@ const TableFilters = ({

useHotkeys(
availableHotkeys.general.REMOVE_FILTERS.sequence,
() => removeFilters(),
() => { removeFilters(); },
{ description: t(availableHotkeys.general.REMOVE_FILTERS.description) ?? undefined },
[removeFilters],
);
Expand Down Expand Up @@ -348,7 +348,7 @@ const TableFilters = ({
}
{/* Remove icon in blue area around filter */}
<ButtonLikeAnchor
onClick={() => removeFilter(filter)}
onClick={() => { removeFilter(filter); }}
tooltipText="TABLE_FILTERS.REMOVE"
>
<LuX />
Expand All @@ -361,7 +361,7 @@ const TableFilters = ({
{/* Remove icon to clear all filters */}
{filterMap.some(e => e.value) &&
<ButtonLikeAnchor
onClick={removeFilters}
onClick={() => { removeFilters(); }}
tooltipText="TABLE_FILTERS.CLEAR"
className="table-filter-button"
>
Expand Down
10 changes: 7 additions & 3 deletions src/components/shared/wizard/RenderField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ const EditableDateValue = ({
<DatePicker
ref={ref}
selected={!isNaN(Date.parse(field.value as string)) ? new Date(field.value as string) : null}
onChange={value => setFieldValue(field.name, value)}
onChange={value => { setFieldValue(field.name, value); }}
showTimeInput
showYearDropdown
showMonthDropdown
Expand Down Expand Up @@ -311,7 +311,7 @@ const EditableSingleValueTime = ({
<DatePicker
ref={ref}
selected={typeof field.value === "string" ? parseISO(field.value) : field.value as Date}
onChange={value => setFieldValue(field.name, value)}
onChange={value => { setFieldValue(field.name, value); }}
showTimeSelect
showTimeSelectOnly
dateFormat="p"
Expand Down Expand Up @@ -406,7 +406,11 @@ const EditableSingleSelectDropDown = ({
options={options}
fetchOptions={fetchOptions}
required={metadataField.required}
handleChange={element => element && setFieldValue(field.name, element.value)}
handleChange={element => {
if (element) {
setFieldValue(field.name, element.value);
}
}}
placeholder={focused
? `-- ${t("SELECT_NO_OPTION_SELECTED")} --`
: `${t("SELECT_NO_OPTION_SELECTED")}`
Expand Down
2 changes: 1 addition & 1 deletion src/components/systems/partials/ServersMaintenanceCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const ServersMaintenanceCell = ({
{hasAccess("ROLE_UI_SERVERS_MAINTENANCE_EDIT", user) && (
<input
type="checkbox"
onChange={e => onClickCheckbox(e)}
onChange={e => { onClickCheckbox(e); }}
name="maintenanceStatus"
checked={row.maintenance}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/components/systems/partials/ServicesActionsCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const ServicesActionCell = ({
return (
row.status !== "SYSTEMS.SERVICES.STATUS.NORMAL" ? (
<ButtonLikeAnchor
onClick={() => onClickRestart()}
onClick={() => { onClickRestart(); }}
className={"action-cell-button"}
editAccessRole={"ROLE_UI_SERVICES_STATUS_EDIT"}
// tooltipText={"SYSTEMS.SERVICES.TABLE.SANITIZE"} // Disabled due to performance concerns
Expand Down
2 changes: 1 addition & 1 deletion src/components/users/partials/AclsActionsCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const AclsActionsCell = ({
<>
{/* edit/show ACL details */}
<ButtonLikeAnchor
onClick={showAclDetails}
onClick={() => { showAclDetails(); }}
className={"action-cell-button"}
editAccessRole={"ROLE_UI_ACLS_EDIT"}
// tooltipText={"USERS.ACLS.TABLE.TOOLTIP.DETAILS"} // Disabled due to performance concerns
Expand Down
2 changes: 1 addition & 1 deletion src/components/users/partials/GroupsActionsCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const GroupsActionsCell = ({
<>
{/* edit/show group */}
<ButtonLikeAnchor
onClick={() => showGroupDetails()}
onClick={() => { showGroupDetails(); }}
className={"action-cell-button"}
editAccessRole={"ROLE_UI_GROUPS_EDIT"}
// tooltipText={"USERS.GROUPS.TABLE.TOOLTIP.DETAILS"} // Disabled due to performance concerns
Expand Down
2 changes: 1 addition & 1 deletion src/components/users/partials/UsersActionsCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const UsersActionCell = ({
<>
{/* edit/show user details */}
<ButtonLikeAnchor
onClick={() => showUserDetails()}
onClick={() => { showUserDetails(); }}
className={"action-cell-button"}
editAccessRole={"ROLE_UI_USERS_EDIT"}
// tooltipText={"USERS.USERS.TABLE.TOOLTIP.DETAILS"} // Disabled due to performance concerns
Expand Down
Loading