Commit 9552ab0589111ab564204cadfd06bbbc76c7993c
Committed by
Andrew Shvayka
1 parent
e5b49c70
Lwm2m: front: fix bug PR
Showing
11 changed files
with
37 additions
and
44 deletions
@@ -109,15 +109,15 @@ | @@ -109,15 +109,15 @@ | ||
109 | (serverFormGroup.get('securityMode').value === securityConfigLwM2MType.RPK || | 109 | (serverFormGroup.get('securityMode').value === securityConfigLwM2MType.RPK || |
110 | serverFormGroup.get('securityMode').value === securityConfigLwM2MType.X509)"> | 110 | serverFormGroup.get('securityMode').value === securityConfigLwM2MType.X509)"> |
111 | {{ 'device-profile.lwm2m.server-public-key' | translate }} | 111 | {{ 'device-profile.lwm2m.server-public-key' | translate }} |
112 | - <strong>{{ translate.get('device-profile.lwm2m.pattern_hex_dec', { | ||
113 | - count: 0}) | async }}</strong> | 112 | + <strong>{{ 'device-profile.lwm2m.pattern_hex_dec' | translate: { |
113 | + count: 0} }}</strong> | ||
114 | </mat-error> | 114 | </mat-error> |
115 | <mat-error *ngIf="(serverFormGroup.get('serverPublicKey').hasError('maxlength') || | 115 | <mat-error *ngIf="(serverFormGroup.get('serverPublicKey').hasError('maxlength') || |
116 | serverFormGroup.get('serverPublicKey').hasError('minlength')) && | 116 | serverFormGroup.get('serverPublicKey').hasError('minlength')) && |
117 | serverFormGroup.get('securityMode').value === securityConfigLwM2MType.RPK"> | 117 | serverFormGroup.get('securityMode').value === securityConfigLwM2MType.RPK"> |
118 | {{ 'device-profile.lwm2m.server-public-key' | translate }} | 118 | {{ 'device-profile.lwm2m.server-public-key' | translate }} |
119 | - <strong>{{ translate.get('device-profile.lwm2m.pattern_hex_dec', { | ||
120 | - count: lenMaxServerPublicKey }) | async }}</strong> | 119 | + <strong>{{ 'device-profile.lwm2m.pattern_hex_dec' | translate: { |
120 | + count: lenMaxServerPublicKey } }}</strong> | ||
121 | </mat-error> | 121 | </mat-error> |
122 | </mat-form-field> | 122 | </mat-form-field> |
123 | </div> | 123 | </div> |
@@ -34,7 +34,6 @@ import { coerceBooleanProperty } from '@angular/cdk/coercion'; | @@ -34,7 +34,6 @@ import { coerceBooleanProperty } from '@angular/cdk/coercion'; | ||
34 | import { WINDOW } from '@core/services/window.service'; | 34 | import { WINDOW } from '@core/services/window.service'; |
35 | import { pairwise, startWith } from 'rxjs/operators'; | 35 | import { pairwise, startWith } from 'rxjs/operators'; |
36 | import { DeviceProfileService } from '@core/http/device-profile.service'; | 36 | import { DeviceProfileService } from '@core/http/device-profile.service'; |
37 | -import { TranslateService } from '@ngx-translate/core'; | ||
38 | 37 | ||
39 | @Component({ | 38 | @Component({ |
40 | selector: 'tb-profile-lwm2m-device-config-server', | 39 | selector: 'tb-profile-lwm2m-device-config-server', |
@@ -75,7 +74,6 @@ export class Lwm2mDeviceConfigServerComponent implements ControlValueAccessor { | @@ -75,7 +74,6 @@ export class Lwm2mDeviceConfigServerComponent implements ControlValueAccessor { | ||
75 | } | 74 | } |
76 | 75 | ||
77 | constructor(protected store: Store<AppState>, | 76 | constructor(protected store: Store<AppState>, |
78 | - public translate: TranslateService, | ||
79 | public fb: FormBuilder, | 77 | public fb: FormBuilder, |
80 | private deviceProfileService: DeviceProfileService, | 78 | private deviceProfileService: DeviceProfileService, |
81 | @Inject(WINDOW) private window: Window) { | 79 | @Inject(WINDOW) private window: Window) { |
@@ -22,19 +22,22 @@ | @@ -22,19 +22,22 @@ | ||
22 | <section [formGroup]="lwm2mDeviceProfileFormGroup"> | 22 | <section [formGroup]="lwm2mDeviceProfileFormGroup"> |
23 | <div class="mat-padding" style="padding-bottom: 0px"> | 23 | <div class="mat-padding" style="padding-bottom: 0px"> |
24 | <mat-checkbox formControlName="clientOnlyObserveAfterConnect" color="primary" | 24 | <mat-checkbox formControlName="clientOnlyObserveAfterConnect" color="primary" |
25 | - matTooltip="{{ translate.get('device-profile.lwm2m.client-only-observe-after-connect-tip', | ||
26 | - { count: +lwm2mDeviceProfileFormGroup.get('clientOnlyObserveAfterConnect').value }) | async }}" | 25 | + matTooltip="{{ 'device-profile.lwm2m.client-only-observe-after-connect-tip' | translate: |
26 | + { count: +lwm2mDeviceProfileFormGroup.get('clientOnlyObserveAfterConnect').value } }}" | ||
27 | matTooltipPosition="above"> | 27 | matTooltipPosition="above"> |
28 | - {{ translate.get('device-profile.lwm2m.client-only-observe-after-connect', | ||
29 | - { count: +lwm2mDeviceProfileFormGroup.get('clientOnlyObserveAfterConnect').value }) | async }} | 28 | + {{ 'device-profile.lwm2m.client-only-observe-after-connect' | translate: |
29 | + {count: +lwm2mDeviceProfileFormGroup.get('clientOnlyObserveAfterConnect').value} }} | ||
30 | </mat-checkbox> | 30 | </mat-checkbox> |
31 | - <mat-checkbox *ngIf="!lwm2mDeviceProfileFormGroup.get('clientOnlyObserveAfterConnect').value" | ||
32 | - formControlName="clientUpdateValueAfterConnect" color="primary" | ||
33 | - matTooltip="{{ translate.get('device-profile.lwm2m.client-update-value-after-connect-tip', | ||
34 | - { count: +lwm2mDeviceProfileFormGroup.get('clientUpdateValueAfterConnect').value }) | async }}" | ||
35 | - matTooltipPosition="above"> | ||
36 | - {{ translate.get('device-profile.lwm2m.client-update-value-after-connect', | ||
37 | - { count: +lwm2mDeviceProfileFormGroup.get('clientUpdateValueAfterConnect').value }) | async }} | 31 | + </div> |
32 | + <div class="mat-padding" style="padding-bottom: 0px" | ||
33 | + *ngIf="!lwm2mDeviceProfileFormGroup.get('clientOnlyObserveAfterConnect').value"> | ||
34 | + <mat-checkbox | ||
35 | + formControlName="clientUpdateValueAfterConnect" color="primary" | ||
36 | + matTooltip="{{ 'device-profile.lwm2m.client-update-value-after-connect-tip' | translate: | ||
37 | + { count: +lwm2mDeviceProfileFormGroup.get('clientUpdateValueAfterConnect').value } }}" | ||
38 | + matTooltipPosition="above"> | ||
39 | + {{ 'device-profile.lwm2m.client-update-value-after-connect' | translate: | ||
40 | + {count: +lwm2mDeviceProfileFormGroup.get('clientUpdateValueAfterConnect').value} }} | ||
38 | </mat-checkbox> | 41 | </mat-checkbox> |
39 | </div> | 42 | </div> |
40 | <div class="mat-padding" style="padding-top: 0"> | 43 | <div class="mat-padding" style="padding-top: 0"> |
@@ -32,7 +32,6 @@ import { deepClone, isDefinedAndNotNull, isUndefined } from '@core/utils'; | @@ -32,7 +32,6 @@ import { deepClone, isDefinedAndNotNull, isUndefined } from '@core/utils'; | ||
32 | import { WINDOW } from '@core/services/window.service'; | 32 | import { WINDOW } from '@core/services/window.service'; |
33 | import { JsonObject } from '@angular/compiler-cli/ngcc/src/packages/entry_point'; | 33 | import { JsonObject } from '@angular/compiler-cli/ngcc/src/packages/entry_point'; |
34 | import { Direction } from '@shared/models/page/sort-order'; | 34 | import { Direction } from '@shared/models/page/sort-order'; |
35 | -import { TranslateService } from '@ngx-translate/core'; | ||
36 | 35 | ||
37 | @Component({ | 36 | @Component({ |
38 | selector: 'tb-profile-lwm2m-device-transport-configuration', | 37 | selector: 'tb-profile-lwm2m-device-transport-configuration', |
@@ -69,7 +68,6 @@ export class Lwm2mDeviceProfileTransportConfigurationComponent implements Contro | @@ -69,7 +68,6 @@ export class Lwm2mDeviceProfileTransportConfigurationComponent implements Contro | ||
69 | } | 68 | } |
70 | 69 | ||
71 | constructor(private store: Store<AppState>, | 70 | constructor(private store: Store<AppState>, |
72 | - public translate: TranslateService, | ||
73 | private fb: FormBuilder, | 71 | private fb: FormBuilder, |
74 | private deviceProfileService: DeviceProfileService, | 72 | private deviceProfileService: DeviceProfileService, |
75 | @Inject(WINDOW) private window: Window) { | 73 | @Inject(WINDOW) private window: Window) { |
@@ -39,19 +39,19 @@ | @@ -39,19 +39,19 @@ | ||
39 | <mat-icon>add</mat-icon> | 39 | <mat-icon>add</mat-icon> |
40 | </button> | 40 | </button> |
41 | <mat-error *ngIf="instancesListFormGroup.get('instanceIdInput').hasError('min')"> | 41 | <mat-error *ngIf="instancesListFormGroup.get('instanceIdInput').hasError('min')"> |
42 | - {{ translate.get('device-profile.lwm2m.valid-id-instance', { | 42 | + {{ 'device-profile.lwm2m.valid-id-instance' | translate: { |
43 | count: 2, instance: instanceId, min: instanceIdValueMin | 43 | count: 2, instance: instanceId, min: instanceIdValueMin |
44 | - }) | async }} | 44 | + } }} |
45 | </mat-error> | 45 | </mat-error> |
46 | <mat-error *ngIf="instancesListFormGroup.get('instanceIdInput').hasError('max')"> | 46 | <mat-error *ngIf="instancesListFormGroup.get('instanceIdInput').hasError('max')"> |
47 | - {{ translate.get('device-profile.lwm2m.valid-id-instance', { | 47 | + {{ 'device-profile.lwm2m.valid-id-instance' | translate: { |
48 | count: 1, instance: instanceId, max: instanceIdValueMax | 48 | count: 1, instance: instanceId, max: instanceIdValueMax |
49 | - }) | async }} | 49 | + } }} |
50 | </mat-error> | 50 | </mat-error> |
51 | <mat-error *ngIf="instancesListFormGroup.get('instanceIdInput').hasError('pattern')"> | 51 | <mat-error *ngIf="instancesListFormGroup.get('instanceIdInput').hasError('pattern')"> |
52 | - {{ translate.get('device-profile.lwm2m.valid-id-instance', { | 52 | + {{ 'device-profile.lwm2m.valid-id-instance' | translate: { |
53 | count: 0, instance: instanceId, max: instanceIdValueMax | 53 | count: 0, instance: instanceId, max: instanceIdValueMax |
54 | - }) | async }} | 54 | + } }} |
55 | </mat-error> | 55 | </mat-error> |
56 | </mat-form-field> | 56 | </mat-form-field> |
57 | </section> | 57 | </section> |
@@ -19,7 +19,6 @@ import { ControlValueAccessor, FormBuilder, FormGroup, NG_VALUE_ACCESSOR, Valida | @@ -19,7 +19,6 @@ import { ControlValueAccessor, FormBuilder, FormGroup, NG_VALUE_ACCESSOR, Valida | ||
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 { INSTANCES_ID_VALUE_MAX, INSTANCES_ID_VALUE_MIN, KEY_REGEXP_NUMBER } from './profile-config.models'; | 21 | import { INSTANCES_ID_VALUE_MAX, INSTANCES_ID_VALUE_MIN, KEY_REGEXP_NUMBER } from './profile-config.models'; |
22 | -import { TranslateService } from '@ngx-translate/core'; | ||
23 | import { DeviceProfileService } from '@core/http/device-profile.service'; | 22 | import { DeviceProfileService } from '@core/http/device-profile.service'; |
24 | 23 | ||
25 | @Component({ | 24 | @Component({ |
@@ -44,7 +43,6 @@ export class Lwm2mObjectAddInstancesListComponent implements ControlValueAccesso | @@ -44,7 +43,6 @@ export class Lwm2mObjectAddInstancesListComponent implements ControlValueAccesso | ||
44 | private propagateChange = (v: any) => { }; | 43 | private propagateChange = (v: any) => { }; |
45 | 44 | ||
46 | constructor(private store: Store<AppState>, | 45 | constructor(private store: Store<AppState>, |
47 | - public translate: TranslateService, | ||
48 | private deviceProfileService: DeviceProfileService, | 46 | private deviceProfileService: DeviceProfileService, |
49 | private fb: FormBuilder) { | 47 | private fb: FormBuilder) { |
50 | this.instancesListFormGroup = this.fb.group({ | 48 | this.instancesListFormGroup = this.fb.group({ |
@@ -44,7 +44,7 @@ | @@ -44,7 +44,7 @@ | ||
44 | </mat-option> | 44 | </mat-option> |
45 | <mat-option *ngIf="!(filteredObjectsList | async)?.length" [value]="null"> | 45 | <mat-option *ngIf="!(filteredObjectsList | async)?.length" [value]="null"> |
46 | <span> | 46 | <span> |
47 | - {{ translate.get('device-profile.lwm2m.no-objects-matching', {object: searchText}) | async }} | 47 | + {{ 'device-profile.lwm2m.no-objects-matching' | translate: {object: searchText} }} |
48 | </span> | 48 | </span> |
49 | </mat-option> | 49 | </mat-option> |
50 | </mat-autocomplete> | 50 | </mat-autocomplete> |
@@ -22,7 +22,6 @@ import { AppState } from '@core/core.state'; | @@ -22,7 +22,6 @@ import { AppState } from '@core/core.state'; | ||
22 | import { Observable } from 'rxjs'; | 22 | import { Observable } from 'rxjs'; |
23 | import { filter, map, mergeMap, publishReplay, refCount, tap } from 'rxjs/operators'; | 23 | import { filter, map, mergeMap, publishReplay, refCount, tap } from 'rxjs/operators'; |
24 | import { ModelValue, ObjectLwM2M } from './profile-config.models'; | 24 | import { ModelValue, ObjectLwM2M } from './profile-config.models'; |
25 | -import { TranslateService } from '@ngx-translate/core'; | ||
26 | import { DeviceProfileService } from '@core/http/device-profile.service'; | 25 | import { DeviceProfileService } from '@core/http/device-profile.service'; |
27 | import { Direction } from '@shared/models/page/sort-order'; | 26 | import { Direction } from '@shared/models/page/sort-order'; |
28 | import { isDefined, isDefinedAndNotNull, isEmptyStr, isString } from '@core/utils'; | 27 | import { isDefined, isDefinedAndNotNull, isEmptyStr, isString } from '@core/utils'; |
@@ -72,7 +71,6 @@ export class Lwm2mObjectListComponent implements ControlValueAccessor, OnInit, V | @@ -72,7 +71,6 @@ export class Lwm2mObjectListComponent implements ControlValueAccessor, OnInit, V | ||
72 | } | 71 | } |
73 | 72 | ||
74 | constructor(private store: Store<AppState>, | 73 | constructor(private store: Store<AppState>, |
75 | - public translate: TranslateService, | ||
76 | private deviceProfileService: DeviceProfileService, | 74 | private deviceProfileService: DeviceProfileService, |
77 | private fb: FormBuilder) { | 75 | private fb: FormBuilder) { |
78 | this.lwm2mListFormGroup = this.fb.group({ | 76 | this.lwm2mListFormGroup = this.fb.group({ |
@@ -52,16 +52,16 @@ | @@ -52,16 +52,16 @@ | ||
52 | </mat-error> | 52 | </mat-error> |
53 | <mat-error *ngIf="serverFormGroup.get('clientPublicKeyOrId').hasError('pattern')"> | 53 | <mat-error *ngIf="serverFormGroup.get('clientPublicKeyOrId').hasError('pattern')"> |
54 | {{ 'device.lwm2m-security-config.client-key' | translate }} | 54 | {{ 'device.lwm2m-security-config.client-key' | translate }} |
55 | - <strong>{{ translate.get('device.lwm2m-security-config.pattern_hex_dec', { | 55 | + <strong>{{ 'device.lwm2m-security-config.pattern_hex_dec' | translate: { |
56 | count: 0 | 56 | count: 0 |
57 | - }) | async }}</strong> | 57 | + } }}</strong> |
58 | </mat-error> | 58 | </mat-error> |
59 | <mat-error *ngIf="(serverFormGroup.get('clientPublicKeyOrId').hasError('maxlength') || | 59 | <mat-error *ngIf="(serverFormGroup.get('clientPublicKeyOrId').hasError('maxlength') || |
60 | serverFormGroup.get('clientPublicKeyOrId').hasError('minlength'))"> | 60 | serverFormGroup.get('clientPublicKeyOrId').hasError('minlength'))"> |
61 | {{ 'device.lwm2m-security-config.client-key' | translate }} | 61 | {{ 'device.lwm2m-security-config.client-key' | translate }} |
62 | - <strong>{{ translate.get('device.lwm2m-security-config.pattern_hex_dec', { | 62 | + <strong>{{ 'device.lwm2m-security-config.pattern_hex_dec' | translate: { |
63 | count: lenMaxClientPublicKeyOrId | 63 | count: lenMaxClientPublicKeyOrId |
64 | - }) | async }}</strong> | 64 | + } }}</strong> |
65 | </mat-error> | 65 | </mat-error> |
66 | </mat-form-field> | 66 | </mat-form-field> |
67 | <mat-form-field class="mat-block"> | 67 | <mat-form-field class="mat-block"> |
@@ -83,16 +83,16 @@ | @@ -83,16 +83,16 @@ | ||
83 | </mat-error> | 83 | </mat-error> |
84 | <mat-error *ngIf="serverFormGroup.get('clientSecretKey').hasError('pattern')"> | 84 | <mat-error *ngIf="serverFormGroup.get('clientSecretKey').hasError('pattern')"> |
85 | {{ 'device.lwm2m-security-config.client-key' | translate }} | 85 | {{ 'device.lwm2m-security-config.client-key' | translate }} |
86 | - <strong>{{ translate.get('device.lwm2m-security-config.pattern_hex_dec', { | 86 | + <strong>{{ 'device.lwm2m-security-config.pattern_hex_dec' | translate: { |
87 | count: 0 | 87 | count: 0 |
88 | - }) | async }}</strong> | 88 | + } }}</strong> |
89 | </mat-error> | 89 | </mat-error> |
90 | <mat-error *ngIf="(serverFormGroup.get('clientSecretKey').hasError('maxlength') || | 90 | <mat-error *ngIf="(serverFormGroup.get('clientSecretKey').hasError('maxlength') || |
91 | serverFormGroup.get('clientSecretKey').hasError('minlength'))"> | 91 | serverFormGroup.get('clientSecretKey').hasError('minlength'))"> |
92 | {{ 'device.lwm2m-security-config.client-key' | translate }} | 92 | {{ 'device.lwm2m-security-config.client-key' | translate }} |
93 | - <strong>{{ translate.get('device.lwm2m-security-config.pattern_hex_dec', { | 93 | + <strong>{{ 'device.lwm2m-security-config.pattern_hex_dec' | translate: { |
94 | count: lenMaxClientSecretKey | 94 | count: lenMaxClientSecretKey |
95 | - }) | async }}</strong> | 95 | + } }}</strong> |
96 | </mat-error> | 96 | </mat-error> |
97 | </mat-form-field> | 97 | </mat-form-field> |
98 | </div> | 98 | </div> |
@@ -31,7 +31,6 @@ import { Store } from '@ngrx/store'; | @@ -31,7 +31,6 @@ import { Store } from '@ngrx/store'; | ||
31 | import { AppState } from '@core/core.state'; | 31 | import { AppState } from '@core/core.state'; |
32 | import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; | 32 | import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; |
33 | import { PageComponent } from '@shared/components/page.component'; | 33 | import { PageComponent } from '@shared/components/page.component'; |
34 | -import { TranslateService } from '@ngx-translate/core'; | ||
35 | 34 | ||
36 | @Component({ | 35 | @Component({ |
37 | selector: 'tb-security-config-server-lwm2m', | 36 | selector: 'tb-security-config-server-lwm2m', |
@@ -61,7 +60,6 @@ export class SecurityConfigServerComponent extends PageComponent implements OnIn | @@ -61,7 +60,6 @@ export class SecurityConfigServerComponent extends PageComponent implements OnIn | ||
61 | constructor(protected store: Store<AppState>, | 60 | constructor(protected store: Store<AppState>, |
62 | @Inject(MAT_DIALOG_DATA) public data: DeviceCredentialsDialogLwm2mData, | 61 | @Inject(MAT_DIALOG_DATA) public data: DeviceCredentialsDialogLwm2mData, |
63 | public dialogRef: MatDialogRef<SecurityConfigServerComponent, object>, | 62 | public dialogRef: MatDialogRef<SecurityConfigServerComponent, object>, |
64 | - public translate: TranslateService, | ||
65 | public fb: FormBuilder) { | 63 | public fb: FormBuilder) { |
66 | super(store); | 64 | super(store); |
67 | } | 65 | } |
@@ -82,16 +82,16 @@ | @@ -82,16 +82,16 @@ | ||
82 | </mat-error> | 82 | </mat-error> |
83 | <mat-error *ngIf="lwm2mConfigFormGroup.get('clientKey').hasError('pattern')"> | 83 | <mat-error *ngIf="lwm2mConfigFormGroup.get('clientKey').hasError('pattern')"> |
84 | {{ 'device.lwm2m-security-config.client-key' | translate }} | 84 | {{ 'device.lwm2m-security-config.client-key' | translate }} |
85 | - <strong>{{ translate.get('device.lwm2m-security-config.pattern_hex_dec', { | 85 | + <strong>{{ 'device.lwm2m-security-config.pattern_hex_dec' | translate: { |
86 | count: 0 | 86 | count: 0 |
87 | - }) | async }}</strong> | 87 | + } }}</strong> |
88 | </mat-error> | 88 | </mat-error> |
89 | <mat-error *ngIf="(lwm2mConfigFormGroup.get('clientKey').hasError('maxlength') || | 89 | <mat-error *ngIf="(lwm2mConfigFormGroup.get('clientKey').hasError('maxlength') || |
90 | lwm2mConfigFormGroup.get('clientKey').hasError('minlength'))"> | 90 | lwm2mConfigFormGroup.get('clientKey').hasError('minlength'))"> |
91 | {{ 'device.lwm2m-security-config.client-key' | translate }} | 91 | {{ 'device.lwm2m-security-config.client-key' | translate }} |
92 | - <strong>{{ translate.get('device.lwm2m-security-config.pattern_hex_dec', { | 92 | + <strong>{{ 'device.lwm2m-security-config.pattern_hex_dec' | translate: { |
93 | count: lenMaxKeyClient | 93 | count: lenMaxKeyClient |
94 | - }) | async }}</strong> | 94 | + } }}</strong> |
95 | </mat-error> | 95 | </mat-error> |
96 | </mat-form-field> | 96 | </mat-form-field> |
97 | </div> | 97 | </div> |