@rh-support/manage 1.0.32 → 1.0.34
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/esm/components/Groups/ManageGroupUsers/ManageGroupUsers.d.ts.map +1 -1
- package/lib/esm/components/Groups/ManageGroupUsers/ManageGroupUsers.js +9 -0
- package/lib/esm/components/ManagePreferences/sections/PreferencesCaseCreate.d.ts.map +1 -1
- package/lib/esm/components/ManagePreferences/sections/PreferencesCaseCreate.js +33 -24
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManageGroupUsers.d.ts","sourceRoot":"","sources":["../../../../../src/components/Groups/ManageGroupUsers/ManageGroupUsers.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ManageGroupUsers.d.ts","sourceRoot":"","sources":["../../../../../src/components/Groups/ManageGroupUsers/ManageGroupUsers.tsx"],"names":[],"mappings":"AAuBA,eAAO,MAAM,gBAAgB,mBA6M5B,CAAC"}
|
|
@@ -14,12 +14,14 @@ import { useGlobalStateContext } from '@rh-support/react-context';
|
|
|
14
14
|
import isEmpty from 'lodash/isEmpty';
|
|
15
15
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
16
16
|
import { Trans, useTranslation } from 'react-i18next';
|
|
17
|
+
import { useLocation } from 'react-router-dom';
|
|
17
18
|
import { ManageTable } from '../../ManageTable/ManageTable';
|
|
18
19
|
import { DefaultGroupSwitch } from '../DefualtGroupSwitch';
|
|
19
20
|
import { GroupSelect } from '../GroupSelect';
|
|
20
21
|
import { GroupUserPermissionsSelect } from '../GroupUserPermissionsSelect';
|
|
21
22
|
export const ManageGroupUsers = () => {
|
|
22
23
|
const { t } = useTranslation();
|
|
24
|
+
const location = useLocation();
|
|
23
25
|
const { globalMetadataState: { loggedInUsersAccount, loggedInUserRights }, } = useGlobalStateContext();
|
|
24
26
|
const disableGroupSelect = !loggedInUsersAccount || !loggedInUsersAccount.data || !loggedInUsersAccount.data.accountNumber;
|
|
25
27
|
const [selectedGroup, setSelectedGroup] = useState();
|
|
@@ -120,6 +122,13 @@ export const ManageGroupUsers = () => {
|
|
|
120
122
|
setData(initialData);
|
|
121
123
|
}
|
|
122
124
|
}, [initialData, userSearch, setData, previousUserSearch, groupUsers]);
|
|
125
|
+
useEffect(() => {
|
|
126
|
+
if (location.pathname !== '/manage/groups') {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
setAllData(response || []);
|
|
130
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
131
|
+
}, [location.pathname]);
|
|
123
132
|
return (React.createElement("section", { id: "manage-groups" },
|
|
124
133
|
React.createElement(AlertMessage, { variant: AlertType.INFO, show: loggedInUserRights.data.isOrgAdmin() && !loggedInUsersAccount.data.hasGroupACLs, isInline: true, className: "pf-u-mb-md" },
|
|
125
134
|
React.createElement(React.Fragment, null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreferencesCaseCreate.d.ts","sourceRoot":"","sources":["../../../../../src/components/ManagePreferences/sections/PreferencesCaseCreate.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PreferencesCaseCreate.d.ts","sourceRoot":"","sources":["../../../../../src/components/ManagePreferences/sections/PreferencesCaseCreate.tsx"],"names":[],"mappings":"AAoBA,UAAU,MAAM;CAAG;AACnB,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,eAwLlD"}
|
|
@@ -16,10 +16,12 @@ import isEmpty from 'lodash/isEmpty';
|
|
|
16
16
|
import map from 'lodash/map';
|
|
17
17
|
import React, { useContext, useEffect, useState } from 'react';
|
|
18
18
|
import { Trans, useTranslation } from 'react-i18next';
|
|
19
|
+
import { useLocation } from 'react-router-dom';
|
|
19
20
|
import { useUserPreferences } from '../../../hooks/useUserPreferences';
|
|
20
21
|
import { PreferenceSelect } from '../components/PreferenceSelect';
|
|
21
22
|
export function PreferencesCaseCreate(props) {
|
|
22
23
|
const { t } = useTranslation();
|
|
24
|
+
const location = useLocation();
|
|
23
25
|
const { globalMetadataState: { caseGroups, caseLanguages, loggedInUserJwtToken, loggedInUserRights, loggedInUsersAccount, }, } = useContext(GlobalMetadataStateContext);
|
|
24
26
|
const dispatchToGlobalMetadataReducer = useContext(GlobalMetadataDispatchContext);
|
|
25
27
|
const languageConst = caseLanguages.data;
|
|
@@ -29,26 +31,22 @@ export function PreferencesCaseCreate(props) {
|
|
|
29
31
|
const toggleDefaultGroupFetch = useFetch(publicApi.caseGroups.toggleDefaultGroup, {
|
|
30
32
|
propgateErrors: true,
|
|
31
33
|
});
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
setOriginalDefaultGroup(filteredDefaultGroup[0].name);
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
setOriginalDefaultGroup('Ungrouped Case');
|
|
43
|
-
}
|
|
34
|
+
const grabDefaultGroupList = (ssoUser) => __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
try {
|
|
36
|
+
let list = yield getDefaultGroupFetch.request(ssoUser);
|
|
37
|
+
setUserDefaultGroupList(list);
|
|
38
|
+
let filteredDefaultGroup = (list ? list : []).filter((group) => group.isDefault === true);
|
|
39
|
+
if (!isEmpty(filteredDefaultGroup)) {
|
|
40
|
+
setOriginalDefaultGroup(filteredDefaultGroup[0].name);
|
|
44
41
|
}
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
else {
|
|
43
|
+
setOriginalDefaultGroup('Ungrouped Case');
|
|
47
44
|
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
console.log(error);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
52
50
|
const updateDefaultGroupPref = (groupNum) => __awaiter(this, void 0, void 0, function* () {
|
|
53
51
|
try {
|
|
54
52
|
yield toggleDefaultGroupFetch.request(groupNum, loggedInUserRights.data.getSSOUsername(), true, loggedInUsersAccount.data.secureSupport);
|
|
@@ -57,12 +55,6 @@ export function PreferencesCaseCreate(props) {
|
|
|
57
55
|
console.log(error);
|
|
58
56
|
}
|
|
59
57
|
});
|
|
60
|
-
useEffect(() => {
|
|
61
|
-
if (haventLoadedMetadata(caseLanguages)) {
|
|
62
|
-
fetchLanguageMetadata(dispatchToGlobalMetadataReducer);
|
|
63
|
-
}
|
|
64
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
65
|
-
}, [caseLanguages]);
|
|
66
58
|
const languagesList = map(languageConst, (cl) => ({
|
|
67
59
|
label: PreferredLanguages.languagesMap[cl] || cl,
|
|
68
60
|
value: cl,
|
|
@@ -121,6 +113,23 @@ export function PreferencesCaseCreate(props) {
|
|
|
121
113
|
userOriginalPreferredLanguage();
|
|
122
114
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
123
115
|
}, [caseLanguages, caseGroups, dispatchToGlobalMetadataReducer, loggedInUserJwtToken]);
|
|
116
|
+
useEffect(() => {
|
|
117
|
+
grabDefaultGroupList(loggedInUserRights.data.getSSOUsername());
|
|
118
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
119
|
+
}, [loggedInUserRights, caseGroups]);
|
|
120
|
+
useEffect(() => {
|
|
121
|
+
if (location.pathname !== '/manage/preferences') {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
grabDefaultGroupList(loggedInUserRights.data.getSSOUsername());
|
|
125
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
126
|
+
}, [location.pathname]);
|
|
127
|
+
useEffect(() => {
|
|
128
|
+
if (haventLoadedMetadata(caseLanguages)) {
|
|
129
|
+
fetchLanguageMetadata(dispatchToGlobalMetadataReducer);
|
|
130
|
+
}
|
|
131
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
132
|
+
}, [caseLanguages]);
|
|
124
133
|
return (React.createElement(Card, { className: "preference-card" },
|
|
125
134
|
React.createElement(CardHeader, null,
|
|
126
135
|
React.createElement("h3", null,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/manage",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.34",
|
|
4
4
|
"description": "Customer Support Manage App",
|
|
5
5
|
"author": "Jordan Eudy <jeudy100@gmail.com>",
|
|
6
6
|
"homepage": "",
|
|
@@ -94,9 +94,9 @@
|
|
|
94
94
|
"@patternfly/pfe-tabs": "1.12.3",
|
|
95
95
|
"@patternfly/react-core": "4.264.0",
|
|
96
96
|
"@patternfly/react-table": "4.111.33",
|
|
97
|
-
"@rh-support/components": "1.2.
|
|
98
|
-
"@rh-support/configs": "1.0.
|
|
99
|
-
"@rh-support/react-context": "1.0.
|
|
97
|
+
"@rh-support/components": "1.2.18",
|
|
98
|
+
"@rh-support/configs": "1.0.1",
|
|
99
|
+
"@rh-support/react-context": "1.0.25",
|
|
100
100
|
"@rh-support/types": "0.2.0",
|
|
101
101
|
"@rh-support/user-permissions": "1.0.11",
|
|
102
102
|
"@rh-support/utils": "1.0.9",
|
|
@@ -109,5 +109,5 @@
|
|
|
109
109
|
"react-i18next": ">=10.11.0",
|
|
110
110
|
"react-router-dom": ">=5.1.2"
|
|
111
111
|
},
|
|
112
|
-
"gitHead": "
|
|
112
|
+
"gitHead": "67c86ae65999c9e8d868a567bcd70f8d7401d386"
|
|
113
113
|
}
|