@rh-support/manage 2.5.271 → 2.5.275

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 (56) hide show
  1. package/lib/esm/ManageTabs.d.ts.map +1 -1
  2. package/lib/esm/ManageTabs.js +46 -18
  3. package/lib/esm/Routes.d.ts +1 -0
  4. package/lib/esm/Routes.d.ts.map +1 -1
  5. package/lib/esm/Routes.js +6 -0
  6. package/lib/esm/components/Groups/AddMembersModal/AddMembersModal.d.ts +12 -0
  7. package/lib/esm/components/Groups/AddMembersModal/AddMembersModal.d.ts.map +1 -0
  8. package/lib/esm/components/Groups/AddMembersModal/AddMembersModal.js +80 -0
  9. package/lib/esm/components/Groups/AddMembersModal/index.d.ts +2 -0
  10. package/lib/esm/components/Groups/AddMembersModal/index.d.ts.map +1 -0
  11. package/lib/esm/components/Groups/AddMembersModal/index.js +1 -0
  12. package/lib/esm/components/Groups/DefualtGroupSwitch/DefaultGroupSwitch.d.ts +5 -3
  13. package/lib/esm/components/Groups/DefualtGroupSwitch/DefaultGroupSwitch.d.ts.map +1 -1
  14. package/lib/esm/components/Groups/DefualtGroupSwitch/DefaultGroupSwitch.js +21 -14
  15. package/lib/esm/components/Groups/GroupSelect/GroupSelect.d.ts +1 -0
  16. package/lib/esm/components/Groups/GroupSelect/GroupSelect.d.ts.map +1 -1
  17. package/lib/esm/components/Groups/GroupSelect/GroupSelect.js +160 -85
  18. package/lib/esm/components/Groups/ManageGroupUsers/ManageGroupUsers.d.ts.map +1 -1
  19. package/lib/esm/components/Groups/ManageGroupUsers/ManageGroupUsers.js +163 -42
  20. package/lib/esm/components/ManageCaseLabels/AddEditCaseLabelModal.d.ts +19 -0
  21. package/lib/esm/components/ManageCaseLabels/AddEditCaseLabelModal.d.ts.map +1 -0
  22. package/lib/esm/components/ManageCaseLabels/AddEditCaseLabelModal.js +83 -0
  23. package/lib/esm/components/ManageCaseLabels/ManageCaseLabelsTab.d.ts +3 -0
  24. package/lib/esm/components/ManageCaseLabels/ManageCaseLabelsTab.d.ts.map +1 -0
  25. package/lib/esm/components/ManageCaseLabels/ManageCaseLabelsTab.js +217 -0
  26. package/lib/esm/components/ManageCaseLabels/index.d.ts +2 -0
  27. package/lib/esm/components/ManageCaseLabels/index.d.ts.map +1 -0
  28. package/lib/esm/components/ManageCaseLabels/index.js +1 -0
  29. package/lib/esm/components/ManageCaseLabels/types.d.ts +6 -0
  30. package/lib/esm/components/ManageCaseLabels/types.d.ts.map +1 -0
  31. package/lib/esm/components/ManageCaseLabels/types.js +1 -0
  32. package/lib/esm/components/ManagePreferences/sections/PreferencesACL.d.ts.map +1 -1
  33. package/lib/esm/components/ManagePreferences/sections/PreferencesACL.js +3 -4
  34. package/lib/esm/components/ManagePreferences/sections/PreferencesCaseCreate.d.ts.map +1 -1
  35. package/lib/esm/components/ManagePreferences/sections/PreferencesCaseCreate.js +73 -58
  36. package/lib/esm/components/ManagePreferences/sections/PreferencesCaseView.d.ts.map +1 -1
  37. package/lib/esm/components/ManagePreferences/sections/PreferencesCaseView.js +43 -98
  38. package/lib/esm/constants/GroupSelectActions.d.ts +2 -1
  39. package/lib/esm/constants/GroupSelectActions.d.ts.map +1 -1
  40. package/lib/esm/constants/GroupSelectActions.js +1 -0
  41. package/lib/esm/hooks/useCaseGroupGraphQL.d.ts +42 -0
  42. package/lib/esm/hooks/useCaseGroupGraphQL.d.ts.map +1 -0
  43. package/lib/esm/hooks/useCaseGroupGraphQL.js +109 -0
  44. package/lib/esm/hooks/useCaseLabelGraphQL.d.ts +26 -0
  45. package/lib/esm/hooks/useCaseLabelGraphQL.d.ts.map +1 -0
  46. package/lib/esm/hooks/useCaseLabelGraphQL.js +100 -0
  47. package/lib/esm/hooks/useCurrentUserContact.d.ts +8 -0
  48. package/lib/esm/hooks/useCurrentUserContact.d.ts.map +1 -0
  49. package/lib/esm/hooks/useCurrentUserContact.js +74 -0
  50. package/lib/esm/hooks/useVersionsDiffer.d.ts.map +1 -1
  51. package/lib/esm/index.js +1 -0
  52. package/lib/esm/scss/_main.scss +77 -0
  53. package/lib/esm/utils/caseGroupMapper.d.ts +18 -0
  54. package/lib/esm/utils/caseGroupMapper.d.ts.map +1 -0
  55. package/lib/esm/utils/caseGroupMapper.js +50 -0
  56. package/package.json +11 -8
@@ -0,0 +1,26 @@
1
+ import { type CreateCaseLabelResponse, type DeleteCaseLabelResponse, type UpdateCaseLabelResponse } from '@rh-support/utils';
2
+ import { ICaseLabel } from '../components/ManageCaseLabels/types';
3
+ interface UseCaseLabelsResult {
4
+ labels: ICaseLabel[];
5
+ loading: boolean;
6
+ error: Error | undefined;
7
+ refetch: () => Promise<void>;
8
+ }
9
+ export declare function useCaseLabels(accountId?: string): UseCaseLabelsResult;
10
+ interface UseCreateCaseLabelResult {
11
+ createCaseLabel: (name: string, accountId: string) => Promise<CreateCaseLabelResponse>;
12
+ loading: boolean;
13
+ }
14
+ export declare function useCreateCaseLabel(): UseCreateCaseLabelResult;
15
+ interface UseUpdateCaseLabelResult {
16
+ updateCaseLabel: (id: string, name: string) => Promise<UpdateCaseLabelResponse>;
17
+ loading: boolean;
18
+ }
19
+ export declare function useUpdateCaseLabel(): UseUpdateCaseLabelResult;
20
+ interface UseDeleteCaseLabelResult {
21
+ deleteCaseLabel: (id: string) => Promise<DeleteCaseLabelResponse>;
22
+ loading: boolean;
23
+ }
24
+ export declare function useDeleteCaseLabel(): UseDeleteCaseLabelResult;
25
+ export {};
26
+ //# sourceMappingURL=useCaseLabelGraphQL.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCaseLabelGraphQL.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCaseLabelGraphQL.ts"],"names":[],"mappings":"AACA,OAAO,EAEH,KAAK,uBAAuB,EAE5B,KAAK,uBAAuB,EAI5B,KAAK,uBAAuB,EAM/B,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAQlE,UAAU,mBAAmB;IACzB,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC;IACzB,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAChC;AAED,wBAAgB,aAAa,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,mBAAmB,CAmCrE;AAED,UAAU,wBAAwB;IAC9B,eAAe,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,uBAAuB,CAAC,CAAC;IACvF,OAAO,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,kBAAkB,IAAI,wBAAwB,CAkB7D;AAED,UAAU,wBAAwB;IAC9B,eAAe,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,uBAAuB,CAAC,CAAC;IAChF,OAAO,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,kBAAkB,IAAI,wBAAwB,CAkB7D;AAED,UAAU,wBAAwB;IAC9B,eAAe,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,uBAAuB,CAAC,CAAC;IAClE,OAAO,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,kBAAkB,IAAI,wBAAwB,CAW7D"}
@@ -0,0 +1,100 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { useApolloClient, useMutation } from '@apollo/client/react';
11
+ import { CREATE_CASE_LABEL, DELETE_CASE_LABEL, GET_CASE_LABELS, UPDATE_CASE_LABEL, } from '@rh-support/utils';
12
+ import unescape from 'lodash/unescape';
13
+ import { useCallback, useEffect, useState } from 'react';
14
+ const mapCaseLabelNode = (node) => {
15
+ var _a, _b, _c, _d;
16
+ return ({
17
+ id: node.Id,
18
+ name: unescape((_b = (_a = node.Name) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : ''),
19
+ assignedCaseCount: (_d = (_c = node.Case_Label_Links__r) === null || _c === void 0 ? void 0 : _c.totalCount) !== null && _d !== void 0 ? _d : 0,
20
+ });
21
+ };
22
+ export function useCaseLabels(accountId) {
23
+ const client = useApolloClient();
24
+ const [labels, setLabels] = useState([]);
25
+ const [loading, setLoading] = useState(false);
26
+ const [error, setError] = useState(undefined);
27
+ const fetchLabels = useCallback(() => __awaiter(this, void 0, void 0, function* () {
28
+ var _a, _b, _c, _d;
29
+ if (!accountId) {
30
+ setLabels([]);
31
+ return;
32
+ }
33
+ setLoading(true);
34
+ setError(undefined);
35
+ try {
36
+ const { data } = yield client.query({
37
+ query: GET_CASE_LABELS,
38
+ variables: { where: { Account__c: { eq: accountId } } },
39
+ fetchPolicy: 'network-only',
40
+ });
41
+ const edges = (_d = (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.redhat_support_uiapi) === null || _a === void 0 ? void 0 : _a.query) === null || _b === void 0 ? void 0 : _b.RedHatSupportCaseLabel__c) === null || _c === void 0 ? void 0 : _c.edges) !== null && _d !== void 0 ? _d : [];
42
+ setLabels(edges.map(({ node }) => mapCaseLabelNode(node)).filter((label) => label.id && label.name));
43
+ }
44
+ catch (e) {
45
+ setError(e);
46
+ setLabels([]);
47
+ }
48
+ finally {
49
+ setLoading(false);
50
+ }
51
+ }), [accountId, client]);
52
+ useEffect(() => {
53
+ fetchLabels();
54
+ }, [fetchLabels]);
55
+ return { labels, loading, error, refetch: fetchLabels };
56
+ }
57
+ export function useCreateCaseLabel() {
58
+ const [mutate, { loading }] = useMutation(CREATE_CASE_LABEL);
59
+ const createCaseLabel = (name, accountId) => __awaiter(this, void 0, void 0, function* () {
60
+ const result = yield mutate({
61
+ variables: {
62
+ input: {
63
+ RedHatSupportCaseLabel__c: {
64
+ Name: name,
65
+ Account__c: accountId,
66
+ },
67
+ },
68
+ },
69
+ });
70
+ return result.data;
71
+ });
72
+ return { createCaseLabel, loading };
73
+ }
74
+ export function useUpdateCaseLabel() {
75
+ const [mutate, { loading }] = useMutation(UPDATE_CASE_LABEL);
76
+ const updateCaseLabel = (id, name) => __awaiter(this, void 0, void 0, function* () {
77
+ const result = yield mutate({
78
+ variables: {
79
+ input: {
80
+ Id: id,
81
+ RedHatSupportCaseLabel__c: {
82
+ Name: name,
83
+ },
84
+ },
85
+ },
86
+ });
87
+ return result.data;
88
+ });
89
+ return { updateCaseLabel, loading };
90
+ }
91
+ export function useDeleteCaseLabel() {
92
+ const [mutate, { loading }] = useMutation(DELETE_CASE_LABEL);
93
+ const deleteCaseLabel = (id) => __awaiter(this, void 0, void 0, function* () {
94
+ const result = yield mutate({
95
+ variables: { id },
96
+ });
97
+ return result.data;
98
+ });
99
+ return { deleteCaseLabel, loading };
100
+ }
@@ -0,0 +1,8 @@
1
+ interface UseCurrentUserContactResult {
2
+ isOrgAdmin: boolean;
3
+ loading: boolean;
4
+ error: Error | undefined;
5
+ }
6
+ export declare function useCurrentUserContact(): UseCurrentUserContactResult;
7
+ export {};
8
+ //# sourceMappingURL=useCurrentUserContact.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCurrentUserContact.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCurrentUserContact.ts"],"names":[],"mappings":"AAMA,UAAU,2BAA2B;IACjC,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC;CAC5B;AAED,wBAAgB,qBAAqB,IAAI,2BAA2B,CAiFnE"}
@@ -0,0 +1,74 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { useApolloClient } from '@apollo/client/react';
11
+ import { setLoggedInUserRoles, useGlobalDispatchContext, useGlobalStateContext } from '@rh-support/react-context';
12
+ import { initUserRoles } from '@rh-support/user-permissions';
13
+ import { GET_CONTACT_BY_SSO } from '@rh-support/utils';
14
+ import { useCallback, useEffect, useRef, useState } from 'react';
15
+ export function useCurrentUserContact() {
16
+ const client = useApolloClient();
17
+ const dispatch = useGlobalDispatchContext();
18
+ const { globalMetadataState: { loggedInUserJwtToken, loggedInUser, loggedInUsersAccount, managedAccounts, accountManagers, bookmarkedAccounts, pcmConfig, viewAsCustomer, }, } = useGlobalStateContext();
19
+ const ssoUsername = loggedInUserJwtToken === null || loggedInUserJwtToken === void 0 ? void 0 : loggedInUserJwtToken.preferred_username;
20
+ const [isOrgAdmin, setIsOrgAdmin] = useState(false);
21
+ const [loading, setLoading] = useState(true);
22
+ const [error, setError] = useState(undefined);
23
+ const hasFetched = useRef(false);
24
+ const fetchContact = useCallback(() => __awaiter(this, void 0, void 0, function* () {
25
+ var _a, _b, _c, _d, _e, _f;
26
+ if (!ssoUsername || hasFetched.current) {
27
+ if (!ssoUsername)
28
+ setLoading(false);
29
+ return;
30
+ }
31
+ hasFetched.current = true;
32
+ setLoading(true);
33
+ setError(undefined);
34
+ try {
35
+ const { data } = yield client.query({
36
+ query: GET_CONTACT_BY_SSO,
37
+ variables: { searchTerm: ssoUsername, namePattern: `%${ssoUsername}%` },
38
+ fetchPolicy: 'cache-first',
39
+ });
40
+ const edges = ((_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.redhat_support_uiapi) === null || _a === void 0 ? void 0 : _a.query) === null || _b === void 0 ? void 0 : _b.RedHatSupportContact) === null || _c === void 0 ? void 0 : _c.edges) || [];
41
+ const match = edges[0];
42
+ const adminStatus = (_f = (_e = (_d = match === null || match === void 0 ? void 0 : match.node) === null || _d === void 0 ? void 0 : _d.IsOrgAdmin__c) === null || _e === void 0 ? void 0 : _e.value) !== null && _f !== void 0 ? _f : false;
43
+ setIsOrgAdmin(adminStatus);
44
+ if ((loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.data) && (loggedInUsersAccount === null || loggedInUsersAccount === void 0 ? void 0 : loggedInUsersAccount.data)) {
45
+ const updatedUser = Object.assign(Object.assign({}, loggedInUser.data), { isOrgAdmin: adminStatus });
46
+ const { user } = initUserRoles(updatedUser, loggedInUsersAccount.data, (managedAccounts === null || managedAccounts === void 0 ? void 0 : managedAccounts.data) || [], (accountManagers === null || accountManagers === void 0 ? void 0 : accountManagers.data) || [], (bookmarkedAccounts === null || bookmarkedAccounts === void 0 ? void 0 : bookmarkedAccounts.data) || [], (pcmConfig === null || pcmConfig === void 0 ? void 0 : pcmConfig.data) || [], viewAsCustomer, loggedInUserJwtToken);
47
+ setLoggedInUserRoles(dispatch, user);
48
+ }
49
+ }
50
+ catch (e) {
51
+ setError(e);
52
+ setIsOrgAdmin(false);
53
+ }
54
+ finally {
55
+ setLoading(false);
56
+ }
57
+ }), [
58
+ client,
59
+ ssoUsername,
60
+ loggedInUser,
61
+ loggedInUsersAccount,
62
+ managedAccounts,
63
+ accountManagers,
64
+ bookmarkedAccounts,
65
+ pcmConfig,
66
+ viewAsCustomer,
67
+ loggedInUserJwtToken,
68
+ dispatch,
69
+ ]);
70
+ useEffect(() => {
71
+ fetchContact();
72
+ }, [fetchContact]);
73
+ return { isOrgAdmin, loading, error };
74
+ }
@@ -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,CAuD/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,CAwD/G,CAAC"}
package/lib/esm/index.js CHANGED
@@ -2,3 +2,4 @@
2
2
  export { Manage } from './Manage';
3
3
  export { TopContentManagement } from './components/TopContentManagement';
4
4
  export { ExpiredContentManagement } from './components/ManageExpiredContents';
5
+ // dummy change for publish
@@ -179,6 +179,7 @@
179
179
  border-radius: 8px;
180
180
  border-top-right-radius: 0px;
181
181
  border-top-left-radius: 0px;
182
+ overflow: hidden;
182
183
 
183
184
  .pf-v6-c-table__th {
184
185
  font-size: 14px;
@@ -194,6 +195,10 @@
194
195
  tbody:first-of-type {
195
196
  border-top: none;
196
197
  }
198
+
199
+ tbody:last-of-type tr:last-child {
200
+ border-bottom: none;
201
+ }
197
202
  .bookmark-alert {
198
203
  margin-left: 1rem;
199
204
  margin-right: 1rem;
@@ -428,6 +433,78 @@ svg.hostnameSpinner {
428
433
  border-radius: 8px;
429
434
  }
430
435
 
436
+ #manage-case-labels {
437
+ thead {
438
+ display: none;
439
+ }
440
+
441
+ .case-labels-toolbar {
442
+ flex-direction: row;
443
+ align-items: center;
444
+ justify-content: space-between;
445
+ gap: var(--pf-t--global--spacer--md);
446
+
447
+ .toolbar-left {
448
+ flex: 0 1 auto;
449
+ margin-bottom: 0;
450
+ max-width: none;
451
+
452
+ & > *:nth-child(2):not(.group-action) {
453
+ width: auto;
454
+ min-width: 16rem;
455
+ }
456
+ }
457
+
458
+ .toolbar-right,
459
+ .case-labels-toolbar__loaded {
460
+ flex: 0 0 auto;
461
+ max-width: none;
462
+ margin-left: auto;
463
+ white-space: nowrap;
464
+ justify-content: flex-end;
465
+ }
466
+ }
467
+
468
+ .case-label-row {
469
+ display: flex;
470
+ align-items: center;
471
+ justify-content: space-between;
472
+ width: 100%;
473
+ gap: var(--pf-t--global--spacer--md);
474
+ }
475
+
476
+ .case-label-row__actions {
477
+ display: flex;
478
+ align-items: center;
479
+ flex-shrink: 0;
480
+ gap: var(--pf-t--global--spacer--sm);
481
+ margin-left: auto;
482
+ }
483
+
484
+ .case-labels-empty-state {
485
+ display: flex;
486
+ align-items: center;
487
+ justify-content: center;
488
+ min-height: 20rem;
489
+ padding: var(--pf-t--global--spacer--2xl) var(--pf-t--global--spacer--lg);
490
+ background-color: var(--pf-t--global--background--color--primary--default);
491
+ }
492
+ }
493
+
494
+ .case-label-delete-description {
495
+ display: flex;
496
+ flex-direction: column;
497
+ gap: var(--pf-t--global--spacer--lg);
498
+
499
+ p {
500
+ margin: 0;
501
+ }
502
+
503
+ .case-label-delete-description__impact {
504
+ white-space: nowrap;
505
+ }
506
+ }
507
+
431
508
  .pf-v6-c-empty-state__icon {
432
509
  color: var(--pf-t--color--gray--30);
433
510
  }
@@ -0,0 +1,18 @@
1
+ import type { ICaseGroup, IGroupUser } from '@cee-eng/hydrajs/@types/api/public/caseGroups';
2
+ import type { CaseGroupMemberNode, CaseGroupNode } from '@rh-support/utils';
3
+ /** Extends the hydrajs IGroupUser with the Salesforce Contact record Id needed for mutations like ContactUpdate. */
4
+ export interface IGroupUserWithContactId extends IGroupUser {
5
+ contactSfId: string;
6
+ memberRecordId: string;
7
+ }
8
+ /**
9
+ * Maps a Salesforce GraphQL CaseGroupNode to the legacy ICaseGroup shape
10
+ * used throughout the application.
11
+ */
12
+ export declare function mapCaseGroupNodeToICaseGroup(node: CaseGroupNode, isDefault?: boolean): ICaseGroup;
13
+ /**
14
+ * Maps a Salesforce GraphQL CaseGroupMemberNode to the legacy IGroupUser shape.
15
+ * Derives `isDefault` by comparing the contact's DefaultCaseGroup__c against the current group Id.
16
+ */
17
+ export declare function mapCaseGroupMemberNodeToIGroupUser(node: CaseGroupMemberNode, groupId: string): IGroupUserWithContactId;
18
+ //# sourceMappingURL=caseGroupMapper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"caseGroupMapper.d.ts","sourceRoot":"","sources":["../../../src/utils/caseGroupMapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AAC5F,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAG5E,oHAAoH;AACpH,MAAM,WAAW,uBAAwB,SAAQ,UAAU;IACvD,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,aAAa,EAAE,SAAS,UAAQ,GAAG,UAAU,CAS/F;AAED;;;GAGG;AACH,wBAAgB,kCAAkC,CAC9C,IAAI,EAAE,mBAAmB,EACzB,OAAO,EAAE,MAAM,GAChB,uBAAuB,CA6BzB"}
@@ -0,0 +1,50 @@
1
+ import unescape from 'lodash/unescape';
2
+ /**
3
+ * Maps a Salesforce GraphQL CaseGroupNode to the legacy ICaseGroup shape
4
+ * used throughout the application.
5
+ */
6
+ export function mapCaseGroupNodeToICaseGroup(node, isDefault = false) {
7
+ var _a;
8
+ return {
9
+ groupNum: node.Id,
10
+ name: unescape((_a = node.Name.displayValue) !== null && _a !== void 0 ? _a : node.Name.value),
11
+ isPrivate: false,
12
+ isDefault,
13
+ defaultMembers: [],
14
+ members: [],
15
+ };
16
+ }
17
+ /**
18
+ * Maps a Salesforce GraphQL CaseGroupMemberNode to the legacy IGroupUser shape.
19
+ * Derives `isDefault` by comparing the contact's DefaultCaseGroup__c against the current group Id.
20
+ */
21
+ export function mapCaseGroupMemberNodeToIGroupUser(node, groupId) {
22
+ var _a, _b, _c, _d;
23
+ const contact = node.Contact__r;
24
+ if (!contact) {
25
+ return {
26
+ firstName: '',
27
+ lastName: '',
28
+ isOrgAdmin: false,
29
+ access: true,
30
+ write: false,
31
+ isDefault: false,
32
+ ssoUsername: '',
33
+ email: '',
34
+ contactSfId: '',
35
+ memberRecordId: node.Id || '',
36
+ };
37
+ }
38
+ return {
39
+ firstName: (_a = contact.FirstName.displayValue) !== null && _a !== void 0 ? _a : contact.FirstName.value,
40
+ lastName: (_b = contact.LastName.displayValue) !== null && _b !== void 0 ? _b : contact.LastName.value,
41
+ isOrgAdmin: contact.IsOrgAdmin__c.value,
42
+ access: true,
43
+ write: false,
44
+ isDefault: ((_c = contact.DefaultCaseGroup__c) === null || _c === void 0 ? void 0 : _c.value) === groupId,
45
+ ssoUsername: contact.SSOUserName__c.value,
46
+ email: (_d = contact.Email.displayValue) !== null && _d !== void 0 ? _d : contact.Email.value,
47
+ contactSfId: contact.Id,
48
+ memberRecordId: node.Id,
49
+ };
50
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/manage",
3
- "version": "2.5.271",
3
+ "version": "2.5.275",
4
4
  "description": "Customer Support Manage App",
5
5
  "author": "Jordan Eudy <jeudy100@gmail.com>",
6
6
  "license": "ISC",
@@ -41,7 +41,8 @@
41
41
  "prepublishOnly": "npm run build"
42
42
  },
43
43
  "peerDependencies": {
44
- "@cee-eng/hydrajs": "4.18.111",
44
+ "@apollo/client": "^4.1.6",
45
+ "@cee-eng/hydrajs": "^4.18.114",
45
46
  "@patternfly/patternfly": "6.2.1",
46
47
  "@patternfly/react-core": "6.2.1",
47
48
  "@patternfly/react-table": "6.2.1",
@@ -53,6 +54,8 @@
53
54
  "react-router-dom": "^5.1.2"
54
55
  },
55
56
  "devDependencies": {
57
+ "@patternfly/react-styles": "^6.2.1",
58
+ "@patternfly/react-tokens": "^6.2.1",
56
59
  "@testing-library/jest-dom": "^6.2.0",
57
60
  "@testing-library/react": "^14.1.2",
58
61
  "@testing-library/user-event": "^14.5.1",
@@ -71,16 +74,16 @@
71
74
  "typescript": "^5.3.3"
72
75
  },
73
76
  "dependencies": {
74
- "@cee-eng/hydrajs": "4.18.111",
77
+ "@cee-eng/hydrajs": "^4.18.114",
75
78
  "@patternfly/patternfly": "6.2.1",
76
79
  "@patternfly/react-core": "6.2.1",
77
80
  "@patternfly/react-table": "6.2.1",
78
- "@rh-support/components": "2.5.222",
81
+ "@rh-support/components": "2.5.225",
79
82
  "@rh-support/configs": "2.0.75",
80
- "@rh-support/react-context": "2.5.318",
83
+ "@rh-support/react-context": "2.5.321",
81
84
  "@rh-support/types": "2.0.26",
82
- "@rh-support/user-permissions": "2.5.170",
83
- "@rh-support/utils": "2.5.149",
85
+ "@rh-support/user-permissions": "2.5.173",
86
+ "@rh-support/utils": "2.5.152",
84
87
  "@types/react-beautiful-dnd": "^13.0.0",
85
88
  "i18next": "^23.15.0",
86
89
  "lodash": ">=4.17.15",
@@ -99,5 +102,5 @@
99
102
  "defaults and supports es6-module",
100
103
  "maintained node versions"
101
104
  ],
102
- "gitHead": "cc1c26280084d477ee0abcec8d46963c8213b783"
105
+ "gitHead": "4cb198056cdf53141dcdf4d9b55d9cbb36940e05"
103
106
  }