@topconsultnpm/sdkui-react-beta 6.15.2 → 6.15.3
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/assets/icomoon.svg +96 -96
- package/lib/assets/italy.svg +16 -16
- package/lib/assets/topmedia-six.svg +65 -65
- package/lib/assets/topmeida-six-bianco.svg +65 -65
- package/lib/components/features/archive/TMArchive.d.ts +2 -0
- package/lib/components/features/archive/TMArchive.js +2 -2
- package/lib/components/features/documents/TMDcmtForm.d.ts +2 -1
- package/lib/components/features/documents/TMDcmtForm.js +6 -3
- package/lib/components/features/search/TMSearch.d.ts +1 -0
- package/lib/components/features/search/TMSearch.js +2 -2
- package/lib/components/features/search/TMSearchResult.d.ts +1 -0
- package/lib/components/features/search/TMSearchResult.js +7 -1
- package/package.json +1 -1
|
@@ -12,7 +12,7 @@ import TMTreeSelector from '../search/TMTreeSelector';
|
|
|
12
12
|
import TMPanel from '../../base/TMPanel';
|
|
13
13
|
import { TMPanelManagerProvider, useTMPanelManagerContext } from '../../layout/panelManager/TMPanelManagerContext';
|
|
14
14
|
import TMPanelManagerContainer from '../../layout/panelManager/TMPanelManagerContainer';
|
|
15
|
-
const TMArchive = ({ inputTID, inputFile = null, connectorFileSave = undefined, onSavedAsyncCallback }) => {
|
|
15
|
+
const TMArchive = ({ onArchiveCompleted = undefined, inputTID, inputFile = null, connectorFileSave = undefined, onSavedAsyncCallback }) => {
|
|
16
16
|
const [currentTID, setCurrentTID] = useState(0);
|
|
17
17
|
const [mruTIDs, setMruTIDs] = useState([]);
|
|
18
18
|
const [currentMruTID, setCurrentMruTID] = useState(0);
|
|
@@ -49,7 +49,7 @@ const TMArchive = ({ inputTID, inputFile = null, connectorFileSave = undefined,
|
|
|
49
49
|
setMruTIDs(newMruTIDS);
|
|
50
50
|
} }), [mruTIDs, currentMruTID, deviceType]);
|
|
51
51
|
const tmFormElement = useMemo(() => currentTID ?
|
|
52
|
-
_jsx(TMDcmtForm, { TID: currentTID, DID: undefined, groupId: 'tmForm', layoutMode: LayoutModes.Ark, onClose: deviceType === DeviceType.MOBILE ? () => setCurrentTID(undefined) : undefined, onSaveRecents: (TIDs) => setMruTIDs(TIDs), showDcmtFormSidebar: false, inputFile: inputFile, connectorFileSave: connectorFileSave, onSavedAsyncCallback: onSavedAsyncCallback })
|
|
52
|
+
_jsx(TMDcmtForm, { TID: currentTID, DID: undefined, groupId: 'tmForm', layoutMode: LayoutModes.Ark, onClose: deviceType === DeviceType.MOBILE ? () => setCurrentTID(undefined) : undefined, onSaveRecents: (TIDs) => setMruTIDs(TIDs), showDcmtFormSidebar: false, inputFile: inputFile, connectorFileSave: connectorFileSave, onSavedAsyncCallback: onSavedAsyncCallback, onArchiveCompleted: onArchiveCompleted })
|
|
53
53
|
:
|
|
54
54
|
_jsx(TMPanel, { title: 'Archiviazione', allowMaximize: false, children: _jsxs(TMLayoutContainer, { gap: 30, alignItems: 'center', justifyContent: 'center', children: [_jsx(StyledToppyTextContainer, { children: _jsx(StyledToppyText, { children: SDKUI_Localizator.DcmtTypeSelect }) }), _jsx(StyledToppyImage, { src: Logo, alt: 'Toppy' })] }) }), [currentTID, deviceType, mruTIDs, inputFile]);
|
|
55
55
|
const allInitialPanelVisibility = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { LayoutModes, TaskDescriptor } from '@topconsultnpm/sdk-ts-beta';
|
|
3
|
-
import { FormModes, TaskContext } from '../../../ts';
|
|
3
|
+
import { FormModes, MetadataValueDescriptorEx, TaskContext } from '../../../ts';
|
|
4
4
|
interface ITMDcmtFormProps {
|
|
5
5
|
TID?: number;
|
|
6
6
|
DID?: number;
|
|
@@ -29,6 +29,7 @@ interface ITMDcmtFormProps {
|
|
|
29
29
|
onTaskCompleted?: (task: TaskDescriptor) => void;
|
|
30
30
|
onTaskCreateRequest?: (taskContext: TaskContext, onTaskCreated?: (task?: TaskDescriptor) => void) => void;
|
|
31
31
|
connectorFileSave?: () => Promise<void>;
|
|
32
|
+
onArchiveCompleted?: (did: number, tid: number, metadataList: MetadataValueDescriptorEx[]) => void;
|
|
32
33
|
isModal?: boolean;
|
|
33
34
|
titleModal?: string;
|
|
34
35
|
widthModal?: string;
|
|
@@ -35,7 +35,7 @@ import ToppyHelpCenter from '../assistant/ToppyHelpCenter';
|
|
|
35
35
|
import TMBlogCommentForm from '../blog/TMBlogCommentForm';
|
|
36
36
|
let abortControllerLocal = new AbortController();
|
|
37
37
|
//#endregion
|
|
38
|
-
const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes.Update, 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, inputFile = null, taskFormDialogComponent, taskMoreInfo, connectorFileSave = undefined }) => {
|
|
38
|
+
const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes.Update, 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, inputFile = null, taskFormDialogComponent, taskMoreInfo, connectorFileSave = undefined, onArchiveCompleted = undefined, }) => {
|
|
39
39
|
const [id, setID] = useState('');
|
|
40
40
|
const [showWaitPanelLocal, setShowWaitPanelLocal] = useState(false);
|
|
41
41
|
const [waitPanelTitleLocal, setWaitPanelTitleLocal] = useState('');
|
|
@@ -287,7 +287,7 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
|
287
287
|
onButtonClick(e) {
|
|
288
288
|
if (e !== ButtonNames.YES)
|
|
289
289
|
return;
|
|
290
|
-
layoutMode === LayoutModes.Update ? onSavedAsync() :
|
|
290
|
+
layoutMode === LayoutModes.Update ? onSavedAsync() : onArchiveCompletedAsync();
|
|
291
291
|
},
|
|
292
292
|
});
|
|
293
293
|
};
|
|
@@ -333,7 +333,7 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
|
333
333
|
};
|
|
334
334
|
let firstBlock = true;
|
|
335
335
|
let maxFileSize = 0;
|
|
336
|
-
const
|
|
336
|
+
const onArchiveCompletedAsync = async () => {
|
|
337
337
|
let operationTitle = 'Archiviazione';
|
|
338
338
|
setUseWaitPanelLocalState(true);
|
|
339
339
|
setShowWaitPanelLocal(true);
|
|
@@ -379,6 +379,9 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
|
379
379
|
});
|
|
380
380
|
await onSavedAsyncCallback?.(ae.TID, res);
|
|
381
381
|
await setMetadataListAsync(fromDTD?.metadata ?? [], undefined, true, res);
|
|
382
|
+
if (res && onArchiveCompleted) {
|
|
383
|
+
onArchiveCompleted(res, TID, formData);
|
|
384
|
+
}
|
|
382
385
|
resetHandler();
|
|
383
386
|
let newMruTIDS = updateMruTids(SDKUI_Globals.userSettings.archivingSettings.mruTIDs, TID);
|
|
384
387
|
SDKUI_Globals.userSettings.archivingSettings.mruTIDs = newMruTIDS;
|
|
@@ -11,6 +11,7 @@ interface ITMSearchProps {
|
|
|
11
11
|
focusedWorkingGroupId?: number;
|
|
12
12
|
fetchTreeFileSystemForWorkingGroup?: (workingGroupId: number | undefined) => Promise<void>;
|
|
13
13
|
fetchArchivedDocumentsForWorkingGroup?: (workingGroupId: number | undefined) => Promise<void>;
|
|
14
|
+
onSearchCompleted?: (tid?: number, did?: number) => void;
|
|
14
15
|
}
|
|
15
16
|
declare const TMSearch: React.FunctionComponent<ITMSearchProps>;
|
|
16
17
|
export default TMSearch;
|
|
@@ -18,7 +18,7 @@ var TMSearchViews;
|
|
|
18
18
|
TMSearchViews[TMSearchViews["Search"] = 0] = "Search";
|
|
19
19
|
TMSearchViews[TMSearchViews["Result"] = 1] = "Result";
|
|
20
20
|
})(TMSearchViews || (TMSearchViews = {}));
|
|
21
|
-
const TMSearch = ({ inputTID, inputSqdID, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, onFileOpened, onRefreshAfterAddDcmtToFavs, onTaskCreateRequest, focusedWorkingGroupId = undefined, fetchTreeFileSystemForWorkingGroup, fetchArchivedDocumentsForWorkingGroup }) => {
|
|
21
|
+
const TMSearch = ({ onSearchCompleted = undefined, inputTID, inputSqdID, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, onFileOpened, onRefreshAfterAddDcmtToFavs, onTaskCreateRequest, focusedWorkingGroupId = undefined, fetchTreeFileSystemForWorkingGroup, fetchArchivedDocumentsForWorkingGroup }) => {
|
|
22
22
|
const [allSQDs, setAllSQDs] = useState([]);
|
|
23
23
|
const [filteredByTIDSQDs, setFilteredByTIDSQDs] = useState([]);
|
|
24
24
|
const [currentSQD, setCurrentSQD] = useState();
|
|
@@ -202,7 +202,7 @@ const TMSearch = ({ inputTID, inputSqdID, isExpertMode = SDKUI_Globals.userSetti
|
|
|
202
202
|
if (newResult.length <= 0) {
|
|
203
203
|
setCurrentSearchView(TMSearchViews.Search);
|
|
204
204
|
}
|
|
205
|
-
}, onTaskCreateRequest: onTaskCreateRequest, onClose: () => { setCurrentSearchView(TMSearchViews.Search); }, onFileOpened: onFileOpened, focusedWorkingGroupId: focusedWorkingGroupId, fetchTreeFileSystemForWorkingGroup: fetchTreeFileSystemForWorkingGroup, fetchArchivedDocumentsForWorkingGroup: fetchArchivedDocumentsForWorkingGroup })] }));
|
|
205
|
+
}, onTaskCreateRequest: onTaskCreateRequest, onClose: () => { setCurrentSearchView(TMSearchViews.Search); }, onFileOpened: onFileOpened, focusedWorkingGroupId: focusedWorkingGroupId, fetchTreeFileSystemForWorkingGroup: fetchTreeFileSystemForWorkingGroup, fetchArchivedDocumentsForWorkingGroup: fetchArchivedDocumentsForWorkingGroup, onSearchCompleted: onSearchCompleted })] }));
|
|
206
206
|
};
|
|
207
207
|
export default TMSearch;
|
|
208
208
|
const TMTreeSelectorWrapper = ({ isMobile, onSelectedTIDChanged }) => {
|
|
@@ -28,6 +28,7 @@ interface ITMSearchResultProps {
|
|
|
28
28
|
focusedWorkingGroupId?: number;
|
|
29
29
|
fetchTreeFileSystemForWorkingGroup?: (workingGroupId: number | undefined) => Promise<void>;
|
|
30
30
|
fetchArchivedDocumentsForWorkingGroup?: (workingGroupId: number | undefined) => Promise<void>;
|
|
31
|
+
onSearchCompleted?: (tid?: number, did?: number) => void;
|
|
31
32
|
}
|
|
32
33
|
declare const TMSearchResult: React.FC<ITMSearchResultProps>;
|
|
33
34
|
export default TMSearchResult;
|
|
@@ -59,7 +59,7 @@ const orderByName = (array) => {
|
|
|
59
59
|
return 1;
|
|
60
60
|
} return 0; });
|
|
61
61
|
};
|
|
62
|
-
const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisible = true, allowRelations = true, openDcmtFormAsModal = false, searchResults = [], showSearchResultSidebar = true, showSelector = false, groupId, title, isClosable = false, allowFloatingBar = true, showToolbarHeader = true, selectedSearchResultTID, workingGroupContext = undefined, disableAccordionIfSingleCategory = false, onRefreshAfterAddDcmtToFavs, onRefreshSearchAsync, onSelectedTIDChanged, onWFOperationCompleted, onClose, onTaskCreateRequest, onFileOpened, focusedWorkingGroupId = undefined, fetchTreeFileSystemForWorkingGroup, fetchArchivedDocumentsForWorkingGroup }) => {
|
|
62
|
+
const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisible = true, allowRelations = true, openDcmtFormAsModal = false, searchResults = [], showSearchResultSidebar = true, showSelector = false, groupId, title, isClosable = false, allowFloatingBar = true, showToolbarHeader = true, selectedSearchResultTID, workingGroupContext = undefined, disableAccordionIfSingleCategory = false, onRefreshAfterAddDcmtToFavs, onRefreshSearchAsync, onSelectedTIDChanged, onWFOperationCompleted, onClose, onTaskCreateRequest, onFileOpened, focusedWorkingGroupId = undefined, fetchTreeFileSystemForWorkingGroup, fetchArchivedDocumentsForWorkingGroup, onSearchCompleted = undefined }) => {
|
|
63
63
|
const [id, setID] = useState('');
|
|
64
64
|
const [showApprovePopup, setShowApprovePopup] = useState(false);
|
|
65
65
|
const [showRejectPopup, setShowRejectPopup] = useState(false);
|
|
@@ -108,6 +108,12 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
108
108
|
}
|
|
109
109
|
setSelectedSearchResult(orderByName(searchResults)[0]);
|
|
110
110
|
}, [searchResults]);
|
|
111
|
+
//Added for connector
|
|
112
|
+
useEffect(() => {
|
|
113
|
+
if (!onSearchCompleted || !currentDcmt)
|
|
114
|
+
return;
|
|
115
|
+
onSearchCompleted(currentDcmt.did, currentDcmt.tid);
|
|
116
|
+
}, [currentDcmt, onSearchCompleted]);
|
|
111
117
|
useEffect(() => {
|
|
112
118
|
setFocusedItem(undefined);
|
|
113
119
|
setSelectedItems([]);
|