Translations - Crowdin, Set workspace member locale on signup, and optimizations (#10091)
More progress on translations: - Migrate from translations.io to crowdin - Optimize performance and robustness - Set workspaceMember/user locale upon signup
This commit is contained in:
@ -8,6 +8,7 @@ export const SIGN_UP = gql`
|
||||
$workspacePersonalInviteToken: String = null
|
||||
$captchaToken: String
|
||||
$workspaceId: String
|
||||
$locale: String
|
||||
) {
|
||||
signUp(
|
||||
email: $email
|
||||
@ -16,6 +17,7 @@ export const SIGN_UP = gql`
|
||||
workspacePersonalInviteToken: $workspacePersonalInviteToken
|
||||
captchaToken: $captchaToken
|
||||
workspaceId: $workspaceId
|
||||
locale: $locale
|
||||
) {
|
||||
loginToken {
|
||||
...AuthTokenFragment
|
||||
|
||||
@ -23,7 +23,12 @@ export const variables = {
|
||||
password,
|
||||
},
|
||||
getAuthTokensFromLoginToken: { loginToken: token },
|
||||
signup: {},
|
||||
signup: {
|
||||
email,
|
||||
password,
|
||||
workspacePersonalInviteToken: null,
|
||||
locale: "",
|
||||
},
|
||||
getCurrentUser: {},
|
||||
};
|
||||
|
||||
@ -103,7 +108,7 @@ export const mocks = [
|
||||
{
|
||||
request: {
|
||||
query: queries.signup,
|
||||
variables: variables.getLoginTokenFromCredentials,
|
||||
variables: variables.signup,
|
||||
},
|
||||
result: jest.fn(() => ({
|
||||
data: {
|
||||
|
||||
@ -60,9 +60,10 @@ import { useRedirectToWorkspaceDomain } from '@/domain-manager/hooks/useRedirect
|
||||
import { domainConfigurationState } from '@/domain-manager/states/domainConfigurationState';
|
||||
import { isAppWaitingForFreshObjectMetadataState } from '@/object-metadata/states/isAppWaitingForFreshObjectMetadataState';
|
||||
import { workspaceAuthProvidersState } from '@/workspace/states/workspaceAuthProvidersState';
|
||||
import { i18n } from '@lingui/core';
|
||||
import { useSearchParams } from 'react-router-dom';
|
||||
import { dynamicActivate } from '~/utils/i18n/dynamicActivate';
|
||||
import { getWorkspaceUrl } from '~/utils/getWorkspaceUrl';
|
||||
import { dynamicActivate } from '~/utils/i18n/dynamicActivate';
|
||||
|
||||
export const useAuth = () => {
|
||||
const setTokenPair = useSetRecoilState(tokenPairState);
|
||||
@ -391,6 +392,7 @@ export const useAuth = () => {
|
||||
workspaceInviteHash,
|
||||
workspacePersonalInviteToken,
|
||||
captchaToken,
|
||||
locale: i18n.locale ?? 'en',
|
||||
...(workspacePublicData?.id
|
||||
? { workspaceId: workspacePublicData.id }
|
||||
: {}),
|
||||
|
||||
Reference in New Issue
Block a user