@rh-support/troubleshoot 0.2.122 → 0.2.125
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/index.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/index.js +2 -3
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.js +40 -20
- package/lib/esm/components/CaseInformation/CaseGroup.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/CaseGroup.js +27 -2
- package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.js +5 -3
- package/lib/esm/components/ConfirmationModals/NoAttachmentSelectedModal.js +1 -1
- package/lib/esm/components/ImproveCase/Hostname.d.ts.map +1 -1
- package/lib/esm/components/ImproveCase/Hostname.js +4 -1
- package/lib/esm/components/Recommendations/ClusterRecommendationItems.js +1 -1
- package/lib/esm/components/shared/Constants.d.ts +0 -4
- package/lib/esm/components/shared/Constants.d.ts.map +1 -1
- package/lib/esm/components/shared/Constants.js +4 -9
- package/lib/esm/components/wizardLayout/WizardMain.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardMain.js +40 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,eA+ejD"}
|
|
@@ -285,9 +285,8 @@ export default function CaseOverview(props) {
|
|
|
285
285
|
React.createElement(ExpandableSection, { className: "case-details-main", toggleText: t('Case information'), isExpanded: isDetailsExpanded, onToggle: onToggleDetails },
|
|
286
286
|
React.createElement(CaseInformation, null))),
|
|
287
287
|
showCloseCaseModal && (React.createElement(CloseCaseModal, { onConfirm: (commentBody) => __awaiter(this, void 0, void 0, function* () {
|
|
288
|
-
yield updateStatusState(CaseStatusEnum.CLOSED
|
|
289
|
-
|
|
290
|
-
}));
|
|
288
|
+
yield updateStatusState(CaseStatusEnum.CLOSED);
|
|
289
|
+
yield postCommentAfterStatusUpdate(commentBody);
|
|
291
290
|
setShowCaseCloseModal(false);
|
|
292
291
|
}), isUpdating: (caseOverviewState.caseStatusUpdating && isCaseUpdating) || isPostingComment, onClose: () => {
|
|
293
292
|
setShowCaseCloseModal(false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PostComment.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/PostComment.tsx"],"names":[],"mappings":"AAqCA,OAAO,EAAkB,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAqB5F,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,WAAW,EAAE,CAAC;CACjC;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"PostComment.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/PostComment.tsx"],"names":[],"mappings":"AAqCA,OAAO,EAAkB,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAqB5F,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,WAAW,EAAE,CAAC;CACjC;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,eA8exC"}
|
|
@@ -11,7 +11,7 @@ import { publicApi } from '@cee-eng/hydrajs';
|
|
|
11
11
|
import { Button, ButtonVariant, Checkbox, debounce, Tooltip } from '@patternfly/react-core';
|
|
12
12
|
import PlusIcon from '@patternfly/react-icons/dist/js/icons/plus-icon';
|
|
13
13
|
import { EditorMode, LoadingIndicator, MarkdownEditor, ToastNotification, useFetch, usePrevious, } from '@rh-support/components';
|
|
14
|
-
import { FeatureAnnouncementKeys, GlobalMetadataStateContext, NewFeaturePopoverAnnouncement, useCanEditCase, } from '@rh-support/react-context';
|
|
14
|
+
import { FeatureAnnouncementKeys, GlobalMetadataStateContext, NewFeaturePopoverAnnouncement, useCanEditCase, useUserPreferences, } from '@rh-support/react-context';
|
|
15
15
|
import { ability, CaseDiscussionFields, CaseListFields, resourceActions, resources, } from '@rh-support/user-permissions';
|
|
16
16
|
import { getConfigField, PCM_CONFIG_FIELD_TYPE, pendoTrackEvent } from '@rh-support/utils';
|
|
17
17
|
import isEmpty from 'lodash/isEmpty';
|
|
@@ -22,7 +22,6 @@ import { useDropzone } from 'react-dropzone';
|
|
|
22
22
|
import { Trans, useTranslation } from 'react-i18next';
|
|
23
23
|
import { useCaseDispatch, useCaseSelector } from '../../../../context/CaseContext';
|
|
24
24
|
import { CaseDetailsCacheNamespaces } from '../../../../enums/cache';
|
|
25
|
-
import { useUserPreference } from '../../../../hooks/useUserPreference';
|
|
26
25
|
import { DiscussionType } from '../../../../reducers/CaseDiscussionTabReducer';
|
|
27
26
|
import { addingNotifiedUsers, checkForCaseStatusToggleOnAttachOrComment, setNotifiedUser, } from '../../../../reducers/CaseReducer';
|
|
28
27
|
import { CaseDetailsCacheUtils } from '../../../../utils/caseDetailsCacheUtils';
|
|
@@ -51,6 +50,28 @@ export function PostComment(props) {
|
|
|
51
50
|
const hasSomeUnUploadedFiles = hasSomeUnUploadedAttachments(attachmentState.caseFiles.selectedLocalFiles);
|
|
52
51
|
const hasSomeSelectedFilesLocal = hasSomeSelectedFiles(attachmentState.caseFiles.selectedLocalFiles);
|
|
53
52
|
const [commentType, setCommentType] = useState(EditorMode.PLAIN);
|
|
53
|
+
const [commentSignature, setCommentSignature] = useState('');
|
|
54
|
+
const { getCommentTypeFromPreference, getCommentSignature } = useUserPreferences();
|
|
55
|
+
const userOriginalCommentPrefs = () => __awaiter(this, void 0, void 0, function* () {
|
|
56
|
+
try {
|
|
57
|
+
const retrievedComment = yield getCommentTypeFromPreference();
|
|
58
|
+
const retrievedCommentSignature = yield getCommentSignature();
|
|
59
|
+
const defaultCommentType = retrievedComment ? retrievedComment : EditorMode.PLAIN;
|
|
60
|
+
setCommentType(defaultCommentType);
|
|
61
|
+
const defaultCommentSignature = retrievedCommentSignature || '';
|
|
62
|
+
setCommentSignature(defaultCommentSignature);
|
|
63
|
+
if (isEmpty(commentText)) {
|
|
64
|
+
setCommentText(`\n ${defaultCommentSignature}` || '');
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
console.log(error);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
useEffect(() => {
|
|
72
|
+
userOriginalCommentPrefs();
|
|
73
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
74
|
+
}, []);
|
|
54
75
|
const [isModalOpen, setIsModalOpen] = useState(false);
|
|
55
76
|
const [isProcessing, setIsProcessing] = useState(isPostingComment || isUploadingAttachments);
|
|
56
77
|
const { globalMetadataState: { loggedInUser, loggedInUserRights, loggedInUsersAccount, pcmConfig }, } = useContext(GlobalMetadataStateContext);
|
|
@@ -66,7 +87,6 @@ export function PostComment(props) {
|
|
|
66
87
|
selectedNotificationContacts: state.selectedNotificationContacts,
|
|
67
88
|
}), isEqual);
|
|
68
89
|
const caseDispatch = useCaseDispatch();
|
|
69
|
-
const { updateCommentType, getCommentTypeFromPreference } = useUserPreference();
|
|
70
90
|
const [isCommentTooLong, setIsCommentTooLong] = useState(false);
|
|
71
91
|
const canEditCase = useCanEditCase();
|
|
72
92
|
const componentRef = useRef(null);
|
|
@@ -142,12 +162,6 @@ export function PostComment(props) {
|
|
|
142
162
|
setNotifiedUser(caseDispatch, uniqBy([...selectedNotificationContacts, loggedInUser.data], 'ssoUsername'));
|
|
143
163
|
}
|
|
144
164
|
});
|
|
145
|
-
const saveCommentTypeInPreference = () => {
|
|
146
|
-
const commentTypeFromPreference = getCommentTypeFromPreference();
|
|
147
|
-
if (!commentTypeFromPreference || commentTypeFromPreference !== commentType) {
|
|
148
|
-
updateCommentType(commentType);
|
|
149
|
-
}
|
|
150
|
-
};
|
|
151
165
|
useEffect(() => {
|
|
152
166
|
isPublicRef.current = isPublic;
|
|
153
167
|
}, [isPublic]);
|
|
@@ -172,7 +186,6 @@ export function PostComment(props) {
|
|
|
172
186
|
yield props.onCommentAdded();
|
|
173
187
|
resetCommentSection();
|
|
174
188
|
ToastNotification.addSuccessMessage(t('Comment submitted'));
|
|
175
|
-
saveCommentTypeInPreference();
|
|
176
189
|
}
|
|
177
190
|
catch (e) {
|
|
178
191
|
ToastNotification.addDangerMessage(t('Could not submit comment'));
|
|
@@ -197,12 +210,23 @@ export function PostComment(props) {
|
|
|
197
210
|
.reduce((acc, line) => (acc += '> ' + line + '\n'), person);
|
|
198
211
|
return reply;
|
|
199
212
|
};
|
|
213
|
+
const addCommentSignature = (preSigCommemnt) => {
|
|
214
|
+
if (!isEmpty(commentSignature)) {
|
|
215
|
+
let signedComment = preSigCommemnt + '\n' + commentSignature;
|
|
216
|
+
setCommentText(signedComment);
|
|
217
|
+
}
|
|
218
|
+
};
|
|
200
219
|
useEffect(() => {
|
|
201
220
|
if (!props.commentText || !props.commentCreator) {
|
|
202
221
|
return;
|
|
203
222
|
}
|
|
204
223
|
const reply = getReplyText(props.commentText, props.commentCreator);
|
|
205
|
-
|
|
224
|
+
if (reply.includes(commentSignature)) {
|
|
225
|
+
setCommentText(reply);
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
addCommentSignature(reply);
|
|
229
|
+
}
|
|
206
230
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
207
231
|
}, [props.commentText, props.commentCreator]);
|
|
208
232
|
useEffect(() => {
|
|
@@ -222,21 +246,17 @@ export function PostComment(props) {
|
|
|
222
246
|
const { value: draftComments = {} } = (yield CaseDetailsCacheUtils.get(CaseDetailsCacheNamespaces.COMMENTS_DRAFT.name, loggedInUserRights.data.getSSOUsername())) || {};
|
|
223
247
|
if (draftComments[caseNumber]) {
|
|
224
248
|
const { text, privateFlag, type } = draftComments[caseNumber];
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
else {
|
|
230
|
-
const commentTypeFromPreference = getCommentTypeFromPreference();
|
|
231
|
-
if (commentTypeFromPreference) {
|
|
232
|
-
setCommentType(commentTypeFromPreference);
|
|
249
|
+
if (text.trim()) {
|
|
250
|
+
addCommentSignature(text);
|
|
251
|
+
privateFlag === true && setIsPublic(false);
|
|
252
|
+
setCommentType(type);
|
|
233
253
|
}
|
|
234
254
|
}
|
|
235
255
|
});
|
|
236
256
|
}
|
|
237
257
|
getDraftComments();
|
|
238
258
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
239
|
-
}, []);
|
|
259
|
+
}, [commentSignature]);
|
|
240
260
|
const onTextAreaBlur = () => {
|
|
241
261
|
!commentText && setIsTextAreaFocused(false);
|
|
242
262
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/CaseGroup.tsx"],"names":[],"mappings":"AAiBA,UAAU,MAAM;CAAG;AAInB,iBAAS,SAAS,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"CaseGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/CaseGroup.tsx"],"names":[],"mappings":"AAiBA,UAAU,MAAM;CAAG;AAInB,iBAAS,SAAS,CAAC,KAAK,EAAE,MAAM,eAsN/B;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { Dropdown, ToastNotification, ValueChangedIcon } from '@rh-support/components';
|
|
11
|
-
import { GlobalMetadataStateContext, useCanEditCase } from '@rh-support/react-context';
|
|
11
|
+
import { GlobalMetadataStateContext, useCanEditCase, useUserPreferences } from '@rh-support/react-context';
|
|
12
12
|
import { toOption, toOptions } from '@rh-support/utils';
|
|
13
13
|
import find from 'lodash/find';
|
|
14
14
|
import isEmpty from 'lodash/isEmpty';
|
|
@@ -22,7 +22,7 @@ import { getChangedValueTooltip } from '../shared/utils';
|
|
|
22
22
|
const emptyCaseGroup = { groupNum: '', name: '', isPrivate: false, isDefault: false, defaultMembers: [], members: [] };
|
|
23
23
|
function CaseGroup(props) {
|
|
24
24
|
const { t } = useTranslation();
|
|
25
|
-
const { groupNumber, caseNumber, accountNumber, selectedAccountDetails, ownersCaseGroups, groupName
|
|
25
|
+
const { groupNumber, caseNumber, accountNumber, selectedAccountDetails, ownersCaseGroups, groupName } = useCaseSelector((state) => ({
|
|
26
26
|
caseNumber: state.caseDetails.caseNumber,
|
|
27
27
|
groupNumber: state.caseDetails.groupNumber,
|
|
28
28
|
accountNumber: state.caseDetails.accountNumberRef,
|
|
@@ -37,6 +37,31 @@ function CaseGroup(props) {
|
|
|
37
37
|
const [isCaseGroupUpdating, setCaseGroupUpdating] = useState(false);
|
|
38
38
|
const canEditCase = useCanEditCase();
|
|
39
39
|
const { globalMetadataState: { loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
|
|
40
|
+
const { getDefaultGroup } = useUserPreferences();
|
|
41
|
+
const userPreferredFilter = () => __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
const fetchedDefaultGroupKey = yield getDefaultGroup();
|
|
43
|
+
const groupObj = ownersCaseGroups.data
|
|
44
|
+
? ownersCaseGroups.data.map((group) => ({ value: group.name, key: group.groupNum }))
|
|
45
|
+
: [];
|
|
46
|
+
if (!isEmpty(groupObj)) {
|
|
47
|
+
const preferredGroupObj = groupObj.find((group) => group.key === fetchedDefaultGroupKey);
|
|
48
|
+
if (preferredGroupObj === null || preferredGroupObj === void 0 ? void 0 : preferredGroupObj.value) {
|
|
49
|
+
const parsedFetchedDefaultGroup = {
|
|
50
|
+
groupNum: preferredGroupObj.key,
|
|
51
|
+
name: preferredGroupObj.value,
|
|
52
|
+
isPrivate: false,
|
|
53
|
+
isDefault: false,
|
|
54
|
+
defaultMembers: [],
|
|
55
|
+
members: [],
|
|
56
|
+
};
|
|
57
|
+
onCaseGroupChange(toOption(parsedFetchedDefaultGroup, { labelKey: 'name' }));
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
userPreferredFilter();
|
|
63
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
64
|
+
}, [ownersCaseGroups.data]);
|
|
40
65
|
// value changed logic to show a non local group change
|
|
41
66
|
const [localGroupChange, setLocalGroupChange] = useState(false);
|
|
42
67
|
const afterGroupLocalChange = () => setLocalGroupChange(false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenshiftDropdownV4.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/OpenshiftDropdownV4.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAG5E,OAAO,EAAE,gBAAgB,EAAuB,MAAM,0BAA0B,CAAC;AAUjF,UAAU,MAAO,SAAQ,gBAAgB;IACrC,uBAAuB,EAAE,MAAM,CAAC;IAChC,sBAAsB,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,oBAAoB,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACzF,kBAAkB,EAAE,OAAO,CAAC;IAC5B,iCAAiC,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IAChD,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,oBAAoB,CAAC,EAAE,MAAM,CAAC;CACjC;AAuBD,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"OpenshiftDropdownV4.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/OpenshiftDropdownV4.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAG5E,OAAO,EAAE,gBAAgB,EAAuB,MAAM,0BAA0B,CAAC;AAUjF,UAAU,MAAO,SAAQ,gBAAgB;IACrC,uBAAuB,EAAE,MAAM,CAAC;IAChC,sBAAsB,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,oBAAoB,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACzF,kBAAkB,EAAE,OAAO,CAAC;IAC5B,iCAAiC,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IAChD,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,oBAAoB,CAAC,EAAE,MAAM,CAAC;CACjC;AAuBD,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,eA4WzC;kBA5WQ,mBAAmB;;;AA+W5B,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -174,14 +174,16 @@ function OpenshiftDropdownV4(props) {
|
|
|
174
174
|
// recreate a new AbortController for each call
|
|
175
175
|
let controller = new AbortController();
|
|
176
176
|
abortControllerRef.current = controller;
|
|
177
|
+
const archived = !showArchivedClusters ? " AND status!='Archived'" : '';
|
|
178
|
+
const searchPhrase = search
|
|
179
|
+
? ` AND (external_cluster_id ILIKE '%${search}%' OR display_name ILIKE '%${search}%' OR console_url ILIKE '%${search}%')`
|
|
180
|
+
: '';
|
|
177
181
|
// query language: https://github.com/yaacov/tree-search-language
|
|
178
182
|
clustersResponse = yield cloud.getAccountClustersSubscription({
|
|
179
183
|
order: 'display_name asc',
|
|
180
184
|
page,
|
|
181
185
|
size: PER_PAGE,
|
|
182
|
-
search: `external_cluster_id!=''
|
|
183
|
-
? `(external_cluster_id ILIKE '%${search}%' OR display_name ILIKE '%${search}%' OR console_url ILIKE '%${search}%')`
|
|
184
|
-
: ''}`,
|
|
186
|
+
search: `external_cluster_id!='' ${archived} ${searchPhrase}`,
|
|
185
187
|
fields: 'external_cluster_id,display_name,status,metrics.openshift_version,console_url',
|
|
186
188
|
}, controller.signal);
|
|
187
189
|
setInCache(`showArchived=${showArchivedClusters}input=${search}p=${page}`, clustersResponse);
|
|
@@ -71,7 +71,7 @@ export function NoAttachmentSelectedModal(props) {
|
|
|
71
71
|
actionButtons = [
|
|
72
72
|
React.createElement(FileSelectorButton, { key: "file-selector-btn", buttonLabel: t('Upload a file'), className: "pf-m-primary", "data-tracking-id": "no-attachment-file-selector-button", isSessionId: true }),
|
|
73
73
|
React.createElement(Button, { key: "skip-file", onClick: props.onConfirm, className: "pf-u-ml-sm", "data-tracking-id": "submit-without-attachment", variant: ButtonVariant.secondary },
|
|
74
|
-
React.createElement(Trans, null, "Yes, I'm
|
|
74
|
+
React.createElement(Trans, null, "Yes, I'm sure")),
|
|
75
75
|
];
|
|
76
76
|
}
|
|
77
77
|
return actionButtons;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Hostname.d.ts","sourceRoot":"","sources":["../../../../src/components/ImproveCase/Hostname.tsx"],"names":[],"mappings":"AASA,UAAU,MAAM;CAAG;AAEnB,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Hostname.d.ts","sourceRoot":"","sources":["../../../../src/components/ImproveCase/Hostname.tsx"],"names":[],"mappings":"AASA,UAAU,MAAM;CAAG;AAEnB,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,eA+CrC"}
|
|
@@ -29,5 +29,8 @@ export function Hostname(props) {
|
|
|
29
29
|
`${HOSTNAME_LENGTH_LIMIT}`,
|
|
30
30
|
" characters are not allowed."))),
|
|
31
31
|
React.createElement("p", { className: "form-instructions" },
|
|
32
|
-
React.createElement(Trans, null,
|
|
32
|
+
React.createElement(Trans, null,
|
|
33
|
+
"Change visibility for hostnames under ",
|
|
34
|
+
React.createElement("a", { href: "/support/cases/#/manage/preferences" }, "Preferences"),
|
|
35
|
+
"."))));
|
|
33
36
|
}
|
|
@@ -33,7 +33,7 @@ export function ClusterRecommendationItems(props) {
|
|
|
33
33
|
React.createElement("h3", null, rule.description)),
|
|
34
34
|
React.createElement("pfe-accordion-panel", null,
|
|
35
35
|
React.createElement("p", null,
|
|
36
|
-
React.createElement(Label, {
|
|
36
|
+
React.createElement(Label, { color: riskLabels[rule.total_risk].color },
|
|
37
37
|
React.createElement(Trans, null, riskLabels[rule.total_risk].label))),
|
|
38
38
|
React.createElement("p", null, rule.details || ''),
|
|
39
39
|
rule.reason && (React.createElement(React.Fragment, null,
|
|
@@ -52,22 +52,18 @@ export declare const markdownInlineFileSelectEvent = "PCM-Next > Markdown-toolba
|
|
|
52
52
|
export declare const markdownFilePasteEvent = "PCM-Next > Markdown-toolbar-file-paste";
|
|
53
53
|
export declare const riskLabels: {
|
|
54
54
|
1: {
|
|
55
|
-
icon: JSX.Element;
|
|
56
55
|
label: string;
|
|
57
56
|
color: string;
|
|
58
57
|
};
|
|
59
58
|
2: {
|
|
60
|
-
icon: JSX.Element;
|
|
61
59
|
label: string;
|
|
62
60
|
color: string;
|
|
63
61
|
};
|
|
64
62
|
3: {
|
|
65
|
-
icon: JSX.Element;
|
|
66
63
|
label: string;
|
|
67
64
|
color: string;
|
|
68
65
|
};
|
|
69
66
|
4: {
|
|
70
|
-
icon: JSX.Element;
|
|
71
67
|
label: string;
|
|
72
68
|
color: string;
|
|
73
69
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Constants.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/Constants.
|
|
1
|
+
{"version":3,"file":"Constants.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/Constants.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBA+BE;AAEF;;GAEG;AACH,oBAAY,iBAAiB;IACzB,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,IAAI,cAAc;IAClB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,KAAK,sBAAsB;IAC3B,KAAK,UAAU;IACf,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,kBAAkB,yBAAyB;CAC9C;AAED,eAAO,MAAM,8BAA8B,oDAAoD,CAAC;AAEhG,eAAO,MAAM,oCAAoC,wDAAwD,CAAC;AAC1G,eAAO,MAAM,6BAA6B,4CAA4C,CAAC;AACvF,eAAO,MAAM,sBAAsB,2CAA2C,CAAC;AAE/E,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;CAKtB,CAAC"}
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import AngleDoubleDownIcon from '@patternfly/react-icons/dist/js/icons/angle-double-down-icon';
|
|
2
|
-
import AngleDoubleUpIcon from '@patternfly/react-icons/dist/js/icons/angle-double-up-icon';
|
|
3
|
-
import CriticalRiskIcon from '@patternfly/react-icons/dist/js/icons/critical-risk-icon';
|
|
4
|
-
import EqualsIcon from '@patternfly/react-icons/dist/js/icons/equals-icon';
|
|
5
|
-
import React from 'react';
|
|
6
1
|
export default {
|
|
7
2
|
languagesMap: {
|
|
8
3
|
en: 'English',
|
|
@@ -56,8 +51,8 @@ export const recsViewedFromNoAttachmentModalEvent = 'PCM-Next > No-Attachment-mo
|
|
|
56
51
|
export const markdownInlineFileSelectEvent = 'PCM-Next > Markdown-toolbar-file-select';
|
|
57
52
|
export const markdownFilePasteEvent = 'PCM-Next > Markdown-toolbar-file-paste';
|
|
58
53
|
export const riskLabels = {
|
|
59
|
-
1: {
|
|
60
|
-
2: {
|
|
61
|
-
3: {
|
|
62
|
-
4: {
|
|
54
|
+
1: { label: 'Low', color: 'blue' },
|
|
55
|
+
2: { label: 'Moderate', color: 'orange' },
|
|
56
|
+
3: { label: 'Important', color: 'red' },
|
|
57
|
+
4: { label: 'Critical', color: 'red' },
|
|
63
58
|
};
|
|
@@ -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":"AAUA,OAAO,EAAS,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAO9D,OAAO,EAAoB,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAcpF,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAGD,iBAAS,UAAU,CAAC,KAAK,EAAE,MAAM,eAoQhC;kBApQQ,UAAU;;;AAsQnB,eAAe,UAAU,CAAC"}
|
|
@@ -1,4 +1,14 @@
|
|
|
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
|
+
};
|
|
1
10
|
import { AlertMessage, AlertType, LoadingIndicator, usePrevious } from '@rh-support/components';
|
|
11
|
+
import { useUserPreferences } from '@rh-support/react-context';
|
|
2
12
|
import isEmpty from 'lodash/isEmpty';
|
|
3
13
|
import isEqual from 'lodash/isEqual';
|
|
4
14
|
import isFunction from 'lodash/isFunction';
|
|
@@ -6,10 +16,11 @@ import map from 'lodash/map';
|
|
|
6
16
|
import React, { Suspense, useContext, useEffect, useRef } from 'react';
|
|
7
17
|
import { Trans, useTranslation } from 'react-i18next';
|
|
8
18
|
import { Route } from 'react-router-dom';
|
|
9
|
-
import { useCaseSelector } from '../../context/CaseContext';
|
|
19
|
+
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
10
20
|
import { RecommendationStateContext } from '../../context/RecommendationContext';
|
|
11
21
|
import { RouteContext } from '../../context/RouteContext';
|
|
12
22
|
import { TCStateContext } from '../../context/TopContentContext';
|
|
23
|
+
import { setCaseDetails } from '../../reducers/CaseReducer';
|
|
13
24
|
import { AppRouteSections } from '../../reducers/RouteConstNTypes';
|
|
14
25
|
import RouteUtils from '../../utils/routeUtils';
|
|
15
26
|
import CaseInformation from '../CaseInformation/CaseInformation';
|
|
@@ -19,6 +30,7 @@ import OpenCase from '../OpenCase/OpenCase';
|
|
|
19
30
|
import ProductSelector from '../ProductSelector/ProductSelector';
|
|
20
31
|
import Recommendations from '../Recommendations/Recommendations';
|
|
21
32
|
import Review from '../Review/Review';
|
|
33
|
+
import Constants from '../shared/Constants';
|
|
22
34
|
import { useIsSectionValid } from '../shared/useIsSectionValid';
|
|
23
35
|
import SubmitCase from '../SubmitCase/SubmitCase';
|
|
24
36
|
import { GlobalTroubleshootEffects } from './GlobalTroubleshootEffects';
|
|
@@ -26,6 +38,33 @@ import MainSection from './MainSection';
|
|
|
26
38
|
const defaultProps = {};
|
|
27
39
|
function WizardMain(props) {
|
|
28
40
|
const { isActiveSectionValid } = useIsSectionValid();
|
|
41
|
+
const caseDispatch = useCaseDispatch();
|
|
42
|
+
const { getPreferredLanguage } = useUserPreferences();
|
|
43
|
+
const userOriginalPreferredLanguage = () => __awaiter(this, void 0, void 0, function* () {
|
|
44
|
+
try {
|
|
45
|
+
const retrievedLanguage = yield getPreferredLanguage();
|
|
46
|
+
if (!isEmpty(retrievedLanguage)) {
|
|
47
|
+
const preferredLanguage = {
|
|
48
|
+
label: Constants.languagesMap[retrievedLanguage] || retrievedLanguage,
|
|
49
|
+
value: retrievedLanguage,
|
|
50
|
+
};
|
|
51
|
+
onLanguageChange(preferredLanguage);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
console.log(error);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
const onCaseDetailsChange = (caseDetails) => {
|
|
59
|
+
setCaseDetails(caseDispatch, caseDetails);
|
|
60
|
+
};
|
|
61
|
+
const onLanguageChange = (selection) => {
|
|
62
|
+
onCaseDetailsChange({ caseLanguage: selection.value });
|
|
63
|
+
};
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
userOriginalPreferredLanguage();
|
|
66
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
67
|
+
}, []);
|
|
29
68
|
const { t } = useTranslation();
|
|
30
69
|
const allSectionRefs = {
|
|
31
70
|
[AppRouteSections.PRODUCT_SELECTOR]: useRef(null),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/troubleshoot",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.125",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@patternfly/pfe-accordion": "1.12.3",
|
|
33
33
|
"@patternfly/pfe-collapse": "1.12.3",
|
|
34
34
|
"@patternfly/pfe-tabs": "1.12.3",
|
|
35
|
-
"@patternfly/react-core": "4.
|
|
35
|
+
"@patternfly/react-core": "4.202.16",
|
|
36
36
|
"@rh-support/api": "0.3.9",
|
|
37
37
|
"@rh-support/components": "^0.1.3",
|
|
38
38
|
"@rh-support/react-context": "^0.1.3",
|
|
@@ -70,12 +70,12 @@
|
|
|
70
70
|
"@patternfly/pfe-collapse": "1.12.3",
|
|
71
71
|
"@patternfly/pfe-icon": "^1.12.3",
|
|
72
72
|
"@patternfly/pfe-tabs": "1.12.3",
|
|
73
|
-
"@patternfly/react-core": "4.
|
|
73
|
+
"@patternfly/react-core": "4.202.16",
|
|
74
74
|
"@progress/kendo-drawing": "^1.6.0",
|
|
75
75
|
"@progress/kendo-react-pdf": "^3.12.0",
|
|
76
76
|
"@rh-support/api": "0.3.24",
|
|
77
|
-
"@rh-support/components": "1.1.
|
|
78
|
-
"@rh-support/react-context": "0.2.
|
|
77
|
+
"@rh-support/components": "1.1.75",
|
|
78
|
+
"@rh-support/react-context": "0.2.81",
|
|
79
79
|
"@rh-support/types": "0.2.0",
|
|
80
80
|
"@rh-support/user-permissions": "0.2.62",
|
|
81
81
|
"@rh-support/utils": "0.2.46",
|
|
@@ -143,5 +143,5 @@
|
|
|
143
143
|
"not ie <= 11",
|
|
144
144
|
"not op_mini all"
|
|
145
145
|
],
|
|
146
|
-
"gitHead": "
|
|
146
|
+
"gitHead": "69133e548c91349a60a4f9805216e60c98207b69"
|
|
147
147
|
}
|