- },
- {
- icon: DetailsIcon,
- name: "View details",
- execute: dispatch => {
- dispatch<any>(toggleDetailsPanel());
- }
- },
- // {
- // icon: ProvenanceGraphIcon,
- // name: "Provenance graph",
- // execute: (dispatch, resource) => {
- // // add code
- // }
- // },
- {
- icon: AdvancedIcon,
- name: "Advanced",
- execute: (dispatch, { uuid, ownerUuid }) => {
- dispatch<any>(openAdvancedTabDialog(uuid, ownerUuid));
- }
- }
- // {
- // icon: RemoveIcon,
- // name: "Remove",
- // execute: (dispatch, resource) => {
- // // add code
- // }
- // }
-]];
+export const readOnlyCollectionActionSet: ContextMenuActionItemSet = [
+ [
+ ...commonActionSet.reduce((prev, next) => prev.concat(next), []),
+ toggleFavoriteAction,
+ {
+ icon: FolderSharedIcon,
+ name: "Open with 3rd party client",
+ execute: (dispatch, resources) => {
+ dispatch<any>(openWebDavS3InfoDialog(resources[0].uuid));
+ },
+ },
+ ],
+];
+
+export const collectionActionSet: ContextMenuActionItemSet = [
+ [
+ ...readOnlyCollectionActionSet.reduce((prev, next) => prev.concat(next), []),
+ {
+ icon: RenameIcon,
+ name: "Edit collection",
+ execute: (dispatch, resources) => {
+ dispatch<any>(openCollectionUpdateDialog(resources[0]));
+ },
+ },
+ {
+ icon: ShareIcon,
+ name: "Share",
+ execute: (dispatch, resources) => {
+ dispatch<any>(openSharingDialog(resources[0].uuid));
+ },
+ },
+ {
+ icon: MoveToIcon,
+ name: "Move to",
+ execute: (dispatch, resources) => dispatch<any>(openMoveCollectionDialog(resources[0])),
+ },
+ {
+ component: ToggleTrashAction,
+ name: "ToggleTrashAction",
+ execute: (dispatch, resources: ContextMenuResource[]) => {
+ for (const resource of [...resources]) {
+ dispatch<any>(toggleCollectionTrashed(resource.uuid, resource.isTrashed!!));
+ }
+ },
+ },
+ ],
+];
+
+export const collectionAdminActionSet: ContextMenuActionItemSet = [
+ [
+ ...collectionActionSet.reduce((prev, next) => prev.concat(next), []),
+ {
+ component: TogglePublicFavoriteAction,
+ name: "TogglePublicFavoriteAction",
+ execute: (dispatch, resources) => {
+ for (const resource of [...resources]) {
+ dispatch<any>(togglePublicFavorite(resource)).then(() => {
+ dispatch<any>(publicFavoritePanelActions.REQUEST_ITEMS());
+ });
+ }
+ },
+ },
+ ],
+];
+
+export const oldCollectionVersionActionSet: ContextMenuActionItemSet = [
+ [
+ ...commonActionSet.reduce((prev, next) => prev.concat(next), []),
+ {
+ icon: RestoreVersionIcon,
+ name: "Restore version",
+ execute: (dispatch, resources) => {
+ for (const resource of [...resources]) {
+ dispatch<any>(openRestoreCollectionVersionDialog(resource.uuid));
+ }
+ },
+ },
+ ],
+];