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