Commit fca2dd62139955bfbb06ec755c244cc8920e97ab

Authored by Vladyslav_Prykhodko
1 parent 15880e3e

Clear import-export (Safari)

... ... @@ -16,7 +16,7 @@
16 16
17 17 -->
18 18 <form>
19   - <mat-toolbar fxLayout="row" color="primary">
  19 + <mat-toolbar color="primary">
20 20 <h2 translate>{{ importTitle }}</h2>
21 21 <span fxFlex></span>
22 22 <div [tb-help]="'entitiesImport'"></div>
... ... @@ -44,13 +44,11 @@
44 44 </tb-file-input>
45 45 </fieldset>
46 46 </form>
47   - <div fxLayout="row">
48   - <span fxFlex></span>
  47 + <div fxLayout="row" fxLayoutAlign="end center" fxLayoutGap="20px">
49 48 <button mat-button
50   - style="margin-right: 20px;"
51 49 [disabled]="(isLoading$ | async)"
52 50 (click)="cancel()">{{ 'action.cancel' | translate }}</button>
53   - <button mat-button mat-raised-button
  51 + <button mat-raised-button
54 52 [disabled]="(isLoading$ | async) || selectFileFormGroup.invalid || !selectFileFormGroup.dirty"
55 53 color="primary"
56 54 (click)="nextStep(2)">{{ 'action.continue' | translate }}</button>
... ... @@ -62,7 +60,7 @@
62 60 <fieldset [disabled]="isLoading$ | async" fxLayout="column">
63 61 <mat-form-field class="mat-block">
64 62 <mat-label translate>import.csv-delimiter</mat-label>
65   - <mat-select required matInput formControlName="delim">
  63 + <mat-select required formControlName="delim">
66 64 <mat-option *ngFor="let delimiter of delimiters" [value]="delimiter.key">
67 65 {{ delimiter.value }}
68 66 </mat-option>
... ... @@ -78,16 +76,15 @@
78 76 </div>
79 77 </fieldset>
80 78 </form>
81   - <div fxLayout="row">
  79 + <div fxLayout="row" fxLayoutGap="20px">
82 80 <button mat-button
83 81 [disabled]="(isLoading$ | async)"
84 82 (click)="previousStep()">{{ 'action.back' | translate }}</button>
85 83 <span fxFlex></span>
86 84 <button mat-button
87   - style="margin-right: 20px;"
88 85 [disabled]="(isLoading$ | async)"
89 86 (click)="cancel()">{{ 'action.cancel' | translate }}</button>
90   - <button mat-button mat-raised-button
  87 + <button mat-raised-button
91 88 [disabled]="(isLoading$ | async)"
92 89 color="primary"
93 90 (click)="nextStep(3)">{{ 'action.continue' | translate }}</button>
... ... @@ -98,16 +95,15 @@
98 95 <ng-template matStepLabel>{{ 'import.stepper-text.column-type' | translate }}</ng-template>
99 96 <tb-table-columns-assignment formControlName="columnsParam" [entityType]="entityType"></tb-table-columns-assignment>
100 97 </form>
101   - <div fxLayout="row">
  98 + <div fxLayout="row" fxLayoutGap="20px">
102 99 <button mat-button
103 100 [disabled]="(isLoading$ | async)"
104 101 (click)="previousStep()">{{ 'action.back' | translate }}</button>
105 102 <span fxFlex></span>
106 103 <button mat-button
107   - style="margin-right: 20px;"
108 104 [disabled]="(isLoading$ | async)"
109 105 (click)="cancel()">{{ 'action.cancel' | translate }}</button>
110   - <button mat-button mat-raised-button
  106 + <button mat-raised-button
111 107 [disabled]="(isLoading$ | async) || columnTypesFormGroup.invalid || !columnTypesFormGroup.dirty"
112 108 color="primary"
113 109 (click)="nextStep(4)">{{ 'action.continue' | translate }}</button>
... ... @@ -131,9 +127,8 @@
131 127 {{ translate.instant('import.message.error-entities', {count: this.statistical.error.entity}) }}
132 128 </p>
133 129 </div>
134   - <div fxLayout="row">
135   - <span fxFlex></span>
136   - <button mat-button mat-raised-button
  130 + <div fxLayout="row" fxLayoutAlign="end center" fxLayoutGap="20px">
  131 + <button mat-raised-button
137 132 [disabled]="(isLoading$ | async)"
138 133 color="primary"
139 134 (click)="nextStep(6)">{{ 'action.ok' | translate }}</button>
... ...
... ... @@ -17,9 +17,6 @@
17 17 import { Widget, WidgetType } from '@app/shared/models/widget.models';
18 18 import { DashboardLayoutId } from '@shared/models/dashboard.models';
19 19 import { WidgetsBundle } from '@shared/models/widgets-bundle.model';
20   -import { ActionNotificationShow } from '@core/notification/notification.actions';
21   -import { ActionType } from '@shared/models/audit-log.models';
22   -import { RuleChain, RuleChainMetaData } from '@shared/models/rule-chain.models';
23 20
24 21 export interface ImportWidgetResult {
25 22 widget: Widget;
... ...
... ... @@ -15,7 +15,7 @@
15 15 limitations under the License.
16 16
17 17 -->
18   -<mat-table [dataSource]="dataSource">
  18 +<table mat-table [dataSource]="dataSource">
19 19 <ng-container matColumnDef="order">
20 20 <mat-header-cell *matHeaderCellDef style="min-width: 40px; max-width: 40px; width: 40px"></mat-header-cell>
21 21 <mat-cell *matCellDef="let column; let i = index">
... ... @@ -52,5 +52,5 @@
52 52 </ng-container>
53 53 <mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
54 54 <mat-row *matRowDef="let column; columns: displayedColumns;"></mat-row>
55   -</mat-table>
  55 +</table>
56 56 <mat-divider></mat-divider>
... ...
... ... @@ -19,8 +19,12 @@ import { ControlValueAccessor, FormControl, NG_VALIDATORS, NG_VALUE_ACCESSOR, Va
19 19 import { Store } from '@ngrx/store';
20 20 import { AppState } from '@core/core.state';
21 21 import { EntityType } from '@shared/models/entity-type.models';
22   -import { CsvColumnParam, ImportEntityColumnType, importEntityColumnTypeTranslations,
23   - importEntityObjectColumns } from '@home/components/import-export/import-export.models';
  22 +import {
  23 + CsvColumnParam,
  24 + ImportEntityColumnType,
  25 + importEntityColumnTypeTranslations,
  26 + importEntityObjectColumns
  27 +} from '@home/components/import-export/import-export.models';
24 28 import { BehaviorSubject, Observable } from 'rxjs';
25 29 import { CollectionViewer, DataSource } from '@angular/cdk/collections';
26 30
... ... @@ -51,8 +55,6 @@ export class TableColumnsAssignmentComponent implements OnInit, ControlValueAcce
51 55
52 56 displayedColumns = ['order', 'sampleData', 'type', 'key'];
53 57
54   - importEntityColumnType = ImportEntityColumnType;
55   -
56 58 columnTypes: AssignmentColumnType[] = [];
57 59
58 60 columnTypesTranslations = importEntityColumnTypeTranslations;
... ... @@ -138,12 +140,10 @@ export class TableColumnsAssignmentComponent implements OnInit, ControlValueAcce
138 140 }
139 141
140 142 public isColumnTypeDiffers(columnType: ImportEntityColumnType): boolean {
141   - return columnType !== ImportEntityColumnType.name &&
142   - columnType !== ImportEntityColumnType.type &&
143   - columnType !== ImportEntityColumnType.label &&
144   - columnType !== ImportEntityColumnType.accessToken &&
145   - columnType !== ImportEntityColumnType.isGateway &&
146   - columnType !== ImportEntityColumnType.description;
  143 + return columnType === ImportEntityColumnType.clientAttribute ||
  144 + columnType === ImportEntityColumnType.sharedAttribute ||
  145 + columnType === ImportEntityColumnType.serverAttribute ||
  146 + columnType === ImportEntityColumnType.timeseries;
147 147 }
148 148
149 149 private columnValid(column: CsvColumnParam): boolean {
... ...