@rh-support/troubleshoot 1.0.26 → 1.0.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.
@@ -21,7 +21,7 @@ export const RemoteSessionAgreement = forwardRef((props, ref) => {
21
21
  // RSA Aside Section Body
22
22
  const RemoteSessionAgreementSectionBody = (React.createElement("div", { className: "card card-white card-support escalations", ref: ref },
23
23
  React.createElement("h3", { className: "card-heading pf-u-display-flex pf-u-justify-content-space-between" },
24
- t('Remote session'),
24
+ t('Remote session agreement'),
25
25
  React.createElement(Popover, { "aria-label": t('Remote Session Helper Info'), bodyContent: t('Before Red Hat logs into your systems to analyze your support issue during a remote session, Red Hat needs your approval and authorization for such remote access.'), footerContent: React.createElement("a", { href: "/articles/3566571", target: "_blank", rel: "noopener noreferrer", "aria-label": t('Read more about remote sessions') }, t('Read more about remote sessions')) },
26
26
  React.createElement(InfoCircleIcon, null))),
27
27
  React.createElement("div", { className: "card-body" },
@@ -31,7 +31,7 @@ export const RemoteSessionAgreement = forwardRef((props, ref) => {
31
31
  React.createElement("li", null, t(`Such access helps diagnose, debug or lead to the resolution of a software defect.`)),
32
32
  React.createElement("li", null, t('Both you and Red Hat agree to remote access.'))),
33
33
  React.createElement("p", { className: "rrs-light-grey-text" }, t('This action does not initiate a remote session. Please make a case comment if you would like to submit a request.')),
34
- acceptedRemoteSessionTerms && (React.createElement(Tooltip, { content: t('Remote session agreement has already has been accepted.'), reference: tooltipRef, "aria-live": 'polite' })),
34
+ acceptedRemoteSessionTerms && (React.createElement(Tooltip, { content: t('Remote session agreement has already been accepted.'), reference: tooltipRef, "aria-live": 'polite' })),
35
35
  React.createElement(Button, { "aria-label": acceptedRemoteSessionTerms ? t('Agreement accepted') : t('Accept agreement'), variant: "primary", onClick: toggleRemoteSessionAgreementModal, "data-tracking-id": "accept-remote-session-agreement-trigger", isAriaDisabled: acceptedRemoteSessionTerms, ref: tooltipRef }, acceptedRemoteSessionTerms ? t('Agreement accepted') : t('Accept agreement')))));
36
36
  return (React.createElement(React.Fragment, null,
37
37
  RemoteSessionAgreementSectionBody,
@@ -1 +1 @@
1
- {"version":3,"file":"RemoteSessionAgreementModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAiBxD,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,OAAO,CAAC;IACd,kBAAkB,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAC;CACrD;AAiBD,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,eAkPxD"}
1
+ {"version":3,"file":"RemoteSessionAgreementModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAiBxD,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,OAAO,CAAC;IACd,kBAAkB,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAC;CACrD;AAiBD,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,eA+OxD"}
@@ -37,7 +37,6 @@ const getLocaleNameFromLocalCode = (localeCode) => {
37
37
  export function RemoteSessionAgreementModal(props) {
38
38
  const { t } = useTranslation();
39
39
  const [isTermsChecked, setIsTermsChecked] = useState(false);
40
- const [isSubmitDisabled, setSubmitDisabled] = useState(false);
41
40
  const { request } = useFetch(publicApi.terms.getRequiredTerms);
42
41
  const [isLangSelectorDropdownOpen, setisLangSelectorDropdownOpen] = useState(false);
43
42
  const caseDispatch = useCaseDispatch();
@@ -87,7 +86,7 @@ export function RemoteSessionAgreementModal(props) {
87
86
  props.onClose && props.onClose();
88
87
  };
89
88
  // Function to ack remote session terms and post comment
90
- const submitRequestRemoteSessionRequest = (pdfId) => __awaiter(this, void 0, void 0, function* () {
89
+ const submitRemoteSessionAgreement = (pdfId) => __awaiter(this, void 0, void 0, function* () {
91
90
  const requestComment = t('#### A Remote Session request has been submitted. We will review the request and confirm via case comment.\n\n This action does not initiate a remote session. Please make a case comment if you would like to submit a request.');
92
91
  try {
93
92
  yield updateCaseDetails(caseDispatch, props.caseNumber, { remoteSessionTermsAcked: true });
@@ -116,18 +115,12 @@ export function RemoteSessionAgreementModal(props) {
116
115
  });
117
116
  // To check if terms acked and if not disable submit button
118
117
  const onSubmit = () => {
119
- if (isTermsChecked) {
120
- setAgreeLoading(true);
121
- submitRequestRemoteSessionRequest(selectedTranslation.termsPdfId);
122
- }
123
- else {
124
- setSubmitDisabled(true);
125
- }
118
+ setAgreeLoading(true);
119
+ submitRemoteSessionAgreement(selectedTranslation.termsPdfId);
126
120
  };
127
121
  // Handle terms checkbox
128
122
  const onCheckBoxChange = (value) => {
129
123
  setIsTermsChecked(value);
130
- setSubmitDisabled(!value);
131
124
  };
132
125
  // Handle language change
133
126
  const onLangChange = (event, lang) => {
@@ -136,9 +129,11 @@ export function RemoteSessionAgreementModal(props) {
136
129
  };
137
130
  // To handle dropdown toggle
138
131
  const onDropdownToggle = (toggle) => setisLangSelectorDropdownOpen(toggle);
132
+ // To check and if I agree button is loading
133
+ const isAgreeLoading = agreeLoading || isPostingComment;
139
134
  // RSA Modal Actions
140
135
  const modalActions = [
141
- React.createElement(Button, { "aria-label": t('I agree'), variant: ButtonVariant.primary, onClick: onSubmit, "data-tracking-id": "remote-session-agreement-check", isLoading: agreeLoading || isPostingComment, isDisabled: isSubmitDisabled || isPostingComment }, t('I agree')),
136
+ React.createElement(Button, { "aria-label": t('I agree'), variant: ButtonVariant.primary, onClick: onSubmit, "data-tracking-id": "remote-session-agreement-check", isLoading: isAgreeLoading, isDisabled: !isTermsChecked || isAgreeLoading }, t('I agree')),
142
137
  ];
143
138
  // Body of RSA Modal
144
139
  const RemoteSessionAgreementModalBody = (React.createElement(React.Fragment, null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "1.0.26",
3
+ "version": "1.0.27",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -142,5 +142,5 @@
142
142
  "not ie <= 11",
143
143
  "not op_mini all"
144
144
  ],
145
- "gitHead": "8e9b0b138cec4a9e71180e96ee391702b6754236"
145
+ "gitHead": "f9f98f77ee023f1323d78252ab0c07266d1be4b6"
146
146
  }