Commit fca2dd62139955bfbb06ec755c244cc8920e97ab

Authored by Vladyslav_Prykhodko
1 parent 15880e3e

Clear import-export (Safari)

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