+
+export const collectionActionSet: ContextMenuActionSet = [
+ [
+ ...readOnlyCollectionActionSet.reduce((prev, next) => prev.concat(next), []),
+ {
+ icon: RenameIcon,
+ name: "Edit collection",
+ execute: (dispatch, resource) => {
+ dispatch<any>(openCollectionUpdateDialog(resource));
+ }
+ },
+ {
+ icon: ShareIcon,
+ name: "Share",
+ execute: (dispatch, { uuid }) => {
+ dispatch<any>(openSharingDialog(uuid));
+ }
+ },
+ {
+ icon: MoveToIcon,
+ name: "Move to",
+ execute: (dispatch, resource) => dispatch<any>(openMoveCollectionDialog(resource))
+ },
+ {
+ component: ToggleTrashAction,
+ name: 'ToggleTrashAction',
+ execute: (dispatch, resource) => {
+ dispatch<any>(toggleCollectionTrashed(resource.uuid, resource.isTrashed!!));
+ }
+ },
+ ]
+];
+
+export const collectionAdminActionSet: ContextMenuActionSet = [
+ [
+ ...collectionActionSet.reduce((prev, next) => prev.concat(next), []),
+ {
+ component: TogglePublicFavoriteAction,
+ name: 'TogglePublicFavoriteAction',
+ execute: (dispatch, resource) => {
+ dispatch<any>(togglePublicFavorite(resource)).then(() => {
+ dispatch<any>(publicFavoritePanelActions.REQUEST_ITEMS());
+ });
+ }
+ },
+ ]
+];
+
+export const oldCollectionVersionActionSet: ContextMenuActionSet = [
+ [
+ ...commonActionSet.reduce((prev, next) => prev.concat(next), []),
+ {
+ icon: RestoreVersionIcon,
+ name: 'Restore version',
+ execute: (dispatch, { uuid }) => {
+ dispatch<any>(openRestoreCollectionVersionDialog(uuid));
+ }
+ },
+ ]
+];