From 97fc6f033a5e0da2206d810591a50b48a716aedd Mon Sep 17 00:00:00 2001 From: Alex Martzios Date: Tue, 11 Jan 2022 12:05:40 +0200 Subject: [PATCH] add changes for pages and dynamic menus - dev only --- dashboard/menu/menu.component.html | 36 ++++---- dashboard/menu/menu.component.ts | 126 ++++++++++++++++++++++++---- dashboard/page/pages.component.html | 71 ++++++++-------- dashboard/page/pages.component.ts | 2 + sharedComponents/menu.ts | 6 +- utils/entities/adminTool/page.ts | 1 + 6 files changed, 168 insertions(+), 74 deletions(-) diff --git a/dashboard/menu/menu.component.html b/dashboard/menu/menu.component.html index 807e0906..1d96a974 100644 --- a/dashboard/menu/menu.component.html +++ b/dashboard/menu/menu.component.html @@ -4,12 +4,12 @@
    -
  • +
  • - + {{item.title}} - +
      @@ -30,7 +30,7 @@ - + Create new root menu @@ -60,18 +60,18 @@
    -
-
+
Actions
@@ -136,39 +136,42 @@ type="text" placeholder="Write a name" label="Page Name">
-
-
-
-
-
-
-
Select if this page have helptext at:
-
-
-
-
-
-
-
-
-
-
- -
+ +
+
+
+
+
+
+
+
Select if this page have helptext at:
+
+
+
+
+
+
+
+
+
+
+ +
+
diff --git a/dashboard/page/pages.component.ts b/dashboard/page/pages.component.ts index f4c55b06..af631036 100644 --- a/dashboard/page/pages.component.ts +++ b/dashboard/page/pages.component.ts @@ -246,6 +246,7 @@ export class PagesComponent implements OnInit { name: this._fb.control(page.name, Validators.required), isEnabled: this._fb.control(page.isEnabled), portalType: this._fb.control(page.portalType, Validators.required), + portalPid: this._fb.control(page.portalPid), top: this._fb.control(page.top), bottom: this._fb.control(page.bottom), left: this._fb.control(page.left), @@ -271,6 +272,7 @@ export class PagesComponent implements OnInit { name: this._fb.control('', Validators.required), isEnabled: this._fb.control(true), portalType: this._fb.control('', Validators.required), + portalPid: this._fb.control(null), top: this._fb.control(true), bottom: this._fb.control(true), left: this._fb.control(true), diff --git a/sharedComponents/menu.ts b/sharedComponents/menu.ts index 82662f30..6e646186 100644 --- a/sharedComponents/menu.ts +++ b/sharedComponents/menu.ts @@ -1,6 +1,7 @@ export class MenuItem { _id: string = ""; // for root menu in order to close the dropdown when clicked title: string = ""; + type: string = "internal"; url: string = ""; // external url route: string = ""; // internal url - using angular routing and components routeActive: string = ""; // route to check if it is active @@ -82,8 +83,3 @@ export class SideMenuItem { items: RootMenuItem[] = []; ukIcon: string = ''; } - -export interface CheckMenuItem { - menuItem: MenuItem; - checked: boolean; -} diff --git a/utils/entities/adminTool/page.ts b/utils/entities/adminTool/page.ts index e9676e8c..faa666ed 100644 --- a/utils/entities/adminTool/page.ts +++ b/utils/entities/adminTool/page.ts @@ -7,6 +7,7 @@ export interface Page { type: string; isEnabled: boolean; portalType: string; + portalPid: string; entities: Entity[] | string[]; top: boolean; bottom: boolean;