diff --git a/connect/community/CustomizationOptions.ts b/connect/community/CustomizationOptions.ts index 988c758f..a1078074 100644 --- a/connect/community/CustomizationOptions.ts +++ b/connect/community/CustomizationOptions.ts @@ -1,11 +1,37 @@ +import {properties} from "../../../../environments/environment"; + export class Layout { _id:string; portalPid:string; layoutOptions:CustomizationOptions; + date; constructor(community, options:CustomizationOptions){ this.portalPid = community; this.layoutOptions = options; } + + public static getVariables(options: CustomizationOptions): {} | null { + if(options) { + let variables = {}; + if(options.identity) { + variables['@global-primary-background'] = options.identity.mainColor; + variables['@global-secondary-background'] = options.identity.secondaryColor; + variables['@primary-color'] = options.identity.mainColor; + variables['@secondary-color'] = options.identity.secondaryColor; + } + if(options.backgrounds){ + variables['@general-search-form-background'] = options.backgrounds.form.color; + variables['@general-search-form-background-image'] = (options.backgrounds.form.imageFile?(this.getUrl(properties.utilsService + '/download/' +options.backgrounds.form.imageFile)): 'none') ; + variables['@base-body-background'] = options.backgrounds.light.color; + } + return variables; + } + return null; + } + public static getUrl(url){ + return 'url("' + url + '")'; + } + } export class CustomizationOptions { identity: { diff --git a/connect/connectHelper.ts b/connect/connectHelper.ts index 18bde834..321beae8 100644 --- a/connect/connectHelper.ts +++ b/connect/connectHelper.ts @@ -18,7 +18,7 @@ export class ConnectHelper { if ( domain.indexOf('beta') !== -1) { domain = domain.substr(domain.indexOf('.') + 1, domain.length); domain = domain.substr(0, domain.indexOf('.')); - } else if (domain.indexOf('test.') !== -1) { + } else if (domain.indexOf('test.') !== -1 && !(properties.adminToolsPortalType == "connect" || properties.adminToolsPortalType == "community")) { return null; } else { domain = domain.substr(0, domain.indexOf('.')); diff --git a/dashboard/menu/menu.component.html b/dashboard/menu/menu.component.html index ab3c185c..777914b3 100644 --- a/dashboard/menu/menu.component.html +++ b/dashboard/menu/menu.component.html @@ -66,7 +66,7 @@ {{item.type == 'external' ? item.url : item.route}}
- This menu item is not visible because the page is disabled + This menu item will not visible because the page is disabled
diff --git a/dashboard/menu/menu.component.ts b/dashboard/menu/menu.component.ts index a8917200..186f77b7 100644 --- a/dashboard/menu/menu.component.ts +++ b/dashboard/menu/menu.component.ts @@ -374,7 +374,9 @@ export class MenuComponent implements OnInit { public moveElement(index: number, newIndex: number, children: MenuItemExtended[] = []) { this.elements.init(); - this.subElements.init(); + if(children && children.length) { + this.subElements.init(); + } if(this.selectedMenuType == 'customMenu') { let temp = HelperFunctions.copy(this.featuredMenuItems); HelperFunctions.swap(temp, index, newIndex); diff --git a/searchPages/searchUtils/searchUtils.class.ts b/searchPages/searchUtils/searchUtils.class.ts index 2f687806..f3cc2ace 100644 --- a/searchPages/searchUtils/searchUtils.class.ts +++ b/searchPages/searchUtils/searchUtils.class.ts @@ -1,3 +1,5 @@ +import {properties} from "../../../../environments/environment"; + export class SearchUtilsClass{ page:number = 1; size:number = 10; @@ -27,6 +29,9 @@ export class SearchCustomFilter{ selected:boolean; promptToAddFilter:boolean; constructor( fieldName:string, queryFieldName:string, valueId:string, valueName:string ){ + if(valueId == "test" && properties.environment == "development"){ + valueId = "covid-19"; + } this.isHiddenFilter = true; this.fieldName = fieldName; this.queryFieldName = queryFieldName; diff --git a/services/layout.service.ts b/services/layout.service.ts index 4013d4e6..f5e9f53c 100644 --- a/services/layout.service.ts +++ b/services/layout.service.ts @@ -20,6 +20,9 @@ export class LayoutService { } } } + createCSS( pid: string, suffix = null, layout = null): Observable { + return this.http.post("http://scoobydoo.di.uoa.gr:4200/build-css/" + (layout?"preview/":"") + pid + (suffix?("/"+ suffix):""), layout ); + } saveLayout(properties: EnvProperties, pid: string, layout: Layout): Observable { LayoutService.removeNulls(layout); diff --git a/sharedComponents/navigationBar.component.html b/sharedComponents/navigationBar.component.html index 8eec8c76..875e8a40 100644 --- a/sharedComponents/navigationBar.component.html +++ b/sharedComponents/navigationBar.component.html @@ -180,7 +180,7 @@ - +
  • @@ -235,8 +235,8 @@
  • - - + +
    diff --git a/sharedComponents/navigationBar.component.ts b/sharedComponents/navigationBar.component.ts index fab308ad..4084e21a 100644 --- a/sharedComponents/navigationBar.component.ts +++ b/sharedComponents/navigationBar.component.ts @@ -56,6 +56,8 @@ export class NavigationBarComponent implements OnInit, OnDestroy { public additionalMenuItems: MenuItem[] = []; public featuredMenuItems: MenuItem[] = []; + public isMenuEnabled: boolean = false; + public isFeaturedMenuEnabled: boolean = false; constructor(private router: Router, private route: ActivatedRoute, @@ -119,6 +121,8 @@ export class NavigationBarComponent implements OnInit, OnDestroy { this.subs.push( this._helpContentService.getMenuItems(this.portal).subscribe( data => { + this.isMenuEnabled = data.isMenuEnabled; + this.isFeaturedMenuEnabled = data.isFeaturedMenuEnabled; this.featuredMenuItems = data.featuredMenuItems; this.additionalMenuItems = data.menuItems; },