//
// SPDX-License-Identifier: AGPL-3.0
-import { ContextMenuActionSet } from "../context-menu-action-set";
+import { ContextMenuActionSet, ContextMenuActionNames } from "../context-menu-action-set";
import { NewProjectIcon, RenameIcon, MoveToIcon, DetailsIcon, AdvancedIcon, OpenIcon, Link, FolderSharedIcon } from "components/icon/icon";
import { ToggleFavoriteAction } from "../actions/favorite-action";
import { toggleFavorite } from "store/favorites/favorites-actions";
export const toggleFavoriteAction = {
component: ToggleFavoriteAction,
- name: "ToggleFavoriteAction",
+ name: ContextMenuActionNames.ADD_TO_FAVORITES,
execute: (dispatch, resources) => {
dispatch(toggleFavorite(resources[0])).then(() => {
dispatch(favoritePanelActions.REQUEST_ITEMS());
export const openInNewTabMenuAction = {
icon: OpenIcon,
- name: "Open in new tab",
+ name: ContextMenuActionNames.OPEN_IN_NEW_TAB,
execute: (dispatch, resources) => {
dispatch(openInNewTabAction(resources[0]));
},
export const copyToClipboardMenuAction = {
icon: Link,
- name: "Copy to clipboard",
+ name: ContextMenuActionNames.COPY_TO_CLIPBOARD,
execute: (dispatch, resources) => {
dispatch(copyToClipboardAction(resources));
},
export const viewDetailsAction = {
icon: DetailsIcon,
- name: "View details",
+ name: ContextMenuActionNames.VIEW_DETAILS,
execute: dispatch => {
dispatch(toggleDetailsPanel());
},
export const advancedAction = {
icon: AdvancedIcon,
- name: "API Details",
+ name: ContextMenuActionNames.API_DETAILS,
execute: (dispatch, resources) => {
dispatch(openAdvancedTabDialog(resources[0].uuid));
},
export const openWith3rdPartyClientAction = {
icon: FolderSharedIcon,
- name: "Open with 3rd party client",
+ name: ContextMenuActionNames.OPEN_WITH_3RD_PARTY_CLIENT,
execute: (dispatch, resources) => {
dispatch(openWebDavS3InfoDialog(resources[0].uuid));
},
export const editProjectAction = {
icon: RenameIcon,
- name: "Edit project",
+ name: ContextMenuActionNames.EDIT_PROJECT,
execute: (dispatch, resources) => {
dispatch(openProjectUpdateDialog(resources[0]));
},
export const shareAction = {
icon: ShareIcon,
- name: "Share",
+ name: ContextMenuActionNames.SHARE,
execute: (dispatch, resources) => {
dispatch(openSharingDialog(resources[0].uuid));
},
export const moveToAction = {
icon: MoveToIcon,
- name: "Move to",
+ name: ContextMenuActionNames.MOVE_TO,
execute: (dispatch, resource) => {
dispatch(openMoveProjectDialog(resource[0]));
},
export const toggleTrashAction = {
component: ToggleTrashAction,
- name: "ToggleTrashAction",
+ name: ContextMenuActionNames.MOVE_TO_TRASH,
execute: (dispatch, resources) => {
dispatch(toggleProjectTrashed(resources[0].uuid, resources[0].ownerUuid, resources[0].isTrashed!!, resources.length > 1));
},
export const freezeProjectAction = {
component: ToggleLockAction,
- name: "ToggleLockAction",
+ name: ContextMenuActionNames.FREEZE_PROJECT,
execute: (dispatch, resources) => {
if (resources[0].isFrozen) {
dispatch(unfreezeProject(resources[0].uuid));
export const newProjectAction: any = {
icon: NewProjectIcon,
- name: "New project",
- execute: (dispatch, resource): void => {
- dispatch(openProjectCreateDialog(resource.uuid));
+ name: ContextMenuActionNames.NEW_PROJECT,
+ execute: (dispatch, resources): void => {
+ dispatch(openProjectCreateDialog(resources[0].uuid));
},
};