@rh-support/troubleshoot 2.7.25 → 2.7.27

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.
@@ -14,7 +14,6 @@ import CaseLabelsCreate from './CaseLabelsCreate';
14
14
  import CaseLanguageSelector from './CaseLanguageSelector';
15
15
  // import { Cep } from './Cep';
16
16
  import OpenReferenceNumber from './OpenReferenceNumber';
17
- import { RHAssociatesSelector } from './RHAssociatesSelector';
18
17
  export default function CaseManagement(props) {
19
18
  const caseDispatch = useCaseDispatch();
20
19
  const showCaseGroupField = useShowCaseGroupField();
@@ -37,6 +36,5 @@ export default function CaseManagement(props) {
37
36
  React.createElement(Grid, { hasGutter: true },
38
37
  React.createElement(GridItem, { span: 12, xl2: 12, className: "pf-v6-u-mb-xs" },
39
38
  React.createElement(CaseLabelsCreate, null))),
40
- React.createElement(RHAssociatesSelector, null),
41
39
  React.createElement(OpenReferenceNumber, { inlineEditable: false, hideSaveCancel: true })));
42
40
  }
@@ -20,7 +20,7 @@ import CaseLabelsCreate from '../CaseManagement/CaseLabelsCreate';
20
20
  import CaseLanguageSelector from '../CaseManagement/CaseLanguageSelector';
21
21
  // import { Cep } from '../CaseManagement/Cep';
22
22
  import OpenReferenceNumber from '../CaseManagement/OpenReferenceNumber';
23
- import { RHAssociatesSelector } from '../CaseManagement/RHAssociatesSelector';
23
+ // import { RHAssociatesSelector } from '../CaseManagement/RHAssociatesSelector';
24
24
  // import CaseContactSelector from '../CaseManagement/SendNotifications/CaseContactSelector';
25
25
  import KtQuestions from '../ImproveCase/KtQuestions';
26
26
  export default function IdeaInformation() {
@@ -111,6 +111,5 @@ export default function IdeaInformation() {
111
111
  React.createElement(Grid, { hasGutter: true },
112
112
  React.createElement(GridItem, { span: 12, xl2: 12, className: "pf-v6-u-mb-xs" },
113
113
  React.createElement(CaseLabelsCreate, null))),
114
- React.createElement(RHAssociatesSelector, null),
115
114
  React.createElement(OpenReferenceNumber, { inlineEditable: false, hideSaveCancel: true }))))));
116
115
  }
@@ -1 +1 @@
1
- {"version":3,"file":"RemoteRiderAcceptanceModal.d.ts","sourceRoot":"","sources":["../../../../src/components/RemoteRider/RemoteRiderAcceptanceModal.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAGxD,OAAO,KAAqB,MAAM,OAAO,CAAC;AAM1C,UAAU,MAAM;IACZ,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAC;CACrD;AAED,MAAM,CAAC,OAAO,UAAU,0BAA0B,CAAC,KAAK,EAAE,MAAM,qBAuD/D"}
1
+ {"version":3,"file":"RemoteRiderAcceptanceModal.d.ts","sourceRoot":"","sources":["../../../../src/components/RemoteRider/RemoteRiderAcceptanceModal.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAGxD,OAAO,KAA+B,MAAM,OAAO,CAAC;AAOpD,UAAU,MAAM;IACZ,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAC;CACrD;AAED,MAAM,CAAC,OAAO,UAAU,0BAA0B,CAAC,KAAK,EAAE,MAAM,qBAoF/D"}
@@ -7,24 +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 { useApolloClient } from '@apollo/client/react';
10
11
  import { publicApi } from '@cee-eng/hydrajs';
11
12
  import { AcceptTermsModal, ToastNotification, useFetch } from '@rh-support/components';
12
13
  import { GlobalMetadataStateContext } from '@rh-support/react-context';
13
- import { TncConstants } from '@rh-support/utils';
14
+ import { resolveSalesforceUserIdByFederationId, TncConstants } from '@rh-support/utils';
14
15
  import isEqual from 'lodash/isEqual';
15
- import React, { useContext } from 'react';
16
+ import React, { useContext, useState } from 'react';
16
17
  import { useTranslation } from 'react-i18next';
17
- import { useCaseSelector } from '../../context/CaseContext';
18
- import { useCreateCaseComment } from '../../hooks/useCaseComments';
18
+ import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
19
+ import { GET_CASE_COMMENTS, useCreateCaseComment } from '../../hooks/useCaseComments';
20
+ import { updateCaseDetailsGraphQL } from '../../reducers/CaseReducer';
19
21
  export default function RemoteRiderAcceptanceModal(props) {
20
22
  const { globalMetadataState: { loggedInUser }, } = useContext(GlobalMetadataStateContext);
21
23
  const { t } = useTranslation();
22
- const { request, isFetching } = useFetch(publicApi.kase.acknowledgeRemoteSessionTerms, { propgateErrors: true });
23
- const { createComment, loading: isPostingComment } = useCreateCaseComment();
24
+ const apolloClient = useApolloClient();
25
+ const caseDispatch = useCaseDispatch();
26
+ const [isSubmitting, setIsSubmitting] = useState(false);
27
+ const { request } = useFetch(publicApi.terms.updateRemoteRiderTermsAck, { propgateErrors: true });
28
+ const { createComment } = useCreateCaseComment();
24
29
  const caseSalesforceId = useCaseSelector((state) => state.caseDetails.id, isEqual);
30
+ const existingCaseDetails = useCaseSelector((state) => state.caseDetails, isEqual);
25
31
  const onConfirm = (pdfId) => __awaiter(this, void 0, void 0, function* () {
32
+ setIsSubmitting(true);
26
33
  try {
27
- yield request(props.caseNumber, pdfId);
34
+ yield request(TncConstants.REMOTE_RIDER_SITE_CODE, loggedInUser.data.ssoUsername, pdfId, 'accepted');
35
+ const ackedByUserId = yield resolveSalesforceUserIdByFederationId(apolloClient, loggedInUser.data.ssoUsername);
36
+ if (!ackedByUserId) {
37
+ throw new Error('Salesforce user id is required to acknowledge remote rider terms');
38
+ }
39
+ yield updateCaseDetailsGraphQL(caseDispatch, apolloClient, props.caseNumber, {
40
+ remoteSessionTermsAcked: true,
41
+ remoteSessionTermsAckedBy: ackedByUserId,
42
+ remoteSessionTermsAckedDate: new Date().toISOString(),
43
+ }, false, { existingCaseDetails });
28
44
  try {
29
45
  const requestComment = t('<h4>Remote Access Rider agreement has been accepted.</h4><p>This action does not initiate a remote session. Please make a case comment if you would like to submit a request.</p>');
30
46
  yield createComment({
@@ -32,6 +48,7 @@ export default function RemoteRiderAcceptanceModal(props) {
32
48
  body: requestComment,
33
49
  isPublic: true,
34
50
  });
51
+ yield apolloClient.refetchQueries({ include: [GET_CASE_COMMENTS] });
35
52
  ToastNotification.addSuccessMessage(t('Remote Access Rider agreement has been accepted'), t('This action does not initiate a remote session. Please make a case comment if you would like to submit a request.'));
36
53
  }
37
54
  catch (e) {
@@ -42,6 +59,9 @@ export default function RemoteRiderAcceptanceModal(props) {
42
59
  catch (e) {
43
60
  props.onFailure && props.onFailure();
44
61
  }
62
+ finally {
63
+ setIsSubmitting(false);
64
+ }
45
65
  });
46
- return (React.createElement(AcceptTermsModal, { isSubmitting: isFetching, siteCode: TncConstants.REMOTE_RIDER_SITE_CODE, eventCode: TncConstants.REMOTER_RIDER_EVENT_CODE, loggedInUser: loggedInUser.data.ssoUsername, isModalOpen: props.isModalOpen, onModalClose: props.onModalClose, dataTrackingId: props.isCaseDetailsPage ? 'rar-case-details' : 'rar-case-submit', onConfirm: onConfirm, isDisabled: isPostingComment }));
66
+ return (React.createElement(AcceptTermsModal, { isSubmitting: isSubmitting, siteCode: TncConstants.REMOTE_RIDER_SITE_CODE, eventCode: TncConstants.REMOTER_RIDER_EVENT_CODE, loggedInUser: loggedInUser.data.ssoUsername, isModalOpen: props.isModalOpen, onModalClose: props.onModalClose, dataTrackingId: props.isCaseDetailsPage ? 'rar-case-details' : 'rar-case-submit', onConfirm: onConfirm }));
47
67
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "2.7.25",
3
+ "version": "2.7.27",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -42,7 +42,7 @@
42
42
  "react-virtualized": "^9.22.5"
43
43
  },
44
44
  "dependencies": {
45
- "@cee-eng/hydrajs": "^4.18.114",
45
+ "@cee-eng/hydrajs": "^4.18.116",
46
46
  "@cee-eng/ui-toolkit": "1.1.9",
47
47
  "@ifd-ui/ask-redhat-core": "^0.0.61",
48
48
  "@patternfly/patternfly": "6.2.1",
@@ -52,11 +52,11 @@
52
52
  "@progress/kendo-licensing": "1.3.5",
53
53
  "@progress/kendo-react-pdf": "^5.16.0",
54
54
  "@redux-devtools/extension": "^3.3.0",
55
- "@rh-support/components": "2.6.23",
56
- "@rh-support/react-context": "2.6.25",
55
+ "@rh-support/components": "2.6.24",
56
+ "@rh-support/react-context": "2.6.26",
57
57
  "@rh-support/types": "2.0.31",
58
- "@rh-support/user-permissions": "2.6.21",
59
- "@rh-support/utils": "2.6.20",
58
+ "@rh-support/user-permissions": "2.6.22",
59
+ "@rh-support/utils": "2.6.21",
60
60
  "@types/react-redux": "^7.1.33",
61
61
  "@types/redux": "^3.6.0",
62
62
  "date-fns": "3.6.0",
@@ -129,5 +129,5 @@
129
129
  "defaults and supports es6-module",
130
130
  "maintained node versions"
131
131
  ],
132
- "gitHead": "e705cdc4659cef7c7a682f03545ac2c9e6c05ee2"
132
+ "gitHead": "2a7b78564b71dc72c1b96910aa281fc8a50c83f5"
133
133
  }