@rh-support/manage 2.5.263 → 2.5.272
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 +18 -46
- package/lib/esm/Routes.d.ts +0 -1
- package/lib/esm/Routes.d.ts.map +1 -1
- package/lib/esm/Routes.js +0 -6
- package/lib/esm/components/Groups/DefualtGroupSwitch/DefaultGroupSwitch.d.ts +3 -5
- package/lib/esm/components/Groups/DefualtGroupSwitch/DefaultGroupSwitch.d.ts.map +1 -1
- package/lib/esm/components/Groups/DefualtGroupSwitch/DefaultGroupSwitch.js +14 -21
- package/lib/esm/components/Groups/GroupSelect/GroupSelect.d.ts +0 -1
- package/lib/esm/components/Groups/GroupSelect/GroupSelect.d.ts.map +1 -1
- package/lib/esm/components/Groups/GroupSelect/GroupSelect.js +85 -156
- package/lib/esm/components/Groups/ManageGroupUsers/ManageGroupUsers.d.ts.map +1 -1
- package/lib/esm/components/Groups/ManageGroupUsers/ManageGroupUsers.js +42 -163
- package/lib/esm/components/ManagePreferences/sections/PreferencesACL.d.ts.map +1 -1
- package/lib/esm/components/ManagePreferences/sections/PreferencesACL.js +4 -3
- package/lib/esm/components/ManagePreferences/sections/PreferencesCaseCreate.d.ts.map +1 -1
- package/lib/esm/components/ManagePreferences/sections/PreferencesCaseCreate.js +58 -73
- package/lib/esm/components/ManagePreferences/sections/PreferencesCaseView.d.ts.map +1 -1
- package/lib/esm/components/ManagePreferences/sections/PreferencesCaseView.js +98 -43
- package/lib/esm/constants/GroupSelectActions.d.ts +1 -2
- package/lib/esm/constants/GroupSelectActions.d.ts.map +1 -1
- package/lib/esm/constants/GroupSelectActions.js +0 -1
- package/lib/esm/hooks/useVersionsDiffer.d.ts.map +1 -1
- package/lib/esm/index.js +0 -1
- package/lib/esm/scss/_main.scss +0 -77
- package/package.json +8 -11
- package/lib/esm/components/Groups/AddMembersModal/AddMembersModal.d.ts +0 -12
- package/lib/esm/components/Groups/AddMembersModal/AddMembersModal.d.ts.map +0 -1
- package/lib/esm/components/Groups/AddMembersModal/AddMembersModal.js +0 -80
- package/lib/esm/components/Groups/AddMembersModal/index.d.ts +0 -2
- package/lib/esm/components/Groups/AddMembersModal/index.d.ts.map +0 -1
- package/lib/esm/components/Groups/AddMembersModal/index.js +0 -1
- package/lib/esm/components/ManageCaseLabels/AddEditCaseLabelModal.d.ts +0 -19
- package/lib/esm/components/ManageCaseLabels/AddEditCaseLabelModal.d.ts.map +0 -1
- package/lib/esm/components/ManageCaseLabels/AddEditCaseLabelModal.js +0 -83
- package/lib/esm/components/ManageCaseLabels/ManageCaseLabelsTab.d.ts +0 -3
- package/lib/esm/components/ManageCaseLabels/ManageCaseLabelsTab.d.ts.map +0 -1
- package/lib/esm/components/ManageCaseLabels/ManageCaseLabelsTab.js +0 -217
- package/lib/esm/components/ManageCaseLabels/index.d.ts +0 -2
- package/lib/esm/components/ManageCaseLabels/index.d.ts.map +0 -1
- package/lib/esm/components/ManageCaseLabels/index.js +0 -1
- package/lib/esm/components/ManageCaseLabels/types.d.ts +0 -6
- package/lib/esm/components/ManageCaseLabels/types.d.ts.map +0 -1
- package/lib/esm/components/ManageCaseLabels/types.js +0 -1
- package/lib/esm/hooks/useCaseGroupGraphQL.d.ts +0 -42
- package/lib/esm/hooks/useCaseGroupGraphQL.d.ts.map +0 -1
- package/lib/esm/hooks/useCaseGroupGraphQL.js +0 -109
- package/lib/esm/hooks/useCaseLabelGraphQL.d.ts +0 -26
- package/lib/esm/hooks/useCaseLabelGraphQL.d.ts.map +0 -1
- package/lib/esm/hooks/useCaseLabelGraphQL.js +0 -99
- package/lib/esm/hooks/useCurrentUserContact.d.ts +0 -8
- package/lib/esm/hooks/useCurrentUserContact.d.ts.map +0 -1
- package/lib/esm/hooks/useCurrentUserContact.js +0 -74
- package/lib/esm/utils/caseGroupMapper.d.ts +0 -18
- package/lib/esm/utils/caseGroupMapper.d.ts.map +0 -1
- package/lib/esm/utils/caseGroupMapper.js +0 -49
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;AAclE,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,EAAE,CAAC,CAAC;IACpC,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,qBAyMvC"}
|
package/lib/esm/ManageTabs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Tab, TabContent, Tabs, TabsComponent, TabTitleText } from '@patternfly/react-core';
|
|
2
|
-
import { ErrorBoundary,
|
|
3
|
-
import { ability, resourceActions, resources } from '@rh-support/user-permissions';
|
|
2
|
+
import { ErrorBoundary, useDocumentTitle } from '@rh-support/components';
|
|
3
|
+
import { ability, CaseDetailsFields, resourceActions, resources } from '@rh-support/user-permissions';
|
|
4
4
|
import map from 'lodash/map';
|
|
5
5
|
import React, { useState } from 'react';
|
|
6
6
|
import { Trans, useTranslation } from 'react-i18next';
|
|
@@ -8,46 +8,29 @@ import { useParams } from 'react-router-dom';
|
|
|
8
8
|
import { ConfigsTable } from './components/Configs/ConfigsTable';
|
|
9
9
|
import { ManageGroupUsers } from './components/Groups/ManageGroupUsers';
|
|
10
10
|
import { ManageGroupedBookmarkedAccountsTab } from './components/ManageBookmarkedAccountsTab';
|
|
11
|
-
import { ManageCaseLabelsTab } from './components/ManageCaseLabels';
|
|
12
11
|
import { ExpiredContentManagement } from './components/ManageExpiredContents/ExpiredContentManagement';
|
|
13
|
-
|
|
14
|
-
// import { ManagePartnerships } from './components/ManagePartnerships/index';
|
|
12
|
+
import { ManagePartnerships } from './components/ManagePartnerships/index';
|
|
15
13
|
import { ManagePreferences } from './components/ManagePreferences';
|
|
16
14
|
import { TagsManagement } from './components/ManageTags';
|
|
17
|
-
|
|
15
|
+
import { NotificationEmails } from './components/NotificationEmails/index';
|
|
18
16
|
import { TopContentManagement } from './components/TopContentManagement';
|
|
19
17
|
import { PageTitle } from './constants/pageTitle';
|
|
20
|
-
import { useCurrentUserContact } from './hooks/useCurrentUserContact';
|
|
21
18
|
import { Routes } from './Routes';
|
|
22
19
|
export function ManageTabs(props) {
|
|
23
20
|
var _a, _b;
|
|
24
21
|
const [activeTabKey, setActiveTabKey] = useState(0);
|
|
25
22
|
const { activeTab } = useParams();
|
|
26
23
|
const { t } = useTranslation();
|
|
27
|
-
const {
|
|
28
|
-
const { groupsRoute, bookmarkedAccountsRoute, caseLabelsRoute, topContentRoute,
|
|
29
|
-
// notificationEmailsRoute,
|
|
30
|
-
preferencesRoute, configsRoute,
|
|
31
|
-
// partnershipsRoute, // TODO: Uncomment when partnerships tab is re-implemented
|
|
32
|
-
tagsManagerRoute, expiredContentRoute, } = Routes.getPaths();
|
|
24
|
+
const { groupsRoute, bookmarkedAccountsRoute, topContentRoute, notificationEmailsRoute, preferencesRoute, configsRoute, partnershipsRoute, tagsManagerRoute, expiredContentRoute, } = Routes.getPaths();
|
|
33
25
|
useDocumentTitle(PageTitle.MANAGE);
|
|
34
26
|
const canViewManageTab = ability.can(resourceActions.READ, resources.MANAGE);
|
|
35
27
|
const canViewManageTopContent = ability.can(resourceActions.READ, resources.TOP_CONTENT) && canViewManageTab;
|
|
36
28
|
const canViewCaseGroups = ability.can(resourceActions.READ, resources.CASE_GROUPS) && canViewManageTab;
|
|
37
29
|
const canManageBookmarkAccounts = ability.can(resourceActions.CREATE, resources.BOOKMARK_ACCOUNTS) && canViewManageTab;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
// const canAddCustomNotification = ability.can(
|
|
42
|
-
// resourceActions.PATCH,
|
|
43
|
-
// resources.CASE_DETAILS,
|
|
44
|
-
// CaseDetailsFields.CASE_DETAILS_SEND_NOTIFICATIONS
|
|
45
|
-
// );
|
|
30
|
+
const canViewEmailNotificationTab = ability.can(resourceActions.READ, resources.NOTIFICATION_EMAIL);
|
|
31
|
+
const canViewPartnershipsTab = ability.can(resourceActions.READ, resources.PARTNERSHIPS);
|
|
32
|
+
const canAddCustomNotification = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_SEND_NOTIFICATIONS);
|
|
46
33
|
const canViewConfigsTab = ability.can(resourceActions.READ, resources.APP_INTERNAL_CONFIGS);
|
|
47
|
-
if (contactLoading) {
|
|
48
|
-
return (React.createElement("div", { className: "grid-main manage" },
|
|
49
|
-
React.createElement(LoadingIndicator, { show: true, size: "sm" })));
|
|
50
|
-
}
|
|
51
34
|
const tabsToRender = [];
|
|
52
35
|
canManageBookmarkAccounts &&
|
|
53
36
|
tabsToRender.push({
|
|
@@ -67,15 +50,6 @@ export function ManageTabs(props) {
|
|
|
67
50
|
component: React.createElement(ManageGroupUsers, null),
|
|
68
51
|
id: 'manage-groups',
|
|
69
52
|
});
|
|
70
|
-
tabsToRender.push({
|
|
71
|
-
title: 'Case labels',
|
|
72
|
-
key: 'case-labels-tab',
|
|
73
|
-
'data-tracking-id': 'manage-case-labels-tab',
|
|
74
|
-
routePath: caseLabelsRoute,
|
|
75
|
-
component: React.createElement(ManageCaseLabelsTab, null),
|
|
76
|
-
id: 'manage-case-labels',
|
|
77
|
-
});
|
|
78
|
-
/* TODO: Re-enable notification emails tab when ready
|
|
79
53
|
canViewEmailNotificationTab &&
|
|
80
54
|
canAddCustomNotification &&
|
|
81
55
|
tabsToRender.push({
|
|
@@ -83,20 +57,18 @@ export function ManageTabs(props) {
|
|
|
83
57
|
key: 'notification-emails-tab',
|
|
84
58
|
'data-tracking-id': 'notification-emails-tab',
|
|
85
59
|
routePath: notificationEmailsRoute,
|
|
86
|
-
component:
|
|
60
|
+
component: React.createElement(NotificationEmails, null),
|
|
87
61
|
id: 'notification-emails',
|
|
88
62
|
});
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
// id: 'partnerships',
|
|
99
|
-
// });
|
|
63
|
+
canViewPartnershipsTab &&
|
|
64
|
+
tabsToRender.push({
|
|
65
|
+
title: 'Partnerships',
|
|
66
|
+
key: 'partnerships-tab',
|
|
67
|
+
'data-tracking-id': 'partnerships-tab',
|
|
68
|
+
routePath: partnershipsRoute,
|
|
69
|
+
component: React.createElement(ManagePartnerships, null),
|
|
70
|
+
id: 'partnerships',
|
|
71
|
+
});
|
|
100
72
|
tabsToRender.push({
|
|
101
73
|
title: 'Preferences',
|
|
102
74
|
key: 'preferences-tab',
|
package/lib/esm/Routes.d.ts
CHANGED
package/lib/esm/Routes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Routes.d.ts","sourceRoot":"","sources":["../../src/Routes.ts"],"names":[],"mappings":"AAAA,UAAU,KAAK;IACX,QAAQ,CAAC,OAAO,EAAE,MAAM,MAAM,CAAC;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACzB;AAED,UAAU,YAAY;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,kBAAkB,EAAE,KAAK,CAAC;IAC1B,eAAe,EAAE,KAAK,CAAC;IACvB,QAAQ,EAAE,MAAM;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAC1C,aAAa,EAAE,MAAM,MAAM,EAAE,CAAC;IAC9B,MAAM,EAAE,KAAK,CAAC;IACd,
|
|
1
|
+
{"version":3,"file":"Routes.d.ts","sourceRoot":"","sources":["../../src/Routes.ts"],"names":[],"mappings":"AAAA,UAAU,KAAK;IACX,QAAQ,CAAC,OAAO,EAAE,MAAM,MAAM,CAAC;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACzB;AAED,UAAU,YAAY;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,kBAAkB,EAAE,KAAK,CAAC;IAC1B,eAAe,EAAE,KAAK,CAAC;IACvB,QAAQ,EAAE,MAAM;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAC1C,aAAa,EAAE,MAAM,MAAM,EAAE,CAAC;IAC9B,MAAM,EAAE,KAAK,CAAC;IACd,aAAa,EAAE,KAAK,CAAC;IACrB,UAAU,EAAE,KAAK,CAAC;IAClB,cAAc,EAAE,KAAK,CAAC;IACtB,WAAW,EAAE,KAAK,CAAC;IACnB,WAAW,EAAE,KAAK,CAAC;IACnB,kBAAkB,EAAE,KAAK,CAAC;IAC1B,OAAO,EAAE,KAAK,CAAC;IACf,YAAY,EAAE,KAAK,CAAC;CACvB;AAED,eAAO,MAAM,MAAM,EAAE,YAqFpB,CAAC"}
|
package/lib/esm/Routes.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { ICaseGroup } from '@cee-eng/hydrajs/@types/api/public/caseGroups';
|
|
1
|
+
import { ICaseGroup, IGroupUser } from '@cee-eng/hydrajs/@types/api/public/caseGroups';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import type { IGroupUserWithContactId } from '../../../utils/caseGroupMapper';
|
|
4
3
|
interface IProps {
|
|
5
4
|
group: ICaseGroup;
|
|
6
|
-
user:
|
|
5
|
+
user: IGroupUser;
|
|
7
6
|
id: string;
|
|
8
|
-
onToggle: (user:
|
|
9
|
-
onToggleSuccess?: (user: IGroupUserWithContactId, isChecked: boolean) => void;
|
|
7
|
+
onToggle: (user: IGroupUser, isChecked: boolean) => void;
|
|
10
8
|
}
|
|
11
9
|
export declare const DefaultGroupSwitch: (props: IProps) => React.JSX.Element;
|
|
12
10
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultGroupSwitch.d.ts","sourceRoot":"","sources":["../../../../../src/components/Groups/DefualtGroupSwitch/DefaultGroupSwitch.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DefaultGroupSwitch.d.ts","sourceRoot":"","sources":["../../../../../src/components/Groups/DefualtGroupSwitch/DefaultGroupSwitch.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AAIvF,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,UAAU,MAAM;IACZ,KAAK,EAAE,UAAU,CAAC;IAClB,IAAI,EAAE,UAAU,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CAC5D;AAED,eAAO,MAAM,kBAAkB,GAAI,OAAO,MAAM,sBA+C/C,CAAC"}
|
|
@@ -7,40 +7,33 @@ 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 { publicApi } from '@cee-eng/hydrajs';
|
|
10
11
|
import { Switch } from '@patternfly/react-core';
|
|
11
|
-
import { LoadingIndicator, ToastNotification } from '@rh-support/components';
|
|
12
|
+
import { LoadingIndicator, ToastNotification, useFetch } from '@rh-support/components';
|
|
13
|
+
import { useGlobalStateContext } from '@rh-support/react-context';
|
|
12
14
|
import React from 'react';
|
|
13
15
|
import { useTranslation } from 'react-i18next';
|
|
14
|
-
import { useToggleDefaultGroup } from '../../../hooks/useCaseGroupGraphQL';
|
|
15
16
|
export const DefaultGroupSwitch = (props) => {
|
|
16
|
-
const {
|
|
17
|
+
const { globalMetadataState: { loggedInUsersAccount }, } = useGlobalStateContext();
|
|
18
|
+
const { group, id, user, onToggle } = props;
|
|
17
19
|
// @ts-ignore
|
|
18
20
|
const { t } = useTranslation();
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
21
|
+
const toggleDefaultGroupFetch = useFetch(publicApi.caseGroups.toggleDefaultGroup, {
|
|
22
|
+
propgateErrors: true,
|
|
23
|
+
});
|
|
24
|
+
// Handle Toggle
|
|
25
|
+
const toggleDefault = (isChecked) => __awaiter(void 0, void 0, void 0, function* () {
|
|
25
26
|
try {
|
|
26
27
|
onToggle(user, isChecked);
|
|
27
|
-
|
|
28
|
-
yield toggleDefault(user.contactSfId, groupId);
|
|
29
|
-
onToggleSuccess === null || onToggleSuccess === void 0 ? void 0 : onToggleSuccess(user, isChecked);
|
|
28
|
+
yield toggleDefaultGroupFetch.request(group.groupNum, user.ssoUsername, isChecked, loggedInUsersAccount.data.secureSupport);
|
|
30
29
|
ToastNotification.addSuccessMessage(t(`Default group updated successfully`));
|
|
31
30
|
}
|
|
32
31
|
catch (e) {
|
|
33
32
|
onToggle(user, user.isDefault);
|
|
34
|
-
|
|
35
|
-
if (message.includes('insufficient access rights')) {
|
|
36
|
-
ToastNotification.addDangerMessage(t('You do not have permission to change the default group for this user'));
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
ToastNotification.addDangerMessage(t('Could not toggle default status'));
|
|
40
|
-
}
|
|
33
|
+
ToastNotification.addDangerMessage(t('Could not toggle default status'));
|
|
41
34
|
}
|
|
42
35
|
});
|
|
43
36
|
return (React.createElement(React.Fragment, null,
|
|
44
|
-
React.createElement(Switch, { "aria-label": "Toggle default group", "data-tracking-id": `group-user-toggle-default-${user.isDefault ? 'off' : 'on'}`, label:
|
|
45
|
-
React.createElement(LoadingIndicator, { show: isFetching, size: "xs" })));
|
|
37
|
+
React.createElement(Switch, { "aria-label": "Toggle default group", "data-tracking-id": `group-user-toggle-default-${user.isDefault ? 'off' : 'on'}`, label: t('On'), id: id, isDisabled: user.access === false || user.write === false || toggleDefaultGroupFetch.isFetching, isChecked: user.isDefault, onChange: (_event, isChecked) => toggleDefault(isChecked) }),
|
|
38
|
+
React.createElement(LoadingIndicator, { show: toggleDefaultGroupFetch.isFetching, size: "xs" })));
|
|
46
39
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupSelect.d.ts","sourceRoot":"","sources":["../../../../../src/components/Groups/GroupSelect/GroupSelect.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;
|
|
1
|
+
{"version":3,"file":"GroupSelect.d.ts","sourceRoot":"","sources":["../../../../../src/components/Groups/GroupSelect/GroupSelect.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AAwC3E,OAAO,KAAmD,MAAM,OAAO,CAAC;AAKxE,UAAU,MAAM;IACZ,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,KAAK,IAAI,CAAC;CAChD;AAKD,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,sBAmjBxC,CAAC"}
|
|
@@ -7,29 +7,26 @@ 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 {
|
|
10
|
+
import { publicApi } from '@cee-eng/hydrajs';
|
|
11
11
|
import { Button, Divider, Dropdown, MenuContent, MenuItem, MenuList, MenuToggle, Select, SelectList, SelectOption, Spinner, TextInput, TextInputGroup, TextInputGroupMain, TextInputGroupUtilities, } from '@patternfly/react-core';
|
|
12
12
|
import CogIcon from '@patternfly/react-icons/dist/js/icons/cog-icon';
|
|
13
13
|
import TimesIcon from '@patternfly/react-icons/dist/js/icons/times-icon';
|
|
14
|
-
import { AlertMessage, AlertType, ToastNotification, useConfirmation, usePrevious, useSelectKeyboardNavigator, } from '@rh-support/components';
|
|
14
|
+
import { AlertMessage, AlertType, ToastNotification, useConfirmation, useFetch, usePrevious, useSelectKeyboardNavigator, } from '@rh-support/components';
|
|
15
15
|
import { fetchCaseGroupsForSSO, setCaseGroups, useGlobalDispatchContext, useGlobalStateContext, } from '@rh-support/react-context';
|
|
16
16
|
import { ability, resourceActions, resources } from '@rh-support/user-permissions';
|
|
17
|
-
import {
|
|
17
|
+
import { haventLoadedMetadata } from '@rh-support/utils';
|
|
18
18
|
import find from 'lodash/find';
|
|
19
19
|
import isEmpty from 'lodash/isEmpty';
|
|
20
20
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
21
21
|
import { Trans, useTranslation } from 'react-i18next';
|
|
22
22
|
import { GroupSelectActions } from '../../../constants/GroupSelectActions';
|
|
23
|
-
import { useCreateCaseGroup, useCreateCaseGroupMember, useDeleteCaseGroup, useRenameCaseGroup, } from '../../../hooks/useCaseGroupGraphQL';
|
|
24
23
|
const actions = GroupSelectActions;
|
|
25
24
|
const unGroupedCaseGroupNumber = '-1';
|
|
26
25
|
export const GroupSelect = (props) => {
|
|
27
|
-
var _a;
|
|
28
26
|
const { t } = useTranslation();
|
|
29
27
|
const { onSelect: onSelectProp } = props;
|
|
30
28
|
const manageActionsRef = useRef();
|
|
31
|
-
const
|
|
32
|
-
const { globalMetadataState: { caseGroups, loggedInUsersAccount }, } = useGlobalStateContext();
|
|
29
|
+
const { globalMetadataState: { caseGroups, loggedInUserJwtToken }, } = useGlobalStateContext();
|
|
33
30
|
const dispatch = useGlobalDispatchContext();
|
|
34
31
|
const selectAGroupText = caseGroups.isFetching
|
|
35
32
|
? t('Loading groups')
|
|
@@ -40,39 +37,11 @@ export const GroupSelect = (props) => {
|
|
|
40
37
|
const confirmation = useConfirmation();
|
|
41
38
|
const [input, setInput] = useState('');
|
|
42
39
|
const [shouldFilter, setShouldFilter] = useState(false);
|
|
43
|
-
|
|
44
|
-
// GraphQL hooks for mutations
|
|
45
|
-
const { createGroup: createGroupMutation, loading: createLoading } = useCreateCaseGroup();
|
|
46
|
-
const { createMember: createMemberMutation } = useCreateCaseGroupMember();
|
|
47
|
-
const { renameGroup: renameGroupMutation, loading: renameLoading } = useRenameCaseGroup();
|
|
48
|
-
const { deleteGroup: deleteGroupMutation, loading: deleteLoading } = useDeleteCaseGroup();
|
|
49
|
-
const hasFetchedFromGraphQL = useRef(false);
|
|
50
|
-
const [groupsFetchCompleted, setGroupsFetchCompleted] = useState(false);
|
|
51
|
-
// Always fetch groups from GraphQL — never rely on potentially stale Hydra data.
|
|
52
|
-
// Auto-select only after this settles so members can load against real group data.
|
|
53
|
-
useEffect(() => {
|
|
54
|
-
if (!apolloClient || !accountId) {
|
|
55
|
-
setGroupsFetchCompleted(true);
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
if (hasFetchedFromGraphQL.current)
|
|
59
|
-
return;
|
|
60
|
-
hasFetchedFromGraphQL.current = true;
|
|
61
|
-
const fetchGroups = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
62
|
-
try {
|
|
63
|
-
yield fetchCaseGroupsForSSO(dispatch, apolloClient, accountId);
|
|
64
|
-
}
|
|
65
|
-
finally {
|
|
66
|
-
setGroupsFetchCompleted(true);
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
fetchGroups();
|
|
70
|
-
}, [dispatch, apolloClient, accountId]);
|
|
71
|
-
// Set default group once groups are loaded
|
|
40
|
+
// Fetch groups on init
|
|
72
41
|
useEffect(() => {
|
|
73
42
|
var _a, _b;
|
|
74
|
-
if (
|
|
75
|
-
|
|
43
|
+
if (haventLoadedMetadata(caseGroups, (data) => data === undefined))
|
|
44
|
+
fetchCaseGroupsForSSO(dispatch, loggedInUserJwtToken.preferred_username);
|
|
76
45
|
if (isEmpty(selectedGroup) && !isEmpty(caseGroups) && ((_a = caseGroups === null || caseGroups === void 0 ? void 0 : caseGroups.data) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
77
46
|
const defaultCaseGroup = find(caseGroups === null || caseGroups === void 0 ? void 0 : caseGroups.data, (g) => g.isDefault);
|
|
78
47
|
const newSelectedGroup = (defaultCaseGroup === null || defaultCaseGroup === void 0 ? void 0 : defaultCaseGroup.groupNum) === '-1'
|
|
@@ -84,7 +53,7 @@ export const GroupSelect = (props) => {
|
|
|
84
53
|
}
|
|
85
54
|
}
|
|
86
55
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
87
|
-
}, [
|
|
56
|
+
}, [dispatch, loggedInUserJwtToken, caseGroups]);
|
|
88
57
|
// handle dropdown open/close toggle
|
|
89
58
|
const [isOpen, setIsOpen] = useState(false);
|
|
90
59
|
// handle group selection
|
|
@@ -112,7 +81,6 @@ export const GroupSelect = (props) => {
|
|
|
112
81
|
// Group actions dropdown state
|
|
113
82
|
const hasGroupPermissions = ability.can(resourceActions.CREATE, resources.CASE_GROUPS);
|
|
114
83
|
const [showDropdown, setShowDropdown] = useState(hasGroupPermissions);
|
|
115
|
-
useEffect(() => setShowDropdown(hasGroupPermissions), [hasGroupPermissions]);
|
|
116
84
|
const [showInput, setShowInput] = useState(false);
|
|
117
85
|
const [isDropdownOpen, setIsDropdownOpen] = useState(false);
|
|
118
86
|
const toggleIsDropdownOpen = () => setIsDropdownOpen(!isDropdownOpen);
|
|
@@ -122,10 +90,19 @@ export const GroupSelect = (props) => {
|
|
|
122
90
|
closeDropdown();
|
|
123
91
|
setAction(action);
|
|
124
92
|
};
|
|
93
|
+
// fetch objects for apis
|
|
125
94
|
const [showErrorMessage] = useState(false);
|
|
95
|
+
const createGroupFetch = useFetch(publicApi.caseGroups.createGroup, { propgateErrors: true });
|
|
96
|
+
const renameGroupFetch = useFetch(publicApi.caseGroups.renameGroup, { propgateErrors: true });
|
|
97
|
+
const deleteGroupFetch = useFetch(publicApi.caseGroups.deleteGroup, { propgateErrors: true });
|
|
98
|
+
const duplicateGroupFetch = useFetch(publicApi.caseGroups.createGroup, { propgateErrors: true });
|
|
126
99
|
// group actions input state
|
|
127
100
|
const textInputRef = useRef();
|
|
128
|
-
const disableOnFetch = caseGroups.isFetching ||
|
|
101
|
+
const disableOnFetch = caseGroups.isFetching ||
|
|
102
|
+
createGroupFetch.isFetching ||
|
|
103
|
+
renameGroupFetch.isFetching ||
|
|
104
|
+
deleteGroupFetch.isFetching ||
|
|
105
|
+
duplicateGroupFetch.isFetching;
|
|
129
106
|
const onChange = (e, value) => {
|
|
130
107
|
if (!showInput) {
|
|
131
108
|
setIsOpen(true);
|
|
@@ -147,78 +124,56 @@ export const GroupSelect = (props) => {
|
|
|
147
124
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
148
125
|
}, [input, showInput]);
|
|
149
126
|
// group actions
|
|
150
|
-
function
|
|
127
|
+
function setGroupOnFetch(groupName) {
|
|
128
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
129
|
+
yield fetchCaseGroupsForSSO(dispatch, loggedInUserJwtToken.preferred_username);
|
|
130
|
+
setSelectedGroup(groupName);
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
function createGroup(groupName, ssoUsername) {
|
|
151
134
|
return __awaiter(this, void 0, void 0, function* () {
|
|
152
|
-
if (!accountId) {
|
|
153
|
-
ToastNotification.addDangerMessage(t('There was an error while creating this group'));
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
135
|
try {
|
|
157
|
-
|
|
158
|
-
const createdRecord = response.redhat_support_uiapi.CaseGroup__cCreate.RedHatSupportRecord;
|
|
136
|
+
yield createGroupFetch.request({ name: groupName, contactSsoName: ssoUsername });
|
|
159
137
|
ToastNotification.addSuccessMessage(t('Group has been successfully created'));
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
defaultMembers: [],
|
|
166
|
-
members: [],
|
|
167
|
-
};
|
|
168
|
-
const updatedGroups = [...(caseGroups.data || []), newGroup];
|
|
169
|
-
setCaseGroups(dispatch, updatedGroups);
|
|
170
|
-
setShowDropdown(true);
|
|
171
|
-
setShowInput(false);
|
|
172
|
-
setSelectedGroup(groupName);
|
|
173
|
-
}
|
|
174
|
-
catch (e) {
|
|
175
|
-
const message = String((e === null || e === void 0 ? void 0 : e.message) || '');
|
|
176
|
-
if (message.includes('insufficient access rights')) {
|
|
177
|
-
ToastNotification.addDangerMessage(t('You do not have permission to create this group'));
|
|
138
|
+
try {
|
|
139
|
+
yield setGroupOnFetch(groupName);
|
|
140
|
+
setShowDropdown(true);
|
|
141
|
+
setShowInput(false);
|
|
142
|
+
setSelectedGroup(groupName);
|
|
178
143
|
}
|
|
179
|
-
|
|
180
|
-
ToastNotification.addDangerMessage(t('
|
|
144
|
+
catch (error) {
|
|
145
|
+
ToastNotification.addDangerMessage(t("We're having an issue finding this group's users"));
|
|
146
|
+
onClear();
|
|
181
147
|
}
|
|
182
148
|
}
|
|
149
|
+
catch (e) {
|
|
150
|
+
ToastNotification.addDangerMessage(t('There was an error while creating this group'));
|
|
151
|
+
}
|
|
183
152
|
});
|
|
184
153
|
}
|
|
185
154
|
const [action, setAction] = useState('');
|
|
186
155
|
const isUserInputAGroup = () => (caseGroups.data || []).find((value) => value.name === input);
|
|
187
|
-
const handleDeleteGroup = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
188
|
-
const groupToDelete = getGroup(selectedGroup);
|
|
189
|
-
yield confirmation({
|
|
190
|
-
catchOnCancel: true,
|
|
191
|
-
title: t('Delete group'),
|
|
192
|
-
description: (React.createElement(Trans, null,
|
|
193
|
-
"Are you sure you want to delete ",
|
|
194
|
-
React.createElement("strong", null, groupToDelete.name),
|
|
195
|
-
"?")),
|
|
196
|
-
});
|
|
197
|
-
yield deleteGroupMutation(groupToDelete.groupNum);
|
|
198
|
-
const index = (caseGroups.data || []).findIndex((value) => value.name === groupToDelete.name);
|
|
199
|
-
(caseGroups.data || []).splice(index, 1);
|
|
200
|
-
setCaseGroups(dispatch, caseGroups.data || []);
|
|
201
|
-
onClear();
|
|
202
|
-
ToastNotification.addSuccessMessage(t('Group has been successfully deleted'));
|
|
203
|
-
});
|
|
204
156
|
const onAction = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
205
|
-
var _a, _b, _c, _d;
|
|
206
|
-
const needsUniqueName = action === actions.create || action === actions.rename || action === actions.duplicate;
|
|
207
|
-
if (needsUniqueName && isUserInputAGroup()) {
|
|
208
|
-
ToastNotification.addWarningMessage(t('Group already exists'));
|
|
209
|
-
return;
|
|
210
|
-
}
|
|
211
157
|
switch (action) {
|
|
212
158
|
case actions.create: {
|
|
213
|
-
|
|
159
|
+
if (isUserInputAGroup()) {
|
|
160
|
+
ToastNotification.addWarningMessage(t('Group already exists'));
|
|
161
|
+
break;
|
|
162
|
+
}
|
|
163
|
+
yield createGroup(input, loggedInUserJwtToken.preferred_username);
|
|
214
164
|
setAction('');
|
|
215
165
|
break;
|
|
216
166
|
}
|
|
217
167
|
case actions.rename: {
|
|
168
|
+
if (isUserInputAGroup()) {
|
|
169
|
+
ToastNotification.addWarningMessage(t('Group already exists'));
|
|
170
|
+
break;
|
|
171
|
+
}
|
|
218
172
|
const previousGroup = selectedGroup;
|
|
219
173
|
const group = getGroup(previousGroup);
|
|
220
174
|
try {
|
|
221
|
-
|
|
175
|
+
// change name in the current caseGroups list
|
|
176
|
+
yield renameGroupFetch.request(input, group.groupNum, group.isPrivate);
|
|
222
177
|
const copyCaseGroups = [...(caseGroups.data || [])];
|
|
223
178
|
const index = copyCaseGroups.findIndex((value) => value.name === previousGroup);
|
|
224
179
|
copyCaseGroups[index].name = input;
|
|
@@ -230,13 +185,7 @@ export const GroupSelect = (props) => {
|
|
|
230
185
|
ToastNotification.addSuccessMessage(t('Group has been renamed'));
|
|
231
186
|
}
|
|
232
187
|
catch (e) {
|
|
233
|
-
|
|
234
|
-
if (message.includes('insufficient access rights')) {
|
|
235
|
-
ToastNotification.addDangerMessage(t('You do not have permission to rename this group'));
|
|
236
|
-
}
|
|
237
|
-
else {
|
|
238
|
-
ToastNotification.addDangerMessage(t('There was an error renaming this group'));
|
|
239
|
-
}
|
|
188
|
+
ToastNotification.addDangerMessage(t('There was an error renaming this group '));
|
|
240
189
|
}
|
|
241
190
|
finally {
|
|
242
191
|
setAction('');
|
|
@@ -245,13 +194,32 @@ export const GroupSelect = (props) => {
|
|
|
245
194
|
}
|
|
246
195
|
case actions.delete: {
|
|
247
196
|
try {
|
|
248
|
-
|
|
197
|
+
const groupToDelete = getGroup(selectedGroup);
|
|
198
|
+
try {
|
|
199
|
+
// get confirmation on delete
|
|
200
|
+
yield confirmation({
|
|
201
|
+
catchOnCancel: true,
|
|
202
|
+
title: t('Delete group'),
|
|
203
|
+
description: (React.createElement(Trans, null,
|
|
204
|
+
"Are you sure you want to delete ",
|
|
205
|
+
React.createElement("strong", null, groupToDelete.name),
|
|
206
|
+
"?")),
|
|
207
|
+
});
|
|
208
|
+
// delete action is confirmed
|
|
209
|
+
yield deleteGroupFetch.request(groupToDelete.groupNum);
|
|
210
|
+
// remove group from list
|
|
211
|
+
const index = (caseGroups.data || []).findIndex((value) => value.name === groupToDelete.name);
|
|
212
|
+
(caseGroups.data || []).splice(index, 1);
|
|
213
|
+
setCaseGroups(dispatch, caseGroups.data || []);
|
|
214
|
+
onClear();
|
|
215
|
+
ToastNotification.addSuccessMessage(t('Group has been successfully deleted'));
|
|
216
|
+
}
|
|
217
|
+
catch (_a) {
|
|
218
|
+
// user didn't confirm the delete action
|
|
219
|
+
}
|
|
249
220
|
}
|
|
250
221
|
catch (e) {
|
|
251
|
-
|
|
252
|
-
if (message.includes('insufficient access rights')) {
|
|
253
|
-
ToastNotification.addDangerMessage(t('You do not have permission to delete this group'));
|
|
254
|
-
}
|
|
222
|
+
ToastNotification.addDangerMessage(t('There was an error deleting this group'));
|
|
255
223
|
}
|
|
256
224
|
finally {
|
|
257
225
|
setAction('');
|
|
@@ -259,60 +227,23 @@ export const GroupSelect = (props) => {
|
|
|
259
227
|
}
|
|
260
228
|
}
|
|
261
229
|
case actions.duplicate: {
|
|
262
|
-
if (
|
|
263
|
-
ToastNotification.
|
|
230
|
+
if (isUserInputAGroup()) {
|
|
231
|
+
ToastNotification.addWarningMessage(t('Group already exists'));
|
|
264
232
|
break;
|
|
265
233
|
}
|
|
266
234
|
try {
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
const membersResponse = yield apolloClient.query({
|
|
273
|
-
query: GET_CASE_GROUP_MEMBERS,
|
|
274
|
-
variables: { where: { Group__c: { eq: sourceGroup.groupNum } } },
|
|
275
|
-
fetchPolicy: 'network-only',
|
|
276
|
-
});
|
|
277
|
-
const sourceMembers = ((_d = (_c = (_b = (_a = membersResponse.data) === null || _a === void 0 ? void 0 : _a.redhat_support_uiapi) === null || _b === void 0 ? void 0 : _b.query) === null || _c === void 0 ? void 0 : _c.RedHatSupportCaseGroupMember__c) === null || _d === void 0 ? void 0 : _d.edges) ||
|
|
278
|
-
[];
|
|
279
|
-
const contactIds = sourceMembers
|
|
280
|
-
.filter(({ node }) => { var _a; return (_a = node.Contact__c) === null || _a === void 0 ? void 0 : _a.value; })
|
|
281
|
-
.map(({ node }) => node.Contact__c.value);
|
|
282
|
-
if (contactIds.length > 0) {
|
|
283
|
-
const results = yield Promise.allSettled(contactIds.map((contactId) => createMemberMutation(contactId, newGroupId)));
|
|
284
|
-
const failed = results.filter((r) => r.status === 'rejected');
|
|
285
|
-
if (failed.length > 0) {
|
|
286
|
-
ToastNotification.addWarningMessage(t('Group duplicated but {{count}} members could not be copied', {
|
|
287
|
-
count: failed.length,
|
|
288
|
-
}));
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
const dupGroup = {
|
|
293
|
-
groupNum: newGroupId,
|
|
294
|
-
name: dupRecord.Name.value,
|
|
295
|
-
isPrivate: false,
|
|
296
|
-
isDefault: false,
|
|
297
|
-
defaultMembers: [],
|
|
298
|
-
members: [],
|
|
299
|
-
};
|
|
300
|
-
const updatedDupGroups = [...(caseGroups.data || []), dupGroup];
|
|
301
|
-
setCaseGroups(dispatch, updatedDupGroups);
|
|
235
|
+
yield duplicateGroupFetch.request({
|
|
236
|
+
name: input,
|
|
237
|
+
contactSsoName: loggedInUserJwtToken.preferred_username,
|
|
238
|
+
});
|
|
239
|
+
yield setGroupOnFetch(input);
|
|
302
240
|
setShowDropdown(true);
|
|
303
241
|
setShowInput(false);
|
|
304
|
-
setSelectedGroup(input);
|
|
305
242
|
setInput('');
|
|
306
243
|
ToastNotification.addSuccessMessage(t('Group has been successfully duplicated'));
|
|
307
244
|
}
|
|
308
245
|
catch (e) {
|
|
309
|
-
|
|
310
|
-
if (message.includes('insufficient access rights')) {
|
|
311
|
-
ToastNotification.addDangerMessage(t('You do not have permission to duplicate this group'));
|
|
312
|
-
}
|
|
313
|
-
else {
|
|
314
|
-
ToastNotification.addDangerMessage(t('There was an error while duplicating group'));
|
|
315
|
-
}
|
|
246
|
+
ToastNotification.addDangerMessage(t('There was an error while duplicating group'));
|
|
316
247
|
}
|
|
317
248
|
finally {
|
|
318
249
|
setAction('');
|
|
@@ -353,17 +284,11 @@ export const GroupSelect = (props) => {
|
|
|
353
284
|
setAction('');
|
|
354
285
|
setInput(selectedGroup);
|
|
355
286
|
};
|
|
356
|
-
const handleAddMembers = () => {
|
|
357
|
-
var _a;
|
|
358
|
-
closeDropdown();
|
|
359
|
-
(_a = props.onAddMembers) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
360
|
-
};
|
|
361
287
|
const dropdownItems = [
|
|
362
288
|
React.createElement(MenuItem, { className: "create-group-action", isDisabled: !ability.can(resourceActions.CREATE, resources.CASE_GROUPS), key: "create", onClick: onActionFocus(actions.create), "data-tracking-id": "manage-group-create" }, t('Create')),
|
|
363
289
|
React.createElement(Divider, { component: "li" }),
|
|
364
290
|
React.createElement(MenuItem, { className: "create-group-action", isDisabled: !selectedGroup || !ability.can(resourceActions.UPDATE, resources.CASE_GROUPS), key: "rename", onClick: onActionFocus(actions.rename), "data-tracking-id": "manage-group-rename" }, t('Rename')),
|
|
365
291
|
React.createElement(MenuItem, { className: "create-group-action", isDisabled: !selectedGroup || !ability.can(resourceActions.CREATE, resources.CASE_GROUPS), key: "duplicate", onClick: onActionFocus(actions.duplicate), "data-tracking-id": "manage-group-duplicate" }, t('Duplicate')),
|
|
366
|
-
React.createElement(MenuItem, { className: "create-group-action", isDisabled: !selectedGroup || !ability.can(resourceActions.CREATE, resources.CASE_GROUPS), key: "add-members", onClick: handleAddMembers, "data-tracking-id": "manage-group-add-members" }, t('Add members')),
|
|
367
292
|
React.createElement(MenuItem, { isDanger: true, className: "create-group-action del-btn", isDisabled: !selectedGroup || !ability.can(resourceActions.DELETE, resources.CASE_GROUPS), key: "delete", onClick: onActionFocus(actions.delete), "data-tracking-id": "manage-group-delete" }, t('Delete')),
|
|
368
293
|
];
|
|
369
294
|
const dropdownToggle = (toggleRef) => (React.createElement(MenuToggle, { isFullHeight: true, className: "pf-v6-u-ml-sm manage-group-actions-toggle-options pf-v6-u-p-md", ref: toggleRef, isDisabled: props.isDisabled || disableOnFetch, onClick: toggleIsDropdownOpen, isExpanded: isDropdownOpen, "data-tracking-id": "manage-group-toggle-options", "aria-label": "Group actions dropdown toggle", icon: React.createElement(CogIcon, null) }));
|
|
@@ -390,11 +315,14 @@ export const GroupSelect = (props) => {
|
|
|
390
315
|
};
|
|
391
316
|
const selectTypeahead = manageActionsRef.current.querySelector('input');
|
|
392
317
|
if (!showInput) {
|
|
318
|
+
// adds event listeners that prevent using enter to select a group.
|
|
393
319
|
selectTypeahead.addEventListener('keydown', dontSubmitOnEnterCb);
|
|
394
320
|
selectTypeahead.addEventListener('keyup', dontSubmitOnEnterCb);
|
|
395
321
|
selectTypeahead.addEventListener('keypress', dontSubmitOnEnterCb);
|
|
396
322
|
}
|
|
397
323
|
else {
|
|
324
|
+
// adds event listeners that allows submitting actions using enter on select
|
|
325
|
+
// inupt used for getting user input for actions.
|
|
398
326
|
selectTypeahead.addEventListener('keydown', submitOnEnterCb);
|
|
399
327
|
}
|
|
400
328
|
return () => {
|
|
@@ -408,6 +336,7 @@ export const GroupSelect = (props) => {
|
|
|
408
336
|
}
|
|
409
337
|
};
|
|
410
338
|
}, [manageActionsRef, showInput]);
|
|
339
|
+
//added for validation of new group name
|
|
411
340
|
const containsOnlySpecialChars = (str) => {
|
|
412
341
|
return /^[^a-zA-Z0-9]*$/.test(str);
|
|
413
342
|
};
|
|
@@ -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":"AAMA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAS5D,eAAO,MAAM,gBAAgB,yBA4L5B,CAAC"}
|