@topconsultnpm/sdkui-react-beta 6.14.134 → 6.14.136
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/assets/icomoon.svg +96 -96
- package/lib/assets/italy.svg +16 -16
- package/lib/assets/topmedia-six.svg +65 -65
- package/lib/assets/topmeida-six-bianco.svg +65 -65
- package/lib/components/grids/TMBlogs.js +12 -6
- package/package.json +1 -1
|
@@ -209,12 +209,18 @@ const TMBlogs = (props) => {
|
|
|
209
209
|
};
|
|
210
210
|
// ContexMenuItems array contains a list of context menu items for a blog
|
|
211
211
|
const contextMenuItems = useMemo(() => {
|
|
212
|
+
// customData1 === 1 means the group is archived (historical)
|
|
213
|
+
const isGroupArchived = Boolean(context && context.engine === 'WorkingGroupEngine' && context.object && context.object.customData1 === 1);
|
|
214
|
+
const userId = SDK_Globals.tmSession?.SessionDescr?.userID;
|
|
215
|
+
const isNotOwner = focusedBlog && focusedBlog.ownerID !== userId;
|
|
216
|
+
const isDeleted = focusedBlog && (focusedBlog.isDel !== undefined && focusedBlog.isDel !== 0);
|
|
217
|
+
const isInvalid = focusedBlog === undefined;
|
|
212
218
|
let menuItemsElements = [
|
|
213
219
|
{
|
|
214
220
|
icon: "chat",
|
|
215
221
|
text: SDKUI_Localizator.Comment,
|
|
216
222
|
visible: contextMenuParams.isCommentEnabled,
|
|
217
|
-
disabled: false,
|
|
223
|
+
disabled: isGroupArchived ? true : false,
|
|
218
224
|
onClick: () => { if (showCommentFormCallback)
|
|
219
225
|
showCommentFormCallback(); },
|
|
220
226
|
},
|
|
@@ -237,14 +243,14 @@ const TMBlogs = (props) => {
|
|
|
237
243
|
text: SDKUI_Localizator.Delete,
|
|
238
244
|
visible: contextMenuParams.isDeleteEnabled,
|
|
239
245
|
onClick: () => deleteOrUndeleteCommentCallback(true),
|
|
240
|
-
disabled:
|
|
246
|
+
disabled: isNotOwner || isInvalid || isDeleted || isGroupArchived,
|
|
241
247
|
beginGroup: true
|
|
242
248
|
},
|
|
243
249
|
{
|
|
244
250
|
text: SDKUI_Localizator.CopyToClipboard,
|
|
245
251
|
visible: contextMenuParams.isCopyToClipboardEnabled,
|
|
246
252
|
icon: 'copy',
|
|
247
|
-
disabled:
|
|
253
|
+
disabled: isInvalid,
|
|
248
254
|
onClick: () => { copyInClipboard(focusedBlog); }
|
|
249
255
|
},
|
|
250
256
|
{
|
|
@@ -252,7 +258,7 @@ const TMBlogs = (props) => {
|
|
|
252
258
|
text: SDKUI_Localizator.Restore,
|
|
253
259
|
visible: contextMenuParams.isRestoreEnabled,
|
|
254
260
|
onClick: () => deleteOrUndeleteCommentCallback(false),
|
|
255
|
-
disabled:
|
|
261
|
+
disabled: isNotOwner || isInvalid || (focusedBlog && (focusedBlog.isDel === undefined || focusedBlog.isDel === 0)),
|
|
256
262
|
},
|
|
257
263
|
{
|
|
258
264
|
text: SDKUI_Localizator.CreateContextualTask,
|
|
@@ -260,7 +266,7 @@ const TMBlogs = (props) => {
|
|
|
260
266
|
onClick: () => { if (showTaskFormCallback)
|
|
261
267
|
showTaskFormCallback(); },
|
|
262
268
|
visible: contextMenuParams.isCreateContextualTask,
|
|
263
|
-
disabled: false,
|
|
269
|
+
disabled: isGroupArchived ? true : false,
|
|
264
270
|
beginGroup: true
|
|
265
271
|
},
|
|
266
272
|
{
|
|
@@ -633,7 +639,7 @@ const TMBlogs = (props) => {
|
|
|
633
639
|
minWidth: isMobile ? '90px' : '120px',
|
|
634
640
|
width: isMobile ? '90px' : '150px',
|
|
635
641
|
height: '29px',
|
|
636
|
-
} }))] }) }) })), _jsxs("div", { style: { height: `calc(100% - ${currentHeader && !isHeaderHidden ? '50px' : '0px'})`, width: "100%", overflow: 'auto', display: 'block' }, onContextMenu: onBackgroundContextMenu, children: [_jsx("div", { style: { width: "100%", height: "100%" }, children: ThumbnailView() }), anchorEl && _jsx(ContextMenu, { ref: contextMenuRef, dataSource: contextMenuItems, target: anchorEl, onHiding: closeContextMenu })] }), (showDcmtForm && focusedAttachment && focusedAttachment.TID && focusedAttachment.DID) && _jsx(TMDcmtForm, { TID: Number(focusedAttachment.TID), DID: Number(focusedAttachment.DID), layoutMode: LayoutModes.Update, onClose: onCloseDcmtForm, isClosable: true, titleModal: SDKUI_Localizator.Attachment + ": " + focusedAttachment.fileName, isModal: true, widthModal: "95%", heightModal: "95%" }), (showFloatingCommentButton && showCommentFormCallback) && _jsx("button", { style: {
|
|
642
|
+
} }))] }) }) })), _jsxs("div", { style: { height: `calc(100% - ${currentHeader && !isHeaderHidden ? '50px' : '0px'})`, width: "100%", overflow: 'auto', display: 'block' }, onContextMenu: onBackgroundContextMenu, children: [_jsx("div", { style: { width: "100%", height: "100%" }, children: ThumbnailView() }), anchorEl && _jsx(ContextMenu, { ref: contextMenuRef, dataSource: contextMenuItems, target: anchorEl, onHiding: closeContextMenu })] }), (showDcmtForm && focusedAttachment && focusedAttachment.TID && focusedAttachment.DID) && _jsx(TMDcmtForm, { TID: Number(focusedAttachment.TID), DID: Number(focusedAttachment.DID), layoutMode: LayoutModes.Update, onClose: onCloseDcmtForm, isClosable: true, titleModal: SDKUI_Localizator.Attachment + ": " + focusedAttachment.fileName, isModal: true, widthModal: "95%", heightModal: "95%" }), (showFloatingCommentButton && showCommentFormCallback && !(context?.engine === 'WorkingGroupEngine' && context?.object?.customData1 === 1)) && _jsx("button", { style: {
|
|
637
643
|
position: 'absolute',
|
|
638
644
|
bottom: '10px',
|
|
639
645
|
right: '20px',
|