@rh-support/react-context 1.0.13 → 1.0.15

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,mBAyKlC,CAAC"}
1
+ {"version":3,"file":"HostnameAwarenessModal.d.ts","sourceRoot":"","sources":["../../../../src/components/HostnameAwarenessModal/HostnameAwarenessModal.tsx"],"names":[],"mappings":"AAAA,OAAO,8BAA8B,CAAC;AAatC,eAAO,MAAM,sBAAsB,mBA4KlC,CAAC"}
@@ -22,7 +22,8 @@ export const HostnameAwarenessModal = () => {
22
22
  const { getHostnamesVisibilityObj, updateShowHostnamesCount } = useUserPreferences();
23
23
  //Setting State for original data value which are used to open/finalize close modal
24
24
  const [originalViewedCountValue, setViewedCountValue] = useState(null);
25
- const [doNotShowModal, setDoNotShowModal] = useState(null);
25
+ const [doNotShowModal, setDoNotShowModal] = useState(undefined);
26
+ const [doNotShowNotClicked, setDoNotShowNotClicked] = useState(true);
26
27
  const [isModalOpen, setIsModalOpen] = useState(true);
27
28
  const [isHostnamesChecked, setisHostnamesChecked] = useState(false);
28
29
  const [isLoadingHostnamesVisibilityObj, setIsLoadingHostnamesVisibilityObj] = useState(false);
@@ -84,6 +85,8 @@ export const HostnameAwarenessModal = () => {
84
85
  //for the checkbox
85
86
  const onDoNotAskAgain = () => {
86
87
  try {
88
+ setDoNotShowNotClicked(false);
89
+ setDoNotShowModal(+!doNotShowModal);
87
90
  const updateObjValue = { shownCount: originalViewedCountValue, doNotShow: 1 };
88
91
  updateShowHostnamesCount(updateObjValue);
89
92
  }
@@ -110,15 +113,15 @@ export const HostnameAwarenessModal = () => {
110
113
  isLoadingHostnamesVisibilityObj ||
111
114
  !canUseHostName ||
112
115
  alreadyCheckedCloseModal ||
113
- originalViewedCountValue > 2 ||
114
- doNotShowModal === 1) {
116
+ originalViewedCountValue > 8 ||
117
+ (doNotShowModal === 1 && doNotShowNotClicked)) {
115
118
  return React.createElement(React.Fragment, null);
116
119
  }
117
120
  return (React.createElement(React.Fragment, null,
118
121
  React.createElement(Modal, { variant: ModalVariant.medium, title: "Share hostnames with Red Hat?", isOpen: isModalOpen, onClose: onCloseModal, actions: [
119
122
  React.createElement(Button, { "data-tracking-id": "close-hostname-modal", key: "close", variant: "primary", onClick: onCloseModal }, "Close"),
120
123
  React.createElement("div", { className: "dontAskCheckbox" },
121
- React.createElement(Checkbox, { isChecked: !!doNotShowModal, label: "Don't ask me again", id: "dont-ask-again", "data-tracking-id": "dont-ask-again-hostname-modal", onClick: onDoNotAskAgain })),
124
+ React.createElement(Checkbox, { isChecked: !!doNotShowModal, label: "Don't ask me again", id: "dont-ask-again", "data-tracking-id": "dont-ask-again-hostname-modal", onChange: onDoNotAskAgain })),
122
125
  ] },
123
126
  React.createElement("div", null,
124
127
  React.createElement(Trans, null, "Red Hat Support cannot currently access hostnames that have been entered on a case. You can share this information at any time to improve your support experience, or you can ignore this.")),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/react-context",
3
- "version": "1.0.13",
3
+ "version": "1.0.15",
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.13.0",
29
+ "@cee-eng/hydrajs": "4.14.53",
30
30
  "@patternfly/react-core": "4.264.0",
31
31
  "@patternfly/react-icons": "4.92.10",
32
32
  "@rh-support/components": "^0.1.3",
@@ -41,13 +41,13 @@
41
41
  "react-test-renderer": "17.0.1"
42
42
  },
43
43
  "dependencies": {
44
- "@cee-eng/hydrajs": "4.13.0",
44
+ "@cee-eng/hydrajs": "4.14.53",
45
45
  "@patternfly/react-core": "4.264.0",
46
46
  "@patternfly/react-icons": "4.92.10",
47
- "@rh-support/components": "1.2.11",
47
+ "@rh-support/components": "1.2.13",
48
48
  "@rh-support/types": "0.2.0",
49
- "@rh-support/user-permissions": "1.0.9",
50
- "@rh-support/utils": "1.0.7",
49
+ "@rh-support/user-permissions": "1.0.10",
50
+ "@rh-support/utils": "1.0.8",
51
51
  "i18next": "^19.0.1",
52
52
  "localforage": "^1.7.3",
53
53
  "lodash": "^4.17.21",
@@ -87,5 +87,5 @@
87
87
  "not ie <= 11",
88
88
  "not op_mini all"
89
89
  ],
90
- "gitHead": "e5eaffb494da11a1b2f33603dd6b369106033882"
90
+ "gitHead": "8e9b0b138cec4a9e71180e96ee391702b6754236"
91
91
  }