import { openCollectionCopyDialog } from "~/store/collections/collection-copy-actions";
import { ToggleTrashAction } from "~/views-components/context-menu/actions/trash-action";
import { toggleCollectionTrashed } from "~/store/trash/trash-actions";
+import { detailsPanelActions } from '~/store/details-panel/details-panel-action';
export const collectionActionSet: ContextMenuActionSet = [[
{
{
icon: DetailsIcon,
name: "View details",
- execute: (dispatch, resource) => {
- // add code
- }
+ execute: dispatch => dispatch(detailsPanelActions.TOGGLE_DETAILS_PANEL())
},
{
icon: ProvenanceGraphIcon,
import { openMoveCollectionDialog } from '~/store/collections/collection-move-actions';
import { openCollectionCopyDialog } from '~/store/collections/collection-copy-actions';
import { toggleCollectionTrashed } from "~/store/trash/trash-actions";
+import { detailsPanelActions } from '~/store/details-panel/details-panel-action';
export const collectionResourceActionSet: ContextMenuActionSet = [[
{
{
icon: DetailsIcon,
name: "View details",
- execute: (dispatch, resource) => {
- // add code
- }
+ execute: dispatch => dispatch(detailsPanelActions.TOGGLE_DETAILS_PANEL())
},
{
icon: RemoveIcon,
import { openProcessUpdateDialog } from "~/store/processes/process-update-actions";
import { openCopyProcessDialog } from '~/store/processes/process-copy-actions';
import { openProcessCommandDialog } from '../../../store/processes/process-command-actions';
+import { detailsPanelActions } from '~/store/details-panel/details-panel-action';
export const processActionSet: ContextMenuActionSet = [[
{
{
icon: DetailsIcon,
name: "View details",
- execute: (dispatch, resource) => {
- // add code
- }
+ execute: dispatch => dispatch(detailsPanelActions.TOGGLE_DETAILS_PANEL())
},
{
icon: LogIcon,
import { openMoveProcessDialog } from '~/store/processes/process-move-actions';
import { openProcessUpdateDialog } from "~/store/processes/process-update-actions";
import { openCopyProcessDialog } from '~/store/processes/process-copy-actions';
+import { detailsPanelActions } from '~/store/details-panel/details-panel-action';
export const processResourceActionSet: ContextMenuActionSet = [[
{
{
icon: DetailsIcon,
name: "View details",
- execute: (dispatch, resource) => {
- // add code
- }
+ execute: dispatch => dispatch(detailsPanelActions.TOGGLE_DETAILS_PANEL())
},
{
icon: RemoveIcon,
// SPDX-License-Identifier: AGPL-3.0
import { ContextMenuActionSet } from "../context-menu-action-set";
-import { NewProjectIcon, RenameIcon, CopyIcon, MoveToIcon } from "~/components/icon/icon";
+import { NewProjectIcon, RenameIcon, CopyIcon, MoveToIcon, DetailsIcon } from '~/components/icon/icon';
import { ToggleFavoriteAction } from "../actions/favorite-action";
import { toggleFavorite } from "~/store/favorites/favorites-actions";
import { favoritePanelActions } from "~/store/favorite-panel/favorite-panel-action";
import { openProjectUpdateDialog } from '~/store/projects/project-update-actions';
import { ToggleTrashAction } from "~/views-components/context-menu/actions/trash-action";
import { toggleProjectTrashed } from "~/store/trash/trash-actions";
+import { detailsPanelActions } from '~/store/details-panel/details-panel-action';
export const projectActionSet: ContextMenuActionSet = [[
{
// add code
}
},
+ {
+ icon: DetailsIcon,
+ name: "View details",
+ execute: dispatch => dispatch(detailsPanelActions.TOGGLE_DETAILS_PANEL())
+ }
]];
import { loadDetailsPanel } from "~/store/details-panel/details-panel-action";
import { DataTableDefaultView } from '~/components/data-table-default-view/data-table-default-view';
import { SHARED_WITH_ME_PANEL_ID } from '~/store/shared-with-me-panel/shared-with-me-panel-actions';
-import { openContextMenu } from '~/store/context-menu/context-menu-actions';
+import { openContextMenu, resourceKindToContextMenuKind } from '~/store/context-menu/context-menu-actions';
import { GroupResource } from '~/models/group';
-import { ContextMenuKind } from '~/views-components/context-menu/context-menu';
type CssRules = "toolbar" | "button";
}
handleContextMenu = (event: React.MouseEvent<HTMLElement>, resourceUuid: string) => {
+ const menuKind = resourceKindToContextMenuKind(resourceUuid);
const resource = getResource<GroupResource>(resourceUuid)(this.props.resources);
- if (resource) {
+ if (menuKind && resource) {
this.props.dispatch<any>(openContextMenu(event, {
name: '',
uuid: resource.uuid,
ownerUuid: resource.ownerUuid,
isTrashed: resource.isTrashed,
kind: resource.kind,
- menuKind: ContextMenuKind.PROJECT,
+ menuKind
}));
}
}