@rh-support/troubleshoot 0.2.132 → 0.2.133

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.
@@ -34,7 +34,7 @@ export function CaseOpenshiftClusterId() {
34
34
  description: state.caseDetails.description,
35
35
  }), isEqual);
36
36
  const caseDispatch = useCaseDispatch();
37
- const { globalMetadataState: { pcmConfig, allProducts, loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
37
+ const { globalMetadataState: { allProducts, loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
38
38
  const majorVersion = (version && getVersion(version).major) || '';
39
39
  const isOpenShiftV3 = majorVersion === '3';
40
40
  const isCustomer = loggedInUserRights.data.isAccountSameAsLoggedInAccount(selectedAccountDetails.data.accountNumber);
@@ -85,7 +85,7 @@ export function CaseOpenshiftClusterId() {
85
85
  isClusterVisible();
86
86
  }
87
87
  // eslint-disable-next-line react-hooks/exhaustive-deps
88
- }, [product, version, pcmConfig, allProducts.data]);
88
+ }, [product, version]);
89
89
  // user may change product and version we need to reset internal state
90
90
  // context api state will be reset on parent component each time user changes product and version
91
91
  useEffect(() => {
@@ -1 +1 @@
1
- {"version":3,"file":"CaseGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/CaseGroup.tsx"],"names":[],"mappings":"AAiBA,UAAU,MAAM;CAAG;AAInB,iBAAS,SAAS,CAAC,KAAK,EAAE,MAAM,eAsN/B;AAED,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"CaseGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/CaseGroup.tsx"],"names":[],"mappings":"AAiBA,UAAU,MAAM;CAAG;AAInB,iBAAS,SAAS,CAAC,KAAK,EAAE,MAAM,eA0N/B;AAED,eAAe,SAAS,CAAC"}
@@ -38,30 +38,31 @@ function CaseGroup(props) {
38
38
  const canEditCase = useCanEditCase();
39
39
  const { globalMetadataState: { loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
40
40
  const { getDefaultGroup } = useUserPreferences();
41
- const userPreferredFilter = () => __awaiter(this, void 0, void 0, function* () {
42
- const fetchedDefaultGroupKey = yield getDefaultGroup();
43
- const groupObj = ownersCaseGroups.data
44
- ? ownersCaseGroups.data.map((group) => ({ value: group.name, key: group.groupNum }))
45
- : [];
46
- if (!isEmpty(groupObj)) {
47
- const preferredGroupObj = groupObj.find((group) => group.key === fetchedDefaultGroupKey);
48
- if (preferredGroupObj === null || preferredGroupObj === void 0 ? void 0 : preferredGroupObj.value) {
49
- const parsedFetchedDefaultGroup = {
50
- groupNum: preferredGroupObj.key,
51
- name: preferredGroupObj.value,
52
- isPrivate: false,
53
- isDefault: false,
54
- defaultMembers: [],
55
- members: [],
56
- };
57
- onCaseGroupChange(toOption(parsedFetchedDefaultGroup, { labelKey: 'name' }));
58
- }
59
- }
60
- });
41
+ // when user opens a case, sets group to the default group saved in preferences
61
42
  useEffect(() => {
62
- userPreferredFilter();
43
+ const userPreferredFilter = () => __awaiter(this, void 0, void 0, function* () {
44
+ const fetchedDefaultGroupKey = yield getDefaultGroup();
45
+ const groupObj = ownersCaseGroups.data
46
+ ? ownersCaseGroups.data.map((group) => ({ value: group.name, key: group.groupNum }))
47
+ : [];
48
+ if (!isEmpty(groupObj)) {
49
+ const preferredGroupObj = groupObj.find((group) => group.key === fetchedDefaultGroupKey);
50
+ if (preferredGroupObj === null || preferredGroupObj === void 0 ? void 0 : preferredGroupObj.value) {
51
+ const parsedFetchedDefaultGroup = {
52
+ groupNum: preferredGroupObj.key,
53
+ name: preferredGroupObj.value,
54
+ isPrivate: false,
55
+ isDefault: false,
56
+ defaultMembers: [],
57
+ members: [],
58
+ };
59
+ onCaseGroupChange(toOption(parsedFetchedDefaultGroup, { labelKey: 'name' }));
60
+ }
61
+ }
62
+ });
63
+ isEmpty(caseNumber) && userPreferredFilter();
63
64
  // eslint-disable-next-line react-hooks/exhaustive-deps
64
- }, [ownersCaseGroups.data]);
65
+ }, [ownersCaseGroups.data, caseNumber]);
65
66
  // value changed logic to show a non local group change
66
67
  const [localGroupChange, setLocalGroupChange] = useState(false);
67
68
  const afterGroupLocalChange = () => setLocalGroupChange(false);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "0.2.132",
3
+ "version": "0.2.133",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -143,5 +143,5 @@
143
143
  "not ie <= 11",
144
144
  "not op_mini all"
145
145
  ],
146
- "gitHead": "33e34e81bbe7407a38cbbca6fa03125bad491706"
146
+ "gitHead": "c049feffba16feb4ef0758eac9934b995b108341"
147
147
  }