From f7b94aa51c0c3d2e5c687fb73347e14ae0646c0f Mon Sep 17 00:00:00 2001 From: Abdhesh Nayak Date: Tue, 8 Oct 2024 12:38:31 +0530 Subject: [PATCH] :bug: Fixed issue with user management fixed error that occured while removing the user form the team. --- gql-queries-generator/doc/queries.graphql | 1 + .../$account+/settings+/user-management/route.tsx | 2 +- .../user-management/user-access-resource.tsx | 4 ++-- .../console/server/gql/queries/access-queries.ts | 1 + .../console/server/gql/queries/account-queries.ts | 12 ++++++------ src/generated/gql/server.ts | 8 +++++++- 6 files changed, 18 insertions(+), 10 deletions(-) diff --git a/gql-queries-generator/doc/queries.graphql b/gql-queries-generator/doc/queries.graphql index 98a678185..6e0498fdb 100644 --- a/gql-queries-generator/doc/queries.graphql +++ b/gql-queries-generator/doc/queries.graphql @@ -1947,6 +1947,7 @@ query consoleListMembershipsForAccount($accountName: String!) { name joined email + id } role } diff --git a/src/apps/console/routes/_main+/$account+/settings+/user-management/route.tsx b/src/apps/console/routes/_main+/$account+/settings+/user-management/route.tsx index 5a44d1034..d93940ecc 100644 --- a/src/apps/console/routes/_main+/$account+/settings+/user-management/route.tsx +++ b/src/apps/console/routes/_main+/$account+/settings+/user-management/route.tsx @@ -127,7 +127,7 @@ const Teams = ({ setShowUserInvite, searchText, sortTeamMembers }: ITeams) => { isLoading && searchResp.length === 0 ? placeHolderUsers : sorted.map((i) => ({ - id: i.user.email, + id: i.user.id, name: i.user.name, role: i.role, email: i.user.email, diff --git a/src/apps/console/routes/_main+/$account+/settings+/user-management/user-access-resource.tsx b/src/apps/console/routes/_main+/$account+/settings+/user-management/user-access-resource.tsx index ebc36c13f..b351e0812 100644 --- a/src/apps/console/routes/_main+/$account+/settings+/user-management/user-access-resource.tsx +++ b/src/apps/console/routes/_main+/$account+/settings+/user-management/user-access-resource.tsx @@ -141,7 +141,7 @@ const UserAccessResources = ({ isPendingInvitation: boolean; }) => { const [showDeleteDialog, setShowDeleteDialog] = useState( - null, + null ); const [showUserInvite, setShowUserInvite] = useState(null); @@ -220,7 +220,7 @@ const UserAccessResources = ({ } } reloadPage(); - toast.success(`${titleCase(RESOURCE_NAME)} deleted successfully`); + toast.success(`${titleCase(RESOURCE_NAME)} removed successfully`); setShowDeleteDialog(null); } catch (err) { handleError(err); diff --git a/src/apps/console/server/gql/queries/access-queries.ts b/src/apps/console/server/gql/queries/access-queries.ts index 8256426dc..6811761a7 100644 --- a/src/apps/console/server/gql/queries/access-queries.ts +++ b/src/apps/console/server/gql/queries/access-queries.ts @@ -63,6 +63,7 @@ export const accessQueries = (executor: IExecutor) => ({ name joined email + id } role } diff --git a/src/apps/console/server/gql/queries/account-queries.ts b/src/apps/console/server/gql/queries/account-queries.ts index 9f46d8617..2af8574ff 100644 --- a/src/apps/console/server/gql/queries/account-queries.ts +++ b/src/apps/console/server/gql/queries/account-queries.ts @@ -31,7 +31,7 @@ export const accountQueries = (executor: IExecutor) => ({ { transformer: (data: ConsoleCreateAccountMutation) => data.accounts_createAccount, - vars(_: ConsoleCreateAccountMutationVariables) { }, + vars(_: ConsoleCreateAccountMutationVariables) {}, } ), getAvailableKloudliteRegions: executor( @@ -46,7 +46,7 @@ export const accountQueries = (executor: IExecutor) => ({ { transformer: (data: ConsoleGetAvailableKloudliteRegionsQuery) => data.accounts_availableKloudliteRegions, - vars(_: ConsoleGetAvailableKloudliteRegionsQueryVariables) { }, + vars(_: ConsoleGetAvailableKloudliteRegionsQueryVariables) {}, } ), @@ -68,7 +68,7 @@ export const accountQueries = (executor: IExecutor) => ({ { transformer: (data: ConsoleListAccountsQuery) => data.accounts_listAccounts, - vars(_: ConsoleListAccountsQueryVariables) { }, + vars(_: ConsoleListAccountsQueryVariables) {}, } ), updateAccount: executor( @@ -82,7 +82,7 @@ export const accountQueries = (executor: IExecutor) => ({ { transformer: (data: ConsoleUpdateAccountMutation) => data.accounts_updateAccount, - vars(_: ConsoleUpdateAccountMutationVariables) { }, + vars(_: ConsoleUpdateAccountMutationVariables) {}, } ), getAccount: executor( @@ -103,7 +103,7 @@ export const accountQueries = (executor: IExecutor) => ({ `, { transformer: (data: ConsoleGetAccountQuery) => data.accounts_getAccount, - vars(_: ConsoleGetAccountQueryVariables) { }, + vars(_: ConsoleGetAccountQueryVariables) {}, } ), deleteAccount: executor( @@ -115,7 +115,7 @@ export const accountQueries = (executor: IExecutor) => ({ { transformer: (data: ConsoleDeleteAccountMutation) => data.accounts_deleteAccount, - vars(_: ConsoleDeleteAccountMutationVariables) { }, + vars(_: ConsoleDeleteAccountMutationVariables) {}, } ), }); diff --git a/src/generated/gql/server.ts b/src/generated/gql/server.ts index 89b2944f6..f689114b9 100644 --- a/src/generated/gql/server.ts +++ b/src/generated/gql/server.ts @@ -3592,7 +3592,13 @@ export type ConsoleListMembershipsForAccountQueryVariables = Exact<{ export type ConsoleListMembershipsForAccountQuery = { accounts_listMembershipsForAccount?: Array<{ role: Github__Com___Kloudlite___Api___Apps___Iam___Types__Role; - user: { verified: boolean; name: string; joined: any; email: string }; + user: { + verified: boolean; + name: string; + joined: any; + email: string; + id: string; + }; }>; };