diff --git a/dashboard/divhelpcontent/class-help-contents.component.ts b/dashboard/divhelpcontent/class-help-contents.component.ts
index b730ccd5..49df2efa 100644
--- a/dashboard/divhelpcontent/class-help-contents.component.ts
+++ b/dashboard/divhelpcontent/class-help-contents.component.ts
@@ -15,9 +15,7 @@ import {DomSanitizer} from '@angular/platform-browser';
import {SearchInputComponent} from '../../sharedComponents/search-input/search-input.component';
import {CheckDivHelpContent, DivHelpContent} from '../../utils/entities/adminTool/div-help-content';
import {ClearCacheService} from "../../services/clear-cache.service";
-
-declare var UIkit;
-
+import {NotificationHandler} from "../../utils/notification-handler";
@Component({
selector: 'class-help-contents',
@@ -43,7 +41,6 @@ export class ClassHelpContentsComponent implements OnInit {
public showLoading: boolean = true;
public filterForm: FormControl;
private subscriptions: any[] = [];
- public stickyPageHeader: boolean = false;
constructor(private element: ElementRef, private route: ActivatedRoute, private router: Router,
private _helpService: HelpContentService, private _fb: FormBuilder, private sanitizer: DomSanitizer,
@@ -156,11 +153,7 @@ export class ClassHelpContentsComponent implements OnInit {
this.subscriptions.push(this._helpService.deleteDivHelpContents(this.selectedPageContents, this.properties.adminToolsAPIURL, this.portal).subscribe(
_ => {
this.deletePageHelpContentsFromArray(this.selectedPageContents);
- UIkit.notification('Page content(s) has been
successfully deleted', {
- status: 'success',
- timeout: 6000,
- pos: 'bottom-right'
- });
+ NotificationHandler.rise('Page content(s) has been
successfully deleted');
this.showLoading = false;
this._clearCacheService.clearCache("Class text texts deleted");
},
@@ -204,11 +197,7 @@ export class ClassHelpContentsComponent implements OnInit {
}
this.countClassHelpContents();
this.applyCheck(false);
- UIkit.notification('Page content(s) has been
successfully updated', {
- status: 'success',
- timeout: 6000,
- pos: 'bottom-right'
- });
+ NotificationHandler.rise('Page content(s) has been
successfully updated');
this._clearCacheService.clearCache("class help text's status changed");
},
error => this.handleUpdateError('System error changing the status of the selected page content(s)', error)
@@ -237,23 +226,19 @@ export class ClassHelpContentsComponent implements OnInit {
this.applyFilter();
}
- handleError(message: string, error) {
- UIkit.notification(message, {
- status: 'danger',
- timeout: 6000,
- pos: 'bottom-right'
- });
- console.log('Server responded: ' + error);
+ handleError(message: string, error = null) {
+ if(error) {
+ console.log('Server responded: ' + error);
+ }
+ NotificationHandler.rise(message, 'danger');
this.showLoading = false;
}
- handleUpdateError(message: string, error) {
- UIkit.notification(message, {
- status: 'danger',
- timeout: 6000,
- pos: 'bottom-right'
- });
- console.log('Server responded: ' + error);
+ handleUpdateError(message: string, error = null) {
+ if(error) {
+ console.log('Server responded: ' + error);
+ }
+ NotificationHandler.rise(message, 'danger');
this.showLoading = false;
}
diff --git a/dashboard/entity/entities.component.html b/dashboard/entity/entities.component.html
index cda470a8..2308954b 100644
--- a/dashboard/entity/entities.component.html
+++ b/dashboard/entity/entities.component.html
@@ -1,6 +1,6 @@
-
+
-
+
@@ -9,37 +9,33 @@
{{name?name:'Super Admin'}}
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
diff --git a/dashboard/entity/entities.component.ts b/dashboard/entity/entities.component.ts
index 77649727..9bbac496 100644
--- a/dashboard/entity/entities.component.ts
+++ b/dashboard/entity/entities.component.ts
@@ -19,8 +19,7 @@ import {CommunityService} from "../../connect/community/community.service";
import {CommunityInfo} from "../../connect/community/communityInfo";
import {Stakeholder, StakeholderInfo} from "../../monitor/entities/stakeholder";
import {ClearCacheService} from "../../services/clear-cache.service";
-
-declare var UIkit;
+import {NotificationHandler} from "../../utils/notification-handler";
@Component({
selector: 'entities',
@@ -57,7 +56,6 @@ export class EntitiesComponent implements OnInit {
public filterForm: FormGroup;
private subscriptions: any[] = [];
private index: number;
- public stickyPageHeader: boolean = false;
constructor(private element: ElementRef, private route: ActivatedRoute,
private _router: Router, private title: Title,
@@ -202,11 +200,7 @@ export class EntitiesComponent implements OnInit {
this._helpContentService.deleteEntities(this.selectedEntities, this.properties.adminToolsAPIURL).subscribe(
_ => {
this.deleteEntitiesFromArray(this.selectedEntities);
- UIkit.notification('Entities have been
successfully deleted', {
- status: 'success',
- timeout: 6000,
- pos: 'bottom-right'
- });
+ NotificationHandler.rise('Entities have been
successfully deleted');
this.showLoading = false;
this._clearCacheService.clearCache("entities deleted");
},
@@ -243,29 +237,21 @@ export class EntitiesComponent implements OnInit {
public entitySaveConfirmed(data: any) {
this.showLoading = true;
- if (this.entityForm.value._id) {
+ if (this.entityForm.getRawValue()._id) {
this._helpContentService.updateEntity(
-
this.entityForm.value, this.properties.adminToolsAPIURL).subscribe(
+ this.entityForm.getRawValue(), this.properties.adminToolsAPIURL).subscribe(
entity => {
this.entityUpdatedSuccessfully(entity);
- UIkit.notification('Entity ' + entity.name + ' has been successfully updated', {
- status: 'success',
- timeout: 6000,
- pos: 'bottom-right'
- });
+ NotificationHandler.rise('Entity ' + entity.name + ' has been successfully updated');
this._clearCacheService.clearCache("entity updated");
},
error => this.handleUpdateError('System error updating entity', error)
);
} else {
- this._helpContentService.saveEntity(this.entityForm.value, this.properties.adminToolsAPIURL).subscribe(
+ this._helpContentService.saveEntity(this.entityForm.getRawValue(), this.properties.adminToolsAPIURL).subscribe(
entity => {
this.entitySavedSuccessfully(entity);
- UIkit.notification('Entity ' + entity.name + ' has been successfully created', {
- status: 'success',
- timeout: 6000,
- pos: 'bottom-right'
- });
+ NotificationHandler.rise('Entity ' + entity.name + ' has been successfully created');
this._clearCacheService.clearCache("entity saved");
},
error => this.handleUpdateError('System error creating entity', error)
@@ -306,18 +292,16 @@ export class EntitiesComponent implements OnInit {
return status == "all" || (status == "disabled" && !entity.isEnabled) || (status == "enabled" && entity.isEnabled);
}
- handleError(message: string, error) {
- UIkit.notification(message, {
- status: 'danger',
- timeout: 6000,
- pos: 'bottom-right'
- });
- console.log('Server responded: ' + error);
+ handleError(message: string, error = null) {
+ if(error) {
+ console.log('Server responded: ' + error);
+ }
+ NotificationHandler.rise(message, 'danger');
this.showLoading = false;
}
- handleUpdateError(message: string, error) {
- if (error == null) {
+ handleUpdateError(message: string, error = null) {
+ if (!error) {
this.entityForm = this._fb.group({
pid: ['', Validators.required],
name: ['', Validators.required],
@@ -325,13 +309,9 @@ export class EntitiesComponent implements OnInit {
_id: ''
});
} else {
- UIkit.notification(message, {
- status: 'danger',
- timeout: 6000,
- pos: 'bottom-right'
- });
console.log('Server responded: ' + error);
}
+ NotificationHandler.rise(message, 'danger');
this.showLoading = false;
}
diff --git a/dashboard/helpTexts/page-help-content-form.component.html b/dashboard/helpTexts/page-help-content-form.component.html
index f36815cc..aed98fbf 100644
--- a/dashboard/helpTexts/page-help-content-form.component.html
+++ b/dashboard/helpTexts/page-help-content-form.component.html
@@ -1,7 +1,6 @@
-
+
-
-
-
+
+
+
+
+
+
+
diff --git a/dashboard/helpTexts/page-help-content-form.component.ts b/dashboard/helpTexts/page-help-content-form.component.ts
index 2a74d1b0..e3b0cea4 100644
--- a/dashboard/helpTexts/page-help-content-form.component.ts
+++ b/dashboard/helpTexts/page-help-content-form.component.ts
@@ -9,8 +9,7 @@ import {Subscriber, Subscription, zip} from 'rxjs';
import {HelperFunctions} from '../../utils/HelperFunctions.class';
import {PageHelpContent} from '../../utils/entities/adminTool/page-help-content';
import {ClearCacheService} from "../../services/clear-cache.service";
-
-declare var UIkit;
+import {NotificationHandler} from "../../utils/notification-handler";
@Component({
selector: 'page-content-form',
@@ -29,7 +28,6 @@ export class PageContentFormComponent implements OnInit {
public showLoading: boolean = true;
private subs: Subscription[] = [];
public pageHelpContent: PageHelpContent;
- public stickyPageHeader: boolean = false;
constructor(private route: ActivatedRoute, private _router: Router, private _fb: FormBuilder,
private _helpContentService: HelpContentService, private _clearCacheService: ClearCacheService) {
@@ -204,30 +202,21 @@ export class PageContentFormComponent implements OnInit {
this.myForm.markAsPristine();
}
- handleError(message: string, error) {
- UIkit.notification(message, {
- status: 'danger',
- timeout: 6000,
- pos: 'bottom-right'
- });
- console.error('Server responded: ' + error);
-
+ handleError(message: string, error = null) {
+ if(error) {
+ console.error('Server responded: ' + error);
+ }
+ NotificationHandler.rise(message, 'danger');
this.showLoading = false;
}
public saveCustom() {
if (this.myForm.valid) {
this.showLoading = true;
- this.myForm.get('order').enable();
- this.myForm.get('placement').enable();
- let pageHelpContent: PageHelpContent = this.myForm.value;
+ let pageHelpContent: PageHelpContent = this.myForm.getRawValue();
this.subs.push(this._helpContentService.savePageHelpContent(pageHelpContent, this.properties.adminToolsAPIURL, this.portal).subscribe(
_ => {
- UIkit.notification('Page content has been
successfully ' + (this.pageContentId ? 'updated' : 'created') + '', {
- status: 'success',
- timeout: 6000,
- pos: 'bottom-right'
- });
+ NotificationHandler.rise('Page content has been
successfully ' + (this.pageContentId ? 'updated' : 'created') + '');
this._router.navigate(['../'], {queryParams: {"pageId": this.pageId}, relativeTo: this.route});
this.showLoading = false;
this._clearCacheService.clearCache("page help content saved");
@@ -249,14 +238,11 @@ export class PageContentFormComponent implements OnInit {
this.showLoading = false;
}
- handleUpdateError(message: string, error) {
- UIkit.notification(message, {
- status: 'danger',
- timeout: 6000,
- pos: 'bottom-right'
- });
- console.error('Server responded: ' + error);
-
+ handleUpdateError(message: string, error = null) {
+ if(error) {
+ console.error('Server responded: ' + error);
+ }
+ NotificationHandler.rise(message, 'danger');
this.showLoading = false;
}
diff --git a/dashboard/helpTexts/page-help-contents.component.html b/dashboard/helpTexts/page-help-contents.component.html
index 93f30941..b908df95 100644
--- a/dashboard/helpTexts/page-help-contents.component.html
+++ b/dashboard/helpTexts/page-help-contents.component.html
@@ -1,7 +1,6 @@
-
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/dashboard/helpTexts/page-help-contents.component.ts b/dashboard/helpTexts/page-help-contents.component.ts
index dcf7c11c..832087a9 100644
--- a/dashboard/helpTexts/page-help-contents.component.ts
+++ b/dashboard/helpTexts/page-help-contents.component.ts
@@ -7,19 +7,16 @@ import {
PageHelpContent,
PageHelpContentFilterOptions
} from '../../utils/entities/adminTool/page-help-content';
-import {CheckPage, Page} from '../../utils/entities/adminTool/page';
+import {Page} from '../../utils/entities/adminTool/page';
import {Portal} from '../../utils/entities/adminTool/portal';
import {EnvProperties} from '../../utils/properties/env-properties';
-import {Session} from '../../login/utils/helper.class';
-import {LoginErrorCodes} from '../../login/utils/guardHelper.class';
import {HelperFunctions} from '../../utils/HelperFunctions.class';
import {Subscriber} from 'rxjs';
import {properties} from '../../../../environments/environment';
import {DomSanitizer} from '@angular/platform-browser';
import {SearchInputComponent} from '../../sharedComponents/search-input/search-input.component';
import {ClearCacheService} from "../../services/clear-cache.service";
-
-declare var UIkit;
+import {NotificationHandler} from "../../utils/notification-handler";
@Component({
selector: 'page-help-contents',
@@ -46,7 +43,6 @@ export class PageHelpContentsComponent implements OnInit {
public filterForm: FormControl;
private subscriptions: any[] = [];
public selectedKeyword: string;
- public stickyPageHeader: boolean = false;
@ViewChild('searchInputComponent') searchInputComponent: SearchInputComponent;
constructor(private element: ElementRef, private route: ActivatedRoute, private router: Router,
@@ -167,11 +163,7 @@ export class PageHelpContentsComponent implements OnInit {
this.subscriptions.push(this._helpService.deletePageHelpContents(this.selectedPageContents, this.properties.adminToolsAPIURL, this.portal).subscribe(
_ => {
this.deletePageHelpContentsFromArray(this.selectedPageContents);
- UIkit.notification('Page content(s) has been
successfully deleted', {
- status: 'success',
- timeout: 6000,
- pos: 'bottom-right'
- });
+ NotificationHandler.rise('Page content(s) has been
successfully deleted');
this.showLoading = false;
this._clearCacheService.clearCache("Help texts deleted");
},
@@ -215,11 +207,7 @@ export class PageHelpContentsComponent implements OnInit {
let i = this.checkboxes.findIndex(_ => _.pageHelpContent._id == id);
this.checkboxes[i].pageHelpContent.isActive = status;
}
- UIkit.notification('Page content(s) has been
successfully updated', {
- status: 'success',
- timeout: 6000,
- pos: 'bottom-right'
- });
+ NotificationHandler.rise('Page content(s) has been
successfully updated');
this.countPageHelpContents();
this.applyCheck(false);
this._clearCacheService.clearCache("Help text's status changed");
@@ -252,23 +240,19 @@ export class PageHelpContentsComponent implements OnInit {
this.applyFilter();
}
- handleError(message: string, error) {
- UIkit.notification(message, {
- status: 'danger',
- timeout: 6000,
- pos: 'bottom-right'
- });
- console.log('Server responded: ' + error);
+ handleError(message: string, error = null) {
+ if(error) {
+ console.log('Server responded: ' + error);
+ }
+ NotificationHandler.rise(message, 'danger');
this.showLoading = false;
}
- handleUpdateError(message: string, error) {
- UIkit.notification(message, {
- status: 'danger',
- timeout: 6000,
- pos: 'bottom-right'
- });
- console.log('Server responded: ' + error);
+ handleUpdateError(message: string, error = null) {
+ if(error) {
+ console.log('Server responded: ' + error);
+ }
+ NotificationHandler.rise(message, 'danger');
this.showLoading = false;
}
diff --git a/dashboard/page/pages.component.html b/dashboard/page/pages.component.html
index 150d324a..f485080f 100644
--- a/dashboard/page/pages.component.html
+++ b/dashboard/page/pages.component.html
@@ -1,6 +1,6 @@
-
+
-
+
@@ -9,36 +9,32 @@
{{name ? name : 'Super Admin'}}
-
+
-
diff --git a/dashboard/page/pages.component.ts b/dashboard/page/pages.component.ts
index c7170f4b..4fb6cd33 100644
--- a/dashboard/page/pages.component.ts
+++ b/dashboard/page/pages.component.ts
@@ -21,8 +21,7 @@ import {CommunityInfo} from "../../connect/community/communityInfo";
import {Stakeholder} from "../../monitor/entities/stakeholder";
import {CommunityService} from "../../connect/community/community.service";
import {ClearCacheService} from "../../services/clear-cache.service";
-
-declare var UIkit;
+import {NotificationHandler} from "../../utils/notification-handler";
@Component({
selector: 'pages',
@@ -70,7 +69,6 @@ export class PagesComponent implements OnInit {
private index: number;
pageHelpContentsCount = {};
pageClassContentsCount = {};
- public stickyPageHeader: boolean = false;
constructor(private element: ElementRef, private route: ActivatedRoute,
private title: Title,
@@ -249,11 +247,7 @@ export class PagesComponent implements OnInit {
this.subscriptions.push(this._helpContentService.deletePages(this.selectedPages, this.properties.adminToolsAPIURL).subscribe(
_ => {
this.deletePagesFromArray(this.selectedPages);
- UIkit.notification('Pages have been
successfully deleted', {
- status: 'success',
- timeout: 6000,
- pos: 'bottom-right'
- });
+ NotificationHandler.rise('Pages have been
successfully deleted');
this.showLoading = false;
this._clearCacheService.clearCache("Pages deleted");
},
@@ -317,29 +311,20 @@ export class PagesComponent implements OnInit {
public pageSaveConfirmed(data: any) {
this.showLoading = true;
- if (!this.pageForm.value._id) {
- this.subscriptions.push(this._helpContentService.savePage(
this.pageForm.value, this.properties.adminToolsAPIURL).subscribe(
+ if (!this.pageForm.getRawValue()._id) {
+ this.subscriptions.push(this._helpContentService.savePage(this.pageForm.getRawValue(), this.properties.adminToolsAPIURL).subscribe(
page => {
this.pageSavedSuccessfully(page, true);
- UIkit.notification('Page ' + page.name + ' has been successfully created', {
- status: 'success',
- timeout: 6000,
- pos: 'bottom-right'
- });
+ NotificationHandler.rise('Page ' + page.name + ' has been successfully created');
this._clearCacheService.clearCache("Page saved");
},
error => this.handleUpdateError('System error creating page', error)
));
} else {
- this.pageForm.get('portalType').enable();
- this.subscriptions.push(this._helpContentService.updatePage(this.pageForm.value, this.properties.adminToolsAPIURL).subscribe(
+ this.subscriptions.push(this._helpContentService.updatePage(this.pageForm.getRawValue(), this.properties.adminToolsAPIURL).subscribe(
page => {
this.pageSavedSuccessfully(page, false);
- UIkit.notification('Page ' + page.name + ' has been successfully updated', {
- status: 'success',
- timeout: 6000,
- pos: 'bottom-right'
- });
+ NotificationHandler.rise('Page ' + page.name + ' has been successfully updated');
this._clearCacheService.clearCache("Page updated");
},
error => this.handleUpdateError('System error updating page', error)
@@ -375,19 +360,16 @@ export class PagesComponent implements OnInit {
return this.searchText.toString() == '' || (page.route + ' ' + page.name + ' ' + page.portalType).match(this.searchText) != null;
}
- handleError(message: string, error) {
- UIkit.notification(message, {
- status: 'danger',
- timeout: 6000,
- pos: 'bottom-right'
- });
- console.log('Server responded: ' + error);
+ handleError(message: string, error = null) {
+ if(error) {
+ console.error('Server responded: ' + error);
+ }
+ NotificationHandler.rise(message, 'danger');
this.showLoading = false;
}
- handleUpdateError(message: string, error) {
- if (error == null) {
- // this.formComponent.reset();
+ handleUpdateError(message: string, error = null) {
+ if (!error) {
this.pageForm = this._fb.group({
route: this._fb.control('', Validators.required),
name: this._fb.control('', Validators.required),
@@ -402,12 +384,9 @@ export class PagesComponent implements OnInit {
_id: this._fb.control(''),
});
} else {
- UIkit.notification(message, {
- status: 'danger',
- timeout: 6000,
- pos: 'bottom-right'
- });
+ console.error('Server responded: ' + error);
}
+ NotificationHandler.rise(message, 'danger');
this.showLoading = false;
}
diff --git a/dashboard/portal/portals.component.html b/dashboard/portal/portals.component.html
index 4a175407..36a6b718 100644
--- a/dashboard/portal/portals.component.html
+++ b/dashboard/portal/portals.component.html
@@ -1,43 +1,39 @@
-
+
-
+
Admin Dashboard - Manage Portals
Super Admin
-
+
+
-
-
-
-
-
-
-
-
-
+
+
diff --git a/dashboard/portal/portals.component.ts b/dashboard/portal/portals.component.ts
index b24d46eb..355f4712 100644
--- a/dashboard/portal/portals.component.ts
+++ b/dashboard/portal/portals.component.ts
@@ -3,20 +3,15 @@ import {ActivatedRoute, Router} from '@angular/router';
import {HelpContentService} from '../../services/help-content.service';
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
import {EnvProperties} from '../../utils/properties/env-properties';
-
-import {Session} from '../../login/utils/helper.class';
-import {LoginErrorCodes} from '../../login/utils/guardHelper.class';
import {HelperFunctions} from "../../utils/HelperFunctions.class";
import {Subscriber} from "rxjs";
import {CheckPortal, Portal} from "../../utils/entities/adminTool/portal";
import {PortalUtils} from "./portalHelper";
import {properties} from "../../../../environments/environment";
import {AlertModal} from "../../utils/modal/alert";
-import {SearchInputComponent} from "../../sharedComponents/search-input/search-input.component";
import {Title} from "@angular/platform-browser";
import {ClearCacheService} from "../../services/clear-cache.service";
-
-declare var UIkit;
+import {NotificationHandler} from "../../utils/notification-handler";
@Component({
selector: 'portals',
@@ -44,7 +39,6 @@ export class PortalsComponent implements OnInit {
public showLoading = true;
public portalUtils: PortalUtils = new PortalUtils();
private index: number;
- public stickyPageHeader: boolean = false;
constructor(private element: ElementRef, private route: ActivatedRoute,
private title: Title,
@@ -141,11 +135,7 @@ export class PortalsComponent implements OnInit {
this.subscriptions.push(this._helpContentService.deleteCommunities(this.selectedPortals, this.properties.adminToolsAPIURL).subscribe(
_ => {
this.deletePortalsFromArray(this.selectedPortals);
- UIkit.notification('Portals have been
successfully deleted', {
- status: 'success',
- timeout: 6000,
- pos: 'bottom-right'
- });
+ NotificationHandler.rise('Portals have been
successfully deleted');
this.showLoading = false;
this._clearCacheService.clearCache("Portals deleted");
},
@@ -192,31 +182,22 @@ export class PortalsComponent implements OnInit {
public portalSaveConfirmed(data: any) {
this.showLoading = true;
- if (this.portalForm.value._id) {
- this.portalForm.get('type').enable();
- this.subscriptions.push(this._helpContentService.updateCommunity(
this.portalForm.value,
+ if (this.portalForm.getRawValue()._id) {
+ this.subscriptions.push(this._helpContentService.updateCommunity(this.portalForm.getRawValue(),
this.properties.adminToolsAPIURL).subscribe(
portal => {
this.portalUpdatedSuccessfully(portal);
- UIkit.notification('Portal ' + portal.name + ' has been successfully updated', {
- status: 'success',
- timeout: 6000,
- pos: 'bottom-right'
- });
+ NotificationHandler.rise('Portal ' + portal.name + ' has been successfully updated');
this._clearCacheService.clearCache("Portal updated");
},
error => this.handleUpdateError('System error updating portal', error)
));
} else {
- this.subscriptions.push(this._helpContentService.saveCommunity(this.portalForm.value,
+ this.subscriptions.push(this._helpContentService.saveCommunity(this.portalForm.getRawValue(),
this.properties.adminToolsAPIURL).subscribe(
portal => {
this.portalSavedSuccessfully(portal);
- UIkit.notification('Portal ' + portal.name + ' has been successfully created', {
- status: 'success',
- timeout: 6000,
- pos: 'bottom-right'
- });
+ NotificationHandler.rise('Portal ' + portal.name + ' has been successfully created');
this._clearCacheService.clearCache("Portal saved");
},
error => this.handleUpdateError('System error creating portal', error)
@@ -252,12 +233,11 @@ export class PortalsComponent implements OnInit {
}
public filterPortals(portal: Portal): boolean {
- const textFlag = this.searchText.toString() === '' || (portal.name || portal.type).match(this.searchText) != null;
- return textFlag;
+ return this.searchText.toString() === '' || (portal.name || portal.type).match(this.searchText) != null;
}
- handleUpdateError(message: string, error) {
- if (error == null) {
+ handleUpdateError(message: string, error = null) {
+ if (!error) {
this.portalForm = this._fb.group({
name: '',
_id: '',
@@ -266,23 +246,17 @@ export class PortalsComponent implements OnInit {
type: ''
});
} else {
- UIkit.notification(message, {
- status: 'danger',
- timeout: 6000,
- pos: 'bottom-right'
- });
console.log('Server responded: ' + error);
}
+ NotificationHandler.rise(message, 'danger');
this.showLoading = false;
}
- handleError(message: string, error) {
- UIkit.notification(message, {
- status: 'danger',
- timeout: 6000,
- pos: 'bottom-right'
- });
- console.log('Server responded: ' + error);
+ handleError(message: string, error = null) {
+ if(error) {
+ console.log('Server responded: ' + error);
+ }
+ NotificationHandler.rise(message, 'danger');
this.showLoading = false;
}
}
diff --git a/dashboard/sharedComponents/admin-tabs/admin-tabs.component.ts b/dashboard/sharedComponents/admin-tabs/admin-tabs.component.ts
index 63c9339f..ac3a5a09 100644
--- a/dashboard/sharedComponents/admin-tabs/admin-tabs.component.ts
+++ b/dashboard/sharedComponents/admin-tabs/admin-tabs.component.ts
@@ -8,7 +8,7 @@ import { properties } from 'src/environments/environment';
@Component({
selector: 'admin-tabs',
template: `
-
+
- Portals
- Pages
- Entities
@@ -20,7 +20,6 @@ import { properties } from 'src/environments/environment';
`
})
export class AdminTabsComponent implements OnInit {
-
@Input()
public type: string;
@Input()
@@ -29,10 +28,9 @@ export class AdminTabsComponent implements OnInit {
public user: User;
@Input()
public tab: "portal" | "page" | "entity" | "menu" | "class" = 'page';
-
public env = properties.environment;
-
private subscriptions: any[] = [];
+
constructor(private route: ActivatedRoute, private userManagementService: UserManagementService) {
}
@@ -41,6 +39,7 @@ export class AdminTabsComponent implements OnInit {
this.user = user;
}));
}
+
ngOnDestroy(): void {
this.subscriptions.forEach(value => {
if (value instanceof Subscriber) {
@@ -51,7 +50,6 @@ export class AdminTabsComponent implements OnInit {
});
}
-
public get isPortalAdmin() {
return Session.isPortalAdministrator(this.user) || Session.isCurator(this.type, this.user);
}
diff --git a/dashboard/sharedComponents/page-content/page-content.component.ts b/dashboard/sharedComponents/page-content/page-content.component.ts
index 897a917b..511ab521 100644
--- a/dashboard/sharedComponents/page-content/page-content.component.ts
+++ b/dashboard/sharedComponents/page-content/page-content.component.ts
@@ -1,21 +1,25 @@
-import {AfterViewInit, Component, EventEmitter, OnDestroy, OnInit, Output} from "@angular/core";
-import {Subscription} from "rxjs";
-
-declare var UIkit;
+import {AfterViewInit, Component, Input, OnDestroy, OnInit} from "@angular/core";
@Component({
selector: '[page-content]',
template: `
-