-const writableActionSet: ContextMenuActionSet = [[
- {
- name: "Move item into new collection",
- icon: FileMoveIcon,
- execute: (dispatch, resource) => {
- dispatch<any>(openCollectionPartialMoveToNewCollectionDialog(resource));
- }
- },
- {
- name: "Move item into existing collection",
- icon: FileMoveIcon,
- execute: (dispatch, resource) => {
- dispatch<any>(openCollectionPartialMoveToExistingCollectionDialog(resource));
- }
- },
- {
- name: "Rename",
- icon: RenameIcon,
- execute: (dispatch, resource) => {
- dispatch<any>(openRenameFileDialog({
- name: resource.name,
- id: resource.uuid,
- path: resource.uuid.split('/').slice(1).join('/') }));
- }
- },
- {
- name: "Remove",
- icon: RemoveIcon,
- execute: (dispatch, resource) => {
- dispatch<any>(openFileRemoveDialog(resource.uuid));
- }
- }
-]];
+const writableActionSet: ContextMenuActionSet = [
+ [
+ {
+ name: "Move item into new collection",
+ icon: FileMoveIcon,
+ execute: (dispatch, resources) => {
+ dispatch<any>(openCollectionPartialMoveToNewCollectionDialog(resources[0]));
+ },
+ },
+ {
+ name: "Move item into existing collection",
+ icon: FileMoveIcon,
+ execute: (dispatch, resources) => {
+ dispatch<any>(openCollectionPartialMoveToExistingCollectionDialog(resources[0]));
+ },
+ },
+ {
+ name: "Rename",
+ icon: RenameIcon,
+ execute: (dispatch, resources) => {
+ dispatch<any>(
+ openRenameFileDialog({
+ name: resources[0].name,
+ id: resources[0].uuid,
+ path: resources[0].uuid.split("/").slice(1).join("/"),
+ })
+ );
+ },
+ },
+ {
+ name: "Remove",
+ icon: RemoveIcon,
+ execute: (dispatch, resources) => {
+ dispatch<any>(openFileRemoveDialog(resources[0].uuid));
+ },
+ },
+ ],
+];