@topconsultnpm/sdkui-react 6.19.0-dev2.5 → 6.19.0-dev2.50
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/base/TMButton.d.ts +1 -0
- package/lib/components/base/TMButton.js +6 -6
- package/lib/components/base/TMCustomButton.d.ts +1 -1
- package/lib/components/base/TMCustomButton.js +83 -28
- package/lib/components/base/TMDataGridExportForm.d.ts +1 -1
- package/lib/components/base/TMDataGridExportForm.js +9 -3
- package/lib/components/base/TMFileManager.js +12 -3
- package/lib/components/base/TMFileManagerDataGridView.d.ts +2 -0
- package/lib/components/base/TMFileManagerDataGridView.js +12 -3
- package/lib/components/base/TMFileManagerThumbnailItems.d.ts +2 -0
- package/lib/components/base/TMFileManagerThumbnailItems.js +12 -2
- package/lib/components/base/TMFileManagerThumbnailsView.d.ts +2 -0
- package/lib/components/base/TMFileManagerThumbnailsView.js +2 -2
- package/lib/components/base/TMModal.d.ts +2 -0
- package/lib/components/base/TMModal.js +13 -2
- package/lib/components/base/TMTooltip.d.ts +1 -1
- package/lib/components/base/TMTooltip.js +1 -1
- package/lib/components/base/TMWaitPanel.js +8 -2
- package/lib/components/choosers/TMDcmtTypeChooser.js +2 -2
- package/lib/components/choosers/TMMetadataChooser.d.ts +4 -1
- package/lib/components/choosers/TMMetadataChooser.js +31 -8
- package/lib/components/choosers/TMUserChooser.d.ts +4 -0
- package/lib/components/choosers/TMUserChooser.js +21 -5
- package/lib/components/editors/TMDateBox.d.ts +1 -1
- package/lib/components/editors/TMTextArea.d.ts +1 -0
- package/lib/components/editors/TMTextArea.js +43 -9
- package/lib/components/editors/TMTextBox.js +33 -3
- package/lib/components/editors/TMTextExpression.js +36 -28
- package/lib/components/features/assistant/ToppyDraggableHelpCenter.d.ts +28 -0
- package/lib/components/features/assistant/ToppyDraggableHelpCenter.js +324 -0
- package/lib/components/features/assistant/ToppyHelpCenter.js +1 -1
- package/lib/components/features/assistant/ToppySpeechBubble.d.ts +8 -0
- package/lib/components/features/assistant/ToppySpeechBubble.js +53 -0
- package/lib/components/features/blog/TMBlogCommentForm.d.ts +2 -0
- package/lib/components/features/blog/TMBlogCommentForm.js +18 -6
- package/lib/components/features/documents/TMDcmtBlog.js +1 -1
- package/lib/components/features/documents/TMDcmtForm.js +313 -57
- package/lib/components/features/documents/TMDcmtPreview.js +45 -8
- package/lib/components/features/documents/TMRelationViewer.js +56 -23
- package/lib/components/features/search/TMSavedQuerySelector.js +1 -1
- package/lib/components/features/search/TMSearch.js +2 -2
- package/lib/components/features/search/TMSearchQueryEditor.js +1 -1
- package/lib/components/features/search/TMSearchQueryPanel.js +8 -25
- package/lib/components/features/search/TMSearchResult.js +94 -13
- package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +2 -1
- package/lib/components/features/search/TMSearchResultsMenuItems.js +97 -51
- package/lib/components/features/tasks/TMTaskForm.js +11 -5
- package/lib/components/features/tasks/TMTasksAgenda.js +4 -4
- package/lib/components/features/tasks/TMTasksCalendar.js +2 -2
- package/lib/components/features/tasks/TMTasksHeader.js +1 -1
- package/lib/components/features/tasks/TMTasksUtils.d.ts +2 -1
- package/lib/components/features/tasks/TMTasksUtils.js +18 -3
- package/lib/components/features/tasks/TMTasksUtilsView.js +26 -4
- package/lib/components/features/tasks/TMTasksView.js +12 -6
- package/lib/components/features/workflow/TMWorkflowPopup.js +3 -3
- package/lib/components/features/workflow/diagram/DiagramItemForm.js +8 -3
- package/lib/components/forms/TMResultDialog.js +8 -2
- package/lib/components/forms/TMSaveForm.js +2 -2
- package/lib/components/grids/TMBlogsPost.d.ts +8 -3
- package/lib/components/grids/TMBlogsPost.js +73 -11
- package/lib/components/grids/TMBlogsPostUtils.d.ts +1 -0
- package/lib/components/grids/TMBlogsPostUtils.js +15 -3
- package/lib/components/grids/TMRecentsManager.js +1 -1
- package/lib/components/index.d.ts +2 -1
- package/lib/components/index.js +2 -1
- package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +1 -0
- package/lib/components/layout/panelManager/TMPanelManagerContainer.js +2 -2
- package/lib/components/layout/panelManager/TMPanelManagerContext.js +0 -1
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +2 -1
- package/lib/components/layout/panelManager/types.d.ts +1 -0
- package/lib/components/pages/TMPage.js +1 -1
- package/lib/components/settings/SettingsAppearance.js +5 -5
- package/lib/components/viewers/TMDataListItemViewer.d.ts +1 -1
- package/lib/components/viewers/TMMidViewer.d.ts +1 -1
- package/lib/components/viewers/TMTidViewer.d.ts +1 -1
- package/lib/helper/GlobalStyles.d.ts +2 -0
- package/lib/helper/GlobalStyles.js +10 -0
- package/lib/helper/Globalization.d.ts +1 -0
- package/lib/helper/Globalization.js +30 -0
- package/lib/helper/SDKUI_Localizator.d.ts +39 -2
- package/lib/helper/SDKUI_Localizator.js +392 -22
- package/lib/helper/TMCustomSearchBar.js +1 -1
- package/lib/helper/TMIcons.d.ts +4 -1
- package/lib/helper/TMIcons.js +13 -1
- package/lib/helper/TMUtils.d.ts +1 -4
- package/lib/helper/TMUtils.js +18 -23
- package/lib/helper/dcmtsHelper.d.ts +2 -1
- package/lib/helper/dcmtsHelper.js +56 -17
- package/lib/helper/helpers.js +5 -1
- package/lib/helper/index.d.ts +1 -0
- package/lib/helper/index.js +1 -0
- package/lib/hooks/useRelatedDocuments.js +35 -26
- package/lib/ts/types.d.ts +3 -1
- package/package.json +8 -8
|
@@ -130,6 +130,11 @@ const DiagramItemForm = ({ itemToEdit, wf, onClose, onApply }) => {
|
|
|
130
130
|
width = '700px';
|
|
131
131
|
height = '700px';
|
|
132
132
|
break;
|
|
133
|
+
case DiagramItemTypes.WorkGroup_AddParts:
|
|
134
|
+
case DiagramItemTypes.CaseFlow_AddParts:
|
|
135
|
+
width = '700px';
|
|
136
|
+
height = '530px';
|
|
137
|
+
break;
|
|
133
138
|
default:
|
|
134
139
|
width = '50%';
|
|
135
140
|
height = '50%';
|
|
@@ -562,7 +567,7 @@ const DiagramItemForm = ({ itemToEdit, wf, onClose, onApply }) => {
|
|
|
562
567
|
const newTos = actorsToTos(updatedRecipients);
|
|
563
568
|
handleTos2Change(newTos);
|
|
564
569
|
}, [localItem.Tos2, handleTos2Change]);
|
|
565
|
-
return (_jsxs(_Fragment, { children: [_jsx(TMTextExpression, { label: `${SDKUI_Localizator.Name} (${SDKUI_Localizator.
|
|
570
|
+
return (_jsxs(_Fragment, { children: [_jsx(TMTextExpression, { label: `${SDKUI_Localizator.Name} (${SDKUI_Localizator.Dossier})`, value: localItem.PlatformObjName, valueOrig: localItemOrig.PlatformObjName, tid: wf?.MTID, isModifiedWhen: (localItem.PlatformObjName ?? '') !== (localItemOrig.PlatformObjName ?? ''), onValueChanged: handlePlatformObjNameChange }), _jsx(TMTextExpression, { label: `${SDKUI_Localizator.Description} (${SDKUI_Localizator.Dossier})`, value: localItem.PlatformObjDescr, valueOrig: localItemOrig.PlatformObjDescr, tid: wf?.MTID, isModifiedWhen: (localItem.PlatformObjDescr ?? '') !== (localItemOrig.PlatformObjDescr ?? ''), onValueChanged: handlePlatformObjDescrChange }), _jsx(TMCultureIDPicker, { label: SDKUI_Localizator.Format, selectedValue: localItem.FormatCultureID, isModifiedWhen: localItem.FormatCultureID !== localItemOrig.FormatCultureID, openChooserBySingleClick: true, onSelectCultureID: handleFormatCultureIDChange }), _jsx(TMTextExpression, { label: `${SDKUI_Localizator.CommentText} (${SDKUI_Localizator.BlogCase})`, placeHolder: 'Inserisci il valore', rows: 2, value: localItem.Value1asString, valueOrig: localItemOrig.Value1asString, tid: wf?.MTID, isModifiedWhen: (localItem.Value1asString ?? '') !== (localItemOrig.Value1asString ?? ''), onValueChanged: handleValue1asStringChange }), _jsx(TMCheckBox, { value: localItem.Value1asInt ?? 0, label: SDKUI_Localizator.WorkflowAddDraftToWg, isModifiedWhen: localItem.Value1asInt !== localItemOrig.Value1asInt, onValueChanged: handleValue1asIntChange }), _jsx(TMCheckBox, { value: localItem.Value2asInt ?? 0, label: SDKUI_Localizator.WorkflowAddDcmtToWg, isModifiedWhen: localItem.Value2asInt !== localItemOrig.Value2asInt, onValueChanged: handleValue2asIntChange }), _jsx(TMCheckBox, { value: localItem.Trunc ?? 0, label: SDKUI_Localizator.TruncateString, isModifiedWhen: localItem.Trunc !== localItemOrig.Trunc, onValueChanged: handleTruncChange }), _jsxs(RecipientsContainer, { children: [_jsx(RecipientList, { recipients: tosRecipients, title: SDKUI_Localizator.OwnerName, tid: wf?.MTID, onAdd: (newRecipients) => handleAddTosRecipients(newRecipients, 0), onRemove: handleRemoveTosRecipient }), _jsx(RecipientList, { recipients: tos2Recipients, title: SDKUI_Localizator.Participants, tid: wf?.MTID, onAdd: (newRecipients) => handleAddTos2Recipients(newRecipients, 0), onRemove: handleRemoveTos2Recipient })] })] }));
|
|
566
571
|
};
|
|
567
572
|
const renderCaseFlowCreateFields = () => {
|
|
568
573
|
const [dossierTypes, setDossierTypes] = useState([]);
|
|
@@ -606,7 +611,7 @@ const DiagramItemForm = ({ itemToEdit, wf, onClose, onApply }) => {
|
|
|
606
611
|
const newTos = actorsToTos(updatedRecipients);
|
|
607
612
|
handleTos2Change(newTos);
|
|
608
613
|
}, [localItem.Tos2, handleTos2Change]);
|
|
609
|
-
return (_jsxs(_Fragment, { children: [_jsx(TMTextExpression, { label: `${SDKUI_Localizator.Name} (${SDKUI_Localizator.
|
|
614
|
+
return (_jsxs(_Fragment, { children: [_jsx(TMTextExpression, { label: `${SDKUI_Localizator.Name} (${SDKUI_Localizator.Dossier})`, value: localItem.PlatformObjName, valueOrig: localItemOrig.PlatformObjName, tid: wf?.MTID, isModifiedWhen: (localItem.PlatformObjName ?? '') !== (localItemOrig.PlatformObjName ?? ''), onValueChanged: handlePlatformObjNameChange }), _jsx(TMDropDown, { dataSource: dossierTypes, label: `${SDKUI_Localizator.Description} (${SDKUI_Localizator.Dossier})`, value: localItem.Value3asInt, isModifiedWhen: (localItem.Value3asInt ?? 0) !== (localItemOrig.Value3asInt ?? 0), onValueChanged: (e) => { handleValue3asIntChange(e.target.value); } }), _jsx(TMTextExpression, { label: `${SDKUI_Localizator.Description} (${SDKUI_Localizator.Dossier})`, value: localItem.PlatformObjDescr, valueOrig: localItemOrig.PlatformObjDescr, tid: wf?.MTID, isModifiedWhen: (localItem.PlatformObjDescr ?? '') !== (localItemOrig.PlatformObjDescr ?? ''), onValueChanged: handlePlatformObjDescrChange }), _jsx(TMCultureIDPicker, { label: SDKUI_Localizator.Format, selectedValue: localItem.FormatCultureID, isModifiedWhen: localItem.FormatCultureID !== localItemOrig.FormatCultureID, openChooserBySingleClick: true, onSelectCultureID: handleFormatCultureIDChange }), _jsx(TMTextExpression, { label: `${SDKUI_Localizator.CommentText} (${SDKUI_Localizator.BlogCase})`, placeHolder: 'Inserisci il valore', rows: 2, value: localItem.Value1asString, valueOrig: localItemOrig.Value1asString, tid: wf?.MTID, isModifiedWhen: (localItem.Value1asString ?? '') !== (localItemOrig.Value1asString ?? ''), onValueChanged: handleValue1asStringChange }), _jsx(TMCheckBox, { value: localItem.Value1asInt ?? 0, label: SDKUI_Localizator.WorkflowAddDcmtAsAttachment, isModifiedWhen: localItem.Value1asInt !== localItemOrig.Value1asInt, onValueChanged: handleValue1asIntChange }), _jsx(TMCheckBox, { value: localItem.Value2asInt ?? 0, label: SDKUI_Localizator.WorkflowAddDcmtToDossier, isModifiedWhen: localItem.Value2asInt !== localItemOrig.Value2asInt, onValueChanged: handleValue2asIntChange }), _jsx(TMCheckBox, { value: localItem.Trunc ?? 0, label: SDKUI_Localizator.TruncateString, isModifiedWhen: localItem.Trunc !== localItemOrig.Trunc, onValueChanged: handleTruncChange }), _jsxs(RecipientsContainer, { children: [_jsx(RecipientList, { recipients: tosRecipients, title: SDKUI_Localizator.OwnerName, tid: wf?.MTID, onAdd: (newRecipients) => handleAddTosRecipients(newRecipients, 0), onRemove: handleRemoveTosRecipient }), _jsx(RecipientList, { recipients: tos2Recipients, title: SDKUI_Localizator.Participants, tid: wf?.MTID, onAdd: (newRecipients) => handleAddTos2Recipients(newRecipients, 0), onRemove: handleRemoveTos2Recipient })] })] }));
|
|
610
615
|
};
|
|
611
616
|
const renderAddPartsFields = () => {
|
|
612
617
|
const { andRecipients: tosRecipients } = useMemo(() => {
|
|
@@ -624,7 +629,7 @@ const DiagramItemForm = ({ itemToEdit, wf, onClose, onApply }) => {
|
|
|
624
629
|
const newTos = actorsToTos(updatedRecipients);
|
|
625
630
|
handleTosChange(newTos);
|
|
626
631
|
}, [localItem.Tos, handleTosChange]);
|
|
627
|
-
return (_jsxs(_Fragment, { children: [_jsx(TMTextExpression, { label: `${SDKUI_Localizator.Name} (${localItem.Type === DiagramItemTypes.CaseFlow_AddParts ? SDKUI_Localizator.
|
|
632
|
+
return (_jsxs(_Fragment, { children: [_jsx(TMTextExpression, { label: `${SDKUI_Localizator.Name} (${localItem.Type === DiagramItemTypes.CaseFlow_AddParts ? SDKUI_Localizator.Dossier : SDKUI_Localizator.WorkGroup})`, value: localItem.PlatformObjName, valueOrig: localItemOrig.PlatformObjName, tid: wf?.MTID, isModifiedWhen: (localItem.PlatformObjName ?? '') !== (localItemOrig.PlatformObjName ?? ''), onValueChanged: handlePlatformObjNameChange }), _jsx(TMCultureIDPicker, { label: SDKUI_Localizator.Format, selectedValue: localItem.FormatCultureID, isModifiedWhen: localItem.FormatCultureID !== localItemOrig.FormatCultureID, openChooserBySingleClick: true, onSelectCultureID: handleFormatCultureIDChange }), _jsx(TMCheckBox, { value: localItem.Trunc ?? 0, label: SDKUI_Localizator.TruncateString, isModifiedWhen: localItem.Trunc !== localItemOrig.Trunc, onValueChanged: handleTruncChange }), _jsx(TMRadioButton, { label: SDKUI_Localizator.OperationType, dataSource: [
|
|
628
633
|
{ value: 1, display: SDKUI_Localizator.Add },
|
|
629
634
|
{ value: 0, display: SDKUI_Localizator.Remove },
|
|
630
635
|
], value: localItem.Value1asInt, isModifiedWhen: localItem.Value1asInt !== localItemOrig.Value1asInt, onValueChanged: handleValue1asIntChange }), _jsx(RecipientList, { recipients: tosRecipients, title: SDKUI_Localizator.OwnerName, tid: wf?.MTID, onAdd: (newRecipients) => handleAddTosRecipients(newRecipients, 0), onRemove: handleRemoveTosRecipient })] }));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ResultTypes } from '@topconsultnpm/sdk-ts';
|
|
3
|
-
import DataGrid, { Column, HeaderFilter, Pager, Paging, Scrolling } from 'devextreme-react/
|
|
3
|
+
import DataGrid, { Column, HeaderFilter, Pager, Paging, Scrolling } from 'devextreme-react/data-grid';
|
|
4
4
|
import ReactDOM from 'react-dom/client';
|
|
5
5
|
import { IconSuccessCirlce, IconWarning, IconCloseCircle, IconInfo, SDKUI_Globals, SDKUI_Localizator } from '../../helper';
|
|
6
6
|
import { TMColors } from '../../utils/theme';
|
|
@@ -8,6 +8,7 @@ import ShowAlert from '../base/TMAlert';
|
|
|
8
8
|
import { TMDeviceProvider } from '../base/TMDeviceProvider';
|
|
9
9
|
import TMLayoutContainer from '../base/TMLayout';
|
|
10
10
|
import TMModal from '../base/TMModal';
|
|
11
|
+
import { TMExceptionBoxManager } from '../base/TMPopUp';
|
|
11
12
|
const cellRender = (cellData) => {
|
|
12
13
|
const resultType = cellData.data.resultType;
|
|
13
14
|
switch (resultType) {
|
|
@@ -19,7 +20,12 @@ const cellRender = (cellData) => {
|
|
|
19
20
|
}
|
|
20
21
|
};
|
|
21
22
|
const TMResultDialog = ({ title, result, id1Caption, id2Caption }) => {
|
|
22
|
-
|
|
23
|
+
const handleRowDblClick = (e) => {
|
|
24
|
+
if (e.data && e.data.description) {
|
|
25
|
+
TMExceptionBoxManager.show({ exception: e.data.description });
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
return (_jsx(TMModal, { height: '65%', width: '75%', title: `${SDKUI_Localizator.OperationResult} - ${title}`, children: _jsxs(TMLayoutContainer, { children: [_jsxs("div", { style: { display: 'flex', flexDirection: 'row', gap: '5px', padding: '5px', justifyContent: 'center', alignItems: 'center' }, children: [_jsx("p", { children: `${SDKUI_Localizator.ProcessedItems}: ${result.length}` }), _jsx(IconSuccessCirlce, { fontSize: 22, color: TMColors.success }), _jsx("p", { children: result.filter(o => o.resultType == ResultTypes.SUCCESS).length ?? 0 }), _jsx(IconWarning, { fontSize: 22, color: TMColors.warning }), _jsx("p", { children: result.filter(o => o.resultType == ResultTypes.WARNING).length ?? 0 }), _jsx(IconCloseCircle, { fontSize: 22, color: TMColors.error }), _jsx("p", { children: result.filter(o => o.resultType == ResultTypes.ERROR).length ?? 0 })] }), _jsxs(DataGrid, { dataSource: result.filter(o => o.resultType != ResultTypes.SUCCESS), showColumnLines: Number(SDKUI_Globals.userSettings?.themeSettings.gridSettings.showRowLines) === 1, showRowLines: Number(SDKUI_Globals.userSettings?.themeSettings.gridSettings.showColumnLines) === 1, keyExpr: "rowIndex", width: "100%", height: "100%", columnResizingMode: "widget", allowColumnResizing: true, focusedRowEnabled: true, hoverStateEnabled: true, rowAlternationEnabled: true, onRowDblClick: handleRowDblClick, children: [_jsx(Column, { dataField: 'resultType', caption: '', width: "5%", allowResizing: true, allowSorting: true, cellRender: cellRender }), _jsx(Column, { dataField: 'id1', caption: id1Caption, width: "10%" }), id2Caption && _jsx(Column, { dataField: 'id2', caption: id2Caption, width: "10%" }), _jsx(Column, { dataField: 'description', allowResizing: true, caption: SDKUI_Localizator.Description, allowSorting: true, width: id2Caption ? "75%" : "85%" }), _jsx(HeaderFilter, { visible: true }), _jsx(Paging, { enabled: true, pageSize: 30 }), _jsx(Pager, { visible: true, showInfo: true, showNavigationButtons: true }), _jsx(Scrolling, { mode: 'standard', useNative: Number(SDKUI_Globals.userSettings?.themeSettings.gridSettings.useNativeScrollbar) === 1 })] })] }) }));
|
|
23
29
|
};
|
|
24
30
|
export default TMResultDialog;
|
|
25
31
|
export class TMResultManager {
|
|
@@ -11,7 +11,7 @@ import { TMColors } from '../../utils/theme';
|
|
|
11
11
|
import TMValidationItemsList from '../grids/TMValidationItemsList';
|
|
12
12
|
import TMModal from '../base/TMModal';
|
|
13
13
|
import { DeviceType, useDeviceType } from '../base/TMDeviceProvider';
|
|
14
|
-
const TMSaveForm = ({ id, formMode = FormModes.Update, showToolbar = true, skipIsModifiedCheck = false, title, children, isModal, exception, customToolbarElements, hasNavigation, showSaveButton = true, customSaveButton, customTooltipSaveButton, showBackButton, showWarningsCount = true, showErrorCount = true, showUndoButton = true, onClose, onSaveAsync, onNext, onPrev, canNext, canPrev, isModified, onShowList, validationItems = [], onUndo, onCancel, width, height, askClosingConfirm = false, showTitleFormMode = true }) => {
|
|
14
|
+
const TMSaveForm = ({ id, formMode = FormModes.Update, showToolbar = true, skipIsModifiedCheck = false, title, children, isModal, exception, customToolbarElements, hasNavigation, showSaveButton = true, customSaveButton, customTooltipSaveButton, showBackButton, showWarningsCount = true, showErrorCount = true, showUndoButton = true, onClose, onSaveAsync, onNext, onPrev, canNext, canPrev, isModified, onShowList, validationItems = [], onUndo, onCancel, width, height, askClosingConfirm = false, showTitleFormMode = true, showCloseButton = true }) => {
|
|
15
15
|
const [showList, setShowList] = useState(true);
|
|
16
16
|
const [showErrorGrid, setShowErrorGrid] = useState(false);
|
|
17
17
|
const deviceType = useDeviceType();
|
|
@@ -110,7 +110,7 @@ const TMSaveForm = ({ id, formMode = FormModes.Update, showToolbar = true, skipI
|
|
|
110
110
|
_jsx("div", { style: { width: '100%', height: '100%', marginTop: '50px', display: 'flex', alignItems: 'center', justifyContent: 'center', flexDirection: 'column', color: getColor('error') }, children: 'Si è verificato un errore' })
|
|
111
111
|
: _jsx(_Fragment, { children: children }) }), showErrorGrid && validationItems.length > 0 ? _jsx(TMCard, { scrollY: true, padding: false, showBorder: false, children: _jsx(TMValidationItemsList, { validationItems: validationItems }) }) : _jsx(_Fragment, {})] }) }), (isModal && onClose) && _jsx("div", { id: "TMSaveFormShowConfirmForClose-" + id })] }));
|
|
112
112
|
};
|
|
113
|
-
return (_jsx(_Fragment, { children: (isModal && onClose) ? _jsx(_Fragment, { children: _jsx(TMModal, { title: `${title}${showTitleFormMode ? ` - ${LocalizeFormModes(formMode)}` : ''}`, onClose: doClose, width: width ?? '100%', height: height ?? '100%', hidePopup: false, askClosingConfirm: askClosingConfirm, children: _jsx("div", { style: { width: "100%", height: "100%", display: 'block' }, children: renderSaveForm() }) }) })
|
|
113
|
+
return (_jsx(_Fragment, { children: (isModal && onClose) ? _jsx(_Fragment, { children: _jsx(TMModal, { title: `${title}${showTitleFormMode ? ` - ${LocalizeFormModes(formMode)}` : ''}`, onClose: doClose, width: width ?? '100%', height: height ?? '100%', hidePopup: false, askClosingConfirm: askClosingConfirm, showCloseButton: showCloseButton, children: _jsx("div", { style: { width: "100%", height: "100%", display: 'block' }, children: renderSaveForm() }) }) })
|
|
114
114
|
: renderSaveForm() }));
|
|
115
115
|
};
|
|
116
116
|
export default TMSaveForm;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { BlogPost, HomeBlogPost, TaskDescriptor } from "@topconsultnpm/sdk-ts";
|
|
3
|
-
import { DcmtInfo } from "../../ts";
|
|
2
|
+
import { BlogPost, HomeBlogPost, TaskDescriptor, UserDescriptor } from "@topconsultnpm/sdk-ts";
|
|
3
|
+
import { DcmtInfo, FormModes } from "../../ts";
|
|
4
4
|
import { FileItem } from "../base/TMFileManagerUtils";
|
|
5
5
|
import { TMBlogsPostHeader, TMBlogContextDescriptor } from "./TMBlogsPostUtils";
|
|
6
6
|
interface TMBlogsPostProps {
|
|
@@ -41,6 +41,10 @@ interface TMBlogsPostProps {
|
|
|
41
41
|
}>;
|
|
42
42
|
/** Context descriptor for the blog component */
|
|
43
43
|
context?: TMBlogContextDescriptor;
|
|
44
|
+
/** Array of participants */
|
|
45
|
+
participants?: Array<UserDescriptor>;
|
|
46
|
+
/** Callback function to be executed when a task is saved */
|
|
47
|
+
afterTaskSaved?: (task: TaskDescriptor | undefined, formMode: FormModes | undefined, forceRefresh?: boolean) => Promise<void>;
|
|
44
48
|
/** Optional context menu params */
|
|
45
49
|
contextMenuParams?: {
|
|
46
50
|
isShowHideFilterEnabled: boolean;
|
|
@@ -74,11 +78,12 @@ interface TMBlogsPostProps {
|
|
|
74
78
|
externalBlogPost?: BlogPost;
|
|
75
79
|
/** Optional function to reset the external blog post */
|
|
76
80
|
resetExternalBlogPost?: () => void;
|
|
81
|
+
visible?: boolean;
|
|
77
82
|
allTasks?: Array<TaskDescriptor>;
|
|
78
83
|
getAllTasks?: () => Promise<void>;
|
|
79
84
|
deleteTaskByIdsCallback?: (deletedTaskIds: Array<number>) => Promise<void>;
|
|
80
|
-
addTaskCallback?: (task: TaskDescriptor) => Promise<void>;
|
|
81
85
|
editTaskCallback?: (task: TaskDescriptor) => Promise<void>;
|
|
86
|
+
addTaskCallback?: (task: TaskDescriptor) => Promise<void>;
|
|
82
87
|
handleNavigateToWGs?: (value: HomeBlogPost | number) => Promise<void>;
|
|
83
88
|
handleNavigateToDossiers?: (value: HomeBlogPost | number) => Promise<void>;
|
|
84
89
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React, { useCallback, useEffect, useRef, useState } from "react";
|
|
3
|
-
import { LayoutModes, ResultTypes, SDK_Globals, WorkingGroupEngine } from "@topconsultnpm/sdk-ts";
|
|
3
|
+
import { DossierEngine, LayoutModes, ResultTypes, SDK_Globals, TaskDescriptor, WorkingGroupEngine } from "@topconsultnpm/sdk-ts";
|
|
4
4
|
import { ContextMenu } from "devextreme-react";
|
|
5
|
-
import { SDKUI_Localizator, Globalization, getExceptionMessage, TMConditionalWrapper } from "../../helper";
|
|
5
|
+
import { SDKUI_Localizator, Globalization, getExceptionMessage, TMConditionalWrapper, calcResponsiveSizes } from "../../helper";
|
|
6
6
|
import TMToppyMessage from "../../helper/TMToppyMessage";
|
|
7
7
|
import { useDcmtOperations } from "../../hooks/useDcmtOperations";
|
|
8
|
-
import { DownloadTypes } from "../../ts";
|
|
8
|
+
import { DownloadTypes, FormModes } from "../../ts";
|
|
9
9
|
import { TMColors } from "../../utils/theme";
|
|
10
10
|
import ShowAlert from "../base/TMAlert";
|
|
11
11
|
import { TMMessageBoxManager, ButtonNames } from "../base/TMPopUp";
|
|
@@ -14,12 +14,14 @@ import { TMLayoutWaitingContainer } from "../base/TMWaitPanel";
|
|
|
14
14
|
import TMHtmlContentDisplay from "../editors/TMHtmlContentDisplay";
|
|
15
15
|
import TMDcmtForm from "../features/documents/TMDcmtForm";
|
|
16
16
|
import { TMResultManager } from "../forms/TMResultDialog";
|
|
17
|
-
import { isHeaderFullyHidden, TMBlogsFilterCategoryId, getDcmtTypeDescriptor, findFileItemByDraftID, BlogPostTitle, NewBadge } from "./TMBlogsPostUtils";
|
|
17
|
+
import { isHeaderFullyHidden, TMBlogsFilterCategoryId, getDcmtTypeDescriptor, findFileItemByDraftID, BlogPostTitle, NewBadge, stripHtml } from "./TMBlogsPostUtils";
|
|
18
18
|
import TMBlogAttachments from "./TMBlogAttachments";
|
|
19
19
|
import TMBlogHeader from "./TMBlogHeader";
|
|
20
|
+
import TMTaskForm from "../features/tasks/TMTaskForm";
|
|
21
|
+
import { useDeviceType } from "../base/TMDeviceProvider";
|
|
20
22
|
let localAbortController = new AbortController();
|
|
21
23
|
const TMBlogsPost = (props) => {
|
|
22
|
-
const { scrollToSelected, id, posts, displayMode = "stacked", height = "100%", width = "100%", scrollToBottom = true, header, showExtendedAttachments = true, treeFs, draftLatestInfoMap, archivedDocumentMap, context, contextMenuParams = {
|
|
24
|
+
const { scrollToSelected, id, posts, displayMode = "stacked", height = "100%", width = "100%", scrollToBottom = true, header, showExtendedAttachments = true, treeFs, draftLatestInfoMap, archivedDocumentMap, context, participants, contextMenuParams = {
|
|
23
25
|
isShowHideFilterEnabled: true,
|
|
24
26
|
isShowHideIDEnaled: true,
|
|
25
27
|
isCommentEnabled: false,
|
|
@@ -30,8 +32,10 @@ const TMBlogsPost = (props) => {
|
|
|
30
32
|
isRestoreEnabled: false,
|
|
31
33
|
isRefreshEnabled: false,
|
|
32
34
|
isCreateContextualTask: false,
|
|
33
|
-
}, showFloatingCommentButton = false, showCommentFormCallback,
|
|
35
|
+
}, showFloatingCommentButton = false, showCommentFormCallback, refreshCallback, showId, setShowId, refreshHomePageNews, markBlogAsRead, externalBlogPost, resetExternalBlogPost, visible = true, allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, afterTaskSaved, handleNavigateToWGs, handleNavigateToDossiers, } = props;
|
|
34
36
|
const { abortController, showWaitPanel, waitPanelTitle, showPrimary, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, downloadDcmtsAsync } = useDcmtOperations();
|
|
37
|
+
// Get the current device type (e.g., mobile, tablet, desktop) using a custom hook.
|
|
38
|
+
const deviceType = useDeviceType();
|
|
35
39
|
const bottomRef = useRef(null);
|
|
36
40
|
const containerRef = useRef(null);
|
|
37
41
|
// State to manage the layout mode of the document form
|
|
@@ -58,6 +62,10 @@ const TMBlogsPost = (props) => {
|
|
|
58
62
|
const [focusedItem, setFocusedItem] = useState(undefined);
|
|
59
63
|
// State to manage the focused file
|
|
60
64
|
const [focusedAttachment, setFocusedAttachment] = useState(undefined);
|
|
65
|
+
const [taskContext, setTaskContext] = useState(undefined);
|
|
66
|
+
const [currentTask, setCurrentTask] = useState(new TaskDescriptor());
|
|
67
|
+
// State to manage show task form selected file
|
|
68
|
+
const [showTaskForm, setShowTaskForm] = useState(false);
|
|
61
69
|
// State to manage show selected file
|
|
62
70
|
const [dcmtForm, setDcmtForm] = useState({ show: false, dcmt: undefined });
|
|
63
71
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
@@ -83,6 +91,24 @@ const TMBlogsPost = (props) => {
|
|
|
83
91
|
const handleFocusedAttachment = (attachment) => {
|
|
84
92
|
setFocusedAttachment(attachment);
|
|
85
93
|
};
|
|
94
|
+
useEffect(() => {
|
|
95
|
+
if (context === undefined) {
|
|
96
|
+
setTaskContext(undefined);
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
if (context.engine === 'WorkingGroupEngine' && context.object) {
|
|
100
|
+
setTaskContext({ workingGroup: { id: context?.object?.id ?? 0, name: context?.object?.name ?? '' } });
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
if (context.engine === 'DossierEngine' && context.object) {
|
|
104
|
+
setTaskContext({ dossier: { id: context?.object?.id ?? 0, name: context?.object?.name ?? '' } });
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
if (context.engine === 'SearchEngine' && context.object) {
|
|
108
|
+
setTaskContext({ document: { tid: context?.object?.tid ?? 0, did: context?.object?.did ?? 0, name: '' } });
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
}, [context]);
|
|
86
112
|
useEffect(() => {
|
|
87
113
|
if (externalBlogPost && externalBlogPost.id) {
|
|
88
114
|
const foundPost = blogPosts.find(post => post.id === externalBlogPost.id);
|
|
@@ -222,6 +248,11 @@ const TMBlogsPost = (props) => {
|
|
|
222
248
|
if (setShowId)
|
|
223
249
|
setShowId(localShowId);
|
|
224
250
|
}, [localShowId]);
|
|
251
|
+
useEffect(() => {
|
|
252
|
+
if (!visible) {
|
|
253
|
+
closeContextMenu();
|
|
254
|
+
}
|
|
255
|
+
}, [visible]);
|
|
225
256
|
const toggleHeaderClick = () => {
|
|
226
257
|
setCurrentHeader(prevState => {
|
|
227
258
|
if (prevState === undefined) {
|
|
@@ -320,6 +351,16 @@ const TMBlogsPost = (props) => {
|
|
|
320
351
|
result.push({ rowIndex: currentBlog.id, id1: currentBlog.id, id2: currentBlog.id, resultType: ResultTypes.ERROR, description: getExceptionMessage(err) });
|
|
321
352
|
});
|
|
322
353
|
break;
|
|
354
|
+
case 'DS':
|
|
355
|
+
const dossierEngine = new DossierEngine(SDK_Globals.tmSession);
|
|
356
|
+
await dossierEngine.FollowAddOrRemoveAsync(currentBlog.id, true).then(async () => {
|
|
357
|
+
result.push({ rowIndex: currentBlog.id, id1: currentBlog.id, id2: currentBlog.id, description: SDKUI_Localizator.OperationSuccess, resultType: ResultTypes.SUCCESS });
|
|
358
|
+
refreshHomePageNews?.();
|
|
359
|
+
})
|
|
360
|
+
.catch((err) => {
|
|
361
|
+
result.push({ rowIndex: currentBlog.id, id1: currentBlog.id, id2: currentBlog.id, resultType: ResultTypes.ERROR, description: getExceptionMessage(err) });
|
|
362
|
+
});
|
|
363
|
+
break;
|
|
323
364
|
default:
|
|
324
365
|
ShowAlert({ message: 'TODO', mode: 'warning', title: SDKUI_Localizator.Unfollow, duration: 3000 });
|
|
325
366
|
break;
|
|
@@ -418,6 +459,27 @@ const TMBlogsPost = (props) => {
|
|
|
418
459
|
}
|
|
419
460
|
});
|
|
420
461
|
};
|
|
462
|
+
const openTaskFormCallback = useCallback((targetItem) => {
|
|
463
|
+
const task = new TaskDescriptor();
|
|
464
|
+
const cleanText = stripHtml(targetItem?.description ?? '');
|
|
465
|
+
task.name = cleanText.slice(0, 100);
|
|
466
|
+
setCurrentTask(task);
|
|
467
|
+
setShowTaskForm(true);
|
|
468
|
+
}, []);
|
|
469
|
+
const closeTaskFormCallback = useCallback(() => {
|
|
470
|
+
setShowTaskForm(false);
|
|
471
|
+
}, []);
|
|
472
|
+
const onSavedTaskFormCallback = (task) => {
|
|
473
|
+
if (task) {
|
|
474
|
+
addTaskCallback?.(task);
|
|
475
|
+
setShowTaskForm(false);
|
|
476
|
+
afterTaskSaved?.(task, FormModes.Create);
|
|
477
|
+
ShowAlert({ message: SDKUI_Localizator.TaskSavedSuccessfully.replaceParams(task.name ?? '-'), mode: 'success', title: SDKUI_Localizator.Widget_Activities, duration: 3000 });
|
|
478
|
+
}
|
|
479
|
+
else {
|
|
480
|
+
ShowAlert({ message: SDKUI_Localizator.TaskSaveError, mode: 'error', title: SDKUI_Localizator.Widget_Activities, duration: 3000 });
|
|
481
|
+
}
|
|
482
|
+
};
|
|
421
483
|
// Open document form
|
|
422
484
|
const openDcmtForm = (dcmtInfo) => {
|
|
423
485
|
setDcmtForm({ show: true, dcmt: dcmtInfo });
|
|
@@ -491,20 +553,20 @@ const TMBlogsPost = (props) => {
|
|
|
491
553
|
onClick: () => { copyInClipboard(targetItem); }
|
|
492
554
|
});
|
|
493
555
|
}
|
|
494
|
-
if (contextMenuParams.isCreateContextualTask
|
|
556
|
+
if (contextMenuParams.isCreateContextualTask) {
|
|
495
557
|
menuItems.push({
|
|
496
558
|
text: SDKUI_Localizator.CreateContextualTask,
|
|
497
559
|
icon: 'plus',
|
|
498
|
-
onClick: () =>
|
|
560
|
+
onClick: () => openTaskFormCallback(targetItem),
|
|
499
561
|
disabled: isGroupArchived ? true : false,
|
|
500
562
|
beginGroup: true
|
|
501
563
|
});
|
|
502
564
|
}
|
|
503
|
-
if (targetItem && Boolean(classId && classId === 'WG')) {
|
|
565
|
+
if (targetItem && Boolean(classId && (classId === 'WG' || classId === 'DS'))) {
|
|
504
566
|
menuItems.push({
|
|
505
567
|
icon: "eyeclose",
|
|
506
568
|
text: SDKUI_Localizator.Unfollow,
|
|
507
|
-
onClick: () => targetItem && classId && unFollowCallback(targetItem, classId),
|
|
569
|
+
onClick: () => (targetItem && classId) && unFollowCallback(targetItem, classId),
|
|
508
570
|
});
|
|
509
571
|
}
|
|
510
572
|
if (contextMenuParams.isShowHideFilterEnabled) {
|
|
@@ -598,7 +660,7 @@ const TMBlogsPost = (props) => {
|
|
|
598
660
|
boxShadow: isFocused ? "0 4px 12px rgba(19, 85, 150, 0.6)" : "none",
|
|
599
661
|
cursor: 'pointer',
|
|
600
662
|
}, children: [_jsx(BlogPostTitle, { displayMode: displayMode, layoutMode: layoutMode, blogPost: blogPost, isSelected: isSelected, isOwnComment: isOwnComment, searchText: searchText, isSys: isSys, isHomeBlogPost: isHomeBlogPost, showId: localShowId, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), isNew && _jsx(NewBadge, { layoutMode: layoutMode }), _jsx("div", { style: { fontSize: '1rem', color: "#000", marginTop: "10px", overflow: "hidden" }, children: _jsx(TMHtmlContentDisplay, { markup: blogPost.description ?? '-', searchText: searchText, isSelected: isSelected }) }), showExtendedAttachments && blogPost.attachments && blogPost.attachments.length > 0 && (_jsx(TMBlogAttachments, { contextMenuParams: contextMenuParams, attachments: blogPost.attachments, layoutMode: layoutMode, isSelected: isSelected, searchText: searchText, dcmtTypeDescriptors: dcmtTypeDescriptors, treeFs: treeFs, draftLatestInfoMap: draftLatestInfoMap, archivedDocumentMap: archivedDocumentMap, context: context, handleAttachmentFocus: handleFocusedAttachment, openDcmtForm: openDcmtForm }))] }, `${id}-blogpost-${blogPost.id}`) })] }, "blog-post-wrapper-" + id + "-" + blogPost.id);
|
|
601
|
-
}), _jsx("div", { ref: bottomRef }), anchorEl && _jsx("div", { style: { position: 'fixed', zIndex: 9999 }, children: _jsx(ContextMenu, { dataSource: menuItems, target: anchorEl, onHiding: closeContextMenu }) })] }), (dcmtForm.dcmt && dcmtForm.dcmt.TID && dcmtForm.dcmt.DID) && _jsx(TMDcmtForm, { TID: Number(dcmtForm.dcmt.TID), DID: Number(dcmtForm.dcmt.DID), layoutMode: LayoutModes.Update, onClose: closeDcmtForm, isClosable: true, titleModal: SDKUI_Localizator.Attachment + ": " + dcmtForm.dcmt.fileName, isModal: true, widthModal: "95%", heightModal: "95%", allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), (showFloatingCommentButton && showCommentFormCallback && !(context?.engine === 'WorkingGroupEngine' && context?.object?.customData1 === 1)) && _jsx("button", { style: {
|
|
663
|
+
}), _jsx("div", { ref: bottomRef }), anchorEl && _jsx("div", { style: { position: 'fixed', zIndex: 9999 }, children: _jsx(ContextMenu, { dataSource: menuItems, target: anchorEl, onHiding: closeContextMenu }) })] }), (showTaskForm && handleNavigateToWGs && handleNavigateToDossiers && getAllTasks && deleteTaskByIdsCallback && addTaskCallback && editTaskCallback) && _jsx("div", { style: { height: "100%", width: "100%" }, children: _jsx(TMTaskForm, { id: -1, title: SDKUI_Localizator.ContextualTask, isModal: true, width: calcResponsiveSizes(deviceType, '700px', '700px', '95%'), height: calcResponsiveSizes(deviceType, '670px', '80%', '95%'), formMode: FormModes.Create, visualizedTasks: [], currentTask: currentTask, setCurrentTask: () => { }, selectedRowKeys: [], handleFocusedRowKeyChange: () => { }, onStatusChanged: () => { }, onSaved: onSavedTaskFormCallback, onClose: () => closeTaskFormCallback(), onCancel: () => closeTaskFormCallback(), usersList: participants, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, isContextualCreate: true, taskContext: taskContext, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback }) }), (dcmtForm.dcmt && dcmtForm.dcmt.TID && dcmtForm.dcmt.DID) && _jsx(TMDcmtForm, { TID: Number(dcmtForm.dcmt.TID), DID: Number(dcmtForm.dcmt.DID), layoutMode: LayoutModes.Update, onClose: closeDcmtForm, isClosable: true, titleModal: SDKUI_Localizator.Attachment + ": " + dcmtForm.dcmt.fileName, isModal: true, widthModal: "95%", heightModal: "95%", allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), (showFloatingCommentButton && showCommentFormCallback && !(context?.engine === 'WorkingGroupEngine' && context?.object?.customData1 === 1)) && _jsx("button", { style: {
|
|
602
664
|
position: 'absolute',
|
|
603
665
|
bottom: '18px',
|
|
604
666
|
right: '20px',
|
|
@@ -110,4 +110,5 @@ interface BlogPostTitleProps {
|
|
|
110
110
|
handleNavigateToDossiers?: (blogPost: BlogPost | HomeBlogPost) => void;
|
|
111
111
|
}
|
|
112
112
|
export declare const BlogPostTitle: (props: BlogPostTitleProps) => import("react/jsx-runtime").JSX.Element;
|
|
113
|
+
export declare const stripHtml: (html: string) => string;
|
|
113
114
|
export {};
|
|
@@ -159,18 +159,20 @@ export const getDcmtTypeDescriptor = async (blogPosts) => {
|
|
|
159
159
|
export const BlogPostHomeHeader = (header, classId, isSelected, searchText, headerClickCallback) => {
|
|
160
160
|
const isWorkGroup = classId === 'WG';
|
|
161
161
|
const iconColor = isSelected ? '#ffffff' : isWorkGroup ? '#009700' : '#e65b00';
|
|
162
|
-
return (_jsxs("div", {
|
|
162
|
+
return (_jsxs("div", { style: {
|
|
163
163
|
display: "flex",
|
|
164
164
|
alignItems: "center",
|
|
165
165
|
cursor: "pointer",
|
|
166
166
|
fontWeight: "bold",
|
|
167
167
|
color: isSelected ? "#fff" : TMColors.primary,
|
|
168
168
|
gap: "4px",
|
|
169
|
-
}, children: [_jsx(TMTooltip, { content: isWorkGroup ? SDKUI_Localizator.WorkGroup : SDKUI_Localizator.
|
|
169
|
+
}, children: [_jsx(TMTooltip, { content: isWorkGroup ? SDKUI_Localizator.WorkGroup : SDKUI_Localizator.Dossier, children: isWorkGroup ? (_jsx(IconMenuCAWorkingGroups, { color: iconColor, fontSize: 28, onClick: headerClickCallback })) : (_jsx(IconCADossier, { color: iconColor, fontSize: 28, onClick: headerClickCallback })) }), _jsx("div", { onClick: headerClickCallback, style: {
|
|
170
170
|
whiteSpace: "nowrap",
|
|
171
171
|
overflow: "hidden",
|
|
172
172
|
textOverflow: "ellipsis",
|
|
173
|
-
|
|
173
|
+
display: "inline-block",
|
|
174
|
+
cursor: "pointer",
|
|
175
|
+
maxWidth: "100%",
|
|
174
176
|
}, children: highlightText(header ?? "", searchText, isSelected) })] }));
|
|
175
177
|
};
|
|
176
178
|
export const isHeaderFullyHidden = (header) => {
|
|
@@ -246,3 +248,13 @@ export const BlogPostTitle = (props) => {
|
|
|
246
248
|
...getCompactEllipsisStyle(layoutMode)
|
|
247
249
|
}, children: highlightText(subtitle, searchText, isSelected) }))] })] });
|
|
248
250
|
};
|
|
251
|
+
export const stripHtml = (html) => {
|
|
252
|
+
try {
|
|
253
|
+
const doc = new DOMParser().parseFromString(html, 'text/html');
|
|
254
|
+
return doc.body.textContent || '';
|
|
255
|
+
}
|
|
256
|
+
catch (error) {
|
|
257
|
+
// Se qualcosa va storto, restituisci l'HTML originale
|
|
258
|
+
return html;
|
|
259
|
+
}
|
|
260
|
+
};
|
|
@@ -3,7 +3,7 @@ import styled from 'styled-components';
|
|
|
3
3
|
import { useCallback, useEffect, useState } from 'react';
|
|
4
4
|
import ReactDOMServer from 'react-dom/server';
|
|
5
5
|
import { DcmtTypeListCacheService } from '@topconsultnpm/sdk-ts';
|
|
6
|
-
import ContextMenu from 'devextreme-react/
|
|
6
|
+
import ContextMenu from 'devextreme-react/context-menu';
|
|
7
7
|
import { IconDelete, SDKUI_Localizator, IconApply, IconInfo, IconCloseOutline } from '../../helper';
|
|
8
8
|
import { TMColors } from '../../utils/theme';
|
|
9
9
|
import { DeviceType } from '../base/TMDeviceProvider';
|
|
@@ -59,7 +59,8 @@ export { default as TMBlogAttachments } from './grids/TMBlogAttachments';
|
|
|
59
59
|
export { default as TMBlogCommentForm } from './features/blog/TMBlogCommentForm';
|
|
60
60
|
export * from './query/TMQueryEditor';
|
|
61
61
|
export * from './query/TMQuerySummary';
|
|
62
|
-
export
|
|
62
|
+
export { default as ToppyHelpCenter } from './features/assistant/ToppyHelpCenter';
|
|
63
|
+
export { default as ToppyDraggableHelpCenter } from './features/assistant/ToppyDraggableHelpCenter';
|
|
63
64
|
export * from './features/documents/TMDcmtForm';
|
|
64
65
|
export * from './features/documents/TMDcmtIcon';
|
|
65
66
|
export * from './features/documents/TMDcmtPreview';
|
package/lib/components/index.js
CHANGED
|
@@ -66,7 +66,8 @@ export { default as TMBlogCommentForm } from './features/blog/TMBlogCommentForm'
|
|
|
66
66
|
export * from './query/TMQueryEditor';
|
|
67
67
|
export * from './query/TMQuerySummary';
|
|
68
68
|
//assistant
|
|
69
|
-
export
|
|
69
|
+
export { default as ToppyHelpCenter } from './features/assistant/ToppyHelpCenter';
|
|
70
|
+
export { default as ToppyDraggableHelpCenter } from './features/assistant/ToppyDraggableHelpCenter';
|
|
70
71
|
//documents
|
|
71
72
|
export * from './features/documents/TMDcmtForm';
|
|
72
73
|
export * from './features/documents/TMDcmtIcon';
|
|
@@ -4,6 +4,7 @@ interface TMPanelManagerContainerProps {
|
|
|
4
4
|
showToolbar: boolean;
|
|
5
5
|
direction: TMPanelDirection;
|
|
6
6
|
parentId?: string;
|
|
7
|
+
minPanelSizePx?: number;
|
|
7
8
|
}
|
|
8
9
|
declare const TMPanelManagerContainer: (props: TMPanelManagerContainerProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
9
10
|
export default TMPanelManagerContainer;
|
|
@@ -24,7 +24,7 @@ const StyledResizerGutter = styled.div `
|
|
|
24
24
|
z-index: 10;
|
|
25
25
|
`;
|
|
26
26
|
const TMPanelManagerContainer = (props) => {
|
|
27
|
-
const { panels, showToolbar, direction, parentId } = props;
|
|
27
|
+
const { panels, showToolbar, direction, parentId, minPanelSizePx = 150 } = props;
|
|
28
28
|
const { panelVisibility, setPanelDimensionsById, hasVisiblePanels, maximizedPanels, updateIsResizingActive } = useTMPanelManagerContext();
|
|
29
29
|
// Get the current device type (e.g., mobile, tablet, desktop) using a custom hook
|
|
30
30
|
const deviceType = useDeviceType();
|
|
@@ -73,7 +73,7 @@ const TMPanelManagerContainer = (props) => {
|
|
|
73
73
|
let newCurrent = initialCurrent + deltaPercent;
|
|
74
74
|
let newNext = initialNext - deltaPercent;
|
|
75
75
|
// Set a minimum size threshold (to prevent panels from collapsing)
|
|
76
|
-
const minPercent = (
|
|
76
|
+
const minPercent = (minPanelSizePx / containerSize) * 100;
|
|
77
77
|
// Correct sizes if they go below the minimum
|
|
78
78
|
if (newCurrent < minPercent) {
|
|
79
79
|
newCurrent = minPercent;
|
|
@@ -118,7 +118,6 @@ export const TMPanelManagerProvider = (props) => {
|
|
|
118
118
|
const maximizePanel = useCallback((id) => {
|
|
119
119
|
// Get all parent panel IDs recursively for the given panel ID
|
|
120
120
|
const parents = showParentRecursively(id, hierarchyMap).map(([pid]) => pid);
|
|
121
|
-
4;
|
|
122
121
|
// Combine parents and the current panel ID into one array to maximize
|
|
123
122
|
const toMaximize = [...parents, id];
|
|
124
123
|
// Update state to track which panels are maximized
|
|
@@ -76,7 +76,8 @@ const TMPanelManagerToolbar = (props) => {
|
|
|
76
76
|
const isActive = panelVisibility[visibleLeafPanel.id];
|
|
77
77
|
const isDisabled = toolbarButtonsDisabled[visibleLeafPanel.id];
|
|
78
78
|
const count = visibleLeafPanel.toolbarOptions?.count ?? 0;
|
|
79
|
-
|
|
79
|
+
const tooltip = visibleLeafPanel.toolbarOptions?.tooltip ?? '';
|
|
80
|
+
return _jsx(TMTooltip, { content: tooltip || (visibleLeafPanel.name + (count > 0 ? ": " + count : '')), position: isMobile ? 'top' : 'left', children: _jsxs(StyledToolbarButton, { disabled: isDisabled, "$isDisabled": isDisabled, onClick: () => onClickCallback(visibleLeafPanel.id, isActive), "$isActive": isActive || visibleLeafPanel.toolbarOptions?.alwaysActiveColor, children: [typeof visibleLeafPanel.toolbarOptions?.icon === 'string' ? (_jsx("i", { className: `dx-icon dx-icon-${visibleLeafPanel.toolbarOptions?.icon}` })) : (visibleLeafPanel.toolbarOptions?.icon), (!isActive && count > 0) && _jsxs(Badge, { "$background": visibleLeafPanel.toolbarOptions?.countBackgroundColor, children: [" ", formatCount(count), " "] })] }, visibleLeafPanel.id) }, visibleLeafPanel.id);
|
|
80
81
|
}) }));
|
|
81
82
|
};
|
|
82
83
|
export default TMPanelManagerToolbar;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React, { useState, useEffect } from "react";
|
|
3
3
|
import { SDK_Globals, ObjectClasses, ResultTypes } from "@topconsultnpm/sdk-ts";
|
|
4
|
-
import DataGrid, { Column, GroupPanel, Grouping, HeaderFilter, LoadPanel, Pager, Paging, Scrolling, SearchPanel, Selection } from "devextreme-react/
|
|
4
|
+
import DataGrid, { Column, GroupPanel, Grouping, HeaderFilter, LoadPanel, Pager, Paging, Scrolling, SearchPanel, Selection } from "devextreme-react/data-grid";
|
|
5
5
|
import { PlatformObjectService } from "../../services/platform_services";
|
|
6
6
|
import { FormModes } from "../../ts";
|
|
7
7
|
import { Globalization, IconAdd, IconColumns, IconCopy, IconDelete, IconDuplicate, IconHide, IconMail, IconMenuVertical, IconOpenInNew, IconRefresh, IconShow, SDKUI_Globals, SDKUI_Localizator, calcSaveFormTitle, canNext, canPrev, dialogConfirmOperation, getExceptionMessage, getNext, getPrev } from "../../helper";
|
|
@@ -47,14 +47,14 @@ const SettingsAppearance = ({ landingPagesOptions, permissions = { canArchive: t
|
|
|
47
47
|
return (_jsxs(TMLayoutContainer, { children: [landingPagesOptions && _jsx("p", { style: { fontSize: '1.h1rem', fontWeight: 'bold', marginBottom: '5px' }, children: SDKUI_Localizator.LandingPage }), landingPagesOptions && _jsx(TMDropDown, { dataSource: filteredLandingPageOptopns, value: SDKUI_Globals.userSettings.landingPage, width: '230px', onValueChanged: (e) => {
|
|
48
48
|
SDKUI_Globals.userSettings.landingPage = e.target.value;
|
|
49
49
|
triggerUIUpdate();
|
|
50
|
-
} }), _jsx("p", { style: { fontSize: '1.h1rem', fontWeight: 'bold', marginTop: '10px' }, children: 'Font' }), _jsx(TMDropDown, { label: SDKUI_Localizator.
|
|
51
|
-
let newpx = e.target.value;
|
|
52
|
-
SDKUI_Globals.userSettings.themeSettings.fontSize = newpx;
|
|
53
|
-
triggerUIUpdate();
|
|
54
|
-
} }), _jsx(TMDropDown, { label: 'Family', dataSource: fontFamilies, width: '230px', value: SDKUI_Globals.userSettings.themeSettings.fontFamily, onValueChanged: (e) => {
|
|
50
|
+
} }), _jsx("p", { style: { fontSize: '1.h1rem', fontWeight: 'bold', marginTop: '10px' }, children: 'Font' }), _jsx(TMDropDown, { label: SDKUI_Localizator.Name, dataSource: fontFamilies, width: '230px', value: SDKUI_Globals.userSettings.themeSettings.fontFamily, onValueChanged: (e) => {
|
|
55
51
|
let newFamily = e.target.value;
|
|
56
52
|
SDKUI_Globals.userSettings.themeSettings.fontFamily = newFamily;
|
|
57
53
|
triggerUIUpdate();
|
|
54
|
+
} }), _jsx(TMDropDown, { label: SDKUI_Localizator.Size, dataSource: fontSizes, width: '230px', value: SDKUI_Globals.userSettings.themeSettings.fontSize, onValueChanged: (e) => {
|
|
55
|
+
let newpx = e.target.value;
|
|
56
|
+
SDKUI_Globals.userSettings.themeSettings.fontSize = newpx;
|
|
57
|
+
triggerUIUpdate();
|
|
58
58
|
} }), _jsx("p", { style: { fontSize: '1rem', fontWeight: 'bold', marginTop: '10px', marginBottom: '5px' }, children: SDKUI_Localizator.Grids }), _jsx(TMCheckBox, { label: SDKUI_Localizator.ShowRowSeparatingLines, value: SDKUI_Globals.userSettings.themeSettings.gridSettings.showRowLines, onValueChanged: (newValue) => {
|
|
59
59
|
SDKUI_Globals.userSettings.themeSettings.gridSettings.showRowLines = newValue;
|
|
60
60
|
triggerUIUpdate();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DataListViewModes } from '@topconsultnpm/sdk-ts';
|
|
2
|
-
import { DataGridTypes } from 'devextreme-react/
|
|
2
|
+
import { DataGridTypes } from 'devextreme-react/data-grid';
|
|
3
3
|
interface ITMDataListItemViewerProps {
|
|
4
4
|
dataListId?: number;
|
|
5
5
|
value?: string | Date | number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ITopMediaSession, LayoutModes, MetadataDescriptor } from '@topconsultnpm/sdk-ts';
|
|
3
3
|
import { TID_MID } from '../../ts';
|
|
4
|
-
import { DataGridTypes } from 'devextreme-react/
|
|
4
|
+
import { DataGridTypes } from 'devextreme-react/data-grid';
|
|
5
5
|
export interface ITMMidViewerProps {
|
|
6
6
|
tmSession?: ITopMediaSession;
|
|
7
7
|
tid_mid: TID_MID | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DcmtTypeDescriptor, ITopMediaSession } from '@topconsultnpm/sdk-ts';
|
|
3
|
-
import { DataGridTypes } from 'devextreme-react/
|
|
3
|
+
import { DataGridTypes } from 'devextreme-react/data-grid';
|
|
4
4
|
export declare enum ImageIDList {
|
|
5
5
|
arrow_001 = "arrow_001",
|
|
6
6
|
arrow_002 = "arrow_002",
|
|
@@ -6,6 +6,7 @@ export declare enum DateDisplayTypes {
|
|
|
6
6
|
}
|
|
7
7
|
export declare class Globalization {
|
|
8
8
|
static getDateTimeDisplayValue(value: Date | string | undefined, displayType?: DateDisplayTypes, metadataFormat?: MetadataFormats): string;
|
|
9
|
+
static getDateTimeDisplayValueCompact(value: Date | string | undefined, displayType?: DateDisplayTypes, metadataFormat?: MetadataFormats): string;
|
|
9
10
|
static getDateDisplayFormat(displayType?: DateDisplayTypes): string;
|
|
10
11
|
static getNumberDisplayValue(value: Number, withThousandsSeparator?: boolean, numberDisplayFormat?: string): string;
|
|
11
12
|
static metadataFormatToDateDisplayFormat(format: MetadataFormats): "" | "MM/dd/yyyy" | "dd/MM/yyyy" | "EEEE dd MMMM yyyy" | "HH:mm" | "HH:mm:ss" | "MM/dd/yyyy HH:mm:ss" | "dd/MM/yyyy HH:mm:ss" | "MM/dd/yyyy HH:mm" | "dd/MM/yyyy HH:mm" | "EEEE dd MMMM yyyy HH:mm" | "EEEE dd MMMM yyyy HH:mm:ss";
|
|
@@ -29,6 +29,36 @@ export class Globalization {
|
|
|
29
29
|
dateTime = dateTime.replace("ss", dt.getSeconds().toString().padStart(2, '0'));
|
|
30
30
|
return dateTime;
|
|
31
31
|
}
|
|
32
|
+
static getDateTimeDisplayValueCompact(value, displayType, metadataFormat) {
|
|
33
|
+
if (!value)
|
|
34
|
+
return "";
|
|
35
|
+
let dt = typeof value === "string" ? new Date(value) : value;
|
|
36
|
+
let dateDisplayFormat = metadataFormat ? this.metadataFormatToDateDisplayFormat(metadataFormat) : this.getDateDisplayFormat(displayType);
|
|
37
|
+
let dateTime = dateDisplayFormat;
|
|
38
|
+
dateTime = dateTime.replace("EEEE", dt.toLocaleString(navigator.language, { weekday: "long" }));
|
|
39
|
+
dateTime = dateTime.replace("dd", dt.toLocaleString(navigator.language, { day: "2-digit" }));
|
|
40
|
+
dateTime = dateTime.replace("MMMM", dt.toLocaleString(navigator.language, { month: "long" }));
|
|
41
|
+
dateTime = dateTime.replace("MM", dt.toLocaleString(navigator.language, { month: "2-digit" }));
|
|
42
|
+
dateTime = dateTime.replace("yyyy", dt.toLocaleString(navigator.language, { year: "numeric" }));
|
|
43
|
+
// gestione ore, minuti e secondi
|
|
44
|
+
const hh = dt.getHours().toString().padStart(2, '0');
|
|
45
|
+
const mm = dt.getMinutes().toString().padStart(2, '0');
|
|
46
|
+
const ss = dt.getSeconds().toString().padStart(2, '0');
|
|
47
|
+
if (hh === '00' && mm === '00' && ss === '00') {
|
|
48
|
+
// nessun tempo
|
|
49
|
+
dateTime = dateTime.replace(/HH:mm:ss/, '').trim();
|
|
50
|
+
}
|
|
51
|
+
else if (ss === '00') {
|
|
52
|
+
// togli solo i secondi
|
|
53
|
+
dateTime = dateTime.replace(/ss/, '').replace(/:$/, '');
|
|
54
|
+
dateTime = dateTime.replace("HH", hh).replace("mm", mm);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
// mantieni tutto
|
|
58
|
+
dateTime = dateTime.replace("HH", hh).replace("mm", mm).replace("ss", ss);
|
|
59
|
+
}
|
|
60
|
+
return dateTime;
|
|
61
|
+
}
|
|
32
62
|
static getDateDisplayFormat(displayType = DateDisplayTypes.DateTime) {
|
|
33
63
|
let timeFormat = "HH:mm:ss";
|
|
34
64
|
if (displayType == DateDisplayTypes.Time)
|