//
// SPDX-License-Identifier: AGPL-3.0
-import { ContextMenuActionItemSet } from "views-components/context-menu/context-menu-action-set";
+import { MultiSelectMenuAction, MultiSelectMenuActionNames } from "views-components/multiselect-toolbar/ms-menu-action-set";
import { MoveToIcon, Link } from "components/icon/icon";
import { openMoveProjectDialog } from "store/projects/project-move-actions";
-import { ToggleTrashAction } from "views-components/context-menu/actions/trash-action";
import { toggleProjectTrashed } from "store/trash/trash-actions";
import { copyToClipboardAction } from "store/open-in-new-tab/open-in-new-tab.actions";
-import { ToggleFavoriteAction } from "views-components/context-menu/actions/favorite-action";
import { toggleFavorite } from "store/favorites/favorites-actions";
import { favoritePanelActions } from "store/favorite-panel/favorite-panel-action";
+import { AddFavoriteIcon, RemoveFavoriteIcon } from "components/icon/icon";
+import { RestoreFromTrashIcon, TrashIcon } from "components/icon/icon";
+
+
export const msToggleFavoriteAction = {
- component: ToggleFavoriteAction,
- name: "ToggleFavoriteAction",
+ name: MultiSelectMenuActionNames.TOGGLE_FAVORITE_ACTION,
+ defaultText: 'Add to Favorites',
+ altText: 'Remove from Favorites',
+ icon: AddFavoriteIcon,
+ altIcon: RemoveFavoriteIcon,
execute: (dispatch, resources) => {
dispatch(toggleFavorite(resources[0])).then(() => {
dispatch(favoritePanelActions.REQUEST_ITEMS());
export const msCopyToClipboardMenuAction = {
icon: Link,
- name: "Copy to clipboard",
+ name: MultiSelectMenuActionNames.COPY_TO_CLIPBOARD,
execute: (dispatch, resources) => {
dispatch(copyToClipboardAction(resources));
},
export const msMoveToAction = {
icon: MoveToIcon,
- name: "Move to",
+ name: MultiSelectMenuActionNames.MOVE_TO,
execute: (dispatch, resource) => {
dispatch(openMoveProjectDialog(resource[0]));
},
};
export const msToggleTrashAction = {
- component: ToggleTrashAction,
- name: "ToggleTrashAction",
+ name: MultiSelectMenuActionNames.TOGGLE_TRASH_ACTION,
+ defaultText: 'Add to Trash',
+ altText: 'Restore from Trash',
+ icon: TrashIcon,
+ altIcon: RestoreFromTrashIcon,
execute: (dispatch, resources) => {
for (const resource of [...resources]) {
dispatch(toggleProjectTrashed(resource.uuid, resource.ownerUuid, resource.isTrashed!!, resources.length > 1));
},
};
-export const msProjectActionSet: ContextMenuActionItemSet = [[msToggleFavoriteAction, msCopyToClipboardMenuAction, msMoveToAction, msToggleTrashAction]]
+export const msProjectActionSet: MultiSelectMenuAction[][] = [[msCopyToClipboardMenuAction, msMoveToAction, msToggleTrashAction, msToggleFavoriteAction]];