|
|
|
@ -15,143 +15,134 @@ |
|
|
|
limitations under the License. |
|
|
|
|
|
|
|
--> |
|
|
|
<form [formGroup]="statesFormGroup" (ngSubmit)="save()" style="width: 750px;"> |
|
|
|
<mat-toolbar color="primary"> |
|
|
|
<h2 translate>dashboard.manage-states</h2> |
|
|
|
<span class="flex-1"></span> |
|
|
|
<button mat-icon-button |
|
|
|
(click)="cancel()" |
|
|
|
type="button"> |
|
|
|
<mat-icon class="material-icons">close</mat-icon> |
|
|
|
</button> |
|
|
|
</mat-toolbar> |
|
|
|
<mat-progress-bar color="warn" mode="indeterminate" *ngIf="isLoading$ | async"> |
|
|
|
</mat-progress-bar> |
|
|
|
<div mat-dialog-content> |
|
|
|
<fieldset [disabled]="isLoading$ | async"> |
|
|
|
<div class="manage-dashboard-states"> |
|
|
|
<div class="tb-entity-table"> |
|
|
|
<div class="tb-entity-table-content flex flex-col"> |
|
|
|
<mat-toolbar class="mat-mdc-table-toolbar" [class.!hidden]="textSearchMode"> |
|
|
|
<div class="mat-toolbar-tools"> |
|
|
|
<span class="tb-entity-table-title" translate>dashboard.states</span> |
|
|
|
<span class="flex-1"></span> |
|
|
|
<button mat-icon-button [disabled]="isLoading$ | async" |
|
|
|
type="button" |
|
|
|
(click)="addState($event)" |
|
|
|
matTooltip="{{ 'dashboard.add-state' | translate }}" |
|
|
|
matTooltipPosition="above"> |
|
|
|
<mat-icon>add</mat-icon> |
|
|
|
</button> |
|
|
|
<button mat-icon-button [disabled]="isLoading$ | async" (click)="enterFilterMode()" |
|
|
|
type="button" |
|
|
|
matTooltip="{{ 'action.search' | translate }}" |
|
|
|
matTooltipPosition="above"> |
|
|
|
<mat-icon>search</mat-icon> |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
</mat-toolbar> |
|
|
|
<mat-toolbar class="mat-mdc-table-toolbar" [class.!hidden]="!textSearchMode"> |
|
|
|
<div class="mat-toolbar-tools"> |
|
|
|
<button mat-icon-button |
|
|
|
type="button" |
|
|
|
matTooltip="{{ 'dashboard.search-states' | translate }}" |
|
|
|
matTooltipPosition="above"> |
|
|
|
<mat-icon>search</mat-icon> |
|
|
|
</button> |
|
|
|
<mat-form-field class="flex-1"> |
|
|
|
<mat-label> </mat-label> |
|
|
|
<input #searchInput matInput |
|
|
|
[(ngModel)]="pageLink.textSearch" |
|
|
|
[ngModelOptions]="{standalone: true}" |
|
|
|
placeholder="{{ 'dashboard.search-states' | translate }}"/> |
|
|
|
</mat-form-field> |
|
|
|
<button mat-icon-button (click)="exitFilterMode()" |
|
|
|
type="button" |
|
|
|
matTooltip="{{ 'action.close' | translate }}" |
|
|
|
matTooltipPosition="above"> |
|
|
|
<mat-icon>close</mat-icon> |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
</mat-toolbar> |
|
|
|
<div class="table-container"> |
|
|
|
<table mat-table [dataSource]="dataSource" |
|
|
|
matSort [matSortActive]="pageLink.sortOrder.property" [matSortDirection]="pageLink.sortDirection()" matSortDisableClear> |
|
|
|
<ng-container matColumnDef="name"> |
|
|
|
<mat-header-cell *matHeaderCellDef mat-sort-header style="width: 60%"> {{ 'dashboard.state-name' | translate }} </mat-header-cell> |
|
|
|
<mat-cell *matCellDef="let state"> |
|
|
|
{{ state.name }} |
|
|
|
</mat-cell> |
|
|
|
</ng-container> |
|
|
|
<ng-container matColumnDef="id"> |
|
|
|
<mat-header-cell *matHeaderCellDef mat-sort-header style="width: 40%"> {{ 'dashboard.state-id' | translate }} </mat-header-cell> |
|
|
|
<mat-cell *matCellDef="let state"> |
|
|
|
{{ state.id }} |
|
|
|
</mat-cell> |
|
|
|
</ng-container> |
|
|
|
<ng-container matColumnDef="root"> |
|
|
|
<mat-header-cell *matHeaderCellDef mat-sort-header style="width: 80px"> {{ 'dashboard.is-root-state' | translate }} </mat-header-cell> |
|
|
|
<mat-cell *matCellDef="let state"> |
|
|
|
<mat-icon class="material-icons mat-icon">{{state.root ? 'check_box' : 'check_box_outline_blank'}}</mat-icon> |
|
|
|
</mat-cell> |
|
|
|
</ng-container> |
|
|
|
<ng-container matColumnDef="actions" stickyEnd> |
|
|
|
<mat-header-cell *matHeaderCellDef style="min-width: 120px; max-width: 120px; width: 120px"> |
|
|
|
</mat-header-cell> |
|
|
|
<mat-cell *matCellDef="let state"> |
|
|
|
<div class="flex flex-1 flex-row"> |
|
|
|
<button mat-icon-button [disabled]="isLoading$ | async" |
|
|
|
type="button" |
|
|
|
matTooltip="{{ 'dashboard.edit-state' | translate }}" |
|
|
|
matTooltipPosition="above" |
|
|
|
(click)="editState($event, state)"> |
|
|
|
<mat-icon>edit</mat-icon> |
|
|
|
</button> |
|
|
|
<button mat-icon-button [disabled]="isLoading$ | async" |
|
|
|
type="button" |
|
|
|
matTooltip="{{ 'dashboard.duplicate-state-action' | translate }}" |
|
|
|
matTooltipPosition="above" |
|
|
|
(click)="duplicateState($event, state)"> |
|
|
|
<mat-icon>content_copy</mat-icon> |
|
|
|
</button> |
|
|
|
<button [class.!hidden]="state.root" mat-icon-button [disabled]="isLoading$ | async" |
|
|
|
type="button" |
|
|
|
matTooltip="{{ 'dashboard.delete-state' | translate }}" |
|
|
|
matTooltipPosition="above" |
|
|
|
(click)="deleteState($event, state)"> |
|
|
|
<mat-icon>delete</mat-icon> |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
</mat-cell> |
|
|
|
</ng-container> |
|
|
|
<mat-header-row class="mat-row-select" *matHeaderRowDef="displayedColumns; sticky: true"></mat-header-row> |
|
|
|
<mat-row class="mat-row-select" |
|
|
|
*matRowDef="let state; columns: displayedColumns;"></mat-row> |
|
|
|
</table> |
|
|
|
<span [class.!hidden]="(dataSource.isEmpty() | async) === false" |
|
|
|
class="no-data-found flex items-center justify-center" translate>{{ 'dashboard.no-states-text' }}</span> |
|
|
|
</div> |
|
|
|
<mat-divider></mat-divider> |
|
|
|
<mat-paginator [length]="dataSource.total() | async" |
|
|
|
[pageIndex]="pageLink.page" |
|
|
|
[pageSize]="pageLink.pageSize" |
|
|
|
[pageSizeOptions]="[5, 10, 15]"></mat-paginator> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<mat-toolbar color="primary"> |
|
|
|
<h2 translate>dashboard.manage-states</h2> |
|
|
|
<span class="flex-1"></span> |
|
|
|
<button mat-icon-button |
|
|
|
(click)="cancel()" |
|
|
|
type="button"> |
|
|
|
<mat-icon class="material-icons">close</mat-icon> |
|
|
|
</button> |
|
|
|
</mat-toolbar> |
|
|
|
<div mat-dialog-content class="manage-dashboard-states"> |
|
|
|
<div class="tb-entity-table-content flex flex-col"> |
|
|
|
<mat-toolbar class="mat-mdc-table-toolbar" [class.!hidden]="textSearchMode"> |
|
|
|
<div class="mat-toolbar-tools"> |
|
|
|
<span class="tb-entity-table-title" translate>dashboard.states</span> |
|
|
|
<span class="flex-1"></span> |
|
|
|
<button mat-icon-button [disabled]="isLoading$ | async" |
|
|
|
type="button" |
|
|
|
(click)="addState($event)" |
|
|
|
matTooltip="{{ 'dashboard.add-state' | translate }}" |
|
|
|
matTooltipPosition="above"> |
|
|
|
<mat-icon>add</mat-icon> |
|
|
|
</button> |
|
|
|
<button mat-icon-button [disabled]="isLoading$ | async" (click)="enterFilterMode()" |
|
|
|
type="button" |
|
|
|
matTooltip="{{ 'action.search' | translate }}" |
|
|
|
matTooltipPosition="above"> |
|
|
|
<mat-icon>search</mat-icon> |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
</fieldset> |
|
|
|
</div> |
|
|
|
<div mat-dialog-actions class="flex items-center justify-end"> |
|
|
|
<button mat-button color="primary" |
|
|
|
type="button" |
|
|
|
[disabled]="(isLoading$ | async)" |
|
|
|
(click)="cancel()" cdkFocusInitial> |
|
|
|
{{ 'action.cancel' | translate }} |
|
|
|
</button> |
|
|
|
<button mat-raised-button color="primary" |
|
|
|
type="submit" |
|
|
|
[disabled]="(isLoading$ | async) || statesFormGroup.invalid || !statesFormGroup.dirty"> |
|
|
|
{{ 'action.save' | translate }} |
|
|
|
</button> |
|
|
|
</mat-toolbar> |
|
|
|
<mat-toolbar class="mat-mdc-table-toolbar" [class.!hidden]="!textSearchMode"> |
|
|
|
<div class="mat-toolbar-tools"> |
|
|
|
<button mat-icon-button |
|
|
|
type="button" |
|
|
|
matTooltip="{{ 'dashboard.search-states' | translate }}" |
|
|
|
matTooltipPosition="above"> |
|
|
|
<mat-icon>search</mat-icon> |
|
|
|
</button> |
|
|
|
<mat-form-field class="flex-1"> |
|
|
|
<mat-label> </mat-label> |
|
|
|
<input #searchInput matInput |
|
|
|
[(ngModel)]="pageLink.textSearch" |
|
|
|
[ngModelOptions]="{standalone: true}" |
|
|
|
placeholder="{{ 'dashboard.search-states' | translate }}"/> |
|
|
|
</mat-form-field> |
|
|
|
<button mat-icon-button (click)="exitFilterMode()" |
|
|
|
type="button" |
|
|
|
matTooltip="{{ 'action.close' | translate }}" |
|
|
|
matTooltipPosition="above"> |
|
|
|
<mat-icon>close</mat-icon> |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
</mat-toolbar> |
|
|
|
<div class="table-container"> |
|
|
|
<table mat-table [dataSource]="dataSource" |
|
|
|
matSort [matSortActive]="pageLink.sortOrder.property" [matSortDirection]="pageLink.sortDirection()" matSortDisableClear> |
|
|
|
<ng-container matColumnDef="name"> |
|
|
|
<mat-header-cell *matHeaderCellDef mat-sort-header style="width: 60%"> {{ 'dashboard.state-name' | translate }} </mat-header-cell> |
|
|
|
<mat-cell *matCellDef="let state"> |
|
|
|
{{ state.name }} |
|
|
|
</mat-cell> |
|
|
|
</ng-container> |
|
|
|
<ng-container matColumnDef="id"> |
|
|
|
<mat-header-cell *matHeaderCellDef mat-sort-header style="width: 40%"> {{ 'dashboard.state-id' | translate }} </mat-header-cell> |
|
|
|
<mat-cell *matCellDef="let state"> |
|
|
|
{{ state.id }} |
|
|
|
</mat-cell> |
|
|
|
</ng-container> |
|
|
|
<ng-container matColumnDef="root"> |
|
|
|
<mat-header-cell *matHeaderCellDef mat-sort-header style="width: 80px"> {{ 'dashboard.is-root-state' | translate }} </mat-header-cell> |
|
|
|
<mat-cell *matCellDef="let state"> |
|
|
|
<mat-icon class="material-icons mat-icon">{{state.root ? 'check_box' : 'check_box_outline_blank'}}</mat-icon> |
|
|
|
</mat-cell> |
|
|
|
</ng-container> |
|
|
|
<ng-container matColumnDef="actions" stickyEnd> |
|
|
|
<mat-header-cell *matHeaderCellDef style="min-width: 120px; max-width: 120px; width: 120px"> |
|
|
|
</mat-header-cell> |
|
|
|
<mat-cell *matCellDef="let state"> |
|
|
|
<div class="flex flex-1 flex-row"> |
|
|
|
<button mat-icon-button [disabled]="isLoading$ | async" |
|
|
|
type="button" |
|
|
|
matTooltip="{{ 'dashboard.edit-state' | translate }}" |
|
|
|
matTooltipPosition="above" |
|
|
|
(click)="editState($event, state)"> |
|
|
|
<mat-icon>edit</mat-icon> |
|
|
|
</button> |
|
|
|
<button mat-icon-button [disabled]="isLoading$ | async" |
|
|
|
type="button" |
|
|
|
matTooltip="{{ 'dashboard.duplicate-state-action' | translate }}" |
|
|
|
matTooltipPosition="above" |
|
|
|
(click)="duplicateState($event, state)"> |
|
|
|
<mat-icon>content_copy</mat-icon> |
|
|
|
</button> |
|
|
|
<button [class.!hidden]="state.root" mat-icon-button [disabled]="isLoading$ | async" |
|
|
|
type="button" |
|
|
|
matTooltip="{{ 'dashboard.delete-state' | translate }}" |
|
|
|
matTooltipPosition="above" |
|
|
|
(click)="deleteState($event, state)"> |
|
|
|
<mat-icon>delete</mat-icon> |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
</mat-cell> |
|
|
|
</ng-container> |
|
|
|
<mat-header-row class="mat-row-select" *matHeaderRowDef="displayedColumns; sticky: true"></mat-header-row> |
|
|
|
<mat-row class="mat-row-select" |
|
|
|
*matRowDef="let state; columns: displayedColumns;"></mat-row> |
|
|
|
</table> |
|
|
|
<span [class.!hidden]="(dataSource.isEmpty() | async) === false" |
|
|
|
class="no-data-found flex items-center justify-center" translate>{{ 'dashboard.no-states-text' }}</span> |
|
|
|
</div> |
|
|
|
<mat-divider></mat-divider> |
|
|
|
<mat-paginator [length]="dataSource.total() | async" |
|
|
|
[pageIndex]="pageLink.page" |
|
|
|
[pageSize]="pageLink.pageSize" |
|
|
|
[pageSizeOptions]="[5, 10, 15]"></mat-paginator> |
|
|
|
</div> |
|
|
|
</form> |
|
|
|
</div> |
|
|
|
<div mat-dialog-actions class="flex items-center justify-end"> |
|
|
|
<button mat-button color="primary" |
|
|
|
type="button" |
|
|
|
[disabled]="(isLoading$ | async)" |
|
|
|
(click)="cancel()" cdkFocusInitial> |
|
|
|
{{ 'action.cancel' | translate }} |
|
|
|
</button> |
|
|
|
<button mat-raised-button color="primary" |
|
|
|
type="submit" |
|
|
|
(click)="save()" |
|
|
|
[disabled]="(isLoading$ | async) || !isDirty"> |
|
|
|
{{ 'action.save' | translate }} |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
|