@rh-support/troubleshoot 2.2.90-beta.1 → 2.2.90-beta.3
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.
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.js +2 -2
- package/lib/esm/components/CaseInformation/OpenCaseIssue.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/OpenCaseIssue.js +10 -7
- package/lib/esm/components/wizardLayout/WizardAside.js +1 -1
- package/package.json +2 -2
|
@@ -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(`
|
|
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(`
|
|
64
|
+
caseUpdateError.showError(e, t(`Problem statement failed to updated`));
|
|
65
65
|
throw e;
|
|
66
66
|
}
|
|
67
67
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenCaseIssue.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/OpenCaseIssue.tsx"],"names":[],"mappings":"AAKA,OAAO,
|
|
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,qBAgInC;kBAhIQ,aAAa;;;AAmItB,eAAe,aAAa,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { Progress, ProgressMeasureLocation, ProgressSize, ProgressVariant } from
|
|
|
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 [
|
|
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
|
-
|
|
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,7 +37,6 @@ 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
|
};
|
|
42
41
|
const getVariant = () => {
|
|
43
42
|
if (getIsSummaryInvalid())
|
|
@@ -54,7 +53,11 @@ function OpenCaseIssue(props) {
|
|
|
54
53
|
return ProgressVariant.success;
|
|
55
54
|
}
|
|
56
55
|
};
|
|
57
|
-
const getIsSummaryInvalid = () =>
|
|
56
|
+
const getIsSummaryInvalid = () => hasLargeSummary || (isNextBtnClickedToShowValidationError && isSummaryEmpty);
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
setIsSummaryEmpty(summary ? isEmpty(summary.trim()) : true);
|
|
59
|
+
// @ts-ignore
|
|
60
|
+
}, [summary]);
|
|
58
61
|
return (React.createElement(React.Fragment, null,
|
|
59
62
|
React.createElement(InlineEdit, { labelProps: {
|
|
60
63
|
htmlFor: supportType === PreviousCaseTypes.FEATURE_ENHANCEMENT
|
|
@@ -63,10 +66,10 @@ function OpenCaseIssue(props) {
|
|
|
63
66
|
}, labelContent: React.createElement(React.Fragment, null,
|
|
64
67
|
React.createElement(Trans, null, supportType === PreviousCaseTypes.FEATURE_ENHANCEMENT ? 'Title' : 'Problem statement'),
|
|
65
68
|
' ',
|
|
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 && !
|
|
69
|
+
!!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
70
|
React.createElement("textarea", { id: supportType === PreviousCaseTypes.FEATURE_ENHANCEMENT
|
|
68
71
|
? 'get-support-title'
|
|
69
|
-
: 'get-support-summary', className: `form-control${getIsSummaryInvalid() ? ' form-invalid' : ''}`, "aria-invalid":
|
|
72
|
+
: 'get-support-summary', className: `form-control${getIsSummaryInvalid() ? ' form-invalid' : ''}`, "aria-invalid": getIsSummaryInvalid(), "aria-required": !!props.required, required: !!props.required, name: supportType === PreviousCaseTypes.FEATURE_ENHANCEMENT
|
|
70
73
|
? 'get-support-title'
|
|
71
74
|
: '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
|
|
72
75
|
? 'get-support-title'
|
|
@@ -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(FileDiag, { className: "pf-v5-u-mt-md" }),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/troubleshoot",
|
|
3
|
-
"version": "2.2.90-beta.
|
|
3
|
+
"version": "2.2.90-beta.3",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -132,5 +132,5 @@
|
|
|
132
132
|
"defaults and supports es6-module",
|
|
133
133
|
"maintained node versions"
|
|
134
134
|
],
|
|
135
|
-
"gitHead": "
|
|
135
|
+
"gitHead": "e6e54f44311de3872889f6ced4e5af9f5f8dacc5"
|
|
136
136
|
}
|