@topconsultnpm/sdkui-react 6.20.0-dev1.69 → 6.20.0-dev1.70
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/choosers/TMInvoiceRetrieveFormats.js +1 -1
- package/lib/components/choosers/TMOrderRetrieveFormats.js +1 -1
- package/lib/components/features/search/TMSearch.js +11 -4
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +1 -0
- package/lib/components/features/search/TMSearchQueryPanel.js +6 -6
- package/lib/components/features/search/TMSearchResult.js +9 -2
- package/lib/components/settings/SettingsAppearance.js +92 -29
- package/lib/helper/SDKUI_Globals.d.ts +2 -0
- package/lib/helper/SDKUI_Globals.js +2 -0
- package/lib/helper/SDKUI_Localizator.d.ts +3 -0
- package/lib/helper/SDKUI_Localizator.js +30 -0
- package/lib/helper/queryHelper.d.ts +1 -1
- package/lib/helper/queryHelper.js +4 -3
- package/lib/hooks/useSettingsFeedback.d.ts +11 -0
- package/lib/hooks/useSettingsFeedback.js +38 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/utils/theme.d.ts +1 -1
- package/lib/utils/theme.js +1 -1
- package/package.json +1 -1
|
@@ -17,6 +17,6 @@ const TMInvoiceRetrieveFormats = ({ value, valueOrig, onValueChanged, valuesToEx
|
|
|
17
17
|
}
|
|
18
18
|
return dataSource;
|
|
19
19
|
};
|
|
20
|
-
return (_jsx(TMDropDown, { label: label, elementStyle: { marginBottom: TMMargin.
|
|
20
|
+
return (_jsx(TMDropDown, { label: label, elementStyle: { marginBottom: TMMargin.defaultMargin, width: width }, dataSource: getDataSource(), value: value, onValueChanged: (e) => { onValueChanged?.(e.target.value); }, isModifiedWhen: value != valueOrig, width: width }));
|
|
21
21
|
};
|
|
22
22
|
export default TMInvoiceRetrieveFormats;
|
|
@@ -17,6 +17,6 @@ const TMOrderRetrieveFormats = ({ value, valueOrig, onValueChanged, valuesToExcl
|
|
|
17
17
|
}
|
|
18
18
|
return dataSource;
|
|
19
19
|
};
|
|
20
|
-
return (_jsx(TMDropDown, { label: label, elementStyle: { marginBottom: TMMargin.
|
|
20
|
+
return (_jsx(TMDropDown, { label: label, elementStyle: { marginBottom: TMMargin.defaultMargin, width: width }, dataSource: getDataSource(), value: value, isModifiedWhen: value != valueOrig, onValueChanged: (e) => { onValueChanged?.(e.target.value); }, width: width }));
|
|
21
21
|
};
|
|
22
22
|
export default TMOrderRetrieveFormats;
|
|
@@ -32,6 +32,7 @@ const TMSearch = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTask
|
|
|
32
32
|
const [currentSQDMode, setCurrentSQDMode] = useState(1);
|
|
33
33
|
const [lastQdSearched, setLastQdSearched] = useState();
|
|
34
34
|
const [showSearchResults, setShowSearchResults] = useState(true);
|
|
35
|
+
const [maxDcmtsToBeReturned, setMaxDcmtsToBeReturned] = useState(SDKUI_Globals.userSettings.searchSettings?.maxDcmtsToBeReturned ?? 1000);
|
|
35
36
|
const deviceType = useDeviceType();
|
|
36
37
|
useEffect(() => {
|
|
37
38
|
if (onCurrentTIDChangedCallback) {
|
|
@@ -55,6 +56,12 @@ const TMSearch = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTask
|
|
|
55
56
|
});
|
|
56
57
|
}
|
|
57
58
|
}, [inputSqdID]);
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
const newMaxDcmtsToBeReturned = SDKUI_Globals.userSettings.searchSettings?.maxDcmtsToBeReturned ?? 1000;
|
|
61
|
+
if (newMaxDcmtsToBeReturned !== maxDcmtsToBeReturned) {
|
|
62
|
+
setMaxDcmtsToBeReturned(newMaxDcmtsToBeReturned);
|
|
63
|
+
}
|
|
64
|
+
}, [SDKUI_Globals.userSettings.searchSettings?.maxDcmtsToBeReturned]);
|
|
58
65
|
useEffect(() => {
|
|
59
66
|
setSearchResult([]);
|
|
60
67
|
if (!currentTID || currentTID <= 0) {
|
|
@@ -160,7 +167,7 @@ const TMSearch = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTask
|
|
|
160
167
|
SDKUI_Globals.userSettings.searchSettings.mruTIDs = newMruTIDS;
|
|
161
168
|
setMruTIDs(newMruTIDS);
|
|
162
169
|
} }), [mruTIDs, currentMruTID, deviceType]);
|
|
163
|
-
const tmSearchQueryPanelElement = useMemo(() => _jsx(TMSearchQueryPanelWrapper, { passToArchiveCallback: passToArchiveCallback, isExpertMode: isExpertMode, showBackToResultButton: searchResult.length > 0, fromDTD: fromDTD, SQD: currentSQD, inputMids: inputMids, onBackToResult: () => { setCurrentSearchView(TMSearchViews.Result); }, onSearchCompleted: (searchResult, qd) => {
|
|
170
|
+
const tmSearchQueryPanelElement = useMemo(() => _jsx(TMSearchQueryPanelWrapper, { passToArchiveCallback: passToArchiveCallback, isExpertMode: isExpertMode, showBackToResultButton: searchResult.length > 0, fromDTD: fromDTD, SQD: currentSQD, inputMids: inputMids, maxDcmtsToBeReturned: maxDcmtsToBeReturned, onBackToResult: () => { setCurrentSearchView(TMSearchViews.Result); }, onSearchCompleted: (searchResult, qd) => {
|
|
164
171
|
setSearchResult(searchResult);
|
|
165
172
|
if (searchResult.length <= 0)
|
|
166
173
|
return;
|
|
@@ -176,7 +183,7 @@ const TMSearch = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTask
|
|
|
176
183
|
}, onSqdSaved: async (newSqd) => {
|
|
177
184
|
await loadDataSQDsAsync(true, newSqd.masterTID);
|
|
178
185
|
await setSQDAsync(newSqd);
|
|
179
|
-
} }), [fromDTD, showSearchResults, setShowSearchResults, currentSQD, isExpertMode, mruTIDs, searchResult, passToArchiveCallback, inputMids]);
|
|
186
|
+
} }), [fromDTD, showSearchResults, setShowSearchResults, currentSQD, isExpertMode, mruTIDs, searchResult, passToArchiveCallback, inputMids, maxDcmtsToBeReturned]);
|
|
180
187
|
const tmSavedQuerySelectorElement = useMemo(() => _jsxs(TabPanel, { width: "100%", height: "100%", showNavButtons: true, repaintChangesOnly: true, selectedIndex: currentSQDMode, onSelectedIndexChange: (index) => setCurrentSQDMode(index), children: [(currentTID || currentSQD) ? _jsx(Item, { title: fromDTD?.nameLoc, children: _jsx(TMSavedQuerySelectorWrapper, { allowShowSearch: false, items: filteredByTIDSQDs, selectedId: currentSQD?.id, onRefreshData: () => { loadDataSQDsAsync(true); }, onItemClick: (sqd) => {
|
|
181
188
|
onSQDItemClick(sqd, setSQDAsync);
|
|
182
189
|
}, onDeleted: (sqd) => onSQDDeleted(sqd, sqd.id == currentSQD?.id ? filteredByTIDSQDs.find(o => o.id == 1) : currentSQD, setSQDAsync) }) }) : _jsx(_Fragment, {}), _jsx(Item, { title: SDKUI_Localizator.AllFemale, children: _jsx(TMSavedQuerySelectorWrapper, { allowShowSearch: true, items: allSQDs, manageDefault: false, onItemClick: (sqd) => {
|
|
@@ -263,11 +270,11 @@ const TMRecentsManagerWrapper = ({ mruTIDs, currentMruTID, deviceType, onSelecte
|
|
|
263
270
|
onDeletedTID?.(tid);
|
|
264
271
|
} }));
|
|
265
272
|
};
|
|
266
|
-
const TMSearchQueryPanelWrapper = ({ fromDTD, SQD, isExpertMode, showBackToResultButton, onSearchCompleted, onSqdSaved, onBackToResult, passToArchiveCallback, inputMids }) => {
|
|
273
|
+
const TMSearchQueryPanelWrapper = ({ fromDTD, SQD, isExpertMode, showBackToResultButton, onSearchCompleted, onSqdSaved, onBackToResult, passToArchiveCallback, inputMids, maxDcmtsToBeReturned }) => {
|
|
267
274
|
const { setPanelVisibilityById, toggleMaximize, countVisibleLeafPanels } = useTMPanelManagerContext();
|
|
268
275
|
const deviceType = useDeviceType();
|
|
269
276
|
const isMobile = deviceType === DeviceType.MOBILE;
|
|
270
|
-
return (_jsx(TMSearchQueryPanel, { onClosePanel: (!isMobile && countVisibleLeafPanels() > 1) ? () => setPanelVisibilityById('TMSearchQueryPanel', false) : undefined, allowMaximize: !isMobile && countVisibleLeafPanels() > 1, onMaximizePanel: (!isMobile && countVisibleLeafPanels() > 1) ? () => toggleMaximize("TMSearchQueryPanel") : undefined, isExpertMode: isExpertMode, fromDTD: fromDTD, SQD: SQD, inputMids: inputMids, onSearchCompleted: onSearchCompleted, onSqdSaved: onSqdSaved, showBackToResultButton: showBackToResultButton, onBackToResult: onBackToResult, passToArchiveCallback: passToArchiveCallback }));
|
|
277
|
+
return (_jsx(TMSearchQueryPanel, { onClosePanel: (!isMobile && countVisibleLeafPanels() > 1) ? () => setPanelVisibilityById('TMSearchQueryPanel', false) : undefined, allowMaximize: !isMobile && countVisibleLeafPanels() > 1, onMaximizePanel: (!isMobile && countVisibleLeafPanels() > 1) ? () => toggleMaximize("TMSearchQueryPanel") : undefined, isExpertMode: isExpertMode, fromDTD: fromDTD, SQD: SQD, inputMids: inputMids, onSearchCompleted: onSearchCompleted, onSqdSaved: onSqdSaved, showBackToResultButton: showBackToResultButton, onBackToResult: onBackToResult, passToArchiveCallback: passToArchiveCallback, maxDcmtsToBeReturned: maxDcmtsToBeReturned }));
|
|
271
278
|
};
|
|
272
279
|
const TMSavedQuerySelectorWrapper = ({ items, selectedId, allowShowSearch, manageDefault, onRefreshData, onItemClick, onDeleted }) => {
|
|
273
280
|
const { setPanelVisibilityById } = useTMPanelManagerContext();
|
|
@@ -20,6 +20,7 @@ interface ITMSearchQueryPanelProps {
|
|
|
20
20
|
mid: number;
|
|
21
21
|
value: string;
|
|
22
22
|
}>, tid?: number) => void;
|
|
23
|
+
maxDcmtsToBeReturned?: number;
|
|
23
24
|
}
|
|
24
25
|
declare const TMSearchQueryPanel: React.FunctionComponent<ITMSearchQueryPanelProps>;
|
|
25
26
|
export default TMSearchQueryPanel;
|
|
@@ -21,7 +21,7 @@ import TMSavedQueryForm from './TMSavedQueryForm';
|
|
|
21
21
|
import { ContextMenu } from '../../NewComponents/ContextMenu';
|
|
22
22
|
import { AdvancedMenuButtons } from '../../editors/TMMetadataValues';
|
|
23
23
|
import TMToppyMessage from '../../../helper/TMToppyMessage';
|
|
24
|
-
const TMSearchQueryPanel = ({ fromDTD, showBackToResultButton, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, SQD, inputMids, onSearchCompleted, onSqdSaved, onBack, onClosePanel, allowMaximize = true, onMaximizePanel, onBackToResult, passToArchiveCallback }) => {
|
|
24
|
+
const TMSearchQueryPanel = ({ fromDTD, showBackToResultButton, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, SQD, inputMids, onSearchCompleted, onSqdSaved, onBack, onClosePanel, allowMaximize = true, onMaximizePanel, onBackToResult, passToArchiveCallback, maxDcmtsToBeReturned }) => {
|
|
25
25
|
const [confirmQueryParams, ConfirmQueryParamsDialog] = useQueryParametersDialog();
|
|
26
26
|
const [qd, setQd] = useState();
|
|
27
27
|
const [shouldSearch, setShouldSearch] = useState(false);
|
|
@@ -57,18 +57,18 @@ const TMSearchQueryPanel = ({ fromDTD, showBackToResultButton, isExpertMode = SD
|
|
|
57
57
|
appliedInputMidsRef.current = null;
|
|
58
58
|
const initQd = async () => {
|
|
59
59
|
// Only initialize if qd doesn't exist or is for a different TID
|
|
60
|
-
if (!qd || qd.from?.tid !== fromDTD.id) {
|
|
61
|
-
const newQd = await getQD(fromDTD.id, false);
|
|
60
|
+
if (!qd || qd.from?.tid !== fromDTD.id || qd.maxDcmtsToBeReturned !== maxDcmtsToBeReturned) {
|
|
61
|
+
const newQd = await getQD(fromDTD.id, false, maxDcmtsToBeReturned ?? 1000);
|
|
62
62
|
if (newQd) {
|
|
63
63
|
setQd(newQd);
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
67
|
initQd();
|
|
68
|
-
}, [fromDTD?.id]);
|
|
68
|
+
}, [fromDTD?.id, maxDcmtsToBeReturned]);
|
|
69
69
|
// Apply inputMids when qd is ready and matches fromDTD
|
|
70
70
|
useEffect(() => {
|
|
71
|
-
if (!qd || !fromDTD || qd.from?.tid !== fromDTD.id)
|
|
71
|
+
if (!qd || !fromDTD || qd.from?.tid !== fromDTD.id || qd.maxDcmtsToBeReturned !== maxDcmtsToBeReturned)
|
|
72
72
|
return;
|
|
73
73
|
const midsToApply = pendingMidsRef.current;
|
|
74
74
|
if (!midsToApply || midsToApply.length === 0)
|
|
@@ -177,7 +177,7 @@ const TMSearchQueryPanel = ({ fromDTD, showBackToResultButton, isExpertMode = SD
|
|
|
177
177
|
if (show)
|
|
178
178
|
setQd({ ...qd, where: qd?.where?.filter(o => PlatformObjectValidator.WhereItemHasValues(o)) });
|
|
179
179
|
else {
|
|
180
|
-
let qdEasy = SQD?.qd ?? await getQD(fromDTD?.id, false);
|
|
180
|
+
let qdEasy = SQD?.qd ?? await getQD(fromDTD?.id, false, maxDcmtsToBeReturned ?? 1000);
|
|
181
181
|
if (qdEasy && qd?.where) {
|
|
182
182
|
for (const wi of qd.where) {
|
|
183
183
|
let wiEasy = qdEasy.where?.find(o => o.mid == wi.mid);
|
|
@@ -3,7 +3,7 @@ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
|
|
3
3
|
import { SDK_Globals, DataColumnTypes, MetadataDataDomains, DataListViewModes, MetadataFormats, LayoutModes, DcmtTypeListCacheService, SystemMIDsAsNumber, RetrieveFileOptions, DcmtOpers, GeneralRetrieveFormats, AccessLevelsEx, LayoutCacheService, UserListCacheService } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
import { getAllFieldSelectedDcmtsOrFocused, getCommandsMenuItems, getSelectedDcmtsOrFocused } from './TMSearchResultsMenuItems';
|
|
6
|
-
import { genUniqueId, IconShow, IconBoard, IconDcmtTypeSys, SDKUI_Localizator, IconDelete, IconRefresh, IconMenuVertical, deepCompare, generateUniqueColumnKeys, searchResultDescriptorToSimpleArray, searchResultToMetadataValues, IconSearchCheck, TMImageLibrary, convertSearchResultDescriptorToFileItems, IconCustom, isApprovalWorkflowView } from '../../../helper';
|
|
6
|
+
import { genUniqueId, IconShow, IconBoard, IconDcmtTypeSys, SDKUI_Localizator, IconDelete, IconRefresh, IconMenuVertical, deepCompare, generateUniqueColumnKeys, searchResultDescriptorToSimpleArray, searchResultToMetadataValues, IconSearchCheck, TMImageLibrary, convertSearchResultDescriptorToFileItems, IconCustom, isApprovalWorkflowView, SDKUI_Globals } from '../../../helper';
|
|
7
7
|
import { useDcmtOperations } from '../../../hooks/useDcmtOperations';
|
|
8
8
|
import { useInputAttachmentsDialog, useInputCvtFormatDialog } from '../../../hooks/useInputDialog';
|
|
9
9
|
import { useRelatedDocuments } from '../../../hooks/useRelatedDocuments';
|
|
@@ -805,6 +805,7 @@ const TMSearchResultGrid = ({ openInOffice, fromDTD, allUsers, inputFocusedItem,
|
|
|
805
805
|
const [selectedRowKeys, setSelectedRowKeys] = useState([]);
|
|
806
806
|
const [focusedItem, setFocusedItem] = useState();
|
|
807
807
|
const [visibleItems, setVisibleItems] = useState([]);
|
|
808
|
+
const [pageSize, setPageSize] = useState(SDKUI_Globals.userSettings.searchSettings?.pageSize ?? TMDataGridPageSize.Large);
|
|
808
809
|
const { loadDataListsAsync, renderDataListCell } = useDataListItem();
|
|
809
810
|
const { loadUsersAsync, renderUserIdViewer } = useDataUserIdItem();
|
|
810
811
|
useEffect(() => {
|
|
@@ -818,6 +819,12 @@ const TMSearchResultGrid = ({ openInOffice, fromDTD, allUsers, inputFocusedItem,
|
|
|
818
819
|
return;
|
|
819
820
|
setSelectedRowKeys(inputSelectedItemsRowIndex);
|
|
820
821
|
}, [inputSelectedItems]);
|
|
822
|
+
useEffect(() => {
|
|
823
|
+
const newPageSize = SDKUI_Globals.userSettings.searchSettings?.pageSize ?? TMDataGridPageSize.Large;
|
|
824
|
+
if (newPageSize !== pageSize) {
|
|
825
|
+
setPageSize(newPageSize);
|
|
826
|
+
}
|
|
827
|
+
}, [SDKUI_Globals.userSettings.searchSettings?.pageSize]);
|
|
821
828
|
const onKeyDown = useCallback((e) => {
|
|
822
829
|
// Check if the pressed key is the "Delete" key.
|
|
823
830
|
if (e.event?.key === 'Delete' && !showExportForm) {
|
|
@@ -1075,7 +1082,7 @@ const TMSearchResultGrid = ({ openInOffice, fromDTD, allUsers, inputFocusedItem,
|
|
|
1075
1082
|
setVisibleItems(visibleRows.map((row) => { return row.data; }));
|
|
1076
1083
|
}, []);
|
|
1077
1084
|
useEffect(() => { onVisibleItemChanged?.(visibleItems); }, [visibleItems]);
|
|
1078
|
-
return _jsxs("div", { style: { width: "100%", height: "100%" }, children: [_jsx(TMDataGrid, { id: "tm-search-result", keyExpr: "rowIndex", dataColumns: dataColumns, dataSource: dataSource, repaintChangesOnly: true, selectedRowKeys: selectedRowKeys, focusedRowKey: Number(focusedItem?.rowIndex ?? 0), showSearchPanel: showSearch, showFilterPanel: true, sorting: { mode: "multiple" }, selection: { mode: allowMultipleSelection ? 'multiple' : 'single' }, pageSize:
|
|
1085
|
+
return _jsxs("div", { style: { width: "100%", height: "100%" }, children: [_jsx(TMDataGrid, { id: "tm-search-result", keyExpr: "rowIndex", dataColumns: dataColumns, dataSource: dataSource, repaintChangesOnly: true, selectedRowKeys: selectedRowKeys, focusedRowKey: Number(focusedItem?.rowIndex ?? 0), showSearchPanel: showSearch, showFilterPanel: true, sorting: { mode: "multiple" }, selection: { mode: allowMultipleSelection ? 'multiple' : 'single' }, pageSize: pageSize, onSelectionChanged: handleSelectionChange, onFocusedRowChanged: handleFocusedRowChange, onRowDblClick: onRowDblClick, onContentReady: onContentReady, showHeaderColumnChooser: true, onKeyDown: onKeyDown, customContextMenuItems: floatingMenuItems, counterConfig: { show: true } }), (showExportForm && searchResult && onCloseExportForm) && _jsx(TMDataGridExportForm, { dataColumns: dataColumns, dataSource: dataSource, selectedRowKeys: selectedRowKeys, onCloseExportForm: onCloseExportForm, searchResult: searchResult })] });
|
|
1079
1086
|
};
|
|
1080
1087
|
//#region TMSearchResultSelector
|
|
1081
1088
|
const StyledItemTemplate = styled.div `
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo
|
|
3
|
-
import TMLayoutContainer from '../base/TMLayout';
|
|
2
|
+
import { useMemo } from 'react';
|
|
4
3
|
import TMDropDown from '../editors/TMDropDown';
|
|
5
4
|
import TMCheckBox from '../editors/TMCheckBox';
|
|
6
5
|
import TMButton from '../base/TMButton';
|
|
7
6
|
import { LandingPages, SDKUI_Globals, SDKUI_Localizator, ThemeSettings } from '../../helper';
|
|
7
|
+
import { useSettingsFeedback } from '../../hooks/useSettingsFeedback';
|
|
8
|
+
import TMTooltip from '../base/TMTooltip';
|
|
8
9
|
const fontSizes = [
|
|
9
10
|
{ value: "10px", display: "10px" },
|
|
10
11
|
{ value: "11px", display: "11px" },
|
|
@@ -23,8 +24,7 @@ const fontFamilies = [
|
|
|
23
24
|
{ value: "Roboto", display: "Roboto" }
|
|
24
25
|
];
|
|
25
26
|
const SettingsAppearance = ({ landingPagesOptions, permissions = { canArchive: true, canSearch: true, dossiersLicense: true, wgGroupLicense: true, workFlowLicense: true } }) => {
|
|
26
|
-
const
|
|
27
|
-
const triggerUIUpdate = () => setForceUpdate((prev) => prev + 1); // Increment dummy state to re-render
|
|
27
|
+
const { showSavedBadge, lastChanged, triggerUIUpdate, closeBadge } = useSettingsFeedback();
|
|
28
28
|
const filteredLandingPageOptopns = useMemo(() => {
|
|
29
29
|
let options = landingPagesOptions ?? [];
|
|
30
30
|
if (!permissions?.canArchive) {
|
|
@@ -44,30 +44,93 @@ const SettingsAppearance = ({ landingPagesOptions, permissions = { canArchive: t
|
|
|
44
44
|
}
|
|
45
45
|
return options;
|
|
46
46
|
}, [permissions?.canArchive, permissions?.canSearch, permissions?.wgGroupLicense, permissions?.dossiersLicense, permissions?.workFlowLicense, landingPagesOptions]);
|
|
47
|
-
return (_jsxs(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
47
|
+
return (_jsxs("div", { style: { width: "100%", height: "100%", display: "flex", flexDirection: "column", position: "relative" }, children: [_jsxs("div", { style: { flex: 1, overflowY: "auto", padding: "4px" }, children: [_jsxs("div", { style: {
|
|
48
|
+
backgroundColor: "rgba(var(--primary-rgb, 33, 150, 243), 0.04)",
|
|
49
|
+
borderLeft: "3px solid var(--primary-color, #2196f3)",
|
|
50
|
+
borderRadius: "4px",
|
|
51
|
+
padding: "10px 12px",
|
|
52
|
+
marginBottom: "6px"
|
|
53
|
+
}, children: [_jsxs("div", { style: {
|
|
54
|
+
display: "flex",
|
|
55
|
+
alignItems: "center",
|
|
56
|
+
gap: "6px",
|
|
57
|
+
marginBottom: "8px"
|
|
58
|
+
}, children: [_jsx("i", { className: "dx-icon-font", style: { fontSize: "1.1rem", color: "var(--primary-color, #2196f3)" } }), _jsx("p", { style: { fontSize: '1.05rem', fontWeight: '600', margin: 0, color: "var(--text-primary, #333)" }, children: "Font" })] }), _jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "2px" }, children: [_jsx(TMDropDown, { label: SDKUI_Localizator.Name, dataSource: fontFamilies, width: '100%', value: SDKUI_Globals.userSettings.themeSettings.fontFamily, onValueChanged: (e) => {
|
|
59
|
+
let newFamily = e.target.value;
|
|
60
|
+
SDKUI_Globals.userSettings.themeSettings.fontFamily = newFamily;
|
|
61
|
+
triggerUIUpdate(SDKUI_Localizator.Name, newFamily);
|
|
62
|
+
} }), _jsx(TMDropDown, { label: SDKUI_Localizator.Size, dataSource: fontSizes, width: '100%', value: SDKUI_Globals.userSettings.themeSettings.fontSize, onValueChanged: (e) => {
|
|
63
|
+
let newpx = e.target.value;
|
|
64
|
+
SDKUI_Globals.userSettings.themeSettings.fontSize = newpx;
|
|
65
|
+
triggerUIUpdate(SDKUI_Localizator.Size, newpx);
|
|
66
|
+
} })] })] }), _jsxs("div", { style: {
|
|
67
|
+
backgroundColor: "rgba(var(--success-rgb, 76, 175, 80), 0.04)",
|
|
68
|
+
borderLeft: "3px solid var(--success-color, #4caf50)",
|
|
69
|
+
borderRadius: "4px",
|
|
70
|
+
padding: "10px 12px",
|
|
71
|
+
marginBottom: "6px"
|
|
72
|
+
}, children: [_jsxs("div", { style: {
|
|
73
|
+
display: "flex",
|
|
74
|
+
alignItems: "center",
|
|
75
|
+
gap: "6px",
|
|
76
|
+
marginBottom: "8px"
|
|
77
|
+
}, children: [_jsx("i", { className: "dx-icon-tableproperties", style: { fontSize: "1.1rem", color: "var(--success-color, #4caf50)" } }), _jsx("p", { style: { fontSize: '1.05rem', fontWeight: '600', margin: 0, color: "var(--text-primary, #333)" }, children: SDKUI_Localizator.Grids })] }), _jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "5px" }, children: [_jsx(TMCheckBox, { label: SDKUI_Localizator.ShowRowSeparatingLines, value: SDKUI_Globals.userSettings.themeSettings.gridSettings.showRowLines, onValueChanged: (newValue) => {
|
|
78
|
+
SDKUI_Globals.userSettings.themeSettings.gridSettings.showRowLines = newValue;
|
|
79
|
+
triggerUIUpdate(SDKUI_Localizator.ShowRowSeparatingLines, newValue ? 'Attivo' : 'Non attivo');
|
|
80
|
+
} }), _jsx(TMCheckBox, { label: SDKUI_Localizator.ShowColumnSeparatingLines, value: SDKUI_Globals.userSettings.themeSettings.gridSettings.showColumnLines, onValueChanged: (newValue) => {
|
|
81
|
+
SDKUI_Globals.userSettings.themeSettings.gridSettings.showColumnLines = newValue;
|
|
82
|
+
triggerUIUpdate(SDKUI_Localizator.ShowColumnSeparatingLines, newValue ? 'Attivo' : 'Non attivo');
|
|
83
|
+
} }), _jsx(TMCheckBox, { label: SDKUI_Localizator.UseNativeScrollbar, value: SDKUI_Globals.userSettings.themeSettings.gridSettings.useNativeScrollbar, onValueChanged: (newValue) => {
|
|
84
|
+
SDKUI_Globals.userSettings.themeSettings.gridSettings.useNativeScrollbar = newValue;
|
|
85
|
+
triggerUIUpdate(SDKUI_Localizator.UseNativeScrollbar, newValue ? 'Attivo' : 'Non attivo');
|
|
86
|
+
} })] })] }), landingPagesOptions && (_jsxs("div", { style: {
|
|
87
|
+
backgroundColor: "rgba(var(--warning-rgb, 255, 152, 0), 0.04)",
|
|
88
|
+
borderLeft: "3px solid var(--warning-color, #ff9800)",
|
|
89
|
+
borderRadius: "4px",
|
|
90
|
+
padding: "10px 12px"
|
|
91
|
+
}, children: [_jsxs("div", { style: {
|
|
92
|
+
display: "flex",
|
|
93
|
+
alignItems: "center",
|
|
94
|
+
gap: "6px",
|
|
95
|
+
marginBottom: "8px"
|
|
96
|
+
}, children: [_jsx("i", { className: "dx-icon-home", style: { fontSize: "1.1rem", color: "var(--warning-color, #ff9800)" } }), _jsx("p", { style: { fontSize: '1.05rem', fontWeight: '600', margin: 0, color: "var(--text-primary, #333)" }, children: SDKUI_Localizator.LandingPage })] }), _jsx(TMDropDown, { dataSource: filteredLandingPageOptopns, value: SDKUI_Globals.userSettings.landingPage, width: '100%', onValueChanged: (e) => {
|
|
97
|
+
const selectedOption = filteredLandingPageOptopns.find(opt => opt.value === e.target.value);
|
|
98
|
+
SDKUI_Globals.userSettings.landingPage = e.target.value;
|
|
99
|
+
triggerUIUpdate(SDKUI_Localizator.LandingPage, selectedOption?.display || e.target.value);
|
|
100
|
+
} })] }))] }), _jsxs("div", { style: { borderTop: "1px solid #e0e0e0", flexShrink: 0, paddingTop: "5px", display: "flex", flexDirection: "column", alignItems: "flex-end" }, children: [_jsx(TMButton, { elementStyle: { marginTop: '0px' }, caption: SDKUI_Localizator.Restore, showTooltip: false, onClick: () => {
|
|
101
|
+
SDKUI_Globals.userSettings.themeSettings = new ThemeSettings();
|
|
102
|
+
SDKUI_Globals.userSettings.landingPage = LandingPages.DASHBOARD;
|
|
103
|
+
triggerUIUpdate(SDKUI_Localizator.Restore, 'Impostazioni predefinite', true);
|
|
104
|
+
} }), showSavedBadge && (_jsxs("div", { style: {
|
|
105
|
+
marginTop: "5px",
|
|
106
|
+
backgroundColor: "#4caf50",
|
|
107
|
+
color: "white",
|
|
108
|
+
padding: "7px 12px",
|
|
109
|
+
fontSize: "0.95rem",
|
|
110
|
+
borderRadius: "4px",
|
|
111
|
+
boxShadow: "0 2px 8px rgba(0,0,0,0.15)",
|
|
112
|
+
display: "flex",
|
|
113
|
+
alignItems: "center",
|
|
114
|
+
gap: "10px",
|
|
115
|
+
width: "100%",
|
|
116
|
+
maxWidth: "350px",
|
|
117
|
+
boxSizing: "border-box"
|
|
118
|
+
}, children: [_jsx("i", { className: "dx-icon-save", style: { fontSize: "1rem", flexShrink: 0 } }), _jsx("div", { style: {
|
|
119
|
+
flex: 1,
|
|
120
|
+
minWidth: 0,
|
|
121
|
+
overflow: "hidden"
|
|
122
|
+
}, children: _jsxs("div", { style: {
|
|
123
|
+
display: "inline-flex",
|
|
124
|
+
alignItems: "center",
|
|
125
|
+
gap: "5px",
|
|
126
|
+
whiteSpace: "nowrap",
|
|
127
|
+
overflow: "hidden",
|
|
128
|
+
textOverflow: "ellipsis"
|
|
129
|
+
}, children: [_jsx("span", { children: SDKUI_Localizator.SettingSavedSuccessfully }), _jsx(TMTooltip, { content: `${lastChanged.label}: ${lastChanged.value}`, children: _jsx("i", { className: "dx-icon-info" }) })] }) }), _jsx("i", { className: "dx-icon-close", style: {
|
|
130
|
+
fontSize: "0.9rem",
|
|
131
|
+
flexShrink: 0,
|
|
132
|
+
cursor: "pointer",
|
|
133
|
+
opacity: 0.8
|
|
134
|
+
}, onClick: closeBadge })] }))] })] }));
|
|
72
135
|
};
|
|
73
136
|
export default SettingsAppearance;
|
|
@@ -98,6 +98,8 @@ export class SearchSettings {
|
|
|
98
98
|
this.mruTIDs = [];
|
|
99
99
|
this.defaultTree = -1;
|
|
100
100
|
this.previewThreshold = 500; // KB
|
|
101
|
+
this.pageSize = 100;
|
|
102
|
+
this.maxDcmtsToBeReturned = 200;
|
|
101
103
|
this.floatingMenuBar = new FloatingMenuBarSettings();
|
|
102
104
|
this.panelLayout = {};
|
|
103
105
|
}
|
|
@@ -435,6 +435,7 @@ export declare class SDKUI_Localizator {
|
|
|
435
435
|
static get NoSource(): "Keine Quelle" | "No Source" | "Ninguna fuente" | "Aucune source" | "Nenhuma fonte" | "Nessun Origine";
|
|
436
436
|
static get NoneSelection(): "Keine Auswahl" | "No selection" | "Ninguna selección" | "Pas de sélections" | "Nenhuma seleção" | "Nessuna selezione";
|
|
437
437
|
static get NotAvailable(): string;
|
|
438
|
+
static get MaximumNumberOfResults(): string;
|
|
438
439
|
static get OfSystem(): "Des Systems" | "Of system" | "Del sistema" | "Du système" | "Do sistema" | "Di sistema";
|
|
439
440
|
static get OldPassword(): "Altes Kennwort" | "Old password" | "Contraseña anterior" | "Ancien mot de passe" | "Senha Antiga" | "Password vecchia";
|
|
440
441
|
static get OpenedDocument(): "Dokument geöffnet" | "Document opened" | "Documento abierto" | "Document ouvert" | "Documento aberto" | "Documento aperto";
|
|
@@ -554,6 +555,7 @@ export declare class SDKUI_Localizator {
|
|
|
554
555
|
static get Restore(): "Wiederherstellen" | "Restore" | "Restablecer" | "Restaure" | "Restauração" | "Ripristina";
|
|
555
556
|
static get RestoreComment(): "Kommentar wiederherstellen?" | "Restore the comment?" | "¿Restaurar el comentario?" | "Restaurer le commentaire ?" | "Restaurar o comentário?" | "Ripristinare il commento?";
|
|
556
557
|
static get ResultDetails(): string;
|
|
558
|
+
static get ResultsPerPage(): string;
|
|
557
559
|
static get RetrieveFile(): "Dateiwiederherstellung" | "Retrieve file" | "Recuperación archivos" | "Récupération fichier" | "Arquivos de recuperação" | "Recupero file";
|
|
558
560
|
static get Rows(): "Linien" | "rows" | "líneas" | "lignes" | "linhas" | "righe";
|
|
559
561
|
static get Save(): "Speichern" | "Save" | "Guardar" | "Enregistre" | "Salvar" | "Salva";
|
|
@@ -590,6 +592,7 @@ export declare class SDKUI_Localizator {
|
|
|
590
592
|
static get SetAsFavorite(): "Als Favorit festlegen" | "Set as favorite" | "Establecer como favorito" | "Définir comme favori" | "Definir como favorito" | "Imposta come preferito";
|
|
591
593
|
static get SetNamedCredentialsAsPreferred(): "Möchten Sie die Anmeldedaten '{{0}}' als bevorzugt festlegen?" | "Do you want to set the '{{0}}' credentials as preferred?" | "¿Quieres configurar las credenciales '{{0}}' como preferidas?" | "Voulez-vous définir les identifiants '{{0}}' comme préférés ?" | "Deseja definir as credenciais '{{0}}' como preferidas?" | "Vuoi impostare le credenziali '{{0}}' come preferite?";
|
|
592
594
|
static get Settings(): "Einstellungen" | "Settings" | "Ajustes" | "Réglages" | "Definições" | "Impostazioni";
|
|
595
|
+
static get SettingSavedSuccessfully(): string;
|
|
593
596
|
static get Severity(): "Schweregrad" | "Severity" | "Gravedad" | "Gravité" | "Gravidade" | "Gravità";
|
|
594
597
|
static get Share(): string;
|
|
595
598
|
static get ShareNew(): string;
|
|
@@ -4308,6 +4308,16 @@ export class SDKUI_Localizator {
|
|
|
4308
4308
|
default: return "Non disponibile";
|
|
4309
4309
|
}
|
|
4310
4310
|
}
|
|
4311
|
+
static get MaximumNumberOfResults() {
|
|
4312
|
+
switch (this._cultureID) {
|
|
4313
|
+
case CultureIDs.De_DE: return "Maximale Anzahl von Ergebnissen";
|
|
4314
|
+
case CultureIDs.En_US: return "Maximum number of results";
|
|
4315
|
+
case CultureIDs.Es_ES: return "Número máximo de resultados";
|
|
4316
|
+
case CultureIDs.Fr_FR: return "Nombre maximum de résultats";
|
|
4317
|
+
case CultureIDs.Pt_PT: return "Número máximo de resultados";
|
|
4318
|
+
default: return "Numero massimo di risultati";
|
|
4319
|
+
}
|
|
4320
|
+
}
|
|
4311
4321
|
static get OfSystem() {
|
|
4312
4322
|
switch (this._cultureID) {
|
|
4313
4323
|
case CultureIDs.De_DE: return "Des Systems";
|
|
@@ -5511,6 +5521,16 @@ export class SDKUI_Localizator {
|
|
|
5511
5521
|
default: return "Dettagli del risultato";
|
|
5512
5522
|
}
|
|
5513
5523
|
}
|
|
5524
|
+
static get ResultsPerPage() {
|
|
5525
|
+
switch (this._cultureID) {
|
|
5526
|
+
case CultureIDs.De_DE: return "Ergebnisse pro Seite";
|
|
5527
|
+
case CultureIDs.En_US: return "Results per page";
|
|
5528
|
+
case CultureIDs.Es_ES: return "Resultados por página";
|
|
5529
|
+
case CultureIDs.Fr_FR: return "Résultats par page";
|
|
5530
|
+
case CultureIDs.Pt_PT: return "Resultados por página";
|
|
5531
|
+
default: return "Risultati per pagina";
|
|
5532
|
+
}
|
|
5533
|
+
}
|
|
5514
5534
|
static get RetrieveFile() {
|
|
5515
5535
|
switch (this._cultureID) {
|
|
5516
5536
|
case CultureIDs.De_DE: return "Dateiwiederherstellung";
|
|
@@ -5872,6 +5892,16 @@ export class SDKUI_Localizator {
|
|
|
5872
5892
|
default: return "Impostazioni";
|
|
5873
5893
|
}
|
|
5874
5894
|
}
|
|
5895
|
+
static get SettingSavedSuccessfully() {
|
|
5896
|
+
switch (this._cultureID) {
|
|
5897
|
+
case CultureIDs.De_DE: return "Einstellung erfolgreich gespeichert";
|
|
5898
|
+
case CultureIDs.En_US: return "Setting saved successfully";
|
|
5899
|
+
case CultureIDs.Es_ES: return "Configuración guardada con éxito";
|
|
5900
|
+
case CultureIDs.Fr_FR: return "Paramètre enregistré avec succès";
|
|
5901
|
+
case CultureIDs.Pt_PT: return "Configuração salva com sucesso";
|
|
5902
|
+
default: return "Impostazione salvata con successo";
|
|
5903
|
+
}
|
|
5904
|
+
}
|
|
5875
5905
|
static get Severity() {
|
|
5876
5906
|
switch (this._cultureID) {
|
|
5877
5907
|
case CultureIDs.De_DE: return "Schweregrad";
|
|
@@ -12,7 +12,7 @@ export declare const addHiddenSelectItem: (select: SelectItem[], tid: number | u
|
|
|
12
12
|
export declare const prepareQdForSearchAsync: (qdInput?: QueryDescriptor, removeWhereItemNoValue?: boolean) => Promise<QueryDescriptor>;
|
|
13
13
|
export declare function addWhereClausesForConnect(qd: QueryDescriptor): void;
|
|
14
14
|
export declare function getDefaultOperator(dataDomain: MetadataDataDomains | undefined, dataType: MetadataDataTypes | undefined): QueryOperators.Equal | QueryOperators.Contain | QueryOperators.In;
|
|
15
|
-
export declare const getQD: (tid: number | undefined, easyOr: boolean) => Promise<QueryDescriptor | undefined>;
|
|
15
|
+
export declare const getQD: (tid: number | undefined, easyOr: boolean, newMaxDcmtsToBeReturned: number) => Promise<QueryDescriptor | undefined>;
|
|
16
16
|
export declare const getWorkItemSetIDAsync: (vid: number, did: number) => Promise<string | undefined>;
|
|
17
17
|
export declare const getSysAllDcmtsSQD: (tid: number | undefined, easyOr: boolean) => Promise<SavedQueryDescriptor>;
|
|
18
18
|
export declare const searchResultToMetadataValues: (tid: number | undefined, dtd: DataTableDescriptor | undefined, rows: string[], mids: number[], metadata: MetadataDescriptor[], layoutMode: LayoutModes) => MetadataValueDescriptorEx[];
|
|
@@ -3,6 +3,7 @@ import { DateDisplayTypes, Globalization } from './Globalization';
|
|
|
3
3
|
import { ChronologyMIDs, DraftsMIDs, MetadataValueDescriptorEx } from '../ts';
|
|
4
4
|
import { SDKUI_Localizator } from './SDKUI_Localizator';
|
|
5
5
|
import { getDcmtCicoInfo } from './checkinCheckoutManager';
|
|
6
|
+
import { SDKUI_Globals } from './SDKUI_Globals';
|
|
6
7
|
export const getTIDsByQd = (qd) => {
|
|
7
8
|
let tids = [];
|
|
8
9
|
qd?.from?.tid && tids.push({ tid: qd.from?.tid, alias: undefined });
|
|
@@ -181,14 +182,14 @@ export function getDefaultOperator(dataDomain, dataType) {
|
|
|
181
182
|
return QueryOperators.In;
|
|
182
183
|
return dataType == MetadataDataTypes.Varchar ? QueryOperators.Contain : QueryOperators.Equal;
|
|
183
184
|
}
|
|
184
|
-
export const getQD = async (tid, easyOr) => {
|
|
185
|
+
export const getQD = async (tid, easyOr, newMaxDcmtsToBeReturned) => {
|
|
185
186
|
let dtd = await DcmtTypeListCacheService.GetAsync(tid);
|
|
186
187
|
if (!dtd?.metadata)
|
|
187
188
|
return;
|
|
188
189
|
let qd = SearchEngine.NewQueryDescriptor();
|
|
189
190
|
qd.isDistinct = false;
|
|
190
191
|
qd.id = 1;
|
|
191
|
-
qd.maxDcmtsToBeReturned =
|
|
192
|
+
qd.maxDcmtsToBeReturned = newMaxDcmtsToBeReturned;
|
|
192
193
|
qd.from = new FromItem();
|
|
193
194
|
qd.from.tid = tid;
|
|
194
195
|
qd.select = [];
|
|
@@ -256,7 +257,7 @@ export const getSysAllDcmtsSQD = async (tid, easyOr) => {
|
|
|
256
257
|
sqd.masterTID = tid;
|
|
257
258
|
sqd.isEasyWhere = 1;
|
|
258
259
|
sqd.name = SDKUI_Localizator.AllDcmts;
|
|
259
|
-
sqd.qd = await getQD(tid, easyOr);
|
|
260
|
+
sqd.qd = await getQD(tid, easyOr, SDKUI_Globals.userSettings.searchSettings?.maxDcmtsToBeReturned ?? 1000);
|
|
260
261
|
return sqd;
|
|
261
262
|
};
|
|
262
263
|
export const searchResultToMetadataValues = (tid, dtd, rows, mids, metadata, layoutMode) => {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface SettingsFeedback {
|
|
2
|
+
showSavedBadge: boolean;
|
|
3
|
+
lastChanged: {
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
};
|
|
7
|
+
isWarning: boolean;
|
|
8
|
+
triggerUIUpdate: (label: string, value: any, warning?: boolean) => void;
|
|
9
|
+
closeBadge: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const useSettingsFeedback: () => SettingsFeedback;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { useState, useRef } from 'react';
|
|
2
|
+
export const useSettingsFeedback = () => {
|
|
3
|
+
const [, setForceUpdate] = useState(0);
|
|
4
|
+
const [showSavedBadge, setShowSavedBadge] = useState(false);
|
|
5
|
+
const [lastChanged, setLastChanged] = useState({
|
|
6
|
+
label: '',
|
|
7
|
+
value: ''
|
|
8
|
+
});
|
|
9
|
+
const [isWarning, setIsWarning] = useState(false);
|
|
10
|
+
const timeoutRef = useRef(null);
|
|
11
|
+
const triggerUIUpdate = (label, value, warning = false) => {
|
|
12
|
+
setForceUpdate((prev) => prev + 1);
|
|
13
|
+
setShowSavedBadge(true);
|
|
14
|
+
setLastChanged({ label, value: String(value) });
|
|
15
|
+
setIsWarning(warning);
|
|
16
|
+
if (timeoutRef.current) {
|
|
17
|
+
clearTimeout(timeoutRef.current);
|
|
18
|
+
}
|
|
19
|
+
timeoutRef.current = setTimeout(() => {
|
|
20
|
+
setShowSavedBadge(false);
|
|
21
|
+
timeoutRef.current = null;
|
|
22
|
+
}, 4000);
|
|
23
|
+
};
|
|
24
|
+
const closeBadge = () => {
|
|
25
|
+
setShowSavedBadge(false);
|
|
26
|
+
if (timeoutRef.current) {
|
|
27
|
+
clearTimeout(timeoutRef.current);
|
|
28
|
+
timeoutRef.current = null;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
return {
|
|
32
|
+
showSavedBadge,
|
|
33
|
+
lastChanged,
|
|
34
|
+
isWarning,
|
|
35
|
+
triggerUIUpdate,
|
|
36
|
+
closeBadge
|
|
37
|
+
};
|
|
38
|
+
};
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -9,6 +9,7 @@ export * from './hooks/useDcmtOperations';
|
|
|
9
9
|
export * from './hooks/useResizeObserver';
|
|
10
10
|
export * from './hooks/useWorkflowApprove';
|
|
11
11
|
export * from './hooks/useRelatedDocuments';
|
|
12
|
+
export * from './hooks/useSettingsFeedback';
|
|
12
13
|
export * from './services';
|
|
13
14
|
import config from 'devextreme/core/config';
|
|
14
15
|
// DevExtreme License Key (valid for v25.1 and earlier versions)
|
package/lib/utils/theme.d.ts
CHANGED
package/lib/utils/theme.js
CHANGED