law-common 11.3.21-beta.0 → 11.3.21-beta.1
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,10 @@ export interface IClassificationWindowConfig {
|
|
|
17
17
|
}>;
|
|
18
18
|
}
|
|
19
19
|
export interface SortableTimesheet {
|
|
20
|
-
projectClientName
|
|
21
|
-
designation
|
|
22
|
-
resourceName
|
|
23
|
-
dateCodeForsorting
|
|
20
|
+
projectClientName?: string;
|
|
21
|
+
designation?: string;
|
|
22
|
+
resourceName?: string;
|
|
23
|
+
dateCodeForsorting?: Date;
|
|
24
24
|
}
|
|
25
25
|
export declare class TimesheetEntityModel extends BaseEntityModel<EntityEnum.TIMESHEET> implements ITimesheetEntity {
|
|
26
26
|
id: number;
|
|
@@ -66,5 +66,5 @@ export declare class TimesheetEntityModel extends BaseEntityModel<EntityEnum.TIM
|
|
|
66
66
|
startDay: number;
|
|
67
67
|
endDay: Nullable<number>;
|
|
68
68
|
}>;
|
|
69
|
-
static sortByProjectAndDesignation
|
|
69
|
+
static sortByProjectAndDesignation(data: SortableTimesheet[], designations: IDesignationEntity[]): SortableTimesheet[];
|
|
70
70
|
}
|
|
@@ -156,18 +156,18 @@ 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 projectCompare = a.projectClientName.localeCompare(b.projectClientName);
|
|
159
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
160
|
+
const projectCompare = ((_a = a.projectClientName) !== null && _a !== void 0 ? _a : "").localeCompare((_b = b.projectClientName) !== null && _b !== void 0 ? _b : "");
|
|
161
161
|
if (projectCompare !== 0)
|
|
162
162
|
return projectCompare;
|
|
163
|
-
const priorityA = (
|
|
164
|
-
const priorityB = (
|
|
163
|
+
const priorityA = (_d = priorityMap.get((_c = a.designation) !== null && _c !== void 0 ? _c : "")) !== null && _d !== void 0 ? _d : Number.MAX_SAFE_INTEGER;
|
|
164
|
+
const priorityB = (_f = priorityMap.get((_e = b.designation) !== null && _e !== void 0 ? _e : "")) !== null && _f !== void 0 ? _f : Number.MAX_SAFE_INTEGER;
|
|
165
165
|
if (priorityA !== priorityB)
|
|
166
166
|
return priorityA - priorityB;
|
|
167
|
-
const resourceCompare = a.resourceName.localeCompare(b.resourceName);
|
|
167
|
+
const resourceCompare = ((_g = a.resourceName) !== null && _g !== void 0 ? _g : "").localeCompare((_h = b.resourceName) !== null && _h !== void 0 ? _h : "");
|
|
168
168
|
if (resourceCompare !== 0)
|
|
169
169
|
return resourceCompare;
|
|
170
|
-
return b.dateCodeForsorting.getTime() - a.dateCodeForsorting.getTime();
|
|
170
|
+
return ((_k = (_j = b.dateCodeForsorting) === null || _j === void 0 ? void 0 : _j.getTime()) !== null && _k !== void 0 ? _k : 0) - ((_m = (_l = a.dateCodeForsorting) === null || _l === void 0 ? void 0 : _l.getTime()) !== null && _m !== void 0 ? _m : 0);
|
|
171
171
|
});
|
|
172
172
|
}
|
|
173
173
|
}
|