@rh-support/troubleshoot 1.0.47-beta.32 → 1.0.48
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/CaseOverview/CaseType.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/CaseType.js +5 -6
- package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/index.js +8 -8
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseAlternateId.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseAlternateId.js +4 -6
- package/lib/esm/components/CaseInformation/CaseInformation.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/CaseInformation.js +4 -2
- package/lib/esm/components/CaseInformation/CaseType.js +3 -3
- package/lib/esm/components/CaseInformation/Description.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/Description.js +1 -1
- package/lib/esm/components/CaseInformation/OpenCaseIssue.js +2 -2
- package/lib/esm/components/CaseInformation/Severity.d.ts +2 -1
- package/lib/esm/components/CaseInformation/Severity.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/Severity.js +8 -14
- package/lib/esm/components/CaseInformation/SupportLevel.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/SupportLevel.js +23 -27
- package/lib/esm/components/CaseManagement/CaseLanguageSelector.d.ts +0 -1
- package/lib/esm/components/CaseManagement/CaseLanguageSelector.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/CaseLanguageSelector.js +17 -37
- package/lib/esm/components/CaseManagement/CaseManagement.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/CaseManagement.js +42 -4
- package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.js +0 -5
- package/lib/esm/components/ImproveCase/Hostname.d.ts.map +1 -1
- package/lib/esm/components/ImproveCase/Hostname.js +5 -9
- package/lib/esm/components/ImproveCase/KtQuestions.d.ts.map +1 -1
- package/lib/esm/components/ImproveCase/KtQuestions.js +6 -7
- package/lib/esm/components/Issue/Issue.js +1 -1
- package/lib/esm/components/OpenCase/CaseTypeSelectorPage.d.ts +2 -0
- package/lib/esm/components/OpenCase/CaseTypeSelectorPage.d.ts.map +1 -0
- package/lib/esm/components/OpenCase/CaseTypeSelectorPage.js +40 -0
- package/lib/esm/components/OpenCase/OpenCase.js +2 -2
- package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/AllProductsSelector.js +0 -3
- package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/ProductSelector.js +20 -6
- package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.js +73 -8
- package/lib/esm/components/ProductSelector/TopProductsSelector.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/AsideResults.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/AsideResults.js +2 -3
- package/lib/esm/components/Recommendations/InsightsResults.d.ts +0 -1
- package/lib/esm/components/Recommendations/InsightsResults.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/InsightsResults.js +0 -4
- package/lib/esm/components/Recommendations/Recommendations.d.ts +1 -5
- package/lib/esm/components/Recommendations/Recommendations.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/Recommendations.js +18 -20
- package/lib/esm/components/Recommendations/RulesModal.d.ts +0 -1
- package/lib/esm/components/Recommendations/RulesModal.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/RulesModal.js +1 -11
- package/lib/esm/components/Review/Review.js +1 -1
- package/lib/esm/components/Suggestions/Suggestions.d.ts.map +1 -1
- package/lib/esm/components/Suggestions/Suggestions.js +3 -5
- package/lib/esm/components/shared/Constants.d.ts +2 -2
- package/lib/esm/components/shared/Constants.d.ts.map +1 -1
- package/lib/esm/components/shared/Constants.js +2 -2
- package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
- package/lib/esm/components/shared/useIsSectionValid.js +15 -16
- package/lib/esm/components/wizardLayout/WizardAside.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardAside.js +4 -15
- package/lib/esm/components/wizardLayout/WizardMain.js +19 -19
- package/lib/esm/components/wizardLayout/WizardNavigation.js +7 -7
- package/lib/esm/enums/pageTitle.d.ts +1 -1
- package/lib/esm/enums/pageTitle.js +1 -1
- package/lib/esm/reducers/CaseConstNTypes.d.ts +4 -4
- package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
- package/lib/esm/reducers/CaseConstNTypes.js +3 -3
- package/lib/esm/reducers/RouteConstNTypes.d.ts +5 -6
- package/lib/esm/reducers/RouteConstNTypes.d.ts.map +1 -1
- package/lib/esm/reducers/RouteConstNTypes.js +16 -23
- package/lib/esm/reducers/RouteReducer.d.ts +1 -3
- package/lib/esm/reducers/RouteReducer.d.ts.map +1 -1
- package/lib/esm/reducers/RouteReducer.js +33 -32
- package/lib/esm/reducers/RulesReducer.d.ts +2 -2
- package/lib/esm/reducers/RulesReducer.d.ts.map +1 -1
- package/lib/esm/reducers/RulesReducer.js +7 -3
- package/lib/esm/scss/_main.scss +27 -0
- package/lib/esm/scss/_pf4-overrides.scss +0 -23
- package/package.json +8 -8
- package/lib/esm/components/OpenCase/CaseTypeIcons/BugIcon.d.ts +0 -8
- package/lib/esm/components/OpenCase/CaseTypeIcons/BugIcon.d.ts.map +0 -1
- package/lib/esm/components/OpenCase/CaseTypeIcons/BugIcon.js +0 -7
- package/lib/esm/components/OpenCase/CaseTypeIcons/CertificationIcon.d.ts +0 -8
- package/lib/esm/components/OpenCase/CaseTypeIcons/CertificationIcon.d.ts.map +0 -1
- package/lib/esm/components/OpenCase/CaseTypeIcons/CertificationIcon.js +0 -10
- package/lib/esm/components/OpenCase/CaseTypeIcons/CustomerServiceIcon.d.ts +0 -8
- package/lib/esm/components/OpenCase/CaseTypeIcons/CustomerServiceIcon.d.ts.map +0 -1
- package/lib/esm/components/OpenCase/CaseTypeIcons/CustomerServiceIcon.js +0 -9
- package/lib/esm/components/OpenCase/CaseTypeIcons/DocumentationIcon.d.ts +0 -8
- package/lib/esm/components/OpenCase/CaseTypeIcons/DocumentationIcon.d.ts.map +0 -1
- package/lib/esm/components/OpenCase/CaseTypeIcons/DocumentationIcon.js +0 -7
- package/lib/esm/components/OpenCase/CaseTypeIcons/GearIcon.d.ts +0 -8
- package/lib/esm/components/OpenCase/CaseTypeIcons/GearIcon.d.ts.map +0 -1
- package/lib/esm/components/OpenCase/CaseTypeIcons/GearIcon.js +0 -8
- package/lib/esm/components/OpenCase/CaseTypeIcons/IdeaIcon.d.ts +0 -8
- package/lib/esm/components/OpenCase/CaseTypeIcons/IdeaIcon.d.ts.map +0 -1
- package/lib/esm/components/OpenCase/CaseTypeIcons/IdeaIcon.js +0 -8
- package/lib/esm/components/OpenCase/CaseTypeIcons/RcaIcon.d.ts +0 -8
- package/lib/esm/components/OpenCase/CaseTypeIcons/RcaIcon.d.ts.map +0 -1
- package/lib/esm/components/OpenCase/CaseTypeIcons/RcaIcon.js +0 -8
- package/lib/esm/components/OpenCase/CaseTypeIcons/index.d.ts +0 -8
- package/lib/esm/components/OpenCase/CaseTypeIcons/index.d.ts.map +0 -1
- package/lib/esm/components/OpenCase/CaseTypeIcons/index.js +0 -7
- package/lib/esm/components/OpenCase/SupportTypeIcons/BugIcon.d.ts +0 -8
- package/lib/esm/components/OpenCase/SupportTypeIcons/BugIcon.d.ts.map +0 -1
- package/lib/esm/components/OpenCase/SupportTypeIcons/BugIcon.js +0 -7
- package/lib/esm/components/OpenCase/SupportTypeIcons/CertificationIcon.d.ts +0 -8
- package/lib/esm/components/OpenCase/SupportTypeIcons/CertificationIcon.d.ts.map +0 -1
- package/lib/esm/components/OpenCase/SupportTypeIcons/CertificationIcon.js +0 -10
- package/lib/esm/components/OpenCase/SupportTypeIcons/CustomerServiceIcon.d.ts +0 -8
- package/lib/esm/components/OpenCase/SupportTypeIcons/CustomerServiceIcon.d.ts.map +0 -1
- package/lib/esm/components/OpenCase/SupportTypeIcons/CustomerServiceIcon.js +0 -9
- package/lib/esm/components/OpenCase/SupportTypeIcons/DocumentationIcon.d.ts +0 -8
- package/lib/esm/components/OpenCase/SupportTypeIcons/DocumentationIcon.d.ts.map +0 -1
- package/lib/esm/components/OpenCase/SupportTypeIcons/DocumentationIcon.js +0 -7
- package/lib/esm/components/OpenCase/SupportTypeIcons/GearIcon.d.ts +0 -8
- package/lib/esm/components/OpenCase/SupportTypeIcons/GearIcon.d.ts.map +0 -1
- package/lib/esm/components/OpenCase/SupportTypeIcons/GearIcon.js +0 -8
- package/lib/esm/components/OpenCase/SupportTypeIcons/IdeaIcon.d.ts +0 -8
- package/lib/esm/components/OpenCase/SupportTypeIcons/IdeaIcon.d.ts.map +0 -1
- package/lib/esm/components/OpenCase/SupportTypeIcons/IdeaIcon.js +0 -8
- package/lib/esm/components/OpenCase/SupportTypeIcons/RcaIcon.d.ts +0 -8
- package/lib/esm/components/OpenCase/SupportTypeIcons/RcaIcon.d.ts.map +0 -1
- package/lib/esm/components/OpenCase/SupportTypeIcons/RcaIcon.js +0 -8
- package/lib/esm/components/OpenCase/SupportTypeIcons/index.d.ts +0 -8
- package/lib/esm/components/OpenCase/SupportTypeIcons/index.d.ts.map +0 -1
- package/lib/esm/components/OpenCase/SupportTypeIcons/index.js +0 -7
- package/lib/esm/components/OpenCase/SupportTypeSelectorPage.d.ts +0 -2
- package/lib/esm/components/OpenCase/SupportTypeSelectorPage.d.ts.map +0 -1
- package/lib/esm/components/OpenCase/SupportTypeSelectorPage.js +0 -133
- package/lib/esm/components/ProductSelector/NewProductSelectSelector.d.ts +0 -13
- package/lib/esm/components/ProductSelector/NewProductSelectSelector.d.ts.map +0 -1
- package/lib/esm/components/ProductSelector/NewProductSelectSelector.js +0 -76
- package/lib/esm/components/ProductSelector/NewProductVersionSelector.d.ts +0 -10
- package/lib/esm/components/ProductSelector/NewProductVersionSelector.d.ts.map +0 -1
- package/lib/esm/components/ProductSelector/NewProductVersionSelector.js +0 -57
- package/lib/esm/components/TroubleshootSection/TroubleshootSection.d.ts +0 -14
- package/lib/esm/components/TroubleshootSection/TroubleshootSection.d.ts.map +0 -1
- package/lib/esm/components/TroubleshootSection/TroubleshootSection.js +0 -59
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseType.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseOverview/CaseType.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAW,MAAM,0BAA0B,CAAC;AASrE,UAAU,MAAO,SAAQ,gBAAgB;IACrC,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,GAAG,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;CACrB;AAOD,iBAAS,QAAQ,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"CaseType.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseOverview/CaseType.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAW,MAAM,0BAA0B,CAAC;AASrE,UAAU,MAAO,SAAQ,gBAAgB;IACrC,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,GAAG,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;CACrB;AAOD,iBAAS,QAAQ,CAAC,KAAK,EAAE,MAAM,eAmD9B;kBAnDQ,QAAQ;;;AAsDjB,eAAe,QAAQ,CAAC"}
|
|
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { Dropdown, ValueChangedIcon } from '@rh-support/components';
|
|
11
|
-
import {
|
|
11
|
+
import { toOption, toOptions } from '@rh-support/utils';
|
|
12
12
|
import isEmpty from 'lodash/isEmpty';
|
|
13
13
|
import React, { useState } from 'react';
|
|
14
14
|
import { Trans, useTranslation } from 'react-i18next';
|
|
@@ -25,11 +25,10 @@ function CaseType(props) {
|
|
|
25
25
|
setIsCaseTypeInValid(isEmpty(selectedItem));
|
|
26
26
|
};
|
|
27
27
|
const onCaseTypeChange = (option) => __awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
|
|
29
|
-
if (switchedCaseType === props.selectedType) {
|
|
28
|
+
if (option.value === props.selectedType) {
|
|
30
29
|
return;
|
|
31
30
|
}
|
|
32
|
-
yield props.onTypeChange(
|
|
31
|
+
yield props.onTypeChange(option.value);
|
|
33
32
|
setLocalTypeChange(true);
|
|
34
33
|
validateCaseType(option);
|
|
35
34
|
});
|
|
@@ -38,10 +37,10 @@ function CaseType(props) {
|
|
|
38
37
|
const afterLocalChange = () => setLocalTypeChange(false);
|
|
39
38
|
return (React.createElement("div", { className: `form-group ${props.className}`, id: `${props.id}` },
|
|
40
39
|
React.createElement("h3", { className: "subheading subheading-sm" },
|
|
41
|
-
React.createElement(Trans, null, "
|
|
40
|
+
React.createElement(Trans, null, "Case type"),
|
|
42
41
|
React.createElement(ValueChangedIcon, { afterLocalChange: afterLocalChange, isLocalChange: localTypeChange, value: props.selectedType, getTooltipContent: getChangedValueTooltip(() => CaseValuesToWatch.type) }),
|
|
43
42
|
React.createElement("span", { className: "form-required", "aria-hidden": true }, "*")),
|
|
44
|
-
React.createElement(Dropdown, { name: "open-
|
|
43
|
+
React.createElement(Dropdown, { name: "open-case-type", placeholder: t(`Select`), title: t(`Select a category`), list: props.allTypes ? toOptions(props.allTypes) : [], selectedItem: toOption(props.selectedType), disabled: props.hasError || props.isDisabled, isLoadingList: props.isFetching, isInValid: isCaseTypeInValid, required: true, onChange: onCaseTypeChange, onOuterClick: validateCaseType, "data-tracking-id": "case-details-type-selector" })));
|
|
45
44
|
}
|
|
46
45
|
CaseType.defaultProps = defaultProps;
|
|
47
46
|
export default CaseType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseOverview/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseOverview/index.tsx"],"names":[],"mappings":"AAyCA,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK,EAAE,MAAM,eAoejD"}
|
|
@@ -11,7 +11,7 @@ import { Alert, AlertVariant, Button, ButtonVariant, ExpandableSection, Label }
|
|
|
11
11
|
import { ToastNotification, useConfirmation } from '@rh-support/components';
|
|
12
12
|
import { CloseCaseModal, fetchCaseSeverities, fetchCaseTypes, GlobalMetadataDispatchContext, GlobalMetadataStateContext, useCanEditCase, } from '@rh-support/react-context';
|
|
13
13
|
import { AbilityContext, CaseDetailsFields, resourceActions, resources } from '@rh-support/user-permissions';
|
|
14
|
-
import { haventLoadedMetadata, isOpenShiftOnlineProduct
|
|
14
|
+
import { haventLoadedMetadata, isOpenShiftOnlineProduct } from '@rh-support/utils';
|
|
15
15
|
import isEqual from 'lodash/isEqual';
|
|
16
16
|
import React, { useContext, useEffect, useReducer, useRef, useState } from 'react';
|
|
17
17
|
import { Trans, useTranslation } from 'react-i18next';
|
|
@@ -26,6 +26,7 @@ import { usePostComment } from '../../shared/usePostComment';
|
|
|
26
26
|
import { ReopenCaseModal } from '../ConfirmationModals/ReopenCaseModal';
|
|
27
27
|
import { PDFContext } from '../PDFContainer';
|
|
28
28
|
import { CaseInformation } from '../Tabs/CaseDetails/CaseInformation';
|
|
29
|
+
import Summary from '../Tabs/CaseDetails/Summary';
|
|
29
30
|
import CaseOwnerInfo from './CaseOwnerInfo';
|
|
30
31
|
import CaseStatus from './CaseStatus';
|
|
31
32
|
import CaseType from './CaseType';
|
|
@@ -72,7 +73,6 @@ export default function CaseOverview(props) {
|
|
|
72
73
|
const { isCaseUpdating, contactIsPartner, hotfixRequested, hotfixDelivered, selectedAccountDetails, caseDetails: { firstCaseInactivityWarningSentAt, secondCaseInactivityWarningSentAt }, } = caseState;
|
|
73
74
|
const globalMetadataDispatchContext = useContext(GlobalMetadataDispatchContext);
|
|
74
75
|
const { globalMetadataState: { allCaseTypes, allCaseSeverities, viewAsCustomer, loggedInUsersAccount, loggedInUserRights, }, } = useContext(GlobalMetadataStateContext);
|
|
75
|
-
const switchedCaseType = toNewCaseTypeSwitcher(caseType);
|
|
76
76
|
const updatingUser = loggedInUsersAccount.data.name;
|
|
77
77
|
const canSeeManagedByPartnerFlag = contactIsPartner &&
|
|
78
78
|
ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_MANAGED_BY_PARTNER_FLAG);
|
|
@@ -110,11 +110,11 @@ export default function CaseOverview(props) {
|
|
|
110
110
|
try {
|
|
111
111
|
yield updateCaseDetails(caseDispatch, props.caseNumber, { caseType: type });
|
|
112
112
|
setTypeUpdating(caseOverviewDispatch, false);
|
|
113
|
-
ToastNotification.addSuccessMessage(t('
|
|
113
|
+
ToastNotification.addSuccessMessage(t('Case type has been successfully updated'));
|
|
114
114
|
}
|
|
115
115
|
catch (e) {
|
|
116
116
|
setTypeUpdating(caseOverviewDispatch, false);
|
|
117
|
-
caseUpdateError.showError(e, t('
|
|
117
|
+
caseUpdateError.showError(e, t('Case type failed to update'));
|
|
118
118
|
}
|
|
119
119
|
});
|
|
120
120
|
const onSeverityChange = (payLoad) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -209,8 +209,6 @@ export default function CaseOverview(props) {
|
|
|
209
209
|
return (React.createElement("a", { href: link, target: "_blank", className: "show-target", rel: "noopener noreferrer", "data-tracking-id": "case-details-support-level-info" }, linkText));
|
|
210
210
|
};
|
|
211
211
|
const isCaseInOpenState = status !== CaseStatusEnum.CLOSED;
|
|
212
|
-
// To switch from old case type to new support type
|
|
213
|
-
const newCaseTypesArray = toNewCaseTypeMapper(allCaseTypes.data).sort();
|
|
214
212
|
return (React.createElement(React.Fragment, null,
|
|
215
213
|
React.createElement("div", { className: "case-overview push-bottom-wide" },
|
|
216
214
|
React.createElement("div", { className: "case-overview-header" },
|
|
@@ -242,6 +240,8 @@ export default function CaseOverview(props) {
|
|
|
242
240
|
React.createElement(Trans, null, isCaseInOpenState ? 'Close case' : 'Reopen case')))),
|
|
243
241
|
React.createElement("div", { className: `case-details-header-secondary push-bottom-narrow ${isExportingPDF && !viewAsCustomer ? 'hide-in-pdf' : ''}` },
|
|
244
242
|
React.createElement("span", { className: "case-support-level" }, computeSupportLink())),
|
|
243
|
+
React.createElement("div", { className: "case-details-summary push-bottom-narrow" },
|
|
244
|
+
React.createElement(Summary, { inlineEditable: true, hideLabel: true })),
|
|
245
245
|
canSeeManagedByPartnerFlag && (React.createElement(Label, { className: "push-right-narrow", color: "green" },
|
|
246
246
|
React.createElement(Trans, null, "Managed by a partner"))),
|
|
247
247
|
canSeeInternalFlags && (React.createElement(React.Fragment, null,
|
|
@@ -275,9 +275,9 @@ export default function CaseOverview(props) {
|
|
|
275
275
|
React.createElement("div", { className: "form-wrapper" },
|
|
276
276
|
React.createElement(CaseStatus, { selectedStatus: status, onStatusChange: onStatusChange, isDisabled: !canManageCase || caseOverviewState.allCaseStatuses.isFetching, allStatuses: caseOverviewState.allCaseStatuses.data, isFetching: caseOverviewState.caseStatusUpdating && isCaseUpdating, hasError: caseOverviewState.allCaseStatuses.isError })),
|
|
277
277
|
React.createElement("div", { className: "form-wrapper" },
|
|
278
|
-
React.createElement(CaseType, { selectedType:
|
|
278
|
+
React.createElement(CaseType, { selectedType: caseType, onTypeChange: onTypeChange, isDisabled: !canManageCase || allCaseTypes.isFetching, allTypes: allCaseTypes.data, isFetching: caseOverviewState.caseTypeUpdating && isCaseUpdating, hasError: allCaseTypes.isError })),
|
|
279
279
|
React.createElement("div", { className: "form-wrapper" },
|
|
280
|
-
React.createElement(Severity, { onSeverityChange: onSeverityChange, isDisabled: !canManageCase, isFetching: caseOverviewState.caseSeverityUpdating && isCaseUpdating })))),
|
|
280
|
+
React.createElement(Severity, { onCaseDetailsPage: true, onSeverityChange: onSeverityChange, isDisabled: !canManageCase, isFetching: caseOverviewState.caseSeverityUpdating && isCaseUpdating })))),
|
|
281
281
|
React.createElement(ExpandableSection, { className: "case-details-main", toggleText: t('Case information'), isExpanded: isDetailsExpanded, onToggle: onToggleDetails },
|
|
282
282
|
React.createElement(CaseInformation, null))),
|
|
283
283
|
showCloseCaseModal && (React.createElement(CloseCaseModal, { onConfirm: (commentBody) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseAlternateId.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseAlternateId.tsx"],"names":[],"mappings":"AA2BA,UAAU,MAAM;IACZ,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC5B;AAOD,iBAAS,eAAe,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"CaseAlternateId.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseAlternateId.tsx"],"names":[],"mappings":"AA2BA,UAAU,MAAM;IACZ,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC5B;AAOD,iBAAS,eAAe,CAAC,KAAK,EAAE,MAAM,eA0KrC;kBA1KQ,eAAe;;;AA6KxB,eAAe,eAAe,CAAC"}
|
|
@@ -66,7 +66,7 @@ function CaseAlternateId(props) {
|
|
|
66
66
|
setIsUpdating(false);
|
|
67
67
|
}
|
|
68
68
|
catch (e) {
|
|
69
|
-
caseUpdateError.showError(e, t('
|
|
69
|
+
caseUpdateError.showError(e, t('Alternate case ID failed to update'));
|
|
70
70
|
setIsUpdating(false);
|
|
71
71
|
throw e;
|
|
72
72
|
}
|
|
@@ -82,7 +82,7 @@ function CaseAlternateId(props) {
|
|
|
82
82
|
setAlternateIdState(alternateId);
|
|
83
83
|
setIsCancelClicked(!isCancelClicked);
|
|
84
84
|
};
|
|
85
|
-
const maxLengthErrorMessage = t('
|
|
85
|
+
const maxLengthErrorMessage = t('Alternate case ID cannot be more than {{limit}} characters.', {
|
|
86
86
|
limit: ALTERNATE_CASE_ID_LIMIT,
|
|
87
87
|
});
|
|
88
88
|
// Conditions to disable save button
|
|
@@ -100,7 +100,7 @@ function CaseAlternateId(props) {
|
|
|
100
100
|
});
|
|
101
101
|
return (React.createElement(React.Fragment, null,
|
|
102
102
|
React.createElement(NewInlineEdit, { labelProps: { htmlFor: 'case-details-alternate-id' }, labelContent: React.createElement(React.Fragment, null,
|
|
103
|
-
React.createElement(Trans, null, "
|
|
103
|
+
React.createElement(Trans, null, "Alternate case ID"),
|
|
104
104
|
React.createElement(ValueChangedIcon, { afterLocalChange: afterLocalChange, isLocalChange: localAltIDChange, value: alternateId, getTooltipContent: getChangedValueTooltip(() => CaseValuesToWatch.altID) }),
|
|
105
105
|
' ',
|
|
106
106
|
React.createElement(Tooltip, { trigger: 'mouseenter focus', position: TooltipPosition.top, content: React.createElement(Trans, null, "Add your internal tracking ID to better identify and organize support issues.") },
|
|
@@ -117,9 +117,7 @@ function CaseAlternateId(props) {
|
|
|
117
117
|
React.createElement(Spinner, { isSVG: true, size: "lg", className: "pf-u-ml-2xl pf-u-mr-xl" }))))),
|
|
118
118
|
(alternateIdState === null || alternateIdState === void 0 ? void 0 : alternateIdState.length) > ALTERNATE_CASE_ID_LIMIT && (React.createElement("div", { className: "pull-top" },
|
|
119
119
|
React.createElement("p", { className: "form-instructions form-invalid" },
|
|
120
|
-
React.createElement(Trans, null, maxLengthErrorMessage))))
|
|
121
|
-
React.createElement("p", { className: "form-instructions" },
|
|
122
|
-
React.createElement(Trans, null, "Add a personal or company reference number to help you connect, organize, and track cases."))));
|
|
120
|
+
React.createElement(Trans, null, maxLengthErrorMessage))))));
|
|
123
121
|
}
|
|
124
122
|
CaseAlternateId.defaultProps = defaultProps;
|
|
125
123
|
export default CaseAlternateId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseInformation.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/CaseInformation.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"CaseInformation.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/CaseInformation.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAavD,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC;CACnC;AAED,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,MAAM,eA6HpD"}
|
|
@@ -13,6 +13,7 @@ import { Hostname } from '../ImproveCase/Hostname';
|
|
|
13
13
|
import KtQuestions from '../ImproveCase/KtQuestions';
|
|
14
14
|
import { AllProductsSelector } from '../ProductSelector/AllProductsSelector';
|
|
15
15
|
import Description from './Description';
|
|
16
|
+
import { FileDiag } from './FileDiag';
|
|
16
17
|
import OpenCaseIssue from './OpenCaseIssue';
|
|
17
18
|
export default function CaseInformation(props) {
|
|
18
19
|
const { t } = useTranslation();
|
|
@@ -89,9 +90,10 @@ export default function CaseInformation(props) {
|
|
|
89
90
|
canManageCase(loggedInUserJwtToken) && (React.createElement(React.Fragment, null,
|
|
90
91
|
React.createElement("form", { onSubmit: handleFormSubmit },
|
|
91
92
|
skippedTroubleshooting && (React.createElement(AllProductsSelector, { isDropdownSelected: true, routeProps: props.routeProps, loadTCOnChange: true, checkEntitledProduct: true })),
|
|
92
|
-
React.createElement(Hostname, null),
|
|
93
93
|
React.createElement(OpenShiftClusterId, null),
|
|
94
|
+
React.createElement(Hostname, null),
|
|
94
95
|
skippedTroubleshooting && React.createElement(OpenCaseIssue, { inlineEditable: false, required: true }),
|
|
95
96
|
React.createElement(Description, { inlineEditable: false }),
|
|
96
|
-
React.createElement(KtQuestions, null)
|
|
97
|
+
React.createElement(KtQuestions, null),
|
|
98
|
+
React.createElement(FileDiag, null))))));
|
|
97
99
|
}
|
|
@@ -24,11 +24,11 @@ export default function CaseType(props) {
|
|
|
24
24
|
validateCaseType(option);
|
|
25
25
|
};
|
|
26
26
|
return (React.createElement("div", { className: "form-group" },
|
|
27
|
-
React.createElement("label", { htmlFor: "open-
|
|
28
|
-
React.createElement(Trans, null, "
|
|
27
|
+
React.createElement("label", { htmlFor: "open-case-type" },
|
|
28
|
+
React.createElement(Trans, null, "Case type"),
|
|
29
29
|
' ',
|
|
30
30
|
React.createElement("span", { className: "form-required", "aria-hidden": true }, "*")),
|
|
31
|
-
React.createElement(Dropdown, { id: "open-
|
|
31
|
+
React.createElement(Dropdown, { id: "open-case-type", name: "open-case-type", placeholder: t(`Select a category`), title: t(`Select a category`), list: allCaseTypes.data ? toOptions(allCaseTypes.data) : [], selectedItem: toOption(caseType), disabled: allCaseTypes.isError, isLoadingList: allCaseTypes.isFetching, isInValid: isCaseTypeInValid, required: true, onChange: onCaseTypeChange, onOuterClick: validateCaseType, "data-tracking-id": "open-case-type" })));
|
|
32
32
|
}, [
|
|
33
33
|
allCaseTypes.data,
|
|
34
34
|
allCaseTypes.isError,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Description.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/Description.tsx"],"names":[],"mappings":"AAkBA,UAAU,MAAM;IACZ,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Description.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/Description.tsx"],"names":[],"mappings":"AAkBA,UAAU,MAAM;IACZ,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAK,EAAE,MAAM,eAiGhD"}
|
|
@@ -46,7 +46,7 @@ export default function Description(props) {
|
|
|
46
46
|
React.createElement(Trans, null, "What are you experiencing? What are you expecting to happen?"),
|
|
47
47
|
' ',
|
|
48
48
|
isKT1Required && (React.createElement("span", { className: "form-required", "aria-hidden": true }, "*"))), labelProps: { htmlFor: 'open-case-ktQ1-issue' }, content: issue, allowInlineEdit: !!props.inlineEditable, hideSaveCancel: !!props.hideSaveCancel, initialIsEditing: isEmpty(issue), usePreformattedTag: true, saveOnBlur: true },
|
|
49
|
-
React.createElement(TextArea, { id: "open-case-ktQ1-issue", name: "open-case-ktQ1-issue", className: `form-control${isDescriptionInvalid(issue) || (showValidationErrorAlert && isEmpty(issue)) ? ' form-invalid' : ''}`, "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: onKTQ1IssueChange, onFocus: onKTQ1IssueFocusChange, onBlur: onKTQ1IssueFocusChange, "data-tracking-id": "open-case-ktQ1-issue"
|
|
49
|
+
React.createElement(TextArea, { id: "open-case-ktQ1-issue", name: "open-case-ktQ1-issue", className: `form-control${isDescriptionInvalid(issue) || (showValidationErrorAlert && isEmpty(issue)) ? ' form-invalid' : ''}`, "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: onKTQ1IssueChange, onFocus: onKTQ1IssueFocusChange, onBlur: onKTQ1IssueFocusChange, "data-tracking-id": "open-case-ktQ1-issue" }),
|
|
50
50
|
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
|
|
51
51
|
? `Description cannot be more than ${CASE_DEATILS_ISSUE_LIMIT} characters`
|
|
52
52
|
: ''}`),
|
|
@@ -39,12 +39,12 @@ function OpenCaseIssue(props) {
|
|
|
39
39
|
});
|
|
40
40
|
return (React.createElement(React.Fragment, null,
|
|
41
41
|
React.createElement(InlineEdit, { labelProps: { htmlFor: 'open-case-summary' }, labelContent: React.createElement(React.Fragment, null,
|
|
42
|
-
React.createElement(Trans, null, "
|
|
42
|
+
React.createElement(Trans, null, "Issue summary"),
|
|
43
43
|
' ',
|
|
44
44
|
!!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 },
|
|
45
45
|
React.createElement("input", { type: "text", id: "open-case-summary", className: `form-control${isSummaryInValid || hasLargeSummary || (showValidationErrorAlert && !summary)
|
|
46
46
|
? ' form-invalid'
|
|
47
|
-
: ''}`, "aria-invalid": isSummaryInValid, "aria-required": !!props.required, required: !!props.required, name: "open-case-summary", placeholder: t(
|
|
47
|
+
: ''}`, "aria-invalid": isSummaryInValid, "aria-required": !!props.required, required: !!props.required, name: "open-case-summary", placeholder: t('Enter a description'), value: summary, onChange: onSummaryChange, onBlur: onSummaryBlur, autoFocus: !!props.autoFocus, "data-tracking-id": "open-case-summary" })),
|
|
48
48
|
(summary === null || summary === void 0 ? void 0 : summary.length) > SUMMARY_LENGTH_LIMIT && (React.createElement("div", { className: "pull-top" },
|
|
49
49
|
React.createElement("p", { className: "form-instructions form-invalid" },
|
|
50
50
|
React.createElement(Trans, null, maxLengthErrorMessage))))));
|
|
@@ -3,8 +3,9 @@ import { IDClassNameProps } from '@rh-support/types/shared';
|
|
|
3
3
|
interface IProps extends IDClassNameProps {
|
|
4
4
|
isDisabled?: boolean;
|
|
5
5
|
isFetching?: boolean;
|
|
6
|
-
onSeverityChange
|
|
6
|
+
onSeverityChange: (casePayload: Partial<ICasePayload>) => void;
|
|
7
7
|
showSeverityInfoIcon: boolean;
|
|
8
|
+
onCaseDetailsPage?: boolean;
|
|
8
9
|
}
|
|
9
10
|
export interface ISeverityOptions {
|
|
10
11
|
disabled: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Severity.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/Severity.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAKvE,OAAO,EAAE,gBAAgB,EAAW,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"Severity.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/Severity.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAKvE,OAAO,EAAE,gBAAgB,EAAW,MAAM,0BAA0B,CAAC;AAuBrE,UAAU,MAAO,SAAQ,gBAAgB;IACrC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,EAAE,CAAC,WAAW,EAAE,OAAO,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;IAC/D,oBAAoB,EAAE,OAAO,CAAC;IAC9B,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AASD,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,GAAG,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;CACxD;AAED,iBAAS,QAAQ,CAAC,KAAK,EAAE,MAAM,eA8Q9B;kBA9QQ,QAAQ;;;AAgRjB,eAAe,QAAQ,CAAC"}
|
|
@@ -11,9 +11,8 @@ import isEqual from 'lodash/isEqual';
|
|
|
11
11
|
import map from 'lodash/map';
|
|
12
12
|
import React, { useContext, useEffect, useState } from 'react';
|
|
13
13
|
import { Trans, useTranslation } from 'react-i18next';
|
|
14
|
-
import {
|
|
14
|
+
import { useCaseSelector } from '../../context/CaseContext';
|
|
15
15
|
import { getIrtForSLAAndSeverity, getOrtForSLAAndSeverity, getSeverityDescription } from '../../reducers/CaseHelpers';
|
|
16
|
-
import { setCaseDetails } from '../../reducers/CaseReducer';
|
|
17
16
|
import { CaseValuesToWatch } from '../shared/Constants';
|
|
18
17
|
import { getChangedValueTooltip } from '../shared/utils';
|
|
19
18
|
import UpdateSeverityModal from '../UpdateSeverityModal/UpdateSeverityModal';
|
|
@@ -39,18 +38,13 @@ function Severity(props) {
|
|
|
39
38
|
const [seviritiesOptions, setSeveritiesOptions] = useState([]);
|
|
40
39
|
const [doNotShowIRT, setDoNotShowIRT] = useState(false);
|
|
41
40
|
const [openUpdateSeverityModal, setOpenUpdateSeverityModal] = useState(false);
|
|
42
|
-
const caseDispatch = useCaseDispatch();
|
|
43
|
-
const isOnCaseDetailsPage = !isEmpty(caseNumber);
|
|
44
41
|
const updateState = (value) => {
|
|
45
42
|
const casePayload = { severity: value };
|
|
46
|
-
// .. change fts on sev change only while creating case or
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
if (
|
|
50
|
-
props.onSeverityChange
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
setCaseDetails(caseDispatch, casePayload);
|
|
43
|
+
// .. change fts on sev change only while creating case or wchen we change to sev1
|
|
44
|
+
isEmpty(caseNumber) && (casePayload.fts = showFtsOnCreateCasePage(entitlementSla, value));
|
|
45
|
+
!isEmpty(caseNumber) && autoEnableFtsOnCaseViewEditPage(entitlementSla, value) && (casePayload.fts = true);
|
|
46
|
+
if (props.onSeverityChange) {
|
|
47
|
+
props.onSeverityChange(casePayload);
|
|
54
48
|
}
|
|
55
49
|
};
|
|
56
50
|
const onSeverityChange = (option) => {
|
|
@@ -140,7 +134,7 @@ function Severity(props) {
|
|
|
140
134
|
availableSeverities = (_c = allCaseSeverities.data) !== null && _c !== void 0 ? _c : [];
|
|
141
135
|
}
|
|
142
136
|
setSeveritiesOptions(availableSeverities.sort((sevA, sevB) => severitySort(sevA, sevB)));
|
|
143
|
-
const shouldUpdateSeverityOnCaseCreate = !
|
|
137
|
+
const shouldUpdateSeverityOnCaseCreate = !caseNumber && (!severity || !includes(availableSeverities, severity));
|
|
144
138
|
if (shouldUpdateSeverityOnCaseCreate) {
|
|
145
139
|
updateState(availableSeverities[0]);
|
|
146
140
|
}
|
|
@@ -160,7 +154,7 @@ function Severity(props) {
|
|
|
160
154
|
"\u00A0",
|
|
161
155
|
filteredSeverities.filter((s) => s.disabled).length !== 0 && (React.createElement(Tooltip, { position: TooltipPosition.top, content: React.createElement(Trans, null, "Only the enabled severity levels are supported for selected product and version.") },
|
|
162
156
|
React.createElement(WarningTriangleIcon, { color: "#ec7a08", size: "sm", title: "Support Severity Level warning" })))),
|
|
163
|
-
!props.isDisabled &&
|
|
157
|
+
!props.isDisabled && props.onCaseDetailsPage === true ? (React.createElement(React.Fragment, null,
|
|
164
158
|
React.createElement("div", { onClick: toggleModal },
|
|
165
159
|
React.createElement(Dropdown, { name: "open-case-severity", placeholder: t(`Select a severity`), title: t(`Select a severity`), list: allCaseSeverities.data
|
|
166
160
|
? toOptions(filteredSeverities, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SupportLevel.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/SupportLevel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SupportLevel.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/SupportLevel.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAW,MAAM,0BAA0B,CAAC;AAUrE,UAAU,MAAO,SAAQ,gBAAgB;CAAG;AAO5C,iBAAS,YAAY,CAAC,KAAK,EAAE,MAAM,eAuHlC;kBAvHQ,YAAY;;;AAyHrB,eAAe,YAAY,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { Popover, PopoverPosition
|
|
1
|
+
import { Popover, PopoverPosition } from '@patternfly/react-core';
|
|
2
|
+
import { Dropdown } from '@rh-support/components';
|
|
2
3
|
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
3
|
-
import { showFtsOnCaseViewEditPage, showFtsOnCreateCasePage } from '@rh-support/utils';
|
|
4
|
+
import { showFtsOnCaseViewEditPage, showFtsOnCreateCasePage, toOption, toOptions } from '@rh-support/utils';
|
|
4
5
|
import isEmpty from 'lodash/isEmpty';
|
|
5
6
|
import isEqual from 'lodash/isEqual';
|
|
6
|
-
import React, { useContext,
|
|
7
|
+
import React, { useContext, useState } from 'react';
|
|
7
8
|
import { Trans, useTranslation } from 'react-i18next';
|
|
8
9
|
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
9
10
|
import { setCaseDetails } from '../../reducers/CaseReducer';
|
|
@@ -23,54 +24,49 @@ function SupportLevel(props) {
|
|
|
23
24
|
const { globalMetadataState: { allProducts }, } = useContext(GlobalMetadataStateContext);
|
|
24
25
|
const { t } = useTranslation();
|
|
25
26
|
const [isSupportLevelInValid, setIsSupportLevelInValid] = useState(false);
|
|
26
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
27
|
-
const onToggle = (isOpen) => {
|
|
28
|
-
setIsOpen(isOpen);
|
|
29
|
-
};
|
|
30
27
|
const onCaseDetailsChange = (caseDetails) => {
|
|
31
28
|
setCaseDetails(caseDispatch, caseDetails);
|
|
32
29
|
};
|
|
33
|
-
const onEntitlementChange = (
|
|
34
|
-
|
|
35
|
-
const casePayload = { entitlementSla: selected };
|
|
30
|
+
const onEntitlementChange = (option) => {
|
|
31
|
+
const casePayload = { entitlementSla: option.value.slaProcessId };
|
|
36
32
|
casePayload.fts = caseNumber
|
|
37
|
-
? showFtsOnCaseViewEditPage(
|
|
38
|
-
: showFtsOnCreateCasePage(
|
|
39
|
-
|
|
33
|
+
? showFtsOnCaseViewEditPage(option.value.slaProcessId, severity)
|
|
34
|
+
: showFtsOnCreateCasePage(option.value.slaProcessId, severity);
|
|
35
|
+
validateSupportLevel(option);
|
|
40
36
|
onCaseDetailsChange(casePayload);
|
|
41
37
|
};
|
|
38
|
+
const validateSupportLevel = (selectedItem) => {
|
|
39
|
+
const isInvalid = isEmpty(selectedItem) || isEmpty(selectedItem.label);
|
|
40
|
+
setIsSupportLevelInValid(isInvalid);
|
|
41
|
+
};
|
|
42
42
|
const getSlaList = () => {
|
|
43
43
|
var _a, _b;
|
|
44
44
|
const entitledProduct = ((_b = (_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult) !== null && _b !== void 0 ? _b : []).find((entitledProduct) => entitledProduct.product === product);
|
|
45
45
|
if (entitledProduct && entitledProduct.serviceLevels) {
|
|
46
|
-
return entitledProduct.serviceLevels.split(';')
|
|
46
|
+
return toOptions(entitledProduct.serviceLevels.split(';').map((serviceLevel) => ({ slaProcessId: serviceLevel })), { labelKey: 'slaProcessId' });
|
|
47
47
|
}
|
|
48
48
|
else {
|
|
49
|
-
return ownersEntitlements.data ? ownersEntitlements.data
|
|
49
|
+
return ownersEntitlements.data ? toOptions(ownersEntitlements.data, { labelKey: 'slaProcessId' }) : [];
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
|
+
const slaProcessId = entitlementSla;
|
|
52
53
|
const getSelectedSla = () => {
|
|
53
54
|
var _a, _b;
|
|
54
55
|
const entitledProduct = ((_b = (_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult) !== null && _b !== void 0 ? _b : []).find((entitledProduct) => entitledProduct.product === product);
|
|
55
56
|
// if sla is empty then it means either first time this component is rendered or product has changed.
|
|
56
|
-
if (isEmpty(
|
|
57
|
+
if (isEmpty(slaProcessId) && entitledProduct && entitledProduct.preferredServiceLevel) {
|
|
57
58
|
return entitledProduct.preferredServiceLevel;
|
|
58
59
|
}
|
|
59
60
|
else {
|
|
60
|
-
return isEmpty(
|
|
61
|
+
return isEmpty(slaProcessId) && !isEmpty(ownersEntitlements.data)
|
|
61
62
|
? ownersEntitlements.data[0].slaProcessId
|
|
62
|
-
:
|
|
63
|
+
: slaProcessId;
|
|
63
64
|
}
|
|
64
65
|
};
|
|
65
66
|
const selectedSla = getSelectedSla();
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
if (entitlementSla !== selectedSla) {
|
|
70
|
-
onCaseDetailsChange({ entitlementSla: selectedSla });
|
|
71
|
-
}
|
|
72
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
73
|
-
}, [selectedSla, entitlementSla]);
|
|
67
|
+
if (slaProcessId !== selectedSla) {
|
|
68
|
+
onCaseDetailsChange({ entitlementSla: selectedSla });
|
|
69
|
+
}
|
|
74
70
|
return (React.createElement("div", { className: `form-group ${props.className}`, id: `${props.id}` },
|
|
75
71
|
React.createElement("label", { htmlFor: "open-case-support-level" },
|
|
76
72
|
React.createElement(Trans, null, "Support level"),
|
|
@@ -82,7 +78,7 @@ function SupportLevel(props) {
|
|
|
82
78
|
' ',
|
|
83
79
|
React.createElement("a", { href: "/support/offerings/production/sla", target: "_blank" }, "production support service level agreement"))), closeBtnAriaLabel: "Close" },
|
|
84
80
|
React.createElement("i", { "aria-label": "Support Level info", className: "fa fa-question-circle" })),
|
|
85
|
-
React.createElement(
|
|
81
|
+
React.createElement(Dropdown, { id: "open-case-support-level", name: "open-case-support-level", placeholder: "Select", title: `Select Support Level`, list: getSlaList(), selectedItem: toOption({ slaProcessId: selectedSla }, { labelKey: 'slaProcessId' }), disabled: ownersEntitlements.isError || isEmpty(ownersEntitlements.data), isLoadingList: ownersEntitlements.isFetching, isInValid: isSupportLevelInValid, required: true, onChange: onEntitlementChange, onOuterClick: validateSupportLevel, "data-tracking-id": "open-case-support-level" }),
|
|
86
82
|
isEmpty(ownersEntitlements.data) && (React.createElement("p", { className: "form-instructions" }, ownersEntitlements.isError ? t('Error loading support levels') : t('No active subscriptions')))));
|
|
87
83
|
}
|
|
88
84
|
SupportLevel.defaultProps = defaultProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseLanguageSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/CaseLanguageSelector.tsx"],"names":[],"mappings":"AAaA,MAAM,WAAW,MAAM;
|
|
1
|
+
{"version":3,"file":"CaseLanguageSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/CaseLanguageSelector.tsx"],"names":[],"mappings":"AAaA,MAAM,WAAW,MAAM;CAAG;AAE1B,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,KAAK,EAAE,MAAM,eAmDzD"}
|
|
@@ -1,58 +1,38 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Dropdown } from '@rh-support/components';
|
|
2
2
|
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
3
|
-
import { ability, CaseDetailsFields, resourceActions, resources } from '@rh-support/user-permissions';
|
|
4
|
-
import isEmpty from 'lodash/isEmpty';
|
|
5
3
|
import isEqual from 'lodash/isEqual';
|
|
6
|
-
import
|
|
4
|
+
import map from 'lodash/map';
|
|
5
|
+
import React, { useContext } from 'react';
|
|
7
6
|
import { Trans, useTranslation } from 'react-i18next';
|
|
8
7
|
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
8
|
+
import { setCaseDetails } from '../../reducers/CaseReducer';
|
|
9
|
+
import Constants from '../shared/Constants';
|
|
11
10
|
export default function CaseLanguageSelector(props) {
|
|
12
11
|
const { t } = useTranslation();
|
|
13
|
-
const {
|
|
14
|
-
summary: state.caseDetails.summary,
|
|
15
|
-
issue: state.caseDetails.issue,
|
|
16
|
-
environment: state.caseDetails.environment,
|
|
17
|
-
periodicityOfIssue: state.caseDetails.periodicityOfIssue,
|
|
18
|
-
timeFramesAndUrgency: state.caseDetails.timeFramesAndUrgency,
|
|
12
|
+
const { caseLanguage, isLoadingLang } = useCaseSelector((state) => ({
|
|
19
13
|
caseLanguage: state.caseDetails.caseLanguage,
|
|
20
14
|
isLoadingLang: state.isLoadingLang,
|
|
21
15
|
}), isEqual);
|
|
22
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
23
|
-
const onToggle = (isOpen) => {
|
|
24
|
-
setIsOpen(isOpen);
|
|
25
|
-
};
|
|
26
|
-
const canUseLanguageDetection = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseDetailsFields.CASE_LANGUAGE_DETECTION);
|
|
27
16
|
const caseDispatch = useCaseDispatch();
|
|
28
17
|
const { globalMetadataState: { caseLanguages }, } = useContext(GlobalMetadataStateContext);
|
|
29
18
|
const onCaseDetailsChange = (caseDetails) => {
|
|
30
19
|
setCaseDetails(caseDispatch, caseDetails);
|
|
31
20
|
};
|
|
32
|
-
const onLanguageChange = (
|
|
33
|
-
|
|
34
|
-
|
|
21
|
+
const onLanguageChange = (selection) => {
|
|
22
|
+
onCaseDetailsChange({ caseLanguage: selection.value });
|
|
23
|
+
};
|
|
24
|
+
const languagesList = map(caseLanguages.data, (cl) => ({
|
|
25
|
+
label: Constants.languagesMap[cl] || cl,
|
|
26
|
+
value: cl,
|
|
27
|
+
}));
|
|
28
|
+
const selectedLanguage = {
|
|
29
|
+
label: Constants.languagesMap[caseLanguage] || caseLanguage,
|
|
30
|
+
value: caseLanguage,
|
|
35
31
|
};
|
|
36
|
-
useEffect(() => {
|
|
37
|
-
if (!props.isManageStep || !isEmpty(caseLanguage) || isLoadingLang || !canUseLanguageDetection)
|
|
38
|
-
return;
|
|
39
|
-
setDetectedLanguage(caseDispatch, summary, getDescriptionWOQues(issue, environment, periodicityOfIssue, timeFramesAndUrgency));
|
|
40
|
-
}, [
|
|
41
|
-
caseDispatch,
|
|
42
|
-
environment,
|
|
43
|
-
issue,
|
|
44
|
-
caseLanguage,
|
|
45
|
-
periodicityOfIssue,
|
|
46
|
-
summary,
|
|
47
|
-
timeFramesAndUrgency,
|
|
48
|
-
isLoadingLang,
|
|
49
|
-
canUseLanguageDetection,
|
|
50
|
-
props.isManageStep,
|
|
51
|
-
]);
|
|
52
32
|
return (React.createElement("div", { className: "form-group" },
|
|
53
33
|
React.createElement("label", { htmlFor: "open-case-language" },
|
|
54
34
|
React.createElement(Trans, null, "Preferred language")),
|
|
55
|
-
React.createElement(
|
|
35
|
+
React.createElement(Dropdown, { id: "open-case-language", name: "open-case-language", placeholder: "Select a language", title: t(`Select a language`), list: languagesList, selectedItem: selectedLanguage, disabled: caseLanguages.isError, isLoadingList: caseLanguages.isFetching || isLoadingLang, onChange: onLanguageChange, isInValid: caseLanguages.isError, "data-tracking-id": "open-case-language-selector" }),
|
|
56
36
|
React.createElement("p", { className: "form-instructions" },
|
|
57
37
|
React.createElement(Trans, null, "Select a language for communicating with our support engineers"))));
|
|
58
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseManagement.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/CaseManagement.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CaseManagement.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/CaseManagement.tsx"],"names":[],"mappings":"AAmBA,MAAM,WAAW,MAAM;CAAG;AAC1B,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,MAAM,eAyEnD"}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { AbilityContext, CaseDetailsFields, resourceActions, resources } from '@rh-support/user-permissions';
|
|
2
|
+
import isEmpty from 'lodash/isEmpty';
|
|
3
|
+
import isEqual from 'lodash/isEqual';
|
|
4
|
+
import React, { useContext, useEffect } from 'react';
|
|
2
5
|
import { AppMetadataStateContext } from '../../context/AppMetadataContext';
|
|
6
|
+
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
7
|
+
import { getDescriptionWOQues } from '../../reducers/CaseHelpers';
|
|
8
|
+
import { setCaseDetails, setDetectedLanguage } from '../../reducers/CaseReducer';
|
|
3
9
|
import CaseGroup from '../CaseInformation/CaseGroup';
|
|
4
10
|
import Fts from '../CaseInformation/Fts';
|
|
5
11
|
import Severity from '../CaseInformation/Severity';
|
|
@@ -10,19 +16,51 @@ import OpenAlternateID from './OpenAlternateID';
|
|
|
10
16
|
import { RHAssociatesSelector } from './RHAssociatesSelector';
|
|
11
17
|
import CaseContactSelector from './SendNotifications/CaseContactSelector';
|
|
12
18
|
export default function CaseManagement(props) {
|
|
19
|
+
const { summary, issue, environment, periodicityOfIssue, timeFramesAndUrgency, caseLanguage, isLoadingLang } = useCaseSelector((state) => ({
|
|
20
|
+
summary: state.caseDetails.summary,
|
|
21
|
+
issue: state.caseDetails.issue,
|
|
22
|
+
environment: state.caseDetails.environment,
|
|
23
|
+
periodicityOfIssue: state.caseDetails.periodicityOfIssue,
|
|
24
|
+
timeFramesAndUrgency: state.caseDetails.timeFramesAndUrgency,
|
|
25
|
+
caseLanguage: state.caseDetails.caseLanguage,
|
|
26
|
+
isLoadingLang: state.isLoadingLang,
|
|
27
|
+
}), isEqual);
|
|
28
|
+
const caseDispatch = useCaseDispatch();
|
|
13
29
|
const { appMetadataState: { nextButtonRef }, } = useContext(AppMetadataStateContext);
|
|
30
|
+
const ability = useContext(AbilityContext);
|
|
31
|
+
const canSeeEmailNotifications = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_SEND_NOTIFICATIONS);
|
|
32
|
+
const canUseLanguageDetection = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseDetailsFields.CASE_LANGUAGE_DETECTION);
|
|
33
|
+
/** One time on section load */
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (!isEmpty(caseLanguage) || isLoadingLang || !canUseLanguageDetection)
|
|
36
|
+
return;
|
|
37
|
+
setDetectedLanguage(caseDispatch, summary, getDescriptionWOQues(issue, environment, periodicityOfIssue, timeFramesAndUrgency));
|
|
38
|
+
}, [
|
|
39
|
+
caseDispatch,
|
|
40
|
+
environment,
|
|
41
|
+
issue,
|
|
42
|
+
caseLanguage,
|
|
43
|
+
periodicityOfIssue,
|
|
44
|
+
summary,
|
|
45
|
+
timeFramesAndUrgency,
|
|
46
|
+
isLoadingLang,
|
|
47
|
+
canUseLanguageDetection,
|
|
48
|
+
]);
|
|
14
49
|
const handleFormSubmit = (e) => {
|
|
15
50
|
e.preventDefault();
|
|
16
51
|
// simulating click
|
|
17
52
|
nextButtonRef.current.click();
|
|
18
53
|
};
|
|
54
|
+
const onSeverityChange = (payload) => {
|
|
55
|
+
setCaseDetails(caseDispatch, payload);
|
|
56
|
+
};
|
|
19
57
|
return (React.createElement("form", { onSubmit: handleFormSubmit },
|
|
20
58
|
React.createElement(SupportLevel, null),
|
|
21
|
-
React.createElement(Severity, { showSeverityInfoIcon: true }),
|
|
59
|
+
React.createElement(Severity, { showSeverityInfoIcon: true, onSeverityChange: onSeverityChange }),
|
|
22
60
|
React.createElement(Fts, { inlineEditable: false }),
|
|
23
|
-
React.createElement(CaseLanguageSelector, { isManageStep: true }),
|
|
24
61
|
React.createElement(CaseGroup, { init: true }),
|
|
25
|
-
React.createElement(
|
|
62
|
+
React.createElement(CaseLanguageSelector, null),
|
|
63
|
+
canSeeEmailNotifications && React.createElement(CaseContactSelector, null),
|
|
26
64
|
React.createElement(RHAssociatesSelector, null),
|
|
27
65
|
React.createElement(OpenAlternateID, { inlineEditable: false, hideSaveCancel: true }),
|
|
28
66
|
React.createElement(Cep, null)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseContactSelector.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseManagement/SendNotifications/CaseContactSelector.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CaseContactSelector.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseManagement/SendNotifications/CaseContactSelector.tsx"],"names":[],"mappings":"AA4CA,MAAM,WAAW,MAAM;CAAG;AAG1B,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,eA8bzC;AAED,eAAe,mBAAmB,CAAC"}
|