@rh-support/manage 2.5.253 → 2.5.254
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":"AAkBA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAO/D,UAAU,MAAM;CAAG;AAEnB,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"PreferencesCaseView.d.ts","sourceRoot":"","sources":["../../../../../src/components/ManagePreferences/sections/PreferencesCaseView.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAO/D,UAAU,MAAM;CAAG;AAEnB,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,qBA0OhD"}
|
|
@@ -12,7 +12,7 @@ import { Card, CardBody, CardHeader, Popover, PopoverPosition, SelectOption, Spi
|
|
|
12
12
|
// Tooltip,
|
|
13
13
|
} from '@patternfly/react-core';
|
|
14
14
|
import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
|
|
15
|
-
import { ToastNotification } from '@rh-support/components';
|
|
15
|
+
import { ToastNotification /* , useFetch */ } from '@rh-support/components';
|
|
16
16
|
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
17
17
|
import { ability /* , CaseListFields */, resourceActions, resources } from '@rh-support/user-permissions';
|
|
18
18
|
import debounce from 'lodash/debounce';
|
|
@@ -23,19 +23,16 @@ import { useUserPreferences } from '../../../hooks/useUserPreferences';
|
|
|
23
23
|
import { PreferenceSelect } from '../components/PreferenceSelect';
|
|
24
24
|
export function PreferencesCaseView(props) {
|
|
25
25
|
const { t } = useTranslation();
|
|
26
|
-
const {
|
|
26
|
+
const { getCommentSignature, updateCommentSignature, getOriginalCaseView, updateOriginalCaseView } = useUserPreferences();
|
|
27
27
|
const {
|
|
28
28
|
// globalMetadataState: { loggedInUsersAccount, loggedInUserRights },
|
|
29
29
|
globalMetadataState: { loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
|
|
30
30
|
// const [isSharingHostNames, setIsSharingHostNames] = useState(false);
|
|
31
31
|
const [localCommentSignature, setLocalCommentSignature] = useState('');
|
|
32
|
-
const [originalCommentType, setOriginalCommentType] = useState('');
|
|
33
32
|
const [originalCommentSignature, setOriginalCommentSignature] = useState('');
|
|
34
33
|
const [commentValidated, setCommentValidated] = useState('default');
|
|
35
34
|
// const [isHostnamesLoading, setIsHostnamesLoading] = useState(true);
|
|
36
35
|
const [isCommentSignatureLoading, setIsCommentSignatureLoading] = useState(false);
|
|
37
|
-
const commentTypes = ['plaintext', 'markdown'];
|
|
38
|
-
const defaultCommentTitleID = 'default-comment-preference-select';
|
|
39
36
|
const defaultCaseViewID = 'default-case-view-select';
|
|
40
37
|
// const canUseHostName = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.HOSTNAME);
|
|
41
38
|
const isInternalUserPermission = ability.can(resourceActions.READ, resources.ACCOUNTS_FILTER);
|
|
@@ -52,7 +49,6 @@ export function PreferencesCaseView(props) {
|
|
|
52
49
|
];
|
|
53
50
|
useEffect(() => {
|
|
54
51
|
userOriginalCommentSignature();
|
|
55
|
-
userOriginalCommentType();
|
|
56
52
|
userOriginalCaseView();
|
|
57
53
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
58
54
|
}, []);
|
|
@@ -85,15 +81,6 @@ export function PreferencesCaseView(props) {
|
|
|
85
81
|
ToastNotification.addWarningMessage(t('Failed to fetch original preference'));
|
|
86
82
|
}
|
|
87
83
|
});
|
|
88
|
-
const userOriginalCommentType = () => __awaiter(this, void 0, void 0, function* () {
|
|
89
|
-
try {
|
|
90
|
-
const retrievedComment = yield getCommentTypeFromPreference();
|
|
91
|
-
setOriginalCommentType(retrievedComment);
|
|
92
|
-
}
|
|
93
|
-
catch (_a) {
|
|
94
|
-
ToastNotification.addWarningMessage(t('Failed to fetch original preference'));
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
84
|
const userOriginalCommentSignature = () => __awaiter(this, void 0, void 0, function* () {
|
|
98
85
|
try {
|
|
99
86
|
const retrievedSignature = yield getCommentSignature();
|
|
@@ -135,28 +122,6 @@ export function PreferencesCaseView(props) {
|
|
|
135
122
|
console.log(error);
|
|
136
123
|
}
|
|
137
124
|
});
|
|
138
|
-
const toInternalFormat = (displayName) => {
|
|
139
|
-
if (displayName === 'Plain text')
|
|
140
|
-
return 'plaintext';
|
|
141
|
-
if (displayName === 'Markdown')
|
|
142
|
-
return 'markdown';
|
|
143
|
-
};
|
|
144
|
-
const toDisplayName = (internal) => {
|
|
145
|
-
if (internal === 'plaintext')
|
|
146
|
-
return 'Plain text';
|
|
147
|
-
if (internal === 'markdown')
|
|
148
|
-
return 'Markdown';
|
|
149
|
-
};
|
|
150
|
-
const onCommentSelect = (event, selection) => __awaiter(this, void 0, void 0, function* () {
|
|
151
|
-
try {
|
|
152
|
-
const selectedComment = toInternalFormat(selection);
|
|
153
|
-
yield updateCommentType(selectedComment);
|
|
154
|
-
setOriginalCommentType(selectedComment);
|
|
155
|
-
}
|
|
156
|
-
catch (error) {
|
|
157
|
-
console.log(error);
|
|
158
|
-
}
|
|
159
|
-
});
|
|
160
125
|
// const onShareHostNamesSwitch = async () => {
|
|
161
126
|
// try {
|
|
162
127
|
// setIsHostnamesLoading(true);
|
|
@@ -191,8 +156,6 @@ export function PreferencesCaseView(props) {
|
|
|
191
156
|
React.createElement("form", null,
|
|
192
157
|
isInternalUserPermission && (React.createElement("div", { className: "form-group" },
|
|
193
158
|
React.createElement(PreferenceSelect, { onSelect: (event, selection) => onPrefCaseViewSelect(event, selection), selections: caseViewPrefSelection(), id: defaultCaseViewID, label: prefCasePopover }, caseViewTypes.map((option, index) => (React.createElement(SelectOption, Object.assign({ "data-index": index, key: index, value: option.value }, (option.description && { description: option.description })))))))),
|
|
194
|
-
React.createElement("div", { className: "form-group" },
|
|
195
|
-
React.createElement(PreferenceSelect, { onSelect: onCommentSelect, selections: toDisplayName(originalCommentType), id: defaultCommentTitleID, label: "Default comment type" }, commentTypes.map((option) => (React.createElement(SelectOption, { key: option, value: toDisplayName(option) }))))),
|
|
196
159
|
React.createElement("div", { className: "form-group" },
|
|
197
160
|
React.createElement("label", { htmlFor: "comment-signature-textarea" },
|
|
198
161
|
React.createElement(Trans, null, "Comment signature")),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/manage",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.254",
|
|
4
4
|
"description": "Customer Support Manage App",
|
|
5
5
|
"author": "Jordan Eudy <jeudy100@gmail.com>",
|
|
6
6
|
"license": "ISC",
|
|
@@ -78,12 +78,12 @@
|
|
|
78
78
|
"@patternfly/patternfly": "6.2.1",
|
|
79
79
|
"@patternfly/react-core": "6.2.1",
|
|
80
80
|
"@patternfly/react-table": "6.2.1",
|
|
81
|
-
"@rh-support/components": "2.5.
|
|
81
|
+
"@rh-support/components": "2.5.205",
|
|
82
82
|
"@rh-support/configs": "2.0.75",
|
|
83
|
-
"@rh-support/react-context": "2.5.
|
|
83
|
+
"@rh-support/react-context": "2.5.300",
|
|
84
84
|
"@rh-support/types": "2.0.26",
|
|
85
|
-
"@rh-support/user-permissions": "2.5.
|
|
86
|
-
"@rh-support/utils": "2.5.
|
|
85
|
+
"@rh-support/user-permissions": "2.5.152",
|
|
86
|
+
"@rh-support/utils": "2.5.134",
|
|
87
87
|
"@types/react-beautiful-dnd": "^13.0.0",
|
|
88
88
|
"i18next": "^23.15.0",
|
|
89
89
|
"lodash": ">=4.17.15",
|
|
@@ -102,5 +102,5 @@
|
|
|
102
102
|
"defaults and supports es6-module",
|
|
103
103
|
"maintained node versions"
|
|
104
104
|
],
|
|
105
|
-
"gitHead": "
|
|
105
|
+
"gitHead": "0a8c5a75fd70b1ec87b66604b4a25587f274540c"
|
|
106
106
|
}
|