[Trunk | Library]: Merging branch 'use-UoaAdminToolsLibrary' into trunk for revisions 58402:59464
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@59465 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
021e7063d7
commit
9261419e2d
|
@ -4,6 +4,7 @@ import { CommunityInfo } from './communityInfo';
|
||||||
import {EnvProperties} from '../../utils/properties/env-properties';
|
import {EnvProperties} from '../../utils/properties/env-properties';
|
||||||
import {map} from "rxjs/operators";
|
import {map} from "rxjs/operators";
|
||||||
import {BehaviorSubject, from} from "rxjs";
|
import {BehaviorSubject, from} from "rxjs";
|
||||||
|
import {properties} from "../../../../environments/environment";
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
export class CommunityService {
|
export class CommunityService {
|
||||||
|
@ -127,7 +128,7 @@ export class CommunityService {
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
isSubscribedToCommunity(pid: string, email: string, url: string) {
|
isSubscribedToCommunity(pid: string, email: string, url: string) {
|
||||||
return this.http.get(url + '/community/' + pid + '/subscribers')
|
return this.http.get(url + '/'+ properties.adminToolsPortalType +'/' + pid + '/subscribers')
|
||||||
//.map(res => ((<any>res === '') ? {} : <any> res.json()))
|
//.map(res => ((<any>res === '') ? {} : <any> res.json()))
|
||||||
.pipe(map(res => {
|
.pipe(map(res => {
|
||||||
if (res['subscribers'] && res['subscribers'] != null) {
|
if (res['subscribers'] && res['subscribers'] != null) {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import {HttpParams} from '@angular/common/http';
|
import {HttpParams} from '@angular/common/http';
|
||||||
|
import {properties} from "../../../environments/environment";
|
||||||
|
|
||||||
export class ConnectHelper {
|
export class ConnectHelper {
|
||||||
|
|
||||||
|
@ -30,4 +31,14 @@ export class ConnectHelper {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static setPortalTypeFromPid(pid: string): void {
|
||||||
|
if(pid == "openaire") {
|
||||||
|
properties.adminToolsPortalType = "explore";
|
||||||
|
} else if(pid == "connect") {
|
||||||
|
properties.adminToolsPortalType = "connect";
|
||||||
|
} else {
|
||||||
|
properties.adminToolsPortalType = "community";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,6 +56,7 @@
|
||||||
<th><input id="allDivIdCheckbox" type="checkbox" (change)="toggleCheckBoxes($event)"></th>
|
<th><input id="allDivIdCheckbox" type="checkbox" (change)="toggleCheckBoxes($event)"></th>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Page</th>
|
<th>Page</th>
|
||||||
|
<th *ngIf="selectedCommunityPid">Portal Type</th>
|
||||||
<th>Actions</th>
|
<th>Actions</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
@ -67,7 +68,9 @@
|
||||||
<td>
|
<td>
|
||||||
<div class="name" href="#">{{check.divId.name}}</div>
|
<div class="name" href="#">{{check.divId.name}}</div>
|
||||||
</td>
|
</td>
|
||||||
|
<td *ngIf="!selectedCommunityPid">
|
||||||
|
<div class="portalType" href="#">{{check.divId.portalType}}</div>
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="pages" href="#">
|
<div class="pages" href="#">
|
||||||
<span *ngFor="let page of check.divId.pages let i=index">{{page.name}}<span
|
<span *ngFor="let page of check.divId.pages let i=index">{{page.name}}<span
|
||||||
|
@ -133,28 +136,47 @@
|
||||||
</mat-autocomplete>
|
</mat-autocomplete>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
<div class="form-group uk-margin-small-left">
|
<div [ngClass]="{'has-error':!myForm.controls.portalType.valid && myForm.controls.portalType.dirty}" class="form-group" uk-grid>
|
||||||
<div class="uk-text-muted"> Select if this class exists in:</div>
|
<label class="uk-width-1-1 uk-margin-small-bottom">
|
||||||
<span dashboard-input class="" [formInput]="myForm.get('openaire')"
|
Class exists in:
|
||||||
type="checkbox"
|
</label>
|
||||||
label="Explore Portal">
|
<label class="uk-width-1-1 radio uk-margin-large-left">
|
||||||
</span>
|
<span class="uk-margin-small-right" style="font-weight: normal;">OpenAIRE portal</span>
|
||||||
<span dashboard-input class="uk-margin-small-left" [formInput]="myForm.get('connect')"
|
<input type="radio" value="explore" formControlName="portalType">
|
||||||
type="checkbox"
|
</label>
|
||||||
label="Connect Portal">
|
<label class="uk-width-1-1 radio uk-margin-large-left">
|
||||||
</span>
|
<span class="uk-margin-small-right" style="font-weight: normal;">OpenAIRE Connect portal</span>
|
||||||
<span dashboard-input class="uk-margin-small-left" [formInput]="myForm.get('communities')"
|
<input type="radio" value="connect" formControlName="portalType">
|
||||||
type="checkbox"
|
</label>
|
||||||
label="Communities Dashboards">
|
<label class="uk-width-1-1 radio uk-margin-large-left">
|
||||||
</span>
|
<span class="uk-margin-small-right" style="font-weight: normal;">Communities' Gateway</span>
|
||||||
<!-- <mat-checkbox [formControl]="myForm.get('openaire')" >Explore Portal</mat-checkbox>-->
|
<input type="radio" value="community" formControlName="portalType">
|
||||||
<!-- <input type="checkbox" id="openaire" formControlName="openaire"/> Explore Portal-->
|
</label>
|
||||||
<!-- <input type="checkbox" [formControl]="myForm.get('connect')" formControlName="connect"/> Connect Portal-->
|
|
||||||
<!-- <input type="checkbox" [formControl]="myForm.controls.communities"-->
|
|
||||||
<!-- formControlName="communities"/>Communities Dashboards-->
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- <div class="form-group uk-margin-small-left">-->
|
||||||
|
<!-- <div class="uk-text-muted"> Select if this class exists in:</div>-->
|
||||||
|
<!-- <span dashboard-input class="" [formInput]="myForm.get('openaire')"-->
|
||||||
|
<!-- type="checkbox"-->
|
||||||
|
<!-- label="Explore Portal">-->
|
||||||
|
<!-- </span>-->
|
||||||
|
<!-- <span dashboard-input class="uk-margin-small-left" [formInput]="myForm.get('connect')"-->
|
||||||
|
<!-- type="checkbox"-->
|
||||||
|
<!-- label="Connect Portal">-->
|
||||||
|
<!-- </span>-->
|
||||||
|
<!-- <span dashboard-input class="uk-margin-small-left" [formInput]="myForm.get('communities')"-->
|
||||||
|
<!-- type="checkbox"-->
|
||||||
|
<!-- label="Communities Dashboards">-->
|
||||||
|
<!-- </span>-->
|
||||||
|
<!--<!– <mat-checkbox [formControl]="myForm.get('openaire')" >Explore Portal</mat-checkbox>–>-->
|
||||||
|
<!--<!– <input type="checkbox" id="openaire" formControlName="openaire"/> Explore Portal–>-->
|
||||||
|
<!--<!– <input type="checkbox" [formControl]="myForm.get('connect')" formControlName="connect"/> Connect Portal–>-->
|
||||||
|
<!--<!– <input type="checkbox" [formControl]="myForm.controls.communities"–>-->
|
||||||
|
<!--<!– formControlName="communities"/>Communities Dashboards–>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
|
||||||
|
|
||||||
<input type="hidden" formControlName="_id">
|
<input type="hidden" formControlName="_id">
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|
|
@ -58,9 +58,7 @@ export class DivIdsComponent implements OnInit {
|
||||||
_id: '',
|
_id: '',
|
||||||
name: ['', Validators.required],
|
name: ['', Validators.required],
|
||||||
pages: this.pagesCtrl,
|
pages: this.pagesCtrl,
|
||||||
openaire: true,
|
portalType: ['', Validators.required]
|
||||||
connect: false,
|
|
||||||
communities: true
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.route.data
|
this.route.data
|
||||||
|
@ -199,10 +197,10 @@ export class DivIdsComponent implements OnInit {
|
||||||
_id: divId._id,
|
_id: divId._id,
|
||||||
name: [divId.name,Validators.required],
|
name: [divId.name,Validators.required],
|
||||||
pages: this.pagesCtrl,
|
pages: this.pagesCtrl,
|
||||||
openaire: divId.openaire,
|
portalType: [divId.portalType, Validators.required]
|
||||||
connect: divId.connect,
|
|
||||||
communities: divId.communities
|
|
||||||
});
|
});
|
||||||
|
this.myForm.controls['portalType'].disable();
|
||||||
|
|
||||||
for(let i = 0; i < divId.pages.length; i++) {
|
for(let i = 0; i < divId.pages.length; i++) {
|
||||||
this.pagesCtrl.push(this._fb.control(divId.pages[i]));
|
this.pagesCtrl.push(this._fb.control(divId.pages[i]));
|
||||||
}
|
}
|
||||||
|
@ -213,14 +211,15 @@ export class DivIdsComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
public newDivId() {
|
public newDivId() {
|
||||||
|
this.myForm.controls['portalType'].enable();
|
||||||
|
|
||||||
this.pagesCtrl = this._fb.array([]);
|
this.pagesCtrl = this._fb.array([]);
|
||||||
this.myForm = this._fb.group({
|
this.myForm = this._fb.group({
|
||||||
_id: '',
|
_id: '',
|
||||||
name: ['', Validators.required],
|
name: ['', Validators.required],
|
||||||
pages: this.pagesCtrl,
|
pages: this.pagesCtrl,
|
||||||
openaire: this._fb.control(true),
|
//openaire: this._fb.control(true),
|
||||||
connect: false,
|
portalType: ['', Validators.required]
|
||||||
communities: true
|
|
||||||
});
|
});
|
||||||
this.filteredPages = this.pageSearchCtrl.valueChanges.pipe(startWith(''),
|
this.filteredPages = this.pageSearchCtrl.valueChanges.pipe(startWith(''),
|
||||||
map(page => this._filter(page)));
|
map(page => this._filter(page)));
|
||||||
|
@ -257,6 +256,8 @@ export class DivIdsComponent implements OnInit {
|
||||||
} else {
|
} else {
|
||||||
console.log(this.myForm.value)
|
console.log(this.myForm.value)
|
||||||
if (this.myForm.value['_id'].length == 0) {
|
if (this.myForm.value['_id'].length == 0) {
|
||||||
|
this.myForm.controls['portalType'].enable();
|
||||||
|
|
||||||
this.modalErrorMessage = "";
|
this.modalErrorMessage = "";
|
||||||
|
|
||||||
this._helpContentService.saveDivId(<DivId>this.myForm.value, this.properties.adminToolsAPIURL).subscribe(
|
this._helpContentService.saveDivId(<DivId>this.myForm.value, this.properties.adminToolsAPIURL).subscribe(
|
||||||
|
@ -300,7 +301,7 @@ export class DivIdsComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
public filterDivIds(divId: DivId): boolean {
|
public filterDivIds(divId: DivId): boolean {
|
||||||
let textFlag = this.searchText.toString() == '' || (divId.name).match(this.searchText) != null;
|
let textFlag = this.searchText.toString() == '' || (divId.name + ' ' + divId.portalType).match(this.searchText) != null;
|
||||||
return textFlag;
|
return textFlag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -136,7 +136,7 @@ export class DivContentFormComponent implements OnInit{
|
||||||
divId: ['', Validators.required],
|
divId: ['', Validators.required],
|
||||||
content: ['', Validators.required],
|
content: ['', Validators.required],
|
||||||
isActive: true,
|
isActive: true,
|
||||||
community: '',
|
portal: '',
|
||||||
_id : '',
|
_id : '',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -146,7 +146,7 @@ export class DivContentFormComponent implements OnInit{
|
||||||
divId: '',
|
divId: '',
|
||||||
content: '',
|
content: '',
|
||||||
isActive: true,
|
isActive: true,
|
||||||
community: '',
|
portal: '',
|
||||||
_id : ''
|
_id : ''
|
||||||
});
|
});
|
||||||
this.myForm.markAsPristine();
|
this.myForm.markAsPristine();
|
||||||
|
|
|
@ -8,7 +8,7 @@ import {
|
||||||
DivHelpContentFilterOptions
|
DivHelpContentFilterOptions
|
||||||
} from "../../utils/entities/adminTool/div-help-content";
|
} from "../../utils/entities/adminTool/div-help-content";
|
||||||
import {Page} from "../../utils/entities/adminTool/page";
|
import {Page} from "../../utils/entities/adminTool/page";
|
||||||
import {Community} from "../../utils/entities/adminTool/community";
|
import {Portal} from "../../utils/entities/adminTool/portal";
|
||||||
import {DivId} from "../../utils/entities/adminTool/divId";
|
import {DivId} from "../../utils/entities/adminTool/divId";
|
||||||
import {EnvProperties} from '../../utils/properties/env-properties';
|
import {EnvProperties} from '../../utils/properties/env-properties';
|
||||||
|
|
||||||
|
@ -45,13 +45,13 @@ export class DivHelpContentsComponent implements OnInit {
|
||||||
|
|
||||||
public counter = {all: 0, active: 0, inactive: 0};
|
public counter = {all: 0, active: 0, inactive: 0};
|
||||||
|
|
||||||
public communities: Community[] = [];
|
public communities: Portal[] = [];
|
||||||
|
|
||||||
public selectedCommunityPid: string;
|
public selectedCommunityPid: string;
|
||||||
|
|
||||||
public selectedPageId: string;
|
public selectedPageId: string;
|
||||||
|
|
||||||
public community: Community;
|
public community: Portal;
|
||||||
|
|
||||||
public page: Page;
|
public page: Page;
|
||||||
public properties: EnvProperties = null;
|
public properties: EnvProperties = null;
|
||||||
|
@ -122,9 +122,7 @@ export class DivHelpContentsComponent implements OnInit {
|
||||||
|
|
||||||
this._helpService.getPage(pageId, this.properties.adminToolsAPIURL).subscribe(
|
this._helpService.getPage(pageId, this.properties.adminToolsAPIURL).subscribe(
|
||||||
page => {
|
page => {
|
||||||
if ((this.selectedCommunityPid == 'openaire' && !page.openaire)
|
if (this.properties.adminToolsPortalType != page.portalType) {
|
||||||
|| (this.selectedCommunityPid == 'connect' && !page.connect)
|
|
||||||
|| (this.selectedCommunityPid != 'openaire' && this.selectedCommunityPid != 'connect' && !page.communities)) {
|
|
||||||
this.router.navigate(['/classContents'], {queryParams: {"communityId": this.selectedCommunityPid}});
|
this.router.navigate(['/classContents'], {queryParams: {"communityId": this.selectedCommunityPid}});
|
||||||
} else {
|
} else {
|
||||||
this.page = page;
|
this.page = page;
|
||||||
|
|
|
@ -80,9 +80,7 @@ export class EditDivHelpContentComponent implements OnInit, OnDestroy{
|
||||||
private getPage(pageId: string) {
|
private getPage(pageId: string) {
|
||||||
this._helpContentService.getPage(pageId,this.properties.adminToolsAPIURL).subscribe(
|
this._helpContentService.getPage(pageId,this.properties.adminToolsAPIURL).subscribe(
|
||||||
page => {
|
page => {
|
||||||
if( (this.communityPid == 'openaire' && !page.openaire)
|
if(this.properties.adminToolsPortalType != page.portalType) {
|
||||||
|| (this.communityPid == 'connect' && !page.connect)
|
|
||||||
|| (this.communityPid != 'openaire' && this.communityPid != 'connect' && !page.communities)) {
|
|
||||||
this.router.navigate(['/classContents'], { queryParams: { "communityId": this.communityPid} });
|
this.router.navigate(['/classContents'], { queryParams: { "communityId": this.communityPid} });
|
||||||
} else {
|
} else {
|
||||||
this.page = page;
|
this.page = page;
|
||||||
|
|
|
@ -62,9 +62,7 @@ export class NewDivHelpContentComponent {
|
||||||
private getPage(pageId: string) {
|
private getPage(pageId: string) {
|
||||||
this._helpContentService.getPage(pageId,this.properties.adminToolsAPIURL).subscribe(
|
this._helpContentService.getPage(pageId,this.properties.adminToolsAPIURL).subscribe(
|
||||||
page => {
|
page => {
|
||||||
if( (this.communityPid == 'openaire' && !page.openaire)
|
if(this.properties.adminToolsPortalType != page.portalType) {
|
||||||
|| (this.communityPid == 'connect' && !page.connect)
|
|
||||||
|| (this.communityPid != 'openaire' && this.communityPid != 'connect' && !page.communities)) {
|
|
||||||
this.router.navigate(['/classContents'], { queryParams: { "communityId": this.communityPid} });
|
this.router.navigate(['/classContents'], { queryParams: { "communityId": this.communityPid} });
|
||||||
} else {
|
} else {
|
||||||
this.page = page;
|
this.page = page;
|
||||||
|
|
|
@ -3,7 +3,7 @@ import {ActivatedRoute, Router} from '@angular/router';
|
||||||
import {HelpContentService} from '../../services/help-content.service';
|
import {HelpContentService} from '../../services/help-content.service';
|
||||||
import {FormBuilder, FormControl, FormGroup, Validators} from '@angular/forms';
|
import {FormBuilder, FormControl, FormGroup, Validators} from '@angular/forms';
|
||||||
import {CheckEntity, Entity} from '../../utils/entities/adminTool/entity';
|
import {CheckEntity, Entity} from '../../utils/entities/adminTool/entity';
|
||||||
import {Community} from '../../utils/entities/adminTool/community';
|
import {Portal} from '../../utils/entities/adminTool/portal';
|
||||||
import {EnvProperties} from '../../utils/properties/env-properties';
|
import {EnvProperties} from '../../utils/properties/env-properties';
|
||||||
import {Session} from '../../login/utils/helper.class';
|
import {Session} from '../../login/utils/helper.class';
|
||||||
import {LoginErrorCodes} from '../../login/utils/guardHelper.class';
|
import {LoginErrorCodes} from '../../login/utils/guardHelper.class';
|
||||||
|
@ -31,7 +31,7 @@ export class EntitiesComponent implements OnInit {
|
||||||
private searchText: RegExp = new RegExp('');
|
private searchText: RegExp = new RegExp('');
|
||||||
public keyword = '';
|
public keyword = '';
|
||||||
|
|
||||||
public communities: Community[] = [];
|
public communities: Portal[] = [];
|
||||||
public selectedCommunityPid: string;
|
public selectedCommunityPid: string;
|
||||||
|
|
||||||
@ViewChild('AlertModalRelatedPages') alertModalRelatedPages;
|
@ViewChild('AlertModalRelatedPages') alertModalRelatedPages;
|
||||||
|
|
|
@ -82,9 +82,7 @@ export class EditPageHelpContentComponent implements OnInit, OnDestroy{
|
||||||
private getPage(pageId: string) {
|
private getPage(pageId: string) {
|
||||||
this._helpContentService.getPage(pageId,this.properties.adminToolsAPIURL).subscribe(
|
this._helpContentService.getPage(pageId,this.properties.adminToolsAPIURL).subscribe(
|
||||||
page => {
|
page => {
|
||||||
if( (this.communityPid == 'openaire' && !page.openaire)
|
if(this.properties.adminToolsPortalType != page.portalType) {
|
||||||
|| (this.communityPid == 'connect' && !page.connect)
|
|
||||||
|| (this.communityPid != 'openaire' && this.communityPid != 'connect' && !page.communities)) {
|
|
||||||
this.router.navigate(['/pageContents'], { queryParams: { "communityId": this.communityPid} });
|
this.router.navigate(['/pageContents'], { queryParams: { "communityId": this.communityPid} });
|
||||||
} else {
|
} else {
|
||||||
this.page = page;
|
this.page = page;
|
||||||
|
|
|
@ -62,9 +62,7 @@ export class NewPageHelpContentComponent {
|
||||||
private getPage(pageId: string) {
|
private getPage(pageId: string) {
|
||||||
this._helpContentService.getPage(pageId,this.properties.adminToolsAPIURL).subscribe(
|
this._helpContentService.getPage(pageId,this.properties.adminToolsAPIURL).subscribe(
|
||||||
page => {
|
page => {
|
||||||
if( (this.communityPid == 'openaire' && !page.openaire)
|
if(this.properties.adminToolsPortalType != page.portalType) {
|
||||||
|| (this.communityPid == 'connect' && !page.connect)
|
|
||||||
|| (this.communityPid != 'openaire' && this.communityPid != 'connect' && !page.communities)) {
|
|
||||||
this.router.navigate(['/pageContents'], { queryParams: { "communityId": this.communityPid} });
|
this.router.navigate(['/pageContents'], { queryParams: { "communityId": this.communityPid} });
|
||||||
} else {
|
} else {
|
||||||
this.page = page;
|
this.page = page;
|
||||||
|
|
|
@ -74,7 +74,7 @@ export class PageContentFormComponent implements OnInit{
|
||||||
public get form() {
|
public get form() {
|
||||||
return this._fb.group({
|
return this._fb.group({
|
||||||
page : [this.pageId, Validators.required],
|
page : [this.pageId, Validators.required],
|
||||||
community : this.communityPid,
|
portal : this.communityPid,
|
||||||
placement : ['', Validators.required],
|
placement : ['', Validators.required],
|
||||||
content : ['', Validators.required],
|
content : ['', Validators.required],
|
||||||
order : [1, Validators.required],
|
order : [1, Validators.required],
|
||||||
|
@ -87,7 +87,7 @@ export class PageContentFormComponent implements OnInit{
|
||||||
public reset() {
|
public reset() {
|
||||||
this.myForm.patchValue({
|
this.myForm.patchValue({
|
||||||
page : '',
|
page : '',
|
||||||
community : this.communityPid,
|
portal : this.communityPid,
|
||||||
placement : '',
|
placement : '',
|
||||||
content : [''],
|
content : [''],
|
||||||
order : 1,
|
order : 1,
|
||||||
|
|
|
@ -100,7 +100,7 @@
|
||||||
<div class="page" href="#">{{check.pageHelpContent.page.name}}</div>
|
<div class="page" href="#">{{check.pageHelpContent.page.name}}</div>
|
||||||
</td>
|
</td>
|
||||||
<td *ngIf="!selectedPageId">
|
<td *ngIf="!selectedPageId">
|
||||||
<div class="community" href="#">{{check.pageHelpContent.community.name}}</div>
|
<div class="community" href="#">{{check.pageHelpContent.portal.name}}</div>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<!-- <div class="content" [innerHtml]="check.pageHelpContent.content | safeHtml"></div>-->
|
<!-- <div class="content" [innerHtml]="check.pageHelpContent.content | safeHtml"></div>-->
|
||||||
|
|
|
@ -8,7 +8,7 @@ import {
|
||||||
PageHelpContentFilterOptions
|
PageHelpContentFilterOptions
|
||||||
} from "../../utils/entities/adminTool/page-help-content";
|
} from "../../utils/entities/adminTool/page-help-content";
|
||||||
import {Page} from "../../utils/entities/adminTool/page";
|
import {Page} from "../../utils/entities/adminTool/page";
|
||||||
import {Community} from "../../utils/entities/adminTool/community";
|
import {Portal} from "../../utils/entities/adminTool/portal";
|
||||||
import {EnvProperties} from '../../utils/properties/env-properties';
|
import {EnvProperties} from '../../utils/properties/env-properties';
|
||||||
import {Session} from '../../login/utils/helper.class';
|
import {Session} from '../../login/utils/helper.class';
|
||||||
import {LoginErrorCodes} from '../../login/utils/guardHelper.class';
|
import {LoginErrorCodes} from '../../login/utils/guardHelper.class';
|
||||||
|
@ -41,13 +41,13 @@ export class PageHelpContentsComponent implements OnInit {
|
||||||
|
|
||||||
public counter = {all: 0, active: 0, inactive: 0};
|
public counter = {all: 0, active: 0, inactive: 0};
|
||||||
|
|
||||||
public communities: Community[] = [];
|
public communities: Portal[] = [];
|
||||||
|
|
||||||
public selectedCommunityPid: string;
|
public selectedCommunityPid: string;
|
||||||
|
|
||||||
public selectedPageId: string;
|
public selectedPageId: string;
|
||||||
|
|
||||||
public community: Community;
|
public community: Portal;
|
||||||
|
|
||||||
public page: Page;
|
public page: Page;
|
||||||
public properties: EnvProperties = null;
|
public properties: EnvProperties = null;
|
||||||
|
@ -115,9 +115,7 @@ export class PageHelpContentsComponent implements OnInit {
|
||||||
|
|
||||||
this._helpService.getPage(pageId, this.properties.adminToolsAPIURL).subscribe(
|
this._helpService.getPage(pageId, this.properties.adminToolsAPIURL).subscribe(
|
||||||
page => {
|
page => {
|
||||||
if ((this.selectedCommunityPid == 'openaire' && !page.openaire)
|
if (this.properties.adminToolsPortalType != page.portalType) {
|
||||||
|| (this.selectedCommunityPid == 'connect' && !page.connect)
|
|
||||||
|| (this.selectedCommunityPid != 'openaire' && this.selectedCommunityPid != 'connect' && !page.communities)) {
|
|
||||||
this.router.navigate(['/pageContents'], {queryParams: {"communityId": this.selectedCommunityPid}});
|
this.router.navigate(['/pageContents'], {queryParams: {"communityId": this.selectedCommunityPid}});
|
||||||
} else {
|
} else {
|
||||||
this.page = page;
|
this.page = page;
|
||||||
|
|
|
@ -69,6 +69,7 @@
|
||||||
<th *ngIf="!pagesType">Type</th>
|
<th *ngIf="!pagesType">Type</th>
|
||||||
<th *ngIf="!isPortalAdministrator">Related Entities</th>
|
<th *ngIf="!isPortalAdministrator">Related Entities</th>
|
||||||
<th>Route</th>
|
<th>Route</th>
|
||||||
|
<th *ngIf="!selectedCommunityPid">Portal Type</th>
|
||||||
<th *ngIf="isPortalAdministrator">Actions</th>
|
<th *ngIf="isPortalAdministrator">Actions</th>
|
||||||
<th *ngIf="!isPortalAdministrator" class="uk-text-center">Page help texts</th>
|
<th *ngIf="!isPortalAdministrator" class="uk-text-center">Page help texts</th>
|
||||||
<th *ngIf="!isPortalAdministrator && (pageWithDivIds && pageWithDivIds.length > 0)"
|
<th *ngIf="!isPortalAdministrator && (pageWithDivIds && pageWithDivIds.length > 0)"
|
||||||
|
@ -100,6 +101,9 @@
|
||||||
<td>
|
<td>
|
||||||
<div class="route" href="#">{{check.page.route}}</div>
|
<div class="route" href="#">{{check.page.route}}</div>
|
||||||
</td>
|
</td>
|
||||||
|
<td *ngIf="!selectedCommunityPid">
|
||||||
|
<div class="portalType" href="#">{{check.page.portalType}}</div>
|
||||||
|
</td>
|
||||||
|
|
||||||
<td *ngIf="isPortalAdministrator">
|
<td *ngIf="isPortalAdministrator">
|
||||||
<div class="actions" href="#">
|
<div class="actions" href="#">
|
||||||
|
@ -257,21 +261,42 @@
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<!-- <div class="form-group">-->
|
||||||
|
|
||||||
<div class="uk-text-muted"> Select if this page exists in:</div>
|
<!-- <div class="uk-text-muted"> Select if this page exists in:</div>-->
|
||||||
<span dashboard-input class="" [formInput]="myForm.get('openaire')"
|
<!-- <span dashboard-input class="" [formInput]="myForm.get('openaire')"-->
|
||||||
type="checkbox"
|
<!-- type="checkbox"-->
|
||||||
label="Explore Portal">
|
<!-- label="Explore Portal">-->
|
||||||
</span>
|
<!-- </span>-->
|
||||||
<span dashboard-input class="uk-margin-small-left" [formInput]="myForm.get('connect')"
|
<!-- <span dashboard-input class="uk-margin-small-left" [formInput]="myForm.get('connect')"-->
|
||||||
type="checkbox"
|
<!-- type="checkbox"-->
|
||||||
label="Connect Portal">
|
<!-- label="Connect Portal">-->
|
||||||
</span>
|
<!-- </span>-->
|
||||||
<span dashboard-input class="uk-margin-small-left" [formInput]="myForm.get('communities')"
|
<!-- <span dashboard-input class="uk-margin-small-left" [formInput]="myForm.get('communities')"-->
|
||||||
type="checkbox"
|
<!-- type="checkbox"-->
|
||||||
label="Communities Dashboards">
|
<!-- label="Communities Dashboards">-->
|
||||||
</span>
|
<!-- </span>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
|
||||||
|
<div [ngClass]="{'has-error':!myForm.controls.portalType.valid && myForm.controls.portalType.dirty}" class="form-group" uk-grid>
|
||||||
|
<label class="uk-width-1-1 uk-margin-small-bottom">
|
||||||
|
Page exists in:
|
||||||
|
</label>
|
||||||
|
<label class="uk-width-1-1 radio uk-margin-large-left">
|
||||||
|
<span class="uk-margin-small-right" style="font-weight: normal;">OpenAIRE portal</span>
|
||||||
|
<!-- <input tabindex="0" type="checkbox" formControlName="openaire">-->
|
||||||
|
<input type="radio" value="explore" formControlName="portalType">
|
||||||
|
</label>
|
||||||
|
<label class="uk-width-1-1 radio uk-margin-large-left">
|
||||||
|
<span class="uk-margin-small-right" style="font-weight: normal;">OpenAIRE Connect portal</span>
|
||||||
|
<!-- <input tabindex="0" type="checkbox" formControlName="connect">-->
|
||||||
|
<input type="radio" value="connect" formControlName="portalType">
|
||||||
|
</label>
|
||||||
|
<label class="uk-width-1-1 radio uk-margin-large-left">
|
||||||
|
<span class="uk-margin-small-right" style="font-weight: normal;">Communities' Gateway</span>
|
||||||
|
<!-- <input tabindex="0" type="checkbox" formControlName="communities">-->
|
||||||
|
<input type="radio" value="community" formControlName="portalType">
|
||||||
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<input type="hidden" formControlName="_id">
|
<input type="hidden" formControlName="_id">
|
||||||
|
|
|
@ -3,7 +3,7 @@ import {ActivatedRoute, Router} from '@angular/router';
|
||||||
import {HelpContentService} from '../../services/help-content.service';
|
import {HelpContentService} from '../../services/help-content.service';
|
||||||
import {FormArray, FormBuilder, FormControl, FormGroup, Validators} from '@angular/forms';
|
import {FormArray, FormBuilder, FormControl, FormGroup, Validators} from '@angular/forms';
|
||||||
import {CheckPage, Page} from '../../utils/entities/adminTool/page';
|
import {CheckPage, Page} from '../../utils/entities/adminTool/page';
|
||||||
import {Community} from '../../utils/entities/adminTool/community';
|
import {Portal} from '../../utils/entities/adminTool/portal';
|
||||||
import {Entity} from '../../utils/entities/adminTool/entity';
|
import {Entity} from '../../utils/entities/adminTool/entity';
|
||||||
import {EnvProperties} from '../../utils/properties/env-properties';
|
import {EnvProperties} from '../../utils/properties/env-properties';
|
||||||
import {Session} from '../../login/utils/helper.class';
|
import {Session} from '../../login/utils/helper.class';
|
||||||
|
@ -37,7 +37,7 @@ export class PagesComponent implements OnInit {
|
||||||
private searchText: RegExp = new RegExp('');
|
private searchText: RegExp = new RegExp('');
|
||||||
public keyword: string = '';
|
public keyword: string = '';
|
||||||
|
|
||||||
public communities: Community[] = [];
|
public communities: Portal[] = [];
|
||||||
|
|
||||||
public selectedCommunityPid: string;
|
public selectedCommunityPid: string;
|
||||||
|
|
||||||
|
@ -81,9 +81,7 @@ export class PagesComponent implements OnInit {
|
||||||
route: ['', Validators.required],
|
route: ['', Validators.required],
|
||||||
name: ['', Validators.required],
|
name: ['', Validators.required],
|
||||||
isEnabled: true,
|
isEnabled: true,
|
||||||
openaire: true,
|
portalType: ['', Validators.required],
|
||||||
connect: false,
|
|
||||||
communities: true,
|
|
||||||
top: true,
|
top: true,
|
||||||
bottom: true,
|
bottom: true,
|
||||||
left: true,
|
left: true,
|
||||||
|
@ -299,9 +297,7 @@ export class PagesComponent implements OnInit {
|
||||||
route: [page.route, Validators.required],
|
route: [page.route, Validators.required],
|
||||||
name: [page.name, Validators.required],
|
name: [page.name, Validators.required],
|
||||||
isEnabled: page.isEnabled,
|
isEnabled: page.isEnabled,
|
||||||
openaire: page.openaire,
|
portalType: ['', Validators.required],
|
||||||
connect: page.connect,
|
|
||||||
communities: page.communities,
|
|
||||||
top: page.top,
|
top: page.top,
|
||||||
bottom: page.bottom,
|
bottom: page.bottom,
|
||||||
left: page.left,
|
left: page.left,
|
||||||
|
@ -310,6 +306,7 @@ export class PagesComponent implements OnInit {
|
||||||
entities: this.entitiesCtrl,
|
entities: this.entitiesCtrl,
|
||||||
_id: page._id,
|
_id: page._id,
|
||||||
});
|
});
|
||||||
|
this.myForm.controls['portalType'].disable();
|
||||||
|
|
||||||
for (let i = 0; i < page.entities.length; i++) {
|
for (let i = 0; i < page.entities.length; i++) {
|
||||||
this.entitiesCtrl.push(this._fb.control(page.entities[i]));
|
this.entitiesCtrl.push(this._fb.control(page.entities[i]));
|
||||||
|
@ -330,14 +327,14 @@ export class PagesComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
public newPage() {
|
public newPage() {
|
||||||
|
this.myForm.controls['portalType'].enable();
|
||||||
|
|
||||||
this.entitiesCtrl = this._fb.array([]);
|
this.entitiesCtrl = this._fb.array([]);
|
||||||
this.myForm = this._fb.group({
|
this.myForm = this._fb.group({
|
||||||
route: ['', Validators.required],
|
route: ['', Validators.required],
|
||||||
name: ['', Validators.required],
|
name: ['', Validators.required],
|
||||||
isEnabled: true,
|
isEnabled: true,
|
||||||
openaire: true,
|
portalType: ['', Validators.required],
|
||||||
connect: false,
|
|
||||||
communities: true,
|
|
||||||
top: true,
|
top: true,
|
||||||
bottom: true,
|
bottom: true,
|
||||||
left: true,
|
left: true,
|
||||||
|
@ -381,6 +378,8 @@ export class PagesComponent implements OnInit {
|
||||||
} else {
|
} else {
|
||||||
console.log(this.myForm.value)
|
console.log(this.myForm.value)
|
||||||
if (this.myForm.value['_id'].length == 0) {
|
if (this.myForm.value['_id'].length == 0) {
|
||||||
|
this.myForm.controls['portalType'].enable();
|
||||||
|
|
||||||
this.modalErrorMessage = '';
|
this.modalErrorMessage = '';
|
||||||
this._helpContentService.savePage(<Page>this.myForm.value, this.properties.adminToolsAPIURL).subscribe(
|
this._helpContentService.savePage(<Page>this.myForm.value, this.properties.adminToolsAPIURL).subscribe(
|
||||||
page => {
|
page => {
|
||||||
|
@ -441,7 +440,7 @@ export class PagesComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
public filterPages(page: Page): boolean {
|
public filterPages(page: Page): boolean {
|
||||||
let textFlag = this.searchText.toString() == '' || (page.route + ' ' + page.name).match(this.searchText) != null;
|
let textFlag = this.searchText.toString() == '' || (page.route + ' ' + page.name + ' ' + page.portalType).match(this.searchText) != null;
|
||||||
return textFlag;
|
return textFlag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -463,9 +462,7 @@ export class PagesComponent implements OnInit {
|
||||||
route: ['', Validators.required],
|
route: ['', Validators.required],
|
||||||
name: ['', Validators.required],
|
name: ['', Validators.required],
|
||||||
isEnabled: true,
|
isEnabled: true,
|
||||||
openaire: true,
|
portalType: ['', Validators.required],
|
||||||
connect: false,
|
|
||||||
communities: true,
|
|
||||||
top: true,
|
top: true,
|
||||||
bottom: true,
|
bottom: true,
|
||||||
left: true,
|
left: true,
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
<div uk-dropdown="mode: click">
|
<div uk-dropdown="mode: click">
|
||||||
<ul class="uk-nav uk-navbar-dropdown-nav"
|
<ul class="uk-nav uk-navbar-dropdown-nav"
|
||||||
[attr.uk-tooltip]="getSelectedCommunities().length == 0 ? 'pos:left; cls: uk-active' : 'cls: uk-invisible'"
|
[attr.uk-tooltip]="getSelectedCommunities().length == 0 ? 'pos:left; cls: uk-active' : 'cls: uk-invisible'"
|
||||||
title="Select at least one community">
|
title="Select at least one portal">
|
||||||
<li><a [class]="getSelectedCommunities().length == 0 ? 'uk-disabled' : ''"
|
<li><a [class]="getSelectedCommunities().length == 0 ? 'uk-disabled' : ''"
|
||||||
(click)="confirmDeleteSelectedCommunities()"><i></i> Delete </a></li>
|
(click)="confirmDeleteSelectedCommunities()"><i></i> Delete </a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -55,6 +55,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<th><input id="allCommunityCheckbox" type="checkbox" (change)="toggleCheckBoxes($event)"></th>
|
<th><input id="allCommunityCheckbox" type="checkbox" (change)="toggleCheckBoxes($event)"></th>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
|
<th>Type</th>
|
||||||
<th>Actions</th>
|
<th>Actions</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
@ -66,6 +67,9 @@
|
||||||
<td>
|
<td>
|
||||||
<div class="name" href="#">{{check.community.name}}</div>
|
<div class="name" href="#">{{check.community.name}}</div>
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
<div class="type" href="#">{{check.community.type}}</div>
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="actions" href="#">
|
<div class="actions" href="#">
|
||||||
<i class="md-icon material-icons" (click)="editCommunity(i)"></i>
|
<i class="md-icon material-icons" (click)="editCommunity(i)"></i>
|
||||||
|
@ -86,7 +90,7 @@
|
||||||
|
|
||||||
|
|
||||||
<div *ngIf="checkboxes.length==0" class="col-md-12">
|
<div *ngIf="checkboxes.length==0" class="col-md-12">
|
||||||
<div class="uk-alert-warning" uk-alert>No communities found</div>
|
<div class="uk-alert-warning" uk-alert>No portals found</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -105,11 +109,20 @@
|
||||||
<form [formGroup]="portalFG">
|
<form [formGroup]="portalFG">
|
||||||
<div dashboard-input class="uk-margin-small-left" [formInput]="portalFG.controls.name"
|
<div dashboard-input class="uk-margin-small-left" [formInput]="portalFG.controls.name"
|
||||||
type="text"
|
type="text"
|
||||||
label="Community Name">
|
label="Portal Name">
|
||||||
|
</div>
|
||||||
|
<div [ngClass]="{'has-error':!portalFG.controls.type.valid && portalFG.controls.type.dirty}">
|
||||||
|
<label for="portalTypeTag">*Portal Type</label>
|
||||||
|
<select formControlName="type" id="portalTypeTag" class="form-control uk-select">
|
||||||
|
<option [value]="'explore'">OpenAIRE Explore Portal</option>
|
||||||
|
<option [value]="'connect'">OpenAIRE Connect Portal</option>
|
||||||
|
<option [value]="'monitor'">OpenAIRE Monitor Portal</option>
|
||||||
|
<option [value]="'community'">OpenAIRE Community Gateway</option>
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div dashboard-input class="uk-margin-small-left " [formInput]="portalFG.controls.pid"
|
<div dashboard-input class="uk-margin-small-left " [formInput]="portalFG.controls.pid"
|
||||||
type="text"
|
type="text"
|
||||||
label="Community persistent id for portal">
|
label="Portal persistent id for portal">
|
||||||
</div>
|
</div>
|
||||||
<input type="hidden" formControlName="_id">
|
<input type="hidden" formControlName="_id">
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -2,7 +2,7 @@ import {Component, ViewChild, OnInit, ElementRef} from '@angular/core';
|
||||||
import {ActivatedRoute, Router} from '@angular/router';
|
import {ActivatedRoute, Router} from '@angular/router';
|
||||||
import {HelpContentService} from '../../services/help-content.service';
|
import {HelpContentService} from '../../services/help-content.service';
|
||||||
import {FormBuilder, FormControl, FormGroup} from '@angular/forms';
|
import {FormBuilder, FormControl, FormGroup} from '@angular/forms';
|
||||||
import {CheckCommunity, Community} from '../../utils/entities/adminTool/community';
|
import {CheckPortal, Portal} from '../../utils/entities/adminTool/portal';
|
||||||
import {EnvProperties} from '../../utils/properties/env-properties';
|
import {EnvProperties} from '../../utils/properties/env-properties';
|
||||||
|
|
||||||
import {Session} from '../../login/utils/helper.class';
|
import {Session} from '../../login/utils/helper.class';
|
||||||
|
@ -21,8 +21,8 @@ export class CommunitiesComponent implements OnInit {
|
||||||
@ViewChild('AlertModalDeleteCommunities') alertModalDeleteCommunities;
|
@ViewChild('AlertModalDeleteCommunities') alertModalDeleteCommunities;
|
||||||
private selectedCommunities: string[] = [];
|
private selectedCommunities: string[] = [];
|
||||||
|
|
||||||
public checkboxes: CheckCommunity[] = [];
|
public checkboxes: CheckPortal[] = [];
|
||||||
public communities: Community[] = [];
|
public communities: Portal[] = [];
|
||||||
|
|
||||||
public portalFG: FormGroup;
|
public portalFG: FormGroup;
|
||||||
public formControl: FormControl;
|
public formControl: FormControl;
|
||||||
|
@ -42,7 +42,8 @@ export class CommunitiesComponent implements OnInit {
|
||||||
this.portalFG = this._fb.group({
|
this.portalFG = this._fb.group({
|
||||||
name: '',
|
name: '',
|
||||||
_id: '',
|
_id: '',
|
||||||
pid: ''
|
pid: '',
|
||||||
|
type: ''
|
||||||
});
|
});
|
||||||
this.formControl = this._fb.control('');
|
this.formControl = this._fb.control('');
|
||||||
this.subscriptions.push(this.formControl.valueChanges.subscribe(value => {
|
this.subscriptions.push(this.formControl.valueChanges.subscribe(value => {
|
||||||
|
@ -88,7 +89,7 @@ export class CommunitiesComponent implements OnInit {
|
||||||
communities => {
|
communities => {
|
||||||
this.communities = communities;
|
this.communities = communities;
|
||||||
communities.forEach(_ => {
|
communities.forEach(_ => {
|
||||||
this.checkboxes.push(<CheckCommunity>{community: _, checked: false});
|
this.checkboxes.push(<CheckPortal>{community: _, checked: false});
|
||||||
});
|
});
|
||||||
this.showLoading = false;
|
this.showLoading = false;
|
||||||
},
|
},
|
||||||
|
@ -162,20 +163,24 @@ export class CommunitiesComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
public editCommunity(i: number) {
|
public editCommunity(i: number) {
|
||||||
const community: Community = this.checkboxes[i].community;
|
const community: Portal = this.checkboxes[i].community;
|
||||||
this.portalFG = this._fb.group({
|
this.portalFG = this._fb.group({
|
||||||
name: community.name,
|
name: community.name,
|
||||||
_id: community._id,
|
_id: community._id,
|
||||||
|
type: community.type,
|
||||||
pid: community.pid
|
pid: community.pid
|
||||||
});
|
});
|
||||||
|
this.portalFG.controls['type'].disable();
|
||||||
this.modalErrorMessage = '';
|
this.modalErrorMessage = '';
|
||||||
this.communitiesModalOpen(this.alertModalSaveCommunity, 'Update', 'Update Community');
|
this.communitiesModalOpen(this.alertModalSaveCommunity, 'Update', 'Update Community');
|
||||||
}
|
}
|
||||||
|
|
||||||
public newCommunity() {
|
public newCommunity() {
|
||||||
|
this.portalFG.controls['type'].enable();
|
||||||
this.portalFG = this._fb.group({
|
this.portalFG = this._fb.group({
|
||||||
name: '',
|
name: '',
|
||||||
_id: '',
|
_id: '',
|
||||||
|
type: '',
|
||||||
pid: ''
|
pid: ''
|
||||||
});
|
});
|
||||||
this.modalErrorMessage = '';
|
this.modalErrorMessage = '';
|
||||||
|
@ -205,7 +210,8 @@ export class CommunitiesComponent implements OnInit {
|
||||||
|
|
||||||
this.modalErrorMessage = '';
|
this.modalErrorMessage = '';
|
||||||
if (this.portalFG.getRawValue()['_id'].length > 0) {
|
if (this.portalFG.getRawValue()['_id'].length > 0) {
|
||||||
this._helpContentService.updateCommunity(<Community>this.portalFG.value,
|
this.portalFG.controls['type'].enable();
|
||||||
|
this._helpContentService.updateCommunity(<Portal>this.portalFG.value,
|
||||||
this.properties.adminToolsAPIURL).subscribe(
|
this.properties.adminToolsAPIURL).subscribe(
|
||||||
community => {
|
community => {
|
||||||
this.communityUpdatedSuccessfully(community);
|
this.communityUpdatedSuccessfully(community);
|
||||||
|
@ -213,7 +219,7 @@ export class CommunitiesComponent implements OnInit {
|
||||||
error => this.handleUpdateError('System error updating portal', error)
|
error => this.handleUpdateError('System error updating portal', error)
|
||||||
);
|
);
|
||||||
}else{
|
}else{
|
||||||
this._helpContentService.saveCommunity(<Community>this.portalFG.value,
|
this._helpContentService.saveCommunity(<Portal>this.portalFG.value,
|
||||||
this.properties.adminToolsAPIURL).subscribe(
|
this.properties.adminToolsAPIURL).subscribe(
|
||||||
community => {
|
community => {
|
||||||
this.communitySavedSuccessfully(community);
|
this.communitySavedSuccessfully(community);
|
||||||
|
@ -231,7 +237,8 @@ export class CommunitiesComponent implements OnInit {
|
||||||
queryParams: {'errorCode': LoginErrorCodes.NOT_VALID, 'redirectUrl': this._router.url}
|
queryParams: {'errorCode': LoginErrorCodes.NOT_VALID, 'redirectUrl': this._router.url}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this._helpContentService.updateCommunity(<Community>this.portalFG.value,
|
this.portalFG.controls['type'].enable();
|
||||||
|
this._helpContentService.updateCommunity(<Portal>this.portalFG.value,
|
||||||
this.properties.adminToolsAPIURL).subscribe(
|
this.properties.adminToolsAPIURL).subscribe(
|
||||||
community => {
|
community => {
|
||||||
this.communityUpdatedSuccessfully(community);
|
this.communityUpdatedSuccessfully(community);
|
||||||
|
@ -241,12 +248,12 @@ export class CommunitiesComponent implements OnInit {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public communitySavedSuccessfully(community: Community) {
|
public communitySavedSuccessfully(community: Portal) {
|
||||||
this.checkboxes.push(<CheckCommunity>{community: community, checked: false});
|
this.checkboxes.push(<CheckPortal>{community: community, checked: false});
|
||||||
this.applyCheck(false);
|
this.applyCheck(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public communityUpdatedSuccessfully(community: Community) {
|
public communityUpdatedSuccessfully(community: Portal) {
|
||||||
this.checkboxes.find(checkItem => checkItem.community._id === community._id).community = community;
|
this.checkboxes.find(checkItem => checkItem.community._id === community._id).community = community;
|
||||||
this.applyCheck(false);
|
this.applyCheck(false);
|
||||||
}
|
}
|
||||||
|
@ -259,12 +266,12 @@ export class CommunitiesComponent implements OnInit {
|
||||||
public applyFilter() {
|
public applyFilter() {
|
||||||
this.checkboxes = [];
|
this.checkboxes = [];
|
||||||
this.communities.filter(item => this.filterCommunities(item)).forEach(
|
this.communities.filter(item => this.filterCommunities(item)).forEach(
|
||||||
_ => this.checkboxes.push(<CheckCommunity>{community: _, checked: false})
|
_ => this.checkboxes.push(<CheckPortal>{community: _, checked: false})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public filterCommunities(community: Community): boolean {
|
public filterCommunities(community: Portal): boolean {
|
||||||
const textFlag = this.searchText.toString() === '' || (community.name).match(this.searchText) != null;
|
const textFlag = this.searchText.toString() === '' || (community.name || community.type).match(this.searchText) != null;
|
||||||
return textFlag;
|
return textFlag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -273,7 +280,8 @@ export class CommunitiesComponent implements OnInit {
|
||||||
this.portalFG = this._fb.group({
|
this.portalFG = this._fb.group({
|
||||||
name: '',
|
name: '',
|
||||||
_id: '',
|
_id: '',
|
||||||
pid: ''
|
pid: '',
|
||||||
|
type: ''
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.updateErrorMessage = message;
|
this.updateErrorMessage = message;
|
||||||
|
|
|
@ -5,6 +5,7 @@ import {Title, Meta} from '@angular/platform-browser';
|
||||||
import {RESPONSE} from "@nguniversal/express-engine/tokens";
|
import {RESPONSE} from "@nguniversal/express-engine/tokens";
|
||||||
import {EnvProperties} from "../utils/properties/env-properties";
|
import {EnvProperties} from "../utils/properties/env-properties";
|
||||||
import {SEOService} from "../sharedComponents/SEO/SEO.service";
|
import {SEOService} from "../sharedComponents/SEO/SEO.service";
|
||||||
|
import {properties} from "../../../environments/environment";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'error',
|
selector: 'error',
|
||||||
|
@ -60,9 +61,9 @@ export class ErrorPageComponent {
|
||||||
this.response.statusCode = 404;
|
this.response.statusCode = 404;
|
||||||
this.response.statusMessage = '404 - Page not found';
|
this.response.statusMessage = '404 - Page not found';
|
||||||
}
|
}
|
||||||
this.route.data
|
//this.route.data
|
||||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
//.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||||
let properties = data.envSpecific;
|
//let properties = data.envSpecific;
|
||||||
this.seoService.createLinkForCanonicalURL(properties.domain + properties.baseLink + "/error");
|
this.seoService.createLinkForCanonicalURL(properties.domain + properties.baseLink + "/error");
|
||||||
|
|
||||||
this.route.queryParams.subscribe(data => {
|
this.route.queryParams.subscribe(data => {
|
||||||
|
@ -97,6 +98,6 @@ export class ErrorPageComponent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
//});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
import {Injectable} from "@angular/core";
|
||||||
|
import {HttpClient} from "@angular/common/http";
|
||||||
|
import {properties} from "../../../environments/environment";
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class ClearCacheService {
|
||||||
|
|
||||||
|
constructor(private http: HttpClient) {}
|
||||||
|
|
||||||
|
clearCache(message: string = null) {
|
||||||
|
this.http.get(properties.deleteCacheUrl).subscribe(
|
||||||
|
res => console.log((message ? message+": " : "") + "Cache cleared!"),
|
||||||
|
err => console.log((message ? message+": " : "") + "Cache could not be cleared ", err)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -6,393 +6,399 @@ import {HttpClient, HttpErrorResponse, HttpHeaders} from "@angular/common/http";
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { Page } from "../utils/entities/adminTool/page";
|
import { Page } from "../utils/entities/adminTool/page";
|
||||||
import { PageHelpContent } from "../utils/entities/adminTool/page-help-content";
|
import { PageHelpContent } from "../utils/entities/adminTool/page-help-content";
|
||||||
import { Community } from "../utils/entities/adminTool/community";
|
import { Portal } from "../utils/entities/adminTool/portal";
|
||||||
import { Entity } from "../utils/entities/adminTool/entity";
|
import { Entity } from "../utils/entities/adminTool/entity";
|
||||||
import { DivId } from "../utils/entities/adminTool/divId";
|
import { DivId } from "../utils/entities/adminTool/divId";
|
||||||
import { DivHelpContent } from "../utils/entities/adminTool/div-help-content";
|
import { DivHelpContent } from "../utils/entities/adminTool/div-help-content";
|
||||||
import {StatisticsDisplay, StatisticsSummary} from '../connect/statistics/statisticsEntities';
|
import {StatisticsDisplay, StatisticsSummary} from '../connect/statistics/statisticsEntities';
|
||||||
import { CustomOptions } from './servicesUtils/customOptions.class';
|
import { CustomOptions } from './servicesUtils/customOptions.class';
|
||||||
import {catchError, map} from "rxjs/operators";
|
import {catchError, map} from "rxjs/operators";
|
||||||
|
import {properties} from "../../../environments/environment";
|
||||||
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class HelpContentService {
|
export class HelpContentService {
|
||||||
|
|
||||||
constructor(private http:HttpClient) {
|
constructor(private http:HttpClient) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static removeNulls(obj){
|
static removeNulls(obj){
|
||||||
var isArray = obj instanceof Array;
|
var isArray = obj instanceof Array;
|
||||||
for (var k in obj){
|
for (var k in obj){
|
||||||
if (obj[k]===null || obj[k]==='') isArray ? obj.splice(k,1) : delete obj[k];
|
if (obj[k]===null || obj[k]==='') isArray ? obj.splice(k,1) : delete obj[k];
|
||||||
else if (typeof obj[k]=="object") HelpContentService.removeNulls(obj[k]);
|
else if (typeof obj[k]=="object") HelpContentService.removeNulls(obj[k]);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
getDivIdsFull(page_id: string, helpContentUrl:string, pid: string = null) {
|
getDivIdsFull(page_id: string, helpContentUrl:string, pid: string = null) {
|
||||||
let parameters: string = "";
|
let parameters: string = "";
|
||||||
if(page_id || pid) {
|
if(page_id || pid) {
|
||||||
parameters = "?";
|
parameters = "?";
|
||||||
if(page_id) {
|
if(page_id) {
|
||||||
parameters += "&page="+page_id;
|
parameters += "&page="+page_id;
|
||||||
}
|
}
|
||||||
if(pid) {
|
if(pid) {
|
||||||
parameters += "&communityId="+pid;
|
parameters += "&portal="+pid;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.http.get<Array<DivId>>(helpContentUrl + '/divFull'+parameters)
|
|
||||||
//.map(res => <Array<DivId>> res.json())
|
|
||||||
.pipe(catchError(this.handleError));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
updateDivId(divId: DivId, helpContentUrl:string) {
|
return this.http.get<Array<DivId>>(helpContentUrl + 'divFull'+parameters)
|
||||||
HelpContentService.removeNulls(divId);
|
//.map(res => <Array<DivId>> res.json())
|
||||||
|
.pipe(catchError(this.handleError));
|
||||||
|
}
|
||||||
|
|
||||||
return this.http.post<DivId>(helpContentUrl + '/div/update', JSON.stringify(divId), CustomOptions.getAuthOptionsWithBody())
|
updateDivId(divId: DivId, helpContentUrl:string) {
|
||||||
//.map(res => <DivId> res.json())
|
HelpContentService.removeNulls(divId);
|
||||||
.pipe(catchError(this.handleError));
|
|
||||||
}
|
return this.http.post<DivId>(helpContentUrl + 'div/update', JSON.stringify(divId), CustomOptions.getAuthOptionsWithBody())
|
||||||
|
//.map(res => <DivId> res.json())
|
||||||
getDivId(divId: string, helpContentUrl:string) {
|
.pipe(catchError(this.handleError));
|
||||||
return this.http.get<DivId>(helpContentUrl + '/div/'+divId)
|
}
|
||||||
//.map(res => <DivId> res.json())
|
|
||||||
.pipe(catchError(this.handleError));
|
getDivId(divId: string, helpContentUrl:string) {
|
||||||
}
|
return this.http.get<DivId>(helpContentUrl + 'div/'+divId)
|
||||||
|
//.map(res => <DivId> res.json())
|
||||||
getDivIdFull(divId: string, helpContentUrl:string) {
|
.pipe(catchError(this.handleError));
|
||||||
return this.http.get<DivId>(helpContentUrl + '/divFull/'+divId)
|
}
|
||||||
//.map(res => <DivId> res.json())
|
|
||||||
.pipe(catchError(this.handleError));
|
getDivIdFull(divId: string, helpContentUrl:string) {
|
||||||
}
|
return this.http.get<DivId>(helpContentUrl + 'divFull/'+divId)
|
||||||
|
//.map(res => <DivId> res.json())
|
||||||
saveDivId(divId: DivId, helpContentUrl:string) {
|
.pipe(catchError(this.handleError));
|
||||||
HelpContentService.removeNulls(divId);
|
}
|
||||||
|
|
||||||
return this.http.post<DivId>(helpContentUrl + '/div/save', JSON.stringify(divId), CustomOptions.getAuthOptionsWithBody())
|
saveDivId(divId: DivId, helpContentUrl:string) {
|
||||||
//.map(res => <DivId> res.json())
|
HelpContentService.removeNulls(divId);
|
||||||
.pipe(catchError(this.handleError));
|
|
||||||
}
|
return this.http.post<DivId>(helpContentUrl + 'div/save', JSON.stringify(divId), CustomOptions.getAuthOptionsWithBody())
|
||||||
/*
|
//.map(res => <DivId> res.json())
|
||||||
getCommunitiesWithDivId(helpContentUrl:string) {
|
.pipe(catchError(this.handleError));
|
||||||
return this.http.get(helpContentUrl + 'community?div=true')
|
}
|
||||||
.map(res => <Array<Community>> res.json())
|
/*
|
||||||
.catch(this.handleError);
|
getCommunitiesWithDivId(helpContentUrl:string) {
|
||||||
}
|
return this.http.get(helpContentUrl + 'community?div=true')
|
||||||
*/
|
.map(res => <Array<Portal>> res.json())
|
||||||
getCommunityPagesWithDivId(community_pid: string, helpContentUrl:string) {
|
.catch(this.handleError);
|
||||||
return this.http.get<Array<Page>>(helpContentUrl + '/community/'+community_pid+'/pages?div=true')
|
}
|
||||||
//.map(res => <Array<Page>> res.json())
|
*/
|
||||||
.pipe(catchError(this.handleError));
|
getCommunityPagesWithDivId(portal_pid: string, helpContentUrl:string) {
|
||||||
}
|
return this.http.get<Array<Page>>(helpContentUrl + properties.adminToolsPortalType + '/'+portal_pid+'/pages?div=true')
|
||||||
|
//.map(res => <Array<Page>> res.json())
|
||||||
getCommunityDivHelpContents(community_pid: string, helpContentUrl:string) {
|
.pipe(catchError(this.handleError));
|
||||||
return this.http.get<Array<DivHelpContent>>(helpContentUrl + '/divhelpcontent?community='+community_pid)
|
}
|
||||||
//.map(res => <Array<DivHelpContent>> res.json())
|
|
||||||
.pipe(catchError(this.handleError));
|
getCommunityDivHelpContents(portal_pid: string, helpContentUrl:string) {
|
||||||
}
|
return this.http.get<Array<DivHelpContent>>(helpContentUrl + 'divhelpcontent?portal='+portal_pid)
|
||||||
|
//.map(res => <Array<DivHelpContent>> res.json())
|
||||||
getDivHelpContent(id : string, helpContentUrl:string) {
|
.pipe(catchError(this.handleError));
|
||||||
return this.http.get<DivHelpContent>(helpContentUrl + '/divhelpcontent/' + id)
|
}
|
||||||
//.map(res => <DivHelpContent> res.json())
|
|
||||||
.pipe(catchError(this.handleError));
|
getDivHelpContent(id : string, helpContentUrl:string) {
|
||||||
}
|
return this.http.get<DivHelpContent>(helpContentUrl + 'divhelpcontent/' + id)
|
||||||
|
//.map(res => <DivHelpContent> res.json())
|
||||||
insertOrUpdateDivHelpContent(divHelpContent: DivHelpContent, helpContentUrl:string) {
|
.pipe(catchError(this.handleError));
|
||||||
HelpContentService.removeNulls(divHelpContent);
|
}
|
||||||
|
|
||||||
return this.http.post<DivHelpContent>(helpContentUrl + '/divhelpcontent', JSON.stringify(divHelpContent), CustomOptions.getAuthOptionsWithBody())
|
insertOrUpdateDivHelpContent(divHelpContent: DivHelpContent, helpContentUrl:string) {
|
||||||
//.map(res => <DivHelpContent> res.json())
|
HelpContentService.removeNulls(divHelpContent);
|
||||||
.pipe(catchError(this.handleError));
|
|
||||||
}
|
return this.http.post<DivHelpContent>(helpContentUrl + 'divhelpcontent', JSON.stringify(divHelpContent), CustomOptions.getAuthOptionsWithBody())
|
||||||
|
//.map(res => <DivHelpContent> res.json())
|
||||||
deleteDivIds(ids : string[], helpContentUrl:string) {
|
.pipe(catchError(this.handleError));
|
||||||
return this.http.post(helpContentUrl + '/div/delete',JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
|
}
|
||||||
.pipe(catchError(this.handleError));
|
|
||||||
}
|
deleteDivIds(ids : string[], helpContentUrl:string) {
|
||||||
|
return this.http.post(helpContentUrl + 'div/delete',JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
|
||||||
deleteDivHelpContents(ids : string[], helpContentUrl:string) {
|
.pipe(catchError(this.handleError));
|
||||||
return this.http.post(helpContentUrl + '/divhelpcontent/delete',JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
|
}
|
||||||
.pipe(catchError(this.handleError));
|
|
||||||
}
|
deleteDivHelpContents(ids : string[], helpContentUrl:string) {
|
||||||
|
return this.http.post(helpContentUrl + 'divhelpcontent/delete',JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
|
||||||
toggleDivHelpContents(ids : string[],status : boolean, helpContentUrl:string) {
|
.pipe(catchError(this.handleError));
|
||||||
|
}
|
||||||
return this.http.post(helpContentUrl + '/divhelpcontent/toggle?status='+ status.toString(), JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
|
|
||||||
//.map( res => <string[]> res.json())
|
toggleDivHelpContents(ids : string[],status : boolean, helpContentUrl:string) {
|
||||||
.pipe(catchError(this.handleError));
|
|
||||||
}
|
return this.http.post(helpContentUrl + 'divhelpcontent/toggle?status='+ status.toString(), JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
|
||||||
|
//.map( res => <string[]> res.json())
|
||||||
getPagesWithDivIds(community_pid: string, helpContentUrl:string) {
|
.pipe(catchError(this.handleError));
|
||||||
let parameters = (community_pid ? "?communityId="+community_pid : "");
|
}
|
||||||
return this.http.get<Array<string>>(helpContentUrl + '/div/pages'+parameters)
|
|
||||||
//.map(res => <Map<string, Set<string>>> res.json())
|
getPagesWithDivIds(portal_pid: string, helpContentUrl:string) {
|
||||||
.pipe(catchError(this.handleError));
|
let parameters = (portal_pid ? "?portal="+portal_pid : "");
|
||||||
}
|
return this.http.get<Array<string>>(helpContentUrl + 'div/pages'+parameters)
|
||||||
|
//.map(res => <Map<string, Set<string>>> res.json())
|
||||||
getPages(helpContentUrl:string,pid:string,with_positions:boolean=null) {
|
.pipe(catchError(this.handleError));
|
||||||
let parameters: string = "";
|
}
|
||||||
if(pid || with_positions == true || with_positions == false) {
|
|
||||||
parameters = "?";
|
getPages(helpContentUrl:string,pid:string,with_positions:boolean=null) {
|
||||||
if(pid) {
|
let parameters: string = "";
|
||||||
parameters += "&pid="+pid;
|
if(pid || with_positions == true || with_positions == false) {
|
||||||
}
|
parameters = "?";
|
||||||
if(with_positions == true || with_positions == false) {
|
if(pid) {
|
||||||
parameters += "&with_positions="+with_positions;
|
parameters += "&pid="+pid;
|
||||||
}
|
}
|
||||||
}
|
if(with_positions == true || with_positions == false) {
|
||||||
return this.http.get<Array<Page>>(helpContentUrl + '/page'+parameters)
|
parameters += "&with_positions="+with_positions;
|
||||||
//.map(res => <Array<Page>> res.json())
|
}
|
||||||
.pipe(catchError(this.handleError));
|
|
||||||
}
|
|
||||||
|
|
||||||
getPagesFull(helpContentUrl:string,pid:string) {
|
|
||||||
return this.http.get<Array<Page>>(helpContentUrl + '/pageFull'+(pid?("?pid="+pid):""))
|
|
||||||
//.map(res => <Array<Page>> res.json())
|
|
||||||
.pipe(catchError(this.handleError));
|
|
||||||
}
|
|
||||||
|
|
||||||
getPage(pageId:string, helpContentUrl:string) {
|
|
||||||
return this.http.get<Page>(helpContentUrl + '/page/'+pageId)
|
|
||||||
//.map(res => <Page> res.json())
|
|
||||||
.pipe(catchError(this.handleError));
|
|
||||||
}
|
|
||||||
|
|
||||||
getPageByRoute(route:string, helpContentUrl:string) {
|
|
||||||
return this.http.get<Page>(helpContentUrl + '/page/?page_route='+route)
|
|
||||||
.pipe(catchError(this.handleError));
|
|
||||||
}
|
|
||||||
|
|
||||||
getCommunities( helpContentUrl:string) {
|
|
||||||
return this.http.get<Array<Community>>(helpContentUrl + '/community')
|
|
||||||
//.map(res => <Array<Community>> res.json())
|
|
||||||
.pipe(catchError(this.handleError));
|
|
||||||
}
|
|
||||||
|
|
||||||
getCommunity(community_pid: string, helpContentUrl:string) {
|
|
||||||
return this.http.get<Community>(helpContentUrl + '/community/'+community_pid)
|
|
||||||
//.map(res => <Community> res.json())
|
|
||||||
.pipe(catchError(this.handleError));
|
|
||||||
}
|
|
||||||
|
|
||||||
getCommunitiesFull( helpContentUrl:string) {
|
|
||||||
return this.http.get<Array<Community>>(helpContentUrl + '/communityFull')
|
|
||||||
//.map(res => <Array<Community>> res.json())
|
|
||||||
.pipe(catchError(this.handleError));
|
|
||||||
}
|
|
||||||
|
|
||||||
getCommunityFull(community_pid: string, helpContentUrl:string) {
|
|
||||||
return this.http.get<Community>(helpContentUrl + '/communityFull/'+community_pid)
|
|
||||||
//.map(res => <Community> res.json())
|
|
||||||
.pipe(catchError(this.handleError));
|
|
||||||
}
|
|
||||||
|
|
||||||
saveCommunity(community: Community, helpContentUrl:string) {
|
|
||||||
// let headers = new Headers({'Content-Type': 'application/json'});
|
|
||||||
// let options = new RequestOptions({headers: headers});
|
|
||||||
|
|
||||||
HelpContentService.removeNulls(community);
|
|
||||||
|
|
||||||
return this.http.post<Community>(helpContentUrl + '/community/save', JSON.stringify(community), CustomOptions.getAuthOptionsWithBody())
|
|
||||||
//.map(res => <Community> res.json())
|
|
||||||
.pipe(catchError(this.handleError));
|
|
||||||
}
|
|
||||||
|
|
||||||
updateCommunity(community: Community, helpContentUrl:string) {
|
|
||||||
// let headers = new Headers({'Content-Type': 'application/json'});
|
|
||||||
// let options = new RequestOptions({headers: headers});
|
|
||||||
|
|
||||||
HelpContentService.removeNulls(community);
|
|
||||||
|
|
||||||
return this.http.post<Community>(helpContentUrl + '/community/update', JSON.stringify(community), CustomOptions.getAuthOptionsWithBody())
|
|
||||||
//.map(res => <Community> res.json())
|
|
||||||
.pipe(catchError(this.handleError));
|
|
||||||
}
|
|
||||||
|
|
||||||
deleteCommunities(ids : string[], helpContentUrl:string) {
|
|
||||||
// let headers = new Headers({'Content-Type': 'application/json'});
|
|
||||||
// let options = new RequestOptions({headers: headers});
|
|
||||||
|
|
||||||
return this.http.post(helpContentUrl + '/community/delete',JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
|
|
||||||
.pipe(catchError(this.handleError));
|
|
||||||
}
|
|
||||||
|
|
||||||
getCommunityPages(community_pid: string, params: string, helpContentUrl:string) {
|
|
||||||
return this.http.get<Array<Page>>(helpContentUrl + '/community/'+community_pid+'/pages'+params)
|
|
||||||
//.map(res => <Array<Page>> res.json())
|
|
||||||
.pipe(catchError(this.handleError));
|
|
||||||
}
|
|
||||||
|
|
||||||
getEntities(helpContentUrl:string) {
|
|
||||||
return this.http.get<Array<Entity>>(helpContentUrl + '/entity')
|
|
||||||
//.map(res => <Array<Entity>> res.json())
|
|
||||||
.pipe(catchError(this.handleError));
|
|
||||||
}
|
|
||||||
|
|
||||||
getCommunityEntities(community_pid: string, helpContentUrl:string) {
|
|
||||||
return this.http.get<Array<Entity>>(helpContentUrl + '/community/'+community_pid+'/entities')
|
|
||||||
//.map(res => <Array<Entity>> res.json())
|
|
||||||
.pipe(catchError(this.handleError));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
saveEntity(entity: Entity, helpContentUrl:string) {
|
|
||||||
HelpContentService.removeNulls(entity);
|
|
||||||
|
|
||||||
return this.http.post<Entity>(helpContentUrl + '/entity/save', JSON.stringify(entity), CustomOptions.getAuthOptionsWithBody())
|
|
||||||
//.map(res => <Entity> res.json())
|
|
||||||
.pipe(catchError(this.handleError));
|
|
||||||
}
|
|
||||||
|
|
||||||
updateEntity(entity: Entity, helpContentUrl:string) {
|
|
||||||
HelpContentService.removeNulls(entity);
|
|
||||||
|
|
||||||
return this.http.post<Entity>(helpContentUrl + '/entity/update', JSON.stringify(entity), CustomOptions.getAuthOptionsWithBody())
|
|
||||||
//.map(res => <Entity> res.json())
|
|
||||||
.pipe(catchError(this.handleError));
|
|
||||||
}
|
|
||||||
|
|
||||||
// toggleEntity(selectedCommunityId: string, id : string,status : boolean) {
|
|
||||||
// let headers = new Headers({'Content-Type': 'application/json'});
|
|
||||||
// let options = new RequestOptions({headers: headers});
|
|
||||||
//
|
|
||||||
// return this.http.post(helpContentUrl + 'community/'+selectedCommunityId+'/entity/toggle?status='+ status.toString()+'&entityId='+id.toString(), options)
|
|
||||||
// .catch(this.handleError);
|
|
||||||
// }
|
|
||||||
|
|
||||||
toggleEntities(selectedCommunityPid: string, ids : string[],status : boolean, helpContentUrl:string) {
|
|
||||||
|
|
||||||
return this.http.post(helpContentUrl +'/community/'+selectedCommunityPid+ '/entity/toggle?status='+ status.toString(), JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
|
|
||||||
//.map( res => <string[]> res.json())
|
|
||||||
.pipe(catchError(this.handleError));
|
|
||||||
}
|
|
||||||
|
|
||||||
deleteEntities(ids : string[], helpContentUrl:string) {
|
|
||||||
return this.http.post(helpContentUrl + '/entity/delete',JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
|
|
||||||
.pipe(catchError(this.handleError));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
toggleEntityOfPage(pageId: string, entityId : string,status : boolean, helpContentUrl:string) {
|
|
||||||
return this.http.post(helpContentUrl + '/page/'+pageId+'/entity/toggle?status='+ status.toString()+'&entityId='+entityId.toString(), CustomOptions.getAuthOptionsWithBody())
|
|
||||||
.pipe(catchError(this.handleError));
|
|
||||||
}
|
|
||||||
|
|
||||||
savePage(page: Page, helpContentUrl:string) {
|
|
||||||
HelpContentService.removeNulls(page);
|
|
||||||
|
|
||||||
return this.http.post<Page>(helpContentUrl + '/page/save', JSON.stringify(page), CustomOptions.getAuthOptionsWithBody())
|
|
||||||
//.map(res => <Page> res.json())
|
|
||||||
.pipe(catchError(this.handleError));
|
|
||||||
}
|
|
||||||
|
|
||||||
updatePage(page: Page, helpContentUrl:string) {
|
|
||||||
|
|
||||||
HelpContentService.removeNulls(page);
|
|
||||||
|
|
||||||
return this.http.post<Page>(helpContentUrl + '/page/update', JSON.stringify(page), CustomOptions.getAuthOptionsWithBody())
|
|
||||||
//.map(res => <Page> res.json())
|
|
||||||
.pipe(catchError(this.handleError));
|
|
||||||
}
|
|
||||||
|
|
||||||
togglePages(selectedCommunityPid: string, ids : string[],status : boolean, helpContentUrl:string) {
|
|
||||||
|
|
||||||
return this.http.post(helpContentUrl + '/community/'+selectedCommunityPid+'/page/toggle?status='+ status.toString(),JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
|
|
||||||
.pipe(catchError(this.handleError));
|
|
||||||
}
|
|
||||||
|
|
||||||
deletePages(ids : string[], helpContentUrl:string) {
|
|
||||||
|
|
||||||
return this.http.post(helpContentUrl + '/page/delete',JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
|
|
||||||
.pipe(catchError(this.handleError));
|
|
||||||
}
|
|
||||||
|
|
||||||
getPageHelpContents(helpContentUrl:string) {
|
|
||||||
return this.http.get<Array<PageHelpContent>>(helpContentUrl + 'pagehelpcontent')
|
|
||||||
//.map(res => <Array<PageHelpContent>> res.json())
|
|
||||||
.pipe(catchError(this.handleError));
|
|
||||||
}
|
|
||||||
|
|
||||||
getCommunityPageHelpContents(community_pid: string, helpContentUrl:string) {
|
|
||||||
return this.http.get<Array<PageHelpContent>>(helpContentUrl + '/pagehelpcontent?community='+community_pid)
|
|
||||||
//.map(res => <Array<PageHelpContent>> res.json())
|
|
||||||
.pipe(catchError(this.handleError));
|
|
||||||
}
|
|
||||||
|
|
||||||
getPageHelpContent(id : string, helpContentUrl:string) {
|
|
||||||
return this.http.get<PageHelpContent>(helpContentUrl + '/pagehelpcontent/' + id)
|
|
||||||
//.map(res => <PageHelpContent> res.json())
|
|
||||||
.pipe(catchError(this.handleError));
|
|
||||||
}
|
|
||||||
|
|
||||||
savePageHelpContent(pageHelpContent: PageHelpContent, helpContentUrl:string) {
|
|
||||||
HelpContentService.removeNulls(pageHelpContent);
|
|
||||||
|
|
||||||
return this.http.post<PageHelpContent>(helpContentUrl + '/pagehelpcontent/save', JSON.stringify(pageHelpContent), CustomOptions.getAuthOptionsWithBody())
|
|
||||||
//.map(res => <PageHelpContent> res.json())
|
|
||||||
.pipe(catchError(this.handleError));
|
|
||||||
}
|
|
||||||
|
|
||||||
updatePageHelpContent(pageHelpContent: PageHelpContent, helpContentUrl:string) {
|
|
||||||
HelpContentService.removeNulls(pageHelpContent);
|
|
||||||
|
|
||||||
return this.http.post<PageHelpContent>(helpContentUrl + '/pagehelpcontent/update', JSON.stringify(pageHelpContent), CustomOptions.getAuthOptionsWithBody())
|
|
||||||
//.map(res => <PageHelpContent> res.json())
|
|
||||||
.pipe(catchError(this.handleError));
|
|
||||||
}
|
|
||||||
|
|
||||||
deletePageHelpContents(ids : string[], helpContentUrl:string) {
|
|
||||||
return this.http.post(helpContentUrl + 'pagehelpcontent/delete',JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
|
|
||||||
.pipe(catchError(this.handleError));
|
|
||||||
}
|
|
||||||
|
|
||||||
togglePageHelpContents(ids : string[],status : boolean, helpContentUrl:string) {
|
|
||||||
return this.http.post(helpContentUrl + '/pagehelpcontent/toggle?status='+ status.toString(), JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
|
|
||||||
//.map( res => <string[]> res.json())
|
|
||||||
.pipe(catchError(this.handleError));
|
|
||||||
}
|
|
||||||
|
|
||||||
private handleError(error: HttpErrorResponse) {
|
|
||||||
// in a real world app, we may send the error to some remote logging infrastructure
|
|
||||||
// instead of just logging it to the console
|
|
||||||
console.error(error);
|
|
||||||
return Observable.throw(error.error || 'Server error');
|
|
||||||
}
|
|
||||||
|
|
||||||
// getDataProviders() {
|
|
||||||
// return this.http.get('https://beta.services.openaire.eu/search/v2/api/datasources?format=json').map(res => <any> res.json()).map(res => res.results).do(res => {console.log(res)}).catch(this.handleError);
|
|
||||||
// }
|
|
||||||
|
|
||||||
getCommunityStatistics(apiUrl: string, communityId: string): Observable<StatisticsSummary> {
|
|
||||||
const url = `${apiUrl}communities/${communityId}`;
|
|
||||||
//console.log(`getting statistics summary from: ${url}`);
|
|
||||||
return this.http.get(url)
|
|
||||||
//.map(res => <any>res.json())
|
|
||||||
.pipe(map(res => res['statistics']));
|
|
||||||
}
|
|
||||||
|
|
||||||
getCommunityAdminStatisticsChoices(apiUrl: string, communityId: string): Observable<StatisticsDisplay> {
|
|
||||||
const url = `${apiUrl}/statistics/${communityId}`;
|
|
||||||
//console.log(`getting admin choices for statistics from: ${url}`);
|
|
||||||
return this.http.get<StatisticsDisplay>(url)
|
|
||||||
//.map(stats => <StatisticsDisplay>stats.json())
|
|
||||||
.pipe(catchError(this.handleError));
|
|
||||||
}
|
|
||||||
|
|
||||||
postCommunityAdminStatisticsChoices(apiUrl: string,
|
|
||||||
communityId: string,
|
|
||||||
entity: string,
|
|
||||||
chartsOrNumbers: string,
|
|
||||||
title: string,
|
|
||||||
status: boolean,
|
|
||||||
monitor: boolean): Observable<any> {
|
|
||||||
const url = `${apiUrl}/statistics/${communityId}/${entity}/${chartsOrNumbers}?status=${status.toString()}&monitor=${monitor.toString()}`;
|
|
||||||
//console.log(`getting admin choices for statistics from: ${url}`);
|
|
||||||
|
|
||||||
return this.http.post(url, title, CustomOptions.getAuthOptionsWithBody())
|
|
||||||
//.map(stats => <any>stats.json())
|
|
||||||
.pipe(catchError(this.handleError));
|
|
||||||
}
|
}
|
||||||
|
return this.http.get<Array<Page>>(helpContentUrl + 'page'+parameters)
|
||||||
|
//.map(res => <Array<Page>> res.json())
|
||||||
|
.pipe(catchError(this.handleError));
|
||||||
|
}
|
||||||
|
|
||||||
|
getPagesFull(helpContentUrl:string,pid:string) {
|
||||||
|
return this.http.get<Array<Page>>(helpContentUrl + 'pageFull'+(pid?("?pid="+pid):""))
|
||||||
|
//.map(res => <Array<Page>> res.json())
|
||||||
|
.pipe(catchError(this.handleError));
|
||||||
|
}
|
||||||
|
|
||||||
|
getPage(pageId:string, helpContentUrl:string) {
|
||||||
|
return this.http.get<Page>(helpContentUrl + 'page/'+pageId)
|
||||||
|
//.map(res => <Page> res.json())
|
||||||
|
.pipe(catchError(this.handleError));
|
||||||
|
}
|
||||||
|
|
||||||
|
getPageByRoute(route:string, helpContentUrl:string) {
|
||||||
|
return this.http.get<Page>(helpContentUrl + 'page/?page_route='+route)
|
||||||
|
.pipe(catchError(this.handleError));
|
||||||
|
}
|
||||||
|
|
||||||
|
getCommunities( helpContentUrl:string) {
|
||||||
|
return this.http.get<Array<Portal>>(helpContentUrl + properties.adminToolsPortalType)
|
||||||
|
//.map(res => <Array<Portal>> res.json())
|
||||||
|
.pipe(catchError(this.handleError));
|
||||||
|
}
|
||||||
|
|
||||||
|
getCommunity(portal_pid: string, helpContentUrl:string) {
|
||||||
|
return this.http.get<Portal>(helpContentUrl + properties.adminToolsPortalType + '/'+portal_pid)
|
||||||
|
//.map(res => <Portal> res.json())
|
||||||
|
.pipe(catchError(this.handleError));
|
||||||
|
}
|
||||||
|
|
||||||
|
getCommunitiesFull( helpContentUrl:string) {
|
||||||
|
return this.http.get<Array<Portal>>(helpContentUrl + properties.adminToolsPortalType + 'Full')
|
||||||
|
//.map(res => <Array<Portal>> res.json())
|
||||||
|
.pipe(catchError(this.handleError));
|
||||||
|
}
|
||||||
|
|
||||||
|
getCommunityFull(portal_pid: string, helpContentUrl:string) {
|
||||||
|
return this.http.get<Portal>(helpContentUrl + properties.adminToolsPortalType + 'Full/'+portal_pid)
|
||||||
|
//.map(res => <Portal> res.json())
|
||||||
|
.pipe(catchError(this.handleError));
|
||||||
|
}
|
||||||
|
|
||||||
|
saveCommunity(portal: Portal, helpContentUrl:string) {
|
||||||
|
// let headers = new Headers({'Content-Type': 'application/json'});
|
||||||
|
// let options = new RequestOptions({headers: headers});
|
||||||
|
|
||||||
|
HelpContentService.removeNulls(portal);
|
||||||
|
|
||||||
|
return this.http.post<Portal>(helpContentUrl + portal.type + '/save', JSON.stringify(portal), CustomOptions.getAuthOptionsWithBody())
|
||||||
|
//.map(res => <Portal> res.json())
|
||||||
|
.pipe(catchError(this.handleError));
|
||||||
|
}
|
||||||
|
|
||||||
|
updateCommunity(portal: Portal, helpContentUrl:string) {
|
||||||
|
// let headers = new Headers({'Content-Type': 'application/json'});
|
||||||
|
// let options = new RequestOptions({headers: headers});
|
||||||
|
|
||||||
|
HelpContentService.removeNulls(portal);
|
||||||
|
|
||||||
|
return this.http.post<Portal>(helpContentUrl + portal.type + '/update', JSON.stringify(portal), CustomOptions.getAuthOptionsWithBody())
|
||||||
|
//.map(res => <Portal> res.json())
|
||||||
|
.pipe(catchError(this.handleError));
|
||||||
|
}
|
||||||
|
|
||||||
|
deleteCommunities(ids : string[], helpContentUrl:string) {
|
||||||
|
// let headers = new Headers({'Content-Type': 'application/json'});
|
||||||
|
// let options = new RequestOptions({headers: headers});
|
||||||
|
|
||||||
|
return this.http.post(helpContentUrl + properties.adminToolsPortalType + '/delete',JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
|
||||||
|
.pipe(catchError(this.handleError));
|
||||||
|
}
|
||||||
|
|
||||||
|
getCommunityPages(portal_pid: string, params: string, helpContentUrl:string) {
|
||||||
|
return this.http.get<Array<Page>>(helpContentUrl + properties.adminToolsPortalType + '/'+portal_pid+'/pages'+params)
|
||||||
|
//.map(res => <Array<Page>> res.json())
|
||||||
|
.pipe(catchError(this.handleError));
|
||||||
|
}
|
||||||
|
|
||||||
|
getEntities(helpContentUrl:string) {
|
||||||
|
return this.http.get<Array<Entity>>(helpContentUrl + 'entity')
|
||||||
|
//.map(res => <Array<Entity>> res.json())
|
||||||
|
.pipe(catchError(this.handleError));
|
||||||
|
}
|
||||||
|
|
||||||
|
getCommunityEntities(portal_pid: string, helpContentUrl:string) {
|
||||||
|
return this.http.get<Array<Entity>>(helpContentUrl + properties.adminToolsPortalType + '/'+portal_pid+'/entities')
|
||||||
|
//.map(res => <Array<Entity>> res.json())
|
||||||
|
.pipe(catchError(this.handleError));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
saveEntity(entity: Entity, helpContentUrl:string) {
|
||||||
|
HelpContentService.removeNulls(entity);
|
||||||
|
|
||||||
|
return this.http.post<Entity>(helpContentUrl + 'entity/save', JSON.stringify(entity), CustomOptions.getAuthOptionsWithBody())
|
||||||
|
//.map(res => <Entity> res.json())
|
||||||
|
.pipe(catchError(this.handleError));
|
||||||
|
}
|
||||||
|
|
||||||
|
updateEntity(entity: Entity, helpContentUrl:string) {
|
||||||
|
HelpContentService.removeNulls(entity);
|
||||||
|
|
||||||
|
return this.http.post<Entity>(helpContentUrl + 'entity/update', JSON.stringify(entity), CustomOptions.getAuthOptionsWithBody())
|
||||||
|
//.map(res => <Entity> res.json())
|
||||||
|
.pipe(catchError(this.handleError));
|
||||||
|
}
|
||||||
|
|
||||||
|
// toggleEntity(selectedCommunityId: string, id : string,status : boolean) {
|
||||||
|
// let headers = new Headers({'Content-Type': 'application/json'});
|
||||||
|
// let options = new RequestOptions({headers: headers});
|
||||||
|
//
|
||||||
|
// return this.http.post(helpContentUrl + 'community/'+selectedCommunityId+'/entity/toggle?status='+ status.toString()+'&entityId='+id.toString(), options)
|
||||||
|
// .catch(this.handleError);
|
||||||
|
// }
|
||||||
|
|
||||||
|
toggleEntities(selectedPortalPid: string, ids : string[],status : boolean, helpContentUrl:string) {
|
||||||
|
|
||||||
|
return this.http.post(helpContentUrl + properties.adminToolsPortalType + '/'+selectedPortalPid+ '/entity/toggle?status='+ status.toString(), JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
|
||||||
|
//.map( res => <string[]> res.json())
|
||||||
|
.pipe(catchError(this.handleError));
|
||||||
|
}
|
||||||
|
|
||||||
|
deleteEntities(ids : string[], helpContentUrl:string) {
|
||||||
|
return this.http.post(helpContentUrl + 'entity/delete',JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
|
||||||
|
.pipe(catchError(this.handleError));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
toggleEntityOfPage(pageId: string, entityId : string,status : boolean, helpContentUrl:string) {
|
||||||
|
return this.http.post(helpContentUrl + 'page/'+pageId+'/entity/toggle?status='+ status.toString()+'&entityId='+entityId.toString(), CustomOptions.getAuthOptionsWithBody())
|
||||||
|
.pipe(catchError(this.handleError));
|
||||||
|
}
|
||||||
|
|
||||||
|
savePage(page: Page, helpContentUrl:string) {
|
||||||
|
HelpContentService.removeNulls(page);
|
||||||
|
|
||||||
|
return this.http.post<Page>(helpContentUrl + 'page/save', JSON.stringify(page), CustomOptions.getAuthOptionsWithBody())
|
||||||
|
//.map(res => <Page> res.json())
|
||||||
|
.pipe(catchError(this.handleError));
|
||||||
|
}
|
||||||
|
|
||||||
|
updatePage(page: Page, helpContentUrl:string) {
|
||||||
|
|
||||||
|
HelpContentService.removeNulls(page);
|
||||||
|
|
||||||
|
return this.http.post<Page>(helpContentUrl + 'page/update', JSON.stringify(page), CustomOptions.getAuthOptionsWithBody())
|
||||||
|
//.map(res => <Page> res.json())
|
||||||
|
.pipe(catchError(this.handleError));
|
||||||
|
}
|
||||||
|
|
||||||
|
togglePages(selectedPortalPid: string, ids : string[],status : boolean, helpContentUrl:string) {
|
||||||
|
|
||||||
|
return this.http.post(helpContentUrl + properties.adminToolsPortalType + '/'+selectedPortalPid+'/page/toggle?status='+ status.toString(),JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
|
||||||
|
.pipe(catchError(this.handleError));
|
||||||
|
}
|
||||||
|
|
||||||
|
deletePages(ids : string[], helpContentUrl:string) {
|
||||||
|
|
||||||
|
return this.http.post(helpContentUrl + 'page/delete',JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
|
||||||
|
.pipe(catchError(this.handleError));
|
||||||
|
}
|
||||||
|
|
||||||
|
getPageHelpContents(helpContentUrl:string) {
|
||||||
|
return this.http.get<Array<PageHelpContent>>(helpContentUrl + 'pagehelpcontent')
|
||||||
|
//.map(res => <Array<PageHelpContent>> res.json())
|
||||||
|
.pipe(catchError(this.handleError));
|
||||||
|
}
|
||||||
|
|
||||||
|
getCommunityPageHelpContents(portal_pid: string, helpContentUrl:string) {
|
||||||
|
return this.http.get<Array<PageHelpContent>>(helpContentUrl + 'pagehelpcontent?portal='+portal_pid)
|
||||||
|
//.map(res => <Array<PageHelpContent>> res.json())
|
||||||
|
.pipe(catchError(this.handleError));
|
||||||
|
}
|
||||||
|
|
||||||
|
getPageHelpContent(id : string, helpContentUrl:string) {
|
||||||
|
return this.http.get<PageHelpContent>(helpContentUrl + 'pagehelpcontent/' + id)
|
||||||
|
//.map(res => <PageHelpContent> res.json())
|
||||||
|
.pipe(catchError(this.handleError));
|
||||||
|
}
|
||||||
|
|
||||||
|
savePageHelpContent(pageHelpContent: PageHelpContent, helpContentUrl:string) {
|
||||||
|
HelpContentService.removeNulls(pageHelpContent);
|
||||||
|
|
||||||
|
return this.http.post<PageHelpContent>(helpContentUrl + 'pagehelpcontent/save', JSON.stringify(pageHelpContent), CustomOptions.getAuthOptionsWithBody())
|
||||||
|
//.map(res => <PageHelpContent> res.json())
|
||||||
|
.pipe(catchError(this.handleError));
|
||||||
|
}
|
||||||
|
|
||||||
|
updatePageHelpContent(pageHelpContent: PageHelpContent, helpContentUrl:string) {
|
||||||
|
HelpContentService.removeNulls(pageHelpContent);
|
||||||
|
|
||||||
|
return this.http.post<PageHelpContent>(helpContentUrl + 'pagehelpcontent/update', JSON.stringify(pageHelpContent), CustomOptions.getAuthOptionsWithBody())
|
||||||
|
//.map(res => <PageHelpContent> res.json())
|
||||||
|
.pipe(catchError(this.handleError));
|
||||||
|
}
|
||||||
|
|
||||||
|
deletePageHelpContents(ids : string[], helpContentUrl:string) {
|
||||||
|
return this.http.post(helpContentUrl + 'pagehelpcontent/delete',JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
|
||||||
|
.pipe(catchError(this.handleError));
|
||||||
|
}
|
||||||
|
|
||||||
|
togglePageHelpContents(ids : string[],status : boolean, helpContentUrl:string) {
|
||||||
|
return this.http.post(helpContentUrl + 'pagehelpcontent/toggle?status='+ status.toString(), JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
|
||||||
|
//.map( res => <string[]> res.json())
|
||||||
|
.pipe(catchError(this.handleError));
|
||||||
|
}
|
||||||
|
|
||||||
|
private handleError(error: HttpErrorResponse) {
|
||||||
|
// in a real world app, we may send the error to some remote logging infrastructure
|
||||||
|
// instead of just logging it to the console
|
||||||
|
console.error(error);
|
||||||
|
return Observable.throw(error.error || 'Server error');
|
||||||
|
}
|
||||||
|
|
||||||
|
// getDataProviders() {
|
||||||
|
// return this.http.get('https://beta.services.openaire.eu/search/v2/api/datasources?format=json').map(res => <any> res.json()).map(res => res.results).do(res => {console.log(res)}).catch(this.handleError);
|
||||||
|
// }
|
||||||
|
|
||||||
|
getCommunityStatistics(apiUrl: string, portalId: string): Observable<StatisticsSummary> {
|
||||||
|
const url = `${apiUrl}communities/${portalId}`;
|
||||||
|
//console.log(`getting statistics summary from: ${url}`);
|
||||||
|
return this.http.get(url)
|
||||||
|
//.map(res => <any>res.json())
|
||||||
|
.pipe(map(res => res['statistics']));
|
||||||
|
}
|
||||||
|
|
||||||
|
getCommunityAdminStatisticsChoices(apiUrl: string, portalId: string): Observable<StatisticsDisplay> {
|
||||||
|
const url = `${apiUrl}statistics/${portalId}`;
|
||||||
|
//console.log(`getting admin choices for statistics from: ${url}`);
|
||||||
|
return this.http.get<StatisticsDisplay>(url)
|
||||||
|
//.map(stats => <StatisticsDisplay>stats.json())
|
||||||
|
.pipe(catchError(this.handleError));
|
||||||
|
}
|
||||||
|
|
||||||
|
postCommunityAdminStatisticsChoices(apiUrl: string,
|
||||||
|
portalId: string,
|
||||||
|
entity: string,
|
||||||
|
chartsOrNumbers: string,
|
||||||
|
title: string,
|
||||||
|
status: boolean,
|
||||||
|
monitor: boolean): Observable<any> {
|
||||||
|
const url = `${apiUrl}statistics/${portalId}/${entity}/${chartsOrNumbers}?status=${status.toString()}&monitor=${monitor.toString()}`;
|
||||||
|
//console.log(`getting admin choices for statistics from: ${url}`);
|
||||||
|
|
||||||
|
return this.http.post(url, title, CustomOptions.getAuthOptionsWithBody())
|
||||||
|
//.map(stats => <any>stats.json())
|
||||||
|
.pipe(catchError(this.handleError));
|
||||||
|
}
|
||||||
|
|
||||||
|
statisticsIsActiveToggle(apiURL: string, id: string): Observable<boolean> {
|
||||||
|
const url = apiURL + '/statistics/' + encodeURIComponent(id) + '/toggle';
|
||||||
|
return this.http.post<boolean>(url, {}, CustomOptions.getAuthOptionsWithBody()).pipe(catchError(this.handleError));
|
||||||
|
}
|
||||||
|
|
||||||
statisticsIsActiveToggle(apiURL: string, id: string): Observable<boolean> {
|
statisticsIsActiveToggle(apiURL: string, id: string): Observable<boolean> {
|
||||||
const url = apiURL + '/statistics/' + encodeURIComponent(id) + '/toggle';
|
const url = apiURL + '/statistics/' + encodeURIComponent(id) + '/toggle';
|
||||||
|
|
|
@ -4,6 +4,7 @@ import {Observable, throwError} from 'rxjs';
|
||||||
import {CustomOptions} from './servicesUtils/customOptions.class';
|
import {CustomOptions} from './servicesUtils/customOptions.class';
|
||||||
import {CustomizationOptions} from '../connect/community/CustomizationOptions';
|
import {CustomizationOptions} from '../connect/community/CustomizationOptions';
|
||||||
import {EnvProperties} from "../utils/properties/env-properties";
|
import {EnvProperties} from "../utils/properties/env-properties";
|
||||||
|
import {properties} from "../../../environments/environment";
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class LayoutService {
|
export class LayoutService {
|
||||||
|
@ -23,12 +24,13 @@ export class LayoutService {
|
||||||
|
|
||||||
saveLayout(properties: EnvProperties, pid: string, layout: CustomizationOptions): Observable<CustomizationOptions> {
|
saveLayout(properties: EnvProperties, pid: string, layout: CustomizationOptions): Observable<CustomizationOptions> {
|
||||||
LayoutService.removeNulls(layout);
|
LayoutService.removeNulls(layout);
|
||||||
return this.http.post<CustomizationOptions>(properties.adminToolsAPIURL + 'community/'
|
return this.http.post<CustomizationOptions>(properties.adminToolsAPIURL + '/' + properties.adminToolsPortalType + '/'
|
||||||
+ pid + '/layout', layout, CustomOptions.getAuthOptionsWithBody());
|
+ pid + '/layout', layout, CustomOptions.getAuthOptionsWithBody());
|
||||||
}
|
}
|
||||||
|
|
||||||
getLayout(properties: EnvProperties, pid: string): Observable<CustomizationOptions> {
|
getLayout(properties: EnvProperties, pid: string): Observable<CustomizationOptions> {
|
||||||
return this.http.get<CustomizationOptions>(properties.adminToolsAPIURL+"/community/" + pid + '/layout');
|
return this.http.get<CustomizationOptions>(properties.adminToolsAPIURL+"/" + properties.adminToolsPortalType + '/'
|
||||||
|
+ pid + '/layout');
|
||||||
}
|
}
|
||||||
|
|
||||||
mockLayout(): any {
|
mockLayout(): any {
|
||||||
|
|
|
@ -21,7 +21,7 @@ export class CustomOptions {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public static getAuthOptions():any {
|
public static getAuthOptions():{} {
|
||||||
const httpOptions = {
|
const httpOptions = {
|
||||||
headers: new HttpHeaders({
|
headers: new HttpHeaders({
|
||||||
'X-XSRF-TOKEN': (COOKIE.getCookie(COOKIE.cookieName_id))?COOKIE.getCookie(COOKIE.cookieName_id):''
|
'X-XSRF-TOKEN': (COOKIE.getCookie(COOKIE.cookieName_id))?COOKIE.getCookie(COOKIE.cookieName_id):''
|
||||||
|
|
|
@ -8,14 +8,14 @@ import {BehaviorSubject, from, Observable, Subscription} from 'rxjs';
|
||||||
// import 'rxjs/add/operator/share';
|
// import 'rxjs/add/operator/share';
|
||||||
import {map, mapTo} from 'rxjs/operators';
|
import {map, mapTo} from 'rxjs/operators';
|
||||||
import {EnvProperties} from "../properties/env-properties";
|
import {EnvProperties} from "../properties/env-properties";
|
||||||
import {Community} from "../entities/adminTool/community";
|
import {Portal} from "../entities/adminTool/portal";
|
||||||
import {Page} from "../entities/adminTool/page";
|
import {Page} from "../entities/adminTool/page";
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
export class ConfigurationService {
|
export class ConfigurationService {
|
||||||
private communityInformation: BehaviorSubject<Community> = new BehaviorSubject(null);
|
private communityInformation: BehaviorSubject<Portal> = new BehaviorSubject(null);
|
||||||
private sub: Subscription = null;
|
private sub: Subscription = null;
|
||||||
private source: Observable<Community> = null;
|
private source: Observable<Portal> = null;
|
||||||
private promise: Promise<boolean> = null;
|
private promise: Promise<boolean> = null;
|
||||||
|
|
||||||
constructor(private http: HttpClient ) {}
|
constructor(private http: HttpClient ) {}
|
||||||
|
@ -30,7 +30,7 @@ export class ConfigurationService {
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
getCommunityInformation(properties:EnvProperties, community:string){
|
getCommunityInformation(properties:EnvProperties, community:string){
|
||||||
let url = properties.adminToolsAPIURL +"/communityFull/" + community;
|
let url = properties.adminToolsAPIURL +"/"+properties.adminToolsPortalType+"/" + community + '/full';
|
||||||
return this.http.get((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url);
|
return this.http.get((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url);
|
||||||
//.map(res => res.json());
|
//.map(res => res.json());
|
||||||
}
|
}
|
||||||
|
@ -38,13 +38,13 @@ export class ConfigurationService {
|
||||||
public initCommunityInformation(properties:EnvProperties, community:string) {
|
public initCommunityInformation(properties:EnvProperties, community:string) {
|
||||||
if(community == null) return;
|
if(community == null) return;
|
||||||
|
|
||||||
let url = properties.adminToolsAPIURL +"/communityFull/" + community;
|
let url = properties.adminToolsAPIURL +"/" + properties.adminToolsPortalType + "/" + community + "/full";
|
||||||
this.promise = new Promise<any>((resolve => {
|
this.promise = new Promise<any>((resolve => {
|
||||||
this.source = this.http.get<Community>((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url);
|
this.source = this.http.get<Portal>((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url);
|
||||||
|
|
||||||
this.sub = this.source
|
this.sub = this.source
|
||||||
.subscribe(
|
.subscribe(
|
||||||
(communityInformation: Community) => {
|
(communityInformation: Portal) => {
|
||||||
this.communityInformation.next(communityInformation);
|
this.communityInformation.next(communityInformation);
|
||||||
resolve();
|
resolve();
|
||||||
},
|
},
|
||||||
|
@ -56,7 +56,7 @@ export class ConfigurationService {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public get communityInformationState(): Observable<Community> {
|
public get communityInformationState(): Observable<Portal> {
|
||||||
return this.communityInformation.asObservable();
|
return this.communityInformation.asObservable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ export class ConfigurationService {
|
||||||
isPageEnabled(properties:EnvProperties, community:string,router: string){
|
isPageEnabled(properties:EnvProperties, community:string,router: string){
|
||||||
let page_route: string = router.split('?')[0].substring(1);
|
let page_route: string = router.split('?')[0].substring(1);
|
||||||
|
|
||||||
let url = properties.adminToolsAPIURL + "/community/" + community+"/pages?page_route="+page_route;
|
let url = properties.adminToolsAPIURL + "/"+properties.adminToolsPortalType+"/" + community+"/pages?page_route="+page_route;
|
||||||
return this.http.get((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
|
return this.http.get((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
|
||||||
//.map(res => res.json())
|
//.map(res => res.json())
|
||||||
.pipe(map(res => {
|
.pipe(map(res => {
|
||||||
|
@ -109,7 +109,7 @@ export class ConfigurationService {
|
||||||
}
|
}
|
||||||
|
|
||||||
filtering(page_route: string) {
|
filtering(page_route: string) {
|
||||||
let community: Community = this.communityInformation.getValue();
|
let community: Portal = this.communityInformation.getValue();
|
||||||
|
|
||||||
let pages: Page[] = <Page[]>community.pages;
|
let pages: Page[] = <Page[]>community.pages;
|
||||||
pages = pages.filter(function (page: Page) {
|
pages = pages.filter(function (page: Page) {
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import { DivId } from './divId';
|
import { DivId } from './divId';
|
||||||
import {Community} from './community';
|
import {Portal} from './portal';
|
||||||
|
|
||||||
export interface DivHelpContent {
|
export interface DivHelpContent {
|
||||||
_id: string;
|
_id: string;
|
||||||
divId: DivId | string;
|
divId: DivId | string;
|
||||||
community: string | Community;
|
portal: string | Portal;
|
||||||
content: string;
|
content: string;
|
||||||
isActive: boolean;
|
isActive: boolean;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,9 +4,7 @@ export interface DivId {
|
||||||
_id: string;
|
_id: string;
|
||||||
name: string;
|
name: string;
|
||||||
pages: Page[] | String[];
|
pages: Page[] | String[];
|
||||||
connect: boolean;
|
portalType: string;
|
||||||
communities: boolean;
|
|
||||||
openaire: boolean;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CheckDivId {
|
export interface CheckDivId {
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import { Page } from "./page";
|
import { Page } from "./page";
|
||||||
import { Community } from "./community";
|
import { Portal } from "./portal";
|
||||||
|
|
||||||
export interface HtmlPageContent {
|
export interface HtmlPageContent {
|
||||||
_id: string;
|
_id: string;
|
||||||
page: Page | string;
|
page: Page | string;
|
||||||
community: Community | string;
|
portal: Portal | string;
|
||||||
content: string;
|
content: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,12 +2,12 @@
|
||||||
* Created by stefania on 7/13/17.
|
* Created by stefania on 7/13/17.
|
||||||
*/
|
*/
|
||||||
import { Page } from './page';
|
import { Page } from './page';
|
||||||
import { Community } from './community';
|
import {Portal} from "./portal";
|
||||||
|
|
||||||
export interface PageHelpContent {
|
export interface PageHelpContent {
|
||||||
_id: string;
|
_id: string;
|
||||||
page: Page | string;
|
page: Page | string;
|
||||||
community: Community | string;
|
portal: Portal | string;
|
||||||
placement: string;
|
placement: string;
|
||||||
order: number;
|
order: number;
|
||||||
content: string;
|
content: string;
|
||||||
|
|
|
@ -6,9 +6,7 @@ export interface Page {
|
||||||
name: string;
|
name: string;
|
||||||
type: string;
|
type: string;
|
||||||
isEnabled: boolean;
|
isEnabled: boolean;
|
||||||
connect: boolean;
|
portalType: string;
|
||||||
communities: boolean;
|
|
||||||
openaire: boolean;
|
|
||||||
entities: Entity[] | string[];
|
entities: Entity[] | string[];
|
||||||
top: boolean;
|
top: boolean;
|
||||||
bottom: boolean;
|
bottom: boolean;
|
||||||
|
|
|
@ -1,15 +1,16 @@
|
||||||
import {Page} from './page';
|
import {Page} from './page';
|
||||||
import {Entity} from './entity';
|
import {Entity} from './entity';
|
||||||
|
|
||||||
export interface Community {
|
export interface Portal {
|
||||||
_id: string;
|
_id: string;
|
||||||
pid: string;
|
pid: string;
|
||||||
name: string;
|
name: string;
|
||||||
|
type: string;
|
||||||
entities: string[] | Entity[];
|
entities: string[] | Entity[];
|
||||||
pages: string[] | Page[];
|
pages: string[] | Page[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CheckCommunity {
|
export interface CheckPortal {
|
||||||
community: Community;
|
community: Portal;
|
||||||
checked: boolean;
|
checked: boolean;
|
||||||
}
|
}
|
|
@ -35,7 +35,7 @@ export class HelperService {
|
||||||
}
|
}
|
||||||
let page_route: string = router.split('?')[0].substring(0);
|
let page_route: string = router.split('?')[0].substring(0);
|
||||||
let url = properties.adminToolsAPIURL;
|
let url = properties.adminToolsAPIURL;
|
||||||
url += '/community/' + communityId + '/pagehelpcontent?active=true&page='+page_route;
|
url += '/'+properties.adminToolsPortalType+'/' + communityId + '/pagehelpcontent/grouped?active=true&page='+page_route;
|
||||||
return this.http.get((properties.useLongCache)? (properties.cacheUrl+encodeURIComponent(url)): url);
|
return this.http.get((properties.useLongCache)? (properties.cacheUrl+encodeURIComponent(url)): url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ export class HelperService {
|
||||||
}
|
}
|
||||||
let page_route: string = router.split('?')[0].substring(0);
|
let page_route: string = router.split('?')[0].substring(0);
|
||||||
let url = properties.adminToolsAPIURL;
|
let url = properties.adminToolsAPIURL;
|
||||||
url += '/community/' + communityId + '/divhelpcontent?active=true&page='+page_route;
|
url += '/'+properties.adminToolsPortalType+'/' + communityId + '/divhelpcontent/grouped?active=true&page='+page_route;
|
||||||
return this.http.get((properties.useLongCache)? (properties.cacheUrl+encodeURIComponent(url)): url);
|
return this.http.get((properties.useLongCache)? (properties.cacheUrl+encodeURIComponent(url)): url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
export type Environment = "development" | "test" | "beta" | "production";
|
export type Environment = "development" | "test" | "beta" | "production";
|
||||||
export type Dashboard = "explore" | "connect" | "monitor";
|
export type Dashboard = "explore" | "connect" | "monitor";
|
||||||
|
export type PortalType = "explore" | "connect" | "community" | "monitor";
|
||||||
|
|
||||||
export interface EnvProperties {
|
export interface EnvProperties {
|
||||||
environment?: Environment;
|
environment?: Environment;
|
||||||
|
adminToolsPortalType?: PortalType;
|
||||||
dashboard?: Dashboard;
|
dashboard?: Dashboard;
|
||||||
isDashboard?: boolean;
|
isDashboard?: boolean;
|
||||||
domain?: string;
|
domain?: string;
|
||||||
|
@ -57,6 +59,7 @@ export interface EnvProperties {
|
||||||
feedbackmail?: string;
|
feedbackmail?: string;
|
||||||
feedbackmailForMissingEntities?: string;
|
feedbackmailForMissingEntities?: string;
|
||||||
cacheUrl?: string;
|
cacheUrl?: string;
|
||||||
|
deleteCacheUrl?: string;
|
||||||
monitorServiceAPIURL?: string;
|
monitorServiceAPIURL?: string;
|
||||||
adminToolsAPIURL?: string;
|
adminToolsAPIURL?: string;
|
||||||
adminToolsCommunity?: string;
|
adminToolsCommunity?: string;
|
||||||
|
|
|
@ -5,6 +5,7 @@ import {CustomOptions} from "../../services/servicesUtils/customOptions.class";
|
||||||
import {EnvProperties} from "../properties/env-properties";
|
import {EnvProperties} from "../properties/env-properties";
|
||||||
import {COOKIE} from "../../login/utils/helper.class";
|
import {COOKIE} from "../../login/utils/helper.class";
|
||||||
import {BehaviorSubject, Observable} from "rxjs";
|
import {BehaviorSubject, Observable} from "rxjs";
|
||||||
|
import {properties} from "../../../../environments/environment";
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class SubscribeService {
|
export class SubscribeService {
|
||||||
|
@ -13,7 +14,7 @@ export class SubscribeService {
|
||||||
constructor(private http: HttpClient) {}
|
constructor(private http: HttpClient) {}
|
||||||
|
|
||||||
public initIsSubscribedToCommunity(properties: EnvProperties, pid: string) {
|
public initIsSubscribedToCommunity(properties: EnvProperties, pid: string) {
|
||||||
let url = properties.adminToolsAPIURL + "/community/" + pid + "/is-subscriber/";
|
let url = properties.adminToolsAPIURL + "/"+ properties.adminToolsPortalType +"/" + pid + "/is-subscriber/";
|
||||||
this.http.get<boolean>(url, CustomOptions.getAuthOptionsWithBody()).subscribe((isSubscribed) => {
|
this.http.get<boolean>(url, CustomOptions.getAuthOptionsWithBody()).subscribe((isSubscribed) => {
|
||||||
this.isSubscribedSubject.next(isSubscribed);
|
this.isSubscribedSubject.next(isSubscribed);
|
||||||
}, error => {
|
}, error => {
|
||||||
|
@ -26,17 +27,17 @@ export class SubscribeService {
|
||||||
}
|
}
|
||||||
|
|
||||||
getCommunitySubscribers(properties: EnvProperties, pid: string) {
|
getCommunitySubscribers(properties: EnvProperties, pid: string) {
|
||||||
let url = properties.adminToolsAPIURL + "/community/" + pid + "/subscribers";
|
let url = properties.adminToolsAPIURL + "/" + properties.adminToolsPortalType + "/" + pid + "/subscribers";
|
||||||
return this.http.get<any>((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url);
|
return this.http.get<any>((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url);
|
||||||
}
|
}
|
||||||
|
|
||||||
getNumberOfCommunitySubscribers(properties: EnvProperties, pid: string) {
|
getNumberOfCommunitySubscribers(properties: EnvProperties, pid: string) {
|
||||||
let url = properties.adminToolsAPIURL + "/community/" + pid + "/subscribers/count";
|
let url = properties.adminToolsAPIURL + "/"+ properties.adminToolsPortalType +"/" + pid + "/subscribers/count";
|
||||||
return this.http.get<any>((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url);
|
return this.http.get<any>((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url);
|
||||||
}
|
}
|
||||||
|
|
||||||
isSubscribedToCommunity(properties: EnvProperties, pid: string) {
|
isSubscribedToCommunity(properties: EnvProperties, pid: string) {
|
||||||
let url = properties.adminToolsAPIURL + "/community/" + pid + "/is-subscriber/";
|
let url = properties.adminToolsAPIURL + "/"+ properties.adminToolsPortalType +"/" + pid + "/is-subscriber/";
|
||||||
return this.http.get<boolean>(url, CustomOptions.getAuthOptionsWithBody())
|
return this.http.get<boolean>(url, CustomOptions.getAuthOptionsWithBody())
|
||||||
.pipe(map(res => {
|
.pipe(map(res => {
|
||||||
// if (res['status'] && res['status'] != 200) {
|
// if (res['status'] && res['status'] != 200) {
|
||||||
|
@ -56,24 +57,24 @@ export class SubscribeService {
|
||||||
}
|
}
|
||||||
|
|
||||||
subscribeToCommunity(properties: EnvProperties, pid: string) {
|
subscribeToCommunity(properties: EnvProperties, pid: string) {
|
||||||
return this.http.post<any>(properties.adminToolsAPIURL + "/community/" + pid + "/subscriber", {}, CustomOptions.getAuthOptionsWithBody())
|
return this.http.post<any>(properties.adminToolsAPIURL + "/"+ properties.adminToolsPortalType +"/" + pid + "/subscriber", {}, CustomOptions.getAuthOptionsWithBody())
|
||||||
.pipe(tap(isSubscribed => {
|
.pipe(tap(isSubscribed => {
|
||||||
this.isSubscribedSubject.next(isSubscribed);}));
|
this.isSubscribedSubject.next(isSubscribed);}));
|
||||||
}
|
}
|
||||||
|
|
||||||
unSubscribeToCommunity(properties: EnvProperties, pid: string) {
|
unSubscribeToCommunity(properties: EnvProperties, pid: string) {
|
||||||
return this.http.post<any>(properties.adminToolsAPIURL + "/community/" + pid + "/subscriber/delete", {}, CustomOptions.getAuthOptionsWithBody())
|
return this.http.post<any>(properties.adminToolsAPIURL + "/"+ properties.adminToolsPortalType+"/" + pid + "/subscriber/delete", {}, CustomOptions.getAuthOptionsWithBody())
|
||||||
.pipe(tap(unSubscribed => {
|
.pipe(tap(unSubscribed => {
|
||||||
this.isSubscribedSubject.next(!unSubscribed);}));
|
this.isSubscribedSubject.next(!unSubscribed);}));
|
||||||
}
|
}
|
||||||
|
|
||||||
subscribeToCommunityByEmail(properties: EnvProperties, pid: string, email: string) {
|
subscribeToCommunityByEmail(properties: EnvProperties, pid: string, email: string) {
|
||||||
let subscriber = {"email": email};
|
let subscriber = {"email": email};
|
||||||
return this.http.post<any>(properties.adminToolsAPIURL + "/community/" + pid + "/subscribers", JSON.stringify(subscriber), CustomOptions.getAuthOptionsWithBody());
|
return this.http.post<any>(properties.adminToolsAPIURL + "/"+ properties.adminToolsPortalType+"/" + pid + "/subscribers", JSON.stringify(subscriber), CustomOptions.getAuthOptionsWithBody());
|
||||||
}
|
}
|
||||||
|
|
||||||
unSubscribeToCommunityByEmail(properties: EnvProperties, pid: string, email: string) {
|
unSubscribeToCommunityByEmail(properties: EnvProperties, pid: string, email: string) {
|
||||||
return this.http.post<any>(properties.adminToolsAPIURL + "/community/" + pid + "/subscribers/delete", JSON.stringify([email]), CustomOptions.getAuthOptionsWithBody());
|
return this.http.post<any>(properties.adminToolsAPIURL + "/"+ properties.adminToolsPortalType+"/" + pid + "/subscribers/delete", JSON.stringify([email]), CustomOptions.getAuthOptionsWithBody());
|
||||||
}
|
}
|
||||||
|
|
||||||
getCommunitiesSubscribedTo(properties: EnvProperties/*, email: string*/) {
|
getCommunitiesSubscribedTo(properties: EnvProperties/*, email: string*/) {
|
||||||
|
|
Loading…
Reference in New Issue