[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:
konstantina.galouni 2019-07-03 10:16:58 +00:00
parent 0fd74a3e30
commit 5851f71634
17 changed files with 85 additions and 89 deletions

View File

@ -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;

View File

@ -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'];
}
});
});

View File

@ -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'];
}
});
});

View File

@ -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{

View File

@ -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();
});
})
}
});
}
});

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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(

View File

@ -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'];
}
});
});

View File

@ -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();

View File

@ -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();

View File

@ -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();
}

View File

@ -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 (