diff --git a/src/components/events/Events.tsx b/src/components/events/Events.tsx index 12a3528298..460cd44712 100644 --- a/src/components/events/Events.tsx +++ b/src/components/events/Events.tsx @@ -43,6 +43,7 @@ import { import { fetchSeries } from "../../slices/seriesSlice"; import EventDetailsModal from "./partials/modals/EventDetailsModal"; import { showModal } from "../../selectors/eventDetailsSelectors"; +import { ShowSeriesDetailsModal } from "./partials/modals/ShowSeriesDetailsModal"; // References for detecting a click outside of the container of the dropdown menu const containerAction = React.createRef(); @@ -308,10 +309,11 @@ const Events = () => {

{t("TABLE_SUMMARY", { numberOfRows: events })}

- {/*Include table modal*/} + {/*Include table modals*/} {displayEventDetailsModal && } + {/*Include table component*/} {/* */} diff --git a/src/components/events/Series.tsx b/src/components/events/Series.tsx index 9152c24d4f..7fd00e7f22 100644 --- a/src/components/events/Series.tsx +++ b/src/components/events/Series.tsx @@ -34,6 +34,7 @@ import { showActionsSeries, } from "../../slices/seriesSlice"; import { fetchSeriesDetailsTobiraNew } from "../../slices/seriesSlice"; +import { ShowSeriesDetailsModal } from "./partials/modals/ShowSeriesDetailsModal"; // References for detecting a click outside of the container of the dropdown menu const containerAction = React.createRef(); @@ -234,6 +235,9 @@ const Series = () => { {/* Include table view */}

{t("TABLE_SUMMARY", { numberOfRows: series })}

+ + +
diff --git a/src/components/events/partials/EventActionCell.tsx b/src/components/events/partials/EventActionCell.tsx index 0654b63cf2..a383b68752 100644 --- a/src/components/events/partials/EventActionCell.tsx +++ b/src/components/events/partials/EventActionCell.tsx @@ -4,19 +4,12 @@ import ConfirmModal from "../../shared/ConfirmModal"; import EmbeddingCodeModal from "./modals/EmbeddingCodeModal"; import { getUserInformation } from "../../../selectors/userInfoSelectors"; import { hasAccess } from "../../../utils/utils"; -import SeriesDetailsModal from "./modals/SeriesDetailsModal"; import { EventDetailsPage } from "./modals/EventDetails"; import { useAppDispatch, useAppSelector } from "../../../store"; -import { - fetchSeriesDetailsAcls, - fetchSeriesDetailsFeeds, - fetchSeriesDetailsMetadata, - fetchSeriesDetailsTheme, - fetchSeriesDetailsThemeNames, -} from "../../../slices/seriesDetailsSlice"; import { Event, deleteEvent } from "../../../slices/eventSlice"; import { Tooltip } from "../../shared/Tooltip"; import { openModal } from "../../../slices/eventDetailsSlice"; +import { SeriesDetailsAction } from "./SeriesDetailsAction"; /** * This component renders the action cells of events in the table view @@ -30,7 +23,6 @@ const EventActionCell = ({ const dispatch = useAppDispatch(); const [displayDeleteConfirmation, setDeleteConfirmation] = useState(false); - const [displaySeriesDetailsModal, setSeriesDetailsModal] = useState(false); const [displayEmbeddingCodeModal, setEmbeddingCodeModal] = useState(false); const user = useAppSelector(state => getUserInformation(state)); @@ -51,26 +43,6 @@ const EventActionCell = ({ setEmbeddingCodeModal(true); }; - const showSeriesDetailsModal = () => { - setSeriesDetailsModal(true); - }; - - const hideSeriesDetailsModal = () => { - setSeriesDetailsModal(false); - }; - - const onClickSeriesDetails = async () => { - if (!!row.series) { - await dispatch(fetchSeriesDetailsMetadata(row.series.id)); - await dispatch(fetchSeriesDetailsAcls(row.series.id)); - await dispatch(fetchSeriesDetailsFeeds(row.series.id)); - await dispatch(fetchSeriesDetailsTheme(row.series.id)); - await dispatch(fetchSeriesDetailsThemeNames()); - - showSeriesDetailsModal(); - } - }; - const onClickEventDetails = () => { dispatch(openModal(EventDetailsPage.Metadata, row)); }; @@ -89,14 +61,6 @@ const EventActionCell = ({ return ( <> - {!!row.series && displaySeriesDetailsModal && ( - - )} - {/* Open event details */} {hasAccess("ROLE_UI_EVENTS_DETAILS_VIEW", user) && ( @@ -108,14 +72,7 @@ const EventActionCell = ({ )} {/* If event belongs to a series then the corresponding series details can be opened */} - {!!row.series && hasAccess("ROLE_UI_SERIES_DETAILS_VIEW", user) && ( - -