@rh-support/manage 0.2.100 → 0.3.2
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.
- package/lib/esm/components/ManagePreferences/components/PreferenceSwitch.d.ts +1 -1
- package/lib/esm/components/ManagePreferences/components/PreferenceSwitch.d.ts.map +1 -1
- package/lib/esm/components/ManagePreferences/components/PreferenceSwitch.js +1 -1
- package/lib/esm/components/ManagePreferences/sections/PreferencesCaseCreate.d.ts.map +1 -1
- package/lib/esm/components/ManagePreferences/sections/PreferencesCaseCreate.js +28 -16
- package/lib/esm/components/ManagePreferences/sections/PreferencesCaseView.d.ts.map +1 -1
- package/lib/esm/components/ManagePreferences/sections/PreferencesCaseView.js +8 -2
- package/lib/esm/scss/_main.scss +8 -0
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreferenceSwitch.d.ts","sourceRoot":"","sources":["../../../../../src/components/ManagePreferences/components/PreferenceSwitch.tsx"],"names":[],"mappings":"AAKA,UAAU,MAAM;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"PreferenceSwitch.d.ts","sourceRoot":"","sources":["../../../../../src/components/ManagePreferences/components/PreferenceSwitch.tsx"],"names":[],"mappings":"AAKA,UAAU,MAAM;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,GAAG,CAAC;IACX,cAAc,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IACnD,SAAS,EAAE,OAAO,CAAC;CACtB;AAED,wBAAgB,gBAAgB,CAAC,EAAE,cAAc,EAAE,SAAS,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,MAAM,eA+B3F"}
|
|
@@ -30,5 +30,5 @@ export function PreferenceSwitch({ onSwitchChange, className, id, label, isCheck
|
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
32
|
return (React.createElement("div", null,
|
|
33
|
-
React.createElement(Switch, { className: className, id: id, label:
|
|
33
|
+
React.createElement(Switch, { className: className, id: id, label: label, isChecked: isCheckedLocal, onChange: onChangeLocal, isDisabled: isSwitchLoading })));
|
|
34
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreferencesCaseCreate.d.ts","sourceRoot":"","sources":["../../../../../src/components/ManagePreferences/sections/PreferencesCaseCreate.tsx"],"names":[],"mappings":"AAkBA,UAAU,MAAM;CAAG;AACnB,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"PreferencesCaseCreate.d.ts","sourceRoot":"","sources":["../../../../../src/components/ManagePreferences/sections/PreferencesCaseCreate.tsx"],"names":[],"mappings":"AAkBA,UAAU,MAAM;CAAG;AACnB,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,eA0IlD"}
|
|
@@ -33,11 +33,23 @@ export function PreferencesCaseCreate(props) {
|
|
|
33
33
|
};
|
|
34
34
|
const onPreferredLanguageSelect = (event, selection, isPlaceholder) => __awaiter(this, void 0, void 0, function* () {
|
|
35
35
|
const selectedLanguageCode = getKeyByValue(languageConst, selection);
|
|
36
|
-
|
|
36
|
+
try {
|
|
37
|
+
yield updatePreferredLanguage(selectedLanguageCode);
|
|
38
|
+
setOriginalPreferredLanguage(selection);
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
console.log(error);
|
|
42
|
+
}
|
|
37
43
|
});
|
|
38
44
|
const onDefaultGroupSelect = (event, selection, isPlaceholder) => __awaiter(this, void 0, void 0, function* () {
|
|
39
45
|
const selectionKey = invert(groupDictionary)[selection];
|
|
40
|
-
|
|
46
|
+
try {
|
|
47
|
+
yield updateDefaultGroup(selectionKey);
|
|
48
|
+
setOriginalDefaultGroup(selection);
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
console.log(error);
|
|
52
|
+
}
|
|
41
53
|
});
|
|
42
54
|
const createCaseGroupStruct = (caseGroups) => {
|
|
43
55
|
const defaultGroupDictionary = {};
|
|
@@ -46,31 +58,21 @@ export function PreferencesCaseCreate(props) {
|
|
|
46
58
|
}
|
|
47
59
|
return defaultGroupDictionary;
|
|
48
60
|
};
|
|
49
|
-
//
|
|
61
|
+
//Set user default group after group obj built
|
|
50
62
|
useEffect(() => {
|
|
51
|
-
const userOriginalPreferredLanguage = () => __awaiter(this, void 0, void 0, function* () {
|
|
52
|
-
try {
|
|
53
|
-
const retrievedLanguage = yield getPreferredLanguage();
|
|
54
|
-
setOriginalPreferredLanguage(languageConst[retrievedLanguage]);
|
|
55
|
-
}
|
|
56
|
-
catch (_a) {
|
|
57
|
-
ToastNotification.addWarningMessage(t('Failed to fetch original preference'));
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
63
|
const userOriginalDefaultGroup = () => __awaiter(this, void 0, void 0, function* () {
|
|
61
64
|
try {
|
|
62
65
|
const retrievedGroupId = yield getDefaultGroup();
|
|
63
66
|
setOriginalDefaultGroup(groupDictionary[retrievedGroupId]);
|
|
64
67
|
}
|
|
65
|
-
catch (
|
|
68
|
+
catch (_a) {
|
|
66
69
|
ToastNotification.addWarningMessage(t('Failed to fetch original preference'));
|
|
67
70
|
}
|
|
68
71
|
});
|
|
69
|
-
userOriginalPreferredLanguage();
|
|
70
72
|
userOriginalDefaultGroup();
|
|
71
73
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
72
|
-
}, []);
|
|
73
|
-
// used to build the groups object
|
|
74
|
+
}, [groupDictionary]);
|
|
75
|
+
// used to build the groups object and fetch pref language
|
|
74
76
|
useEffect(() => {
|
|
75
77
|
const refreshParsedGroups = () => __awaiter(this, void 0, void 0, function* () {
|
|
76
78
|
var _a;
|
|
@@ -87,7 +89,17 @@ export function PreferencesCaseCreate(props) {
|
|
|
87
89
|
setUserDefaultGroupList(parsedDefaultGroupNames);
|
|
88
90
|
}
|
|
89
91
|
});
|
|
92
|
+
const userOriginalPreferredLanguage = () => __awaiter(this, void 0, void 0, function* () {
|
|
93
|
+
try {
|
|
94
|
+
const retrievedLanguage = yield getPreferredLanguage();
|
|
95
|
+
setOriginalPreferredLanguage(languageConst[retrievedLanguage]);
|
|
96
|
+
}
|
|
97
|
+
catch (_b) {
|
|
98
|
+
ToastNotification.addWarningMessage(t('Failed to fetch original preference'));
|
|
99
|
+
}
|
|
100
|
+
});
|
|
90
101
|
refreshParsedGroups();
|
|
102
|
+
userOriginalPreferredLanguage();
|
|
91
103
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
92
104
|
}, [caseGroups, dispatchToGlobalMetadataReducer, loggedInUserJwtToken]);
|
|
93
105
|
return (React.createElement(Card, { className: "preference-card" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreferencesCaseView.d.ts","sourceRoot":"","sources":["../../../../../src/components/ManagePreferences/sections/PreferencesCaseView.tsx"],"names":[],"mappings":"
|
|
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,eA2KhD"}
|
|
@@ -8,7 +8,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { accounts } from '@cee-eng/hydrajs';
|
|
11
|
-
import { Card, CardBody, CardHeader, SelectOption, Spinner, TextArea } from '@patternfly/react-core';
|
|
11
|
+
import { Card, CardBody, CardHeader, SelectOption, Spinner, TextArea, Tooltip } from '@patternfly/react-core';
|
|
12
|
+
import InfoIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
|
|
12
13
|
import { EditorMode, ToastNotification, useFetch } from '@rh-support/components';
|
|
13
14
|
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
14
15
|
import { ability, CaseListFields, resourceActions, resources } from '@rh-support/user-permissions';
|
|
@@ -112,6 +113,7 @@ export function PreferencesCaseView(props) {
|
|
|
112
113
|
console.log(error);
|
|
113
114
|
}
|
|
114
115
|
});
|
|
116
|
+
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.';
|
|
115
117
|
return (React.createElement(Card, { className: "preference-card" },
|
|
116
118
|
React.createElement(CardHeader, null,
|
|
117
119
|
React.createElement("h3", null,
|
|
@@ -130,5 +132,9 @@ export function PreferencesCaseView(props) {
|
|
|
130
132
|
canUseHostName && (React.createElement("div", { className: "form-group" },
|
|
131
133
|
React.createElement("label", { htmlFor: "share-hostnames-switch" },
|
|
132
134
|
React.createElement(Trans, null, "Case information")),
|
|
133
|
-
React.createElement(
|
|
135
|
+
React.createElement("div", null,
|
|
136
|
+
React.createElement(PreferenceSwitch, { className: "switches hostnameSwitch", id: "share-hostnames-switch", label: 'Share hostnames', isChecked: isSharingHostNames, onSwitchChange: onShareHostNamesSwitch }),
|
|
137
|
+
React.createElement("div", { className: "prefhostnameTooltip" },
|
|
138
|
+
React.createElement(Tooltip, { content: prefHostnameCopy, position: "right" },
|
|
139
|
+
React.createElement(InfoIcon, { className: "pf-u-ml-sm" }))))))))));
|
|
134
140
|
}
|
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.2
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Customer Support Manage App",
|
|
5
5
|
"author": "Jordan Eudy <jeudy100@gmail.com>",
|
|
6
6
|
"homepage": "",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
],
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"@cee-eng/hydrajs": "4.12.7",
|
|
55
|
-
"@patternfly/patternfly": "4.
|
|
55
|
+
"@patternfly/patternfly": "4.196.7",
|
|
56
56
|
"@patternfly/pfe-accordion": "1.12.3",
|
|
57
57
|
"@patternfly/pfe-collapse": "1.12.3",
|
|
58
58
|
"@patternfly/pfe-tabs": "1.12.3",
|
|
@@ -89,19 +89,19 @@
|
|
|
89
89
|
},
|
|
90
90
|
"dependencies": {
|
|
91
91
|
"@cee-eng/hydrajs": "4.12.7",
|
|
92
|
-
"@patternfly/patternfly": "4.
|
|
92
|
+
"@patternfly/patternfly": "4.196.7",
|
|
93
93
|
"@patternfly/pfe-accordion": "1.12.3",
|
|
94
94
|
"@patternfly/pfe-collapse": "1.12.3",
|
|
95
95
|
"@patternfly/pfe-tabs": "1.12.3",
|
|
96
96
|
"@patternfly/react-core": "4.202.16",
|
|
97
97
|
"@patternfly/react-table": "4.71.16",
|
|
98
98
|
"@rh-support/api": "0.3.25",
|
|
99
|
-
"@rh-support/components": "1.1.
|
|
99
|
+
"@rh-support/components": "1.1.81",
|
|
100
100
|
"@rh-support/configs": "0.2.5",
|
|
101
|
-
"@rh-support/react-context": "0.
|
|
101
|
+
"@rh-support/react-context": "0.3.1",
|
|
102
102
|
"@rh-support/types": "0.2.0",
|
|
103
|
-
"@rh-support/user-permissions": "0.2.
|
|
104
|
-
"@rh-support/utils": "0.2.
|
|
103
|
+
"@rh-support/user-permissions": "0.2.65",
|
|
104
|
+
"@rh-support/utils": "0.2.48",
|
|
105
105
|
"@types/react-beautiful-dnd": "^13.0.0",
|
|
106
106
|
"i18next": ">=17.0.1",
|
|
107
107
|
"lodash": ">=4.17.15",
|
|
@@ -111,5 +111,5 @@
|
|
|
111
111
|
"react-i18next": ">=10.11.0",
|
|
112
112
|
"react-router-dom": ">=5.1.2"
|
|
113
113
|
},
|
|
114
|
-
"gitHead": "
|
|
114
|
+
"gitHead": "e4bbdcf60f5ca9c6427a3655a7d264680c692b37"
|
|
115
115
|
}
|