Refactor client config (#529)
* Refactor client config * Fix server tests * Fix lint
This commit is contained in:
18
front/src/modules/client-config/queries/index.tsx
Normal file
18
front/src/modules/client-config/queries/index.tsx
Normal file
@ -0,0 +1,18 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const GET_CLIENT_CONFIG = gql`
|
||||
query GetClientConfig {
|
||||
clientConfig {
|
||||
authProviders {
|
||||
google
|
||||
password
|
||||
}
|
||||
demoMode
|
||||
debugMode
|
||||
telemetry {
|
||||
enabled
|
||||
anonymizationEnabled
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -0,0 +1,8 @@
|
||||
import { atom } from 'recoil';
|
||||
|
||||
import { AuthProviders } from '~/generated/graphql';
|
||||
|
||||
export const authProvidersState = atom<AuthProviders>({
|
||||
key: 'authProvidersState',
|
||||
default: { google: false, magicLink: false, password: true },
|
||||
});
|
||||
@ -0,0 +1,6 @@
|
||||
import { atom } from 'recoil';
|
||||
|
||||
export const isDebugModeState = atom<boolean>({
|
||||
key: 'isDebugModeState',
|
||||
default: false,
|
||||
});
|
||||
@ -0,0 +1,6 @@
|
||||
import { atom } from 'recoil';
|
||||
|
||||
export const isDemoModeState = atom<boolean>({
|
||||
key: 'isDemoModeState',
|
||||
default: false,
|
||||
});
|
||||
8
front/src/modules/client-config/states/telemetryState.ts
Normal file
8
front/src/modules/client-config/states/telemetryState.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import { atom } from 'recoil';
|
||||
|
||||
import { Telemetry } from '~/generated/graphql';
|
||||
|
||||
export const telemetryState = atom<Telemetry>({
|
||||
key: 'telemetryState',
|
||||
default: { enabled: true, anonymizationEnabled: true },
|
||||
});
|
||||
Reference in New Issue
Block a user