@rh-support/troubleshoot 2.6.19 → 2.6.21
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/ActiveCustomerEscalation/ActiveCustomerEscalation.d.ts +0 -1
- package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.js +5 -31
- package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.js +34 -33
- package/lib/esm/components/CaseEditView/CaseDetailsAside.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseDetailsAside.js +1 -2
- package/lib/esm/components/CaseEditView/CaseDetailsTabs.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseDetailsTabs.js +0 -1
- package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.js +22 -16
- package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.js +95 -52
- package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.js +19 -15
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseHostname.js +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.css +8 -0
- package/lib/esm/components/CaseInformation/Fts.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/Fts.js +2 -6
- package/lib/esm/components/CaseManagement/RHAssociatesSelector.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/RHAssociatesSelector.js +8 -5
- package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.js +7 -7
- package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.js +1 -1
- package/lib/esm/components/TroubleshootSection/TroubleshootSection.d.ts +0 -4
- package/lib/esm/components/TroubleshootSection/TroubleshootSection.d.ts.map +1 -1
- package/lib/esm/components/TroubleshootSection/TroubleshootSection.js +12 -81
- package/lib/esm/components/shared/input/ContactSelectorInternal.d.ts +1 -0
- package/lib/esm/components/shared/input/ContactSelectorInternal.d.ts.map +1 -1
- package/lib/esm/components/shared/input/ContactSelectorInternal.js +6 -1
- package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardLayout.js +4 -5
- package/lib/esm/components/wizardLayout/WizardMain.d.ts +1 -3
- package/lib/esm/components/wizardLayout/WizardMain.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardMain.js +4 -89
- package/lib/esm/components/wizardLayout/WizardNavigation.d.ts +0 -2
- package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardNavigation.js +3 -11
- package/lib/esm/components/wizardLayout/index.d.ts +0 -1
- package/lib/esm/components/wizardLayout/index.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/index.js +0 -1
- package/lib/esm/context/RootTroubleshootProvider.d.ts.map +1 -1
- package/lib/esm/context/RootTroubleshootProvider.js +6 -8
- package/lib/esm/css/case.css +12 -0
- package/lib/esm/hooks/useWizard.d.ts +0 -3
- package/lib/esm/hooks/useWizard.d.ts.map +1 -1
- package/lib/esm/hooks/useWizard.js +1 -1
- package/lib/esm/reducers/CaseConstNTypes.d.ts +0 -1
- package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
- package/lib/esm/reducers/CaseConstNTypes.js +0 -1
- package/lib/esm/scss/_main.scss +13 -0
- package/lib/esm/scss/_pf-overrides.scss +5 -0
- package/package.json +6 -7
- package/lib/esm/components/TroubleshootSection/AskRedHat.d.ts +0 -7
- package/lib/esm/components/TroubleshootSection/AskRedHat.d.ts.map +0 -1
- package/lib/esm/components/TroubleshootSection/AskRedHat.js +0 -73
- package/lib/esm/components/TroubleshootSection/icons/CollapseIcon.d.ts +0 -9
- package/lib/esm/components/TroubleshootSection/icons/CollapseIcon.d.ts.map +0 -1
- package/lib/esm/components/TroubleshootSection/icons/CollapseIcon.js +0 -9
- package/lib/esm/components/TroubleshootSection/icons/StarIcon.d.ts +0 -9
- package/lib/esm/components/TroubleshootSection/icons/StarIcon.d.ts.map +0 -1
- package/lib/esm/components/TroubleshootSection/icons/StarIcon.js +0 -17
- package/lib/esm/context/AIResponseContext.d.ts +0 -10
- package/lib/esm/context/AIResponseContext.d.ts.map +0 -1
- package/lib/esm/context/AIResponseContext.js +0 -26
- package/lib/esm/css/AskRedHat.css +0 -283
- package/lib/esm/reducers/AIResponseConstNTypes.d.ts +0 -48
- package/lib/esm/reducers/AIResponseConstNTypes.d.ts.map +0 -1
- package/lib/esm/reducers/AIResponseConstNTypes.js +0 -16
- package/lib/esm/reducers/AIResponseReducer.d.ts +0 -9
- package/lib/esm/reducers/AIResponseReducer.d.ts.map +0 -1
- package/lib/esm/reducers/AIResponseReducer.js +0 -43
|
@@ -103,7 +103,7 @@ function CaseHostname(props) {
|
|
|
103
103
|
React.createElement("p", null, "You can share this information at any time to improve your support experience."),
|
|
104
104
|
React.createElement(Switch, { label: shareHostnameLabel, isChecked: isShareHostNamesChecked, onChange: onShareHostnameCheck }),
|
|
105
105
|
isHostnamesLoading && (React.createElement(Spinner, { size: "lg", className: "pf-v6-u-ml-sm hostnameSpinner", "aria-label": "Hostname loading" }))));
|
|
106
|
-
if (!canUseHostName
|
|
106
|
+
if (!canUseHostName) {
|
|
107
107
|
return React.createElement(React.Fragment, null);
|
|
108
108
|
}
|
|
109
109
|
const lengthError = (hostnameState === null || hostnameState === void 0 ? void 0 : hostnameState.length) > HOSTNAME_LENGTH_LIMIT;
|
|
@@ -81,11 +81,14 @@
|
|
|
81
81
|
display: flex;
|
|
82
82
|
align-items: center;
|
|
83
83
|
}
|
|
84
|
+
|
|
84
85
|
#options-menu-top-pagination {
|
|
85
86
|
display: flex !important;
|
|
86
87
|
flex-wrap: nowrap !important;
|
|
87
88
|
justify-content: flex-start;
|
|
89
|
+
margin-left: 1rem;
|
|
88
90
|
}
|
|
91
|
+
|
|
89
92
|
.timeline-sort-order-select {
|
|
90
93
|
width: auto;
|
|
91
94
|
margin-left: 1rem;
|
|
@@ -282,6 +285,11 @@ ul#case-history-paginated-timeline {
|
|
|
282
285
|
height: 100% !important;
|
|
283
286
|
}
|
|
284
287
|
|
|
288
|
+
.case-history-timeline-datepicker .pf-v6-c-calendar-month__header-year input {
|
|
289
|
+
font-size: var(--pf-t--global--font--size--body--default);
|
|
290
|
+
line-height: var(--pf-t--global--font--line-height--body);
|
|
291
|
+
}
|
|
292
|
+
|
|
285
293
|
.empty-state-date-picker {
|
|
286
294
|
margin-left: 82%;
|
|
287
295
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Fts.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/Fts.tsx"],"names":[],"mappings":"AAWA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAS/D,UAAU,MAAM;IACZ,cAAc,EAAE,OAAO,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAQD,iBAAS,GAAG,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Fts.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/Fts.tsx"],"names":[],"mappings":"AAWA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAS/D,UAAU,MAAM;IACZ,cAAc,EAAE,OAAO,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAQD,iBAAS,GAAG,CAAC,KAAK,EAAE,MAAM,qBA+OzB;kBA/OQ,GAAG;;;AAkPZ,eAAe,GAAG,CAAC"}
|
|
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { InlineEdit, LoadingIndicator,
|
|
10
|
+
import { InlineEdit, LoadingIndicator, TextAreaAutosize, ToastNotification, usePrevious } from '@rh-support/components';
|
|
11
11
|
import { useCanEditCase } from '@rh-support/react-context';
|
|
12
12
|
import { isFtsEditableOnEditPage, PreviousCaseTypes, showFtsOnCaseViewEditPage, showFtsOnCreateCasePage, } from '@rh-support/utils';
|
|
13
13
|
import isEmpty from 'lodash/isEmpty';
|
|
@@ -171,11 +171,7 @@ function Fts(props) {
|
|
|
171
171
|
React.createElement("input", { type: "checkbox", id: "same-as-case-owner-phone", name: "same-as-case-owner-phone", "data-tracking-id": "same-as-case-owner-phone", checked: ftsContactSameAsOwner, onChange: onSetContactSameAsOwner }),
|
|
172
172
|
React.createElement("label", { htmlFor: "same-as-case-owner-phone", className: "pf-v6-u-font-weight-normal pf-v6-u-font-size-md" },
|
|
173
173
|
React.createElement(Trans, null, "Same as case owner's phone number")),
|
|
174
|
-
React.createElement(
|
|
175
|
-
// id="get-support-24-7-contact"
|
|
176
|
-
, {
|
|
177
|
-
// id="get-support-24-7-contact"
|
|
178
|
-
isDisabled: disableFtsNContact || ftsContactSameAsOwner, "data-tracking-id": "get-support-24-7-contact", phoneValue: contactInfo24X7State || '', onPhoneValueChange: onFtsContactChange }),
|
|
174
|
+
React.createElement(TextAreaAutosize, { id: "get-support-24-7-contact", className: `form-control`, name: "get-support-24-7-contact", value: contactInfo24X7State, onChange: (event) => onFtsContactChange(event.target.value), disabled: disableFtsNContact || ftsContactSameAsOwner, "data-tracking-id": "get-support-24-7-contact" }),
|
|
179
175
|
React.createElement("p", { className: "form-instructions" },
|
|
180
176
|
React.createElement(Trans, null, "Please provide contact information where you can be reached at any time to help you with your case."))),
|
|
181
177
|
(contactInfo24X7State === null || contactInfo24X7State === void 0 ? void 0 : contactInfo24X7State.length) > CONTACT_INFO_24X7_LIMIT && (React.createElement("div", { className: "pull-top" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RHAssociatesSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/RHAssociatesSelector.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAS5D,MAAM,WAAW,MAAM;CAAG;AAG1B,iBAAS,oBAAoB,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"RHAssociatesSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/RHAssociatesSelector.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAS5D,MAAM,WAAW,MAAM;CAAG;AAG1B,iBAAS,oBAAoB,CAAC,KAAK,EAAE,MAAM,qBAqN1C;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -100,6 +100,7 @@ function RHAssociatesSelector(props) {
|
|
|
100
100
|
onNotifiedUserChange([Object.assign(Object.assign({}, loggedInUser.data), { accountNumber: loggedInUserRights.data.getAccountNumber() })], true);
|
|
101
101
|
});
|
|
102
102
|
const removeCurrentUser = () => {
|
|
103
|
+
console.log(isCurrentUserSelectedInternalNotifiedUser());
|
|
103
104
|
if (isCurrentUserSelectedInternalNotifiedUser()) {
|
|
104
105
|
onNotifiedUserChange(filter(selectedNotificationContacts, (contact) => contact.ssoUsername !== loggedInUser.data.ssoUsername));
|
|
105
106
|
}
|
|
@@ -110,21 +111,23 @@ function RHAssociatesSelector(props) {
|
|
|
110
111
|
};
|
|
111
112
|
const canNotifyRHAssociates = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.NOTIFY_RH_ASSOCIATES);
|
|
112
113
|
const toolTipRef = useRef();
|
|
114
|
+
const contactsToExclude = !isEmpty(selectedOwner.data) ? [{ ssoUsername: selectedOwner.data.ssoUsername }] : [];
|
|
113
115
|
if (!canNotifyRHAssociates)
|
|
114
116
|
return React.createElement(React.Fragment, null);
|
|
115
117
|
return (React.createElement(React.Fragment, null, canNotifyRHAssociates && (React.createElement("div", { className: "form-group" },
|
|
116
118
|
React.createElement("label", { className: "react-typeahead-label-wrapper", htmlFor: "get-support-notifications" },
|
|
117
119
|
React.createElement(Trans, null, "Internal Contacts"),
|
|
118
|
-
React.createElement(ContactSelectorInternal, { className: "push-bottom-narrow", selectedContacts: filter(selectedNotificationContacts, (c) => c.isInternal), showSelectedContacts: true, contactsToExclude:
|
|
120
|
+
React.createElement(ContactSelectorInternal, { className: "push-bottom-narrow", selectedContacts: filter(selectedNotificationContacts, (c) => c.isInternal), showSelectedContacts: true, contactsToExclude: contactsToExclude, disableContactRemoval: contactsToExclude, id: "open-case-rh-notifications", name: "open-case-rh-notifications", multiple: true, contactListParams: {
|
|
119
121
|
internal: false, // to get non-ldap contacts only
|
|
120
122
|
isInternalContact: true,
|
|
121
123
|
}, placeholder: t(`Add an internal associate to watch this case`), onSelect: onNotifiedUserChange, renderToken: renderToken, isUpdating: isRHAssociatesUpdating, "data-tracking-id": "case-contact-select-rh-watcher" })),
|
|
122
|
-
caseNumber && showAddWatchButton() && !isExportingPDF && (React.createElement(Button, { variant: "secondary", onClick: addCurrentUser, type: "button", "data-tracking-id": "case-add-me-rh-watcher" },
|
|
124
|
+
caseNumber && showAddWatchButton() && !isExportingPDF && (React.createElement(Button, { className: "add-watcher-button", variant: "secondary", onClick: addCurrentUser, type: "button", "data-tracking-id": "case-add-me-rh-watcher", isDisabled: isRHAssociatesUpdating },
|
|
123
125
|
React.createElement(Trans, null, "Add me as a watcher"))),
|
|
124
|
-
caseNumber && showRemoveWatchButton() && !isExportingPDF && (React.createElement("div", {
|
|
126
|
+
caseNumber && showRemoveWatchButton() && !isExportingPDF && (React.createElement("div", { className: "remove-me-as-watcher pf-v6-u-display-inline-block" }, isCurrentUserCaseContact ? (React.createElement(React.Fragment, null,
|
|
125
127
|
React.createElement(Tooltip, { trigger: 'mouseenter focus', triggerRef: toolTipRef, position: TooltipPosition.top, content: React.createElement(Trans, null, "You are case contact and therefore you cannot be removed as watcher") }),
|
|
126
|
-
React.createElement(
|
|
127
|
-
React.createElement(
|
|
128
|
+
React.createElement("div", { ref: toolTipRef },
|
|
129
|
+
React.createElement(Button, { className: "remove-watcher-button", variant: "tertiary", onClick: removeCurrentUser, isDisabled: true, "data-tracking-id": "case-remove-me-rh-watcher-case-contact" },
|
|
130
|
+
React.createElement(Trans, null, "Remove me as a watcher"))))) : (React.createElement(Button, { className: "remove-watcher-button", variant: "secondary", onClick: removeCurrentUser, "data-tracking-id": "case-remove-me-rh-watcher", isDisabled: isRHAssociatesUpdating },
|
|
128
131
|
React.createElement(Trans, null, "Remove me as a watcher")))))))));
|
|
129
132
|
}
|
|
130
133
|
export { RHAssociatesSelector };
|
|
@@ -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":"AA0BA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAgBvE,MAAM,WAAW,MAAM;CAAG;AAG1B,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,qBAodzC;AAED,eAAe,mBAAmB,CAAC"}
|
|
@@ -17,7 +17,6 @@ import differenceBy from 'lodash/differenceBy';
|
|
|
17
17
|
import filter from 'lodash/filter';
|
|
18
18
|
import find from 'lodash/find';
|
|
19
19
|
import intersection from 'lodash/intersection';
|
|
20
|
-
import intersectionBy from 'lodash/intersectionBy';
|
|
21
20
|
import isEmpty from 'lodash/isEmpty';
|
|
22
21
|
import isEqual from 'lodash/isEqual';
|
|
23
22
|
import map from 'lodash/map';
|
|
@@ -112,7 +111,7 @@ function CaseContactSelector(props) {
|
|
|
112
111
|
});
|
|
113
112
|
const processCaseContacts = (selectedContacts) => __awaiter(this, void 0, void 0, function* () {
|
|
114
113
|
const toAdd = filter(differenceBy(selectedContacts, selectedNotificationContacts, 'ssoUsername'), (item) => item.ssoUsername !== contactSsoUsername);
|
|
115
|
-
const toRemove = filter(
|
|
114
|
+
const toRemove = filter(differenceBy(selectedNotificationContacts, selectedContacts, 'ssoUsername'), (item) => !item.isInternal && item.ssoUsername !== contactSsoUsername);
|
|
116
115
|
(toAdd.length || toRemove.length) && clearErrorState();
|
|
117
116
|
if ((toAdd || []).length > 0) {
|
|
118
117
|
if (loggedInUserRights.data.isOrgAdmin()) {
|
|
@@ -267,7 +266,7 @@ function CaseContactSelector(props) {
|
|
|
267
266
|
React.createElement(CaseContactsSelectorExternal, { isDisabled: isUpdatingCustomEmails || isAssociatesUpdating, groupContactsAndEmails: true, allowCustomEmailAdd: true, contactSsoUsername: contactSsoUsername !== null && contactSsoUsername !== void 0 ? contactSsoUsername : '', loggedInUserRights: loggedInUserRights.data, selectedAccountNumber: accountNumber, selected: [
|
|
268
267
|
...customEmailsList.data,
|
|
269
268
|
...filter(selectedNotificationContacts, (c) => !c.isInternal),
|
|
270
|
-
], contactsToExclude: !isEmpty(selectedOwner.data) ? [selectedOwner.data] : [], onChange: onNotifiedUserChange, clearButton: true, multiple: true, placeholder: t(
|
|
269
|
+
], contactsToExclude: !isEmpty(selectedOwner.data) ? [selectedOwner.data] : [], onChange: onNotifiedUserChange, clearButton: true, multiple: true, placeholder: t('Search for an email address or username of the person you want to notify'), id: "open-case-notifications", name: "open-case-notifications", className: "react-select-custom", renderToken: renderToken, isUpdating: isAssociatesUpdating ||
|
|
271
270
|
customEmailsList.isFetching ||
|
|
272
271
|
isUpdatingCustomEmails ||
|
|
273
272
|
isCaseOwnerUpdating, isExportingPDF: isExportingPDF, customEmails: accountCustomEmails.data || [], canAddNew: onAddNew, getCreateNewText: getCreateNewText })),
|
|
@@ -284,12 +283,13 @@ function CaseContactSelector(props) {
|
|
|
284
283
|
" is not listed under your account. You can always",
|
|
285
284
|
' ',
|
|
286
285
|
React.createElement(Button, { variant: "link", isInline: true, component: "span", onClick: onAddEmailToAccountBtnClick }, "add them at the account level"))))),
|
|
287
|
-
caseNumber && showAddWatchButton() && !isExportingPDF && (React.createElement(Button, { variant: "secondary", onClick: addCurrentUser, type: "button", "data-tracking-id": "case-add-me-watcher" },
|
|
286
|
+
caseNumber && showAddWatchButton() && !isExportingPDF && (React.createElement(Button, { className: "add-watcher-button", variant: "secondary", onClick: addCurrentUser, type: "button", "data-tracking-id": "case-add-me-watcher", isDisabled: isUpdatingCustomEmails || isAssociatesUpdating },
|
|
288
287
|
React.createElement(Trans, null, "Add me as a watcher"))),
|
|
289
|
-
caseNumber && showRemoveWatchButton() && !isExportingPDF && (React.createElement("div", {
|
|
288
|
+
caseNumber && showRemoveWatchButton() && !isExportingPDF && (React.createElement("div", { className: "remove-me-as-watcher pf-v6-u-display-inline-block" }, isCurrentUserCaseContact ? (React.createElement(React.Fragment, null,
|
|
290
289
|
React.createElement(Tooltip, { trigger: 'mouseenter focus', triggerRef: toolTipRef, position: TooltipPosition.top, content: React.createElement(Trans, null, "You are case contact and therefore you cannot be removed as watcher") }),
|
|
291
|
-
React.createElement(
|
|
292
|
-
React.createElement(
|
|
290
|
+
React.createElement("div", { className: "pf-v6-u-display-inline-block", ref: toolTipRef },
|
|
291
|
+
React.createElement(Button, { className: "remove-watcher-button", variant: "tertiary", onClick: removeCurrentUser, type: "button", isDisabled: true, "data-tracking-id": "case-remove-me-watcher" },
|
|
292
|
+
React.createElement(Trans, null, "Remove me as a watcher"))))) : (React.createElement(Button, { className: "remove-watcher-button", variant: "secondary", onClick: removeCurrentUser, isDisabled: isUpdatingCustomEmails || isAssociatesUpdating, type: "button", "data-tracking-id": "case-remove-me-watcher" },
|
|
293
293
|
React.createElement(Trans, null, "Remove me as a watcher"))))))) : (React.createElement(NonOrgCaseNotifyeesSelector, { id: "open-case-notifications", placeholder: t('Enter an email address or username for the person you want to notify'), isDisabled: isAssociatesUpdating || customEmailsList.isFetching || isUpdatingCustomEmails, selectedItems: [
|
|
294
294
|
...customEmailsList.data,
|
|
295
295
|
...filter(selectedNotificationContacts, (c) => !c.isInternal),
|
package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NonOrgCaseNotifyeesSelector.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAwB,oBAAoB,EAAY,MAAM,wBAAwB,CAAC;AAE9F,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAkD,MAAM,OAAO,CAAC;AAGvE,UAAU,MAAO,SAAQ,gBAAgB;IACrC,aAAa,EAAE,oBAAoB,EAAE,CAAC;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,CAAC,aAAa,EAAE,oBAAoB,EAAE,KAAK,IAAI,CAAC;IAC1D,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;IAC1C,kBAAkB,EAAE,MAAM,CAAC;CAC9B;AAqCD,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"NonOrgCaseNotifyeesSelector.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAwB,oBAAoB,EAAY,MAAM,wBAAwB,CAAC;AAE9F,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAkD,MAAM,OAAO,CAAC;AAGvE,UAAU,MAAO,SAAQ,gBAAgB;IACrC,aAAa,EAAE,oBAAoB,EAAE,CAAC;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,CAAC,aAAa,EAAE,oBAAoB,EAAE,KAAK,IAAI,CAAC;IAC1D,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;IAC1C,kBAAkB,EAAE,MAAM,CAAC;CAC9B;AAqCD,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,qBA2MxD"}
|
|
@@ -144,7 +144,7 @@ export function NonOrgCaseNotifyeesSelector(props) {
|
|
|
144
144
|
const isContactOption = isContact(option);
|
|
145
145
|
const isCurrentUserCaseContact = isContactOption && option.ssoUsername === props.contactSsoUsername;
|
|
146
146
|
const isDisabled = (props.isChipDisabled && isContactOption) || isCurrentUserCaseContact;
|
|
147
|
-
return (React.createElement(Label, { key: getKey(option) || index, onClose:
|
|
147
|
+
return (React.createElement(Label, { key: getKey(option) || index, onClose: () => onRemoveItem(option), isDisabled: isDisabled, closeBtnAriaLabel: `Remove ${getHydraContactLabel(option)}`, variant: "outline" }, getHydraContactLabel(option)));
|
|
148
148
|
})));
|
|
149
149
|
};
|
|
150
150
|
const menu = (React.createElement(Menu, { ref: menuRef },
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import '@ifd-ui/ask-redhat-core/ask-redhat-core.css';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
interface IProps {
|
|
4
3
|
inlineEditable: boolean;
|
|
@@ -7,9 +6,6 @@ interface IProps {
|
|
|
7
6
|
collapseOnBlur?: boolean;
|
|
8
7
|
autoFocus?: boolean;
|
|
9
8
|
hideSaveCancel?: boolean;
|
|
10
|
-
isAIChatMode: boolean;
|
|
11
|
-
setIsAIChatMode: (value: boolean) => void;
|
|
12
|
-
onChatWithAIClick?: () => void;
|
|
13
9
|
}
|
|
14
10
|
declare function TroubleshootSection(props: IProps): React.JSX.Element;
|
|
15
11
|
declare namespace TroubleshootSection {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TroubleshootSection.d.ts","sourceRoot":"","sources":["../../../../src/components/TroubleshootSection/TroubleshootSection.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TroubleshootSection.d.ts","sourceRoot":"","sources":["../../../../src/components/TroubleshootSection/TroubleshootSection.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAU1C,UAAU,MAAM;IACZ,cAAc,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC5B;AASD,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,qBAoFzC;kBApFQ,mBAAmB;;;AAuF5B,eAAe,mBAAmB,CAAC"}
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import '@ifd-ui/ask-redhat-core/ask-redhat-core.css';
|
|
11
|
-
import { AskRedHatChat, setAuthToken } from '@ifd-ui/ask-redhat-core';
|
|
12
1
|
import { Card, CardBody, CardHeader, Tooltip } from '@patternfly/react-core';
|
|
13
2
|
import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
|
|
14
3
|
import { ErrorBoundary, LoadingDots } from '@rh-support/components';
|
|
@@ -17,15 +6,12 @@ import isEmpty from 'lodash/isEmpty';
|
|
|
17
6
|
import isEqual from 'lodash/isEqual';
|
|
18
7
|
import React, { useContext } from 'react';
|
|
19
8
|
import { Trans, useTranslation } from 'react-i18next';
|
|
20
|
-
import { useAIResponseState } from '../../context/AIResponseContext';
|
|
21
9
|
import { useCaseSelector } from '../../context/CaseContext';
|
|
22
10
|
import { TCStateContext } from '../../context/TopContentContext';
|
|
23
|
-
import { excludedCaseTypesforARH } from '../../reducers/CaseConstNTypes';
|
|
24
11
|
import { OpenShiftClusterId } from '../CaseManagement/OpenShiftClusterId';
|
|
25
12
|
import ClusterRecommendations from '../Recommendations/ClusterRecommendations';
|
|
26
13
|
import InsightsResults from '../Recommendations/InsightsResults';
|
|
27
14
|
import Suggestions from '../Suggestions/Suggestions';
|
|
28
|
-
import { AskRedHat } from './AskRedHat';
|
|
29
15
|
const defaultProps = {
|
|
30
16
|
initialIsEditing: false,
|
|
31
17
|
required: false,
|
|
@@ -34,12 +20,9 @@ const defaultProps = {
|
|
|
34
20
|
hideSaveCancel: false,
|
|
35
21
|
};
|
|
36
22
|
function TroubleshootSection(props) {
|
|
37
|
-
var _a
|
|
23
|
+
var _a;
|
|
38
24
|
const { t } = useTranslation();
|
|
39
25
|
const { topContentState: { topContent }, } = useContext(TCStateContext);
|
|
40
|
-
const aiResponseState = useAIResponseState();
|
|
41
|
-
const session = window === null || window === void 0 ? void 0 : window.sessionjs;
|
|
42
|
-
const keycloakSession = (_b = (_a = session === null || session === void 0 ? void 0 : session._state) === null || _a === void 0 ? void 0 : _a.keycloak) !== null && _b !== void 0 ? _b : null;
|
|
43
26
|
const { product, version, isCreatingCase, caseType } = useCaseSelector((state) => ({
|
|
44
27
|
product: state.caseDetails.product,
|
|
45
28
|
version: state.caseDetails.version,
|
|
@@ -49,70 +32,18 @@ function TroubleshootSection(props) {
|
|
|
49
32
|
issue: state.caseDetails.issue,
|
|
50
33
|
}), isEqual);
|
|
51
34
|
const canShowTopProducts = isEmpty(product);
|
|
52
|
-
const canShowTopContent = !canShowTopProducts && ((
|
|
35
|
+
const canShowTopContent = !canShowTopProducts && ((_a = topContent === null || topContent === void 0 ? void 0 : topContent.data) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
53
36
|
const isNotAnIdea = caseType !== PreviousCaseTypes.FEATURE_ENHANCEMENT;
|
|
54
|
-
|
|
55
|
-
const handleInitialized = (success, error) => {
|
|
56
|
-
if (success) {
|
|
57
|
-
console.log('Chat initialized successfully');
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
console.error('Chat initialization failed:', error);
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
const preprocessRequest = () => __awaiter(this, void 0, void 0, function* () {
|
|
64
|
-
var _a;
|
|
65
|
-
if (!keycloakSession) {
|
|
66
|
-
throw new Error('No Keycloak session available');
|
|
67
|
-
}
|
|
68
|
-
try {
|
|
69
|
-
yield ((_a = session === null || session === void 0 ? void 0 : session.updateToken) === null || _a === void 0 ? void 0 : _a.call(session, 500));
|
|
70
|
-
const token = session === null || session === void 0 ? void 0 : session.getEncodedToken();
|
|
71
|
-
if (token) {
|
|
72
|
-
setAuthToken(token);
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
throw new Error('No token available');
|
|
76
|
-
}
|
|
77
|
-
return Promise.resolve();
|
|
78
|
-
}
|
|
79
|
-
catch (error) {
|
|
80
|
-
console.error('Failed to refresh token:', error);
|
|
81
|
-
throw error;
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
const initConfig = {
|
|
85
|
-
packageVersion: (_d = window === null || window === void 0 ? void 0 : window.supportVersionInfo) === null || _d === void 0 ? void 0 : _d.packageVersion,
|
|
86
|
-
appSourceId: 'PCM-001',
|
|
87
|
-
enableDebugLogging: false,
|
|
88
|
-
headerTitle: 'AI insights',
|
|
89
|
-
showWelcomeMessage: false,
|
|
90
|
-
conversationId: ((_e = aiResponseState.aiResponse) === null || _e === void 0 ? void 0 : _e.conversationId) || undefined,
|
|
91
|
-
enableHeaderMenu: false,
|
|
92
|
-
enableTheme: false,
|
|
93
|
-
tokenAuth: {
|
|
94
|
-
auth: {
|
|
95
|
-
userInfo: (_h = (_g = (_f = window === null || window === void 0 ? void 0 : window.sessionjs) === null || _f === void 0 ? void 0 : _f.getToken) === null || _g === void 0 ? void 0 : _g.call(_f)) !== null && _h !== void 0 ? _h : {},
|
|
96
|
-
authToken: (_k = (_j = window === null || window === void 0 ? void 0 : window.sessionjs) === null || _j === void 0 ? void 0 : _j.getEncodedToken()) !== null && _k !== void 0 ? _k : '',
|
|
97
|
-
},
|
|
98
|
-
events: {
|
|
99
|
-
preprocessRequest,
|
|
100
|
-
isAuthenticated: () => {
|
|
101
|
-
var _a, _b, _c;
|
|
102
|
-
return (_c = (_b = (_a = window === null || window === void 0 ? void 0 : window.sessionjs) === null || _a === void 0 ? void 0 : _a.isAuthenticated) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : false;
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
onInitialized: handleInitialized,
|
|
107
|
-
};
|
|
108
|
-
const handleChatWithAIClick = () => {
|
|
109
|
-
var _a;
|
|
110
|
-
props.setIsAIChatMode(true);
|
|
111
|
-
(_a = props.onChatWithAIClick) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
112
|
-
};
|
|
113
|
-
return (React.createElement(React.Fragment, null, props.isAIChatMode ? (React.createElement(AskRedHatChat, { initConfig: initConfig })) : (React.createElement(React.Fragment, null,
|
|
37
|
+
return (React.createElement(React.Fragment, null,
|
|
114
38
|
React.createElement("section", null,
|
|
115
|
-
|
|
39
|
+
React.createElement("header", null,
|
|
40
|
+
React.createElement("p", { className: "pf-v6-u-pt-md" },
|
|
41
|
+
React.createElement("span", { className: "pf-v6-u-font-family-heading pf-v6-u-pr-xs" }, t('Product')),
|
|
42
|
+
" ",
|
|
43
|
+
product),
|
|
44
|
+
React.createElement("p", null,
|
|
45
|
+
React.createElement("span", { className: "pf-v6-u-font-family-heading pf-v6-u-pr-xs" }, t('Version')),
|
|
46
|
+
version)),
|
|
116
47
|
!isCreatingCase && (React.createElement(OpenShiftClusterId, { className: "push-bottom", "data-tracking-id": "troubleshoot-section-openshift-cluster-id" })),
|
|
117
48
|
React.createElement(LoadingDots, { show: topContent.isFetching }),
|
|
118
49
|
topContent.data.length === 0 && (React.createElement(Card, { id: "card", className: "pf-v6-u-mb-md" },
|
|
@@ -125,7 +56,7 @@ function TroubleshootSection(props) {
|
|
|
125
56
|
React.createElement(Trans, null, "No recommendations for this product")))),
|
|
126
57
|
React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading suggestions') } }, canShowTopContent && !isEmpty(version) && React.createElement(Suggestions, null)),
|
|
127
58
|
!isCreatingCase && React.createElement(ClusterRecommendations, { className: "pf-v6-u-mt-lg" })),
|
|
128
|
-
React.createElement("section", { className: "pf-v6-u-mt-lg" }, isNotAnIdea && (React.createElement(InsightsResults, { isDisplayOnMain: true, "data-tracking-id": "troubleshoot-section-file-recs" })))))
|
|
59
|
+
React.createElement("section", { className: "pf-v6-u-mt-lg" }, isNotAnIdea && (React.createElement(InsightsResults, { isDisplayOnMain: true, "data-tracking-id": "troubleshoot-section-file-recs" })))));
|
|
129
60
|
}
|
|
130
61
|
TroubleshootSection.defaultProps = defaultProps;
|
|
131
62
|
export default TroubleshootSection;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContactSelectorInternal.d.ts","sourceRoot":"","sources":["../../../../../src/components/shared/input/ContactSelectorInternal.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iDAAiD,CAAC;
|
|
1
|
+
{"version":3,"file":"ContactSelectorInternal.d.ts","sourceRoot":"","sources":["../../../../../src/components/shared/input/ContactSelectorInternal.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iDAAiD,CAAC;AAsBrF,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,MAAM;IACnB,QAAQ,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,GAAG,CAAC;IACxC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,kBAAkB,CAAC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC9B,iBAAiB,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC/B,qBAAqB,CAAC,EAAE,QAAQ,EAAE,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACnC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,CAAC,MAAM,KAAA,EAAE,KAAK,KAAA,EAAE,GAAG,KAAA,KAAK,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;CAClE;AAED,MAAM,WAAW,MAAM;IACnB,OAAO,EAAE,QAAQ,EAAE,CAAC;IACpB,gBAAgB,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC9B,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAED,qBAAa,uBAAwB,SAAQ,KAAK,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;IACxE,UAAU,EAAE,eAAe,CAAC;IAC5B,aAAa,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,CAAQ;IAC5C,QAAQ,oCAAuC;IAE/C,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,MAAM,CAAC,CAalC;gBAEU,KAAK,EAAE,MAAM;IAYzB,gBAAgB,YAAa,QAAQ,KAAG,MAAM,CAS5C;IAEF,mBAAmB,aAAc,QAAQ,EAAE,KAAG,QAAQ,EAAE,CAGtD;IAEF,sBAAsB,MAAO,QAAQ,KAAG,OAAO,CAE7C;IAEF,kBAAkB,CAAC,SAAS,EAAE,MAAM;IAmBpC,QAAQ,aAAoB,QAAQ,EAAE,mBAKpC;IAEF,YAAY,UAAiB,MAAM,mBA0CjC;IAEF,iBAAiB,UAAW,MAAM,UAiBhC;IAEF,YAAY,UAAW,GAAG,aAAa,GAAG,UAkBxC;IAEF,mBAAmB,oBAAqB,QAAQ,UAI9C;IAEF,aAAa,UAAW,KAAK,CAAC,aAAa,UAkCzC;IAEF,WAAW,aAIT;IAEF,UAAU,aAKR;IAEF,WAAW,aAGT;IAEF,QAAQ,aAEN;IAEF,MAAM;CA6GT"}
|
|
@@ -10,6 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import { contacts } from '@cee-eng/hydrajs';
|
|
11
11
|
import { Button, Label, LabelGroup, MenuToggle, Select, SelectList, SelectOption, Spinner, TextInputGroup, TextInputGroupMain, TextInputGroupUtilities, } from '@patternfly/react-core';
|
|
12
12
|
import TimesCircleIcon from '@patternfly/react-icons/dist/esm/icons/times-circle-icon';
|
|
13
|
+
import { haltEvent } from '@rh-support/utils';
|
|
13
14
|
import assign from 'lodash/assign';
|
|
14
15
|
import differenceBy from 'lodash/differenceBy';
|
|
15
16
|
import filter from 'lodash/filter';
|
|
@@ -212,7 +213,11 @@ export class ContactSelectorInternal extends React.Component {
|
|
|
212
213
|
: searchValue;
|
|
213
214
|
const toggle = (toggleRef) => (React.createElement(MenuToggle, { ref: toggleRef, variant: "typeahead", onClick: this.onToggle, isExpanded: isOpen, isDisabled: this.props.disabled || this.props.isUpdating, isFullWidth: true },
|
|
214
215
|
React.createElement(TextInputGroup, { isPlain: true },
|
|
215
|
-
React.createElement(TextInputGroupMain, { value: displayValue, onChange: (_, value) => this.handleInputChange(value), onFocus: this.handleFocus, onBlur: this.handleBlur, onKeyDown: this.handleKeyDown, placeholder: this.props.placeholder || 'Search contact by name or username', ref: this.inputRef, autoComplete: "off", isExpanded: isOpen, role: "combobox" }, this.props.multiple && selectedContacts.length > 0 && (React.createElement(LabelGroup, { "aria-label": "Selected contacts" }, selectedContacts.map((contact, index) =>
|
|
216
|
+
React.createElement(TextInputGroupMain, { value: displayValue, onChange: (_, value) => this.handleInputChange(value), onFocus: this.handleFocus, onBlur: this.handleBlur, onKeyDown: this.handleKeyDown, placeholder: this.props.placeholder || 'Search contact by name or username', ref: this.inputRef, autoComplete: "off", isExpanded: isOpen, role: "combobox" }, this.props.multiple && selectedContacts.length > 0 && (React.createElement(LabelGroup, { "aria-label": "Selected contacts" }, selectedContacts.map((contact, index) => {
|
|
217
|
+
var _a, _b;
|
|
218
|
+
const isDisabled = !!((_b = (_a = this.props) === null || _a === void 0 ? void 0 : _a.disableContactRemoval) === null || _b === void 0 ? void 0 : _b.find((v) => v.ssoUsername === contact.ssoUsername));
|
|
219
|
+
return (React.createElement(Label, { key: contact.ssoUsername, variant: "outline", color: "blue", onClick: haltEvent, onClose: () => this.handleRemoveContact(contact), isDisabled: isDisabled }, this.getSelectedLabel(contact)));
|
|
220
|
+
})))),
|
|
216
221
|
React.createElement(TextInputGroupUtilities, null,
|
|
217
222
|
isLoading && React.createElement(Spinner, { size: "sm" }),
|
|
218
223
|
this.props.clearButton && (searchValue || selectedContacts.length > 0) && (React.createElement(Button, { variant: "plain", icon: React.createElement(TimesCircleIcon, null), onClick: this.handleClear, "aria-label": "Clear input" }))))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardLayout.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardLayout.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAEvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAMvD,OAAO,EAAuC,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAcvG,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"WizardLayout.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardLayout.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAEvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAMvD,OAAO,EAAuC,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAcvG,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,qBAoNzC"}
|
|
@@ -35,7 +35,6 @@ import WizardMain from './WizardMain';
|
|
|
35
35
|
export function WizardLayout(props) {
|
|
36
36
|
const { routeState: { activeSection, isCaseCreate }, } = useContext(RouteContext);
|
|
37
37
|
const { getMetadata } = useMetadata();
|
|
38
|
-
const [isAIChatMode, setIsAIChatMode] = useState(false);
|
|
39
38
|
const { caseCreationError, contactSSOName, caseType, product, caseState, ABTestVariation } = useCaseSelector((state) => ({
|
|
40
39
|
caseState: state,
|
|
41
40
|
caseCreationError: state.caseCreationError,
|
|
@@ -153,9 +152,9 @@ export function WizardLayout(props) {
|
|
|
153
152
|
React.createElement(GlobalTroubleshootEffects, { routeProps: props.routeProps }),
|
|
154
153
|
activeSection !== AppRouteSections.DESCRIBE_IDEA && (React.createElement(PreCaseConfirmationModals, { onModalClose: onModalClose, confirmationModalType: confirmationModalType, onConfirm: () => submitCaseAndNavigate(caseCreationError) })),
|
|
155
154
|
React.createElement(Grid, { style: { height: '100%' } },
|
|
156
|
-
React.createElement(GridItem, { sm: 12, md: 12, lg:
|
|
157
|
-
React.createElement(WizardMain, { routeProps: props.routeProps, submitCaseAndNavigate: submitCaseAndNavigate, confirmSupportModal: confirmSupportModal
|
|
158
|
-
|
|
159
|
-
React.createElement(WizardAside, { isAttachmentUploadModalOpen: confirmationModalType === PreCaseConfirmationModalsEnum.NO_ATTACHMENT_MODAL, routeProps: props.routeProps })))
|
|
155
|
+
React.createElement(GridItem, { sm: 12, md: 12, lg: 8, xl2: 8 },
|
|
156
|
+
React.createElement(WizardMain, { routeProps: props.routeProps, submitCaseAndNavigate: submitCaseAndNavigate, confirmSupportModal: confirmSupportModal })),
|
|
157
|
+
React.createElement(GridItem, { span: 4, className: "grid-wizard-aside-content" },
|
|
158
|
+
React.createElement(WizardAside, { isAttachmentUploadModalOpen: confirmationModalType === PreCaseConfirmationModalsEnum.NO_ATTACHMENT_MODAL, routeProps: props.routeProps }))),
|
|
160
159
|
React.createElement(AlertToastWrapper, { submitCaseAndNavigate: submitCaseAndNavigate, routeProps: props.routeProps })));
|
|
161
160
|
}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { RouteComponentProps } from 'react-router-dom';
|
|
3
3
|
import { IRouteUrlParams } from '../../reducers/RouteConstNTypes';
|
|
4
4
|
interface IProps {
|
|
5
5
|
routeProps: RouteComponentProps<IRouteUrlParams>;
|
|
6
6
|
submitCaseAndNavigate: (isReSubmitting: boolean) => void;
|
|
7
7
|
confirmSupportModal: (hasPreferredSecureSupportAccount: boolean) => void;
|
|
8
|
-
isAIChatMode: boolean;
|
|
9
|
-
setIsAIChatMode: Dispatch<SetStateAction<boolean>>;
|
|
10
8
|
}
|
|
11
9
|
declare function WizardMain(props: IProps): React.JSX.Element;
|
|
12
10
|
export default WizardMain;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardMain.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardMain.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WizardMain.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardMain.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAEjF,OAAO,EAAS,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAO9D,OAAO,EAAoB,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAOpF,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,qBAAqB,EAAE,CAAC,cAAc,EAAE,OAAO,KAAK,IAAI,CAAC;IACzD,mBAAmB,EAAE,CAAC,gCAAgC,EAAE,OAAO,KAAK,IAAI,CAAC;CAC5E;AAED,iBAAS,UAAU,CAAC,KAAK,EAAE,MAAM,qBAwMhC;AACD,eAAe,UAAU,CAAC"}
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
1
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
11
2
|
var t = {};
|
|
12
3
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -18,20 +9,16 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
18
9
|
}
|
|
19
10
|
return t;
|
|
20
11
|
};
|
|
21
|
-
import { askRHDirectAIResponse, getRHDirectStatusCheck, } from '@ifd-ui/ask-redhat-core';
|
|
22
12
|
import { useWizardContext, Wizard, WizardNav, WizardNavItem, WizardStep } from '@patternfly/react-core';
|
|
23
13
|
import { LoadingIndicator } from '@rh-support/components';
|
|
24
14
|
import isEqual from 'lodash/isEqual';
|
|
25
15
|
import React, { Suspense, useContext, useEffect, useRef, useState } from 'react';
|
|
26
16
|
import { useTranslation } from 'react-i18next';
|
|
27
17
|
import { Route } from 'react-router-dom';
|
|
28
|
-
import { useAIResponseDispatch } from '../../context/AIResponseContext';
|
|
29
18
|
import { useCaseSelector } from '../../context/CaseContext';
|
|
30
19
|
import { RecommendationDispatchContext } from '../../context/RecommendationContext';
|
|
31
20
|
import { RouteContext, RouteDispatchContext } from '../../context/RouteContext';
|
|
32
21
|
import { useWizard } from '../../hooks/useWizard';
|
|
33
|
-
import { receivedAIResponse, receivedAIResponseError, requestAIResponse } from '../../reducers/AIResponseReducer';
|
|
34
|
-
import { excludedCaseTypesforARH } from '../../reducers/CaseConstNTypes';
|
|
35
22
|
import { RecommendationsConstants } from '../../reducers/RecommendationsReducer';
|
|
36
23
|
import { AppRouteSections } from '../../reducers/RouteConstNTypes';
|
|
37
24
|
import { setActiveSectionChanged, updateisNextBtnClickedToShowValidationError } from '../../reducers/RouteReducer';
|
|
@@ -40,39 +27,13 @@ import SubmitCase from '../SubmitCase/SubmitCase';
|
|
|
40
27
|
import MainSection from './MainSection';
|
|
41
28
|
import NewFeatureModal from './NewFeatureModal';
|
|
42
29
|
import WizardNavigation from './WizardNavigation';
|
|
43
|
-
// Mapping for case type display text in AI questions
|
|
44
|
-
const CASE_TYPE_AI_TEXT_MAP = {
|
|
45
|
-
Other: 'Something',
|
|
46
|
-
};
|
|
47
|
-
const getCaseTypeAIText = (caseType) => {
|
|
48
|
-
return CASE_TYPE_AI_TEXT_MAP[caseType] || caseType;
|
|
49
|
-
};
|
|
50
|
-
const generateCaseTypePrefix = (activeSection, caseType) => {
|
|
51
|
-
if (activeSection === AppRouteSections.TROUBLESHOOT) {
|
|
52
|
-
return '';
|
|
53
|
-
}
|
|
54
|
-
const helpWith = getCaseTypeAIText(caseType);
|
|
55
|
-
return `I want help with ${helpWith}. `;
|
|
56
|
-
};
|
|
57
|
-
//generate AI question based on case details
|
|
58
|
-
const generateAIQuestion = (activeSection, product, version, summary, issue, caseType) => {
|
|
59
|
-
const baseMessage = `My issue is primarily related to ${product} ${version}. I would title my problem: ${summary}. More details are as follows: ${issue}.`;
|
|
60
|
-
const prefix = generateCaseTypePrefix(activeSection, caseType);
|
|
61
|
-
return `${prefix}${baseMessage}`;
|
|
62
|
-
};
|
|
63
30
|
function WizardMain(props) {
|
|
64
31
|
const [showRestFlag, setShowRestFlag] = useState(false);
|
|
65
32
|
const recommendationDispatch = useContext(RecommendationDispatchContext);
|
|
66
|
-
const { isCreatingCase
|
|
33
|
+
const { isCreatingCase } = useCaseSelector((state) => ({
|
|
67
34
|
isCreatingCase: state.isCreatingCase,
|
|
68
|
-
product: state.caseDetails.product,
|
|
69
|
-
version: state.caseDetails.version,
|
|
70
|
-
summary: state.caseDetails.summary,
|
|
71
|
-
issue: state.caseDetails.issue,
|
|
72
|
-
caseType: state.caseDetails.caseType,
|
|
73
35
|
}), isEqual);
|
|
74
36
|
const { routeState: { isCaseCreate }, } = useContext(RouteContext);
|
|
75
|
-
const aiResponseDispatch = useAIResponseDispatch();
|
|
76
37
|
const [userSeenRecommendations, setUserSeenRecommendations] = useState(false);
|
|
77
38
|
const [userClickedNextonRecommendations, setUserClickedNextonRecommendations] = useState(false);
|
|
78
39
|
const [userScrolledLabel, setUserScrolledLabel] = useState(false);
|
|
@@ -81,9 +42,6 @@ function WizardMain(props) {
|
|
|
81
42
|
const isNextButtonClickedRef = useRef(false);
|
|
82
43
|
const isBackButtonClickedRef = useRef(false);
|
|
83
44
|
const resultsRowRef = useRef(null);
|
|
84
|
-
const handleChatWithAIClick = () => {
|
|
85
|
-
props.setIsAIChatMode(true);
|
|
86
|
-
};
|
|
87
45
|
const { getStepsSequece } = useWizard(props.routeProps, {
|
|
88
46
|
userSeenRecommendationsfn: setUserSeenRecommendations,
|
|
89
47
|
userSeenRecommendationsValue: userSeenRecommendations,
|
|
@@ -91,9 +49,6 @@ function WizardMain(props) {
|
|
|
91
49
|
userClickedNextonRecommendationsValue: userClickedNextonRecommendations,
|
|
92
50
|
resultsRowRef: resultsRowRef,
|
|
93
51
|
userScrolledLabel: userScrolledLabel,
|
|
94
|
-
isAIChatMode: props.isAIChatMode,
|
|
95
|
-
setIsAIChatMode: props.setIsAIChatMode,
|
|
96
|
-
onChatWithAIClick: handleChatWithAIClick,
|
|
97
52
|
});
|
|
98
53
|
const dispatchToRouteReducer = useContext(RouteDispatchContext);
|
|
99
54
|
const { t } = useTranslation();
|
|
@@ -144,66 +99,26 @@ function WizardMain(props) {
|
|
|
144
99
|
isBackButtonClickedRef.current = false;
|
|
145
100
|
setIsNextButtonClicked(false);
|
|
146
101
|
};
|
|
147
|
-
const handleReturnToCaseCreation = () => {
|
|
148
|
-
props.setIsAIChatMode(false);
|
|
149
|
-
};
|
|
150
102
|
const customNav = (isExpanded, steps, activeStep, goToStepByIndex) => (React.createElement(WizardNav, { isExpanded: isExpanded }, steps.map((step) => {
|
|
151
103
|
return (React.createElement(WizardNavItem, { key: step.id, id: step.id, content: step.name, isCurrent: activeStep.id === step.id, isDisabled: !step.canJumpTo, stepIndex: step.index, onClick: () => goToStepByIndex(step.index) }));
|
|
152
104
|
})));
|
|
153
105
|
const CustomFooter = () => {
|
|
154
|
-
var _a, _b;
|
|
155
106
|
const { activeStep, goToNextStep, goToPrevStep, steps, goToStepByIndex } = useWizardContext(); // Correctly using the context
|
|
156
|
-
const { routeState: { activeSection }, } = useContext(RouteContext);
|
|
157
|
-
const isTroubleshootSection = activeSection === AppRouteSections.TROUBLESHOOT;
|
|
158
|
-
const isSummarizeSection = activeSection === AppRouteSections.SUMMARIZE;
|
|
159
|
-
const config = {
|
|
160
|
-
appSourceId: 'PCM-001',
|
|
161
|
-
authToken: (_b = (_a = window === null || window === void 0 ? void 0 : window.sessionjs) === null || _a === void 0 ? void 0 : _a.getEncodedToken()) !== null && _b !== void 0 ? _b : '',
|
|
162
|
-
};
|
|
163
107
|
useEffect(() => {
|
|
164
108
|
if (steps.length > 2 && activeStep.index === 2 && isNextButtonClicked) {
|
|
165
109
|
goToStepByIndex(3);
|
|
166
110
|
}
|
|
167
111
|
}, [activeStep, steps.length, goToStepByIndex]);
|
|
168
|
-
|
|
169
|
-
const shouldCallAPI = (isTroubleshootSection || isSummarizeSection) && !excludedCaseTypesforARH.includes(caseType || '');
|
|
170
|
-
if (shouldCallAPI) {
|
|
171
|
-
const detailedQuestion = generateAIQuestion(activeSection, product, version, summary, issue, caseType || '');
|
|
172
|
-
let useAIServices = true;
|
|
173
|
-
try {
|
|
174
|
-
yield getRHDirectStatusCheck(config);
|
|
175
|
-
}
|
|
176
|
-
catch (healthCheckError) {
|
|
177
|
-
useAIServices = false;
|
|
178
|
-
}
|
|
179
|
-
// Navigate to next step first
|
|
112
|
+
return (React.createElement(WizardNavigation, { routeProps: props.routeProps, onNext: () => {
|
|
180
113
|
isNextButtonClickedRef.current = true;
|
|
181
114
|
setIsNextButtonClicked(true);
|
|
182
115
|
goToNextStep();
|
|
183
116
|
focusWizardMainPanel();
|
|
184
|
-
|
|
185
|
-
aiResponseDispatch(requestAIResponse(detailedQuestion));
|
|
186
|
-
try {
|
|
187
|
-
const response = yield askRHDirectAIResponse(detailedQuestion, config);
|
|
188
|
-
aiResponseDispatch(receivedAIResponse(response));
|
|
189
|
-
}
|
|
190
|
-
catch (error) {
|
|
191
|
-
aiResponseDispatch(receivedAIResponseError((error === null || error === void 0 ? void 0 : error.message) || 'Failed to get AI response'));
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
else {
|
|
196
|
-
isNextButtonClickedRef.current = true;
|
|
197
|
-
setIsNextButtonClicked(true);
|
|
198
|
-
goToNextStep();
|
|
199
|
-
focusWizardMainPanel();
|
|
200
|
-
}
|
|
201
|
-
});
|
|
202
|
-
return (React.createElement(WizardNavigation, { routeProps: props.routeProps, onNext: handleContinueClick, onBack: () => {
|
|
117
|
+
}, onBack: () => {
|
|
203
118
|
isBackButtonClickedRef.current = true;
|
|
204
119
|
goToPrevStep();
|
|
205
120
|
focusWizardMainPanel();
|
|
206
|
-
}, activeStep: activeStep, onSubmit: onSubmit, confirmSupportModal: props.confirmSupportModal, onShowRestUpdate: (flag) => setShowRestFlag(flag), userSeenRecommendations: userSeenRecommendations, setUserSeenRecommendations: setUserSeenRecommendations, userClickedNextonRecommendationsFn: setUserClickedNextonRecommendations, userClickedNextonRecommendationsValue: userClickedNextonRecommendations, setUserCanNavigateToTroubleshoot: setUserCanNavigateToTroubleshoot, resultsRowRef: resultsRowRef, setUserScrolledLabel: setUserScrolledLabel
|
|
121
|
+
}, activeStep: activeStep, onSubmit: onSubmit, confirmSupportModal: props.confirmSupportModal, onShowRestUpdate: (flag) => setShowRestFlag(flag), userSeenRecommendations: userSeenRecommendations, setUserSeenRecommendations: setUserSeenRecommendations, userClickedNextonRecommendationsFn: setUserClickedNextonRecommendations, userClickedNextonRecommendationsValue: userClickedNextonRecommendations, setUserCanNavigateToTroubleshoot: setUserCanNavigateToTroubleshoot, resultsRowRef: resultsRowRef, setUserScrolledLabel: setUserScrolledLabel }));
|
|
207
122
|
};
|
|
208
123
|
const steps = getStepsSequece(showRestFlag);
|
|
209
124
|
const wizardSteps = steps.map((step) => {
|