@topconsultnpm/sdkui-react 6.20.0-dev2.38 → 6.20.0-dev2.39
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.
|
@@ -1846,7 +1846,21 @@ const TMDcmtFormActionButtons = (props) => {
|
|
|
1846
1846
|
alignItems: 'center',
|
|
1847
1847
|
gap: '10px'
|
|
1848
1848
|
}, children: [_jsx(TaskLink, { messagePrefix: `"${senderNameTruncated}" ti ha richiesto maggiori informazioni tramite l'attività`, name: currentTask.name ?? 'N/A', taskNameTrunc: taskNameTrunc ?? 'N/A', description: currentTask.description ?? 'N/A' }), _jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx("span", { className: "dx-icon-chat" }), caption: SDKUI_Localizator.CommentAndComplete, width: "180px", disabled: false, onClick: () => setShowCommentForm(true), onMouseDown: e => e.stopPropagation(), advancedColor: TMColors.success, color: "success" })] }))] }));
|
|
1849
|
-
})() }) })) : (_jsx("div", { style: {
|
|
1849
|
+
})() }) })) : (_jsx("div", { style: {
|
|
1850
|
+
padding: '10px',
|
|
1851
|
+
color: '#FFFFFF',
|
|
1852
|
+
maxWidth: '240px',
|
|
1853
|
+
background: 'linear-gradient(135deg, #1E90FF 0%, #0077BE 60%, #00509E 100%)',
|
|
1854
|
+
border: '1px solid rgba(255,255,255,0.15)',
|
|
1855
|
+
boxShadow: '0 8px 20px rgba(0, 0, 50, 0.4)',
|
|
1856
|
+
backdropFilter: 'blur(6px)',
|
|
1857
|
+
display: 'flex',
|
|
1858
|
+
flexDirection: 'column',
|
|
1859
|
+
alignItems: 'center',
|
|
1860
|
+
textAlign: 'center',
|
|
1861
|
+
gap: '10px',
|
|
1862
|
+
cursor: 'default',
|
|
1863
|
+
}, children: `Ci sono ${moreInfoTasks?.length ?? 0} richieste di maggiori informazioni. ${SDKUI_Localizator.ManageFromTaskPanel}` }))), hasMoreInfo && hasApprove && _jsx(Divider, {}), hasApprove && (workItems.length === 1 ?
|
|
1850
1864
|
_jsx(WorkFlowOperationButtons, { deviceType: deviceType, onApprove: () => setShowApprovePopup(true), onSignApprove: handleSignApprove, onReject: () => setShowRejectPopup(true), onReAssign: () => setShowReAssignPopup(true), onMoreInfo: () => setShowMoreInfoPopup(true), dtd: fromDTD })
|
|
1851
1865
|
:
|
|
1852
1866
|
_jsxs("div", { style: { padding: 10, color: 'white', maxWidth: '180px', borderRadius: 10, background: '#1B1464 0% 0% no-repeat padding-box', border: '1px solid #FFFFFF' }, children: [`Questo documento è associato a ${workItems.length} workitem.`, _jsx("br", {}), `Per approvare, vai alla pagina "Approvazione workflow".`] })), (hasApprove && hasReferences) || (hasMoreInfo && !hasApprove && hasReferences) ? (_jsx(Divider, {})) : null, hasReferences && (_jsx(ReferencesContainer, { children: dcmtReferences
|
|
@@ -7,7 +7,7 @@ import TMLayoutContainer from '../../base/TMLayout';
|
|
|
7
7
|
import { FormModes } from '../../../ts';
|
|
8
8
|
import { useWorkflowApprove } from '../../../hooks/useWorkflowApprove';
|
|
9
9
|
import { SaveFormOptions, useSaveForm } from '../../../hooks/useForm';
|
|
10
|
-
import { SDKUI_Localizator, calcIsModified, TMConditionalWrapper, getPdgsIconMap, DateDisplayTypes } from '../../../helper';
|
|
10
|
+
import { SDKUI_Localizator, calcIsModified, TMConditionalWrapper, getPdgsIconMap, DateDisplayTypes, getMoreInfoTasksForDocument } from '../../../helper';
|
|
11
11
|
import { TMExceptionBoxManager } from '../../base/TMPopUp';
|
|
12
12
|
import TMSpinner from '../../base/TMSpinner';
|
|
13
13
|
import TMTooltip from '../../base/TMTooltip';
|
|
@@ -437,6 +437,6 @@ const TMTaskForm = (props) => {
|
|
|
437
437
|
: _jsx(TMTextBox, { label: SDKUI_Localizator.Priority, value: getPriorityLocalizatorValue(formData?.priority ?? Priorities.Low), readOnly: true }) })] }) }), _jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 10 }, children: children }), children: _jsxs(_Fragment, { children: [_jsx("div", { style: { width: isMobile ? '100%' : '50%', marginTop: 10 }, children: !fieldsReadOnly.startDate ? _jsx(TMDateBox, { id: "start-date", resetTimeToZeroOnKeyPress: false, label: SDKUI_Localizator.StartDate, dateDisplayType: DateDisplayTypes.DateTime, value: formData?.startTime, isModifiedWhen: formData?.startTime !== formDataOrig?.startTime, validationItems: validationItems?.filter(o => o.PropertyName === SDKUI_Localizator.ErrorStartEndDate), onContentReady: handleStartTimeContentReady, onValueChange: (value) => { setFormData({ ...formData ?? {}, startTime: value }); }, showClearButton: true }) : _jsx(TMTextBox, { label: SDKUI_Localizator.StartDate, value: formData?.startTime ? formatDate(formData?.startTime) : '', readOnly: true }) }), _jsx("div", { style: { width: isMobile ? '100%' : '50%', marginTop: 10 }, children: !fieldsReadOnly.startDate ? _jsx(TMDateBox, { id: "end-date", resetTimeToZeroOnKeyPress: false, label: SDKUI_Localizator.Expiration, dateDisplayType: DateDisplayTypes.DateTime, value: formData?.endTime, isModifiedWhen: formData?.endTime !== formDataOrig?.endTime, validationItems: validationItems?.filter(o => o.PropertyName === SDKUI_Localizator.ErrorStartEndDate || o.PropertyName === SDKUI_Localizator.ErrorEndRemDate), onContentReady: handleEndTimeContentReady, onValueChange: (value) => { setFormData({ ...formData ?? {}, endTime: value }); }, showClearButton: true, readOnly: fieldsReadOnly.endDate }) : _jsx(TMTextBox, { label: SDKUI_Localizator.Expiration, value: formData?.endTime ? formatDate(formData?.endTime) : '', readOnly: true }) })] }) }), _jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 3 }, children: children }), children: _jsx("div", { style: { width: isMobile ? '100%' : '50%', marginTop: 10 }, children: _jsx(TMDateBox, { id: "alert-time", resetTimeToZeroOnKeyPress: false, label: SDKUI_Localizator.Reminder, dateDisplayType: DateDisplayTypes.DateTime, value: formData?.remTime ?? undefined, isModifiedWhen: formData?.remTime !== formDataOrig?.remTime, validationItems: validationItems?.filter(o => o.PropertyName === SDKUI_Localizator.ErrorEndRemDate), onValueChange: (value) => { setFormData({ ...formData ?? {}, remTime: value }); }, showClearButton: true, readOnly: fieldsReadOnly.remTime }) }) }), (formData?.state && [Task_States.Completed, Task_States.Waiting, Task_States.Deferred].includes(formData?.state) ||
|
|
438
438
|
(formData?.response ?? "") !== "") && _jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 3 }, children: children }), children: _jsx("div", { style: { width: isMobile ? '100%' : '50%', marginTop: 10 }, children: _jsxs(ResponseCommentWrapper, { children: [_jsx(ResponseCommentTextArea, { id: "responseId", name: "response", "$isValid": true, value: formData?.response ?? '', onChange: onAnswerChange, "$isModifiedWhen": formData?.response !== formDataOrig?.response, disabled: (formData?.response ?? "") !== "" &&
|
|
439
439
|
(formData?.state && ![Task_States.Completed, Task_States.Waiting, Task_States.Deferred].includes(formData?.state)) }), _jsxs(ResponseCommentLabel, { htmlFor: "responseId", children: [SDKUI_Localizator.Answer, _jsxs(TMTooltip, { content: SDKUI_Localizator.AnswerTooltip, children: [" ", _jsx("i", { className: 'dx-icon-info' }), " "] })] }), _jsx(ResponseCommentCharacterCounter, { children: `${500 - (formData?.response ?? '').length} ${SDKUI_Localizator.CharactersRemaining}` })] }) }) })] }) }) }), (showDcmtForm && formData?.iD1 && formData?.iD2) &&
|
|
440
|
-
_jsx(TMDcmtForm, { titleModal: formData.iD1Name ?? '-', isModal: true, TID: formData.iD1, DID: formData.iD2, allowButtonsRefs: true, moreInfoTasks:
|
|
440
|
+
_jsx(TMDcmtForm, { titleModal: formData.iD1Name ?? '-', isModal: true, TID: formData.iD1, DID: formData.iD2, allowButtonsRefs: true, moreInfoTasks: getMoreInfoTasksForDocument(allTasks, formData?.iD1, formData?.iD2), onWFOperationCompleted: refreshWorkflowApprove, onTaskCompleted: onTaskCompleted, onClose: () => { setShowDcmtForm(false); }, onOpenS4TViewerRequest: onOpenS4TViewerRequest, s4TViewerDialogComponent: s4TViewerDialogComponent, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, onReferenceClick: handleNavigateToReference })] }) }) }));
|
|
441
441
|
};
|
|
442
442
|
export default TMTaskForm;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useBetaFeatures: () => boolean;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { useEffect, useMemo } from 'react';
|
|
2
|
+
import { SDK_Globals } from '@topconsultnpm/sdk-ts';
|
|
3
|
+
import { SDKUI_Globals } from '../helper';
|
|
4
|
+
import { ShowAlert } from '../components';
|
|
5
|
+
export const useBetaFeatures = () => {
|
|
6
|
+
const tmSession = SDK_Globals.tmSession;
|
|
7
|
+
const archiveId = tmSession?.SessionDescr?.archiveID;
|
|
8
|
+
const userId = tmSession?.SessionDescr?.userID;
|
|
9
|
+
const isBetaFeaturesEnabled = useMemo(() => {
|
|
10
|
+
return SDKUI_Globals.userSettings.devSettings?.betaFeatures === 1;
|
|
11
|
+
}, [archiveId, userId]);
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
const handleBetaFeaturesShortcut = (e) => {
|
|
14
|
+
if (e.ctrlKey && e.altKey && e.key.toLowerCase() === 'y') {
|
|
15
|
+
e.preventDefault();
|
|
16
|
+
e.stopPropagation();
|
|
17
|
+
e.stopImmediatePropagation();
|
|
18
|
+
const currentValue = SDKUI_Globals.userSettings.devSettings?.betaFeatures;
|
|
19
|
+
const isCurrentlyEnabled = currentValue === 1;
|
|
20
|
+
if (isCurrentlyEnabled) {
|
|
21
|
+
SDKUI_Globals.userSettings.devSettings = undefined;
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
SDKUI_Globals.userSettings.devSettings = { betaFeatures: 1 };
|
|
25
|
+
}
|
|
26
|
+
const status = isCurrentlyEnabled ? 'disabilitato' : 'abilitato';
|
|
27
|
+
ShowAlert({
|
|
28
|
+
message: `Beta features ${status}! Saranno ${status === 'abilitato' ? 'disponibili' : 'nascoste'} al prossimo login.`,
|
|
29
|
+
mode: 'info',
|
|
30
|
+
duration: 5000,
|
|
31
|
+
title: 'Beta Features'
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
globalThis.addEventListener('keydown', handleBetaFeaturesShortcut);
|
|
36
|
+
return () => {
|
|
37
|
+
globalThis.removeEventListener('keydown', handleBetaFeaturesShortcut);
|
|
38
|
+
};
|
|
39
|
+
}, []);
|
|
40
|
+
return isBetaFeaturesEnabled;
|
|
41
|
+
};
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -10,6 +10,7 @@ export * from './hooks/useResizeObserver';
|
|
|
10
10
|
export * from './hooks/useWorkflowApprove';
|
|
11
11
|
export * from './hooks/useRelatedDocuments';
|
|
12
12
|
export * from './hooks/useSettingsFeedback';
|
|
13
|
+
export * from './hooks/useBetaFeatures';
|
|
13
14
|
export * from './services';
|
|
14
15
|
import config from 'devextreme/core/config';
|
|
15
16
|
// DevExtreme License Key (valid for v25.2 and earlier versions)
|