@topconsultnpm/sdkui-react 6.21.0-dev1.23 → 6.21.0-dev1.25

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.
@@ -132,12 +132,24 @@ const TMFormulaEditor = (props) => {
132
132
  const renderTreeViewItem = useCallback((item) => {
133
133
  return (_jsxs(StyledDivHorizontal, { style: { display: 'flex', gap: '5px', overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis' }, children: [renderFormulaIcon(item.icon, item.tid, item.md), _jsx("p", { style: { verticalAlign: 'middle', whiteSpace: 'nowrap', textOverflow: 'ellipsis' }, children: item.text })] }));
134
134
  }, []);
135
+ const translateDescInFormula = (text) => {
136
+ switch (text) {
137
+ case `TM_GetViewLink (${SDKUI_Localizator.FormulaEditor_Function_TM_GetViewLink_WithoutLogin})`:
138
+ return `[dbo].[TM_GetViewLink](NULL, NULL, NULL, 0, {@TID}, {@DID}, 1, NULL, 0)`;
139
+ case `TM_GetViewLink (${SDKUI_Localizator.FormulaEditor_Function_TM_GetViewLink_WithLogin})`:
140
+ return `[dbo].[TM_GetViewLink](NULL, 'ASKLOGIN', NULL, 0, {@TID}, {@DID}, 1, NULL, 0)`;
141
+ case `TM_GetViewLink (${SDKUI_Localizator.FormulaEditor_Function_TM_GetViewLink_WithDate})`:
142
+ return `[dbo].[TM_GetViewLink](NULL, NULL, NULL, 0, {@TID}, {@DID}, 1, CONVERT(VARCHAR, {@CreationTime}+30, 126), 0)`;
143
+ break;
144
+ }
145
+ return text;
146
+ };
135
147
  const handleTreeViewItemClick = (e) => {
136
148
  if (!e)
137
149
  return;
138
150
  if (e.itemData?.hasItems)
139
151
  return;
140
- insertText(e.itemData?.text);
152
+ insertText(translateDescInFormula(e.itemData?.text));
141
153
  };
142
154
  return (_jsx(TMApplyForm, { isModal: props.isModal, formMode: props.formMode, isModified: formData.expression !== formDataOrig.expression, exception: exception, validationItems: validationItems, title: SDKUI_Localizator.Formula, hasNavigation: false, showBack: props.showBack, height: '600px', width: '800px', onApply: () => applyData(), onClose: props.onClose, onUndo: () => {
143
155
  setFormData(formDataOrig);
@@ -705,19 +717,19 @@ export class FormulaHelper {
705
717
  static jsonItems_LoadFunctions_Link() {
706
718
  let items = [{
707
719
  id: '3_4_1',
708
- text: `[dbo].[TM_GetViewLink](NULL, NULL, NULL, 0, {@TID}, {@DID}, 1, NULL, 0)`,
720
+ text: `TM_GetViewLink (${SDKUI_Localizator.FormulaEditor_Function_TM_GetViewLink_WithoutLogin})`,
709
721
  icon: FormulaIconTypes.Function,
710
722
  expanded: false,
711
723
  hasItems: false,
712
724
  }, {
713
725
  id: '3_4_2',
714
- text: `[dbo].[TM_GetViewLink](NULL, 'ASKLOGIN', NULL, 0, {@TID}, {@DID}, 1, NULL, 0)`,
726
+ text: `TM_GetViewLink (${SDKUI_Localizator.FormulaEditor_Function_TM_GetViewLink_WithLogin})`,
715
727
  icon: FormulaIconTypes.Function,
716
728
  expanded: false,
717
729
  hasItems: false,
718
730
  }, {
719
731
  id: '3_4_3',
720
- text: `[dbo].[TM_GetViewLink](NULL, NULL, NULL, 0, {@TID}, {@DID}, 1, CONVERT(VARCHAR, {@CreationTime}+30, 126), 0)`,
732
+ text: `TM_GetViewLink (${SDKUI_Localizator.FormulaEditor_Function_TM_GetViewLink_WithDate})`,
721
733
  icon: FormulaIconTypes.Function,
722
734
  expanded: false,
723
735
  hasItems: false,
@@ -328,8 +328,8 @@ const TMLoginForm = (props) => {
328
328
  const nextStepHandler = async () => {
329
329
  if (!endpoint || (!dcmtArchive && !manualArchiveID))
330
330
  return;
331
- if (loginStep === 1 && !dcmtArchive && manualArchiveID) {
332
- const isValid = await validateManualArchiveAsync();
331
+ if (loginStep === 1 && manualArchiveID) {
332
+ const isValid = await fetchManualArchiveByIdAsync();
333
333
  if (!isValid)
334
334
  return;
335
335
  }
@@ -359,17 +359,27 @@ const TMLoginForm = (props) => {
359
359
  return;
360
360
  setLoginStep(prev => prev - 1);
361
361
  }, [loginStep]);
362
- const validateManualArchiveAsync = async () => {
363
- if (!tmSession || !manualArchiveID)
362
+ /** Retrieves and sets the archive descriptor from server using the manually entered ID. */
363
+ const fetchManualArchiveByIdAsync = async () => {
364
+ // Early exit if session or manual archive ID is not available
365
+ if (!tmSession || !manualArchiveID) {
366
+ setDcmtArchive(undefined);
364
367
  return false;
368
+ }
369
+ ;
365
370
  try {
366
371
  TMSpinner.show({ description: '' });
372
+ // Create archive engine and retrieve archive descriptor by ID
367
373
  const archiveEngine = tmSession.NewArchiveEngine();
368
- await archiveEngine.RetrieveAsync(manualArchiveID);
374
+ const result = await archiveEngine.RetrieveAsync(manualArchiveID);
375
+ // Update state with retrieved archive if valid
376
+ setDcmtArchive(result);
369
377
  return true;
370
378
  }
371
379
  catch (e) {
380
+ // Display error to user if retrieval fails
372
381
  TMExceptionBoxManager.show({ exception: e });
382
+ setDcmtArchive(undefined);
373
383
  return false;
374
384
  }
375
385
  finally {
@@ -1060,8 +1060,13 @@ export const useDocumentOperations = (props) => {
1060
1060
  disabled: isDisabledForSingleRow() && isDisabledForMultiRow(),
1061
1061
  submenu: [
1062
1062
  addToFavoriteOperation(),
1063
+ addReplaceFileOperation(),
1064
+ fileCheckMenuItem(),
1065
+ fileConversionsMenuItem(),
1066
+ ...(SDK_Globals.tmSession?.SessionDescr?.appModuleID === AppModules.SURFER ? [createContextualTaskMenuItem()] : []),
1063
1067
  downloadFileMenuItem(),
1064
1068
  downloadXMLAttachmentsMenuItem(),
1069
+ ...(selectedDcmtInfos.length > 0 && isPdfEditorAvailable(dtd, selectedDcmtInfos[0]?.FILEEXT) && onOpenPdfEditorRequest ? [pdfEditorMenuItem(onOpenPdfEditorRequest)] : []),
1065
1070
  ]
1066
1071
  },
1067
1072
  signatureMenuItem(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react",
3
- "version": "6.21.0-dev1.23",
3
+ "version": "6.21.0-dev1.25",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",