@rh-support/manage 2.5.0 → 2.5.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/Groups/ManageGroupUsers/ManageGroupUsers.d.ts.map +1 -1
- package/lib/esm/components/Groups/ManageGroupUsers/ManageGroupUsers.js +11 -9
- package/lib/esm/components/ManageExpiredContents/ExpiredContentCategory.js +1 -1
- package/lib/esm/components/ManagePreferences/PreferencesBody.d.ts.map +1 -1
- package/lib/esm/components/ManagePreferences/PreferencesBody.js +5 -1
- package/lib/esm/components/ManagePreferences/sections/PreferencesACL.d.ts +3 -0
- package/lib/esm/components/ManagePreferences/sections/PreferencesACL.d.ts.map +1 -0
- package/lib/esm/components/ManagePreferences/sections/PreferencesACL.js +62 -0
- package/lib/esm/components/ManageTags/TagsManager.d.ts.map +1 -1
- package/lib/esm/components/ManageTags/TagsManager.js +2 -2
- package/lib/esm/components/TopContentManagement/NoTopContentFound.js +1 -1
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentComponent.js +1 -1
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/TopContentSingleItem.js +1 -1
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentEditor.d.ts.map +1 -1
- package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentEditor.js +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManageGroupUsers.d.ts","sourceRoot":"","sources":["../../../../../src/components/Groups/ManageGroupUsers/ManageGroupUsers.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAS5D,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"ManageGroupUsers.d.ts","sourceRoot":"","sources":["../../../../../src/components/Groups/ManageGroupUsers/ManageGroupUsers.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAS5D,eAAO,MAAM,gBAAgB,yBA4N5B,CAAC"}
|
|
@@ -14,7 +14,7 @@ import { useGlobalStateContext } from '@rh-support/react-context';
|
|
|
14
14
|
import isEmpty from 'lodash/isEmpty';
|
|
15
15
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
16
16
|
import { Trans, useTranslation } from 'react-i18next';
|
|
17
|
-
import { useLocation } from 'react-router-dom';
|
|
17
|
+
import { Link, useLocation } from 'react-router-dom';
|
|
18
18
|
import { ManageTable } from '../../ManageTable/ManageTable';
|
|
19
19
|
import { DefaultGroupSwitch } from '../DefualtGroupSwitch';
|
|
20
20
|
import { GroupSelect } from '../GroupSelect';
|
|
@@ -128,20 +128,22 @@ export const ManageGroupUsers = () => {
|
|
|
128
128
|
}
|
|
129
129
|
setAllData(response || []);
|
|
130
130
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
131
|
-
}, [location.pathname]);
|
|
131
|
+
}, [location.pathname, loggedInUsersAccount.data]);
|
|
132
132
|
return (React.createElement(React.Fragment, null,
|
|
133
|
-
React.createElement(AlertMessage, { variant: AlertType.INFO, show: loggedInUserRights.data.isOrgAdmin() && !loggedInUsersAccount.data.hasGroupACLs, isInline: true, className: "pf-v5-u-mb-md", title: t(
|
|
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 ACL is not activated') },
|
|
134
134
|
React.createElement("p", null,
|
|
135
135
|
React.createElement(Trans, { i18nKey: "i18nRequestControl" },
|
|
136
|
-
"
|
|
136
|
+
"To use case groups to limit user access, enable the",
|
|
137
137
|
' ',
|
|
138
|
-
React.createElement("a", { href: "https://access.redhat.com/
|
|
138
|
+
React.createElement("a", { href: "https://access.redhat.com/articles/170453", target: "_blank", rel: "noopener noreferrer" }, "Case Group Access Control Lists (ACL)"),
|
|
139
139
|
' ',
|
|
140
|
-
"
|
|
140
|
+
"under",
|
|
141
141
|
' ',
|
|
142
|
-
React.createElement(
|
|
143
|
-
|
|
144
|
-
|
|
142
|
+
React.createElement(Link, { key: "case-contact-phone-number-review", replace: true, to: {
|
|
143
|
+
pathname: '/manage/preferences',
|
|
144
|
+
}, "data-tracking-id": "case-contact-phone-number-review" }, "Preferences")),
|
|
145
|
+
React.createElement("br", null),
|
|
146
|
+
React.createElement(Trans, null, "You can organize and group related cases and filter on the case list page, but you cannot change permissions for case groups unless the Case Group ACL is enabled."))),
|
|
145
147
|
React.createElement("header", null,
|
|
146
148
|
React.createElement("h2", null, t('Groups')),
|
|
147
149
|
React.createElement("p", null, t('Add or edit groups to easily filter while searching through cases.'))),
|
|
@@ -27,5 +27,5 @@ export default function ExpiredContentCategory({ category, isCategoryExpanded =
|
|
|
27
27
|
React.createElement(AccordionToggle, { id: category.categoryName, onClick: toggleExpanded, isExpanded: isExpanded },
|
|
28
28
|
React.createElement("h3", null, category.categoryName)),
|
|
29
29
|
React.createElement(AccordionContent, { isHidden: !isExpanded },
|
|
30
|
-
React.createElement("ul", { className: "list-flat list-flushleft" },
|
|
30
|
+
React.createElement("ul", { className: "list-flat list-flushleft" }, sortedExpiredContents.map((content, i) => (React.createElement(ExpiredContentSingleItem, { key: content.topContentId, content: content, category: category }))))))) : (React.createElement(React.Fragment, null));
|
|
31
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreferencesBody.d.ts","sourceRoot":"","sources":["../../../../src/components/ManagePreferences/PreferencesBody.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PreferencesBody.d.ts","sourceRoot":"","sources":["../../../../src/components/ManagePreferences/PreferencesBody.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,UAAU,MAAM;CAAG;AAEnB,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,qBAa5C"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
import { useGlobalStateContext } from '@rh-support/react-context';
|
|
1
2
|
import React from 'react';
|
|
3
|
+
import { PreferencesACL } from './sections/PreferencesACL';
|
|
2
4
|
import { PreferencesCaseCreate } from './sections/PreferencesCaseCreate';
|
|
3
5
|
import { PreferencesCaseSearch } from './sections/PreferencesCaseSearch';
|
|
4
6
|
import { PreferencesCaseView } from './sections/PreferencesCaseView';
|
|
5
7
|
export function PreferencesBody(props) {
|
|
8
|
+
const { globalMetadataState: { loggedInUserRights }, } = useGlobalStateContext();
|
|
6
9
|
return (React.createElement("div", { className: "pfe-l-grid pfe-m-gutters pfe-m-all-4-col" },
|
|
7
10
|
React.createElement(PreferencesCaseSearch, null),
|
|
8
11
|
React.createElement(PreferencesCaseView, null),
|
|
9
|
-
React.createElement(PreferencesCaseCreate, null)
|
|
12
|
+
React.createElement(PreferencesCaseCreate, null),
|
|
13
|
+
loggedInUserRights.data.isOrgAdmin() && React.createElement(PreferencesACL, null)));
|
|
10
14
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PreferencesACL.d.ts","sourceRoot":"","sources":["../../../../../src/components/ManagePreferences/sections/PreferencesACL.tsx"],"names":[],"mappings":"AASA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAKpD,wBAAgB,cAAc,sBAyF7B"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { accounts } from '@cee-eng/hydrajs';
|
|
11
|
+
import { Card, CardBody, CardHeader, Spinner, Tooltip } from '@patternfly/react-core';
|
|
12
|
+
import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
|
|
13
|
+
import { useFetch } from '@rh-support/components';
|
|
14
|
+
import { fetchLoggedInUsersAccount, GlobalMetadataDispatchContext, GlobalMetadataStateContext, } from '@rh-support/react-context';
|
|
15
|
+
import React, { useContext, useState } from 'react';
|
|
16
|
+
import { Trans, useTranslation } from 'react-i18next';
|
|
17
|
+
import { PreferenceSwitch } from '../components/PreferenceSwitch';
|
|
18
|
+
export function PreferencesACL() {
|
|
19
|
+
var _a;
|
|
20
|
+
const { t } = useTranslation();
|
|
21
|
+
const { globalMetadataState: { loggedInUsersAccount, loggedInUserJwtToken }, } = useContext(GlobalMetadataStateContext);
|
|
22
|
+
const dispatchToGlobalMetadataReducer = useContext(GlobalMetadataDispatchContext);
|
|
23
|
+
const [isAclActivated, setIsAclActivated] = useState((_a = loggedInUsersAccount.data) === null || _a === void 0 ? void 0 : _a.hasGroupACLs);
|
|
24
|
+
const [isAclLoading, setIsAclLoading] = useState(false);
|
|
25
|
+
const { request: updateAcl } = useFetch(accounts.updateAcl);
|
|
26
|
+
const onAclSwitch = () => __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
try {
|
|
28
|
+
setIsAclLoading(true);
|
|
29
|
+
yield updateAcl(!isAclActivated, loggedInUsersAccount.data.accountNumber);
|
|
30
|
+
fetchLoggedInUsersAccount(dispatchToGlobalMetadataReducer, loggedInUserJwtToken, true);
|
|
31
|
+
setIsAclActivated(!isAclActivated);
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
console.log(error);
|
|
35
|
+
}
|
|
36
|
+
setIsAclLoading(false);
|
|
37
|
+
});
|
|
38
|
+
return (React.createElement(Card, { className: "preference-card" },
|
|
39
|
+
React.createElement(CardHeader, null,
|
|
40
|
+
React.createElement("h3", null,
|
|
41
|
+
React.createElement(Trans, null, "Case Group Access Control List"))),
|
|
42
|
+
React.createElement(CardBody, null,
|
|
43
|
+
React.createElement("form", null,
|
|
44
|
+
React.createElement("div", { className: "form-group" },
|
|
45
|
+
React.createElement("label", null,
|
|
46
|
+
React.createElement(Trans, null, "Enable Case Group ACL for my account")),
|
|
47
|
+
React.createElement("div", { className: "pf-v5-u-mt-sm" },
|
|
48
|
+
React.createElement(PreferenceSwitch, { className: "switches hostnameSwitch", id: "ACL-switch", label: 'Case Group ACL', isChecked: isAclActivated, onSwitchChange: onAclSwitch }),
|
|
49
|
+
React.createElement("div", { className: "prefhostnameTooltip" },
|
|
50
|
+
React.createElement(Tooltip, { content: t('This determines if the account is utilizing case group access controls'), position: "right" },
|
|
51
|
+
React.createElement(InfoCircleIcon, { className: "pf-v5-u-ml-sm" })),
|
|
52
|
+
isAclLoading && (React.createElement(Spinner, { size: "lg", className: "pf-v5-u-ml-sm hostnameSpinner", "aria-label": "Hostname loading" })))),
|
|
53
|
+
React.createElement("div", { className: "pf-v5-u-mt-lg" },
|
|
54
|
+
React.createElement("label", null,
|
|
55
|
+
React.createElement(Trans, null, "Related links")),
|
|
56
|
+
React.createElement("p", null,
|
|
57
|
+
React.createElement("a", { href: "https://access.redhat.com/solutions/777833", target: "_blank", rel: "noopener noreferrer" },
|
|
58
|
+
React.createElement(Trans, null, "What are Case Groups and how do I create one?")),
|
|
59
|
+
React.createElement("br", null),
|
|
60
|
+
React.createElement("a", { href: "https://access.redhat.com/articles/170453", target: "_blank", rel: "noopener noreferrer" },
|
|
61
|
+
React.createElement(Trans, null, "How to Use Case Group Access Control Lists (ACLs)")))))))));
|
|
62
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TagsManager.d.ts","sourceRoot":"","sources":["../../../../src/components/ManageTags/TagsManager.tsx"],"names":[],"mappings":"AA4BA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAOxE,MAAM,CAAC,OAAO,UAAU,WAAW,
|
|
1
|
+
{"version":3,"file":"TagsManager.d.ts","sourceRoot":"","sources":["../../../../src/components/ManageTags/TagsManager.tsx"],"names":[],"mappings":"AA4BA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAOxE,MAAM,CAAC,OAAO,UAAU,WAAW,sBAyYlC"}
|
|
@@ -245,9 +245,9 @@ export default function TagsManager() {
|
|
|
245
245
|
React.createElement("div", { className: "pf-v5-u-flex-grow-1" },
|
|
246
246
|
React.createElement(TextInputGroup, null,
|
|
247
247
|
React.createElement(TextInputGroupMain, { type: "text", id: "tag-search-input", placeholder: t('Search for a tag'), icon: React.createElement(SearchIcon, null), value: tagSearchTerm, onChange: (e, v) => setTagSearchTerm(v) }),
|
|
248
|
-
React.createElement(TextInputGroupUtilities, null,
|
|
248
|
+
!isEmpty(tagSearchTerm) && (React.createElement(TextInputGroupUtilities, null,
|
|
249
249
|
React.createElement(Button, { variant: "plain", onClick: onSearchClear, "aria-label": "Clear button and input" },
|
|
250
|
-
React.createElement(TimesIcon, null))))),
|
|
250
|
+
React.createElement(TimesIcon, null)))))),
|
|
251
251
|
React.createElement("span", { className: "pf-v5-u-ml-sm" },
|
|
252
252
|
React.createElement(Button, { variant: ButtonVariant.primary, isInline: true, onClick: () => {
|
|
253
253
|
setCreateTagModalOpen(true);
|
|
@@ -45,7 +45,7 @@ export function NoTopContentFound({ version, product, dataLength, onAddCategory,
|
|
|
45
45
|
version)))));
|
|
46
46
|
const noContent = dataLength === 0 && !isContentOnlyForMajorVersion;
|
|
47
47
|
const noMinorButHaveMajorContent = dataLength !== 0 && isContentOnlyForMajorVersion;
|
|
48
|
-
return (React.createElement(EmptyState, { variant: EmptyStateVariant.xs },
|
|
48
|
+
return (React.createElement(EmptyState, { variant: EmptyStateVariant.xs, id: "no-content" },
|
|
49
49
|
React.createElement(EmptyStateHeader, { titleText: React.createElement(React.Fragment, null, isEmpty(product) || isEmpty(version) ? (React.createElement(Trans, null, "No top content found")) : isRegularVersion(version) && isNumber(version.split('.')[1]) && dataLength === 0 ? (React.createElement(Trans, null,
|
|
50
50
|
"No content available for ",
|
|
51
51
|
version,
|
|
@@ -55,7 +55,7 @@ export const TopContentComponent = (props) => {
|
|
|
55
55
|
React.createElement(Trans, null, "Cancel"))))));
|
|
56
56
|
return (React.createElement("div", null,
|
|
57
57
|
React.createElement(Droppable, { droppableId: `${props.category.id}`, type: `drop-inner-${props.category.id}`, isDropDisabled: !isArrangingContent, key: `drop-inner-${props.category.id}` }, (provided) => (React.createElement("div", { ref: provided.innerRef },
|
|
58
|
-
React.createElement("ul", { "aria-label": t('Content list'), className: "list-flat list-flushleft" },
|
|
58
|
+
React.createElement("ul", { id: "content-list", "aria-label": t('Content list'), className: "list-flat list-flushleft" },
|
|
59
59
|
props.category.content.map((content, i) => (React.createElement(Draggable, { key: `drag-inner-${i}${props.category.id}`, draggableId: `drag-inner-${i}${props.category.id}`, index: i, isDragDisabled: !isArrangingContent }, (provided, snapshot) => (React.createElement("div", Object.assign({ key: `${i}-c`, "aria-label": t('Content'), ref: provided.innerRef }, provided.draggableProps, provided.dragHandleProps),
|
|
60
60
|
React.createElement(TopContentSingleItem, { isArrangingContent: isArrangingContent, category: props.category, snapshot: snapshot, i: i, key: content.topContentId })))))),
|
|
61
61
|
provided.placeholder),
|
|
@@ -391,7 +391,7 @@ export const TopContentSingleItem = ({ isArrangingContent, category, snapshot, i
|
|
|
391
391
|
React.createElement(Flex, { className: "pf-v5-u-my-lg" },
|
|
392
392
|
React.createElement(FlexItem, { flex: { default: 'flex_1' } },
|
|
393
393
|
React.createElement(FormGroup, { label: t('Tags') },
|
|
394
|
-
React.createElement("div", { className:
|
|
394
|
+
React.createElement("div", { className: `${isEmpty(tagOptions) ? 'menu-is-disabld' : ''}` },
|
|
395
395
|
React.createElement(TagsSelector, { tagOptions: tagOptions, onChange: handleLocalTagChange, selectedTags: localSelectedTags, placeholder: t('Select tags to improve discoverability'), id: "top-content-tag" })))),
|
|
396
396
|
React.createElement(FlexItem, null,
|
|
397
397
|
React.createElement(FormGroup, { label: t('Expiry date') },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopContentEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/TopContentManagement/TopContentEditor/TopContentEditor.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAA2D,MAAM,OAAO,CAAC;AAiChF,wBAAgB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"TopContentEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/TopContentManagement/TopContentEditor/TopContentEditor.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAA2D,MAAM,OAAO,CAAC;AAiChF,wBAAgB,gBAAgB,sBAqX/B"}
|
|
@@ -182,7 +182,7 @@ export function TopContentEditor() {
|
|
|
182
182
|
React.createElement("div", { className: "pf-v5-u-p-md" },
|
|
183
183
|
showSectionFooter && (React.createElement(React.Fragment, null,
|
|
184
184
|
isCategoryLimitReached && React.createElement(CategoryLimit, null),
|
|
185
|
-
React.createElement(Button, { variant: "primary", onClick: () => onAddCategory(isContentOnlyForMajorVersion, false, selectedVersion), isDisabled: isCategoryLimitReached, "data-tracking-id": "add-new-section-topcontent" },
|
|
185
|
+
React.createElement(Button, { variant: "primary", onClick: () => onAddCategory(isContentOnlyForMajorVersion, false, selectedVersion), isDisabled: isCategoryLimitReached, id: "add-new-section-topcontent", "data-tracking-id": "add-new-section-topcontent" },
|
|
186
186
|
React.createElement(Trans, null, "Add a new section")),
|
|
187
187
|
' ',
|
|
188
188
|
React.createElement(Button, { variant: "secondary", onClick: arrangeSection, isDisabled: flagContentEditState.length < 2 },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/manage",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.2",
|
|
4
4
|
"description": "Customer Support Manage App",
|
|
5
5
|
"author": "Jordan Eudy <jeudy100@gmail.com>",
|
|
6
6
|
"license": "ISC",
|
|
@@ -79,9 +79,9 @@
|
|
|
79
79
|
"@patternfly/patternfly": "5.4.0",
|
|
80
80
|
"@patternfly/react-core": "5.4.0",
|
|
81
81
|
"@patternfly/react-table": "5.4.0",
|
|
82
|
-
"@rh-support/components": "2.5.
|
|
82
|
+
"@rh-support/components": "2.5.1",
|
|
83
83
|
"@rh-support/configs": "2.0.21",
|
|
84
|
-
"@rh-support/react-context": "2.5.
|
|
84
|
+
"@rh-support/react-context": "2.5.1",
|
|
85
85
|
"@rh-support/types": "2.0.5",
|
|
86
86
|
"@rh-support/user-permissions": "2.5.0",
|
|
87
87
|
"@rh-support/utils": "2.5.0",
|
|
@@ -103,5 +103,5 @@
|
|
|
103
103
|
"defaults and supports es6-module",
|
|
104
104
|
"maintained node versions"
|
|
105
105
|
],
|
|
106
|
-
"gitHead": "
|
|
106
|
+
"gitHead": "ec31db4e147f912a3b6c50c8606a828e73affbf1"
|
|
107
107
|
}
|