@rh-support/manage 2.5.227 → 2.5.230

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.
@@ -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;AAclE,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,EAAE,CAAC,CAAC;IACpC,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,qBA2MvC"}
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"}
@@ -1,6 +1,6 @@
1
1
  import { Tab, TabContent, Tabs, TabsComponent, TabTitleText } from '@patternfly/react-core';
2
2
  import { ErrorBoundary, useDocumentTitle } from '@rh-support/components';
3
- import { ability, resourceActions, resources } from '@rh-support/user-permissions';
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';
@@ -12,7 +12,7 @@ import { ExpiredContentManagement } from './components/ManageExpiredContents/Exp
12
12
  import { ManagePartnerships } from './components/ManagePartnerships/index';
13
13
  import { ManagePreferences } from './components/ManagePreferences';
14
14
  import { TagsManagement } from './components/ManageTags';
15
- // import { NotificationEmails } from './components/NotificationEmails/index';
15
+ import { NotificationEmails } from './components/NotificationEmails/index';
16
16
  import { TopContentManagement } from './components/TopContentManagement';
17
17
  import { PageTitle } from './constants/pageTitle';
18
18
  import { Routes } from './Routes';
@@ -21,21 +21,15 @@ export function ManageTabs(props) {
21
21
  const [activeTabKey, setActiveTabKey] = useState(0);
22
22
  const { activeTab } = useParams();
23
23
  const { t } = useTranslation();
24
- const { groupsRoute, bookmarkedAccountsRoute, topContentRoute,
25
- // notificationEmailsRoute,
26
- preferencesRoute, configsRoute, partnershipsRoute, tagsManagerRoute, expiredContentRoute, } = Routes.getPaths();
24
+ const { groupsRoute, bookmarkedAccountsRoute, topContentRoute, notificationEmailsRoute, preferencesRoute, configsRoute, partnershipsRoute, tagsManagerRoute, expiredContentRoute, } = Routes.getPaths();
27
25
  useDocumentTitle(PageTitle.MANAGE);
28
26
  const canViewManageTab = ability.can(resourceActions.READ, resources.MANAGE);
29
27
  const canViewManageTopContent = ability.can(resourceActions.READ, resources.TOP_CONTENT) && canViewManageTab;
30
28
  const canViewCaseGroups = ability.can(resourceActions.READ, resources.CASE_GROUPS) && canViewManageTab;
31
29
  const canManageBookmarkAccounts = ability.can(resourceActions.CREATE, resources.BOOKMARK_ACCOUNTS) && canViewManageTab;
32
- // const canViewEmailNotificationTab = ability.can(resourceActions.READ, resources.NOTIFICATION_EMAIL);
30
+ const canViewEmailNotificationTab = ability.can(resourceActions.READ, resources.NOTIFICATION_EMAIL);
33
31
  const canViewPartnershipsTab = ability.can(resourceActions.READ, resources.PARTNERSHIPS);
34
- // const canAddCustomNotification = ability.can(
35
- // resourceActions.PATCH,
36
- // resources.CASE_DETAILS,
37
- // CaseDetailsFields.CASE_DETAILS_SEND_NOTIFICATIONS
38
- // );
32
+ const canAddCustomNotification = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_SEND_NOTIFICATIONS);
39
33
  const canViewConfigsTab = ability.can(resourceActions.READ, resources.APP_INTERNAL_CONFIGS);
40
34
  const tabsToRender = [];
41
35
  canManageBookmarkAccounts &&
@@ -56,7 +50,6 @@ export function ManageTabs(props) {
56
50
  component: React.createElement(ManageGroupUsers, null),
57
51
  id: 'manage-groups',
58
52
  });
59
- /* TODO: Re-enable notification emails tab when ready
60
53
  canViewEmailNotificationTab &&
61
54
  canAddCustomNotification &&
62
55
  tabsToRender.push({
@@ -64,10 +57,9 @@ export function ManageTabs(props) {
64
57
  key: 'notification-emails-tab',
65
58
  'data-tracking-id': 'notification-emails-tab',
66
59
  routePath: notificationEmailsRoute,
67
- component: <NotificationEmails />,
60
+ component: React.createElement(NotificationEmails, null),
68
61
  id: 'notification-emails',
69
62
  });
70
- */
71
63
  canViewPartnershipsTab &&
72
64
  tabsToRender.push({
73
65
  title: 'Partnerships',
@@ -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;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,sBA+iBxC,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"}
@@ -104,7 +104,9 @@ export const GroupSelect = (props) => {
104
104
  deleteGroupFetch.isFetching ||
105
105
  duplicateGroupFetch.isFetching;
106
106
  const onChange = (e, value) => {
107
- setIsOpen(true);
107
+ if (!showInput) {
108
+ setIsOpen(true);
109
+ }
108
110
  setInput(value);
109
111
  if (value !== input) {
110
112
  setShouldFilter(true);
@@ -112,7 +114,7 @@ export const GroupSelect = (props) => {
112
114
  };
113
115
  useEffect(() => setInput(selectedGroup), [selectedGroup]);
114
116
  useEffect(() => {
115
- if (input && input != selectedGroup) {
117
+ if (!showInput && input && input != selectedGroup) {
116
118
  if (!isOpen) {
117
119
  setIsOpen(true);
118
120
  }
@@ -120,7 +122,7 @@ export const GroupSelect = (props) => {
120
122
  setFocusedItemIndex(-1);
121
123
  setActiveItem(null);
122
124
  // eslint-disable-next-line react-hooks/exhaustive-deps
123
- }, [input]);
125
+ }, [input, showInput]);
124
126
  // group actions
125
127
  function setGroupOnFetch(groupName) {
126
128
  return __awaiter(this, void 0, void 0, function* () {
@@ -252,6 +254,7 @@ export const GroupSelect = (props) => {
252
254
  });
253
255
  useEffect(() => {
254
256
  if (action === actions.rename || action === actions.duplicate || action === actions.create) {
257
+ setIsOpen(false);
255
258
  setShowDropdown(false);
256
259
  setShowInput(true);
257
260
  action === actions.duplicate && setInput(`${selectedGroup} Duplicate`);
@@ -275,6 +278,7 @@ export const GroupSelect = (props) => {
275
278
  }
276
279
  }, [caseGroups.isFetching, caseGroups.isError, props.isDisabled, disableOnFetch, selectedGroup]);
277
280
  const onGroupActionCancel = () => {
281
+ setIsOpen(false);
278
282
  setShowInput(false);
279
283
  setShowDropdown(hasGroupPermissions);
280
284
  setAction('');
@@ -1 +1 @@
1
- {"version":3,"file":"PreferencesACL.d.ts","sourceRoot":"","sources":["../../../../../src/components/ManagePreferences/sections/PreferencesACL.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAKpD,wBAAgB,cAAc,sBAuF7B"}
1
+ {"version":3,"file":"PreferencesACL.d.ts","sourceRoot":"","sources":["../../../../../src/components/ManagePreferences/sections/PreferencesACL.tsx"],"names":[],"mappings":"AASA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAKpD,wBAAgB,cAAc,sBAwF7B"}
@@ -11,14 +11,15 @@ import { accounts } from '@cee-eng/hydrajs';
11
11
  import { Card, CardBody, CardHeader, Spinner, Tooltip } from '@patternfly/react-core';
12
12
  import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
13
13
  import { useFetch } from '@rh-support/components';
14
- import { GlobalMetadataStateContext } from '@rh-support/react-context';
14
+ import { fetchLoggedInUsersAccount, GlobalMetadataDispatchContext, GlobalMetadataStateContext, } from '@rh-support/react-context';
15
15
  import React, { useContext, useState } from 'react';
16
16
  import { Trans, useTranslation } from 'react-i18next';
17
17
  import { PreferenceSwitch } from '../components/PreferenceSwitch';
18
18
  export function PreferencesACL() {
19
19
  var _a;
20
20
  const { t } = useTranslation();
21
- const { globalMetadataState: { loggedInUsersAccount }, } = useContext(GlobalMetadataStateContext);
21
+ const { globalMetadataState: { loggedInUsersAccount, loggedInUserJwtToken }, } = useContext(GlobalMetadataStateContext);
22
+ const dispatchToGlobalMetadataReducer = useContext(GlobalMetadataDispatchContext);
22
23
  const [isAclActivated, setIsAclActivated] = useState((_a = loggedInUsersAccount.data) === null || _a === void 0 ? void 0 : _a.hasGroupACLs);
23
24
  const [isAclLoading, setIsAclLoading] = useState(false);
24
25
  const { request: updateAcl } = useFetch(accounts.updateAcl);
@@ -26,7 +27,7 @@ export function PreferencesACL() {
26
27
  try {
27
28
  setIsAclLoading(true);
28
29
  yield updateAcl(!isAclActivated, loggedInUsersAccount.data.accountNumber);
29
- // TODO: migrate to GraphQL - fetchLoggedInUsersAccount(dispatchToGlobalMetadataReducer, loggedInUserJwtToken, true, apolloClient);
30
+ fetchLoggedInUsersAccount(dispatchToGlobalMetadataReducer, loggedInUserJwtToken, true);
30
31
  setIsAclActivated(!isAclActivated);
31
32
  }
32
33
  catch (error) {
@@ -1 +1 @@
1
- {"version":3,"file":"PreferencesCaseCreate.d.ts","sourceRoot":"","sources":["../../../../../src/components/ManagePreferences/sections/PreferencesCaseCreate.tsx"],"names":[],"mappings":"AAeA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAO/D,UAAU,MAAM;CAAG;AACnB,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,qBA2MlD"}
1
+ {"version":3,"file":"PreferencesCaseCreate.d.ts","sourceRoot":"","sources":["../../../../../src/components/ManagePreferences/sections/PreferencesCaseCreate.tsx"],"names":[],"mappings":"AAcA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAO/D,UAAU,MAAM;CAAG;AACnB,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,qBA0MlD"}
@@ -7,7 +7,6 @@ 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 { useApolloClient } from '@apollo/client/react';
11
10
  import { publicApi } from '@cee-eng/hydrajs';
12
11
  import { Card, CardBody, CardHeader, SelectOption } from '@patternfly/react-core';
13
12
  import { ToastNotification, useFetch } from '@rh-support/components';
@@ -23,7 +22,6 @@ import { PreferenceSelect } from '../components/PreferenceSelect';
23
22
  export function PreferencesCaseCreate(props) {
24
23
  const { t } = useTranslation();
25
24
  const location = useLocation();
26
- const apolloClient = useApolloClient();
27
25
  const { globalMetadataState: { caseGroups, caseLanguages, loggedInUserJwtToken, loggedInUserRights, loggedInUsersAccount, }, } = useContext(GlobalMetadataStateContext);
28
26
  const dispatchToGlobalMetadataReducer = useContext(GlobalMetadataDispatchContext);
29
27
  const languageConst = caseLanguages.data;
@@ -138,10 +136,10 @@ export function PreferencesCaseCreate(props) {
138
136
  }, [location.pathname]);
139
137
  useEffect(() => {
140
138
  if (haventLoadedMetadata(caseLanguages)) {
141
- fetchLanguageMetadata(dispatchToGlobalMetadataReducer, apolloClient);
139
+ fetchLanguageMetadata(dispatchToGlobalMetadataReducer);
142
140
  }
143
141
  // eslint-disable-next-line react-hooks/exhaustive-deps
144
- }, [caseLanguages, apolloClient]);
142
+ }, [caseLanguages]);
145
143
  return (React.createElement(Card, { variant: "secondary", className: "preference-card" },
146
144
  React.createElement(CardHeader, null,
147
145
  React.createElement("h3", null,
@@ -1 +1 @@
1
- {"version":3,"file":"PreferencesCaseView.d.ts","sourceRoot":"","sources":["../../../../../src/components/ManagePreferences/sections/PreferencesCaseView.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAO/D,UAAU,MAAM;CAAG;AAEnB,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,qBAmShD"}
1
+ {"version":3,"file":"PreferencesCaseView.d.ts","sourceRoot":"","sources":["../../../../../src/components/ManagePreferences/sections/PreferencesCaseView.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAO/D,UAAU,MAAM;CAAG;AAEnB,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,qBAqShD"}
@@ -11,7 +11,7 @@ import { accounts } from '@cee-eng/hydrajs';
11
11
  import { Card, CardBody, CardHeader, Popover, PopoverPosition, SelectOption, Spinner, TextArea, Tooltip, } from '@patternfly/react-core';
12
12
  import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
13
13
  import { EditorMode, ToastNotification, useFetch } from '@rh-support/components';
14
- import { GlobalMetadataStateContext } from '@rh-support/react-context';
14
+ import { fetchLoggedInUsersAccount, GlobalMetadataDispatchContext, GlobalMetadataStateContext, } from '@rh-support/react-context';
15
15
  import { ability, CaseListFields, resourceActions, resources } from '@rh-support/user-permissions';
16
16
  import debounce from 'lodash/debounce';
17
17
  import isEmpty from 'lodash/isEmpty';
@@ -23,7 +23,8 @@ import { PreferenceSwitch } from '../components/PreferenceSwitch';
23
23
  export function PreferencesCaseView(props) {
24
24
  const { t } = useTranslation();
25
25
  const { updateCommentType, getCommentTypeFromPreference, getCommentSignature, updateCommentSignature, getOriginalCaseView, updateOriginalCaseView, } = useUserPreferences();
26
- const { globalMetadataState: { loggedInUsersAccount, loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
26
+ const { globalMetadataState: { loggedInUsersAccount, loggedInUserJwtToken, loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
27
+ const dispatchToGlobalMetadataReducer = useContext(GlobalMetadataDispatchContext);
27
28
  const [isSharingHostNames, setIsSharingHostNames] = useState(false);
28
29
  const [localCommentSignature, setLocalCommentSignature] = useState('');
29
30
  const [originalCommentType, setOriginalCommentType] = useState('');
@@ -169,7 +170,7 @@ export function PreferencesCaseView(props) {
169
170
  try {
170
171
  setIsHostnamesLoading(true);
171
172
  yield updateShareHostnames(!isSharingHostNames, accountNumber);
172
- // TODO: migrate to GraphQL - fetchLoggedInUsersAccount(dispatchToGlobalMetadataReducer, loggedInUserJwtToken, true, apolloClient);
173
+ fetchLoggedInUsersAccount(dispatchToGlobalMetadataReducer, loggedInUserJwtToken, true);
173
174
  setIsSharingHostNames(!isSharingHostNames);
174
175
  }
175
176
  catch (error) {
@@ -1 +1 @@
1
- {"version":3,"file":"useVersionsDiffer.d.ts","sourceRoot":"","sources":["../../../src/hooks/useVersionsDiffer.tsx"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAAI,qBAAqB,MAAM,EAAE,sBAAsB,MAAM,KAAG,CAAC,OAAO,EAAE,MAAM,EAAE,CAwD/G,CAAC"}
1
+ {"version":3,"file":"useVersionsDiffer.d.ts","sourceRoot":"","sources":["../../../src/hooks/useVersionsDiffer.tsx"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAAI,qBAAqB,MAAM,EAAE,sBAAsB,MAAM,KAAG,CAAC,OAAO,EAAE,MAAM,EAAE,CAuD/G,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/manage",
3
- "version": "2.5.227",
3
+ "version": "2.5.230",
4
4
  "description": "Customer Support Manage App",
5
5
  "author": "Jordan Eudy <jeudy100@gmail.com>",
6
6
  "license": "ISC",
@@ -75,12 +75,12 @@
75
75
  "@patternfly/patternfly": "6.2.1",
76
76
  "@patternfly/react-core": "6.2.1",
77
77
  "@patternfly/react-table": "6.2.1",
78
- "@rh-support/components": "2.5.165",
78
+ "@rh-support/components": "2.5.182",
79
79
  "@rh-support/configs": "2.0.75",
80
- "@rh-support/react-context": "2.5.275",
80
+ "@rh-support/react-context": "2.5.276",
81
81
  "@rh-support/types": "2.0.26",
82
- "@rh-support/user-permissions": "2.5.127",
83
- "@rh-support/utils": "2.5.110",
82
+ "@rh-support/user-permissions": "2.5.128",
83
+ "@rh-support/utils": "2.5.92",
84
84
  "@types/react-beautiful-dnd": "^13.0.0",
85
85
  "i18next": "^23.15.0",
86
86
  "lodash": ">=4.17.15",
@@ -99,5 +99,5 @@
99
99
  "defaults and supports es6-module",
100
100
  "maintained node versions"
101
101
  ],
102
- "gitHead": "d1a226af32eb5997a31c34001b6146be141c8911"
102
+ "gitHead": "ab00ab0180e7ed16e1d170328e568a0aba4599c3"
103
103
  }