diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 3edeabb..07612c2 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,9 +1,8 @@ -import {Component} from '@angular/core'; - +import {Component, Inject, RendererFactory2, ViewEncapsulation} from '@angular/core'; import {EnvProperties} from './openaireLibrary/utils/properties/env-properties'; import {MenuItem, RootMenuItem} from './openaireLibrary/sharedComponents/menu'; import {EnvironmentSpecificService} from './openaireLibrary/utils/properties/environment-specific.service'; -import {FilterInfo, PortalAggregators} from "./utils/aggregators"; +import {AggregatorInfo, PortalAggregators} from "./utils/aggregators"; import {UserManagementService} from "./openaireLibrary/services/user-management.service"; import {User} from "./openaireLibrary/login/utils/helper.class"; import {Header} from "./openaireLibrary/sharedComponents/navigationBar.component"; @@ -12,6 +11,7 @@ import {properties} from "../environments/environment"; import {ConnectHelper} from "./openaireLibrary/connect/connectHelper"; import {ConfigurationService} from "./openaireLibrary/utils/configuration/configuration.service"; import {Subscriber} from "rxjs"; +import {DOCUMENT} from "@angular/common"; @Component({ selector: 'app-root', @@ -52,12 +52,13 @@ export class AppComponent { loginCheck: boolean = false; footer = portalProperties.sectionFooter; header: Header; - agg: FilterInfo = null; + agg: AggregatorInfo = null; subscriptions = []; constructor(private propertiesService: EnvironmentSpecificService, - private userManagementService: UserManagementService, private configurationService: ConfigurationService) { + private userManagementService: UserManagementService, private configurationService: ConfigurationService, @Inject(DOCUMENT) private document, private rendererFactory: RendererFactory2) { this.id = ConnectHelper.getCommunityFromDomain(this.properties.domain); this.agg = PortalAggregators.getFilterInfoByMenuId(this.id); + this.setStyles(); this.configurationService.initStaticCommunityInformation(PortalAggregators.getCommunityInfoByMenuId(this.id)); } ngOnDestroy() { @@ -92,7 +93,8 @@ export class AppComponent { this.loginCheck = true; this.userMenuItems = []; if (this.user) { - this.userMenuItems.push(new MenuItem("", "User information", "", "/user-info", false, [], [], {})); + this.userMenuItems.push(new MenuItem("", "My links", "", "/myclaims", false, [], [], {})); + // this.userMenuItems.push(new MenuItem("", "User information", "", "/user-info", false, [], [], {})); } })); } @@ -122,4 +124,47 @@ export class AppComponent { this.menuItems[1].items.push(new MenuItem("", "Organizations", "", "/search/find/organizations", false, ["organization"], ["/search/find/organizations"], params)); } + setStyles(){ + let css:string =':root {\n'; + if(this.agg.mainColor){ + css = css.concat('--portal-main-color: ' + this.agg.mainColor + ';\n'); + } + if(this.agg.darkColor){ + css = css.concat('--portal-dark-color: ' + this.agg.darkColor + ';\n'); + } + if(this.agg.darkColor){ + css = css.concat("--graph-background: url('" + this.agg.background + "\') no-repeat bottom;\n"); + } + css = css.concat('}'); + + try { + if( this.document.getElementById('customStyle')){ + try { + this.document.getElementById('customStyle').append(css); + }catch(e){ + console.log("error with append style") + } + }else { + const renderer = this.rendererFactory.createRenderer(this.document, { + id: '-1', + encapsulation: ViewEncapsulation.None, + styles: [], + data: {} + }); + + const head = this.document.head; + if (head === null) { + throw new Error(' not found within DOCUMENT.'); + } + const style = renderer.createElement('style'); + renderer.setAttribute(style, "id", "customStyle"); + let CSSElement = renderer.createText(css); + renderer.appendChild(head, style); + renderer.appendChild(style, CSSElement); + } + } catch (e) { + console.error('Renderrer Error to append style ', e); + } + } + } diff --git a/src/app/home/home.component.html b/src/app/home/home.component.html index d2978b9..340d0f0 100644 --- a/src/app/home/home.component.html +++ b/src/app/home/home.component.html @@ -174,22 +174,26 @@ Our growing Community
-
-
+
+

- {{fundersSize.number|number}}{{fundersSize.size}} + + {{fundersSize.number|number}}{{fundersSize.size}}

Funders
-
+

- {{datasourcesSize.number|number}}{{datasourcesSize.size}} + + {{datasourcesSize.number|number}}{{datasourcesSize.size}}

Content providers
-
+

- {{projectsSize.number|number}}{{projectsSize.size}} + + {{projectsSize.number|number}}{{projectsSize.size}} +

Projects
@@ -201,69 +205,51 @@
-
-
+
+
-
-
{{publicationsSize.count|number}}
-
- - publications -
-
-
-
{{softwareSize.count|number}}
-
- - software -
-
-
-
{{otherSize.count|number}}
-
- - other research
products
- other research products -
-
-
-
{{datasetsSize.count|number}}
-
- - research data -
+ + {{publicationsSize.count|number}} +
+ + publications
-
+
-
-
{{softwareSize.count|number}}
-
- - software -
+ {{datasetsSize.count|number}} + +
+ + research data
-
-
{{datasetsSize.count|number}}
-
- - research data -
+
+
+
+
+ + {{softwareSize.count|number}} +
+ + software
-
-
{{otherSize.count|number}}
-
- - other research
products
- other research products -
+
+
+
+
+ {{otherSize.count|number}} +
+ + other research
products
+ other research products
diff --git a/src/app/home/home.component.ts b/src/app/home/home.component.ts index 8283331..93f3ba1 100644 --- a/src/app/home/home.component.ts +++ b/src/app/home/home.component.ts @@ -20,7 +20,7 @@ import { SEOService } from '../openaireLibrary/sharedComponents/SEO/SEO.service' import {SearchResearchResultsService} from "../openaireLibrary/services/searchResearchResults.service"; import {HelperService} from "../openaireLibrary/utils/helper/helper.service"; import {Filter} from "../openaireLibrary/searchPages/searchUtils/searchHelperClasses.class"; -import {FilterInfo, PortalAggregators} from "../utils/aggregators"; +import {AggregatorInfo, PortalAggregators} from "../utils/aggregators"; import {SearchCustomFilter} from "../openaireLibrary/searchPages/searchUtils/searchUtils.class"; import {properties} from "../../environments/environment"; import {portalProperties} from "../../environments/environment-aggregator"; @@ -75,7 +75,7 @@ export class HomeComponent { public pageContents = null; customFilter:SearchCustomFilter= null; aggregatorId; - aggregator:FilterInfo; + aggregator:AggregatorInfo; constructor ( private route: ActivatedRoute, private _router: Router, @@ -325,6 +325,11 @@ export class HomeComponent { parameterValues.push("" + this.resultsQuickFilter.selected); } } + }else if(this.selectedEntity == "all"){ + if (this.resultsQuickFilter) { + parameterNames.push("qf"); + parameterValues.push("true"); + } } if(this.keyword.length > 0) { parameterNames.push("fv0"); diff --git a/src/app/searchPages/advanced/advancedSearchDataProviders.component.ts b/src/app/searchPages/advanced/advancedSearchDataProviders.component.ts index 5a50719..0b843a9 100644 --- a/src/app/searchPages/advanced/advancedSearchDataProviders.component.ts +++ b/src/app/searchPages/advanced/advancedSearchDataProviders.component.ts @@ -1,6 +1,6 @@ import {Component} from '@angular/core'; import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class"; -import {FilterInfo, PortalAggregators} from "../../utils/aggregators"; +import {AggregatorInfo, PortalAggregators} from "../../utils/aggregators"; import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper"; import {properties} from "../../../environments/environment"; import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properties"; @@ -23,7 +23,7 @@ export class OpenaireAdvancedSearchDataProvidersComponent { ngOnInit() { this.properties = properties; let id = ConnectHelper.getCommunityFromDomain(properties.domain); - let agg: FilterInfo = PortalAggregators.getFilterInfoByMenuId(id); + let agg: AggregatorInfo = PortalAggregators.getFilterInfoByMenuId(id); this.customFilter = PortalAggregators.getSearchCustomFilterByAggregator(agg); } } diff --git a/src/app/searchPages/advanced/advancedSearchOrganizations.component.ts b/src/app/searchPages/advanced/advancedSearchOrganizations.component.ts index b3ee6e0..8974dde 100644 --- a/src/app/searchPages/advanced/advancedSearchOrganizations.component.ts +++ b/src/app/searchPages/advanced/advancedSearchOrganizations.component.ts @@ -1,6 +1,6 @@ import {Component} from '@angular/core'; import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class"; -import {FilterInfo, PortalAggregators} from "../../utils/aggregators"; +import {AggregatorInfo, PortalAggregators} from "../../utils/aggregators"; import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper"; import {properties} from "../../../environments/environment"; import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properties"; @@ -23,7 +23,7 @@ export class OpenaireAdvancedSearchOrganizationsComponent { ngOnInit() { this.properties = properties; let id = ConnectHelper.getCommunityFromDomain(properties.domain); - let agg: FilterInfo = PortalAggregators.getFilterInfoByMenuId(id); + let agg: AggregatorInfo = PortalAggregators.getFilterInfoByMenuId(id); this.customFilter = PortalAggregators.getSearchCustomFilterByAggregator(agg); } } diff --git a/src/app/searchPages/advanced/advancedSearchProjects.component.ts b/src/app/searchPages/advanced/advancedSearchProjects.component.ts index f8f3982..8ca0cdd 100644 --- a/src/app/searchPages/advanced/advancedSearchProjects.component.ts +++ b/src/app/searchPages/advanced/advancedSearchProjects.component.ts @@ -1,6 +1,6 @@ import {Component} from '@angular/core'; import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class"; -import {FilterInfo, PortalAggregators} from "../../utils/aggregators"; +import {AggregatorInfo, PortalAggregators} from "../../utils/aggregators"; import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper"; import {properties} from "../../../environments/environment"; import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properties"; @@ -22,7 +22,7 @@ export class OpenaireAdvancedSearchProjectsComponent { ngOnInit() { this.properties = properties; let id = ConnectHelper.getCommunityFromDomain(properties.domain); - let agg: FilterInfo = PortalAggregators.getFilterInfoByMenuId(id); + let agg: AggregatorInfo = PortalAggregators.getFilterInfoByMenuId(id); this.customFilter = PortalAggregators.getSearchCustomFilterByAggregator(agg); } } diff --git a/src/app/searchPages/advanced/searchResearchResults.component.ts b/src/app/searchPages/advanced/searchResearchResults.component.ts index c43ed56..9bb5fa8 100644 --- a/src/app/searchPages/advanced/searchResearchResults.component.ts +++ b/src/app/searchPages/advanced/searchResearchResults.component.ts @@ -1,5 +1,5 @@ import {Component, Input} from '@angular/core'; -import {FilterInfo, PortalAggregators} from "../../utils/aggregators"; +import {AggregatorInfo, PortalAggregators} from "../../utils/aggregators"; import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class"; import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper"; import {properties} from "../../../environments/environment"; @@ -20,7 +20,7 @@ export class OpenaireSearchResearchResultsComponent { ngOnInit() { this.properties = properties; let id = ConnectHelper.getCommunityFromDomain(properties.domain); - let agg: FilterInfo = PortalAggregators.getFilterInfoByMenuId(id); + let agg: AggregatorInfo = PortalAggregators.getFilterInfoByMenuId(id); this.customFilter = PortalAggregators.getSearchCustomFilterByAggregator(agg); } } diff --git a/src/app/searchPages/find/search.component.ts b/src/app/searchPages/find/search.component.ts index c076977..a642e4e 100644 --- a/src/app/searchPages/find/search.component.ts +++ b/src/app/searchPages/find/search.component.ts @@ -1,6 +1,6 @@ import {Component} from '@angular/core'; import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class"; -import {FilterInfo, PortalAggregators} from "../../utils/aggregators"; +import {AggregatorInfo, PortalAggregators} from "../../utils/aggregators"; import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper"; import {properties} from "../../../environments/environment"; @@ -15,7 +15,7 @@ export class OpenaireSearchComponent{ constructor ( ) {} ngOnInit() { let id = ConnectHelper.getCommunityFromDomain(properties.domain); - let agg:FilterInfo = PortalAggregators.getFilterInfoByMenuId(id); + let agg:AggregatorInfo = PortalAggregators.getFilterInfoByMenuId(id); this.customFilter = PortalAggregators.getSearchCustomFilterByAggregator(agg); } diff --git a/src/app/searchPages/simple/searchDataproviders.component.ts b/src/app/searchPages/simple/searchDataproviders.component.ts index 08e90c1..ea3329f 100644 --- a/src/app/searchPages/simple/searchDataproviders.component.ts +++ b/src/app/searchPages/simple/searchDataproviders.component.ts @@ -1,6 +1,6 @@ import {Component} from '@angular/core'; import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class"; -import {FilterInfo, PortalAggregators} from "../../utils/aggregators"; +import {AggregatorInfo, PortalAggregators} from "../../utils/aggregators"; import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper"; import {properties} from "../../../environments/environment"; import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properties"; @@ -21,7 +21,7 @@ export class OpenaireSearchDataprovidersComponent { ngOnInit() { this.properties = properties; let id = ConnectHelper.getCommunityFromDomain(properties.domain); - let agg: FilterInfo = PortalAggregators.getFilterInfoByMenuId(id); + let agg: AggregatorInfo = PortalAggregators.getFilterInfoByMenuId(id); this.customFilter = PortalAggregators.getSearchCustomFilterByAggregator(agg); } } diff --git a/src/app/searchPages/simple/searchOrganizations.component.ts b/src/app/searchPages/simple/searchOrganizations.component.ts index 08c5aad..6ab4874 100644 --- a/src/app/searchPages/simple/searchOrganizations.component.ts +++ b/src/app/searchPages/simple/searchOrganizations.component.ts @@ -1,6 +1,6 @@ import {Component} from '@angular/core'; import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class"; -import {FilterInfo, PortalAggregators} from "../../utils/aggregators"; +import {AggregatorInfo, PortalAggregators} from "../../utils/aggregators"; import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper"; import {properties} from "../../../environments/environment"; import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properties"; @@ -22,7 +22,7 @@ export class OpenaireSearchOrganizationsComponent { ngOnInit() { this.properties = properties; let id = ConnectHelper.getCommunityFromDomain(properties.domain); - let agg:FilterInfo = PortalAggregators.getFilterInfoByMenuId(id); + let agg:AggregatorInfo = PortalAggregators.getFilterInfoByMenuId(id); this.customFilter = PortalAggregators.getSearchCustomFilterByAggregator(agg); } } diff --git a/src/app/searchPages/simple/searchProjects.component.ts b/src/app/searchPages/simple/searchProjects.component.ts index f5397a6..4e4d9a1 100644 --- a/src/app/searchPages/simple/searchProjects.component.ts +++ b/src/app/searchPages/simple/searchProjects.component.ts @@ -1,6 +1,6 @@ import {Component} from '@angular/core'; import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class"; -import {FilterInfo, PortalAggregators} from "../../utils/aggregators"; +import {AggregatorInfo, PortalAggregators} from "../../utils/aggregators"; import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper"; import {properties} from "../../../environments/environment"; import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properties"; @@ -21,7 +21,7 @@ export class OpenaireSearchProjectsComponent { ngOnInit() { this.properties = properties; let id = ConnectHelper.getCommunityFromDomain(properties.domain); - let agg: FilterInfo = PortalAggregators.getFilterInfoByMenuId(id); + let agg: AggregatorInfo = PortalAggregators.getFilterInfoByMenuId(id); this.customFilter = PortalAggregators.getSearchCustomFilterByAggregator(agg); } } diff --git a/src/app/searchPages/simple/searchResearchResults.component.ts b/src/app/searchPages/simple/searchResearchResults.component.ts index 4a8bdfd..ed213bb 100644 --- a/src/app/searchPages/simple/searchResearchResults.component.ts +++ b/src/app/searchPages/simple/searchResearchResults.component.ts @@ -1,6 +1,6 @@ import {Component, Input} from '@angular/core'; import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class"; -import {FilterInfo, PortalAggregators} from "../../utils/aggregators"; +import {AggregatorInfo, PortalAggregators} from "../../utils/aggregators"; import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper"; import {properties} from "../../../environments/environment"; import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properties"; @@ -20,7 +20,7 @@ export class OpenaireSearchResearchResultsComponent { ngOnInit() { this.properties = properties; let id = ConnectHelper.getCommunityFromDomain(properties.domain); - let agg:FilterInfo = PortalAggregators.getFilterInfoByMenuId(id); + let agg:AggregatorInfo = PortalAggregators.getFilterInfoByMenuId(id); this.customFilter = PortalAggregators.getSearchCustomFilterByAggregator(agg); } } diff --git a/src/app/utils/aggregators.ts b/src/app/utils/aggregators.ts index 0167a1e..77ca988 100644 --- a/src/app/utils/aggregators.ts +++ b/src/app/utils/aggregators.ts @@ -1,7 +1,7 @@ import {SearchCustomFilter} from "../openaireLibrary/searchPages/searchUtils/searchUtils.class"; import {Portal} from "../openaireLibrary/utils/entities/adminTool/portal"; -export class FilterInfo { +export class AggregatorInfo { menuId: string; title: string; logoUrl: string; @@ -9,8 +9,11 @@ export class FilterInfo { queryFieldName: string; //country valueId: string; //gr valueName: string; // Greece + mainColor:string; + darkColor:string; + background:string; - constructor(menuId: string, title: string, logoUrl: string, fieldName: string, queryFieldName: string, valueId: string, valueName: string) { + constructor(menuId: string, title: string, logoUrl: string, fieldName: string, queryFieldName: string, valueId: string, valueName: string, mainColor:string=null, darkColor:string=null, background:string=null) { this.menuId = menuId; this.title = title; this.logoUrl = logoUrl; @@ -18,28 +21,31 @@ export class FilterInfo { this.queryFieldName = queryFieldName; this.valueId = valueId; this.valueName = valueName; + this.mainColor = mainColor; + this.darkColor = darkColor; + this.background = background; } } export class PortalAggregators { - static list: FilterInfo[] = [ - new FilterInfo("canada", "Canadian Aggregator", "assets/canada-logo.png", "Country", "country", "CA", "Canada"), - new FilterInfo("italy", "Italian Aggregator", "assets/common-assets/logo-small-aggregator.png", "Country", "country", "IT", "Italy"), - new FilterInfo("greece", "Greek Aggregator", "assets/common-assets/logo-small-aggregator.png", "Country", "country", "GR", "Greece"), + static list: AggregatorInfo[] = [ + new AggregatorInfo("canada", "Canadian Aggregator", "assets/canada-logo.png", "Country", "country", "CA", "Canada","#E80000","#ad0000", "/assets/canada-background.svg" ), + new AggregatorInfo("italy", "Italian Aggregator", "assets/common-assets/logo-small-aggregator.png", "Country", "country", "IT", "Italy"), + new AggregatorInfo("greece", "Greek Aggregator", "assets/common-assets/logo-small-aggregator.png", "Country", "country", "GR", "Greece"), ]; static disabled = { - "canada": {pages: [], entities: ["software"]}, + "canada": {pages: [], entities: []}, "italy": {pages: [], entities: []}, - "greece": {pages: [], entities: []} + "greece": {pages: [], entities: ["dataset"]} }; - static defaultAggregator: FilterInfo = PortalAggregators.list[0]; + static defaultAggregator: AggregatorInfo = PortalAggregators.list[0]; - public static getList(): FilterInfo[] { + public static getList(): AggregatorInfo[] { return PortalAggregators.list; } - public static getFilterInfoByMenuId(menuId: string): FilterInfo { + public static getFilterInfoByMenuId(menuId: string): AggregatorInfo { for (let agg of this.getList()) { if (agg.menuId == menuId) { return agg; @@ -48,7 +54,7 @@ export class PortalAggregators { return PortalAggregators.defaultAggregator; } - public static getSearchCustomFilterByAggregator(agg: FilterInfo): SearchCustomFilter { + public static getSearchCustomFilterByAggregator(agg: AggregatorInfo): SearchCustomFilter { let filter:SearchCustomFilter = null; if(agg) { filter = new SearchCustomFilter(agg.fieldName, agg.queryFieldName, agg.valueId, agg.valueName); diff --git a/src/assets/portal-custom.css b/src/assets/portal-custom.css index 01f1d7d..c74abad 100644 --- a/src/assets/portal-custom.css +++ b/src/assets/portal-custom.css @@ -1,14 +1,16 @@ :root { - --portal-main-color: #E80000; + --portal-main-color: #2d72d6; --portal-main-contrast: white; - --portal-dark-color: #ad0000; + --portal-dark-color: #313179; --openaire-main-color: #313179; + --graph-background: no-repeat bottom;; } .graph-background { background-size: cover !important; padding-bottom: 100px; - background: #FAFAFA url('/assets/canada-background.svg') no-repeat bottom; + background-color: #FAFAFA !important; + background: var(--graph-background); } .mainPageSearchForm{ background-color: white !important; @@ -46,3 +48,6 @@ .numbers-background { background: transparent url('numbers_background_pattern.svg') 0 0 repeat-x padding-box; } +.number { + color: #1d1d1d; +} diff --git a/src/environments/environment.beta.ts b/src/environments/environment.beta.ts index 3842500..74c76c2 100644 --- a/src/environments/environment.beta.ts +++ b/src/environments/environment.beta.ts @@ -4,7 +4,7 @@ export let properties: EnvProperties = { environment: "beta", adminToolsPortalType: "aggregator", dashboard: "explore", - enablePiwikTrack: true, + enablePiwikTrack: false, useCache: false, useLongCache: true, showAddThis: true, diff --git a/src/index.beta.html b/src/index.beta.html index ce4c1a4..996a849 100644 --- a/src/index.beta.html +++ b/src/index.beta.html @@ -39,7 +39,7 @@ - + Search OpenAIRE diff --git a/src/index.html b/src/index.html index ce4c1a4..996a849 100644 --- a/src/index.html +++ b/src/index.html @@ -39,7 +39,7 @@ - + Search OpenAIRE diff --git a/src/index.prod.html b/src/index.prod.html index ce4c1a4..996a849 100644 --- a/src/index.prod.html +++ b/src/index.prod.html @@ -39,7 +39,7 @@ - + Search OpenAIRE