Commit 18a57bcefc0f7b7707ffbd2f1b258cd68bbc5378
1 parent
9d3fe774
fixed save required field with disabled showActionButton
Showing
1 changed file
with
2 additions
and
2 deletions
... | ... | @@ -24,7 +24,7 @@ import { UtilsService } from '@core/services/utils.service'; |
24 | 24 | import { TranslateService } from '@ngx-translate/core'; |
25 | 25 | import { DataKey, Datasource, DatasourceData, DatasourceType, WidgetConfig } from '@shared/models/widget.models'; |
26 | 26 | import { IWidgetSubscription } from '@core/api/widget-api.models'; |
27 | -import { createLabelFromDatasource, isDefined, isDefinedAndNotNull, isEqual, isUndefined } from '@core/utils'; | |
27 | +import { createLabelFromDatasource, isDefinedAndNotNull, isEqual, isNotEmptyStr, isUndefined } from '@core/utils'; | |
28 | 28 | import { EntityType } from '@shared/models/entity-type.models'; |
29 | 29 | import * as _moment from 'moment'; |
30 | 30 | import { FormBuilder, FormGroup, ValidatorFn, Validators } from '@angular/forms'; |
... | ... | @@ -488,7 +488,7 @@ export class MultipleInputWidgetComponent extends PageComponent implements OnIni |
488 | 488 | public inputChanged(source: MultipleInputWidgetSource, key: MultipleInputWidgetDataKey) { |
489 | 489 | if (!this.settings.showActionButtons) { |
490 | 490 | const currentValue = this.multipleInputFormGroup.get(key.formId).value; |
491 | - if (!key.settings.required || (key.settings.required && isDefined(currentValue))) { | |
491 | + if (!key.settings.required || (key.settings.required && isDefinedAndNotNull(currentValue) && isNotEmptyStr(currentValue.toString()))) { | |
492 | 492 | const dataToSave: MultipleInputWidgetSource = { |
493 | 493 | datasource: source.datasource, |
494 | 494 | keys: [key] | ... | ... |