@topconsultnpm/sdkui-react-beta 6.15.2 → 6.15.4

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.
@@ -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, }) => {
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() : onArchiveAsync();
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 onArchiveAsync = async () => {
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 && onSavedAsyncCallback) {
383
+ onSavedAsyncCallback(res, TID);
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([]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react-beta",
3
- "version": "6.15.2",
3
+ "version": "6.15.4",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",