Revision 60297
Added by Konstantinos Triantafyllou about 3 years ago
entities.component.ts | ||
---|---|---|
34 | 34 |
public keyword = ''; |
35 | 35 |
|
36 | 36 |
public communities: Portal[] = []; |
37 |
public selectedCommunityPid: string;
|
|
37 |
public portal: string;
|
|
38 | 38 |
|
39 | 39 |
@ViewChild('AlertModalRelatedPages') alertModalRelatedPages; |
40 | 40 |
|
... | ... | |
75 | 75 |
this.applyStatusFilter(); |
76 | 76 |
})); |
77 | 77 |
this.userManagementService.getUserInfo().subscribe(user => { |
78 |
this.selectedCommunityPid = (this.route.snapshot.data.portal) ? this.route.snapshot.data.portal : this.route.snapshot.params[this.route.snapshot.data.param]; |
|
79 |
ConnectHelper.setPortalTypeFromPid(this.selectedCommunityPid ); |
|
80 |
this.applyCommunityFilter(this.selectedCommunityPid); |
|
81 |
this.isPortalAdministrator = Session.isPortalAdministrator(user) && !this.selectedCommunityPid; |
|
78 |
this.portal = (this.route.snapshot.data.portal) ? this.route.snapshot.data.portal : this.route.snapshot.params[this.route.snapshot.data.param]; |
|
79 |
if(this.portal === 'connect' || this.portal === 'explore') { |
|
80 |
ConnectHelper.setPortalTypeFromPid(this.portal); |
|
81 |
} |
|
82 |
this.applyPortalFilter(this.portal); |
|
83 |
this.isPortalAdministrator = Session.isPortalAdministrator(user) && !this.portal; |
|
82 | 84 |
}); |
83 | 85 |
|
84 | 86 |
|
... | ... | |
94 | 96 |
}); |
95 | 97 |
} |
96 | 98 |
|
97 |
getEntities(community_pid: string) {
|
|
99 |
getEntities(portal: string) {
|
|
98 | 100 |
if (!Session.isLoggedIn()) { |
99 | 101 |
this._router.navigate(['/user-info'], |
100 | 102 |
{queryParams: {'errorCode': LoginErrorCodes.NOT_VALID, 'redirectUrl': this._router.url}}); |
... | ... | |
102 | 104 |
this.showLoading = true; |
103 | 105 |
this.updateErrorMessage = ''; |
104 | 106 |
this.errorMessage = ''; |
105 |
if (community_pid) {
|
|
106 |
this._helpContentService.getCommunityEntities(community_pid, this.properties.adminToolsAPIURL).subscribe(
|
|
107 |
if (portal) {
|
|
108 |
this._helpContentService.getCommunityEntities(portal, this.properties.adminToolsAPIURL).subscribe(
|
|
107 | 109 |
entities => { |
108 | 110 |
this.entities = entities; |
109 | 111 |
this.checkboxes = []; |
... | ... | |
321 | 323 |
this.showLoading = false; |
322 | 324 |
} |
323 | 325 |
|
324 |
public applyCommunityFilter(community_pid: string) {
|
|
325 |
this.getEntities(community_pid);
|
|
326 |
public applyPortalFilter(portal: string) {
|
|
327 |
this.getEntities(portal);
|
|
326 | 328 |
} |
327 | 329 |
|
328 | 330 |
public toggleEntities(status: boolean, ids: string[]) { |
... | ... | |
353 | 355 |
} else { |
354 | 356 |
this.updateErrorMessage = ''; |
355 | 357 |
this._helpContentService.toggleEntities( |
356 |
this.selectedCommunityPid, this.toggleIds, this.toggleStatus, this.properties.adminToolsAPIURL).subscribe(
|
|
358 |
this.portal, this.toggleIds, this.toggleStatus, this.properties.adminToolsAPIURL).subscribe(
|
|
357 | 359 |
() => { |
358 | 360 |
for (let id of this.toggleIds) { |
359 | 361 |
const i = this.checkboxes.findIndex(_ => _.entity._id === id); |
Also available in: Unified diff
[Library | Trunk]: Rename community to portal in pages and entities