[Trunk | Connect]:

1. communities.component.ts & contentPage.component.ts & shareInZenodo.component.ts & helper-test.component.ts & organizationsPage.component.ts & 
   learn-how.component.ts & learn-in-depth.component.ts & my-communities.component.ts:
	"properties" as first parameter in methods of helper.service.ts.
2. contact.component.ts & curators.component.ts & invite.component.ts: 
	a. "properties" as first parameter in methods of helper.service.ts
	b. create request path in service (email.service.ts, curator.service.ts).
3. htmlPage.component.ts & htmlPage.service.ts: "properties" as first parameter in methods of htmlPage.service.ts.
4. customization.component.ts: create request path in service (layout.service.ts).
5. subscribe.component.ts: create request path in service (subscribe.service.ts).


git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@58421 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2020-04-07 16:52:19 +00:00
parent a6404f7120
commit 955958a7c8
15 changed files with 32 additions and 34 deletions

View File

@ -80,13 +80,13 @@ export class CommunitiesComponent {
}
private getPageContents() {
this.helper.getPageHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => {
this.helper.getPageHelpContents(this.properties, 'connect', this._router.url).subscribe(contents => {
this.pageContents = contents;
})
}
private getDivContents() {
this.helper.getDivHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => {
this.helper.getDivHelpContents(this.properties, 'connect', this._router.url).subscribe(contents => {
this.divContents = contents;
})
}

View File

@ -65,13 +65,13 @@ export class ContactComponent implements OnInit {
}
private getPageContents() {
this.helper.getPageHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => {
this.helper.getPageHelpContents(this.properties, 'connect', this._router.url).subscribe(contents => {
this.pageContents = contents;
})
}
private getDivContents() {
this.helper.getDivHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => {
this.helper.getDivHelpContents(this.properties, 'connect', this._router.url).subscribe(contents => {
this.divContents = contents;
})
}
@ -100,7 +100,7 @@ export class ContactComponent implements OnInit {
private sendMail(admins: any) {
this.showLoading = true;
this._emailService.contact(this.properties.adminToolsAPIURL + '/contact',
this._emailService.contact(this.properties,
Composer.composeEmailForNewCommunity(this.contactForm.value, admins),
this.contactForm.value.recaptcha).subscribe(
res => {

View File

@ -68,13 +68,13 @@ export class ContentPageComponent {
}
private getPageContents() {
this.helper.getPageHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => {
this.helper.getPageHelpContents(this.properties, 'connect', this._router.url).subscribe(contents => {
this.pageContents = contents;
})
}
private getDivContents() {
this.helper.getDivHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => {
this.helper.getDivHelpContents(this.properties, 'connect', this._router.url).subscribe(contents => {
this.divContents = contents;
})
}

View File

@ -65,8 +65,7 @@ export class CuratorsComponent {
this.downloadUrl = this.properties.utilsService + '/download/';
if(!this.longView) {
let emails = this.managers.join();
this.curatorsService.getCurators(this.properties,
this.properties.adminToolsAPIURL + '/curator?emails=' + emails).subscribe(curators => {
this.curatorsService.getCurators(this.properties, emails).subscribe(curators => {
this.curators = curators;
for(let i = 0; i < this.curators.length; i++) {
this.showMore[i]= false;
@ -86,8 +85,7 @@ export class CuratorsComponent {
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.curatorsService.getCurators(this.properties, emails).subscribe(curators => {
this.curators = curators;
for(let i = 0; i < this.curators.length; i++) {
this.showMore[i]= false;
@ -108,13 +106,13 @@ export class CuratorsComponent {
}
private getPageContents() {
this.helper.getPageHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => {
this.helper.getPageHelpContents(this.properties, 'connect', this._router.url).subscribe(contents => {
this.pageContents = contents;
})
}
private getDivContents() {
this.helper.getDivHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => {
this.helper.getDivHelpContents(this.properties, 'connect', this._router.url).subscribe(contents => {
this.divContents = contents;
})
}

View File

@ -162,13 +162,13 @@ export class ShareInZenodoComponent {
}
private getPageContents() {
this.helper.getPageHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => {
this.helper.getPageHelpContents(this.properties, 'connect', this._router.url).subscribe(contents => {
this.pageContents = contents;
})
}
private getDivContents() {
this.helper.getDivHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => {
this.helper.getDivHelpContents(this.properties, 'connect', this._router.url).subscribe(contents => {
this.divContents = contents;
})
}

View File

@ -29,7 +29,7 @@ export class HelperTestComponent implements OnInit{
}
private getPageContents() {
this.helper.getPageHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => {
this.helper.getPageHelpContents(this.properties, "connect", this._router.url).subscribe(contents => {
this.pageContents = contents;
})
}

View File

@ -34,7 +34,7 @@ export class HtmlPageComponent {
this.communityId = this.properties.adminToolsCommunity;
}
if(location){
this.sub = this._service.getHtmlContent(location.pathname, this.properties, this.communityId).subscribe(
this.sub = this._service.getHtmlContent(this.properties, this.communityId, location.pathname).subscribe(
data => {
if(data.length > 0) {
this.content = data[0].content;

View File

@ -10,10 +10,10 @@ import{EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
export class HtmlPageService {
constructor(private http: HttpClient) {}
getHtmlContent (router: string, properties:EnvProperties, communityId:string ):any {
getHtmlContent (properties:EnvProperties, communityId:string, page_route: string):any {
//console.info("get router html content for : "+router);
let url = properties.adminToolsAPIURL + '/htmlpagecontent?community='+communityId+'&page='+router;
let url = properties.adminToolsAPIURL + '/htmlpagecontent?community='+communityId+'&page='+page_route;
return this.http.get<Array<any>>((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url);
//.map(res => <Array<any>> res.json());

View File

@ -57,13 +57,13 @@ export class OrganizationsPageComponent {
}
private getPageContents() {
this.helper.getPageHelpContents(this._router.url, this.properties, this.communityId).subscribe(contents => {
this.helper.getPageHelpContents(this.properties, this.communityId, this._router.url).subscribe(contents => {
this.pageContents = contents;
})
}
private getDivContents() {
this.helper.getDivHelpContents(this._router.url, this.properties, this.communityId).subscribe(contents => {
this.helper.getDivHelpContents(this.properties, this.communityId, this._router.url).subscribe(contents => {
this.divContents = contents;
})
}

View File

@ -161,13 +161,13 @@ export class LearnHowComponent {
}
private getPageContents() {
this.helper.getPageHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => {
this.helper.getPageHelpContents(this.properties, 'connect', this._router.url).subscribe(contents => {
this.pageContents = contents;
})
}
private getDivContents() {
this.helper.getDivHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => {
this.helper.getDivHelpContents(this.properties, 'connect', this._router.url).subscribe(contents => {
this.divContents = contents;
})
}

View File

@ -245,13 +245,13 @@ export class LearnInDepthComponent {
}
private getPageContents() {
this.helper.getPageHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => {
this.helper.getPageHelpContents(this.properties, 'connect', this._router.url).subscribe(contents => {
this.pageContents = contents;
})
}
private getDivContents() {
this.helper.getDivHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => {
this.helper.getDivHelpContents(this.properties, 'connect', this._router.url).subscribe(contents => {
this.divContents = contents;
})
}

View File

@ -88,13 +88,13 @@ export class MyCommunitiesComponent {
}
private getPageContents() {
this.helper.getPageHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => {
this.helper.getPageHelpContents(this.properties, 'connect', this._router.url).subscribe(contents => {
this.pageContents = contents;
})
}
private getDivContents() {
this.helper.getDivHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => {
this.helper.getDivHelpContents(this.properties, 'connect', this._router.url).subscribe(contents => {
this.divContents = contents;
})
}

View File

@ -33,7 +33,7 @@ export class CustomizationComponent {
this.layout = JSON.parse(StringUtils.URIDecode(params['layout']));
this.buildCss();
}else{
this._layoutService.getLayout(this.communityId, this.properties.adminToolsAPIURL+"/community/").subscribe(
this._layoutService.getLayout(this.properties, this.communityId).subscribe(
layout => {
this.layout = layout;
if(!layout){

View File

@ -160,13 +160,13 @@ export class InviteComponent implements OnInit {
}
private getPageContents() {
this.helper.getPageHelpContents(this._router.url, this.properties, this.communityId).subscribe(contents => {
this.helper.getPageHelpContents(this.properties, this.communityId, this._router.url).subscribe(contents => {
this.pageContents = contents;
})
}
private getDivContents() {
this.helper.getDivHelpContents(this._router.url, this.properties, this.communityId).subscribe(contents => {
this.helper.getDivHelpContents(this.properties, this.communityId, this._router.url).subscribe(contents => {
this.divContents = contents;
})
}
@ -182,7 +182,7 @@ export class InviteComponent implements OnInit {
if (this.validateEmails()) {
this.composeEmail();
this._emailService.sendEmail(this.properties.adminToolsAPIURL + "/sendMail/", this.email).subscribe(
this._emailService.sendEmail(this.properties, this.email).subscribe(
res => {
this.status = this.errorCodes.DONE;
//console.log("Emails Sent: ",res);

View File

@ -137,7 +137,7 @@ export class SubscribeComponent {
} else {
this.loading = true;
this.showLoginAlert = false;
this._subscribeService.subscribeToCommunity(this.communityId, email, this.properties.adminToolsAPIURL).subscribe(
this._subscribeService.subscribeToCommunity(this.properties, this.communityId, email).subscribe(
res => {
this.loading = false;
if (res.status && res.status != 200) {
@ -156,7 +156,7 @@ export class SubscribeComponent {
this.subscribeEvent.emit({
value: "ok"
});
this._emailService.sendEmail(this.properties.adminToolsAPIURL + "/notifyForNewSubscribers/" + this.communityId, Composer.composeEmailToInformManagers(this.community.title, this.communityId, this.community.managers, email)).subscribe(
this._emailService.notifyForNewManagers(this.properties, this.communityId, Composer.composeEmailToInformManagers(this.community.title, this.communityId, this.community.managers, email)).subscribe(
res => {
//console.log("The email has been sent successfully!")
},
@ -192,7 +192,7 @@ export class SubscribeComponent {
} else {
this.loading = true;
//this.properties.adminToolsAPIURL
this._subscribeService.unSubscribeToCommunity(this.communityId, email, this.properties.adminToolsAPIURL).subscribe(
this._subscribeService.unSubscribeToCommunity(this.properties, this.communityId, email).subscribe(
res => {
this.loading = false;
if (res.status && res.status != 200) {