@topconsultnpm/sdkui-react-beta 6.12.111 → 6.12.112
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,6 +1,6 @@
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
2
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
3
|
-
import { DcmtTypeListCacheService, ResultTypes, SDK_Globals, WorkingGroupEngine } from "@topconsultnpm/sdk-ts-beta";
|
3
|
+
import { DcmtTypeListCacheService, LayoutModes, ResultTypes, SDK_Globals, WorkingGroupEngine } from "@topconsultnpm/sdk-ts-beta";
|
4
4
|
import { ContextMenu, ScrollView } from 'devextreme-react';
|
5
5
|
import { SDKUI_Localizator, IconAttachment, getExceptionMessage, Globalization, IconBoard } from '../../helper';
|
6
6
|
import TMDataGrid from '../base/TMDataGrid';
|
@@ -16,6 +16,7 @@ import { TMSearchBar } from '../sidebar/TMHeader';
|
|
16
16
|
import { AttachmentElement, BlogPostContainer, colors, findFileItemByDraftID, highlightText, IconAndHeaderElement, isHeaderFullyHidden, OwnerInitialsBadge, TMBlogsFilterCategoryId } from './TMBlogsUtils';
|
17
17
|
import { useDcmtOperations } from '../../hooks/useDcmtOperations';
|
18
18
|
import { DownloadTypes } from '../../ts';
|
19
|
+
import TMDcmtForm from '../features/documents/TMDcmtForm';
|
19
20
|
let localAbortController = new AbortController();
|
20
21
|
const TMBlogs = (props) => {
|
21
22
|
const { id, allData, showExtendedAttachments = true, treeFs, draftLatestInfoMap, archivedDocumentMap, updateVisualizedBlogCallback, height, width, scrollToBottom = true, viewMode = 'thumbnails', header, showIconHeader = true, color = colors.PRIMARY_BLUE, handleNavigateToWGs, showId, setShowId, currentWorkingGroup, contextMenuParams = {
|
@@ -23,6 +24,7 @@ const TMBlogs = (props) => {
|
|
23
24
|
isShowHideIDEnaled: true,
|
24
25
|
isCommentEnabled: false,
|
25
26
|
isDownloadAttachmentEnabled: false,
|
27
|
+
isViewEditMetadata: false,
|
26
28
|
isDeleteEnabled: false,
|
27
29
|
isRestoreEnabled: false,
|
28
30
|
isRefreshEnabled: false,
|
@@ -76,6 +78,8 @@ const TMBlogs = (props) => {
|
|
76
78
|
const [localWaitPanelValuePrimary, setLocalWaitPanelValuePrimary] = useState(0);
|
77
79
|
// State variable to define the maximum value for the primary progress indicator in the wait panel.
|
78
80
|
const [localWaitPanelMaxValuePrimary, setLocalWaitPanelMaxValuePrimary] = useState(0);
|
81
|
+
// State to manage show selected file
|
82
|
+
const [showDcmtForm, setShowDcmtForm] = useState(false);
|
79
83
|
// Data source for the number of posts to display in the UI
|
80
84
|
const postsToShowDataSource = [
|
81
85
|
{ value: 30, display: SDKUI_Localizator.Latest + ' 30' },
|
@@ -181,6 +185,13 @@ const TMBlogs = (props) => {
|
|
181
185
|
disabled: focusedAttachment === undefined,
|
182
186
|
onClick: downloadAttachment,
|
183
187
|
},
|
188
|
+
{
|
189
|
+
icon: showDcmtForm ? 'eyeclose' : 'eyeopen',
|
190
|
+
text: showDcmtForm ? SDKUI_Localizator.HideMetadata : SDKUI_Localizator.ViewEditMetadata,
|
191
|
+
visible: contextMenuParams.isViewEditMetadata && focusedAttachment !== undefined,
|
192
|
+
disabled: focusedAttachment === undefined,
|
193
|
+
onClick: () => setShowDcmtForm(true),
|
194
|
+
},
|
184
195
|
{
|
185
196
|
icon: "trash",
|
186
197
|
text: SDKUI_Localizator.Delete,
|
@@ -230,7 +241,7 @@ const TMBlogs = (props) => {
|
|
230
241
|
},
|
231
242
|
];
|
232
243
|
return menuItemsElements;
|
233
|
-
}, [isHeaderHidden, localShowId, setLocalShowId, focusedBlog, focusedAttachment]);
|
244
|
+
}, [isHeaderHidden, localShowId, setLocalShowId, focusedBlog, focusedAttachment, showDcmtForm]);
|
234
245
|
useEffect(() => {
|
235
246
|
if (currentWorkingGroup === undefined)
|
236
247
|
setNewPostCount(0);
|
@@ -573,6 +584,10 @@ const TMBlogs = (props) => {
|
|
573
584
|
setAnchorEl(event.currentTarget);
|
574
585
|
}
|
575
586
|
};
|
587
|
+
const onCloseDcmtForm = useCallback(() => {
|
588
|
+
setShowDcmtForm(false);
|
589
|
+
handleFocusedAttachment(undefined);
|
590
|
+
}, []);
|
576
591
|
return _jsx("div", { style: { height: height ?? '100%', width: width ?? '100%' }, children: _jsxs(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: localShowWaitPanel, showWaitPanelPrimary: localShowPrimary, waitPanelTitle: localWaitPanelTitle, waitPanelTextPrimary: localWaitPanelTextPrimary, waitPanelValuePrimary: localWaitPanelValuePrimary, waitPanelMaxValuePrimary: localWaitPanelMaxValuePrimary, isCancelable: true, abortController: localAbortController, children: [(currentHeader && !isHeaderHidden) && (_jsx("div", { style: { display: 'block', width: '100%', overflowX: 'auto', overflowY: 'hidden', whiteSpace: 'nowrap' }, onContextMenu: e => e.preventDefault(), children: _jsx(ScrollView, { width: "100%", height: "auto", direction: "horizontal", useNative: true, children: _jsxs("div", { style: {
|
577
592
|
display: 'flex',
|
578
593
|
flexDirection: 'row',
|
@@ -591,6 +606,6 @@ const TMBlogs = (props) => {
|
|
591
606
|
minWidth: isMobile ? '90px' : '120px',
|
592
607
|
width: isMobile ? '90px' : '150px',
|
593
608
|
height: '29px',
|
594
|
-
} }))] }) }) })), _jsxs("div", { style: { height: `calc(100% - ${currentHeader && !isHeaderHidden ? '50px' : '0px'})`, width: "100%", overflow: 'auto', display: 'block' }, children: [_jsx("div", { style: { display: renderMode === 'thumbnails' ? 'block' : 'none', width: "100%", height: "100%" }, onContextMenu: onContextMenu, children: ThumbnailView() }), _jsx("div", { style: { display: renderMode === 'details' ? 'block' : 'none', width: "100%", height: "100%" }, children: DataGridView() }), anchorEl && _jsx(ContextMenu, { ref: contextMenuRef, dataSource: contextMenuItems, target: anchorEl, onHiding: closeContextMenu })] })] }) });
|
609
|
+
} }))] }) }) })), _jsxs("div", { style: { height: `calc(100% - ${currentHeader && !isHeaderHidden ? '50px' : '0px'})`, width: "100%", overflow: 'auto', display: 'block' }, children: [_jsx("div", { style: { display: renderMode === 'thumbnails' ? 'block' : 'none', width: "100%", height: "100%" }, onContextMenu: onContextMenu, children: ThumbnailView() }), _jsx("div", { style: { display: renderMode === 'details' ? 'block' : 'none', width: "100%", height: "100%" }, children: DataGridView() }), 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, showPreview: !isMobile, showBoard: !isMobile, widthModal: "95%", heightModal: "95%" })] }) });
|
595
610
|
};
|
596
611
|
export default TMBlogs;
|
@@ -170,6 +170,7 @@ export declare class SDKUI_Localizator {
|
|
170
170
|
static get Hide_CompleteName(): "Vollständigen Namen ausblenden" | "Hide full name" | "Ocultar nombre completo" | "Masquer le nom complet" | "Ocultar nome completo" | "Nascondi nome completo";
|
171
171
|
static get HideFilters(): string;
|
172
172
|
static get HideLeftPanel(): "Linkes Panel ausblenden" | "Hide left panel" | "Ocultar panel izquierdo" | "Masquer le panneau de gauche" | "Ocultar painel esquerdo" | "Nascondi il pannello sinistro";
|
173
|
+
static get HideMetadata(): string;
|
173
174
|
static get HideSearch(): "Suche ausblenden" | "Hide search" | "Ocultar búsqueda" | "Masquer la recherche" | "Ocultar pesquisa" | "Nascondi ricerca";
|
174
175
|
static get ID_Hide(): "Ausblenden ID" | "Hide ID" | "Ocultar ID" | "Masquer ID" | "Nascondi ID";
|
175
176
|
static get ID_Show(): "ID anzeigen" | "Show ID" | "Mostrar ID" | "Afficher ID" | "Visualizza ID";
|
@@ -400,6 +401,7 @@ export declare class SDKUI_Localizator {
|
|
400
401
|
static get VariablesSystem(): "Systemvariablen" | "System variables" | "Variables del sistema" | "Variables de système" | "Variáveis do sistema" | "Variabili di sistema";
|
401
402
|
static get Version(): string;
|
402
403
|
static get View_Metadato(): "Anzeige (Methadaten)" | "Visualization (metadata)" | "Visualización (metadato)" | "Visualisation (métadonnée)" | "Display (metadados)" | "Visualizzazione (metadato)";
|
404
|
+
static get ViewEditMetadata(): string;
|
403
405
|
static get ViewWithCheckOption(): "Kontrolle über Archivierung und Bearbeitung" | "Check on archive and update" | "Control en almacenamiento y modificación" | "Contrôle de l'archivage et la modifie" | "Controle de arquivamento e edição" | "Controllo su archiviazione e modifica";
|
404
406
|
static get Visible(): "Sichtbar" | "Visible" | "Visibles" | "Visibiles" | "Visíveis" | "Visibili";
|
405
407
|
static get VisibleItems(): "sichtbare Elemente" | "Visible items" | "elementos visibles" | "éléments visibles" | "itens visíveis" | "Elementi visibili";
|
@@ -1660,6 +1660,16 @@ export class SDKUI_Localizator {
|
|
1660
1660
|
default: return "Nascondi il pannello sinistro";
|
1661
1661
|
}
|
1662
1662
|
}
|
1663
|
+
static get HideMetadata() {
|
1664
|
+
switch (this._cultureID) {
|
1665
|
+
case CultureIDs.De_DE: return "Metadaten ausblenden";
|
1666
|
+
case CultureIDs.En_US: return "Hide Metadata";
|
1667
|
+
case CultureIDs.Es_ES: return "Ocultar metadatos";
|
1668
|
+
case CultureIDs.Fr_FR: return "Masquer les métadonnées";
|
1669
|
+
case CultureIDs.Pt_PT: return "Ocultar metadados";
|
1670
|
+
default: return "Nascondi metadati";
|
1671
|
+
}
|
1672
|
+
}
|
1663
1673
|
static get HideSearch() {
|
1664
1674
|
switch (this._cultureID) {
|
1665
1675
|
case CultureIDs.De_DE: return "Suche ausblenden";
|
@@ -3958,6 +3968,16 @@ export class SDKUI_Localizator {
|
|
3958
3968
|
default: return "Visualizzazione (metadato)";
|
3959
3969
|
}
|
3960
3970
|
}
|
3971
|
+
static get ViewEditMetadata() {
|
3972
|
+
switch (this._cultureID) {
|
3973
|
+
case CultureIDs.De_DE: return "Metadaten anzeigen/bearbeiten";
|
3974
|
+
case CultureIDs.En_US: return "View/Edit Metadata";
|
3975
|
+
case CultureIDs.Es_ES: return "Ver/Editar metadatos";
|
3976
|
+
case CultureIDs.Fr_FR: return "Afficher/Modifier les métadonnées";
|
3977
|
+
case CultureIDs.Pt_PT: return "Visualizar/Editar metadados";
|
3978
|
+
default: return "Visualizza/modifica metadati";
|
3979
|
+
}
|
3980
|
+
}
|
3961
3981
|
static get ViewWithCheckOption() {
|
3962
3982
|
switch (this._cultureID) {
|
3963
3983
|
case CultureIDs.De_DE: return "Kontrolle über Archivierung und Bearbeitung";
|