@rh-support/manage 2.5.241 → 2.5.243

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":"GroupSelect.d.ts","sourceRoot":"","sources":["../../../../../src/components/Groups/GroupSelect/GroupSelect.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AAsC3E,OAAO,KAAmD,MAAM,OAAO,CAAC;AAMxE,UAAU,MAAM;IACZ,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,KAAK,IAAI,CAAC;IAC7C,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC7B;AAKD,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,sBAmmBxC,CAAC"}
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;AAsC3E,OAAO,KAAmD,MAAM,OAAO,CAAC;AAMxE,UAAU,MAAM;IACZ,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,KAAK,IAAI,CAAC;IAC7C,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC7B;AAKD,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,sBA0mBxC,CAAC"}
@@ -28,7 +28,7 @@ export const GroupSelect = (props) => {
28
28
  const { onSelect: onSelectProp } = props;
29
29
  const manageActionsRef = useRef();
30
30
  const apolloClient = useApolloClient();
31
- const { globalMetadataState: { caseGroups, loggedInUserJwtToken, loggedInUsersAccount }, } = useGlobalStateContext();
31
+ const { globalMetadataState: { caseGroups, loggedInUsersAccount }, } = useGlobalStateContext();
32
32
  const dispatch = useGlobalDispatchContext();
33
33
  const selectAGroupText = caseGroups.isFetching
34
34
  ? t('Loading groups')
@@ -56,8 +56,16 @@ export const GroupSelect = (props) => {
56
56
  if (hasFetchedFromGraphQL.current)
57
57
  return;
58
58
  hasFetchedFromGraphQL.current = true;
59
- Promise.resolve(fetchCaseGroupsForSSO(dispatch, loggedInUserJwtToken.preferred_username, apolloClient, accountId)).finally(() => setGroupsFetchCompleted(true));
60
- }, [dispatch, loggedInUserJwtToken.preferred_username, apolloClient, accountId]);
59
+ const fetchGroups = () => __awaiter(void 0, void 0, void 0, function* () {
60
+ try {
61
+ yield fetchCaseGroupsForSSO(dispatch, apolloClient, accountId);
62
+ }
63
+ finally {
64
+ setGroupsFetchCompleted(true);
65
+ }
66
+ });
67
+ fetchGroups();
68
+ }, [dispatch, apolloClient, accountId]);
61
69
  // Set default group once groups are loaded
62
70
  useEffect(() => {
63
71
  var _a, _b;
@@ -1 +1 @@
1
- {"version":3,"file":"PreferencesCaseView.d.ts","sourceRoot":"","sources":["../../../../../src/components/ManagePreferences/sections/PreferencesCaseView.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAO/D,UAAU,MAAM;CAAG;AAEnB,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,qBAmShD"}
1
+ {"version":3,"file":"PreferencesCaseView.d.ts","sourceRoot":"","sources":["../../../../../src/components/ManagePreferences/sections/PreferencesCaseView.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAO/D,UAAU,MAAM;CAAG;AAEnB,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,qBAqShD"}
@@ -7,37 +7,40 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { accounts } from '@cee-eng/hydrajs';
11
- import { Card, CardBody, CardHeader, Popover, PopoverPosition, SelectOption, Spinner, TextArea, Tooltip, } from '@patternfly/react-core';
10
+ // import { accounts } from '@cee-eng/hydrajs';
11
+ import { Card, CardBody, CardHeader, Popover, PopoverPosition, SelectOption, Spinner, TextArea,
12
+ // Tooltip,
13
+ } from '@patternfly/react-core';
12
14
  import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
13
- import { EditorMode, ToastNotification, useFetch } from '@rh-support/components';
15
+ import { EditorMode, ToastNotification /* , useFetch */ } from '@rh-support/components';
14
16
  import { GlobalMetadataStateContext } from '@rh-support/react-context';
15
- import { ability, CaseListFields, resourceActions, resources } from '@rh-support/user-permissions';
17
+ import { ability /* , CaseListFields */, resourceActions, resources } from '@rh-support/user-permissions';
16
18
  import debounce from 'lodash/debounce';
17
19
  import isEmpty from 'lodash/isEmpty';
18
20
  import React, { useContext, useEffect, useState } from 'react';
19
21
  import { Trans, useTranslation } from 'react-i18next';
20
22
  import { useUserPreferences } from '../../../hooks/useUserPreferences';
21
23
  import { PreferenceSelect } from '../components/PreferenceSelect';
22
- import { PreferenceSwitch } from '../components/PreferenceSwitch';
23
24
  export function PreferencesCaseView(props) {
24
25
  const { t } = useTranslation();
25
26
  const { updateCommentType, getCommentTypeFromPreference, getCommentSignature, updateCommentSignature, getOriginalCaseView, updateOriginalCaseView, } = useUserPreferences();
26
- const { globalMetadataState: { loggedInUsersAccount, loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
27
- const [isSharingHostNames, setIsSharingHostNames] = useState(false);
27
+ const {
28
+ // globalMetadataState: { loggedInUsersAccount, loggedInUserRights },
29
+ globalMetadataState: { loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
30
+ // const [isSharingHostNames, setIsSharingHostNames] = useState(false);
28
31
  const [localCommentSignature, setLocalCommentSignature] = useState('');
29
32
  const [originalCommentType, setOriginalCommentType] = useState('');
30
33
  const [originalCommentSignature, setOriginalCommentSignature] = useState('');
31
34
  const [commentValidated, setCommentValidated] = useState('default');
32
- const [isHostnamesLoading, setIsHostnamesLoading] = useState(true);
35
+ // const [isHostnamesLoading, setIsHostnamesLoading] = useState(true);
33
36
  const [isCommentSignatureLoading, setIsCommentSignatureLoading] = useState(false);
34
37
  const commentTypes = [EditorMode.PLAIN, EditorMode.MARKDOWN];
35
38
  const defaultCommentTitleID = 'default-comment-preference-select';
36
39
  const defaultCaseViewID = 'default-case-view-select';
37
- const canUseHostName = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.HOSTNAME);
40
+ // const canUseHostName = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.HOSTNAME);
38
41
  const isInternalUserPermission = ability.can(resourceActions.READ, resources.ACCOUNTS_FILTER);
39
- const accountNumber = loggedInUsersAccount.data.accountNumber;
40
- const { request: updateShareHostnames } = useFetch(accounts.updateIsSharingHostname);
42
+ // const accountNumber = loggedInUsersAccount.data.accountNumber;
43
+ // const { request: updateShareHostnames } = useFetch(accounts.updateIsSharingHostname);
41
44
  const originalAccountPermission = loggedInUserRights.data.isInternal();
42
45
  const [originalCaseView, setOriginalCaseView] = useState(+originalAccountPermission);
43
46
  const caseViewTypes = [
@@ -58,23 +61,19 @@ export function PreferencesCaseView(props) {
58
61
  setCommentValidated('default');
59
62
  }
60
63
  }, [localCommentSignature, commentValidated]);
61
- useEffect(() => {
62
- function userOriginalHostnameValue() {
63
- return __awaiter(this, void 0, void 0, function* () {
64
- var _a, _b;
65
- try {
66
- ((_a = loggedInUsersAccount.data) === null || _a === void 0 ? void 0 : _a.shareHostnameWithRHT) &&
67
- setIsSharingHostNames((_b = loggedInUsersAccount.data) === null || _b === void 0 ? void 0 : _b.shareHostnameWithRHT);
68
- }
69
- catch (error) {
70
- console.log(error);
71
- }
72
- setIsHostnamesLoading(false);
73
- });
74
- }
75
- canUseHostName && userOriginalHostnameValue();
76
- // eslint-disable-next-line react-hooks/exhaustive-deps
77
- }, []);
64
+ // useEffect(() => {
65
+ // async function userOriginalHostnameValue() {
66
+ // try {
67
+ // loggedInUsersAccount.data?.shareHostnameWithRHT &&
68
+ // setIsSharingHostNames(loggedInUsersAccount.data?.shareHostnameWithRHT);
69
+ // } catch (error) {
70
+ // console.log(error);
71
+ // }
72
+ // setIsHostnamesLoading(false);
73
+ // }
74
+ // canUseHostName && userOriginalHostnameValue();
75
+ // // eslint-disable-next-line react-hooks/exhaustive-deps
76
+ // }, []);
78
77
  const userOriginalCaseView = () => __awaiter(this, void 0, void 0, function* () {
79
78
  try {
80
79
  const retrievedCaseView = yield getOriginalCaseView();
@@ -165,19 +164,19 @@ export function PreferencesCaseView(props) {
165
164
  console.log(error);
166
165
  }
167
166
  });
168
- const onShareHostNamesSwitch = () => __awaiter(this, void 0, void 0, function* () {
169
- try {
170
- setIsHostnamesLoading(true);
171
- yield updateShareHostnames(!isSharingHostNames, accountNumber);
172
- // TODO: migrate to GraphQL - fetchLoggedInUsersAccount(dispatchToGlobalMetadataReducer, loggedInUserJwtToken, true, apolloClient);
173
- setIsSharingHostNames(!isSharingHostNames);
174
- }
175
- catch (error) {
176
- console.log(error);
177
- }
178
- setIsHostnamesLoading(false);
179
- });
180
- const prefHostnameCopy = '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.';
167
+ // const onShareHostNamesSwitch = async () => {
168
+ // try {
169
+ // setIsHostnamesLoading(true);
170
+ // await updateShareHostnames!(!isSharingHostNames, accountNumber!);
171
+ // // TODO: migrate to GraphQL - fetchLoggedInUsersAccount(dispatchToGlobalMetadataReducer, loggedInUserJwtToken, true, apolloClient);
172
+ // setIsSharingHostNames(!isSharingHostNames);
173
+ // } catch (error) {
174
+ // console.log(error);
175
+ // }
176
+ // setIsHostnamesLoading(false);
177
+ // };
178
+ // const prefHostnameCopy =
179
+ // '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.';
181
180
  const caseViewPrefSelection = () => {
182
181
  if (!!originalCaseView) {
183
182
  return caseViewTypes[+originalAccountPermission].value;
@@ -207,14 +206,5 @@ export function PreferencesCaseView(props) {
207
206
  React.createElement(TextArea, { value: localCommentSignature, onChange: (_event, value) => handleCommentSignatureChange(value), "aria-label": "comment-signature-textarea", placeholder: originalCommentSignature || 'Add a comment signature', id: "comment-signature-textarea",
208
207
  // @ts-ignore
209
208
  validated: commentValidated, resizeOrientation: "vertical" }),
210
- isCommentSignatureLoading && React.createElement(Spinner, { size: "md" })),
211
- canUseHostName && (React.createElement("div", { className: "form-group" },
212
- React.createElement("label", null,
213
- React.createElement(Trans, null, "Case information")),
214
- React.createElement("div", { className: "preference-page-switch-container" },
215
- React.createElement(PreferenceSwitch, { id: "share-hostnames-switch", label: 'Share hostnames', isChecked: isSharingHostNames, onSwitchChange: onShareHostNamesSwitch }),
216
- React.createElement("div", { className: "prefhostnameTooltip" },
217
- React.createElement(Tooltip, { content: prefHostnameCopy, position: "right" },
218
- React.createElement(InfoCircleIcon, { className: "pf-v6-u-ml-sm cursor-pointer", color: "#5e40be" })),
219
- isHostnamesLoading && (React.createElement(Spinner, { size: "lg", className: "pf-v6-u-ml-sm hostnameSpinner", "aria-label": "Hostname loading" }))))))))));
209
+ isCommentSignatureLoading && React.createElement(Spinner, { size: "md" }))))));
220
210
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/manage",
3
- "version": "2.5.241",
3
+ "version": "2.5.243",
4
4
  "description": "Customer Support Manage App",
5
5
  "author": "Jordan Eudy <jeudy100@gmail.com>",
6
6
  "license": "ISC",
@@ -42,7 +42,7 @@
42
42
  },
43
43
  "peerDependencies": {
44
44
  "@apollo/client": "^4.1.6",
45
- "@cee-eng/hydrajs": "^4.18.113",
45
+ "@cee-eng/hydrajs": "^4.18.114",
46
46
  "@patternfly/patternfly": "6.2.1",
47
47
  "@patternfly/react-core": "6.2.1",
48
48
  "@patternfly/react-table": "6.2.1",
@@ -72,16 +72,16 @@
72
72
  "typescript": "^5.3.3"
73
73
  },
74
74
  "dependencies": {
75
- "@cee-eng/hydrajs": "^4.18.113",
75
+ "@cee-eng/hydrajs": "^4.18.114",
76
76
  "@patternfly/patternfly": "6.2.1",
77
77
  "@patternfly/react-core": "6.2.1",
78
78
  "@patternfly/react-table": "6.2.1",
79
- "@rh-support/components": "2.5.193",
79
+ "@rh-support/components": "2.5.195",
80
80
  "@rh-support/configs": "2.0.75",
81
- "@rh-support/react-context": "2.5.287",
81
+ "@rh-support/react-context": "2.5.289",
82
82
  "@rh-support/types": "2.0.26",
83
- "@rh-support/user-permissions": "2.5.139",
84
- "@rh-support/utils": "2.5.121",
83
+ "@rh-support/user-permissions": "2.5.141",
84
+ "@rh-support/utils": "2.5.123",
85
85
  "@types/react-beautiful-dnd": "^13.0.0",
86
86
  "i18next": "^23.15.0",
87
87
  "lodash": ">=4.17.15",
@@ -100,5 +100,5 @@
100
100
  "defaults and supports es6-module",
101
101
  "maintained node versions"
102
102
  ],
103
- "gitHead": "25e583b62d2c134f01811158805d24b70da32847"
103
+ "gitHead": "f5994856f35873c8555a84006c0d278fbc98b067"
104
104
  }