Revision 60202
Added by Argiro Kokogiannaki about 3 years ago
div-help-contents.component.ts | ||
---|---|---|
16 | 16 |
import {LoginErrorCodes} from '../../login/utils/guardHelper.class'; |
17 | 17 |
import {HelperFunctions} from "../../utils/HelperFunctions.class"; |
18 | 18 |
import {Subscriber} from "rxjs"; |
19 |
import {properties} from "../../../../environments/environment"; |
|
19 | 20 |
|
20 | 21 |
@Component({ |
21 | 22 |
selector: 'div-help-contents', |
... | ... | |
74 | 75 |
this.filterByPage(value); |
75 | 76 |
})); |
76 | 77 |
|
77 |
this.route.data |
|
78 |
.subscribe((data: { envSpecific: EnvProperties }) => { |
|
79 |
this.properties = data.envSpecific; |
|
78 |
this.properties = properties; |
|
80 | 79 |
|
81 |
this.route.queryParams.subscribe(params => {
|
|
82 |
HelperFunctions.scroll();
|
|
80 |
this.subscriptions.push(this.route.queryParams.subscribe(params => {
|
|
81 |
HelperFunctions.scroll(); |
|
83 | 82 |
|
84 |
this.selectedCommunityPid = params['communityId'];
|
|
85 |
this.selectedPageId = params['pageId'];
|
|
83 |
this.selectedCommunityPid = params['communityId']; |
|
84 |
this.selectedPageId = params['pageId']; |
|
86 | 85 |
|
87 |
if (this.selectedCommunityPid && this.selectedPageId) {
|
|
88 |
this.getPage(this.selectedPageId);
|
|
89 |
} else if (this.selectedCommunityPid) {
|
|
90 |
this.selectedPageId = "";
|
|
91 |
this.getPages(this.selectedCommunityPid);
|
|
92 |
}
|
|
93 |
});
|
|
94 |
}); |
|
86 |
if (this.selectedCommunityPid && this.selectedPageId) { |
|
87 |
this.getPage(this.selectedPageId); |
|
88 |
} else if (this.selectedCommunityPid) { |
|
89 |
this.selectedPageId = ""; |
|
90 |
this.getPages(this.selectedCommunityPid); |
|
91 |
} |
|
92 |
}));
|
|
93 |
|
|
95 | 94 |
} |
96 | 95 |
|
97 | 96 |
constructor(private element: ElementRef, private route: ActivatedRoute, private _helpService: HelpContentService, private router: Router, private _fb: FormBuilder) { |
... | ... | |
123 | 122 |
this._helpService.getPageByPortal(pageId, this.properties.adminToolsAPIURL, this.selectedCommunityPid).subscribe( |
124 | 123 |
page => { |
125 | 124 |
if (this.properties.adminToolsPortalType != page.portalType) { |
126 |
this.router.navigate(['/classContents'], {queryParams: {"communityId": this.selectedCommunityPid}}); |
|
125 |
this.router.navigate(['../../classContents'], {queryParams: {"communityId": this.selectedCommunityPid}});
|
|
127 | 126 |
} else { |
128 | 127 |
this.page = page; |
129 | 128 |
this.getDivHelpContents(this.selectedCommunityPid); |
... | ... | |
292 | 291 |
public editDivHelpContent(id: string) { |
293 | 292 |
//this.router.navigate(['/pageContents/edit/', _id]); |
294 | 293 |
if (this.selectedPageId) { |
295 |
this.router.navigate(['/classContents/edit/'], { |
|
294 |
this.router.navigate(['../../classContents/edit/'], {
|
|
296 | 295 |
queryParams: { |
297 | 296 |
"classContentId": id, |
298 | 297 |
"communityId": this.selectedCommunityPid, |
... | ... | |
300 | 299 |
} |
301 | 300 |
}); |
302 | 301 |
} else { |
303 |
this.router.navigate(['/classContents/edit/'], { |
|
302 |
this.router.navigate(['../../classContents/edit/'], {
|
|
304 | 303 |
queryParams: { |
305 | 304 |
"classContentId": id, |
306 | 305 |
"communityId": this.selectedCommunityPid |
... | ... | |
422 | 421 |
} |
423 | 422 |
|
424 | 423 |
public newClassContent() { |
424 |
console.log("AAA") |
|
425 | 425 |
if (this.selectedPageId) { |
426 |
this.router.navigate(['/classContents/new'], { |
|
426 |
this.router.navigate(['../../classContents/new'], {
|
|
427 | 427 |
queryParams: { |
428 | 428 |
communityId: this.selectedCommunityPid, |
429 | 429 |
pageId: this.selectedPageId |
430 |
} |
|
430 |
}, relativeTo: this.route
|
|
431 | 431 |
}); |
432 | 432 |
} else { |
433 |
this.router.navigate(['/classContents/new'], {queryParams: {communityId: this.selectedCommunityPid}});
|
|
433 |
this.router.navigate(['../../classContents/new'], {queryParams: {communityId: this.selectedCommunityPid}, relativeTo: this.route});
|
|
434 | 434 |
} |
435 | 435 |
} |
436 | 436 |
} |
Also available in: Unified diff
[Library | Trunk]
Dashboard - Admin tool pages:
- add tabs components
- add rout module (without guards)
- put tabs and page-content in pages, classes, entities pages
Stakeholder:
initial try to add filters for country and organization fields (doesn't work properly)