mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4861] Fix memory leak in Date widgets and Form Cloud Model (#5041)
* [ADF-4836] Fix memory leak in Date widgets and Form Cloud Model * Remove unit tests based on old logic
This commit is contained in:
committed by
Eugenio Romano
parent
f731988ca6
commit
2def8d0557
@@ -83,8 +83,8 @@ export class FormFieldModel extends FormWidgetModel {
|
|||||||
return this._value;
|
return this._value;
|
||||||
}
|
}
|
||||||
|
|
||||||
set value(v: any) {
|
set value(value: any) {
|
||||||
this._value = v;
|
this._value = value;
|
||||||
this.updateForm();
|
this.updateForm();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -87,23 +87,6 @@ describe('DateTimeWidgetComponent', () => {
|
|||||||
expect(widget.maxDate.isSame(expected)).toBeTruthy();
|
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', () => {
|
describe('template check', () => {
|
||||||
|
|
||||||
it('should show visible date widget', async(() => {
|
it('should show visible date widget', async(() => {
|
||||||
|
@@ -94,7 +94,6 @@ export class DateTimeWidgetComponent extends WidgetComponent implements OnInit,
|
|||||||
} else {
|
} else {
|
||||||
this.field.value = null;
|
this.field.value = null;
|
||||||
}
|
}
|
||||||
this.onFieldChanged(this.field);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -81,23 +81,6 @@ describe('DateWidgetComponent', () => {
|
|||||||
expect(widget.maxDate.isSame(expected)).toBeTruthy();
|
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', () => {
|
describe('template check', () => {
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
|
@@ -89,6 +89,5 @@ export class DateWidgetComponent extends WidgetComponent implements OnInit, OnDe
|
|||||||
} else {
|
} else {
|
||||||
this.field.value = null;
|
this.field.value = null;
|
||||||
}
|
}
|
||||||
this.onFieldChanged(this.field);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -80,23 +80,6 @@ describe('DateWidgetComponent', () => {
|
|||||||
expect(widget.maxDate.isSame(expected)).toBeTruthy();
|
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', () => {
|
describe('template check', () => {
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
|
@@ -86,6 +86,5 @@ export class DateCloudWidgetComponent extends WidgetComponent implements OnInit,
|
|||||||
} else {
|
} else {
|
||||||
this.field.value = null;
|
this.field.value = null;
|
||||||
}
|
}
|
||||||
this.onFieldChanged(this.field);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user