From 75dd058ce216c5cd990057ffe71b923e5bfe72e0 Mon Sep 17 00:00:00 2001 From: Mutasem Aldmour <4711238+mutdmour@users.noreply.github.com> Date: Fri, 9 Apr 2021 23:44:53 +0300 Subject: [PATCH] :sparkles: Add support to dynamically add menu items * add menu items POC * remove sidebar hook * use getters * update menu to add items * add home icon for CLD-202 * center icon * address comments * :zap: Minor improvements Co-authored-by: Jan Oberhauser --- packages/editor-ui/src/Interface.ts | 17 +++++++ .../editor-ui/src/components/MainSidebar.vue | 44 +++++++++++++++++++ packages/editor-ui/src/main.ts | 2 + packages/editor-ui/src/store.ts | 16 +++++-- 4 files changed, 76 insertions(+), 3 deletions(-) diff --git a/packages/editor-ui/src/Interface.ts b/packages/editor-ui/src/Interface.ts index 972ef0cbd8..745e0f11fb 100644 --- a/packages/editor-ui/src/Interface.ts +++ b/packages/editor-ui/src/Interface.ts @@ -428,3 +428,20 @@ export interface ITimeoutHMS { } export type WorkflowTitleStatus = 'EXECUTING' | 'IDLE' | 'ERROR'; + +export type MenuItemType = 'link'; +export type MenuItemPosition = 'top' | 'bottom'; + +export interface IMenuItem { + id: string; + type: MenuItemType; + position: MenuItemPosition; + properties: ILinkMenuItemProperties; +} + +export interface ILinkMenuItemProperties { + title: string; + icon: string; + href: string; + newWindow?: boolean; +} \ No newline at end of file diff --git a/packages/editor-ui/src/components/MainSidebar.vue b/packages/editor-ui/src/components/MainSidebar.vue index 2b6ae3e054..6de1de6c98 100644 --- a/packages/editor-ui/src/components/MainSidebar.vue +++ b/packages/editor-ui/src/components/MainSidebar.vue @@ -21,6 +21,22 @@ + + + + {{ item.properties.title }} + + +