@topconsultnpm/sdkui-react-beta 6.17.18 → 6.17.19
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { AccessLevels, AccessLevelsEx, AppModules, FileFormats, LayoutModes, SDK_Globals } from '@topconsultnpm/sdk-ts-beta';
|
|
3
|
-
import { IconActivity, IconArchiveDoc, IconBatchUpdate, IconCheckFile, IconCheckIn, IconCircleInfo, IconCloseCircle, IconConvertFilePdf, IconDelete, IconDotsVerticalCircleOutline, IconDownload, IconEdit, IconExportTo, IconFileDots, IconHide, IconInfo, IconMenuCAArchive, IconPlatform, IconPreview, IconRelation, IconSearch, IconShow, IconSignature, IconStar, IconSubstFile, IconUndo, IconUserGroupOutline, SDKUI_Localizator, svgToString } from '../../../helper';
|
|
2
|
+
import { AccessLevels, AccessLevelsEx, AppModules, FileFormats, LayoutModes, SDK_Globals, DcmtTypeListCacheService } from '@topconsultnpm/sdk-ts-beta';
|
|
3
|
+
import { IconActivity, IconArchiveDoc, IconBatchUpdate, IconCheckFile, IconCheckIn, IconCircleInfo, IconCloseCircle, IconConvertFilePdf, IconDelete, IconDotsVerticalCircleOutline, IconDownload, IconEdit, IconExportTo, IconFileDots, IconHide, IconInfo, IconMenuCAArchive, IconPlatform, IconPreview, IconRelation, IconSearch, IconShow, IconSignature, IconStar, IconSubstFile, IconUndo, IconUserGroupOutline, SDKUI_Localizator, svgToString, searchResultToMetadataValues } from '../../../helper';
|
|
4
4
|
import ShowAlert from '../../base/TMAlert';
|
|
5
5
|
import { TMMessageBoxManager, ButtonNames, TMExceptionBoxManager } from '../../base/TMPopUp';
|
|
6
6
|
import TMSpinner from '../../base/TMSpinner';
|
|
@@ -215,10 +215,27 @@ export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem,
|
|
|
215
215
|
operationType: 'singleRow',
|
|
216
216
|
disabled: disabledForSingleRow(selectedItems, focusedItem),
|
|
217
217
|
onClick: async () => {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
218
|
+
try {
|
|
219
|
+
const item = selectedItems.length === 1 ? selectedItems[0] : focusedItem;
|
|
220
|
+
if (!item?.TID || !item?.DID)
|
|
221
|
+
return;
|
|
222
|
+
TMSpinner.show({ description: SDKUI_Localizator.Loading });
|
|
223
|
+
const getMetadataResult = await SDK_Globals.tmSession?.NewSearchEngine().GetMetadataAsync(item.TID, item.DID, true);
|
|
224
|
+
const dtdFull = getMetadataResult?.dtdResult;
|
|
225
|
+
const rowsFull = dtdFull?.rows ? dtdFull.rows[0] : [];
|
|
226
|
+
const midsFull = getMetadataResult?.selectMIDs;
|
|
227
|
+
const dtdWithMetadata = await DcmtTypeListCacheService.GetWithNotGrantedAsync(item.TID, item.DID, getMetadataResult);
|
|
228
|
+
const allMetadataValues = searchResultToMetadataValues(item.TID, dtdFull, rowsFull, midsFull, dtdWithMetadata?.metadata, LayoutModes.Update);
|
|
229
|
+
const outputMids = allMetadataValues
|
|
230
|
+
?.filter(md => md.mid && md.mid > 100 && md.value && md.value.length > 0)
|
|
231
|
+
.map(md => ({ mid: md.mid, value: md.value })) || [];
|
|
232
|
+
TMSpinner.hide();
|
|
233
|
+
passToArchiveCallback?.(outputMids);
|
|
234
|
+
}
|
|
235
|
+
catch (error) {
|
|
236
|
+
TMSpinner.hide();
|
|
237
|
+
TMExceptionBoxManager.show({ exception: error });
|
|
238
|
+
}
|
|
222
239
|
}
|
|
223
240
|
};
|
|
224
241
|
};
|