@topconsultnpm/sdkui-react 6.20.0-dev2.32 → 6.20.0-dev2.35
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.
|
@@ -62,6 +62,7 @@ export declare const getTaskNotPersonalAssignedToMe: (tasks: Array<TaskDescripto
|
|
|
62
62
|
export declare const getTaskPersonalAssignedToMe: (tasks: Array<TaskDescriptor>) => Array<TaskDescriptor>;
|
|
63
63
|
export declare const getTaskAssignedByMe: (tasks: Array<TaskDescriptor>) => Array<TaskDescriptor>;
|
|
64
64
|
export declare const getTaskNotCompletedAssignedByMe: (tasks: Array<TaskDescriptor>) => Array<TaskDescriptor>;
|
|
65
|
+
export declare const getTaskCompletedAssignedByMe: (tasks: Array<TaskDescriptor>) => Array<TaskDescriptor>;
|
|
65
66
|
export declare const getHeaderStatusFilterConfig: () => {
|
|
66
67
|
enabled: boolean;
|
|
67
68
|
dataSource: {
|
|
@@ -226,6 +226,24 @@ export const getTaskNotCompletedAssignedByMe = (tasks) => {
|
|
|
226
226
|
return a.endTime.getTime() - b.endTime.getTime();
|
|
227
227
|
});
|
|
228
228
|
};
|
|
229
|
+
export const getTaskCompletedAssignedByMe = (tasks) => {
|
|
230
|
+
const userID = SDK_Globals.tmSession?.SessionDescr?.userID;
|
|
231
|
+
return tasks
|
|
232
|
+
.filter((task) => task.toID !== undefined &&
|
|
233
|
+
task.toID !== userID &&
|
|
234
|
+
task.state === Task_States.Completed)
|
|
235
|
+
.sort((a, b) => {
|
|
236
|
+
// Task senza lastUpdateTime li mettiamo alla fine
|
|
237
|
+
if (!a.lastUpdateTime && !b.lastUpdateTime)
|
|
238
|
+
return 0;
|
|
239
|
+
if (!a.lastUpdateTime)
|
|
240
|
+
return 1; // a va dopo
|
|
241
|
+
if (!b.lastUpdateTime)
|
|
242
|
+
return -1; // b va dopo
|
|
243
|
+
// Ordine decrescente: più recente prima
|
|
244
|
+
return b.lastUpdateTime.getTime() - a.lastUpdateTime.getTime();
|
|
245
|
+
});
|
|
246
|
+
};
|
|
229
247
|
export const getHeaderStatusFilterConfig = () => ({
|
|
230
248
|
enabled: true,
|
|
231
249
|
dataSource: getStatusLocalizatorValues().map(item => ({
|
|
@@ -297,7 +315,10 @@ newTasks // Array of new tasks to merge
|
|
|
297
315
|
return Array.from(taskMap.values());
|
|
298
316
|
};
|
|
299
317
|
export const getOriginLabel = (pdg, ID1Name) => {
|
|
300
|
-
|
|
318
|
+
if (!pdg) {
|
|
319
|
+
return SDKUI_Localizator.NoSource;
|
|
320
|
+
}
|
|
321
|
+
let label = ID1Name ?? '';
|
|
301
322
|
try {
|
|
302
323
|
if (typeof label === 'string' && label.length > 0) {
|
|
303
324
|
// Rimuove: (TID: 123), (DID: 456), TID: 123, DID: 456
|
|
@@ -307,10 +328,9 @@ export const getOriginLabel = (pdg, ID1Name) => {
|
|
|
307
328
|
}
|
|
308
329
|
}
|
|
309
330
|
catch {
|
|
310
|
-
label
|
|
331
|
+
// Se fallisce, mantieni label così com'è ('' se undefined)
|
|
311
332
|
}
|
|
312
|
-
|
|
313
|
-
return pdg ? label : SDKUI_Localizator.NoSource;
|
|
333
|
+
return label;
|
|
314
334
|
};
|
|
315
335
|
export const taskValidatorAsync = async (taskDescriptor) => {
|
|
316
336
|
let vil = [];
|
|
@@ -26,9 +26,6 @@ export declare class UserSettings {
|
|
|
26
26
|
static LoadSettings(userID: number | undefined, archiveID: string | undefined): UserSettings;
|
|
27
27
|
/** Save settings to local storage or other sources */
|
|
28
28
|
static SaveSettings(settings: UserSettings): void;
|
|
29
|
-
/** Save default settings for properties that don't exist in localStorage yet.*/
|
|
30
|
-
static SaveDefaultSettings(//nosonar
|
|
31
|
-
userID: number | undefined, archiveID: string | undefined, defaultProperties?: string[]): void;
|
|
32
29
|
}
|
|
33
30
|
export declare class DataGridSettings {
|
|
34
31
|
showColumnLines: number;
|
|
@@ -59,59 +59,6 @@ export class UserSettings {
|
|
|
59
59
|
}));
|
|
60
60
|
LocalStorageService.setItem(`userSettings_${settings.archiveID}_${settings.userID}`, JSON.stringify(filteredSettings));
|
|
61
61
|
}
|
|
62
|
-
/** Save default settings for properties that don't exist in localStorage yet.*/
|
|
63
|
-
static SaveDefaultSettings(//nosonar
|
|
64
|
-
userID, archiveID, defaultProperties = ['devSettings.betaFeatures']) {
|
|
65
|
-
if (!userID || !archiveID) {
|
|
66
|
-
throw new Error('User ID and Archive ID are required to save default settings.');
|
|
67
|
-
}
|
|
68
|
-
// Load existing settings from local storage
|
|
69
|
-
const loadedSettings = LocalStorageService.getItem(`userSettings_${archiveID}_${userID}`);
|
|
70
|
-
// If no settings exist yet, save all defaults
|
|
71
|
-
if (!loadedSettings) {
|
|
72
|
-
const defaultSettings = new UserSettings(true);
|
|
73
|
-
const settingsToSave = {
|
|
74
|
-
userID: userID,
|
|
75
|
-
archiveID: archiveID,
|
|
76
|
-
devSettings: defaultSettings.devSettings
|
|
77
|
-
};
|
|
78
|
-
LocalStorageService.setItem(`userSettings_${archiveID}_${userID}`, JSON.stringify(settingsToSave));
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
// Check if any of the default properties are missing
|
|
82
|
-
let needsUpdate = false;
|
|
83
|
-
const defaultSettings = new UserSettings(true);
|
|
84
|
-
for (const propertyPath of defaultProperties) {
|
|
85
|
-
const pathParts = propertyPath.split('.');
|
|
86
|
-
let current = loadedSettings;
|
|
87
|
-
let exists = true;
|
|
88
|
-
// Check if the property exists in loaded settings
|
|
89
|
-
for (const part of pathParts) {
|
|
90
|
-
if (current && typeof current === 'object' && part in current) {
|
|
91
|
-
current = current[part];
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
exists = false;
|
|
95
|
-
break;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
// If property doesn't exist, we need to add it
|
|
99
|
-
if (!exists) {
|
|
100
|
-
needsUpdate = true;
|
|
101
|
-
// Add the missing property from defaults
|
|
102
|
-
const [topLevel] = pathParts;
|
|
103
|
-
if (!loadedSettings[topLevel]) {
|
|
104
|
-
loadedSettings[topLevel] = defaultSettings[topLevel];
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
// Save updated settings if needed
|
|
109
|
-
if (needsUpdate) {
|
|
110
|
-
loadedSettings.userID = userID;
|
|
111
|
-
loadedSettings.archiveID = archiveID;
|
|
112
|
-
LocalStorageService.setItem(`userSettings_${archiveID}_${userID}`, JSON.stringify(loadedSettings));
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
62
|
}
|
|
116
63
|
export class DataGridSettings {
|
|
117
64
|
constructor() {
|