Browse Source

UI: fix timezone displaying on quick-interval-only

pull/11633/head
Chantsova Ekaterina 2 years ago
parent
commit
7be52df6f5
  1. 37
      ui-ngx/src/app/shared/components/time/timewindow-panel.component.html
  2. 2
      ui-ngx/src/app/shared/components/time/timewindow-panel.component.ts
  3. 6
      ui-ngx/src/form.scss

37
ui-ngx/src/app/shared/components/time/timewindow-panel.component.html

@ -22,14 +22,16 @@
<div class="tb-flex column"> <div class="tb-flex column">
<section class="tb-form-panel stroked" <section class="tb-form-panel stroked"
*ngIf="isEdit || !(timewindow.hideInterval || (timewindow.hideLastInterval && timewindow.hideQuickInterval))"> *ngIf="isEdit || !(timewindow.hideInterval || (timewindow.hideLastInterval && timewindow.hideQuickInterval))">
<div class="tb-form-panel-title">{{ 'timewindow.time-range' | translate }}</div> <div class="tb-flex space-between"
<div class="tb-flex align-center space-between"> [ngClass]="{'align-end': realtimeTimewindowOptions.length > 1, 'align-center': realtimeTimewindowOptions.length <= 1 }">
<ng-container formGroupName="realtime"> <div class="tb-flex column">
<tb-toggle-select *ngIf="!quickIntervalOnly || isEdit || (!timewindow.hideLastInterval && !timewindow.hideQuickInterval)" <div class="tb-form-panel-title">{{ 'timewindow.time-range' | translate }}</div>
appearance="fill" [options]="realtimeTimewindowOptions" formControlName="realtimeType" <ng-container formGroupName="realtime" *ngIf="realtimeTimewindowOptions.length > 1">
style="max-width: 100%"> <tb-toggle-select appearance="fill" [options]="realtimeTimewindowOptions" formControlName="realtimeType"
</tb-toggle-select> style="max-width: 100%">
</ng-container> </tb-toggle-select>
</ng-container>
</div>
<ng-container *ngTemplateOutlet="timezoneSelection"> <ng-container *ngTemplateOutlet="timezoneSelection">
</ng-container> </ng-container>
@ -58,7 +60,7 @@
</tb-quick-time-interval> </tb-quick-time-interval>
</ng-container> </ng-container>
</ng-container> </ng-container>
</section> </section>
<section class="tb-form-panel stroked tb-flex row align-center space-between" <section class="tb-form-panel stroked tb-flex row align-center space-between"
*ngIf="!isEdit && (timewindow.hideInterval || (timewindow.hideLastInterval && timewindow.hideQuickInterval))"> *ngIf="!isEdit && (timewindow.hideInterval || (timewindow.hideLastInterval && timewindow.hideQuickInterval))">
<div class="tb-form-panel-title">{{ 'timezone.timezone' | translate }}</div> <div class="tb-form-panel-title">{{ 'timezone.timezone' | translate }}</div>
@ -72,13 +74,16 @@
<mat-tab label="{{ 'timewindow.history' | translate }}"> <mat-tab label="{{ 'timewindow.history' | translate }}">
<div class="tb-flex column"> <div class="tb-flex column">
<section class="tb-form-panel stroked" *ngIf="isEdit || !timewindow.hideInterval"> <section class="tb-form-panel stroked" *ngIf="isEdit || !timewindow.hideInterval">
<div class="tb-form-panel-title">{{ 'timewindow.time-range' | translate }}</div> <div class="tb-flex space-between"
<div class="tb-flex align-center space-between"> [ngClass]="{'align-end': historyTimewindowOptions.length > 1, 'align-center': historyTimewindowOptions.length <= 1 }">
<ng-container formGroupName="history"> <div class="tb-flex column">
<tb-toggle-select appearance="fill" [options]="historyTimewindowOptions" formControlName="historyType" <div class="tb-form-panel-title">{{ 'timewindow.time-range' | translate }}</div>
style="max-width: 100%"> <ng-container formGroupName="history" *ngIf="historyTimewindowOptions.length > 1">
</tb-toggle-select> <tb-toggle-select appearance="fill" [options]="historyTimewindowOptions" formControlName="historyType"
</ng-container> style="max-width: 100%">
</tb-toggle-select>
</ng-container>
</div>
<ng-container *ngTemplateOutlet="timezoneSelection"> <ng-container *ngTemplateOutlet="timezoneSelection">
</ng-container> </ng-container>

2
ui-ngx/src/app/shared/components/time/timewindow-panel.component.ts

@ -125,7 +125,7 @@ export class TimewindowPanelComponent extends PageComponent implements OnInit {
}); });
} }
if (this.isEdit || (!this.timewindow.hideLastInterval && !this.quickIntervalOnly)) { if ((this.isEdit || !this.timewindow.hideLastInterval) && !this.quickIntervalOnly) {
this.realtimeTimewindowOptions.push({ this.realtimeTimewindowOptions.push({
name: this.translate.instant('timewindow.last'), name: this.translate.instant('timewindow.last'),
value: this.realtimeTypes.LAST_INTERVAL value: this.realtimeTypes.LAST_INTERVAL

6
ui-ngx/src/form.scss

@ -293,6 +293,12 @@
&.align-center { &.align-center {
align-items: center; align-items: center;
} }
&.align-start {
align-items: start;
}
&.align-end {
align-items: end;
}
&.no-gap { &.no-gap {
gap: 0; gap: 0;
} }

Loading…
Cancel
Save