diff --git a/lib/core/form/components/widgets/core/form-field.model.ts b/lib/core/form/components/widgets/core/form-field.model.ts index 3ae937cac0..b859da13df 100644 --- a/lib/core/form/components/widgets/core/form-field.model.ts +++ b/lib/core/form/components/widgets/core/form-field.model.ts @@ -83,8 +83,8 @@ export class FormFieldModel extends FormWidgetModel { return this._value; } - set value(v: any) { - this._value = v; + set value(value: any) { + this._value = value; this.updateForm(); } diff --git a/lib/core/form/components/widgets/date-time/date-time.widget.spec.ts b/lib/core/form/components/widgets/date-time/date-time.widget.spec.ts index aca2a7b4cd..9b6755bf0a 100644 --- a/lib/core/form/components/widgets/date-time/date-time.widget.spec.ts +++ b/lib/core/form/components/widgets/date-time/date-time.widget.spec.ts @@ -87,23 +87,6 @@ describe('DateTimeWidgetComponent', () => { expect(widget.maxDate.isSame(expected)).toBeTruthy(); }); - it('should eval visibility on date changed', () => { - spyOn(widget, 'onFieldChanged').and.callThrough(); - - const field = new FormFieldModel(new FormModel(), { - id: 'date-field-id', - name: 'date-name', - value: '09-12-9999 10:00 AM', - type: 'datetime', - readOnly: 'false' - }); - - widget.field = field; - - widget.onDateChanged({ value: moment('1982-03-13T10:00:000Z') }); - expect(widget.onFieldChanged).toHaveBeenCalledWith(field); - }); - describe('template check', () => { it('should show visible date widget', async(() => { diff --git a/lib/core/form/components/widgets/date-time/date-time.widget.ts b/lib/core/form/components/widgets/date-time/date-time.widget.ts index 5462bc0921..778d6c69a0 100644 --- a/lib/core/form/components/widgets/date-time/date-time.widget.ts +++ b/lib/core/form/components/widgets/date-time/date-time.widget.ts @@ -94,7 +94,6 @@ export class DateTimeWidgetComponent extends WidgetComponent implements OnInit, } else { this.field.value = null; } - this.onFieldChanged(this.field); } } diff --git a/lib/core/form/components/widgets/date/date.widget.spec.ts b/lib/core/form/components/widgets/date/date.widget.spec.ts index 3f94065877..44d7396e3e 100644 --- a/lib/core/form/components/widgets/date/date.widget.spec.ts +++ b/lib/core/form/components/widgets/date/date.widget.spec.ts @@ -81,23 +81,6 @@ describe('DateWidgetComponent', () => { expect(widget.maxDate.isSame(expected)).toBeTruthy(); }); - it('should eval visibility on date changed', () => { - spyOn(widget, 'onFieldChanged').and.callThrough(); - - const field = new FormFieldModel(new FormModel(), { - id: 'date-field-id', - name: 'date-name', - value: '9-9-9999', - type: 'date', - readOnly: 'false' - }); - - widget.field = field; - - widget.onDateChanged({ value: moment('12/12/2012') }); - expect(widget.onFieldChanged).toHaveBeenCalledWith(field); - }); - describe('template check', () => { afterEach(() => { diff --git a/lib/core/form/components/widgets/date/date.widget.ts b/lib/core/form/components/widgets/date/date.widget.ts index 4f8966de88..3f09e9325b 100644 --- a/lib/core/form/components/widgets/date/date.widget.ts +++ b/lib/core/form/components/widgets/date/date.widget.ts @@ -89,6 +89,5 @@ export class DateWidgetComponent extends WidgetComponent implements OnInit, OnDe } else { this.field.value = null; } - this.onFieldChanged(this.field); } } diff --git a/lib/process-services-cloud/src/lib/form/components/date-cloud/date-cloud.widget.spec.ts b/lib/process-services-cloud/src/lib/form/components/date-cloud/date-cloud.widget.spec.ts index 728f9069af..c41098bd2e 100644 --- a/lib/process-services-cloud/src/lib/form/components/date-cloud/date-cloud.widget.spec.ts +++ b/lib/process-services-cloud/src/lib/form/components/date-cloud/date-cloud.widget.spec.ts @@ -80,23 +80,6 @@ describe('DateWidgetComponent', () => { expect(widget.maxDate.isSame(expected)).toBeTruthy(); }); - it('should eval visibility on date changed', () => { - spyOn(widget, 'onFieldChanged').and.callThrough(); - - const field = new FormFieldModel(new FormModel(), { - id: 'date-field-id', - name: 'date-name', - value: '9999-9-9', - type: 'date', - readOnly: 'false' - }); - - widget.field = field; - - widget.onDateChanged({ value: moment('12/12/2012') }); - expect(widget.onFieldChanged).toHaveBeenCalledWith(field); - }); - describe('template check', () => { afterEach(() => { diff --git a/lib/process-services-cloud/src/lib/form/components/date-cloud/date-cloud.widget.ts b/lib/process-services-cloud/src/lib/form/components/date-cloud/date-cloud.widget.ts index 633e4bbe85..2d8a520d68 100644 --- a/lib/process-services-cloud/src/lib/form/components/date-cloud/date-cloud.widget.ts +++ b/lib/process-services-cloud/src/lib/form/components/date-cloud/date-cloud.widget.ts @@ -86,6 +86,5 @@ export class DateCloudWidgetComponent extends WidgetComponent implements OnInit, } else { this.field.value = null; } - this.onFieldChanged(this.field); } }