@rh-support/react-context 2.1.23 → 2.1.25-beta.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"HostnameAwarenessModal.d.ts","sourceRoot":"","sources":["../../../../src/components/HostnameAwarenessModal/HostnameAwarenessModal.tsx"],"names":[],"mappings":"AAAA,OAAO,8BAA8B,CAAC;AAatC,eAAO,MAAM,sBAAsB,mBAwKlC,CAAC"}
1
+ {"version":3,"file":"HostnameAwarenessModal.d.ts","sourceRoot":"","sources":["../../../../src/components/HostnameAwarenessModal/HostnameAwarenessModal.tsx"],"names":[],"mappings":"AAAA,OAAO,8BAA8B,CAAC;AActC,eAAO,MAAM,sBAAsB,mBA2KlC,CAAC"}
@@ -13,10 +13,11 @@ import { Button, Checkbox, Modal, ModalVariant, Spinner, Switch, Tooltip } from
13
13
  import InfoIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
14
14
  import { useFetch } from '@rh-support/components';
15
15
  import { ability, CaseListFields, resourceActions, resources } from '@rh-support/user-permissions';
16
- import React, { useEffect, useState } from 'react';
16
+ import React, { useContext, useEffect, useState } from 'react';
17
17
  import { Trans } from 'react-i18next';
18
- import { useGlobalStateContext } from '../../context/GlobalMetadataContext';
18
+ import { GlobalMetadataDispatchContext, useGlobalStateContext } from '../../context/GlobalMetadataContext';
19
19
  import { useUserPreferences } from '../../hooks';
20
+ import { fetchLoggedInUsersAccount } from '../../reducers/GlobalMetadataReducer';
20
21
  export const HostnameAwarenessModal = () => {
21
22
  // Function to fetch original data
22
23
  const { getHostnamesVisibilityObj, updateShowHostnamesCount } = useUserPreferences();
@@ -30,7 +31,8 @@ export const HostnameAwarenessModal = () => {
30
31
  //preserving initial state to disable modal load
31
32
  const [alreadyCheckedCloseModal, setAlreadyCheckedCloseModal] = useState(false);
32
33
  const [isHostnamesLoading, setIsHostnamesLoading] = useState(true);
33
- const { globalMetadataState: { loggedInUsersAccount }, } = useGlobalStateContext();
34
+ const { globalMetadataState: { loggedInUsersAccount, loggedInUserJwtToken }, } = useGlobalStateContext();
35
+ const dispatchToGlobalMetadataReducer = useContext(GlobalMetadataDispatchContext);
34
36
  const accountNumber = loggedInUsersAccount.data.accountNumber;
35
37
  const { request: updateHostnameDefault, isFetching: isFetchingUpdateHostnameDefault } = useFetch(accounts.updateIsSharingHostname);
36
38
  useEffect(() => {
@@ -75,6 +77,7 @@ export const HostnameAwarenessModal = () => {
75
77
  try {
76
78
  setIsHostnamesLoading(true);
77
79
  yield updateHostnameDefault(!isHostnamesChecked, accountNumber);
80
+ fetchLoggedInUsersAccount(dispatchToGlobalMetadataReducer, loggedInUserJwtToken, true);
78
81
  setisHostnamesChecked(!isHostnamesChecked);
79
82
  }
80
83
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/react-context",
3
- "version": "2.1.23",
3
+ "version": "2.1.25-beta.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -26,7 +26,7 @@
26
26
  "lib/**/*"
27
27
  ],
28
28
  "peerDependencies": {
29
- "@cee-eng/hydrajs": "4.16.21",
29
+ "@cee-eng/hydrajs": "4.16.43",
30
30
  "@patternfly/react-core": "4.264.0",
31
31
  "@patternfly/react-icons": "4.92.10",
32
32
  "i18next": "^19.0.1",
@@ -37,13 +37,13 @@
37
37
  "react-test-renderer": "17.0.1"
38
38
  },
39
39
  "dependencies": {
40
- "@cee-eng/hydrajs": "4.16.21",
40
+ "@cee-eng/hydrajs": "4.16.43",
41
41
  "@patternfly/react-core": "4.264.0",
42
42
  "@patternfly/react-icons": "4.92.10",
43
- "@rh-support/components": "2.1.22",
43
+ "@rh-support/components": "2.1.23-beta.0",
44
44
  "@rh-support/types": "2.0.2",
45
- "@rh-support/user-permissions": "2.1.16",
46
- "@rh-support/utils": "2.1.10",
45
+ "@rh-support/user-permissions": "2.1.17-beta.0",
46
+ "@rh-support/utils": "2.1.11-beta.0",
47
47
  "i18next": "^19.0.1",
48
48
  "localforage": "^1.10.0",
49
49
  "lodash": "^4.17.21",
@@ -85,5 +85,5 @@
85
85
  "defaults and supports es6-module",
86
86
  "maintained node versions"
87
87
  ],
88
- "gitHead": "8aa9957475709612c9d651414efe046c93c4ef11"
88
+ "gitHead": "3d67f1bfd743fabfd0a606cf56ea4bf48d91daa2"
89
89
  }