@rh-support/troubleshoot 2.6.306 → 2.6.309
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/CaseDetailsTabs.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseDetailsTabs.js +25 -21
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.js +6 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseAttachment.js +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.js +104 -83
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.js +3 -2
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/DiscussionItemLink.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/DiscussionItemLink.js +7 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/JumpAndCopyLink.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/JumpAndCopyLink.js +8 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.d.ts +8 -3
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.js +11 -9
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.js +33 -17
- package/lib/esm/components/CaseInformation/CaseLabels.d.ts +3 -0
- package/lib/esm/components/CaseInformation/CaseLabels.d.ts.map +1 -0
- package/lib/esm/components/CaseInformation/CaseLabels.js +98 -0
- package/lib/esm/components/shared/fileUpload/FileLister.js +1 -1
- package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.d.ts +11 -2
- package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.d.ts.map +1 -1
- package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.js +65 -9
- package/lib/esm/components/shared/fileUpload/reducer/AttachmentReducer.d.ts +5 -1
- package/lib/esm/components/shared/fileUpload/reducer/AttachmentReducer.d.ts.map +1 -1
- package/lib/esm/components/shared/fileUpload/reducer/AttachmentReducer.js +23 -1
- package/lib/esm/components/shared/fileUpload/types/index.d.ts +2 -0
- package/lib/esm/components/shared/fileUpload/types/index.d.ts.map +1 -1
- package/lib/esm/components/shared/fileUpload/useFileUploader.d.ts.map +1 -1
- package/lib/esm/components/shared/fileUpload/useFileUploader.js +7 -1
- package/lib/esm/css/case.css +12 -7
- package/lib/esm/hooks/useCaseComments/mapCaseComment.d.ts +1 -1
- package/lib/esm/hooks/useCaseComments/mapCaseComment.d.ts.map +1 -1
- package/lib/esm/hooks/useCaseComments/mapCaseComment.js +14 -3
- package/lib/esm/hooks/useCaseLabelLinkMutations.d.ts +21 -0
- package/lib/esm/hooks/useCaseLabelLinkMutations.d.ts.map +1 -0
- package/lib/esm/hooks/useCaseLabelLinkMutations.js +84 -0
- package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseDiscussionTabReducer.js +6 -2
- package/package.json +6 -6
|
@@ -28,7 +28,7 @@ export function useFileUploader(props) {
|
|
|
28
28
|
const caseSalesforceIdRef = useRef();
|
|
29
29
|
const { request: deleteSessionAttachment } = useFetch(sessionAttachments.deleteSesionAttachment);
|
|
30
30
|
const { request: deleteCaseAttachmentRequest } = useFetch(deleteCaseAttachment);
|
|
31
|
-
const { idToUploadTo, caseSalesforceId, needsAnalyzing, isSessionId, autoUploadOnSelect, onUploadClick } = props;
|
|
31
|
+
const { idToUploadTo, caseSalesforceId, needsAnalyzing, isSessionId, autoUploadOnSelect, onUploadClick, onCaseFileUploaded, } = props;
|
|
32
32
|
useEffect(() => {
|
|
33
33
|
if (caseSalesforceId) {
|
|
34
34
|
caseSalesforceIdRef.current = caseSalesforceId;
|
|
@@ -83,6 +83,9 @@ export function useFileUploader(props) {
|
|
|
83
83
|
debounceSessionMetadataUpdate(editedLocalFile, changes);
|
|
84
84
|
});
|
|
85
85
|
const onFileRemoveLocal = (fileIndexToRemove, file) => __awaiter(this, void 0, void 0, function* () {
|
|
86
|
+
var _a, _b;
|
|
87
|
+
// Stop in-flight S3 transfer if Remove is used while upload/verify is still active
|
|
88
|
+
(_b = (_a = file.uploadProgress).onAbort) === null || _b === void 0 ? void 0 : _b.call(_a, fileIndexToRemove);
|
|
86
89
|
const selectedLocalFiles = attachmentState.caseFiles.selectedLocalFiles;
|
|
87
90
|
if (!isUploadingAttachment(selectedLocalFiles) && !isAnalysingAnyAttachment(selectedLocalFiles)) {
|
|
88
91
|
onFileRemove(dispatch, fileIndexToRemove);
|
|
@@ -90,6 +93,7 @@ export function useFileUploader(props) {
|
|
|
90
93
|
else {
|
|
91
94
|
updateUploadMetadata(dispatch, fileIndexToRemove, {
|
|
92
95
|
uploadStatus: UploadStatusConstants.deleted,
|
|
96
|
+
onAbort: undefined,
|
|
93
97
|
});
|
|
94
98
|
}
|
|
95
99
|
isUploadedSuccessfully(file) && isSessionId && deleteSessionAttachment(idToUploadTo, file.attachmentId);
|
|
@@ -135,6 +139,7 @@ export function useFileUploader(props) {
|
|
|
135
139
|
slowUploadConfig,
|
|
136
140
|
apolloClient: !isSessionId ? apolloClient : undefined,
|
|
137
141
|
caseSalesforceId: !isSessionId ? caseSalesforceIdRef.current : undefined,
|
|
142
|
+
onCaseFileUploaded: !isSessionId ? onCaseFileUploaded : undefined,
|
|
138
143
|
});
|
|
139
144
|
});
|
|
140
145
|
const onUploadFile = (fileIndex) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -150,6 +155,7 @@ export function useFileUploader(props) {
|
|
|
150
155
|
slowUploadConfig,
|
|
151
156
|
apolloClient: !isSessionId ? apolloClient : undefined,
|
|
152
157
|
caseSalesforceId: !isSessionId ? caseSalesforceIdRef.current : undefined,
|
|
158
|
+
onCaseFileUploaded: !isSessionId ? onCaseFileUploaded : undefined,
|
|
153
159
|
});
|
|
154
160
|
});
|
|
155
161
|
return {
|
package/lib/esm/css/case.css
CHANGED
|
@@ -315,23 +315,28 @@ button,
|
|
|
315
315
|
}
|
|
316
316
|
|
|
317
317
|
.case-comment-input-container {
|
|
318
|
-
display: -ms-flexbox;
|
|
319
318
|
display: flex;
|
|
319
|
+
align-items: center;
|
|
320
|
+
gap: 0.5rem;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
.case-comment-input-container .case-comment-search-input-wrapper {
|
|
320
324
|
position: relative;
|
|
325
|
+
flex: 1;
|
|
321
326
|
}
|
|
322
327
|
|
|
323
|
-
.case-comment-input-container input {
|
|
324
|
-
padding-right:
|
|
325
|
-
margin-right: 1rem;
|
|
328
|
+
.case-comment-input-container .case-comment-search-input-wrapper input {
|
|
329
|
+
padding-right: 2rem;
|
|
326
330
|
}
|
|
327
331
|
|
|
328
332
|
.case-comment-input-container .clear-btn {
|
|
329
333
|
position: absolute;
|
|
330
|
-
top:
|
|
331
|
-
right:
|
|
334
|
+
top: 50%;
|
|
335
|
+
right: 0.25rem;
|
|
336
|
+
transform: translateY(-50%);
|
|
332
337
|
font-size: 14px;
|
|
333
338
|
background-color: transparent;
|
|
334
|
-
padding: 0
|
|
339
|
+
padding: 0 0.5rem;
|
|
335
340
|
}
|
|
336
341
|
|
|
337
342
|
.ReactVirtualized__List:focus {
|
|
@@ -3,7 +3,7 @@ import { ICaseCommentNode, IGetCaseCommentsQueryResponse } from './types';
|
|
|
3
3
|
/**
|
|
4
4
|
* The GraphQL API HTML-encodes comment bodies on storage/retrieval
|
|
5
5
|
* (e.g. > becomes >, & becomes &). Two-pass decode
|
|
6
|
-
* handles both single- and double-encoded entities.
|
|
6
|
+
* handles both single- and double-encoded entities, plus numeric refs.
|
|
7
7
|
*
|
|
8
8
|
* TODO: The double-encoding is a backend bug in the Salesforce UIAPI — it encodes on both
|
|
9
9
|
* write and read. Once the backend is fixed, replace with a single `unescape(text)` call.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapCaseComment.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useCaseComments/mapCaseComment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAGvE,OAAO,EAAE,gBAAgB,EAAE,6BAA6B,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"mapCaseComment.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useCaseComments/mapCaseComment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAGvE,OAAO,EAAE,gBAAgB,EAAE,6BAA6B,EAAE,MAAM,SAAS,CAAC;AAY1E;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAIvD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,GAAG,MAAM,CAKzG;AAED,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAG7E;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,CAEvD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,gBAAgB,GAAG,YAAY,CAuBvE;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,6BAA6B,GAAG,SAAS,GAAG,YAAY,EAAE,CAOvG"}
|
|
@@ -1,14 +1,25 @@
|
|
|
1
1
|
import { unescape } from 'lodash';
|
|
2
|
+
/**
|
|
3
|
+
* Decodes numeric (&#nn;) and hex (&#xHH;) HTML character references
|
|
4
|
+
* that lodash `unescape` does not handle.
|
|
5
|
+
*/
|
|
6
|
+
function decodeNumericEntities(text) {
|
|
7
|
+
return text
|
|
8
|
+
.replaceAll(/&#x([0-9a-fA-F]+);/g, (_, hex) => String.fromCodePoint(Number.parseInt(hex, 16)))
|
|
9
|
+
.replaceAll(/&#(\d+);/g, (_, dec) => String.fromCodePoint(Number.parseInt(dec, 10)));
|
|
10
|
+
}
|
|
2
11
|
/**
|
|
3
12
|
* The GraphQL API HTML-encodes comment bodies on storage/retrieval
|
|
4
13
|
* (e.g. > becomes >, & becomes &). Two-pass decode
|
|
5
|
-
* handles both single- and double-encoded entities.
|
|
14
|
+
* handles both single- and double-encoded entities, plus numeric refs.
|
|
6
15
|
*
|
|
7
16
|
* TODO: The double-encoding is a backend bug in the Salesforce UIAPI — it encodes on both
|
|
8
17
|
* write and read. Once the backend is fixed, replace with a single `unescape(text)` call.
|
|
9
18
|
*/
|
|
10
19
|
export function decodeHtmlEntities(text) {
|
|
11
|
-
|
|
20
|
+
let decoded = unescape(unescape(text));
|
|
21
|
+
decoded = decodeNumericEntities(decoded);
|
|
22
|
+
return decoded;
|
|
12
23
|
}
|
|
13
24
|
/**
|
|
14
25
|
* Derives the comment author type with priority: Associate > Customer > Partner.
|
|
@@ -50,7 +61,7 @@ export function mapCaseCommentNode(node) {
|
|
|
50
61
|
createdDate: (_t = (_s = node.CreatedDate) === null || _s === void 0 ? void 0 : _s.value) !== null && _t !== void 0 ? _t : '',
|
|
51
62
|
visibility: visibility !== null && visibility !== void 0 ? visibility : undefined,
|
|
52
63
|
isPublic: deriveIsPublic(visibility),
|
|
53
|
-
contentType: '
|
|
64
|
+
contentType: 'markdown',
|
|
54
65
|
isDraft: false,
|
|
55
66
|
publishedDate: '',
|
|
56
67
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface LabelOption {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
}
|
|
5
|
+
export interface LabelLink {
|
|
6
|
+
linkId: string;
|
|
7
|
+
labelId: string;
|
|
8
|
+
}
|
|
9
|
+
interface UseCaseLabelLinksResult {
|
|
10
|
+
availableLabels: LabelOption[];
|
|
11
|
+
assignedLinks: LabelLink[];
|
|
12
|
+
selectedLabelIds: string[];
|
|
13
|
+
loading: boolean;
|
|
14
|
+
mutating: boolean;
|
|
15
|
+
setAssignedLinks: React.Dispatch<React.SetStateAction<LabelLink[]>>;
|
|
16
|
+
createLink: (caseId: string, labelId: string) => Promise<string | undefined>;
|
|
17
|
+
deleteLink: (linkId: string) => Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
export declare function useCaseLabelLinks(salesforceAccountId?: string, caseId?: string): UseCaseLabelLinksResult;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=useCaseLabelLinkMutations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCaseLabelLinkMutations.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCaseLabelLinkMutations.ts"],"names":[],"mappings":"AAmBA,MAAM,WAAW,WAAW;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,SAAS;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,uBAAuB;IAC7B,eAAe,EAAE,WAAW,EAAE,CAAC;IAC/B,aAAa,EAAE,SAAS,EAAE,CAAC;IAC3B,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,gBAAgB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;IACpE,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAC7E,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACjD;AAED,wBAAgB,iBAAiB,CAAC,mBAAmB,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,uBAAuB,CA6FxG"}
|
|
@@ -0,0 +1,84 @@
|
|
|
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 { useApolloClient, useMutation } from '@apollo/client/react';
|
|
11
|
+
import { CREATE_CASE_LABEL_LINK, DELETE_CASE_LABEL_LINK, GET_CASE_LABEL_LINKS, GET_CASE_LABELS, } from '@rh-support/utils';
|
|
12
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
13
|
+
export function useCaseLabelLinks(salesforceAccountId, caseId) {
|
|
14
|
+
const client = useApolloClient();
|
|
15
|
+
const [availableLabels, setAvailableLabels] = useState([]);
|
|
16
|
+
const [assignedLinks, setAssignedLinks] = useState([]);
|
|
17
|
+
const [loading, setLoading] = useState(false);
|
|
18
|
+
const fetchData = useCallback(() => __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
20
|
+
if (!salesforceAccountId || !caseId)
|
|
21
|
+
return;
|
|
22
|
+
setLoading(true);
|
|
23
|
+
try {
|
|
24
|
+
const [labelsResult, linksResult] = yield Promise.all([
|
|
25
|
+
client.query({
|
|
26
|
+
query: GET_CASE_LABELS,
|
|
27
|
+
variables: { where: { Account__c: { eq: salesforceAccountId } } },
|
|
28
|
+
fetchPolicy: 'network-only',
|
|
29
|
+
}),
|
|
30
|
+
client.query({
|
|
31
|
+
query: GET_CASE_LABEL_LINKS,
|
|
32
|
+
variables: { where: { Case__c: { eq: caseId } } },
|
|
33
|
+
fetchPolicy: 'network-only',
|
|
34
|
+
}),
|
|
35
|
+
]);
|
|
36
|
+
const labelEdges = (_e = (_d = (_c = (_b = (_a = labelsResult.data) === null || _a === void 0 ? void 0 : _a.redhat_support_uiapi) === null || _b === void 0 ? void 0 : _b.query) === null || _c === void 0 ? void 0 : _c.RedHatSupportCaseLabel__c) === null || _d === void 0 ? void 0 : _d.edges) !== null && _e !== void 0 ? _e : [];
|
|
37
|
+
setAvailableLabels(labelEdges
|
|
38
|
+
.map(({ node }) => { var _a, _b; return ({ id: node.Id, name: (_b = (_a = node.Name) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : '' }); })
|
|
39
|
+
.filter((l) => l.id && l.name));
|
|
40
|
+
const linkEdges = (_k = (_j = (_h = (_g = (_f = linksResult.data) === null || _f === void 0 ? void 0 : _f.redhat_support_uiapi) === null || _g === void 0 ? void 0 : _g.query) === null || _h === void 0 ? void 0 : _h.RedHatSupportCaseLabelLink__c) === null || _j === void 0 ? void 0 : _j.edges) !== null && _k !== void 0 ? _k : [];
|
|
41
|
+
setAssignedLinks(linkEdges
|
|
42
|
+
.filter(({ node }) => { var _a; return node.Id && ((_a = node.Label__c) === null || _a === void 0 ? void 0 : _a.value); })
|
|
43
|
+
.map(({ node }) => ({
|
|
44
|
+
linkId: node.Id,
|
|
45
|
+
labelId: node.Label__c.value,
|
|
46
|
+
})));
|
|
47
|
+
}
|
|
48
|
+
catch (_l) {
|
|
49
|
+
setAvailableLabels([]);
|
|
50
|
+
setAssignedLinks([]);
|
|
51
|
+
}
|
|
52
|
+
finally {
|
|
53
|
+
setLoading(false);
|
|
54
|
+
}
|
|
55
|
+
}), [client, salesforceAccountId, caseId]);
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
fetchData();
|
|
58
|
+
}, [fetchData]);
|
|
59
|
+
const [createMutate, { loading: createLoading }] = useMutation(CREATE_CASE_LABEL_LINK);
|
|
60
|
+
const createLink = useCallback((caseSfId, labelId) => __awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
var _a, _b, _c, _d;
|
|
62
|
+
const result = yield createMutate({
|
|
63
|
+
variables: {
|
|
64
|
+
input: { RedHatSupportCaseLabelLink__c: { Case__c: caseSfId, Label__c: labelId } },
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
return (_d = (_c = (_b = (_a = result.data) === null || _a === void 0 ? void 0 : _a.redhat_support_uiapi) === null || _b === void 0 ? void 0 : _b.CaseLabelLink__cCreate) === null || _c === void 0 ? void 0 : _c.RedHatSupportRecord) === null || _d === void 0 ? void 0 : _d.Id;
|
|
68
|
+
}), [createMutate]);
|
|
69
|
+
const [deleteMutate, { loading: deleteLoading }] = useMutation(DELETE_CASE_LABEL_LINK);
|
|
70
|
+
const deleteLink = useCallback((linkId) => __awaiter(this, void 0, void 0, function* () {
|
|
71
|
+
yield deleteMutate({ variables: { id: linkId } });
|
|
72
|
+
}), [deleteMutate]);
|
|
73
|
+
const selectedLabelIds = assignedLinks.map((link) => link.labelId);
|
|
74
|
+
return {
|
|
75
|
+
availableLabels,
|
|
76
|
+
assignedLinks,
|
|
77
|
+
selectedLabelIds,
|
|
78
|
+
loading,
|
|
79
|
+
mutating: createLoading || deleteLoading,
|
|
80
|
+
setAssignedLinks,
|
|
81
|
+
createLink,
|
|
82
|
+
deleteLink,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseDiscussionTabReducer.d.ts","sourceRoot":"","sources":["../../../src/reducers/CaseDiscussionTabReducer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,gBAAgB,EAAE,MAAM,oDAAoD,CAAC;AACtF,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EACH,iBAAiB,
|
|
1
|
+
{"version":3,"file":"CaseDiscussionTabReducer.d.ts","sourceRoot":"","sources":["../../../src/reducers/CaseDiscussionTabReducer.ts"],"names":[],"mappings":"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"}
|
|
@@ -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 {
|
|
10
|
+
import { fetchCaseAttachmentsViaGraphQLWithRetry, fetchCaseDetailsByCaseNumber, getApiResourceObject, mergeAttachmentsByUuid, } from '@rh-support/utils';
|
|
11
11
|
import filter from 'lodash/filter';
|
|
12
12
|
import findIndex from 'lodash/findIndex';
|
|
13
13
|
import isEqual from 'lodash/isEqual';
|
|
@@ -233,7 +233,11 @@ export const updateDiscussionStateAttachments = (dispatch, caseNumber, allDiscus
|
|
|
233
233
|
if (!resolvedCaseSalesforceId) {
|
|
234
234
|
throw new Error('Missing Salesforce case id');
|
|
235
235
|
}
|
|
236
|
-
const
|
|
236
|
+
const existingAttachments = filter(allDiscussions, (o) => o.discussionType === DiscussionType.ATTACHMENT).map((discussion) => discussion.item);
|
|
237
|
+
const fetchedAttachments = yield fetchCaseAttachmentsViaGraphQLWithRetry(apolloClient, caseNumber, resolvedCaseSalesforceId,
|
|
238
|
+
// After a successful upload batch we expect at least one new attachment beyond what discussion already shows
|
|
239
|
+
{ minExpectedCount: existingAttachments.length + 1 });
|
|
240
|
+
const attachments = mergeAttachmentsByUuid(existingAttachments, fetchedAttachments);
|
|
237
241
|
const allAttachments = attachments.map((attachment) => ({
|
|
238
242
|
item: Object.assign(Object.assign({}, attachment), { lastModifiedDate: attachment.lastModifiedDate || attachment.createdDate }),
|
|
239
243
|
last_modified_date: attachment.lastModifiedDate || attachment.createdDate,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/troubleshoot",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.309",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -52,11 +52,11 @@
|
|
|
52
52
|
"@progress/kendo-licensing": "1.3.5",
|
|
53
53
|
"@progress/kendo-react-pdf": "^5.16.0",
|
|
54
54
|
"@redux-devtools/extension": "^3.3.0",
|
|
55
|
-
"@rh-support/components": "2.5.
|
|
56
|
-
"@rh-support/react-context": "2.5.
|
|
55
|
+
"@rh-support/components": "2.5.190",
|
|
56
|
+
"@rh-support/react-context": "2.5.284",
|
|
57
57
|
"@rh-support/types": "2.0.26",
|
|
58
|
-
"@rh-support/user-permissions": "2.5.
|
|
59
|
-
"@rh-support/utils": "2.5.
|
|
58
|
+
"@rh-support/user-permissions": "2.5.136",
|
|
59
|
+
"@rh-support/utils": "2.5.118",
|
|
60
60
|
"@types/react-redux": "^7.1.33",
|
|
61
61
|
"@types/redux": "^3.6.0",
|
|
62
62
|
"date-fns": "3.6.0",
|
|
@@ -126,5 +126,5 @@
|
|
|
126
126
|
"defaults and supports es6-module",
|
|
127
127
|
"maintained node versions"
|
|
128
128
|
],
|
|
129
|
-
"gitHead": "
|
|
129
|
+
"gitHead": "9017d17207b6357a27edbab889de8f10696e745b"
|
|
130
130
|
}
|