Delete isLoggedIn from portals and class-contents

This commit is contained in:
Konstantinos Triantafyllou 2022-07-08 21:57:12 +03:00
parent 2d0893ff45
commit 02bf9abee4
2 changed files with 57 additions and 90 deletions

View File

@ -192,14 +192,6 @@ export class ClassHelpContentsComponent implements OnInit {
}
public togglePageHelpContents(status: boolean, ids: string[]) {
if (!Session.isLoggedIn()) {
this.router.navigate(['/user-info'], {
queryParams: {
'errorCode': LoginErrorCodes.NOT_VALID,
'redirectUrl': this.router.url
}
});
} else {
this.subscriptions.push(this._helpService.toggleDivHelpContents(ids, status, this.properties.adminToolsAPIURL, this.portal).subscribe(
() => {
for (let id of ids) {
@ -217,7 +209,6 @@ export class ClassHelpContentsComponent implements OnInit {
error => this.handleUpdateError('System error changing the status of the selected page content(s)', error)
));
}
}
public filterPageHelpContent(divHelpContent: DivHelpContent, filters: PageHelpContentFilterOptions): boolean {

View File

@ -81,11 +81,6 @@ export class PortalsComponent implements OnInit {
}
getPortals() {
if (!Session.isLoggedIn()) {
this._router.navigate(['/user-info'], {
queryParams: {'errorCode': LoginErrorCodes.NOT_VALID, 'redirectUrl': this._router.url}
});
} else {
this.showLoading = true;
this.subscriptions.push(this._helpContentService.getPortalsFull(this.properties.adminToolsAPIURL).subscribe(
portals => {
@ -99,7 +94,6 @@ export class PortalsComponent implements OnInit {
},
error => this.handleError('System error retrieving portals', error)));
}
}
public toggleCheckBoxes(event) {
this.checkboxes.forEach(_ => _.checked = event.target.checked);
@ -187,31 +181,14 @@ export class PortalsComponent implements OnInit {
}
private portalModalOpen(title: string, yesBtn: string) {
if (!Session.isLoggedIn()) {
this._router.navigate(['/user-info'], {
queryParams: {
"errorCode": LoginErrorCodes.NOT_VALID,
"redirectUrl": this._router.url
}
});
} else {
this.editModal.okButtonLeft = false;
this.editModal.alertTitle = title;
this.editModal.okButtonText = yesBtn;
this.editModal.open();
}
}
public portalSaveConfirmed(data: any) {
this.showLoading = true;
if (!Session.isLoggedIn()) {
this._router.navigate(['/user-info'], {
queryParams: {
"errorCode": LoginErrorCodes.NOT_VALID,
"redirectUrl": this._router.url
}
});
} else {
if (this.portalForm.value._id) {
this.portalForm.get('type').enable();
this.subscriptions.push(this._helpContentService.updateCommunity(<Portal>this.portalForm.value,
@ -241,7 +218,6 @@ export class PortalsComponent implements OnInit {
));
}
}
}
public portalSavedSuccessfully(portal: Portal) {
this.portals.push(portal);