@rh-support/manage 0.2.94 → 0.2.95

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":"PreferencesCaseView.d.ts","sourceRoot":"","sources":["../../../../../src/components/ManagePreferences/sections/PreferencesCaseView.tsx"],"names":[],"mappings":"AAaA,UAAU,MAAM;CAAG;AAEnB,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,eA6JhD"}
1
+ {"version":3,"file":"PreferencesCaseView.d.ts","sourceRoot":"","sources":["../../../../../src/components/ManagePreferences/sections/PreferencesCaseView.tsx"],"names":[],"mappings":"AAcA,UAAU,MAAM;CAAG;AAEnB,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,eAgKhD"}
@@ -12,6 +12,7 @@ import { Card, CardBody, CardHeader, SelectOption, Spinner, TextArea } from '@pa
12
12
  import { EditorMode, ToastNotification, useFetch } from '@rh-support/components';
13
13
  import { GlobalMetadataStateContext } from '@rh-support/react-context';
14
14
  import { ability, CaseListFields, resourceActions, resources } from '@rh-support/user-permissions';
15
+ import { isEmpty } from 'lodash';
15
16
  import debounce from 'lodash/debounce';
16
17
  import React, { useContext, useEffect, useState } from 'react';
17
18
  import { Trans, useTranslation } from 'react-i18next';
@@ -58,6 +59,7 @@ export function PreferencesCaseView(props) {
58
59
  const debounceUpdateCommentSignature = debounce((value) => __awaiter(this, void 0, void 0, function* () {
59
60
  try {
60
61
  yield updateCommentSignature(value);
62
+ !isEmpty(value.trim()) && setTimeout(() => setCommentValidated('success'), 2000);
61
63
  }
62
64
  catch (error) {
63
65
  setLocalCommentSignature('');
@@ -66,11 +68,13 @@ export function PreferencesCaseView(props) {
66
68
  setCommentValidated('error');
67
69
  setIsCommentSignatureLoading(false);
68
70
  }
69
- }), 1000);
71
+ }), 2000);
70
72
  const handleCommentSignatureChange = (value) => __awaiter(this, void 0, void 0, function* () {
71
73
  setIsCommentSignatureLoading(true);
72
- yield debounceUpdateCommentSignature(value);
73
- setTimeout(() => setCommentValidated('success'), 2000);
74
+ if (isEmpty(value.trim())) {
75
+ yield debounceUpdateCommentSignature('');
76
+ }
77
+ !isEmpty(value.trim()) && (yield debounceUpdateCommentSignature(value));
74
78
  setLocalCommentSignature(value);
75
79
  setIsCommentSignatureLoading(false);
76
80
  });
@@ -118,7 +122,7 @@ export function PreferencesCaseView(props) {
118
122
  React.createElement("div", { className: "form-group" },
119
123
  React.createElement("label", { htmlFor: "comment-signature-textarea" },
120
124
  React.createElement(Trans, null, "Comment signature")),
121
- React.createElement(TextArea, { value: localCommentSignature, onChange: handleCommentSignatureChange, "aria-label": "comment-signature-textarea", placeholder: originalCommentSignature, id: "comment-signature-textarea",
125
+ React.createElement(TextArea, { value: localCommentSignature, onChange: handleCommentSignatureChange, "aria-label": "comment-signature-textarea", placeholder: originalCommentSignature || 'Add a comment signature', id: "comment-signature-textarea",
122
126
  // @ts-ignore
123
127
  validated: commentValidated }),
124
128
  isCommentSignatureLoading && React.createElement(Spinner, { size: "md" })),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/manage",
3
- "version": "0.2.94",
3
+ "version": "0.2.95",
4
4
  "description": "Customer Support Manage App",
5
5
  "author": "Jordan Eudy <jeudy100@gmail.com>",
6
6
  "homepage": "",
@@ -97,11 +97,11 @@
97
97
  "@patternfly/react-core": "4.202.16",
98
98
  "@patternfly/react-table": "4.71.16",
99
99
  "@rh-support/api": "0.3.24",
100
- "@rh-support/components": "1.1.75",
100
+ "@rh-support/components": "1.1.76",
101
101
  "@rh-support/configs": "0.2.5",
102
- "@rh-support/react-context": "0.2.81",
102
+ "@rh-support/react-context": "0.2.82",
103
103
  "@rh-support/types": "0.2.0",
104
- "@rh-support/user-permissions": "0.2.62",
104
+ "@rh-support/user-permissions": "0.2.63",
105
105
  "@rh-support/utils": "0.2.46",
106
106
  "@types/react-beautiful-dnd": "^13.0.0",
107
107
  "i18next": ">=17.0.1",
@@ -113,5 +113,5 @@
113
113
  "react-i18next": ">=10.11.0",
114
114
  "react-router-dom": ">=5.1.2"
115
115
  },
116
- "gitHead": "36c7eb5b28d9a55ba7a7501fd2287ff7a940e91a"
116
+ "gitHead": "1359173d6efb7ece2bd1d0760c001e053bc29893"
117
117
  }