@rh-support/troubleshoot 1.0.41 → 1.0.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseAttachment.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseAttachment.js +16 -6
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.js +1 -1
- package/lib/esm/components/CaseInformation/FileDiag.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/FileDiag.js +1 -1
- package/lib/esm/components/Recommendations/InsightsResults.js +1 -1
- package/lib/esm/components/SessionRestore/RestoreLastSessionModal.d.ts.map +1 -1
- package/lib/esm/components/SessionRestore/RestoreLastSessionModal.js +6 -1
- package/lib/esm/components/shared/fileUpload/FileLister.d.ts +1 -1
- package/lib/esm/components/shared/fileUpload/FileLister.d.ts.map +1 -1
- package/lib/esm/components/shared/fileUpload/FileLister.js +5 -2
- package/lib/esm/components/shared/fileUpload/FileUploader.js +1 -1
- package/lib/esm/components/shared/fileUpload/WidgetFileUploader.d.ts +2 -0
- package/lib/esm/components/shared/fileUpload/WidgetFileUploader.d.ts.map +1 -1
- package/lib/esm/components/shared/fileUpload/WidgetFileUploader.js +68 -2
- package/lib/esm/components/shared/fileUpload/css/fileSelector.css +1 -27
- package/lib/esm/components/shared/fileUpload/fileSelectors/WidgetFileSelector.js +1 -1
- package/lib/esm/components/shared/fileUpload/index.d.ts +1 -1
- package/lib/esm/components/shared/fileUpload/index.js +1 -1
- package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.d.ts +1 -1
- package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.d.ts.map +1 -1
- package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.js +1 -1
- package/lib/esm/components/shared/fileUpload/reducer/{AttachemntReducer.d.ts → AttachmentReducer.d.ts} +1 -1
- package/lib/esm/components/shared/fileUpload/reducer/{AttachemntReducer.d.ts.map → AttachmentReducer.d.ts.map} +1 -1
- package/lib/esm/components/shared/fileUpload/reducer/{AttachemntReducer.js → AttachmentReducer.js} +0 -0
- package/lib/esm/components/shared/fileUpload/reducer/AttachmentReducerContext.d.ts +1 -1
- package/lib/esm/components/shared/fileUpload/reducer/AttachmentReducerContext.js +1 -1
- package/lib/esm/components/shared/fileUpload/reducer/FileStatusHelper.d.ts +1 -1
- package/lib/esm/components/shared/fileUpload/reducer/FileStatusHelper.js +1 -1
- package/lib/esm/components/shared/fileUpload/useFileUploader.d.ts +1 -1
- package/lib/esm/components/shared/fileUpload/useFileUploader.d.ts.map +1 -1
- package/lib/esm/components/shared/fileUpload/useFileUploader.js +2 -4
- package/lib/esm/reducers/CaseConstNTypes.d.ts +1 -0
- package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
- package/lib/esm/reducers/CaseConstNTypes.js +1 -0
- package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
- package/lib/esm/reducers/CaseHelpers.js +2 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseAttachment.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/CaseAttachment.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAcxE,OAAO,KAAuC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"CaseAttachment.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/CaseAttachment.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAcxE,OAAO,KAAuC,MAAM,OAAO,CAAC;AAS5D,UAAU,MAAM;IACZ,UAAU,EAAE,WAAW,CAAC;IACxB,kBAAkB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,gBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,iBAAiB,EAAE,WAAW,KAAK,IAAI,CAAC;IACzE,eAAe,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,kBAAkB,EAAE,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CAChH;AAED,QAAA,MAAM,cAAc,4EAoPlB,CAAC;AAEH,eAAe,cAAc,CAAC"}
|
|
@@ -16,12 +16,13 @@ import { formatDateTime, humanizeSize } from '@rh-support/utils';
|
|
|
16
16
|
import isEmpty from 'lodash/isEmpty';
|
|
17
17
|
import React, { useContext, useRef, useState } from 'react';
|
|
18
18
|
import { Trans, useTranslation } from 'react-i18next';
|
|
19
|
+
import { ATTACHMENT_DESCRIPTION_LENGTH_LIMIT } from '../../../../reducers/CaseConstNTypes';
|
|
19
20
|
import { DiscussionType } from '../../../../reducers/CaseDiscussionTabReducer';
|
|
20
21
|
import { PDFContext } from '../../PDFContainer';
|
|
21
22
|
import { DiscussionItemLink } from './DiscussionItemLink';
|
|
22
23
|
import { JumpAndCopyLink } from './JumpAndCopyLink';
|
|
23
24
|
const CaseAttachment = React.forwardRef((props, ref) => {
|
|
24
|
-
var _a;
|
|
25
|
+
var _a, _b;
|
|
25
26
|
const { t } = useTranslation();
|
|
26
27
|
const clipboardRef = useRef(null);
|
|
27
28
|
const { clipboardText, copyToClipboard } = useCopyToClipboard(clipboardRef);
|
|
@@ -78,8 +79,8 @@ const CaseAttachment = React.forwardRef((props, ref) => {
|
|
|
78
79
|
const onAttachmentDownloadClick = () => {
|
|
79
80
|
let { downloadAttachment, attachment: { caseNumber, uuid, fileName }, } = props;
|
|
80
81
|
downloadAttachment({
|
|
81
|
-
caseNumber,
|
|
82
|
-
uuid,
|
|
82
|
+
caseNumber: caseNumber,
|
|
83
|
+
uuid: uuid,
|
|
83
84
|
name: fileName,
|
|
84
85
|
});
|
|
85
86
|
};
|
|
@@ -110,6 +111,12 @@ const CaseAttachment = React.forwardRef((props, ref) => {
|
|
|
110
111
|
const onJumpToComment = (attachmentId) => () => props.showJumpToComment && props.onJumpToComment && props.onJumpToComment(attachmentId);
|
|
111
112
|
if (((_a = props.attachment) === null || _a === void 0 ? void 0 : _a.isPrivate) && !canSeePrivateAttachments)
|
|
112
113
|
return React.createElement(React.Fragment, null);
|
|
114
|
+
// Attachment description length error message
|
|
115
|
+
const maxCaseAttachmentDescription = t('Attachment description cannot be more than {{limit}} characters.', {
|
|
116
|
+
limit: ATTACHMENT_DESCRIPTION_LENGTH_LIMIT,
|
|
117
|
+
});
|
|
118
|
+
// To check if attachment description length is less than the limit
|
|
119
|
+
const isCaseAttachmentDescriptionLengthy = ((_b = attachmentDescription) === null || _b === void 0 ? void 0 : _b.length) > ATTACHMENT_DESCRIPTION_LENGTH_LIMIT;
|
|
113
120
|
// To check if attachment description is empty
|
|
114
121
|
const isCaseAttachmentDescription = isEmpty(attachmentDescription === null || attachmentDescription === void 0 ? void 0 : attachmentDescription.trim());
|
|
115
122
|
return (React.createElement("section", { ref: ref, id: props.attachment.id, className: `prevent-split support-comment comment-attachment ${!isCardIsDeleted ? 'showcard' : ''} ${ref ? 'selected-case-comment' : ''} ${props.attachment.isPrivate ? 'private' : ''}` },
|
|
@@ -132,10 +139,13 @@ const CaseAttachment = React.forwardRef((props, ref) => {
|
|
|
132
139
|
React.createElement("code", { ref: clipboardRef }, props.attachment.checksum)),
|
|
133
140
|
React.createElement(Tooltip, { position: TooltipPosition.top, content: clipboardText, trigger: "click" },
|
|
134
141
|
React.createElement("button", { className: "nimbus-icon-clipboard clip-code-raw-btn xs-icon", "aria-hidden": "true", onClick: copyToClipboard }))))),
|
|
135
|
-
React.createElement(InlineEdit, { labelProps: { htmlFor: `case-details-file-description-${props.attachment.id}` }, allowInlineEdit: true, labelContent:
|
|
142
|
+
React.createElement(InlineEdit, { labelProps: { htmlFor: `case-details-file-description-${props.attachment.id}` }, allowInlineEdit: true, labelContent: t('Description'), content: React.createElement("div", { className: "clip-content-wrapper code-block" }, props.attachment.description), hideSaveCancel: false, onSave: onDescriptionSave, onCancel: onDescriptionCancel, dataTrackingId: "case-details-file-description", initialIsEditing: props.attachment.description ? false : true, saveDisabled: isCaseAttachmentDescriptionLengthy ||
|
|
143
|
+
isCaseAttachmentDescription ||
|
|
136
144
|
attachmentDescription === props.attachment.description ||
|
|
137
|
-
isUpdating, loadingIndicator: isUpdating ? React.createElement(LoadingIndicator, { isInline: true }) :
|
|
138
|
-
React.createElement("input", { id: `case-details-file-description-${props.attachment.id}`, value: attachmentDescription, type: "text", className: "form-control", placeholder: t(`Enter a description`), onChange: onDescriptionChange, disabled: isUpdating,
|
|
145
|
+
isUpdating, loadingIndicator: isUpdating ? React.createElement(LoadingIndicator, { isInline: true }) : undefined },
|
|
146
|
+
React.createElement("input", { id: `case-details-file-description-${props.attachment.id}`, value: attachmentDescription, type: "text", className: "form-control", placeholder: t(`Enter a description`), onChange: onDescriptionChange, disabled: isUpdating, "data-tracking-id": `case-details-file-description-input` })))),
|
|
147
|
+
isCaseAttachmentDescriptionLengthy && (React.createElement("p", { className: "form-instructions form-invalid" },
|
|
148
|
+
React.createElement(Trans, null, maxCaseAttachmentDescription))),
|
|
139
149
|
React.createElement("footer", null,
|
|
140
150
|
React.createElement("span", { className: "comment-note" }, props.attachment.isPrivate && React.createElement(Trans, null, "Private attachment")),
|
|
141
151
|
React.createElement("span", { className: "pull-right pf-l-flex pf-m-align-items-center" },
|
|
@@ -24,7 +24,7 @@ import { AutoSizer, CellMeasurer, CellMeasurerCache, List, WindowScroller } from
|
|
|
24
24
|
import { useCaseDetailsPageStateContext } from '../../../../context/CaseDetailsPageContext';
|
|
25
25
|
import { useCaseDiscussionTabDispatchContext, useCaseDiscussionTabStateContext, } from '../../../../context/CaseDiscussionTabContext';
|
|
26
26
|
import { clearReplyComment, discussionSortOrderConst, DiscussionType, setCommentText, setDiscussions, setFilter, setSort, updateAttachment, updateAttacmentsAfterRemoval, updateCommentStateFeedback, updateDiscussionStateAttachments, updateDiscussionStateComments, } from '../../../../reducers/CaseDiscussionTabReducer';
|
|
27
|
-
import { AttachmentContextProvider } from '../../../shared/fileUpload';
|
|
27
|
+
import { AttachmentContextProvider } from '../../../shared/fileUpload/reducer/AttachmentReducerContext';
|
|
28
28
|
import { PDFContext } from '../../PDFContainer';
|
|
29
29
|
import CaseAttachment from './CaseAttachment';
|
|
30
30
|
import CaseChat from './CaseChat';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileDiag.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/FileDiag.tsx"],"names":[],"mappings":"AASA,wBAAgB,QAAQ,
|
|
1
|
+
{"version":3,"file":"FileDiag.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/FileDiag.tsx"],"names":[],"mappings":"AASA,wBAAgB,QAAQ,gBAwBvB"}
|
|
@@ -13,5 +13,5 @@ export function FileDiag() {
|
|
|
13
13
|
if (!canAddAttachments)
|
|
14
14
|
return null;
|
|
15
15
|
return (React.createElement(React.Fragment, null,
|
|
16
|
-
React.createElement(WidgetFileUploader, { idToUploadTo: activeSessionId, needsAnalyzing: true, isSessionId: true, isSecureSupport: loggedInUsersAccount.data.secureSupport, autoUploadOnSelect: loggedInUsersAccount.data.secureSupport ? false : true, helperText: getValidAttachmentRules(rulesState.EARules.rules).length > 0 ? React.createElement(FileEARule, null) : null })));
|
|
16
|
+
React.createElement(WidgetFileUploader, { idToUploadTo: activeSessionId, isPrivate: false, needsAnalyzing: true, isSessionId: true, isSecureSupport: loggedInUsersAccount.data.secureSupport, autoUploadOnSelect: loggedInUsersAccount.data.secureSupport ? false : true, helperText: getValidAttachmentRules(rulesState.EARules.rules).length > 0 ? React.createElement(FileEARule, null) : null })));
|
|
17
17
|
}
|
|
@@ -35,8 +35,8 @@ import { RulesDispatchContext, RulesStateContext } from '../../context/RulesCont
|
|
|
35
35
|
import { getDescriptionWOQues } from '../../reducers/CaseHelpers';
|
|
36
36
|
import { setInsighResultsKcsIds } from '../../reducers/RecommendationsReducer';
|
|
37
37
|
import { RulesReducerConstants } from '../../reducers/RulesReducer';
|
|
38
|
-
import { updateAnalysisMetadata } from '../shared/fileUpload/reducer/AttachemntReducer';
|
|
39
38
|
import { isAnalysisComplete, isFileDeleted } from '../shared/fileUpload/reducer/AttachmentHelper';
|
|
39
|
+
import { updateAnalysisMetadata } from '../shared/fileUpload/reducer/AttachmentReducer';
|
|
40
40
|
import { AttachmentDispatchContext, AttachmentStateContext, } from '../shared/fileUpload/reducer/AttachmentReducerContext';
|
|
41
41
|
import { InsightResultModal } from './RulesModal';
|
|
42
42
|
const defaultProps = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RestoreLastSessionModal.d.ts","sourceRoot":"","sources":["../../../../src/components/SessionRestore/RestoreLastSessionModal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qDAAqD,CAAC;AAGnF,OAAc,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"RestoreLastSessionModal.d.ts","sourceRoot":"","sources":["../../../../src/components/SessionRestore/RestoreLastSessionModal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qDAAqD,CAAC;AAGnF,OAAc,EAAE,EAAE,EAAc,MAAM,OAAO,CAAC;AAQ9C,UAAU,MAAM;IACZ,SAAS,EAAE,CAAC,WAAW,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD,YAAY,EAAE,YAAY,CAAC;CAC9B;AAED,eAAO,MAAM,uBAAuB,EAAE,EAAE,CAAC,MAAM,CAmE9C,CAAC"}
|
|
@@ -9,10 +9,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { Button, Modal, ModalVariant } from '@patternfly/react-core';
|
|
11
11
|
import { isEqual } from 'lodash';
|
|
12
|
-
import React from 'react';
|
|
12
|
+
import React, { useContext } from 'react';
|
|
13
13
|
import { Trans, useTranslation } from 'react-i18next';
|
|
14
14
|
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
15
|
+
import { SessionRestoreDispatchContext } from '../../context/SessionRestoreContext';
|
|
15
16
|
import { updateCaseCreationErrorStatus } from '../../reducers/CaseReducer';
|
|
17
|
+
import { updateSession } from '../../reducers/SessionRestoreReducer';
|
|
16
18
|
export const RestoreLastSessionModal = ({ onRestore, errorSession }) => {
|
|
17
19
|
const { t } = useTranslation();
|
|
18
20
|
const { caseCreation500ErrorStatus, caseCreationError } = useCaseSelector((state) => ({
|
|
@@ -23,7 +25,9 @@ export const RestoreLastSessionModal = ({ onRestore, errorSession }) => {
|
|
|
23
25
|
/**
|
|
24
26
|
* On Restore
|
|
25
27
|
*/
|
|
28
|
+
const sessionDispatch = useContext(SessionRestoreDispatchContext);
|
|
26
29
|
const onRestoreClick = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
30
|
+
yield updateSession(sessionDispatch, errorSession.session.id, errorSession.sessionDetails, Object.assign(Object.assign({}, errorSession.session), { caseCreationError: false }));
|
|
27
31
|
yield onRestore(errorSession);
|
|
28
32
|
updateCaseCreationErrorStatus(caseDispatch, false);
|
|
29
33
|
});
|
|
@@ -32,6 +36,7 @@ export const RestoreLastSessionModal = ({ onRestore, errorSession }) => {
|
|
|
32
36
|
*/
|
|
33
37
|
const onOpenNewCase = () => {
|
|
34
38
|
updateCaseCreationErrorStatus(caseDispatch, false);
|
|
39
|
+
updateSession(sessionDispatch, errorSession.session.id, errorSession.sessionDetails, Object.assign(Object.assign({}, errorSession.session), { caseCreationError: false }));
|
|
35
40
|
};
|
|
36
41
|
return (React.createElement(Modal, { "data-tracking-id": "restore-session-modal", variant: ModalVariant.small, title: t('Restore last session?'), isOpen: !caseCreationError && caseCreation500ErrorStatus, onClose: onOpenNewCase, actions: [
|
|
37
42
|
React.createElement(Button, { key: "restore", variant: "primary", onClick: onRestoreClick, "data-tracking-id": "restore-session-button" },
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IFileLocal } from './reducer/
|
|
1
|
+
import { IFileLocal } from './reducer/AttachmentReducer';
|
|
2
2
|
export declare const CaseDiagnosticsStatus: typeof import("@cee-eng/hydrajs/@types/api/pcm/preCaseDiagnostics").CaseDiagnosticsStatus;
|
|
3
3
|
interface IProps {
|
|
4
4
|
selectedLocalFiles: IFileLocal[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileLister.d.ts","sourceRoot":"","sources":["../../../../../src/components/shared/fileUpload/FileLister.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FileLister.d.ts","sourceRoot":"","sources":["../../../../../src/components/shared/fileUpload/FileLister.tsx"],"names":[],"mappings":"AA0BA,OAAO,EAAiB,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAGxE,eAAO,MAAM,qBAAqB,2FAAyC,CAAC;AAiB5E,UAAU,MAAM;IACZ,kBAAkB,EAAE,UAAU,EAAE,CAAC;IACjC,UAAU,EAAE,CAAC,eAAe,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;IACtG,YAAY,EAAE,CAAC,aAAa,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IACtE,OAAO,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,eAAe,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAK,EAAE,MAAM,eAgQ/C"}
|
|
@@ -32,15 +32,18 @@ export default function FileLister(props) {
|
|
|
32
32
|
props.onFileEdit &&
|
|
33
33
|
props.onFileEdit(editedLocalFile, indexToEdit, { description: editedLocalFile.description.trim() });
|
|
34
34
|
};
|
|
35
|
+
// To retry file upload
|
|
35
36
|
const onRetry = (index) => () => {
|
|
36
37
|
props.onRetry && props.onRetry(index);
|
|
37
38
|
};
|
|
38
39
|
const onRetryAnalysis = (index) => () => {
|
|
39
40
|
props.onRetryAnalysis && props.onRetryAnalysis(index);
|
|
40
41
|
};
|
|
42
|
+
// To abort attachment upload
|
|
41
43
|
const onAbortClick = (localFile, index) => () => {
|
|
42
44
|
localFile.uploadProgress.onAbort && localFile.uploadProgress.onAbort(index);
|
|
43
45
|
};
|
|
46
|
+
// To remove attachment
|
|
44
47
|
const onRemoveClick = (localFile, index) => () => {
|
|
45
48
|
props.onFileRemove && props.onFileRemove(index, localFile);
|
|
46
49
|
};
|
|
@@ -104,9 +107,9 @@ export default function FileLister(props) {
|
|
|
104
107
|
React.createElement("i", { className: "nimbus-icon-backup" }))),
|
|
105
108
|
!isVerifyingUpload(localFile.uploadProgress.uploadStatus) &&
|
|
106
109
|
!isAnalysingFile(localFile.analysisMetadata.analysisStatus) && (React.createElement(React.Fragment, null,
|
|
107
|
-
canShowAbortBtn(localFile.uploadProgress.uploadStatus) && (React.createElement(
|
|
110
|
+
canShowAbortBtn(localFile.uploadProgress.uploadStatus) && (React.createElement(Button, { variant: ButtonVariant.link, isDanger: true, "aria-label": t('Cancel Upload'), title: t('Cancel Upload'), className: "btn btn-link btn-app remove-file", "data-tracking-id": "file-lister-abort", onClick: onAbortClick(localFile, index), hidden: !localFile.uploadability.ableToUpload, isDisabled: !(localFile.uploadProgress.percentUploaded > 0) },
|
|
108
111
|
React.createElement(Trans, null, "Cancel"))),
|
|
109
|
-
showDeleteBtn(localFile.uploadProgress.uploadStatus, localFile) && (React.createElement(
|
|
112
|
+
showDeleteBtn(localFile.uploadProgress.uploadStatus, localFile) && (React.createElement(Button, { variant: ButtonVariant.link, isDanger: true, "aria-label": t('Delete file'), title: t('Delete file'), className: "btn btn-link btn-app remove-file", "data-tracking-id": "file-lister-delete", onClick: onRemoveClick(localFile, index), hidden: !localFile.uploadability.ableToUpload },
|
|
110
113
|
React.createElement(Trans, null, "Remove")))))),
|
|
111
114
|
isAnalysingFile(localFile.analysisMetadata.analysisStatus) && (React.createElement(Progress, { measureLocation: ProgressMeasureLocation.top, value: getAnalysisStepCount(localFile), min: 0, max: analysisSteps.length + 1, label: getAnalysisProgressTitle(localFile), valueText: getAnalysisProgressTitle(localFile) })),
|
|
112
115
|
React.createElement("input", { id: `file-${index + 1}-description`, "data-tracking-id": `case-${props.isSessionId ? 'create' : 'details'}-file-${index + 1}-description`, className: "file-description form-control pf-u-my-sm", type: "text", value: localFile.description, onChange: onDescriptionChange(localFile, index), maxLength: 255, placeholder: t(`${shouldHideDescription(localFile, props.isSessionId)
|
|
@@ -2,8 +2,8 @@ import React, { useContext, useEffect } from 'react';
|
|
|
2
2
|
import { Trans } from 'react-i18next';
|
|
3
3
|
import { SessionRestoreStateContext } from '../../../context/SessionRestoreContext';
|
|
4
4
|
import FileLister from './FileLister';
|
|
5
|
-
import { UploadStatusConstants } from './reducer/AttachemntReducer';
|
|
6
5
|
import { isSessionUploadComplete, isUploadingAttachment, moveSessionAttachmentToCase, } from './reducer/AttachmentHelper';
|
|
6
|
+
import { UploadStatusConstants } from './reducer/AttachmentReducer';
|
|
7
7
|
import { AttachmentDispatchContext, AttachmentStateContext } from './reducer/AttachmentReducerContext';
|
|
8
8
|
import { useFileUploader } from './useFileUploader';
|
|
9
9
|
const defaultProps = {
|
|
@@ -3,6 +3,8 @@ import React from 'react';
|
|
|
3
3
|
import { IFileUploaderCommonProps } from './types';
|
|
4
4
|
interface IProps extends IFileUploaderCommonProps, IDClassNameProps {
|
|
5
5
|
helperText?: string | React.ReactNode;
|
|
6
|
+
isSessionId: boolean;
|
|
7
|
+
isPrivate: boolean;
|
|
6
8
|
}
|
|
7
9
|
declare function WidgetFileUploader(props: IProps): JSX.Element;
|
|
8
10
|
declare namespace WidgetFileUploader {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WidgetFileUploader.d.ts","sourceRoot":"","sources":["../../../../../src/components/shared/fileUpload/WidgetFileUploader.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WidgetFileUploader.d.ts","sourceRoot":"","sources":["../../../../../src/components/shared/fileUpload/WidgetFileUploader.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,KAA0C,MAAM,OAAO,CAAC;AA0B/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAInD,UAAU,MAAO,SAAQ,wBAAwB,EAAE,gBAAgB;IAC/D,UAAU,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IACtC,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;CACtB;AAUD,iBAAS,kBAAkB,CAAC,KAAK,EAAE,MAAM,eAwKxC;kBAxKQ,kBAAkB;;;AA4K3B,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -1,11 +1,23 @@
|
|
|
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 { Button } from '@patternfly/react-core';
|
|
11
|
+
import { ToastNotification } from '@rh-support/components';
|
|
12
|
+
import { getText } from '@rh-support/utils';
|
|
2
13
|
import React, { useContext, useEffect, useState } from 'react';
|
|
3
|
-
import { Trans } from 'react-i18next';
|
|
14
|
+
import { Trans, useTranslation } from 'react-i18next';
|
|
4
15
|
import { RulesDispatchContext, RulesStateContext } from '../../../context/RulesContext';
|
|
5
16
|
import { RulesReducerConstants } from '../../../reducers/RulesReducer';
|
|
6
17
|
import FileLister from './FileLister';
|
|
7
18
|
import WidgetFileSelector from './fileSelectors/WidgetFileSelector';
|
|
8
19
|
import { doSosReportAnalysisForFile, hasAnalysedSomeAttachments, hasSomeSelectedFiles, hasUploadedSomeAttachments, isAnalysingAnyAttachment, isAnalysisNotStarted, isRestoredFromSession, } from './reducer/AttachmentHelper';
|
|
20
|
+
import { defaultAnalysisMetadata, defaultUploadMetadata, onFilesSelect, UploadStatusConstants, } from './reducer/AttachmentReducer';
|
|
9
21
|
import { AttachmentDispatchContext, AttachmentStateContext } from './reducer/AttachmentReducerContext';
|
|
10
22
|
import { FileUploadButton } from './UploadButton';
|
|
11
23
|
import { useFileUploader } from './useFileUploader';
|
|
@@ -17,6 +29,7 @@ const defaultProps = {
|
|
|
17
29
|
isPrivate: false,
|
|
18
30
|
};
|
|
19
31
|
function WidgetFileUploader(props) {
|
|
32
|
+
const { t } = useTranslation();
|
|
20
33
|
const { attachmentState } = useContext(AttachmentStateContext);
|
|
21
34
|
const dispatchToAttachmentReducer = useContext(AttachmentDispatchContext);
|
|
22
35
|
const selectedLocalFiles = attachmentState.caseFiles.selectedLocalFiles;
|
|
@@ -50,7 +63,60 @@ function WidgetFileUploader(props) {
|
|
|
50
63
|
dispatchToAttachmentReducer,
|
|
51
64
|
props.needsAnalyzing,
|
|
52
65
|
]);
|
|
53
|
-
|
|
66
|
+
const getFileAccessDetails = (file) => __awaiter(this, void 0, void 0, function* () {
|
|
67
|
+
const fileName = (file === null || file === void 0 ? void 0 : file.name) || '';
|
|
68
|
+
if (file.size === 0) {
|
|
69
|
+
return Promise.reject({
|
|
70
|
+
ableToUpload: false,
|
|
71
|
+
ableToUploadMessage: t(`${fileName} ${getText('is empty')}`),
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
const reader = new FileReader();
|
|
75
|
+
return new Promise((resolve, reject) => {
|
|
76
|
+
reader.onloadend = () => resolve({ ableToUpload: true, ableToUploadMessage: t('File attached, but not yet uploaded') });
|
|
77
|
+
reader.onerror = (ev) => reject({ ableToUpload: false, ableToUploadMessage: t(`${fileName} ${getText("Can't be selected")}`) });
|
|
78
|
+
// only read the first 10 bytes. readAsBinaryString is not supported in IE 11
|
|
79
|
+
reader.readAsArrayBuffer(file.slice(0, 10));
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
// To handle pasting of screenshots in uploader
|
|
83
|
+
const handlePaste = (event) => __awaiter(this, void 0, void 0, function* () {
|
|
84
|
+
let file;
|
|
85
|
+
for (let i = 0; i < event.clipboardData.items.length; ++i) {
|
|
86
|
+
let item = event.clipboardData.items[i];
|
|
87
|
+
if (item.kind === 'file' && item.type.startsWith('image/')) {
|
|
88
|
+
event.preventDefault();
|
|
89
|
+
file = item.getAsFile();
|
|
90
|
+
const onFilesSelectLocal = (caseFiles) => {
|
|
91
|
+
onFilesSelect(dispatchToAttachmentReducer, caseFiles);
|
|
92
|
+
};
|
|
93
|
+
try {
|
|
94
|
+
const fileAccessDetails = yield getFileAccessDetails(file);
|
|
95
|
+
const localFile = {
|
|
96
|
+
name: file.name,
|
|
97
|
+
size: file.size,
|
|
98
|
+
lastModified: file.lastModified,
|
|
99
|
+
type: file.type,
|
|
100
|
+
description: '',
|
|
101
|
+
isPrivate: props.isPrivate,
|
|
102
|
+
uploadProgress: Object.assign(Object.assign({}, defaultUploadMetadata), { uploadStatus: props.isSessionId
|
|
103
|
+
? UploadStatusConstants.attachedOnSession
|
|
104
|
+
: UploadStatusConstants.attachedOnCase }),
|
|
105
|
+
analysisMetadata: Object.assign({}, defaultAnalysisMetadata),
|
|
106
|
+
uploadability: Object.assign({}, fileAccessDetails),
|
|
107
|
+
includeResults: true,
|
|
108
|
+
};
|
|
109
|
+
onFilesSelectLocal({ selectedLocalFiles: [localFile], selectedOriginalFiles: [file] });
|
|
110
|
+
}
|
|
111
|
+
catch (e) {
|
|
112
|
+
if (!e.ableToUpload) {
|
|
113
|
+
ToastNotification.addDangerMessage(e.ableToUploadMessage);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
return (React.createElement("div", { className: `card card-white card-support file-diag ${props.className || ''}`, onPaste: handlePaste },
|
|
54
120
|
React.createElement("h3", { className: "card-heading" },
|
|
55
121
|
React.createElement(Trans, null, "File uploader and analyzer")),
|
|
56
122
|
React.createElement("div", { className: "card-body" },
|
|
@@ -64,32 +64,6 @@ i.web-icon-check {
|
|
|
64
64
|
color: #3c763d;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
/* #submitCase .file-name.text-error {
|
|
68
|
-
display: none;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
#submitCase .file-description[value=""],
|
|
72
|
-
#submitCase .remove-file {
|
|
73
|
-
display: none;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
#submitCase .progress {
|
|
77
|
-
flex: 1;
|
|
78
|
-
margin: .3rem 0 .55rem 20px;
|
|
79
|
-
font-weight: 700;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
#submitCase .progress,
|
|
83
|
-
#submitCase .file-description {
|
|
84
|
-
margin-top: .5rem;
|
|
85
|
-
margin-left: 20px;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
#submitCase .file-description {
|
|
89
|
-
width: calc(100% - 20px);
|
|
90
|
-
font-weight: 800;
|
|
91
|
-
} */
|
|
92
|
-
|
|
93
67
|
/* File diagnostic css */
|
|
94
68
|
.file-diag .file-diag-dragndrop {
|
|
95
69
|
display: -ms-flexbox;
|
|
@@ -160,7 +134,7 @@ i.web-icon-check {
|
|
|
160
134
|
.file-diag .file-diag-list.text-error,
|
|
161
135
|
.file-diag-list .remove-file {
|
|
162
136
|
margin-top: 0;
|
|
163
|
-
color:
|
|
137
|
+
color: var(--pf-global--danger-color--100);
|
|
164
138
|
}
|
|
165
139
|
|
|
166
140
|
.file-diag .file-diag-list .remove-file {
|
|
@@ -24,6 +24,6 @@ function WidgetFileSelector({ id = '', className = '', isSessionId, isPrivate =
|
|
|
24
24
|
React.createElement("input", Object.assign({ id: "file-diag-selector" }, getInputProps())),
|
|
25
25
|
isDragActive ? (t(`Drop your file here...`)) : (React.createElement(React.Fragment, null,
|
|
26
26
|
React.createElement("span", null,
|
|
27
|
-
React.createElement(Trans, null, "Drag and drop, or browse to upload a file"))))));
|
|
27
|
+
React.createElement(Trans, null, "Drag and drop, paste, or browse to upload a file"))))));
|
|
28
28
|
}
|
|
29
29
|
export default WidgetFileSelector;
|
|
@@ -3,7 +3,7 @@ export * from './FileUploader';
|
|
|
3
3
|
export * from './SectionFileUploader';
|
|
4
4
|
export * from './WidgetFileUploader';
|
|
5
5
|
export * from './fileSelectors';
|
|
6
|
-
export * from './reducer/
|
|
6
|
+
export * from './reducer/AttachmentReducer';
|
|
7
7
|
export * from './reducer/AttachmentHelper';
|
|
8
8
|
export * from './reducer/AttachmentReducerContext';
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -3,6 +3,6 @@ export * from './FileUploader';
|
|
|
3
3
|
export * from './SectionFileUploader';
|
|
4
4
|
export * from './WidgetFileUploader';
|
|
5
5
|
export * from './fileSelectors';
|
|
6
|
-
export * from './reducer/
|
|
6
|
+
export * from './reducer/AttachmentReducer';
|
|
7
7
|
export * from './reducer/AttachmentHelper';
|
|
8
8
|
export * from './reducer/AttachmentReducerContext';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CaseDiagnosticsStatus } from '@cee-eng/hydrajs/@types/api/pcm/preCaseDiagnostics';
|
|
2
2
|
import { ISlowUploadDetectionConfig } from '@cee-eng/hydrajs/@types/models/attachment';
|
|
3
|
-
import { AttachmentReducerDispatchType, IAnalysisResults, ICaseFiles, IFileLocal, IUploadMetadata } from './
|
|
3
|
+
import { AttachmentReducerDispatchType, IAnalysisResults, ICaseFiles, IFileLocal, IUploadMetadata } from './AttachmentReducer';
|
|
4
4
|
export declare const onDrop: (dispatchToAttachmentReducer: AttachmentReducerDispatchType, isSessionId: boolean, isPrivate?: boolean) => (acceptedFiles: File[]) => void;
|
|
5
5
|
export declare const isUploadingOnSession: (status: string) => boolean;
|
|
6
6
|
export declare const isUploadingOnCase: (status: string) => boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttachmentHelper.d.ts","sourceRoot":"","sources":["../../../../../../src/components/shared/fileUpload/reducer/AttachmentHelper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oDAAoD,CAAC;AAC3F,OAAO,EAAE,0BAA0B,EAAE,MAAM,2CAA2C,CAAC;AAQvF,OAAO,EAGH,6BAA6B,EAK7B,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,eAAe,EAOlB,MAAM,qBAAqB,CAAC;AAG7B,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"AttachmentHelper.d.ts","sourceRoot":"","sources":["../../../../../../src/components/shared/fileUpload/reducer/AttachmentHelper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oDAAoD,CAAC;AAC3F,OAAO,EAAE,0BAA0B,EAAE,MAAM,2CAA2C,CAAC;AAQvF,OAAO,EAGH,6BAA6B,EAK7B,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,eAAe,EAOlB,MAAM,qBAAqB,CAAC;AAG7B,eAAO,MAAM,MAAM,gCACe,6BAA6B,eAAe,OAAO,0CACjE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AW,EAAE,OAAO,EACpB,SAAS,EAAE,MAAM,iBA0DpB;AAED,wBAAsB,sBAAsB,CACxC,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,OAAO,EACpB,QAAQ,EAAE,CAAC,MAAM,EAAE,qBAAqB,KAAK,IAAI,GAClD,OAAO,CAAC,gBAAgB,CAAC,CAwB3B;AAED,wBAAsB,2BAA2B,CAC7C,QAAQ,KAAA,EACR,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,UAAU,EACrB,SAAS,EAAE,MAAM,iBA6BpB;AAED,wBAAsB,uBAAuB,CAAC,QAAQ,KAAA,EAAE,SAAS,EAAE,MAAM,iBA0CxE;AAED,wBAAgB,+BAA+B,CAAC,UAAU,EAAE,UAAU,EAAE,WAEvE;AAED,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,UAAU,EAAE,WAKzD;AAED,eAAO,MAAM,uBAAuB,eAAgB,UAAU,KAAG,OAShE,CAAC;AAKF,eAAO,MAAM,2BAA2B,UAOvC,CAAC;AAEF,eAAO,MAAM,8BAA8B,uBAAwB,UAAU,EAAE,YAE9E,CAAC;AAEF,eAAO,MAAM,eAAe,yBAU3B,CAAC"}
|
|
@@ -14,7 +14,7 @@ import find from 'lodash/find';
|
|
|
14
14
|
import forEach from 'lodash/forEach';
|
|
15
15
|
import includes from 'lodash/includes';
|
|
16
16
|
import isEmpty from 'lodash/isEmpty';
|
|
17
|
-
import { AnalysisStatusConstants, AttachmentReducerConstants, defaultAnalysisMetadata, defaultUploadMetadata, onFilesSelect, resetAttachment, udpateFileUploadMetadata, updateAnalysisMetadata, updateAttachmentIdForFile, UploadStatusConstants, } from './
|
|
17
|
+
import { AnalysisStatusConstants, AttachmentReducerConstants, defaultAnalysisMetadata, defaultUploadMetadata, onFilesSelect, resetAttachment, udpateFileUploadMetadata, updateAnalysisMetadata, updateAttachmentIdForFile, UploadStatusConstants, } from './AttachmentReducer';
|
|
18
18
|
import { FileStatusHelper } from './FileStatusHelper';
|
|
19
19
|
export const onDrop = (dispatchToAttachmentReducer, isSessionId, isPrivate = false) => (acceptedFiles) => {
|
|
20
20
|
const onFilesSelectLocal = (caseFiles) => {
|
|
@@ -107,4 +107,4 @@ export declare const updateAttachmentIdForFile: (dispatch: AttachmentReducerDisp
|
|
|
107
107
|
export declare const updateAnalysisMetadata: (dispatch: AttachmentReducerDispatchType, analysisMetadata: Partial<IAnalysisMetadata>, fileIndexToEdit: number) => void;
|
|
108
108
|
export declare const udpateFileUploadMetadata: (dispatch: AttachmentReducerDispatchType, uploadProgress: Partial<IUploadMetadata>, fileIndexToEdit: number) => void;
|
|
109
109
|
export {};
|
|
110
|
-
//# sourceMappingURL=
|
|
110
|
+
//# sourceMappingURL=AttachmentReducer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"AttachmentReducer.d.ts","sourceRoot":"","sources":["../../../../../../src/components/shared/fileUpload/reducer/AttachmentReducer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,oDAAoD,CAAC;AACrH,OAAO,EAAE,MAAM,EAAE,MAAM,yCAAyC,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAMnD,oBAAY,0BAA0B;IAClC,gBAAgB,qBAAqB;IACrC,mBAAmB,wBAAwB;IAC3C,eAAe,oBAAoB;IACnC,eAAe,oBAAoB;IACnC,sBAAsB,2BAA2B;IACjD,yBAAyB,8BAA8B;IACvD,sBAAsB,2BAA2B;IACjD,wBAAwB,6BAA6B;IACrD,mCAAmC,wCAAwC;CAC9E;AAED,oBAAY,qBAAqB;IAC7B,cAAc,qBAAqB;IACnC,iBAAiB,wBAAwB;IACzC,eAAe,sBAAsB;IACrC,kBAAkB,yBAAyB;IAC3C,mBAAmB,0BAA0B;IAC7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aAAc,6BAA6B,qBAAqB,MAAM,SAE9F,CAAC;AACF,eAAO,MAAM,eAAe,aAAc,6BAA6B,SAEtE,CAAC;AACF,eAAO,MAAM,uBAAuB,aAAc,6BAA6B,kBAAkB,OAAO,SAEvG,CAAC;AAEF,eAAO,MAAM,yBAAyB,aACxB,6BAA6B,gBACzB,MAAM,mBACH,MAAM,SAM1B,CAAC;AAEF,eAAO,MAAM,sBAAsB,aACrB,6BAA6B,oBACrB,QAAQ,iBAAiB,CAAC,mBAC3B,MAAM,SAM1B,CAAC;AAEF,eAAO,MAAM,wBAAwB,aACvB,6BAA6B,kBACvB,QAAQ,eAAe,CAAC,mBACvB,MAAM,SAM1B,CAAC"}
|
package/lib/esm/components/shared/fileUpload/reducer/{AttachemntReducer.js → AttachmentReducer.js}
RENAMED
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { AttachmentReducerDispatchType, IAttachemntState } from './
|
|
2
|
+
import { AttachmentReducerDispatchType, IAttachemntState } from './AttachmentReducer';
|
|
3
3
|
export interface IAttachmentStateContext {
|
|
4
4
|
attachmentState: IAttachemntState;
|
|
5
5
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useReducer } from 'react';
|
|
2
|
-
import { attachmentReducer, initialAttachmentState, } from './
|
|
2
|
+
import { attachmentReducer, initialAttachmentState, } from './AttachmentReducer';
|
|
3
3
|
const initialStateContext = {
|
|
4
4
|
attachmentState: initialAttachmentState,
|
|
5
5
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { IFileLocal } from './reducer/
|
|
2
|
+
import { IFileLocal } from './reducer/AttachmentReducer';
|
|
3
3
|
import { IFileUploaderCommonProps } from './types';
|
|
4
4
|
export declare function useFileUploader(props: IFileUploaderCommonProps): {
|
|
5
5
|
retryUpload: (indexToRetry: number) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFileUploader.d.ts","sourceRoot":"","sources":["../../../../../src/components/shared/fileUpload/useFileUploader.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA8D,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useFileUploader.d.ts","sourceRoot":"","sources":["../../../../../src/components/shared/fileUpload/useFileUploader.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA8D,MAAM,OAAO,CAAC;AAWnF,OAAO,EAAE,UAAU,EAAmD,MAAM,6BAA6B,CAAC;AAE1G,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAEnD,wBAAgB,eAAe,CAAC,KAAK,EAAE,wBAAwB;gCA0DvB,MAAM;gCAYM,UAAU,mBAAmB,MAAM,WAAW,UAAU;oCAOpD,MAAM,QAAQ,UAAU;wBAc/C,gBAAgB,CAAC,iBAAiB,EAAE,UAAU,CAAC;4BAY3C,MAAM;kCAxCA,MAAM;EA8DhD"}
|
|
@@ -13,8 +13,8 @@ import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
|
13
13
|
import { getConfigField, PCM_CONFIG_FIELD_TYPE } from '@rh-support/utils';
|
|
14
14
|
import debounce from 'lodash/debounce';
|
|
15
15
|
import { useCallback, useContext, useEffect, useMemo, useRef } from 'react';
|
|
16
|
-
import { onFileEdit, onFileRemove, UploadStatusConstants } from './reducer/AttachemntReducer';
|
|
17
16
|
import { doSosReportAnalysisForFile, isAnalysingAnyAttachment, isUploadedSuccessfully, isUploadingAttachment, updateUploadMetadata, uploadAllFiles, uploadFile, } from './reducer/AttachmentHelper';
|
|
17
|
+
import { onFileEdit, onFileRemove, UploadStatusConstants } from './reducer/AttachmentReducer';
|
|
18
18
|
import { AttachmentDispatchContext, AttachmentStateContext } from './reducer/AttachmentReducerContext';
|
|
19
19
|
export function useFileUploader(props) {
|
|
20
20
|
const { attachmentState, attachmentState: { caseFiles }, } = useContext(AttachmentStateContext);
|
|
@@ -48,9 +48,7 @@ export function useFileUploader(props) {
|
|
|
48
48
|
const updateSessionAttachmentMetadata = useCallback((file, changes) => __awaiter(this, void 0, void 0, function* () {
|
|
49
49
|
sessionAttachments.updateSessionAttachmentMetadata(idToUploadTo, [Object.assign({ id: file.attachmentId }, changes)]);
|
|
50
50
|
}), [idToUploadTo]);
|
|
51
|
-
const debounceSessionMetadataUpdate = useMemo(() => debounce(updateSessionAttachmentMetadata, 800), [
|
|
52
|
-
updateSessionAttachmentMetadata,
|
|
53
|
-
]);
|
|
51
|
+
const debounceSessionMetadataUpdate = useMemo(() => debounce(updateSessionAttachmentMetadata, 800), [updateSessionAttachmentMetadata]);
|
|
54
52
|
const onRetryLocal = (indexToRetry) => {
|
|
55
53
|
if (idToUploadTo && attachmentState.caseFiles.selectedLocalFiles[indexToRetry]) {
|
|
56
54
|
onUploadFile(indexToRetry);
|
|
@@ -8,6 +8,7 @@ import { IContact } from '@cee-eng/hydrajs/@types/models/contact';
|
|
|
8
8
|
import { IAction, IAPIError, IApiResponseDetails } from '@rh-support/types/shared';
|
|
9
9
|
import { Dispatch } from 'react';
|
|
10
10
|
export declare const SUMMARY_LENGTH_LIMIT = 255;
|
|
11
|
+
export declare const ATTACHMENT_DESCRIPTION_LENGTH_LIMIT = 255;
|
|
11
12
|
export declare const ESCALATION_SUBJECT_LENGTH_LIMIT = 255;
|
|
12
13
|
export declare const DESCRIPTION_LENGTH_LIMIT = 32000;
|
|
13
14
|
export declare const MODIFIED_DESCRIPTION_LENGTH_LIMIT = 31000;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseConstNTypes.d.ts","sourceRoot":"","sources":["../../../src/reducers/CaseConstNTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AACjH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC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O,CAAC;IAC5B,cAAc,EAAE,OAAO,CAAC;IACxB,gBAAgB,EAAE,SAAS,CAAC;IAC5B,0BAA0B,EAAE,OAAO,CAAC;IACpC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,oCAAoC,EAAE,OAAO,CAAC;IAC9C,sCAAsC,EAAE,OAAO,CAAC;IAChD,eAAe,EAAE,mBAAmB,CAAC,gBAAgB,EAAE,CAAC,CAAC;IACzD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,0BAA0B,EAAE,OAAO,CAAC;IACpC,oBAAoB,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,MAAM,WAAW,sBAAuB,SAAQ,UAAU;CAAG;AAC7D,oBAAY,eAAe,GAAG,OAAO,CAAC,oBAAoB,EAAE,sBAAsB,CAAC,CAAC;AACpF,oBAAY,uBAAuB,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAC;AAEhE,eAAO,MAAM,qCAAqC,+CAA+C,CAAC;AAClG,eAAO,MAAM,yCAAyC,+CAA+C,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { getApiResourceObject } from '@rh-support/utils';
|
|
2
2
|
export const SUMMARY_LENGTH_LIMIT = 255;
|
|
3
|
+
export const ATTACHMENT_DESCRIPTION_LENGTH_LIMIT = 255;
|
|
3
4
|
export const ESCALATION_SUBJECT_LENGTH_LIMIT = 255;
|
|
4
5
|
export const DESCRIPTION_LENGTH_LIMIT = 32000;
|
|
5
6
|
export const MODIFIED_DESCRIPTION_LENGTH_LIMIT = 31000;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseHelpers.d.ts","sourceRoot":"","sources":["../../../src/reducers/CaseHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,qDAAqD,CAAC;AACpG,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AACvG,OAAO,EAAE,YAAY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B,YAAY,EAAE,KAAG,YAAY,EAEvF,CAAC;AACF,eAAO,MAAM,yBAAyB,qBAAsB,YAAY,EAAE,KAAG,OAE5E,CAAC;AAEF,eAAO,MAAM,yBAAyB,gBACrB,YAAY,6BACE,MAAM,mBAChB,MAAM,KACxB,QAAQ,YAAY,CA6BtB,CAAC;AACF,eAAO,MAAM,yBAAyB,gBACrB,QAAQ,YAAY,CAAC,gCACJ,QAAQ,EAAE,KACzC,eAyCF,CAAC"}
|
|
@@ -129,7 +129,8 @@ export const isClusterIDValid = (caseState, allProducts) => {
|
|
|
129
129
|
// Add a !isEmpty to to make any KTQuestion Mandatory in isCaseStateValid
|
|
130
130
|
export const isCaseStateValid = (caseState, loggedInUserJwtToken) => {
|
|
131
131
|
const case_details = caseState.caseDetails;
|
|
132
|
-
return (isEmpty(case_details.
|
|
132
|
+
return (!isEmpty(case_details.issue) &&
|
|
133
|
+
isEmpty(case_details.caseNumber) &&
|
|
133
134
|
!caseState.hasLargeCaseDescription &&
|
|
134
135
|
!isEmpty(case_details.product) &&
|
|
135
136
|
!isEmpty(case_details.version) &&
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/troubleshoot",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.43",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -73,8 +73,8 @@
|
|
|
73
73
|
"@patternfly/react-core": "4.264.0",
|
|
74
74
|
"@progress/kendo-drawing": "^1.6.0",
|
|
75
75
|
"@progress/kendo-react-pdf": "^3.12.0",
|
|
76
|
-
"@rh-support/components": "1.2.
|
|
77
|
-
"@rh-support/react-context": "1.0.
|
|
76
|
+
"@rh-support/components": "1.2.19",
|
|
77
|
+
"@rh-support/react-context": "1.0.26",
|
|
78
78
|
"@rh-support/types": "0.2.0",
|
|
79
79
|
"@rh-support/user-permissions": "1.0.11",
|
|
80
80
|
"@rh-support/utils": "1.0.9",
|
|
@@ -145,5 +145,5 @@
|
|
|
145
145
|
"not ie <= 11",
|
|
146
146
|
"not op_mini all"
|
|
147
147
|
],
|
|
148
|
-
"gitHead": "
|
|
148
|
+
"gitHead": "34d2dec5c3f91b58ef2cdd7378f776997e755dfc"
|
|
149
149
|
}
|