[Trunk | Connect]:
affiliations.component & directLinking.component & linkingGeneric.component & communityWrapper.component & curators.component & depositBySubjectResult.component & depositDatasets.component & depositDatasetsResult.component & depositPublications.component & depositPublicationsResult.component & shareInZenodo.component & htmlPage.component & user.component & searchDataproviders.component & searchProjects.component & statistics.component & invite.component: Priority to get communityId from domain (if not exists, check url parameter) git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@56331 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
0fd74a3e30
commit
5851f71634
|
@ -33,9 +33,9 @@ export class AffiliationsComponent {
|
|||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.route.queryParams.subscribe(
|
||||
communityId => {
|
||||
this.communityId = communityId['communityId'];
|
||||
if(!this.communityId){
|
||||
this.communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
|
||||
this.communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
|
||||
if(!this.communityId) {
|
||||
this.communityId = communityId['communityId'];
|
||||
}
|
||||
|
||||
this.properties = data.envSpecific;
|
||||
|
|
|
@ -18,11 +18,10 @@ export class OpenaireDirectLinkingComponent {
|
|||
.subscribe((data: { envSpecific: any }) => {
|
||||
this.route.queryParams.subscribe(
|
||||
communityId => {
|
||||
this.communityId = communityId['communityId'];
|
||||
if(!this.communityId){
|
||||
this.communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
|
||||
this.communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
|
||||
if(!this.communityId) {
|
||||
this.communityId = communityId['communityId'];
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -19,11 +19,10 @@ export class OpenaireLinkingComponent {
|
|||
.subscribe((data: { envSpecific: any }) => {
|
||||
this.route.queryParams.subscribe(
|
||||
communityId => {
|
||||
this.communityId = communityId['communityId'];
|
||||
if(!this.communityId){
|
||||
this.communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
|
||||
this.communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
|
||||
if(!this.communityId) {
|
||||
this.communityId = communityId['communityId'];
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -24,10 +24,11 @@ export class CommunityWrapperComponent {
|
|||
.subscribe((data: { envSpecific: any }) => {
|
||||
this.route.queryParams.subscribe(
|
||||
communityId => {
|
||||
this.communityId = communityId['communityId'];
|
||||
if(!this.communityId){
|
||||
this.communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
|
||||
this.communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
|
||||
if(!this.communityId) {
|
||||
this.communityId = communityId['communityId'];
|
||||
}
|
||||
|
||||
if(this.communityId){
|
||||
this.dashboard = true;
|
||||
}else{
|
||||
|
|
|
@ -48,41 +48,27 @@ export class CuratorsComponent {
|
|||
HelperFunctions.scroll();
|
||||
})
|
||||
} else {
|
||||
if(this.properties.environment == "development") {
|
||||
this.route.queryParams.subscribe(data => {
|
||||
this.route.queryParams.subscribe(data => {
|
||||
this.communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
|
||||
if(!this.communityId) {
|
||||
this.communityId = data['communityId'];
|
||||
this.communitiesService.getCommunities(this.properties,
|
||||
this.properties.communityAPI + this.communityId).subscribe(community => {
|
||||
this.managers = community[0].managers;
|
||||
let emails = this.managers.join();
|
||||
this.curatorsService.getCurators(this.properties,
|
||||
this.properties.adminToolsAPIURL + '/curator?emails=' + emails).subscribe(curators => {
|
||||
this.curators = curators;
|
||||
for(let i = 0; i < this.curators.length; i++) {
|
||||
this.showMore[i]= false;
|
||||
}
|
||||
this.showLoading = false;
|
||||
HelperFunctions.scroll();
|
||||
});
|
||||
})
|
||||
});
|
||||
} else {
|
||||
this.communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
|
||||
}
|
||||
|
||||
this.communitiesService.getCommunities(this.properties,
|
||||
this.properties.communityAPI + this.communityId).subscribe(community => {
|
||||
this.managers = community[0].managers;
|
||||
let emails = this.managers.join();
|
||||
this.curatorsService.getCurators(this.properties,
|
||||
this.properties.adminToolsAPIURL + '/curator?emails=' + emails).subscribe(curators => {
|
||||
this.curators = curators;
|
||||
for(let i = 0; i < this.curators.length; i++) {
|
||||
this.showMore[i]= false;
|
||||
}
|
||||
this.showLoading = false;
|
||||
HelperFunctions.scroll();
|
||||
});
|
||||
this.managers = community[0].managers;
|
||||
let emails = this.managers.join();
|
||||
this.curatorsService.getCurators(this.properties,
|
||||
this.properties.adminToolsAPIURL + '/curator?emails=' + emails).subscribe(curators => {
|
||||
this.curators = curators;
|
||||
for(let i = 0; i < this.curators.length; i++) {
|
||||
this.showMore[i]= false;
|
||||
}
|
||||
this.showLoading = false;
|
||||
HelperFunctions.scroll();
|
||||
});
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -36,10 +36,11 @@ export class OpenaireDepositBySubjectResultComponent {
|
|||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties = data.envSpecific;
|
||||
this.route.queryParams.subscribe(params => {
|
||||
var communityId = params['communityId'];
|
||||
if(!communityId){
|
||||
communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
|
||||
}
|
||||
let communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
|
||||
if(!communityId) {
|
||||
communityId = params['communityId'];
|
||||
}
|
||||
|
||||
this.piwikSiteId = PiwikHelper.siteIDs[communityId];
|
||||
|
||||
if(communityId) {
|
||||
|
|
|
@ -38,10 +38,11 @@ export class OpenaireDepositDatasetsComponent {
|
|||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties = data.envSpecific;
|
||||
this.route.queryParams.subscribe(params => {
|
||||
var communityId = params['communityId'];
|
||||
if(!communityId){
|
||||
communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
|
||||
}
|
||||
let communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
|
||||
if(!communityId) {
|
||||
communityId = params['communityId'];
|
||||
}
|
||||
|
||||
this.piwikSiteId = PiwikHelper.siteIDs[communityId];
|
||||
|
||||
if(communityId) {
|
||||
|
|
|
@ -37,10 +37,11 @@ export class OpenaireDepositDatasetsResultComponent {
|
|||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties = data.envSpecific;
|
||||
this.route.queryParams.subscribe(params => {
|
||||
var communityId = params['communityId'];
|
||||
if(!communityId){
|
||||
communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
|
||||
}
|
||||
let communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
|
||||
if(!communityId) {
|
||||
communityId = params['communityId'];
|
||||
}
|
||||
|
||||
this.piwikSiteId = PiwikHelper.siteIDs[communityId];
|
||||
|
||||
if(communityId) {
|
||||
|
|
|
@ -38,10 +38,11 @@ export class OpenaireDepositPublicationsComponent {
|
|||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties = data.envSpecific;
|
||||
this.route.queryParams.subscribe(params => {
|
||||
var communityId = params['communityId'];
|
||||
if(!communityId){
|
||||
communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
|
||||
}
|
||||
let communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
|
||||
if(!communityId) {
|
||||
communityId = params['communityId'];
|
||||
}
|
||||
|
||||
this.piwikSiteId = PiwikHelper.siteIDs[communityId];
|
||||
|
||||
if(communityId) {
|
||||
|
|
|
@ -37,10 +37,11 @@ export class OpenaireDepositPublicationsResultComponent {
|
|||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties = data.envSpecific;
|
||||
this.route.queryParams.subscribe(params => {
|
||||
var communityId = params['communityId'];
|
||||
if(!communityId){
|
||||
communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
|
||||
}
|
||||
let communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
|
||||
if(!communityId) {
|
||||
communityId = params['communityId'];
|
||||
}
|
||||
|
||||
this.piwikSiteId = PiwikHelper.siteIDs[communityId];
|
||||
|
||||
if(communityId) {
|
||||
|
|
|
@ -51,9 +51,9 @@ export class ShareInZenodoComponent {
|
|||
this.updateDescription("Zenodo, repository, deposit, share");
|
||||
this.properties = data.envSpecific;
|
||||
this.route.queryParams.subscribe(params => {
|
||||
this.communityId = params['communityId'];
|
||||
if (!this.communityId) {
|
||||
this.communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
|
||||
this.communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
|
||||
if(!this.communityId) {
|
||||
this.communityId = params['communityId'];
|
||||
}
|
||||
|
||||
if (this.communityId) {
|
||||
|
|
|
@ -25,12 +25,13 @@ export class HtmlPageComponent {
|
|||
this.properties = data.envSpecific;
|
||||
this.route.queryParams.subscribe(
|
||||
params => {
|
||||
this.communityId = params['communityId'];
|
||||
if(!this.communityId){
|
||||
this.communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
|
||||
}
|
||||
this.communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
|
||||
if(!this.communityId) {
|
||||
this.communityId = params['communityId'];
|
||||
}
|
||||
|
||||
if(!this.communityId){
|
||||
this.communityId = this.properties.adminToolsCommunity;
|
||||
this.communityId = this.properties.adminToolsCommunity;
|
||||
}
|
||||
if(location){
|
||||
this.sub = this._service.getHtmlContent(location.pathname, this.properties, this.communityId).subscribe(
|
||||
|
|
|
@ -62,11 +62,10 @@ export class OpenaireUserComponent {
|
|||
.subscribe((data: { envSpecific: any }) => {
|
||||
this.route.queryParams.subscribe(
|
||||
communityId => {
|
||||
this.communityId = communityId['communityId'];
|
||||
if(!this.communityId){
|
||||
this.communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
|
||||
this.communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
|
||||
if(!this.communityId) {
|
||||
this.communityId = communityId['communityId'];
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -67,10 +67,11 @@ export class OpenaireSearchDataprovidersComponent {
|
|||
|
||||
//this.searchPage.refineFields = this.refineFields;
|
||||
this.sub = this.route.queryParams.subscribe(params => {
|
||||
this.communityId = params['communityId'];
|
||||
if(!this.communityId){
|
||||
this.communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
|
||||
this.communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
|
||||
if(!this.communityId) {
|
||||
this.communityId = params['communityId'];
|
||||
}
|
||||
|
||||
this.piwikSiteId = PiwikHelper.siteIDs[this.communityId];
|
||||
this.searchUtils.keyword = (params['keyword']?params['keyword']:'');
|
||||
//this.filters = this.createFilters();
|
||||
|
|
|
@ -66,10 +66,12 @@ export class OpenaireSearchProjectsComponent {
|
|||
|
||||
//this.searchPage.refineFields = this.refineFields;
|
||||
this.sub = this.route.queryParams.subscribe(params => {
|
||||
this.communityId = params['communityId'];
|
||||
if(!this.communityId && typeof document !== 'undefined'){
|
||||
this.communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
|
||||
//if (!this.communityId && typeof document !== 'undefined') {
|
||||
this.communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
|
||||
if(!this.communityId) {
|
||||
this.communityId = params['communityId'];
|
||||
}
|
||||
|
||||
this.piwikSiteId = PiwikHelper.siteIDs[this.communityId];
|
||||
this.searchUtils.keyword = (params['keyword']?params['keyword']:'');
|
||||
//this.filters = this.createFilters();
|
||||
|
|
|
@ -89,10 +89,11 @@ export class StatisticsComponent {
|
|||
|
||||
this.route.queryParams.subscribe(
|
||||
communityId => {
|
||||
this.communityId = communityId['communityId'];
|
||||
if (!this.communityId) {
|
||||
this.communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
|
||||
this.communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
|
||||
if(!this.communityId) {
|
||||
this.communityId = communityId['community'];
|
||||
}
|
||||
|
||||
if (this.currentMode == "showInMonitor" && this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
|
||||
this.piwiksub = this._piwikService.trackView(this.properties, "Monitor " + this.communityId, PiwikHelper.siteIDs[this.communityId]).subscribe();
|
||||
}
|
||||
|
|
|
@ -81,10 +81,12 @@ export class InviteComponent implements OnInit {
|
|||
this.status = this.errorCodes.LOADING;
|
||||
this.route.queryParams.subscribe(
|
||||
communityId => {
|
||||
this.communityId = communityId['communityId'];
|
||||
if(!this.communityId && typeof document !== 'undefined'){
|
||||
this.communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
|
||||
//if(!this.communityId && typeof document !== 'undefined'){
|
||||
this.communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
|
||||
if(!this.communityId) {
|
||||
this.communityId = communityId['community'];
|
||||
}
|
||||
|
||||
this.communityIdParam = (this.properties.environment !="development" )?{}:{communityId:this.communityId};
|
||||
if (this.communityId != null && this.communityId != '') {
|
||||
this._communityService.getCommunity(this.properties, this.properties.communityAPI+this.communityId).subscribe (
|
||||
|
|
Loading…
Reference in New Issue