Change piwik base on the new dynamic piwik.

This commit is contained in:
Konstantinos Triantafyllou 2023-07-13 13:44:40 +03:00
parent 575ea1f996
commit d8d498474b
32 changed files with 38 additions and 179 deletions

View File

@ -112,7 +112,7 @@ export class AppRoutingModule {
} }
} }
constructor( private config: ConfigurationService, private router: Router){ constructor( private config: ConfigurationService, private router: Router){
this.subs.push(this.config.communityInformationState.subscribe(data => { this.subs.push(this.config.portalAsObservable.subscribe(data => {
if (data) { if (data) {
if (data['pages']) { if (data['pages']) {
for (var i = 0; i < data['pages'].length; i++) { for (var i = 0; i < data['pages'].length; i++) {

View File

@ -39,7 +39,7 @@ import {OpenaireEntities} from "./openaireLibrary/utils/properties/searchFields"
ratio="1"><polyline fill="none" stroke="#000" stroke-width="1.03" points="7 4 13 10 7 16"></polyline></svg> ratio="1"><polyline fill="none" stroke="#000" stroke-width="1.03" points="7 4 13 10 7 16"></polyline></svg>
</span></a> </span></a>
</cookie-law> </cookie-law>
<bottom *ngIf="isClient && properties" [properties]=properties [centered]="true" [showMenuItems]="true" [menuItems]="[]" [darkBackground]="false" ></bottom> <bottom *ngIf="isClient && properties" [properties]=properties [centered]="true" [showMenuItems]="true" [menuItems]="[]"></bottom>
</div> </div>
` `
}) })
@ -64,7 +64,7 @@ export class AppComponent {
this.id = ConnectHelper.getCommunityFromDomain(this.properties.domain); this.id = ConnectHelper.getCommunityFromDomain(this.properties.domain);
this.agg = PortalAggregators.getFilterInfoByMenuId(this.id); this.agg = PortalAggregators.getFilterInfoByMenuId(this.id);
this.setStyles(); this.setStyles();
this.configurationService.initStaticCommunityInformation(PortalAggregators.getCommunityInfoByMenuId(this.id)); this.configurationService.initStaticPortal(PortalAggregators.getCommunityInfoByMenuId(this.id));
this.showHeader = this.agg.showHeaderAlways; this.showHeader = this.agg.showHeaderAlways;
} }

View File

@ -4,9 +4,7 @@ import {properties} from "../../../environments/environment";
@Component({ @Component({
selector: 'openaire-directLinking', selector: 'openaire-directLinking',
template: ` template: `
<directLinking [piwikSiteId]="piwikSiteId"></directLinking>` <directLinking></directLinking>`
}) })
export class OpenaireDirectLinkingComponent { export class OpenaireDirectLinkingComponent {
piwikSiteId = properties.piwikSiteId;
} }

View File

@ -3,11 +3,8 @@ import {properties} from "../../../environments/environment";
@Component({ @Component({
selector: 'openaire-linking-generic', selector: 'openaire-linking-generic',
template: `<linking-generic pageTitle="Linking" [piwikSiteId]="piwikSiteId"></linking-generic>` template: `<linking-generic pageTitle="Linking"></linking-generic>`
}) })
export class OpenaireLinkingComponent { export class OpenaireLinkingComponent {
piwikSiteId = properties.piwikSiteId;
} }

View File

@ -1,24 +1,17 @@
import {Component} from '@angular/core'; import {Component} from '@angular/core';
import {ActivatedRoute} from '@angular/router'; import {ActivatedRoute} from '@angular/router';
import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properties';
import {Subscriber} from "rxjs"; import {Subscriber} from "rxjs";
import {properties} from "../../../environments/environment"; import {properties} from "../../../environments/environment";
@Component({ @Component({
selector: 'openaire-my-claims', selector: 'openaire-my-claims',
template: ` template: `<my-claims *ngIf="userInfoURL && claimsInfoURL" [claimsInfoURL]=claimsInfoURL [userInfoURL]="userInfoURL"></my-claims>`
<my-claims *ngIf="userInfoURL && claimsInfoURL" [claimsInfoURL]=claimsInfoURL [userInfoURL]="userInfoURL" [piwikSiteId]="piwikSiteId">
</my-claims>
`
}) })
export class OpenaireMyClaimsComponent { export class OpenaireMyClaimsComponent {
claimsInfoURL:string; claimsInfoURL:string;
userInfoURL: string; userInfoURL: string;
sub; sub;
piwikSiteId = properties.piwikSiteId;
constructor (private route: ActivatedRoute) { constructor (private route: ActivatedRoute) {
} }

View File

@ -1,18 +1,12 @@
import {Component} from '@angular/core'; import {Component} from '@angular/core';
import {properties} from "../../environments/environment";
@Component({ @Component({
selector: 'openaire-deposit', selector: 'openaire-deposit',
template: ` template: `
<deposit-first-page [piwikSiteId]="piwikSiteId"></deposit-first-page> <deposit-first-page></deposit-first-page>
` `
}) })
export class OpenaireDepositComponent { export class OpenaireDepositComponent {
piwikSiteId = properties.piwikSiteId;
constructor() {
}
public ngOnInit() {}
} }

View File

@ -1,18 +1,12 @@
import {Component} from '@angular/core'; import {Component} from '@angular/core';
import {properties} from "../../environments/environment";
@Component({ @Component({
selector: 'openaire-search-deposit', selector: 'openaire-search-deposit',
template: ` template: `
<deposit-search-dataproviders [piwikSiteId]="piwikSiteId"></deposit-search-dataproviders> <deposit-search-dataproviders></deposit-search-dataproviders>
` `
}) })
export class OpenaireSearchDataprovidersToDepositComponent { export class OpenaireSearchDataprovidersToDepositComponent {
piwikSiteId = properties.piwikSiteId;
constructor() {}
public ngOnInit() {}
} }

View File

@ -1,16 +1,10 @@
import {Component} from "@angular/core"; import {Component} from "@angular/core";
import {properties} from "../../environments/environment";
@Component({ @Component({
selector: 'aggregator-fos', selector: 'aggregator-fos',
template: ` template: `
<fos [piwikSiteId]="piwikSiteId"></fos> <fos></fos>
` `
}) })
export class AggregatorFosComponent { export class AggregatorFosComponent {
piwikSiteId = properties.piwikSiteId;
constructor() {
}
} }

View File

@ -110,7 +110,7 @@ export class HomeComponent {
this.numbersComponent.showProjects = portalProperties.entities.project.isEnabled; this.numbersComponent.showProjects = portalProperties.entities.project.isEnabled;
this.numbersComponent.showDataProviders = portalProperties.entities.datasource.isEnabled; this.numbersComponent.showDataProviders = portalProperties.entities.datasource.isEnabled;
} }
this.subs.push(this.config.communityInformationState.subscribe(data => { this.subs.push(this.config.portalAsObservable.subscribe(data => {
if (data) { if (data) {
var showEntity = {}; var showEntity = {};
for (var i = 0; i < data['entities'].length; i++) { for (var i = 0; i < data['entities'].length; i++) {

View File

@ -1,20 +1,8 @@
import {Component} from '@angular/core'; import {Component} from '@angular/core';
import {properties} from "../../../environments/environment";
@Component({ @Component({
selector: 'openaire-dataprovider', selector: 'openaire-dataprovider',
template: `<dataprovider [piwikSiteId]="piwikSiteId"></dataprovider>`, template: `<dataprovider></dataprovider>`,
}) })
export class OpenaireDataProviderComponent{ export class OpenaireDataProviderComponent{
piwikSiteId = properties.piwikSiteId;
constructor ( ) {
}
ngOnInit() {
}
} }

View File

@ -3,18 +3,7 @@ import {properties} from "../../../environments/environment";
@Component({ @Component({
selector: 'openaire-dataset', selector: 'openaire-dataset',
template: `<result-landing type="dataset" [piwikSiteId]="piwikSiteId"></result-landing>`, template: `<result-landing type="dataset"></result-landing>`,
}) })
export class OpenaireDatasetComponent{ export class OpenaireDatasetComponent{
piwikSiteId = properties.piwikSiteId;
constructor ( ) {
}
ngOnInit() {
}
} }

View File

@ -3,18 +3,7 @@ import {properties} from "../../../environments/environment";
@Component({ @Component({
selector: 'openaire-htmlProjectReport', selector: 'openaire-htmlProjectReport',
template: `<htmlProjectReport [piwikSiteId]=""></htmlProjectReport>`, template: `<htmlProjectReport></htmlProjectReport>`,
}) })
export class OpenaireHtmlProjectReportComponent{ export class OpenaireHtmlProjectReportComponent{
piwikSiteId = properties.piwikSiteId;
constructor ( ) {
}
ngOnInit() {
}
} }

View File

@ -1,20 +1,8 @@
import {Component} from '@angular/core'; import {Component} from '@angular/core';
import {properties} from "../../../environments/environment";
@Component({ @Component({
selector: 'openaire-organization', selector: 'openaire-organization',
template: `<organization [piwikSiteId]="piwikSiteId"></organization>`, template: `<organization></organization>`,
}) })
export class OpenaireOrganizationComponent{ export class OpenaireOrganizationComponent{
piwikSiteId = properties.piwikSiteId;
constructor ( ) {
}
ngOnInit() {
}
} }

View File

@ -1,20 +1,8 @@
import {Component} from '@angular/core'; import {Component} from '@angular/core';
import {properties} from "../../../environments/environment";
@Component({ @Component({
selector: 'openaire-orp', selector: 'openaire-orp',
template: `<result-landing type="orp" [piwikSiteId]="piwikSiteId"></result-landing>`, template: `<result-landing type="orp"></result-landing>`,
}) })
export class OpenaireOrpComponent{ export class OpenaireOrpComponent{
piwikSiteId = properties.piwikSiteId;
constructor ( ) {
}
ngOnInit() {
}
} }

View File

@ -1,20 +1,8 @@
import {Component} from '@angular/core'; import {Component} from '@angular/core';
import {properties} from "../../../environments/environment";
@Component({ @Component({
selector: 'openaire-project', selector: 'openaire-project',
template: `<project [piwikSiteId]="piwikSiteId"></project>`, template: `<project></project>`,
}) })
export class OpenaireProjectComponent{ export class OpenaireProjectComponent{
piwikSiteId = properties.piwikSiteId;
constructor ( ) {
}
ngOnInit() {
}
} }

View File

@ -1,19 +1,8 @@
import {Component} from '@angular/core'; import {Component} from '@angular/core';
import {properties} from "../../../environments/environment";
@Component({ @Component({
selector: 'openaire-publication', selector: 'openaire-publication',
template: ` template: `
<result-landing type="publication" [piwikSiteId]="piwikSiteId"></result-landing>`, <result-landing type="publication"></result-landing>`,
}) })
export class OpenairePublicationComponent { export class OpenairePublicationComponent {}
piwikSiteId = properties.piwikSiteId;
constructor() {}
ngOnInit() {
}
}

View File

@ -1,11 +1,8 @@
import {Component} from '@angular/core'; import {Component} from '@angular/core';
import {properties} from "../../../environments/environment";
@Component({ @Component({
selector: 'openaire-publication', selector: 'openaire-publication',
template: `<result-landing type="result" [piwikSiteId]="piwikSiteId"></result-landing>`, template: `<result-landing type="result"></result-landing>`,
}) })
export class OpenaireResultComponent{ export class OpenaireResultComponent{
piwikSiteId = properties.piwikSiteId;
} }

View File

@ -1,20 +1,8 @@
import {Component} from '@angular/core'; import {Component} from '@angular/core';
import {properties} from "../../../environments/environment";
@Component({ @Component({
selector: 'openaire-dataprovider', selector: 'openaire-dataprovider',
template: `<dataprovider type="service" [piwikSiteId]="piwikSiteId"></dataprovider>`, template: `<dataprovider type="service"></dataprovider>`,
}) })
export class OpenaireServiceComponent{ export class OpenaireServiceComponent{
piwikSiteId = properties.piwikSiteId;
constructor ( ) {
}
ngOnInit() {
}
} }

View File

@ -1,19 +1,8 @@
import {Component} from '@angular/core'; import {Component} from '@angular/core';
import {properties} from "../../../environments/environment";
@Component({ @Component({
selector: 'openaire-software', selector: 'openaire-software',
template: `<result-landing type="software" [piwikSiteId]="piwikSiteId"></result-landing>`, template: `<result-landing type="software"></result-landing>`,
}) })
export class OpenaireSoftwareComponent{ export class OpenaireSoftwareComponent{
piwikSiteId = properties.piwikSiteId;
constructor ( ) {
}
ngOnInit() {
}
} }

@ -1 +1 @@
Subproject commit 870ce718972596f5c36ae79271927c7f4279ff58 Subproject commit 8b57fae58515adae81210f99fdef27905b9f4e8a

View File

@ -7,11 +7,10 @@ import {AggregatorInfo, PortalAggregators} from "../utils/aggregators";
@Component({ @Component({
selector: 'aggregator-sdg', selector: 'aggregator-sdg',
template: ` template: `
<sdg [piwikSiteId]="piwikSiteId" [customFilter]="customFilter"></sdg> <sdg [customFilter]="customFilter"></sdg>
` `
}) })
export class AggregatorSdgComponent { export class AggregatorSdgComponent {
piwikSiteId = properties.piwikSiteId;
aggregatorId; aggregatorId;
aggregator: AggregatorInfo; aggregator: AggregatorInfo;
customFilter: SearchCustomFilter = null; customFilter: SearchCustomFilter = null;

View File

@ -11,7 +11,7 @@ import {SearchForm} from "../../openaireLibrary/searchPages/searchUtils/newSearc
selector: 'openaire-advanced-search-dataprovider', selector: 'openaire-advanced-search-dataprovider',
template: ` template: `
<search-dataproviders [customFilter]="customFilter" [simpleView]="false" [openaireLink]="customFilter?'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/advanced/dataproviders':null" <search-dataproviders [customFilter]="customFilter" [simpleView]="false" [openaireLink]="customFilter?'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/advanced/dataproviders':null"
[piwikSiteId]="properties.piwikSiteId" [hasPrefix]="false" [searchForm]="searchForm"> [hasPrefix]="false" [searchForm]="searchForm">
</search-dataproviders> </search-dataproviders>
` `

View File

@ -11,7 +11,7 @@ import {SearchForm} from "../../openaireLibrary/searchPages/searchUtils/newSearc
selector: 'openaire-advanced-search-organizations', selector: 'openaire-advanced-search-organizations',
template: ` template: `
<search-organizations [customFilter]="customFilter" [simpleView]="false" [openaireLink]="customFilter?'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/advanced/organizations':null" <search-organizations [customFilter]="customFilter" [simpleView]="false" [openaireLink]="customFilter?'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/advanced/organizations':null"
[piwikSiteId]="properties.piwikSiteId" [hasPrefix]="false" [searchForm]="searchForm"> [hasPrefix]="false" [searchForm]="searchForm">
</search-organizations> </search-organizations>
` `

View File

@ -10,7 +10,7 @@ import {SearchForm} from "../../openaireLibrary/searchPages/searchUtils/newSearc
selector: 'openaire-advanced-search-projects', selector: 'openaire-advanced-search-projects',
template: ` template: `
<search-projects [customFilter]="customFilter" [simpleView]="false" [openaireLink]="customFilter?'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/advanced/projects':null" <search-projects [customFilter]="customFilter" [simpleView]="false" [openaireLink]="customFilter?'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/advanced/projects':null"
[piwikSiteId]="properties.piwikSiteId" [hasPrefix]="false" [searchForm]="searchForm"> [hasPrefix]="false" [searchForm]="searchForm">
</search-projects> </search-projects>
` `

View File

@ -12,7 +12,7 @@ import {SearchForm} from "../../openaireLibrary/searchPages/searchUtils/newSearc
selector: 'openaire-advanced-search-service', selector: 'openaire-advanced-search-service',
template: ` template: `
<search-dataproviders [customFilter]="customFilter" [simpleView]="false" [openaireLink]="customFilter?'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/advanced/services':null" <search-dataproviders [customFilter]="customFilter" [simpleView]="false" [openaireLink]="customFilter?'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/advanced/services':null"
[piwikSiteId]="properties.piwikSiteId" [hasPrefix]="false" [hasPrefix]="false"
type="services" entityType="service" [typeName]="openaireEntities.SERVICES" type="services" entityType="service" [typeName]="openaireEntities.SERVICES"
[searchForm]="searchForm"> [searchForm]="searchForm">
</search-dataproviders> </search-dataproviders>

View File

@ -10,7 +10,7 @@ import {SearchForm} from "../../openaireLibrary/searchPages/searchUtils/newSearc
selector: 'openaire-search-results', selector: 'openaire-search-results',
template: ` template: `
<search-research-results resultType="result" [simpleView]="false" [customFilter]="customFilter" [openaireLink]="customFilter?'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/advanced/research-outcomes':null" <search-research-results resultType="result" [simpleView]="false" [customFilter]="customFilter" [openaireLink]="customFilter?'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/advanced/research-outcomes':null"
[piwikSiteId]="properties.piwikSiteId" [hasPrefix]="false" [searchForm]="searchForm"></search-research-results> [hasPrefix]="false" [searchForm]="searchForm"></search-research-results>
` `
}) })

View File

@ -8,22 +8,19 @@ import {SearchForm} from "../../openaireLibrary/searchPages/searchUtils/newSearc
@Component({ @Component({
selector: 'openaire-search-find', selector: 'openaire-search-find',
template: ` template: `
<search-all logoURL = "/assets/common-assets/logo-small-aggregator.png" name="OpenAIRE" [customFilter]="customFilter" [piwikSiteId]="piwikSiteId" <search-all logoURL = "/assets/common-assets/logo-small-aggregator.png" name="OpenAIRE" [customFilter]="customFilter"
[searchForm]="searchForm" [openAccess]="false"></search-all> [searchForm]="searchForm" [openAccess]="false"></search-all>
`, `,
}) })
export class OpenaireSearchComponent{ export class OpenaireSearchComponent{
customFilter:SearchCustomFilter= null; customFilter:SearchCustomFilter= null;
piwikSiteId = properties.piwikSiteId;
public searchForm: SearchForm = {class: 'search-form', dark: true}; public searchForm: SearchForm = {class: 'search-form', dark: true};
constructor ( ) {}
ngOnInit() { ngOnInit() {
let id = ConnectHelper.getCommunityFromDomain(properties.domain); let id = ConnectHelper.getCommunityFromDomain(properties.domain);
let agg:AggregatorInfo = PortalAggregators.getFilterInfoByMenuId(id); let agg:AggregatorInfo = PortalAggregators.getFilterInfoByMenuId(id);
this.customFilter = PortalAggregators.getSearchCustomFilterByAggregator(agg); this.customFilter = PortalAggregators.getSearchCustomFilterByAggregator(agg);
} }
} }

View File

@ -11,7 +11,7 @@ import {SearchForm} from "../../openaireLibrary/searchPages/searchUtils/newSearc
template: ` template: `
<search-dataproviders [customFilter]="customFilter" [openaireLink]="customFilter?'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/find/dataproviders':null" <search-dataproviders [customFilter]="customFilter" [openaireLink]="customFilter?'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/find/dataproviders':null"
[piwikSiteId]="properties.piwikSiteId" [hasPrefix]="false" [searchForm]="searchForm"> [hasPrefix]="false" [searchForm]="searchForm">
</search-dataproviders> </search-dataproviders>
` `

View File

@ -11,7 +11,7 @@ import {SearchForm} from "../../openaireLibrary/searchPages/searchUtils/newSearc
template: ` template: `
<search-organizations [customFilter]="customFilter" [openaireLink]="customFilter?'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/find/organizations':null" <search-organizations [customFilter]="customFilter" [openaireLink]="customFilter?'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/find/organizations':null"
[piwikSiteId]="properties.piwikSiteId" [hasPrefix]="false" [searchForm]="searchForm"> [hasPrefix]="false" [searchForm]="searchForm">
</search-organizations> </search-organizations>
` `

View File

@ -11,7 +11,7 @@ import {SearchForm} from "../../openaireLibrary/searchPages/searchUtils/newSearc
template: ` template: `
<search-projects [customFilter]="customFilter" [openaireLink]="customFilter?'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/find/projects':null" <search-projects [customFilter]="customFilter" [openaireLink]="customFilter?'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/find/projects':null"
[piwikSiteId]="properties.piwikSiteId" [hasPrefix]="false" [searchForm]="searchForm"> [hasPrefix]="false" [searchForm]="searchForm">
</search-projects> </search-projects>
` `

View File

@ -10,7 +10,7 @@ import {SearchForm} from "../../openaireLibrary/searchPages/searchUtils/newSearc
selector: 'openaire-search-results', selector: 'openaire-search-results',
template: ` template: `
<search-research-results resultType="result" [stickyForm]="false" [customFilter]="customFilter" [openaireLink]="customFilter?'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/find/research-outcomes':null" <search-research-results resultType="result" [stickyForm]="false" [customFilter]="customFilter" [openaireLink]="customFilter?'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/find/research-outcomes':null"
[piwikSiteId]="properties.piwikSiteId" [hasPrefix]="false" [searchForm]="searchForm"></search-research-results> [hasPrefix]="false" [searchForm]="searchForm"></search-research-results>
` `
}) })

View File

@ -12,7 +12,7 @@ import {SearchForm} from "../../openaireLibrary/searchPages/searchUtils/newSearc
template: ` template: `
<search-dataproviders [customFilter]="customFilter" [openaireLink]="customFilter?'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/find/services':null" <search-dataproviders [customFilter]="customFilter" [openaireLink]="customFilter?'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/find/services':null"
[piwikSiteId]="properties.piwikSiteId" [hasPrefix]="false" [hasPrefix]="false"
type="services" entityType="service" [typeName]="openaireEntities.SERVICES" type="services" entityType="service" [typeName]="openaireEntities.SERVICES"
[searchForm]="searchForm"> [searchForm]="searchForm">
</search-dataproviders> </search-dataproviders>