@rh-support/troubleshoot 2.0.2-beta.0 → 2.0.4

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.
@@ -173,7 +173,7 @@ export default function CaseOverview(props) {
173
173
  yield confirm({
174
174
  catchOnCancel: true,
175
175
  title: t(`Status has been changed`),
176
- description: t('Are you sure you want to change this case status to {{status}}?', { newStatus }),
176
+ description: t('Are you sure you want to change this case status to {{newStatus}}?', { newStatus }),
177
177
  });
178
178
  updateStatusState(newStatus);
179
179
  }
@@ -152,7 +152,7 @@ export const CaseSolutions = forwardRef((props, ref) => {
152
152
  if (error.status === 403) {
153
153
  ToastNotification.addDangerMessage(t('You do not have the proper entitlements to pin a recommendation.'), React.createElement(React.Fragment, null,
154
154
  t('Please'),
155
- React.createElement("a", { href: "/support/contact/customerService.html" },
155
+ React.createElement("a", { href: "/support/contact/customerService" },
156
156
  " ",
157
157
  t('contact Customer Service'),
158
158
  " "),
@@ -1 +1 @@
1
- {"version":3,"file":"CaseGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/CaseGroup.tsx"],"names":[],"mappings":"AAmBA,UAAU,MAAM;IACZ,IAAI,CAAC,EAAE,OAAO,CAAC;CAClB;AAWD,iBAAS,SAAS,CAAC,KAAK,EAAE,MAAM,eAyO/B;AAED,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"CaseGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/CaseGroup.tsx"],"names":[],"mappings":"AAmBA,UAAU,MAAM;IACZ,IAAI,CAAC,EAAE,OAAO,CAAC;CAClB;AAWD,iBAAS,SAAS,CAAC,KAAK,EAAE,MAAM,eAsP/B;AAED,eAAe,SAAS,CAAC"}
@@ -32,13 +32,14 @@ const emptyCaseGroup = {
32
32
  function CaseGroup(props) {
33
33
  const { t } = useTranslation();
34
34
  const caseUpdateError = useCaseUpdateErrorMessage();
35
- const { groupNumber, caseNumber, accountNumber, selectedAccountDetails, ownersCaseGroups, groupName } = useCaseSelector((state) => ({
35
+ const { groupNumber, caseNumber, accountNumber, selectedAccountDetails, ownersCaseGroups, groupName, isCaseOwnerUpdating, } = useCaseSelector((state) => ({
36
36
  caseNumber: state.caseDetails.caseNumber,
37
37
  groupNumber: state.caseDetails.groupNumber,
38
38
  accountNumber: state.caseDetails.accountNumberRef,
39
39
  ownersCaseGroups: state.ownersCaseGroups,
40
40
  selectedAccountDetails: state.selectedAccountDetails,
41
41
  groupName: state.caseDetails.groupName,
42
+ isCaseOwnerUpdating: state.isCaseOwnerUpdating,
42
43
  }), isEqual);
43
44
  const caseDispatch = useCaseDispatch();
44
45
  const { routeState: { showValidationErrorAlert }, } = useContext(RouteContext);
@@ -168,7 +169,10 @@ function CaseGroup(props) {
168
169
  React.createElement(Trans, null, "Group"),
169
170
  React.createElement(ValueChangedIcon, { afterLocalChange: afterGroupLocalChange, comparator: groupComparator, isLocalChange: localGroupChange, value: selectedCaseGroup, getTooltipContent: getChangedValueTooltip(() => CaseValuesToWatch.group, (v) => v.name) }),
170
171
  isGroupMandatory && (React.createElement("span", { className: "form-required", "aria-hidden": true }, "*"))),
171
- React.createElement(Dropdown, { id: "get-support-group", searchable: (ownersCaseGroups.data || []).length > 10, onClearSelection: onCaseGroupClear, name: "get-support-group", placeholder: t(`Select a group`), title: t(`Select a group`), list: computeDropdownList(), selectedItem: toOption(selectedCaseGroup, { labelKey: 'name' }), disabled: ownersCaseGroups.isError || ownersCaseGroups.isFetching || isCaseGroupUpdating, isLoadingList: ownersCaseGroups.isFetching || isCaseGroupUpdating, onChange: onCaseGroupChange, isInValid: ownersCaseGroups.isError || showEmptyValidationError || (caseNumber && isSelectedUngroupedInvalid), required: isGroupMandatory, onOuterClick: onOuterClickGroupCheck, "data-tracking-id": "get-support-group" }),
172
+ React.createElement(Dropdown, { id: "get-support-group", searchable: (ownersCaseGroups.data || []).length > 10, onClearSelection: onCaseGroupClear, name: "get-support-group", placeholder: t(`Select a group`), title: t(`Select a group`), list: computeDropdownList(), selectedItem: toOption(selectedCaseGroup, { labelKey: 'name' }), disabled: ownersCaseGroups.isError ||
173
+ ownersCaseGroups.isFetching ||
174
+ isCaseGroupUpdating ||
175
+ isCaseOwnerUpdating, isLoadingList: !isCaseOwnerUpdating && (ownersCaseGroups.isFetching || isCaseGroupUpdating), onChange: onCaseGroupChange, isInValid: ownersCaseGroups.isError || showEmptyValidationError || (caseNumber && isSelectedUngroupedInvalid), required: isGroupMandatory, onOuterClick: onOuterClickGroupCheck, "data-tracking-id": "get-support-group" }),
172
176
  caseNumber && isSelectedUngroupedInvalid && (React.createElement("p", { className: "form-instructions form-invalid" },
173
177
  React.createElement(Trans, null, "'Ungrouped Case' cannot be selected. Please select a group."))),
174
178
  showEmptyValidationError && isGroupMandatory && (React.createElement("p", { className: "form-instructions form-invalid" },
@@ -1 +1 @@
1
- {"version":3,"file":"NewProductVersionSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/NewProductVersionSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAKpE,UAAU,MAAM;IACZ,eAAe,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IACrC,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,YAAY,EAAE,MAAM,CAAC;IACrB,wBAAwB,EAAE,OAAO,CAAC;CACrC;AAED,eAAO,MAAM,yBAAyB,UAAW,MAAM,gBAiFtD,CAAC"}
1
+ {"version":3,"file":"NewProductVersionSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/NewProductVersionSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAMpE,UAAU,MAAM;IACZ,eAAe,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IACrC,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,YAAY,EAAE,MAAM,CAAC;IACrB,wBAAwB,EAAE,OAAO,CAAC;CACrC;AAED,eAAO,MAAM,yBAAyB,UAAW,MAAM,gBA+EtD,CAAC"}
@@ -1,7 +1,9 @@
1
1
  import { Select, SelectGroup, SelectOption, SelectVariant } from '@patternfly/react-core';
2
2
  import isEmpty from 'lodash/isEmpty';
3
3
  import React, { useEffect, useState } from 'react';
4
+ import { useTranslation } from 'react-i18next';
4
5
  export const NewProductVersionSelector = (props) => {
6
+ const { t } = useTranslation();
5
7
  const [isOpen, setIsOpen] = useState(false);
6
8
  const [selected, setSelected] = useState('');
7
9
  const [selectVersionOptions, setSelectVersionOptions] = React.useState([]);
@@ -31,9 +33,7 @@ export const NewProductVersionSelector = (props) => {
31
33
  renderVersions();
32
34
  // eslint-disable-next-line react-hooks/exhaustive-deps
33
35
  }, [props.selectedProduct]);
34
- let options = [
35
- React.createElement(SelectGroup, { label: "Version", key: "productVersions" }, selectVersionOptions),
36
- ];
36
+ let options = [React.createElement(SelectGroup, { label: "Version", key: "productVersions" }), ...selectVersionOptions];
37
37
  const onToggle = (isOpen) => {
38
38
  setIsOpen(isOpen);
39
39
  };
@@ -53,5 +53,5 @@ export const NewProductVersionSelector = (props) => {
53
53
  // eslint-disable-next-line react-hooks/exhaustive-deps
54
54
  }, [props.versionState]);
55
55
  const titleId = 'version-selector';
56
- return (React.createElement(Select, { variant: SelectVariant.single, onToggle: onToggle, onSelect: onSelect, isOpen: isOpen, placeholderText: "Select a version", "aria-labelledby": titleId, selections: selected, validated: isEmpty(selected) && showValidationLocal ? 'error' : 'default', isDisabled: isEmpty(props.selectedProduct.product), "data-tracking-id": "get-support-version-dropdown-selector" }, options));
56
+ return (React.createElement(Select, { variant: SelectVariant.single, onToggle: onToggle, onSelect: onSelect, isOpen: isOpen, placeholderText: t('Select a version'), "aria-labelledby": titleId, selections: selected, validated: isEmpty(selected) && showValidationLocal ? 'error' : 'default', isDisabled: isEmpty(props.selectedProduct.product), "data-tracking-id": "get-support-version-dropdown-selector" }, options));
57
57
  };
@@ -1 +1 @@
1
- {"version":3,"file":"AlertToastWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/AlertToastWrapper.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAc,EAAE,EAAE,EAAmC,MAAM,OAAO,CAAC;AAUnE,UAAU,MAAM;IACZ,qBAAqB,EAAE,CAAC,cAAc,EAAE,OAAO,KAAK,IAAI,CAAC;CAC5D;AAED,QAAA,MAAM,iBAAiB,EAAE,EAAE,CAAC,MAAM,CA8BjC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"AlertToastWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/AlertToastWrapper.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAc,EAAE,EAAE,EAAmC,MAAM,OAAO,CAAC;AAWnE,UAAU,MAAM;IACZ,qBAAqB,EAAE,CAAC,cAAc,EAAE,OAAO,KAAK,IAAI,CAAC;CAC5D;AAED,QAAA,MAAM,iBAAiB,EAAE,EAAE,CAAC,MAAM,CAuCjC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -2,8 +2,11 @@
2
2
  * We need to wrap Critical solution toast notification and Cluster recommendation toast notification so they don't get overlapped.
3
3
  */
4
4
  import { AlertGroup } from '@patternfly/react-core';
5
+ import { PreviousCaseTypes } from '@rh-support/utils';
6
+ import isEqual from 'lodash/isEqual';
5
7
  import React, { useContext, useEffect, useState } from 'react';
6
8
  import { isUploadedAndAnalyzed } from '../../components/shared/fileUpload/reducer/AttachmentHelper';
9
+ import { useCaseSelector } from '../../context/CaseContext';
7
10
  import { RouteContext } from '../../context/RouteContext';
8
11
  import { hideSideBarClusterIdRuleToast } from '../../reducers/RouteConstNTypes';
9
12
  import { AttachmentStateContext } from '../shared/fileUpload';
@@ -13,10 +16,15 @@ import CriticalSolutionsToast from './CriticalSolutionsToast';
13
16
  const AlertToastWrapper = ({ submitCaseAndNavigate }) => {
14
17
  const { routeState: { activeSection }, } = useContext(RouteContext);
15
18
  const [isCriticalSolutionsVisible, setIsCriticalSolutionsVisible] = useState(true);
19
+ const { caseType } = useCaseSelector((state) => ({
20
+ caseType: state.caseDetails.caseType,
21
+ }), isEqual);
16
22
  const { attachmentState } = useContext(AttachmentStateContext);
17
23
  useEffect(() => {
18
24
  const isEveryFileFinished = attachmentState.caseFiles.selectedLocalFiles.every((file) => isUploadedAndAnalyzed(file));
19
- isEveryFileFinished && setIsCriticalSolutionsVisible(true);
25
+ isEveryFileFinished &&
26
+ caseType !== PreviousCaseTypes.FEATURE_ENHANCEMENT &&
27
+ setIsCriticalSolutionsVisible(true);
20
28
  // eslint-disable-next-line react-hooks/exhaustive-deps
21
29
  }, [attachmentState.caseFiles.selectedLocalFiles]);
22
30
  const hideClusterIdReportModal = hideSideBarClusterIdRuleToast.includes(activeSection);
@@ -1 +1 @@
1
- {"version":3,"file":"CriticalSolutionsToast.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/CriticalSolutionsToast.tsx"],"names":[],"mappings":"AACA,OAAc,EAAE,EAAE,EAAmC,MAAM,OAAO,CAAC;AAKnE,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,IAAI,CAAC;CAC1B;AAED,QAAA,MAAM,sBAAsB,EAAE,EAAE,CAAC,MAAM,CAiDtC,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
1
+ {"version":3,"file":"CriticalSolutionsToast.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/CriticalSolutionsToast.tsx"],"names":[],"mappings":"AAGA,OAAc,EAAE,EAAE,EAAmC,MAAM,OAAO,CAAC;AAMnE,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,IAAI,CAAC;CAC1B;AAED,QAAA,MAAM,sBAAsB,EAAE,EAAE,CAAC,MAAM,CAyDtC,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
@@ -1,6 +1,9 @@
1
1
  import { Alert, AlertActionCloseButton, Button } from '@patternfly/react-core';
2
+ import { PreviousCaseTypes } from '@rh-support/utils';
3
+ import isEqual from 'lodash/isEqual';
2
4
  import React, { useContext, useEffect, useState } from 'react';
3
5
  import { Trans, useTranslation } from 'react-i18next';
6
+ import { useCaseSelector } from '../../context/CaseContext';
4
7
  import { RulesDispatchContext, RulesStateContext } from '../../context/RulesContext';
5
8
  import { RulesReducerConstants } from '../../reducers/RulesReducer';
6
9
  const CriticalSolutionsToast = (props) => {
@@ -8,6 +11,9 @@ const CriticalSolutionsToast = (props) => {
8
11
  const [showNotification, setShowNotification] = useState(false);
9
12
  const { rulesState } = useContext(RulesStateContext);
10
13
  const rulesDispatch = useContext(RulesDispatchContext);
14
+ const { caseType } = useCaseSelector((state) => ({
15
+ caseType: state.caseDetails.caseType,
16
+ }), isEqual);
11
17
  useEffect(() => {
12
18
  if (rulesState.triggerRuleNotification && !showNotification) {
13
19
  setShowNotification(true);
@@ -36,6 +42,6 @@ const CriticalSolutionsToast = (props) => {
36
42
  if (!showNotification && !rulesState.triggerRuleNotification)
37
43
  return null;
38
44
  return (React.createElement(Alert, { isLiveRegion: true, variant: "success", title: t('File recommendations are ready to view'), "data-tracking-id": "toast-view-crit-sol", actionLinks: React.createElement(Button, { isInline: true, variant: "link", onClick: viewCriticalSolution },
39
- React.createElement(Trans, null, "Troubleshooting specific for your uploaded files.")), actionClose: React.createElement(AlertActionCloseButton, { variantLabel: "success alert", onClose: onClose }) }));
45
+ React.createElement(Trans, null, "Troubleshooting specific for your uploaded files.")), actionClose: React.createElement(AlertActionCloseButton, { variantLabel: "success alert", onClose: onClose }), timeout: caseType !== PreviousCaseTypes.FEATURE_ENHANCEMENT }));
40
46
  };
41
47
  export default CriticalSolutionsToast;
@@ -1 +1 @@
1
- {"version":3,"file":"InsightsResults.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/InsightsResults.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAgC,MAAM,0CAA0C,CAAC;AAG7G,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAwB5D,UAAU,MAAO,SAAQ,gBAAgB;IACrC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B;AASD,MAAM,WAAW,wBAAyB,SAAQ,mBAAmB;IACjE,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,OAAO,CAAC;CAClB;AAED,iBAAS,eAAe,CAAC,KAAK,EAAE,MAAM,eAuPrC;kBAvPQ,eAAe;;;AA0PxB,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"InsightsResults.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/InsightsResults.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAgC,MAAM,0CAA0C,CAAC;AAG7G,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAwB5D,UAAU,MAAO,SAAQ,gBAAgB;IACrC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B;AASD,MAAM,WAAW,wBAAyB,SAAQ,mBAAmB;IACjE,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,OAAO,CAAC;CAClB;AAED,iBAAS,eAAe,CAAC,KAAK,EAAE,MAAM,eAyPrC;kBAzPQ,eAAe;;;AA4PxB,eAAe,eAAe,CAAC"}
@@ -21,7 +21,7 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  import { search } from '@cee-eng/hydrajs';
22
22
  import { Alert } from '@patternfly/react-core';
23
23
  import { usePrevious } from '@rh-support/components';
24
- import { getSolrParams } from '@rh-support/utils';
24
+ import { getSolrParams, PreviousCaseTypes } from '@rh-support/utils';
25
25
  import difference from 'lodash/difference';
26
26
  import filter from 'lodash/filter';
27
27
  import flatMap from 'lodash/flatMap';
@@ -49,7 +49,7 @@ const defaultProps = {
49
49
  function InsightsResults(props) {
50
50
  const recommendationDispatch = useContext(RecommendationDispatchContext);
51
51
  const { attachmentState: { includeAnalysisResults, caseFiles: { selectedLocalFiles }, }, } = useContext(AttachmentStateContext);
52
- const { product, version, environment, summary, issue, periodicityOfIssue, timeFramesAndUrgency } = useCaseSelector((state) => ({
52
+ const { product, version, environment, summary, issue, periodicityOfIssue, timeFramesAndUrgency, caseType } = useCaseSelector((state) => ({
53
53
  product: state.caseDetails.product,
54
54
  version: state.caseDetails.version,
55
55
  environment: state.caseDetails.environment,
@@ -57,6 +57,7 @@ function InsightsResults(props) {
57
57
  issue: state.caseDetails.issue,
58
58
  periodicityOfIssue: state.caseDetails.periodicityOfIssue,
59
59
  timeFramesAndUrgency: state.caseDetails.timeFramesAndUrgency,
60
+ caseType: state.caseDetails.caseType,
60
61
  }), isEqual);
61
62
  const [recommendedResultsMap, setRecommendedResultsMap] = useState({});
62
63
  const [insightResultsMap, setInsightResultsMap] = useState({});
@@ -238,7 +239,7 @@ function InsightsResults(props) {
238
239
  return (React.createElement(InsightResultModal, { EARule: validEARules, onModalToggle: insightsModalToggle, isOpen: isRuleModalVisible, insightResults: allResults, isRenderedMain: true }));
239
240
  }
240
241
  return (React.createElement(React.Fragment, null,
241
- !rulesState.triggerRuleNotification && (React.createElement(Alert, { isInline: true, title: t('File recommendations are ready to view'), "data-tracking-id": "inline-view-crit-sol", children: React.createElement("p", null,
242
+ !rulesState.triggerRuleNotification && caseType !== PreviousCaseTypes.FEATURE_ENHANCEMENT && (React.createElement(Alert, { isInline: true, title: t('File recommendations are ready to view'), "data-tracking-id": "inline-view-critical-solution", children: React.createElement("p", null,
242
243
  React.createElement(Trans, null, "Troubleshooting specific for your uploaded files.")) })),
243
244
  React.createElement(InsightResultModal, { EARule: validEARules, onModalToggle: insightsModalToggle, isOpen: isRuleModalVisible, insightResults: allResults })));
244
245
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TroubleshootSection.d.ts","sourceRoot":"","sources":["../../../../src/components/TroubleshootSection/TroubleshootSection.tsx"],"names":[],"mappings":"AAcA,UAAU,MAAM;IACZ,cAAc,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC5B;AASD,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,eAmDzC;kBAnDQ,mBAAmB;;;AAsD5B,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"TroubleshootSection.d.ts","sourceRoot":"","sources":["../../../../src/components/TroubleshootSection/TroubleshootSection.tsx"],"names":[],"mappings":"AAiBA,UAAU,MAAM;IACZ,cAAc,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC5B;AASD,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,eAuFzC;kBAvFQ,mBAAmB;;;AA0F5B,eAAe,mBAAmB,CAAC"}
@@ -1,4 +1,7 @@
1
1
  import { ErrorBoundary, LoadingDots } from '@rh-support/components';
2
+ import { GlobalMetadataStateContext } from '@rh-support/react-context';
3
+ import { ability, CaseListFields, resourceActions, resources } from '@rh-support/user-permissions';
4
+ import { PreviousCaseTypes } from '@rh-support/utils';
2
5
  import isEmpty from 'lodash/isEmpty';
3
6
  import isEqual from 'lodash/isEqual';
4
7
  import React, { useContext } from 'react';
@@ -21,30 +24,43 @@ function TroubleshootSection(props) {
21
24
  var _a;
22
25
  const { t } = useTranslation();
23
26
  const { topContentState: { topContent }, } = useContext(TCStateContext);
24
- const { product, version, isCreatingCase } = useCaseSelector((state) => ({
27
+ const { globalMetadataState: { loggedInUsersAccount }, } = useContext(GlobalMetadataStateContext);
28
+ const { product, version, isCreatingCase, caseType } = useCaseSelector((state) => ({
25
29
  product: state.caseDetails.product,
26
30
  version: state.caseDetails.version,
27
31
  isCreatingCase: state.isCreatingCase,
32
+ caseType: state.caseDetails.caseType,
28
33
  }), isEqual);
34
+ const isIdea = caseType === PreviousCaseTypes.FEATURE_ENHANCEMENT;
29
35
  const canShowTopProducts = isEmpty(product);
30
36
  const canShowTopContent = !canShowTopProducts && ((_a = topContent === null || topContent === void 0 ? void 0 : topContent.data) === null || _a === void 0 ? void 0 : _a.length) > 0;
37
+ const canAddAttachments = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.ATTACHMENTS);
31
38
  return (React.createElement(React.Fragment, null,
32
39
  !isCreatingCase && (React.createElement("section", { className: "push-bottom" },
33
40
  React.createElement(OpenShiftClusterId, null))),
34
41
  React.createElement("section", null,
35
42
  React.createElement("header", null,
36
- topContent.data.length > 0 && (React.createElement("h3", null,
43
+ React.createElement("h3", null,
37
44
  React.createElement(Trans, null,
38
45
  "Because you selected",
39
46
  ' ',
40
- React.createElement("p", { className: "pf-u-font-weight-bold selected-product-suggestion" }, product)))),
47
+ React.createElement("p", { className: "pf-u-font-weight-bold selected-product-suggestion" }, product))),
41
48
  React.createElement(LoadingDots, { show: topContent.isFetching }),
49
+ topContent.data.length === 0 && (React.createElement("div", { className: "card card-white card-support" },
50
+ React.createElement("h3", { className: "card-heading popular-solutions" },
51
+ React.createElement(Trans, null, "Popular solutions and docs")),
52
+ React.createElement("div", { className: "card-body" },
53
+ React.createElement(Trans, null, "No recommendations for this product")))),
42
54
  React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading suggestions') } }, canShowTopContent && !isEmpty(version) && React.createElement(Suggestions, null)),
43
55
  !isCreatingCase && React.createElement(ClusterRecommendations, { className: "push-top" }))),
44
56
  React.createElement("section", { className: "pf-u-mt-lg" },
45
57
  React.createElement(InsightsResults, { isDisplayOnMain: true }),
46
- React.createElement("div", { className: "push-top" },
47
- React.createElement(FileDiag, null)))));
58
+ React.createElement("div", { className: "push-top" }, canAddAttachments ? (React.createElement(FileDiag, null)) : (React.createElement("div", { className: "card card-white card-support file-diag" },
59
+ React.createElement("h3", { className: "card-heading" }, isIdea || loggedInUsersAccount.data.secureSupport ? (React.createElement(Trans, null, "File uploader")) : (React.createElement(Trans, null, "File uploader and analyzer"))),
60
+ React.createElement("div", { className: "card-body" },
61
+ React.createElement("div", { className: "display-dashed pf-u-font-weight-bold pf-u-text-align-center" },
62
+ React.createElement(Trans, null, "You do not have access to upload files"),
63
+ "."))))))));
48
64
  }
49
65
  TroubleshootSection.defaultProps = defaultProps;
50
66
  export default TroubleshootSection;
@@ -1 +1 @@
1
- {"version":3,"file":"WidgetFileUploader.d.ts","sourceRoot":"","sources":["../../../../../src/components/shared/fileUpload/WidgetFileUploader.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,KAA0C,MAAM,OAAO,CAAC;AA2B/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAInD,UAAU,MAAO,SAAQ,wBAAwB,EAAE,gBAAgB;IAC/D,UAAU,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IACtC,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB;AAYD,iBAAS,kBAAkB,CAAC,KAAK,EAAE,MAAM,eAsLxC;kBAtLQ,kBAAkB;;;AA0L3B,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
1
+ {"version":3,"file":"WidgetFileUploader.d.ts","sourceRoot":"","sources":["../../../../../src/components/shared/fileUpload/WidgetFileUploader.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,KAA0C,MAAM,OAAO,CAAC;AA2B/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAInD,UAAU,MAAO,SAAQ,wBAAwB,EAAE,gBAAgB;IAC/D,UAAU,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IACtC,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB;AAYD,iBAAS,kBAAkB,CAAC,KAAK,EAAE,MAAM,eAwLxC;kBAxLQ,kBAAkB;;;AA4L3B,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
@@ -126,12 +126,14 @@ function WidgetFileUploader(props) {
126
126
  React.createElement("h3", { className: "card-heading" }, props.isIdea || props.isSecureSupport ? (React.createElement(Trans, null, "File uploader")) : (React.createElement(Trans, null, "File uploader and analyzer"))),
127
127
  React.createElement("div", { className: "card-body" },
128
128
  props.isIdea ? (React.createElement(WidgetFileSelectorImage, { isSessionId: props.isSessionId, isPrivate: props.isPrivate })) : (React.createElement(WidgetFileSelector, { isSessionId: props.isSessionId, isPrivate: props.isPrivate })),
129
- !hasSomeSelectedFiles(selectedLocalFiles) ? (props.helperText || (React.createElement("p", { className: "pf-u-mt-sm" }, !props.isIdea ? (React.createElement(Trans, { i18nKey: "i18nUploadSosReport" },
130
- "Upload a",
131
- ' ',
132
- React.createElement("a", { href: "/solutions/3592", target: "_blank" }, "sosreport"),
133
- "to help us provide the best solutions for your system.")) : (React.createElement("span", { className: "pf-u-font-family-redhatVF-heading-sans-serif pf-u-color-300" },
134
- React.createElement(Trans, null, "Allowed file types: png, gif, jpg, jpeg.")))))) : (React.createElement(React.Fragment, null,
129
+ !hasSomeSelectedFiles(selectedLocalFiles) ? ((!props.isIdea && props.helperText) || (React.createElement("p", { className: "pf-u-mt-sm" },
130
+ !props.isIdea ? (React.createElement(Trans, { i18nKey: "i18nUploadSosReport" },
131
+ "Upload a",
132
+ ' ',
133
+ React.createElement("a", { href: "/solutions/3592", target: "_blank" }, "sosreport"),
134
+ "to help us provide the best solutions for your system.")) : (React.createElement("span", { className: "pf-u-font-family-redhatVF-heading-sans-serif pf-u-color-300" },
135
+ React.createElement(Trans, null, "Allowed file types: png, gif, jpg, jpeg."))),
136
+ ' '))) : (React.createElement(React.Fragment, null,
135
137
  React.createElement(FileLister, { selectedLocalFiles: attachmentState.caseFiles.selectedLocalFiles, onFileEdit: editFile, onFileRemove: removeFile, onRetry: retryUpload, onRetryAnalysis: retryAnalysis, isSessionId: props.isSessionId, showSlowUploadMsg: attachmentState.showUploadingOnSlowConnectionMsg }),
136
138
  hasUploadedSomeAttachments(selectedLocalFiles) && !props.isIdea && (React.createElement("p", null,
137
139
  React.createElement(Trans, null, "If you can't find a solution, all files are moved to your case."))))),
@@ -139,6 +141,7 @@ function WidgetFileUploader(props) {
139
141
  isAnalysingAnyAttachment(attachmentState.caseFiles.selectedLocalFiles) && (React.createElement(Button, { isDisabled: true },
140
142
  React.createElement(Trans, null, "Analyzing..."))),
141
143
  showViewRecBtn &&
144
+ !props.isIdea &&
142
145
  !isAnalysingAnyAttachment(attachmentState.caseFiles.selectedLocalFiles) &&
143
146
  hasAnalysedSomeAttachments(attachmentState.caseFiles.selectedLocalFiles) && (React.createElement(Button, { "data-tracking-id": "widget-file-uploader-view-recs", onClick: onViewRecBtnClick },
144
147
  React.createElement(Trans, null, "View recommendations"))))));
@@ -1 +1 @@
1
- {"version":3,"file":"useIsSectionValid.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/useIsSectionValid.tsx"],"names":[],"mappings":"AAyBA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAGnE,wBAAgB,iBAAiB,CAAC,WAAW,GAAE,gBAAuB;;;;;EA2LrE"}
1
+ {"version":3,"file":"useIsSectionValid.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/useIsSectionValid.tsx"],"names":[],"mappings":"AAyBA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAGnE,wBAAgB,iBAAiB,CAAC,WAAW,GAAE,gBAAuB;;;;;EA4LrE"}
@@ -48,7 +48,8 @@ export function useIsSectionValid(sectionName = null) {
48
48
  !allProducts.isError &&
49
49
  !topContent.isFetching &&
50
50
  !isEmpty(summary) &&
51
- !recommendationState.isLoadingRecommendations);
51
+ !recommendationState.isLoadingRecommendations &&
52
+ summary.length < SUMMARY_LENGTH_LIMIT);
52
53
  };
53
54
  const isCaseManagementSectionValid = () => {
54
55
  const hasContactInfo24x7ValidLength = contactInfo24x7
@@ -1789,3 +1789,9 @@ div.case-details-ref-number {
1789
1789
  color: var(--pf-global--Color--100) !important;
1790
1790
  }
1791
1791
  }
1792
+
1793
+ .display-dashed {
1794
+ padding: 0.5rem;
1795
+ border: 2px dashed var(--pf-global--palette--black-600);
1796
+ background-color: var(--pf-global--palette--black-300);
1797
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "2.0.2-beta.0",
3
+ "version": "2.0.4",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -73,11 +73,11 @@
73
73
  "@patternfly/react-core": "4.264.0",
74
74
  "@progress/kendo-drawing": "^1.6.0",
75
75
  "@progress/kendo-react-pdf": "^3.12.0",
76
- "@rh-support/components": "2.0.2-beta.0",
77
- "@rh-support/react-context": "2.0.2-beta.0",
76
+ "@rh-support/components": "2.0.4",
77
+ "@rh-support/react-context": "2.0.4",
78
78
  "@rh-support/types": "2.0.1",
79
- "@rh-support/user-permissions": "2.0.1-beta.0",
80
- "@rh-support/utils": "2.0.1-beta.0",
79
+ "@rh-support/user-permissions": "2.0.4",
80
+ "@rh-support/utils": "2.0.4",
81
81
  "@types/react-redux": "^7.1.12",
82
82
  "@types/redux": "^3.6.0",
83
83
  "@webcomponents/webcomponentsjs": "^2.2.10",
@@ -145,5 +145,5 @@
145
145
  "not ie <= 11",
146
146
  "not op_mini all"
147
147
  ],
148
- "gitHead": "d8aaf95219bd66267ccfeef0d708d88dadc60766"
148
+ "gitHead": "30c2ea68d7e31306b5bce11d448f45070f97f7cd"
149
149
  }