Remove bulk options from portal page and entities

This commit is contained in:
Konstantinos Triantafyllou 2022-06-24 18:20:40 +03:00
parent 4966a1d342
commit 950f50030f
6 changed files with 368 additions and 360 deletions

View File

@ -1,8 +1,10 @@
<div page-content (stickyEmitter)="stickyPageHeader = $event">
<div header>
<div class="uk-flex uk-flex-middle uk-margin-top info" [class.uk-active]="stickyPageHeader">
<img src="assets/common-assets/placeholder.png" class="uk-margin-right">
<div>
<div class="uk-margin-remove uk-text-background uk-text-bold uk-h6">Admin Dashboard</div>
<div class="uk-margin-remove uk-text-background uk-text-bold uk-h6">Admin Dashboard - Manage Classes</div>
<h1 class="uk-h4 uk-margin-remove">Super Admin</h1>
</div>
</div>
<div class="uk-margin uk-margin-remove-bottom">
@ -14,7 +16,7 @@
<loading></loading>
</div>
<ng-container *ngIf="!showLoading">
<div class="uk-grid uk-flex-middle uk-margin-top uk-margin-medium-bottom" uk-grid>
<div class="uk-grid uk-flex-middle uk-margin-top" uk-grid>
<div class="uk-width-1-1">
<ul class="uk-subnav uk-subnav-pill">
<li [class.uk-active]="filterForm.get('type').value === 'all'" class="uk-margin-small-bottom"><a
@ -28,19 +30,6 @@
</div>
<div class="uk-width-1-1 uk-flex uk-flex-right@m uk-flex-center uk-flex-wrap uk-flex-middle uk-grid" uk-grid>
<div search-input [expandable]="true" [searchControl]="filterForm.get('keyword')" searchInputClass="outer" placeholder="Search class" class="uk-width-1-3@xl uk-width-2-5@l uk-width-1-2@m uk-width-1-1"></div>
<div>
<button class="uk-button uk-button-secondary" [class.uk-disabled]="getSelectedDivIds().length == 0" [disabled]="getSelectedDivIds().length == 0">
Bulk Actions ({{getSelectedDivIds().length}})
</button>
<div uk-dropdown="mode: click">
<ul class="uk-nav uk-dropdown-nav"
[attr.uk-tooltip]="getSelectedDivIds().length == 0 ? 'pos:left; cls: uk-active' : 'cls: uk-invisible'"
title="Select at least one class">
<li><a [class]="getSelectedDivIds().length == 0 ? 'uk-disabled' : ''"
(click)="confirmDeleteSelectedDivIds()"><i></i> Delete </a></li>
</ul>
</div>
</div>
<div>
<button class="uk-button uk-button-default uk-flex uk-flex-middle" (click)="newDivId()">
<icon name="add" [flex]="true"></icon>
@ -49,47 +38,64 @@
</div>
</div>
</div>
<table *ngIf="checkboxes.length > 0"class="uk-table uk-table-striped uk-table-large">
<thead>
<tr>
<th
class="uk-width-small"><input id="allDivIdCheckbox" type="checkbox" class="uk-checkbox"
(change)="toggleCheckBoxes($event)"></th>
<th>Name</th>
<th *ngIf="!selectedCommunityPid">Portal Type</th>
<th>Page</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let check of checkboxes; let i=index">
<td><input id="{{check.divId._id}}" class="uk-checkbox" type="checkbox"
name="divIdscb[]" value="{{check.divId._id}}" [(ngModel)]="check.checked">
</td>
<td>
<div class="name" href="#">{{check.divId.name}}</div>
</td>
<td *ngIf="!selectedCommunityPid">
<div class="portalType" href="#">{{check.divId.portalType}}</div>
</td>
<td>
<div class="pages" href="#">
<span *ngFor="let page of check.divId.pages let i=index">{{page.name}}<span
*ngIf="i<(check.divId.pages.length-1)">, </span></span>
</div>
</td>
<td>
<div class="actions" href="#">
<icon class="clickable" name="edit" (click)="editDivId(i)"></icon>
<div class="uk-section">
<table *ngIf="checkboxes.length > 0"class="uk-table uk-table-striped uk-table-large">
<thead>
<tr class="uk-child-width-1-5">
<th>
<label>
<input id="checkAll" type="checkbox" (click)="toggleCheckBoxes($event)" class="uk-checkbox"
[ngModel]="getSelectedDivIds().length ==checkboxes.length"/>
</label>
<span class="uk-margin-left">
<button class="uk-button uk-button-link" [class.uk-disabled]="getSelectedDivIds().length == 0" [disabled]="getSelectedDivIds().length == 0">
Bulk Actions ({{getSelectedDivIds().length}})
</button>
<div uk-dropdown="mode: click">
<ul class="uk-nav uk-dropdown-nav"
[attr.uk-tooltip]="getSelectedDivIds().length == 0 ? 'pos:left; cls: uk-active' : 'cls: uk-invisible'"
title="Select at least one entity">
<li>
<a (click)="confirmDeleteSelectedDivIds()"><i></i>Delete</a>
</li>
</ul>
</div>
</span>
</th>
<th>Name</th>
<th *ngIf="!selectedCommunityPid">Portal Type</th>
<th>Page</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let check of checkboxes; let i=index">
<td><input id="{{check.divId._id}}" class="uk-checkbox" type="checkbox"
name="divIdscb[]" value="{{check.divId._id}}" [(ngModel)]="check.checked">
</td>
<td>
<div class="name" href="#">{{check.divId.name}}</div>
</td>
<td *ngIf="!selectedCommunityPid">
<div class="portalType" href="#">{{check.divId.portalType}}</div>
</td>
<td>
<div class="pages" href="#">
<span *ngFor="let page of check.divId.pages let i=index">{{page.name}}<span
*ngIf="i<(check.divId.pages.length-1)">, </span></span>
</div>
</td>
<td>
<icon class="clickable" name="edit" [customClass]="'uk-text-primary'" (click)="editDivId(i)"></icon>
<icon class="clickable uk-margin-small-left" [customClass]="'uk-text-danger'" name="delete" (click)="confirmDeleteDivId(check.divId._id)"></icon>
</div>
</td>
</tr>
</tbody>
</table>
<div *ngIf="checkboxes.length == 0"
class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-bottom uk-text-bold">
<div>No classes found</div>
</td>
</tr>
</tbody>
</table>
<div *ngIf="checkboxes.length == 0"
class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-bottom uk-text-bold">
<div>No classes found</div>
</div>
</div>
</ng-container>
</div>

View File

@ -2,9 +2,10 @@
<div header>
<div class="uk-flex uk-flex-middle uk-margin-top info" [class.uk-active]="stickyPageHeader">
<img *ngIf="logo" [src]="logo" class="uk-margin-right">
<img *ngIf="!logo" src="assets/common-assets/placeholder.png" class="uk-margin-right">
<div>
<div class="uk-margin-remove uk-text-background uk-text-bold uk-h6">Admin Dashboard</div>
<h1 class="uk-h4 uk-margin-remove">{{name}}</h1>
<div class="uk-margin-remove uk-text-background uk-text-bold uk-h6">Admin Dashboard - Manage Entities</div>
<h1 class="uk-h4 uk-margin-remove">{{name?name:'Super Admin'}}</h1>
</div>
</div>
<div class="uk-margin uk-margin-remove-bottom">
@ -16,7 +17,7 @@
<loading></loading>
</div>
<div *ngIf="!showLoading">
<div class="uk-grid uk-flex-middle uk-margin-top uk-margin-medium-bottom" uk-grid>
<div class="uk-grid uk-flex-middle uk-margin-top" uk-grid>
<div class="uk-width-1-1">
<ul *ngIf="!isPortalAdministrator" class="uk-subnav uk-subnav-pill">
<li [class.uk-active]="filterForm.get('status').value === 'all'"><a
@ -31,35 +32,6 @@
<div class="uk-width-1-1 uk-flex uk-flex-right@m uk-flex-center uk-flex-wrap uk-flex-middle uk-grid" uk-grid>
<div search-input [expandable]="true" [searchControl]="filterForm.get('keyword')" searchInputClass="outer" placeholder="Search entity"
class="uk-width-1-3@xl uk-width-2-5@l uk-width-1-2@m uk-width-1-1"></div>
<div>
<button class="uk-button uk-button-secondary" [class.uk-disabled]="getSelectedEntities().length == 0" [disabled]="getSelectedEntities().length == 0">
Bulk Actions ({{getSelectedEntities().length}})
</button>
<div uk-dropdown="mode: click">
<ul class="uk-nav uk-dropdown-nav"
[attr.uk-tooltip]="getSelectedEntities().length == 0 ? 'pos:left; cls: uk-active' : 'cls: uk-invisible'"
title="Select at least one entity">
<li *ngIf="!isPortalAdministrator">
<a [class]="getSelectedEntities().length == 0 ? 'uk-disabled' : ''"
(click)="toggleEntities(true,getSelectedEntities())"><i></i>
Enable
</a>
</li>
<li *ngIf="!isPortalAdministrator">
<a [class]="getSelectedEntities().length == 0 ? 'uk-disabled' : ''"
(click)="toggleEntities(false,getSelectedEntities())"><i></i>
Disable
</a>
</li>
<li *ngIf="isPortalAdministrator">
<a [class]="getSelectedEntities().length == 0 ? 'uk-disabled' : ''"
(click)="confirmDeleteSelectedEntities()"><i></i>
Delete
</a>
</li>
</ul>
</div>
</div>
<div *ngIf="isPortalAdministrator">
<button class="uk-button uk-button-default uk-flex uk-flex-middle" (click)="newEntity()">
<icon name="add" [flex]="true"></icon>
@ -68,49 +40,62 @@
</div>
</div>
</div>
</div>
<div *ngIf="!showLoading">
<table *ngIf="checkboxes.length > 0 " class="uk-table uk-table-striped uk-table-large">
<thead>
<tr>
<th><input id="checkAll" type="checkbox" (click)="selectAll()" class="uk-checkbox" [ngModel]="getSelectedEntities().length == checkboxes.length"/></th>
<th>Name</th>
<th *ngIf="!isPortalAdministrator">Status</th>
<th *ngIf="!isPortalAdministrator">Enable/Disable</th>
<th *ngIf="isPortalAdministrator">Actions</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let check of checkboxes; let i=index">
<td><input id="{{check.entity._id}}" class="uk-checkbox" type="checkbox"
name="entitiescb[]" value="{{check.entity._id}}" [(ngModel)]="check.checked">
</td>
<td>
<div class="name" href="#">{{check.entity.name}}</div>
</td>
<td *ngIf="!isPortalAdministrator">
<div class="name" href="#">{{check.entity.isEnabled ? "Enabled" : "Disabled"}}</div>
</td>
<td *ngIf="!isPortalAdministrator">
<mat-slide-toggle [checked]="check.entity.isEnabled"
(change)="($event.source.checked = check.entity.isEnabled);toggleEntities(!check.entity.isEnabled,[check.entity._id])"
uk-tooltip="title:<div class='uk-padding-small uk-width-large'><div class='uk-text-bold '>Disable an entity to hide it from community dashboard portal.</div><div class=' uk-margin-top'>If an entity is disabled, all related search and advanced search pages will be hidden from the community dashborad and a message 'Can't find that page' will appear in case the url of that page is loaded. If the related page belongs to the menu the link will be removed from menu, too.</div></div>"
></mat-slide-toggle>
</td>
<td *ngIf="isPortalAdministrator">
<div class="actions" href="#">
<icon class="clickable" name="edit" (click)="editEntity(i)"></icon>
<icon class="clickable uk-margin-small-left" [customClass]="'uk-text-danger'" name="delete" (click)="confirmDeleteEntity(check.entity._id)"></icon>
</div>
</td>
</tr>
</tbody>
</table>
<div *ngIf="checkboxes.length == 0"
class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-top uk-margin-bottom uk-text-bold">
<div>No entities found</div>
</div>
<div class="uk-section">
<table *ngIf="checkboxes.length > 0 " class="uk-table uk-table-striped uk-table-large">
<thead>
<tr class="uk-child-width-1-3">
<th *ngIf="!portal">
<label>
<input id="checkAll" type="checkbox" (click)="selectAll()" class="uk-checkbox"
[ngModel]="getSelectedEntities().length ==checkboxes.length"/>
</label>
<span class="uk-margin-left">
<button class="uk-button uk-button-link" [class.uk-disabled]="getSelectedEntities().length == 0" [disabled]="getSelectedEntities().length == 0">
Bulk Actions ({{getSelectedEntities().length}})
</button>
<div uk-dropdown="mode: click">
<ul class="uk-nav uk-dropdown-nav"
[attr.uk-tooltip]="getSelectedEntities().length == 0 ? 'pos:left; cls: uk-active' : 'cls: uk-invisible'"
title="Select at least one entity">
<li *ngIf="isPortalAdministrator">
<a (click)="confirmDeleteSelectedEntities()"><i></i>Delete</a>
</li>
</ul>
</div>
</span>
</th>
<th>Name</th>
<th *ngIf="!isPortalAdministrator">Status</th>
<th *ngIf="isPortalAdministrator">Actions</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let check of checkboxes; let i=index">
<td *ngIf="!portal">
<input id="{{check.entity._id}}" class="uk-checkbox" type="checkbox"
name="entitiescb[]" value="{{check.entity._id}}" [(ngModel)]="check.checked">
</td>
<td>
<div class="name" href="#">{{check.entity.name}}</div>
</td>
<td *ngIf="!isPortalAdministrator">
<mat-slide-toggle [checked]="check.entity.isEnabled"
(change)="($event.source.checked = check.entity.isEnabled);toggleEntities(!check.entity.isEnabled,[check.entity._id])"
uk-tooltip="title:<div class='uk-padding-small uk-width-large'><div class='uk-text-bold '>Disable an entity to hide it from community dashboard portal.</div><div class=' uk-margin-top'>If an entity is disabled, all related search and advanced search pages will be hidden from the community dashborad and a message 'Can't find that page' will appear in case the url of that page is loaded. If the related page belongs to the menu the link will be removed from menu, too.</div></div>"
></mat-slide-toggle>
</td>
<td *ngIf="isPortalAdministrator">
<icon class="clickable" name="edit" [customClass]="'uk-text-primary'" (click)="editEntity(i)"></icon>
<icon class="clickable uk-margin-small-left" [customClass]="'uk-text-danger'" name="delete" (click)="confirmDeleteEntity(check.entity._id)"></icon>
</td>
</tr>
</tbody>
</table>
<div *ngIf="checkboxes.length == 0"
class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-top uk-margin-bottom uk-text-bold">
<div>No entities found</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -75,6 +75,7 @@ export class EntitiesComponent implements OnInit {
this.userManagementService.getUserInfo().subscribe(user => {
this.portal = (this.route.snapshot.data.portal) ? this.route.snapshot.data.portal : this.route.snapshot.params[this.route.snapshot.data.param];
if (this.route.snapshot.data.portal) {
this.name = StringUtils.capitalize(this.portal);
this.title.setTitle(StringUtils.capitalize(this.portal) + ' | Entities');
} else if (this.route.snapshot.params[this.route.snapshot.data.param]) {
if(this.route.snapshot.data.param === 'stakeholder') {

View File

@ -1,203 +1,209 @@
<div page-content (stickyEmitter)="stickyPageHeader = $event">
<div header>
<div class="uk-flex uk-flex-middle uk-margin-top info" [class.uk-active]="stickyPageHeader">
<img *ngIf="logo" [src]="logo" class="uk-margin-right">
<div>
<div class="uk-margin-remove uk-text-background uk-text-bold uk-h6">Admin Dashboard</div>
<h1 class="uk-h4 uk-margin-remove">{{name}}</h1>
</div>
</div>
<div class="uk-margin uk-margin-remove-bottom">
<admin-tabs tab="page" [portal]="portal"></admin-tabs>
</div>
<div class="uk-flex uk-flex-middle uk-margin-top info" [class.uk-active]="stickyPageHeader">
<img *ngIf="logo" [src]="logo" class="uk-margin-right">
<img *ngIf="!logo" src="assets/common-assets/placeholder.png" class="uk-margin-right">
<div>
<div class="uk-margin-remove uk-text-background uk-text-bold uk-h6">Admin Dashboard - Manage Pages</div>
<h1 class="uk-h4 uk-margin-remove">{{name ? name : 'Super Admin'}}</h1>
</div>
</div>
<div class="uk-margin uk-margin-remove-bottom">
<admin-tabs tab="page" [portal]="portal"></admin-tabs>
</div>
</div>
<div inner>
<div *ngIf="showLoading" class="uk-position-center">
<loading></loading>
</div>
<ng-container *ngIf="!showLoading">
<div class="uk-grid uk-flex-middle uk-margin-top uk-margin-medium-bottom" uk-grid>
<div class="uk-width-1-1">
<ul class="uk-subnav uk-subnav-pill">
<li [class.uk-active]="filterForm.get('type').value === 'all'"><a
(click)="filterForm.get('type').setValue('all')"><span>All pages</span></a></li>
<li *ngFor="let type of typeOptions; let i=index"
[class.uk-active]="filterForm.get('type').value === type.value"><a
(click)="filterForm.get('type').setValue(type.value)"><span>{{type.label}}</span></a></li>
</ul>
</div>
<div class="uk-width-1-1 uk-flex uk-flex-right@m uk-flex-center uk-flex-wrap uk-flex-middle uk-grid" uk-grid>
<div search-input [expandable]="true" [searchControl]="filterForm.get('keyword')" searchInputClass="outer" placeholder="Search page"
class="uk-width-1-3@xl uk-width-2-5@l uk-width-1-2@m uk-width-1-1"></div>
<div>
<button class="uk-button uk-button-secondary" [class.uk-disabled]="getSelectedPages().length == 0" [disabled]="getSelectedPages().length == 0">
Bulk Actions ({{getSelectedPages().length}})
</button>
<div *ngIf="!showLoading">
<div class="uk-grid uk-flex-middle uk-margin-top" uk-grid>
<div class="uk-width-1-1">
<ul class="uk-subnav uk-subnav-pill">
<li [class.uk-active]="filterForm.get('type').value === 'all'"><a
(click)="filterForm.get('type').setValue('all')"><span>All pages</span></a></li>
<li *ngFor="let type of typeOptions; let i=index"
[class.uk-active]="filterForm.get('type').value === type.value"><a
(click)="filterForm.get('type').setValue(type.value)"><span>{{type.label}}</span></a></li>
</ul>
</div>
<div class="uk-width-1-1 uk-flex uk-flex-right@m uk-flex-center uk-flex-wrap uk-flex-middle uk-grid" uk-grid>
<div search-input [expandable]="true" [searchControl]="filterForm.get('keyword')" searchInputClass="outer"
placeholder="Search page"
class="uk-width-1-3@xl uk-width-2-5@l uk-width-1-2@m uk-width-1-1"></div>
<div *ngIf="isPortalAdministrator">
<button class="uk-button uk-button-default uk-flex uk-flex-middle" (click)="newPage()">
<icon name="add" [flex]="true"></icon>
<span class="uk-margin-small-left uk-text-bold uk-text-uppercase">Add page</span>
</button>
</div>
</div>
</div>
<div class="uk-section">
<div *ngIf="checkboxes.length > 0 && !portal" class="uk-padding uk-padding-remove-top uk-flex uk-flex-middle">
<label>
<input id="checkAll" type="checkbox" (click)="selectAll()" class="uk-checkbox"
[ngModel]="getSelectedPages().length ==checkboxes.length"/>
</label>
<div class="uk-margin-left">
<button class="uk-button uk-button-link" [class.uk-disabled]="getSelectedPages().length == 0"
[disabled]="getSelectedPages().length == 0">
Bulk Actions ({{getSelectedPages().length}})
</button>
<div uk-dropdown="mode: click">
<ul class="uk-nav uk-dropdown-nav"
[attr.uk-tooltip]="getSelectedPages().length == 0 ? 'pos:left; cls: uk-active' : 'cls: uk-invisible'"
title="Select at least one page">
<li *ngIf="!isPortalAdministrator">
<a [class]="getSelectedPages().length == 0 ? 'uk-disabled' : ''"
(click)="togglePages(true,getSelectedPages())"><i></i>
Enable
</a>
</li>
<li *ngIf="!isPortalAdministrator">
<a [class]="getSelectedPages().length == 0 ? 'uk-disabled' : ''"
(click)="togglePages(false,getSelectedPages())"><i></i>
Disable
</a>
</li>
<li *ngIf="isPortalAdministrator">
<a [class]="getSelectedPages().length == 0 ? 'uk-disabled' : ''"
(click)="confirmDeleteSelectedPages()"><i></i>
Delete
</a>
</li>
[attr.uk-tooltip]="getSelectedPages().length == 0 ? 'pos:left; cls: uk-active' : 'cls: uk-invisible'"
title="Select at least one page">
<li *ngIf="isPortalAdministrator">
<a (click)="confirmDeleteSelectedPages()"><i></i>
Delete
</a>
</li>
</ul>
</div>
</div>
<div *ngIf="isPortalAdministrator">
<button class="uk-button uk-button-default uk-flex uk-flex-middle" (click)="newPage()">
<icon name="add" [flex]="true"></icon>
<span class="uk-margin-small-left uk-text-bold uk-text-uppercase">Add page</span>
</button>
</div>
</div>
</div>
<div *ngIf="checkboxes.length > 0" class="uk-padding uk-padding-remove-bottom">
<div class="uk-display-inline">
<label>
<input id="checkAll" type="checkbox" (click)="selectAll()" class="uk-checkbox"
[ngModel]="getSelectedPages().length ==checkboxes.length"/>
<span class="uk-margin-medium-left uk-text-emphasis">Select all</span>
</label>
</div>
</div>
<ul *ngIf="checkboxes.length > 0" class="uk-list pages">
<li *ngFor="let check of checkboxes; let i=index" class="uk-card uk-card-default uk-margin-bottom">
<div class="top uk-padding uk-grid" uk-grid>
<div class="inputDiv">
<input id="{{check.page._id}}" class="uk-checkbox" type="checkbox"
name="pagescb[]" value="{{check.page._id}}" [(ngModel)]="check.checked">
</div>
<div class="infoDiv uk-width-expand uk-text-small">
<div class="uk-margin-bottom uk-text-large uk-text-bold">{{check.page.name}}</div>
<div *ngIf="check.page.entities && check.page.entities.length > 0">
<span class="uk-text-meta">Entities: </span>{{getEntitiesAsString(check.page)}}
</div>
<div class=" uk-margin-small-bottom">
<span class="uk-text-meta">Route: </span>{{check.page.route}}
</div>
<div *ngIf="!pagesType" class=" uk-margin-small-bottom">
<span class="uk-text-meta">Type: </span>{{check.page.type}}
</div>
<div *ngIf="!portal" class=" uk-margin-small-bottom">
<span class="uk-text-meta">Portal type: </span>{{check.page.portalType}}
</div>
<div *ngIf="!portal && check.page.portalPid" class=" uk-margin-small-bottom">
<span class="uk-text-meta">Portal PID: </span>{{check.page.portalPid}}
</div>
</div>
</div>
<div class="bottom uk-card-footer uk-flex uk-flex-right">
<div *ngIf="!isPortalAdministrator && ((check.page.top || check.page.bottom || check.page.left ||
check.page.right) || pageWithDivIds.includes(check.page._id) )" class="">
<div>
<a *ngIf="check.page.top || check.page.bottom || check.page.left || check.page.right"
class="uk-button uk-button-link uk-text-uppercase"
[queryParams]="{pageId: check.page._id}"
routerLink="../helptexts">
Manage page help texts
<span *ngIf="pageHelpContentsCount[check.page._id]">({{pageHelpContentsCount[check.page._id]}})</span>
</a>
</div>
<div>
<a *ngIf="pageWithDivIds.includes(check.page._id)" class="uk-button uk-button-link uk-text-uppercase"
[queryParams]="{ pageId: check.page._id}"
routerLink="../classContents">Manage class help texts
<span *ngIf="pageClassContentsCount[check.page._id]">({{pageClassContentsCount[check.page._id]}})</span>
</a>
</div>
</div>
<div *ngIf="!isPortalAdministrator" class="uk-margin-medium-left uk-flex uk-flex-middle">
<mat-slide-toggle [checked]="check.page.isEnabled"
(change)="($event.source.checked = check.page.isEnabled);togglePages(!check.page.isEnabled,[check.page._id])"
uk-tooltip="title:<div class='uk-padding-small uk-width-large'><div class='uk-text-bold '>Disable a page to hide it from community dashboard portal.</div><div class=' uk-margin-top'>If the page is disabled, a message 'Can't find that page' will appear in case the url of that page is loaded. If the disabled page belongs to the menu, the link will be removed from menu, too.</div></div>">
</mat-slide-toggle>
<span class="uk-margin-small-left uk-text-small uk-text-emphasis">Enable</span>
</div>
<div *ngIf="isPortalAdministrator || (check.page.portalType == properties.adminToolsPortalType && check.page.portalPid == portal)">
<div class="uk-flex uk-flex-middle">
<button [disabled]="!portal && check.page.portalPid" [attr.uk-tooltip]="((!portal && check.page.portalPid)?'This page belongs to ' + check.page.portalPid:null)"
class="uk-button uk-button-link uk-flex uk-flex-middle" (click)="editPage(i)">
<icon name="edit" [flex]="true"></icon>
<span class="uk-margin-xsmall-left"> Edit</span>
</button>
<button class="uk-button uk-button-link uk-flex uk-flex-middle uk-margin-left" (click)="confirmDeletePage(check.page._id)">
<icon name="delete" [flex]="true"></icon>
<span class="uk-margin-xsmall-left"> Delete</span>
</button>
</div>
</div>
</div>
</li>
</ul>
<div *ngIf="checkboxes.length == 0"
class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-top uk-margin-bottom uk-text-bold">
<div>No pages found</div>
</div>
</ng-container>
</div>
<div *ngIf="checkboxes.length > 0" class="uk-grid uk-child-width-1-1 uk-child-width-1-2@m" uk-grid>
<div *ngFor="let check of checkboxes; let i=index">
<div class="uk-card uk-card-default">
<div class="uk-card-body uk-flex">
<div *ngIf="!portal" class="uk-margin-right">
<input [id]="check.page._id" class="uk-checkbox" type="checkbox"
name="pagescb[]" value="{{check.page._id}}" [(ngModel)]="check.checked">
</div>
<div class="uk-width-expand uk-text-small">
<div class="uk-margin-bottom uk-text-large uk-text-bold">{{check.page.name}}</div>
<div *ngIf="check.page.entities && check.page.entities.length > 0">
<span class="uk-text-meta">Entities: </span>{{getEntitiesAsString(check.page)}}
</div>
<div class="uk-margin-small-bottom">
<span class="uk-text-meta">Route: </span>{{check.page.route}}
</div>
<div *ngIf="!pagesType" class="uk-margin-small-bottom">
<span class="uk-text-meta">Type: </span>{{check.page.type}}
</div>
<div *ngIf="!portal" class="uk-margin-small-bottom">
<span class="uk-text-meta">Portal type: </span>{{check.page.portalType}}
</div>
<div *ngIf="!portal && check.page.portalPid" class="uk-margin-small-bottom">
<span class="uk-text-meta">Portal PID: </span>{{check.page.portalPid}}
</div>
</div>
</div>
<div class="uk-card-footer uk-padding-remove-vertical">
<div class="uk-grid uk-grid-divider uk-flex-right">
<ng-container *ngIf="!isPortalAdministrator">
<div *ngIf="check.page.top || check.page.bottom || check.page.left || check.page.right">
<div class="uk-padding-small uk-padding-remove-horizontal">
<a class="uk-button uk-button-link"
[queryParams]="{pageId: check.page._id}"
routerLink="../helptexts">
Manage page help texts
<span *ngIf="pageHelpContentsCount[check.page._id]">({{pageHelpContentsCount[check.page._id]}})</span>
</a>
</div>
</div>
<div *ngIf="pageWithDivIds.includes(check.page._id)">
<div class="uk-padding-small uk-padding-remove-horizontal">
<a class="uk-button uk-button-link"
[queryParams]="{ pageId: check.page._id}"
routerLink="../classContents">Manage class help texts
<span *ngIf="pageClassContentsCount[check.page._id]">({{pageClassContentsCount[check.page._id]}})</span>
</a>
</div>
</div>
<div>
<div class="uk-padding-small uk-padding-remove-horizontal">
<mat-slide-toggle [checked]="check.page.isEnabled"
(change)="($event.source.checked = check.page.isEnabled);togglePages(!check.page.isEnabled,[check.page._id])"
uk-tooltip="title:<div><div class='uk-text-bold '>Disable a page to hide it from community dashboard portal.</div><div class=' uk-margin-top'>If the page is disabled, a message 'Can't find that page' will appear in case the url of that page is loaded. If the disabled page belongs to the menu, the link will be removed from menu, too.</div></div>">
<span class="uk-text-small">Enable</span>
</mat-slide-toggle>
</div>
</div>
</ng-container>
<ng-container *ngIf="isPortalAdministrator || (check.page.portalType == properties.adminToolsPortalType && check.page.portalPid == portal)">
<div>
<div class="uk-padding-small uk-padding-remove-horizontal">
<button [disabled]="!portal && check.page.portalPid"
[attr.uk-tooltip]="((!portal && check.page.portalPid)?'This page belongs to ' + check.page.portalPid:null)"
class="uk-button uk-button-link uk-flex uk-flex-middle" (click)="editPage(i)">
<icon name="edit" [flex]="true"></icon>
<span class="uk-margin-xsmall-left"> Edit</span>
</button>
</div>
</div>
<div>
<div class="uk-padding-small uk-padding-remove-horizontal">
<button class="uk-button uk-button-link uk-flex uk-flex-middle"
(click)="confirmDeletePage(check.page._id)">
<icon name="delete" [flex]="true"></icon>
<span class="uk-margin-xsmall-left"> Delete</span>
</button>
</div>
</div>
</ng-container>
</div>
</div>
</div>
</div>
</div>
<div *ngIf="checkboxes.length == 0"
class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-top uk-margin-bottom uk-text-bold">
<div>No pages found</div>
</div>
</div>
</div>
</div>
</div>
<modal-alert #editModal (alertOutput)="pageSaveConfirmed($event)"
[okDisabled]="pageForm && (pageForm.invalid || !pageForm.dirty)" classTitle="uk-background-primary uk-light">
[okDisabled]="pageForm && (pageForm.invalid || !pageForm.dirty)"
classTitle="uk-background-primary uk-light">
<form *ngIf="pageForm" [formGroup]="pageForm" class="uk-grid uk-child-width-1-1" uk-grid>
<div input placeholder="Route" [formInput]="pageForm.get('route')"></div>
<div input placeholder="Name" [formInput]="pageForm.get('name')"></div>
<ng-container *ngIf="isPortalAdministrator">
<div input placeholder="Type" [formInput]="pageForm.get('type')"
type="select" [options]="typeOptions"></div>
<div input placeholder="Add an entity" [formInput]="pageForm.get('entities')"
type="chips" [options]="allEntities"></div>
<div input placeholder="Choose a type" [formInput]="pageForm.get('portalType')"
type="select" [options]="portalUtils.portalTypes"></div>
<div>
<div class="uk-form-label uk-text-bold uk-margin-bottom">Select if this page have helptext at:</div>
<div class="uk-grid uk-grid-small uk-child-width-1-4" uk-grid>
<div>
<label>
<input type="checkbox" class="uk-checkbox" formControlName="top">
<span class="uk-margin-small-left">Top</span>
</label>
</div>
<div>
<label>
<input type="checkbox" class="uk-checkbox" formControlName="right">
<span class="uk-margin-small-left">Right</span>
</label>
</div>
<div>
<label>
<input type="checkbox" class="uk-checkbox" formControlName="bottom">
<span class="uk-margin-small-left">Bottom</span>
</label>
</div>
<div>
<label>
<input type="checkbox" class="uk-checkbox" formControlName="left">
<span class="uk-margin-small-left">Left</span>
</label>
</div>
</div>
<div class="uk-text-danger uk-margin-top">
By disabling a position, all contents in this position will be deleted.
</div>
</div>
</ng-container>
<ng-container *ngIf="isPortalAdministrator">
<div input placeholder="Type" [formInput]="pageForm.get('type')"
type="select" [options]="typeOptions"></div>
<div input placeholder="Add an entity" [formInput]="pageForm.get('entities')"
type="chips" [options]="allEntities"></div>
<div input placeholder="Choose a type" [formInput]="pageForm.get('portalType')"
type="select" [options]="portalUtils.portalTypes"></div>
<div>
<div class="uk-form-label uk-text-bold uk-margin-bottom">Select if this page have helptext at:</div>
<div class="uk-grid uk-grid-small uk-child-width-1-4" uk-grid>
<div>
<label>
<input type="checkbox" class="uk-checkbox" formControlName="top">
<span class="uk-margin-small-left">Top</span>
</label>
</div>
<div>
<label>
<input type="checkbox" class="uk-checkbox" formControlName="right">
<span class="uk-margin-small-left">Right</span>
</label>
</div>
<div>
<label>
<input type="checkbox" class="uk-checkbox" formControlName="bottom">
<span class="uk-margin-small-left">Bottom</span>
</label>
</div>
<div>
<label>
<input type="checkbox" class="uk-checkbox" formControlName="left">
<span class="uk-margin-small-left">Left</span>
</label>
</div>
</div>
<div class="uk-text-danger uk-margin-top">
By disabling a position, all contents in this position will be deleted.
</div>
</div>
</ng-container>
</form>
</modal-alert>
<modal-alert #deleteModal [overflowBody]="false" (alertOutput)="confirmedDeletePages($event)" classTitle="uk-background-primary uk-light"></modal-alert>
<modal-alert #deleteModal [overflowBody]="false" (alertOutput)="confirmedDeletePages($event)"
classTitle="uk-background-primary uk-light"></modal-alert>

View File

@ -95,6 +95,7 @@ export class PagesComponent implements OnInit {
}
this.portal = (this.route.snapshot.data.portal) ? this.route.snapshot.data.portal : this.route.snapshot.params[this.route.snapshot.data.param];
if (this.route.snapshot.data.portal) {
this.name = StringUtils.capitalize(this.portal);
this.title.setTitle(StringUtils.capitalize(this.portal) + ' | Pages');
} else if (this.route.snapshot.params[this.route.snapshot.data.param]) {
if(this.route.snapshot.data.param === 'stakeholder') {

View File

@ -1,8 +1,10 @@
<div page-content (stickyEmitter)="stickyPageHeader = $event">
<div header>
<div class="uk-flex uk-flex-middle uk-margin-top info" [class.uk-active]="stickyPageHeader">
<img src="assets/common-assets/placeholder.png" class="uk-margin-right">
<div>
<div class="uk-margin-remove uk-text-background uk-text-bold uk-h6">Admin Dashboard</div>
<div class="uk-margin-remove uk-text-background uk-text-bold uk-h6">Admin Dashboard - Manage Portals</div>
<h1 class="uk-h4 uk-margin-remove">Super Admin</h1>
</div>
</div>
<div class="uk-margin uk-margin-remove-bottom">
@ -14,7 +16,7 @@
<loading></loading>
</div>
<ng-container *ngIf="!showLoading">
<div class="uk-grid uk-flex-middle uk-margin-top uk-margin-medium-bottom" uk-grid>
<div class="uk-grid uk-flex-middle uk-margin-top" uk-grid>
<div class="uk-width-1-1">
<ul class="uk-subnav uk-subnav-pill">
<li [class.uk-active]="filterForm.get('type').value === 'all'" class="uk-margin-small-bottom"><a
@ -29,19 +31,6 @@
<div class="uk-width-1-1 uk-flex uk-flex-right@m uk-flex-center uk-flex-wrap uk-flex-middle uk-grid" uk-grid>
<div search-input [expandable]="true" [searchControl]="filterForm.get('keyword')" searchInputClass="outer" placeholder="Search portal"
[bordered]="true" colorClass="uk-text-secondary" class="uk-width-1-3@xl uk-width-2-5@l uk-width-1-2@m uk-width-1-1"></div>
<div>
<button class="uk-button uk-button-secondary" [class.uk-disabled]="getSelectedPortals().length == 0" [disabled]="getSelectedPortals().length == 0">
Bulk Actions ({{getSelectedPortals().length}})
</button>
<div uk-dropdown="mode: click">
<ul class="uk-nav uk-dropdown-nav"
[attr.uk-tooltip]="getSelectedPortals().length == 0 ? 'pos:left; cls: uk-active' : 'cls: uk-invisible'"
title="Select at least one portal">
<li><a [class]="getSelectedPortals().length == 0 ? 'uk-disabled' : ''"
(click)="confirmDeleteSelectedPortals()"><i></i> Delete </a></li>
</ul>
</div>
</div>
<div>
<button class="uk-button uk-button-default uk-flex uk-flex-middle" (click)="newPortal()">
<icon name="add" [flex]="true"></icon>
@ -50,40 +39,60 @@
</div>
</div>
</div>
<table *ngIf="checkboxes.length > 0" class="uk-table uk-table-striped">
<thead>
<tr>
<th><input id="allCommunityCheckbox" type="checkbox" class="uk-checkbox" (change)="toggleCheckBoxes($event)"></th>
<th>Name</th>
<th>Type</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let check of checkboxes; let i=index">
<td><input id="{{check.portal._id}}" class="uk-checkbox" type="checkbox"
name="communitiescb[]" value="{{check.portal._id}}" [(ngModel)]="check.checked">
</td>
<td>
<div class="name" href="#">{{check.portal.name}}</div>
</td>
<td>
<div class="type" href="#">{{check.portal.type}}</div>
</td>
<td>
<div class="actions" href="#">
<icon class="clickable" name="edit" (click)="editPortal(i)"></icon>
<icon class="clickable uk-margin-small-left" [customClass]="'uk-text-danger'" name="delete" (click)="confirmDeletePortal(check.portal._id)"></icon>
</div>
</td>
<div class="uk-section">
<table *ngIf="checkboxes.length > 0" class="uk-table uk-table-striped">
<thead>
<tr class="uk-child-width-1-4">
<th>
<label>
<input id="checkAll" type="checkbox" (click)="toggleCheckBoxes($event)" class="uk-checkbox"
[ngModel]="getSelectedPortals().length ==checkboxes.length"/>
</label>
<span class="uk-margin-left">
<button class="uk-button uk-button-link" [class.uk-disabled]="getSelectedPortals().length == 0" [disabled]="getSelectedPortals().length == 0">
Bulk Actions ({{getSelectedPortals().length}})
</button>
<div uk-dropdown="mode: click">
<ul class="uk-nav uk-dropdown-nav"
[attr.uk-tooltip]="getSelectedPortals().length == 0 ? 'pos:left; cls: uk-active' : 'cls: uk-invisible'"
title="Select at least one entity">
<li>
<a (click)="confirmDeleteSelectedPortals()"><i></i>Delete</a>
</li>
</ul>
</div>
</span>
</th>
<th>Name</th>
<th>Type</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let check of checkboxes; let i=index">
<td><input id="{{check.portal._id}}" class="uk-checkbox" type="checkbox"
name="communitiescb[]" value="{{check.portal._id}}" [(ngModel)]="check.checked">
</td>
<td>
<div class="name" href="#">{{check.portal.name}}</div>
</td>
<td>
<div class="type" href="#">{{check.portal.type}}</div>
</td>
<td>
<div class="actions" href="#">
<icon class="clickable" name="edit" [customClass]="'uk-text-primary'" (click)="editPortal(i)"></icon>
<icon class="clickable uk-margin-small-left" [customClass]="'uk-text-danger'" name="delete" (click)="confirmDeletePortal(check.portal._id)"></icon>
</div>
</td>
</tr>
</tr>
</tbody>
</table>
<div *ngIf="checkboxes.length == 0"
class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-bottom uk-text-bold">
<div>No portals found</div>
</tbody>
</table>
<div *ngIf="checkboxes.length == 0"
class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-bottom uk-text-bold">
<div>No portals found</div>
</div>
</div>
</ng-container>
</div>