20031: Add icons to collection files action set
authorStephen Smith <stephen@curii.com>
Thu, 25 May 2023 18:40:02 +0000 (14:40 -0400)
committerStephen Smith <stephen@curii.com>
Thu, 25 May 2023 18:40:02 +0000 (14:40 -0400)
Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen@curii.com>

src/components/icon/icon.tsx
src/views-components/context-menu/action-sets/collection-files-action-set.ts
src/views-components/context-menu/action-sets/collection-files-not-selected-action-set.ts

index 157fb44b3c12d796a887065d8eeb4da01fd8c152..b71dc5a4059af666f8f20b7a14df718e0e4e26e3 100644 (file)
@@ -142,6 +142,18 @@ export const FileMoveIcon: IconType = (props: any) =>
         <path d="M14,17H18V14L23,18.5L18,23V20H14V17M13,9H18.5L13,3.5V9M6,2H14L20,8V12.34C19.37,12.12 18.7,12 18,12A6,6 0 0,0 12,18C12,19.54 12.58,20.94 13.53,22H6C4.89,22 4,21.1 4,20V4A2,2 0 0,1 6,2Z" />
     </SvgIcon>;
 
+// https://pictogrammers.com/library/mdi/icon/checkbox-multiple-outline/
+export const CheckboxMultipleOutline: IconType = (props: any) =>
+    <SvgIcon {...props}>
+        <path d="M20,2H8A2,2 0 0,0 6,4V16A2,2 0 0,0 8,18H20A2,2 0 0,0 22,16V4A2,2 0 0,0 20,2M20,16H8V4H20V16M16,20V22H4A2,2 0 0,1 2,20V7H4V20H16M18.53,8.06L17.47,7L12.59,11.88L10.47,9.76L9.41,10.82L12.59,14L18.53,8.06Z" />
+    </SvgIcon>;
+
+// https://pictogrammers.com/library/mdi/icon/checkbox-multiple-blank-outline/
+export const CheckboxMultipleBlankOutline: IconType = (props: any) =>
+    <SvgIcon {...props}>
+        <path d="M20,16V4H8V16H20M22,16A2,2 0 0,1 20,18H8C6.89,18 6,17.1 6,16V4C6,2.89 6.89,2 8,2H20A2,2 0 0,1 22,4V16M16,20V22H4A2,2 0 0,1 2,20V7H4V20H16Z" />
+    </SvgIcon>;
+
 export type IconType = React.SFC<{ className?: string, style?: object }>;
 
 // https://v4.mui.com/components/material-icons/
@@ -226,3 +238,5 @@ export const InactiveIcon: IconType = (props) => <NotInterested {...props} />;
 export const ImageIcon: IconType = (props) => <Image {...props} />;
 export const StartIcon: IconType = (props) => <PlayArrow {...props} />;
 export const StopIcon: IconType = (props) => <Stop {...props} />;
+export const SelectAllIcon: IconType = (props) => <CheckboxMultipleOutline {...props} />;
+export const SelectNoneIcon: IconType = (props) => <CheckboxMultipleBlankOutline {...props} />;
index 681ca5b3c05dd272576f4e1a7c7ae9bff9dadde6..80deb37cade38c6768421f80187ee7ac6f5a0fe7 100644 (file)
@@ -10,16 +10,19 @@ import {
     openCollectionPartialCopyToSeparateCollectionsDialog
 } from 'store/collections/collection-partial-copy-actions';
 import { openCollectionPartialMoveMultipleToExistingCollectionDialog, openCollectionPartialMoveMultipleToNewCollectionDialog, openCollectionPartialMoveToSeparateCollectionsDialog } from "store/collections/collection-partial-move-actions";
+import { FileCopyIcon, FileMoveIcon, RemoveIcon, SelectAllIcon, SelectNoneIcon } from "components/icon/icon";
 
 const copyActions: ContextMenuAction[] = [
     {
         name: "Copy selected into new collection",
+        icon: FileCopyIcon,
         execute: dispatch => {
             dispatch<any>(openCollectionPartialCopyMultipleToNewCollectionDialog());
         }
     },
     {
         name: "Copy selected into existing collection",
+        icon: FileCopyIcon,
         execute: dispatch => {
             dispatch<any>(openCollectionPartialCopyMultipleToExistingCollectionDialog());
         }
@@ -30,6 +33,7 @@ const copyActionsMultiple: ContextMenuAction[] = [
     ...copyActions,
     {
         name: "Copy selected into separate collections",
+        icon: FileCopyIcon,
         execute: dispatch => {
             dispatch<any>(openCollectionPartialCopyToSeparateCollectionsDialog());
         }
@@ -39,12 +43,14 @@ const copyActionsMultiple: ContextMenuAction[] = [
 const moveActions: ContextMenuAction[] = [
     {
         name: "Move selected into new collection",
+        icon: FileMoveIcon,
         execute: dispatch => {
             dispatch<any>(openCollectionPartialMoveMultipleToNewCollectionDialog());
         }
     },
     {
         name: "Move selected into existing collection",
+        icon: FileMoveIcon,
         execute: dispatch => {
             dispatch<any>(openCollectionPartialMoveMultipleToExistingCollectionDialog());
         }
@@ -55,6 +61,7 @@ const moveActionsMultiple: ContextMenuAction[] = [
     ...moveActions,
     {
         name: "Move selected into separate collections",
+        icon: FileMoveIcon,
         execute: dispatch => {
             dispatch<any>(openCollectionPartialMoveToSeparateCollectionsDialog());
         }
@@ -64,12 +71,14 @@ const moveActionsMultiple: ContextMenuAction[] = [
 const selectActions: ContextMenuAction[] = [
     {
         name: "Select all",
+        icon: SelectAllIcon,
         execute: dispatch => {
             dispatch(collectionPanelFilesAction.SELECT_ALL_COLLECTION_FILES());
         }
     },
     {
         name: "Unselect all",
+        icon: SelectNoneIcon,
         execute: dispatch => {
             dispatch(collectionPanelFilesAction.UNSELECT_ALL_COLLECTION_FILES());
         }
@@ -78,6 +87,7 @@ const selectActions: ContextMenuAction[] = [
 
 const removeAction: ContextMenuAction = {
     name: "Remove selected",
+    icon: RemoveIcon,
     execute: dispatch => {
         dispatch(openMultipleFilesRemoveDialog());
     }
index 1ad13e74188cdfe249d28a14479e16821606c996..1e31d11c800742eac41659e502513aeb39d4d86f 100644 (file)
@@ -4,10 +4,12 @@
 
 import { ContextMenuActionSet } from "views-components/context-menu/context-menu-action-set";
 import { collectionPanelFilesAction } from "store/collection-panel/collection-panel-files/collection-panel-files-actions";
+import { SelectAllIcon } from "components/icon/icon";
 
 export const collectionFilesNotSelectedActionSet: ContextMenuActionSet = [[{
     name: "Select all",
+    icon: SelectAllIcon,
     execute: dispatch => {
         dispatch(collectionPanelFilesAction.SELECT_ALL_COLLECTION_FILES());
     }
-}]];
\ No newline at end of file
+}]];