From dbbb832bff746f73c0bbcc416ee09bdbcd77b9e4 Mon Sep 17 00:00:00 2001 From: argirok Date: Mon, 1 Aug 2022 17:32:25 +0300 Subject: [PATCH] Connect Admin Customization: create button that updates layout timestamp and create new css files --- .../sharedComponents/admin-tabs/admin-tabs.component.ts | 3 ++- services/layout.service.ts | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/dashboard/sharedComponents/admin-tabs/admin-tabs.component.ts b/dashboard/sharedComponents/admin-tabs/admin-tabs.component.ts index a5f3d12d..5fdcd555 100644 --- a/dashboard/sharedComponents/admin-tabs/admin-tabs.component.ts +++ b/dashboard/sharedComponents/admin-tabs/admin-tabs.component.ts @@ -14,6 +14,7 @@ import { properties } from 'src/environments/environment';
  • Entities
  • Menu
  • Classes
  • +
  • Customization
  • ` }) @@ -25,7 +26,7 @@ export class AdminTabsComponent implements OnInit { @Input() public user: User; @Input() - public tab: "portal" | "page" | "entity" | "menu" | "class" = 'page'; + public tab: "portal" | "page" | "entity" | "menu" | "class" | "customization"= 'page'; private subscriptions: any[] = []; constructor(private route: ActivatedRoute, private userManagementService: UserManagementService) { diff --git a/services/layout.service.ts b/services/layout.service.ts index 4d00aa10..7282a872 100644 --- a/services/layout.service.ts +++ b/services/layout.service.ts @@ -24,9 +24,9 @@ export class LayoutService { return this.http.post(connectPortalUrl + "/build-css/" + (layout?"preview/":"") + pid + (suffix?("/"+ suffix):""), layout ); } - saveLayout(properties: EnvProperties, pid: string, layout: Layout): Observable { + saveLayout(properties: EnvProperties, pid: string, layout: Layout, portalType = null): Observable { LayoutService.removeNulls(layout); - return this.http.post(properties.adminToolsAPIURL + '/' + properties.adminToolsPortalType + '/' + return this.http.post(properties.adminToolsAPIURL + '/' + (portalType?portalType: properties.adminToolsPortalType) + '/' + pid + '/layout', layout, CustomOptions.getAuthOptionsWithBody()); } @@ -34,7 +34,9 @@ export class LayoutService { return this.http.get(properties.adminToolsAPIURL+"/" + properties.adminToolsPortalType + '/' + pid + '/layout'); } - + getLayouts(properties: EnvProperties): Observable { + return this.http.get(properties.adminToolsAPIURL+'/community/layouts'); + } mockLayout(): any { return this.http.get('./assets/customizationOptions.json') ;