diff --git a/app/src/components/configuration/Themes.tsx b/src/components/configuration/Themes.tsx
similarity index 100%
rename from app/src/components/configuration/Themes.tsx
rename to src/components/configuration/Themes.tsx
diff --git a/app/src/components/configuration/partials/ThemesActionsCell.tsx b/src/components/configuration/partials/ThemesActionsCell.tsx
similarity index 100%
rename from app/src/components/configuration/partials/ThemesActionsCell.tsx
rename to src/components/configuration/partials/ThemesActionsCell.tsx
diff --git a/app/src/components/configuration/partials/wizard/BumperPage.tsx b/src/components/configuration/partials/wizard/BumperPage.tsx
similarity index 99%
rename from app/src/components/configuration/partials/wizard/BumperPage.tsx
rename to src/components/configuration/partials/wizard/BumperPage.tsx
index 01fb9a149b..af9b88a43f 100644
--- a/app/src/components/configuration/partials/wizard/BumperPage.tsx
+++ b/src/components/configuration/partials/wizard/BumperPage.tsx
@@ -12,6 +12,7 @@ import Notifications from "../../../shared/Notifications";
interface RequiredFormProps {
bumperActive: boolean,
trailerActive: boolean,
+ [key: string]: unknown,
}
const BumperPage = ({
diff --git a/app/src/components/configuration/partials/wizard/GeneralPage.tsx b/src/components/configuration/partials/wizard/GeneralPage.tsx
similarity index 100%
rename from app/src/components/configuration/partials/wizard/GeneralPage.tsx
rename to src/components/configuration/partials/wizard/GeneralPage.tsx
diff --git a/app/src/components/configuration/partials/wizard/NewThemeWizard.tsx b/src/components/configuration/partials/wizard/NewThemeWizard.tsx
similarity index 100%
rename from app/src/components/configuration/partials/wizard/NewThemeWizard.tsx
rename to src/components/configuration/partials/wizard/NewThemeWizard.tsx
diff --git a/app/src/components/configuration/partials/wizard/ThemeDetails.tsx b/src/components/configuration/partials/wizard/ThemeDetails.tsx
similarity index 100%
rename from app/src/components/configuration/partials/wizard/ThemeDetails.tsx
rename to src/components/configuration/partials/wizard/ThemeDetails.tsx
diff --git a/app/src/components/configuration/partials/wizard/ThemeDetailsModal.tsx b/src/components/configuration/partials/wizard/ThemeDetailsModal.tsx
similarity index 100%
rename from app/src/components/configuration/partials/wizard/ThemeDetailsModal.tsx
rename to src/components/configuration/partials/wizard/ThemeDetailsModal.tsx
diff --git a/app/src/components/configuration/partials/wizard/ThemeSummaryPage.tsx b/src/components/configuration/partials/wizard/ThemeSummaryPage.tsx
similarity index 100%
rename from app/src/components/configuration/partials/wizard/ThemeSummaryPage.tsx
rename to src/components/configuration/partials/wizard/ThemeSummaryPage.tsx
diff --git a/app/src/components/configuration/partials/wizard/TitleSlidePage.tsx b/src/components/configuration/partials/wizard/TitleSlidePage.tsx
similarity index 99%
rename from app/src/components/configuration/partials/wizard/TitleSlidePage.tsx
rename to src/components/configuration/partials/wizard/TitleSlidePage.tsx
index 3db480d974..48aaaacab6 100644
--- a/app/src/components/configuration/partials/wizard/TitleSlidePage.tsx
+++ b/src/components/configuration/partials/wizard/TitleSlidePage.tsx
@@ -10,6 +10,7 @@ import FileUpload from "../../../shared/wizard/FileUpload";
interface RequiredFormProps {
titleSlideActive: boolean,
titleSlideMode: string,
+ [key: string]: unknown,
}
const TitleSlidePage = ({
diff --git a/app/src/components/configuration/partials/wizard/UsagePage.tsx b/src/components/configuration/partials/wizard/UsagePage.tsx
similarity index 100%
rename from app/src/components/configuration/partials/wizard/UsagePage.tsx
rename to src/components/configuration/partials/wizard/UsagePage.tsx
diff --git a/app/src/components/configuration/partials/wizard/WatermarkPage.tsx b/src/components/configuration/partials/wizard/WatermarkPage.tsx
similarity index 99%
rename from app/src/components/configuration/partials/wizard/WatermarkPage.tsx
rename to src/components/configuration/partials/wizard/WatermarkPage.tsx
index dc3940f962..6af725d396 100644
--- a/app/src/components/configuration/partials/wizard/WatermarkPage.tsx
+++ b/src/components/configuration/partials/wizard/WatermarkPage.tsx
@@ -14,6 +14,7 @@ interface RequiredFormProps {
watermarkActive: boolean,
watermarkFile: string,
watermarkPosition: string,
+ [key: string]: unknown,
}
const WatermarkPage = ({
diff --git a/app/src/components/events/Events.tsx b/src/components/events/Events.tsx
similarity index 97%
rename from app/src/components/events/Events.tsx
rename to src/components/events/Events.tsx
index 4293543fe3..2d9d60b00a 100644
--- a/app/src/components/events/Events.tsx
+++ b/src/components/events/Events.tsx
@@ -31,7 +31,7 @@ import Header from "../Header";
import Footer from "../Footer";
import { getUserInformation } from "../../selectors/userInfoSelectors";
import { hasAccess } from "../../utils/utils";
-import { GlobalHotKeys } from "react-hotkeys";
+import { useHotkeys } from "react-hotkeys-hook";
import { availableHotkeys } from "../../configs/hotkeysConfig";
import { getCurrentFilterResource } from "../../selectors/tableFilterSelectors";
import { fetchAssetUploadOptions } from "../../thunks/assetsThunks";
@@ -186,17 +186,17 @@ const Events = ({
setEditMetadataEventsModal(false);
};
- const hotKeyHandlers = {
- NEW_EVENT: showNewEventModal,
- };
+ useHotkeys(
+ availableHotkeys.general.NEW_EVENT.sequence,
+ () => showNewEventModal(),
+ {
+ description: t(availableHotkeys.general.NEW_EVENT.description) ?? undefined
+ },
+ [showNewEventModal]
+ );
return (
<>
-
diff --git a/app/src/components/events/Series.tsx b/src/components/events/Series.tsx
similarity index 97%
rename from app/src/components/events/Series.tsx
rename to src/components/events/Series.tsx
index bdadb37390..58149d934c 100644
--- a/app/src/components/events/Series.tsx
+++ b/src/components/events/Series.tsx
@@ -24,8 +24,8 @@ import Footer from "../Footer";
import { getUserInformation } from "../../selectors/userInfoSelectors";
import { hasAccess } from "../../utils/utils";
import { availableHotkeys } from "../../configs/hotkeysConfig";
-import { GlobalHotKeys } from "react-hotkeys";
import { getCurrentFilterResource } from "../../selectors/tableFilterSelectors";
+import { useHotkeys } from "react-hotkeys-hook";
import { useAppDispatch, useAppSelector } from "../../store";
import { fetchEvents } from "../../slices/eventSlice";
import {
@@ -158,17 +158,15 @@ const Series = ({
setDeleteSeriesModal(false);
};
- const hotKeyHandlers = {
- NEW_SERIES: showNewSeriesModal,
- };
+ useHotkeys(
+ availableHotkeys.general.NEW_SERIES.sequence,
+ () => showNewSeriesModal(),
+ { description: t(availableHotkeys.general.NEW_SERIES.description) ?? undefined },
+ [showNewSeriesModal]
+ );
return (
<>
-
diff --git a/app/src/components/events/partials/EventActionCell.tsx b/src/components/events/partials/EventActionCell.tsx
similarity index 100%
rename from app/src/components/events/partials/EventActionCell.tsx
rename to src/components/events/partials/EventActionCell.tsx
diff --git a/app/src/components/events/partials/EventsDateCell.tsx b/src/components/events/partials/EventsDateCell.tsx
similarity index 100%
rename from app/src/components/events/partials/EventsDateCell.tsx
rename to src/components/events/partials/EventsDateCell.tsx
diff --git a/app/src/components/events/partials/EventsEndCell.tsx b/src/components/events/partials/EventsEndCell.tsx
similarity index 100%
rename from app/src/components/events/partials/EventsEndCell.tsx
rename to src/components/events/partials/EventsEndCell.tsx
diff --git a/app/src/components/events/partials/EventsLocationCell.tsx b/src/components/events/partials/EventsLocationCell.tsx
similarity index 100%
rename from app/src/components/events/partials/EventsLocationCell.tsx
rename to src/components/events/partials/EventsLocationCell.tsx
diff --git a/app/src/components/events/partials/EventsNotesCell.tsx b/src/components/events/partials/EventsNotesCell.tsx
similarity index 100%
rename from app/src/components/events/partials/EventsNotesCell.tsx
rename to src/components/events/partials/EventsNotesCell.tsx
diff --git a/app/src/components/events/partials/EventsPresentersCell.tsx b/src/components/events/partials/EventsPresentersCell.tsx
similarity index 100%
rename from app/src/components/events/partials/EventsPresentersCell.tsx
rename to src/components/events/partials/EventsPresentersCell.tsx
diff --git a/app/src/components/events/partials/EventsSeriesCell.tsx b/src/components/events/partials/EventsSeriesCell.tsx
similarity index 100%
rename from app/src/components/events/partials/EventsSeriesCell.tsx
rename to src/components/events/partials/EventsSeriesCell.tsx
diff --git a/app/src/components/events/partials/EventsStartCell.tsx b/src/components/events/partials/EventsStartCell.tsx
similarity index 100%
rename from app/src/components/events/partials/EventsStartCell.tsx
rename to src/components/events/partials/EventsStartCell.tsx
diff --git a/app/src/components/events/partials/EventsStatusCell.tsx b/src/components/events/partials/EventsStatusCell.tsx
similarity index 100%
rename from app/src/components/events/partials/EventsStatusCell.tsx
rename to src/components/events/partials/EventsStatusCell.tsx
diff --git a/app/src/components/events/partials/EventsTechnicalDateCell.tsx b/src/components/events/partials/EventsTechnicalDateCell.tsx
similarity index 100%
rename from app/src/components/events/partials/EventsTechnicalDateCell.tsx
rename to src/components/events/partials/EventsTechnicalDateCell.tsx
diff --git a/app/src/components/events/partials/ModalTabsAndPages/DetailsExtendedMetadataTab.tsx b/src/components/events/partials/ModalTabsAndPages/DetailsExtendedMetadataTab.tsx
similarity index 100%
rename from app/src/components/events/partials/ModalTabsAndPages/DetailsExtendedMetadataTab.tsx
rename to src/components/events/partials/ModalTabsAndPages/DetailsExtendedMetadataTab.tsx
diff --git a/app/src/components/events/partials/ModalTabsAndPages/DetailsMetadataTab.tsx b/src/components/events/partials/ModalTabsAndPages/DetailsMetadataTab.tsx
similarity index 100%
rename from app/src/components/events/partials/ModalTabsAndPages/DetailsMetadataTab.tsx
rename to src/components/events/partials/ModalTabsAndPages/DetailsMetadataTab.tsx
diff --git a/app/src/components/events/partials/ModalTabsAndPages/EditScheduledEventsEditPage.tsx b/src/components/events/partials/ModalTabsAndPages/EditScheduledEventsEditPage.tsx
similarity index 100%
rename from app/src/components/events/partials/ModalTabsAndPages/EditScheduledEventsEditPage.tsx
rename to src/components/events/partials/ModalTabsAndPages/EditScheduledEventsEditPage.tsx
diff --git a/app/src/components/events/partials/ModalTabsAndPages/EditScheduledEventsGeneralPage.tsx b/src/components/events/partials/ModalTabsAndPages/EditScheduledEventsGeneralPage.tsx
similarity index 100%
rename from app/src/components/events/partials/ModalTabsAndPages/EditScheduledEventsGeneralPage.tsx
rename to src/components/events/partials/ModalTabsAndPages/EditScheduledEventsGeneralPage.tsx
diff --git a/app/src/components/events/partials/ModalTabsAndPages/EditScheduledEventsSummaryPage.tsx b/src/components/events/partials/ModalTabsAndPages/EditScheduledEventsSummaryPage.tsx
similarity index 100%
rename from app/src/components/events/partials/ModalTabsAndPages/EditScheduledEventsSummaryPage.tsx
rename to src/components/events/partials/ModalTabsAndPages/EditScheduledEventsSummaryPage.tsx
diff --git a/app/src/components/events/partials/ModalTabsAndPages/EventDetailsAccessPolicyTab.tsx b/src/components/events/partials/ModalTabsAndPages/EventDetailsAccessPolicyTab.tsx
similarity index 100%
rename from app/src/components/events/partials/ModalTabsAndPages/EventDetailsAccessPolicyTab.tsx
rename to src/components/events/partials/ModalTabsAndPages/EventDetailsAccessPolicyTab.tsx
diff --git a/app/src/components/events/partials/ModalTabsAndPages/EventDetailsAssetAttachmentDetails.tsx b/src/components/events/partials/ModalTabsAndPages/EventDetailsAssetAttachmentDetails.tsx
similarity index 100%
rename from app/src/components/events/partials/ModalTabsAndPages/EventDetailsAssetAttachmentDetails.tsx
rename to src/components/events/partials/ModalTabsAndPages/EventDetailsAssetAttachmentDetails.tsx
diff --git a/app/src/components/events/partials/ModalTabsAndPages/EventDetailsAssetAttachments.tsx b/src/components/events/partials/ModalTabsAndPages/EventDetailsAssetAttachments.tsx
similarity index 100%
rename from app/src/components/events/partials/ModalTabsAndPages/EventDetailsAssetAttachments.tsx
rename to src/components/events/partials/ModalTabsAndPages/EventDetailsAssetAttachments.tsx
diff --git a/app/src/components/events/partials/ModalTabsAndPages/EventDetailsAssetCatalogDetails.tsx b/src/components/events/partials/ModalTabsAndPages/EventDetailsAssetCatalogDetails.tsx
similarity index 100%
rename from app/src/components/events/partials/ModalTabsAndPages/EventDetailsAssetCatalogDetails.tsx
rename to src/components/events/partials/ModalTabsAndPages/EventDetailsAssetCatalogDetails.tsx
diff --git a/app/src/components/events/partials/ModalTabsAndPages/EventDetailsAssetCatalogs.tsx b/src/components/events/partials/ModalTabsAndPages/EventDetailsAssetCatalogs.tsx
similarity index 100%
rename from app/src/components/events/partials/ModalTabsAndPages/EventDetailsAssetCatalogs.tsx
rename to src/components/events/partials/ModalTabsAndPages/EventDetailsAssetCatalogs.tsx
diff --git a/app/src/components/events/partials/ModalTabsAndPages/EventDetailsAssetMedia.tsx b/src/components/events/partials/ModalTabsAndPages/EventDetailsAssetMedia.tsx
similarity index 100%
rename from app/src/components/events/partials/ModalTabsAndPages/EventDetailsAssetMedia.tsx
rename to src/components/events/partials/ModalTabsAndPages/EventDetailsAssetMedia.tsx
diff --git a/app/src/components/events/partials/ModalTabsAndPages/EventDetailsAssetMediaDetails.tsx b/src/components/events/partials/ModalTabsAndPages/EventDetailsAssetMediaDetails.tsx
similarity index 100%
rename from app/src/components/events/partials/ModalTabsAndPages/EventDetailsAssetMediaDetails.tsx
rename to src/components/events/partials/ModalTabsAndPages/EventDetailsAssetMediaDetails.tsx
diff --git a/app/src/components/events/partials/ModalTabsAndPages/EventDetailsAssetPublicationDetails.tsx b/src/components/events/partials/ModalTabsAndPages/EventDetailsAssetPublicationDetails.tsx
similarity index 100%
rename from app/src/components/events/partials/ModalTabsAndPages/EventDetailsAssetPublicationDetails.tsx
rename to src/components/events/partials/ModalTabsAndPages/EventDetailsAssetPublicationDetails.tsx
diff --git a/app/src/components/events/partials/ModalTabsAndPages/EventDetailsAssetPublications.tsx b/src/components/events/partials/ModalTabsAndPages/EventDetailsAssetPublications.tsx
similarity index 100%
rename from app/src/components/events/partials/ModalTabsAndPages/EventDetailsAssetPublications.tsx
rename to src/components/events/partials/ModalTabsAndPages/EventDetailsAssetPublications.tsx
diff --git a/app/src/components/events/partials/ModalTabsAndPages/EventDetailsAssetsAddAsset.tsx b/src/components/events/partials/ModalTabsAndPages/EventDetailsAssetsAddAsset.tsx
similarity index 100%
rename from app/src/components/events/partials/ModalTabsAndPages/EventDetailsAssetsAddAsset.tsx
rename to src/components/events/partials/ModalTabsAndPages/EventDetailsAssetsAddAsset.tsx
diff --git a/app/src/components/events/partials/ModalTabsAndPages/EventDetailsAssetsTab.tsx b/src/components/events/partials/ModalTabsAndPages/EventDetailsAssetsTab.tsx
similarity index 100%
rename from app/src/components/events/partials/ModalTabsAndPages/EventDetailsAssetsTab.tsx
rename to src/components/events/partials/ModalTabsAndPages/EventDetailsAssetsTab.tsx
diff --git a/app/src/components/events/partials/ModalTabsAndPages/EventDetailsCommentsTab.tsx b/src/components/events/partials/ModalTabsAndPages/EventDetailsCommentsTab.tsx
similarity index 100%
rename from app/src/components/events/partials/ModalTabsAndPages/EventDetailsCommentsTab.tsx
rename to src/components/events/partials/ModalTabsAndPages/EventDetailsCommentsTab.tsx
diff --git a/app/src/components/events/partials/ModalTabsAndPages/EventDetailsPublicationTab.tsx b/src/components/events/partials/ModalTabsAndPages/EventDetailsPublicationTab.tsx
similarity index 100%
rename from app/src/components/events/partials/ModalTabsAndPages/EventDetailsPublicationTab.tsx
rename to src/components/events/partials/ModalTabsAndPages/EventDetailsPublicationTab.tsx
diff --git a/app/src/components/events/partials/ModalTabsAndPages/EventDetailsSchedulingTab.tsx b/src/components/events/partials/ModalTabsAndPages/EventDetailsSchedulingTab.tsx
similarity index 100%
rename from app/src/components/events/partials/ModalTabsAndPages/EventDetailsSchedulingTab.tsx
rename to src/components/events/partials/ModalTabsAndPages/EventDetailsSchedulingTab.tsx
diff --git a/app/src/components/events/partials/ModalTabsAndPages/EventDetailsStatisticsTab.tsx b/src/components/events/partials/ModalTabsAndPages/EventDetailsStatisticsTab.tsx
similarity index 100%
rename from app/src/components/events/partials/ModalTabsAndPages/EventDetailsStatisticsTab.tsx
rename to src/components/events/partials/ModalTabsAndPages/EventDetailsStatisticsTab.tsx
diff --git a/app/src/components/events/partials/ModalTabsAndPages/EventDetailsTabHierarchyNavigation.tsx b/src/components/events/partials/ModalTabsAndPages/EventDetailsTabHierarchyNavigation.tsx
similarity index 100%
rename from app/src/components/events/partials/ModalTabsAndPages/EventDetailsTabHierarchyNavigation.tsx
rename to src/components/events/partials/ModalTabsAndPages/EventDetailsTabHierarchyNavigation.tsx
diff --git a/app/src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowDetails.tsx b/src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowDetails.tsx
similarity index 100%
rename from app/src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowDetails.tsx
rename to src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowDetails.tsx
diff --git a/app/src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowErrorDetails.tsx b/src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowErrorDetails.tsx
similarity index 100%
rename from app/src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowErrorDetails.tsx
rename to src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowErrorDetails.tsx
diff --git a/app/src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowErrors.tsx b/src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowErrors.tsx
similarity index 100%
rename from app/src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowErrors.tsx
rename to src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowErrors.tsx
diff --git a/app/src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowOperationDetails.tsx b/src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowOperationDetails.tsx
similarity index 100%
rename from app/src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowOperationDetails.tsx
rename to src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowOperationDetails.tsx
diff --git a/app/src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowOperations.tsx b/src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowOperations.tsx
similarity index 100%
rename from app/src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowOperations.tsx
rename to src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowOperations.tsx
diff --git a/app/src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowTab.tsx b/src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowTab.tsx
similarity index 100%
rename from app/src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowTab.tsx
rename to src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowTab.tsx
diff --git a/app/src/components/events/partials/ModalTabsAndPages/NewAccessPage.tsx b/src/components/events/partials/ModalTabsAndPages/NewAccessPage.tsx
similarity index 100%
rename from app/src/components/events/partials/ModalTabsAndPages/NewAccessPage.tsx
rename to src/components/events/partials/ModalTabsAndPages/NewAccessPage.tsx
diff --git a/app/src/components/events/partials/ModalTabsAndPages/NewAssetUploadPage.tsx b/src/components/events/partials/ModalTabsAndPages/NewAssetUploadPage.tsx
similarity index 85%
rename from app/src/components/events/partials/ModalTabsAndPages/NewAssetUploadPage.tsx
rename to src/components/events/partials/ModalTabsAndPages/NewAssetUploadPage.tsx
index 7387e93e5b..58f1c9dcb7 100644
--- a/app/src/components/events/partials/ModalTabsAndPages/NewAssetUploadPage.tsx
+++ b/src/components/events/partials/ModalTabsAndPages/NewAssetUploadPage.tsx
@@ -4,18 +4,25 @@ import WizardNavigationButtons from "../../../shared/wizard/WizardNavigationButt
import { getAssetUploadOptions } from "../../../../selectors/eventSelectors";
import { translateOverrideFallback } from "../../../../utils/utils";
import { useAppSelector } from "../../../../store";
+import { FormikProps } from "formik";
/**
* This component renders the asset upload page of the new event wizard
* (only if its not set hidden (see newEventWizardConfig) or user chose UPLOAD as source mode)
*/
-const NewAssetUploadPage = ({
-// @ts-expect-error TS(7031): Binding element 'previousPage' implicitly has an '... Remove this comment to see the full error message
- previousPage,
-// @ts-expect-error TS(7031): Binding element 'nextPage' implicitly has an 'any'... Remove this comment to see the full error message
- nextPage,
-// @ts-expect-error TS(7031): Binding element 'formik' implicitly has an 'any' t... Remove this comment to see the full error message
+interface RequiredFormProps {
+ sourceMode: string,
+ [key: string]: any,
+}
+
+const NewAssetUploadPage = ({
formik,
+ nextPage,
+ previousPage
+}: {
+ formik: FormikProps,
+ nextPage: (values: T) => void,
+ previousPage: (values: T, twoPagesBack?: boolean) => void,
}) => {
const { t } = useTranslation();
@@ -91,8 +98,7 @@ const NewAssetUploadPage = ({
className="button-like-anchor remove"
onClick={() => {
formik.setFieldValue(asset.id, null);
-// @ts-expect-error TS(2531): Object is possibly 'null'.
- document.getElementById(asset.id).value = "";
+ (document.getElementById(asset.id) as HTMLInputElement).value = "";
}}
/>
diff --git a/app/src/components/events/partials/ModalTabsAndPages/NewMetadataExtendedPage.tsx b/src/components/events/partials/ModalTabsAndPages/NewMetadataExtendedPage.tsx
similarity index 81%
rename from app/src/components/events/partials/ModalTabsAndPages/NewMetadataExtendedPage.tsx
rename to src/components/events/partials/ModalTabsAndPages/NewMetadataExtendedPage.tsx
index 00dc2a0b71..6d2dcff296 100644
--- a/app/src/components/events/partials/ModalTabsAndPages/NewMetadataExtendedPage.tsx
+++ b/src/components/events/partials/ModalTabsAndPages/NewMetadataExtendedPage.tsx
@@ -1,21 +1,23 @@
import React from "react";
import { useTranslation } from "react-i18next";
-import { Field } from "formik";
+import { Field, FormikProps } from "formik";
import RenderMultiField from "../../../shared/wizard/RenderMultiField";
import RenderField from "../../../shared/wizard/RenderField";
import WizardNavigationButtons from "../../../shared/wizard/WizardNavigationButtons";
import { isJson } from "../../../../utils/utils";
import { getMetadataCollectionFieldName } from "../../../../utils/resourceUtils";
+import { MetadataCatalog } from "../../../../slices/eventSlice";
-const NewMetadataExtendedPage = ({
-// @ts-expect-error TS(7031): Binding element 'previousPage' implicitly has an '... Remove this comment to see the full error message
- previousPage,
-// @ts-expect-error TS(7031): Binding element 'nextPage' implicitly has an 'any'... Remove this comment to see the full error message
- nextPage,
-// @ts-expect-error TS(7031): Binding element 'formik' implicitly has an 'any' t... Remove this comment to see the full error message
+const NewMetadataExtendedPage = ({
formik,
-// @ts-expect-error TS(7031): Binding element 'extendedMetadataFields' implicitl... Remove this comment to see the full error message
+ nextPage,
+ previousPage,
extendedMetadataFields,
+}: {
+ formik: FormikProps,
+ nextPage: (values: T) => void,
+ previousPage: (values: T, twoPagesBack?: boolean) => void,
+ extendedMetadataFields?: MetadataCatalog[],
}) => {
const { t } = useTranslation();
@@ -28,7 +30,6 @@ const NewMetadataExtendedPage = ({
//iterate through metadata catalogs
!!extendedMetadataFields &&
extendedMetadataFields.length > 0 &&
-// @ts-expect-error TS(7006): Parameter 'catalog' implicitly has an 'any' type.
extendedMetadataFields.map((catalog, index) => (
{formik.values.repeatOn
-// @ts-expect-error TS(7006): Parameter 'day' implicitly has an 'any' type.
.map((day) =>
t("EVENTS.EVENTS.NEW.WEEKDAYSLONG." + day)
)
diff --git a/app/src/components/events/partials/wizards/NewEventWizard.tsx b/src/components/events/partials/wizards/NewEventWizard.tsx
similarity index 63%
rename from app/src/components/events/partials/wizards/NewEventWizard.tsx
rename to src/components/events/partials/wizards/NewEventWizard.tsx
index b77cf47c65..5cd23e4847 100644
--- a/app/src/components/events/partials/wizards/NewEventWizard.tsx
+++ b/src/components/events/partials/wizards/NewEventWizard.tsx
@@ -18,8 +18,9 @@ import {
getExtendedEventMetadata,
} from "../../../../selectors/eventSelectors";
import { useAppDispatch, useAppSelector } from "../../../../store";
-import { postNewEvent } from "../../../../slices/eventSlice";
+import { MetadataCatalog, UploadAssetOption, postNewEvent } from "../../../../slices/eventSlice";
import { getUserInformation } from "../../../../selectors/userInfoSelectors";
+import { UserInfoState } from "../../../../slices/userInfoSlice";
/**
* This component manages the pages of the new event wizard and the submission of values
@@ -42,7 +43,6 @@ const NewEventWizard: React.FC<{
uploadAssetOptions,
user
);
- let workflowPanelRef = React.useRef();
const [page, setPage] = useState(0);
const [snapshot, setSnapshot] = useState(initialValues);
@@ -92,8 +92,7 @@ const NewEventWizard: React.FC<{
// Validation schema of current page
const currentValidationSchema = NewEventSchema[page];
-// @ts-expect-error TS(7006): Parameter 'values' implicitly has an 'any' type.
- const nextPage = (values) => {
+ const nextPage = (values: typeof initialValues) => {
setSnapshot(values);
// set page as completely filled out
@@ -108,8 +107,7 @@ const NewEventWizard: React.FC<{
}
};
-// @ts-expect-error TS(7006): Parameter 'values' implicitly has an 'any' type.
- const previousPage = (values, twoPagesBack) => {
+ const previousPage = (values: typeof initialValues, twoPagesBack?: boolean) => {
setSnapshot(values);
// if previous page is hidden or not always shown, than go back two pages
if (steps[page - 1].hidden || twoPagesBack) {
@@ -119,10 +117,7 @@ const NewEventWizard: React.FC<{
}
};
-// @ts-expect-error TS(7006): Parameter 'values' implicitly has an 'any' type.
- const handleSubmit = (values) => {
-// @ts-expect-error TS(2339): Property 'submitForm' does not exist on type 'neve... Remove this comment to see the full error message
- workflowPanelRef.current?.submitForm();
+ const handleSubmit = (values: typeof initialValues) => {
const response = dispatch(postNewEvent({values, metadataInfo: metadataFields, extendedMetadata}));
console.info(response);
close();
@@ -189,8 +184,6 @@ const NewEventWizard: React.FC<{
)}
@@ -221,90 +214,64 @@ const NewEventWizard: React.FC<{
// Transform all initial values needed from information provided by backend
const getInitialValues = (
-// @ts-expect-error TS(7006): Parameter 'metadataFields' implicitly has an 'any'... Remove this comment to see the full error message
- metadataFields,
-// @ts-expect-error TS(7006): Parameter 'extendedMetadata' implicitly has an 'an... Remove this comment to see the full error message
- extendedMetadata,
-// @ts-expect-error TS(7006): Parameter 'uploadAssetOptions' implicitly has an '... Remove this comment to see the full error message
- uploadAssetOptions,
-// @ts-expect-error TS(7006): Parameter 'uploadAssetOptions' implicitly has an '... Remove this comment to see the full error message
- user
+ metadataFields: MetadataCatalog,
+ extendedMetadata: MetadataCatalog[],
+ uploadAssetOptions: UploadAssetOption[],
+ user: UserInfoState
) => {
+ let initialValues = initialFormValuesNewEvents;
+
// Transform metadata fields provided by backend (saved in redux)
- let initialValues = getInitialMetadataFieldValues(
+ initialValues = {...initialValues, ...getInitialMetadataFieldValues(
metadataFields,
extendedMetadata
- );
+ )};
// Transform additional metadata for source (provided by constant in newEventConfig)
if (!!sourceMetadata.UPLOAD) {
sourceMetadata.UPLOAD.metadata.forEach((field) => {
-// @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
initialValues[field.id] = field.value;
});
}
-// @ts-expect-error TS(2339): Property 'SINGLE_SCHEDULE' does not exist on type ... Remove this comment to see the full error message
- if (!!sourceMetadata.SINGLE_SCHEDULE) {
-// @ts-expect-error TS(2339): Property 'SINGLE_SCHEDULE' does not exist on type ... Remove this comment to see the full error message
- sourceMetadata.SINGLE_SCHEDULE.metadata.forEach((field) => {
-// @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
+ if (!!sourceMetadata.SCHEDULE_SINGLE) {
+ sourceMetadata.SCHEDULE_SINGLE.metadata.forEach((field) => {
initialValues[field.id] = field.value;
});
}
-// @ts-expect-error TS(2339): Property 'MULTIPLE_SCHEDULE' does not exist on typ... Remove this comment to see the full error message
- if (!!sourceMetadata.MULTIPLE_SCHEDULE) {
-// @ts-expect-error TS(2339): Property 'MULTIPLE_SCHEDULE' does not exist on typ... Remove this comment to see the full error message
- sourceMetadata.MULTIPLE_SCHEDULE.metadata.forEach((field) => {
-// @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
+ if (!!sourceMetadata.SCHEDULE_MULTIPLE) {
+ sourceMetadata.SCHEDULE_MULTIPLE.metadata.forEach((field) => {
initialValues[field.id] = field.value;
});
}
// Add possible files that can be uploaded in source step
if (!!uploadAssetOptions) {
-// @ts-expect-error TS(2339): Property 'uploadAssetsTrack' does not exist on typ... Remove this comment to see the full error message
initialValues.uploadAssetsTrack = [];
// Sort by displayOrder
uploadAssetOptions = uploadAssetOptions.slice().sort((a: any, b: any) => a.displayOrder - b.displayOrder)
// initial value of upload asset needs to be null, because object (file) is saved there
-// @ts-expect-error TS(7006): Parameter 'option' implicitly has an 'any' type.
- uploadAssetOptions.forEach((option) => {
+ for (const option of uploadAssetOptions) {
if (option.type === "track") {
-// @ts-expect-error TS(2339): Property 'uploadAssetsTrack' does not exist on typ... Remove this comment to see the full error message
initialValues.uploadAssetsTrack.push({
...option,
- file: null,
+ file: undefined,
});
} else {
-// @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
initialValues[option.id] = null;
}
- });
- }
-
- // Add all initial form values known upfront listed in newEventsConfig
- for (const [key, value] of Object.entries(initialFormValuesNewEvents)) {
-// @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
- initialValues[key] = value;
+ };
}
const defaultDate = new Date();
// fill times with some default values
-// @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
initialValues["scheduleStartHour"] = (defaultDate.getHours() + 1).toString();
-// @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
initialValues["scheduleStartMinute"] = "00";
-// @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
initialValues["scheduleDurationHours"] = "00";
-// @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
initialValues["scheduleDurationMinutes"] = "55";
-// @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
initialValues["scheduleEndHour"] = (defaultDate.getHours() + 1).toString();
-// @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
initialValues["scheduleEndMinute"] = "55";
-// @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
initialValues["acls"] = [
{
role: user.userRole,
diff --git a/app/src/components/events/partials/wizards/NewSeriesSummary.tsx b/src/components/events/partials/wizards/NewSeriesSummary.tsx
similarity index 85%
rename from app/src/components/events/partials/wizards/NewSeriesSummary.tsx
rename to src/components/events/partials/wizards/NewSeriesSummary.tsx
index 73495388c7..4b3656230c 100644
--- a/app/src/components/events/partials/wizards/NewSeriesSummary.tsx
+++ b/src/components/events/partials/wizards/NewSeriesSummary.tsx
@@ -10,17 +10,25 @@ import MetadataExtendedSummaryTable from "./summaryTables/MetadataExtendedSummar
import AccessSummaryTable from "./summaryTables/AccessSummaryTable";
import WizardNavigationButtons from "../../../shared/wizard/WizardNavigationButtons";
import { useAppSelector } from "../../../../store";
+import { FormikProps } from "formik";
+import { TransformedAcl } from "../../../../slices/aclDetailsSlice";
/**
* This component renders the summary page for new series in the new series wizard.
*/
-const NewSeriesSummary = ({
-// @ts-expect-error TS(7031): Binding element 'formik' implicitly has an 'any' t... Remove this comment to see the full error message
+interface RequiredFormProps {
+ theme: string,
+ acls: TransformedAcl[],
+}
+
+const NewSeriesSummary = ({
formik,
-// @ts-expect-error TS(7031): Binding element 'previousPage' implicitly has an '... Remove this comment to see the full error message
previousPage,
-// @ts-expect-error TS(7031): Binding element 'metaDataExtendedHidden' implicitl... Remove this comment to see the full error message
metaDataExtendedHidden,
+}: {
+ formik: FormikProps,
+ previousPage: (values: T, twoPagesBack?: boolean) => void,
+ metaDataExtendedHidden: boolean,
}) => {
const { t } = useTranslation();
diff --git a/app/src/components/events/partials/wizards/NewSeriesWizard.tsx b/src/components/events/partials/wizards/NewSeriesWizard.tsx
similarity index 80%
rename from app/src/components/events/partials/wizards/NewSeriesWizard.tsx
rename to src/components/events/partials/wizards/NewSeriesWizard.tsx
index 02185dd387..3ca7dfa04b 100644
--- a/app/src/components/events/partials/wizards/NewSeriesWizard.tsx
+++ b/src/components/events/partials/wizards/NewSeriesWizard.tsx
@@ -16,6 +16,9 @@ import { getInitialMetadataFieldValues } from "../../../../utils/resourceUtils";
import { useAppDispatch, useAppSelector } from "../../../../store";
import { postNewSeries } from "../../../../slices/seriesSlice";
import { getUserInformation } from "../../../../selectors/userInfoSelectors";
+import { MetadataCatalog } from "../../../../slices/eventSlice";
+import { UserInfoState } from "../../../../slices/userInfoSlice";
+import { TransformedAcl } from "../../../../slices/aclDetailsSlice";
/**
* This component manages the pages of the new series wizard and the submission of values
@@ -35,7 +38,7 @@ const NewSeriesWizard: React.FC<{
const [page, setPage] = useState(0);
const [snapshot, setSnapshot] = useState(initialValues);
- const [pageCompleted, setPageCompleted] = useState({});
+ const [pageCompleted, setPageCompleted] = useState<{ [key: number]: boolean }>({});
// Caption of steps used by Stepper
const steps = [
@@ -69,13 +72,17 @@ const NewSeriesWizard: React.FC<{
// Validation schema of current page
const currentValidationSchema = NewSeriesSchema[page];
-// @ts-expect-error TS(7006): Parameter 'values' implicitly has an 'any' type.
- const nextPage = (values) => {
+ const nextPage = (
+ values: {
+ [key: string]: any;
+ acls: TransformedAcl[];
+ theme: string;
+ }
+ ) => {
setSnapshot(values);
// set page as completely filled out
let updatedPageCompleted = pageCompleted;
-// @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
updatedPageCompleted[page] = true;
setPageCompleted(updatedPageCompleted);
@@ -86,8 +93,14 @@ const NewSeriesWizard: React.FC<{
}
};
-// @ts-expect-error TS(7006): Parameter 'values' implicitly has an 'any' type.
- const previousPage = (values, twoPagesBack) => {
+ const previousPage = (
+ values: {
+ [key: string]: any;
+ acls: TransformedAcl[];
+ theme: string;
+ },
+ twoPagesBack?: boolean
+ ) => {
setSnapshot(values);
// if previous page is hidden or not always shown, then go back two pages
if (steps[page - 1].hidden || twoPagesBack) {
@@ -97,8 +110,14 @@ const NewSeriesWizard: React.FC<{
}
};
-// @ts-expect-error TS(7006): Parameter 'values' implicitly has an 'any' type.
- const handleSubmit = (values) => {
+ const handleSubmit = (
+ values:
+ {
+ [key: string]: any;
+ acls: TransformedAcl[];
+ theme: string;
+ }
+ ) => {
const response = dispatch(postNewSeries({values, metadataInfo: metadataFields, extendedMetadata}));
console.info(response);
close();
@@ -180,21 +199,18 @@ const NewSeriesWizard: React.FC<{
);
};
-// @ts-expect-error TS(7006): Parameter 'metadataFields' implicitly has an 'any'... Remove this comment to see the full error message
-const getInitialValues = (metadataFields, extendedMetadata, user) => {
+const getInitialValues = (
+ metadataFields: MetadataCatalog,
+ extendedMetadata: MetadataCatalog[],
+ user: UserInfoState
+) => {
+ let initialValues = initialFormValuesNewSeries;
// Transform metadata fields provided by backend (saved in redux)
- let initialValues = getInitialMetadataFieldValues(
+ initialValues = {...initialValues, ...getInitialMetadataFieldValues(
metadataFields,
extendedMetadata
- );
-
- // Add all initial form values known upfront listed in newSeriesConfig
- for (const [key, value] of Object.entries(initialFormValuesNewSeries)) {
-// @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
- initialValues[key] = value;
- }
+ )};
-// @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
initialValues["acls"] = [
{
role: user.userRole,
diff --git a/app/src/components/events/partials/wizards/RenderWorkflowConfig.tsx b/src/components/events/partials/wizards/RenderWorkflowConfig.tsx
similarity index 74%
rename from app/src/components/events/partials/wizards/RenderWorkflowConfig.tsx
rename to src/components/events/partials/wizards/RenderWorkflowConfig.tsx
index 98595f7bbf..7431cf6941 100644
--- a/app/src/components/events/partials/wizards/RenderWorkflowConfig.tsx
+++ b/src/components/events/partials/wizards/RenderWorkflowConfig.tsx
@@ -1,6 +1,6 @@
import React from "react";
import { v4 as uuidv4 } from "uuid";
-import { Field } from "formik";
+import { Field, FormikProps } from "formik";
import {
getWorkflowDefById,
} from "../../../../selectors/workflowSelectors";
@@ -10,14 +10,18 @@ import { useAppSelector } from "../../../../store";
* This component renders the configuration panel for the selected workflow in the processing step of the new event
* wizard chosen via dropdown.
*/
-const RenderWorkflowConfig: React.FC<{
- workflowId: string
- formik: any //TODO: Add type
- displayDescription?: any
-}> = ({
+interface RequiredFormProps {
+ configuration?: { [key: string]: any }
+}
+
+const RenderWorkflowConfig = ({
workflowId,
formik,
displayDescription
+}: {
+ workflowId: string
+ formik: FormikProps
+ displayDescription?: boolean
}) => {
const workflowDef = useAppSelector(state => getWorkflowDefById(state, workflowId));
@@ -82,8 +86,11 @@ const RenderWorkflowConfig: React.FC<{
};
// render input depending on field type
-// @ts-expect-error TS(7006): Parameter 'field' implicitly has an 'any' type.
-const renderInputByType = (field, key, formik) => {
+const renderInputByType = (
+ field: any,
+ key: React.Key | null | undefined,
+ formik: FormikProps,
+) => {
switch (field.type) {
case "checkbox":
return ;
@@ -100,26 +107,25 @@ const renderInputByType = (field, key, formik) => {
}
};
-// @ts-expect-error TS(7031): Binding element 'field' implicitly has an 'any' ty... Remove this comment to see the full error message
-const RenderDatetimeLocal = ({ field, formik }) => {
+const RenderDatetimeLocal = (
+ { field, formik } : { field: any, formik: FormikProps }) => {
return ;
};
-// @ts-expect-error TS(7031): Binding element 'field' implicitly has an 'any' ty... Remove this comment to see the full error message
-const RenderCheckbox = ({ field, formik }) => {
+const RenderCheckbox = (
+ { field, formik } : { field: any, formik: FormikProps }) => {
return ;
};
-// @ts-expect-error TS(7031): Binding element 'field' implicitly has an 'any' ty... Remove this comment to see the full error message
-const RenderRadio = ({ field, formik }) => {
+const RenderRadio = (
+ { field, formik } : { field: any, formik: FormikProps }) => {
return ;
};
-// @ts-expect-error TS(7031): Binding element 'field' implicitly has an 'any' ty... Remove this comment to see the full error message
-const RenderNumber = ({ field, formik }) => {
+const RenderNumber = (
+ { field, formik } : { field: any, formik: FormikProps }) => {
// validate that value of number is between max and min
-// @ts-expect-error TS(7006): Parameter 'value' implicitly has an 'any' type.
- const validate = (value) => {
+ const validate = (value: string) => {
let error;
if (parseInt(value) > field.max || parseInt(value) < field.min) {
error = "out of range";
@@ -130,19 +136,24 @@ const RenderNumber = ({ field, formik }) => {
return ;
};
-// @ts-expect-error TS(7031): Binding element 'field' implicitly has an 'any' ty... Remove this comment to see the full error message
-const RenderText = ({ field, formik }) => {
+const RenderText = ({
+ field,
+ formik
+}: {
+ field: any,
+ formik: FormikProps,
+}) => {
return ;
};
-const RenderField : React.FC<{
- field: any,
- formik: any,
- validate?: (value: any) => string | undefined,
-}> = ({
+const RenderField = ({
field,
formik,
validate = undefined
+}: {
+ field: any,
+ formik: FormikProps,
+ validate?: (value: any) => string | undefined,
}) => {
// id used for Field and label
const uuid = uuidv4();
@@ -170,7 +181,7 @@ const RenderField : React.FC<{
{/* if input has an additional fieldset or further configuration inputs
then render again by input type*/}
- {!!field.fieldset && !!formik.values.configuration[field.name] && (
+ {!!field.fieldset && !!formik.values.configuration && !!formik.values.configuration[field.name] && (
{/* @ts-expect-error TS(7006): Parameter 'f' implicitly has an 'any' type. */}
{field.fieldset?.map((f, keys) => renderInputByType(f, keys, formik))}
diff --git a/app/src/components/events/partials/wizards/summaryTables/AccessSummaryTable.tsx b/src/components/events/partials/wizards/summaryTables/AccessSummaryTable.tsx
similarity index 100%
rename from app/src/components/events/partials/wizards/summaryTables/AccessSummaryTable.tsx
rename to src/components/events/partials/wizards/summaryTables/AccessSummaryTable.tsx
diff --git a/app/src/components/events/partials/wizards/summaryTables/MetadataExtendedSummaryTable.tsx b/src/components/events/partials/wizards/summaryTables/MetadataExtendedSummaryTable.tsx
similarity index 100%
rename from app/src/components/events/partials/wizards/summaryTables/MetadataExtendedSummaryTable.tsx
rename to src/components/events/partials/wizards/summaryTables/MetadataExtendedSummaryTable.tsx
diff --git a/app/src/components/events/partials/wizards/summaryTables/MetadataSummaryTable.tsx b/src/components/events/partials/wizards/summaryTables/MetadataSummaryTable.tsx
similarity index 100%
rename from app/src/components/events/partials/wizards/summaryTables/MetadataSummaryTable.tsx
rename to src/components/events/partials/wizards/summaryTables/MetadataSummaryTable.tsx
diff --git a/app/src/components/recordings/Recordings.tsx b/src/components/recordings/Recordings.tsx
similarity index 100%
rename from app/src/components/recordings/Recordings.tsx
rename to src/components/recordings/Recordings.tsx
diff --git a/app/src/components/recordings/partials/RecordingsActionCell.tsx b/src/components/recordings/partials/RecordingsActionCell.tsx
similarity index 100%
rename from app/src/components/recordings/partials/RecordingsActionCell.tsx
rename to src/components/recordings/partials/RecordingsActionCell.tsx
diff --git a/app/src/components/recordings/partials/RecordingsNameCell.tsx b/src/components/recordings/partials/RecordingsNameCell.tsx
similarity index 100%
rename from app/src/components/recordings/partials/RecordingsNameCell.tsx
rename to src/components/recordings/partials/RecordingsNameCell.tsx
diff --git a/app/src/components/recordings/partials/RecordingsStatusCell.tsx b/src/components/recordings/partials/RecordingsStatusCell.tsx
similarity index 100%
rename from app/src/components/recordings/partials/RecordingsStatusCell.tsx
rename to src/components/recordings/partials/RecordingsStatusCell.tsx
diff --git a/app/src/components/recordings/partials/RecordingsUpdateCell.tsx b/src/components/recordings/partials/RecordingsUpdateCell.tsx
similarity index 100%
rename from app/src/components/recordings/partials/RecordingsUpdateCell.tsx
rename to src/components/recordings/partials/RecordingsUpdateCell.tsx
diff --git a/app/src/components/recordings/partials/modal/RecordingDetailsModal.tsx b/src/components/recordings/partials/modal/RecordingDetailsModal.tsx
similarity index 100%
rename from app/src/components/recordings/partials/modal/RecordingDetailsModal.tsx
rename to src/components/recordings/partials/modal/RecordingDetailsModal.tsx
diff --git a/app/src/components/recordings/partials/modal/RecordingsDetails.tsx b/src/components/recordings/partials/modal/RecordingsDetails.tsx
similarity index 100%
rename from app/src/components/recordings/partials/modal/RecordingsDetails.tsx
rename to src/components/recordings/partials/modal/RecordingsDetails.tsx
diff --git a/app/src/components/recordings/partials/wizards/CapabilitiesDetailsTab.tsx b/src/components/recordings/partials/wizards/CapabilitiesDetailsTab.tsx
similarity index 100%
rename from app/src/components/recordings/partials/wizards/CapabilitiesDetailsTab.tsx
rename to src/components/recordings/partials/wizards/CapabilitiesDetailsTab.tsx
diff --git a/app/src/components/recordings/partials/wizards/ConfigurationDetailsTab.tsx b/src/components/recordings/partials/wizards/ConfigurationDetailsTab.tsx
similarity index 100%
rename from app/src/components/recordings/partials/wizards/ConfigurationDetailsTab.tsx
rename to src/components/recordings/partials/wizards/ConfigurationDetailsTab.tsx
diff --git a/app/src/components/recordings/partials/wizards/GeneralDetailsTab.tsx b/src/components/recordings/partials/wizards/GeneralDetailsTab.tsx
similarity index 100%
rename from app/src/components/recordings/partials/wizards/GeneralDetailsTab.tsx
rename to src/components/recordings/partials/wizards/GeneralDetailsTab.tsx
diff --git a/app/src/components/shared/BarChart.tsx b/src/components/shared/BarChart.tsx
similarity index 100%
rename from app/src/components/shared/BarChart.tsx
rename to src/components/shared/BarChart.tsx
diff --git a/app/src/components/shared/ConfirmModal.tsx b/src/components/shared/ConfirmModal.tsx
similarity index 100%
rename from app/src/components/shared/ConfirmModal.tsx
rename to src/components/shared/ConfirmModal.tsx
diff --git a/app/src/components/shared/DropDown.tsx b/src/components/shared/DropDown.tsx
similarity index 100%
rename from app/src/components/shared/DropDown.tsx
rename to src/components/shared/DropDown.tsx
diff --git a/app/src/components/shared/EditTableViewModal.tsx b/src/components/shared/EditTableViewModal.tsx
similarity index 100%
rename from app/src/components/shared/EditTableViewModal.tsx
rename to src/components/shared/EditTableViewModal.tsx
diff --git a/app/src/components/shared/HotKeyCheatSheet.tsx b/src/components/shared/HotKeyCheatSheet.tsx
similarity index 70%
rename from app/src/components/shared/HotKeyCheatSheet.tsx
rename to src/components/shared/HotKeyCheatSheet.tsx
index 1594b2d8f8..23110da2b8 100644
--- a/app/src/components/shared/HotKeyCheatSheet.tsx
+++ b/src/components/shared/HotKeyCheatSheet.tsx
@@ -1,19 +1,37 @@
import React from "react";
import { useTranslation } from "react-i18next";
import { availableHotkeys } from "../../configs/hotkeysConfig";
+import { useHotkeysContext } from "react-hotkeys-hook";
+import { Hotkey } from "react-hotkeys-hook/dist/types";
/**
* This component renders the hotkey cheat sheet showing all available hotkeys
*/
-const HotKeyCheatSheet = ({
- close
-}: any) => {
+const HotKeyCheatSheet: React.FC<{
+ close: () => void,
+}> = ({
+ close
+}) => {
const { t } = useTranslation();
const handleClose = () => {
close();
};
+ const { hotkeys } = useHotkeysContext();
+
+ const checkHotkeys = (hotkeys: readonly Hotkey[], searchkeys: string[]) => {
+ for (const hotkey of hotkeys) {
+ if (!hotkey.keys) { continue; }
+ if (hotkey.keys.length !== searchkeys.length) { continue; }
+ if (hotkey.keys.every((element, index) => element === searchkeys[index])) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
return (
<>
@@ -38,21 +56,18 @@ const HotKeyCheatSheet = ({
{/* Repeat row for each hotkey in group*/}
-{/* @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message */}
{Object.keys(availableHotkeys[hotkeyGroup]).map(
(hotkey, key) => (
-
+
{/* repeat for each key in hotkey */}
-{/* @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message */}
{availableHotkeys[hotkeyGroup][
hotkey
-// @ts-expect-error TS(7006): Parameter 'comboKey' implicitly has an 'any' type.
- ].combo.map((comboKey, key) => (
- <>
-
+ ].sequence.map((comboKey, key) => (
+
+
{t(
"HOTKEYS.KEYS." +
@@ -62,23 +77,20 @@ const HotKeyCheatSheet = ({
{comboKey ===
-// @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
availableHotkeys[hotkeyGroup][hotkey]
- .combo[
-// @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
+ .sequence[
availableHotkeys[hotkeyGroup][hotkey]
- .combo.length - 1
+ .sequence.length - 1
]
? ""
: " + "}
- >
+
))}
{t(
-// @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
availableHotkeys[hotkeyGroup][hotkey]
.description
)}
diff --git a/app/src/components/shared/MainNav.tsx b/src/components/shared/MainNav.tsx
similarity index 94%
rename from app/src/components/shared/MainNav.tsx
rename to src/components/shared/MainNav.tsx
index 6735f83b00..93ffee601d 100644
--- a/app/src/components/shared/MainNav.tsx
+++ b/src/components/shared/MainNav.tsx
@@ -21,7 +21,7 @@ import { getUserInformation } from "../../selectors/userInfoSelectors";
import { hasAccess } from "../../utils/utils";
import { fetchServices } from "../../slices/serviceSlice";
import { fetchGroups } from "../../slices/groupSlice";
-import { GlobalHotKeys } from "react-hotkeys";
+import { useHotkeys } from "react-hotkeys-hook";
import { availableHotkeys } from "../../configs/hotkeysConfig";
import { fetchAcls } from "../../slices/aclSlice";
import { useAppDispatch, useAppSelector } from "../../store";
@@ -206,26 +206,29 @@ const MainNav = ({
loadingThemesIntoTable();
};
- const hotkeyLoadEvents = () => {
- navigate("/events/events");
- };
-
- const hotkeyLoadSeries = () => {
- navigate("/events/series");
- };
+ useHotkeys(
+ availableHotkeys.general.EVENT_VIEW.sequence,
+ () => navigate("/events/events"),
+ { description: t(availableHotkeys.general.EVENT_VIEW.description) ?? undefined },
+ []
+ );
+
+ useHotkeys(
+ availableHotkeys.general.SERIES_VIEW.sequence,
+ () => navigate("/events/series"),
+ { description: t(availableHotkeys.general.SERIES_VIEW.description) ?? undefined },
+ []
+ );
+
+ useHotkeys(
+ availableHotkeys.general.MAIN_MENU.sequence,
+ () => toggleMenu(),
+ { description: t(availableHotkeys.general.MAIN_MENU.description) ?? undefined },
+ [toggleMenu]
+ );
- const hotKeyHandlers = {
- EVENT_VIEW: hotkeyLoadEvents,
- SERIES_VIEW: hotkeyLoadSeries,
- MAIN_MENU: toggleMenu,
- };
return (
<>
-