@topconsultnpm/sdkui-react 6.20.0-dev3.8 → 6.20.0-dev4.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.
Files changed (40) hide show
  1. package/lib/components/base/TMPopUp.js +4 -0
  2. package/lib/components/base/TMTreeView.js +12 -8
  3. package/lib/components/choosers/TMDataListItemChooser.js +1 -1
  4. package/lib/components/choosers/TMDataListItemFields.js +1 -1
  5. package/lib/components/choosers/TMDataListItemPicker.d.ts +1 -0
  6. package/lib/components/choosers/TMDataListItemPicker.js +5 -1
  7. package/lib/components/choosers/TMUserChooser.js +1 -1
  8. package/lib/components/editors/TMMetadataValues.js +200 -40
  9. package/lib/components/editors/TMTextArea.d.ts +1 -0
  10. package/lib/components/editors/TMTextArea.js +6 -6
  11. package/lib/components/features/documents/TMDcmtForm.js +13 -4
  12. package/lib/components/features/documents/TMFileUploader.js +12 -2
  13. package/lib/components/features/documents/TMMasterDetailDcmts.js +25 -63
  14. package/lib/components/features/documents/TMRelationViewer.js +109 -40
  15. package/lib/components/features/search/TMSearchQueryPanel.js +3 -3
  16. package/lib/components/features/search/TMSearchResult.js +2 -10
  17. package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +1 -1
  18. package/lib/components/features/search/TMSearchResultsMenuItems.js +1 -8
  19. package/lib/components/features/search/TMSignatureInfoContent.js +10 -6
  20. package/lib/components/features/tasks/TMTaskFormUtils.js +1 -1
  21. package/lib/components/features/workflow/TMWorkflowPopup.js +9 -19
  22. package/lib/components/features/workflow/diagram/DiagramItemForm.d.ts +2 -0
  23. package/lib/components/features/workflow/diagram/DiagramItemForm.js +32 -25
  24. package/lib/components/features/workflow/diagram/RecipientList.d.ts +3 -1
  25. package/lib/components/features/workflow/diagram/RecipientList.js +13 -9
  26. package/lib/components/features/workflow/diagram/WFDiagram.js +29 -2
  27. package/lib/components/features/workflow/diagram/workflowHelpers.js +31 -19
  28. package/lib/components/viewers/TMMidViewer.js +2 -1
  29. package/lib/components/viewers/TMTidViewer.js +2 -1
  30. package/lib/helper/SDKUI_Globals.d.ts +4 -0
  31. package/lib/helper/SDKUI_Globals.js +9 -1
  32. package/lib/helper/SDKUI_Localizator.d.ts +12 -4
  33. package/lib/helper/SDKUI_Localizator.js +104 -24
  34. package/lib/helper/TMUtils.d.ts +6 -40
  35. package/lib/helper/TMUtils.js +69 -166
  36. package/lib/hooks/useDataUserIdItem.js +2 -2
  37. package/lib/hooks/useRelatedDocuments.js +30 -31
  38. package/package.json +55 -55
  39. package/lib/components/features/search/TMSignSettingsForm.d.ts +0 -9
  40. package/lib/components/features/search/TMSignSettingsForm.js +0 -621
@@ -194,29 +194,6 @@ export const useRelatedDocuments = ({ selectedSearchResult, focusedItem, current
194
194
  setHasManyToManyRelation(false);
195
195
  }
196
196
  }, [selectedSearchResult?.fromTID]);
197
- const getFocusedItem = useCallback(() => {
198
- if (!focusedItem)
199
- return undefined;
200
- if (currentSearchResults.length === 1) {
201
- return { mdList: currentSearchResults[0].dtdResult?.rows?.[focusedItem?.rowIndex ?? 0], mids: currentSearchResults[0].selectMIDs ?? [] };
202
- }
203
- const matchingSearchResult = currentSearchResults.find(res => res.fromTID == focusedItem?.TID);
204
- if (!matchingSearchResult)
205
- return undefined;
206
- return {
207
- mdList: matchingSearchResult.dtdResult?.rows?.[focusedItem?.rowIndex ?? 0],
208
- mids: matchingSearchResult.selectMIDs ?? []
209
- };
210
- }, [focusedItem, currentSearchResults]);
211
- const fetchAssociatedValues = useCallback((mid) => {
212
- let mdList = getFocusedItem();
213
- if (!mdList)
214
- return;
215
- let index = mdList.mids.findIndex(m => m == mid);
216
- if (index === -1)
217
- return;
218
- return mdList.mdList?.[index];
219
- }, [getFocusedItem]);
220
197
  const filterRelationsByType = (relations, tid, type) => {
221
198
  return type === 'detail'
222
199
  ? relations.filter(r => r.masterTID == tid)
@@ -245,12 +222,34 @@ export const useRelatedDocuments = ({ selectedSearchResult, focusedItem, current
245
222
  duration: 5000
246
223
  });
247
224
  };
248
- const mapAssociationsToMids = useCallback((relation, type) => {
249
- return relation.associations?.map(assoc => ({
250
- mid: type === 'detail' ? (assoc.item2 ?? 0) : (assoc.item1 ?? 0),
251
- value: fetchAssociatedValues(type === 'detail' ? (assoc.item1 ?? 0) : (assoc.item2 ?? 0)) ?? ''
252
- })) ?? [];
253
- }, [fetchAssociatedValues]);
225
+ //This ensures archive master/detail works correctly regardless of output metadata configuration.
226
+ const mapAssociationsToMidsAsync = useCallback(async (relation, type) => {
227
+ if (!relation.associations || relation.associations.length === 0)
228
+ return [];
229
+ if (!focusedItem?.TID || !focusedItem?.DID)
230
+ return [];
231
+ const searchEngine = SDK_Globals.tmSession?.NewSearchEngine();
232
+ if (!searchEngine)
233
+ return [];
234
+ const allMetadata = await searchEngine.GetMetadataAsync(focusedItem.TID, focusedItem.DID, false);
235
+ if (!allMetadata?.dtdResult?.rows?.[0] || !allMetadata.selectMIDs)
236
+ return [];
237
+ const row = allMetadata.dtdResult.rows[0];
238
+ const mids = allMetadata.selectMIDs;
239
+ const metadataMap = new Map();
240
+ mids.forEach((mid, index) => {
241
+ const value = row[index];
242
+ if (value !== undefined && value !== null) {
243
+ metadataMap.set(mid, value.toString());
244
+ }
245
+ });
246
+ return relation.associations.map(assoc => {
247
+ const sourceMid = type === 'detail' ? (assoc.item1 ?? 0) : (assoc.item2 ?? 0);
248
+ const targetMid = type === 'detail' ? (assoc.item2 ?? 0) : (assoc.item1 ?? 0);
249
+ const value = metadataMap.get(sourceMid) ?? '';
250
+ return { mid: targetMid, value };
251
+ });
252
+ }, [focusedItem]);
254
253
  const archiveRelatedDcmtHandler = useCallback(async (relation, type) => {
255
254
  const targetTID = type === 'detail' ? relation.detailTID : relation.masterTID;
256
255
  if (!targetTID)
@@ -268,7 +267,7 @@ export const useRelatedDocuments = ({ selectedSearchResult, focusedItem, current
268
267
  });
269
268
  return;
270
269
  }
271
- const mids = mapAssociationsToMids(relation, type);
270
+ const mids = await mapAssociationsToMidsAsync(relation, type);
272
271
  setArchiveType(type);
273
272
  setArchiveRelatedDcmtFormTID(targetTID);
274
273
  setArchiveRelatedDcmtFormMids(mids);
@@ -278,7 +277,7 @@ export const useRelatedDocuments = ({ selectedSearchResult, focusedItem, current
278
277
  console.error("Error checking archive permissions:", error);
279
278
  TMExceptionBoxManager.show({ exception: error });
280
279
  }
281
- }, [mapAssociationsToMids]);
280
+ }, [mapAssociationsToMidsAsync]);
282
281
  const filterRelationsByPermission = async (relations, type) => {
283
282
  const dataSourcePromises = relations.map(async (rel) => {
284
283
  const targetTID = type === 'detail' ? rel.detailTID : rel.masterTID;
package/package.json CHANGED
@@ -1,57 +1,57 @@
1
1
  {
2
- "name": "@topconsultnpm/sdkui-react",
3
- "version": "6.20.0-dev3.8",
4
- "description": "",
5
- "scripts": {
6
- "test": "echo \"Error: no test specified\" && exit 1",
7
- "clean": "powershell Remove-Item lib/ -recurse",
8
- "copy-files": "copyfiles -u 1 src/assets/*.* src/assets/ImageLibrary/*.* src/assets/thumbnails/*.* src/assets/IconsS4t/*.* src/assets/Metadata/*.* src/css/tm-sdkui.css lib/",
9
- "tm-build": "npm run clean && tsc && npm run copy-files",
10
- "tm-watch": "tsc -w",
11
- "tm-publish": "npm publish --tag latest",
12
- "tm-publish_wl": "npm publish",
13
- "storybook": "storybook dev -p 6006",
14
- "build-storybook": "storybook build"
15
- },
16
- "author": "TopConsult",
17
- "license": "ISC",
18
- "devDependencies": {
19
- "@chromatic-com/storybook": "^4.1.3",
20
- "@storybook/addon-docs": "^10.1.0",
21
- "@storybook/addon-onboarding": "^10.1.0",
22
- "@storybook/react-vite": "^10.1.0",
23
- "@types/htmlparser2": "^3.10.7",
24
- "@types/node": "^20.2.5",
25
- "@types/react": "^18.3.3",
26
- "@types/react-dom": "^18.3.3",
27
- "copyfiles": "^2.4.1",
28
- "esbuild": "^0.25.0",
29
- "react": "^18.3.1",
30
- "react-dom": "^18.3.1",
31
- "storybook": "^10.1.0",
32
- "typescript": "^5.9.3",
33
- "vite": "^6.1.1"
34
- },
35
- "main": "dist/cjs/index.js",
36
- "types": "./index.d.ts",
37
- "module": "lib/esm/index.js",
38
- "files": [
39
- "dist",
40
- "lib"
41
- ],
42
- "dependencies": {
43
- "@topconsultnpm/sdk-ts": "6.20.0-t2",
44
- "buffer": "^6.0.3",
45
- "devextreme": "25.2.4",
46
- "devextreme-react": "25.2.4",
47
- "exceljs": "^4.4.0",
48
- "htmlparser2": "^10.0.0",
49
- "pdfjs-dist": "5.4.296",
50
- "react-pdf": "^10.3.0",
51
- "react-router-dom": "^6.15.0",
52
- "styled-components": "^6.1.1"
53
- },
54
- "overrides": {
55
- "esbuild": "^0.25.0"
56
- }
2
+ "name": "@topconsultnpm/sdkui-react",
3
+ "version": "6.20.0-dev4.2",
4
+ "description": "",
5
+ "scripts": {
6
+ "test": "echo \"Error: no test specified\" \u0026\u0026 exit 1",
7
+ "clean": "powershell Remove-Item lib/ -recurse",
8
+ "copy-files": "copyfiles -u 1 src/assets/*.* src/assets/ImageLibrary/*.* src/assets/thumbnails/*.* src/assets/IconsS4t/*.* src/assets/Metadata/*.* src/css/tm-sdkui.css lib/",
9
+ "tm-build": "npm run clean \u0026\u0026 tsc \u0026\u0026 npm run copy-files",
10
+ "tm-watch": "tsc -w",
11
+ "tm-publish": "npm publish --tag latest",
12
+ "tm-publish_wl": "npm publish",
13
+ "storybook": "storybook dev -p 6006",
14
+ "build-storybook": "storybook build"
15
+ },
16
+ "author": "TopConsult",
17
+ "license": "ISC",
18
+ "devDependencies": {
19
+ "@chromatic-com/storybook": "^4.1.3",
20
+ "@storybook/addon-docs": "^10.1.0",
21
+ "@storybook/addon-onboarding": "^10.1.0",
22
+ "@storybook/react-vite": "^10.1.0",
23
+ "@types/htmlparser2": "^3.10.7",
24
+ "@types/node": "^20.2.5",
25
+ "@types/react": "^18.3.3",
26
+ "@types/react-dom": "^18.3.3",
27
+ "copyfiles": "^2.4.1",
28
+ "esbuild": "^0.25.0",
29
+ "react": "^18.3.1",
30
+ "react-dom": "^18.3.1",
31
+ "storybook": "^10.1.0",
32
+ "typescript": "^5.9.3",
33
+ "vite": "^6.1.1"
34
+ },
35
+ "main": "dist/cjs/index.js",
36
+ "types": "./index.d.ts",
37
+ "module": "lib/esm/index.js",
38
+ "files": [
39
+ "dist",
40
+ "lib"
41
+ ],
42
+ "dependencies": {
43
+ "react-router-dom": "^6.15.0",
44
+ "react-pdf": "^10.3.0",
45
+ "htmlparser2": "^10.0.0",
46
+ "buffer": "^6.0.3",
47
+ "@topconsultnpm/sdk-ts": "6.20.0-t3",
48
+ "exceljs": "^4.4.0",
49
+ "devextreme": "25.2.4",
50
+ "styled-components": "^6.1.1",
51
+ "pdfjs-dist": "5.4.296",
52
+ "devextreme-react": "25.2.4"
53
+ },
54
+ "overrides": {
55
+ "esbuild": "^0.25.0"
56
+ }
57
57
  }
@@ -1,9 +0,0 @@
1
- import { DcmtTypeDescriptor, SearchResultDescriptor } from "@topconsultnpm/sdk-ts";
2
- interface TMSignSettingsFormProps {
3
- fromDTD: DcmtTypeDescriptor;
4
- inputDcmts: any[];
5
- onCloseSignSettingsForm: () => void;
6
- onSavedAsyncCallback: ((tid: number | undefined, did: number | undefined, metadataResult?: SearchResultDescriptor | null) => Promise<void>);
7
- }
8
- declare const TMSignSettingsForm: (props: TMSignSettingsFormProps) => import("react/jsx-runtime").JSX.Element | null;
9
- export default TMSignSettingsForm;