Refactoring

This commit is contained in:
Chantsova Ekaterina 2024-09-11 18:32:53 +03:00
parent 63da803251
commit 8d0f5744f3
3 changed files with 17 additions and 12 deletions

View File

@ -77,7 +77,9 @@ export class TimeintervalComponent implements OnInit, ControlValueAccessor, OnDe
if (this.disabledAdvancedState !== disabledAdvanced) { if (this.disabledAdvancedState !== disabledAdvanced) {
this.disabledAdvancedState = disabledAdvanced; this.disabledAdvancedState = disabledAdvanced;
this.updateIntervalValue(); this.updateIntervalValue();
this.boundInterval(); if (!this.disabledAdvancedState) {
this.boundInterval();
}
} }
} }

View File

@ -32,7 +32,7 @@
<section class="tb-form-panel stroked" *ngIf="realtimeIntervalSelectionAvailable; else timezoneSelectionPanel"> <section class="tb-form-panel stroked" *ngIf="realtimeIntervalSelectionAvailable; else timezoneSelectionPanel">
<div class="tb-flex space-between" <div class="tb-flex space-between"
[ngClass]="{'align-end': realtimeTypeSelectionAvailable, 'align-center': !realtimeTypeSelectionAvailable }"> [ngClass]="{'align-end': realtimeTypeSelectionAvailable, 'align-center': !realtimeTypeSelectionAvailable }">
<div class="tb-flex column no-flex flex-xs"> <div class="tb-flex-xs column">
<div class="tb-form-panel-title">{{ 'timewindow.timewindow' | translate }}</div> <div class="tb-form-panel-title">{{ 'timewindow.timewindow' | translate }}</div>
<ng-container formGroupName="realtime" *ngIf="realtimeTypeSelectionAvailable"> <ng-container formGroupName="realtime" *ngIf="realtimeTypeSelectionAvailable">
<tb-toggle-select appearance="stroked" [options]="realtimeTimewindowOptions" formControlName="realtimeType"> <tb-toggle-select appearance="stroked" [options]="realtimeTimewindowOptions" formControlName="realtimeType">
@ -73,7 +73,7 @@
<section class="tb-form-panel stroked" *ngIf="historyIntervalSelectionAvailable; else timezoneSelectionPanel"> <section class="tb-form-panel stroked" *ngIf="historyIntervalSelectionAvailable; else timezoneSelectionPanel">
<div class="tb-flex space-between" <div class="tb-flex space-between"
[ngClass]="{'align-end': historyTypeSelectionAvailable, 'align-center': !historyTypeSelectionAvailable }"> [ngClass]="{'align-end': historyTypeSelectionAvailable, 'align-center': !historyTypeSelectionAvailable }">
<div class="tb-flex column no-flex flex-xs"> <div class="tb-flex-xs column">
<div class="tb-form-panel-title">{{ 'timewindow.timewindow' | translate }}</div> <div class="tb-form-panel-title">{{ 'timewindow.timewindow' | translate }}</div>
<ng-container formGroupName="history" *ngIf="historyTypeSelectionAvailable"> <ng-container formGroupName="history" *ngIf="historyTypeSelectionAvailable">
<tb-toggle-select appearance="stroked" [options]="historyTimewindowOptions" formControlName="historyType"> <tb-toggle-select appearance="stroked" [options]="historyTimewindowOptions" formControlName="historyType">
@ -182,8 +182,8 @@
</div> </div>
<ng-template #timezoneSelectionPanel> <ng-template #timezoneSelectionPanel>
<section class="tb-form-panel stroked tb-flex row align-center space-between"> <section class="tb-form-row space-between same-padding">
<div class="tb-form-panel-title">{{ 'timezone.timezone' | translate }}</div> <div>{{ 'timezone.timezone' | translate }}</div>
<ng-container *ngTemplateOutlet="timezoneSelection"> <ng-container *ngTemplateOutlet="timezoneSelection">
</ng-container> </ng-container>
</section> </section>

View File

@ -264,18 +264,21 @@
} }
.tb-flex { .tb-flex {
display: flex;
flex: 1; flex: 1;
gap: 8px;
&.no-flex { &.no-flex {
flex: none; flex: none;
&.flex-xs { }
@media #{$mat-xs} {
width: auto; &-xs {
flex: 1; @media #{$mat-xs} {
} flex: 1;
} }
} }
}
[class*="tb-flex"] {
display: flex;
gap: 8px;
&.row { &.row {
flex-direction: row; flex-direction: row;
} }