@topconsultnpm/sdkui-react 6.21.0-dev2.37 → 6.21.0-dev2.38
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.
|
@@ -16,6 +16,8 @@ interface ITMUserChooserProps extends ITMChooserProps {
|
|
|
16
16
|
initialShowChooser?: boolean;
|
|
17
17
|
/** Allow showing all users with toggle button */
|
|
18
18
|
allowShowAllUsers?: boolean;
|
|
19
|
+
/** If true, uses UserListCacheService.GetAllAdminAsync() instead of GetAllAsync() */
|
|
20
|
+
adminMode?: boolean;
|
|
19
21
|
/** Funzione per aggiornare lo stato di apertura della modale */
|
|
20
22
|
updateIsModalOpen?: (isOpen: boolean) => void;
|
|
21
23
|
}
|
|
@@ -30,6 +32,8 @@ interface ITMUserChooserFormProps extends ITMChooserFormProps<UserDescriptor> {
|
|
|
30
32
|
hideShowId?: boolean;
|
|
31
33
|
/** Allow showing all users with toggle button */
|
|
32
34
|
allowShowAllUsers?: boolean;
|
|
35
|
+
/** If true, uses UserListCacheService.GetAllAdminAsync() instead of GetAllAsync() */
|
|
36
|
+
adminMode?: boolean;
|
|
33
37
|
}
|
|
34
38
|
export declare const TMUserChooserForm: React.FunctionComponent<ITMUserChooserFormProps>;
|
|
35
39
|
export declare const TMUserIcon: ({ ud }: {
|
|
@@ -8,7 +8,7 @@ import TMSummary from '../editors/TMSummary';
|
|
|
8
8
|
import TMChooserForm from '../forms/TMChooserForm';
|
|
9
9
|
import TMButton from '../base/TMButton';
|
|
10
10
|
import TMDataUserIdItemViewer from '../viewers/TMDataUserIdItemViewer';
|
|
11
|
-
const TMUserChooser = ({ labelColor, titleForm, filter, readOnly = false, icon, width, dataSource, backgroundColor, openChooserBySingleClick, buttons = [], disabled = false, showBorder = true, hideRefresh = false, hideShowId = false, elementStyle, allowMultipleSelection, values, isModifiedWhen, label, placeHolder, validationItems = [], onValueChanged, showClearButton, initialShowChooser = false, allowShowAllUsers = false, updateIsModalOpen }) => {
|
|
11
|
+
const TMUserChooser = ({ labelColor, titleForm, filter, readOnly = false, icon, width, dataSource, backgroundColor, openChooserBySingleClick, buttons = [], disabled = false, showBorder = true, hideRefresh = false, hideShowId = false, elementStyle, allowMultipleSelection, values, isModifiedWhen, label, placeHolder, validationItems = [], onValueChanged, showClearButton, initialShowChooser = false, allowShowAllUsers = false, adminMode = false, updateIsModalOpen }) => {
|
|
12
12
|
const [showChooser, setShowChooser] = useState(initialShowChooser);
|
|
13
13
|
useEffect(() => {
|
|
14
14
|
setShowChooser(initialShowChooser);
|
|
@@ -24,14 +24,14 @@ const TMUserChooser = ({ labelColor, titleForm, filter, readOnly = false, icon,
|
|
|
24
24
|
updateIsModalOpen?.(true);
|
|
25
25
|
}
|
|
26
26
|
}, elementStyle: elementStyle, isModifiedWhen: isModifiedWhen, openEditorOnSummaryClick: openChooserBySingleClick, label: label, template: renderTemplate(), onClearClick: showClearButton ? () => { onValueChanged?.([]); } : undefined, validationItems: validationItems }), showChooser &&
|
|
27
|
-
_jsx(TMUserChooserForm, { title: titleForm, allowMultipleSelection: allowMultipleSelection, hasShowOnlySelectedItems: true, dataSource: dataSource, filter: filter, selectedIDs: values, hideRefresh: hideRefresh, hideShowId: hideShowId, allowShowAllUsers: allowShowAllUsers, onClose: () => {
|
|
27
|
+
_jsx(TMUserChooserForm, { title: titleForm, allowMultipleSelection: allowMultipleSelection, hasShowOnlySelectedItems: true, dataSource: dataSource, filter: filter, selectedIDs: values, hideRefresh: hideRefresh, hideShowId: hideShowId, allowShowAllUsers: allowShowAllUsers, adminMode: adminMode, onClose: () => {
|
|
28
28
|
setShowChooser(false);
|
|
29
29
|
summaryInputRef.current?.focus();
|
|
30
30
|
updateIsModalOpen?.(false);
|
|
31
31
|
}, onChoose: (IDs) => { onValueChanged?.(IDs); } })] }));
|
|
32
32
|
};
|
|
33
33
|
export default TMUserChooser;
|
|
34
|
-
export const TMUserChooserForm = ({ allowMultipleSelection, columns, hideRefresh = false, hideShowId = false, startWithShowOnlySelectedItems = true, filter, title, hasShowOnlySelectedItems, width, height, selectedIDs, dataSource, onClose, onChoose, allowShowAllUsers = false }) => {
|
|
34
|
+
export const TMUserChooserForm = ({ allowMultipleSelection, columns, hideRefresh = false, hideShowId = false, startWithShowOnlySelectedItems = true, filter, title, hasShowOnlySelectedItems, width, height, selectedIDs, dataSource, onClose, onChoose, allowShowAllUsers = false, adminMode = false }) => {
|
|
35
35
|
const [currentDataSource, setCurrentDataSource] = useState(dataSource);
|
|
36
36
|
const [showingAllUsers, setShowingAllUsers] = useState(false);
|
|
37
37
|
const dataColumns = useMemo(() => {
|
|
@@ -45,8 +45,10 @@ export const TMUserChooserForm = ({ allowMultipleSelection, columns, hideRefresh
|
|
|
45
45
|
const getItems = async (refreshCache) => {
|
|
46
46
|
TMSpinner.show({ description: `${SDKUI_Localizator.Loading} - ${SDK_Localizator.Users} ...` });
|
|
47
47
|
if (refreshCache)
|
|
48
|
-
UserListCacheService.RemoveAll();
|
|
49
|
-
let allUsers =
|
|
48
|
+
adminMode ? UserListCacheService.RemoveAllAdmin() : UserListCacheService.RemoveAll();
|
|
49
|
+
let allUsers = adminMode
|
|
50
|
+
? await UserListCacheService.GetAllAdminAsync()
|
|
51
|
+
: await UserListCacheService.GetAllAsync();
|
|
50
52
|
let users = filter ? allUsers?.filter(filter) : allUsers;
|
|
51
53
|
TMSpinner.hide();
|
|
52
54
|
return users;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@topconsultnpm/sdkui-react",
|
|
3
|
-
"version": "6.21.0-dev2.
|
|
3
|
+
"version": "6.21.0-dev2.38",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"lib"
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@topconsultnpm/sdk-ts": "6.21.0-dev2.
|
|
43
|
+
"@topconsultnpm/sdk-ts": "6.21.0-dev2.7",
|
|
44
44
|
"@zip.js/zip.js": "2.8.26",
|
|
45
45
|
"buffer": "^6.0.3",
|
|
46
46
|
"devextreme": "^25.2.6",
|