@rh-support/manage 1.0.301-beta.2 → 1.1.0

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.
Files changed (77) hide show
  1. package/lib/esm/ManageTab.d.ts.map +1 -1
  2. package/lib/esm/ManageTab.js +3 -2
  3. package/lib/esm/ManageTabs.d.ts.map +1 -1
  4. package/lib/esm/ManageTabs.js +4 -21
  5. package/lib/esm/Routes.d.ts +0 -1
  6. package/lib/esm/Routes.d.ts.map +1 -1
  7. package/lib/esm/Routes.js +0 -6
  8. package/lib/esm/components/Configs/ConfigInLineEdit.js +1 -1
  9. package/lib/esm/components/Groups/GroupUserPermissionsSelect/GroupUserPermissionsSelect.js +1 -1
  10. package/lib/esm/components/Groups/ManageGroupUsers/ManageGroupUsers.d.ts.map +1 -1
  11. package/lib/esm/components/Groups/ManageGroupUsers/ManageGroupUsers.js +9 -0
  12. package/lib/esm/components/ManageBookmarkedAccountsTab/AddEditBookmarkModal.d.ts.map +1 -1
  13. package/lib/esm/components/ManageBookmarkedAccountsTab/AddEditBookmarkModal.js +24 -11
  14. package/lib/esm/components/ManageBookmarkedAccountsTab/BookmarkAccountSelector.d.ts.map +1 -1
  15. package/lib/esm/components/ManageBookmarkedAccountsTab/BookmarkAccountSelector.js +4 -4
  16. package/lib/esm/components/ManageBookmarkedAccountsTab/BookmarkGroupSelector.d.ts +3 -0
  17. package/lib/esm/components/ManageBookmarkedAccountsTab/BookmarkGroupSelector.d.ts.map +1 -1
  18. package/lib/esm/components/ManageBookmarkedAccountsTab/BookmarkGroupSelector.js +9 -23
  19. package/lib/esm/components/ManageBookmarkedAccountsTab/ManageGroupedBookmarkedAccountsTab.d.ts.map +1 -1
  20. package/lib/esm/components/ManageBookmarkedAccountsTab/ManageGroupedBookmarkedAccountsTab.js +45 -30
  21. package/lib/esm/components/ManagePreferences/sections/PreferencesCaseCreate.d.ts.map +1 -1
  22. package/lib/esm/components/ManagePreferences/sections/PreferencesCaseCreate.js +63 -54
  23. package/lib/esm/components/ManageTable/ManageTable.d.ts +0 -1
  24. package/lib/esm/components/ManageTable/ManageTable.d.ts.map +1 -1
  25. package/lib/esm/components/ManageTable/ManageTable.js +3 -4
  26. package/lib/esm/components/NotificationEmails/NotificationEmailsModal.d.ts.map +1 -1
  27. package/lib/esm/components/NotificationEmails/NotificationEmailsModal.js +1 -0
  28. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/AddNewCategoryDropDown.d.ts.map +1 -1
  29. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentCategoryContent/AddNewCategoryDropDown.js +29 -10
  30. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentEditor.d.ts.map +1 -1
  31. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentEditor.js +3 -1
  32. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentSuggestion/TopContentSuggestion.d.ts +6 -0
  33. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentSuggestion/TopContentSuggestion.d.ts.map +1 -0
  34. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentSuggestion/TopContentSuggestion.js +30 -0
  35. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentSuggestion/TopContentSuggestionHint.d.ts +8 -0
  36. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentSuggestion/TopContentSuggestionHint.d.ts.map +1 -0
  37. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentSuggestion/TopContentSuggestionHint.js +64 -0
  38. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentSuggestion/TopContentSuggestionHintAccept.d.ts +9 -0
  39. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentSuggestion/TopContentSuggestionHintAccept.d.ts.map +1 -0
  40. package/lib/esm/components/TopContentManagement/TopContentEditor/TopContentSuggestion/TopContentSuggestionHintAccept.js +142 -0
  41. package/lib/esm/components/TopContentManagement/TopContentProductVersionSelector.d.ts.map +1 -1
  42. package/lib/esm/components/TopContentManagement/TopContentProductVersionSelector.js +31 -30
  43. package/lib/esm/context/TopContentProvider.d.ts.map +1 -1
  44. package/lib/esm/context/TopContentProvider.js +1 -0
  45. package/lib/esm/reducers/TopContentReducer.d.ts +32 -2
  46. package/lib/esm/reducers/TopContentReducer.d.ts.map +1 -1
  47. package/lib/esm/reducers/TopContentReducer.js +82 -13
  48. package/lib/esm/scss/_main.scss +8 -0
  49. package/lib/esm/scss/_pf4-overrides.scss +22 -0
  50. package/package.json +10 -10
  51. package/lib/esm/components/ManagePartnerships/NonOrgCustomerInfoModal.d.ts +0 -2
  52. package/lib/esm/components/ManagePartnerships/NonOrgCustomerInfoModal.d.ts.map +0 -1
  53. package/lib/esm/components/ManagePartnerships/NonOrgCustomerInfoModal.js +0 -15
  54. package/lib/esm/components/ManagePartnerships/PartnerLinkNameForm.d.ts +0 -12
  55. package/lib/esm/components/ManagePartnerships/PartnerLinkNameForm.d.ts.map +0 -1
  56. package/lib/esm/components/ManagePartnerships/PartnerLinkNameForm.js +0 -21
  57. package/lib/esm/components/ManagePartnerships/PartnershipsList.d.ts +0 -2
  58. package/lib/esm/components/ManagePartnerships/PartnershipsList.d.ts.map +0 -1
  59. package/lib/esm/components/ManagePartnerships/PartnershipsList.js +0 -164
  60. package/lib/esm/components/ManagePartnerships/PartnershipsTermsModal.d.ts +0 -2
  61. package/lib/esm/components/ManagePartnerships/PartnershipsTermsModal.d.ts.map +0 -1
  62. package/lib/esm/components/ManagePartnerships/PartnershipsTermsModal.js +0 -97
  63. package/lib/esm/components/ManagePartnerships/PendingRequests.d.ts +0 -3
  64. package/lib/esm/components/ManagePartnerships/PendingRequests.d.ts.map +0 -1
  65. package/lib/esm/components/ManagePartnerships/PendingRequests.js +0 -190
  66. package/lib/esm/components/ManagePartnerships/RequestCollaborationModal.d.ts +0 -8
  67. package/lib/esm/components/ManagePartnerships/RequestCollaborationModal.d.ts.map +0 -1
  68. package/lib/esm/components/ManagePartnerships/RequestCollaborationModal.js +0 -130
  69. package/lib/esm/components/ManagePartnerships/index.d.ts +0 -2
  70. package/lib/esm/components/ManagePartnerships/index.d.ts.map +0 -1
  71. package/lib/esm/components/ManagePartnerships/index.js +0 -27
  72. package/lib/esm/context/ManagePartnershipsProvider.d.ts +0 -11
  73. package/lib/esm/context/ManagePartnershipsProvider.d.ts.map +0 -1
  74. package/lib/esm/context/ManagePartnershipsProvider.js +0 -26
  75. package/lib/esm/reducers/ManagePartnershipsReducer.d.ts +0 -16
  76. package/lib/esm/reducers/ManagePartnershipsReducer.d.ts.map +0 -1
  77. package/lib/esm/reducers/ManagePartnershipsReducer.js +0 -30
@@ -1 +1 @@
1
- {"version":3,"file":"ManageTab.d.ts","sourceRoot":"","sources":["../../src/ManageTab.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIxD,UAAU,MAAM;IACZ,GAAG,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;CAC7B;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,eAYtC"}
1
+ {"version":3,"file":"ManageTab.d.ts","sourceRoot":"","sources":["../../src/ManageTab.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGxD,UAAU,MAAM;IACZ,GAAG,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;CAC7B;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,eAkBtC"}
@@ -1,11 +1,12 @@
1
1
  import { ErrorBoundary } from '@rh-support/components';
2
2
  import React from 'react';
3
- import { Trans } from 'react-i18next';
3
+ import { Trans, useTranslation } from 'react-i18next';
4
4
  export function ManageTab(props) {
5
5
  const tab = props.tab;
6
+ const { t } = useTranslation();
6
7
  return (React.createElement(React.Fragment, null,
7
8
  React.createElement("pfe-tab", { role: "heading", slot: "tab", "data-tracking-id": tab['data-tracking-id'], onClick: tab.onClick },
8
9
  React.createElement(Trans, null, tab.title)),
9
10
  React.createElement("pfe-tab-panel", { role: "region", slot: "panel" },
10
- React.createElement(ErrorBoundary, { isPageLevelError: true }, tab.component))));
11
+ React.createElement(ErrorBoundary, { errorMsgInfo: t('There was an error loading manage tab. Please try refreshing the page.'), isPageLevelError: true }, tab.component))));
11
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ManageTabs.d.ts","sourceRoot":"","sources":["../../src/ManageTabs.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAoBvD,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,EAAE,CAAC,CAAC;CACvC;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,eAgKvC"}
1
+ {"version":3,"file":"ManageTabs.d.ts","sourceRoot":"","sources":["../../src/ManageTabs.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAmBvD,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,EAAE,CAAC,CAAC;CACvC;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,eAqIvC"}
@@ -1,13 +1,11 @@
1
1
  import { ErrorBoundary, useDocumentTitle } from '@rh-support/components';
2
- import { GlobalMetadataStateContext } from '@rh-support/react-context';
3
2
  import { ability, CaseDetailsFields, resourceActions, resources } from '@rh-support/user-permissions';
4
- import { CustomElements, getConfigField, PCM_CONFIG_FIELD_TYPE, requireCustomElement } from '@rh-support/utils';
3
+ import { CustomElements, requireCustomElement } from '@rh-support/utils';
5
4
  import map from 'lodash/map';
6
- import React, { useContext } from 'react';
5
+ import React from 'react';
7
6
  import { ConfigsTable } from './components/Configs/ConfigsTable';
8
7
  import { ManageGroupUsers } from './components/Groups/ManageGroupUsers';
9
8
  import { ManageGroupedBookmarkedAccountsTab } from './components/ManageBookmarkedAccountsTab';
10
- import { ManagePartnerships } from './components/ManagePartnerships/index';
11
9
  import { ManagePreferences } from './components/ManagePreferences';
12
10
  import { NotificationEmails } from './components/NotificationEmails/index';
13
11
  import { TopContentManagement } from './components/TopContentManagement';
@@ -23,9 +21,7 @@ requireCustomElement([
23
21
  export function ManageTabs(props) {
24
22
  var _a, _b;
25
23
  const history = props.routeProps.history;
26
- const { groupsRoute, bookmarkedAccountsRoute, topContentRoute, notificationEmailsRoute, preferencesRoute, configsRoute, partnershipsRoute, } = Routes.getPaths();
27
- const { globalMetadataState: { pcmConfig }, } = useContext(GlobalMetadataStateContext);
28
- const isPartnershipsEnabled = getConfigField(pcmConfig.data, 'isPartnershipEnabled', PCM_CONFIG_FIELD_TYPE.FEATURE_FLAG);
24
+ const { groupsRoute, bookmarkedAccountsRoute, topContentRoute, notificationEmailsRoute, preferencesRoute, configsRoute, } = Routes.getPaths();
29
25
  // Changes route and saves the current path to the url query params
30
26
  const isOnlyBasePath = history.location.pathname === Routes.basePath;
31
27
  useDocumentTitle(PageTitle.MANAGE);
@@ -38,7 +34,6 @@ export function ManageTabs(props) {
38
34
  const canViewCaseGroups = ability.can(resourceActions.READ, resources.CASE_GROUPS) && canViewManageTab;
39
35
  const canManageBookmarkAccounts = ability.can(resourceActions.CREATE, resources.BOOKMARK_ACCOUNTS) && canViewManageTab;
40
36
  const canViewEmailNotificationTab = ability.can(resourceActions.READ, resources.NOTIFICATION_EMAIL);
41
- const canViewPartnershipsTab = ability.can(resourceActions.READ, resources.PARTNERSHIPS);
42
37
  const canAddCustomNotification = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_SEND_NOTIFICATIONS);
43
38
  const canViewConfigsTab = ability.can(resourceActions.READ, resources.APP_INTERNAL_CONFIGS);
44
39
  const tabsToRender = [];
@@ -76,18 +71,6 @@ export function ManageTabs(props) {
76
71
  },
77
72
  component: React.createElement(NotificationEmails, null),
78
73
  });
79
- canViewPartnershipsTab &&
80
- isPartnershipsEnabled &&
81
- tabsToRender.push({
82
- title: 'Partnerships',
83
- key: 'partnerships-tab',
84
- 'data-tracking-id': 'partnerships-tab',
85
- routePath: partnershipsRoute,
86
- onClick: () => {
87
- changeRouteThunk(partnershipsRoute);
88
- },
89
- component: React.createElement(ManagePartnerships, null),
90
- });
91
74
  tabsToRender.push({
92
75
  title: 'Preferences',
93
76
  key: 'preferences-tab',
@@ -129,7 +112,7 @@ export function ManageTabs(props) {
129
112
  const getSelectedIndex = () => {
130
113
  if (isOnlyBasePath)
131
114
  return 0;
132
- const tabIndex = tabsToRender.findIndex((tab) => tab.routePath === history.location.pathname.substring(0, tab.routePath.length));
115
+ const tabIndex = tabsToRender.findIndex((tab) => tab.routePath === history.location.pathname);
133
116
  return tabIndex > -1 ? tabIndex : 0;
134
117
  };
135
118
  /**
@@ -14,7 +14,6 @@ interface ManageRoutes {
14
14
  savedSearches: Route;
15
15
  topContent: Route;
16
16
  preferences: Route;
17
- partnerships: Route;
18
17
  notificationEmails: Route;
19
18
  configs: Route;
20
19
  }
@@ -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,aAAa,EAAE,KAAK,CAAC;IACrB,UAAU,EAAE,KAAK,CAAC;IAClB,WAAW,EAAE,KAAK,CAAC;IACnB,YAAY,EAAE,KAAK,CAAC;IACpB,kBAAkB,EAAE,KAAK,CAAC;IAC1B,OAAO,EAAE,KAAK,CAAC;CAClB;AAED,eAAO,MAAM,MAAM,EAAE,YAyEpB,CAAC"}
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,WAAW,EAAE,KAAK,CAAC;IACnB,kBAAkB,EAAE,KAAK,CAAC;IAC1B,OAAO,EAAE,KAAK,CAAC;CAClB;AAED,eAAO,MAAM,MAAM,EAAE,YAmEpB,CAAC"}
package/lib/esm/Routes.js CHANGED
@@ -36,12 +36,6 @@ export const Routes = {
36
36
  return getPath(this);
37
37
  },
38
38
  },
39
- partnerships: {
40
- path: '/partnerships',
41
- getPath() {
42
- return getPath(this);
43
- },
44
- },
45
39
  notificationEmails: {
46
40
  path: '/notification-emails',
47
41
  getPath() {
@@ -32,7 +32,7 @@ export function ConfigInLineEdit(props) {
32
32
  }, [props.fieldValue]);
33
33
  return (React.createElement(React.Fragment, null,
34
34
  React.createElement(InlineEdit, { labelProps: { htmlFor: 'case-details-custom-email' }, allowInlineEdit: true, initialIsEditing: false, onSave: onSave, onCancel: onCancel, saveDisabled: input === props.fieldValue || props.isUpdating || hasLargeInput, loadingIndicator: React.createElement(LoadingIndicator, { show: props.isUpdating, isInline: true }) },
35
- React.createElement(TextAreaAutosize, { id: `config-value-${props.id}`, name: `config-value-${props.id}`, "aria-invalid": hasLargeInput, className: `form-control${hasLargeInput ? ' form-invalid' : ''}`, value: input, "data-tracking-id": "open-case-describe-ktQ1-issue", onChange: onChange, disabled: props.isUpdating }),
35
+ React.createElement(TextAreaAutosize, { id: `config-value-${props.id}`, name: `config-value-${props.id}`, "aria-invalid": hasLargeInput, className: `form-control${hasLargeInput ? ' form-invalid' : ''}`, value: input, "data-tracking-id": "manage-case-describe-ktQ1-issue", onChange: onChange, disabled: props.isUpdating }),
36
36
  hasLargeInput && (React.createElement("p", { className: "form-instructions form-invalid" },
37
37
  "Config value cannot be more than ",
38
38
  CONFIG_FIELD_VALUE_LIMIT,
@@ -72,6 +72,6 @@ export const GroupUserPermissionsSelect = (props) => {
72
72
  * 4. Non-org admins cannot see the manage tab itself and thus that check is not added.
73
73
  */
74
74
  return (React.createElement(React.Fragment, null,
75
- React.createElement(Select, { isDisabled: updateUsersFetch.isFetching || !props.account.hasGroupACLs, className: "permissions-select", "aria-label": t('User permissions'), onToggle: onToggle, onSelect: onSelect, onClear: onClear, selections: option, isOpen: isOpen, "aria-labelledby": t('User permissions'), placeholderText: t('Select a permission') }, Object.keys(options).map((key) => (React.createElement(SelectOption, { key: key, value: options[key], "data-tracking-id": `group-user-permission-${key}` }, t(options[key]))))),
75
+ React.createElement(Select, { isDisabled: updateUsersFetch.isFetching, className: "permissions-select", "aria-label": t('User permissions'), onToggle: onToggle, onSelect: onSelect, onClear: onClear, selections: option, isOpen: isOpen, "aria-labelledby": t('User permissions'), placeholderText: t('Select a permission') }, Object.keys(options).map((key) => (React.createElement(SelectOption, { key: key, value: options[key], "data-tracking-id": `group-user-permission-${key}` }, t(options[key]))))),
76
76
  React.createElement(LoadingIndicator, { show: updateUsersFetch.isFetching, size: "xs" })));
77
77
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ManageGroupUsers.d.ts","sourceRoot":"","sources":["../../../../../src/components/Groups/ManageGroupUsers/ManageGroupUsers.tsx"],"names":[],"mappings":"AAsBA,eAAO,MAAM,gBAAgB,mBAmM5B,CAAC"}
1
+ {"version":3,"file":"ManageGroupUsers.d.ts","sourceRoot":"","sources":["../../../../../src/components/Groups/ManageGroupUsers/ManageGroupUsers.tsx"],"names":[],"mappings":"AAuBA,eAAO,MAAM,gBAAgB,mBA6M5B,CAAC"}
@@ -14,12 +14,14 @@ 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
18
  import { ManageTable } from '../../ManageTable/ManageTable';
18
19
  import { DefaultGroupSwitch } from '../DefualtGroupSwitch';
19
20
  import { GroupSelect } from '../GroupSelect';
20
21
  import { GroupUserPermissionsSelect } from '../GroupUserPermissionsSelect';
21
22
  export const ManageGroupUsers = () => {
22
23
  const { t } = useTranslation();
24
+ const location = useLocation();
23
25
  const { globalMetadataState: { loggedInUsersAccount, loggedInUserRights }, } = useGlobalStateContext();
24
26
  const disableGroupSelect = !loggedInUsersAccount || !loggedInUsersAccount.data || !loggedInUsersAccount.data.accountNumber;
25
27
  const [selectedGroup, setSelectedGroup] = useState();
@@ -120,6 +122,13 @@ export const ManageGroupUsers = () => {
120
122
  setData(initialData);
121
123
  }
122
124
  }, [initialData, userSearch, setData, previousUserSearch, groupUsers]);
125
+ useEffect(() => {
126
+ if (location.pathname !== '/manage/groups') {
127
+ return;
128
+ }
129
+ setAllData(response || []);
130
+ // eslint-disable-next-line react-hooks/exhaustive-deps
131
+ }, [location.pathname]);
123
132
  return (React.createElement("section", { id: "manage-groups" },
124
133
  React.createElement(AlertMessage, { variant: AlertType.INFO, show: loggedInUserRights.data.isOrgAdmin() && !loggedInUsersAccount.data.hasGroupACLs, isInline: true, className: "pf-u-mb-md" },
125
134
  React.createElement(React.Fragment, null,
@@ -1 +1 @@
1
- {"version":3,"file":"AddEditBookmarkModal.d.ts","sourceRoot":"","sources":["../../../../src/components/ManageBookmarkedAccountsTab/AddEditBookmarkModal.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAStD,UAAU,MAAM;IACZ,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,MAAM,EAAE,CAAC,gBAAgB,EAAE,SAAS,EAAE,EAAE,aAAa,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACxE,gBAAgB,EAAE,SAAS,EAAE,CAAC;IAC9B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,uBAAuB,EAAE,SAAS,EAAE,CAAC;IACrC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,oBAAoB,UAAW,MAAM,gBAmIjD,CAAC"}
1
+ {"version":3,"file":"AddEditBookmarkModal.d.ts","sourceRoot":"","sources":["../../../../src/components/ManageBookmarkedAccountsTab/AddEditBookmarkModal.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAStD,UAAU,MAAM;IACZ,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,MAAM,EAAE,CAAC,gBAAgB,EAAE,SAAS,EAAE,EAAE,aAAa,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACxE,gBAAgB,EAAE,SAAS,EAAE,CAAC;IAC9B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,uBAAuB,EAAE,SAAS,EAAE,CAAC;IACrC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,oBAAoB,UAAW,MAAM,gBA2IjD,CAAC"}
@@ -10,6 +10,14 @@ export const AddEditBookmarkModal = (props) => {
10
10
  const [localSelectedBookmarks, setLocalSelectedBookmarks] = useState([]);
11
11
  const [isInValid, setIsInValid] = useState(false);
12
12
  const [saveButtonIsClicked, setSaveButtonIsClicked] = useState(false);
13
+ const [isPresentInGroups, setIsPresentInGroups] = useState(false);
14
+ const checkBookmarkPresent = () => {
15
+ if (!(props === null || props === void 0 ? void 0 : props.groups) || !(props === null || props === void 0 ? void 0 : props.selectedAccounts[0])) {
16
+ return false;
17
+ }
18
+ const firstSelectedGroup = props.selectedAccounts[0].bookmarkGroupName;
19
+ return props.groups.some((b) => b === selectedGroup && selectedGroup !== firstSelectedGroup);
20
+ };
13
21
  // only check if save button has been clicked once
14
22
  const checkIsInvalid = (group, selectedAccounts) => {
15
23
  const isInvalid = isEmpty(group === null || group === void 0 ? void 0 : group.trim()) || selectedAccounts.length === 0;
@@ -17,28 +25,34 @@ export const AddEditBookmarkModal = (props) => {
17
25
  };
18
26
  const resetModal = () => {
19
27
  setIsInValid(false);
28
+ setIsPresentInGroups(false);
20
29
  setSaveButtonIsClicked(false);
21
30
  };
22
31
  const save = () => {
23
32
  setSaveButtonIsClicked(true);
24
- if (isEmpty(selectedGroup === null || selectedGroup === void 0 ? void 0 : selectedGroup.trim()) || localSelectedBookmarks.length === 0) {
33
+ let isInvalid = isEmpty(selectedGroup === null || selectedGroup === void 0 ? void 0 : selectedGroup.trim()) || localSelectedBookmarks.length === 0;
34
+ //check if there is already a bookmark with this name
35
+ if (checkBookmarkPresent()) {
36
+ isInvalid = true;
37
+ setIsPresentInGroups(true);
38
+ }
39
+ else {
40
+ setIsPresentInGroups(false);
41
+ }
42
+ if (isInvalid) {
25
43
  setIsInValid(true);
26
44
  return;
27
45
  }
28
46
  resetModal();
29
47
  props.onSave(localSelectedBookmarks, selectedGroup === null || selectedGroup === void 0 ? void 0 : selectedGroup.trim());
30
48
  };
31
- const remove = () => {
32
- props.onRemove(selectedGroup);
33
- resetModal();
34
- props.onClose();
35
- };
36
49
  const close = () => {
37
50
  resetModal();
38
51
  props.onClose();
39
52
  };
40
53
  const onGroupInputBoxChanged = (group) => {
41
54
  setSelectedGroup(group);
55
+ setIsPresentInGroups(false);
42
56
  saveButtonIsClicked && checkIsInvalid(group, localSelectedBookmarks);
43
57
  };
44
58
  const onBookMarkAccountSelected = (selected) => {
@@ -56,19 +70,18 @@ export const AddEditBookmarkModal = (props) => {
56
70
  isEqual(props.selectedAccounts.map((a) => a.accountNumber).sort(), localSelectedBookmarks.map((a) => a.accountNumber).sort()) &&
57
71
  selectedGroup === ((_a = props.selectedAccounts[0]) === null || _a === void 0 ? void 0 : _a.bookmarkGroupName));
58
72
  };
59
- return (React.createElement(Modal, { id: "Add-edit-bookmark-modal", className: "pf-modal-overflow-visible", title: props.title, "aria-describedby": "Add-edit-bookmark-modal", isOpen: props.isOpen, onClose: props.onClose, showClose: true, onEscapePress: props.onClose, variant: ModalVariant.medium, actions: [
73
+ return (React.createElement(Modal, { id: "Add-edit-bookmark-modal", className: "pf-modal-overflow-visible", title: props.title, "aria-describedby": "Add-edit-bookmark-modal", isOpen: props.isOpen, onClose: close, showClose: true, onEscapePress: props.onClose, variant: ModalVariant.medium, actions: [
60
74
  React.createElement(Button, { key: "save", variant: ButtonVariant.primary, onClick: save, isDisabled: isInValid || isNothingIsChangedOnEditMode() },
61
75
  React.createElement(Trans, null, "Save")),
62
76
  React.createElement(Button, { key: "cancel", variant: props.addMode ? ButtonVariant.link : ButtonVariant.secondary, onClick: close },
63
77
  React.createElement(Trans, null, "Cancel")),
64
- !props.addMode && (React.createElement(Button, { key: "remove", variant: ButtonVariant.link, onClick: remove, isDisabled: !props.groups.includes(selectedGroup), style: props.groups.includes(selectedGroup) ? { color: '#a30000' } : {} },
65
- React.createElement(Trans, null, "Remove"))),
66
78
  ] },
67
79
  React.createElement("div", null,
68
80
  React.createElement("div", { className: "pf-u-mb-lg" },
81
+ React.createElement(BookmarkGroupSelector, { selectedGroup: selectedGroup, groups: props.groups, onGroupInputBoxChanged: onGroupInputBoxChanged, isInValid: isInValid && (isPresentInGroups || isEmpty(selectedGroup === null || selectedGroup === void 0 ? void 0 : selectedGroup.trim())), setIsInValid: setIsInValid, isPresentInGroups: isPresentInGroups })),
82
+ React.createElement("div", null,
69
83
  React.createElement("label", { id: "add-bookmark-account-on-add-modal" },
70
84
  React.createElement(Trans, null, "Account(s)"),
71
85
  React.createElement("span", { className: "form-required", "aria-hidden": true }, "*")),
72
- React.createElement(BookmarkAccountSelector, { defaultSelected: props.selectedAccounts, labelId: "add-bookmark-account-on-add-modal", bookmarkedGroupAccounts: props.bookmarkedGroupAccounts, onBookMarkAccountSelected: onBookMarkAccountSelected, addMode: props.addMode, isInValid: isInValid && isEmpty(localSelectedBookmarks) })),
73
- React.createElement(BookmarkGroupSelector, { selectedGroup: selectedGroup, groups: props.groups, onGroupInputBoxChanged: onGroupInputBoxChanged, isInValid: isInValid && isEmpty(selectedGroup === null || selectedGroup === void 0 ? void 0 : selectedGroup.trim()) }))));
86
+ React.createElement(BookmarkAccountSelector, { defaultSelected: props.selectedAccounts, labelId: "add-bookmark-account-on-add-modal", bookmarkedGroupAccounts: props.bookmarkedGroupAccounts, onBookMarkAccountSelected: onBookMarkAccountSelected, addMode: props.addMode, isInValid: isInValid && isEmpty(localSelectedBookmarks) })))));
74
87
  };
@@ -1 +1 @@
1
- {"version":3,"file":"BookmarkAccountSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ManageBookmarkedAccountsTab/BookmarkAccountSelector.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAGhF,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAUtD,UAAU,MAAM;IACZ,uBAAuB,EAAE,SAAS,EAAE,CAAC;IACrC,iBAAiB,CAAC,EAAE,kBAAkB,CAAC;IACvC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,yBAAyB,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,KAAK,IAAI,CAAC;IAC5D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,SAAS,EAAE,CAAC;IAC9B,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,eAyPpD;yBAzPe,uBAAuB"}
1
+ {"version":3,"file":"BookmarkAccountSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ManageBookmarkedAccountsTab/BookmarkAccountSelector.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAGhF,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAUtD,UAAU,MAAM;IACZ,uBAAuB,EAAE,SAAS,EAAE,CAAC;IACrC,iBAAiB,CAAC,EAAE,kBAAkB,CAAC;IACvC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,yBAAyB,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,KAAK,IAAI,CAAC;IAC5D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,SAAS,EAAE,CAAC;IAC9B,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,eAwPpD;yBAxPe,uBAAuB"}
@@ -103,16 +103,16 @@ export function BookmarkAccountSelector(props) {
103
103
  })
104
104
  .map((a) => a.accountNumber)) ||
105
105
  [];
106
- const removeAccountChip = (removedAccount) => {
106
+ const removeAccountLabel = (removedAccount) => {
107
107
  const updatedSelectedAccounts = remove(selected, (account) => account.accountNumber !== removedAccount.accountNumber);
108
108
  setSelected(updatedSelectedAccounts);
109
109
  props.onBookMarkAccountSelected(updatedSelectedAccounts);
110
110
  };
111
111
  const labelGroupComponent = () => {
112
- return (React.createElement(LabelGroup, { numLabels: 2 }, (selected || []).map((currentChip) => (React.createElement(Label, { key: currentChip.accountNumber, onClose: () => removeAccountChip(currentChip), isTruncated: false, color: "cyan" },
113
- currentChip.name,
112
+ return (React.createElement(LabelGroup, { numLabels: 2 }, (selected || []).map((currentLabel) => (React.createElement(Label, { key: currentLabel.accountNumber, onClose: () => removeAccountLabel(currentLabel), isTruncated: false, color: "cyan" },
113
+ currentLabel.name,
114
114
  " (",
115
- currentChip.accountNumber,
115
+ currentLabel.accountNumber,
116
116
  ")")))));
117
117
  };
118
118
  useEffect(() => {
@@ -1,8 +1,11 @@
1
+ import React from 'react';
1
2
  interface IProps {
2
3
  groups: string[];
3
4
  onGroupInputBoxChanged: (group: string) => void;
4
5
  selectedGroup: string;
5
6
  isInValid: boolean;
7
+ setIsInValid: React.Dispatch<React.SetStateAction<boolean>>;
8
+ isPresentInGroups: boolean;
6
9
  }
7
10
  declare const BookmarkGroupSelector: (props: IProps) => JSX.Element;
8
11
  export { BookmarkGroupSelector };
@@ -1 +1 @@
1
- {"version":3,"file":"BookmarkGroupSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ManageBookmarkedAccountsTab/BookmarkGroupSelector.tsx"],"names":[],"mappings":"AAKA,UAAU,MAAM;IACZ,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,sBAAsB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;CACtB;AAED,QAAA,MAAM,qBAAqB,UAAW,MAAM,gBAsE3C,CAAC;AAEF,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
1
+ {"version":3,"file":"BookmarkGroupSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ManageBookmarkedAccountsTab/BookmarkGroupSelector.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAGnD,UAAU,MAAM;IACZ,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,sBAAsB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IAC5D,iBAAiB,EAAE,OAAO,CAAC;CAC9B;AAED,QAAA,MAAM,qBAAqB,UAAW,MAAM,gBAkD3C,CAAC;AAEF,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
@@ -1,27 +1,11 @@
1
- import { Select, SelectOption, SelectVariant } from '@patternfly/react-core';
1
+ import { Form, FormGroup, TextInput } from '@patternfly/react-core';
2
2
  import React, { useEffect, useState } from 'react';
3
3
  import { Trans, useTranslation } from 'react-i18next';
4
4
  const BookmarkGroupSelector = (props) => {
5
5
  const { t } = useTranslation();
6
- const [isOpen, setIsOpen] = useState(false);
7
6
  const [validated, setValidated] = useState('default');
8
- const onToggle = (isOpen) => {
9
- setIsOpen(isOpen);
10
- };
11
- const onSelect = (event, selection, isPlaceholder) => {
12
- if (isPlaceholder)
13
- clearSelection();
14
- else {
15
- setIsOpen(false);
16
- props.onGroupInputBoxChanged(selection);
17
- }
18
- };
19
- const onCreateOption = (newValue) => {
20
- props.onGroupInputBoxChanged(newValue);
21
- };
22
- const clearSelection = () => {
23
- setIsOpen(false);
24
- props.onGroupInputBoxChanged('');
7
+ const onInputSave = (value) => {
8
+ props.onGroupInputBoxChanged(value);
25
9
  };
26
10
  useEffect(() => {
27
11
  if (props.isInValid) {
@@ -31,13 +15,15 @@ const BookmarkGroupSelector = (props) => {
31
15
  setValidated('default');
32
16
  }
33
17
  }, [props.isInValid]);
34
- const titleId = 'group-name-select';
18
+ const titleId = 'group-name-input';
35
19
  return (React.createElement(React.Fragment, null,
36
20
  React.createElement("label", { id: titleId },
37
21
  React.createElement(Trans, null, "Bookmark name"),
38
22
  React.createElement("span", { className: "form-required", "aria-hidden": true }, "*")),
39
- React.createElement(Select, { variant: SelectVariant.typeahead, typeAheadAriaLabel: t('Search for existing bookmarks or create a new one'), onToggle: onToggle, onSelect: onSelect, onClear: clearSelection, selections: props.selectedGroup, isOpen: isOpen, placeholderText: t('Search for existing bookmarks or create a new one'), isCreatable: true, noValidate: props.isInValid, onCreateOption: onCreateOption, "aria-labelledby": titleId, "aria-invalid": props.isInValid, "aria-describedby": "validated-helper", validated: validated }, props.groups.map((option, index) => (React.createElement(SelectOption, { key: index, value: option })))),
40
- React.createElement("p", { id: "validated-helper", className: `form-instructions ${props.isInValid ? 'form-invalid' : ''}` },
41
- React.createElement(Trans, null, "Enter a unique name to create a new bookmark or add accounts to an existing one."))));
23
+ React.createElement(Form, null,
24
+ React.createElement(FormGroup, { helperTextInvalid: props.isPresentInGroups
25
+ ? t('A bookmark with this name already exists')
26
+ : t('Add a name to your bookmark'), validated: validated },
27
+ React.createElement(TextInput, { value: props.selectedGroup, onChange: onInputSave, placeholder: t('Enter a unique name for your bookmark'), "aria-invalid": props.isInValid, validated: validated, selected: false, id: "bookmark-group-input", width: 200 })))));
42
28
  };
43
29
  export { BookmarkGroupSelector };
@@ -1 +1 @@
1
- {"version":3,"file":"ManageGroupedBookmarkedAccountsTab.d.ts","sourceRoot":"","sources":["../../../../src/components/ManageBookmarkedAccountsTab/ManageGroupedBookmarkedAccountsTab.tsx"],"names":[],"mappings":"AAyCA,UAAU,MAAM;IACZ,yBAAyB,EAAE,OAAO,CAAC;CACtC;AAED,wBAAgB,kCAAkC,CAAC,EAAE,yBAAyB,EAAE,EAAE,MAAM,eA6XvF"}
1
+ {"version":3,"file":"ManageGroupedBookmarkedAccountsTab.d.ts","sourceRoot":"","sources":["../../../../src/components/ManageBookmarkedAccountsTab/ManageGroupedBookmarkedAccountsTab.tsx"],"names":[],"mappings":"AA6CA,UAAU,MAAM;IACZ,yBAAyB,EAAE,OAAO,CAAC;CACtC;AAED,wBAAgB,kCAAkC,CAAC,EAAE,yBAAyB,EAAE,EAAE,MAAM,eA4YvF"}
@@ -7,7 +7,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { AlertVariant, Button, ButtonVariant, Label, LabelGroup, Popover, PopoverPosition, SearchInput, } from '@patternfly/react-core';
10
+ import { ActionList, ActionListItem, AlertVariant, Button, ButtonVariant, Label, LabelGroup, Popover, PopoverPosition, SearchInput, } from '@patternfly/react-core';
11
+ import PencilAltIcon from '@patternfly/react-icons/dist/esm/icons/pencil-alt-icon';
12
+ import TrashIcon from '@patternfly/react-icons/dist/esm/icons/trash-icon';
11
13
  import { defaultTableSortMethod, ErrorBoundary, ToastNotification, useConfirmation, } from '@rh-support/components';
12
14
  import { addEditbookmarks, getBookmarkGroups, removeGroupedBookmarks, removeWholeGroup, useGlobalDispatchContext, useGlobalStateContext, useGroupedBookmarkApiCalls, } from '@rh-support/react-context';
13
15
  import { ability, CaseListFields, resourceActions, resources } from '@rh-support/user-permissions';
@@ -15,6 +17,7 @@ import { promiseReflection } from '@rh-support/utils';
15
17
  import differenceBy from 'lodash/differenceBy';
16
18
  import groupBy from 'lodash/groupBy';
17
19
  import isEmpty from 'lodash/isEmpty';
20
+ import isUndefined from 'lodash/isUndefined';
18
21
  import uniq from 'lodash/uniq';
19
22
  import React, { useRef, useState } from 'react';
20
23
  import { Trans, useTranslation } from 'react-i18next';
@@ -94,7 +97,7 @@ export function ManageGroupedBookmarkedAccountsTab({ canManageBookmarkAccounts }
94
97
  });
95
98
  // remove already added accounts from selected accounts
96
99
  const accounts = selectedAccounts.filter((a) => !alreadyAdded.includes(a.accountNumber));
97
- if (accounts.length === 0 && accountsRemovedFromGroup.length === 0) {
100
+ if (isEmpty(accounts) && isEmpty(accountsRemovedFromGroup)) {
98
101
  // clear the account selector inputbox
99
102
  if (isInAddMode) {
100
103
  setLocalSelectedAccounts([]);
@@ -104,15 +107,29 @@ export function ManageGroupedBookmarkedAccountsTab({ canManageBookmarkAccounts }
104
107
  return;
105
108
  }
106
109
  try {
107
- if (group === selectedGroupOnEdit) {
108
- accountsRemovedFromGroup.map((account) => __awaiter(this, void 0, void 0, function* () { return yield apiCalls.removeAccountApiCalls(account); }));
109
- }
110
- // add bookmarks
111
110
  let response = undefined;
112
- if (accounts.length !== 0) {
111
+ if (isInAddMode) {
113
112
  response = yield apiCalls.addBookmarksApiCall(accounts, group);
114
113
  }
115
- addEditbookmarks(dispatchGlobalContext, bookmarkedGroupAccounts.data, response, accounts, group, group === selectedGroupOnEdit ? accountsRemovedFromGroup : []);
114
+ else {
115
+ if (!isEmpty(accountsRemovedFromGroup)) {
116
+ yield Promise.all(accountsRemovedFromGroup.map((account) => apiCalls.removeAccountApiCalls(account)));
117
+ }
118
+ const rootBookmarkId = allGroups[selectedGroupOnEdit][0].rootBookmarkId;
119
+ // if we are renaming bookmark then call edit bookmark api
120
+ if (group !== selectedGroupOnEdit) {
121
+ // already existing bookmark accounts are deleted and new bookmark accounts are generated for this group
122
+ response = yield apiCalls.editBookmarkApiCall(selectedAccounts, group, rootBookmarkId);
123
+ selectedAccounts.forEach((a) => {
124
+ if (!isUndefined(a.bookmarkId))
125
+ accountsRemovedFromGroup.push(a);
126
+ });
127
+ }
128
+ else if (!isEmpty(accounts)) {
129
+ response = yield apiCalls.addBookmarksApiCall(accounts, group);
130
+ }
131
+ }
132
+ addEditbookmarks(dispatchGlobalContext, bookmarkedGroupAccounts.data, response, accounts, group, accountsRemovedFromGroup);
116
133
  // clear the account selector inputbox
117
134
  clearRef.current();
118
135
  ToastNotification.addSuccessMessage(t(`Account has been successfully updated`));
@@ -194,7 +211,7 @@ export function ManageGroupedBookmarkedAccountsTab({ canManageBookmarkAccounts }
194
211
  sortable: true,
195
212
  id: 'bookmark-group-name',
196
213
  title: t('Bookmark name'),
197
- cellWidth: 25,
214
+ cellWidth: 20,
198
215
  sortMethod: (a, b) => defaultTableSortMethod(a.toLowerCase(), b.toLowerCase()),
199
216
  },
200
217
  {
@@ -208,23 +225,20 @@ export function ManageGroupedBookmarkedAccountsTab({ canManageBookmarkAccounts }
208
225
  account.accountNumber,
209
226
  ")"))))),
210
227
  },
228
+ {
229
+ id: 'bookmark-actions',
230
+ title: '',
231
+ sortable: false,
232
+ cellWidth: 10,
233
+ cell: (group) => (React.createElement(ActionList, { isIconList: true },
234
+ React.createElement(ActionListItem, null,
235
+ React.createElement(Button, { variant: "plain", onClick: () => onOpenEditGroupOpenModal(group) },
236
+ React.createElement(PencilAltIcon, null))),
237
+ React.createElement(ActionListItem, null,
238
+ React.createElement(Button, { variant: "plain", onClick: () => removeGroup(group) },
239
+ React.createElement(TrashIcon, null))))),
240
+ },
211
241
  ];
212
- const actionResolver = (rowData) => {
213
- //@ts-ignore
214
- const group = (rowData === null || rowData === void 0 ? void 0 : rowData.cells[0]) || '';
215
- return [
216
- {
217
- title: 'Edit',
218
- onClick: () => onOpenEditGroupOpenModal(group),
219
- itemKey: 'edit-bookmaked-group',
220
- },
221
- {
222
- title: 'Remove',
223
- onClick: () => removeGroup(group),
224
- itemKey: 'remove-bookmaked-group',
225
- },
226
- ];
227
- };
228
242
  const isValid = () => {
229
243
  return !localSelectedAccounts || localSelectedAccounts.length === 0;
230
244
  };
@@ -242,24 +256,25 @@ export function ManageGroupedBookmarkedAccountsTab({ canManageBookmarkAccounts }
242
256
  React.createElement("a", { href: "https://source.redhat.com/communitiesatredhat/applications/integration-community-of-practice/misplaced/lostnfound/bookmarking", target: "_blank", rel: "noopener noreferrer" },
243
257
  ' ',
244
258
  "bookmarks in the customer support tool"))), closeBtnAriaLabel: "Close" },
245
- React.createElement("i", { "aria-label": "Cluster Id Info", className: "m-l-1 fa fa-question-circle" }))))),
259
+ React.createElement("i", { "aria-label": "Cluster Id Info", className: "m-l-1 fa fa-info-circle" }))))),
246
260
  React.createElement("div", { className: "toolbar" },
247
261
  React.createElement("form", { className: "toolbar-left" },
248
262
  React.createElement("label", { htmlFor: "bookmark-account-selector" },
249
- React.createElement(Trans, null, "Bookmark")),
263
+ React.createElement(Trans, null, "Search accounts")),
250
264
  React.createElement("span", { className: "bookmark-account" },
251
265
  React.createElement(BookmarkAccountSelector, { clearRef: clearRef, labelId: "bookmark-account-selector", isDisabled: !loggedInUserRights.data.isInternal() || !canBookmarkAccounts, bookmarkedGroupAccounts: bookmarkedGroupAccounts.data, onBookMarkAccountSelected: onBookMarkAccountSelected, addMode: true, isInValid: false })),
252
266
  React.createElement("span", { className: "pf-u-ml-sm" },
253
267
  React.createElement(Button, { variant: ButtonVariant.primary, isInline: true, onClick: onOpenAddBookmarkModal, "data-tracking-id": "bookmark-add-button", isDisabled: isValid() || apiCalls.isAddingBookmark },
254
- React.createElement(Trans, null, "Add")))),
268
+ React.createElement(Trans, null, "Add bookmark")))),
255
269
  React.createElement("div", { className: "toolbar-right" },
256
270
  React.createElement("label", { htmlFor: "search-bookmark-account-selector" },
257
271
  React.createElement(Trans, null, "Filter by")),
258
272
  React.createElement(SearchInput, { className: "pf-u-flex-grow-1 pf-c-search-input pf-u-background-color-100", value: searchString, id: "search-bookmark-account-selector", placeholder: t('Search for a bookmark'), "aria-label": t('Filter by searching for a bookmark'), onChange: setSearchString, onClear: () => setSearchString('') }))),
259
- React.createElement(AddEditBookmarkModal, { selectedAccounts: isInAddMode ? localSelectedAccounts : editGroupSelectedAccounts, groups: groups, isOpen: isUpdateBookmarkModalOpen, onSave: onAddEditBookmarksSave, onClose: closeAddEditBookmarkModal, onRemove: removeGroup, bookmarkedGroupAccounts: bookmarkedGroupAccounts.data, addMode: isInAddMode, title: isInAddMode ? t('Create or add to an existing bookmark') : t('Edit bookmark') }),
273
+ React.createElement(AddEditBookmarkModal, { selectedAccounts: isInAddMode ? localSelectedAccounts : editGroupSelectedAccounts, groups: groups, isOpen: isUpdateBookmarkModalOpen, onSave: onAddEditBookmarksSave, onClose: closeAddEditBookmarkModal, onRemove: removeGroup, bookmarkedGroupAccounts: bookmarkedGroupAccounts.data, addMode: isInAddMode, title: isInAddMode ? t('Add a bookmark') : t('Edit bookmark') }),
260
274
  React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading bookmarked accounts list') } },
261
275
  React.createElement(ManageTable, { ariaLabel: t('Table to manage bookmarks'), columns: columns, data: groupNames, sortInfo: { column: 'bookmark-group-name', direction: 'asc' }, errorVariant: AlertVariant.warning, isFetching: bookmarkedGroupAccounts.isFetching ||
262
276
  loggedInUser.isFetching ||
263
277
  apiCalls.isAddingBookmark ||
264
- apiCalls.isRemovingBookmark, isError: bookmarkedGroupAccounts.isError, errorTitle: t('Bookmarked accounts error'), errorComponent: React.createElement(Trans, null, "Could not get bookmarked accounts"), actionResolver: bookmarkedGroupAccounts.data.length !== 0 ? actionResolver : null, noResultText: t('There are no results to display. Try adding a bookmark or refining your search') }))));
278
+ apiCalls.isRemovingBookmark ||
279
+ apiCalls.isEditingBookmark, isError: bookmarkedGroupAccounts.isError, errorTitle: t('Bookmarked accounts error'), errorComponent: React.createElement(Trans, null, "Could not get bookmarked accounts"), noResultText: t('There are no results to display. Try adding a bookmark or refining your search') }))));
265
280
  }
@@ -1 +1 @@
1
- {"version":3,"file":"PreferencesCaseCreate.d.ts","sourceRoot":"","sources":["../../../../../src/components/ManagePreferences/sections/PreferencesCaseCreate.tsx"],"names":[],"mappings":"AAoBA,UAAU,MAAM;CAAG;AACnB,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,eAkKlD"}
1
+ {"version":3,"file":"PreferencesCaseCreate.d.ts","sourceRoot":"","sources":["../../../../../src/components/ManagePreferences/sections/PreferencesCaseCreate.tsx"],"names":[],"mappings":"AAoBA,UAAU,MAAM;CAAG;AACnB,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,eAwLlD"}