@@ -78,7 +76,7 @@
{{check.page.name}}
0">Entities:
- {{check.page.entities.join(", ")}}
+ {{getEntitiesAsString(check.page)}}
Route: {{check.page.route}}
Type: {{check.page.type}}
diff --git a/dashboard/page/pages.component.ts b/dashboard/page/pages.component.ts
index 3d73bf38..a5a86b78 100644
--- a/dashboard/page/pages.component.ts
+++ b/dashboard/page/pages.component.ts
@@ -1,29 +1,26 @@
import {Component, ElementRef, OnInit, ViewChild} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {HelpContentService} from '../../services/help-content.service';
-import {FormArray, FormBuilder, FormControl, FormGroup, Validators} from '@angular/forms';
+import {FormArray, FormBuilder, FormGroup, Validators} from '@angular/forms';
import {CheckPage, Page} from '../../utils/entities/adminTool/page';
-import {Portal} from '../../utils/entities/adminTool/portal';
-import {CheckEntity, Entity} from '../../utils/entities/adminTool/entity';
+import {Entity} from '../../utils/entities/adminTool/entity';
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 {UserManagementService} from '../../services/user-management.service';
-import {Observable, Subscriber} from "rxjs";
-import {map, startWith} from "rxjs/operators";
-import {MatAutocompleteSelectedEvent} from "@angular/material";
+import {Subscriber} from "rxjs";
import {PortalUtils} from "../portal/portalHelper";
import {properties} from "../../../../environments/environment";
import {ConnectHelper} from "../../connect/connectHelper";
import {Option} from "../../sharedComponents/input/input.component";
import {AlertModal} from "../../utils/modal/alert";
+declare var UIkit;
+
@Component({
selector: 'pages',
templateUrl: './pages.component.html',
})
-
export class PagesComponent implements OnInit {
@ViewChild('editModal') editModal: AlertModal;
@@ -100,7 +97,6 @@ export class PagesComponent implements OnInit {
this.isPortalAdministrator = Session.isPortalAdministrator(user) && !this.portal;
}));
}));
-
this.subscriptions.push(this._helpContentService.getEntities(this.properties.adminToolsAPIURL).subscribe(
entities => {
this.allEntities = [];
@@ -110,7 +106,6 @@ export class PagesComponent implements OnInit {
value: entity
});
});
- this.showLoading = false;
},
error => this.handleError('System error retrieving pages', error)));
@@ -139,9 +134,7 @@ export class PagesComponent implements OnInit {
this.showLoading = true;
this.updateErrorMessage = '';
this.errorMessage = '';
-
this.pageWithDivIds = [];
-
let parameters = '';
if (this.pagesType) {
parameters = '?page_type=' + this.pagesType;
@@ -279,6 +272,11 @@ 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'
+ });
this.showLoading = false;
},
error => this.handleUpdateError('System error deleting the selected pages', error)
@@ -352,6 +350,7 @@ export class PagesComponent implements OnInit {
}
public pageSaveConfirmed(data: any) {
+ this.showLoading = true;
if (!Session.isLoggedIn()) {
this._router.navigate(['/user-info'], {
queryParams: {
@@ -365,6 +364,11 @@ export class PagesComponent implements OnInit {
this.subscriptions.push(this._helpContentService.savePage(
this.pageForm.value, 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'
+ });
},
error => this.handleUpdateError('System error creating page', error)
));
@@ -373,6 +377,11 @@ export class PagesComponent implements OnInit {
this.subscriptions.push(this._helpContentService.updatePage(this.pageForm.value, 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'
+ });
},
error => this.handleUpdateError('System error updating page', error)
));
@@ -389,6 +398,7 @@ export class PagesComponent implements OnInit {
}
this.applyFilters();
this.applyCheck(false);
+ this.showLoading = false;
}
public applyFilters() {
@@ -440,10 +450,21 @@ export class PagesComponent implements OnInit {
this.updateErrorMessage = message;// + ' (Server responded: ' + error + ')';
console.log('Server responded: ' + error);
}
-
+ UIkit.notification('An error has occurred. Please try again later', {
+ status: 'danger',
+ timeout: 6000,
+ pos: 'bottom-right'
+ });
this.showLoading = false;
}
+ public getEntitiesAsString(page: Page): string {
+ if(page.entities) {
+ return ( page.entities).map((page: Entity) => page.name).join(',');
+ }
+ return '';
+ }
+
// public filterByPortal(event: any) {
// this.portal = event.target.value;
// this.applyPortalFilter(this.portal);
diff --git a/dashboard/page/pages.module.ts b/dashboard/page/pages.module.ts
index 8b023f69..c7dfdb92 100644
--- a/dashboard/page/pages.module.ts
+++ b/dashboard/page/pages.module.ts
@@ -14,11 +14,12 @@ import {SearchInputModule} from "../../sharedComponents/search-input/search-inpu
import {IconsModule} from "../../utils/icons/icons.module";
import {IconsService} from "../../utils/icons/icons.service";
import {add} from "../../utils/icons/icons";
+import {LoadingModule} from "../../utils/loading/loading.module";
@NgModule({
imports: [
CommonModule, RouterModule, FormsModule, AlertModalModule, ReactiveFormsModule, MatSlideToggleModule, AdminToolServiceModule, InputModule,
- MatAutocompleteModule, MatFormFieldModule, MatChipsModule, AdminTabsModule, PageContentModule, PagesRoutingModule, SearchInputModule, IconsModule
+ MatAutocompleteModule, MatFormFieldModule, MatChipsModule, AdminTabsModule, PageContentModule, PagesRoutingModule, SearchInputModule, IconsModule, LoadingModule
],
declarations: [PagesComponent],
exports: [PagesComponent]
diff --git a/dashboard/portal/portals.component.html b/dashboard/portal/portals.component.html
index b145fc4c..7e3e2ddf 100644
--- a/dashboard/portal/portals.component.html
+++ b/dashboard/portal/portals.component.html
@@ -40,62 +40,57 @@