Finish UI of class help texts list, edit page/class help content

This commit is contained in:
Konstantinos Triantafyllou 2022-06-27 15:50:21 +03:00
parent beb21be4a0
commit 4625ebf967
12 changed files with 198 additions and 254 deletions

View File

@ -1,78 +1,66 @@
<div page-content> <div page-content (stickyEmitter)="stickyPageHeader = $event">
<div header> <div header>
<div class="uk-margin-top"> <div *ngIf="!showLoading" class="uk-flex uk-flex-middle uk-grid" uk-grid>
<a routerLink="../" [queryParams]=" { 'pageId': pageId }" <div class="uk-width-expand uk-flex uk-flex-middle uk-margin-top uk-margin-bottom info"
class="uk-button uk-button-link uk-text-uppercase uk-flex uk-flex-middle"> [class.uk-active]="stickyPageHeader">
<icon name="west" [flex]="true"></icon> <a routerLink="../" [queryParams]=" { 'pageId': pageId }" class="uk-button uk-button-link uk-margin-right">
<span class="uk-margin-small-left">Go back to class help texts list</span> <icon name="west" ratio="2" [flex]="true"></icon>
</a> </a>
<div>
<div class="uk-margin-remove uk-text-background uk-text-bold uk-h6">
Admin Dashboard - {{pageHelpContent ? 'Update ' : 'Add new '}} class help text
</div>
<h1 class="uk-h4 uk-margin-remove">{{page.name}}<span *ngIf="myForm.dirty" class="uk-text-large"> (unsaved changes)</span></h1>
</div>
</div>
<div class="uk-width-auto uk-text-right@m uk-text-center">
<button class="uk-button uk-button-default uk-margin-right"
(click)="resetCustom()" [class.uk-disabled]="!myForm.dirty"
[disabled]="!myForm.dirty">Reset
</button>
<button class="uk-button uk-button-primary" [class.uk-disabled]="!myForm.dirty || myForm.disabled"
(click)="saveCustom()" [disabled]="!myForm.dirty || myForm.disabled">Save
</button>
</div>
</div> </div>
</div> </div>
<div inner> <div inner>
<div class="uk-card-header"> <div *ngIf="myForm" class="uk-section uk-container uk-container-small">
<div class="uk-flex uk-flex-middle uk-child-width-1-1 uk-child-width-1-2@m uk-grid" uk-grid> <div *ngIf="errorMessage" class="uk-alert uk-alert-danger" role="alert">{{errorMessage}}</div>
<div> <div *ngIf="updateErrorMessage" class="uk-alert uk-alert-danger" role="alert">{{updateErrorMessage}}</div>
<div class="uk-text-small uk-text-muted"> {{pageHelpContent ? 'Update ' : 'Add new '}} class help text</div> <div *ngIf="showLoading" class="uk-position-center">
<div> <loading *ngIf="showLoading"></loading>
<span *ngIf="page" class="uk-text-bold">{{page.name}}</span>
<span *ngIf="myForm.dirty"> (unsaved changes)</span>
</div>
</div>
<div class=" uk-flex uk-flex-right">
<button (click)="resetCustom()" [disabled]="showLoading || !myForm.dirty"
class="uk-button uk-button-secondary outlined uk-margin-small-right">Reset
</button>
<button (click)="saveCustom()" class="uk-button uk-button-secondary uk-margin-small-right"
[disabled]="showLoading || !myForm.dirty || !myForm.valid ">Save
</button>
</div>
</div> </div>
</div> <form [formGroup]="myForm" [class.hidden]="showLoading">
<div class="uk-card uk-card-default uk-position-relative " style="min-height: 60vh"> <div class="uk-width-1-2" *ngIf="classOptions.length > 0" input [formInput]="myForm.get('divId')" placeholder="Select Class" [options]="classOptions" type="select"></div>
<div style="max-height: 60vh" class="uk-padding-large uk-overflow-auto"> <div class="form-group uk-margin-medium-top">
<span class="uk-text-bold uk-margin-small-right">Select Status (Enable/ disable)</span>
<div *ngIf="errorMessage" class="uk-alert uk-alert-danger" role="alert">{{errorMessage}}</div> <mat-slide-toggle [checked]="myForm.get('isActive').value"
<div class="uk-animation-fade uk-width-1-1" role="alert"> (change)="changeStatus()"
<div *ngIf="updateErrorMessage" class="uk-alert uk-alert-danger" role="alert">{{updateErrorMessage}}</div> uk-tooltip="title:<div class='uk-padding-small uk-width-large'><div class='uk-text-bold '> Enable or disable help text to show or hide it from the dashboard</div></div>"
></mat-slide-toggle>
<div *ngIf="showLoading" class="uk-position-center">
<loading *ngIf="showLoading"></loading>
</div>
<form [formGroup]="myForm" [class.hidden]="showLoading">
<div class="uk-grid uk-child-width-1-2 ">
<div *ngIf="classOptions.length > 0" input [formInput]="myForm.get('divId')" placeholder="Select Class" [options]="classOptions" type="select"></div>
</div>
<div class="form-group uk-margin-top">
<span class="uk-text-bold uk-margin-small-right">Select Status (Enable/ disable)</span>
<mat-slide-toggle [checked]="myForm.get('isActive').value"
(change)="changeStatus()"
uk-tooltip="title:<div class='uk-padding-small uk-width-large'><div class='uk-text-bold '> Enable or disable help text to show or hide it from the dashboard</div></div>"
></mat-slide-toggle>
</div>
<div class="form-group uk-margin-large-top"
[ngClass]="{'has-error':!myForm.controls.content.valid &&
myForm.controls.content.dirty}" >
<label class="uk-text-bold">Content</label>
<div class="uk-margin-top">
<ckeditor (change)="contentChanged()"
[readonly]="false"
debounce="500"
[formControl]="myForm.get('content')"
[config]="{ extraAllowedContent: '* [uk-*](*) ; span', disallowedContent: 'script; *[on*]',
removeButtons: 'Save,NewPage,DocProps,Preview,Print,' +
'Form,Checkbox,Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField,' +
'CreateDiv,Flash,PageBreak,' +
'Subscript,Superscript,Anchor,Smiley,Iframe,Styles,Font,About,Language',
extraPlugins: 'divarea'}">
</ckeditor>
</div>
</div>
<input type="hidden" formControlName="_id">
</form>
</div> </div>
</div> <div class="form-group uk-margin-large-top"
[ngClass]="{'has-error':!myForm.controls.content.valid &&
myForm.controls.content.dirty}" >
<label class="uk-text-bold">Content</label>
<div class="uk-margin-top">
<ckeditor (change)="contentChanged()"
[readonly]="false"
debounce="500"
[formControl]="myForm.get('content')"
[config]="{ extraAllowedContent: '* [uk-*](*) ; span', disallowedContent: 'script; *[on*]',
removeButtons: 'Save,NewPage,DocProps,Preview,Print,' +
'Form,Checkbox,Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField,' +
'CreateDiv,Flash,PageBreak,' +
'Subscript,Superscript,Anchor,Smiley,Iframe,Styles,Font,About,Language',
extraPlugins: 'divarea'}">
</ckeditor>
</div>
</div>
<input type="hidden" formControlName="_id">
</form>
</div> </div>
</div> </div>
</div> </div>

View File

@ -32,6 +32,7 @@ export class ClassContentFormComponent implements OnInit {
@Input() updateErrorMessage: string = ''; @Input() updateErrorMessage: string = '';
private subs: Subscription[] = []; private subs: Subscription[] = [];
public pageHelpContent: DivHelpContent; public pageHelpContent: DivHelpContent;
public stickyPageHeader: boolean = false;
constructor(private route: ActivatedRoute, private _router: Router, private _fb: FormBuilder, private _helpContentService: HelpContentService) { constructor(private route: ActivatedRoute, private _router: Router, private _fb: FormBuilder, private _helpContentService: HelpContentService) {
} }

View File

@ -2,7 +2,7 @@
<div header> <div header>
<div *ngIf="!showLoading" class="uk-flex uk-flex-middle uk-margin-top info" <div *ngIf="!showLoading" class="uk-flex uk-flex-middle uk-margin-top info"
[class.uk-active]="stickyPageHeader"> [class.uk-active]="stickyPageHeader">
<a routerLink="../pages/" class="uk-button uk-button-link uk-margin-right"> <a routerLink="../pages" class="uk-button uk-button-link uk-margin-right">
<icon name="west" ratio="2" [flex]="true"></icon> <icon name="west" ratio="2" [flex]="true"></icon>
</a> </a>
<div> <div>

View File

@ -1,7 +1,7 @@
<div page-content (stickyEmitter)="stickyPageHeader = $event"> <div page-content (stickyEmitter)="stickyPageHeader = $event">
<div header> <div header>
<div class="uk-flex uk-flex-middle uk-margin-top info" [class.uk-active]="stickyPageHeader"> <div class="uk-flex uk-flex-middle uk-margin-top info" [class.uk-active]="stickyPageHeader">
<ng-container *ngIf="showLogo && entity"> <ng-container *ngIf="showLogo">
<img [src]="entity | logoUrl" class="uk-margin-right uk-blend-multiply"> <img [src]="entity | logoUrl" class="uk-margin-right uk-blend-multiply">
</ng-container> </ng-container>
<div> <div>

View File

@ -1,75 +1,68 @@
<div page-content> <div page-content (stickyEmitter)="stickyPageHeader = $event">
<div header> <div header>
<div class="uk-margin-top"> <div *ngIf="!showLoading" class="uk-flex uk-flex-middle uk-grid" uk-grid>
<a routerLink="../" [queryParams]=" { 'pageId': pageId }" <div class="uk-width-expand uk-flex uk-flex-middle uk-margin-top uk-margin-bottom info"
class="uk-button uk-button-link uk-text-uppercase uk-flex uk-flex-middle"> [class.uk-active]="stickyPageHeader">
<icon name="west" [flex]="true"></icon> <a routerLink="../" [queryParams]=" { 'pageId': pageId }" class="uk-button uk-button-link uk-margin-right">
<span class="uk-margin-small-left">Go back to page help texts list</span> <icon name="west" ratio="2" [flex]="true"></icon>
</a> </a>
<div>
<div class="uk-margin-remove uk-text-background uk-text-bold uk-h6">
Admin Dashboard - {{pageHelpContent ? 'Update ' : 'Add new '}} page help text
</div>
<h1 class="uk-h4 uk-margin-remove">{{page.name}}<span *ngIf="myForm.dirty" class="uk-text-large"> (unsaved changes)</span></h1>
</div>
</div>
<div class="uk-width-auto uk-text-right@m uk-text-center">
<button class="uk-button uk-button-default uk-margin-right"
(click)="resetCustom()" [class.uk-disabled]="!myForm.dirty"
[disabled]="!myForm.dirty">Reset
</button>
<button class="uk-button uk-button-primary" [class.uk-disabled]="!myForm.dirty || myForm.disabled"
(click)="saveCustom()" [disabled]="!myForm.dirty || myForm.disabled">Save
</button>
</div>
</div> </div>
</div> </div>
<div inner> <div inner>
<div class="uk-card-header"> <div *ngIf="myForm" class="uk-section uk-container uk-container-small">
<div class="uk-flex uk-flex-middle uk-child-width-1-1 uk-child-width-1-2@m uk-grid" uk-grid> <div *ngIf="showLoading" class="uk-position-center">
<div> <loading *ngIf="showLoading"></loading>
<div class="uk-text-small uk-text-muted"> {{pageHelpContent ? 'Update ' : 'Add new '}} page help text</div>
<div>
<span *ngIf="page" class="uk-text-bold">{{page.name}}</span>
<span *ngIf="myForm.dirty"> (unsaved changes)</span>
</div>
</div>
<div class=" uk-flex uk-flex-right">
<button (click)="resetCustom()" [disabled]="showLoading || !myForm.dirty"
class="uk-button uk-button-secondary outlined uk-margin-small-right">Reset
</button>
<button (click)="saveCustom()" class="uk-button uk-button-secondary uk-margin-small-right"
[disabled]="showLoading || !myForm.dirty || myForm.invalid ">Save
</button>
</div>
</div> </div>
</div> <form [formGroup]="myForm" [class.hidden]="showLoading">
<div class="uk-card uk-card-default uk-position-relative " style="min-height: 60vh"> <div class="uk-grid uk-child-width-1-2">
<div style="max-height: 60vh" class="uk-padding-large uk-overflow-auto"> <div *ngIf="placementsOptions.length > 0" input [formInput]="myForm.get('placement')"
<div class="uk-animation-fade uk-width-1-1" role="alert"> placeholder="Select placement" [options]="placementsOptions" type="select"></div>
<div *ngIf="showLoading" class="uk-position-center"> <div input [formInput]="myForm.get('order')" placeholder="Select order" [options]="orderOptions" type="select"></div>
<loading *ngIf="showLoading"></loading> </div>
<div class="form-group uk-margin-medium-top">
<span class="uk-text-bold uk-margin-small-right">Select Status (Enable/ disable)</span>
<mat-slide-toggle [checked]="myForm.get('isActive').value"
(change)="changeStatus()"
uk-tooltip="title:<div class='uk-padding-small uk-width-large'><div class='uk-text-bold '> Enable or disable help text to show or hide it from the dashboard</div></div>"
></mat-slide-toggle>
</div>
<div class="form-group uk-margin-large-top"
[ngClass]="{'has-error':!myForm.controls.content.valid &&
myForm.controls.content.dirty}">
<label class="uk-text-bold">Content</label>
<div class="uk-margin-top">
<ckeditor (change)="contentChanged()"
[readonly]="false"
debounce="500"
[formControl]="myForm.get('content')"
[config]="{ extraAllowedContent: '* [uk-*](*) ; span', disallowedContent: 'script; *[on*]',
removeButtons: 'Save,NewPage,DocProps,Preview,Print,' +
'Form,Checkbox,Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField,' +
'CreateDiv,Flash,PageBreak,' +
'Subscript,Superscript,Anchor,Smiley,Iframe,Styles,Font,About,Language',
extraPlugins: 'divarea'}">
</ckeditor>
</div> </div>
<form [formGroup]="myForm" [class.hidden]="showLoading">
<div class="uk-grid uk-child-width-1-2 ">
<div *ngIf="placementsOptions.length > 0" input [formInput]="myForm.get('placement')"
placeholder="Select placement" [options]="placementsOptions" type="select"></div>
<div input [formInput]="myForm.get('order')" placeholder="Select order" [options]="orderOptions" type="select"></div>
</div>
<div class="form-group uk-margin-top">
<div class="uk-text-bold uk-margin-medium-bottom">Select Status (Enable/ disable)</div>
<mat-slide-toggle [checked]="myForm.get('isActive').value"
(change)="changeStatus()"
uk-tooltip="title:<div class='uk-padding-small uk-width-large'><div class='uk-text-bold '> Enable or disable help text to show or hide it from the dashboard</div></div>"
></mat-slide-toggle>
</div>
<div class="form-group uk-margin-medium-top"
[ngClass]="{'has-error':!myForm.controls.content.valid &&
myForm.controls.content.dirty}">
<label class="uk-text-bold">Content</label>
<div class="uk-margin-top">
<ckeditor (change)="contentChanged()"
[readonly]="false"
debounce="500"
[formControl]="myForm.get('content')"
[config]="{ extraAllowedContent: '* [uk-*](*) ; span', disallowedContent: 'script; *[on*]',
removeButtons: 'Save,NewPage,DocProps,Preview,Print,' +
'Form,Checkbox,Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField,' +
'CreateDiv,Flash,PageBreak,' +
'Subscript,Superscript,Anchor,Smiley,Iframe,Styles,Font,About,Language',
extraPlugins: 'divarea'}">
</ckeditor>
</div>
</div>
<input type="hidden" formControlName="_id">
</form>
</div> </div>
</div> <input type="hidden" formControlName="_id">
</form>
</div> </div>
</div> </div>
</div> </div>

View File

@ -28,6 +28,7 @@ export class PageContentFormComponent implements OnInit {
public showLoading: boolean = true; public showLoading: boolean = true;
private subs: Subscription[] = []; private subs: Subscription[] = [];
public pageHelpContent: PageHelpContent; public pageHelpContent: PageHelpContent;
public stickyPageHeader: boolean = false;
constructor(private route: ActivatedRoute, private _router: Router, private _fb: FormBuilder, private _helpContentService: HelpContentService) { constructor(private route: ActivatedRoute, private _router: Router, private _fb: FormBuilder, private _helpContentService: HelpContentService) {
} }

View File

@ -1,56 +1,15 @@
<div page-content> <div page-content (stickyEmitter)="stickyPageHeader = $event">
<div header> <div header>
<div class="uk-text-bold"> <div *ngIf="!showLoading" class="uk-flex uk-flex-middle uk-margin-top info"
<span *ngIf="selectedPageId && page">{{page.name}}</span> [class.uk-active]="stickyPageHeader">
</div> <a routerLink="../pages" class="uk-button uk-button-link uk-margin-right">
<div class="uk-margin-top"> <icon name="west" ratio="2" [flex]="true"></icon>
<a routerLink="../pages/" class="uk-text-secondary uk-text-uppercase uk-text-bold uk-text-small">
<span class="uk-icon-button small uk-icon uk-button-secondary">
<icon name="west"></icon>
</span>
<span class="space">
Back to pages list
</span>
</a> </a>
</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 #searchInputComponent search-input [control]="filterForm" [showSearch]="false" placeholder="Search helptext"
[selected]="selectedKeyword" (closeEmitter)="onSearchClose()" (resetEmitter)="reset()"
[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> <div>
<a (click)="newPageContent()" <div class="uk-margin-remove uk-text-background uk-text-bold uk-h6">
class="uk-flex uk-flex-middle uk-text-uppercase"> Admin Dashboard <span *ngIf="selectedPageId && page"> - Manage page help texts</span>
<button class="large uk-icon-button uk-button-secondary"> </div>
<icon name="add"></icon> <h1 class="uk-h4 uk-margin-remove">{{page.name}}</h1>
</button>
<button class="uk-button uk-button-link uk-margin-small-left uk-text-secondary">Add new page help text
</button>
</a>
</div>
</div>
<div *ngIf="!showLoading && checkboxes.length > 0"
class="uk-padding uk-flex uk-padding-remove-bottom uk-padding-remove-top uk-margin-remove-top uk-margin-small-bottom uk-display-inline"
[attr.uk-tooltip]="getSelectedPageHelpContents().length == 0 ? 'pos:left; cls: uk-active' : 'cls: uk-invisible'"
title="Select at least one help text"><input id="checkAll" type="checkbox" (click)="selectAll()"
[ngModel]="getSelectedPageHelpContents().length ==checkboxes.length"/>
<span *ngIf="getSelectedPageHelpContents().length > 0" class="uk-margin-left uk-text-muted">
{{getSelectedPageHelpContents().length}} pages selected </span>
<a class="uk-margin-left">Actions </a>
<div uk-dropdown="mode: click">
<ul class="uk-nav uk-dropdown-nav"
[attr.uk-tooltip]="getSelectedPageHelpContents().length == 0 ? 'pos:left; cls: uk-active' : 'cls: uk-invisible'"
title="Select at least one help text">
<li><a [class]="getSelectedPageHelpContents().length == 0 ? 'uk-disabled' : ''"
(click)="togglePageHelpContents(true,getSelectedPageHelpContents())"><i></i> Enable
</a></li>
<li><a [class]="getSelectedPageHelpContents().length == 0 ? 'uk-disabled' : ''"
(click)="togglePageHelpContents(false,getSelectedPageHelpContents())"><i></i> Disable
</a>
</li>
<li><a [class]="getSelectedPageHelpContents().length == 0 ? 'uk-disabled' : ''"
(click)="confirmDeleteSelectedPageHelpContents()"><i></i> Delete </a></li>
</ul>
</div> </div>
</div> </div>
</div> </div>
@ -59,62 +18,72 @@
<loading></loading> <loading></loading>
</div> </div>
<div *ngIf="!showLoading"> <div *ngIf="!showLoading">
<div *ngIf="checkboxes.length > 0" class="uk-margin-medium-bottom"> <div class="uk-margin-top uk-margin-medium-bottom uk-flex-right@m uk-flex-center uk-flex-middle uk-grid" uk-grid>
<ul class="uk-list pages"> <div search-input [expandable]="true" [searchControl]="filterForm" searchInputClass="outer" placeholder="Search helptext" class="uk-width-1-3@xl uk-width-2-5@l uk-width-1-2@m uk-width-1-1">
<li *ngFor="let check of checkboxes; let i=index" class="uk-card uk-card-default uk-margin-bottom"> </div>
<div class="uk-grid uk-grid-divider uk-padding" uk-grid> <div>
<div class="uk-width-4-5 "> <a (click)="newPageContent()"
<div class="uk-grid uk-flex uk-flex-middle"> class="uk-flex uk-flex-middle uk-button uk-button-default">
<div><input id="{{check.pageHelpContent._id}}" class="uk-checkbox" type="checkbox" <icon [flex]="true" name="add"></icon>
name="entitiescb[]" value="{{check.pageHelpContent._id}}" [(ngModel)]="check.checked"> <span class="uk-margin-small-left">Add page help text</span>
</div> </a>
<div class="uk-width-expand uk-margin-medium-bottom"> </div>
<div *ngIf="!selectedPageId"> </div>
<div class="page" href="#">{{check.pageHelpContent.page.name}}</div> <div class="uk-section">
<div *ngIf="checkboxes.length > 0">
<div class="uk-grid uk-child-width-1-2@l uk-child-width-1-1" uk-height-match=".uk-card-body" uk-grid>
<div *ngFor="let check of checkboxes; let i=index">
<div class="uk-card uk-card-default uk-margin-bottom">
<div class="uk-card-body">
<div class="uk-margin-medium-bottom">
<div class="multi-line-ellipsis lines-2">
<p>{{check.pageHelpContent.content | htmlToString}}</p>
</div> </div>
<div class="content multi-line-ellipsis lines-2"> <div class="uk-text-small">
<p>{{check.pageHelpContent.content|htmlToString}}</p></div> <span class="uk-text-meta">Placement: </span>{{check.pageHelpContent.placement}}
</div>
<div class="uk-grid uk-width-1-1 uk-margin-left">
<div class=" ">
<span class="title">Placement: </span>{{check.pageHelpContent.placement}}
</div> </div>
<div class=" "> <div class="uk-text-small uk-margin-small-top">
<span class="title">Order: </span>{{check.pageHelpContent.order}} <span class="uk-text-meta">Order: </span>{{check.pageHelpContent.order}}
</div>
<div class=" ">
<span class="title uk-margin-small-right">Enable/disable: </span>
<mat-slide-toggle [checked]="check.pageHelpContent.isActive"
(change)="($event.source.checked = check.pageHelpContent.isActive);togglePageHelpContents(!check.pageHelpContent.isActive,[check.pageHelpContent._id])"
uk-tooltip="title:<div class='uk-padding-small uk-width-large'><div class='uk-text-bold '> Enable or disable help text to show or hide it from the dashboard</div></div>"
></mat-slide-toggle>
</div> </div>
</div> </div>
</div> </div>
</div> <div class="uk-card-footer uk-padding-remove-vertical">
<div class="uk-width-1-5"> <div class="uk-grid uk-grid-small uk-flex-nowrap uk-grid-divider uk-flex-right" uk-grid>
<div class="uk-flex uk-flex-center uk-flex-column uk-height-1-1"> <div>
<div class="uk-flex uk-flex-center"> <div class="uk-padding-small uk-padding-remove-horizontal">
<div class="actions" href="#"> <mat-slide-toggle [checked]="check.pageHelpContent.isActive"
<button (click)="editPageHelpContent(check.pageHelpContent._id)" class="uk-button uk-button-secondary uk-margin-top uk-flex uk-flex-middle"> (change)="($event.source.checked = check.pageHelpContent.isActive);togglePageHelpContents(!check.pageHelpContent.isActive,[check.pageHelpContent._id])"
uk-tooltip="title:<div><div class='uk-text-bold '> Enable or disable help text to show or hide it from the dashboard</div></div>">
<span class="uk-text-small">Enable</span>
</mat-slide-toggle>
</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)="editPageHelpContent(check.pageHelpContent._id)">
<icon name="edit" [flex]="true"></icon> <icon name="edit" [flex]="true"></icon>
<span class="uk-margin-small-left">Edit</span> <span class="uk-margin-xsmall-left"> Edit</span>
</button>
<button (click)="confirmDeletePageHelpContent(check.pageHelpContent._id)" class="uk-button uk-button-danger uk-margin-top uk-flex uk-flex-middle">
<icon name="delete" [flex]="true"></icon>
<span class="uk-margin-small-left">Delete</span>
</button> </button>
</div> </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)="confirmDeletePageHelpContent(check.pageHelpContent._id)">
<icon name="delete" [flex]="true"></icon>
<span class="uk-margin-xsmall-left"> Delete</span>
</button>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</li> </div>
</ul> </div>
</div> <div *ngIf="checkboxes.length == 0"
<div *ngIf="checkboxes.length == 0" class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-bottom uk-text-bold">
class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-bottom uk-text-bold"> <div>No page help texts found</div>
<div>No page help texts found</div> </div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -45,6 +45,7 @@ export class PageHelpContentsComponent implements OnInit {
public filterForm: FormControl; public filterForm: FormControl;
private subscriptions: any[] = []; private subscriptions: any[] = [];
public selectedKeyword: string; public selectedKeyword: string;
public stickyPageHeader: boolean = false;
@ViewChild('searchInputComponent') searchInputComponent: SearchInputComponent; @ViewChild('searchInputComponent') searchInputComponent: SearchInputComponent;
constructor(private element: ElementRef, private route: ActivatedRoute, private router: Router, private _helpService: HelpContentService, private _fb: FormBuilder, private sanitizer: DomSanitizer) { constructor(private element: ElementRef, private route: ActivatedRoute, private router: Router, private _helpService: HelpContentService, private _fb: FormBuilder, private sanitizer: DomSanitizer) {

View File

@ -1,7 +1,7 @@
<div page-content (stickyEmitter)="stickyPageHeader = $event"> <div page-content (stickyEmitter)="stickyPageHeader = $event">
<div header> <div header>
<div class="uk-flex uk-flex-middle uk-margin-top info" [class.uk-active]="stickyPageHeader"> <div class="uk-flex uk-flex-middle uk-margin-top info" [class.uk-active]="stickyPageHeader">
<ng-container *ngIf="showLogo && entity"> <ng-container *ngIf="showLogo">
<img [src]="entity | logoUrl" class="uk-margin-right uk-blend-multiply"> <img [src]="entity | logoUrl" class="uk-margin-right uk-blend-multiply">
</ng-container> </ng-container>
<div> <div>

View File

@ -418,25 +418,16 @@ export class PagesComponent implements OnInit {
} }
public togglePages(status: boolean, ids: string[]) { public togglePages(status: boolean, ids: string[]) {
if (!Session.isLoggedIn()) { this.subscriptions.push(this._helpContentService.togglePages(this.portal, ids, status, this.properties.adminToolsAPIURL).subscribe(
this._router.navigate(['/user-info'], { () => {
queryParams: { for (let id of ids) {
'errorCode': LoginErrorCodes.NOT_VALID, let i = this.checkboxes.findIndex(_ => _.page._id == id);
'redirectUrl': this._router.url this.checkboxes[i].page.isEnabled = status;
} }
}); this.applyCheck(false);
} else { },
this.subscriptions.push(this._helpContentService.togglePages(this.portal, ids, status, this.properties.adminToolsAPIURL).subscribe( error => this.handleUpdateError('System error changing the status of the selected page(s)', error)
() => { ));
for (let id of ids) {
let i = this.checkboxes.findIndex(_ => _.page._id == id);
this.checkboxes[i].page.isEnabled = status;
}
this.applyCheck(false);
},
error => this.handleUpdateError('System error changing the status of the selected page(s)', error)
));
}
} }
selectAll() { selectAll() {

View File

@ -9,11 +9,11 @@ import { properties } from 'src/environments/environment';
selector: 'admin-tabs', selector: 'admin-tabs',
template: ` template: `
<ul class="uk-tab" uk-tab> <ul class="uk-tab" uk-tab>
<li *ngIf="isPortalAdmin && !portal" [class.uk-active]="tab === 'portal'"><a routerLink="../portals"><span class="title">Portals</span></a></li> <li *ngIf="isPortalAdmin && !portal" [class.uk-active]="tab === 'portal'"><a routerLink="../portals">Portals</a></li>
<li [class.uk-active]="tab === 'page'"><a routerLink="../pages"><span class="title">Pages</span></a></li> <li [class.uk-active]="tab === 'page'"><a routerLink="../pages">Pages</a></li>
<li [class.uk-active]="tab === 'entity'"><a routerLink="../entities"><span class="title">Entities</span></a></li> <li [class.uk-active]="tab === 'entity'"><a routerLink="../entities">Entities</a></li>
<li *ngIf="env === 'development' && portal && type === 'community'" [class.uk-active]="tab === 'menu'"><a routerLink="../menu"><span class="title">Menu</span></a></li> <li *ngIf="env === 'development' && portal && type === 'community'" [class.uk-active]="tab === 'menu'"><a routerLink="../menu">Menu</a></li>
<li *ngIf="isPortalAdmin && !portal" [class.uk-active]="tab === 'class'"><a routerLink="../classes"><span class="title">Classes</span></a></li> <li *ngIf="isPortalAdmin && !portal" [class.uk-active]="tab === 'class'"><a routerLink="../classes">Classes</a></li>
</ul> </ul>
` `
}) })

View File

@ -311,7 +311,7 @@ export class StringUtils {
} }
public static getLogoUrl(result: Stakeholder | CommunityInfo): string { public static getLogoUrl(result: Stakeholder | CommunityInfo): string {
if(result.logoUrl) { if(result && result.logoUrl) {
return (result.isUpload)?(properties.utilsService + '/download/' + result.logoUrl):result.logoUrl; return (result.isUpload)?(properties.utilsService + '/download/' + result.logoUrl):result.logoUrl;
} else { } else {
return "assets/common-assets/placeholder.png"; return "assets/common-assets/placeholder.png";