@rh-support/troubleshoot 0.2.115 → 0.2.116

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.
@@ -15,7 +15,7 @@ import React, { useState } from 'react';
15
15
  import { Trans, useTranslation } from 'react-i18next';
16
16
  import { CaseStatusEnum } from '../../../constants/caseDetailsConstants';
17
17
  const reasonWithDescription = ['Other'];
18
- const reasonWithoutDescription = ["I'm experiencing the same issue", 'My case has been closed prematurely'];
18
+ const reasonWithoutDescription = ['I am experiencing the same issue', 'My case has been closed prematurely'];
19
19
  const reasonsList = [...reasonWithoutDescription, ...reasonWithDescription];
20
20
  export function ReopenCaseModal(props) {
21
21
  const { t } = useTranslation();
@@ -1 +1 @@
1
- {"version":3,"file":"CaseDiscussion.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,YAAY,EAA0B,MAAM,yCAAyC,CAAC;AAmB1G,OAAO,KAAoE,MAAM,OAAO,CAAC;AAsCzF,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,YAAY,EAAE,CAAC;IAC7B,SAAS,EAAE,SAAS,EAAE,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;IAC/C,eAAe,EAAE,OAAO,CAAC;CAC5B;AAOD,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,MAAM,eAwgBnD"}
1
+ {"version":3,"file":"CaseDiscussion.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,YAAY,EAA0B,MAAM,yCAAyC,CAAC;AAmB1G,OAAO,KAAoE,MAAM,OAAO,CAAC;AAsCzF,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,YAAY,EAAE,CAAC;IAC7B,SAAS,EAAE,SAAS,EAAE,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;IAC/C,eAAe,EAAE,OAAO,CAAC;CAC5B;AAOD,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,MAAM,eAugBnD"}
@@ -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,eAqcxC"}
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,eAmdxC"}
@@ -70,6 +70,7 @@ export function PostComment(props) {
70
70
  const [isCommentTooLong, setIsCommentTooLong] = useState(false);
71
71
  const canEditCase = useCanEditCase();
72
72
  const componentRef = useRef(null);
73
+ let passedReply = props.commentText;
73
74
  const { getRootProps, getInputProps, open } = useDropzone({
74
75
  onDrop: (files) => onFileAttach(files, isPublic),
75
76
  multiple: false,
@@ -150,6 +151,12 @@ export function PostComment(props) {
150
151
  useEffect(() => {
151
152
  isPublicRef.current = isPublic;
152
153
  }, [isPublic]);
154
+ useEffect(() => {
155
+ if (isCommentEmpty) {
156
+ props.onCommentClear && props.onCommentClear();
157
+ }
158
+ // eslint-disable-next-line react-hooks/exhaustive-deps
159
+ }, [commentText]);
153
160
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
154
161
  const onPostComment = () => __awaiter(this, void 0, void 0, function* () {
155
162
  if (canEditCase.alert())
@@ -266,8 +273,13 @@ export function PostComment(props) {
266
273
  const onBtnClick = () => {
267
274
  setIsModalOpen(true);
268
275
  };
269
- // TO check is commment is empty
276
+ // To check is commment is empty
270
277
  const isCommentEmpty = isEmpty(commentText === null || commentText === void 0 ? void 0 : commentText.trim());
278
+ // To check is comment reply is empty and disable if it is
279
+ const isReplyDisabled = () => {
280
+ let parsedPassedReply = getReplyText(passedReply, props.commentCreator);
281
+ return (parsedPassedReply === null || parsedPassedReply === void 0 ? void 0 : parsedPassedReply.trim()) === (commentText === null || commentText === void 0 ? void 0 : commentText.trim());
282
+ };
271
283
  return (React.createElement("div", { className: "pf-u-mb-md hide-in-pdf", ref: componentRef },
272
284
  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: {
273
285
  showFileSelectorInToolbar: allowInlineImagesInMarkdown && !loggedInUsersAccount.data.secureSupport,
@@ -281,7 +293,7 @@ export function PostComment(props) {
281
293
  } }),
282
294
  isProcessing ? (React.createElement(LoadingIndicator, { isInline: true, size: "sm" })) : (React.createElement("div", { className: "pf-l-flex post-comment-btn-group push-top-narrow" },
283
295
  isModalOpen && loggedInUserRights.data.isInternal() && isPublic && (React.createElement(VerifyCaseStatusModal, { onClose: onCancel, onConfirm: onConfirm, isUpdating: isPostingComment, caseNumber: props.caseNumber })),
284
- React.createElement(Button, { "data-tracking-id": "postcomment-submit-button", type: "button", variant: ButtonVariant.primary, onClick: loggedInUser.data.isInternal && isPublic ? onBtnClick : isNotInternalConfirm, isDisabled: isCommentEmpty || isPostCommentDisabled, className: "postcomment-submit" },
296
+ React.createElement(Button, { "data-tracking-id": "postcomment-submit-button", type: "button", variant: ButtonVariant.primary, onClick: loggedInUser.data.isInternal && isPublic ? onBtnClick : isNotInternalConfirm, isDisabled: isReplyDisabled() || isCommentEmpty || isPostCommentDisabled, className: "postcomment-submit" },
285
297
  React.createElement(Trans, null, "Submit")),
286
298
  canAddAttachments &&
287
299
  (isPublic && canPostPrivateComments ? (React.createElement(Tooltip, { content: t('You can attach files privately') }, fileUploadButton)) : (fileUploadButton)),
@@ -1 +1 @@
1
- {"version":3,"file":"OpenshiftDropdownV4.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/OpenshiftDropdownV4.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAgC,MAAM,sCAAsC,CAAC;AAE1G,OAAO,EAAE,gBAAgB,EAAuB,MAAM,0BAA0B,CAAC;AAWjF,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;CACzC;AAQD,QAAA,MAAM,qBAAqB,cAAqB,MAAM,qEASrD,CAAC;AAeF,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,eAwTzC;kBAxTQ,mBAAmB;;;AA2T5B,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,CAAC"}
1
+ {"version":3,"file":"OpenshiftDropdownV4.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/OpenshiftDropdownV4.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAgC,MAAM,sCAAsC,CAAC;AAE1G,OAAO,EAAE,gBAAgB,EAAuB,MAAM,0BAA0B,CAAC;AAWjF,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;CACzC;AAQD,QAAA,MAAM,qBAAqB,cAAqB,MAAM,qEASrD,CAAC;AAeF,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,eAmTzC;kBAnTQ,mBAAmB;;;AAsT5B,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,CAAC"}
@@ -47,7 +47,7 @@ const createState = (external_cluster_id, display_name) => {
47
47
  };
48
48
  function OpenshiftDropdownV4(props) {
49
49
  const { t } = useTranslation();
50
- const PER_PAGE = 20;
50
+ const PER_PAGE = 200;
51
51
  const [clustersRawResponse, setClustersRawResponse] = useState([]);
52
52
  const abortControllerRef = useRef(undefined);
53
53
  const [clustersSelectOptions, setClustersSelectOptions] = useState([]);
@@ -168,19 +168,16 @@ function OpenshiftDropdownV4(props) {
168
168
  });
169
169
  try {
170
170
  // old api has dns info
171
- // new api doesn't have dns info but we can exclude archived clusters
172
- // call old api get all clusters and call new api get limitted number of clusters
173
- // then add dns info to the new api response
174
- const promiseArray = clustersResponse.items.map((cluster) => cloud.getAccountClusters({
175
- order: 'display_name asc',
176
- search: `external_id='${cluster.external_cluster_id}' OR display_name='${cluster.external_cluster_id}'`,
177
- }, controller.signal));
178
- const oldApiResponse = yield Promise.allSettled(promiseArray);
179
- oldApiResponse.forEach((response) => {
180
- var _a, _b;
181
- if (response.status === 'fulfilled' && ((_b = (_a = response.value) === null || _a === void 0 ? void 0 : _a.items) === null || _b === void 0 ? void 0 : _b[0].dns)) {
182
- var index = findIndex(items, { external_cluster_id: response.value.items[0].external_id });
183
- items[index] = Object.assign(Object.assign({}, items[index]), { dns: response.value.items[0].dns });
171
+ // call old api to get clusters from prev call then add dns info to the new api response
172
+ const oldApiResponse = yield cloud.getAccountClusters({
173
+ search: clustersResponse.items
174
+ .map((c) => `external_id='${c.external_cluster_id}'`)
175
+ .join(' OR '),
176
+ }, controller.signal);
177
+ oldApiResponse === null || oldApiResponse === void 0 ? void 0 : oldApiResponse.items.forEach((response) => {
178
+ if (response.dns) {
179
+ var index = findIndex(items, { external_cluster_id: response.external_id });
180
+ items[index] = Object.assign(Object.assign({}, items[index]), { dns: response.dns });
184
181
  }
185
182
  });
186
183
  }
@@ -314,4 +314,4 @@ div.pf-c-alert__description div.ea-rule p a.pf-c-button {
314
314
  div pfe-accordion {
315
315
  --pfe-accordion--FontSize--header: 16px;
316
316
  --pfe-accordion--FontWeight--header: 600;
317
- }
317
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "0.2.115",
3
+ "version": "0.2.116",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -75,7 +75,7 @@
75
75
  "@progress/kendo-react-pdf": "^3.12.0",
76
76
  "@rh-support/api": "0.3.21",
77
77
  "@rh-support/components": "1.1.69",
78
- "@rh-support/react-context": "0.2.73",
78
+ "@rh-support/react-context": "0.2.74",
79
79
  "@rh-support/types": "0.2.0",
80
80
  "@rh-support/user-permissions": "0.2.58",
81
81
  "@rh-support/utils": "0.2.43",
@@ -143,5 +143,5 @@
143
143
  "not ie <= 11",
144
144
  "not op_mini all"
145
145
  ],
146
- "gitHead": "83213f63a0200c2976231df845612f7ef9d73c3e"
146
+ "gitHead": "1b7928a0e111e756b4fe781c440d3c859299bebf"
147
147
  }