@rh-support/troubleshoot 1.0.6 → 1.0.7
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.
|
@@ -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,eAqfxC"}
|
|
@@ -293,20 +293,22 @@ export function PostComment(props) {
|
|
|
293
293
|
const isNotInternalConfirm = () => {
|
|
294
294
|
onPostComment();
|
|
295
295
|
};
|
|
296
|
-
const onConfirm = (commentText) =>
|
|
297
|
-
|
|
296
|
+
const onConfirm = (commentText) => {
|
|
297
|
+
setIsModalOpen(false);
|
|
298
298
|
isNotInternalConfirm();
|
|
299
|
-
}
|
|
299
|
+
};
|
|
300
300
|
const onBtnClick = () => {
|
|
301
301
|
setIsModalOpen(true);
|
|
302
302
|
};
|
|
303
303
|
// To check is commment is empty
|
|
304
|
-
const
|
|
304
|
+
const checkCommentSignature = commentText.replace(commentSignature, '');
|
|
305
|
+
const isCommentEmpty = isEmpty(checkCommentSignature === null || checkCommentSignature === void 0 ? void 0 : checkCommentSignature.trim());
|
|
305
306
|
// To check is comment reply is empty and disable if it is
|
|
306
307
|
const isReplyDisabled = () => {
|
|
307
308
|
let parsedPassedReply = getReplyText(passedReply, props.commentCreator);
|
|
308
309
|
return (parsedPassedReply === null || parsedPassedReply === void 0 ? void 0 : parsedPassedReply.trim()) === (commentText === null || commentText === void 0 ? void 0 : commentText.trim());
|
|
309
310
|
};
|
|
311
|
+
const isSubmitDisabled = isReplyDisabled() || isCommentEmpty || isPostCommentDisabled;
|
|
310
312
|
return (React.createElement("div", { className: "pf-u-mb-md hide-in-pdf", ref: componentRef },
|
|
311
313
|
React.createElement(MarkdownEditor, { className: `${!isPublic ? 'is-private' : ''}`, disabled: isProcessing || canEditCase.isCaseNotEditable, "aria-label": "comment text area", showMarkdownPlainTextToggle: true, editorMode: commentType, onFocus: () => setIsTextAreaFocused(true), onBlur: onTextAreaBlur, onChange: onCommentTextChange, value: commentText, rows: isTextAreaFocused ? 12 : 4, bindTextArea: textAreaRef, onCommentExceedCharsLimit: onCommentExceedCharsLimit, mdPlaceholder: isPublic ? 'Add a comment using markdown' : 'Add a comment or attach a file privately', plainTextPlaceholder: isPublic ? 'Add a comment to this case' : 'Add a comment or attach a file privately', fileSelectorProps: {
|
|
312
314
|
showFileSelectorInToolbar: !loggedInUsersAccount.data.secureSupport,
|
|
@@ -320,7 +322,7 @@ export function PostComment(props) {
|
|
|
320
322
|
} }),
|
|
321
323
|
isProcessing ? (React.createElement(LoadingIndicator, { isInline: true, size: "sm" })) : (React.createElement("div", { className: "pf-l-flex post-comment-btn-group push-top-narrow" },
|
|
322
324
|
isModalOpen && loggedInUserRights.data.isInternal() && isPublic && (React.createElement(VerifyCaseStatusModal, { onClose: onCancel, onConfirm: onConfirm, isUpdating: isPostingComment, caseNumber: props.caseNumber })),
|
|
323
|
-
React.createElement(Button, { "data-tracking-id": "postcomment-submit-button", type: "button", variant: ButtonVariant.primary, onClick: loggedInUser.data.isInternal && isPublic ? onBtnClick : isNotInternalConfirm, isDisabled:
|
|
325
|
+
React.createElement(Button, { "data-tracking-id": "postcomment-submit-button", type: "button", variant: ButtonVariant.primary, onClick: loggedInUser.data.isInternal && isPublic ? onBtnClick : isNotInternalConfirm, isDisabled: isSubmitDisabled, className: "postcomment-submit" },
|
|
324
326
|
React.createElement(Trans, null, "Submit")),
|
|
325
327
|
canAddAttachments &&
|
|
326
328
|
(isPublic && canPostPrivateComments ? (React.createElement(Tooltip, { content: t('You can attach files privately') }, fileUploadButton)) : (fileUploadButton)),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/troubleshoot",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -142,5 +142,5 @@
|
|
|
142
142
|
"not ie <= 11",
|
|
143
143
|
"not op_mini all"
|
|
144
144
|
],
|
|
145
|
-
"gitHead": "
|
|
145
|
+
"gitHead": "b69cce6cf363373e3cb9ea6bbfc0515b04974f3a"
|
|
146
146
|
}
|