@rh-support/manage 0.3.4 → 0.3.5
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":"AAeA,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":"AAeA,UAAU,MAAM;CAAG;AAEnB,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,eAwLhD"}
|
|
@@ -28,6 +28,7 @@ export function PreferencesCaseView(props) {
|
|
|
28
28
|
const [originalCommentType, setOriginalCommentType] = useState('');
|
|
29
29
|
const [originalCommentSignature, setOriginalCommentSignature] = useState('');
|
|
30
30
|
const [commentValidated, setCommentValidated] = useState('default');
|
|
31
|
+
const [isHostnamesLoading, setIsHostnamesLoading] = useState(true);
|
|
31
32
|
const [isCommentSignatureLoading, setIsCommentSignatureLoading] = useState(false);
|
|
32
33
|
const commentTypes = [EditorMode.PLAIN, EditorMode.MARKDOWN];
|
|
33
34
|
const userOriginalCommentType = () => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -84,7 +85,7 @@ export function PreferencesCaseView(props) {
|
|
|
84
85
|
});
|
|
85
86
|
const titleId = 'default-comment-preference-select';
|
|
86
87
|
const canUseHostName = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.HOSTNAME);
|
|
87
|
-
const { globalMetadataState: { loggedInUsersAccount
|
|
88
|
+
const { globalMetadataState: { loggedInUsersAccount }, } = useContext(GlobalMetadataStateContext);
|
|
88
89
|
const { request: fetchHostnameDefault } = useFetch(accounts.getIsSharingHostname);
|
|
89
90
|
const accountNumber = loggedInUsersAccount.data.accountNumber;
|
|
90
91
|
const { request: updateShareHostnames } = useFetch(accounts.updateIsSharingHostname);
|
|
@@ -99,19 +100,22 @@ export function PreferencesCaseView(props) {
|
|
|
99
100
|
catch (error) {
|
|
100
101
|
console.log(error);
|
|
101
102
|
}
|
|
103
|
+
setIsHostnamesLoading(false);
|
|
102
104
|
});
|
|
103
105
|
}
|
|
104
|
-
|
|
106
|
+
canUseHostName && userOriginalHostnameValue();
|
|
105
107
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
106
108
|
}, []);
|
|
107
109
|
const onShareHostNamesSwitch = () => __awaiter(this, void 0, void 0, function* () {
|
|
108
110
|
try {
|
|
111
|
+
setIsHostnamesLoading(true);
|
|
109
112
|
yield updateShareHostnames(!isSharingHostNames, accountNumber);
|
|
110
113
|
setIsSharingHostNames(!isSharingHostNames);
|
|
111
114
|
}
|
|
112
115
|
catch (error) {
|
|
113
116
|
console.log(error);
|
|
114
117
|
}
|
|
118
|
+
setIsHostnamesLoading(false);
|
|
115
119
|
});
|
|
116
120
|
const prefHostnameCopy = 'Red Hat Support cannot currently access hostnames that have been entered on a case. You can share this information at any time to improve your support experience.';
|
|
117
121
|
return (React.createElement(Card, { className: "preference-card" },
|
|
@@ -136,5 +140,6 @@ export function PreferencesCaseView(props) {
|
|
|
136
140
|
React.createElement(PreferenceSwitch, { className: "switches hostnameSwitch", id: "share-hostnames-switch", label: 'Share hostnames', isChecked: isSharingHostNames, onSwitchChange: onShareHostNamesSwitch }),
|
|
137
141
|
React.createElement("div", { className: "prefhostnameTooltip" },
|
|
138
142
|
React.createElement(Tooltip, { content: prefHostnameCopy, position: "right" },
|
|
139
|
-
React.createElement(InfoIcon, { className: "pf-u-ml-sm" }))
|
|
143
|
+
React.createElement(InfoIcon, { className: "pf-u-ml-sm" })),
|
|
144
|
+
isHostnamesLoading && (React.createElement(Spinner, { isSVG: true, size: "lg", className: "pf-u-ml-sm hostnameSpinner", "aria-label": "Hostname loading" }))))))))));
|
|
140
145
|
}
|
package/lib/esm/scss/_main.scss
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/manage",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"description": "Customer Support Manage App",
|
|
5
5
|
"author": "Jordan Eudy <jeudy100@gmail.com>",
|
|
6
6
|
"homepage": "",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"@patternfly/react-table": "4.71.16",
|
|
97
97
|
"@rh-support/components": "1.1.83",
|
|
98
98
|
"@rh-support/configs": "0.2.8",
|
|
99
|
-
"@rh-support/react-context": "0.3.
|
|
99
|
+
"@rh-support/react-context": "0.3.4",
|
|
100
100
|
"@rh-support/types": "0.2.0",
|
|
101
101
|
"@rh-support/user-permissions": "0.2.67",
|
|
102
102
|
"@rh-support/utils": "0.2.49",
|
|
@@ -109,5 +109,5 @@
|
|
|
109
109
|
"react-i18next": ">=10.11.0",
|
|
110
110
|
"react-router-dom": ">=5.1.2"
|
|
111
111
|
},
|
|
112
|
-
"gitHead": "
|
|
112
|
+
"gitHead": "cd70b3e8d05162414bc78e541020c3de692d892b"
|
|
113
113
|
}
|