mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACA-3700] - add suspended date filter (#6886)
* [ACA-3700] - add suspended date filter * fix process list filtering Co-authored-by: Silviu Constantin Popa <silviucpopa@L3700101120.ness.com>
This commit is contained in:
@@ -248,6 +248,7 @@
|
|||||||
"PROCESS_NAME": "Process Name",
|
"PROCESS_NAME": "Process Name",
|
||||||
"APP_VERSION": "AppVersion",
|
"APP_VERSION": "AppVersion",
|
||||||
"STARTED_DATE": "Started Date",
|
"STARTED_DATE": "Started Date",
|
||||||
|
"SUSPENDED_DATE": "Suspended Date",
|
||||||
"STARTED_BY": "Started by",
|
"STARTED_BY": "Started by",
|
||||||
"COMPLETED_DATE": "Completed Date",
|
"COMPLETED_DATE": "Completed Date",
|
||||||
"DATE_RANGE": {
|
"DATE_RANGE": {
|
||||||
|
@@ -400,6 +400,21 @@ describe('EditProcessFilterCloudComponent', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should get form attributes for suspendedData', async() => {
|
||||||
|
fixture.detectChanges();
|
||||||
|
component.filterProperties = ['appName', 'suspendedDateRange'];
|
||||||
|
fixture.detectChanges();
|
||||||
|
const processFilterIdChange = new SimpleChange(null, 'mock-process-filter-id', true);
|
||||||
|
component.ngOnChanges({ 'id': processFilterIdChange });
|
||||||
|
fixture.detectChanges();
|
||||||
|
fixture.whenStable().then(() => {
|
||||||
|
fixture.detectChanges();
|
||||||
|
expect(component.editProcessFilterForm.get('_suspendedFrom')).toBeDefined();
|
||||||
|
expect(component.editProcessFilterForm.get('_suspendedTo')).toBeDefined();
|
||||||
|
expect(component.editProcessFilterForm.get('suspendedDateType')).toBeDefined();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
it('should able to build a editProcessFilter form with default properties if input is empty', async(() => {
|
it('should able to build a editProcessFilter form with default properties if input is empty', async(() => {
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
component.filterProperties = [];
|
component.filterProperties = [];
|
||||||
|
@@ -777,6 +777,17 @@ export class EditProcessFilterCloudComponent implements OnInit, OnChanges, OnDes
|
|||||||
_startFrom: filterModel.startFrom || null,
|
_startFrom: filterModel.startFrom || null,
|
||||||
_startTo: filterModel.startTo || null
|
_startTo: filterModel.startTo || null
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'ADF_CLOUD_EDIT_PROCESS_FILTER.LABEL.SUSPENDED_DATE',
|
||||||
|
type: 'date-range',
|
||||||
|
key: 'suspendedDateRange',
|
||||||
|
attributes: { dateType: 'suspendedDateType', from: '_suspendedFrom', to: '_suspendedTo'},
|
||||||
|
value: {
|
||||||
|
suspendedDateType: filterModel.suspendedDateType || null,
|
||||||
|
_startFrom: filterModel.suspendedFrom || null,
|
||||||
|
_startTo: filterModel.suspendedTo || null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@@ -44,12 +44,15 @@ export class ProcessFilterCloudModel {
|
|||||||
startedDate: Date;
|
startedDate: Date;
|
||||||
completedDateType: DateCloudFilterType;
|
completedDateType: DateCloudFilterType;
|
||||||
startedDateType: DateCloudFilterType;
|
startedDateType: DateCloudFilterType;
|
||||||
|
suspendedDateType: DateCloudFilterType;
|
||||||
completedDate: Date;
|
completedDate: Date;
|
||||||
|
|
||||||
private _completedFrom: string;
|
private _completedFrom: string;
|
||||||
private _completedTo: string;
|
private _completedTo: string;
|
||||||
private _startFrom: string;
|
private _startFrom: string;
|
||||||
private _startTo: string;
|
private _startTo: string;
|
||||||
|
private _suspendedFrom: string;
|
||||||
|
private _suspendedTo: string;
|
||||||
|
|
||||||
constructor(obj?: any) {
|
constructor(obj?: any) {
|
||||||
if (obj) {
|
if (obj) {
|
||||||
@@ -82,9 +85,12 @@ export class ProcessFilterCloudModel {
|
|||||||
this.startTo = obj._startTo || null;
|
this.startTo = obj._startTo || null;
|
||||||
this.completedDateType = obj.completedDateType || null;
|
this.completedDateType = obj.completedDateType || null;
|
||||||
this.startedDateType = obj.startedDateType || null;
|
this.startedDateType = obj.startedDateType || null;
|
||||||
|
this.suspendedDateType = obj.suspendedDateType || null;
|
||||||
this.completedFrom = obj._completedFrom || null;
|
this.completedFrom = obj._completedFrom || null;
|
||||||
this.completedTo = obj._completedTo || null;
|
this.completedTo = obj._completedTo || null;
|
||||||
this.completedDate = obj.completedDate || null;
|
this.completedDate = obj.completedDate || null;
|
||||||
|
this._suspendedFrom = obj._suspendedFrom || null;
|
||||||
|
this._suspendedTo = obj._suspendedTo || null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -132,6 +138,28 @@ export class ProcessFilterCloudModel {
|
|||||||
return this.getEndDate(this.startedDateType);
|
return this.getEndDate(this.startedDateType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
set suspendedFrom(suspendedFrom: string) {
|
||||||
|
this._suspendedFrom = suspendedFrom;
|
||||||
|
}
|
||||||
|
|
||||||
|
set suspendedTo(suspendedTo: string) {
|
||||||
|
this._suspendedTo = suspendedTo;
|
||||||
|
}
|
||||||
|
|
||||||
|
get suspendedFrom(): string {
|
||||||
|
if (this.isDateRangeType(this.suspendedDateType)) {
|
||||||
|
return this._suspendedFrom;
|
||||||
|
}
|
||||||
|
return this.getEndDate(this.suspendedDateType);
|
||||||
|
}
|
||||||
|
|
||||||
|
get suspendedTo(): string {
|
||||||
|
if (this.isDateRangeType(this.suspendedDateType)) {
|
||||||
|
return this._suspendedTo;
|
||||||
|
}
|
||||||
|
return this.getEndDate(this.suspendedDateType);
|
||||||
|
}
|
||||||
|
|
||||||
private getStartDate(key: DateCloudFilterType) {
|
private getStartDate(key: DateCloudFilterType) {
|
||||||
return this.dateRangeFilterService.getDateRange(key).startDate;
|
return this.dateRangeFilterService.getDateRange(key).startDate;
|
||||||
}
|
}
|
||||||
|
@@ -110,6 +110,14 @@ export class ProcessListCloudComponent extends DataTableSchema implements OnChan
|
|||||||
@Input()
|
@Input()
|
||||||
completedDate: string = '';
|
completedDate: string = '';
|
||||||
|
|
||||||
|
/** Filter the processes. Display only process with suspendedFrom equal to the supplied date. */
|
||||||
|
@Input()
|
||||||
|
suspendedFrom: string = '';
|
||||||
|
|
||||||
|
/** Filter the processes. Display only process with suspendedTo equal to the supplied date. */
|
||||||
|
@Input()
|
||||||
|
suspendedTo: string = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Row selection mode. Can be "none", "single" or "multiple".
|
* Row selection mode. Can be "none", "single" or "multiple".
|
||||||
* For multiple mode, you can use Cmd (macOS) or Ctrl (Win) modifier
|
* For multiple mode, you can use Cmd (macOS) or Ctrl (Win) modifier
|
||||||
@@ -341,6 +349,8 @@ export class ProcessListCloudComponent extends DataTableSchema implements OnChan
|
|||||||
startTo: this.startTo,
|
startTo: this.startTo,
|
||||||
completedFrom: this.completedFrom,
|
completedFrom: this.completedFrom,
|
||||||
completedTo: this.completedTo,
|
completedTo: this.completedTo,
|
||||||
|
suspendedFrom: this.suspendedFrom,
|
||||||
|
suspendedTo: this.suspendedTo,
|
||||||
completedDate: this.completedDate,
|
completedDate: this.completedDate,
|
||||||
sorting: this.sorting
|
sorting: this.sorting
|
||||||
};
|
};
|
||||||
|
@@ -36,6 +36,8 @@ export class ProcessQueryCloudRequestModel {
|
|||||||
startTo?: string;
|
startTo?: string;
|
||||||
completedFrom?: string;
|
completedFrom?: string;
|
||||||
completedTo?: string;
|
completedTo?: string;
|
||||||
|
suspendedFrom?: string;
|
||||||
|
suspendedTo?: string;
|
||||||
completedDate?: string;
|
completedDate?: string;
|
||||||
maxItems: number;
|
maxItems: number;
|
||||||
skipCount: number;
|
skipCount: number;
|
||||||
@@ -60,6 +62,8 @@ export class ProcessQueryCloudRequestModel {
|
|||||||
this.startTo = obj.startTo;
|
this.startTo = obj.startTo;
|
||||||
this.completedFrom = obj.completedFrom;
|
this.completedFrom = obj.completedFrom;
|
||||||
this.completedTo = obj.completedTo;
|
this.completedTo = obj.completedTo;
|
||||||
|
this.suspendedFrom = obj.suspendedFrom;
|
||||||
|
this.suspendedTo = obj.suspendedTo;
|
||||||
this.completedDate = obj.completedDate;
|
this.completedDate = obj.completedDate;
|
||||||
this.maxItems = obj.maxItems;
|
this.maxItems = obj.maxItems;
|
||||||
this.skipCount = obj.skipCount;
|
this.skipCount = obj.skipCount;
|
||||||
|
Reference in New Issue
Block a user