@topconsultnpm/sdkui-react 6.19.0-dev2.31 → 6.19.0-dev2.33
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/editors/TMTextArea.js +35 -4
- package/lib/components/editors/TMTextBox.js +33 -3
- package/lib/components/editors/TMTextExpression.js +36 -28
- package/lib/components/features/search/TMSearchResult.js +1 -1
- package/lib/components/grids/TMBlogsPost.d.ts +2 -0
- package/lib/components/grids/TMBlogsPost.js +2 -1
- package/lib/helper/dcmtsHelper.d.ts +1 -1
- package/lib/helper/dcmtsHelper.js +15 -11
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useEffect, useRef } from 'react';
|
|
3
3
|
import { StyledEditorContainer, StyledEditorIcon, StyledEditorLabel, StyledTextareaEditor } from './TMEditorStyled';
|
|
4
4
|
import { FontSize, TMColors } from '../../utils/theme';
|
|
@@ -8,8 +8,10 @@ import TMLayoutContainer, { TMLayoutItem } from '../base/TMLayout';
|
|
|
8
8
|
import TMVilViewer from '../base/TMVilViewer';
|
|
9
9
|
import TMTooltip from '../base/TMTooltip';
|
|
10
10
|
import { DeviceType, useDeviceType } from '../base/TMDeviceProvider';
|
|
11
|
-
import { IconClearButton } from '../../helper';
|
|
11
|
+
import { IconClearButton, IconDataList, SDKUI_Localizator } from '../../helper';
|
|
12
12
|
import styled from 'styled-components';
|
|
13
|
+
import { FormulaItemHelper } from './TMTextExpression';
|
|
14
|
+
import TMChooserForm from '../forms/TMChooserForm';
|
|
13
15
|
const StyledTextAreaEditorButton = styled.div `
|
|
14
16
|
color: ${TMColors.button_icon};
|
|
15
17
|
display: flex;
|
|
@@ -37,6 +39,8 @@ const TMTextArea = (props) => {
|
|
|
37
39
|
const [formulaMenuItems, setFormulaMenuItems] = useState([]);
|
|
38
40
|
// Stores the calculated number of rows for the textarea
|
|
39
41
|
const [calculatedRows, setCalculatedRows] = useState(rows ?? 1);
|
|
42
|
+
//Show chooserForm formulaItems
|
|
43
|
+
const [showFormulaItemsChooser, setShowFormulaItemsChooser] = useState(false);
|
|
40
44
|
// Manages the state for the custom context menu
|
|
41
45
|
const { clicked, setClicked, points, setPoints } = useContextMenu();
|
|
42
46
|
const deviceType = useDeviceType();
|
|
@@ -73,6 +77,30 @@ const TMTextArea = (props) => {
|
|
|
73
77
|
setFormulaMenuItems(menuItems);
|
|
74
78
|
}
|
|
75
79
|
}, [formulaItems]);
|
|
80
|
+
function getFormulaDataSorce() {
|
|
81
|
+
let fiarray = [];
|
|
82
|
+
if (!formulaItems)
|
|
83
|
+
return [];
|
|
84
|
+
let i = 0;
|
|
85
|
+
for (const f of formulaItems) {
|
|
86
|
+
let fi = new FormulaItemHelper();
|
|
87
|
+
fi.id = i;
|
|
88
|
+
fi.paramName = f;
|
|
89
|
+
fiarray.push(fi);
|
|
90
|
+
i++;
|
|
91
|
+
}
|
|
92
|
+
return fiarray;
|
|
93
|
+
}
|
|
94
|
+
const openFormulaItemsChooser = () => {
|
|
95
|
+
return (showFormulaItemsChooser ?
|
|
96
|
+
_jsx(TMChooserForm, { title: SDKUI_Localizator.Parameters, height: '350', width: '300', hasShowId: false, showDefaultColumns: false, allowMultipleSelection: true, columns: [
|
|
97
|
+
{ dataField: 'paramName', caption: SDKUI_Localizator.Name, dataType: 'string', sortOrder: 'asc', alignment: 'left' }
|
|
98
|
+
], dataSource: getFormulaDataSorce(), onClose: () => { setShowFormulaItemsChooser(false); }, onChoose: (IDs) => {
|
|
99
|
+
let expr = value?.toString() ?? '';
|
|
100
|
+
IDs.map(i => expr += formulaItems[i]);
|
|
101
|
+
onValueChanged?.({ target: { value: expr } });
|
|
102
|
+
} }) : _jsx(_Fragment, {}));
|
|
103
|
+
};
|
|
76
104
|
// Adjust the rows dynamically
|
|
77
105
|
const updateRows = () => {
|
|
78
106
|
const newRowCount = calculateRows(currentValue);
|
|
@@ -136,7 +164,10 @@ const TMTextArea = (props) => {
|
|
|
136
164
|
const y = e.clientY - bounds.top;
|
|
137
165
|
// set the x and y coordinates of our users right click
|
|
138
166
|
setPoints({ x, y });
|
|
139
|
-
}, "$isMobile": deviceType === DeviceType.MOBILE, "$maxHeight": maxHeight, "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, "$fontSize": fontSize, "$width": width, "$resize": resize }), _jsxs("div", { style: { display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', position: 'absolute', right: '6px', top: label.length > 0 ? '22px' : '7px', pointerEvents: disabled ? 'none' : 'auto', opacity: disabled ? 0.4 : 1 }, children: [
|
|
167
|
+
}, "$isMobile": deviceType === DeviceType.MOBILE, "$maxHeight": maxHeight, "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, "$fontSize": fontSize, "$width": width, "$resize": resize }), _jsxs("div", { style: { display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', position: 'absolute', right: '6px', top: label.length > 0 ? '22px' : '7px', pointerEvents: disabled ? 'none' : 'auto', opacity: disabled ? 0.4 : 1 }, children: [formulaItems.length > 0 &&
|
|
168
|
+
_jsx(StyledTextAreaEditorButton, { onClick: () => {
|
|
169
|
+
setShowFormulaItemsChooser(true);
|
|
170
|
+
}, children: _jsx(IconDataList, {}) }), showClearButton && currentValue &&
|
|
140
171
|
_jsx(StyledTextAreaEditorButton, { onClick: () => {
|
|
141
172
|
onValueChanged?.({ target: { value: undefined } });
|
|
142
173
|
setCurrentValue('');
|
|
@@ -144,7 +175,7 @@ const TMTextArea = (props) => {
|
|
|
144
175
|
onBlur?.(undefined);
|
|
145
176
|
}, children: _jsx(IconClearButton, {}) }), buttons.map((buttonItem, index) => {
|
|
146
177
|
return (_jsx(StyledTextAreaEditorButton, { onClick: buttonItem.onClick, children: _jsx(TMTooltip, { content: buttonItem.text, children: buttonItem.icon }) }, buttonItem.text));
|
|
147
|
-
})] }), formulaItems.length > 0 && clicked && (_jsx(TMContextMenu, { menuData: formulaMenuItems, top: points.y, left: points.x, onMenuItemClick: (formula) => insertText(formula) })), _jsx(TMVilViewer, { vil: validationItems })] });
|
|
178
|
+
})] }), openFormulaItemsChooser(), formulaItems.length > 0 && clicked && (_jsx(TMContextMenu, { menuData: formulaMenuItems, top: points.y, left: points.x, onMenuItemClick: (formula) => insertText(formula) })), _jsx(TMVilViewer, { vil: validationItems })] });
|
|
148
179
|
};
|
|
149
180
|
// Layout for the textarea with a left-aligned label
|
|
150
181
|
const renderedLeftLabelTextArea = () => {
|
|
@@ -3,7 +3,7 @@ import { useState, useEffect, useRef } from 'react';
|
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import { StyledEditor, StyledEditorContainer, StyledEditorIcon, StyledEditorLabel, editorColorManager } from './TMEditorStyled';
|
|
5
5
|
import { FontSize, TMColors } from '../../utils/theme';
|
|
6
|
-
import { genUniqueId, IconClearButton, IconHide, IconShow, SDKUI_Localizator } from '../../helper';
|
|
6
|
+
import { genUniqueId, IconClearButton, IconDataList, IconHide, IconShow, SDKUI_Localizator } from '../../helper';
|
|
7
7
|
import ShowAlert from '../base/TMAlert';
|
|
8
8
|
import { TMExceptionBoxManager } from '../base/TMPopUp';
|
|
9
9
|
import TMLayoutContainer, { TMLayoutItem } from '../base/TMLayout';
|
|
@@ -11,6 +11,8 @@ import TMVilViewer from '../base/TMVilViewer';
|
|
|
11
11
|
import TMTooltip from '../base/TMTooltip';
|
|
12
12
|
import { ContextMenu } from 'devextreme-react';
|
|
13
13
|
import { DeviceType, useDeviceType } from '../base/TMDeviceProvider';
|
|
14
|
+
import TMChooserForm from '../forms/TMChooserForm';
|
|
15
|
+
import { FormulaItemHelper } from './TMTextExpression';
|
|
14
16
|
const StyledShowPasswordIcon = styled.div `
|
|
15
17
|
color: ${props => !props.$disabled ? (props.$vil.length === 0) ? !props.$isModified ? TMColors.text_normal : TMColors.isModified : editorColorManager(props.$vil) : TMColors.disabled};
|
|
16
18
|
position: absolute;
|
|
@@ -37,6 +39,7 @@ const TMTextBox = ({ autoFocus, maxLength, labelColor, precision, fromModal = fa
|
|
|
37
39
|
const [currentType, setCurrentType] = useState(type);
|
|
38
40
|
const [currentValue, setCurrentValue] = useState(value);
|
|
39
41
|
const [formulaMenuItems, setFormulaMenuItems] = useState([]);
|
|
42
|
+
const [showFormulaItemsChooser, setShowFormulaItemsChooser] = useState(false);
|
|
40
43
|
const [isFocused, setIsFocused] = useState(false);
|
|
41
44
|
const inputRef = useRef(null);
|
|
42
45
|
const deviceType = useDeviceType();
|
|
@@ -219,6 +222,30 @@ const TMTextBox = ({ autoFocus, maxLength, labelColor, precision, fromModal = fa
|
|
|
219
222
|
setCurrentValue(inputValue);
|
|
220
223
|
onValueChanged?.({ target: { value: inputValue } }); // Passa il valore filtrato
|
|
221
224
|
};
|
|
225
|
+
function getFormulaDataSorce() {
|
|
226
|
+
let fiarray = [];
|
|
227
|
+
if (!formulaItems)
|
|
228
|
+
return [];
|
|
229
|
+
let i = 0;
|
|
230
|
+
for (const f of formulaItems) {
|
|
231
|
+
let fi = new FormulaItemHelper();
|
|
232
|
+
fi.id = i;
|
|
233
|
+
fi.paramName = f;
|
|
234
|
+
fiarray.push(fi);
|
|
235
|
+
i++;
|
|
236
|
+
}
|
|
237
|
+
return fiarray;
|
|
238
|
+
}
|
|
239
|
+
const openFormulaItemsChooser = () => {
|
|
240
|
+
return (showFormulaItemsChooser ?
|
|
241
|
+
_jsx(TMChooserForm, { title: SDKUI_Localizator.Parameters, height: '350', width: '300', hasShowId: false, showDefaultColumns: false, allowMultipleSelection: true, columns: [
|
|
242
|
+
{ dataField: 'paramName', caption: SDKUI_Localizator.Name, dataType: 'string', sortOrder: 'asc', alignment: 'left' }
|
|
243
|
+
], dataSource: getFormulaDataSorce(), onClose: () => { setShowFormulaItemsChooser(false); }, onChoose: (IDs) => {
|
|
244
|
+
let expr = value?.toString() ?? '';
|
|
245
|
+
IDs.map(i => expr += formulaItems[i]);
|
|
246
|
+
onValueChanged?.({ target: { value: expr } });
|
|
247
|
+
} }) : _jsx(_Fragment, {}));
|
|
248
|
+
};
|
|
222
249
|
const renderInputField = () => {
|
|
223
250
|
const bulletEntity = '\u2022'; // •
|
|
224
251
|
const displayedValue = initialType === 'secureText'
|
|
@@ -233,13 +260,16 @@ const TMTextBox = ({ autoFocus, maxLength, labelColor, precision, fromModal = fa
|
|
|
233
260
|
e.preventDefault();
|
|
234
261
|
}
|
|
235
262
|
}, "$isMobile": deviceType === DeviceType.MOBILE, "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, "$fontSize": fontSize, "$maxValue": maxValue, "$width": width, "$type": currentType, "$borderRadius": borderRadius }), (initialType === 'password' || initialType === 'secureText') && _jsx(StyledShowPasswordIcon, { onClick: toggleShowPassword, "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, children: showPasswordIcon() }), initialType !== 'password' &&
|
|
236
|
-
_jsxs("div", { style: { display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', position: 'absolute', right: type === 'number' ? '25px' : '6px', top: label.length > 0 ? '20px' : '7px', pointerEvents: disabled ? 'none' : 'auto', opacity: disabled ? 0.4 : 1 }, children: [
|
|
263
|
+
_jsxs("div", { style: { display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', position: 'absolute', right: type === 'number' ? '25px' : '6px', top: label.length > 0 ? '20px' : '7px', pointerEvents: disabled ? 'none' : 'auto', opacity: disabled ? 0.4 : 1 }, children: [formulaItems.length > 0 &&
|
|
264
|
+
_jsx(StyledTextBoxEditorButton, { onClick: () => {
|
|
265
|
+
setShowFormulaItemsChooser(true);
|
|
266
|
+
}, children: _jsx(IconDataList, {}) }), showClearButton && currentValue &&
|
|
237
267
|
_jsx(StyledTextBoxEditorButton, { onClick: () => {
|
|
238
268
|
onValueChanged?.({ target: { value: undefined } });
|
|
239
269
|
onBlur?.(undefined);
|
|
240
270
|
}, children: _jsx(IconClearButton, {}) }), buttons.map((buttonItem, index) => {
|
|
241
271
|
return (_jsx(StyledTextBoxEditorButton, { onClick: buttonItem.onClick, children: _jsx(TMTooltip, { content: buttonItem.text, children: buttonItem.icon }) }, buttonItem.text));
|
|
242
|
-
})] }), formulaItems.length > 0 && (_jsx(ContextMenu, { dataSource: formulaMenuItems, target: `#text-${id}`, onItemClick: (e) => { insertText(e.itemData?.text ?? ''); } })), _jsx(TMVilViewer, { vil: validationItems })] }));
|
|
272
|
+
})] }), openFormulaItemsChooser(), formulaItems.length > 0 && (_jsx(ContextMenu, { dataSource: formulaMenuItems, target: `#text-${id}`, onItemClick: (e) => { insertText(e.itemData?.text ?? ''); } })), _jsx(TMVilViewer, { vil: validationItems })] }));
|
|
243
273
|
};
|
|
244
274
|
const renderedLeftLabelTextBox = () => {
|
|
245
275
|
return (_jsxs(TMLayoutContainer, { direction: 'horizontal', children: [icon && _jsx(TMLayoutItem, { width: '20px', children: _jsx(StyledEditorIcon, { "$disabled": disabled, "$vil": validationItems, "$isModified": isModifiedWhen, children: icon }) }), _jsx(TMLayoutItem, { children: _jsxs(StyledEditorContainer, { "$width": width, children: [label && _jsx(StyledEditorLabel, { "$color": labelColor, "$isFocused": isFocused, "$labelPosition": labelPosition, "$disabled": disabled, children: label }), renderInputField()] }) })] }));
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useMemo, useState } from 'react';
|
|
3
3
|
import { DcmtTypeListCacheService } from '@topconsultnpm/sdk-ts';
|
|
4
|
-
import { IconClear, IconColumns,
|
|
4
|
+
import { IconClear, IconColumns, SDKUI_Localizator, stringIsNullOrEmpty } from '../../helper';
|
|
5
5
|
import { TMExceptionBoxManager } from '../base/TMPopUp';
|
|
6
6
|
import { TMMetadataChooserForm } from '../choosers/TMMetadataChooser';
|
|
7
|
-
import TMChooserForm from '../forms/TMChooserForm';
|
|
8
7
|
import TMTextBox from './TMTextBox';
|
|
9
8
|
import TMTextArea from './TMTextArea';
|
|
10
9
|
const TMTextExpression = (props) => {
|
|
@@ -96,8 +95,7 @@ const TMTextExpression = (props) => {
|
|
|
96
95
|
let buttons = [];
|
|
97
96
|
if (props.qd || props.tid)
|
|
98
97
|
buttons.push({ icon: _jsx(IconColumns, {}), text: SDKUI_Localizator.MetadataReferenceInsert, onClick: () => { setShowMetadataChooser(true); } });
|
|
99
|
-
if (props.formulaItems && props.formulaItems.length > 0)
|
|
100
|
-
buttons.push({ icon: _jsx(IconDataList, {}), text: SDKUI_Localizator.Parameters, onClick: () => setShowFormulaChooser(true) });
|
|
98
|
+
// if (props.formulaItems && props.formulaItems.length > 0) buttons.push({ icon: <IconDataList />, text: SDKUI_Localizator.Parameters, onClick: () => setShowFormulaChooser(true) })
|
|
101
99
|
buttons.push({ icon: _jsx(IconClear, {}), text: SDKUI_Localizator.Clear, onClick: () => props.onValueChanged?.('') });
|
|
102
100
|
return buttons;
|
|
103
101
|
};
|
|
@@ -120,20 +118,18 @@ const TMTextExpression = (props) => {
|
|
|
120
118
|
}
|
|
121
119
|
return output;
|
|
122
120
|
}
|
|
123
|
-
function getFormulaDataSorce() {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
return fiarray;
|
|
136
|
-
}
|
|
121
|
+
// function getFormulaDataSorce() {
|
|
122
|
+
// let fiarray: FormulaItemHelper[] = []
|
|
123
|
+
// if (!props.formulaItems) return []
|
|
124
|
+
// let i: number = 0;
|
|
125
|
+
// for (const f of props.formulaItems!) {
|
|
126
|
+
// let fi = new FormulaItemHelper();
|
|
127
|
+
// fi.id = i; fi.paramName = f;
|
|
128
|
+
// fiarray.push(fi);
|
|
129
|
+
// i++;
|
|
130
|
+
// }
|
|
131
|
+
// return fiarray;
|
|
132
|
+
// }
|
|
137
133
|
const openMetadataChooseForm = () => {
|
|
138
134
|
return (showMetadataChooser ?
|
|
139
135
|
_jsx(TMMetadataChooserForm, { allowMultipleSelection: true, qd: props.qd, tids: props.tid ? [props.tid] : undefined, qdShowOnlySelectItems: true, allowSysMetadata: true, onClose: () => setShowMetadataChooser(false), onChoose: (tid_mid) => {
|
|
@@ -146,18 +142,30 @@ const TMTextExpression = (props) => {
|
|
|
146
142
|
{ dataField: 'paramName', caption: props.captionColumnChooser ?? SDKUI_Localizator.Name, dataType: 'string', sortOrder: 'asc', alignment: 'left' }
|
|
147
143
|
];
|
|
148
144
|
}, []);
|
|
149
|
-
const openFormulaChooseForm = () => {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
}
|
|
145
|
+
// const openFormulaChooseForm = () => {
|
|
146
|
+
// return (showFormulaChooser ?
|
|
147
|
+
// <TMChooserForm
|
|
148
|
+
// title={props.titleChooser ?? SDKUI_Localizator.Parameters}
|
|
149
|
+
// height={props.higthChooser ?? '350'}
|
|
150
|
+
// width={props.widthChooser ?? '300'}
|
|
151
|
+
// hasShowId={false}
|
|
152
|
+
// showDefaultColumns={false}
|
|
153
|
+
// allowMultipleSelection={props.disableMultipleSelection !== true}
|
|
154
|
+
// columns={dataColumns}
|
|
155
|
+
// dataSource={getFormulaDataSorce()}
|
|
156
|
+
// onClose={() => { setShowFormulaChooser(false); }}
|
|
157
|
+
// onChoose={(IDs: number[]) => {
|
|
158
|
+
// let expr: string = props.value ?? '';
|
|
159
|
+
// IDs.map(i => expr += props.formulaItems![i]);
|
|
160
|
+
// props.onValueChanged?.(expr)
|
|
161
|
+
// }}
|
|
162
|
+
// /> : <></>
|
|
163
|
+
// )
|
|
164
|
+
// }
|
|
157
165
|
return (_jsxs(_Fragment, { children: [props.rows === undefined ?
|
|
158
|
-
_jsx(TMTextBox, { buttons: renderButtons(), isModifiedWhen: props.value != props.valueOrig, label: props.label, value: Expression_IDs2Names(props.value) ?? '', validationItems: props.validationItems, onValueChanged: (e) => { props.onValueChanged?.(Expression_Names2IDs(e.target.value)); } })
|
|
166
|
+
_jsx(TMTextBox, { buttons: renderButtons(), formulaItems: props.formulaItems, isModifiedWhen: props.value != props.valueOrig, label: props.label, value: Expression_IDs2Names(props.value) ?? '', validationItems: props.validationItems, onValueChanged: (e) => { props.onValueChanged?.(Expression_Names2IDs(e.target.value)); } })
|
|
159
167
|
:
|
|
160
|
-
_jsx(TMTextArea, { buttons: renderButtons(), isModifiedWhen: props.value != props.valueOrig, label: props.label, rows: props.rows, resize: false, placeHolder: props.placeHolder, value: Expression_IDs2Names(props.value) ?? '', validationItems: props.validationItems, onValueChanged: (e) => { props.onValueChanged?.(Expression_Names2IDs(e.target.value)); } }), openMetadataChooseForm(), " "
|
|
168
|
+
_jsx(TMTextArea, { buttons: renderButtons(), formulaItems: props.formulaItems, isModifiedWhen: props.value != props.valueOrig, label: props.label, rows: props.rows, resize: false, placeHolder: props.placeHolder, value: Expression_IDs2Names(props.value) ?? '', validationItems: props.validationItems, onValueChanged: (e) => { props.onValueChanged?.(Expression_Names2IDs(e.target.value)); } }), openMetadataChooseForm(), " "] }));
|
|
161
169
|
};
|
|
162
170
|
class MetatadaHelper {
|
|
163
171
|
constructor(mid, metadataName) {
|
|
@@ -987,7 +987,7 @@ const TMSearchResultGrid = ({ openInOffice, inputFocusedItem, showSearch, allowM
|
|
|
987
987
|
width: 50,
|
|
988
988
|
cellRender: (cellData) => renderDcmtIcon(cellData, onDownloadDcmtsAsync, openInOffice),
|
|
989
989
|
allowResizing: false,
|
|
990
|
-
filterOperations: ['=']
|
|
990
|
+
filterOperations: ['=', "anyof"]
|
|
991
991
|
},
|
|
992
992
|
...columns.filter(col => col.dataField !== 'FILEEXT')
|
|
993
993
|
];
|
|
@@ -74,6 +74,8 @@ interface TMBlogsPostProps {
|
|
|
74
74
|
externalBlogPost?: BlogPost;
|
|
75
75
|
/** Optional function to reset the external blog post */
|
|
76
76
|
resetExternalBlogPost?: () => void;
|
|
77
|
+
/** Optional function to update the selected blog post */
|
|
78
|
+
updateSelectedBlogPosts?: (blogPosts: Array<BlogPost>) => void;
|
|
77
79
|
visible?: boolean;
|
|
78
80
|
allTasks?: Array<TaskDescriptor>;
|
|
79
81
|
getAllTasks?: () => Promise<void>;
|
|
@@ -30,7 +30,7 @@ const TMBlogsPost = (props) => {
|
|
|
30
30
|
isRestoreEnabled: false,
|
|
31
31
|
isRefreshEnabled: false,
|
|
32
32
|
isCreateContextualTask: false,
|
|
33
|
-
}, showFloatingCommentButton = false, showCommentFormCallback, showTaskFormCallback, refreshCallback, showId, setShowId, refreshHomePageNews, markBlogAsRead, externalBlogPost, resetExternalBlogPost, visible = true, allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, } = props;
|
|
33
|
+
}, showFloatingCommentButton = false, showCommentFormCallback, showTaskFormCallback, refreshCallback, showId, setShowId, refreshHomePageNews, markBlogAsRead, externalBlogPost, resetExternalBlogPost, updateSelectedBlogPosts, visible = true, allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, } = props;
|
|
34
34
|
const { abortController, showWaitPanel, waitPanelTitle, showPrimary, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, downloadDcmtsAsync } = useDcmtOperations();
|
|
35
35
|
const bottomRef = useRef(null);
|
|
36
36
|
const containerRef = useRef(null);
|
|
@@ -79,6 +79,7 @@ const TMBlogsPost = (props) => {
|
|
|
79
79
|
markBlogAsRead(item[0]);
|
|
80
80
|
}
|
|
81
81
|
setSelectedItem(item ? item : []);
|
|
82
|
+
updateSelectedBlogPosts?.(item ? item : []);
|
|
82
83
|
};
|
|
83
84
|
const handleFocusedAttachment = (attachment) => {
|
|
84
85
|
setFocusedAttachment(attachment);
|
|
@@ -4,5 +4,5 @@ export declare const hasDetailRelations: (mTID: number | undefined) => Promise<b
|
|
|
4
4
|
/** Check if dcmtType (mTID) has configured Master or Many-to-Many relations */
|
|
5
5
|
export declare const hasMasterRelations: (mTID: number | undefined) => Promise<boolean>;
|
|
6
6
|
export declare const isXMLFileExt: (fileExt: string | undefined) => boolean;
|
|
7
|
-
export declare const processButtonAttributes: (args: string | undefined, formData: MetadataValueDescriptorEx[] | undefined) =>
|
|
7
|
+
export declare const processButtonAttributes: (args: string | undefined, formData: MetadataValueDescriptorEx[] | undefined) => string[] | undefined;
|
|
8
8
|
export declare const processSelectedItems: (selectedItems: Array<any> | undefined) => any[] | undefined;
|
|
@@ -36,14 +36,18 @@ export const processSelectedItems = (selectedItems) => selectedItems?.map(item =
|
|
|
36
36
|
return acc;
|
|
37
37
|
}, {});
|
|
38
38
|
});
|
|
39
|
-
const formDataMap = (data, args) =>
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
39
|
+
const formDataMap = (data, args) => {
|
|
40
|
+
const tokens = args.match(/\{@?[^}]+\}/g) || [];
|
|
41
|
+
return tokens.map(token => {
|
|
42
|
+
if (token.startsWith('{@')) {
|
|
43
|
+
// Campo dinamico: {@campo} -> cerca in formData
|
|
44
|
+
const fieldName = token.slice(2, -1); // Rimuove {@...}
|
|
45
|
+
const md = data.find(md => md.md?.name === fieldName);
|
|
46
|
+
return md?.value;
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
// Campo statico: {valore} -> ritorna il valore direttamente
|
|
50
|
+
return token.slice(1, -1); // Rimuove {...}
|
|
51
|
+
}
|
|
52
|
+
}).filter((value) => value !== undefined && value !== null);
|
|
53
|
+
};
|