feat(): enable custom domain usage (#9911)

# Content
- Introduce the `workspaceUrls` property. It contains two
sub-properties: `customUrl, subdomainUrl`. These endpoints are used to
access the workspace. Even if the `workspaceUrls` is invalid for
multiple reasons, the `subdomainUrl` remains valid.
- Introduce `ResolveField` workspaceEndpoints to avoid unnecessary URL
computation on the frontend part.
- Add a `forceSubdomainUrl` to avoid custom URL using a query parameter
This commit is contained in:
Antoine Moreaux
2025-02-07 14:34:26 +01:00
committed by GitHub
parent 3cc66fe712
commit 68183b7c85
87 changed files with 645 additions and 373 deletions

View File

@ -1,12 +1,15 @@
import { GetPublicWorkspaceDataBySubdomainQuery } from '~/generated/graphql';
import { GetPublicWorkspaceDataByDomainQuery } from '~/generated/graphql';
export const mockedPublicWorkspaceDataBySubdomain: GetPublicWorkspaceDataBySubdomainQuery['getPublicWorkspaceDataBySubdomain'] =
export const mockedPublicWorkspaceDataBySubdomain: GetPublicWorkspaceDataByDomainQuery['getPublicWorkspaceDataByDomain'] =
{
__typename: 'PublicWorkspaceDataOutput',
id: '9870323e-22c3-4d14-9b7f-5bdc84f7d6ee',
logo: 'workspace-logo/original/c88deb49-7636-4560-918d-08c3265ffb20.49?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ3b3Jrc3BhY2VJZCI6Ijk4NzAzMjNlLTIyYzMtNGQxNC05YjdmLTViZGM4NGY3ZDZlZSIsImlhdCI6MTczNjU0MDU0MywiZXhwIjoxNzM2NjI2OTQzfQ.C8cnHu09VGseRbQAMM4nhiO6z4TLG03ntFTvxm53-xg',
displayName: 'Twenty Eng',
subdomain: 'twenty-eng',
workspaceUrls: {
customUrl: 'https://twenty-eng.com',
subdomainUrl: 'https://custom.twenty.com',
},
authProviders: {
__typename: 'AuthProviders',
sso: [],

View File

@ -48,6 +48,10 @@ export const mockCurrentWorkspace: Workspace = {
hasValidEnterpriseKey: false,
isGoogleAuthEnabled: true,
isPasswordAuthEnabled: true,
workspaceUrls: {
customUrl: undefined,
subdomainUrl: 'twenty.twenty.com',
},
isMicrosoftAuthEnabled: false,
featureFlags: [
{