@topconsultnpm/sdkui-react-beta 6.15.28 → 6.15.29
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.
|
@@ -183,18 +183,6 @@ const TMWGsCopyMoveForm = (props) => {
|
|
|
183
183
|
setSelectedWg(e.data);
|
|
184
184
|
}
|
|
185
185
|
}, [mode]);
|
|
186
|
-
const onRowDblClick = useCallback((e) => {
|
|
187
|
-
if (e.data) {
|
|
188
|
-
const isWgFolderRequired = mode !== 'copyToWgArchivedDoc';
|
|
189
|
-
if (isWgFolderRequired) {
|
|
190
|
-
setSelectedWg(e.data);
|
|
191
|
-
setCurrentStep(1);
|
|
192
|
-
}
|
|
193
|
-
else {
|
|
194
|
-
onSaveAsync();
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
}, [mode]);
|
|
198
186
|
// Handle selected folder
|
|
199
187
|
const handleSelectedFolder = (folderItem) => {
|
|
200
188
|
setSelectedFolder(folderItem);
|
|
@@ -237,12 +225,13 @@ const TMWGsCopyMoveForm = (props) => {
|
|
|
237
225
|
}
|
|
238
226
|
return '-';
|
|
239
227
|
};
|
|
240
|
-
const onSaveAsync = async () => {
|
|
228
|
+
const onSaveAsync = async (currentWg) => {
|
|
241
229
|
if (isDisabled)
|
|
242
230
|
return;
|
|
243
231
|
try {
|
|
232
|
+
const currentWorkingGroupDescriptor = currentWg ?? selectedWg;
|
|
244
233
|
const isWgFolderRequired = mode !== 'copyToWgArchivedDoc';
|
|
245
|
-
const missingWgOrFolder = isWgFolderRequired ? (!
|
|
234
|
+
const missingWgOrFolder = isWgFolderRequired ? (!currentWorkingGroupDescriptor || !selectedFolder) : !currentWorkingGroupDescriptor;
|
|
246
235
|
if (missingWgOrFolder) {
|
|
247
236
|
return Promise.resolve();
|
|
248
237
|
}
|
|
@@ -272,16 +261,16 @@ const TMWGsCopyMoveForm = (props) => {
|
|
|
272
261
|
setWaitPanelTextPrimary(`${i + 1}/${totalDrafts}`);
|
|
273
262
|
const item = context.selectedDrafts[i];
|
|
274
263
|
try {
|
|
275
|
-
if (isWgEngine && currentWorkingGroupDescriptor?.id &&
|
|
264
|
+
if (isWgEngine && currentWorkingGroupDescriptor?.id && currentWorkingGroupDescriptor && currentWorkingGroupDescriptor.id && selectedFolder && item.did) {
|
|
276
265
|
const draft = item;
|
|
277
266
|
const did = draft.did ?? 0;
|
|
278
267
|
if (mode === 'copy') {
|
|
279
|
-
await workingGroupEngine.DraftsCopyAsync(currentWorkingGroupDescriptor.id, did,
|
|
268
|
+
await workingGroupEngine.DraftsCopyAsync(currentWorkingGroupDescriptor.id, did, currentWorkingGroupDescriptor.id, selectedFolderId);
|
|
280
269
|
if (fetchTreeFileSystemForWorkingGroup)
|
|
281
270
|
fetchTreeFileSystemForWorkingGroup(currentWorkingGroupDescriptor.id);
|
|
282
271
|
}
|
|
283
272
|
else if (mode === 'move') {
|
|
284
|
-
await workingGroupEngine.DraftsMoveAsync(currentWorkingGroupDescriptor.id, did,
|
|
273
|
+
await workingGroupEngine.DraftsMoveAsync(currentWorkingGroupDescriptor.id, did, currentWorkingGroupDescriptor.id, selectedFolderId);
|
|
285
274
|
if (fetchTreeFileSystemForWorkingGroup)
|
|
286
275
|
fetchTreeFileSystemForWorkingGroup(currentWorkingGroupDescriptor.id);
|
|
287
276
|
}
|
|
@@ -328,6 +317,24 @@ const TMWGsCopyMoveForm = (props) => {
|
|
|
328
317
|
TMExceptionBoxManager.show({ exception: e });
|
|
329
318
|
}
|
|
330
319
|
};
|
|
320
|
+
// Callback function triggered when a row in the DataGrid is double-clicked
|
|
321
|
+
const onRowDblClick = useCallback((e) => {
|
|
322
|
+
// Check if the event contains valid row data
|
|
323
|
+
if (e.data) {
|
|
324
|
+
// Determine whether the workflow requires selecting a working group folder
|
|
325
|
+
const isWgFolderRequired = mode !== 'copyToWgArchivedDoc';
|
|
326
|
+
// Set the selected working group to the data from the clicked row
|
|
327
|
+
setSelectedWg(e.data);
|
|
328
|
+
// If a working group folder selection is required, move to the next step
|
|
329
|
+
if (isWgFolderRequired) {
|
|
330
|
+
setCurrentStep(1);
|
|
331
|
+
}
|
|
332
|
+
else {
|
|
333
|
+
// Otherwise, saving
|
|
334
|
+
onSaveAsync(e.data);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}, [mode, onSaveAsync]);
|
|
331
338
|
const cellIconRender = useCallback((cellData) => {
|
|
332
339
|
const data = cellData.data;
|
|
333
340
|
const tooltipContent = (_jsxs("div", { style: { textAlign: 'left' }, children: [_jsx("div", { children: _jsx("strong", { children: SDKUI_Localizator.WorkGroup }) }), _jsx("hr", {}), _jsxs("div", { children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "ID:" }), " ", data.id] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Name, ":"] }), " ", data.name ?? '-'] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.OwnerName, ":"] }), " ", data.ownerName ?? '-'] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.CreationTime, ":"] }), " ", Globalization.getDateTimeDisplayValue(data.creationTime)] })] }));
|