[TLC-254] Replace some undef/null tests with hasValue, hasNoValue

This commit is contained in:
Kim Shepherd
2022-04-19 14:05:16 +12:00
parent 617717069b
commit c414b8cebc
2 changed files with 16 additions and 7 deletions

View File

@@ -20,7 +20,16 @@ import {
} from '@ng-dynamic-forms/core';
import { isObject, isString, mergeWith } from 'lodash';
import { hasValue, isEmpty, isNotEmpty, isNotNull, isNotUndefined, isNull, isObjectEmpty } from '../../empty.util';
import {
hasNoValue,
hasValue,
isEmpty,
isNotEmpty,
isNotNull,
isNotUndefined,
isNull,
isObjectEmpty
} from '../../empty.util';
import { DynamicQualdropModel } from './ds-dynamic-form-ui/models/ds-dynamic-qualdrop.model';
import { SubmissionFormsModel } from '../../../core/config/models/config-submission-forms.model';
import { DYNAMIC_FORM_CONTROL_TYPE_TAG } from './ds-dynamic-form-ui/models/tag/dynamic-tag.model';
@@ -281,11 +290,11 @@ export class FormBuilderService extends DynamicFormService {
});
}
if (isNull(typeBindModel)) {
if (hasNoValue(typeBindModel)) {
typeBindModel = this.findById(this.typeField, rows);
}
if (typeBindModel !== null) {
if (hasValue(typeBindModel)) {
this.setTypeBindModel(typeBindModel);
}
return rows;