law-common 11.3.21-beta.0 → 11.3.21-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -17,10 +17,11 @@ export interface IClassificationWindowConfig {
|
|
|
17
17
|
}>;
|
|
18
18
|
}
|
|
19
19
|
export interface SortableTimesheet {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
projectId?: number;
|
|
21
|
+
projectClientName?: string;
|
|
22
|
+
designation?: string;
|
|
23
|
+
resourceName?: string;
|
|
24
|
+
dateCodeForsorting?: Date;
|
|
24
25
|
}
|
|
25
26
|
export declare class TimesheetEntityModel extends BaseEntityModel<EntityEnum.TIMESHEET> implements ITimesheetEntity {
|
|
26
27
|
id: number;
|
|
@@ -66,5 +67,5 @@ export declare class TimesheetEntityModel extends BaseEntityModel<EntityEnum.TIM
|
|
|
66
67
|
startDay: number;
|
|
67
68
|
endDay: Nullable<number>;
|
|
68
69
|
}>;
|
|
69
|
-
static sortByProjectAndDesignation
|
|
70
|
+
static sortByProjectAndDesignation(data: SortableTimesheet[], designations: IDesignationEntity[]): SortableTimesheet[];
|
|
70
71
|
}
|
|
@@ -156,18 +156,22 @@ class TimesheetEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
156
156
|
priorityMap.set(d.name, (_a = d.order) !== null && _a !== void 0 ? _a : Number.MAX_SAFE_INTEGER);
|
|
157
157
|
});
|
|
158
158
|
return [...data].sort((a, b) => {
|
|
159
|
-
var _a, _b;
|
|
160
|
-
const
|
|
159
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
160
|
+
const aIsNB = ((_a = a.projectId) !== null && _a !== void 0 ? _a : 0) === 0;
|
|
161
|
+
const bIsNB = ((_b = b.projectId) !== null && _b !== void 0 ? _b : 0) === 0;
|
|
162
|
+
if (aIsNB !== bIsNB)
|
|
163
|
+
return aIsNB ? 1 : -1;
|
|
164
|
+
const projectCompare = ((_c = a.projectClientName) !== null && _c !== void 0 ? _c : "").localeCompare((_d = b.projectClientName) !== null && _d !== void 0 ? _d : "");
|
|
161
165
|
if (projectCompare !== 0)
|
|
162
166
|
return projectCompare;
|
|
163
|
-
const priorityA = (
|
|
164
|
-
const priorityB = (
|
|
167
|
+
const priorityA = (_f = priorityMap.get((_e = a.designation) !== null && _e !== void 0 ? _e : "")) !== null && _f !== void 0 ? _f : Number.MAX_SAFE_INTEGER;
|
|
168
|
+
const priorityB = (_h = priorityMap.get((_g = b.designation) !== null && _g !== void 0 ? _g : "")) !== null && _h !== void 0 ? _h : Number.MAX_SAFE_INTEGER;
|
|
165
169
|
if (priorityA !== priorityB)
|
|
166
170
|
return priorityA - priorityB;
|
|
167
|
-
const resourceCompare = a.resourceName.localeCompare(b.resourceName);
|
|
171
|
+
const resourceCompare = ((_j = a.resourceName) !== null && _j !== void 0 ? _j : "").localeCompare((_k = b.resourceName) !== null && _k !== void 0 ? _k : "");
|
|
168
172
|
if (resourceCompare !== 0)
|
|
169
173
|
return resourceCompare;
|
|
170
|
-
return b.dateCodeForsorting.getTime() - a.dateCodeForsorting.getTime();
|
|
174
|
+
return ((_m = (_l = b.dateCodeForsorting) === null || _l === void 0 ? void 0 : _l.getTime()) !== null && _m !== void 0 ? _m : 0) - ((_p = (_o = a.dateCodeForsorting) === null || _o === void 0 ? void 0 : _o.getTime()) !== null && _p !== void 0 ? _p : 0);
|
|
171
175
|
});
|
|
172
176
|
}
|
|
173
177
|
}
|