@rh-support/troubleshoot 2.2.100 → 2.2.102

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.
@@ -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(`Summary has been successfully updated`));
60
+ ToastNotification.addSuccessMessage(t(`Problem statement has been successfully updated`));
61
61
  }
62
62
  catch (e) {
63
63
  setIsSummaryUpdating(false);
64
- caseUpdateError.showError(e, t(`Summary failed to updated`));
64
+ caseUpdateError.showError(e, t(`Problem statement 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 description"),
127
+ React.createElement(Trans, null, "Problem statement"),
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":"OpenCaseIssue.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/OpenCaseIssue.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAQpD,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,qBAsGnC;kBAtGQ,aAAa;;;AAyGtB,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;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,8 +1,8 @@
1
- import { Progress, ProgressMeasureLocation, ProgressSize } from '@patternfly/react-core';
1
+ import { Progress, ProgressMeasureLocation, ProgressSize, ProgressVariant } from '@patternfly/react-core';
2
2
  import { InlineEdit } from '@rh-support/components';
3
3
  import { PreviousCaseTypes } from '@rh-support/utils';
4
4
  import isEmpty from 'lodash/isEmpty';
5
- import React, { useContext, useState } from 'react';
5
+ 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';
@@ -22,12 +22,12 @@ function OpenCaseIssue(props) {
22
22
  supportType: state.caseDetails.caseType,
23
23
  }));
24
24
  const caseDispatch = useCaseDispatch();
25
- const [isSummaryInValid, setIsSummaryInValid] = useState(false);
25
+ const [isSummaryEmpty, setIsSummaryEmpty] = useState(false);
26
26
  const [hasLargeSummary, setHasLargeSummary] = useState(false);
27
27
  const { routeState: { isNextBtnClickedToShowValidationError }, } = useContext(RouteContext);
28
28
  const onSummaryBlur = (e) => {
29
29
  var _a;
30
- setIsSummaryInValid(isEmpty((_a = e.target.value) === null || _a === void 0 ? void 0 : _a.trim()));
30
+ setIsSummaryEmpty(isEmpty((_a = e.target.value) === null || _a === void 0 ? void 0 : _a.trim()));
31
31
  };
32
32
  const onCaseDetailsChange = (caseDetails) => {
33
33
  setCaseDetails(caseDispatch, caseDetails);
@@ -37,27 +37,41 @@ function OpenCaseIssue(props) {
37
37
  const summaryLocal = isEmpty((_a = e.target.value) === null || _a === void 0 ? void 0 : _a.trim()) ? '' : e.target.value;
38
38
  setHasLargeSummary(summaryLocal.length > SUMMARY_LENGTH_LIMIT);
39
39
  onCaseDetailsChange({ summary: summaryLocal });
40
- setIsSummaryInValid(isEmpty(summaryLocal === null || summaryLocal === void 0 ? void 0 : summaryLocal.trim()));
41
40
  };
41
+ const getVariant = () => {
42
+ if (getIsSummaryInvalid())
43
+ return ProgressVariant.danger;
44
+ if (!summary)
45
+ return ProgressVariant.success;
46
+ if (summary.length > SUMMARY_LENGTH_LIMIT / 2) {
47
+ return ProgressVariant.warning;
48
+ }
49
+ else {
50
+ return ProgressVariant.success;
51
+ }
52
+ };
53
+ const getIsSummaryInvalid = () => hasLargeSummary || (isNextBtnClickedToShowValidationError && isSummaryEmpty);
54
+ const isIdea = () => supportType === PreviousCaseTypes.FEATURE_ENHANCEMENT;
55
+ useEffect(() => {
56
+ setIsSummaryEmpty(summary ? isEmpty(summary.trim()) : true);
57
+ summary && setHasLargeSummary(summary.length > SUMMARY_LENGTH_LIMIT);
58
+ // @ts-ignore
59
+ }, [summary]);
42
60
  return (React.createElement(React.Fragment, null,
43
61
  React.createElement(InlineEdit, { labelProps: {
44
- htmlFor: supportType === PreviousCaseTypes.FEATURE_ENHANCEMENT
45
- ? 'get-support-title'
46
- : 'get-support-summary',
62
+ htmlFor: isIdea() ? 'get-support-title' : 'get-support-summary',
47
63
  }, labelContent: React.createElement(React.Fragment, null,
48
- React.createElement(Trans, null, supportType === PreviousCaseTypes.FEATURE_ENHANCEMENT ? 'Title' : 'Problem description'),
64
+ React.createElement(Trans, null, isIdea() ? 'Title' : 'Problem statement'),
49
65
  ' ',
50
- !!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 && !isSummaryInValid, content: summary },
51
- React.createElement("textarea", { id: supportType === PreviousCaseTypes.FEATURE_ENHANCEMENT
52
- ? 'get-support-title'
53
- : 'get-support-summary', className: `form-control${isSummaryInValid || hasLargeSummary || (isNextBtnClickedToShowValidationError && !summary)
54
- ? ' form-invalid'
55
- : ''}`, "aria-invalid": isSummaryInValid, "aria-required": !!props.required, required: !!props.required, name: supportType === PreviousCaseTypes.FEATURE_ENHANCEMENT
56
- ? 'get-support-title'
57
- : 'get-support-summary', placeholder: t('i18nkeySummarizeExperience', "Please describe the problem you are facing, including any specific steps you've taken or error messages."), value: summary, onChange: onSummaryChange, onBlur: onSummaryBlur, autoFocus: !!props.autoFocus, "data-tracking-id": supportType === PreviousCaseTypes.FEATURE_ENHANCEMENT
58
- ? 'get-support-title'
59
- : 'get-support-summary', rows: 6 }),
60
- 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.outside, "aria-label": `Progress - ${summary === null || summary === void 0 ? void 0 : summary.length} / ${SUMMARY_LENGTH_LIMIT}` }))));
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()
68
+ ? 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.`))))));
61
75
  }
62
76
  OpenCaseIssue.defaultProps = defaultProps;
63
77
  export default OpenCaseIssue;
@@ -1 +1 @@
1
- {"version":3,"file":"RecommendationInfoBox.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/RecommendationInfoBox.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,eAAO,MAAM,qBAAqB,yBA8CjC,CAAC"}
1
+ {"version":3,"file":"RecommendationInfoBox.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/RecommendationInfoBox.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAKxC,eAAO,MAAM,qBAAqB,yBAqDjC,CAAC"}
@@ -1,27 +1,29 @@
1
1
  import { Accordion, AccordionContent, AccordionItem, AccordionToggle, List, ListItem } from '@patternfly/react-core';
2
2
  import React, { useState } from 'react';
3
- import { Trans } from 'react-i18next';
3
+ import { Trans, useTranslation } from 'react-i18next';
4
+ import { SUMMARY_LENGTH_LIMIT } from '../../reducers/CaseConstNTypes';
4
5
  export const RecommendationInfoBox = () => {
6
+ const { t } = useTranslation();
5
7
  const [isExpanded, setIsExpanded] = useState(true);
6
8
  return (React.createElement(React.Fragment, null,
7
9
  React.createElement(Accordion, { isBordered: true, asDefinitionList: false, className: "pf-v5-u-mb-md" },
8
10
  React.createElement(AccordionItem, null,
9
- React.createElement(AccordionToggle, { id: "recommendation-tips", isExpanded: isExpanded, onClick: () => setIsExpanded(!isExpanded) },
10
- React.createElement(Trans, null, "Tips for problem description field")),
11
+ React.createElement(AccordionToggle, { id: "recommendation-tips", isExpanded: isExpanded, onClick: () => setIsExpanded(!isExpanded) }, t(`Tips for summarizing your problem in under ${SUMMARY_LENGTH_LIMIT} characters`)),
11
12
  React.createElement(AccordionContent, { isHidden: !isExpanded },
12
13
  React.createElement("span", { className: "pf-v5-u-color-100" },
13
- React.createElement(Trans, null, "Include the following information in the description to expedite your case:")),
14
+ React.createElement(Trans, null, "To help us find the right information for you, include 1-2 key details, such as:")),
14
15
  React.createElement(List, { className: "pf-v5-u-ml-lg", style: { listStyleType: 'disc' } },
15
16
  React.createElement(ListItem, null,
16
- React.createElement(Trans, null, "Problem")),
17
+ React.createElement(Trans, null, "Relevant keywords")),
17
18
  React.createElement(ListItem, null,
18
- React.createElement(Trans, null, "Steps you've taken")),
19
+ React.createElement(Trans, null, "Error messages")),
19
20
  React.createElement(ListItem, null,
20
- React.createElement(Trans, null, "Error Messages"))),
21
+ React.createElement(Trans, null, "Specific problems"))),
21
22
  React.createElement("span", { className: "pf-v5-u-color-100" },
22
23
  React.createElement(Trans, null, "Examples:")),
23
- React.createElement("p", null,
24
- React.createElement(Trans, null, "\"we see error/message\", \"function that is failing\"")),
25
- React.createElement("p", null,
26
- React.createElement(Trans, null, "I'm unable to start the SSHD service receiving the error message \"Bad yes/no argument for ShowPatchLevel parameter\"")))))));
24
+ React.createElement(List, { className: "pf-v5-u-ml-lg", style: { listStyleType: 'disc' } },
25
+ React.createElement(ListItem, null,
26
+ React.createElement(Trans, null, "I'm unable to start the SSHD service and am receiving this error message, \u201CBad yes/no argument for ShowPatchLevel parameter.\u201D (125/255 characters)")),
27
+ React.createElement(ListItem, null,
28
+ React.createElement(Trans, null, "We see this error message: \u201Cfunction that is failing\u201D. (54/255 characters)"))))))));
27
29
  };
@@ -42,7 +42,7 @@ function TroubleshootSection(props) {
42
42
  React.createElement("span", { className: "pf-v5-u-font-family-heading pf-v5-u-ml-xl pf-v5-u-pr-xs" }, "Version"),
43
43
  ' ',
44
44
  version),
45
- React.createElement("div", { className: "pf-v5-u-font-family-heading" }, "Problem Description"),
45
+ React.createElement("div", { className: "pf-v5-u-font-family-heading" }, "Problem statement"),
46
46
  React.createElement("p", { className: "pf-v5-u-mb-xl" }, summary)),
47
47
  !isCreatingCase && (React.createElement(OpenShiftClusterId, { className: "push-bottom", "data-tracking-id": "troubleshoot-section-openshift-cluster-id" })),
48
48
  React.createElement(LoadingDots, { show: topContent.isFetching }),
@@ -30,7 +30,7 @@ function WizardAside(props) {
30
30
  const canshowEARuleWidget = showSideBarEARuleWidgetSections.includes(activeSection);
31
31
  const canShowClusterIdReportWidget = showSideBarClusterIdRuleWidgetSections.includes(activeSection);
32
32
  const canShowFileRecommendationSectionsWidget = showSideBarFileRecommendationSections.includes(activeSection);
33
- const canShowRecommendationTips = showRecommendationTipsSections.includes(activeSection);
33
+ const canShowRecommendationTips = showRecommendationTipsSections.includes(activeSection) && !isIdea;
34
34
  return (React.createElement("aside", null,
35
35
  React.createElement("section", { className: "grid-aside-content" },
36
36
  canShowFileUploadWidget() && React.createElement(InsightsResults, null),
@@ -428,3 +428,26 @@ input[type='checkbox'] {
428
428
  position: absolute;
429
429
  width: 100%;
430
430
  }
431
+
432
+ #summary-progress-bar .pf-v5-c-progress__status-icon {
433
+ display: none;
434
+ }
435
+
436
+ #summary-progress-bar .pf-v5-c-progress__bar,
437
+ #summary-progress-bar .pf-v5-c-progress__indicator {
438
+ height: 2px;
439
+ }
440
+
441
+ #summary-progress-bar.gray .pf-v5-c-progress__bar,
442
+ #summary-progress-bar.gray .pf-v5-c-progress__bar::before {
443
+ background-color: var(--pf-v5-global--palette--black-300) !important;
444
+ }
445
+
446
+ #summary-progress-bar .pf-v5-c-progress.pf-m-sm .pf-v5-c-progress__measure {
447
+ font-size: 14px;
448
+ }
449
+
450
+ #summary-progress-bar {
451
+ row-gap: 9px;
452
+ line-height: 2px;
453
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "2.2.100",
3
+ "version": "2.2.102",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -60,11 +60,11 @@
60
60
  "@progress/kendo-licensing": "1.3.5",
61
61
  "@progress/kendo-react-pdf": "^5.16.0",
62
62
  "@redux-devtools/extension": "^3.3.0",
63
- "@rh-support/components": "2.1.51",
64
- "@rh-support/react-context": "2.1.57",
63
+ "@rh-support/components": "2.1.53",
64
+ "@rh-support/react-context": "2.1.59",
65
65
  "@rh-support/types": "2.0.3",
66
- "@rh-support/user-permissions": "2.1.37",
67
- "@rh-support/utils": "2.1.27",
66
+ "@rh-support/user-permissions": "2.1.39",
67
+ "@rh-support/utils": "2.1.29",
68
68
  "@types/react-redux": "^7.1.33",
69
69
  "@types/redux": "^3.6.0",
70
70
  "dompurify": "^2.2.6",
@@ -131,5 +131,5 @@
131
131
  "defaults and supports es6-module",
132
132
  "maintained node versions"
133
133
  ],
134
- "gitHead": "3b669f23c094069a3e7d042cfdffd716407734d3"
134
+ "gitHead": "d579286a00d09356cd07729b5750176ad8e3c090"
135
135
  }