Skip to content

Commit 9cf2a9a

Browse files
authored
Merge branch 'release/6.2.3' into NAE-1739
2 parents fb70880 + 6313da1 commit 9cf2a9a

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

projects/netgrif-components-core/src/lib/data-fields/i18n-field/models/i18n-field.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ export class I18nField extends DataField<I18nFieldValue> {
3636
}
3737

3838
private static translationsEquality(a: I18nFieldValue, b: I18nFieldValue): boolean {
39-
const aKeys = Object.keys(a.translations).sort();
40-
const bKeys = Object.keys(b.translations).sort();
39+
const aKeys = !!a.translations ? Object.keys(a.translations).sort() : [];
40+
const bKeys = !!b.translations ? Object.keys(b.translations).sort() : [];
4141
if (aKeys.length !== bKeys.length
4242
|| !aKeys.every((element, index) => {
4343
return element === bKeys[index];
@@ -166,14 +166,14 @@ export class I18nField extends DataField<I18nFieldValue> {
166166
private validTranslationRequired(countries: Array<string>): ValidatorFn {
167167
return (fc: FormControl): { [key: string]: any } | null => {
168168
return countries.every(languageCode => languageCode in fc.value.translations)
169-
? (null) : ({translationRequired: true});
169+
? null : ({translationRequired: true});
170170
};
171171
}
172172

173173
private validTranslationOnly(countries: Array<string>): ValidatorFn {
174174
return (fc: FormControl): { [key: string]: any } | null => {
175175
return Object.keys(fc.value.translations).every(translation => countries.includes(translation))
176-
? (null) : ({translationOnly: true});
176+
? null : ({translationOnly: true});
177177
};
178178
}
179179

projects/netgrif-components/src/lib/data-fields/boolean-field/boolean-field.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<mat-slide-toggle color="primary" [formControl]="formControl">
1313
{{createValueLabel()}}
1414
</mat-slide-toggle>
15+
<mat-hint>{{dataField.description}}</mat-hint>
1516
<mat-error *ngIf="dataField.isInvalid(formControl)">{{getErrorMessage()}}</mat-error>
1617
</div>
1718
</ng-template>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
mat-hint {
2+
display: block;
3+
}

0 commit comments

Comments
 (0)