diff --git a/CHANGELOG.md b/CHANGELOG.md index ff07a0668dc..081dad112cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ (Add entries here in the order of: server, console, cli, docs, others) +- console: update sidebar icons for different action and trigger types ## `v1.3.0` diff --git a/console/src/components/Common/Layout/LeftSubSidebar/LeftSidebarSection.tsx b/console/src/components/Common/Layout/LeftSubSidebar/LeftSidebarSection.tsx index a108f6f5fe6..74c579d83b8 100644 --- a/console/src/components/Common/Layout/LeftSubSidebar/LeftSidebarSection.tsx +++ b/console/src/components/Common/Layout/LeftSubSidebar/LeftSidebarSection.tsx @@ -53,6 +53,17 @@ const LeftSidebarSection = ({ itemList = [...items]; } + const getServiceIcon = () => { + switch (service) { + case 'cron': + return 'fa-calendar'; + case 'data': + return 'fa-database'; + default: + return 'fa-wrench'; + } + }; + const getChildList = () => { let childList; if (itemList.length === 0) { @@ -62,6 +73,8 @@ const LeftSidebarSection = ({ ); } else { + const serviceIcon = getServiceIcon(); + childList = itemList.map(a => { let activeTableClass = ''; if (currentItem && currentItem.name === a.name) { @@ -76,7 +89,7 @@ const LeftSidebarSection = ({ > {a.name} diff --git a/console/src/components/Services/Actions/Sidebar/LeftSidebar.js b/console/src/components/Services/Actions/Sidebar/LeftSidebar.js index f2387298d34..9726a3f1550 100644 --- a/console/src/components/Services/Actions/Sidebar/LeftSidebar.js +++ b/console/src/components/Services/Actions/Sidebar/LeftSidebar.js @@ -41,6 +41,17 @@ const LeftSidebar = ({ actionsList = [...actions]; } + const getActionIcon = action => { + switch (action.action_defn.type) { + case 'mutation': + return 'fa-pencil-square-o'; + case 'query': + return 'fa-book'; + default: + return 'fa-wrench'; + } + }; + const getChildList = () => { let childList; if (actionsList.length === 0) { @@ -59,6 +70,8 @@ const LeftSidebar = ({ activeTableClass = styles.activeLink; } + const actionIcon = getActionIcon(a); + return (