@topconsultnpm/sdkui-react-beta 6.17.13 → 6.17.14

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.
@@ -88,7 +88,7 @@ export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem,
88
88
  const addReplaceFileMenuItem = () => {
89
89
  return {
90
90
  icon: svgToString(_jsx(IconSubstFile, {})),
91
- text: SDKUI_Localizator.AddReplaceFile,
91
+ text: SDKUI_Localizator.AddOrSubstFile,
92
92
  operationType: 'singleRow',
93
93
  disabled: dtd?.perm?.canSubstFile !== AccessLevels.Yes ? true : disabledForSingleRow(selectedItems, focusedItem),
94
94
  onClick: async () => { await runOperationAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DcmtOperationTypes.SubstituteFile, onRefreshDataRowsAsync); }
@@ -223,9 +223,18 @@ export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem,
223
223
  };
224
224
  };
225
225
  const pdfEditorMenuItem = (openEditPdfCallback) => {
226
+ // Get the currently selected or focused documents
226
227
  const selectedDocs = getSelectedDcmtsOrFocused(selectedItems, focusedItem);
228
+ // Take the first document (used for validation checks)
227
229
  const firstDoc = selectedDocs?.[0];
228
- const isDisabled = disabledForSingleRow(selectedItems, focusedItem) || firstDoc?.FILEEXT?.toLowerCase() !== "pdf" || firstDoc?.ISSIGNED === 1;
230
+ // Check if the selected document is a PDF
231
+ const isPdf = firstDoc?.FILEEXT?.toLowerCase() === "pdf";
232
+ // Check if the document has been signed
233
+ const isSigned = firstDoc?.ISSIGNED === 1;
234
+ // Check if the user has permission to substitute files
235
+ const canSubstitute = dtd?.perm?.canSubstFile === AccessLevels.Yes;
236
+ // Determine whether the menu item should be disabled
237
+ const isDisabled = !canSubstitute || disabledForSingleRow(selectedItems, focusedItem) || !isPdf || isSigned;
229
238
  return {
230
239
  icon: svgToString(_jsx(IconEdit, {})),
231
240
  text: "PDF Editor",
@@ -20,7 +20,6 @@ export declare class SDKUI_Localizator {
20
20
  static get AddOrSubstFile(): "Dateien hinzufügen/ersetzen" | "Add/substitute file" | "Añadir/sustituir archivo" | "Ajoute/Remplace le fichier" | "Adicionar / substituir arquivos" | "Aggiungi/sostituisci file";
21
21
  static get AddRecipient(): "Empfänger hinzufügen" | "Add recipient" | "Agregar destinatario" | "Ajouter destinataire" | "Adicionar destinatário" | "Aggiungi destinatario";
22
22
  static get AddParticipants(): string;
23
- static get AddReplaceFile(): string;
24
23
  static get AddTo(): string;
25
24
  static get AddToHomePage(): "Zur Startseite hinzufügen" | "Add to Home Page" | "Añadir a la página inicial" | "Ajoute à Home Page" | "Adicionar a Home Page" | "Aggiungi alla Home Page";
26
25
  static get Advanced(): "Erweitert" | "Advanced" | "Avanzado" | "Avancé" | "Avançado" | "Avanzate";
@@ -148,16 +148,6 @@ export class SDKUI_Localizator {
148
148
  default: return "Aggiungi partecipanti";
149
149
  }
150
150
  }
151
- static get AddReplaceFile() {
152
- switch (this._cultureID) {
153
- case CultureIDs.De_DE: return "Datei hinzufügen/ersetzen";
154
- case CultureIDs.En_US: return "Add/Replace File";
155
- case CultureIDs.Es_ES: return "Agregar/Reemplazar archivo";
156
- case CultureIDs.Fr_FR: return "Ajouter/Remplacer le fichier";
157
- case CultureIDs.Pt_PT: return "Adicionar/Substituir arquivo";
158
- default: return "Aggiungi/sostituisci file";
159
- }
160
- }
161
151
  static get AddTo() {
162
152
  switch (this._cultureID) {
163
153
  case CultureIDs.De_DE: return "Hinzufügen zu";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react-beta",
3
- "version": "6.17.13",
3
+ "version": "6.17.14",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",