refactor(sso): standardize SSO identity provider query names (#10335)
Updated method, query, and variable names to align with a consistent naming convention for fetching SSO identity providers. Added comprehensive unit tests to validate SSO service logic, ensuring better reliability and maintainability. --------- Co-authored-by: Félix Malfait <felix@twenty.com>
This commit is contained in:
@ -49,7 +49,6 @@ export const SettingsAccountsRowDropdownMenu = ({
|
||||
<>
|
||||
<Dropdown
|
||||
dropdownId={dropdownId}
|
||||
className={className}
|
||||
dropdownPlacement="right-start"
|
||||
dropdownHotkeyScope={{ scope: dropdownId }}
|
||||
clickableComponent={
|
||||
|
||||
@ -15,7 +15,7 @@ import styled from '@emotion/styled';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { useRecoilState, useRecoilValue } from 'recoil';
|
||||
import { IconKey } from 'twenty-ui';
|
||||
import { useListSsoIdentityProvidersByWorkspaceIdQuery } from '~/generated/graphql';
|
||||
import { useGetSsoIdentityProvidersQuery } from '~/generated/graphql';
|
||||
import { getSettingsPath } from '~/utils/navigation/getSettingsPath';
|
||||
|
||||
const StyledLink = styled(Link, {
|
||||
@ -36,13 +36,11 @@ export const SettingsSSOIdentitiesProvidersListCard = () => {
|
||||
SSOIdentitiesProvidersState,
|
||||
);
|
||||
|
||||
const { loading } = useListSsoIdentityProvidersByWorkspaceIdQuery({
|
||||
const { loading } = useGetSsoIdentityProvidersQuery({
|
||||
fetchPolicy: 'network-only',
|
||||
skip: currentWorkspace?.hasValidEnterpriseKey === false,
|
||||
onCompleted: (data) => {
|
||||
setSSOIdentitiesProviders(
|
||||
data?.listSSOIdentityProvidersByWorkspaceId ?? [],
|
||||
);
|
||||
setSSOIdentitiesProviders(data?.getSSOIdentityProviders ?? []);
|
||||
},
|
||||
onError: (error: Error) => {
|
||||
enqueueSnackBar(error.message, {
|
||||
|
||||
@ -2,9 +2,9 @@
|
||||
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const LIST_WORKSPACE_SSO_IDENTITY_PROVIDERS = gql`
|
||||
query ListSSOIdentityProvidersByWorkspaceId {
|
||||
listSSOIdentityProvidersByWorkspaceId {
|
||||
export const GET_SSO_IDENTITY_PROVIDERS = gql`
|
||||
query GetSSOIdentityProviders {
|
||||
getSSOIdentityProviders {
|
||||
type
|
||||
id
|
||||
name
|
||||
|
||||
Reference in New Issue
Block a user