@rh-support/troubleshoot 2.2.148 → 2.2.150

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.
Files changed (66) hide show
  1. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInformation.d.ts.map +1 -1
  2. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInformation.js +3 -7
  3. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.d.ts.map +1 -1
  4. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.js +1 -6
  5. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.js +3 -3
  6. package/lib/esm/components/CaseInformation/CaseInformation.d.ts.map +1 -1
  7. package/lib/esm/components/CaseInformation/CaseInformation.js +0 -2
  8. package/lib/esm/components/CaseInformation/ContactPhoneNumber.d.ts.map +1 -1
  9. package/lib/esm/components/CaseInformation/ContactPhoneNumber.js +0 -2
  10. package/lib/esm/components/CaseInformation/Description.d.ts +1 -0
  11. package/lib/esm/components/CaseInformation/Description.d.ts.map +1 -1
  12. package/lib/esm/components/CaseInformation/Description.js +6 -13
  13. package/lib/esm/components/CaseInformation/OpenCaseIssue.d.ts +1 -0
  14. package/lib/esm/components/CaseInformation/OpenCaseIssue.d.ts.map +1 -1
  15. package/lib/esm/components/CaseInformation/OpenCaseIssue.js +36 -19
  16. package/lib/esm/components/CaseManagement/OpenShiftClusterId.d.ts.map +1 -1
  17. package/lib/esm/components/CaseManagement/OpenShiftClusterId.js +3 -7
  18. package/lib/esm/components/ImproveCase/KtQuestions.d.ts.map +1 -1
  19. package/lib/esm/components/ImproveCase/KtQuestions.js +65 -14
  20. package/lib/esm/components/OpenCase/NewFeatureModal.d.ts +4 -0
  21. package/lib/esm/components/OpenCase/NewFeatureModal.d.ts.map +1 -0
  22. package/lib/esm/components/OpenCase/NewFeatureModal.js +38 -0
  23. package/lib/esm/components/OpenCase/OpenCase.js +2 -2
  24. package/lib/esm/components/ProductSelector/AllProductsSelector.js +1 -1
  25. package/lib/esm/components/ProductSelector/ProductSelector.d.ts +1 -0
  26. package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
  27. package/lib/esm/components/ProductSelector/ProductSelector.js +1 -1
  28. package/lib/esm/components/Recommendations/EARules/EARuleWidget.d.ts.map +1 -1
  29. package/lib/esm/components/Recommendations/EARules/EARuleWidget.js +7 -5
  30. package/lib/esm/components/Recommendations/RecommendationInfoBox.d.ts.map +1 -1
  31. package/lib/esm/components/Recommendations/RecommendationInfoBox.js +10 -8
  32. package/lib/esm/components/Recommendations/Recommendations.d.ts +1 -0
  33. package/lib/esm/components/Recommendations/Recommendations.d.ts.map +1 -1
  34. package/lib/esm/components/Recommendations/Recommendations.js +17 -6
  35. package/lib/esm/components/Review/Review.d.ts.map +1 -1
  36. package/lib/esm/components/Review/Review.js +0 -2
  37. package/lib/esm/components/TroubleshootSection/TroubleshootSection.d.ts.map +1 -1
  38. package/lib/esm/components/TroubleshootSection/TroubleshootSection.js +8 -4
  39. package/lib/esm/components/shared/fileUpload/WidgetFileUploader.d.ts.map +1 -1
  40. package/lib/esm/components/shared/fileUpload/WidgetFileUploader.js +2 -3
  41. package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
  42. package/lib/esm/components/shared/useIsSectionValid.js +6 -3
  43. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
  44. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +2 -38
  45. package/lib/esm/components/wizardLayout/WizardMain.d.ts.map +1 -1
  46. package/lib/esm/components/wizardLayout/WizardMain.js +7 -2
  47. package/lib/esm/components/wizardLayout/WizardNavigation.d.ts +1 -0
  48. package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
  49. package/lib/esm/components/wizardLayout/WizardNavigation.js +2 -1
  50. package/lib/esm/hooks/useWizard.d.ts +6 -1
  51. package/lib/esm/hooks/useWizard.d.ts.map +1 -1
  52. package/lib/esm/hooks/useWizard.js +10 -6
  53. package/lib/esm/reducers/CaseConstNTypes.d.ts +11 -5
  54. package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
  55. package/lib/esm/reducers/CaseConstNTypes.js +11 -5
  56. package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
  57. package/lib/esm/reducers/CaseHelpers.js +4 -4
  58. package/lib/esm/reducers/RecommendationsReducer.d.ts +3 -1
  59. package/lib/esm/reducers/RecommendationsReducer.d.ts.map +1 -1
  60. package/lib/esm/reducers/RecommendationsReducer.js +2 -0
  61. package/lib/esm/scss/_main.scss +6 -0
  62. package/lib/esm/scss/_pf-overrides.scss +21 -0
  63. package/package.json +4 -4
  64. package/lib/esm/components/OpenCase/MandatoryPhoneBanner.d.ts +0 -4
  65. package/lib/esm/components/OpenCase/MandatoryPhoneBanner.d.ts.map +0 -1
  66. package/lib/esm/components/OpenCase/MandatoryPhoneBanner.js +0 -29
@@ -1 +1 @@
1
- {"version":3,"file":"CaseInformation.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseInformation.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAK5D,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,UAAU,MAAO,SAAQ,gBAAgB;CAAG;AAE5C,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,qBAqE5C"}
1
+ {"version":3,"file":"CaseInformation.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseInformation.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAK5D,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,UAAU,MAAO,SAAQ,gBAAgB;CAAG;AAE5C,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,qBAkE5C"}
@@ -9,19 +9,16 @@ import React from 'react';
9
9
  import { Trans } from 'react-i18next';
10
10
  import { useCaseSelector } from '../../../../context/CaseContext';
11
11
  import { KtQuestionConstant } from '../../../../reducers/CaseConstNTypes';
12
- import { isClusterIdEnabledForProduct } from '../../../../utils/caseOpenshiftClusterIdUtils';
13
12
  import EditDescription from '../../../EditDescription/EditDescription';
14
13
  import { CaseHostname } from './CaseHostname';
15
14
  import { CaseOpenshiftClusterId } from './CaseOpenshiftClusterId/CaseOpenshiftClusterId';
16
15
  import ProductVersion from './ProductVersion';
17
16
  export function CaseInformation(props) {
18
- var _a;
19
- const { product, description, caseType } = useCaseSelector((state) => ({
20
- product: state.caseDetails.product,
17
+ const { description, caseType } = useCaseSelector((state) => ({
21
18
  description: state.caseDetails.description,
22
19
  caseType: state.caseDetails.caseType,
23
20
  }), isEqual);
24
- const { globalMetadataState: { navBarRef, allProducts }, } = useGlobalStateContext();
21
+ const { globalMetadataState: { navBarRef }, } = useGlobalStateContext();
25
22
  // To replace description KTQ for Idea
26
23
  const replaceDescriptionHeading = (description) => {
27
24
  let ideaHeading = KtQuestionConstant.ideaIssue;
@@ -37,11 +34,10 @@ export function CaseInformation(props) {
37
34
  return { __html: DOMPurify.sanitize(text) };
38
35
  };
39
36
  const canEditDescription = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_DESCRIPTION);
40
- const hasCluster = isClusterIdEnabledForProduct(product, (_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult);
41
37
  return (React.createElement("section", { className: "card card-sm card-white" },
42
38
  React.createElement("form", null,
43
39
  React.createElement(ProductVersion, null),
44
- hasCluster && React.createElement(CaseOpenshiftClusterId, null),
40
+ React.createElement(CaseOpenshiftClusterId, null),
45
41
  React.createElement(CaseHostname, { inlineEditable: true }),
46
42
  React.createElement("div", { className: "form-group" }, !canEditDescription ? (React.createElement(React.Fragment, null,
47
43
  React.createElement("label", { htmlFor: "case-description" },
@@ -1 +1 @@
1
- {"version":3,"file":"CaseOpenshiftClusterId.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAqBvE,wBAAgB,sBAAsB,sBAsSrC"}
1
+ {"version":3,"file":"CaseOpenshiftClusterId.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAqBvE,wBAAgB,sBAAsB,sBAiSrC"}
@@ -96,12 +96,7 @@ export function CaseOpenshiftClusterId() {
96
96
  isClusterVisible();
97
97
  }
98
98
  // eslint-disable-next-line react-hooks/exhaustive-deps
99
- }, [product, version]);
100
- // user may change product and version we need to reset internal state
101
- // context api state will be reset on parent component each time user changes product and version
102
- useEffect(() => {
103
- clusterStateReset();
104
- }, [product, version]);
99
+ }, [product, allProducts.data]);
105
100
  /**
106
101
  * Hook to make sure that if cluster id comes from session or someother source
107
102
  * we also fetch the details for the cluster id so that we can have fields like cluster version while creating the case
@@ -57,11 +57,11 @@ function Summary(props) {
57
57
  try {
58
58
  yield updateCaseDetails(caseDispatch, caseNumber, caseDetails);
59
59
  setIsSummaryUpdating(false);
60
- ToastNotification.addSuccessMessage(t(`Problem statement has been successfully updated`));
60
+ ToastNotification.addSuccessMessage(t(`Title has been successfully updated`));
61
61
  }
62
62
  catch (e) {
63
63
  setIsSummaryUpdating(false);
64
- caseUpdateError.showError(e, t(`Problem statement failed to updated`));
64
+ caseUpdateError.showError(e, t(`Title failed to updated`));
65
65
  throw e;
66
66
  }
67
67
  });
@@ -124,7 +124,7 @@ function Summary(props) {
124
124
  });
125
125
  return (React.createElement(React.Fragment, null,
126
126
  React.createElement(NewInlineEdit, { labelProps: { htmlFor: 'case-details-summary' }, labelContent: React.createElement(React.Fragment, null,
127
- React.createElement(Trans, null, "Problem statement"),
127
+ React.createElement(Trans, null, "Title"),
128
128
  React.createElement(ValueChangedIcon, { afterLocalChange: afterLocalChange, isLocalChange: localSummaryChange, value: summary, getTooltipContent: getSummaryChangedTT }),
129
129
  React.createElement("span", { className: "form-required", "aria-hidden": true }, "*")), allowInlineEdit: props.inlineEditable, content: summary ? summary : t('No summary to display.'), saveDisabled: saveDisabled, hideLabel: props.hideLabel, hideSaveCancel: props.hideSaveCancel, charCount: (summaryState === null || summaryState === void 0 ? void 0 : summaryState.length) || 0, charTotal: SUMMARY_LENGTH_LIMIT, cancelToggleState: isCancelClicked, saveToggleState: isSaveClicked, isExportingPDF: isExportingPDF },
130
130
  React.createElement(TextInputGroup, null,
@@ -1 +1 @@
1
- {"version":3,"file":"CaseInformation.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/CaseInformation.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAErD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AASvD,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC;CACnC;AAED,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,MAAM,qBAkHpD"}
1
+ {"version":3,"file":"CaseInformation.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/CaseInformation.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAErD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAQvD,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC;CACnC;AAED,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,MAAM,qBAiHpD"}
@@ -10,7 +10,6 @@ import { OpenShiftClusterId } from '../CaseManagement/OpenShiftClusterId';
10
10
  import { Hostname } from '../ImproveCase/Hostname';
11
11
  import KtQuestions from '../ImproveCase/KtQuestions';
12
12
  import ClusterRecommendations from '../Recommendations/ClusterRecommendations';
13
- import Description from './Description';
14
13
  export default function CaseInformation(props) {
15
14
  const { t } = useTranslation();
16
15
  const { globalMetadataState: { allCaseTypes, allCaseSeverities, caseLanguages, loggedInUser, loggedInUserJwtToken, loggedInUsersAccount, }, } = useContext(GlobalMetadataStateContext);
@@ -81,6 +80,5 @@ export default function CaseInformation(props) {
81
80
  React.createElement(Hostname, null),
82
81
  React.createElement(OpenShiftClusterId, null),
83
82
  React.createElement(ClusterRecommendations, { className: "push-bottom" }),
84
- React.createElement(Description, { inlineEditable: false }),
85
83
  React.createElement(KtQuestions, null))))));
86
84
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ContactPhoneNumber.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/ContactPhoneNumber.tsx"],"names":[],"mappings":"AAOA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAkB/D,wBAAgB,kBAAkB,sBAyVjC"}
1
+ {"version":3,"file":"ContactPhoneNumber.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/ContactPhoneNumber.tsx"],"names":[],"mappings":"AAOA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAiB/D,wBAAgB,kBAAkB,sBAwVjC"}
@@ -24,7 +24,6 @@ import { setCaseDetails, setCaseState } from '../../reducers/CaseReducer';
24
24
  import { PDFContext } from '../CaseEditView/PDFContainer';
25
25
  import { removeAllChars, trimAndReplacePlus } from '../shared/utils';
26
26
  import { ContactPhoneNumberPopOver } from './ContactPhoneNumberPopOver';
27
- import MandatoryPhonePopOver from './MandatoryPhonePopOver';
28
27
  export function ContactPhoneNumber() {
29
28
  const { suppliedPhoneNumberVerified, phoneCountryCode = '', phoneAreaCodePrefixLineNumber = '', hasLoggedInUserConfirmedPhoneNumber, contactSSOName, shouldNotSetPhoneCountryCode, isCasePhoneUpdating, } = useCaseSelector((state) => ({
30
29
  suppliedPhoneNumberVerified: state.caseDetails.suppliedPhoneNumberVerified,
@@ -266,7 +265,6 @@ export function ContactPhoneNumber() {
266
265
  React.createElement("span", { className: `form-required ${isExportingPDF ? 'hide-in-pdf' : ''}`, "aria-hidden": true }, "*"),
267
266
  ContactPhoneNumberPopOver()),
268
267
  React.createElement(PhoneInput, { phoneValue: localFullPhone, countryCode: phoneCountryCode, onPhoneValueChange: onPhoneChange, onCountryCodeChange: onCountryCodeChange, validations: isPhoneNumberValid, invalid: invalid, setInvalid: setInvalid, isLoading: isFetchingSso || isCasePhoneUpdating, shouldNotSetCountryCode: shouldNotSetPhoneCountryCode, isDisabled: isFetchingSso || isCasePhoneUpdating }),
269
- React.createElement(MandatoryPhonePopOver, null),
270
268
  !invalid &&
271
269
  getPhone().length < PHONE_LIMIT &&
272
270
  !(isPhoneNumberEmpty && isNextBtnClickedToShowValidationError) &&
@@ -3,6 +3,7 @@ interface IProps {
3
3
  inlineEditable?: boolean;
4
4
  hideSaveCancel?: boolean;
5
5
  customTitle?: string;
6
+ isSummarizeInvalid?: boolean;
6
7
  }
7
8
  export default function Description(props: IProps): React.JSX.Element;
8
9
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"Description.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/Description.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAapD,UAAU,MAAM;IACZ,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAK,EAAE,MAAM,qBA0GhD"}
1
+ {"version":3,"file":"Description.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/Description.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAYxC,UAAU,MAAM;IACZ,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAK,EAAE,MAAM,qBA2GhD"}
@@ -2,35 +2,33 @@ import { TextArea } from '@patternfly/react-core';
2
2
  import { InlineEdit } from '@rh-support/components';
3
3
  import isEmpty from 'lodash/isEmpty';
4
4
  import isEqual from 'lodash/isEqual';
5
- import React, { useContext, useState } from 'react';
5
+ import React, { useState } from 'react';
6
6
  import { Trans, useTranslation } from 'react-i18next';
7
7
  import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
8
- import { RouteContext } from '../../context/RouteContext';
9
8
  import { CASE_DEATILS_ISSUE_LIMIT, LargeDescriptionErrorMessage, MODIFIED_DESCRIPTION_LENGTH_LIMIT, } from '../../reducers/CaseConstNTypes';
10
9
  import { getUpdatedDescription } from '../../reducers/CaseHelpers';
11
10
  import { setCaseDetails } from '../../reducers/CaseReducer';
12
11
  export default function Description(props) {
13
12
  const { t } = useTranslation();
14
- const { hasLargeCaseDescription, issue, environment, periodicityOfIssue, timeFramesAndUrgency, v3ClusterName } = useCaseSelector((state) => ({
13
+ const { hasLargeCaseDescription, issue, environment, periodicityOfIssue, timeFramesAndUrgency, v3ClusterName, summary, version, } = useCaseSelector((state) => ({
14
+ summary: state.caseDetails.summary,
15
15
  description: state.caseDetails.description,
16
16
  issue: state.caseDetails.issue,
17
17
  environment: state.caseDetails.environment,
18
+ version: state.caseDetails.version,
18
19
  periodicityOfIssue: state.caseDetails.periodicityOfIssue,
19
20
  timeFramesAndUrgency: state.caseDetails.timeFramesAndUrgency,
20
21
  hasLargeCaseDescription: state.hasLargeCaseDescription,
21
22
  v3ClusterName: state.v3ClusterName,
22
23
  }), isEqual);
23
24
  const caseDispatch = useCaseDispatch();
24
- const [hasFocusedLostKT4, setHasFocusedLostKT4] = useState(false);
25
25
  const [isIssueTextAreaFocused, setIssueTextAreaFocused] = useState(false);
26
26
  const onKTQ1IssueFocusChange = (e) => {
27
27
  setIssueTextAreaFocused(e.type === 'focus');
28
- e.type === 'blur' && setHasFocusedLostKT4(true);
29
28
  };
30
29
  const onCaseDetailsChange = (caseDetails) => {
31
30
  setCaseDetails(caseDispatch, caseDetails);
32
31
  };
33
- const { routeState: { isNextBtnClickedToShowValidationError }, } = useContext(RouteContext);
34
32
  const onKTQ1IssueChange = (value, e) => {
35
33
  const ktQ1Local = isEmpty(value === null || value === void 0 ? void 0 : value.trim()) ? '' : value;
36
34
  const newDescription = getUpdatedDescription(ktQ1Local, environment, periodicityOfIssue, timeFramesAndUrgency, v3ClusterName);
@@ -39,15 +37,10 @@ export default function Description(props) {
39
37
  const isKT1Required = true;
40
38
  //changing limit to 31000 to account for extra chars added during description combination to backend. True limit is 32000
41
39
  const descriptionErrorMessage = t(LargeDescriptionErrorMessage, { limit: MODIFIED_DESCRIPTION_LENGTH_LIMIT });
42
- const isDescriptionInvalid = (issue) => {
43
- return hasFocusedLostKT4 && isEmpty(issue);
44
- };
45
40
  return (React.createElement(InlineEdit, { labelContent: React.createElement(React.Fragment, null,
46
- props.customTitle ? (props.customTitle) : (React.createElement(Trans, null, "What are you experiencing? What are you expecting to happen?")),
41
+ props.customTitle ? (props.customTitle) : (React.createElement(Trans, null, "Describe your problem. Include specific actions and error messages.")),
47
42
  isKT1Required && (React.createElement("span", { className: "form-required", "aria-hidden": true }, "*"))), labelProps: { htmlFor: 'get-support-ktQ1-issue' }, content: issue, allowInlineEdit: !!props.inlineEditable, hideSaveCancel: !!props.hideSaveCancel, initialIsEditing: isEmpty(issue), usePreformattedTag: true, saveOnBlur: true },
48
- React.createElement(TextArea, { id: "get-support-ktQ1-issue", name: "get-support-ktQ1-issue", "aria-invalid": (issue === null || issue === void 0 ? void 0 : issue.length) > CASE_DEATILS_ISSUE_LIMIT ? 'true' : 'false', "aria-required": isKT1Required, isRequired: isKT1Required, value: issue, isDisabled: isEmpty(issue) && hasLargeCaseDescription && !setIssueTextAreaFocused, onChange: (e, value) => onKTQ1IssueChange(value, e), onFocus: onKTQ1IssueFocusChange, onBlur: onKTQ1IssueFocusChange, "data-tracking-id": "get-support-ktQ1-issue", placeholder: t('Please enter an elaborate description'), resizeOrientation: "vertical", validated: isDescriptionInvalid(issue) || (isNextBtnClickedToShowValidationError && isEmpty(issue))
49
- ? 'error'
50
- : 'default', rows: 5 }),
43
+ React.createElement(TextArea, { id: "get-support-ktQ1-issue", name: "get-support-ktQ1-issue", className: (isEmpty(summary) || isEmpty(version)) && isEmpty(issue) ? 'kt1-disabled' : '', "aria-invalid": (issue === null || issue === void 0 ? void 0 : issue.length) > CASE_DEATILS_ISSUE_LIMIT ? 'true' : 'false', "aria-required": isKT1Required, isRequired: isKT1Required, value: issue, disabled: (isEmpty(summary) || isEmpty(version)) && isEmpty(issue), isDisabled: hasLargeCaseDescription && !setIssueTextAreaFocused && isEmpty(issue), onChange: (e, value) => onKTQ1IssueChange(value, e), onFocus: onKTQ1IssueFocusChange, onBlur: onKTQ1IssueFocusChange, "data-tracking-id": "get-support-ktQ1-issue", placeholder: t(`Example: I'm unable to start the SSHD service receiving the error message \n"Bad yes/no argument for ShowPatchLevel parameter`), resizeOrientation: "vertical", validated: props.isSummarizeInvalid ? 'error' : 'default', rows: 10 }),
51
44
  React.createElement("p", { className: "form-instructions", "data-tracking-id": "large-20k-warning-ktQ1-environment" }, `${(issue === null || issue === void 0 ? void 0 : issue.length) > CASE_DEATILS_ISSUE_LIMIT
52
45
  ? `Description cannot be more than ${CASE_DEATILS_ISSUE_LIMIT} characters`
53
46
  : ''}`),
@@ -7,6 +7,7 @@ interface IProps {
7
7
  autoFocus?: boolean;
8
8
  hideSaveCancel?: boolean;
9
9
  supportType?: string;
10
+ isOnSummaryPage: boolean;
10
11
  }
11
12
  declare function OpenCaseIssue(props: IProps): React.JSX.Element;
12
13
  declare namespace OpenCaseIssue {
@@ -1 +1 @@
1
- {"version":3,"file":"OpenCaseIssue.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/OpenCaseIssue.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAQ/D,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;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AASD,iBAAS,aAAa,CAAC,KAAK,EAAE,MAAM,qBAuHnC;kBAvHQ,aAAa;;;AA0HtB,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"OpenCaseIssue.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/OpenCaseIssue.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAS/D,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;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,OAAO,CAAC;CAC5B;AASD,iBAAS,aAAa,CAAC,KAAK,EAAE,MAAM,qBA8InC;kBA9IQ,aAAa;;;AAiJtB,eAAe,aAAa,CAAC"}
@@ -6,8 +6,9 @@ import React, { useContext, useEffect, useState } from 'react';
6
6
  import { Trans, useTranslation } from 'react-i18next';
7
7
  import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
8
8
  import { RouteContext } from '../../context/RouteContext';
9
- import { SUMMARY_LENGTH_LIMIT } from '../../reducers/CaseConstNTypes';
9
+ import { ISSUE_SUMMARY_LENGTH_LIMIT, TITLE_SUMMARY_LENGTH_LIMIT } from '../../reducers/CaseConstNTypes';
10
10
  import { setCaseDetails } from '../../reducers/CaseReducer';
11
+ import Description from './Description';
11
12
  const defaultProps = {
12
13
  initialIsEditing: false,
13
14
  required: false,
@@ -17,13 +18,17 @@ const defaultProps = {
17
18
  };
18
19
  function OpenCaseIssue(props) {
19
20
  const { t } = useTranslation();
20
- const { summary, supportType } = useCaseSelector((state) => ({
21
+ const { summary, supportType, version, issue } = useCaseSelector((state) => ({
21
22
  summary: state.caseDetails.summary,
23
+ version: state.caseDetails.version,
22
24
  supportType: state.caseDetails.caseType,
25
+ issue: state.caseDetails.issue,
23
26
  }));
24
27
  const caseDispatch = useCaseDispatch();
25
28
  const [isSummaryEmpty, setIsSummaryEmpty] = useState(false);
26
- const [hasLargeSummary, setHasLargeSummary] = useState(false);
29
+ const [isIssueEmpty, setIsIssueEmpty] = useState(false);
30
+ const [hasLargeTitleSummary, setHasLargeTitleSummary] = useState(false);
31
+ const [hasLargeIssueSummary, setHasLargeIssueSummary] = useState(false);
27
32
  const { routeState: { isNextBtnClickedToShowValidationError }, } = useContext(RouteContext);
28
33
  const onSummaryBlur = (e) => {
29
34
  var _a;
@@ -35,43 +40,55 @@ function OpenCaseIssue(props) {
35
40
  const onSummaryChange = (e) => {
36
41
  var _a;
37
42
  const summaryLocal = isEmpty((_a = e.target.value) === null || _a === void 0 ? void 0 : _a.trim()) ? '' : e.target.value;
38
- setHasLargeSummary(summaryLocal.length > SUMMARY_LENGTH_LIMIT);
43
+ const fullLengthChanges = summaryLocal.length;
44
+ setHasLargeTitleSummary(fullLengthChanges > TITLE_SUMMARY_LENGTH_LIMIT); //255
39
45
  onCaseDetailsChange({ summary: summaryLocal });
40
46
  };
41
47
  const getVariant = () => {
42
- if (getIsSummaryInvalid())
48
+ if (getIssueSummaryInvalid())
43
49
  return ProgressVariant.danger;
44
- if (!summary)
50
+ if (!issue)
45
51
  return ProgressVariant.success;
46
- if (summary.length > SUMMARY_LENGTH_LIMIT / 2) {
52
+ if (issue.length > ISSUE_SUMMARY_LENGTH_LIMIT / 2) {
47
53
  return ProgressVariant.warning;
48
54
  }
49
55
  else {
50
56
  return ProgressVariant.success;
51
57
  }
52
58
  };
53
- const getIsSummaryInvalid = () => hasLargeSummary || (isNextBtnClickedToShowValidationError && isSummaryEmpty);
59
+ const getTitleSummaryInvalid = () => hasLargeTitleSummary || (isNextBtnClickedToShowValidationError && isSummaryEmpty);
60
+ const getIssueSummaryInvalid = () => hasLargeIssueSummary || (isNextBtnClickedToShowValidationError && isIssueEmpty);
54
61
  const isIdea = () => supportType === PreviousCaseTypes.FEATURE_ENHANCEMENT;
55
62
  useEffect(() => {
56
63
  setIsSummaryEmpty(summary ? isEmpty(summary.trim()) : true);
57
- summary && setHasLargeSummary(summary.length > SUMMARY_LENGTH_LIMIT);
64
+ setIsIssueEmpty(issue ? isEmpty(issue.trim()) : true);
65
+ summary && setHasLargeTitleSummary(summary.length > TITLE_SUMMARY_LENGTH_LIMIT);
66
+ issue && setHasLargeIssueSummary(issue.length > ISSUE_SUMMARY_LENGTH_LIMIT);
58
67
  // @ts-ignore
59
- }, [summary]);
68
+ }, [summary, issue]);
60
69
  return (React.createElement(React.Fragment, null,
61
70
  React.createElement(InlineEdit, { labelProps: {
62
71
  htmlFor: isIdea() ? 'get-support-title' : 'get-support-summary',
72
+ style: {
73
+ display: 'flex',
74
+ justifyContent: 'space-between',
75
+ alignItems: 'center',
76
+ },
63
77
  }, labelContent: React.createElement(React.Fragment, null,
64
- React.createElement(Trans, null, isIdea() ? 'Title' : 'Problem statement'),
78
+ React.createElement(Trans, null, 'Title'),
65
79
  ' ',
66
- !!props.required && (React.createElement("span", { className: "form-required", "aria-hidden": true }, "*"))), allowInlineEdit: props.inlineEditable, hideSaveCancel: !!props.hideSaveCancel, initialIsEditing: !!props.initialIsEditing, saveOnBlur: true, collapseOnBlur: !!props.collapseOnBlur && !isSummaryEmpty, content: summary },
67
- React.createElement("textarea", { id: isIdea() ? 'get-support-title' : 'get-support-summary', className: `form-control${getIsSummaryInvalid() ? ' form-invalid' : ''}`, "aria-invalid": getIsSummaryInvalid(), "aria-required": !!props.required, required: !!props.required, name: isIdea() ? 'get-support-title' : 'get-support-summary', placeholder: isIdea()
80
+ !!props.required && (React.createElement("span", { className: "form-required", "aria-hidden": true }, "*"))), helperContent: React.createElement("div", { className: "title-summary-counter" },
81
+ `${summary === null || summary === void 0 ? void 0 : summary.length} / ${TITLE_SUMMARY_LENGTH_LIMIT}`,
82
+ " "), allowInlineEdit: props.inlineEditable, hideSaveCancel: !!props.hideSaveCancel, initialIsEditing: !!props.initialIsEditing, saveOnBlur: true, collapseOnBlur: !!props.collapseOnBlur && !isSummaryEmpty, content: summary },
83
+ React.createElement("textarea", { id: isIdea() ? 'get-support-title' : 'get-support-summary', className: `form-control ${getTitleSummaryInvalid() ? ' form-invalid' : ''} ${isEmpty(version) ? 'issue-title-disabled' : ''}`, "aria-invalid": getTitleSummaryInvalid(), "aria-required": !!props.required, required: !!props.required, name: isIdea() ? 'get-support-title' : 'get-support-summary', placeholder: isIdea()
68
84
  ? t('i18nkeySummarizeIdea', "Summarize what you're experiencing today")
69
- : t('i18nkeySummarizeExperience', `Describe your problem in detail. Include specific steps already taken and error messages. (Limit: ${SUMMARY_LENGTH_LIMIT} characters)`), value: summary, onChange: onSummaryChange, onBlur: onSummaryBlur, autoFocus: !!props.autoFocus, "data-tracking-id": isIdea() ? 'get-support-title' : 'get-support-summary', rows: 3 }),
70
- React.createElement(Progress, { value: summary === null || summary === void 0 ? void 0 : summary.length, min: 0, max: SUMMARY_LENGTH_LIMIT, size: ProgressSize.sm, label: `${summary === null || summary === void 0 ? void 0 : summary.length} / ${SUMMARY_LENGTH_LIMIT}`, valueText: `${summary === null || summary === void 0 ? void 0 : summary.length} / ${SUMMARY_LENGTH_LIMIT}`, measureLocation: ProgressMeasureLocation.top, "aria-label": `Progress - ${summary === null || summary === void 0 ? void 0 : summary.length} / ${SUMMARY_LENGTH_LIMIT}`, variant: getVariant(), title: ' ', className: `pf-v5-u-mt-md ${!isNextBtnClickedToShowValidationError && isEmpty(summary) ? 'gray' : ''}`, id: "summary-progress-bar" })),
71
- hasLargeSummary && (React.createElement("div", { className: "pull-top" },
72
- React.createElement("p", { className: "form-instructions form-invalid" }, isIdea()
73
- ? t(`The title cannot be more than ${SUMMARY_LENGTH_LIMIT} characters.`)
74
- : t(`The problem statement cannot be more than ${SUMMARY_LENGTH_LIMIT} characters.`))))));
85
+ : t('i18nkeySummarizeExperience', 'Create a heading that summarizes your issue'), value: summary, onChange: onSummaryChange, onBlur: onSummaryBlur, autoFocus: !!props.autoFocus, "data-tracking-id": isIdea() ? 'get-support-title' : 'get-support-summary', rows: 1, disabled: isEmpty(version) }),
86
+ React.createElement(React.Fragment, null, hasLargeTitleSummary && (React.createElement("div", null,
87
+ React.createElement("p", { className: "form-instructions form-invalid" }, isIdea()
88
+ ? t(`The title cannot be more than ${TITLE_SUMMARY_LENGTH_LIMIT} characters.`)
89
+ : t(`The title cannot be more than ${TITLE_SUMMARY_LENGTH_LIMIT} characters.`))))),
90
+ React.createElement(Description, { isSummarizeInvalid: getIssueSummaryInvalid() }),
91
+ React.createElement(Progress, { value: issue === null || issue === void 0 ? void 0 : issue.length, min: 0, max: ISSUE_SUMMARY_LENGTH_LIMIT, size: ProgressSize.sm, label: `${issue === null || issue === void 0 ? void 0 : issue.length} / ${ISSUE_SUMMARY_LENGTH_LIMIT}`, valueText: `${issue === null || issue === void 0 ? void 0 : issue.length} / ${ISSUE_SUMMARY_LENGTH_LIMIT}`, measureLocation: ProgressMeasureLocation.top, "aria-label": `Progress - ${issue === null || issue === void 0 ? void 0 : issue.length} / ${ISSUE_SUMMARY_LENGTH_LIMIT}`, variant: getVariant(), title: ' ', className: `pf-v5-u-mt-md ${!isNextBtnClickedToShowValidationError && isEmpty(issue) ? 'gray' : ''}`, id: "summary-progress-bar" }))));
75
92
  }
76
93
  OpenCaseIssue.defaultProps = defaultProps;
77
94
  export default OpenCaseIssue;
@@ -1 +1 @@
1
- {"version":3,"file":"OpenShiftClusterId.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/OpenShiftClusterId.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAsB/D,eAAO,MAAM,oBAAoB,yBAShC,CAAC;AAEF,eAAO,MAAM,uBAAuB,yBAInC,CAAC;AAEF,eAAO,MAAM,4BAA4B,yBAUxC,CAAC;AAEF,eAAO,MAAM,qBAAqB,yBAIjC,CAAC;AAEF,UAAU,MAAM;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,qBAyR/C"}
1
+ {"version":3,"file":"OpenShiftClusterId.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/OpenShiftClusterId.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAsB/D,eAAO,MAAM,oBAAoB,yBAShC,CAAC;AAEF,eAAO,MAAM,uBAAuB,yBAInC,CAAC;AAEF,eAAO,MAAM,4BAA4B,yBAUxC,CAAC;AAEF,eAAO,MAAM,qBAAqB,yBAIjC,CAAC;AAEF,UAAU,MAAM;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,qBAqR/C"}
@@ -110,19 +110,15 @@ export function OpenShiftClusterId(props) {
110
110
  setIsClusterIdInValid(false);
111
111
  }
112
112
  }
113
+ if (!hasCluster) {
114
+ resetClusterData();
115
+ }
113
116
  });
114
117
  if ((((_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult) || []).length > 0) {
115
118
  isClusterVisible();
116
119
  }
117
120
  // eslint-disable-next-line react-hooks/exhaustive-deps
118
121
  }, [product, version, allProducts.data]);
119
- // On preview page user may change product and version we need to reset internal state
120
- // context api state will be reset on parent component each time user changes product and version
121
- useEffect(() => {
122
- clusterStateReset();
123
- v3ClusterNameInputBoxChanged(v3ClusterName);
124
- // eslint-disable-next-line react-hooks/exhaustive-deps
125
- }, [product, version]);
126
122
  /**
127
123
  * Hook to set clusterId fields when comes from session or backward/forward
128
124
  **/
@@ -1 +1 @@
1
- {"version":3,"file":"KtQuestions.d.ts","sourceRoot":"","sources":["../../../../src/components/ImproveCase/KtQuestions.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAgB/D,UAAU,MAAM;IACZ,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB;AAGD,iBAAS,WAAW,CAAC,KAAK,EAAE,MAAM,qBAkQjC;kBAlQQ,WAAW;;;AAoQpB,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"KtQuestions.d.ts","sourceRoot":"","sources":["../../../../src/components/ImproveCase/KtQuestions.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAoB/D,UAAU,MAAM;IACZ,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB;AAGD,iBAAS,WAAW,CAAC,KAAK,EAAE,MAAM,qBA2WjC;kBA3WQ,WAAW;;;AA6WpB,eAAe,WAAW,CAAC"}
@@ -1,4 +1,4 @@
1
- import { TextArea } from '@patternfly/react-core';
1
+ import { Progress, ProgressMeasureLocation, ProgressSize, ProgressVariant, TextArea } from '@patternfly/react-core';
2
2
  import { InlineEdit } from '@rh-support/components';
3
3
  import isEmpty from 'lodash/isEmpty';
4
4
  import isEqual from 'lodash/isEqual';
@@ -6,7 +6,7 @@ import React, { useContext, useEffect, useState } from 'react';
6
6
  import { useTranslation } from 'react-i18next';
7
7
  import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
8
8
  import { RouteContext } from '../../context/RouteContext';
9
- import { CASE_DEATILS_ENVIRONMENT_LIMIT, CASE_DEATILS_PERIODICITYOFISSUE_LIMIT, CASE_DETAILS_TIMEFRAMESANDURGENCY_LIMIT, KtQuestionConstant, LargeDescriptionErrorMessage, MODIFIED_DESCRIPTION_LENGTH_LIMIT, } from '../../reducers/CaseConstNTypes';
9
+ import { CASE_DEATILS_ENVIRONMENT_LIMIT, CASE_DEATILS_PERIODICITYOFISSUE_LIMIT, CASE_DETAILS_TIMEFRAMESANDURGENCY_LIMIT, KTQ2LengthError, KTQ3LengthError, KTQ4LengthError, KTQUESTION_MAX_LIMIT, KtQuestionConstant, LargeDescriptionErrorMessage, MODIFIED_DESCRIPTION_LENGTH_LIMIT, } from '../../reducers/CaseConstNTypes';
10
10
  import { getUpdatedDescription } from '../../reducers/CaseHelpers';
11
11
  import { setCaseDetails } from '../../reducers/CaseReducer';
12
12
  const defaultProps = { inlineEditable: false, hideSaveCancel: false, onlyShowKT4: false };
@@ -78,6 +78,60 @@ function KtQuestions(props) {
78
78
  const invalidateQT4 = (value) => {
79
79
  return isEmpty(value) && hasFocusedLostKT4;
80
80
  };
81
+ const [isQ2Empty, setIsQ2Empty] = useState(false);
82
+ const [isQ3Empty, setIsQ3Empty] = useState(false);
83
+ const [isQ4Empty, setIsQ4Empty] = useState(false);
84
+ const [hasLargeQ2, setHasLargeQ2] = useState(false);
85
+ const [hasLargeQ3, setHasLargeQ3] = useState(false);
86
+ const [hasLargeQ4, setHasLargeQ4] = useState(false);
87
+ useEffect(() => {
88
+ setIsQ2Empty(environment ? isEmpty(environment.trim()) : true);
89
+ setIsQ3Empty(periodicityOfIssue ? isEmpty(periodicityOfIssue.trim()) : true);
90
+ setIsQ4Empty(timeFramesAndUrgency ? isEmpty(timeFramesAndUrgency.trim()) : true);
91
+ environment && setHasLargeQ2(environment.length > KTQUESTION_MAX_LIMIT);
92
+ periodicityOfIssue && setHasLargeQ3(periodicityOfIssue.length > KTQUESTION_MAX_LIMIT);
93
+ timeFramesAndUrgency && setHasLargeQ4(timeFramesAndUrgency.length > KTQUESTION_MAX_LIMIT);
94
+ // @ts-ignore
95
+ }, [environment, periodicityOfIssue, timeFramesAndUrgency]);
96
+ const getQ2Invalid = () => hasLargeQ2 || (isNextBtnClickedToShowValidationError && isQ2Empty);
97
+ const getQ3Invalid = () => hasLargeQ3 || (isNextBtnClickedToShowValidationError && isQ3Empty);
98
+ const getQ4Invalid = () => hasLargeQ4 || (isNextBtnClickedToShowValidationError && isQ4Empty);
99
+ const getVariantQ2 = () => {
100
+ if (getQ2Invalid())
101
+ return ProgressVariant.danger;
102
+ if (!environment)
103
+ return ProgressVariant.success;
104
+ if (environment.length > KTQUESTION_MAX_LIMIT / 2) {
105
+ return ProgressVariant.warning;
106
+ }
107
+ else {
108
+ return ProgressVariant.success;
109
+ }
110
+ };
111
+ const getVariantQ3 = () => {
112
+ if (getQ3Invalid())
113
+ return ProgressVariant.danger;
114
+ if (!periodicityOfIssue)
115
+ return ProgressVariant.success;
116
+ if (periodicityOfIssue.length > KTQUESTION_MAX_LIMIT / 2) {
117
+ return ProgressVariant.warning;
118
+ }
119
+ else {
120
+ return ProgressVariant.success;
121
+ }
122
+ };
123
+ const getVariantQ4 = () => {
124
+ if (getQ4Invalid())
125
+ return ProgressVariant.danger;
126
+ if (!timeFramesAndUrgency)
127
+ return ProgressVariant.success;
128
+ if (timeFramesAndUrgency.length > KTQUESTION_MAX_LIMIT / 2) {
129
+ return ProgressVariant.warning;
130
+ }
131
+ else {
132
+ return ProgressVariant.success;
133
+ }
134
+ };
81
135
  return (React.createElement(React.Fragment, null,
82
136
  React.createElement(InlineEdit, { labelProps: { htmlFor: 'ktQ4-timeFramesAndUrgency' }, labelContent: React.createElement(React.Fragment, null,
83
137
  t(KtQuestionConstant.timeFramesAndUrgency),
@@ -89,20 +143,18 @@ function KtQuestions(props) {
89
143
  ? 'error'
90
144
  : 'default', "aria-invalid": timeFramesAndUrgency && (timeFramesAndUrgency === null || timeFramesAndUrgency === void 0 ? void 0 : timeFramesAndUrgency.length) > CASE_DETAILS_TIMEFRAMESANDURGENCY_LIMIT
91
145
  ? 'true'
92
- : 'false', id: "ktQ4-timeFramesAndUrgency", value: timeFramesAndUrgency, isDisabled: isEmpty(timeFramesAndUrgency) && hasLargeCaseDescription && !isKTQ4TextAreaActive, onChange: (e, value) => onKtQ4Change(value, e), onFocus: onKTQ4FocusChange, onBlur: onKTQ4FocusChange, "aria-required": isKT4Required, "data-tracking-id": "get-support-ktQ4-timeFramesAndUrgency", placeholder: t("User or financial impact, and whether there's a legal, national, or medical urgency"), isRequired: isKT4Required, resizeOrientation: "vertical" }),
93
- React.createElement("p", { className: "form-instructions", "data-tracking-id": "large-4k-warning-ktQ4-environment" }, `${isKTQ4TextAreaActive && (timeFramesAndUrgency === null || timeFramesAndUrgency === void 0 ? void 0 : timeFramesAndUrgency.length) > CASE_DETAILS_TIMEFRAMESANDURGENCY_LIMIT
94
- ? `Description cannot be more than ${CASE_DETAILS_TIMEFRAMESANDURGENCY_LIMIT} characters`
95
- : ''}`),
146
+ : 'false', id: "ktQ4-timeFramesAndUrgency", value: timeFramesAndUrgency, isDisabled: isEmpty(timeFramesAndUrgency) && hasLargeCaseDescription && !isKTQ4TextAreaActive, onChange: (e, value) => onKtQ4Change(value, e), onFocus: onKTQ4FocusChange, onBlur: onKTQ4FocusChange, "aria-required": isKT4Required, "data-tracking-id": "get-support-ktQ4-timeFramesAndUrgency", placeholder: t('Describe the user or financial impact. Tell us about any legal, national, or medical urgency.'), isRequired: isKT4Required, resizeOrientation: "vertical", rows: 5 }),
147
+ React.createElement(Progress, { value: timeFramesAndUrgency === null || timeFramesAndUrgency === void 0 ? void 0 : timeFramesAndUrgency.length, min: 0, max: KTQUESTION_MAX_LIMIT, size: ProgressSize.sm, label: `${timeFramesAndUrgency === null || timeFramesAndUrgency === void 0 ? void 0 : timeFramesAndUrgency.length} / ${KTQUESTION_MAX_LIMIT}`, valueText: `${timeFramesAndUrgency === null || timeFramesAndUrgency === void 0 ? void 0 : timeFramesAndUrgency.length} / ${KTQUESTION_MAX_LIMIT}`, measureLocation: ProgressMeasureLocation.top, "aria-label": `Progress - ${timeFramesAndUrgency === null || timeFramesAndUrgency === void 0 ? void 0 : timeFramesAndUrgency.length} / ${KTQUESTION_MAX_LIMIT}`, variant: getVariantQ4(), title: ' ', className: `pf-v5-u-mt-md ${!isNextBtnClickedToShowValidationError && isEmpty(timeFramesAndUrgency) ? 'gray' : ''} kt-progress-bar`, id: "summary-progress-bar" }),
148
+ React.createElement("p", { className: "form-instructions", "data-tracking-id": "large-4k-warning-ktQ4-environment" }, `${(timeFramesAndUrgency === null || timeFramesAndUrgency === void 0 ? void 0 : timeFramesAndUrgency.length) > CASE_DETAILS_TIMEFRAMESANDURGENCY_LIMIT ? KTQ4LengthError : ''}`),
96
149
  React.createElement("p", { className: "form-instructions", "data-tracking-id": "large-warning-ktQ4-timeFramesAndUrgency" }, `${hasLargeCaseDescription && isKTQ4TextAreaActive ? descriptionErrorMessage : ''}`)),
97
150
  !props.onlyShowKT4 && (React.createElement(React.Fragment, null,
98
151
  React.createElement(InlineEdit, { labelProps: { htmlFor: 'ktQ2-environment' }, labelContent: React.createElement(React.Fragment, null,
99
152
  t(KtQuestionConstant.environment),
100
153
  ' ',
101
154
  isKT2Required && (React.createElement("span", { className: "form-required", "aria-hidden": true }, "*"))), allowInlineEdit: props.inlineEditable, hideSaveCancel: props.hideSaveCancel, initialIsEditing: isEmpty(environment), usePreformattedTag: true, saveOnBlur: true, content: environment },
102
- React.createElement(TextArea, { id: "ktQ2-environment", value: environment, isDisabled: isEmpty(environment) && hasLargeCaseDescription && !isKTQ2TextAreaActive, onChange: (e, value) => onKtQ2Change(value, e), onFocus: onKTQ2FocusChange, onBlur: onKTQ2FocusChange, "aria-required": isKT2Required, isRequired: isKT2Required, "data-tracking-id": "get-support-ktQ2-environment", "aria-invalid": environment && (environment === null || environment === void 0 ? void 0 : environment.length) > CASE_DEATILS_ENVIRONMENT_LIMIT ? 'true' : 'false', resizeOrientation: "vertical" }),
103
- React.createElement("p", { className: "form-instructions", "data-tracking-id": "large-4k-warning-ktQ2-environment" }, `${isKTQ2TextAreaActive && (environment === null || environment === void 0 ? void 0 : environment.length) > CASE_DEATILS_ENVIRONMENT_LIMIT
104
- ? `Description cannot be more than ${CASE_DEATILS_ENVIRONMENT_LIMIT} characters`
105
- : ''}`),
155
+ React.createElement(TextArea, { id: "ktQ2-environment", value: environment, isDisabled: isEmpty(environment) && hasLargeCaseDescription && !isKTQ2TextAreaActive, onChange: (e, value) => onKtQ2Change(value, e), onFocus: onKTQ2FocusChange, onBlur: onKTQ2FocusChange, "aria-required": isKT2Required, isRequired: isKT2Required, "data-tracking-id": "get-support-ktQ2-environment", "aria-invalid": environment && (environment === null || environment === void 0 ? void 0 : environment.length) > CASE_DEATILS_ENVIRONMENT_LIMIT ? 'true' : 'false', resizeOrientation: "vertical", placeholder: t('Please provide details about the location, device, software version, etc. where you encounter this issue'), rows: 5 }),
156
+ React.createElement(Progress, { value: environment === null || environment === void 0 ? void 0 : environment.length, min: 0, max: KTQUESTION_MAX_LIMIT, size: ProgressSize.sm, label: `${environment === null || environment === void 0 ? void 0 : environment.length} / ${KTQUESTION_MAX_LIMIT}`, valueText: `${environment === null || environment === void 0 ? void 0 : environment.length} / ${KTQUESTION_MAX_LIMIT}`, measureLocation: ProgressMeasureLocation.top, "aria-label": `Progress - ${environment === null || environment === void 0 ? void 0 : environment.length} / ${KTQUESTION_MAX_LIMIT}`, variant: getVariantQ2(), title: ' ', className: `pf-v5-u-mt-md ${!isNextBtnClickedToShowValidationError && isEmpty(environment) ? 'gray' : ''} kt-progress-bar`, id: "summary-progress-bar" }),
157
+ React.createElement("p", { className: "form-instructions", "data-tracking-id": "large-4k-warning-ktQ2-environment" }, `${(environment === null || environment === void 0 ? void 0 : environment.length) > KTQUESTION_MAX_LIMIT ? KTQ2LengthError : ''}`),
106
158
  React.createElement("p", { className: "form-instructions", "data-tracking-id": "large-warning-ktQ2-environment" }, `${hasLargeCaseDescription && isKTQ2TextAreaActive ? descriptionErrorMessage : ''}`)),
107
159
  React.createElement(InlineEdit, { labelProps: { htmlFor: 'ktQ3-periodicityOfIssue' }, labelContent: React.createElement(React.Fragment, null,
108
160
  t(KtQuestionConstant.periodicityOfIssue),
@@ -110,10 +162,9 @@ function KtQuestions(props) {
110
162
  isKT3Required && (React.createElement("span", { className: "form-required", "aria-hidden": true }, "*"))), allowInlineEdit: props.inlineEditable, hideSaveCancel: props.hideSaveCancel, initialIsEditing: isEmpty(periodicityOfIssue), usePreformattedTag: true, saveOnBlur: true, content: periodicityOfIssue },
111
163
  React.createElement(TextArea, { id: "ktQ3-periodicityOfIssue", value: periodicityOfIssue, isDisabled: isEmpty(periodicityOfIssue) && hasLargeCaseDescription && !isKTQ3TextAreaActive, onChange: (e, value) => onKtQ3Change(value, e), onFocus: onKTQ3FocusChange, onBlur: onKTQ3FocusChange, "aria-required": isKT3Required, isRequired: isKT3Required, "data-tracking-id": "get-support-ktQ3-periodicityOfIssue", "aria-invalid": periodicityOfIssue && (periodicityOfIssue === null || periodicityOfIssue === void 0 ? void 0 : periodicityOfIssue.length) > CASE_DEATILS_PERIODICITYOFISSUE_LIMIT
112
164
  ? 'true'
113
- : 'false', resizeOrientation: "vertical" }),
114
- React.createElement("p", { className: "form-instructions", "data-tracking-id": "large-4k-warning-ktQ3-environment" }, `${isKTQ3TextAreaActive && (periodicityOfIssue === null || periodicityOfIssue === void 0 ? void 0 : periodicityOfIssue.length) > CASE_DEATILS_PERIODICITYOFISSUE_LIMIT
115
- ? `Description cannot be more than ${CASE_DEATILS_PERIODICITYOFISSUE_LIMIT} characters`
116
- : ''}`),
165
+ : 'false', resizeOrientation: "vertical", placeholder: t('Describe when and how often the problem occurs, e.g., daily, after specific actions, at particular times of day, etc.'), rows: 5 }),
166
+ React.createElement(Progress, { value: periodicityOfIssue === null || periodicityOfIssue === void 0 ? void 0 : periodicityOfIssue.length, min: 0, max: KTQUESTION_MAX_LIMIT, size: ProgressSize.sm, label: `${periodicityOfIssue === null || periodicityOfIssue === void 0 ? void 0 : periodicityOfIssue.length} / ${KTQUESTION_MAX_LIMIT}`, valueText: `${periodicityOfIssue === null || periodicityOfIssue === void 0 ? void 0 : periodicityOfIssue.length} / ${KTQUESTION_MAX_LIMIT}`, measureLocation: ProgressMeasureLocation.top, "aria-label": `Progress - ${periodicityOfIssue === null || periodicityOfIssue === void 0 ? void 0 : periodicityOfIssue.length} / ${KTQUESTION_MAX_LIMIT}`, variant: getVariantQ3(), title: ' ', className: `pf-v5-u-mt-md ${!isNextBtnClickedToShowValidationError && isEmpty(periodicityOfIssue) ? 'gray' : ''} kt-progress-bar`, id: "summary-progress-bar" }),
167
+ React.createElement("p", { className: "form-instructions", "data-tracking-id": "large-4k-warning-ktQ3-environment" }, `${(periodicityOfIssue === null || periodicityOfIssue === void 0 ? void 0 : periodicityOfIssue.length) > CASE_DEATILS_PERIODICITYOFISSUE_LIMIT ? KTQ3LengthError : ''}`),
117
168
  React.createElement("p", { className: "form-instructions", "data-tracking-id": "large-warning-ktQ3-periodicityOfIssue" }, `${hasLargeCaseDescription && isKTQ3TextAreaActive ? descriptionErrorMessage : ''}`))))));
118
169
  }
119
170
  KtQuestions.defaultProps = defaultProps;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ declare const NewFeatureModal: () => React.JSX.Element;
3
+ export default NewFeatureModal;
4
+ //# sourceMappingURL=NewFeatureModal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NewFeatureModal.d.ts","sourceRoot":"","sources":["../../../../src/components/OpenCase/NewFeatureModal.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAK/D,QAAA,MAAM,eAAe,yBA8EpB,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { Button, Checkbox, Modal, Title } from '@patternfly/react-core';
2
+ import { useLocalStorage, useSessionStorage } from '@rh-support/components';
3
+ import { GlobalMetadataStateContext } from '@rh-support/react-context';
4
+ import { getConfigField, PCM_CONFIG_FIELD_TYPE } from '@rh-support/utils';
5
+ import React, { useContext, useEffect, useState } from 'react';
6
+ import { Trans, useTranslation } from 'react-i18next';
7
+ import { RedHatCustomerPortalIcon } from './RedHatCustomerPortalIcon';
8
+ const NewFeatureModal = () => {
9
+ const [modalViewStorageCounter, setModalViewStorageCounter] = useSessionStorage('modalShowCounter', 0);
10
+ const [shouldNotShowModal, setShouldNotShowModal] = useLocalStorage('shouldNotShowFeatureModal', false); // local storage flag to not show modal
11
+ const [checkedToNotShowModal, setCheckedToNotShowModal] = useState(false);
12
+ const [showModal, setShowModal] = useState(false);
13
+ const { t } = useTranslation();
14
+ const { globalMetadataState: { pcmConfig }, } = useContext(GlobalMetadataStateContext);
15
+ const isNewFeatureBannerVisible = getConfigField(pcmConfig.data, 'isNewFeatureBannerVisible', PCM_CONFIG_FIELD_TYPE.FEATURE_FLAG);
16
+ const handleModalToggle = (_event) => {
17
+ setShowModal(!showModal);
18
+ if (checkedToNotShowModal) {
19
+ setShouldNotShowModal(true); // updating the local storage value on clicking close button
20
+ }
21
+ setModalViewStorageCounter(modalViewStorageCounter + 1);
22
+ };
23
+ useEffect(() => {
24
+ setShowModal(modalViewStorageCounter < 2);
25
+ // eslint-disable-next-line react-hooks/exhaustive-deps
26
+ }, []);
27
+ const onBannerCheckboxChange = () => {
28
+ setCheckedToNotShowModal(!checkedToNotShowModal);
29
+ };
30
+ return (React.createElement(React.Fragment, null, !shouldNotShowModal && isNewFeatureBannerVisible && showModal && (React.createElement(Modal, { className: "newFeatureModal", width: "45%", "aria-label": t('New feature modal'), isOpen: showModal, onClose: handleModalToggle, actions: [
31
+ React.createElement(Button, { key: "close", variant: "primary", "data-tracking-id": "new-feature-modal-close", onClick: handleModalToggle }, t('Close')),
32
+ ], showClose: false },
33
+ React.createElement(RedHatCustomerPortalIcon, null),
34
+ React.createElement(Title, { headingLevel: "h2", className: "pf-v5-u-font-weight-bold" }, t('Change: Application Announcement For KT Question Update')),
35
+ React.createElement(Trans, null, "Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source."),
36
+ React.createElement(Checkbox, { className: "pf-v5-u-mt-md", id: "new-feature-modal-checkbox", label: t(`I don't want to see this modal again`), isChecked: checkedToNotShowModal, onChange: onBannerCheckboxChange, "data-tracking-id": "new-feature-modal-checkbox" })))));
37
+ };
38
+ export default NewFeatureModal;
@@ -2,12 +2,12 @@ import { ability, CaseListFields, resourceActions, resources } from '@rh-support
2
2
  import React from 'react';
3
3
  import { AccountSelector } from '../AccountInfo/AccountSelector';
4
4
  import { OwnerSelector } from '../AccountInfo/OwnerSelector';
5
- import MandatoryPhoneBanner from './MandatoryPhoneBanner';
5
+ import NewFeatureModal from './NewFeatureModal';
6
6
  import SupportTypeSelectorPage from './SupportTypeSelectorPage';
7
7
  export default function OpenCase(props) {
8
8
  const canChangeAccountInfo = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.ACCOUNT_AND_OWNER);
9
9
  return (React.createElement("form", null,
10
- React.createElement(MandatoryPhoneBanner, null),
10
+ React.createElement(NewFeatureModal, null),
11
11
  canChangeAccountInfo && (React.createElement(React.Fragment, null,
12
12
  React.createElement(AccountSelector, { "data-tracking-id": "get-support-account-selector" }),
13
13
  React.createElement(OwnerSelector, { "data-tracking-id": "get-support-owner-selector" }))),
@@ -81,7 +81,7 @@ const AllProductsSelector = forwardRef((props, ref) => {
81
81
  React.createElement("div", { className: "all-product-selector-dropdown" },
82
82
  React.createElement(ProductVersionDropdownSelector, { isLoading: allProducts.isFetching, products: props.checkEntitledProduct ? entitledProducts : allProducts.data.productsResult, onProductChange: onProductChange, onVersionChange: onVersionChange, ref: ref, isOnSummaryPage: props.isOnSummaryPage }))),
83
83
  React.createElement("div", { className: "case-details-summary" },
84
- React.createElement(OpenCaseIssue, { inlineEditable: false, required: true })),
84
+ React.createElement(OpenCaseIssue, { inlineEditable: false, required: true, isOnSummaryPage: props.isOnSummaryPage })),
85
85
  React.createElement(AlertMessage, { isInline: true, variant: AlertType.DANGER, className: "pf-v5-u-mt-lg", title: t(`${loggedInUserRights.data.isSSOUsernameSameAsLoggedInUser(contactSSOName)
86
86
  ? 'You are'
87
87
  : 'Selected owner is'} not allowed to create case on this product.`), show: !allProducts.isFetching && props.checkEntitledProduct && !isEntitledProduct && !isEmpty(product) }),
@@ -3,6 +3,7 @@ import { RouteComponentProps } from 'react-router';
3
3
  import { IRouteUrlParams } from '../../reducers/RouteConstNTypes';
4
4
  interface IProps {
5
5
  routeProps: RouteComponentProps<IRouteUrlParams>;
6
+ userSeenRecommendations?: (value: React.SetStateAction<boolean>) => void;
6
7
  }
7
8
  /**
8
9
  * Responsible for:
@@ -1 +1 @@
1
- {"version":3,"file":"ProductSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/ProductSelector.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAElD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAInD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAMlE,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,MAAM,qBAiFpD"}
1
+ {"version":3,"file":"ProductSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/ProductSelector.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAElD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAInD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAMlE,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,uBAAuB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;CAC5E;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,MAAM,qBAoFpD"}