17018: Fixes the bug adding checks for readonly context menu type.
[arvados-workbench2.git] / src / components / icon / icon.tsx
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import * as React from 'react';
6 import Add from '@material-ui/icons/Add';
7 import ArrowBack from '@material-ui/icons/ArrowBack';
8 import ArrowDropDown from '@material-ui/icons/ArrowDropDown';
9 import BubbleChart from '@material-ui/icons/BubbleChart';
10 import Build from '@material-ui/icons/Build';
11 import Cached from '@material-ui/icons/Cached';
12 import ChevronLeft from '@material-ui/icons/ChevronLeft';
13 import CloudUpload from '@material-ui/icons/CloudUpload';
14 import Code from '@material-ui/icons/Code';
15 import Create from '@material-ui/icons/Create';
16 import ImportContacts from '@material-ui/icons/ImportContacts';
17 import ChevronRight from '@material-ui/icons/ChevronRight';
18 import Close from '@material-ui/icons/Close';
19 import ContentCopy from '@material-ui/icons/FileCopyOutlined';
20 import CreateNewFolder from '@material-ui/icons/CreateNewFolder';
21 import Delete from '@material-ui/icons/Delete';
22 import DeviceHub from '@material-ui/icons/DeviceHub';
23 import Edit from '@material-ui/icons/Edit';
24 import ErrorRoundedIcon from '@material-ui/icons/ErrorRounded';
25 import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
26 import Folder from '@material-ui/icons/Folder';
27 import GetApp from '@material-ui/icons/GetApp';
28 import Help from '@material-ui/icons/Help';
29 import HelpOutline from '@material-ui/icons/HelpOutline';
30 import Inbox from '@material-ui/icons/Inbox';
31 import Info from '@material-ui/icons/Info';
32 import Input from '@material-ui/icons/Input';
33 import InsertDriveFile from '@material-ui/icons/InsertDriveFile';
34 import LastPage from '@material-ui/icons/LastPage';
35 import LibraryBooks from '@material-ui/icons/LibraryBooks';
36 import ListAlt from '@material-ui/icons/ListAlt';
37 import Menu from '@material-ui/icons/Menu';
38 import MoreVert from '@material-ui/icons/MoreVert';
39 import Mail from '@material-ui/icons/Mail';
40 import MoveToInbox from '@material-ui/icons/MoveToInbox';
41 import Notifications from '@material-ui/icons/Notifications';
42 import OpenInNew from '@material-ui/icons/OpenInNew';
43 import People from '@material-ui/icons/People';
44 import Person from '@material-ui/icons/Person';
45 import PersonAdd from '@material-ui/icons/PersonAdd';
46 import PlayArrow from '@material-ui/icons/PlayArrow';
47 import Public from '@material-ui/icons/Public';
48 import RateReview from '@material-ui/icons/RateReview';
49 import RestoreFromTrash from '@material-ui/icons/History';
50 import Search from '@material-ui/icons/Search';
51 import SettingsApplications from '@material-ui/icons/SettingsApplications';
52 import SettingsEthernet from '@material-ui/icons/SettingsEthernet';
53 import Star from '@material-ui/icons/Star';
54 import StarBorder from '@material-ui/icons/StarBorder';
55 import Warning from '@material-ui/icons/Warning';
56 import VpnKey from '@material-ui/icons/VpnKey';
57 import LinkOutlined from '@material-ui/icons/LinkOutlined';
58
59 // Import FontAwesome icons
60 import { library } from '@fortawesome/fontawesome-svg-core';
61 import { faPencilAlt, faSlash } from '@fortawesome/free-solid-svg-icons';
62 library.add(
63     faPencilAlt,
64     faSlash,
65 );
66
67 export const ReadOnlyIcon = (props:any) =>
68     <span {...props}>
69         <div className="fa-layers fa-1x fa-fw">
70             <span className="fas fa-slash"
71                 data-fa-mask="fas fa-pencil-alt" data-fa-transform="down-1.5" />
72             <span className="fas fa-slash" />
73         </div>
74     </span>;
75
76 export type IconType = React.SFC<{ className?: string, style?: object }>;
77
78 export const AddIcon: IconType = (props) => <Add {...props} />;
79 export const AddFavoriteIcon: IconType = (props) => <StarBorder {...props} />;
80 export const AdminMenuIcon: IconType = (props) => <Build {...props} />;
81 export const AdvancedIcon: IconType = (props) => <SettingsApplications {...props} />;
82 export const AttributesIcon: IconType = (props) => <ListAlt {...props} />;
83 export const BackIcon: IconType = (props) => <ArrowBack {...props} />;
84 export const CustomizeTableIcon: IconType = (props) => <Menu {...props} />;
85 export const CommandIcon: IconType = (props) => <LastPage {...props} />;
86 export const CopyIcon: IconType = (props) => <ContentCopy {...props} />;
87 export const CollectionIcon: IconType = (props) => <LibraryBooks {...props} />;
88 export const CloseIcon: IconType = (props) => <Close {...props} />;
89 export const CloudUploadIcon: IconType = (props) => <CloudUpload {...props} />;
90 export const DefaultIcon: IconType = (props) => <RateReview {...props} />;
91 export const DetailsIcon: IconType = (props) => <Info {...props} />;
92 export const DownloadIcon: IconType = (props) => <GetApp {...props} />;
93 export const EditSavedQueryIcon: IconType = (props) => <Create {...props} />;
94 export const ExpandIcon: IconType = (props) => <ExpandMoreIcon {...props} />;
95 export const ErrorIcon: IconType = (props) => <ErrorRoundedIcon style={{color: '#ff0000'}} {...props} />;
96 export const FavoriteIcon: IconType = (props) => <Star {...props} />;
97 export const HelpIcon: IconType = (props) => <Help {...props} />;
98 export const HelpOutlineIcon: IconType = (props) => <HelpOutline {...props} />;
99 export const ImportContactsIcon: IconType = (props) => <ImportContacts {...props} />;
100 export const InputIcon: IconType = (props) => <InsertDriveFile {...props} />;
101 export const KeyIcon: IconType = (props) => <VpnKey {...props} />;
102 export const LogIcon: IconType = (props) => <SettingsEthernet {...props} />;
103 export const MailIcon: IconType = (props) => <Mail {...props} />;
104 export const MoreOptionsIcon: IconType = (props) => <MoreVert {...props} />;
105 export const MoveToIcon: IconType = (props) => <Input {...props} />;
106 export const NewProjectIcon: IconType = (props) => <CreateNewFolder {...props} />;
107 export const NotificationIcon: IconType = (props) => <Notifications {...props} />;
108 export const OpenIcon: IconType = (props) => <OpenInNew {...props} />;
109 export const OutputIcon: IconType = (props) => <MoveToInbox {...props} />;
110 export const PaginationDownIcon: IconType = (props) => <ArrowDropDown {...props} />;
111 export const PaginationLeftArrowIcon: IconType = (props) => <ChevronLeft {...props} />;
112 export const PaginationRightArrowIcon: IconType = (props) => <ChevronRight {...props} />;
113 export const ProcessIcon: IconType = (props) => <BubbleChart {...props} />;
114 export const ProjectIcon: IconType = (props) => <Folder {...props} />;
115 export const ProjectsIcon: IconType = (props) => <Inbox {...props} />;
116 export const ProvenanceGraphIcon: IconType = (props) => <DeviceHub {...props} />;
117 export const RemoveIcon: IconType = (props) => <Delete {...props} />;
118 export const RemoveFavoriteIcon: IconType = (props) => <Star {...props} />;
119 export const PublicFavoriteIcon: IconType = (props) => <Public {...props} />;
120 export const RenameIcon: IconType = (props) => <Edit {...props} />;
121 export const RestoreFromTrashIcon: IconType = (props) => <RestoreFromTrash {...props} />;
122 export const ReRunProcessIcon: IconType = (props) => <Cached {...props} />;
123 export const SearchIcon: IconType = (props) => <Search {...props} />;
124 export const ShareIcon: IconType = (props) => <PersonAdd {...props} />;
125 export const ShareMeIcon: IconType = (props) => <People {...props} />;
126 export const SidePanelRightArrowIcon: IconType = (props) => <PlayArrow {...props} />;
127 export const TrashIcon: IconType = (props) => <Delete {...props} />;
128 export const UserPanelIcon: IconType = (props) => <Person {...props} />;
129 export const UsedByIcon: IconType = (props) => <Folder {...props} />;
130 export const WorkflowIcon: IconType = (props) => <Code {...props} />;
131 export const WarningIcon: IconType = (props) => <Warning style={{ color: '#fbc02d', height: '30px', width: '30px' }} {...props} />;
132 export const Link: IconType = (props) => <LinkOutlined {...props} />;