@rh-support/manage 2.1.112 → 2.1.113
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/GroupSelect/GroupSelect.d.ts.map +1 -1
- package/lib/esm/components/Groups/GroupSelect/GroupSelect.js +8 -3
- package/lib/esm/components/ManagePreferences/sections/PreferencesCaseCreate.d.ts.map +1 -1
- package/lib/esm/components/ManagePreferences/sections/PreferencesCaseCreate.js +11 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupSelect.d.ts","sourceRoot":"","sources":["../../../../../src/components/Groups/GroupSelect/GroupSelect.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AA4B3E,OAAO,KAAmD,MAAM,OAAO,CAAC;AAKxE,UAAU,MAAM;IACZ,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,KAAK,IAAI,CAAC;CAChD;AAKD,eAAO,MAAM,WAAW,UAAW,MAAM,
|
|
1
|
+
{"version":3,"file":"GroupSelect.d.ts","sourceRoot":"","sources":["../../../../../src/components/Groups/GroupSelect/GroupSelect.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AA4B3E,OAAO,KAAmD,MAAM,OAAO,CAAC;AAKxE,UAAU,MAAM;IACZ,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,KAAK,IAAI,CAAC;CAChD;AAKD,eAAO,MAAM,WAAW,UAAW,MAAM,sBAycxC,CAAC"}
|
|
@@ -36,13 +36,18 @@ export const GroupSelect = (props) => {
|
|
|
36
36
|
const confirmation = useConfirmation();
|
|
37
37
|
// Fetch groups on init
|
|
38
38
|
useEffect(() => {
|
|
39
|
-
var _a;
|
|
39
|
+
var _a, _b;
|
|
40
40
|
if (haventLoadedMetadata(caseGroups, (data) => data === undefined))
|
|
41
41
|
fetchCaseGroupsForSSO(dispatch, loggedInUserJwtToken.username);
|
|
42
42
|
if (isEmpty(selectedGroup) && !isEmpty(caseGroups) && ((_a = caseGroups === null || caseGroups === void 0 ? void 0 : caseGroups.data) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
43
43
|
const defaultCaseGroup = find(caseGroups === null || caseGroups === void 0 ? void 0 : caseGroups.data, (g) => g.isDefault);
|
|
44
|
-
const
|
|
45
|
-
|
|
44
|
+
const newSelectedGroup = (defaultCaseGroup === null || defaultCaseGroup === void 0 ? void 0 : defaultCaseGroup.groupNum) === '-1'
|
|
45
|
+
? null
|
|
46
|
+
: (defaultCaseGroup === null || defaultCaseGroup === void 0 ? void 0 : defaultCaseGroup.name) ||
|
|
47
|
+
(((_b = caseGroups.data[0]) === null || _b === void 0 ? void 0 : _b.groupNum) !== '-1' ? caseGroups.data[0].name : null);
|
|
48
|
+
if (newSelectedGroup !== selectedGroup) {
|
|
49
|
+
setSelectedGroup(newSelectedGroup);
|
|
50
|
+
}
|
|
46
51
|
}
|
|
47
52
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
48
53
|
}, [dispatch, loggedInUserJwtToken, caseGroups]);
|
|
@@ -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":"AAeA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAO/D,UAAU,MAAM;CAAG;AACnB,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,qBA0MlD"}
|
|
@@ -11,7 +11,7 @@ import { publicApi } from '@cee-eng/hydrajs';
|
|
|
11
11
|
import { Card, CardBody, CardHeader } from '@patternfly/react-core';
|
|
12
12
|
import { SelectOption } from '@patternfly/react-core/deprecated';
|
|
13
13
|
import { ToastNotification, useFetch } from '@rh-support/components';
|
|
14
|
-
import { fetchLanguageMetadata, GlobalMetadataDispatchContext, GlobalMetadataStateContext, } from '@rh-support/react-context';
|
|
14
|
+
import { fetchLanguageMetadata, GlobalMetadataDispatchContext, GlobalMetadataReducerConstants, GlobalMetadataStateContext, } from '@rh-support/react-context';
|
|
15
15
|
import { haventLoadedMetadata, PreferredLanguages } from '@rh-support/utils';
|
|
16
16
|
import isEmpty from 'lodash/isEmpty';
|
|
17
17
|
import map from 'lodash/map';
|
|
@@ -49,8 +49,18 @@ export function PreferencesCaseCreate(props) {
|
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
51
|
const updateDefaultGroupPref = (groupNum) => __awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
var _a;
|
|
52
53
|
try {
|
|
53
54
|
yield toggleDefaultGroupFetch.request(groupNum, loggedInUserRights.data.getSSOUsername(), true, loggedInUsersAccount.data.secureSupport);
|
|
55
|
+
const updatedGroups = (caseGroups.data || []).map((group) => (Object.assign(Object.assign({}, group), { isDefault: group.groupNum === groupNum })));
|
|
56
|
+
dispatchToGlobalMetadataReducer({
|
|
57
|
+
type: GlobalMetadataReducerConstants.setCaseGroups,
|
|
58
|
+
payload: {
|
|
59
|
+
caseGroups: Object.assign(Object.assign({}, caseGroups), { data: updatedGroups }),
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
setUserDefaultGroupList(updatedGroups);
|
|
63
|
+
setOriginalDefaultGroup(((_a = updatedGroups.find((g) => g.isDefault)) === null || _a === void 0 ? void 0 : _a.name) || 'Ungrouped Case');
|
|
54
64
|
}
|
|
55
65
|
catch (error) {
|
|
56
66
|
console.log(error);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/manage",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.113",
|
|
4
4
|
"description": "Customer Support Manage App",
|
|
5
5
|
"author": "Jordan Eudy <jeudy100@gmail.com>",
|
|
6
6
|
"license": "ISC",
|
|
@@ -103,5 +103,5 @@
|
|
|
103
103
|
"defaults and supports es6-module",
|
|
104
104
|
"maintained node versions"
|
|
105
105
|
],
|
|
106
|
-
"gitHead": "
|
|
106
|
+
"gitHead": "66526673b8a34858094195171b3faec5ddd9ff82"
|
|
107
107
|
}
|