From fa02d7629e7294daba71d7cba62db3812b3839bb Mon Sep 17 00:00:00 2001 From: Vladyslav_Prykhodko Date: Tue, 30 Mar 2021 18:15:37 +0300 Subject: [PATCH] UI: Improvement mobile view timeWindow; Add show time in 24 format --- .../time/datetime-period.component.html | 8 ++-- .../time/quick-time-interval.component.scss | 19 --------- .../time/quick-time-interval.component.ts | 1 - .../time/timewindow-panel.component.html | 39 +++++++++++-------- .../time/timewindow-panel.component.scss | 24 ++++++++---- ui-ngx/src/app/shared/shared.module.ts | 5 +++ 6 files changed, 49 insertions(+), 47 deletions(-) delete mode 100644 ui-ngx/src/app/shared/components/time/quick-time-interval.component.scss diff --git a/ui-ngx/src/app/shared/components/time/datetime-period.component.html b/ui-ngx/src/app/shared/components/time/datetime-period.component.html index 96b2e3d526..96bffe8696 100644 --- a/ui-ngx/src/app/shared/components/time/datetime-period.component.html +++ b/ui-ngx/src/app/shared/components/time/datetime-period.component.html @@ -15,8 +15,9 @@ limitations under the License. --> -
-
+
+
datetime.date-from @@ -30,7 +31,8 @@
-
+
datetime.date-to diff --git a/ui-ngx/src/app/shared/components/time/quick-time-interval.component.scss b/ui-ngx/src/app/shared/components/time/quick-time-interval.component.scss deleted file mode 100644 index 97c400525e..0000000000 --- a/ui-ngx/src/app/shared/components/time/quick-time-interval.component.scss +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Copyright © 2016-2021 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -:host { - min-width: 364px; -} diff --git a/ui-ngx/src/app/shared/components/time/quick-time-interval.component.ts b/ui-ngx/src/app/shared/components/time/quick-time-interval.component.ts index 3eab8c428d..3f9c712556 100644 --- a/ui-ngx/src/app/shared/components/time/quick-time-interval.component.ts +++ b/ui-ngx/src/app/shared/components/time/quick-time-interval.component.ts @@ -21,7 +21,6 @@ import { QuickTimeInterval, QuickTimeIntervalTranslationMap } from '@shared/mode @Component({ selector: 'tb-quick-time-interval', templateUrl: './quick-time-interval.component.html', - styleUrls: ['./quick-time-interval.component.scss'], providers: [ { provide: NG_VALUE_ACCESSOR, diff --git a/ui-ngx/src/app/shared/components/time/timewindow-panel.component.html b/ui-ngx/src/app/shared/components/time/timewindow-panel.component.html index 57c596bbc2..f947c51d3e 100644 --- a/ui-ngx/src/app/shared/components/time/timewindow-panel.component.html +++ b/ui-ngx/src/app/shared/components/time/timewindow-panel.component.html @@ -51,7 +51,7 @@ [fxShow]="timewindowForm.get('realtime.realtimeType').value === realtimeTypes.INTERVAL" [required]="timewindow.selectedTab === timewindowTypes.REALTIME && timewindowForm.get('realtime.realtimeType').value === realtimeTypes.INTERVAL" - style="padding-top: 8px; min-width: 364px"> + style="padding-top: 8px">
@@ -75,6 +75,7 @@ timewindow.time-period timewindow.interval + style="padding-top: 8px">
@@ -134,21 +137,23 @@ (ngModelChange)="onHideAggIntervalChanged()">
-
- aggregation.limit - - - - - +
+ +
+ + + + + +
diff --git a/ui-ngx/src/app/shared/components/time/timewindow-panel.component.scss b/ui-ngx/src/app/shared/components/time/timewindow-panel.component.scss index 6b25d0b1a7..fd8cb0f331 100644 --- a/ui-ngx/src/app/shared/components/time/timewindow-panel.component.scss +++ b/ui-ngx/src/app/shared/components/time/timewindow-panel.component.scss @@ -13,6 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +@import "../../../../scss/constants"; + :host { width: 100%; height: 100%; @@ -40,21 +42,29 @@ } .limit-slider-container { - >:first-child { - margin-right: 16px; - } - >:last-child { + .limit-slider-value { margin-left: 16px; - } - >:first-child, >:last-child { min-width: 25px; - max-width: 42px; + max-width: 80px; } mat-form-field input[type=number] { text-align: center; } } + @media #{$mat-gt-sm} { + .history-time-input { + min-width: 364px; + } + .limit-slider-container { + > label { + margin-right: 16px; + width: min-content; + max-width: 40%; + } + } + } + } :host ::ng-deep { diff --git a/ui-ngx/src/app/shared/shared.module.ts b/ui-ngx/src/app/shared/shared.module.ts index 02cd3b93d4..15d36d6753 100644 --- a/ui-ngx/src/app/shared/shared.module.ts +++ b/ui-ngx/src/app/shared/shared.module.ts @@ -141,6 +141,7 @@ import { FileSizePipe } from '@shared/pipe/file-size.pipe'; import { WidgetsBundleSearchComponent } from '@shared/components/widgets-bundle-search.component'; import { SelectableColumnsPipe } from '@shared/pipe/selectable-columns.pipe'; import { QuickTimeIntervalComponent } from '@shared/components/time/quick-time-interval.component'; +import { MAT_DATE_LOCALE } from '@angular/material/core'; @NgModule({ providers: [ @@ -154,6 +155,10 @@ import { QuickTimeIntervalComponent } from '@shared/components/time/quick-time-i { provide: FlowInjectionToken, useValue: Flow + }, + { + provide: MAT_DATE_LOCALE, + useValue: 'en-GB' } ], declarations: [