@rh-support/troubleshoot 2.2.31 → 2.2.32

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":"CaseSolutions.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseSolutions/CaseSolutions.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAsD,MAAM,OAAO,CAAC;AA+D3E,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,sBAAsB,EAAE,OAAO,CAAC;CACnC;AAUD,eAAO,MAAM,aAAa,+EAoYxB,CAAC"}
1
+ {"version":3,"file":"CaseSolutions.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseSolutions/CaseSolutions.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAsD,MAAM,OAAO,CAAC;AA+D3E,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,sBAAsB,EAAE,OAAO,CAAC;CACnC;AAUD,eAAO,MAAM,aAAa,+EA2YxB,CAAC"}
@@ -109,8 +109,13 @@ export const CaseSolutions = forwardRef((props, ref) => {
109
109
  };
110
110
  if (recommendationToUpdate.resourceViewURI)
111
111
  recommendation.resourceViewURI = recommendationToUpdate.resourceViewURI;
112
- if (recommendationToUpdate.resourceURI)
113
- recommendation.resourceURI = recommendationToUpdate.resourceURI;
112
+ // for some doc types like Errata we don't have resourceURI. If resourceURI was not avalable,
113
+ // we constructe a 'fake' one to be used when linking in SFDC
114
+ recommendation.resourceURI = recommendationToUpdate.resourceURI
115
+ ? recommendationToUpdate.resourceURI
116
+ : recommendationToUpdate.resourceViewURI
117
+ ? recommendationToUpdate.resourceViewURI
118
+ : recommendationToUpdate.resourceId;
114
119
  yield updateCaseDetails(caseDispatch, caseNumber, {
115
120
  caseResourceLinks: [recommendation],
116
121
  }, true);
@@ -1 +1 @@
1
- {"version":3,"file":"CaseHostname.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseHostname.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAc5D,UAAU,MAAO,SAAQ,gBAAgB;IACrC,cAAc,EAAE,OAAO,CAAC;CAC3B;AAMD,iBAAS,YAAY,CAAC,KAAK,EAAE,MAAM,eA0KlC;kBA1KQ,YAAY;;;AA6KrB,OAAO,EAAE,YAAY,EAAE,CAAC"}
1
+ {"version":3,"file":"CaseHostname.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseHostname.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAc5D,UAAU,MAAO,SAAQ,gBAAgB;IACrC,cAAc,EAAE,OAAO,CAAC;CAC3B;AAMD,iBAAS,YAAY,CAAC,KAAK,EAAE,MAAM,eAuKlC;kBAvKQ,YAAY;;;AA0KrB,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -41,10 +41,8 @@ function CaseHostname(props) {
41
41
  const [isHostnamesLoading, setIsHostnamesLoading] = useState(true);
42
42
  const { isExportingPDF } = useContext(PDFContext);
43
43
  const { globalMetadataState: { loggedInUsersAccount }, } = useContext(GlobalMetadataStateContext);
44
- const { request: fetchHostnameDefault } = useFetch(accounts.getIsSharingHostname);
45
44
  const userOriginalHostnameValue = () => __awaiter(this, void 0, void 0, function* () {
46
- const fetchedHostnameStatus = yield fetchHostnameDefault(accountNumber);
47
- setIsShareHostNamesChecked(fetchedHostnameStatus.shareHostnameWithRHT);
45
+ setIsShareHostNamesChecked(loggedInUsersAccount.data.shareHostnameWithRHT);
48
46
  setIsHostnamesLoading(false);
49
47
  });
50
48
  // value changed logic to show a none local status change
@@ -1 +1 @@
1
- {"version":3,"file":"SubmitCase.d.ts","sourceRoot":"","sources":["../../../../src/components/SubmitCase/SubmitCase.tsx"],"names":[],"mappings":"AAkCA,MAAM,CAAC,OAAO,UAAU,UAAU,gBAoTjC"}
1
+ {"version":3,"file":"SubmitCase.d.ts","sourceRoot":"","sources":["../../../../src/components/SubmitCase/SubmitCase.tsx"],"names":[],"mappings":"AAkCA,MAAM,CAAC,OAAO,UAAU,UAAU,gBA0TjC"}
@@ -21,7 +21,7 @@ import ClusterRecommendations from '../Recommendations/ClusterRecommendations';
21
21
  import InsightsResults from '../Recommendations/InsightsResults';
22
22
  import { RemoteRiderBanner } from '../RemoteRider/RemoteRiderBanner';
23
23
  import FileUploader from '../shared/fileUpload/FileUploader';
24
- import { isUploadedAndAnalyzed, isUploadingAttachment } from '../shared/fileUpload/reducer/AttachmentHelper';
24
+ import { isUploadingAttachment } from '../shared/fileUpload/reducer/AttachmentHelper';
25
25
  import { AttachmentStateContext } from '../shared/fileUpload/reducer/AttachmentReducerContext';
26
26
  import Suggestions from '../Suggestions/Suggestions';
27
27
  export default function SubmitCase() {
@@ -81,9 +81,6 @@ export default function SubmitCase() {
81
81
  showRemoteRiderTermsInline &&
82
82
  !selectedAccountDetails.data.remoteSessionTermsAcked &&
83
83
  !isIdea;
84
- const viewDisabled = isEmpty(attachmentState.caseFiles.selectedLocalFiles)
85
- ? false
86
- : attachmentState.caseFiles.selectedLocalFiles.every((localFile) => !isUploadedAndAnalyzed(localFile));
87
84
  const isNotAnIdea = caseType !== PreviousCaseTypes.FEATURE_ENHANCEMENT;
88
85
  // To check if the user is ESS Customer and Product has ESS Support
89
86
  const isESSCustomer = isSpecialSupportOfferingEnabled((_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult, product);
@@ -107,7 +104,9 @@ export default function SubmitCase() {
107
104
  React.createElement("div", { className: "pf-u-mt-sm" },
108
105
  React.createElement(Trans, null, "Case number:"),
109
106
  "\u00A0",
110
- React.createElement(Link, { to: `/case/${caseNoOfCreatedCase}`, "data-tracking-id": "get-support-queued-case-number", className: viewDisabled ? 'case-link-disabled' : '' }, caseNoOfCreatedCase)))) : (React.createElement(React.Fragment, null,
107
+ React.createElement(Link, { to: `/case/${caseNoOfCreatedCase}`, "data-tracking-id": "get-support-queued-case-number", className: isUploadingAttachment(attachmentState.caseFiles.selectedLocalFiles)
108
+ ? 'case-link-disabled'
109
+ : '' }, caseNoOfCreatedCase)))) : (React.createElement(React.Fragment, null,
111
110
  React.createElement("div", { className: "submit-page-title" },
112
111
  React.createElement(CheckCircleIcon, { className: "submit-case-check-icon", size: "lg" }),
113
112
  ' ',
@@ -115,7 +114,9 @@ export default function SubmitCase() {
115
114
  React.createElement(Trans, null, "We\u2019ve added your case to our queue"))),
116
115
  React.createElement(React.Fragment, null,
117
116
  React.createElement(Trans, null, "Case number: "),
118
- React.createElement("a", { href: getCaseURL(), target: "_blank", rel: "noopener noreferrer", "data-tracking-id": "get-support-case-number", className: viewDisabled ? 'case-link-disabled' : '' }, caseNoOfCreatedCase))))),
117
+ React.createElement("a", { href: getCaseURL(), target: "_blank", rel: "noopener noreferrer", "data-tracking-id": "get-support-case-number", className: isUploadingAttachment(attachmentState.caseFiles.selectedLocalFiles)
118
+ ? 'case-link-disabled'
119
+ : '' }, caseNoOfCreatedCase))))),
119
120
  React.createElement("p", null,
120
121
  !versionsDetails.isFetching &&
121
122
  !versionsDetails.isFetching &&
@@ -134,9 +135,9 @@ export default function SubmitCase() {
134
135
  React.createElement(ActionList, null,
135
136
  React.createElement(ActionListItem, null,
136
137
  React.createElement(Button, { component: "a", href: `${getRedhatDotComHost(Env.getEnvName())}/wapps/ugc/protected/${'personalInfo.html'}`, target: "_blank", variant: "secondary", "data-tracking-id": "get-support-update-info", className: "update-info-button" }, "Update info")),
137
- React.createElement(ActionListItem, null, viewDisabled ? (React.createElement(React.Fragment, null,
138
+ React.createElement(ActionListItem, null, isUploadingAttachment(attachmentState.caseFiles.selectedLocalFiles) ? (React.createElement(React.Fragment, null,
138
139
  React.createElement(Tooltip, { content: t('File upload in progress.'), position: "bottom" },
139
- React.createElement(Button, { className: "pf-u-ml-md", component: "a", href: getCaseURL(), variant: "primary", "data-tracking-id": "get-support-view-case", "aria-label": t('View case'), isAriaDisabled: viewDisabled }, "View case")))) : (React.createElement(Button, { className: "pf-u-ml-md", component: (props) => (React.createElement(Link, Object.assign({}, props, { to: `/case/${caseNoOfCreatedCase}` }))), variant: "primary", "data-tracking-id": "get-support-view-case", "aria-label": t('View case') }, "View case")))))),
140
+ React.createElement(Button, { className: "pf-u-ml-md", component: "a", href: getCaseURL(), variant: "primary", "data-tracking-id": "get-support-view-case", "aria-label": t('View case'), isAriaDisabled: isUploadingAttachment(attachmentState.caseFiles.selectedLocalFiles) }, "View case")))) : (React.createElement(Button, { className: "pf-u-ml-md", component: (props) => (React.createElement(Link, Object.assign({}, props, { to: `/case/${caseNoOfCreatedCase}` }))), variant: "primary", "data-tracking-id": "get-support-view-case", "aria-label": t('View case') }, "View case")))))),
140
141
  !isEmpty(attachmentState.caseFiles.selectedLocalFiles) && (React.createElement(FileUploader, { idToUploadTo: caseNoOfCreatedCase, isSessionId: false, isSecureSupport: loggedInUsersAccount.data.secureSupport })),
141
142
  React.createElement("div", null,
142
143
  (!isEmpty(topContent.data) || !rulesState.EARules.rules || !clusterRecommendations) &&
@@ -3,6 +3,6 @@ export declare function useIsSectionValid(sectionName: AppRouteSections): {
3
3
  isSectionValid: boolean;
4
4
  isSectionValidFn: (sectionNameLocal: any) => boolean;
5
5
  isActiveSectionValid: boolean;
6
- activeSectionError: string;
6
+ activeSectionError: string | JSX.Element;
7
7
  };
8
8
  //# sourceMappingURL=useIsSectionValid.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useIsSectionValid.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/useIsSectionValid.tsx"],"names":[],"mappings":"AAwBA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAInE,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,gBAAgB;;;;;EA0L9D"}
1
+ {"version":3,"file":"useIsSectionValid.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/useIsSectionValid.tsx"],"names":[],"mappings":"AAyBA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAInE,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,gBAAgB;;;;;EAiM9D"}
@@ -2,7 +2,8 @@ import { GlobalMetadataStateContext } from '@rh-support/react-context';
2
2
  import find from 'lodash/find';
3
3
  import isEmpty from 'lodash/isEmpty';
4
4
  import isEqual from 'lodash/isEqual';
5
- import { useContext } from 'react';
5
+ import React, { useContext } from 'react';
6
+ import { Trans } from 'react-i18next';
6
7
  import { useCaseSelector } from '../../context/CaseContext';
7
8
  import { RecommendationStateContext } from '../../context/RecommendationContext';
8
9
  import { RouteContext } from '../../context/RouteContext';
@@ -129,7 +130,11 @@ export function useIsSectionValid(sectionName) {
129
130
  if (!product)
130
131
  return '';
131
132
  const isEntitledProductLocal = isSearchIntent ? true : isEntitledProduct;
132
- return !isEntitledProductLocal ? 'You are not allowed to create case on this product' : '';
133
+ return !isEntitledProductLocal ? (React.createElement(Trans, { i18nKey: "i18ValidEntitlementContactCustomerService" },
134
+ "You need a valid entitlement to create a case.\u00A0 Please contact",
135
+ ' ',
136
+ React.createElement("a", { href: "/support/contact/customerService" }, "Customer Service"),
137
+ " for assistance.")) : ('');
133
138
  };
134
139
  const activeSectionError = (sectionNameLocal) => {
135
140
  if (!sectionNameLocal)
@@ -112,7 +112,7 @@ function WizardNavigation(props) {
112
112
  noValidEntitlement, onClick: onNext, className: "btn btn-app btn-primary main-nav-button", "data-tracking-id": `next-of-${activeSection}` }, t(props.activeStep.nextButtonLabel)),
113
113
  activeSection === AppRouteSections.TROUBLESHOOT && isFileRecommendationsTriggered && (React.createElement(Button, { onClick: handleFileRecsSelfSolved, variant: ButtonVariant.secondary, className: "issue-solved-button solved-issue-button", "data-tracking-id": "troubleshoot-self-solved-issue" }, t('I solved my issue'))),
114
114
  React.createElement(RecommendationFeedbackModal, { isModalOpen: isRecsModalVisible, handleModalToggle: onRecsFeedbackModalToggle, modalContent: t(`Great, we're glad that resolved your issue`) }),
115
- activeSectionError ? (React.createElement("small", { className: "pf-u-align-self-center pf-u-ml-md text-red" }, t(activeSectionError))) : null));
115
+ activeSectionError ? (React.createElement("small", { className: "pf-u-align-self-center pf-u-ml-md text-red" }, activeSectionError)) : null));
116
116
  }
117
117
  WizardNavigation.defaultProps = defaultProps;
118
118
  export default WizardNavigation;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "2.2.31",
3
+ "version": "2.2.32",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -67,7 +67,7 @@
67
67
  "@progress/kendo-drawing": "^1.6.0",
68
68
  "@progress/kendo-react-pdf": "^3.12.0",
69
69
  "@rh-support/components": "2.1.18",
70
- "@rh-support/react-context": "2.1.18",
70
+ "@rh-support/react-context": "2.1.19",
71
71
  "@rh-support/types": "2.0.2",
72
72
  "@rh-support/user-permissions": "2.1.12",
73
73
  "@rh-support/utils": "2.1.9",
@@ -133,5 +133,5 @@
133
133
  "defaults and supports es6-module",
134
134
  "maintained node versions"
135
135
  ],
136
- "gitHead": "ec73b04b857523eb9ced98302c2245c095db46e1"
136
+ "gitHead": "1be555e9d41b629276c10a44ec8e40e0bb9a8995"
137
137
  }