UI: Fixed stepper for device and device profile dialog

This commit is contained in:
Artem Dzhereleiko 2023-03-16 11:05:23 +02:00
parent da4d0f93a3
commit e96e355a31
4 changed files with 301 additions and 283 deletions

View File

@ -15,7 +15,6 @@
limitations under the License. limitations under the License.
--> -->
<div>
<mat-toolbar color="primary"> <mat-toolbar color="primary">
<h2 translate>device-profile.add</h2> <h2 translate>device-profile.add</h2>
<span fxFlex></span> <span fxFlex></span>
@ -132,7 +131,8 @@
</mat-step> </mat-step>
</mat-horizontal-stepper> </mat-horizontal-stepper>
</div> </div>
<div mat-dialog-actions fxLayout="row"> <div mat-dialog-actions style="padding: 0">
<div class="dialog-actions-row" fxFlex fxLayout="row" fxLayoutAlign="end center">
<button mat-stroked-button *ngIf="selectedIndex > 0" <button mat-stroked-button *ngIf="selectedIndex > 0"
[disabled]="(isLoading$ | async)" [disabled]="(isLoading$ | async)"
(click)="previousStep()">{{ 'action.back' | translate }}</button> (click)="previousStep()">{{ 'action.back' | translate }}</button>
@ -143,8 +143,8 @@
[disabled]="(isLoading$ | async)" [disabled]="(isLoading$ | async)"
(click)="nextStep()">{{ 'action.next-with-label' | translate:{label: (getFormLabel(this.selectedIndex+1) | translate)} }}</button> (click)="nextStep()">{{ 'action.next-with-label' | translate:{label: (getFormLabel(this.selectedIndex+1) | translate)} }}</button>
</div> </div>
<mat-divider></mat-divider> <mat-divider style="width: 100%"></mat-divider>
<div mat-dialog-actions fxLayout="row" fxLayoutGap="8px" fxLayoutAlign="end"> <div class="dialog-actions-row" fxFlex fxLayout="row" fxLayoutGap="8px" fxLayoutAlign="end center">
<button mat-button <button mat-button
[disabled]="(isLoading$ | async)" [disabled]="(isLoading$ | async)"
(click)="cancel()">{{ 'action.cancel' | translate }}</button> (click)="cancel()">{{ 'action.cancel' | translate }}</button>

View File

@ -15,6 +15,15 @@
*/ */
@import "../../../../../scss/constants"; @import "../../../../../scss/constants";
:host {
height: 100%;
display: grid;
.dialog-actions-row {
padding: 8px;
}
}
:host-context(.tb-fullscreen-dialog .mat-mdc-dialog-container) { :host-context(.tb-fullscreen-dialog .mat-mdc-dialog-container) {
@media #{$mat-lt-sm} { @media #{$mat-lt-sm} {
.mat-mdc-dialog-content { .mat-mdc-dialog-content {

View File

@ -15,7 +15,6 @@
limitations under the License. limitations under the License.
--> -->
<div>
<mat-toolbar color="primary"> <mat-toolbar color="primary">
<h2 translate>device.add-device-text</h2> <h2 translate>device.add-device-text</h2>
<span fxFlex></span> <span fxFlex></span>
@ -180,7 +179,8 @@
</mat-step> </mat-step>
</mat-horizontal-stepper> </mat-horizontal-stepper>
</div> </div>
<div mat-dialog-actions fxLayout="row"> <div mat-dialog-actions style="padding: 0">
<div class="dialog-actions-row" fxFlex fxLayout="row" fxLayoutAlign="end center">
<button mat-stroked-button *ngIf="selectedIndex > 0" <button mat-stroked-button *ngIf="selectedIndex > 0"
[disabled]="(isLoading$ | async)" [disabled]="(isLoading$ | async)"
(click)="previousStep()">{{ 'action.back' | translate }}</button> (click)="previousStep()">{{ 'action.back' | translate }}</button>
@ -191,8 +191,8 @@
[disabled]="(isLoading$ | async)" [disabled]="(isLoading$ | async)"
(click)="nextStep()">{{ 'action.next-with-label' | translate:{label: (getFormLabel(this.selectedIndex+1) | translate)} }}</button> (click)="nextStep()">{{ 'action.next-with-label' | translate:{label: (getFormLabel(this.selectedIndex+1) | translate)} }}</button>
</div> </div>
<mat-divider></mat-divider> <mat-divider style="width: 100%"></mat-divider>
<div mat-dialog-actions fxLayout="row" fxLayoutGap="8px" fxLayoutAlign="end"> <div class="dialog-actions-row" fxFlex fxLayout="row" fxLayoutGap="8px" fxLayoutAlign="end center">
<button mat-button <button mat-button
[disabled]="(isLoading$ | async)" [disabled]="(isLoading$ | async)"
(click)="cancel()">{{ 'action.cancel' | translate }}</button> (click)="cancel()">{{ 'action.cancel' | translate }}</button>

View File

@ -15,6 +15,15 @@
*/ */
@import "../../../../../scss/constants"; @import "../../../../../scss/constants";
:host {
height: 100%;
display: grid;
.dialog-actions-row {
padding: 8px;
}
}
:host-context(.tb-fullscreen-dialog .mat-mdc-dialog-container) { :host-context(.tb-fullscreen-dialog .mat-mdc-dialog-container) {
@media #{$mat-lt-sm} { @media #{$mat-lt-sm} {
.mat-mdc-dialog-content { .mat-mdc-dialog-content {