@topconsultnpm/sdkui-react-beta 6.17.13 → 6.17.15
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/features/blog/TMBlogCommentForm.js +9 -1
- package/lib/components/features/search/TMSearchResultsMenuItems.js +11 -2
- package/lib/components/grids/TMBlogs.js +14 -1
- package/lib/components/grids/TMBlogsUtils.d.ts +4 -1
- package/lib/helper/SDKUI_Localizator.d.ts +0 -1
- package/lib/helper/SDKUI_Localizator.js +0 -10
- package/package.json +1 -1
|
@@ -99,7 +99,8 @@ const TMBlogCommentForm = (props) => {
|
|
|
99
99
|
// Exit early if the engine or its required identifiers are undefined
|
|
100
100
|
if (context.object === undefined
|
|
101
101
|
|| (context.engine === 'WorkingGroupEngine' && !context.object.id)
|
|
102
|
-
|| (context.engine === 'SearchEngine' && (!context.object.tid || !context.object.did))
|
|
102
|
+
|| (context.engine === 'SearchEngine' && (!context.object.tid || !context.object.did))
|
|
103
|
+
|| (context.engine === 'DossierEngine' && !context.object.id)) {
|
|
103
104
|
TMSpinner.hide();
|
|
104
105
|
return;
|
|
105
106
|
}
|
|
@@ -153,6 +154,13 @@ const TMBlogCommentForm = (props) => {
|
|
|
153
154
|
await refreshCallback();
|
|
154
155
|
setTimeout(() => updateShouldSelectLastBlog?.(true), 300);
|
|
155
156
|
}
|
|
157
|
+
else if (context.engine === 'DossierEngine' && context.object && context.object.id) {
|
|
158
|
+
// Create an instance of DossierEngine
|
|
159
|
+
const dossierEngine = SDK_Globals.tmSession?.NewDossierEngine();
|
|
160
|
+
await dossierEngine.BlogPostAddAsync(context.object.id, blogPost);
|
|
161
|
+
await refreshCallback();
|
|
162
|
+
setTimeout(() => updateShouldSelectLastBlog?.(true), 300);
|
|
163
|
+
}
|
|
156
164
|
}
|
|
157
165
|
catch (e) {
|
|
158
166
|
// If any error occurs during the try block execution, display the exception in an error box
|
|
@@ -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.
|
|
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
|
-
|
|
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",
|
|
@@ -121,7 +121,8 @@ const TMBlogs = (props) => {
|
|
|
121
121
|
return;
|
|
122
122
|
if (focusedBlog === undefined || focusedBlog.id === undefined || context === undefined || context.object === undefined
|
|
123
123
|
|| (context.engine === 'WorkingGroupEngine' && !context.object.id)
|
|
124
|
-
|| (context.engine === 'SearchEngine' && (!context.object.tid || !context.object.did))
|
|
124
|
+
|| (context.engine === 'SearchEngine' && (!context.object.tid || !context.object.did))
|
|
125
|
+
|| (context.engine === 'DossierEngine' && !context.object.id)) {
|
|
125
126
|
return Promise.resolve();
|
|
126
127
|
}
|
|
127
128
|
setLocalWaitPanelTitle(del ? SDKUI_Localizator.Delete : SDKUI_Localizator.Restore);
|
|
@@ -160,6 +161,18 @@ const TMBlogs = (props) => {
|
|
|
160
161
|
TMResultManager.show(result, del ? SDKUI_Localizator.Delete : SDKUI_Localizator.Restore, "ID", undefined);
|
|
161
162
|
});
|
|
162
163
|
}
|
|
164
|
+
else if (context.engine === 'DossierEngine' && context.object.id) {
|
|
165
|
+
const dossierEngine = SDK_Globals.tmSession?.NewDossierEngine();
|
|
166
|
+
await dossierEngine.BlogPostDeleteOrUndeleteAsync(context.object.id, focusedBlog.id, del)
|
|
167
|
+
.then(() => {
|
|
168
|
+
handleFocusedBlog(undefined);
|
|
169
|
+
refresh();
|
|
170
|
+
})
|
|
171
|
+
.catch((err) => {
|
|
172
|
+
result.push({ rowIndex: 1, id1: context.object?.id, id2: context.object?.id, resultType: ResultTypes.ERROR, description: getExceptionMessage(err) });
|
|
173
|
+
TMResultManager.show(result, del ? SDKUI_Localizator.Delete : SDKUI_Localizator.Restore, "ID", undefined);
|
|
174
|
+
});
|
|
175
|
+
}
|
|
163
176
|
}
|
|
164
177
|
setLocalWaitPanelTextPrimary('');
|
|
165
178
|
setLocalWaitPanelMaxValuePrimary(0);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { BlogPost, BlogPostAttachment, DcmtTypeDescriptor, HomeBlogPost, TID_DID, WorkingGroupDescriptor } from "@topconsultnpm/sdk-ts-beta";
|
|
2
|
+
import { BlogPost, BlogPostAttachment, DcmtTypeDescriptor, DossierDescriptor, HomeBlogPost, TID_DID, WorkingGroupDescriptor } from "@topconsultnpm/sdk-ts-beta";
|
|
3
3
|
import { DcmtInfo } from '../../ts';
|
|
4
4
|
import { ContextMenuRef } from 'devextreme-react/cjs/context-menu';
|
|
5
5
|
import { FileItem } from '../base/TMFileManagerUtils';
|
|
@@ -10,6 +10,9 @@ export type TMBlogContextDescriptor = {
|
|
|
10
10
|
} | {
|
|
11
11
|
engine: 'SearchEngine';
|
|
12
12
|
object?: TID_DID;
|
|
13
|
+
} | {
|
|
14
|
+
engine: 'DossierEngine';
|
|
15
|
+
object?: DossierDescriptor;
|
|
13
16
|
};
|
|
14
17
|
export declare const colors: {
|
|
15
18
|
DARK_BLUE: string;
|
|
@@ -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";
|