@rh-support/manage 2.5.281 → 2.6.10

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 (58) 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 +169 -85
  18. package/lib/esm/components/Groups/ManageGroupUsers/ManageGroupUsers.d.ts.map +1 -1
  19. package/lib/esm/components/Groups/ManageGroupUsers/ManageGroupUsers.js +182 -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 +97 -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 +220 -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/PreferencesBody.d.ts.map +1 -1
  33. package/lib/esm/components/ManagePreferences/PreferencesBody.js +1 -5
  34. package/lib/esm/components/ManagePreferences/sections/PreferencesACL.d.ts.map +1 -1
  35. package/lib/esm/components/ManagePreferences/sections/PreferencesACL.js +3 -4
  36. package/lib/esm/components/ManagePreferences/sections/PreferencesCaseCreate.d.ts.map +1 -1
  37. package/lib/esm/components/ManagePreferences/sections/PreferencesCaseCreate.js +73 -58
  38. package/lib/esm/components/ManagePreferences/sections/PreferencesCaseView.d.ts.map +1 -1
  39. package/lib/esm/components/ManagePreferences/sections/PreferencesCaseView.js +43 -98
  40. package/lib/esm/constants/GroupSelectActions.d.ts +2 -1
  41. package/lib/esm/constants/GroupSelectActions.d.ts.map +1 -1
  42. package/lib/esm/constants/GroupSelectActions.js +1 -0
  43. package/lib/esm/hooks/useCaseGroupGraphQL.d.ts +42 -0
  44. package/lib/esm/hooks/useCaseGroupGraphQL.d.ts.map +1 -0
  45. package/lib/esm/hooks/useCaseGroupGraphQL.js +117 -0
  46. package/lib/esm/hooks/useCaseLabelGraphQL.d.ts +26 -0
  47. package/lib/esm/hooks/useCaseLabelGraphQL.d.ts.map +1 -0
  48. package/lib/esm/hooks/useCaseLabelGraphQL.js +104 -0
  49. package/lib/esm/hooks/useCurrentUserContact.d.ts +8 -0
  50. package/lib/esm/hooks/useCurrentUserContact.d.ts.map +1 -0
  51. package/lib/esm/hooks/useCurrentUserContact.js +74 -0
  52. package/lib/esm/hooks/useVersionsDiffer.d.ts.map +1 -1
  53. package/lib/esm/index.js +1 -0
  54. package/lib/esm/scss/_main.scss +77 -0
  55. package/lib/esm/utils/caseGroupMapper.d.ts +18 -0
  56. package/lib/esm/utils/caseGroupMapper.d.ts.map +1 -0
  57. package/lib/esm/utils/caseGroupMapper.js +50 -0
  58. package/package.json +9 -6
@@ -0,0 +1,117 @@
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 { useMutation, useQuery } from '@apollo/client/react';
11
+ import { CREATE_CASE_GROUP, CREATE_CASE_GROUP_MEMBER, DELETE_CASE_GROUP, DELETE_CASE_GROUP_MEMBER, GET_CASE_GROUP_MEMBERS, RENAME_CASE_GROUP, TOGGLE_DEFAULT_GROUP, } from '@rh-support/utils';
12
+ import { useMemo, useState } from 'react';
13
+ import { mapCaseGroupMemberNodeToIGroupUser } from '../utils/caseGroupMapper';
14
+ export function useCaseGroupMembers() {
15
+ const [groupId, setGroupId] = useState(undefined);
16
+ const { data, loading, error, refetch } = useQuery(GET_CASE_GROUP_MEMBERS, {
17
+ variables: { where: { Group__c: { eq: groupId } }, first: 2000 },
18
+ skip: !groupId,
19
+ fetchPolicy: 'network-only',
20
+ });
21
+ const members = useMemo(() => {
22
+ var _a, _b, _c;
23
+ if (!data || !groupId)
24
+ return [];
25
+ const response = data;
26
+ const edges = ((_c = (_b = (_a = response.redhat_support_uiapi) === null || _a === void 0 ? void 0 : _a.query) === null || _b === void 0 ? void 0 : _b.RedHatSupportCaseGroupMember__c) === null || _c === void 0 ? void 0 : _c.edges) || [];
27
+ return edges
28
+ .filter(({ node }) => node.Contact__r !== null)
29
+ .map(({ node }) => mapCaseGroupMemberNodeToIGroupUser(node, groupId));
30
+ }, [data, groupId]);
31
+ const fetchMembers = (id) => {
32
+ setGroupId(id);
33
+ };
34
+ const refetchMembers = () => {
35
+ if (!groupId)
36
+ return;
37
+ void refetch({
38
+ where: { Group__c: { eq: groupId } },
39
+ first: 2000,
40
+ });
41
+ };
42
+ return {
43
+ data: members,
44
+ loading,
45
+ error: error,
46
+ refetch: refetchMembers,
47
+ fetchMembers,
48
+ };
49
+ }
50
+ export function useCreateCaseGroup() {
51
+ const [mutate, { loading }] = useMutation(CREATE_CASE_GROUP);
52
+ const createGroup = (name, accountId) => __awaiter(this, void 0, void 0, function* () {
53
+ const result = yield mutate({
54
+ variables: { name, accountId },
55
+ });
56
+ return result.data;
57
+ });
58
+ return { createGroup, loading };
59
+ }
60
+ export function useCreateCaseGroupMember() {
61
+ const [mutate, { loading }] = useMutation(CREATE_CASE_GROUP_MEMBER);
62
+ const createMember = (contactId, groupId) => __awaiter(this, void 0, void 0, function* () {
63
+ const result = yield mutate({
64
+ variables: {
65
+ memberInput: {
66
+ Contact__c: contactId,
67
+ Group__c: groupId,
68
+ },
69
+ },
70
+ });
71
+ return result.data;
72
+ });
73
+ return { createMember, loading };
74
+ }
75
+ export function useRenameCaseGroup() {
76
+ const [mutate, { loading }] = useMutation(RENAME_CASE_GROUP);
77
+ const renameGroup = (id, newName) => __awaiter(this, void 0, void 0, function* () {
78
+ const result = yield mutate({
79
+ variables: { id, caseGroupPatch: { Name: newName } },
80
+ });
81
+ return result.data;
82
+ });
83
+ return { renameGroup, loading };
84
+ }
85
+ export function useDeleteCaseGroup() {
86
+ const [mutate, { loading }] = useMutation(DELETE_CASE_GROUP);
87
+ const deleteGroup = (id) => __awaiter(this, void 0, void 0, function* () {
88
+ const result = yield mutate({
89
+ variables: { id },
90
+ });
91
+ return result.data;
92
+ });
93
+ return { deleteGroup, loading };
94
+ }
95
+ export function useToggleDefaultGroup() {
96
+ const [mutate, { loading }] = useMutation(TOGGLE_DEFAULT_GROUP);
97
+ const toggleDefault = (contactId, groupId) => __awaiter(this, void 0, void 0, function* () {
98
+ const result = yield mutate({
99
+ variables: {
100
+ id: contactId,
101
+ contactPatch: { DefaultCaseGroup__c: groupId },
102
+ },
103
+ });
104
+ return result.data;
105
+ });
106
+ return { toggleDefault, loading };
107
+ }
108
+ export function useDeleteCaseGroupMember() {
109
+ const [mutate, { loading }] = useMutation(DELETE_CASE_GROUP_MEMBER);
110
+ const deleteMember = (memberId) => __awaiter(this, void 0, void 0, function* () {
111
+ const result = yield mutate({
112
+ variables: { id: memberId },
113
+ });
114
+ return result.data;
115
+ });
116
+ return { deleteMember, loading };
117
+ }
@@ -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,EAE5B,KAAK,uBAAuB,EAQ/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,CA8BrE;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,CA4B7D;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,104 @@
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 { CASE_LABEL_QUERY_LIMIT, CREATE_CASE_LABEL, DELETE_CASE_LABEL, fetchAllAccountCaseLabels, 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
+ if (!accountId) {
29
+ setLabels([]);
30
+ return;
31
+ }
32
+ setLoading(true);
33
+ setError(undefined);
34
+ try {
35
+ const labelNodes = yield fetchAllAccountCaseLabels(client, accountId);
36
+ setLabels(labelNodes.map((node) => mapCaseLabelNode(node)).filter((label) => label.id && label.name));
37
+ }
38
+ catch (e) {
39
+ setError(e);
40
+ setLabels([]);
41
+ }
42
+ finally {
43
+ setLoading(false);
44
+ }
45
+ }), [accountId, client]);
46
+ useEffect(() => {
47
+ fetchLabels();
48
+ }, [fetchLabels]);
49
+ return { labels, loading, error, refetch: fetchLabels };
50
+ }
51
+ export function useCreateCaseLabel() {
52
+ const [mutate, { loading }] = useMutation(CREATE_CASE_LABEL);
53
+ const createCaseLabel = (name, accountId) => __awaiter(this, void 0, void 0, function* () {
54
+ const result = yield mutate({
55
+ variables: {
56
+ input: {
57
+ RedHatSupportCaseLabel__c: {
58
+ Name: name,
59
+ Account__c: accountId,
60
+ },
61
+ },
62
+ },
63
+ refetchQueries: [
64
+ {
65
+ query: GET_CASE_LABELS,
66
+ variables: {
67
+ where: { Account__c: { eq: accountId } },
68
+ first: CASE_LABEL_QUERY_LIMIT,
69
+ },
70
+ },
71
+ ],
72
+ awaitRefetchQueries: true,
73
+ });
74
+ return result.data;
75
+ });
76
+ return { createCaseLabel, loading };
77
+ }
78
+ export function useUpdateCaseLabel() {
79
+ const [mutate, { loading }] = useMutation(UPDATE_CASE_LABEL);
80
+ const updateCaseLabel = (id, name) => __awaiter(this, void 0, void 0, function* () {
81
+ const result = yield mutate({
82
+ variables: {
83
+ input: {
84
+ Id: id,
85
+ RedHatSupportCaseLabel__c: {
86
+ Name: name,
87
+ },
88
+ },
89
+ },
90
+ });
91
+ return result.data;
92
+ });
93
+ return { updateCaseLabel, loading };
94
+ }
95
+ export function useDeleteCaseLabel() {
96
+ const [mutate, { loading }] = useMutation(DELETE_CASE_LABEL);
97
+ const deleteCaseLabel = (id) => __awaiter(this, void 0, void 0, function* () {
98
+ const result = yield mutate({
99
+ variables: { id },
100
+ });
101
+ return result.data;
102
+ });
103
+ return { deleteCaseLabel, loading };
104
+ }
@@ -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.281",
3
+ "version": "2.6.10",
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,13 +74,13 @@
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.231",
81
+ "@rh-support/components": "2.6.10",
79
82
  "@rh-support/configs": "2.0.75",
80
- "@rh-support/react-context": "2.5.327",
83
+ "@rh-support/react-context": "2.6.10",
81
84
  "@rh-support/types": "2.0.26",
82
85
  "@rh-support/user-permissions": "2.5.170",
83
86
  "@rh-support/utils": "2.5.149",
@@ -99,5 +102,5 @@
99
102
  "defaults and supports es6-module",
100
103
  "maintained node versions"
101
104
  ],
102
- "gitHead": "a4db33129a9d9f0d6a6907d1c48df34784e57021"
105
+ "gitHead": "3f16770cee04217483b234f6d8dceaced57a0695"
103
106
  }