diff --git a/server.ts b/server.ts index 650a951..1fa5859 100644 --- a/server.ts +++ b/server.ts @@ -66,13 +66,13 @@ app.set('view engine', 'html'); app.set('views', join(DIST_FOLDER, 'browser')); // Allow frames from specific domains app.use(function (req, res, next) { - var XFRAME_WHITELIST = [ 'http://scoobydoo.di.uoa.gr:5000/customize-layout', 'https://beta.admin.connect.openaire.eu/customize-layout','https://admin.connect.openaire.eu/customize-layout' ]; + var XFRAME_WHITELIST = [ 'http://spitoo.di.uoa.gr:5000/','http://scoobydoo.di.uoa.gr:5000/', 'https://beta.admin.connect.openaire.eu/','https://admin.connect.openaire.eu/' ]; let referer: string; if(req.headers.referer){ referer = isArray(req.headers.referer)?req.headers.referer[0]:(req.headers.referer); referer = referer.split("?")[0]; } - if ( referer && (XFRAME_WHITELIST.indexOf(referer) != -1 || referer.indexOf(".d4science.org") != -1)) { + if ( referer && (XFRAME_WHITELIST.indexOf(referer) != -1 || referer.indexOf("/customize-layout") !=-1 || referer.indexOf(".d4science.org") != -1)) { // res.header('X-FRAME-OPTIONS', 'allow from ' +req.headers.referer); }else { res.header('X-FRAME-OPTIONS', 'SAMEORIGIN'); diff --git a/src/app/affiliations/affiliations.component.html b/src/app/affiliations/affiliations.component.html index ca546a8..d456941 100644 --- a/src/app/affiliations/affiliations.component.html +++ b/src/app/affiliations/affiliations.component.html @@ -2,8 +2,8 @@ - +
-
+
diff --git a/src/app/community/community.component.ts b/src/app/community/community.component.ts index c3778c2..2f2fc93 100644 --- a/src/app/community/community.component.ts +++ b/src/app/community/community.component.ts @@ -75,7 +75,6 @@ export class CommunityComponent { subscribers: number = 0; - // TODO Unsubscribe subs: Subscription[] = []; @ViewChild(StatisticsForDashboardComponent) statistics: StatisticsForDashboardComponent = null; diff --git a/src/app/demo/demo.component.html b/src/app/demo/demo.component.html index 3b830f6..a6f21df 100644 --- a/src/app/demo/demo.component.html +++ b/src/app/demo/demo.component.html @@ -1,24 +1,59 @@ +
-
-
- - -
-
- Link -
+ class="uk-padding generalSearchForm midBackground "> +
+
+

+ Lorem ipsum dolor sit amet +

+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit +
+
+
+
+
+ + + +
+
-
- Summary tab -
+
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. +
+
+ Created: 01-Jan-2020 + + Members: + 1024 +
+
+ Projects: 567 + + + Content providers: + + 123 +
+
+
+
Recent publications
+ + +
+
+
+ + +
Dark background
@@ -35,7 +74,8 @@

Heading

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent mollis velit ornare, auctor lectus at, rutrum magna. Aenean vehicula elementum lacinia.
Link - +
+
diff --git a/src/app/demo/demo.component.ts b/src/app/demo/demo.component.ts index aa79d44..5872137 100644 --- a/src/app/demo/demo.component.ts +++ b/src/app/demo/demo.component.ts @@ -1,7 +1,11 @@ import {Component, OnInit} from '@angular/core'; import {EnvProperties} from "../openaireLibrary/utils/properties/env-properties"; -import {ActivatedRoute, Router} from "@angular/router"; -import {HelperService} from "../openaireLibrary/utils/helper/helper.service"; +import {ActivatedRoute} from "@angular/router"; +import {CustomizationOptions} from "../openaireLibrary/connect/community/CustomizationOptions"; +import {StringUtils} from "../openaireLibrary/utils/string-utils.class"; +import {ResultPreview} from "../openaireLibrary/utils/result-preview/result-preview"; +import {properties} from "../../environments/environment"; +import {ResultLandingInfo} from "../openaireLibrary/utils/entities/resultLandingInfo"; @Component({ @@ -11,15 +15,43 @@ import {HelperService} from "../openaireLibrary/utils/helper/helper.service"; export class DemoComponent implements OnInit{ - properties:EnvProperties; - - constructor(private route: ActivatedRoute, - private _router: Router, - private helper: HelperService) { + properties:EnvProperties; + layout: CustomizationOptions = null; + result: ResultPreview; + resultLanding:ResultLandingInfo; + constructor(private route: ActivatedRoute) { } ngOnInit(): void { + this.properties = properties; + this.route.queryParams.subscribe(params => { + if (params['layout']) { + this.layout = JSON.parse(StringUtils.URIDecode(params['layout'])); + } + }); + this.result = new ResultPreview(); + this.resultLanding = new ResultLandingInfo(); + this.result.resultType = "Publication"; + this.resultLanding.types = this.result.types = ["Article"]; + this.resultLanding.accessMode = this.result.accessMode = "Open Access"; + this.resultLanding.description = this.result.description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." + this.resultLanding.authors = this.result.authors = [{fullName: "Lorem ipsum", orcid: "0000-1111-2222-3333", orcid_pending: null}, {fullName: "Lorem ipsum", orcid: null, orcid_pending: "0000-1111-2222-3333"},{fullName: "Lorem ipsum", orcid: null, orcid_pending: null}]; + this.resultLanding.title = this.result.title = "Lorem ipsum dolor sit amet, consectetur adipiscing elit"; + this.resultLanding.fundedByProjects = this.result.projects = [{id: "XYZ", acronym: "Project acronym", title: "Project name", funderShortname: "Funder acronym", funderName: "Funder name", code:" project code"}] + this.resultLanding.countries = this.result.countries = ["Greece"]; + this.resultLanding.languages = this.result.languages = ["GR"]; + this.resultLanding.identifiers = this.result.identifiers = new Map(); + this.result.identifiers.set("doi",["DOI/1","DOI/2"]); + this.resultLanding.date = this.result.year = "2020"; + this.resultLanding.publisher = "Publisher name"; + this.resultLanding.journal = {journal: "Journal name", lissn: null}; + this.resultLanding.subjects = ["Subject 1", "Subject 2"]; + this.resultLanding.contexts = [{ "labelContext": "Research Community", "idContext": "", + "labelCategory":"", "idCategory": "", + "labelConcept": "", "idConcept": "", "inline" :true }] + this.resultLanding.objIdentifier ="re3data_____::db814dc656a911b556dba42a331cebe9"; + } diff --git a/src/app/demo/demo.module.ts b/src/app/demo/demo.module.ts index e608168..ecf901b 100644 --- a/src/app/demo/demo.module.ts +++ b/src/app/demo/demo.module.ts @@ -4,6 +4,9 @@ import {DemoComponent} from "./demo.component"; import {CommonModule} from "@angular/common"; import {RouterModule} from "@angular/router"; import {TabsModule} from "../openaireLibrary/utils/tabs/tabs.module"; +import {CustomizationModule} from "../utils/customization/customization.module"; +import {ResultPreviewModule} from "../openaireLibrary/utils/result-preview/result-preview.module"; +import {ResultLandingModule} from "../openaireLibrary/landingPages/result/resultLanding.module"; @NgModule({ imports: [ @@ -12,7 +15,10 @@ import {TabsModule} from "../openaireLibrary/utils/tabs/tabs.module"; RouterModule.forChild([ {path: '', component: DemoComponent} ]), - TabsModule + TabsModule, + CustomizationModule, + ResultPreviewModule, + ResultLandingModule ], declarations: [ DemoComponent diff --git a/src/app/utils/customization/customization.component.ts b/src/app/utils/customization/customization.component.ts index 5734f1f..b680436 100644 --- a/src/app/utils/customization/customization.component.ts +++ b/src/app/utils/customization/customization.component.ts @@ -4,8 +4,6 @@ import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properti import {LayoutService} from "../../openaireLibrary/services/layout.service"; import {CustomizationOptions} from "../../openaireLibrary/connect/community/CustomizationOptions"; import {DOCUMENT} from "@angular/common"; -import {DomSanitizer} from "@angular/platform-browser"; -import {StringUtils} from "../../openaireLibrary/utils/string-utils.class"; @Component({ selector: 'customization', @@ -19,42 +17,10 @@ export class CustomizationComponent { customizationCss:string = ""; - constructor(private route: ActivatedRoute, - private router: Router, private _layoutService: LayoutService, @Inject(DOCUMENT) private document, private rendererFactory: RendererFactory2, private sanitizer: DomSanitizer - ) { - + constructor(private route: ActivatedRoute,private router: Router, private _layoutService: LayoutService, @Inject(DOCUMENT) private document, private rendererFactory: RendererFactory2) { } public ngOnInit() { - console.log("cust init") - this._layoutService.getLayout(this.properties, this.communityId).subscribe( - layout => { - if (layout) { - console.debug("service"); - this.layout = CustomizationOptions.checkForObsoleteVersion(layout.layoutOptions,this.communityId); - } else { - this.layout = new CustomizationOptions(CustomizationOptions.getIdentity(this.communityId).mainColor, CustomizationOptions.getIdentity(this.communityId).secondaryColor); - console.debug("default"); - } - this.privateAppendCss(); - }, - error => { - console.log(" Layout not found - use default"); - this.layout = new CustomizationOptions(); - this.privateAppendCss(); - } - ); - this.route.queryParams.subscribe(params => { - if(params['layout']) { - this.layout = JSON.parse(StringUtils.URIDecode(params['layout'])); - this.privateAppendCss(); - }else{ - - } - }); - // this.privateAppendCss(); - } - privateAppendCss(){ this.buildCss(); try { @@ -105,6 +71,12 @@ export class CustomizationComponent { this.customizationCss = this.customizationCss.concat('.generalSearchForm,.publicationsSearchForm,.projectsSearchForm, .projectsTableSearchForm,.organizationsSearchForm,.datasourcesSearchForm {'); this.customizationCss = this.customizationCss.concat(' background: ' + "url('" + svg + "') transparent no-repeat center bottom }"); + //Button link SVG + let arrow = ``;; + let svg_arrow = 'data:image/svg+xml,' + encodeURIComponent(arrow.split('{{color}}').join(this.layout.identity.mainColor)); + this.customizationCss = this.customizationCss.concat('.uk-button-text::before {'); + this.customizationCss = this.customizationCss.concat(' background-image: ' + "url('" + svg_arrow + "') !important}"); + this.customizationCss = this.customizationCss.concat(' .communityPanelBackground, .communityPanelBackground .uk-section-primary {'); this.customizationCss = this.customizationCss.concat(' background-color: ' + this.layout.backgrounds.dark.color + ';}'); this.customizationCss = this.customizationCss.concat(' .uk-button:not(.uk-button-text){'); diff --git a/src/app/utils/piwikHelper.ts b/src/app/utils/piwikHelper.ts index 96bbeed..07f48ab 100644 --- a/src/app/utils/piwikHelper.ts +++ b/src/app/utils/piwikHelper.ts @@ -22,17 +22,7 @@ export class PiwikHelper{ "enermaps":318, "galaxy":453 }; - public static siteIDsProduction={ - "dh-ch":198, - "sdsn-gr":200, - "fam":197, - "mes":196, - "ni":199 - }; public static getSiteId(communityId:string, environment:string){ - // if(environment == 'production' && this.siteIDsProduction[communityId]){ - // return this.siteIDsProduction[communityId]; - // } return this.siteIDs[communityId]; } diff --git a/src/assets/connect-custom.css b/src/assets/connect-custom.css index e7241a7..8af1fc9 100644 --- a/src/assets/connect-custom.css +++ b/src/assets/connect-custom.css @@ -162,11 +162,7 @@ a:hover .user-circle-background { } .coloredBackground, .coloredBackground:focus, .coloredBackground:hover { - background-color: var(--background-light-color); -} - -.coloredBackground:hover { - opacity: 0.9; + background-color: transparent; } .generalSearchForm .subtitle{ diff --git a/src/assets/customization.css b/src/assets/customization.css index f5c8b1c..ca97848 100644 --- a/src/assets/customization.css +++ b/src/assets/customization.css @@ -85,7 +85,8 @@ a:not(.uk-button), .uk-navbar-dropdown-nav>li.uk-active>a, .uk-tab>.uk-active>a, .uk-navbar-nav>li.uk-active>a, -.uk-navbar-container:not(.uk-navbar-transparent) .uk-navbar-nav>li.uk-active>a +.uk-navbar-container:not(.uk-navbar-transparent) .uk-navbar-nav>li.uk-active>a, +.uk-button-text { color: var(--portal-main-color) !important; } @@ -120,10 +121,6 @@ a:not(.uk-button), color: var(--portal-dark-color) !important; } -.uk-slidenav { - background: none; -} - #stickyNavbar{ box-shadow: 0 1px 1px #0000004D; }