@topconsultnpm/sdkui-react 6.20.0-dev3.9 → 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.
- package/lib/components/base/TMPopUp.js +4 -0
- package/lib/components/base/TMTreeView.js +12 -8
- package/lib/components/choosers/TMDataListItemChooser.js +1 -1
- package/lib/components/choosers/TMDataListItemFields.js +1 -1
- package/lib/components/choosers/TMDataListItemPicker.d.ts +1 -0
- package/lib/components/choosers/TMDataListItemPicker.js +5 -1
- package/lib/components/choosers/TMUserChooser.js +1 -1
- package/lib/components/editors/TMMetadataValues.js +200 -40
- package/lib/components/editors/TMTextArea.d.ts +1 -0
- package/lib/components/editors/TMTextArea.js +6 -6
- package/lib/components/features/documents/TMDcmtForm.js +13 -4
- package/lib/components/features/documents/TMMasterDetailDcmts.js +25 -63
- package/lib/components/features/documents/TMRelationViewer.js +109 -40
- package/lib/components/features/search/TMSearchQueryPanel.js +3 -3
- package/lib/components/features/search/TMSearchResult.js +2 -10
- package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +1 -1
- package/lib/components/features/search/TMSearchResultsMenuItems.js +1 -8
- package/lib/components/features/search/TMSignatureInfoContent.js +10 -6
- package/lib/components/features/tasks/TMTaskFormUtils.js +1 -1
- package/lib/components/features/workflow/TMWorkflowPopup.js +9 -19
- package/lib/components/features/workflow/diagram/DiagramItemForm.d.ts +2 -0
- package/lib/components/features/workflow/diagram/DiagramItemForm.js +32 -25
- package/lib/components/features/workflow/diagram/RecipientList.d.ts +3 -1
- package/lib/components/features/workflow/diagram/RecipientList.js +13 -9
- package/lib/components/features/workflow/diagram/WFDiagram.js +29 -2
- package/lib/components/features/workflow/diagram/workflowHelpers.js +31 -19
- package/lib/components/viewers/TMMidViewer.js +2 -1
- package/lib/components/viewers/TMTidViewer.js +2 -1
- package/lib/helper/SDKUI_Globals.d.ts +4 -0
- package/lib/helper/SDKUI_Globals.js +9 -1
- package/lib/helper/SDKUI_Localizator.d.ts +12 -4
- package/lib/helper/SDKUI_Localizator.js +104 -24
- package/lib/helper/TMUtils.d.ts +6 -40
- package/lib/helper/TMUtils.js +69 -166
- package/lib/hooks/useDataUserIdItem.js +2 -2
- package/lib/hooks/useRelatedDocuments.js +30 -31
- package/package.json +55 -55
- package/lib/components/features/search/TMSignSettingsForm.d.ts +0 -9
- 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
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
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 =
|
|
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
|
-
}, [
|
|
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":
|
|
3
|
-
"version":
|
|
4
|
-
"description":
|
|
5
|
-
"scripts":
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"author":
|
|
17
|
-
"license":
|
|
18
|
-
"devDependencies":
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"main":
|
|
36
|
-
"types":
|
|
37
|
-
"module":
|
|
38
|
-
"files":
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"dependencies":
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
"overrides":
|
|
55
|
-
|
|
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;
|