@rh-support/manage 2.1.82 → 2.1.83
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/Manage.d.ts.map +1 -1
- package/lib/esm/Manage.js +4 -3
- package/lib/esm/ManageTabs.d.ts +1 -0
- package/lib/esm/ManageTabs.d.ts.map +1 -1
- package/lib/esm/ManageTabs.js +33 -39
- package/lib/esm/Routes.js +9 -9
- package/lib/esm/components/Configs/ConfigsTable.js +1 -1
- package/lib/esm/components/Groups/ManageGroupUsers/ManageGroupUsers.js +1 -1
- package/lib/esm/components/ManageBookmarkedAccountsTab/ManageGroupedBookmarkedAccountsTab.js +1 -1
- package/lib/esm/components/ManagePartnerships/index.js +1 -1
- package/lib/esm/components/ManagePreferences/ManagePreferences.d.ts.map +1 -1
- package/lib/esm/components/ManagePreferences/ManagePreferences.js +1 -2
- package/lib/esm/components/ManagePreferences/PreferencesBody.js +1 -1
- package/lib/esm/components/NotificationEmails/index.js +1 -1
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentEditor.js +1 -1
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentSuggestion/TopContentSuggestion.d.ts +1 -0
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentSuggestion/TopContentSuggestion.d.ts.map +1 -1
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentSuggestion/TopContentSuggestion.js +35 -10
- package/lib/esm/components/TopContentManagement/TopContentManagement.d.ts.map +1 -1
- package/lib/esm/components/TopContentManagement/TopContentManagement.js +3 -4
- package/lib/esm/reducers/TopContentReducer.d.ts +1 -1
- package/lib/esm/reducers/TopContentReducer.d.ts.map +1 -1
- package/lib/esm/scss/_main.scss +20 -12
- package/lib/esm/scss/index.scss +2 -2
- package/package.json +9 -7
- package/lib/esm/ManageTab.d.ts +0 -10
- package/lib/esm/ManageTab.d.ts.map +0 -1
- package/lib/esm/ManageTab.js +0 -22
package/lib/esm/Manage.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Manage.d.ts","sourceRoot":"","sources":["../../src/Manage.tsx"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;AAI3B,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC1D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,
|
|
1
|
+
{"version":3,"file":"Manage.d.ts","sourceRoot":"","sources":["../../src/Manage.tsx"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;AAI3B,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC1D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAS,mBAAmB,EAAU,MAAM,kBAAkB,CAAC;AAItE,MAAM,WAAW,qBAAqB;CAAG;AACzC,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,qBAAqB,CAAC,CAAC;IACvD,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM;QACZ,SAAS,EAAE,GAAG,CAAC;QACf,oBAAoB,EAAE,GAAG,CAAC;QAC1B,MAAM,EAAE,GAAG,CAAC;QACZ,KAAK,EAAE,GAAG,CAAC;QACX,aAAa,EAAE;YACX,cAAc,EAAE,MAAM,CAAC;YACvB,OAAO,EAAE,MAAM,CAAC;SACnB,CAAC;KACL;IAED,UAAU,QAAQ;QACd,YAAY,EAAE,GAAG,CAAC;KACrB;IAED,UAAU,GAAG,CAAC;QACV,UAAU,iBAAkB,SAAQ,QAAQ;SAAG;KAClD;CACJ;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,qBAYnC"}
|
package/lib/esm/Manage.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import './scss/index.scss';
|
|
2
2
|
import { ConfirmationServiceProvider } from '@rh-support/components';
|
|
3
3
|
import React from 'react';
|
|
4
|
+
import { Route, Switch } from 'react-router-dom';
|
|
4
5
|
import { ManageTabs } from './ManageTabs';
|
|
5
|
-
import { Routes } from './Routes';
|
|
6
6
|
export function Manage(props) {
|
|
7
|
-
Routes.basePath = props.basePath;
|
|
8
7
|
return (React.createElement("div", { id: "rh-support-manage" },
|
|
9
8
|
React.createElement(ConfirmationServiceProvider, null,
|
|
10
|
-
React.createElement(
|
|
9
|
+
React.createElement(Switch, null,
|
|
10
|
+
React.createElement(Route, { path: `${props.basePath}/:activeTab?` },
|
|
11
|
+
React.createElement(ManageTabs, { routeProps: props.routeProps, basePath: props.basePath }))))));
|
|
11
12
|
}
|
package/lib/esm/ManageTabs.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManageTabs.d.ts","sourceRoot":"","sources":["../../src/ManageTabs.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ManageTabs.d.ts","sourceRoot":"","sources":["../../src/ManageTabs.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,mBAAmB,EAAa,MAAM,kBAAkB,CAAC;AAYlE,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,EAAE,CAAC,CAAC;IACpC,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,qBA8KvC"}
|
package/lib/esm/ManageTabs.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { Tab, TabContent, Tabs, TabsComponent, TabTitleText } from '@patternfly/react-core';
|
|
1
2
|
import { ErrorBoundary, useDocumentTitle } from '@rh-support/components';
|
|
2
3
|
import { ability, CaseDetailsFields, resourceActions, resources } from '@rh-support/user-permissions';
|
|
3
4
|
import map from 'lodash/map';
|
|
4
|
-
import React from 'react';
|
|
5
|
+
import React, { useState } from 'react';
|
|
6
|
+
import { Trans, useTranslation } from 'react-i18next';
|
|
7
|
+
import { useParams } from 'react-router-dom';
|
|
5
8
|
import { ConfigsTable } from './components/Configs/ConfigsTable';
|
|
6
9
|
import { ManageGroupUsers } from './components/Groups/ManageGroupUsers';
|
|
7
10
|
import { ManageGroupedBookmarkedAccountsTab } from './components/ManageBookmarkedAccountsTab';
|
|
@@ -10,19 +13,14 @@ import { ManagePreferences } from './components/ManagePreferences';
|
|
|
10
13
|
import { NotificationEmails } from './components/NotificationEmails/index';
|
|
11
14
|
import { TopContentManagement } from './components/TopContentManagement';
|
|
12
15
|
import { PageTitle } from './constants/pageTitle';
|
|
13
|
-
import { ManageTab } from './ManageTab';
|
|
14
16
|
import { Routes } from './Routes';
|
|
15
17
|
export function ManageTabs(props) {
|
|
16
18
|
var _a, _b;
|
|
17
|
-
const
|
|
19
|
+
const [activeTabKey, setActiveTabKey] = useState(0);
|
|
20
|
+
const { activeTab } = useParams();
|
|
21
|
+
const { t } = useTranslation();
|
|
18
22
|
const { groupsRoute, bookmarkedAccountsRoute, topContentRoute, notificationEmailsRoute, preferencesRoute, configsRoute, partnershipsRoute, } = Routes.getPaths();
|
|
19
|
-
// Changes route and saves the current path to the url query params
|
|
20
|
-
const isOnlyBasePath = history.location.pathname === Routes.basePath;
|
|
21
23
|
useDocumentTitle(PageTitle.MANAGE);
|
|
22
|
-
const changeRouteThunk = (route) => {
|
|
23
|
-
// add last selected manage tab to session storage
|
|
24
|
-
history.push(route);
|
|
25
|
-
};
|
|
26
24
|
const canViewManageTab = ability.can(resourceActions.READ, resources.MANAGE);
|
|
27
25
|
const canViewManageTopContent = ability.can(resourceActions.READ, resources.TOP_CONTENT) && canViewManageTab;
|
|
28
26
|
const canViewCaseGroups = ability.can(resourceActions.READ, resources.CASE_GROUPS) && canViewManageTab;
|
|
@@ -38,10 +36,8 @@ export function ManageTabs(props) {
|
|
|
38
36
|
key: 'bookmarked-accounts-tab',
|
|
39
37
|
'data-tracking-id': 'manage-bookmarks-tab',
|
|
40
38
|
routePath: bookmarkedAccountsRoute,
|
|
41
|
-
onClick: () => {
|
|
42
|
-
changeRouteThunk(bookmarkedAccountsRoute);
|
|
43
|
-
},
|
|
44
39
|
component: React.createElement(ManageGroupedBookmarkedAccountsTab, { canManageBookmarkAccounts: canManageBookmarkAccounts }),
|
|
40
|
+
id: 'manage-bookmarked-accounts',
|
|
45
41
|
});
|
|
46
42
|
canViewCaseGroups &&
|
|
47
43
|
tabsToRender.push({
|
|
@@ -49,10 +45,8 @@ export function ManageTabs(props) {
|
|
|
49
45
|
key: 'groups-tab',
|
|
50
46
|
routePath: groupsRoute,
|
|
51
47
|
'data-tracking-id': 'manage-groups-tab',
|
|
52
|
-
onClick: () => {
|
|
53
|
-
changeRouteThunk(groupsRoute);
|
|
54
|
-
},
|
|
55
48
|
component: React.createElement(ManageGroupUsers, null),
|
|
49
|
+
id: 'manage-groups',
|
|
56
50
|
});
|
|
57
51
|
canViewEmailNotificationTab &&
|
|
58
52
|
canAddCustomNotification &&
|
|
@@ -61,10 +55,8 @@ export function ManageTabs(props) {
|
|
|
61
55
|
key: 'notification-emails-tab',
|
|
62
56
|
'data-tracking-id': 'notification-emails-tab',
|
|
63
57
|
routePath: notificationEmailsRoute,
|
|
64
|
-
onClick: () => {
|
|
65
|
-
changeRouteThunk(notificationEmailsRoute);
|
|
66
|
-
},
|
|
67
58
|
component: React.createElement(NotificationEmails, null),
|
|
59
|
+
id: 'notification-emails',
|
|
68
60
|
});
|
|
69
61
|
canViewPartnershipsTab &&
|
|
70
62
|
tabsToRender.push({
|
|
@@ -72,20 +64,16 @@ export function ManageTabs(props) {
|
|
|
72
64
|
key: 'partnerships-tab',
|
|
73
65
|
'data-tracking-id': 'partnerships-tab',
|
|
74
66
|
routePath: partnershipsRoute,
|
|
75
|
-
onClick: () => {
|
|
76
|
-
changeRouteThunk(partnershipsRoute);
|
|
77
|
-
},
|
|
78
67
|
component: React.createElement(ManagePartnerships, null),
|
|
68
|
+
id: 'partnerships',
|
|
79
69
|
});
|
|
80
70
|
tabsToRender.push({
|
|
81
71
|
title: 'Preferences',
|
|
82
72
|
key: 'preferences-tab',
|
|
83
73
|
'data-tracking-id': 'preferences-tab',
|
|
84
74
|
routePath: preferencesRoute,
|
|
85
|
-
onClick: () => {
|
|
86
|
-
changeRouteThunk(preferencesRoute);
|
|
87
|
-
},
|
|
88
75
|
component: React.createElement(ManagePreferences, null),
|
|
76
|
+
id: 'preferences-body',
|
|
89
77
|
});
|
|
90
78
|
canViewManageTopContent &&
|
|
91
79
|
tabsToRender.push({
|
|
@@ -93,10 +81,8 @@ export function ManageTabs(props) {
|
|
|
93
81
|
key: 'top-content-tab',
|
|
94
82
|
'data-tracking-id': 'manage-top-content-tab',
|
|
95
83
|
routePath: topContentRoute,
|
|
96
|
-
onClick: () => {
|
|
97
|
-
changeRouteThunk(topContentRoute);
|
|
98
|
-
},
|
|
99
84
|
component: React.createElement(TopContentManagement, null),
|
|
85
|
+
id: 'manage-top-content',
|
|
100
86
|
});
|
|
101
87
|
canViewConfigsTab &&
|
|
102
88
|
tabsToRender.push({
|
|
@@ -104,27 +90,35 @@ export function ManageTabs(props) {
|
|
|
104
90
|
key: 'pcm-internal-configs-tab',
|
|
105
91
|
'data-tracking-id': 'pcm-config-admin-tab',
|
|
106
92
|
routePath: configsRoute,
|
|
107
|
-
onClick: () => {
|
|
108
|
-
changeRouteThunk(configsRoute);
|
|
109
|
-
},
|
|
110
93
|
component: React.createElement(ConfigsTable, null),
|
|
94
|
+
id: 'internal-config',
|
|
111
95
|
});
|
|
96
|
+
const getActiveTabKey = () => {
|
|
97
|
+
if (!activeTab)
|
|
98
|
+
return activeTabKey;
|
|
99
|
+
const tabIndex = tabsToRender.findIndex((item) => item.routePath === activeTab);
|
|
100
|
+
return tabIndex > -1 ? tabIndex : activeTabKey;
|
|
101
|
+
};
|
|
102
|
+
// Toggle currently active tab
|
|
103
|
+
const handleTabClick = (event, tabIndex) => {
|
|
104
|
+
setActiveTabKey(tabIndex);
|
|
105
|
+
};
|
|
112
106
|
/**
|
|
113
107
|
* Render without tabs if there is only one element
|
|
114
108
|
*/
|
|
115
109
|
if (tabsToRender.length === 1)
|
|
116
110
|
return (React.createElement("div", { className: "grid-main manage" },
|
|
117
111
|
React.createElement(ErrorBoundary, { isPageLevelError: true }, (_b = (_a = tabsToRender[0]) === null || _a === void 0 ? void 0 : _a.component) !== null && _b !== void 0 ? _b : React.createElement(React.Fragment, null))));
|
|
118
|
-
// To get selected index
|
|
119
|
-
const getSelectedIndex = () => {
|
|
120
|
-
if (isOnlyBasePath)
|
|
121
|
-
return 0;
|
|
122
|
-
const tabIndex = tabsToRender.findIndex((tab) => tab.routePath === history.location.pathname.substring(0, tab.routePath.length));
|
|
123
|
-
return tabIndex > -1 ? tabIndex : 0;
|
|
124
|
-
};
|
|
125
112
|
/**
|
|
126
113
|
* Render array with tabs
|
|
127
114
|
*/
|
|
128
|
-
return (React.createElement("div", { className: "grid-main manage" },
|
|
129
|
-
React.createElement(
|
|
115
|
+
return (React.createElement("div", { className: "grid-main manage", role: "region", style: { display: 'flex' } },
|
|
116
|
+
React.createElement(Tabs, { activeKey: getActiveTabKey(), onSelect: handleTabClick, "aria-label": t('Manage tabs'), component: TabsComponent.nav, isVertical: true, style: { width: 'auto' } }, map(tabsToRender, (tab, index) => (React.createElement(Tab, { eventKey: index, tabContentRef: tab.ref, tabContentId: `pf-tab-${index}-${tab.title.split(' ')[0]}-tabpanel`, title: React.createElement(TabTitleText, null,
|
|
117
|
+
React.createElement(Trans, null, tab.title)), "data-tracking-id": tab['data-tracking-id'], key: tab.title, href: `#${props.basePath}/${tab.routePath}` })))),
|
|
118
|
+
map(tabsToRender, (tab, index) => {
|
|
119
|
+
return index === getActiveTabKey() ? (React.createElement(TabContent, { activeKey: getActiveTabKey(), id: tab.id, "aria-label": tab.title },
|
|
120
|
+
React.createElement(ErrorBoundary, { errorMsgInfo: {
|
|
121
|
+
message: t('There was an error loading manage tab. Please try refreshing the page.'),
|
|
122
|
+
}, isPageLevelError: true }, tab.component))) : (React.createElement(React.Fragment, null));
|
|
123
|
+
})));
|
|
130
124
|
}
|
package/lib/esm/Routes.js
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
1
1
|
export const Routes = {
|
|
2
2
|
basePath: '',
|
|
3
3
|
groups: {
|
|
4
|
-
path: '
|
|
4
|
+
path: 'groups',
|
|
5
5
|
getPath() {
|
|
6
6
|
return getPath(this);
|
|
7
7
|
},
|
|
8
8
|
},
|
|
9
9
|
bookmarkedAccounts: {
|
|
10
|
-
path: '
|
|
10
|
+
path: 'bookmarks',
|
|
11
11
|
getPath() {
|
|
12
12
|
return getPath(this);
|
|
13
13
|
},
|
|
14
14
|
},
|
|
15
15
|
fileDiagnostics: {
|
|
16
|
-
path: '
|
|
16
|
+
path: 'file-diagnostics',
|
|
17
17
|
getPath() {
|
|
18
18
|
return getPath(this);
|
|
19
19
|
},
|
|
20
20
|
},
|
|
21
21
|
savedSearches: {
|
|
22
|
-
path: '
|
|
22
|
+
path: 'saved-searches',
|
|
23
23
|
getPath() {
|
|
24
24
|
return getPath(this);
|
|
25
25
|
},
|
|
26
26
|
},
|
|
27
27
|
topContent: {
|
|
28
|
-
path: '
|
|
28
|
+
path: 'top-content',
|
|
29
29
|
getPath() {
|
|
30
30
|
return getPath(this);
|
|
31
31
|
},
|
|
32
32
|
},
|
|
33
33
|
preferences: {
|
|
34
|
-
path: '
|
|
34
|
+
path: 'preferences',
|
|
35
35
|
getPath() {
|
|
36
36
|
return getPath(this);
|
|
37
37
|
},
|
|
38
38
|
},
|
|
39
39
|
partnerships: {
|
|
40
|
-
path: '
|
|
40
|
+
path: 'partnerships',
|
|
41
41
|
getPath() {
|
|
42
42
|
return getPath(this);
|
|
43
43
|
},
|
|
44
44
|
},
|
|
45
45
|
notificationEmails: {
|
|
46
|
-
path: '
|
|
46
|
+
path: 'notification-emails',
|
|
47
47
|
getPath() {
|
|
48
48
|
return getPath(this);
|
|
49
49
|
},
|
|
50
50
|
},
|
|
51
51
|
configs: {
|
|
52
|
-
path: '
|
|
52
|
+
path: 'configs',
|
|
53
53
|
getPath() {
|
|
54
54
|
return getPath(this);
|
|
55
55
|
},
|
|
@@ -112,7 +112,7 @@ export const ConfigsTable = () => {
|
|
|
112
112
|
setFilteredValues(configValues);
|
|
113
113
|
}
|
|
114
114
|
}, [searchString, configValues]);
|
|
115
|
-
return (React.createElement(
|
|
115
|
+
return (React.createElement(React.Fragment, null,
|
|
116
116
|
React.createElement("header", null,
|
|
117
117
|
React.createElement("h2", null, "Internal app configs"),
|
|
118
118
|
"Edit app configs that used as flags or other settings here."),
|
|
@@ -129,7 +129,7 @@ export const ManageGroupUsers = () => {
|
|
|
129
129
|
setAllData(response || []);
|
|
130
130
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
131
131
|
}, [location.pathname]);
|
|
132
|
-
return (React.createElement(
|
|
132
|
+
return (React.createElement(React.Fragment, null,
|
|
133
133
|
React.createElement(AlertMessage, { variant: AlertType.INFO, show: loggedInUserRights.data.isOrgAdmin() && !loggedInUsersAccount.data.hasGroupACLs, isInline: true, className: "pf-v5-u-mb-md", title: t("Case Group Access Control Lists (ACLs) haven't been activated on your account.") },
|
|
134
134
|
React.createElement("p", null,
|
|
135
135
|
React.createElement(Trans, { i18nKey: "i18nRequestControl" },
|
package/lib/esm/components/ManageBookmarkedAccountsTab/ManageGroupedBookmarkedAccountsTab.js
CHANGED
|
@@ -245,7 +245,7 @@ export function ManageGroupedBookmarkedAccountsTab({ canManageBookmarkAccounts }
|
|
|
245
245
|
};
|
|
246
246
|
if (!canManageBookmarkAccounts)
|
|
247
247
|
return null;
|
|
248
|
-
return (React.createElement(
|
|
248
|
+
return (React.createElement(React.Fragment, null,
|
|
249
249
|
React.createElement("header", null,
|
|
250
250
|
React.createElement("h2", null, t('Bookmarks')),
|
|
251
251
|
React.createElement("p", null,
|
|
@@ -12,7 +12,7 @@ export function ManagePartnerships() {
|
|
|
12
12
|
const { t } = useTranslation();
|
|
13
13
|
const { globalMetadataState: { loggedInUserRights }, } = useGlobalStateContext();
|
|
14
14
|
return (React.createElement(React.Fragment, null,
|
|
15
|
-
React.createElement("header", { className: "pf-v5-u-
|
|
15
|
+
React.createElement("header", { className: "pf-v5-u-mb-xs" },
|
|
16
16
|
React.createElement("h2", null,
|
|
17
17
|
React.createElement(Trans, null, "Partnerships")),
|
|
18
18
|
React.createElement("p", null, loggedInUserRights.data.isPartner() ? (React.createElement(Trans, null, "Add, edit, or remove partnerships and manage your collaboration requests")) : (React.createElement(React.Fragment, null, loggedInUserRights.data.isCustomerOrgAdmin() ? (React.createElement(Trans, null, "Confirm, filter, or remove partnerships and manage collaboration requests.")) : (React.createElement(Trans, null, "Filter or remove partnerships and manage collaboration requests.")))))),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManagePreferences.d.ts","sourceRoot":"","sources":["../../../../src/components/ManagePreferences/ManagePreferences.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,UAAU,MAAM;CAAG;AAEnB,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ManagePreferences.d.ts","sourceRoot":"","sources":["../../../../src/components/ManagePreferences/ManagePreferences.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,UAAU,MAAM;CAAG;AAEnB,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,qBAE9C"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Preferences } from './Preferences';
|
|
3
3
|
export function ManagePreferences(props) {
|
|
4
|
-
return
|
|
5
|
-
React.createElement(Preferences, null)));
|
|
4
|
+
return React.createElement(Preferences, null);
|
|
6
5
|
}
|
|
@@ -3,7 +3,7 @@ import { PreferencesCaseCreate } from './sections/PreferencesCaseCreate';
|
|
|
3
3
|
import { PreferencesCaseSearch } from './sections/PreferencesCaseSearch';
|
|
4
4
|
import { PreferencesCaseView } from './sections/PreferencesCaseView';
|
|
5
5
|
export function PreferencesBody(props) {
|
|
6
|
-
return (React.createElement("
|
|
6
|
+
return (React.createElement("div", { className: "pfe-l-grid pfe-m-gutters pfe-m-all-4-col" },
|
|
7
7
|
React.createElement(PreferencesCaseSearch, null),
|
|
8
8
|
React.createElement(PreferencesCaseView, null),
|
|
9
9
|
React.createElement(PreferencesCaseCreate, null)));
|
|
@@ -155,7 +155,7 @@ export function NotificationEmails() {
|
|
|
155
155
|
setIsAddingNotificationEmail(true);
|
|
156
156
|
editEmail({ firstName: '', lastName: '', email: emailToAdd });
|
|
157
157
|
};
|
|
158
|
-
return (React.createElement(
|
|
158
|
+
return (React.createElement(React.Fragment, null,
|
|
159
159
|
React.createElement("header", null,
|
|
160
160
|
React.createElement("h2", null, t('Notification emails')),
|
|
161
161
|
t('Add, edit or remove emails from your account that were added to receive notifications.')),
|
|
@@ -115,7 +115,7 @@ export function TopContentEditor() {
|
|
|
115
115
|
React.createElement(TopContentProductVersionSelector, { selectedProduct: selectedProduct, selectedVersion: selectedVersion, onProductChange: onProductChange, onVersionChange: onVersionChange }),
|
|
116
116
|
!topContentResponse.isFetching && (React.createElement(TopContentSearch, { dataTrackingId: "top-content-filter-manage", topContentData: flagContentEditState, onSearch: onSearch, topContentResultsWrapperRef: topContentResultsRef, searchQuery: searchQuery, setSearchQuery: setSearchQuery })),
|
|
117
117
|
React.createElement("div", { className: "top-content-manage-wrapper pf-v5-u-pt-md" },
|
|
118
|
-
!topContentResponse.isFetching &&
|
|
118
|
+
!topContentResponse.isFetching && React.createElement(TopContentSuggestion, { searchQuery: searchQuery }),
|
|
119
119
|
topContentResponse.isFetching ? (React.createElement(Bullseye, null,
|
|
120
120
|
React.createElement(EmptyState, { variant: EmptyStateVariant.full },
|
|
121
121
|
React.createElement(Spinner, { size: "lg" })))) : (!topContentResponse.isFetching &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopContentSuggestion.d.ts","sourceRoot":"","sources":["../../../../../../src/components/TopContentManagement/TopContentEditor/TopContentSuggestion/TopContentSuggestion.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TopContentSuggestion.d.ts","sourceRoot":"","sources":["../../../../../../src/components/TopContentManagement/TopContentEditor/TopContentSuggestion/TopContentSuggestion.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAE,EAAE,EAAwC,MAAM,OAAO,CAAC;AAWxE,UAAU,MAAM;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,MAAM,CA8E3C,CAAC"}
|
|
@@ -1,30 +1,55 @@
|
|
|
1
1
|
import { ExpandableSection, Panel, PanelMain, PanelMainBody, Title } from '@patternfly/react-core';
|
|
2
|
+
import { useSearchDocument } from '@rh-support/components';
|
|
2
3
|
import isEmpty from 'lodash/isEmpty';
|
|
3
|
-
import
|
|
4
|
+
import Mark from 'mark.js';
|
|
5
|
+
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
4
6
|
import { Trans } from 'react-i18next';
|
|
5
7
|
import { useTopContentContext, useTopContentDispatchContext } from '../../../../context/TopContentProvider';
|
|
6
|
-
import { fetchTopContentSuggestions } from '../../../../reducers/TopContentReducer';
|
|
8
|
+
import { fetchTopContentSuggestions, } from '../../../../reducers/TopContentReducer';
|
|
7
9
|
import { TopContentSuggestionHint } from './TopContentSuggestionHint';
|
|
8
|
-
export const TopContentSuggestion = () => {
|
|
9
|
-
var _a;
|
|
10
|
+
export const TopContentSuggestion = ({ searchQuery = '' }) => {
|
|
10
11
|
const [isExpanded, setExpanded] = useState(false);
|
|
12
|
+
const ref = useRef(null);
|
|
11
13
|
const onToggle = () => setExpanded((previousExpandedState) => !previousExpandedState);
|
|
12
14
|
const { selectedProduct, selectedVersion, suggestion, topContentResponse } = useTopContentContext();
|
|
13
15
|
const topContentDispatch = useTopContentDispatchContext();
|
|
14
|
-
const topContent = topContentResponse.data.reduce((ret, category) => {
|
|
16
|
+
const topContent = useMemo(() => topContentResponse.data.reduce((ret, category) => {
|
|
15
17
|
return [...ret, ...category.content];
|
|
16
|
-
}, []);
|
|
17
|
-
const filteredSuggestion = (
|
|
18
|
+
}, []), [topContentResponse.data]);
|
|
19
|
+
const filteredSuggestion = useMemo(() => {
|
|
20
|
+
var _a;
|
|
21
|
+
return (_a = suggestion.linkedResources) === null || _a === void 0 ? void 0 : _a.filter((resource) => !topContent.some((content) => content.contentUrl === resource.resourceViewUri));
|
|
22
|
+
}, [suggestion.linkedResources, topContent]);
|
|
18
23
|
useEffect(() => {
|
|
19
24
|
if ((selectedProduct === null || selectedProduct === void 0 ? void 0 : selectedProduct.name) && selectedVersion) {
|
|
20
25
|
fetchTopContentSuggestions(topContentDispatch, selectedProduct.name, selectedVersion);
|
|
21
26
|
}
|
|
22
27
|
}, [topContentDispatch, selectedProduct, selectedVersion]);
|
|
23
|
-
|
|
28
|
+
const searchedContent = useSearchDocument(filteredSuggestion || [], searchQuery, {
|
|
29
|
+
indexKey: 'id',
|
|
30
|
+
strategy: (doc) => doc.resourceTitle,
|
|
31
|
+
});
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
var _a;
|
|
34
|
+
if (ref.current == null)
|
|
35
|
+
return;
|
|
36
|
+
setExpanded(!isEmpty(searchQuery));
|
|
37
|
+
const containers = (_a = ref.current) === null || _a === void 0 ? void 0 : _a.querySelectorAll('div.pf-v5-c-card');
|
|
38
|
+
const markInstance = new Mark(containers);
|
|
39
|
+
markInstance.unmark({
|
|
40
|
+
done: () => {
|
|
41
|
+
if (isEmpty(searchQuery))
|
|
42
|
+
return;
|
|
43
|
+
markInstance.mark(searchQuery, { separateWordSearch: true });
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
}, [searchedContent, searchQuery]);
|
|
47
|
+
if (isEmpty(searchedContent))
|
|
24
48
|
return React.createElement(React.Fragment, null);
|
|
25
|
-
return (React.createElement(Panel, { variant: "raised", className: "pf-v5-u-mx-md pf-v5-u-p-md top-content-panel" },
|
|
49
|
+
return (React.createElement(Panel, { variant: "raised", className: "pf-v5-u-mx-md pf-v5-u-p-md top-content-panel", ref: ref },
|
|
26
50
|
React.createElement(PanelMain, null,
|
|
27
51
|
React.createElement(PanelMainBody, null,
|
|
28
52
|
React.createElement(ExpandableSection, { onToggle: onToggle, isExpanded: isExpanded, toggleContent: React.createElement(Title, { headingLevel: "h6", className: "accordion_title" },
|
|
29
|
-
React.createElement(Trans, null, " Suggested top content resources")), id: "top-content-suggestion" },
|
|
53
|
+
React.createElement(Trans, null, " Suggested top content resources")), id: "top-content-suggestion" }, !isEmpty(searchedContent) &&
|
|
54
|
+
(searchedContent === null || searchedContent === void 0 ? void 0 : searchedContent.map((resources) => (React.createElement(TopContentSuggestionHint, { key: resources.id, resources: resources })))))))));
|
|
30
55
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopContentManagement.d.ts","sourceRoot":"","sources":["../../../../src/components/TopContentManagement/TopContentManagement.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,UAAU,MAAM;CAAG;AAEnB,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"TopContentManagement.d.ts","sourceRoot":"","sources":["../../../../src/components/TopContentManagement/TopContentManagement.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,UAAU,MAAM;CAAG;AAEnB,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,qBAUjD"}
|
|
@@ -5,8 +5,7 @@ import { TopContentContextProvider } from '../../context/TopContentProvider';
|
|
|
5
5
|
import { TopContentEditor } from './TopContentEditor/TopContentEditor';
|
|
6
6
|
export function TopContentManagement(props) {
|
|
7
7
|
const { t } = useTranslation();
|
|
8
|
-
return (React.createElement(
|
|
9
|
-
React.createElement(
|
|
10
|
-
React.createElement(
|
|
11
|
-
React.createElement(TopContentEditor, null)))));
|
|
8
|
+
return (React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading suggestions') } },
|
|
9
|
+
React.createElement(TopContentContextProvider, null,
|
|
10
|
+
React.createElement(TopContentEditor, null))));
|
|
12
11
|
}
|
|
@@ -24,7 +24,7 @@ interface categoryDups {
|
|
|
24
24
|
export interface IContentUrlsDups {
|
|
25
25
|
[url: string]: categoryDups;
|
|
26
26
|
}
|
|
27
|
-
interface ITopContentSuggestionLinkedResources {
|
|
27
|
+
export interface ITopContentSuggestionLinkedResources {
|
|
28
28
|
id: number;
|
|
29
29
|
numberOfCaseLinked: number;
|
|
30
30
|
productName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopContentReducer.d.ts","sourceRoot":"","sources":["../../../src/reducers/TopContentReducer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,IAAI,aAAa,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAC7F,OAAO,EACH,WAAW,EAEX,mBAAmB,EACnB,eAAe,EAGf,iCAAiC,EAEpC,MAAM,2DAA2D,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAOxE,MAAM,WAAW,oBAAqB,SAAQ,WAAW;IACrD,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC;IAC1E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,oBAAoB,EAAE,CAAC;IAChC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED;;;;;;;EAOE;AACF,UAAU,YAAY;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,gBAAgB;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,CAAC;CAC/B;AAED,
|
|
1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AQ,CAAC,mBACjB,MAAM,4BACG,OAAO,cACrB,GAAG,qBACG,OAAO,mBAmE5B,CAAC;AAGF,eAAO,MAAM,mBAAmB,aAClB,6BAA6B,uBAClB,oBAAoB,EAAE,MACvC,MAAM,cACE,MAAM,WACT,oBAAoB,SACtB,MAAM,mBA0DhB,CAAC;AAGF,eAAO,MAAM,2BAA2B,aAC1B,6BAA6B,uBAClB,oBAAoB,EAAE,cAC/B,MAAM,WACT,oBAAoB,mBA4ChC,CAAC;AAGF,eAAO,MAAM,gBAAgB,aACf,6BAA6B,uBAClB,oBAAoB,EAAE,cAC/B,MAAM,mBA+BrB,CAAC;AAGF,eAAO,MAAM,iBAAiB,aAChB,6BAA6B,uBAClB,oBAAoB,EAAE,mBA2B9C,CAAC;AAEF,eAAO,MAAM,eAAe,aAAoB,6BAA6B,mBAwB5E,CAAC;AAEF,eAAO,MAAM,sBAAsB,aAAc,6BAA6B,uBAAuB,OAAO,SAK3G,CAAC;AAEF,eAAO,MAAM,iBAAiB,aAAc,6BAA6B,SAKxE,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,aACzB,6BAA6B,eAC1B,MAAM,WACV,MAAM,kBAsBlB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,aACzB,6BAA6B,cAC3B,qBAAqB,gBACnB,MAAM,mBAavB,CAAC"}
|
package/lib/esm/scss/_main.scss
CHANGED
|
@@ -121,10 +121,6 @@
|
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
.panels {
|
|
125
|
-
width: 100%;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
124
|
.create-category-link {
|
|
129
125
|
padding: 0;
|
|
130
126
|
}
|
|
@@ -133,14 +129,6 @@
|
|
|
133
129
|
margin-bottom: 1rem;
|
|
134
130
|
}
|
|
135
131
|
|
|
136
|
-
[role='tabpanel'] {
|
|
137
|
-
background-color: #fff !important;
|
|
138
|
-
|
|
139
|
-
& > * {
|
|
140
|
-
padding: 0 0.5rem 1rem;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
132
|
.table-wrapper {
|
|
145
133
|
margin-bottom: 2rem;
|
|
146
134
|
border: 1px solid #ccc;
|
|
@@ -176,6 +164,26 @@
|
|
|
176
164
|
}
|
|
177
165
|
}
|
|
178
166
|
}
|
|
167
|
+
.pf-v5-c-tabs__item {
|
|
168
|
+
white-space: nowrap;
|
|
169
|
+
a {
|
|
170
|
+
color: gray;
|
|
171
|
+
}
|
|
172
|
+
a:hover {
|
|
173
|
+
color: black;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.pf-v5-c-tabs__item.pf-m-current {
|
|
178
|
+
background-color: white;
|
|
179
|
+
a {
|
|
180
|
+
color: black;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.pf-v5-c-tab-content {
|
|
185
|
+
flex: 1;
|
|
186
|
+
}
|
|
179
187
|
}
|
|
180
188
|
|
|
181
189
|
#manage-top-content {
|
package/lib/esm/scss/index.scss
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/manage",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.83",
|
|
4
4
|
"description": "Customer Support Manage App",
|
|
5
5
|
"author": "Jordan Eudy <jeudy100@gmail.com>",
|
|
6
6
|
"license": "ISC",
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
"@patternfly/react-core": "5.1.1",
|
|
51
51
|
"@patternfly/react-table": "5.1.1",
|
|
52
52
|
"lodash": ">=4.17.15",
|
|
53
|
+
"mark.js": "^8.11.1",
|
|
53
54
|
"react": "18.2.0",
|
|
54
55
|
"react-dom": "18.2.0",
|
|
55
56
|
"react-i18next": "^12.3.1",
|
|
@@ -78,14 +79,15 @@
|
|
|
78
79
|
"@patternfly/patternfly": "5.1.0",
|
|
79
80
|
"@patternfly/react-core": "5.1.1",
|
|
80
81
|
"@patternfly/react-table": "5.1.1",
|
|
81
|
-
"@rh-support/components": "2.1.
|
|
82
|
+
"@rh-support/components": "2.1.62",
|
|
82
83
|
"@rh-support/configs": "2.0.19",
|
|
83
|
-
"@rh-support/react-context": "2.1.
|
|
84
|
-
"@rh-support/types": "2.0.
|
|
85
|
-
"@rh-support/user-permissions": "2.1.
|
|
86
|
-
"@rh-support/utils": "2.1.
|
|
84
|
+
"@rh-support/react-context": "2.1.70",
|
|
85
|
+
"@rh-support/types": "2.0.4",
|
|
86
|
+
"@rh-support/user-permissions": "2.1.45",
|
|
87
|
+
"@rh-support/utils": "2.1.34",
|
|
87
88
|
"@types/react-beautiful-dnd": "^13.0.0",
|
|
88
89
|
"lodash": ">=4.17.15",
|
|
90
|
+
"mark.js": "^8.11.1",
|
|
89
91
|
"react": "18.2.0",
|
|
90
92
|
"react-beautiful-dnd": "^13.0.0",
|
|
91
93
|
"react-dom": "18.2.0",
|
|
@@ -100,5 +102,5 @@
|
|
|
100
102
|
"defaults and supports es6-module",
|
|
101
103
|
"maintained node versions"
|
|
102
104
|
],
|
|
103
|
-
"gitHead": "
|
|
105
|
+
"gitHead": "ecb9820a2fe40793e79c0f9f4786ec657070fe64"
|
|
104
106
|
}
|
package/lib/esm/ManageTab.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ITabToRender } from '@rh-support/types/shared';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
interface IProps {
|
|
4
|
-
tab: ITabToRender<string>;
|
|
5
|
-
loadComponent: boolean;
|
|
6
|
-
tabIndex: number;
|
|
7
|
-
}
|
|
8
|
-
export declare function ManageTab(props: IProps): React.JSX.Element;
|
|
9
|
-
export {};
|
|
10
|
-
//# sourceMappingURL=ManageTab.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ManageTab.d.ts","sourceRoot":"","sources":["../../src/ManageTab.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,KAAoB,MAAM,OAAO,CAAC;AAEzC,UAAU,MAAM;IACZ,GAAG,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAC1B,aAAa,EAAE,OAAO,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,qBA+BtC"}
|
package/lib/esm/ManageTab.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ErrorBoundary } from '@rh-support/components';
|
|
2
|
-
import React, { useEffect } from 'react';
|
|
3
|
-
import { Trans, useTranslation } from 'react-i18next';
|
|
4
|
-
export function ManageTab(props) {
|
|
5
|
-
const tab = props.tab;
|
|
6
|
-
const { t } = useTranslation();
|
|
7
|
-
useEffect(() => {
|
|
8
|
-
if (!props.loadComponent)
|
|
9
|
-
return;
|
|
10
|
-
const tabPaneles = document.getElementsByTagName('pfe-tab-panel');
|
|
11
|
-
if (tabPaneles.length > 0 && tabPaneles[props.tabIndex])
|
|
12
|
-
tabPaneles[props.tabIndex].removeAttribute('hidden');
|
|
13
|
-
}, [props.loadComponent, props.tabIndex]);
|
|
14
|
-
return (React.createElement(React.Fragment, null,
|
|
15
|
-
React.createElement("pfe-tab", { role: "tab", slot: "tab", "data-tracking-id": tab['data-tracking-id'], onClick: tab.onClick },
|
|
16
|
-
React.createElement(Trans, null,
|
|
17
|
-
React.createElement("h2", null, tab.title))),
|
|
18
|
-
React.createElement("pfe-tab-panel", { role: "tabpanel", slot: "panel" },
|
|
19
|
-
React.createElement(ErrorBoundary, { errorMsgInfo: {
|
|
20
|
-
message: t('There was an error loading manage tab. Please try refreshing the page.'),
|
|
21
|
-
}, isPageLevelError: true }, props.loadComponent && tab.component))));
|
|
22
|
-
}
|