[Trunk|Connect]: Portal color is loaded from AdminTools. AdminToolUrl:mpagasas(for test)

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@55026 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
k.triantafyllou 2019-03-19 10:25:25 +00:00
parent f864e33f01
commit f8ff5d1c3d
3 changed files with 15 additions and 7 deletions

View File

@ -8,6 +8,7 @@ import { EnvironmentSpecificService} from './openaireLibrary/utils/properties/en
import {CommunitiesService} from "./openaireLibrary/connect/communities/communities.service";
import {Session} from './openaireLibrary/login/utils/helper.class';
import {ConnectHelper} from './openaireLibrary/connect/connectHelper';
import {LayoutService} from "./openaireLibrary/services/layout.service";
@Component({
//changeDetection: ChangeDetectionStrategy.Default,
@ -44,7 +45,6 @@ import {ConnectHelper} from './openaireLibrary/connect/connectHelper';
export class AppComponent {
isClient:boolean = false;
userMenuItems:MenuItem[] =[];
@ -54,8 +54,10 @@ export class AppComponent {
properties:EnvProperties;
showMenu:boolean = false;
communities = null;
layout = null;
// community: {id:string, name:string, logoUrl:string};
constructor( private route: ActivatedRoute, private propertiesService:EnvironmentSpecificService, private _communitiesService:CommunitiesService, private injector: Injector) {
constructor( private route: ActivatedRoute, private propertiesService:EnvironmentSpecificService,
private _communitiesService:CommunitiesService, private _layoutService: LayoutService) {
}
@ -75,6 +77,13 @@ export class AppComponent {
if((data['communityId'] && data['communityId']!="" && com.communityId == data['communityId'])
|| (ConnectHelper.getCommunityFromDomain(this.properties.domain) == com.communityId ) ){
community = com;
this._layoutService.getLayout(com.communityId,
this.properties.adminToolsAPIURL + '/').subscribe (
layout => {
this.layout = layout;
document.documentElement.style.setProperty('--portal-main-color', this.layout.color);
}
);
this.community = {id: community.communityId, name: (community.shortTitle)?community.shortTitle:community.title, logoUrl:community.logoUrl};
this.menuItems= [
// {rootItem: new MenuItem("dashboard","Dashboard","","/",false,[],[],this.properties.environment!="development"?{}:{communityId:community.communityId}),

View File

@ -21,9 +21,8 @@ import {NavigationBarModule} from './openaireLibrary/sharedComponent
import {EnvironmentSpecificResolver} from './openaireLibrary/utils/properties/environmentSpecificResolver';
// import {CommunityService} from './openaireLibrary/connect/community/community.service';
import {CommunitiesService} from './openaireLibrary/connect/communities/communities.service';
//import { LibSearchProjectsModule } from './searchPages/simple/searchProjects.module';
import {LayoutService} from "./openaireLibrary/services/layout.service";
@NgModule({
@ -38,11 +37,11 @@ import {CommunitiesService} from './openaireLibrary/connect/communi
NavigationBarModule, FeedbackModule, BottomModule,
CookieLawModule,
BrowserModule.withServerTransition({appId: 'my-app'}),
AppRoutingModule,//,LibSearchProjectsModule
AppRoutingModule
],
declarations: [ AppComponent, OpenaireErrorPageComponent],
exports: [ AppComponent ],
providers:[EnvironmentSpecificResolver, CommunitiesService ],
providers:[EnvironmentSpecificResolver, CommunitiesService, LayoutService],
bootstrap: [AppComponent]
})
//

View File

@ -52,7 +52,7 @@
"cacheUrl" :"http://scoobydoo.di.uoa.gr:3000/get?url=",
"adminToolsAPIURL" :"http://duffy.di.uoa.gr:8080/uoa-admin-tools",
"adminToolsAPIURL" :"http://mpagasas.di.uoa.gr:8080/uoa-admin-tools",
"adminToolsCommunity" :"openaire",
"datasourcesAPI": "https://beta.services.openaire.eu/openaire/ds/search/",