From fca2dd62139955bfbb06ec755c244cc8920e97ab Mon Sep 17 00:00:00 2001 From: Vladyslav_Prykhodko Date: Fri, 3 Apr 2020 14:34:13 +0300 Subject: [PATCH 1/5] Clear import-export (Safari) --- .../import-dialog-csv.component.html | 25 ++++++++----------- .../import-export/import-export.models.ts | 3 --- .../table-columns-assignment.component.html | 4 +-- .../table-columns-assignment.component.ts | 20 +++++++-------- 4 files changed, 22 insertions(+), 30 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/import-export/import-dialog-csv.component.html b/ui-ngx/src/app/modules/home/components/import-export/import-dialog-csv.component.html index 2f9598015c..39bf361794 100644 --- a/ui-ngx/src/app/modules/home/components/import-export/import-dialog-csv.component.html +++ b/ui-ngx/src/app/modules/home/components/import-export/import-dialog-csv.component.html @@ -16,7 +16,7 @@ -->
- +

{{ importTitle }}

@@ -44,13 +44,11 @@ -
- +
- @@ -62,7 +60,7 @@
import.csv-delimiter - + {{ delimiter.value }} @@ -78,16 +76,15 @@
-
+
- @@ -98,16 +95,15 @@ {{ 'import.stepper-text.column-type' | translate }} -
+
- @@ -131,9 +127,8 @@ {{ translate.instant('import.message.error-entities', {count: this.statistical.error.entity}) }}

-
- - diff --git a/ui-ngx/src/app/modules/home/components/import-export/import-export.models.ts b/ui-ngx/src/app/modules/home/components/import-export/import-export.models.ts index 85064a7236..cd37c43223 100644 --- a/ui-ngx/src/app/modules/home/components/import-export/import-export.models.ts +++ b/ui-ngx/src/app/modules/home/components/import-export/import-export.models.ts @@ -17,9 +17,6 @@ import { Widget, WidgetType } from '@app/shared/models/widget.models'; import { DashboardLayoutId } from '@shared/models/dashboard.models'; import { WidgetsBundle } from '@shared/models/widgets-bundle.model'; -import { ActionNotificationShow } from '@core/notification/notification.actions'; -import { ActionType } from '@shared/models/audit-log.models'; -import { RuleChain, RuleChainMetaData } from '@shared/models/rule-chain.models'; export interface ImportWidgetResult { widget: Widget; diff --git a/ui-ngx/src/app/modules/home/components/import-export/table-columns-assignment.component.html b/ui-ngx/src/app/modules/home/components/import-export/table-columns-assignment.component.html index 889eaa9c1d..b7360837d7 100644 --- a/ui-ngx/src/app/modules/home/components/import-export/table-columns-assignment.component.html +++ b/ui-ngx/src/app/modules/home/components/import-export/table-columns-assignment.component.html @@ -15,7 +15,7 @@ limitations under the License. --> - + @@ -52,5 +52,5 @@ - +
diff --git a/ui-ngx/src/app/modules/home/components/import-export/table-columns-assignment.component.ts b/ui-ngx/src/app/modules/home/components/import-export/table-columns-assignment.component.ts index 9e759ec641..e2fe0caef2 100644 --- a/ui-ngx/src/app/modules/home/components/import-export/table-columns-assignment.component.ts +++ b/ui-ngx/src/app/modules/home/components/import-export/table-columns-assignment.component.ts @@ -19,8 +19,12 @@ import { ControlValueAccessor, FormControl, NG_VALIDATORS, NG_VALUE_ACCESSOR, Va import { Store } from '@ngrx/store'; import { AppState } from '@core/core.state'; import { EntityType } from '@shared/models/entity-type.models'; -import { CsvColumnParam, ImportEntityColumnType, importEntityColumnTypeTranslations, - importEntityObjectColumns } from '@home/components/import-export/import-export.models'; +import { + CsvColumnParam, + ImportEntityColumnType, + importEntityColumnTypeTranslations, + importEntityObjectColumns +} from '@home/components/import-export/import-export.models'; import { BehaviorSubject, Observable } from 'rxjs'; import { CollectionViewer, DataSource } from '@angular/cdk/collections'; @@ -51,8 +55,6 @@ export class TableColumnsAssignmentComponent implements OnInit, ControlValueAcce displayedColumns = ['order', 'sampleData', 'type', 'key']; - importEntityColumnType = ImportEntityColumnType; - columnTypes: AssignmentColumnType[] = []; columnTypesTranslations = importEntityColumnTypeTranslations; @@ -138,12 +140,10 @@ export class TableColumnsAssignmentComponent implements OnInit, ControlValueAcce } public isColumnTypeDiffers(columnType: ImportEntityColumnType): boolean { - return columnType !== ImportEntityColumnType.name && - columnType !== ImportEntityColumnType.type && - columnType !== ImportEntityColumnType.label && - columnType !== ImportEntityColumnType.accessToken && - columnType !== ImportEntityColumnType.isGateway && - columnType !== ImportEntityColumnType.description; + return columnType === ImportEntityColumnType.clientAttribute || + columnType === ImportEntityColumnType.sharedAttribute || + columnType === ImportEntityColumnType.serverAttribute || + columnType === ImportEntityColumnType.timeseries; } private columnValid(column: CsvColumnParam): boolean { From 56bb0f60711e20bf820772c1263ff8890fd4f033 Mon Sep 17 00:00:00 2001 From: Vladyslav_Prykhodko Date: Fri, 3 Apr 2020 21:14:39 +0300 Subject: [PATCH 2/5] Improvement dialog and component style --- .../src/main/resources/thingsboard.yml | 2 +- .../home/components/contact.component.html | 2 +- .../components/details-panel.component.ts | 2 +- .../entity/add-entity-dialog.component.html | 10 +++--- .../entity/add-entity-dialog.component.scss | 3 +- .../entity/add-entity-dialog.component.ts | 23 +++++++------ ...entities-to-customer-dialog.component.html | 8 ++--- ...d-entities-to-customer-dialog.component.ts | 21 ++++++------ .../assign-to-customer-dialog.component.html | 10 +++--- .../assign-to-customer-dialog.component.ts | 21 ++++++------ .../home/dialogs/home-dialogs.module.ts | 4 +-- .../home/dialogs/home-dialogs.service.ts | 3 -- .../asset/assets-table-config.resolver.ts | 2 +- .../device-credentials-dialog.component.html | 14 ++++---- .../device-credentials-dialog.component.ts | 14 +++----- .../pages/user/add-user-dialog.component.html | 10 +++--- .../pages/user/add-user-dialog.component.scss | 19 +++++++++++ .../pages/user/add-user-dialog.component.ts | 6 ++-- .../dialog/alert-dialog.component.html | 5 ++- .../dialog/confirm-dialog.component.html | 5 ++- .../entity-subtype-select.component.html | 2 +- .../entity-subtype-select.component.scss | 4 +-- .../entity/entity-subtype-select.component.ts | 32 +++++++------------ .../assets/locale/locale.constant-en_US.json | 1 - 24 files changed, 105 insertions(+), 118 deletions(-) create mode 100644 ui-ngx/src/app/modules/home/pages/user/add-user-dialog.component.scss diff --git a/application/src/main/resources/thingsboard.yml b/application/src/main/resources/thingsboard.yml index 2d33b559ab..60ba232795 100644 --- a/application/src/main/resources/thingsboard.yml +++ b/application/src/main/resources/thingsboard.yml @@ -379,7 +379,7 @@ spring: database-platform: "${SPRING_JPA_DATABASE_PLATFORM:org.hibernate.dialect.PostgreSQLDialect}" datasource: driverClassName: "${SPRING_DRIVER_CLASS_NAME:org.postgresql.Driver}" - url: "${SPRING_DATASOURCE_URL:jdbc:postgresql://localhost:5432/thingsboard}" + url: "${SPRING_DATASOURCE_URL:jdbc:postgresql://localhost:5432/thingsboard_angular}" username: "${SPRING_DATASOURCE_USERNAME:postgres}" password: "${SPRING_DATASOURCE_PASSWORD:postgres}" hikari: diff --git a/ui-ngx/src/app/modules/home/components/contact.component.html b/ui-ngx/src/app/modules/home/components/contact.component.html index 53c2e29a76..3e5493e17c 100644 --- a/ui-ngx/src/app/modules/home/components/contact.component.html +++ b/ui-ngx/src/app/modules/home/components/contact.component.html @@ -18,7 +18,7 @@
contact.country - + {{ country }} diff --git a/ui-ngx/src/app/modules/home/components/details-panel.component.ts b/ui-ngx/src/app/modules/home/components/details-panel.component.ts index 12894876eb..66a9f3dc82 100644 --- a/ui-ngx/src/app/modules/home/components/details-panel.component.ts +++ b/ui-ngx/src/app/modules/home/components/details-panel.component.ts @@ -14,7 +14,7 @@ /// limitations under the License. /// -import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; +import { Component, EventEmitter, Input, Output } from '@angular/core'; import { PageComponent } from '@shared/components/page.component'; import { Store } from '@ngrx/store'; import { AppState } from '@core/core.state'; diff --git a/ui-ngx/src/app/modules/home/components/entity/add-entity-dialog.component.html b/ui-ngx/src/app/modules/home/components/entity/add-entity-dialog.component.html index 68bb015071..47d6b385b2 100644 --- a/ui-ngx/src/app/modules/home/components/entity/add-entity-dialog.component.html +++ b/ui-ngx/src/app/modules/home/components/entity/add-entity-dialog.component.html @@ -16,11 +16,11 @@ -->
- +

{{ translations.add }}

-
-
- -
- {{ assignToCustomerText | translate }} +
{{ assignToCustomerText | translate }}
-
- -
-
- -
-
- -
diff --git a/ui-ngx/src/app/shared/components/dialog/confirm-dialog.component.html b/ui-ngx/src/app/shared/components/dialog/confirm-dialog.component.html index 6abbd68dea..aeb705d631 100644 --- a/ui-ngx/src/app/shared/components/dialog/confirm-dialog.component.html +++ b/ui-ngx/src/app/shared/components/dialog/confirm-dialog.component.html @@ -16,9 +16,8 @@ -->

{{data.title}}

-
-
-
+
+
diff --git a/ui-ngx/src/app/shared/components/entity/entity-subtype-select.component.html b/ui-ngx/src/app/shared/components/entity/entity-subtype-select.component.html index 00bd722c38..92b43d490f 100644 --- a/ui-ngx/src/app/shared/components/entity/entity-subtype-select.component.html +++ b/ui-ngx/src/app/shared/components/entity/entity-subtype-select.component.html @@ -17,7 +17,7 @@ --> {{ entitySubtypeTitle | translate }} - + {{ displaySubTypeFn(subType) }} diff --git a/ui-ngx/src/app/shared/components/entity/entity-subtype-select.component.scss b/ui-ngx/src/app/shared/components/entity/entity-subtype-select.component.scss index 3bda90f75f..bb3718c2da 100644 --- a/ui-ngx/src/app/shared/components/entity/entity-subtype-select.component.scss +++ b/ui-ngx/src/app/shared/components/entity/entity-subtype-select.component.scss @@ -14,7 +14,5 @@ * limitations under the License. */ :host { - mat-select.tb-entity-subtype-select { - min-width: 200px; - } + } diff --git a/ui-ngx/src/app/shared/components/entity/entity-subtype-select.component.ts b/ui-ngx/src/app/shared/components/entity/entity-subtype-select.component.ts index 7e41068e3d..72540ad4c8 100644 --- a/ui-ngx/src/app/shared/components/entity/entity-subtype-select.component.ts +++ b/ui-ngx/src/app/shared/components/entity/entity-subtype-select.component.ts @@ -14,26 +14,18 @@ /// limitations under the License. /// -import {AfterViewInit, Component, ElementRef, forwardRef, Input, OnInit, ViewChild, OnDestroy} from '@angular/core'; -import {ControlValueAccessor, FormBuilder, FormGroup, NG_VALUE_ACCESSOR} from '@angular/forms'; -import {Observable, of, throwError, Subscription, Subject} from 'rxjs'; -import {PageLink} from '@shared/models/page/page-link'; -import {Direction} from '@shared/models/page/sort-order'; -import {filter, map, mergeMap, publishReplay, refCount, startWith, tap, publish} from 'rxjs/operators'; -import {PageData, emptyPageData} from '@shared/models/page/page-data'; -import {DashboardInfo} from '@app/shared/models/dashboard.models'; -import {DashboardId} from '@app/shared/models/id/dashboard-id'; -import {DashboardService} from '@core/http/dashboard.service'; -import {Store} from '@ngrx/store'; -import {AppState} from '@app/core/core.state'; -import {getCurrentAuthUser} from '@app/core/auth/auth.selectors'; -import {Authority} from '@shared/models/authority.enum'; -import {TranslateService} from '@ngx-translate/core'; -import {DeviceService} from '@core/http/device.service'; -import {EntitySubtype, EntityType} from '@app/shared/models/entity-type.models'; -import {BroadcastService} from '@app/core/services/broadcast.service'; -import {AssetService} from '@core/http/asset.service'; -import {EntityViewService} from '@core/http/entity-view.service'; +import { AfterViewInit, Component, forwardRef, Input, OnDestroy, OnInit } from '@angular/core'; +import { ControlValueAccessor, FormBuilder, FormGroup, NG_VALUE_ACCESSOR } from '@angular/forms'; +import { Observable, Subject, Subscription, throwError } from 'rxjs'; +import { map, mergeMap, publishReplay, refCount, startWith, tap } from 'rxjs/operators'; +import { Store } from '@ngrx/store'; +import { AppState } from '@app/core/core.state'; +import { TranslateService } from '@ngx-translate/core'; +import { DeviceService } from '@core/http/device.service'; +import { EntitySubtype, EntityType } from '@app/shared/models/entity-type.models'; +import { BroadcastService } from '@app/core/services/broadcast.service'; +import { AssetService } from '@core/http/asset.service'; +import { EntityViewService } from '@core/http/entity-view.service'; @Component({ selector: 'tb-entity-subtype-select', diff --git a/ui-ngx/src/assets/locale/locale.constant-en_US.json b/ui-ngx/src/assets/locale/locale.constant-en_US.json index a2f8a57316..b1d6dc9973 100644 --- a/ui-ngx/src/assets/locale/locale.constant-en_US.json +++ b/ui-ngx/src/assets/locale/locale.constant-en_US.json @@ -247,7 +247,6 @@ "no-asset-types-matching": "No asset types matching '{{entitySubtype}}' were found.", "asset-type-list-empty": "No asset types selected.", "asset-types": "Asset types", - "created-time": "Created time", "name": "Name", "name-required": "Name is required.", "description": "Description", From 2ca4b78cf9db67888bdcfd3ecb25286c4248ef67 Mon Sep 17 00:00:00 2001 From: Vladyslav_Prykhodko Date: Mon, 6 Apr 2020 11:04:03 +0300 Subject: [PATCH 3/5] Improvement view on mobile device --- .../audit-log-details-dialog.component.html | 6 ++--- .../entity/entities-table.component.html | 25 +++++++++---------- .../home/pages/asset/asset-routing.module.ts | 10 ++++---- .../home/pages/asset/asset.component.html | 4 +-- .../home/pages/asset/asset.component.ts | 20 +++++++-------- .../modules/home/pages/asset/asset.module.ts | 16 ++++++------ .../pages/customer/customer.component.html | 4 +-- .../home/pages/customer/customer.component.ts | 7 +++--- .../dashboard/dashboard-form.component.html | 2 +- .../dashboard/dashboard-form.component.ts | 19 +++++++------- .../pages/device/device-tabs.component.ts | 1 - .../home/pages/device/device.component.html | 6 ++--- .../home/pages/device/device.component.ts | 22 +++++++--------- .../home/pages/device/device.module.ts | 12 ++++----- .../entity-view/entity-view.component.html | 4 +-- .../activation-link-dialog.component.html | 10 +++----- .../user/activation-link-dialog.component.ts | 1 - .../pages/user/add-user-dialog.component.html | 4 +-- .../home/pages/user/user.component.html | 2 +- .../modules/home/pages/user/user.component.ts | 4 +-- .../modules/home/pages/user/user.module.ts | 2 +- .../widget/widget-library-routing.module.ts | 4 +-- .../widget/widgets-bundle.component.html | 2 +- ui-ngx/src/styles.scss | 21 +++++++++++----- 24 files changed, 102 insertions(+), 106 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/audit-log/audit-log-details-dialog.component.html b/ui-ngx/src/app/modules/home/components/audit-log/audit-log-details-dialog.component.html index 5bda4c7550..3589e465fe 100644 --- a/ui-ngx/src/app/modules/home/components/audit-log/audit-log-details-dialog.component.html +++ b/ui-ngx/src/app/modules/home/components/audit-log/audit-log-details-dialog.component.html @@ -15,7 +15,7 @@ limitations under the License. --> - +

audit-log.audit-log-details

-
- +
- -
- - -
+
-
+
- -
+
-
+
-
- +