@@ -84,7 +84,7 @@
Route: {{check.page.route}}
Type: {{check.page.type}}
-
+
Portal type: {{check.page.portalType}}
@@ -101,14 +101,14 @@
diff --git a/dashboard/page/pages.component.ts b/dashboard/page/pages.component.ts
index 72a02567..d2eb2e5f 100644
--- a/dashboard/page/pages.component.ts
+++ b/dashboard/page/pages.component.ts
@@ -40,9 +40,7 @@ export class PagesComponent implements OnInit {
private searchText: RegExp = new RegExp('');
public keyword: string = '';
- public communities: Portal[] = [];
-
- public selectedCommunityPid: string;
+ public portal: string;
public pagesType: string;
public properties: EnvProperties = null;
@@ -106,12 +104,14 @@ export class PagesComponent implements OnInit {
// this.pagesType = params['type'];
this.filterForm.get('type').setValue(params['type']);
}
- this.selectedCommunityPid = (this.route.snapshot.data.portal)?this.route.snapshot.data.portal:this.route.snapshot.params[this.route.snapshot.data.param];
- ConnectHelper.setPortalTypeFromPid(this.selectedCommunityPid);
+ this.portal = (this.route.snapshot.data.portal)?this.route.snapshot.data.portal:this.route.snapshot.params[this.route.snapshot.data.param];
+ if(this.portal === 'connect' || this.portal === 'explore') {
+ ConnectHelper.setPortalTypeFromPid(this.portal);
+ }
this.keyword = '';
this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => {
- this.applyCommunityFilter(this.selectedCommunityPid);
- this.isPortalAdministrator = Session.isPortalAdministrator(user) && !this.selectedCommunityPid;
+ this.applyPortalFilter(this.portal);
+ this.isPortalAdministrator = Session.isPortalAdministrator(user) && !this.portal;
}));
}));
@@ -135,7 +135,7 @@ export class PagesComponent implements OnInit {
});
}
- getPages(community_pid: string) {
+ getPages(portal: string) {
if (!Session.isLoggedIn()) {
this._router.navigate(['/user-info'], {
queryParams: {
@@ -154,12 +154,12 @@ export class PagesComponent implements OnInit {
if (this.pagesType) {
parameters = '?page_type=' + this.pagesType;
}
- if (community_pid) {
- this.subscriptions.push(this._helpContentService.getCommunityPagesByType(community_pid, parameters, this.properties.adminToolsAPIURL).subscribe(
+ if (portal) {
+ this.subscriptions.push(this._helpContentService.getCommunityPagesByType(portal, parameters, this.properties.adminToolsAPIURL).subscribe(
pages => {
this.pagesReturned(pages);
//if(!this.pagesType || this.pagesType == "link") {
- this.getPagesWithDivIds(community_pid);
+ this.getPagesWithDivIds(portal);
//} else {
//this.showLoading = false;
//}
@@ -178,7 +178,7 @@ export class PagesComponent implements OnInit {
}
}
- getPagesWithDivIds(community_pid: string) {
+ getPagesWithDivIds(portal: string) {
if (!Session.isLoggedIn()) {
this._router.navigate(['/user-info'], {
queryParams: {
@@ -187,7 +187,7 @@ export class PagesComponent implements OnInit {
}
});
} else {
- this.subscriptions.push(this._helpContentService.getPageIdsFromDivIds(community_pid, this.properties.adminToolsAPIURL).subscribe(
+ this.subscriptions.push(this._helpContentService.getPageIdsFromDivIds(portal, this.properties.adminToolsAPIURL).subscribe(
pages => {
this.pageWithDivIds = pages;
this.showLoading = false;
@@ -208,13 +208,13 @@ export class PagesComponent implements OnInit {
}
/*
- getCommunities() {
+ getPortals() {
this._helpContentService.getCommunities(this.properties.adminToolsAPIURL).subscribe(
communities => {
this.communities = communities;
- this.selectedCommunityPid = this.communities[0].pid;
- this.getPages(this.selectedCommunityPid);
- this.getPagesWithDivIds(this.selectedCommunityPid);
+ this.portal = this.communities[0].pid;
+ this.getPages(this.portal);
+ this.getPagesWithDivIds(this.portal);
},
error => this.handleError('System error retrieving communities', error));
}
@@ -492,13 +492,13 @@ export class PagesComponent implements OnInit {
this.showLoading = false;
}
- // public filterByCommunity(event: any) {
- // this.selectedCommunityPid = event.target.value;
- // this.applyCommunityFilter(this.selectedCommunityPid);
+ // public filterByPortal(event: any) {
+ // this.portal = event.target.value;
+ // this.applyPortalFilter(this.portal);
// }
- public applyCommunityFilter(community_pid: string) {
- this.getPages(community_pid);
+ public applyPortalFilter(portal: string) {
+ this.getPages(portal);
}
public togglePages(status: boolean, ids: string[]) {
@@ -512,7 +512,7 @@ export class PagesComponent implements OnInit {
} else {
this.updateErrorMessage = '';
- this.subscriptions.push(this._helpContentService.togglePages(this.selectedCommunityPid, ids, status, this.properties.adminToolsAPIURL).subscribe(
+ this.subscriptions.push(this._helpContentService.togglePages(this.portal, ids, status, this.properties.adminToolsAPIURL).subscribe(
() => {
for (let id of ids) {
let i = this.checkboxes.findIndex(_ => _.page._id == id);