mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-19 17:14:57 +00:00
#1115 - fixed error on test
This commit is contained in:
parent
94db90eb19
commit
5d1e638df1
@ -158,11 +158,11 @@ export class WidgetVisibilityService {
|
||||
|
||||
private isSearchedField(field: FormFieldModel, fieldToFind: string) {
|
||||
let forrmattedFieldName = this.removeLabel(field, fieldToFind);
|
||||
return field.name.toUpperCase() === forrmattedFieldName.toUpperCase();
|
||||
return field.name ? field.name.toUpperCase() === forrmattedFieldName.toUpperCase() : false;
|
||||
}
|
||||
|
||||
private removeLabel(field: FormFieldModel, fieldToFind) {
|
||||
let formattedFieldName = fieldToFind;
|
||||
let formattedFieldName = fieldToFind || '';
|
||||
if (field.fieldType === 'RestFieldRepresentation' && fieldToFind.indexOf('_LABEL') > 0) {
|
||||
formattedFieldName = fieldToFind.substring(0, fieldToFind.length - 6);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user