@topconsultnpm/sdkui-react-beta 6.16.60 → 6.16.62
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.
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useState } from 'react';
|
|
3
3
|
import TMTooltip from '../../base/TMTooltip';
|
|
4
|
-
import { IconShare } from '../../../helper';
|
|
5
4
|
;
|
|
6
5
|
export const TMSearchResultFloatingActionButton = (props) => {
|
|
7
6
|
const { config, selectedDcmtsOrFocused } = props;
|
|
@@ -46,6 +45,6 @@ export const TMSearchResultFloatingActionButton = (props) => {
|
|
|
46
45
|
if (config.onClick) {
|
|
47
46
|
await config.onClick(selectedDcmtsOrFocused);
|
|
48
47
|
}
|
|
49
|
-
}, children: _jsx(TMTooltip, { content: tooltip, children: iconElement || _jsx(
|
|
48
|
+
}, children: _jsx(TMTooltip, { content: tooltip, children: iconElement || _jsx("i", { className: "dx-icon-share", style: { fontSize: 25, transform: 'translateX(-1px)', } }) }) });
|
|
50
49
|
};
|
|
51
50
|
export default TMSearchResultFloatingActionButton;
|
|
@@ -74,135 +74,149 @@ export const signatureInformationCallback = async (inputDcmts) => {
|
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
76
|
export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, showSearch, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, onRefreshDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, confirmAttachments, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, handleToggleSearch, handleSignApprove, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm) => {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
disabled:
|
|
77
|
+
const addToFavoriteMenuItem = () => {
|
|
78
|
+
return {
|
|
79
|
+
icon: svgToString(_jsx(IconStar, {})),
|
|
80
|
+
text: SDKUI_Localizator.AddTo + ' ' + SDKUI_Localizator.Favorites,
|
|
81
|
+
operationType: 'multiRow',
|
|
82
|
+
disabled: context === SearchResultContext.FAVORITES_AND_RECENTS || disabledForMultiRow(selectedItems, focusedItem),
|
|
83
|
+
onClick: async () => { await runOperationAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DcmtOperationTypes.AddToFavs); onRefreshAfterAddDcmtToFavs?.(); },
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
const addReplaceFileMenuItem = () => {
|
|
87
|
+
return {
|
|
88
|
+
icon: svgToString(_jsx(IconSubstFile, {})),
|
|
89
|
+
text: SDKUI_Localizator.AddReplaceFile,
|
|
90
|
+
operationType: 'singleRow',
|
|
91
|
+
disabled: dtd?.perm?.canSubstFile !== AccessLevels.Yes ? true : disabledForSingleRow(selectedItems, focusedItem),
|
|
92
|
+
onClick: async () => { await runOperationAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DcmtOperationTypes.SubstituteFile, onRefreshDataRowsAsync); }
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
const openFormMenuItem = () => {
|
|
96
|
+
return {
|
|
97
|
+
icon: svgToString(_jsx(IconPreview, {})),
|
|
98
|
+
text: SDKUI_Localizator.OpenForm,
|
|
99
|
+
operationType: 'singleRow',
|
|
100
|
+
disabled: disabledForSingleRow(selectedItems, focusedItem),
|
|
101
|
+
onClick: () => openFormHandler?.(LayoutModes.Update)
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
const deletetionMenuItem = () => {
|
|
105
|
+
return {
|
|
106
|
+
icon: svgToString(_jsx(IconDelete, {})),
|
|
107
|
+
text: SDKUI_Localizator.Deletion,
|
|
108
|
+
operationType: 'multiRow',
|
|
109
|
+
disabled: disabledForMultiRow(selectedItems, focusedItem),
|
|
83
110
|
items: [
|
|
84
|
-
{
|
|
85
|
-
icon: svgToString(_jsx(IconStar, {})),
|
|
86
|
-
text: SDKUI_Localizator.AddTo + ' ' + SDKUI_Localizator.Favorites,
|
|
87
|
-
operationType: 'multiRow',
|
|
88
|
-
disabled: context === SearchResultContext.FAVORITES_AND_RECENTS || disabledForMultiRow(selectedItems, focusedItem),
|
|
89
|
-
onClick: async () => { await runOperationAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DcmtOperationTypes.AddToFavs); onRefreshAfterAddDcmtToFavs?.(); },
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
icon: svgToString(_jsx(IconSubstFile, {})),
|
|
93
|
-
text: SDKUI_Localizator.AddReplaceFile,
|
|
94
|
-
operationType: 'singleRow',
|
|
95
|
-
disabled: dtd?.perm?.canSubstFile !== AccessLevels.Yes ? true : disabledForSingleRow(selectedItems, focusedItem),
|
|
96
|
-
onClick: async () => { await runOperationAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DcmtOperationTypes.SubstituteFile, onRefreshDataRowsAsync); }
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
icon: svgToString(_jsx(IconPreview, {})),
|
|
100
|
-
text: SDKUI_Localizator.OpenForm,
|
|
101
|
-
operationType: 'singleRow',
|
|
102
|
-
disabled: disabledForSingleRow(selectedItems, focusedItem),
|
|
103
|
-
onClick: () => openFormHandler?.(LayoutModes.Update)
|
|
104
|
-
},
|
|
105
111
|
{
|
|
106
112
|
icon: svgToString(_jsx(IconDelete, {})),
|
|
107
|
-
text: SDKUI_Localizator.
|
|
113
|
+
text: SDKUI_Localizator.LogDelete,
|
|
108
114
|
operationType: 'multiRow',
|
|
109
|
-
disabled: disabledForMultiRow(selectedItems, focusedItem),
|
|
110
|
-
|
|
111
|
-
{
|
|
112
|
-
icon: svgToString(_jsx(IconDelete, {})),
|
|
113
|
-
text: SDKUI_Localizator.LogDelete,
|
|
114
|
-
operationType: 'multiRow',
|
|
115
|
-
disabled: dtd?.perm?.canLogicalDelete !== AccessLevels.Yes ? true : disabledForMultiRow(selectedItems, focusedItem),
|
|
116
|
-
beginGroup: true,
|
|
117
|
-
onClick: async () => {
|
|
118
|
-
let dcmts = getSelectedDcmtsOrFocused(selectedItems, focusedItem);
|
|
119
|
-
await runOperationAsync(dcmts, DcmtOperationTypes.LogDelete, dcmts.length <= MAX_DCMTS_FOR_SELECTION_REFRESH ? onRefreshDataRowsAsync : onRefreshSearchAsync);
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
icon: svgToString(_jsx(IconUndo, {})),
|
|
124
|
-
text: SDKUI_Localizator.Restore,
|
|
125
|
-
operationType: 'multiRow',
|
|
126
|
-
disabled: dtd?.perm?.canLogicalDelete !== AccessLevels.Yes ? true : disabledForMultiRow(selectedItems, focusedItem),
|
|
127
|
-
onClick: async () => {
|
|
128
|
-
let dcmts = getSelectedDcmtsOrFocused(selectedItems, focusedItem);
|
|
129
|
-
await runOperationAsync(dcmts, DcmtOperationTypes.Undelete, dcmts.length <= MAX_DCMTS_FOR_SELECTION_REFRESH ? onRefreshDataRowsAsync : onRefreshSearchAsync);
|
|
130
|
-
}
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
icon: svgToString(_jsx(IconCloseCircle, {})),
|
|
134
|
-
text: SDKUI_Localizator.PhysDelete,
|
|
135
|
-
operationType: 'multiRow',
|
|
136
|
-
disabled: dtd?.perm?.canPhysicalDelete !== AccessLevels.Yes ? true : disabledForMultiRow(selectedItems, focusedItem),
|
|
137
|
-
onClick: async () => { await runOperationAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DcmtOperationTypes.PhysDelete, onRefreshSearchAsync); }
|
|
138
|
-
},
|
|
139
|
-
]
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
icon: svgToString(_jsx(IconCheckFile, {})),
|
|
143
|
-
text: SDKUI_Localizator.FileCheck,
|
|
144
|
-
operationType: 'multiRow',
|
|
145
|
-
disabled: disabledForMultiRow(selectedItems, focusedItem),
|
|
146
|
-
onClick: async () => { await runOperationAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DcmtOperationTypes.CheckFile); }
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
icon: svgToString(_jsx(IconConvertFilePdf, {})),
|
|
150
|
-
text: SDKUI_Localizator.FileConversion,
|
|
151
|
-
operationType: 'multiRow',
|
|
152
|
-
disabled: disabledForMultiRow(selectedItems, focusedItem),
|
|
115
|
+
disabled: dtd?.perm?.canLogicalDelete !== AccessLevels.Yes ? true : disabledForMultiRow(selectedItems, focusedItem),
|
|
116
|
+
beginGroup: true,
|
|
153
117
|
onClick: async () => {
|
|
154
|
-
let
|
|
155
|
-
|
|
156
|
-
return;
|
|
157
|
-
let dcmts = getSelectedDcmtsOrFocused(selectedItems, focusedItem, format);
|
|
158
|
-
await runOperationAsync(dcmts, DcmtOperationTypes.ConvertFile, dcmts.length <= MAX_DCMTS_FOR_SELECTION_REFRESH ? onRefreshDataRowsAsync : onRefreshSearchAsync);
|
|
118
|
+
let dcmts = getSelectedDcmtsOrFocused(selectedItems, focusedItem);
|
|
119
|
+
await runOperationAsync(dcmts, DcmtOperationTypes.LogDelete, dcmts.length <= MAX_DCMTS_FOR_SELECTION_REFRESH ? onRefreshDataRowsAsync : onRefreshSearchAsync);
|
|
159
120
|
}
|
|
160
121
|
},
|
|
161
|
-
...(SDK_Globals.tmSession?.SessionDescr?.appModuleID === AppModules.SURFER
|
|
162
|
-
? [{
|
|
163
|
-
icon: svgToString(_jsx(IconActivity, {})),
|
|
164
|
-
text: SDKUI_Localizator.CreateContextualTask,
|
|
165
|
-
operationType: 'singleRow',
|
|
166
|
-
disabled: disabledForSingleRow(selectedItems, focusedItem),
|
|
167
|
-
onClick: () => { openTaskFormHandler(); }
|
|
168
|
-
}] : []),
|
|
169
122
|
{
|
|
170
|
-
icon: svgToString(_jsx(
|
|
123
|
+
icon: svgToString(_jsx(IconUndo, {})),
|
|
124
|
+
text: SDKUI_Localizator.Restore,
|
|
171
125
|
operationType: 'multiRow',
|
|
172
|
-
disabled: dtd?.perm?.
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
operationType: 'singleRow',
|
|
178
|
-
disabled: !isXMLFileExt(getSelectedDcmtsOrFocused(selectedItems, focusedItem)?.[0]?.FILEEXT) ? true : disabledForSingleRow(selectedItems, focusedItem),
|
|
179
|
-
text: SDKUI_Localizator.DownloadXMLAttachments, onClick: () => downloadDcmtsAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DownloadTypes.Attachment, "download", undefined, confirmAttachments)
|
|
180
|
-
},
|
|
181
|
-
{
|
|
182
|
-
icon: svgToString(_jsx(IconArchiveDoc, {})),
|
|
183
|
-
text: SDKUI_Localizator.DuplicateDocument,
|
|
184
|
-
operationType: 'singleRow',
|
|
185
|
-
disabled: dtd?.perm?.canArchive !== AccessLevelsEx.Yes && dtd?.perm?.canArchive !== AccessLevelsEx.Mixed ? true : disabledForSingleRow(selectedItems, focusedItem),
|
|
186
|
-
onClick: () => { openFormHandler?.(LayoutModes.Ark); }
|
|
126
|
+
disabled: dtd?.perm?.canLogicalDelete !== AccessLevels.Yes ? true : disabledForMultiRow(selectedItems, focusedItem),
|
|
127
|
+
onClick: async () => {
|
|
128
|
+
let dcmts = getSelectedDcmtsOrFocused(selectedItems, focusedItem);
|
|
129
|
+
await runOperationAsync(dcmts, DcmtOperationTypes.Undelete, dcmts.length <= MAX_DCMTS_FOR_SELECTION_REFRESH ? onRefreshDataRowsAsync : onRefreshSearchAsync);
|
|
130
|
+
}
|
|
187
131
|
},
|
|
188
132
|
{
|
|
189
|
-
icon: svgToString(_jsx(
|
|
190
|
-
text: SDKUI_Localizator.
|
|
133
|
+
icon: svgToString(_jsx(IconCloseCircle, {})),
|
|
134
|
+
text: SDKUI_Localizator.PhysDelete,
|
|
191
135
|
operationType: 'multiRow',
|
|
192
|
-
disabled: dtd?.perm?.
|
|
193
|
-
onClick: () =>
|
|
136
|
+
disabled: dtd?.perm?.canPhysicalDelete !== AccessLevels.Yes ? true : disabledForMultiRow(selectedItems, focusedItem),
|
|
137
|
+
onClick: async () => { await runOperationAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DcmtOperationTypes.PhysDelete, onRefreshSearchAsync); }
|
|
194
138
|
},
|
|
195
|
-
...((openEditPdf && getSelectedDcmtsOrFocused(selectedItems, focusedItem)?.[0]?.FILEEXT?.toLowerCase() === "pdf")
|
|
196
|
-
? [{
|
|
197
|
-
icon: svgToString(_jsx(IconEdit, {})),
|
|
198
|
-
text: "PDF Editor",
|
|
199
|
-
operationType: 'singleRow',
|
|
200
|
-
disabled: disabledForSingleRow(selectedItems, focusedItem) || getSelectedDcmtsOrFocused(selectedItems, focusedItem)?.[0]?.FILEEXT?.toLowerCase() !== "pdf",
|
|
201
|
-
onClick: () => openEditPdf(getSelectedDcmtsOrFocused(selectedItems, focusedItem)),
|
|
202
|
-
}] : []),
|
|
203
139
|
]
|
|
204
|
-
}
|
|
205
|
-
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
const fileCheckMenuItem = () => {
|
|
143
|
+
return {
|
|
144
|
+
icon: svgToString(_jsx(IconCheckFile, {})),
|
|
145
|
+
text: SDKUI_Localizator.FileCheck,
|
|
146
|
+
operationType: 'multiRow',
|
|
147
|
+
disabled: disabledForMultiRow(selectedItems, focusedItem),
|
|
148
|
+
onClick: async () => { await runOperationAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DcmtOperationTypes.CheckFile); }
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
const fileConversionsMenuItem = () => {
|
|
152
|
+
return {
|
|
153
|
+
icon: svgToString(_jsx(IconConvertFilePdf, {})),
|
|
154
|
+
text: SDKUI_Localizator.FileConversion,
|
|
155
|
+
operationType: 'multiRow',
|
|
156
|
+
disabled: disabledForMultiRow(selectedItems, focusedItem),
|
|
157
|
+
onClick: async () => {
|
|
158
|
+
let format = await confirmFormat();
|
|
159
|
+
if (format === FileFormats.None)
|
|
160
|
+
return;
|
|
161
|
+
let dcmts = getSelectedDcmtsOrFocused(selectedItems, focusedItem, format);
|
|
162
|
+
await runOperationAsync(dcmts, DcmtOperationTypes.ConvertFile, dcmts.length <= MAX_DCMTS_FOR_SELECTION_REFRESH ? onRefreshDataRowsAsync : onRefreshSearchAsync);
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
const createContextualTaskMenuItem = () => {
|
|
167
|
+
return {
|
|
168
|
+
icon: svgToString(_jsx(IconActivity, {})),
|
|
169
|
+
text: SDKUI_Localizator.CreateContextualTask,
|
|
170
|
+
operationType: 'singleRow',
|
|
171
|
+
disabled: disabledForSingleRow(selectedItems, focusedItem),
|
|
172
|
+
onClick: () => { openTaskFormHandler(); }
|
|
173
|
+
};
|
|
174
|
+
};
|
|
175
|
+
const downloadFileMenuItem = () => {
|
|
176
|
+
return {
|
|
177
|
+
icon: svgToString(_jsx(IconDownload, {})),
|
|
178
|
+
operationType: 'multiRow',
|
|
179
|
+
disabled: dtd?.perm?.canRetrieveFile !== AccessLevels.Yes ? true : disabledForMultiRow(selectedItems, focusedItem),
|
|
180
|
+
text: SDKUI_Localizator.DownloadFile, onClick: () => downloadDcmtsAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DownloadTypes.Dcmt, "download")
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
const downloadXMLAttachmentsMenuItem = () => {
|
|
184
|
+
return {
|
|
185
|
+
icon: svgToString(_jsx(IconDownload, {})),
|
|
186
|
+
operationType: 'singleRow',
|
|
187
|
+
disabled: !isXMLFileExt(getSelectedDcmtsOrFocused(selectedItems, focusedItem)?.[0]?.FILEEXT) ? true : disabledForSingleRow(selectedItems, focusedItem),
|
|
188
|
+
text: SDKUI_Localizator.DownloadXMLAttachments, onClick: () => downloadDcmtsAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DownloadTypes.Attachment, "download", undefined, confirmAttachments)
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
const duplicateDocumentMenuItem = () => {
|
|
192
|
+
return {
|
|
193
|
+
icon: svgToString(_jsx(IconArchiveDoc, {})),
|
|
194
|
+
text: SDKUI_Localizator.DuplicateDocument,
|
|
195
|
+
operationType: 'singleRow',
|
|
196
|
+
disabled: dtd?.perm?.canArchive !== AccessLevelsEx.Yes && dtd?.perm?.canArchive !== AccessLevelsEx.Mixed ? true : disabledForSingleRow(selectedItems, focusedItem),
|
|
197
|
+
onClick: () => { openFormHandler?.(LayoutModes.Ark); }
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
const batchUpdateMenuItem = () => {
|
|
201
|
+
return {
|
|
202
|
+
icon: svgToString(_jsx(IconBatchUpdate, {})),
|
|
203
|
+
text: SDKUI_Localizator.BatchUpdate,
|
|
204
|
+
operationType: 'multiRow',
|
|
205
|
+
disabled: dtd?.perm?.canUpdate !== AccessLevelsEx.Yes && dtd?.perm?.canUpdate !== AccessLevelsEx.Mixed ? true : disabledForMultiRow(selectedItems, focusedItem),
|
|
206
|
+
onClick: () => openBatchUpdateFormHandler?.(true)
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
const pdfEditorMenuItem = (openEditPdfCallback) => {
|
|
210
|
+
return {
|
|
211
|
+
icon: svgToString(_jsx(IconEdit, {})),
|
|
212
|
+
text: "PDF Editor",
|
|
213
|
+
operationType: 'singleRow',
|
|
214
|
+
disabled: disabledForSingleRow(selectedItems, focusedItem) || getSelectedDcmtsOrFocused(selectedItems, focusedItem)?.[0]?.FILEEXT?.toLowerCase() !== "pdf",
|
|
215
|
+
onClick: () => openEditPdfCallback(getSelectedDcmtsOrFocused(selectedItems, focusedItem)),
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
const signatureMenuItem = () => {
|
|
219
|
+
return {
|
|
206
220
|
icon: svgToString(_jsx(IconSignature, {})),
|
|
207
221
|
text: SDKUI_Localizator.Signature,
|
|
208
222
|
disabled: disabledForSingleRow(selectedItems, focusedItem) && disabledForMultiRow(selectedItems, focusedItem),
|
|
@@ -229,49 +243,53 @@ export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem,
|
|
|
229
243
|
onClick: handleSignApprove
|
|
230
244
|
},
|
|
231
245
|
]
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
246
|
+
};
|
|
247
|
+
};
|
|
248
|
+
/* const checkinMenuItem = (): TMDataGridContextMenuItem => {
|
|
249
|
+
return {
|
|
250
|
+
icon: svgToString(<IconCheckIn />),
|
|
251
|
+
text: "Check in",
|
|
252
|
+
disabled: disabledForSingleRow(selectedItems, focusedItem) && disabledForMultiRow(selectedItems, focusedItem),
|
|
253
|
+
items: [
|
|
254
|
+
{
|
|
255
|
+
icon: svgToString(<IconCheckIn />),
|
|
256
|
+
operationType: 'singleRow',
|
|
257
|
+
disabled: fromDatagrid ? false : disabledForSingleRow(selectedItems, focusedItem),
|
|
258
|
+
text: "Check out", onClick: () => ShowAlert({ message: "TODO Check out", mode: 'info', title: `${"TODO"}`, duration: 3000 })
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
icon: svgToString(<IconCheckIn />),
|
|
262
|
+
text: "Modifica file",
|
|
263
|
+
operationType: 'singleRow',
|
|
264
|
+
disabled: fromDatagrid ? false : disabledForSingleRow(selectedItems, focusedItem),
|
|
265
|
+
onClick: () => ShowAlert({ message: "TODO Modifica file", mode: 'info', title: `${"TODO"}`, duration: 3000 })
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
icon: svgToString(<IconCheckIn />),
|
|
269
|
+
text: "Annulla check out",
|
|
270
|
+
operationType: 'singleRow',
|
|
271
|
+
disabled: fromDatagrid ? false : disabledForSingleRow(selectedItems, focusedItem),
|
|
272
|
+
onClick: () => ShowAlert({ message: "TODO Annulla check out", mode: 'info', title: `${"TODO"}`, duration: 3000 })
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
icon: svgToString(<IconCheckIn />),
|
|
276
|
+
text: "Check in",
|
|
277
|
+
operationType: 'singleRow',
|
|
278
|
+
disabled: fromDatagrid ? false : disabledForSingleRow(selectedItems, focusedItem),
|
|
279
|
+
onClick: () => ShowAlert({ message: "TODO Check in", mode: 'info', title: `${"TODO"}`, duration: 3000 })
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
icon: svgToString(<IconCheckIn />),
|
|
283
|
+
text: "Cronologia",
|
|
284
|
+
operationType: 'singleRow',
|
|
285
|
+
disabled: fromDatagrid ? false : disabledForSingleRow(selectedItems, focusedItem),
|
|
286
|
+
onClick: () => ShowAlert({ message: "TODO Cronologia", mode: 'info', title: `${"TODO"}`, duration: 3000 })
|
|
287
|
+
},
|
|
288
|
+
]
|
|
289
|
+
}
|
|
290
|
+
} */
|
|
291
|
+
const relationsMenuItem = () => {
|
|
292
|
+
return {
|
|
275
293
|
icon: svgToString(_jsx(IconRelation, {})),
|
|
276
294
|
text: SDKUI_Localizator.Relations,
|
|
277
295
|
operationType: 'multiRow',
|
|
@@ -324,30 +342,34 @@ export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem,
|
|
|
324
342
|
onClick: () => openDetailDcmtsFormHandler?.(true)
|
|
325
343
|
}
|
|
326
344
|
]
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
345
|
+
};
|
|
346
|
+
};
|
|
347
|
+
/* const shareMenuItem = (): TMDataGridContextMenuItem => {
|
|
348
|
+
return {
|
|
349
|
+
icon: svgToString(<IconShare />),
|
|
350
|
+
text: "Condivisione",
|
|
351
|
+
operationType: 'multiRow',
|
|
352
|
+
disabled: fromDatagrid ? false : disabledForMultiRow(selectedItems, focusedItem),
|
|
353
|
+
items: [
|
|
354
|
+
{
|
|
355
|
+
icon: svgToString(<IconShare />),
|
|
356
|
+
text: "Archiviazione condivisa",
|
|
357
|
+
operationType: 'multiRow',
|
|
358
|
+
disabled: fromDatagrid ? false : disabledForMultiRow(selectedItems, focusedItem),
|
|
359
|
+
onClick: () => ShowAlert({ message: "TODO Archiviazione condivisa", mode: 'info', title: `${"TODO"}`, duration: 3000 })
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
icon: svgToString(<IconSharedDcmt />),
|
|
363
|
+
text: "Documenti condivisi",
|
|
364
|
+
operationType: 'multiRow',
|
|
365
|
+
disabled: fromDatagrid ? false : disabledForMultiRow(selectedItems, focusedItem),
|
|
366
|
+
onClick: () => ShowAlert({ message: "TODO Documenti condivisi", mode: 'info', title: `${"TODO"}`, duration: 3000 })
|
|
367
|
+
}
|
|
368
|
+
]
|
|
369
|
+
}
|
|
370
|
+
} */
|
|
371
|
+
const fullTextSearchMenuItem = () => {
|
|
372
|
+
return {
|
|
351
373
|
icon: svgToString(_jsx(IconSearch, {})),
|
|
352
374
|
text: SDKUI_Localizator.FullTextSearch,
|
|
353
375
|
operationType: 'multiRow',
|
|
@@ -398,8 +420,10 @@ export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem,
|
|
|
398
420
|
}
|
|
399
421
|
}] : []),
|
|
400
422
|
]
|
|
401
|
-
}
|
|
402
|
-
|
|
423
|
+
};
|
|
424
|
+
};
|
|
425
|
+
const otherMenuItem = () => {
|
|
426
|
+
return {
|
|
403
427
|
icon: svgToString(_jsx(IconDotsVerticalCircleOutline, {})),
|
|
404
428
|
text: SDKUI_Localizator.Other,
|
|
405
429
|
items: [
|
|
@@ -453,61 +477,127 @@ export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem,
|
|
|
453
477
|
// ]
|
|
454
478
|
// }
|
|
455
479
|
]
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
480
|
+
};
|
|
481
|
+
};
|
|
482
|
+
const shareFromWgMenuItem = () => {
|
|
483
|
+
return {
|
|
484
|
+
icon: "share",
|
|
485
|
+
text: SDKUI_Localizator.Share,
|
|
486
|
+
visible: workingGroupContext !== undefined && openAddDocumentForm !== undefined,
|
|
487
|
+
disabled: workingGroupContext === undefined,
|
|
488
|
+
onClick: () => openAddDocumentForm && openAddDocumentForm(),
|
|
489
|
+
};
|
|
490
|
+
};
|
|
491
|
+
const copyFromWgMenuItem = () => {
|
|
492
|
+
return {
|
|
493
|
+
icon: 'copy',
|
|
494
|
+
text: SDKUI_Localizator.CopyToDrafts,
|
|
460
495
|
operationType: 'multiRow',
|
|
461
|
-
visible: openWGsCopyMoveForm !== undefined
|
|
496
|
+
visible: openWGsCopyMoveForm !== undefined,
|
|
462
497
|
disabled: disabledForMultiRow(selectedItems, focusedItem),
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
498
|
+
onClick: () => { (dtd && openWGsCopyMoveForm) && openWGsCopyMoveForm('copyToWgDraft', dtd, getSelectedDcmtsOrFocused(selectedItems, focusedItem)); },
|
|
499
|
+
};
|
|
500
|
+
};
|
|
501
|
+
const movetofolderFromWgMenuItem = () => {
|
|
502
|
+
return {
|
|
503
|
+
icon: 'movetofolder',
|
|
504
|
+
text: !isMobile ? SDKUI_Localizator.CopyToArchivedDocuments : SDKUI_Localizator.CopyToArchived,
|
|
505
|
+
operationType: 'multiRow',
|
|
506
|
+
visible: openWGsCopyMoveForm !== undefined,
|
|
507
|
+
disabled: disabledForMultiRow(selectedItems, focusedItem),
|
|
508
|
+
onClick: () => { (dtd && openWGsCopyMoveForm) && openWGsCopyMoveForm('copyToWgArchivedDoc', dtd, getSelectedDcmtsOrFocused(selectedItems, focusedItem)); },
|
|
509
|
+
};
|
|
510
|
+
};
|
|
511
|
+
const commentFromWgMenuItem = (beginGroup) => {
|
|
512
|
+
return {
|
|
513
|
+
icon: "chat",
|
|
514
|
+
text: SDKUI_Localizator.Comment,
|
|
515
|
+
operationType: 'multiRow',
|
|
516
|
+
visible: workingGroupContext !== undefined && openCommentFormCallback !== undefined,
|
|
517
|
+
disabled: workingGroupContext === undefined || disabledForMultiRow(selectedItems, focusedItem),
|
|
518
|
+
onClick: () => openCommentFormCallback && openCommentFormCallback(getSelectedDcmtsOrFocused(selectedItems, focusedItem)),
|
|
519
|
+
beginGroup: beginGroup,
|
|
520
|
+
};
|
|
521
|
+
};
|
|
522
|
+
const removeFromWgMenuItem = (text) => {
|
|
523
|
+
return {
|
|
524
|
+
icon: svgToString(_jsx(IconDelete, {})),
|
|
525
|
+
text: text,
|
|
526
|
+
operationType: 'multiRow',
|
|
527
|
+
visible: workingGroupContext !== undefined,
|
|
528
|
+
disabled: workingGroupContext === undefined || disabledForMultiRow(selectedItems, focusedItem),
|
|
529
|
+
onClick: async () => {
|
|
530
|
+
let dcmts = getSelectedDcmtsOrFocused(selectedItems, focusedItem);
|
|
531
|
+
if (workingGroupContext)
|
|
532
|
+
dcmts.forEach(dcmt => dcmt.workingGroupId = workingGroupContext.id);
|
|
533
|
+
await runOperationAsync(dcmts, DcmtOperationTypes.RemoveFromWorkgroup, onRefreshSearchAsync);
|
|
534
|
+
}
|
|
535
|
+
};
|
|
536
|
+
};
|
|
537
|
+
// MENU SPECIFICO ARCHIVED WORKGROUP
|
|
538
|
+
const getArchivedWorkgroupMenuItems = () => {
|
|
539
|
+
const items = [
|
|
540
|
+
addReplaceFileMenuItem(),
|
|
541
|
+
openFormMenuItem(),
|
|
542
|
+
deletetionMenuItem(),
|
|
543
|
+
fileConversionsMenuItem(),
|
|
544
|
+
...(SDK_Globals.tmSession?.SessionDescr?.appModuleID === AppModules.SURFER ? [createContextualTaskMenuItem()] : []),
|
|
545
|
+
downloadFileMenuItem(),
|
|
546
|
+
shareFromWgMenuItem(),
|
|
547
|
+
copyFromWgMenuItem(),
|
|
548
|
+
movetofolderFromWgMenuItem(),
|
|
549
|
+
commentFromWgMenuItem(false),
|
|
550
|
+
removeFromWgMenuItem(SDKUI_Localizator.RemoveFromWorkgroup),
|
|
551
|
+
];
|
|
552
|
+
return items.sort((a, b) => a.text.localeCompare(b.text));
|
|
553
|
+
};
|
|
554
|
+
// MENU STANDARD
|
|
555
|
+
const getDefaultMenuItems = () => {
|
|
556
|
+
return [
|
|
557
|
+
{
|
|
558
|
+
icon: svgToString(_jsx(IconFileDots, {})),
|
|
559
|
+
text: !isMobile ? SDKUI_Localizator.DocumentOperations : SDKUI_Localizator.Documents,
|
|
560
|
+
disabled: disabledForSingleRow(selectedItems, focusedItem) && disabledForMultiRow(selectedItems, focusedItem),
|
|
561
|
+
items: [
|
|
562
|
+
addToFavoriteMenuItem(),
|
|
563
|
+
addReplaceFileMenuItem(),
|
|
564
|
+
openFormMenuItem(),
|
|
565
|
+
deletetionMenuItem(),
|
|
566
|
+
fileCheckMenuItem(),
|
|
567
|
+
fileConversionsMenuItem(),
|
|
568
|
+
...(SDK_Globals.tmSession?.SessionDescr?.appModuleID === AppModules.SURFER ? [createContextualTaskMenuItem()] : []),
|
|
569
|
+
downloadFileMenuItem(),
|
|
570
|
+
downloadXMLAttachmentsMenuItem(),
|
|
571
|
+
duplicateDocumentMenuItem(),
|
|
572
|
+
batchUpdateMenuItem(),
|
|
573
|
+
...((openEditPdf && getSelectedDcmtsOrFocused(selectedItems, focusedItem)?.[0]?.FILEEXT?.toLowerCase() === "pdf") ? [pdfEditorMenuItem(openEditPdf)] : []),
|
|
574
|
+
]
|
|
575
|
+
},
|
|
576
|
+
signatureMenuItem(),
|
|
577
|
+
// checkinMenuItem(),
|
|
578
|
+
relationsMenuItem(),
|
|
579
|
+
// shareMenuItem(),
|
|
580
|
+
fullTextSearchMenuItem(),
|
|
581
|
+
otherMenuItem(),
|
|
582
|
+
{
|
|
583
|
+
icon: svgToString(_jsx(IconUserGroupOutline, {})),
|
|
584
|
+
text: !isMobile ? SDKUI_Localizator.WorkgroupOperations : SDKUI_Localizator.WorkingGroups,
|
|
585
|
+
operationType: 'multiRow',
|
|
586
|
+
visible: openWGsCopyMoveForm !== undefined || workingGroupContext !== undefined,
|
|
587
|
+
disabled: disabledForMultiRow(selectedItems, focusedItem),
|
|
588
|
+
beginGroup: true,
|
|
589
|
+
items: [
|
|
590
|
+
shareFromWgMenuItem(),
|
|
591
|
+
copyFromWgMenuItem(),
|
|
592
|
+
movetofolderFromWgMenuItem(),
|
|
593
|
+
commentFromWgMenuItem(true),
|
|
594
|
+
removeFromWgMenuItem(SDKUI_Localizator.Remove)
|
|
595
|
+
]
|
|
596
|
+
},
|
|
597
|
+
];
|
|
598
|
+
};
|
|
599
|
+
if (context === SearchResultContext.ARCHIVED_WORKGROUP) {
|
|
600
|
+
return getArchivedWorkgroupMenuItems();
|
|
601
|
+
}
|
|
602
|
+
return getDefaultMenuItems();
|
|
513
603
|
};
|
package/lib/ts/types.d.ts
CHANGED
|
@@ -47,7 +47,8 @@ export declare enum SearchResultContext {
|
|
|
47
47
|
WORKFLOW_APPROVE = "workflowApprove",
|
|
48
48
|
FAVORITES_AND_RECENTS = "favorites",
|
|
49
49
|
FREE_SEARCH = "freeSearch",
|
|
50
|
-
MASTER_DETAIL = "masterDetail"
|
|
50
|
+
MASTER_DETAIL = "masterDetail",
|
|
51
|
+
ARCHIVED_WORKGROUP = "archivedWorkgroup"
|
|
51
52
|
}
|
|
52
53
|
export declare enum DraftsMIDs {
|
|
53
54
|
WGID = 6001,
|
package/lib/ts/types.js
CHANGED
|
@@ -52,6 +52,7 @@ export var SearchResultContext;
|
|
|
52
52
|
SearchResultContext["FAVORITES_AND_RECENTS"] = "favorites";
|
|
53
53
|
SearchResultContext["FREE_SEARCH"] = "freeSearch";
|
|
54
54
|
SearchResultContext["MASTER_DETAIL"] = "masterDetail";
|
|
55
|
+
SearchResultContext["ARCHIVED_WORKGROUP"] = "archivedWorkgroup";
|
|
55
56
|
})(SearchResultContext || (SearchResultContext = {}));
|
|
56
57
|
export var DraftsMIDs;
|
|
57
58
|
(function (DraftsMIDs) {
|