@rh-support/manage 2.6.17 → 2.6.19
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 +6 -4
- package/lib/esm/components/ManagePreferences/sections/PreferencesCaseCreate.d.ts.map +1 -1
- package/lib/esm/components/ManagePreferences/sections/PreferencesCaseCreate.js +7 -3
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManageGroupUsers.d.ts","sourceRoot":"","sources":["../../../../../src/components/Groups/ManageGroupUsers/ManageGroupUsers.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ManageGroupUsers.d.ts","sourceRoot":"","sources":["../../../../../src/components/Groups/ManageGroupUsers/ManageGroupUsers.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAuC,MAAM,OAAO,CAAC;AA0C5D,eAAO,MAAM,gBAAgB,yBAgY5B,CAAC"}
|
|
@@ -7,7 +7,7 @@ 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 { Button, Modal, ModalBody, ModalFooter, ModalHeader, ModalVariant, SearchInput, Tooltip, } from '@patternfly/react-core';
|
|
10
|
+
import { Alert, AlertVariant, Button, Modal, ModalBody, ModalFooter, ModalHeader, ModalVariant, SearchInput, Tooltip, } from '@patternfly/react-core';
|
|
11
11
|
import { ErrorBoundary, ToastNotification, usePrevious } from '@rh-support/components';
|
|
12
12
|
import { GlobalMetadataReducerConstants, useGlobalDispatchContext, useGlobalStateContext, } from '@rh-support/react-context';
|
|
13
13
|
import { ability, resourceActions, resources } from '@rh-support/user-permissions';
|
|
@@ -274,9 +274,11 @@ export const ManageGroupUsers = () => {
|
|
|
274
274
|
React.createElement(ManageTable, { ariaLabel: t('Table to manage groups'), columns: columns, data: data, sortInfo: { column: 'first-name', direction: 'asc' }, isFetching: isFetching, isError: false, pagination: false })),
|
|
275
275
|
memberToRemove && (React.createElement(Modal, { variant: ModalVariant.small, isOpen: true, onClose: () => setMemberToRemove(null), "aria-label": t('Confirm removal') },
|
|
276
276
|
React.createElement(ModalHeader, { title: t('Remove member') }),
|
|
277
|
-
React.createElement(ModalBody, null,
|
|
278
|
-
|
|
279
|
-
|
|
277
|
+
React.createElement(ModalBody, null,
|
|
278
|
+
React.createElement("p", null, t('Are you sure you want to remove {{name}} from this group?', {
|
|
279
|
+
name: `${memberToRemove.firstName} ${memberToRemove.lastName}`,
|
|
280
|
+
})),
|
|
281
|
+
React.createElement(Alert, { className: "pf-v6-u-mt-md", isInline: true, isPlain: true, variant: AlertVariant.warning, component: "p", title: t('A user who owns a case will still have access to that case even if they are removed from the case group. Please assign a different owner to those cases if needed. If you need to change the owner of an archived case please open a ticket with Customer Service.') })),
|
|
280
282
|
React.createElement(ModalFooter, null,
|
|
281
283
|
React.createElement(Button, { variant: "danger", onClick: handleRemoveMember, isLoading: isRemovingMember, isDisabled: isRemovingMember }, t('Remove')),
|
|
282
284
|
React.createElement(Button, { variant: "link", onClick: () => setMemberToRemove(null), isDisabled: isRemovingMember }, t('Cancel'))))),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreferencesCaseCreate.d.ts","sourceRoot":"","sources":["../../../../../src/components/ManagePreferences/sections/PreferencesCaseCreate.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PreferencesCaseCreate.d.ts","sourceRoot":"","sources":["../../../../../src/components/ManagePreferences/sections/PreferencesCaseCreate.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAA2D,MAAM,OAAO,CAAC;AAkBhF,UAAU,MAAM;CAAG;AACnB,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,qBA4NlD"}
|
|
@@ -11,6 +11,7 @@ import { useApolloClient } from '@apollo/client/react';
|
|
|
11
11
|
import { Card, CardBody, CardHeader, SelectOption } from '@patternfly/react-core';
|
|
12
12
|
import { ToastNotification } from '@rh-support/components';
|
|
13
13
|
import { fetchCaseGroupsForAccount, fetchCaseGroupsForSSO, fetchLanguageMetadata, GlobalMetadataDispatchContext, GlobalMetadataReducerConstants, GlobalMetadataStateContext, } from '@rh-support/react-context';
|
|
14
|
+
import { ability, CaseListFields, resourceActions, resources } from '@rh-support/user-permissions';
|
|
14
15
|
import { haventLoadedMetadata, PreferredLanguages } from '@rh-support/utils';
|
|
15
16
|
import isEmpty from 'lodash/isEmpty';
|
|
16
17
|
import map from 'lodash/map';
|
|
@@ -86,6 +87,7 @@ export function PreferencesCaseCreate(props) {
|
|
|
86
87
|
const { getPreferredLanguage, updatePreferredLanguage } = useUserPreferences();
|
|
87
88
|
const preferredLangTitleId = 'preferred-language-select';
|
|
88
89
|
const defaultGroupTitleId = 'default-group-select';
|
|
90
|
+
const canAccessGroupsFilter = ability.can(resourceActions.PATCH, resources.CASE_LIST, CaseListFields.GROUPS_FILTER);
|
|
89
91
|
const getLanguageKey = (selection) => {
|
|
90
92
|
return languagesList.find((language) => language.label === selection);
|
|
91
93
|
};
|
|
@@ -142,6 +144,8 @@ export function PreferencesCaseCreate(props) {
|
|
|
142
144
|
}, [caseLanguages, apolloClient]);
|
|
143
145
|
useEffect(() => {
|
|
144
146
|
var _a;
|
|
147
|
+
if (!canAccessGroupsFilter)
|
|
148
|
+
return;
|
|
145
149
|
if (!salesforceAccountId || loggedInUser.isFetching || !contactId)
|
|
146
150
|
return;
|
|
147
151
|
if (hasFetchedCaseGroups.current)
|
|
@@ -154,7 +158,7 @@ export function PreferencesCaseCreate(props) {
|
|
|
154
158
|
fetchCaseGroupsForSSO(dispatchToGlobalMetadataReducer, apolloClient, salesforceAccountId, defaultCaseGroupId, loggedInContactId, loggedInIsOrgAdmin);
|
|
155
159
|
}
|
|
156
160
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
157
|
-
}, [salesforceAccountId, loggedInUser.isFetching, contactId, defaultCaseGroupId]);
|
|
161
|
+
}, [canAccessGroupsFilter, salesforceAccountId, loggedInUser.isFetching, contactId, defaultCaseGroupId]);
|
|
158
162
|
return (React.createElement(Card, { variant: "secondary", className: "preference-card" },
|
|
159
163
|
React.createElement(CardHeader, null,
|
|
160
164
|
React.createElement("h3", null,
|
|
@@ -165,6 +169,6 @@ export function PreferencesCaseCreate(props) {
|
|
|
165
169
|
React.createElement(PreferenceSelect, { label: t('i18nPreferredLanguage', 'Preferred case language'), id: preferredLangTitleId, onSelect: onPreferredLanguageSelect, selections: originalPreferredLanguage }, Object.keys(languagesList).map((option, index) => (React.createElement(SelectOption, { key: index, value: languagesList[index].label })))),
|
|
166
170
|
React.createElement("p", { className: "form-instructions" },
|
|
167
171
|
React.createElement(Trans, null, "Preferred language will impact future cases, not existing ones."))),
|
|
168
|
-
React.createElement("div", { className: "form-group" },
|
|
169
|
-
React.createElement(PreferenceSelect, { label: "Default group", id: defaultGroupTitleId, onSelect: onDefaultGroupSelect, selections: originalDefaultGroup }, [UNGROUPED_CASE_LABEL, ...groupList.map((group) => group.name)].map((name, index) => (React.createElement(SelectOption, { key: index, value: name })))))))));
|
|
172
|
+
canAccessGroupsFilter && (React.createElement("div", { className: "form-group" },
|
|
173
|
+
React.createElement(PreferenceSelect, { label: "Default group", id: defaultGroupTitleId, onSelect: onDefaultGroupSelect, selections: originalDefaultGroup }, [UNGROUPED_CASE_LABEL, ...groupList.map((group) => group.name)].map((name, index) => (React.createElement(SelectOption, { key: index, value: name }))))))))));
|
|
170
174
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/manage",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.19",
|
|
4
4
|
"description": "Customer Support Manage App",
|
|
5
5
|
"author": "Jordan Eudy <jeudy100@gmail.com>",
|
|
6
6
|
"license": "ISC",
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"react-router-dom": "^5.1.2"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@patternfly/react-styles": "
|
|
58
|
-
"@patternfly/react-tokens": "
|
|
57
|
+
"@patternfly/react-styles": "6.2.1",
|
|
58
|
+
"@patternfly/react-tokens": "6.2.1",
|
|
59
59
|
"@testing-library/jest-dom": "^6.2.0",
|
|
60
60
|
"@testing-library/react": "^14.1.2",
|
|
61
61
|
"@testing-library/user-event": "^14.5.1",
|
|
@@ -78,12 +78,12 @@
|
|
|
78
78
|
"@patternfly/patternfly": "6.2.1",
|
|
79
79
|
"@patternfly/react-core": "6.2.1",
|
|
80
80
|
"@patternfly/react-table": "6.2.1",
|
|
81
|
-
"@rh-support/components": "2.6.
|
|
81
|
+
"@rh-support/components": "2.6.19",
|
|
82
82
|
"@rh-support/configs": "2.1.14",
|
|
83
|
-
"@rh-support/react-context": "2.6.
|
|
83
|
+
"@rh-support/react-context": "2.6.19",
|
|
84
84
|
"@rh-support/types": "2.0.30",
|
|
85
|
-
"@rh-support/user-permissions": "2.6.
|
|
86
|
-
"@rh-support/utils": "2.6.
|
|
85
|
+
"@rh-support/user-permissions": "2.6.17",
|
|
86
|
+
"@rh-support/utils": "2.6.16",
|
|
87
87
|
"@types/react-beautiful-dnd": "^13.0.0",
|
|
88
88
|
"i18next": "^23.15.0",
|
|
89
89
|
"lodash": ">=4.17.15",
|
|
@@ -102,5 +102,5 @@
|
|
|
102
102
|
"defaults and supports es6-module",
|
|
103
103
|
"maintained node versions"
|
|
104
104
|
],
|
|
105
|
-
"gitHead": "
|
|
105
|
+
"gitHead": "af72d32bcaddadd498184ca6b0bf2b913abb29a8"
|
|
106
106
|
}
|