@topconsultnpm/sdkui-react 6.20.0-dev1.2 → 6.20.0-dev1.20
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/NewComponents/ContextMenu/TMContextMenu.js +2 -2
- package/lib/components/NewComponents/ContextMenu/hooks.d.ts +1 -0
- package/lib/components/NewComponents/ContextMenu/hooks.js +8 -4
- package/lib/components/NewComponents/ContextMenu/styles.d.ts +4 -1
- package/lib/components/NewComponents/ContextMenu/styles.js +41 -8
- package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +5 -5
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +8 -0
- package/lib/components/NewComponents/FloatingMenuBar/styles.js +25 -15
- package/lib/components/base/TMAccordion.js +2 -2
- package/lib/components/base/TMCustomButton.js +0 -1
- package/lib/components/base/TMDataGrid.d.ts +2 -2
- package/lib/components/base/TMDataGrid.js +16 -5
- package/lib/components/editors/TMHtmlEditor.js +1 -1
- package/lib/components/editors/TMMetadataValues.js +20 -2
- package/lib/components/features/documents/TMDcmtBlog.d.ts +1 -7
- package/lib/components/features/documents/TMDcmtBlog.js +29 -2
- package/lib/components/features/documents/TMDcmtForm.js +233 -114
- package/lib/components/features/documents/TMDcmtPreview.js +94 -28
- package/lib/components/features/search/TMDcmtCheckoutInfoForm.d.ts +8 -0
- package/lib/components/features/search/{TMSearchResultCheckoutInfoForm.js → TMDcmtCheckoutInfoForm.js} +6 -11
- package/lib/components/features/search/TMSearchResult.js +46 -108
- package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +1 -1
- package/lib/components/features/search/TMSearchResultsMenuItems.js +16 -16
- package/lib/components/features/search/TMViewHistoryDcmt.js +1 -1
- package/lib/components/forms/Login/TMLoginForm.js +2 -0
- package/lib/css/tm-sdkui.css +1 -1
- package/lib/helper/SDKUI_Globals.d.ts +3 -14
- package/lib/helper/SDKUI_Localizator.d.ts +8 -0
- package/lib/helper/SDKUI_Localizator.js +98 -0
- package/lib/helper/TMUtils.d.ts +3 -1
- package/lib/helper/TMUtils.js +51 -0
- package/lib/helper/checkinCheckoutManager.d.ts +85 -0
- package/lib/helper/checkinCheckoutManager.js +348 -0
- package/lib/helper/devextremeCustomMessages.d.ts +30 -0
- package/lib/helper/devextremeCustomMessages.js +30 -0
- package/lib/helper/helpers.js +7 -1
- package/lib/helper/index.d.ts +1 -0
- package/lib/helper/index.js +1 -0
- package/lib/helper/queryHelper.js +29 -0
- package/lib/hooks/useCheckInOutOperations.d.ts +28 -0
- package/lib/hooks/useCheckInOutOperations.js +223 -0
- package/lib/services/platform_services.d.ts +1 -1
- package/package.json +12 -10
- package/lib/components/features/search/TMSearchResultCheckoutInfoForm.d.ts +0 -8
- package/lib/helper/cicoHelper.d.ts +0 -31
- package/lib/helper/cicoHelper.js +0 -155
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import TMDcmtPreview from './TMDcmtPreview';
|
|
4
|
-
import { AccessLevels, ArchiveConstraints, ArchiveEngineByID, DcmtTypeListCacheService, LayoutCacheService, LayoutModes, MetadataDataTypes, ObjectClasses, ResultTypes, SDK_Globals, SDK_Localizator, SystemMIDsAsNumber, SystemTIDs, Task_States, TemplateTIDs, TID_DID, UpdateEngineByID, ValidationItem, WorkflowCacheService, WorkItemMetadataNames } from '@topconsultnpm/sdk-ts';
|
|
4
|
+
import { AccessLevels, ArchiveConstraints, ArchiveEngineByID, DcmtTypeListCacheService, LayoutCacheService, LayoutModes, MetadataDataTypes, ObjectClasses, ResultTypes, SDK_Globals, SDK_Localizator, SystemMIDsAsNumber, SystemTIDs, Task_States, TemplateTIDs, TID_DID, UpdateEngineByID, UserListCacheService, ValidationItem, WorkflowCacheService, WorkItemMetadataNames } from '@topconsultnpm/sdk-ts';
|
|
5
5
|
import { ContextMenu } from 'devextreme-react';
|
|
6
6
|
import { WorkFlowApproveRejectPopUp, WorkFlowMoreInfoPopUp, WorkFlowOperationButtons, WorkFlowReAssignPopUp } from '../workflow/TMWorkflowPopup';
|
|
7
7
|
import { DownloadTypes, FormModes, DcmtOperationTypes } from '../../../ts';
|
|
@@ -9,7 +9,7 @@ import { DeviceType, useDeviceType } from '../../base/TMDeviceProvider';
|
|
|
9
9
|
import { useDcmtOperations } from '../../../hooks/useDcmtOperations';
|
|
10
10
|
import { useRelatedDocuments } from '../../../hooks/useRelatedDocuments';
|
|
11
11
|
import { getWorkItemSetIDAsync, handleArchiveVisibility, searchResultToMetadataValues } from '../../../helper/queryHelper';
|
|
12
|
-
import { genUniqueId, IconShow, SDKUI_Localizator, updateMruTids, IconBoard, IconDcmtTypeSys, IconDetailDcmts, svgToString, IconDownload, calcIsModified, IconMenuVertical, Globalization, getListMaxItems, getSystemMetadata, IconBoxArchiveIn, IconClear, IconUndo, SDKUI_Globals, IconPreview, isTaskMoreInfo, IconWorkflow, IconSearch, deepCompare, IconCheck, IconActivity, TMImageLibrary, IconStar, IconRelation, IconInfo, IconArchiveDoc, IconDelete, IconPair, IconUnpair, IconArchiveMaster, IconArchiveDetail } from '../../../helper';
|
|
12
|
+
import { genUniqueId, IconShow, SDKUI_Localizator, updateMruTids, IconBoard, IconDcmtTypeSys, IconDetailDcmts, svgToString, IconDownload, calcIsModified, IconMenuVertical, Globalization, getListMaxItems, getSystemMetadata, IconBoxArchiveIn, IconClear, IconUndo, SDKUI_Globals, IconPreview, isTaskMoreInfo, IconWorkflow, IconSearch, deepCompare, IconCheck, IconActivity, TMImageLibrary, IconStar, IconRelation, IconInfo, IconArchiveDoc, IconDelete, IconPair, IconUnpair, IconArchiveMaster, IconArchiveDetail, getDcmtCicoStatus, IconFileDots } from '../../../helper';
|
|
13
13
|
import { hasDetailRelations, hasMasterRelations, isXMLFileExt } from '../../../helper/dcmtsHelper';
|
|
14
14
|
import { Gutters, TMColors } from '../../../utils/theme';
|
|
15
15
|
import { StyledFormButtonsContainer, StyledLoadingContainer, StyledModalContainer, StyledReferenceButton, StyledSpinner, StyledToolbarCardContainer } from '../../base/Styled';
|
|
@@ -42,9 +42,14 @@ import TMToppyMessage from '../../../helper/TMToppyMessage';
|
|
|
42
42
|
import { getTaskAssignedToMe } from '../tasks/TMTasksUtils';
|
|
43
43
|
import TMCustomButton from '../../base/TMCustomButton';
|
|
44
44
|
import ToppyDraggableHelpCenter from '../assistant/ToppyDraggableHelpCenter';
|
|
45
|
+
import { useCheckInOutOperations } from '../../../hooks/useCheckInOutOperations';
|
|
46
|
+
import TMViewHistoryDcmt from '../search/TMViewHistoryDcmt';
|
|
47
|
+
import TMDcmtCheckoutInfoForm from '../search/TMDcmtCheckoutInfoForm';
|
|
48
|
+
import styled from 'styled-components';
|
|
45
49
|
let abortControllerLocal = new AbortController();
|
|
46
50
|
//#endregion
|
|
47
51
|
const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, showHeader = true, onSaveRecents, layoutMode = LayoutModes.Update, showBackButton = true, onClose, onSavedAsyncCallback, TID, DID, formMode = FormModes.Update, canNext, canPrev, count, itemIndex, onNext, onPrev, allowNavigation = true, allowRelations = true, isClosable = false, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, showDcmtFormSidebar = true, invokedByTodo = false, titleModal, isModal = false, widthModal = "100%", heightModal = "100%", groupId, onWFOperationCompleted, onTaskCompleted, onTaskCreateRequest, inputFile = null, taskFormDialogComponent, taskMoreInfo, connectorFileSave = undefined, inputMids = [], openS4TViewer = false, onOpenS4TViewerRequest, s4TViewerDialogComponent, enableDragDropOverlay = false, passToSearch, isSharedDcmt = false, sharedSourceTID, sharedSourceDID, allowButtonsRefs = false, onReferenceClick, }) => {
|
|
52
|
+
const { showHistory, showHistoryCallback, hideHistoryCallback, showCheckoutInformationForm, commentFormState, hideCommentFormCallback, showCheckoutInformationFormCallback, hideCheckoutInformationFormCallback, copyCheckoutPathToClipboardCallback, handleCheckOutCallback, handleCheckInCallback, refreshPreviewTrigger, showCicoWaitPanel, cicoWaitPanelTitle, showCicoPrimaryProgress, cicoPrimaryProgressText, cicoPrimaryProgressValue, cicoPrimaryProgressMax, } = useCheckInOutOperations();
|
|
48
53
|
const [id, setID] = useState('');
|
|
49
54
|
const [showWaitPanelLocal, setShowWaitPanelLocal] = useState(false);
|
|
50
55
|
const [waitPanelTitleLocal, setWaitPanelTitleLocal] = useState('');
|
|
@@ -68,6 +73,7 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
68
73
|
const [layout, setLayout] = useState();
|
|
69
74
|
const [customButtonsLayout, setCustomButtonsLayout] = useState();
|
|
70
75
|
const [customButton, setCustomButton] = useState();
|
|
76
|
+
const [allUsers, setAllUsers] = useState([]);
|
|
71
77
|
const appliedInputMidsRef = useRef(null);
|
|
72
78
|
// Refs per evitare stale closure nei callback
|
|
73
79
|
// I useCallback catturano i valori delle dipendenze al momento della creazione.
|
|
@@ -96,10 +102,18 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
96
102
|
const [isInitialLoading, setIsInitialLoading] = useState(true);
|
|
97
103
|
const [isNavigating, setIsNavigating] = useState(false);
|
|
98
104
|
const [dcmtReferences, setDcmtReferences] = useState(undefined);
|
|
99
|
-
//
|
|
100
|
-
const [
|
|
101
|
-
const
|
|
102
|
-
|
|
105
|
+
// Stato per triggerare il refresh del blog dall'esterno
|
|
106
|
+
const [refreshBlogTrigger, setRefreshBlogTrigger] = useState(0);
|
|
107
|
+
const triggerBlogRefresh = useCallback(async () => {
|
|
108
|
+
setRefreshBlogTrigger(prev => prev + 1);
|
|
109
|
+
}, []);
|
|
110
|
+
useEffect(() => {
|
|
111
|
+
const fetchAllUsers = async () => {
|
|
112
|
+
const users = await UserListCacheService.GetAllAsync();
|
|
113
|
+
setAllUsers(users ?? []);
|
|
114
|
+
};
|
|
115
|
+
fetchAllUsers();
|
|
116
|
+
}, []);
|
|
103
117
|
useEffect(() => {
|
|
104
118
|
if (!allowButtonsRefs)
|
|
105
119
|
setDcmtReferences(undefined);
|
|
@@ -123,7 +137,7 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
123
137
|
selectMIDs: selectMIDs,
|
|
124
138
|
dtdResult: {
|
|
125
139
|
rows: [rowValues],
|
|
126
|
-
columns: selectMIDs.map(mid => ({ name: `MID_${mid}
|
|
140
|
+
columns: selectMIDs.map(mid => ({ name: `MID_${mid}`, }))
|
|
127
141
|
},
|
|
128
142
|
dcmtsFound: 1,
|
|
129
143
|
dcmtsReturned: 1
|
|
@@ -237,8 +251,7 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
237
251
|
// Imposta il layout e customButtonsLayout immediatamente
|
|
238
252
|
setLayout(resLayout);
|
|
239
253
|
if (layoutMode === LayoutModes.Update && customButtonsLayoutResult) {
|
|
240
|
-
|
|
241
|
-
//setCustomButtonsLayout(customButtonsLayoutResult);
|
|
254
|
+
setCustomButtonsLayout(customButtonsLayoutResult);
|
|
242
255
|
}
|
|
243
256
|
// Carica DTD e metadata
|
|
244
257
|
let dtd = await DcmtTypeListCacheService.GetWithNotGrantedAsync(TID, DID, getMetadataResult);
|
|
@@ -410,6 +423,21 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
410
423
|
const workItemSetIDValue = useMemo(() => formData.find(o => o.md?.name === WorkItemMetadataNames.WI_SetID)?.value, [formData]);
|
|
411
424
|
// Valore derivato: true se formData ha elementi validi
|
|
412
425
|
const hasFormData = useMemo(() => formData.length > 0 && formData.some(md => md.mid && md.mid > 99), [formData]);
|
|
426
|
+
const handleCheckOutOperationCallback = async (checkout) => {
|
|
427
|
+
if (!currentDcmt)
|
|
428
|
+
return;
|
|
429
|
+
await handleCheckOutCallback({ TID: currentDcmt.tid, DID: currentDcmt.did, FILEEXT: currentDcmt.fileExt }, checkout, fromDTD?.name ?? SDKUI_Localizator.SearchResult, downloadDcmtsAsync, updateCurrentDcmt);
|
|
430
|
+
};
|
|
431
|
+
const handleCheckInOperationCallback = async () => {
|
|
432
|
+
if (!currentDcmt)
|
|
433
|
+
return;
|
|
434
|
+
await handleCheckInCallback({ TID: currentDcmt.tid, DID: currentDcmt.did, FILEEXT: currentDcmt.fileExt, fileName: fromDTD?.name ?? SDKUI_Localizator.SearchResult }, updateCurrentDcmt, undefined);
|
|
435
|
+
};
|
|
436
|
+
const copyCheckoutPathToClipboardOperationCallback = () => {
|
|
437
|
+
if (!currentDcmt)
|
|
438
|
+
return;
|
|
439
|
+
copyCheckoutPathToClipboardCallback({ TID: currentDcmt.tid, DID: currentDcmt.did, FILEEXT: currentDcmt.fileExt }, fromDTD?.name ?? SDKUI_Localizator.SearchResult);
|
|
440
|
+
};
|
|
413
441
|
useEffect(() => {
|
|
414
442
|
const loadAllWfData = async () => {
|
|
415
443
|
if (layoutMode !== LayoutModes.Update || !DID || fromDTD?.templateTID !== TemplateTIDs.WF_WIApprView) {
|
|
@@ -565,6 +593,53 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
565
593
|
items: operationsItems
|
|
566
594
|
});
|
|
567
595
|
}
|
|
596
|
+
if (fromDTD?.id !== SystemTIDs.Drafts) {
|
|
597
|
+
// Check in/Check out menu
|
|
598
|
+
const { cicoEnabled, checkoutStatus } = getDcmtCicoStatus(formData, allUsers, fromDTD);
|
|
599
|
+
items.push({
|
|
600
|
+
icon: svgToString(_jsx(IconFileDots, {})),
|
|
601
|
+
text: "Check in/Check out",
|
|
602
|
+
disabled: false,
|
|
603
|
+
items: [
|
|
604
|
+
{
|
|
605
|
+
icon: "edit",
|
|
606
|
+
text: 'Check out',
|
|
607
|
+
disabled: !cicoEnabled || checkoutStatus.isCheckedOut,
|
|
608
|
+
onClick: () => handleCheckOutOperationCallback(true),
|
|
609
|
+
},
|
|
610
|
+
{
|
|
611
|
+
icon: "unlock",
|
|
612
|
+
text: 'Check in',
|
|
613
|
+
onClick: () => handleCheckInOperationCallback(),
|
|
614
|
+
disabled: !cicoEnabled || !checkoutStatus.isCheckedOut || checkoutStatus.mode === 'lockMode'
|
|
615
|
+
},
|
|
616
|
+
{
|
|
617
|
+
icon: "remove",
|
|
618
|
+
text: SDKUI_Localizator.CancelCheckOut,
|
|
619
|
+
disabled: !cicoEnabled || !checkoutStatus.isCheckedOut || checkoutStatus.mode === 'lockMode',
|
|
620
|
+
onClick: () => handleCheckOutOperationCallback(false),
|
|
621
|
+
},
|
|
622
|
+
{
|
|
623
|
+
icon: "info",
|
|
624
|
+
text: SDKUI_Localizator.CheckoutInfo,
|
|
625
|
+
onClick: showCheckoutInformationFormCallback,
|
|
626
|
+
disabled: !checkoutStatus.isCheckedOut
|
|
627
|
+
},
|
|
628
|
+
{
|
|
629
|
+
icon: "copy",
|
|
630
|
+
text: SDKUI_Localizator.CopyCheckoutPath,
|
|
631
|
+
onClick: copyCheckoutPathToClipboardOperationCallback,
|
|
632
|
+
disabled: !checkoutStatus.isCheckedOut
|
|
633
|
+
},
|
|
634
|
+
{
|
|
635
|
+
icon: "clock",
|
|
636
|
+
text: SDKUI_Localizator.History,
|
|
637
|
+
disabled: !cicoEnabled,
|
|
638
|
+
onClick: showHistoryCallback,
|
|
639
|
+
},
|
|
640
|
+
]
|
|
641
|
+
});
|
|
642
|
+
}
|
|
568
643
|
if (allowRelations && layoutMode === LayoutModes.Update && DID) {
|
|
569
644
|
const relationsItems = [
|
|
570
645
|
{
|
|
@@ -680,16 +755,15 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
680
755
|
text: customButton.title || 'Bottone personalizzato',
|
|
681
756
|
onClick: () => setCustomButton(customButton)
|
|
682
757
|
}));
|
|
683
|
-
//disabilitato per ora
|
|
684
|
-
/*
|
|
685
758
|
items.push({
|
|
686
|
-
icon: svgToString(
|
|
759
|
+
icon: svgToString(_jsx(IconCheck, {})),
|
|
687
760
|
text: SDKUI_Localizator.CustomButtons,
|
|
688
761
|
items: customButtonsItems
|
|
689
|
-
}
|
|
762
|
+
});
|
|
690
763
|
}
|
|
691
764
|
return items;
|
|
692
765
|
}, [
|
|
766
|
+
fromDTD?.id,
|
|
693
767
|
fromDTD?.perm?.canRetrieveFile,
|
|
694
768
|
fromDTD?.description,
|
|
695
769
|
currentDcmt?.fileExt,
|
|
@@ -732,6 +806,60 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
732
806
|
},
|
|
733
807
|
});
|
|
734
808
|
}, [isModal, id, layoutMode]);
|
|
809
|
+
// Funzione helper per ottenere e aggiornare i metadati con gestione errori centralizzata
|
|
810
|
+
const refreshMetadataAsync = useCallback(async () => {
|
|
811
|
+
let metadataResult = undefined;
|
|
812
|
+
let hasGetMetadataError = false;
|
|
813
|
+
try {
|
|
814
|
+
metadataResult = await SDK_Globals.tmSession?.NewSearchEngine().GetMetadataAsync(TID, DID, true);
|
|
815
|
+
}
|
|
816
|
+
catch (metadataError) {
|
|
817
|
+
hasGetMetadataError = true;
|
|
818
|
+
// Estrai ErrorCode dal campo detail se disponibile
|
|
819
|
+
let errorCode = undefined;
|
|
820
|
+
if (metadataError?.isApiException && metadataError?.response?.detail) {
|
|
821
|
+
try {
|
|
822
|
+
const detailObj = JSON.parse(metadataError.response.detail);
|
|
823
|
+
errorCode = detailObj?.ErrorCode;
|
|
824
|
+
}
|
|
825
|
+
catch (parseError) {
|
|
826
|
+
console.log("Impossibile parsare il detail dell'eccezione:", parseError);
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
// Se ErrorCode è -5, mostra messaggio personalizzato, altrimenti mostra l'eccezione originale
|
|
830
|
+
if (errorCode === -5) {
|
|
831
|
+
TMMessageBoxManager.show({
|
|
832
|
+
message: SDKUI_Localizator.DcmtOutOfView,
|
|
833
|
+
buttons: [ButtonNames.OK],
|
|
834
|
+
});
|
|
835
|
+
}
|
|
836
|
+
else {
|
|
837
|
+
TMExceptionBoxManager.show({ exception: metadataError });
|
|
838
|
+
}
|
|
839
|
+
// Usa null per indicare al callback che c'è stato un errore e non deve ritentare
|
|
840
|
+
metadataResult = null;
|
|
841
|
+
}
|
|
842
|
+
// Aggiorna i metadati locali solo se non ci sono stati errori
|
|
843
|
+
if (!hasGetMetadataError && metadataResult && metadataResult !== null) {
|
|
844
|
+
await setMetadataList(fromDTDRef.current?.metadata ?? [], metadataResult);
|
|
845
|
+
}
|
|
846
|
+
return { success: !hasGetMetadataError, result: metadataResult };
|
|
847
|
+
}, [TID, DID, setMetadataList]);
|
|
848
|
+
const updateCurrentDcmt = useCallback(async () => {
|
|
849
|
+
try {
|
|
850
|
+
TMSpinner.show({ description: 'Aggiornamento in corso...' });
|
|
851
|
+
const { success, result: metadataResult } = await refreshMetadataAsync();
|
|
852
|
+
if (!success)
|
|
853
|
+
onClose?.();
|
|
854
|
+
await onSavedAsyncCallback?.(TID, DID, metadataResult === null ? null : metadataResult);
|
|
855
|
+
}
|
|
856
|
+
catch (e) {
|
|
857
|
+
TMExceptionBoxManager.show({ exception: e });
|
|
858
|
+
}
|
|
859
|
+
finally {
|
|
860
|
+
TMSpinner.hide();
|
|
861
|
+
}
|
|
862
|
+
}, [refreshMetadataAsync, onClose]);
|
|
735
863
|
const handleSave = useCallback(async () => {
|
|
736
864
|
const ue = new UpdateEngineByID(SDK_Globals.tmSession);
|
|
737
865
|
ue.DID = DID;
|
|
@@ -768,55 +896,20 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
768
896
|
const savedFormData = structuredClone(formDataRef.current);
|
|
769
897
|
setFormDataOrig(savedFormData);
|
|
770
898
|
formDataOrigRef.current = savedFormData;
|
|
771
|
-
//
|
|
772
|
-
|
|
773
|
-
let hasGetMetadataError = false;
|
|
774
|
-
try {
|
|
775
|
-
metadataResult = await SDK_Globals.tmSession?.NewSearchEngine().GetMetadataAsync(TID, DID, true);
|
|
776
|
-
}
|
|
777
|
-
catch (metadataError) {
|
|
778
|
-
hasGetMetadataError = true;
|
|
779
|
-
// Estrai ErrorCode dal campo detail se disponibile
|
|
780
|
-
let errorCode = undefined;
|
|
781
|
-
if (metadataError?.isApiException && metadataError?.response?.detail) {
|
|
782
|
-
try {
|
|
783
|
-
const detailObj = JSON.parse(metadataError.response.detail);
|
|
784
|
-
errorCode = detailObj?.ErrorCode;
|
|
785
|
-
}
|
|
786
|
-
catch (parseError) {
|
|
787
|
-
console.log("Impossibile parsare il detail dell'eccezione:", parseError);
|
|
788
|
-
}
|
|
789
|
-
}
|
|
790
|
-
// Se ErrorCode è -5, mostra messaggio personalizzato, altrimenti mostra l'eccezione originale
|
|
791
|
-
if (errorCode === -5) {
|
|
792
|
-
TMMessageBoxManager.show({
|
|
793
|
-
message: SDKUI_Localizator.DcmtOutOfView,
|
|
794
|
-
buttons: [ButtonNames.OK],
|
|
795
|
-
});
|
|
796
|
-
}
|
|
797
|
-
else {
|
|
798
|
-
TMExceptionBoxManager.show({ exception: metadataError });
|
|
799
|
-
}
|
|
800
|
-
// Usa null per indicare al callback che c'è stato un errore e non deve ritentare
|
|
801
|
-
metadataResult = null;
|
|
802
|
-
}
|
|
899
|
+
// Usa la funzione helper per ottenere i metadati aggiornati
|
|
900
|
+
const { success, result: metadataResult } = await refreshMetadataAsync();
|
|
803
901
|
// Esegui sempre il callback:
|
|
804
902
|
// - Se metadataResult è un oggetto: refresh normale
|
|
805
903
|
// - Se metadataResult è null: GetMetadataAsync fallito, rimuove il documento dalla griglia senza ritentare
|
|
806
904
|
// - Se metadataResult è undefined: nessun parametro passato, il callback può decidere cosa fare
|
|
807
905
|
await onSavedAsyncCallback?.(TID, DID, metadataResult === null ? null : metadataResult);
|
|
808
906
|
// Mostra messaggio di successo solo se non ci sono stati errori critici
|
|
809
|
-
if (
|
|
810
|
-
if (metadataResult && metadataResult !== null) {
|
|
811
|
-
// Usa fromDTDRef.current invece di fromDTD per evitare stale closure.
|
|
812
|
-
// fromDTD potrebbe essere undefined/vuoto nel callback se lo stato è cambiato,
|
|
813
|
-
// mentre fromDTDRef.current contiene sempre il valore corrente sincronizzato tramite useEffect.
|
|
814
|
-
await setMetadataList(fromDTDRef.current?.metadata ?? [], metadataResult);
|
|
815
|
-
}
|
|
907
|
+
if (success) {
|
|
816
908
|
ShowAlert({ mode: 'success', title: 'Form di documento', message: 'Le modifiche sono state salvate con successo', duration: 3000 });
|
|
817
909
|
}
|
|
818
|
-
else
|
|
910
|
+
else {
|
|
819
911
|
onClose?.();
|
|
912
|
+
}
|
|
820
913
|
}
|
|
821
914
|
catch (e) {
|
|
822
915
|
TMExceptionBoxManager.show({ exception: e });
|
|
@@ -824,7 +917,7 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
824
917
|
finally {
|
|
825
918
|
TMSpinner.hide();
|
|
826
919
|
}
|
|
827
|
-
}, [DID, TID, getSpecificChangedKeysWithValues, onSavedAsyncCallback, onClose
|
|
920
|
+
}, [DID, TID, getSpecificChangedKeysWithValues, refreshMetadataAsync, onSavedAsyncCallback, onClose]);
|
|
828
921
|
const handleArchiveCompleted = useCallback(async () => {
|
|
829
922
|
let firstBlock = true;
|
|
830
923
|
let maxFileSize = 0;
|
|
@@ -1007,50 +1100,40 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
1007
1100
|
setShowAll(true);
|
|
1008
1101
|
}
|
|
1009
1102
|
}, [shouldShowAll, showAll]);
|
|
1010
|
-
const fetchBlogDataAsync = useCallback(async (tid, did) => {
|
|
1011
|
-
try {
|
|
1012
|
-
TMSpinner.show({ description: 'Caricamento - Bacheca...' });
|
|
1013
|
-
const res = await SDK_Globals.tmSession?.NewSearchEngine().BlogRetrieveAsync(tid, did);
|
|
1014
|
-
setBlogsDatasource(res ?? []);
|
|
1015
|
-
setHasLoadedDataOnce(true);
|
|
1016
|
-
setLastLoadedDid(did);
|
|
1017
|
-
}
|
|
1018
|
-
catch (e) {
|
|
1019
|
-
let err = e;
|
|
1020
|
-
TMExceptionBoxManager.show({ exception: err });
|
|
1021
|
-
}
|
|
1022
|
-
finally {
|
|
1023
|
-
TMSpinner.hide();
|
|
1024
|
-
}
|
|
1025
|
-
}, []);
|
|
1026
1103
|
const afterTaskSaved = useCallback(async (task, formMode, forceRefresh = false) => {
|
|
1027
1104
|
const shouldRefresh = forceRefresh || (task && task.state === Task_States.Completed) || formMode === FormModes.Create || formMode === FormModes.Duplicate;
|
|
1028
1105
|
if (TID && DID && shouldRefresh) {
|
|
1029
|
-
await
|
|
1106
|
+
await triggerBlogRefresh();
|
|
1030
1107
|
}
|
|
1031
|
-
}, [TID, DID]);
|
|
1108
|
+
}, [TID, DID, triggerBlogRefresh]);
|
|
1109
|
+
const checkoutBadge = useMemo(() => {
|
|
1110
|
+
const { cicoEnabled, checkoutStatus } = getDcmtCicoStatus(formData, allUsers, fromDTD);
|
|
1111
|
+
if (!cicoEnabled || !checkoutStatus.isCheckedOut)
|
|
1112
|
+
return null;
|
|
1113
|
+
return (_jsx(Ribbon, { "$isMobile": isMobile, children: _jsx(TMTooltip, { content: checkoutStatus.editLockTooltipText, position: "right", children: _jsx("span", { children: checkoutStatus.mode === 'editMode' ? SDKUI_Localizator.CheckOut : 'Locked' }) }) }));
|
|
1114
|
+
}, [formData, fromDTD, isMobile]);
|
|
1032
1115
|
const tmDcmtForm = useMemo(() => {
|
|
1033
|
-
return
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1116
|
+
return _jsxs(_Fragment, { children: [checkoutBadge && _jsx("div", { style: { padding: '10px', display: 'flex', justifyContent: 'center' }, children: checkoutBadge }), metadataValuesSource.length > 0 &&
|
|
1117
|
+
_jsxs(StyledToolbarCardContainer, { children: [_jsx(TMMetadataValues, { TID: TID, metadataValues: metadataValuesSource, metadataValuesOrig: metadataValuesSourceOrig, isExpertMode: isExpertMode, isOpenDistinctValues: isOpenDistinctValues, openChooserBySingleClick: !isOpenDistinctValues, selectedMID: focusedMetadataValue?.mid, isReadOnly: formMode === FormModes.ReadOnly, layoutMode: layoutMode, deviceType: deviceType, validationItems: validationItems, inputMids: inputMids, layout: layout, onFocusedItemChanged: (item) => { (item?.mid !== focusedMetadataValue?.mid) && setFocusedMetadataValue(item); }, onValueChanged: (newItems) => {
|
|
1118
|
+
setFormData((prevItems) => prevItems.map((item) => {
|
|
1119
|
+
const newItem = newItems.find((newItem) => newItem.tid === item.tid && newItem.mid === item.mid);
|
|
1120
|
+
return newItem ? { ...item, ...newItem } : item;
|
|
1121
|
+
}));
|
|
1122
|
+
}, onAdvancedMenuClick: (e) => {
|
|
1123
|
+
switch (e.button) {
|
|
1124
|
+
case AdvancedMenuButtons.DistinctValues:
|
|
1125
|
+
setIsOpenDistinctValues(!isOpenDistinctValues);
|
|
1126
|
+
break;
|
|
1127
|
+
case AdvancedMenuButtons.FormulaEditor:
|
|
1128
|
+
setIsOpenFormulaEditor(!isOpenFormulaEditor);
|
|
1129
|
+
break;
|
|
1130
|
+
}
|
|
1131
|
+
} }), _jsxs(StyledFormButtonsContainer, { children: [_jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: 10 }, children: _jsx("div", { style: { display: 'flex', justifyContent: 'center', alignItems: 'center', gap: '8px' }, children: layoutMode === LayoutModes.Update ? _jsxs(_Fragment, { children: [_jsx(TMSaveFormButtonSave, { showTooltip: false, btnStyle: 'advanced', advancedColor: '#f09c0a', isModified: isModified, formMode: formMode, errorsCount: validationItems.filter(o => o.ResultType == ResultTypes.ERROR).length, onSaveAsync: handleConfirmAction }), _jsx(TMSaveFormButtonUndo, { btnStyle: 'toolbar', showTooltip: true, color: 'primary', isModified: isModified, formMode: formMode, onUndo: handleUndo })] }) :
|
|
1132
|
+
_jsxs(_Fragment, { children: [_jsx(TMButton, { disabled: archiveBtnDisabled, btnStyle: 'advanced', icon: _jsx(IconBoxArchiveIn, {}), width: 'auto', showTooltip: false, caption: SDKUI_Localizator.Archive, advancedColor: TMColors.success, onClick: handleConfirmAction }), _jsx(TMButton, { disabled: !clearFormBtnDisabled, btnStyle: 'advanced', icon: _jsx(IconClear, {}), width: 'auto', showTooltip: false, caption: SDKUI_Localizator.Clear, advancedColor: TMColors.tertiary, onClick: handleClearForm }), DID && _jsx(TMButton, { disabled: undoBtnDisabled, btnStyle: 'advanced', icon: _jsx(IconUndo, {}), width: '150px', showTooltip: false, caption: SDKUI_Localizator.Undo, advancedColor: TMColors.tertiary, onClick: handleUndo })] }) }) }), customButton && _jsx(TMCustomButton, { button: customButton, formData: formData, selectedItems: [], onClose: () => setCustomButton(undefined) }), totalItems > listMaxItems &&
|
|
1133
|
+
!isApprView &&
|
|
1134
|
+
TID !== SystemTIDs.Drafts &&
|
|
1135
|
+
!shouldShowAll &&
|
|
1136
|
+
_jsx(TMShowAllOrMaxItemsButton, { showAll: showAll, dataSourceLength: totalItems, onClick: () => { setShowAll(!showAll); } })] }), _jsx(ConfirmAttachmentsDialog, {})] })] });
|
|
1054
1137
|
}, [
|
|
1055
1138
|
TID,
|
|
1056
1139
|
DID,
|
|
@@ -1078,11 +1161,11 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
1078
1161
|
handleUndo,
|
|
1079
1162
|
handleClearForm
|
|
1080
1163
|
]);
|
|
1081
|
-
const tmBlog = useMemo(() => _jsx(TMDcmtBlog, {
|
|
1164
|
+
const tmBlog = useMemo(() => _jsx(TMDcmtBlog, { tid: TID, did: DID, allTasks: allTasks, fetchBlogDataTrigger: refreshBlogTrigger, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), [TID, DID, allTasks, refreshBlogTrigger]);
|
|
1082
1165
|
const tmSysMetadata = useMemo(() => _jsx(TMMetadataValues, { layoutMode: layoutMode, openChooserBySingleClick: !isOpenDistinctValues, TID: TID, isReadOnly: true, deviceType: deviceType, metadataValues: formData.filter(o => (o.mid != undefined && o.mid <= 100)), metadataValuesOrig: formData.filter(o => (o.mid != undefined && o.mid <= 100)), validationItems: [], inputMids: inputMids }), [TID, layoutMode, formData, deviceType, inputMids]);
|
|
1083
1166
|
const tmDcmtPreview = useMemo(() => _jsx(TMDcmtPreviewWrapper, { currentDcmt: currentDcmt, dcmtFile: dcmtFile ?? inputFile, deviceType: deviceType, fromDTD: fromDTD, layoutMode: layoutMode, onFileUpload: (file) => {
|
|
1084
1167
|
setDcmtFile(file);
|
|
1085
|
-
}, enableDragDropOverlay: enableDragDropOverlay }), [currentDcmt, dcmtFile, deviceType, fromDTD, layoutMode, inputFile, enableDragDropOverlay, setDcmtFile]);
|
|
1168
|
+
}, enableDragDropOverlay: enableDragDropOverlay }, refreshPreviewTrigger), [currentDcmt, dcmtFile, deviceType, fromDTD, layoutMode, inputFile, enableDragDropOverlay, setDcmtFile]);
|
|
1086
1169
|
const tmWF = useMemo(() => {
|
|
1087
1170
|
if (isWFDataLoading) {
|
|
1088
1171
|
return (_jsx("div", { style: {
|
|
@@ -1347,23 +1430,23 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
1347
1430
|
height: '100%',
|
|
1348
1431
|
position: 'relative',
|
|
1349
1432
|
overflow: 'hidden'
|
|
1350
|
-
}, children: [_jsxs("div", { style: { width: '100%', height: '100%', display: isOpenDetails || isOpenMaster ? 'none' : 'flex' }, children: [isNavigating && _jsx(Spinner, { description: SDKUI_Localizator.Loading, flat: false }), (fromDTD) &&
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1433
|
+
}, children: [_jsxs("div", { style: { width: '100%', height: '100%', display: isOpenDetails || isOpenMaster ? 'none' : 'flex' }, children: [isNavigating && _jsx(Spinner, { description: SDKUI_Localizator.Loading, flat: false }), (fromDTD) && _jsx(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: useWaitPanelLocalState ? showWaitPanelLocal : showWaitPanel, showWaitPanelPrimary: useWaitPanelLocalState ? showPrimaryLocal : showPrimary, showWaitPanelSecondary: useWaitPanelLocalState ? showSecondaryLocal : showSecondary, waitPanelTitle: useWaitPanelLocalState ? waitPanelTitleLocal : waitPanelTitle, waitPanelTextPrimary: useWaitPanelLocalState ? waitPanelTextPrimaryLocal : waitPanelTextPrimary, waitPanelValuePrimary: useWaitPanelLocalState ? waitPanelValuePrimaryLocal : waitPanelValuePrimary, waitPanelMaxValuePrimary: useWaitPanelLocalState ? waitPanelMaxValuePrimaryLocal : waitPanelMaxValuePrimary, waitPanelTextSecondary: useWaitPanelLocalState ? waitPanelTextSecondaryLocal : waitPanelTextSecondary, waitPanelValueSecondary: useWaitPanelLocalState ? waitPanelValueSecondaryLocal : waitPanelValueSecondary, waitPanelMaxValueSecondary: useWaitPanelLocalState ? waitPanelMaxValueSecondaryLocal : waitPanelMaxValueSecondary, isCancelable: useWaitPanelLocalState ? dcmtFile ? dcmtFile.size >= 1000000 : false : true, abortController: useWaitPanelLocalState ? abortControllerLocal : abortController, children: _jsxs(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: showCicoWaitPanel, showWaitPanelPrimary: showCicoPrimaryProgress, waitPanelTitle: cicoWaitPanelTitle, waitPanelTextPrimary: cicoPrimaryProgressText, waitPanelValuePrimary: cicoPrimaryProgressValue, waitPanelMaxValuePrimary: cicoPrimaryProgressMax, isCancelable: true, abortController: abortControllerLocal, children: [(groupId && groupId.length > 0)
|
|
1434
|
+
? _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", parentId: groupId, showToolbar: showDcmtFormSidebar })
|
|
1435
|
+
: _jsxs(TMPanelManagerWithPersistenceProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: defaultPanelDimensions, initialDimensions: defaultPanelDimensions, initialMobilePanelId: 'tmDcmtForm', isPersistenceEnabled: !isMobile ? hasSavedLayout() : false, persistPanelStates: !isMobile ? (state) => persistPanelStates(state) : undefined, persistedPanelStates: getPersistedPanelStates(), children: [_jsx(WfButtonStateHandler, { isWFDisabled: isWFDisabled }), _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", parentId: groupId, showToolbar: showDcmtFormSidebar })] }), isOpenDistinctValues &&
|
|
1436
|
+
_jsx(TMDistinctValues, { tid: TID, mid: focusedMetadataValue?.mid, isModal: true, showHeader: false, layoutMode: layoutMode, onSelectionChanged: (e) => {
|
|
1437
|
+
if (!e)
|
|
1438
|
+
return;
|
|
1439
|
+
setFormData((prevItems) => prevItems.map((item) => item.tid == e.tid && item.mid === e.mid ? { ...item, value: e.newValue } : item));
|
|
1440
|
+
} }), isOpenFormulaEditor &&
|
|
1441
|
+
_jsx(TMFormulaEditor, { isModal: true, formMode: FormModes.Update, inputData: getFormula(), showBack: false, onClose: () => setIsOpenFormulaEditor(false), onApplied: (newFormula) => {
|
|
1442
|
+
setFormData((prevItems) => prevItems.map((item) => item.tid == newFormula.tid && item.mid === newFormula.mid ? { ...item, value: FormulaHelper.addFormulaTag(newFormula.expression), isSelected: true, isEditable: true } : item));
|
|
1443
|
+
setFocusedMetadataValue(prevState => ({
|
|
1444
|
+
...prevState,
|
|
1445
|
+
isSelected: true,
|
|
1446
|
+
isEditable: true,
|
|
1447
|
+
value: FormulaHelper.addFormulaTag(newFormula.expression)
|
|
1448
|
+
}));
|
|
1449
|
+
} }), showApprovePopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, TID: approvalVID, DID: DID, isReject: 0, onClose: () => setShowApprovePopup(false) }), showRejectPopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, TID: approvalVID, DID: DID, isReject: 1, onClose: () => setShowRejectPopup(false) }), showReAssignPopup && _jsx(WorkFlowReAssignPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, TID: approvalVID, DID: DID, onClose: () => setShowReAssignPopup(false) }), showMoreInfoPopup && _jsx(WorkFlowMoreInfoPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, TID: approvalVID, DID: DID, onClose: () => setShowMoreInfoPopup(false) }), (isModal && onClose) && _jsx("div", { id: "TMDcmtFormShowConfirmForClose-" + id })] }) }), _jsx(ToppyDraggableHelpCenter, { initialIsCollapsed: false, deviceType: deviceType, isVisible: (showToppyForApprove || showToppyForCompleteMoreInfo || showToppyForReferences) && !openS4TViewer, content: _jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: [showToppyForApprove && (workItems.length === 1 ?
|
|
1367
1450
|
_jsx(WorkFlowOperationButtons, { deviceType: deviceType, onApprove: () => setShowApprovePopup(true), onSignApprove: handleSignApprove, onReject: () => setShowRejectPopup(true), onReAssign: () => setShowReAssignPopup(true), onMoreInfo: () => setShowMoreInfoPopup(true), dtd: fromDTD })
|
|
1368
1451
|
:
|
|
1369
1452
|
_jsxs("div", { style: { padding: 10, color: 'white', maxWidth: '180px', borderRadius: 10, background: '#1B1464 0% 0% no-repeat padding-box', border: '1px solid #FFFFFF' }, children: [`Devi approvare ${workItems.length} workitem(s) per questo documento.`, `Vai alla sezione di approvazione.`] })), showToppyForCompleteMoreInfo && (_jsxs(_Fragment, { children: [_jsx("div", { style: { padding: 10, color: 'white', maxWidth: '180px', borderRadius: 10, background: '#1B1464 0% 0% no-repeat padding-box', border: '1px solid #FFFFFF' }, children: `${SDKUI_Localizator.MoreInfoCompleteRequestSentBy} ${taskMoreInfo?.fromName}!` }), _jsx(TMButton, { caption: SDKUI_Localizator.CommentAndComplete, color: 'success', showTooltip: false, onClick: () => {
|
|
@@ -1417,7 +1500,8 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
1417
1500
|
finally {
|
|
1418
1501
|
TMSpinner.hide();
|
|
1419
1502
|
}
|
|
1420
|
-
}, onClose: () => setShowManyToManyChooser(false), manageUseLocalizedName: false })),
|
|
1503
|
+
}, onClose: () => setShowManyToManyChooser(false), manageUseLocalizedName: false })), (showHistory && fromDTD && currentDcmt) && _jsx(TMViewHistoryDcmt, { fromDTD: fromDTD, deviceType: deviceType, inputDcmt: { TID: currentDcmt.tid, DID: currentDcmt.did }, onClose: hideHistoryCallback, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), (showCheckoutInformationForm && fromDTD && currentDcmt) &&
|
|
1504
|
+
_jsx(TMDcmtCheckoutInfoForm, { dtdName: fromDTD.name ?? SDKUI_Localizator.SearchResult, selectedDcmtOrFocused: { TID: currentDcmt.tid, DID: currentDcmt.did, FILEEXT: currentDcmt.fileExt }, onClose: hideCheckoutInformationFormCallback }), (commentFormState.show && currentDcmt) && _jsx(TMBlogCommentForm, { context: { engine: 'SearchEngine', object: { tid: currentDcmt.tid, did: currentDcmt.did } }, onClose: hideCommentFormCallback, refreshCallback: triggerBlogRefresh, participants: [], showAttachmentsSection: false, allArchivedDocumentsFileItems: [], isCommentRequired: commentFormState.isRequired, removeAndEditAttachment: commentFormState.removeAndEditAttachment }), isOpenArchiveRelationForm && (_jsx(TMDcmtForm, { isModal: true, titleModal: SDKUI_Localizator.Archive + ' - ' + (archiveType === 'detail' ? SDKUI_Localizator.DcmtsDetail : SDKUI_Localizator.DcmtsMaster), TID: archiveRelatedDcmtFormTID, layoutMode: LayoutModes.Ark, inputMids: archiveRelatedDcmtFormMids, showBackButton: false, allowButtonsRefs: false, onClose: () => {
|
|
1421
1505
|
setIsOpenArchiveRelationForm(false);
|
|
1422
1506
|
setArchiveType(undefined);
|
|
1423
1507
|
setArchiveRelatedDcmtFormTID(undefined);
|
|
@@ -1451,8 +1535,11 @@ const applyMetadataFilter = (data, showAll, listMaxItems, TID) => {
|
|
|
1451
1535
|
o.mid === SystemMIDsAsNumber.FileSize ||
|
|
1452
1536
|
o.mid === SystemMIDsAsNumber.LastUpdateTime ||
|
|
1453
1537
|
o.mid === SystemMIDsAsNumber.CreationTime;
|
|
1538
|
+
const chronologySystemFilter = (o) => baseFilter(o) ||
|
|
1539
|
+
o.mid === SystemMIDsAsNumber.FileExt ||
|
|
1540
|
+
o.mid === SystemMIDsAsNumber.FileSize;
|
|
1454
1541
|
// Select the appropriate filter based on document type
|
|
1455
|
-
const currentFilter = TID === SystemTIDs.Drafts ? draftFilter : baseFilter;
|
|
1542
|
+
const currentFilter = TID === SystemTIDs.Drafts ? draftFilter : TID === SystemTIDs.Chronology ? chronologySystemFilter : baseFilter;
|
|
1456
1543
|
// Apply filter once
|
|
1457
1544
|
const filteredData = data.filter(currentFilter);
|
|
1458
1545
|
// Return all filtered data or slice to max items
|
|
@@ -1506,3 +1593,35 @@ const TMDcmtPreviewWrapper = ({ currentDcmt, layoutMode, fromDTD, dcmtFile, devi
|
|
|
1506
1593
|
_jsx(TMDcmtPreview, { isVisible: isVisible, onClosePanel: (!isMobile && countVisibleLeafPanels() > 1) ? () => setPanelVisibilityById('tmDcmtPreview', false) : undefined, allowMaximize: !isMobile && countVisibleLeafPanels() > 1, onMaximizePanel: (!isMobile && countVisibleLeafPanels() > 1) ? () => toggleMaximize("tmDcmtPreview") : undefined, dcmtData: currentDcmt, isResizingActive: isResizingActive }) :
|
|
1507
1594
|
_jsx(TMFileUploader, { onFileUpload: onFileUpload, onClose: (!isMobile && countVisibleLeafPanels() > 1) ? () => setPanelVisibilityById('tmDcmtPreview', false) : undefined, isRequired: fromDTD?.archiveConstraint === ArchiveConstraints.ContentCompulsory && dcmtFile === null, defaultBlob: dcmtFile, deviceType: deviceType, isResizingActive: isResizingActive, enableDragDropOverlay: panelVisibility['tmDcmtPreview'] && enableDragDropOverlay }));
|
|
1508
1595
|
};
|
|
1596
|
+
const Ribbon = styled.div `
|
|
1597
|
+
font-size: 0.85rem;
|
|
1598
|
+
font-weight: 600;
|
|
1599
|
+
color: #fff;
|
|
1600
|
+
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
|
|
1601
|
+
--f: .4em; /* control the folded part */
|
|
1602
|
+
position: absolute;
|
|
1603
|
+
top: 2px;
|
|
1604
|
+
left: 2px;
|
|
1605
|
+
z-index: 1200;
|
|
1606
|
+
line-height: 1.6;
|
|
1607
|
+
padding-inline: 0.8lh;
|
|
1608
|
+
padding-bottom: var(--f);
|
|
1609
|
+
border-image: conic-gradient(#0008 0 0) 51%/var(--f);
|
|
1610
|
+
clip-path: polygon(100% calc(100% - var(--f)),100% 100%,calc(100% - var(--f)) calc(100% - var(--f)),var(--f) calc(100% - var(--f)), 0 100%,0 calc(100% - var(--f)),999px calc(100% - var(--f) - 999px),calc(100% - 999px) calc(100% - var(--f) - 999px));
|
|
1611
|
+
transform: translate(calc((cos(45deg) - 1)*100%), -100%) rotate(-45deg);
|
|
1612
|
+
transform-origin: 100% 100%;
|
|
1613
|
+
background-color: rgba(217, 148, 13, 0.92);
|
|
1614
|
+
display: inline-block;
|
|
1615
|
+
padding-top: 0.1em;
|
|
1616
|
+
white-space: nowrap;
|
|
1617
|
+
transition: ${props => props.$isMobile ? 'none' : 'all 0.3s ease'};
|
|
1618
|
+
cursor: 'default';
|
|
1619
|
+
|
|
1620
|
+
${props => !props.$isMobile && `
|
|
1621
|
+
&:hover {
|
|
1622
|
+
background-color: #d9940d;
|
|
1623
|
+
font-size: 1.1rem;
|
|
1624
|
+
transform: translate(calc((cos(45deg) - 1)*100%), -100%) rotate(-45deg) scale(1.05);
|
|
1625
|
+
}
|
|
1626
|
+
`}
|
|
1627
|
+
`;
|