[Connect | Trunk]: Delete properties resolver. Delete query param community id

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@60772 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
k.triantafyllou 2021-04-01 14:25:15 +00:00
parent 1f78864788
commit 9ee09f1f3a
18 changed files with 434 additions and 566 deletions

View File

@ -1,89 +1,201 @@
import {NgModule} from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { EnvironmentSpecificResolver} from './openaireLibrary/utils/properties/environmentSpecificResolver';
import { EnvironmentSpecificService} from './openaireLibrary/utils/properties/environment-specific.service';
import {RouterModule, Routes} from '@angular/router';
import {OpenaireErrorPageComponent} from './error/errorPage.component';
import {PageURLResolverComponent} from "./openaireLibrary/utils/pageURLResolver.component";
import {IsCommunity} from "./openaireLibrary/connect/communityGuard/isCommunity.guard";
const routes: Routes = [
// Other Pages
/** Other Pages */
{path: '', loadChildren: './communitywrapper/communityWrapper.module#CommunityWrapperModule'},
{path: 'about', redirectTo: 'about/learn-how', pathMatch: 'full'},
{ path: 'about/learn-how', loadChildren: './learn-how/learn-how.module#LearnHowModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
{ path: 'about/learn-in-depth', loadChildren: './learn-how/learnInDepth/learn-in-depth.module#LearnInDepthModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
{ path: 'about/faq', loadChildren: './learn-how/faqs/faqs.module#FaqsModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
{path: 'about/learn-how', loadChildren: './learn-how/learn-how.module#LearnHowModule'},
{path: 'about/learn-in-depth', loadChildren: './learn-how/learnInDepth/learn-in-depth.module#LearnInDepthModule'},
{path: 'about/faq', loadChildren: './learn-how/faqs/faqs.module#FaqsModule'},
{path: 'contact-us', loadChildren: './contact/contact.module#ContactModule'},
{path: 'invite', loadChildren: './utils/subscribe/invite/invite.module#InviteModule'},
{path: 'content', loadChildren: './content/contentPage.module#ContentPageModule', canActivate: [IsCommunity]},
{ path: 'organizations', loadChildren: './htmlPages/organizations/organizationsPage.module#OrganizationsPageModule', canActivate:[IsCommunity]},
{ path: 'publications', loadChildren: './htmlPages/publications/publications-page.module#PublicationsPageModule', canActivate:[IsCommunity]},
{ path: 'projects', loadChildren: './htmlPages/projects/projectsPage.module#ProjectsPageModule', canActivate:[IsCommunity]},
{ path: 'national-bulletins', loadChildren: './htmlPages/nationalBulletins/nationalBulletinsPage.module#NaionalBulletinPageModule', canActivate:[IsCommunity]},
{
path: 'organizations',
loadChildren: './htmlPages/organizations/organizationsPage.module#OrganizationsPageModule',
canActivate: [IsCommunity]
},
{
path: 'publications',
loadChildren: './htmlPages/publications/publications-page.module#PublicationsPageModule',
canActivate: [IsCommunity]
},
{
path: 'projects',
loadChildren: './htmlPages/projects/projectsPage.module#ProjectsPageModule',
canActivate: [IsCommunity]
},
{
path: 'national-bulletins',
loadChildren: './htmlPages/nationalBulletins/nationalBulletinsPage.module#NaionalBulletinPageModule',
canActivate: [IsCommunity]
},
{path: 'curators', loadChildren: './curators/curators.module#CuratorsModule', canActivate: [IsCommunity]},
{path: 'subjects', loadChildren: './subjects/subjects.module#SubjectsModule', canActivate: [IsCommunity]},
{path: 'myCommunities', loadChildren: './my-communities/my-communities.module#MyCommunitiesModule'},
// Testing Page for help contents
/** Testing Page for help contents */
{path: 'helper-test', loadChildren: './helper-test/helper-test.module#HelperTestModule'},
// Landing Pages
{ path: 'search/result', loadChildren: './landingPages/result/libResult.module#LibResultModule', canActivate:[IsCommunity]},
{ path: 'search/publication', loadChildren: './landingPages/publication/libPublication.module#LibPublicationModule', canActivate:[IsCommunity]},
{ path: 'search/dataset', loadChildren: './landingPages/dataset/libDataset.module#LibDatasetModule', canActivate:[IsCommunity]},
{ path: 'search/software', loadChildren: './landingPages/software/libSoftware.module#LibSoftwareModule', canActivate:[IsCommunity]},
/** Landing Pages */
{
path: 'search/result',
loadChildren: './landingPages/result/libResult.module#LibResultModule',
canActivate: [IsCommunity]
},
{
path: 'search/publication',
loadChildren: './landingPages/publication/libPublication.module#LibPublicationModule',
canActivate: [IsCommunity]
},
{
path: 'search/dataset',
loadChildren: './landingPages/dataset/libDataset.module#LibDatasetModule',
canActivate: [IsCommunity]
},
{
path: 'search/software',
loadChildren: './landingPages/software/libSoftware.module#LibSoftwareModule',
canActivate: [IsCommunity]
},
{path: 'search/other', loadChildren: './landingPages/orp/libOrp.module#LibOrpModule', canActivate: [IsCommunity]},
{ path: 'search/project', loadChildren: './landingPages/project/libProject.module#LibProjectModule', canActivate:[IsCommunity]},
{ path: 'search/dataprovider', loadChildren: '././landingPages/dataProvider/libDataProvider.module#LibDataProviderModule', canActivate:[IsCommunity]},
{ path: 'search/organization', loadChildren: './landingPages/organization/libOrganization.module#LibOrganizationModule', canActivate:[IsCommunity]},
{ path: 'project-report', loadChildren: './landingPages/htmlProjectReport/libHtmlProjectReport.module#LibHtmlProjectReportModule'},
// Search Pages
{
path: 'search/project',
loadChildren: './landingPages/project/libProject.module#LibProjectModule',
canActivate: [IsCommunity]
},
{
path: 'search/dataprovider',
loadChildren: '././landingPages/dataProvider/libDataProvider.module#LibDataProviderModule',
canActivate: [IsCommunity]
},
{
path: 'search/organization',
loadChildren: './landingPages/organization/libOrganization.module#LibOrganizationModule',
canActivate: [IsCommunity]
},
{
path: 'project-report',
loadChildren: './landingPages/htmlProjectReport/libHtmlProjectReport.module#LibHtmlProjectReportModule'
},
/** Search Pages */
{path: 'search/find', redirectTo: 'search/find/research-outcomes', pathMatch: 'full'},
{ path: 'search/find/communities', loadChildren: './searchPages/communities/searchCommunities.module#SearchCommunitiesModule'},
{ path: 'search/find/research-outcomes', loadChildren: './searchPages/simple/searchResearchResults.module#OpenaireSearchResearchResultsModule', canActivate:[IsCommunity]},
{
path: 'search/find/communities',
loadChildren: './searchPages/communities/searchCommunities.module#SearchCommunitiesModule'
},
{
path: 'search/find/research-outcomes',
loadChildren: './searchPages/simple/searchResearchResults.module#OpenaireSearchResearchResultsModule',
canActivate: [IsCommunity]
},
{path: 'search/find/publications', component: PageURLResolverComponent, canActivate: [IsCommunity]},
{path: 'search/find/datasets', component: PageURLResolverComponent, canActivate: [IsCommunity]},
{path: 'search/find/software', component: PageURLResolverComponent, canActivate: [IsCommunity]},
{path: 'search/find/other', component: PageURLResolverComponent, canActivate: [IsCommunity]},
{ path: 'search/find/projects', loadChildren: './searchPages/simple/searchProjects.module#LibSearchProjectsModule', canActivate:[IsCommunity]},
{ path: 'search/find/dataproviders', loadChildren: './searchPages/simple/searchDataProviders.module#LibSearchDataProvidersModule', canActivate:[IsCommunity]},
// Advanced Search Pages
{ path: 'search/advanced/research-outcomes', loadChildren: './searchPages/advanced/searchResearchResults.module#OpenaireAdvancedSearchResearchResultsModule', canActivate:[IsCommunity]},
{
path: 'search/find/projects',
loadChildren: './searchPages/simple/searchProjects.module#LibSearchProjectsModule',
canActivate: [IsCommunity]
},
{
path: 'search/find/dataproviders',
loadChildren: './searchPages/simple/searchDataProviders.module#LibSearchDataProvidersModule',
canActivate: [IsCommunity]
},
/** Advanced Search Pages */
{
path: 'search/advanced/research-outcomes',
loadChildren: './searchPages/advanced/searchResearchResults.module#OpenaireAdvancedSearchResearchResultsModule',
canActivate: [IsCommunity]
},
{path: 'search/advanced/publications', component: PageURLResolverComponent, canActivate: [IsCommunity]},
{path: 'search/advanced/datasets', component: PageURLResolverComponent, canActivate: [IsCommunity]},
{path: 'search/advanced/software', component: PageURLResolverComponent, canActivate: [IsCommunity]},
{path: 'search/advanced/other', component: PageURLResolverComponent, canActivate: [IsCommunity]},
{ path: 'search/advanced/organizations', loadChildren: './searchPages/advanced/advancedSearchOrganizations.module#LibAdvancedSearchOrganizationsModule', canActivate:[IsCommunity]},
{ path: 'search/advanced/dataproviders', loadChildren: './searchPages/advanced/advancedSearchDataProviders.module#LibAdvancedSearchDataProvidersModule', canActivate:[IsCommunity]},
{ path: 'search/advanced/projects', loadChildren: './searchPages/advanced/advancedSearchProjects.module#LibAdvancedSearchProjectsModule', canActivate:[IsCommunity]},
// Deposit Pages
{ path: 'participate/deposit-datasets', redirectTo: 'participate/deposit/learn-how', pathMatch: 'full', canActivate:[IsCommunity]},
{ path: 'participate/deposit-datasets-result', redirectTo: 'participate/deposit/learn-how', pathMatch: 'full', canActivate:[IsCommunity]},
{ path: 'participate/deposit-subject-result', redirectTo: 'participate/deposit/learn-how', pathMatch: 'full', canActivate:[IsCommunity]},
{ path: 'participate/deposit-publications', redirectTo: 'participate/deposit/learn-how', pathMatch: 'full', canActivate:[IsCommunity]},
{ path: 'participate/deposit-publications-result', redirectTo: 'participate/deposit/learn-how', pathMatch: 'full', canActivate:[IsCommunity]},
{ path: 'participate/share-zenodo', redirectTo: '/participate/deposit/zenodo', pathMatch: 'full', canActivate:[IsCommunity]},
{ path: 'participate/deposit/learn-how', loadChildren: './deposit/deposit.module#LibDepositModule', canActivate:[IsCommunity]},
{ path: 'participate/deposit/search', loadChildren: './deposit/searchDataprovidersToDeposit.module#LibSearchDataprovidersToDepositModule', canActivate:[IsCommunity]},
{ path: 'participate/deposit/zenodo', loadChildren: './deposit/zenodo/shareInZenodo.module#ShareInZenodoModule', canActivate:[IsCommunity]},
// Linking Pages
{
path: 'search/advanced/organizations',
loadChildren: './searchPages/advanced/advancedSearchOrganizations.module#LibAdvancedSearchOrganizationsModule',
canActivate: [IsCommunity]
},
{
path: 'search/advanced/dataproviders',
loadChildren: './searchPages/advanced/advancedSearchDataProviders.module#LibAdvancedSearchDataProvidersModule',
canActivate: [IsCommunity]
},
{
path: 'search/advanced/projects',
loadChildren: './searchPages/advanced/advancedSearchProjects.module#LibAdvancedSearchProjectsModule',
canActivate: [IsCommunity]
},
/** Deposit Pages */
{
path: 'participate/deposit-datasets',
redirectTo: 'participate/deposit/learn-how',
pathMatch: 'full',
canActivate: [IsCommunity]
},
{
path: 'participate/deposit-datasets-result',
redirectTo: 'participate/deposit/learn-how',
pathMatch: 'full',
canActivate: [IsCommunity]
},
{
path: 'participate/deposit-subject-result',
redirectTo: 'participate/deposit/learn-how',
pathMatch: 'full',
canActivate: [IsCommunity]
},
{
path: 'participate/deposit-publications',
redirectTo: 'participate/deposit/learn-how',
pathMatch: 'full',
canActivate: [IsCommunity]
},
{
path: 'participate/deposit-publications-result',
redirectTo: 'participate/deposit/learn-how',
pathMatch: 'full',
canActivate: [IsCommunity]
},
{
path: 'participate/share-zenodo',
redirectTo: '/participate/deposit/zenodo',
pathMatch: 'full',
canActivate: [IsCommunity]
},
{
path: 'participate/deposit/learn-how',
loadChildren: './deposit/deposit.module#LibDepositModule',
canActivate: [IsCommunity]
},
{
path: 'participate/deposit/search',
loadChildren: './deposit/searchDataprovidersToDeposit.module#LibSearchDataprovidersToDepositModule',
canActivate: [IsCommunity]
},
{
path: 'participate/deposit/zenodo',
loadChildren: './deposit/zenodo/shareInZenodo.module#ShareInZenodoModule',
canActivate: [IsCommunity]
},
/** Linking Pages */
{path: 'myclaims', loadChildren: './claims/myClaims/myClaims.module#LibMyClaimsModule', canActivate: [IsCommunity]},
{ path: 'participate/claim', loadChildren: './claims/linking/linkingGeneric.module#LibLinkingGenericModule', canActivate:[IsCommunity]},
{ path: 'participate/direct-claim', loadChildren: './claims/directLinking/directLinking.module#LibDirectLinkingModule', canActivate:[IsCommunity]},
// help pages - do not exist in Admin portal/api/db
{
path: 'participate/claim',
loadChildren: './claims/linking/linkingGeneric.module#LibLinkingGenericModule',
canActivate: [IsCommunity]
},
{
path: 'participate/direct-claim',
loadChildren: './claims/directLinking/directLinking.module#LibDirectLinkingModule',
canActivate: [IsCommunity]
},
/** help pages - do not exist in Admin portal/api/db */
{path: 'reload', loadChildren: './reload/libReload.module#LibReloadModule'},
{path: 'user-info', loadChildren: './login/libUser.module#LibUserModule'},
{path: 'error', component: OpenaireErrorPageComponent},
@ -93,7 +205,7 @@ const routes: Routes = [
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule],
providers: [EnvironmentSpecificResolver, EnvironmentSpecificService]
exports: [RouterModule]
})
export class AppRoutingModule { }
export class AppRoutingModule {
}

View File

@ -16,6 +16,7 @@ import {Subscriber} from "rxjs";
import {CommunityService} from "./openaireLibrary/connect/community/community.service";
import {StringUtils} from "./openaireLibrary/utils/string-utils.class";
import {LoginErrorCodes} from "./openaireLibrary/login/utils/guardHelper.class";
@Component({
//changeDetection: ChangeDetectionStrategy.Default,
//encapsulation: ViewEncapsulation.Emulated,
@ -97,6 +98,7 @@ export class AppComponent {
header: Header;
logoPath: string = 'assets/common-assets/';
subscriptions = [];
constructor(private route: ActivatedRoute, private propertiesService: EnvironmentSpecificService,
private _communitiesService: CommunitiesService,
private router: Router, private userManagementService: UserManagementService,
@ -153,12 +155,14 @@ export class AppComponent {
this.userManagementService.fixRedirectURL = null;
}
}
initAdminToolCommunity(communityId) {
if (communityId) {
this.properties.adminToolsPortalType = "community";
}
this.configurationService.initCommunityInformation(this.properties, (communityId) ? communityId : this.properties.adminToolsPortalType);
}
public buildMenu(communityId: string) {
if (communityId) {
if (!this.community || this.community.communityId !== communityId) {
@ -247,9 +251,11 @@ export class AppComponent {
this.buildConnectMenu();
}
}
isPrivate(community) {
return community && (community.status == "hidden" || (community.status == "manager" && !(Session.isCommunityCurator(this.user) || Session.isManager("community", community.communityId, this.user))))
}
showPrivateOrNoCommunity(restrictedData: string) {
this.communityId = null;
this.community = null;
@ -266,12 +272,13 @@ export class AppComponent {
}
});
} else {
this.router.navigate(['/error'], restrictedData ? {queryParams: {'page': -1}} : {});
this.router.navigate(['/error'], {queryParams: {'page': -1}});
}
} else {
this.router.navigate(['/error'], restrictedData ? {queryParams: {'page': -1}} : {});
}
}
buildConnectMenu(restrictedData: boolean = false) {
let url = "https://" + (properties.environment != "production" ? "beta." : "") + "connect.openaire.eu";
this.header = {

View File

@ -14,9 +14,6 @@ import {CookieLawModule} from './openaireLibrary/sharedComponents/cookie-law/coo
import {BottomModule} from './openaireLibrary/sharedComponents/bottom.module';
import {ErrorModule} from './openaireLibrary/error/error.module';
import {NavigationBarModule} from './openaireLibrary/sharedComponents/navigationBar.module';
import {EnvironmentSpecificResolver} from './openaireLibrary/utils/properties/environmentSpecificResolver';
import {CommunitiesService} from './openaireLibrary/connect/communities/communities.service';
import {LayoutService} from "./openaireLibrary/services/layout.service";
import {SubscribeModule} from './utils/subscribe/subscribe.module';
@ -53,7 +50,7 @@ import {RoleVerificationModule} from "./openaireLibrary/role-verification/role-v
declarations: [AppComponent, OpenaireErrorPageComponent],
exports: [AppComponent],
providers: [
EnvironmentSpecificResolver, CommunitiesService, LayoutService, IsCommunity, SubscribeService,
CommunitiesService, LayoutService, IsCommunity, SubscribeService,
{
provide: HTTP_INTERCEPTORS,
useClass: HttpInterceptorService,
@ -70,4 +67,5 @@ import {RoleVerificationModule} from "./openaireLibrary/role-verification/role-v
bootstrap: [AppComponent]
})
export class AppModule {}
export class AppModule {
}

View File

@ -14,12 +14,12 @@ import {properties} from "../../environments/environment";
selector: 'html-page',
template: `
<schema2jsonld *ngIf="url" [URL]="url" [name]="pageTitle" type="other" [description]="description"></schema2jsonld>
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0" [texts]="pageContents['top']"></helper>
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
[texts]="pageContents['top']"></helper>
`
})
export class HtmlPageComponent {
properties: EnvProperties;
properties: EnvProperties = properties;
public pageContents = null;
public divContents = null;
@ -34,21 +34,14 @@ export class HtmlPageComponent {
private _title: Title,
private seoService: SEOService,
private _piwikService: PiwikService,
private helper: HelperService) {}
private helper: HelperService) {
}
public ngOnInit() {
this.properties = properties;
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
this.subscriptions.push(this._piwikService.trackView(this.properties, this.pageTitle, this.properties.piwikSiteId).subscribe());
}
this.communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
if (this.properties.environment == "development") {
this.subscriptions.push(this.route.queryParams.subscribe(params => {
this.communityId = (params['communityId']) ? params['communityId'] : ConnectHelper.getCommunityFromDomain(this.properties.domain);
}));
}
//TODO set the proper URL
this.url = this.properties.domain + this._router.url;
this.seoService.createLinkForCanonicalURL(this.url);

View File

@ -1,8 +1,6 @@
import {Component} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
import {Component, OnInit} from '@angular/core';
import {PiwikHelper} from '../../utils/piwikHelper';
import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper';
import {Subscriber} from "rxjs";
import {properties} from "../../../environments/environment";
@Component({
@ -10,28 +8,15 @@ import {properties} from "../../../environments/environment";
template: `
<dataprovider [piwikSiteId]=piwikSiteId [communityId]="communityId"></dataprovider>`,
})
export class OpenaireDataProviderComponent {
piwikSiteId = null;
communityId = null;
private sub;
constructor(private route: ActivatedRoute) {
this.sub = this.route.queryParams.subscribe(params => {
this.communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
if (!this.communityId) {
this.communityId = params['communityId'];
}
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, properties.environment);
});
export class OpenaireDataProviderComponent implements OnInit {
piwikSiteId;
communityId;
constructor() {
}
ngOnInit() {
}
ngOnDestroy() {
if (this.sub instanceof Subscriber) {
this.sub.unsubscribe();
this.communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, properties.environment);
}
}
}

View File

@ -1,8 +1,6 @@
import {Component} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
import {Component, OnInit} from '@angular/core';
import {PiwikHelper} from '../../utils/piwikHelper';
import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper';
import {Subscriber} from "rxjs";
import {properties} from "../../../environments/environment";
@Component({
@ -11,29 +9,15 @@ import {properties} from "../../../environments/environment";
<result-landing type="dataset" [piwikSiteId]="piwikSiteId" [communityId]="communityId"></result-landing>
`,
})
export class OpenaireDatasetComponent {
piwikSiteId = null;
communityId = null;
private sub;
constructor(private route: ActivatedRoute) {
this.sub = this.route.queryParams.subscribe(params => {
this.communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
if (!this.communityId) {
this.communityId = params['communityId'];
}
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, properties.environment);
});
export class OpenaireDatasetComponent implements OnInit {
piwikSiteId;
communityId;
constructor() {
}
ngOnInit() {
}
ngOnDestroy() {
if (this.sub instanceof Subscriber) {
this.sub.unsubscribe();
this.communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, properties.environment);
}
}
}

View File

@ -1,38 +1,22 @@
import {Component, ViewChild, ElementRef} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
import {Component} from '@angular/core';
import {PiwikHelper} from '../../utils/piwikHelper';
import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper';
import {Subscriber} from "rxjs";
import {properties} from "../../../environments/environment";
@Component({
selector: 'openaire-htmlProjectReport',
template: `<htmlProjectReport [piwikSiteId]=piwikSiteId [communityId]="communityId"></htmlProjectReport>`,
template: `
<htmlProjectReport [piwikSiteId]=piwikSiteId [communityId]="communityId"></htmlProjectReport>`,
})
export class OpenaireHtmlProjectReportComponent {
piwikSiteId = null;
communityId = null;
private sub;
constructor(private route: ActivatedRoute) {
this.sub = this.route.queryParams.subscribe(params => {
this.communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
if (!this.communityId) {
this.communityId = params['communityId'];
}
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, properties.environment);
});
piwikSiteId;
communityId;
constructor() {
}
ngOnInit() {
}
ngOnDestroy() {
if (this.sub instanceof Subscriber) {
this.sub.unsubscribe();
this.communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, properties.environment);
}
}
}

View File

@ -1,8 +1,6 @@
import {Component} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
import {PiwikHelper} from '../../utils/piwikHelper';
import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper';
import {Subscriber} from "rxjs";
import {properties} from "../../../environments/environment";
@Component({
@ -11,27 +9,14 @@ import {properties} from "../../../environments/environment";
<organization [piwikSiteId]=piwikSiteId [communityId]="communityId"></organization>`,
})
export class OpenaireOrganizationComponent {
piwikSiteId = null;
communityId = null;
private sub;
piwikSiteId;
communityId;
constructor(private route: ActivatedRoute) {
this.sub = this.route.queryParams.subscribe(params => {
this.communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
if (!this.communityId) {
this.communityId = params['communityId'];
constructor() {
}
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, properties.environment);
});
}
ngOnInit() {
}
ngOnDestroy() {
if (this.sub instanceof Subscriber) {
this.sub.unsubscribe();
}
this.communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, properties.environment);
}
}

View File

@ -1,4 +1,4 @@
import {Component} from '@angular/core';
import {Component, OnInit} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
import {PiwikHelper} from '../../utils/piwikHelper';
import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper';
@ -12,29 +12,14 @@ import {properties} from "../../../environments/environment";
`,
})
export class OpenaireOrpComponent {
export class OpenaireOrpComponent implements OnInit {
piwikSiteId = null;
communityId = null;
private sub;
constructor(private route: ActivatedRoute) {
this.sub = this.route.queryParams.subscribe(params => {
this.communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
if (!this.communityId) {
this.communityId = params['communityId'];
}
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, properties.environment);
});
}
constructor() {}
ngOnInit() {
}
ngOnDestroy() {
if (this.sub instanceof Subscriber) {
this.sub.unsubscribe();
}
this.communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, properties.environment);
}
}

View File

@ -1,8 +1,6 @@
import {Component} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
import {Component, OnInit} from '@angular/core';
import {PiwikHelper} from '../../utils/piwikHelper';
import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper';
import {Subscriber} from "rxjs";
import {properties} from "../../../environments/environment";
@Component({
@ -10,28 +8,15 @@ import {properties} from "../../../environments/environment";
template: `
<project [piwikSiteId]=piwikSiteId [communityId]="communityId"></project>`,
})
export class OpenaireProjectComponent {
piwikSiteId = null;
communityId = null;
private sub;
constructor(private route: ActivatedRoute) {
this.sub = this.route.queryParams.subscribe(params => {
this.communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
if (!this.communityId) {
this.communityId = params['communityId'];
}
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, properties.environment);
});
export class OpenaireProjectComponent implements OnInit {
piwikSiteId;
communityId;
constructor() {
}
ngOnInit() {
}
ngOnDestroy() {
if (this.sub instanceof Subscriber) {
this.sub.unsubscribe();
this.communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, properties.environment);
}
}
}

View File

@ -1,8 +1,6 @@
import {Component} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
import {PiwikHelper} from '../../utils/piwikHelper';
import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper';
import {Subscriber} from "rxjs";
import {properties} from "../../../environments/environment";
@Component({
@ -14,25 +12,11 @@ import {properties} from "../../../environments/environment";
export class OpenairePublicationComponent {
piwikSiteId = null;
communityId = null;
private sub;
constructor(private route: ActivatedRoute) {
this.sub = this.route.queryParams.subscribe(params => {
this.communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
if (!this.communityId) {
this.communityId = params['communityId'];
}
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, properties.environment);
});
}
constructor() {}
ngOnInit() {
}
ngOnDestroy() {
if (this.sub instanceof Subscriber) {
this.sub.unsubscribe();
this.communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, properties.environment);
}
}
}

View File

@ -1,37 +1,21 @@
import {Component} from '@angular/core';
import {ActivatedRoute} from "@angular/router";
import {Component, OnInit} from '@angular/core';
import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper";
import {PiwikHelper} from "../../utils/piwikHelper";
import {Subscriber} from "rxjs";
import {properties} from "../../../environments/environment";
@Component({
selector: 'openaire-publication',
template: `<result-landing type="result" [piwikSiteId]="piwikSiteId" [communityId]="communityId"></result-landing>`,
template: `
<result-landing type="result" [piwikSiteId]="piwikSiteId" [communityId]="communityId"></result-landing>`,
})
export class OpenaireResultComponent{
piwikSiteId = null;
communityId = null;
private sub;
constructor(private route: ActivatedRoute) {
this.sub = this.route.queryParams.subscribe(params => {
this.communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
if (!this.communityId) {
this.communityId = params['communityId'];
}
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, properties.environment);
});
}
export class OpenaireResultComponent implements OnInit{
piwikSiteId;
communityId;
constructor() {}
ngOnInit() {
}
ngOnDestroy() {
if (this.sub instanceof Subscriber) {
this.sub.unsubscribe();
this.communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, properties.environment);
}
}
}

View File

@ -1,8 +1,6 @@
import {Component} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
import {Component, OnInit} from '@angular/core';
import {PiwikHelper} from '../../utils/piwikHelper';
import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper';
import {Subscriber} from "rxjs";
import {properties} from "../../../environments/environment";
@Component({
@ -11,30 +9,15 @@ import {properties} from "../../../environments/environment";
<result-landing type="software" [piwikSiteId]="piwikSiteId" [communityId]="communityId"></result-landing>
`,
})
export class OpenaireSoftwareComponent {
piwikSiteId = null;
communityId = null;
private sub;
export class OpenaireSoftwareComponent implements OnInit {
piwikSiteId;
communityId;
constructor(private route: ActivatedRoute) {
this.sub =
this.route.queryParams.subscribe(params => {
this.communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
if (!this.communityId) {
this.communityId = params['communityId'];
constructor() {
}
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, properties.environment);
});
}
ngOnInit() {
}
ngOnDestroy() {
if (this.sub instanceof Subscriber) {
this.sub.unsubscribe();
this.communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, properties.environment);
}
}
}

View File

@ -1,55 +1,32 @@
import {Component, Input, ViewChild} from '@angular/core';
import {Component, OnInit} from '@angular/core';
import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class";
import {ActivatedRoute} from "@angular/router";
import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper";
import {PiwikHelper} from "../../utils/piwikHelper";
import {Subscriber} from "rxjs";
import {properties} from "../../../environments/environment";
@Component({
selector: 'openaire-advanced-search-dataprovider',
template: `
<search-dataproviders [simpleView]="false" [customFilter]=customFilter [piwikSiteId]="piwikSiteId" [hasPrefix]="false" [showBreadcrumb]="true" [showSwitchSearchLink]="false">
<search-dataproviders [simpleView]="false" [customFilter]=customFilter [piwikSiteId]="piwikSiteId"
[hasPrefix]="false" [showBreadcrumb]="true" [showSwitchSearchLink]="false">
</search-dataproviders>
`
})
export class OpenaireAdvancedSearchDataProvidersComponent {
connectCommunityId:string;
export class OpenaireAdvancedSearchDataProvidersComponent implements OnInit {
communityId: string;
piwikSiteId = null;
customFilter: SearchCustomFilter = null;
constructor ( private route: ActivatedRoute) {
}
sub;
ngOnDestroy() {
if (this.sub instanceof Subscriber) {
this.sub.unsubscribe();
}
constructor() {
}
ngOnInit() {
var communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
this.piwikSiteId = PiwikHelper.getSiteId(communityId, properties.environment);
let communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
if (communityId) {
this.connectCommunityId = communityId;
this.customFilter = new SearchCustomFilter("Community", "communityId", this.connectCommunityId, "");
this.customFilter.isHiddenFilter = false;
} else{
this.sub = this.route.queryParams.subscribe(params => {
if(params['communityId'] && params['communityId']!=""){
this.connectCommunityId = params['communityId'];
this.piwikSiteId = PiwikHelper.getSiteId(this.connectCommunityId, properties.environment);
this.customFilter = new SearchCustomFilter("Community", "communityId", this.connectCommunityId, "");
this.piwikSiteId = PiwikHelper.getSiteId(communityId, properties.environment);
this.communityId = communityId;
this.customFilter = new SearchCustomFilter("Community", "communityId", this.communityId, "");
this.customFilter.isHiddenFilter = false;
}
});
}
}
}

View File

@ -1,4 +1,4 @@
import {Component, Input, ViewChild} from '@angular/core';
import {Component, Input, OnInit, ViewChild} from '@angular/core';
import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class";
import {ActivatedRoute} from "@angular/router";
import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper";
@ -12,47 +12,23 @@ import {properties} from "../../../environments/environment";
template: `
<search-organizations [simpleView]="false" [customFilter]=customFilter [piwikSiteId]="piwikSiteId" [hasPrefix]="false" [showBreadcrumb]="true" [showSwitchSearchLink]="false">
</search-organizations>
`
})
export class OpenaireAdvancedSearchOrganizationsComponent implements OnInit {
communityId:string;
piwikSiteId;
customFilter: SearchCustomFilter;
export class OpenaireAdvancedSearchOrganizationsComponent {
connectCommunityId:string;
piwikSiteId = null;
customFilter: SearchCustomFilter = null;
constructor ( private route: ActivatedRoute) {
}
sub;
ngOnDestroy() {
if (this.sub instanceof Subscriber) {
this.sub.unsubscribe();
}
constructor () {
}
ngOnInit() {
var communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
let communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
this.piwikSiteId = PiwikHelper.getSiteId(communityId, properties.environment);
if(communityId){
this.connectCommunityId = communityId;
this.customFilter = new SearchCustomFilter("Community", "communityId", this.connectCommunityId, "");
this.communityId = communityId;
this.customFilter = new SearchCustomFilter("Community", "communityId", this.communityId, "");
this.customFilter.isHiddenFilter = false;
} else{
this.sub = this.route.queryParams.subscribe(params => {
if(params['communityId'] && params['communityId']!=""){
this.connectCommunityId = params['communityId'];
this.piwikSiteId = PiwikHelper.getSiteId(this.connectCommunityId, properties.environment);
this.customFilter = new SearchCustomFilter("Community", "communityId", this.connectCommunityId, "");
this.customFilter.isHiddenFilter = false;
}
});
}
}
}

View File

@ -1,53 +1,34 @@
import {Component} from '@angular/core';
import {Component, OnInit} from '@angular/core';
import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class";
import {ActivatedRoute} from "@angular/router";
import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper";
import {PiwikHelper} from "../../utils/piwikHelper";
import {Subscriber} from "rxjs";
import {properties} from "../../../environments/environment";
@Component({
selector: 'openaire-advanced-search-projects',
template: `
<search-projects [simpleView]="false" [customFilter]=customFilter [piwikSiteId]="piwikSiteId" [hasPrefix]="false" [showBreadcrumb]="true" [showSwitchSearchLink]="false">
<search-projects [simpleView]="false" [customFilter]=customFilter [piwikSiteId]="piwikSiteId" [hasPrefix]="false"
[showBreadcrumb]="true" [showSwitchSearchLink]="false">
</search-projects>
`
})
export class OpenaireAdvancedSearchProjectsComponent {
connectCommunityId:string;
piwikSiteId = null;
export class OpenaireAdvancedSearchProjectsComponent implements OnInit {
communityId: string;
piwikSiteId;
customFilter: SearchCustomFilter = null;
constructor ( private route: ActivatedRoute) {
}
sub;
ngOnDestroy() {
if (this.sub instanceof Subscriber) {
this.sub.unsubscribe();
}
constructor() {
}
ngOnInit() {
var communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
this.piwikSiteId = PiwikHelper.getSiteId(communityId, properties.environment);
let communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
if (communityId) {
this.connectCommunityId = communityId;
this.customFilter = new SearchCustomFilter("Community", "communityId", this.connectCommunityId, "");
this.customFilter.isHiddenFilter = false;
} else{
this.route.queryParams.subscribe(params => {
if(params['communityId'] && params['communityId']!=""){
this.connectCommunityId = params['communityId'];
this.piwikSiteId = PiwikHelper.getSiteId(this.connectCommunityId, properties.environment);
this.customFilter = new SearchCustomFilter("Community", "communityId", this.connectCommunityId, "");
this.communityId = communityId;
this.piwikSiteId = PiwikHelper.getSiteId(communityId, properties.environment);
this.customFilter = new SearchCustomFilter("Community", "communityId", this.communityId, "");
this.customFilter.isHiddenFilter = false;
}
});
}
}
}

View File

@ -1,49 +1,32 @@
import {Component} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
import {PiwikHelper} from '../../utils/piwikHelper';
import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper';
import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class";
import {properties} from "../../../environments/environment";
import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properties";
import {Subscriber} from "rxjs";
@Component({
selector: 'openaire-search-find',
template: `
<search-all logoURL = "/assets/common-assets/logo-small-explore.png" name="OpenAIRE Connect" [customFilter]=customFilter [piwikSiteId]="piwikSiteId" ></search-all>
<search-all logoURL="/assets/common-assets/logo-small-explore.png" name="OpenAIRE Connect"
[customFilter]=customFilter [piwikSiteId]="piwikSiteId"></search-all>
`,
})
export class OpenaireSearchComponent {
connectCommunityId:string;
communityId: string;
customFilter: SearchCustomFilter = null;
piwikSiteId = null;
properties:EnvProperties;
constructor ( private route: ActivatedRoute) {
}
sub;
ngOnDestroy() {
if (this.sub instanceof Subscriber) {
this.sub.unsubscribe();
}
properties: EnvProperties = properties;
constructor() {
}
ngOnInit() {
this.properties = properties;
let communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
this.piwikSiteId = PiwikHelper.getSiteId(communityId,this.properties.environment);
if (communityId) {
this.connectCommunityId = communityId;
this.customFilter = new SearchCustomFilter("Community", "communityId", this.connectCommunityId, "");
}else{
this.sub = this.route.queryParams.subscribe(params => {
if(params['communityId'] && params['communityId']!=""){
this.connectCommunityId = params['communityId'];
this.piwikSiteId = PiwikHelper.getSiteId(this.connectCommunityId,this.properties.environment);
this.customFilter = new SearchCustomFilter("Community", "communityId", this.connectCommunityId, "");
this.communityId = communityId;
this.piwikSiteId = PiwikHelper.getSiteId(communityId, this.properties.environment);
this.customFilter = new SearchCustomFilter("Community", "communityId", this.communityId, "");
}
});
}
}
}

View File

@ -1,43 +1,25 @@
import {Component, OnDestroy, OnInit} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
import {Component, OnInit} from '@angular/core';
import {PiwikHelper} from '../../utils/piwikHelper';
import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper';
import {Subscriber} from "rxjs";
import {properties} from "../../../environments/environment";
@Component({
selector: 'openaire-search-organizations',
template: `
<search-organizations>
</search-organizations>
<search-organizations></search-organizations>
`
})
export class OpenaireSearchOrganizationsComponent implements OnInit, OnDestroy {
export class OpenaireSearchOrganizationsComponent implements OnInit {
piwikSiteId = null;
sub;
constructor(private route: ActivatedRoute) {
constructor() {
}
ngOnInit() {
var communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
let communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
if (communityId) {
this.piwikSiteId = PiwikHelper.getSiteId(communityId, properties.environment);
} else {
this.sub = this.route.queryParams.subscribe(params => {
if (params['communityId'] && params['communityId'] != "") {
communityId = params['communityId'];
this.piwikSiteId = PiwikHelper.getSiteId(communityId, properties.environment);
}
});
}
}
ngOnDestroy() {
if (this.sub instanceof Subscriber) {
this.sub.unsubscribe();
}
}
}