@rh-support/manage 0.3.0 → 0.3.3
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/ManageTabs.d.ts.map +1 -1
- package/lib/esm/ManageTabs.js +10 -12
- package/lib/esm/components/Groups/ManageGroupUsers/ManageGroupUsers.d.ts.map +1 -1
- package/lib/esm/components/Groups/ManageGroupUsers/ManageGroupUsers.js +3 -3
- package/lib/esm/components/ManageBookmarkedAccountsTab/AddEditBookmarkModal.js +6 -6
- package/lib/esm/components/ManageBookmarkedAccountsTab/ManageBookmarkedAccountsTab.d.ts.map +1 -1
- package/lib/esm/components/ManageBookmarkedAccountsTab/ManageBookmarkedAccountsTab.js +4 -5
- package/lib/esm/components/ManageBookmarkedAccountsTab/ManageGroupedBookmarkedAccountsTab.d.ts.map +1 -1
- package/lib/esm/components/ManageBookmarkedAccountsTab/ManageGroupedBookmarkedAccountsTab.js +4 -6
- 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 +5 -5
- package/lib/esm/components/NotificationEmails/index.js +3 -3
- package/lib/esm/reducers/TopContentHelpers.d.ts.map +1 -1
- package/lib/esm/reducers/TopContentHelpers.js +1 -2
- package/lib/esm/scss/_main.scss +8 -0
- package/package.json +9 -11
- package/lib/esm/components/ManageBookmarkedAccountsTab/ManageBookmarkedAccountsTabWrapper.d.ts +0 -2
- package/lib/esm/components/ManageBookmarkedAccountsTab/ManageBookmarkedAccountsTabWrapper.d.ts.map +0 -1
- package/lib/esm/components/ManageBookmarkedAccountsTab/ManageBookmarkedAccountsTabWrapper.js +0 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManageTabs.d.ts","sourceRoot":"","sources":["../../src/ManageTabs.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAsBvD,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,EAAE,CAAC,CAAC;CACvC;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ManageTabs.d.ts","sourceRoot":"","sources":["../../src/ManageTabs.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAsBvD,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,EAAE,CAAC,CAAC;CACvC;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,eAmJvC"}
|
package/lib/esm/ManageTabs.js
CHANGED
|
@@ -25,7 +25,6 @@ export function ManageTabs(props) {
|
|
|
25
25
|
const { groupsRoute, bookmarkedAccountsRoute, topContentRoute, notificationEmailsRoute, preferencesRoute, configsRoute, } = Routes.getPaths();
|
|
26
26
|
const { globalMetadataState: { pcmConfig }, } = useContext(GlobalMetadataStateContext);
|
|
27
27
|
const isGroupBookmarkEnabled = getConfigField(pcmConfig.data, 'isGroupBookmarkEnabled', PCM_CONFIG_FIELD_TYPE.FEATURE_FLAG);
|
|
28
|
-
const isPreferencesPageEnabled = getConfigField(pcmConfig.data, 'allowPreferencesPage', PCM_CONFIG_FIELD_TYPE.FEATURE_FLAG);
|
|
29
28
|
// Changes route and saves the current path to the url query params
|
|
30
29
|
const isOnlyBasePath = history.location.pathname === Routes.basePath;
|
|
31
30
|
useDocumentTitle(PageTitle.MANAGE);
|
|
@@ -75,17 +74,16 @@ export function ManageTabs(props) {
|
|
|
75
74
|
},
|
|
76
75
|
component: React.createElement(NotificationEmails, null),
|
|
77
76
|
});
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
});
|
|
77
|
+
tabsToRender.push({
|
|
78
|
+
title: 'Preferences',
|
|
79
|
+
key: 'preferences-tab',
|
|
80
|
+
'data-tracking-id': 'preferences-tab',
|
|
81
|
+
routePath: preferencesRoute,
|
|
82
|
+
onClick: () => {
|
|
83
|
+
changeRouteThunk(preferencesRoute);
|
|
84
|
+
},
|
|
85
|
+
component: React.createElement(ManagePreferences, null),
|
|
86
|
+
});
|
|
89
87
|
canViewManageTopContent &&
|
|
90
88
|
tabsToRender.push({
|
|
91
89
|
title: 'Top content',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManageGroupUsers.d.ts","sourceRoot":"","sources":["../../../../../src/components/Groups/ManageGroupUsers/ManageGroupUsers.tsx"],"names":[],"mappings":"AAsBA,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"ManageGroupUsers.d.ts","sourceRoot":"","sources":["../../../../../src/components/Groups/ManageGroupUsers/ManageGroupUsers.tsx"],"names":[],"mappings":"AAsBA,eAAO,MAAM,gBAAgB,mBAkM5B,CAAC"}
|
|
@@ -8,7 +8,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { publicApi } from '@cee-eng/hydrajs';
|
|
11
|
-
import {
|
|
11
|
+
import { SearchInput } from '@patternfly/react-core';
|
|
12
|
+
import { AlertMessage, AlertType, ErrorBoundary, ToastNotification, useFetch, usePrevious, } from '@rh-support/components';
|
|
12
13
|
import { useGlobalStateContext } from '@rh-support/react-context';
|
|
13
14
|
import isEmpty from 'lodash/isEmpty';
|
|
14
15
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
@@ -104,7 +105,6 @@ export const ManageGroupUsers = () => {
|
|
|
104
105
|
];
|
|
105
106
|
// filter out search query.
|
|
106
107
|
const [userSearch, setUserSearch] = useState('');
|
|
107
|
-
const onGroupUserSearch = (input) => setUserSearch(input);
|
|
108
108
|
const previousUserSearch = usePrevious(userSearch);
|
|
109
109
|
useEffect(() => {
|
|
110
110
|
if (userSearch === previousUserSearch)
|
|
@@ -140,7 +140,7 @@ export const ManageGroupUsers = () => {
|
|
|
140
140
|
React.createElement("span", { className: "toolbar-right" },
|
|
141
141
|
React.createElement("label", { htmlFor: "account-group-filter" },
|
|
142
142
|
React.createElement(Trans, null, "Filter by")),
|
|
143
|
-
React.createElement(
|
|
143
|
+
React.createElement(SearchInput, { className: "pf-u-flex-grow-1 pf-c-search-input pf-u-background-color-100", id: "account-group-filter", value: userSearch, isDisabled: isFetching || !selectedGroup, onChange: setUserSearch, placeholder: t('Search for people in this group'), "aria-label": "Group search input", onClear: () => setUserSearch('') }))),
|
|
144
144
|
React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading group users list') } },
|
|
145
145
|
React.createElement(ManageTable, { ariaLabel: t('Table to manage groups'), columns: columns, data: data, sortInfo: { column: 'first-name', direction: 'asc' }, isFetching: isFetching, isError: false }))));
|
|
146
146
|
};
|
|
@@ -12,8 +12,9 @@ export const AddEditBookmarkModal = (props) => {
|
|
|
12
12
|
const [saveButtonIsClicked, setSaveButtonIsClicked] = useState(false);
|
|
13
13
|
// only check if save button has been clicked once
|
|
14
14
|
const checkIsInvalid = (group, selectedAccounts) => {
|
|
15
|
-
const isInvalid = isEmpty(group) || selectedAccounts.length === 0;
|
|
15
|
+
const isInvalid = isEmpty(group === null || group === void 0 ? void 0 : group.trim()) || selectedAccounts.length === 0;
|
|
16
16
|
setIsInValid(isInvalid);
|
|
17
|
+
return isInValid;
|
|
17
18
|
};
|
|
18
19
|
const resetModal = () => {
|
|
19
20
|
setIsInValid(false);
|
|
@@ -21,12 +22,11 @@ export const AddEditBookmarkModal = (props) => {
|
|
|
21
22
|
};
|
|
22
23
|
const save = () => {
|
|
23
24
|
setSaveButtonIsClicked(true);
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
if (isInvalid)
|
|
25
|
+
const isBookmarkInvalid = checkIsInvalid(selectedGroup, localSelectedBookmarks);
|
|
26
|
+
if (isBookmarkInvalid)
|
|
27
27
|
return;
|
|
28
28
|
resetModal();
|
|
29
|
-
props.onSave(localSelectedBookmarks, selectedGroup);
|
|
29
|
+
props.onSave(localSelectedBookmarks, selectedGroup === null || selectedGroup === void 0 ? void 0 : selectedGroup.trim());
|
|
30
30
|
};
|
|
31
31
|
const remove = () => {
|
|
32
32
|
props.onRemove(selectedGroup);
|
|
@@ -70,5 +70,5 @@ export const AddEditBookmarkModal = (props) => {
|
|
|
70
70
|
React.createElement(Trans, null, "Account(s)"),
|
|
71
71
|
React.createElement("span", { className: "form-required", "aria-hidden": true }, "*")),
|
|
72
72
|
React.createElement(BookmarkAccountSelector, { defaultSelected: props.selectedAccounts, labelId: "add-bookmark-account-on-add-modal", bookmarkedGroupAccounts: props.bookmarkedGroupAccounts, onBookMarkAccountSelected: onBookMarkAccountSelected, addMode: props.addMode, isInValid: isInValid && isEmpty(localSelectedBookmarks) })),
|
|
73
|
-
React.createElement(BookmarkGroupSelector, { selectedGroup: selectedGroup, groups: props.groups, onGroupInputBoxChanged: onGroupInputBoxChanged, isInValid: isInValid && isEmpty(selectedGroup) }))));
|
|
73
|
+
React.createElement(BookmarkGroupSelector, { selectedGroup: selectedGroup, groups: props.groups, onGroupInputBoxChanged: onGroupInputBoxChanged, isInValid: isInValid && isEmpty(selectedGroup === null || selectedGroup === void 0 ? void 0 : selectedGroup.trim()) }))));
|
|
74
74
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManageBookmarkedAccountsTab.d.ts","sourceRoot":"","sources":["../../../../src/components/ManageBookmarkedAccountsTab/ManageBookmarkedAccountsTab.tsx"],"names":[],"mappings":"AAYA,UAAU,MAAM;IACZ,yBAAyB,EAAE,OAAO,CAAC;CACtC;AAED,wBAAgB,2BAA2B,CAAC,EAAE,yBAAyB,EAAE,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ManageBookmarkedAccountsTab.d.ts","sourceRoot":"","sources":["../../../../src/components/ManageBookmarkedAccountsTab/ManageBookmarkedAccountsTab.tsx"],"names":[],"mappings":"AAYA,UAAU,MAAM;IACZ,yBAAyB,EAAE,OAAO,CAAC;CACtC;AAED,wBAAgB,2BAA2B,CAAC,EAAE,yBAAyB,EAAE,EAAE,MAAM,eAkIhF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AlertVariant } from '@patternfly/react-core';
|
|
2
|
-
import { defaultTableSortMethod, ErrorBoundary
|
|
1
|
+
import { AlertVariant, SearchInput } from '@patternfly/react-core';
|
|
2
|
+
import { defaultTableSortMethod, ErrorBoundary } from '@rh-support/components';
|
|
3
3
|
import { AccountSelectorInternal, AddRemoveBookmark, useGlobalStateContext } from '@rh-support/react-context';
|
|
4
4
|
import { ability, CaseListFields, resourceActions, resources } from '@rh-support/user-permissions';
|
|
5
5
|
import isArray from 'lodash/isArray';
|
|
@@ -13,8 +13,7 @@ export function ManageBookmarkedAccountsTab({ canManageBookmarkAccounts }) {
|
|
|
13
13
|
const { globalMetadataState: { bookmarkedAccounts, loggedInUser }, } = useGlobalStateContext();
|
|
14
14
|
const _bookmarkedAccounts = bookmarkedAccounts.data || [];
|
|
15
15
|
const [accountToBookmark, setAccountToBookmark] = useState(null);
|
|
16
|
-
const [searchString, setSearchString] = useState(
|
|
17
|
-
const onSearchSubmit = (str) => setSearchString(str);
|
|
16
|
+
const [searchString, setSearchString] = useState('');
|
|
18
17
|
let accounts = _bookmarkedAccounts;
|
|
19
18
|
if (!isEmpty(searchString)) {
|
|
20
19
|
accounts = accounts.filter((account) => account.name.toLowerCase().includes(searchString.toLowerCase()) ||
|
|
@@ -73,7 +72,7 @@ export function ManageBookmarkedAccountsTab({ canManageBookmarkAccounts }) {
|
|
|
73
72
|
React.createElement("div", { className: "toolbar-right" },
|
|
74
73
|
React.createElement("label", { htmlFor: "search-bookmark-account-selector" },
|
|
75
74
|
React.createElement(Trans, null, "Filter by")),
|
|
76
|
-
React.createElement(
|
|
75
|
+
React.createElement(SearchInput, { className: "pf-u-flex-grow-1 pf-c-search-input pf-u-background-color-100", value: searchString, id: "search-bookmark-account-selector", placeholder: t('Search for a bookmark'), "aria-label": t('Bookmarked accounts search input'), onChange: setSearchString, onClear: () => setSearchString('') }))),
|
|
77
76
|
React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading bookmarked accounts list') } },
|
|
78
77
|
React.createElement(ManageTable, { ariaLabel: t('Table to manage bookmarks'), columns: columns, data: accounts, sortInfo: { column: 'account-name', direction: 'asc' }, errorVariant: AlertVariant.warning, isFetching: bookmarkedAccounts.isFetching || loggedInUser.isFetching, isError: bookmarkedAccounts.isError, errorTitle: t('Bookmarked accounts error'), errorComponent: React.createElement(Trans, null, "Could not get bookmarked accounts") }))));
|
|
79
78
|
}
|
package/lib/esm/components/ManageBookmarkedAccountsTab/ManageGroupedBookmarkedAccountsTab.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManageGroupedBookmarkedAccountsTab.d.ts","sourceRoot":"","sources":["../../../../src/components/ManageBookmarkedAccountsTab/ManageGroupedBookmarkedAccountsTab.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ManageGroupedBookmarkedAccountsTab.d.ts","sourceRoot":"","sources":["../../../../src/components/ManageBookmarkedAccountsTab/ManageGroupedBookmarkedAccountsTab.tsx"],"names":[],"mappings":"AAyCA,UAAU,MAAM;IACZ,yBAAyB,EAAE,OAAO,CAAC;CACtC;AAED,wBAAgB,kCAAkC,CAAC,EAAE,yBAAyB,EAAE,EAAE,MAAM,eA4XvF"}
|
package/lib/esm/components/ManageBookmarkedAccountsTab/ManageGroupedBookmarkedAccountsTab.js
CHANGED
|
@@ -7,9 +7,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { AlertVariant, Button, ButtonVariant, Label, LabelGroup, Popover, PopoverPosition, } from '@patternfly/react-core';
|
|
11
|
-
import
|
|
12
|
-
import { defaultTableSortMethod, ErrorBoundary, Input, ToastNotification, useConfirmation, } from '@rh-support/components';
|
|
10
|
+
import { AlertVariant, Button, ButtonVariant, Label, LabelGroup, Popover, PopoverPosition, SearchInput, } from '@patternfly/react-core';
|
|
11
|
+
import { defaultTableSortMethod, ErrorBoundary, ToastNotification, useConfirmation, } from '@rh-support/components';
|
|
13
12
|
import { addEditbookmarks, getBookmarkGroups, removeGroupedBookmarks, removeWholeGroup, useGlobalDispatchContext, useGlobalStateContext, useGroupedBookmarkApiCalls, } from '@rh-support/react-context';
|
|
14
13
|
import { ability, CaseListFields, resourceActions, resources } from '@rh-support/user-permissions';
|
|
15
14
|
import { promiseReflection } from '@rh-support/utils';
|
|
@@ -29,7 +28,7 @@ export function ManageGroupedBookmarkedAccountsTab({ canManageBookmarkAccounts }
|
|
|
29
28
|
const dispatchGlobalContext = useGlobalDispatchContext();
|
|
30
29
|
const confirmation = useConfirmation();
|
|
31
30
|
const apiCalls = useGroupedBookmarkApiCalls(loggedInUser.data.ssoUsername, bookmarkedGroupIds);
|
|
32
|
-
const [searchString, setSearchString] = useState(
|
|
31
|
+
const [searchString, setSearchString] = useState('');
|
|
33
32
|
const bookmarkedAccounts = bookmarkedGroupAccounts.data || [];
|
|
34
33
|
const allGroups = groupBy(bookmarkedAccounts, 'bookmarkGroupName');
|
|
35
34
|
let groupNames = Object.keys(allGroups);
|
|
@@ -43,7 +42,6 @@ export function ManageGroupedBookmarkedAccountsTab({ canManageBookmarkAccounts }
|
|
|
43
42
|
groupNames = groupNames.filter((group) => group.toLowerCase().includes(searchString.toLowerCase()));
|
|
44
43
|
}
|
|
45
44
|
const groups = getBookmarkGroups(bookmarkedGroupAccounts.data);
|
|
46
|
-
const onSearchSubmit = (str) => setSearchString(str);
|
|
47
45
|
const canBookmarkAccounts = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.BOOKMARK_ACCOUNTS);
|
|
48
46
|
const resetModal = () => {
|
|
49
47
|
setIsInAddMode(true);
|
|
@@ -257,7 +255,7 @@ export function ManageGroupedBookmarkedAccountsTab({ canManageBookmarkAccounts }
|
|
|
257
255
|
React.createElement("div", { className: "toolbar-right" },
|
|
258
256
|
React.createElement("label", { htmlFor: "search-bookmark-account-selector" },
|
|
259
257
|
React.createElement(Trans, null, "Filter by")),
|
|
260
|
-
React.createElement(
|
|
258
|
+
React.createElement(SearchInput, { className: "pf-u-flex-grow-1 pf-c-search-input pf-u-background-color-100", value: searchString, id: "search-bookmark-account-selector", placeholder: t('Search for a bookmark'), "aria-label": t('Filter by searching for a bookmark'), onChange: setSearchString, onClear: () => setSearchString('') }))),
|
|
261
259
|
React.createElement(AddEditBookmarkModal, { selectedAccounts: isInAddMode ? localSelectedAccounts : editGroupSelectedAccounts, groups: groups, isOpen: isUpdateBookmarkModalOpen, onSave: onAddEditBookmarksSave, onClose: closeAddEditBookmarkModal, onRemove: removeGroup, bookmarkedGroupAccounts: bookmarkedGroupAccounts.data, addMode: isInAddMode, title: isInAddMode ? t('Create or add to an existing bookmark') : t('Edit bookmark') }),
|
|
262
260
|
React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading bookmarked accounts list') } },
|
|
263
261
|
React.createElement(ManageTable, { ariaLabel: t('Table to manage bookmarks'), columns: columns, data: groupNames, sortInfo: { column: 'bookmark-group-name', direction: 'asc' }, errorVariant: AlertVariant.warning, isFetching: bookmarkedGroupAccounts.isFetching ||
|
|
@@ -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":"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,eA2KhD"}
|
|
@@ -114,10 +114,6 @@ export function PreferencesCaseView(props) {
|
|
|
114
114
|
}
|
|
115
115
|
});
|
|
116
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.';
|
|
117
|
-
const hostnameLabelTooltip = (React.createElement(React.Fragment, null,
|
|
118
|
-
React.createElement("label", null, "Share hostnames"),
|
|
119
|
-
React.createElement(Tooltip, { content: prefHostnameCopy, position: "right" },
|
|
120
|
-
React.createElement(InfoIcon, { className: "pf-u-ml-sm" }))));
|
|
121
117
|
return (React.createElement(Card, { className: "preference-card" },
|
|
122
118
|
React.createElement(CardHeader, null,
|
|
123
119
|
React.createElement("h3", null,
|
|
@@ -136,5 +132,9 @@ export function PreferencesCaseView(props) {
|
|
|
136
132
|
canUseHostName && (React.createElement("div", { className: "form-group" },
|
|
137
133
|
React.createElement("label", { htmlFor: "share-hostnames-switch" },
|
|
138
134
|
React.createElement(Trans, null, "Case information")),
|
|
139
|
-
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" }))))))))));
|
|
140
140
|
}
|
|
@@ -8,8 +8,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { customEmail } from '@cee-eng/hydrajs';
|
|
11
|
-
import { AlertVariant, Button, ButtonVariant, SearchInput } from '@patternfly/react-core';
|
|
12
|
-
import {
|
|
11
|
+
import { AlertVariant, Button, ButtonVariant, SearchInput, TextInput } from '@patternfly/react-core';
|
|
12
|
+
import { ToastNotification, useConfirmation } from '@rh-support/components';
|
|
13
13
|
import { fetchAccountCustomEmails, setAccountCustomEmails, useGlobalDispatchContext, useGlobalStateContext, } from '@rh-support/react-context';
|
|
14
14
|
import isEmpty from 'lodash/isEmpty';
|
|
15
15
|
import React, { useEffect, useState } from 'react';
|
|
@@ -162,7 +162,7 @@ export function NotificationEmails() {
|
|
|
162
162
|
React.createElement("div", { className: "toolbar" },
|
|
163
163
|
React.createElement("div", { className: "toolbar-left" },
|
|
164
164
|
React.createElement("label", { htmlFor: "notification-emails-input" }, "Add an Email"),
|
|
165
|
-
React.createElement(
|
|
165
|
+
React.createElement(TextInput, { id: "notification-email-input", placeholder: t('Enter a valid email address'), "aria-label": t('Enter a valid email address'), onChange: onEmailInputBoxChange }),
|
|
166
166
|
React.createElement("span", { className: "pf-u-ml-sm" },
|
|
167
167
|
React.createElement(Button, { variant: ButtonVariant.primary, isInline: true, onClick: addEmail, "data-tracking-id": "email-address-add-button", isDisabled: isAddButtonDisabled },
|
|
168
168
|
React.createElement(Trans, null, "Add")))),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopContentHelpers.d.ts","sourceRoot":"","sources":["../../../src/reducers/TopContentHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,iCAAiC,EAEpC,MAAM,2DAA2D,CAAC;
|
|
1
|
+
{"version":3,"file":"TopContentHelpers.d.ts","sourceRoot":"","sources":["../../../src/reducers/TopContentHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,iCAAiC,EAEpC,MAAM,2DAA2D,CAAC;AAKnE,OAAO,EAAE,oBAAoB,EAAwB,MAAM,qBAAqB,CAAC;AAEjF,eAAO,MAAM,gBAAgB,eAAgB,MAAM,WASlD,CAAC;AAEF,eAAO,MAAM,cAAc,6BAe1B,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB,eACb,oBAAoB,EAAE,iBACnB,iCAAiC,mBAC/B,MAAM,2BAqC1B,CAAC;AAEF,eAAO,MAAM,cAAc,oBAAqB,MAAM,KAAG,OAExD,CAAC"}
|
|
@@ -9,8 +9,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
import { getAccessHostname } from '@rh-support/
|
|
13
|
-
import { addDaysToDate, isFutureDate, outlier } from '@rh-support/utils';
|
|
12
|
+
import { addDaysToDate, getAccessHostname, isFutureDate, outlier } from '@rh-support/utils';
|
|
14
13
|
import isEmpty from 'lodash/isEmpty';
|
|
15
14
|
export const getTopContentUrl = (contentUrl) => {
|
|
16
15
|
// There is some data urls (e.g. /solutions/articles/etc.) that aren't valid urls
|
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.3",
|
|
4
4
|
"description": "Customer Support Manage App",
|
|
5
5
|
"author": "Jordan Eudy <jeudy100@gmail.com>",
|
|
6
6
|
"homepage": "",
|
|
@@ -52,13 +52,12 @@
|
|
|
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",
|
|
59
59
|
"@patternfly/react-core": "4.202.16",
|
|
60
60
|
"@patternfly/react-table": "4.71.16",
|
|
61
|
-
"@rh-support/api": "0.3.9",
|
|
62
61
|
"@rh-support/components": "^0.1.3",
|
|
63
62
|
"@rh-support/react-context": "^0.1.3",
|
|
64
63
|
"@rh-support/types": "^0.1.3",
|
|
@@ -89,19 +88,18 @@
|
|
|
89
88
|
},
|
|
90
89
|
"dependencies": {
|
|
91
90
|
"@cee-eng/hydrajs": "4.12.7",
|
|
92
|
-
"@patternfly/patternfly": "4.
|
|
91
|
+
"@patternfly/patternfly": "4.196.7",
|
|
93
92
|
"@patternfly/pfe-accordion": "1.12.3",
|
|
94
93
|
"@patternfly/pfe-collapse": "1.12.3",
|
|
95
94
|
"@patternfly/pfe-tabs": "1.12.3",
|
|
96
95
|
"@patternfly/react-core": "4.202.16",
|
|
97
96
|
"@patternfly/react-table": "4.71.16",
|
|
98
|
-
"@rh-support/
|
|
99
|
-
"@rh-support/
|
|
100
|
-
"@rh-support/
|
|
101
|
-
"@rh-support/react-context": "0.3.0",
|
|
97
|
+
"@rh-support/components": "1.1.82",
|
|
98
|
+
"@rh-support/configs": "0.2.8",
|
|
99
|
+
"@rh-support/react-context": "0.3.2",
|
|
102
100
|
"@rh-support/types": "0.2.0",
|
|
103
|
-
"@rh-support/user-permissions": "0.2.
|
|
104
|
-
"@rh-support/utils": "0.2.
|
|
101
|
+
"@rh-support/user-permissions": "0.2.66",
|
|
102
|
+
"@rh-support/utils": "0.2.49",
|
|
105
103
|
"@types/react-beautiful-dnd": "^13.0.0",
|
|
106
104
|
"i18next": ">=17.0.1",
|
|
107
105
|
"lodash": ">=4.17.15",
|
|
@@ -111,5 +109,5 @@
|
|
|
111
109
|
"react-i18next": ">=10.11.0",
|
|
112
110
|
"react-router-dom": ">=5.1.2"
|
|
113
111
|
},
|
|
114
|
-
"gitHead": "
|
|
112
|
+
"gitHead": "f69fb5ac2a9d8561d300a9e7f02456268d1e2fc7"
|
|
115
113
|
}
|
package/lib/esm/components/ManageBookmarkedAccountsTab/ManageBookmarkedAccountsTabWrapper.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ManageBookmarkedAccountsTabWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/ManageBookmarkedAccountsTab/ManageBookmarkedAccountsTabWrapper.tsx"],"names":[],"mappings":"AAOA,wBAAgB,kCAAkC,CAAC,KAAK,KAAA,eAoBvD"}
|
package/lib/esm/components/ManageBookmarkedAccountsTab/ManageBookmarkedAccountsTabWrapper.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { useGlobalStateContext } from '@rh-support/react-context';
|
|
2
|
-
import { getConfigField, PCM_CONFIG_FIELD_TYPE } from '@rh-support/utils';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { ManageBookmarkedAccountsTab } from './ManageBookmarkedAccountsTab';
|
|
5
|
-
import { ManageGroupedBookmarkedAccountsTab } from './ManageGroupedBookmarkedAccountsTab';
|
|
6
|
-
export function ManageBookmarkedAccountsTabWrapper(props) {
|
|
7
|
-
const { globalMetadataState: { pcmConfig }, } = useGlobalStateContext();
|
|
8
|
-
const isGroupBookmarkEnabled = getConfigField(pcmConfig.data, 'isGroupBookmarkEnabled', PCM_CONFIG_FIELD_TYPE.FEATURE_FLAG);
|
|
9
|
-
return (React.createElement(React.Fragment, null, isGroupBookmarkEnabled ? (React.createElement(ManageGroupedBookmarkedAccountsTab, Object.assign({}, props))) : (React.createElement(ManageBookmarkedAccountsTab, Object.assign({}, props)))));
|
|
10
|
-
}
|