{" "}
- {!!asset.displayOverride
- ? t(asset.displayOverride)
- : t(asset.title)}
+ {translateOverrideFallback(asset, t)}
{ // eslint-disable-next-line react/jsx-no-comment-textnodes
} ({asset.type} "{asset.flavorType}//
diff --git a/app/src/components/events/partials/ModalTabsAndPages/NewAccessPage.tsx b/app/src/components/events/partials/ModalTabsAndPages/NewAccessPage.tsx
index 657a502406..1542cd2a2b 100644
--- a/app/src/components/events/partials/ModalTabsAndPages/NewAccessPage.tsx
+++ b/app/src/components/events/partials/ModalTabsAndPages/NewAccessPage.tsx
@@ -3,20 +3,20 @@ import { useTranslation } from "react-i18next";
import cn from "classnames";
import Notifications from "../../../shared/Notifications";
import {
+ Role,
checkAcls,
fetchAclActions,
fetchAclTemplateById,
fetchAclTemplates,
fetchRolesWithTarget,
-} from "../../../../thunks/aclThunks";
+} from "../../../../slices/aclSlice";
import { Field, FieldArray } from "formik";
-import { connect } from "react-redux";
import RenderMultiField from "../../../shared/wizard/RenderMultiField";
import { getUserInformation } from "../../../../selectors/userInfoSelectors";
import { hasAccess } from "../../../../utils/utils";
import DropDown from "../../../shared/DropDown";
import { filterRoles, getAclTemplateText } from "../../../../utils/aclUtils";
-import { useAppSelector } from "../../../../store";
+import { useAppDispatch, useAppSelector } from "../../../../store";
/**
* This component renders the access page for new events and series in the wizards.
@@ -30,15 +30,14 @@ const NewAccessPage = ({
formik,
// @ts-expect-error TS(7031): Binding element 'editAccessRole' implicitly has an... Remove this comment to see the full error message
editAccessRole,
-// @ts-expect-error TS(7031): Binding element 'checkAcls' implicitly has an 'any... Remove this comment to see the full error message
- checkAcls,
}) => {
const { t } = useTranslation();
+ const dispatch = useAppDispatch();
// States containing response from server concerning acl templates, actions and roles
- const [aclTemplates, setAclTemplates] = useState([]);
- const [aclActions, setAclActions] = useState([]);
- const [roles, setRoles] = useState([]);
+ const [aclTemplates, setAclTemplates] = useState<{ id: string, value: string}[]>([]);
+ const [aclActions, setAclActions] = useState<{ id: string, value: string}[]>([]);
+ const [roles, setRoles] = useState([]);
const [loading, setLoading] = useState(false);
const user = useAppSelector(state => getUserInformation(state));
@@ -48,10 +47,8 @@ const NewAccessPage = ({
async function fetchData() {
setLoading(true);
const responseTemplates = await fetchAclTemplates();
-// @ts-expect-error TS(2345): Argument of type '{ id: string; value: any; }[]' i... Remove this comment to see the full error message
setAclTemplates(responseTemplates);
const responseActions = await fetchAclActions();
-// @ts-expect-error TS(2345): Argument of type '{ id: string; value: any; }[]' i... Remove this comment to see the full error message
setAclActions(responseActions);
const responseRoles = await fetchRolesWithTarget("ACL");
setRoles(responseRoles);
@@ -68,7 +65,7 @@ const NewAccessPage = ({
formik.setFieldValue("aclTemplate", value);
formik.setFieldValue("acls", template);
- await checkAcls(formik.values.acls);
+ await dispatch(checkAcls(formik.values.acls));
};
return (
@@ -292,7 +289,7 @@ const NewAccessPage = ({
write: false,
actions: [],
});
- checkAcls(formik.values.acls);
+ dispatch(checkAcls(formik.values.acls));
}}
className="button-like-anchor"
>
@@ -329,7 +326,7 @@ const NewAccessPage = ({
})}
disabled={!(formik.dirty && formik.isValid)}
onClick={async () => {
- if (await checkAcls(formik.values.acls)) {
+ if (await dispatch(checkAcls(formik.values.acls))) {
nextPage(formik.values);
}
}}
@@ -351,16 +348,4 @@ const NewAccessPage = ({
);
};
-// Getting state data out of redux store
-// @ts-expect-error TS(7006): Parameter 'state' implicitly has an 'any' type.
-const mapStateToProps = (state) => ({
-
-});
-
-// @ts-expect-error TS(7006): Parameter 'dispatch' implicitly has an 'any' type.
-const mapDispatchToProps = (dispatch) => ({
-// @ts-expect-error TS(7006): Parameter 'acls' implicitly has an 'any' type.
- checkAcls: (acls) => dispatch(checkAcls(acls)),
-});
-
-export default connect(mapStateToProps, mapDispatchToProps)(NewAccessPage);
+export default NewAccessPage;
diff --git a/app/src/components/events/partials/ModalTabsAndPages/NewAssetUploadPage.tsx b/app/src/components/events/partials/ModalTabsAndPages/NewAssetUploadPage.tsx
index 7896961f98..58f1c9dcb7 100644
--- a/app/src/components/events/partials/ModalTabsAndPages/NewAssetUploadPage.tsx
+++ b/app/src/components/events/partials/ModalTabsAndPages/NewAssetUploadPage.tsx
@@ -2,6 +2,7 @@ import React from "react";
import { useTranslation } from "react-i18next";
import WizardNavigationButtons from "../../../shared/wizard/WizardNavigationButtons";
import { getAssetUploadOptions } from "../../../../selectors/eventSelectors";
+import { translateOverrideFallback } from "../../../../utils/utils";
import { useAppSelector } from "../../../../store";
import { FormikProps } from "formik";
@@ -67,9 +68,7 @@ const NewAssetUploadPage = ({
{" "}
- {!!asset.displayOverride
- ? t(asset.displayOverride)
- : t(asset.title)}
+ {translateOverrideFallback(asset, t)}
{ // eslint-disable-next-line react/jsx-no-comment-textnodes
} ({asset.type} "{asset.flavorType}//
diff --git a/app/src/components/events/partials/ModalTabsAndPages/NewSourcePage.tsx b/app/src/components/events/partials/ModalTabsAndPages/NewSourcePage.tsx
index ee6681c1ec..dd971d860d 100644
--- a/app/src/components/events/partials/ModalTabsAndPages/NewSourcePage.tsx
+++ b/app/src/components/events/partials/ModalTabsAndPages/NewSourcePage.tsx
@@ -6,6 +6,7 @@ import { DatePicker } from "@mui/x-date-pickers/DatePicker";
import {
getCurrentLanguageInformation,
getTimezoneOffset,
+ translateOverrideFallback,
} from "../../../../utils/utils";
import { Field, FieldArray, FormikProps } from "formik";
import RenderField from "../../../shared/wizard/RenderField";
@@ -260,20 +261,14 @@ const Upload = ({ formik }) => {
- {t(
- asset.title + ".SHORT",
- asset["displayOverride.SHORT"]
- )}
+ {translateOverrideFallback(asset, t, "SHORT")}
({asset.type} "{asset.flavorType}/
{asset.flavorSubType}")
- {t(
- asset.title + ".DETAIL",
- asset["displayOverride.DETAIL"]
- )}
+ {translateOverrideFallback(asset, t, "DETAIL")}
|
diff --git a/app/src/components/events/partials/ModalTabsAndPages/StartTaskWorkflowPage.tsx b/app/src/components/events/partials/ModalTabsAndPages/StartTaskWorkflowPage.tsx
index 473eaf6086..60ea6773b1 100644
--- a/app/src/components/events/partials/ModalTabsAndPages/StartTaskWorkflowPage.tsx
+++ b/app/src/components/events/partials/ModalTabsAndPages/StartTaskWorkflowPage.tsx
@@ -34,7 +34,7 @@ const StartTaskWorkflowPage = ({
useEffect(() => {
// Load workflow definitions for selecting
- dispatch(fetchWorkflowDef("default"));
+ dispatch(fetchWorkflowDef("tasks"));
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
diff --git a/app/src/components/events/partials/wizards/NewEventSummary.tsx b/app/src/components/events/partials/wizards/NewEventSummary.tsx
index a086577e30..52e7367a37 100644
--- a/app/src/components/events/partials/wizards/NewEventSummary.tsx
+++ b/app/src/components/events/partials/wizards/NewEventSummary.tsx
@@ -10,6 +10,7 @@ import MetadataSummaryTable from "./summaryTables/MetadataSummaryTable";
import MetadataExtendedSummaryTable from "./summaryTables/MetadataExtendedSummaryTable";
import AccessSummaryTable from "./summaryTables/AccessSummaryTable";
import WizardNavigationButtons from "../../../shared/wizard/WizardNavigationButtons";
+import { translateOverrideFallback } from "../../../../utils/utils";
import { useAppSelector } from "../../../../store";
import { FormikProps } from "formik";
import { TransformedAcl } from "../../../../slices/aclDetailsSlice";
@@ -77,7 +78,7 @@ const NewEventSummary = ({
name: uploadAssetsOptionsNonTrack[i].id,
translate: !!displayOverride
? t(displayOverride)
- : t(uploadAssetsOptionsNonTrack[i].title),
+ : translateOverrideFallback(uploadAssetsOptionsNonTrack[i], t),
type: uploadAssetsOptionsNonTrack[i].type,
flavorType: uploadAssetsOptionsNonTrack[i].flavorType,
flavorSubType: uploadAssetsOptionsNonTrack[i].flavorSubType,
@@ -162,10 +163,7 @@ const NewEventSummary = ({
!!asset.file ? (
- {t(
- asset.title + ".SHORT",
- asset["displayOverride.SHORT"]
- )}
+ {translateOverrideFallback(asset, t, "SHORT")}
{ // eslint-disable-next-line react/jsx-no-comment-textnodes
} ({asset.type} "{asset.flavorType}//
diff --git a/app/src/components/events/partials/wizards/NewEventWizard.tsx b/app/src/components/events/partials/wizards/NewEventWizard.tsx
index 5ab59c0276..5cd23e4847 100644
--- a/app/src/components/events/partials/wizards/NewEventWizard.tsx
+++ b/app/src/components/events/partials/wizards/NewEventWizard.tsx
@@ -247,6 +247,8 @@ const getInitialValues = (
// Add possible files that can be uploaded in source step
if (!!uploadAssetOptions) {
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
for (const option of uploadAssetOptions) {
if (option.type === "track") {
diff --git a/app/src/components/events/partials/wizards/summaryTables/MetadataExtendedSummaryTable.tsx b/app/src/components/events/partials/wizards/summaryTables/MetadataExtendedSummaryTable.tsx
index bd80a9fddf..258a335459 100644
--- a/app/src/components/events/partials/wizards/summaryTables/MetadataExtendedSummaryTable.tsx
+++ b/app/src/components/events/partials/wizards/summaryTables/MetadataExtendedSummaryTable.tsx
@@ -81,7 +81,7 @@ const MetadataExtendedSummaryTable = ({
{catalogs.map((catalog, key) => (
-
+
{catalog.map((entry, key) => (
diff --git a/app/src/components/shared/EditTableViewModal.tsx b/app/src/components/shared/EditTableViewModal.tsx
index 9d3a1cb782..2a88a34b5f 100644
--- a/app/src/components/shared/EditTableViewModal.tsx
+++ b/app/src/components/shared/EditTableViewModal.tsx
@@ -1,5 +1,4 @@
import React, { useState, useEffect } from "react";
-import { Container, Draggable } from "@edorivai/react-smooth-dnd";
import { arrayMoveImmutable } from "array-move";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -9,6 +8,7 @@ import {
getDeactivatedColumns,
getResourceType,
} from "../../selectors/tableSelectors";
+import { DragDropContext, Droppable, OnDragEndResponder, Draggable as Draggablee } from "@hello-pangea/dnd";
/**
* This component renders the modal for editing which columns are shown in the table
@@ -34,11 +34,17 @@ const EditTableViewModal = ({
const [deactivatedCols, setDeactivatedColumns] = useState(deactivatedColumns);
const [activeCols, setActiveColumns] = useState(activeColumns);
+ const [isColsLoaded, setIsColsLoaded] = useState(false);
useEffect(() => {
- setActiveColumns(activeColumns);
- setDeactivatedColumns(deactivatedColumns);
- }, [activeColumns, deactivatedColumns]);
+ if (!isColsLoaded) {
+ setActiveColumns(activeColumns);
+ setDeactivatedColumns(deactivatedColumns);
+ if (activeColumns.length !== 0 || deactivatedColumns.length !== 0) {
+ setIsColsLoaded(true)
+ }
+ }
+ }, [activeColumns, deactivatedColumns, isColsLoaded]);
// closes this modal
const close = () => {
@@ -76,11 +82,15 @@ const EditTableViewModal = ({
};
// change column order based on where column was dragged and dropped
-// @ts-expect-error TS(7031): Binding element 'removedIndex' implicitly has an '... Remove this comment to see the full error message
- const onDrop = ({ removedIndex, addedIndex }) => {
-// @ts-expect-error TS(7006): Parameter 'columns' implicitly has an 'any' type.
- setActiveColumns((columns) => arrayMoveImmutable(columns, removedIndex, addedIndex));
- };
+ const onDragEnd: OnDragEndResponder = (result) => {
+ // dropped outside the list
+ if (!result.destination) {
+ return;
+ }
+
+ // @ts-expect-error TS(7006): Parameter 'columns' implicitly has an 'any' type.
+ setActiveColumns((columns) => arrayMoveImmutable(columns, result.source.index, result.destination.index));
+ }
return (
<>
@@ -156,28 +166,46 @@ const EditTableViewModal = ({
-
-
-{/* @ts-expect-error TS(7006): Parameter 'column' implicitly has an 'any' type. */}
- {activeCols.map((column, key) =>
- column ? (
-
-
-
- {t(column.label)}
-
-
-
- ) : null
- )}
-
+
+ {(provided, snapshot) => (
+
+ {/* @ts-expect-error TS(7006): Parameter 'column' implicitly has an 'any' type. */}
+ {activeCols.filter(col => col).map((column, key) =>
+ (
+
+ {(provided, snapshot) => (
+
+
+ {t(column.label)}
+
+
+ )}
+
+ )
+ )}
+ {provided.placeholder}
+
+ )}
+
+
+
diff --git a/app/src/components/shared/TableFilterProfiles.tsx b/app/src/components/shared/TableFilterProfiles.tsx
index 9ef05cebf6..4434890bc7 100644
--- a/app/src/components/shared/TableFilterProfiles.tsx
+++ b/app/src/components/shared/TableFilterProfiles.tsx
@@ -8,9 +8,10 @@ import {
createFilterProfile,
editFilterProfile,
removeFilterProfile,
-} from "../../actions/tableFilterProfilesActions";
+} from "../../slices/tableFilterProfilesSlice";
import { getFilters } from "../../selectors/tableFilterSelectors";
import { loadFilterProfile } from "../../actions/tableFilterActions";
+import { useAppDispatch, useAppSelector } from "../../store";
/**
* This component renders the table filter profiles in the upper right corner when clicked on settings icon of the
@@ -21,16 +22,8 @@ const TableFiltersProfiles = ({
showFilterSettings,
// @ts-expect-error TS(7031): Binding element 'setFilterSettings' implicitly has... Remove this comment to see the full error message
setFilterSettings,
-// @ts-expect-error TS(7031): Binding element 'createFilterProfile' implicitly h... Remove this comment to see the full error message
- createFilterProfile,
// @ts-expect-error TS(7031): Binding element 'filterMap' implicitly has an 'any... Remove this comment to see the full error message
filterMap,
-// @ts-expect-error TS(7031): Binding element 'cancelEditFilterProfile' implicit... Remove this comment to see the full error message
- cancelEditFilterProfile,
-// @ts-expect-error TS(7031): Binding element 'profiles' implicitly has an 'any'... Remove this comment to see the full error message
- profiles,
-// @ts-expect-error TS(7031): Binding element 'removeFilterProfile' implicitly h... Remove this comment to see the full error message
- removeFilterProfile,
// @ts-expect-error TS(7031): Binding element 'loadFilterProfile' implicitly has... Remove this comment to see the full error message
loadFilterProfile,
// @ts-expect-error TS(7031): Binding element 'loadResource' implicitly has an '... Remove this comment to see the full error message
@@ -40,6 +33,10 @@ const TableFiltersProfiles = ({
// @ts-expect-error TS(7031): Binding element 'resource' implicitly has an 'any'... Remove this comment to see the full error message
resource,
}) => {
+ const dispatch = useAppDispatch();
+
+ const profiles = useAppSelector(state => getFilterProfiles(state));
+
// State for switching between list of profiles and saving/editing dialog
const [settingsMode, setSettingsMode] = useState(true);
@@ -52,7 +49,6 @@ const TableFiltersProfiles = ({
const { t } = useTranslation();
const currentProfiles = profiles.filter(
-// @ts-expect-error TS(7006): Parameter 'profile' implicitly has an 'any' type.
(profile) => profile.resource === resource
);
@@ -65,7 +61,7 @@ const TableFiltersProfiles = ({
filterMap: filterMap,
resource: resource,
};
- createFilterProfile(filterProfile);
+ dispatch(createFilterProfile(filterProfile));
}
setSettingsMode(!settingsMode);
resetStateValues();
@@ -77,15 +73,16 @@ const TableFiltersProfiles = ({
setCurrentlyEditing(profile);
setProfileName(profile.name);
setProfileDescription(profile.description);
- removeFilterProfile(profile);
+ dispatch(removeFilterProfile(profile));
setValidName(true);
};
const cancelEditProfile = () => {
- if (currentlyEditing !== "") {
- createFilterProfile(currentlyEditing);
- }
- cancelEditFilterProfile();
+ // What was this achieving?
+ // if (currentlyEditing !== "") {
+ // dispatch(createFilterProfile(currentlyEditing));
+ // }
+ dispatch(cancelEditFilterProfile());
setSettingsMode(!settingsMode);
setFilterSettings(!showFilterSettings);
resetStateValues();
@@ -105,7 +102,6 @@ const TableFiltersProfiles = ({
if (itemName === "name") {
const isDuplicated = profiles.some(
-// @ts-expect-error TS(7006): Parameter 'profile' implicitly has an 'any' type.
(profile) => profile.name === itemValue
);
if (!isDuplicated) {
@@ -151,7 +147,6 @@ const TableFiltersProfiles = ({
{t("TABLE_FILTERS.PROFILES.EMPTY")}
) : (
// repeat for each profile in profiles filtered for currently shown resource (else-case)
-// @ts-expect-error TS(7006): Parameter 'profile' implicitly has an 'any' type.
currentProfiles.map((profile, key) => (
{/* Remove icon to remove profile */}
| | | |