Skip to content

Commit

Permalink
Show correct event details modal with table actions
Browse files Browse the repository at this point in the history
Currently, some actions, like open assets, always open the metadata page
  • Loading branch information
dennis531 committed Jul 25, 2024
1 parent ea0a526 commit d59e007
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions src/components/events/partials/EventActionCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ import {
} from "../../../slices/seriesDetailsSlice";
import { Event, deleteEvent } from "../../../slices/eventSlice";
import { Tooltip } from "../../shared/Tooltip";
import {
openModal,
setModalPage
} from "../../../slices/eventDetailsSlice";
import { openModal } from "../../../slices/eventDetailsSlice";

/**
* This component renders the action cells of events in the table view
Expand Down Expand Up @@ -55,10 +52,6 @@ const EventActionCell = ({
setEmbeddingCodeModal(true);
};

const showEventDetailsModal = () => {
dispatch(openModal(EventDetailsPage.Metadata, row))
};

const showSeriesDetailsModal = () => {
setSeriesDetailsModal(true);
};
Expand All @@ -80,23 +73,19 @@ const EventActionCell = ({
};

const onClickEventDetails = () => {
dispatch(setModalPage(EventDetailsPage.Metadata));
showEventDetailsModal();
dispatch(openModal(EventDetailsPage.Metadata, row));
};

const onClickComments = () => {
dispatch(setModalPage(EventDetailsPage.Comments));
showEventDetailsModal();
dispatch(openModal(EventDetailsPage.Comments, row));
};

const onClickWorkflow = () => {
dispatch(setModalPage(EventDetailsPage.Workflow));
showEventDetailsModal();
dispatch(openModal(EventDetailsPage.Workflow, row));
};

const onClickAssets = () => {
dispatch(setModalPage(EventDetailsPage.Assets));
showEventDetailsModal();
dispatch(openModal(EventDetailsPage.Assets, row));
};

return (
Expand Down

0 comments on commit d59e007

Please sign in to comment.