refacto(*): rename hostname to custom domain (#10100)
This commit is contained in:
@ -109,7 +109,6 @@ export type AuthorizeApp = {
|
||||
export type AvailableWorkspaceOutput = {
|
||||
__typename?: 'AvailableWorkspaceOutput';
|
||||
displayName?: Maybe<Scalars['String']['output']>;
|
||||
hostname?: Maybe<Scalars['String']['output']>;
|
||||
id: Scalars['String']['output'];
|
||||
logo?: Maybe<Scalars['String']['output']>;
|
||||
sso: Array<SsoConnection>;
|
||||
@ -385,15 +384,15 @@ export type CursorPaging = {
|
||||
last?: InputMaybe<Scalars['Int']['input']>;
|
||||
};
|
||||
|
||||
export type CustomHostnameDetails = {
|
||||
__typename?: 'CustomHostnameDetails';
|
||||
hostname: Scalars['String']['output'];
|
||||
export type CustomDomainDetails = {
|
||||
__typename?: 'CustomDomainDetails';
|
||||
customDomain: Scalars['String']['output'];
|
||||
id: Scalars['String']['output'];
|
||||
records: Array<CustomHostnameVerification>;
|
||||
records: Array<CustomDomainVerification>;
|
||||
};
|
||||
|
||||
export type CustomHostnameVerification = {
|
||||
__typename?: 'CustomHostnameVerification';
|
||||
export type CustomDomainVerification = {
|
||||
__typename?: 'CustomDomainVerification';
|
||||
key: Scalars['String']['output'];
|
||||
status: Scalars['String']['output'];
|
||||
type: Scalars['String']['output'];
|
||||
@ -1105,6 +1104,7 @@ export type MutationSendInvitationsArgs = {
|
||||
export type MutationSignUpArgs = {
|
||||
captchaToken?: InputMaybe<Scalars['String']['input']>;
|
||||
email: Scalars['String']['input'];
|
||||
locale?: InputMaybe<Scalars['String']['input']>;
|
||||
password: Scalars['String']['input'];
|
||||
workspaceId?: InputMaybe<Scalars['String']['input']>;
|
||||
workspaceInviteHash?: InputMaybe<Scalars['String']['input']>;
|
||||
@ -1373,8 +1373,8 @@ export type Query = {
|
||||
findWorkspaceFromInviteHash: Workspace;
|
||||
findWorkspaceInvitations: Array<WorkspaceInvitation>;
|
||||
getAvailablePackages: Scalars['JSON']['output'];
|
||||
getCustomDomainDetails?: Maybe<CustomDomainDetails>;
|
||||
getEnvironmentVariablesGrouped: EnvironmentVariablesOutput;
|
||||
getHostnameDetails?: Maybe<CustomHostnameDetails>;
|
||||
getPostgresCredentials?: Maybe<PostgresCredentials>;
|
||||
getProductPrices: BillingProductPricesOutput;
|
||||
getPublicWorkspaceDataByDomain: PublicWorkspaceDataOutput;
|
||||
@ -1971,8 +1971,8 @@ export type UpdateWorkflowVersionStepInput = {
|
||||
|
||||
export type UpdateWorkspaceInput = {
|
||||
allowImpersonation?: InputMaybe<Scalars['Boolean']['input']>;
|
||||
customDomain?: InputMaybe<Scalars['String']['input']>;
|
||||
displayName?: InputMaybe<Scalars['String']['input']>;
|
||||
hostname?: InputMaybe<Scalars['String']['input']>;
|
||||
inviteHash?: InputMaybe<Scalars['String']['input']>;
|
||||
isGoogleAuthEnabled?: InputMaybe<Scalars['Boolean']['input']>;
|
||||
isMicrosoftAuthEnabled?: InputMaybe<Scalars['Boolean']['input']>;
|
||||
@ -1997,6 +1997,7 @@ export type User = {
|
||||
id: Scalars['UUID']['output'];
|
||||
isEmailVerified: Scalars['Boolean']['output'];
|
||||
lastName: Scalars['String']['output'];
|
||||
locale: Scalars['String']['output'];
|
||||
onboardingStatus?: Maybe<OnboardingStatus>;
|
||||
passwordHash?: Maybe<Scalars['String']['output']>;
|
||||
supportUserHash?: Maybe<Scalars['String']['output']>;
|
||||
@ -2103,13 +2104,13 @@ export type Workspace = {
|
||||
billingSubscriptions: Array<BillingSubscription>;
|
||||
createdAt: Scalars['DateTime']['output'];
|
||||
currentBillingSubscription?: Maybe<BillingSubscription>;
|
||||
customDomain?: Maybe<Scalars['String']['output']>;
|
||||
databaseSchema: Scalars['String']['output'];
|
||||
databaseUrl: Scalars['String']['output'];
|
||||
deletedAt?: Maybe<Scalars['DateTime']['output']>;
|
||||
displayName?: Maybe<Scalars['String']['output']>;
|
||||
featureFlags?: Maybe<Array<FeatureFlag>>;
|
||||
hasValidEnterpriseKey: Scalars['Boolean']['output'];
|
||||
hostname?: Maybe<Scalars['String']['output']>;
|
||||
id: Scalars['UUID']['output'];
|
||||
inviteHash?: Maybe<Scalars['String']['output']>;
|
||||
isGoogleAuthEnabled: Scalars['Boolean']['output'];
|
||||
@ -2198,18 +2199,18 @@ export type WorkspaceNameAndId = {
|
||||
id: Scalars['String']['output'];
|
||||
};
|
||||
|
||||
export type WorkspaceUrlsAndId = {
|
||||
__typename?: 'WorkspaceUrlsAndId';
|
||||
id: Scalars['String']['output'];
|
||||
workspaceUrls: WorkspaceUrls;
|
||||
};
|
||||
|
||||
export type WorkspaceUrls = {
|
||||
__typename?: 'workspaceUrls';
|
||||
customUrl?: Maybe<Scalars['String']['output']>;
|
||||
subdomainUrl: Scalars['String']['output'];
|
||||
};
|
||||
|
||||
export type WorkspaceUrlsAndId = {
|
||||
__typename?: 'workspaceUrlsAndId';
|
||||
id: Scalars['String']['output'];
|
||||
workspaceUrls: WorkspaceUrls;
|
||||
};
|
||||
|
||||
export type RemoteServerFieldsFragment = { __typename?: 'RemoteServer', id: string, createdAt: any, foreignDataWrapperId: string, foreignDataWrapperOptions?: any | null, foreignDataWrapperType: string, updatedAt: any, schema?: string | null, label: string, userMappingOptions?: { __typename?: 'UserMappingOptionsUser', user?: string | null } | null };
|
||||
|
||||
export type RemoteTableFieldsFragment = { __typename?: 'RemoteTable', id?: any | null, name: string, schema?: string | null, status: RemoteTableStatus, schemaPendingUpdates?: Array<DistantTableUpdate> | null };
|
||||
|
||||
@ -102,7 +102,6 @@ export type AuthorizeApp = {
|
||||
export type AvailableWorkspaceOutput = {
|
||||
__typename?: 'AvailableWorkspaceOutput';
|
||||
displayName?: Maybe<Scalars['String']>;
|
||||
hostname?: Maybe<Scalars['String']>;
|
||||
id: Scalars['String'];
|
||||
logo?: Maybe<Scalars['String']>;
|
||||
sso: Array<SsoConnection>;
|
||||
@ -322,15 +321,15 @@ export type CursorPaging = {
|
||||
last?: InputMaybe<Scalars['Int']>;
|
||||
};
|
||||
|
||||
export type CustomHostnameDetails = {
|
||||
__typename?: 'CustomHostnameDetails';
|
||||
hostname: Scalars['String'];
|
||||
export type CustomDomainDetails = {
|
||||
__typename?: 'CustomDomainDetails';
|
||||
customDomain: Scalars['String'];
|
||||
id: Scalars['String'];
|
||||
records: Array<CustomHostnameVerification>;
|
||||
records: Array<CustomDomainVerification>;
|
||||
};
|
||||
|
||||
export type CustomHostnameVerification = {
|
||||
__typename?: 'CustomHostnameVerification';
|
||||
export type CustomDomainVerification = {
|
||||
__typename?: 'CustomDomainVerification';
|
||||
key: Scalars['String'];
|
||||
status: Scalars['String'];
|
||||
type: Scalars['String'];
|
||||
@ -1238,7 +1237,7 @@ export type Query = {
|
||||
findWorkspaceFromInviteHash: Workspace;
|
||||
findWorkspaceInvitations: Array<WorkspaceInvitation>;
|
||||
getAvailablePackages: Scalars['JSON'];
|
||||
getCustomHostnameDetails?: Maybe<CustomHostnameDetails>;
|
||||
getCustomDomainDetails?: Maybe<CustomDomainDetails>;
|
||||
getEnvironmentVariablesGrouped: EnvironmentVariablesOutput;
|
||||
getPostgresCredentials?: Maybe<PostgresCredentials>;
|
||||
getProductPrices: BillingProductPricesOutput;
|
||||
@ -1760,8 +1759,8 @@ export type UpdateWorkflowVersionStepInput = {
|
||||
|
||||
export type UpdateWorkspaceInput = {
|
||||
allowImpersonation?: InputMaybe<Scalars['Boolean']>;
|
||||
customDomain?: InputMaybe<Scalars['String']>;
|
||||
displayName?: InputMaybe<Scalars['String']>;
|
||||
hostname?: InputMaybe<Scalars['String']>;
|
||||
inviteHash?: InputMaybe<Scalars['String']>;
|
||||
isGoogleAuthEnabled?: InputMaybe<Scalars['Boolean']>;
|
||||
isMicrosoftAuthEnabled?: InputMaybe<Scalars['Boolean']>;
|
||||
@ -1786,6 +1785,7 @@ export type User = {
|
||||
id: Scalars['UUID'];
|
||||
isEmailVerified: Scalars['Boolean'];
|
||||
lastName: Scalars['String'];
|
||||
locale: Scalars['String'];
|
||||
onboardingStatus?: Maybe<OnboardingStatus>;
|
||||
passwordHash?: Maybe<Scalars['String']>;
|
||||
supportUserHash?: Maybe<Scalars['String']>;
|
||||
@ -1882,13 +1882,13 @@ export type Workspace = {
|
||||
billingSubscriptions: Array<BillingSubscription>;
|
||||
createdAt: Scalars['DateTime'];
|
||||
currentBillingSubscription?: Maybe<BillingSubscription>;
|
||||
customDomain?: Maybe<Scalars['String']>;
|
||||
databaseSchema: Scalars['String'];
|
||||
databaseUrl: Scalars['String'];
|
||||
deletedAt?: Maybe<Scalars['DateTime']>;
|
||||
displayName?: Maybe<Scalars['String']>;
|
||||
featureFlags?: Maybe<Array<FeatureFlag>>;
|
||||
hasValidEnterpriseKey: Scalars['Boolean'];
|
||||
hostname?: Maybe<Scalars['String']>;
|
||||
id: Scalars['UUID'];
|
||||
inviteHash?: Maybe<Scalars['String']>;
|
||||
isGoogleAuthEnabled: Scalars['Boolean'];
|
||||
@ -1977,18 +1977,18 @@ export type WorkspaceNameAndId = {
|
||||
id: Scalars['String'];
|
||||
};
|
||||
|
||||
export type WorkspaceUrlsAndId = {
|
||||
__typename?: 'WorkspaceUrlsAndId';
|
||||
id: Scalars['String'];
|
||||
workspaceUrls: WorkspaceUrls;
|
||||
};
|
||||
|
||||
export type WorkspaceUrls = {
|
||||
__typename?: 'workspaceUrls';
|
||||
customUrl?: Maybe<Scalars['String']>;
|
||||
subdomainUrl: Scalars['String'];
|
||||
};
|
||||
|
||||
export type WorkspaceUrlsAndId = {
|
||||
__typename?: 'workspaceUrlsAndId';
|
||||
id: Scalars['String'];
|
||||
workspaceUrls: WorkspaceUrls;
|
||||
};
|
||||
|
||||
export type TimelineCalendarEventFragmentFragment = { __typename?: 'TimelineCalendarEvent', id: any, title: string, description: string, location: string, startsAt: string, endsAt: string, isFullDay: boolean, visibility: CalendarChannelVisibility, participants: Array<{ __typename?: 'TimelineCalendarEventParticipant', personId?: any | null, workspaceMemberId?: any | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string }> };
|
||||
|
||||
export type TimelineCalendarEventParticipantFragmentFragment = { __typename?: 'TimelineCalendarEventParticipant', personId?: any | null, workspaceMemberId?: any | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string };
|
||||
@ -2133,7 +2133,7 @@ export type ImpersonateMutationVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type ImpersonateMutation = { __typename?: 'Mutation', impersonate: { __typename?: 'ImpersonateOutput', workspace: { __typename?: 'workspaceUrlsAndId', id: string, workspaceUrls: { __typename?: 'workspaceUrls', subdomainUrl: string, customUrl?: string | null } }, loginToken: { __typename?: 'AuthToken', token: string, expiresAt: string } } };
|
||||
export type ImpersonateMutation = { __typename?: 'Mutation', impersonate: { __typename?: 'ImpersonateOutput', workspace: { __typename?: 'WorkspaceUrlsAndId', id: string, workspaceUrls: { __typename?: 'workspaceUrls', subdomainUrl: string, customUrl?: string | null } }, loginToken: { __typename?: 'AuthToken', token: string, expiresAt: string } } };
|
||||
|
||||
export type RenewTokenMutationVariables = Exact<{
|
||||
appToken: Scalars['String'];
|
||||
@ -2160,7 +2160,7 @@ export type SignUpMutationVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type SignUpMutation = { __typename?: 'Mutation', signUp: { __typename?: 'SignUpOutput', loginToken: { __typename?: 'AuthToken', token: string, expiresAt: string }, workspace: { __typename?: 'workspaceUrlsAndId', id: string, workspaceUrls: { __typename?: 'workspaceUrls', subdomainUrl: string, customUrl?: string | null } } } };
|
||||
export type SignUpMutation = { __typename?: 'Mutation', signUp: { __typename?: 'SignUpOutput', loginToken: { __typename?: 'AuthToken', token: string, expiresAt: string }, workspace: { __typename?: 'WorkspaceUrlsAndId', id: string, workspaceUrls: { __typename?: 'workspaceUrls', subdomainUrl: string, customUrl?: string | null } } } };
|
||||
|
||||
export type UpdatePasswordViaResetTokenMutationVariables = Exact<{
|
||||
token: Scalars['String'];
|
||||
@ -2295,7 +2295,7 @@ export type ListSsoIdentityProvidersByWorkspaceIdQueryVariables = Exact<{ [key:
|
||||
|
||||
export type ListSsoIdentityProvidersByWorkspaceIdQuery = { __typename?: 'Query', listSSOIdentityProvidersByWorkspaceId: Array<{ __typename?: 'FindAvailableSSOIDPOutput', type: IdentityProviderType, id: string, name: string, issuer: string, status: SsoIdentityProviderStatus }> };
|
||||
|
||||
export type UserQueryFragmentFragment = { __typename?: 'User', id: any, firstName: string, lastName: string, email: string, canImpersonate: boolean, supportUserHash?: string | null, onboardingStatus?: OnboardingStatus | null, userVars: any, analyticsTinybirdJwts?: { __typename?: 'AnalyticsTinybirdJwtMap', getWebhookAnalytics: string, getPageviewsAnalytics: string, getUsersAnalytics: string, getServerlessFunctionDuration: string, getServerlessFunctionSuccessRate: string, getServerlessFunctionErrorCount: string } | null, workspaceMember?: { __typename?: 'WorkspaceMember', id: any, colorScheme: string, avatarUrl?: string | null, locale?: string | null, timeZone?: string | null, dateFormat?: WorkspaceMemberDateFormatEnum | null, timeFormat?: WorkspaceMemberTimeFormatEnum | null, name: { __typename?: 'FullName', firstName: string, lastName: string } } | null, workspaceMembers?: Array<{ __typename?: 'WorkspaceMember', id: any, colorScheme: string, avatarUrl?: string | null, locale?: string | null, timeZone?: string | null, dateFormat?: WorkspaceMemberDateFormatEnum | null, timeFormat?: WorkspaceMemberTimeFormatEnum | null, name: { __typename?: 'FullName', firstName: string, lastName: string } }> | null, currentUserWorkspace?: { __typename?: 'UserWorkspace', settingsPermissions?: Array<SettingsFeatures> | null } | null, currentWorkspace?: { __typename?: 'Workspace', id: any, displayName?: string | null, logo?: string | null, inviteHash?: string | null, allowImpersonation: boolean, activationStatus: WorkspaceActivationStatus, isPublicInviteLinkEnabled: boolean, isGoogleAuthEnabled: boolean, isMicrosoftAuthEnabled: boolean, isPasswordAuthEnabled: boolean, subdomain: string, hasValidEnterpriseKey: boolean, hostname?: string | null, metadataVersion: number, workspaceMembersCount?: number | null, workspaceUrls: { __typename?: 'workspaceUrls', subdomainUrl: string, customUrl?: string | null }, featureFlags?: Array<{ __typename?: 'FeatureFlag', id: any, key: FeatureFlagKey, value: boolean, workspaceId: string }> | null, currentBillingSubscription?: { __typename?: 'BillingSubscription', id: any, status: SubscriptionStatus, interval?: SubscriptionInterval | null } | null, billingSubscriptions: Array<{ __typename?: 'BillingSubscription', id: any, status: SubscriptionStatus }> } | null, workspaces: Array<{ __typename?: 'UserWorkspace', workspace?: { __typename?: 'Workspace', id: any, logo?: string | null, displayName?: string | null, subdomain: string, hostname?: string | null, workspaceUrls: { __typename?: 'workspaceUrls', subdomainUrl: string, customUrl?: string | null } } | null }> };
|
||||
export type UserQueryFragmentFragment = { __typename?: 'User', id: any, firstName: string, lastName: string, email: string, canImpersonate: boolean, supportUserHash?: string | null, onboardingStatus?: OnboardingStatus | null, userVars: any, analyticsTinybirdJwts?: { __typename?: 'AnalyticsTinybirdJwtMap', getWebhookAnalytics: string, getPageviewsAnalytics: string, getUsersAnalytics: string, getServerlessFunctionDuration: string, getServerlessFunctionSuccessRate: string, getServerlessFunctionErrorCount: string } | null, workspaceMember?: { __typename?: 'WorkspaceMember', id: any, colorScheme: string, avatarUrl?: string | null, locale?: string | null, timeZone?: string | null, dateFormat?: WorkspaceMemberDateFormatEnum | null, timeFormat?: WorkspaceMemberTimeFormatEnum | null, name: { __typename?: 'FullName', firstName: string, lastName: string } } | null, workspaceMembers?: Array<{ __typename?: 'WorkspaceMember', id: any, colorScheme: string, avatarUrl?: string | null, locale?: string | null, timeZone?: string | null, dateFormat?: WorkspaceMemberDateFormatEnum | null, timeFormat?: WorkspaceMemberTimeFormatEnum | null, name: { __typename?: 'FullName', firstName: string, lastName: string } }> | null, currentUserWorkspace?: { __typename?: 'UserWorkspace', settingsPermissions?: Array<SettingsFeatures> | null } | null, currentWorkspace?: { __typename?: 'Workspace', id: any, displayName?: string | null, logo?: string | null, inviteHash?: string | null, allowImpersonation: boolean, activationStatus: WorkspaceActivationStatus, isPublicInviteLinkEnabled: boolean, isGoogleAuthEnabled: boolean, isMicrosoftAuthEnabled: boolean, isPasswordAuthEnabled: boolean, subdomain: string, hasValidEnterpriseKey: boolean, customDomain?: string | null, metadataVersion: number, workspaceMembersCount?: number | null, workspaceUrls: { __typename?: 'workspaceUrls', subdomainUrl: string, customUrl?: string | null }, featureFlags?: Array<{ __typename?: 'FeatureFlag', id: any, key: FeatureFlagKey, value: boolean, workspaceId: string }> | null, currentBillingSubscription?: { __typename?: 'BillingSubscription', id: any, status: SubscriptionStatus, interval?: SubscriptionInterval | null } | null, billingSubscriptions: Array<{ __typename?: 'BillingSubscription', id: any, status: SubscriptionStatus }> } | null, workspaces: Array<{ __typename?: 'UserWorkspace', workspace?: { __typename?: 'Workspace', id: any, logo?: string | null, displayName?: string | null, subdomain: string, customDomain?: string | null, workspaceUrls: { __typename?: 'workspaceUrls', subdomainUrl: string, customUrl?: string | null } } | null }> };
|
||||
|
||||
export type DeleteUserAccountMutationVariables = Exact<{ [key: string]: never; }>;
|
||||
|
||||
@ -2312,7 +2312,7 @@ export type UploadProfilePictureMutation = { __typename?: 'Mutation', uploadProf
|
||||
export type GetCurrentUserQueryVariables = Exact<{ [key: string]: never; }>;
|
||||
|
||||
|
||||
export type GetCurrentUserQuery = { __typename?: 'Query', currentUser: { __typename?: 'User', id: any, firstName: string, lastName: string, email: string, canImpersonate: boolean, supportUserHash?: string | null, onboardingStatus?: OnboardingStatus | null, userVars: any, analyticsTinybirdJwts?: { __typename?: 'AnalyticsTinybirdJwtMap', getWebhookAnalytics: string, getPageviewsAnalytics: string, getUsersAnalytics: string, getServerlessFunctionDuration: string, getServerlessFunctionSuccessRate: string, getServerlessFunctionErrorCount: string } | null, workspaceMember?: { __typename?: 'WorkspaceMember', id: any, colorScheme: string, avatarUrl?: string | null, locale?: string | null, timeZone?: string | null, dateFormat?: WorkspaceMemberDateFormatEnum | null, timeFormat?: WorkspaceMemberTimeFormatEnum | null, name: { __typename?: 'FullName', firstName: string, lastName: string } } | null, workspaceMembers?: Array<{ __typename?: 'WorkspaceMember', id: any, colorScheme: string, avatarUrl?: string | null, locale?: string | null, timeZone?: string | null, dateFormat?: WorkspaceMemberDateFormatEnum | null, timeFormat?: WorkspaceMemberTimeFormatEnum | null, name: { __typename?: 'FullName', firstName: string, lastName: string } }> | null, currentUserWorkspace?: { __typename?: 'UserWorkspace', settingsPermissions?: Array<SettingsFeatures> | null } | null, currentWorkspace?: { __typename?: 'Workspace', id: any, displayName?: string | null, logo?: string | null, inviteHash?: string | null, allowImpersonation: boolean, activationStatus: WorkspaceActivationStatus, isPublicInviteLinkEnabled: boolean, isGoogleAuthEnabled: boolean, isMicrosoftAuthEnabled: boolean, isPasswordAuthEnabled: boolean, subdomain: string, hasValidEnterpriseKey: boolean, hostname?: string | null, metadataVersion: number, workspaceMembersCount?: number | null, workspaceUrls: { __typename?: 'workspaceUrls', subdomainUrl: string, customUrl?: string | null }, featureFlags?: Array<{ __typename?: 'FeatureFlag', id: any, key: FeatureFlagKey, value: boolean, workspaceId: string }> | null, currentBillingSubscription?: { __typename?: 'BillingSubscription', id: any, status: SubscriptionStatus, interval?: SubscriptionInterval | null } | null, billingSubscriptions: Array<{ __typename?: 'BillingSubscription', id: any, status: SubscriptionStatus }> } | null, workspaces: Array<{ __typename?: 'UserWorkspace', workspace?: { __typename?: 'Workspace', id: any, logo?: string | null, displayName?: string | null, subdomain: string, hostname?: string | null, workspaceUrls: { __typename?: 'workspaceUrls', subdomainUrl: string, customUrl?: string | null } } | null }> } };
|
||||
export type GetCurrentUserQuery = { __typename?: 'Query', currentUser: { __typename?: 'User', id: any, firstName: string, lastName: string, email: string, canImpersonate: boolean, supportUserHash?: string | null, onboardingStatus?: OnboardingStatus | null, userVars: any, analyticsTinybirdJwts?: { __typename?: 'AnalyticsTinybirdJwtMap', getWebhookAnalytics: string, getPageviewsAnalytics: string, getUsersAnalytics: string, getServerlessFunctionDuration: string, getServerlessFunctionSuccessRate: string, getServerlessFunctionErrorCount: string } | null, workspaceMember?: { __typename?: 'WorkspaceMember', id: any, colorScheme: string, avatarUrl?: string | null, locale?: string | null, timeZone?: string | null, dateFormat?: WorkspaceMemberDateFormatEnum | null, timeFormat?: WorkspaceMemberTimeFormatEnum | null, name: { __typename?: 'FullName', firstName: string, lastName: string } } | null, workspaceMembers?: Array<{ __typename?: 'WorkspaceMember', id: any, colorScheme: string, avatarUrl?: string | null, locale?: string | null, timeZone?: string | null, dateFormat?: WorkspaceMemberDateFormatEnum | null, timeFormat?: WorkspaceMemberTimeFormatEnum | null, name: { __typename?: 'FullName', firstName: string, lastName: string } }> | null, currentUserWorkspace?: { __typename?: 'UserWorkspace', settingsPermissions?: Array<SettingsFeatures> | null } | null, currentWorkspace?: { __typename?: 'Workspace', id: any, displayName?: string | null, logo?: string | null, inviteHash?: string | null, allowImpersonation: boolean, activationStatus: WorkspaceActivationStatus, isPublicInviteLinkEnabled: boolean, isGoogleAuthEnabled: boolean, isMicrosoftAuthEnabled: boolean, isPasswordAuthEnabled: boolean, subdomain: string, hasValidEnterpriseKey: boolean, customDomain?: string | null, metadataVersion: number, workspaceMembersCount?: number | null, workspaceUrls: { __typename?: 'workspaceUrls', subdomainUrl: string, customUrl?: string | null }, featureFlags?: Array<{ __typename?: 'FeatureFlag', id: any, key: FeatureFlagKey, value: boolean, workspaceId: string }> | null, currentBillingSubscription?: { __typename?: 'BillingSubscription', id: any, status: SubscriptionStatus, interval?: SubscriptionInterval | null } | null, billingSubscriptions: Array<{ __typename?: 'BillingSubscription', id: any, status: SubscriptionStatus }> } | null, workspaces: Array<{ __typename?: 'UserWorkspace', workspace?: { __typename?: 'Workspace', id: any, logo?: string | null, displayName?: string | null, subdomain: string, customDomain?: string | null, workspaceUrls: { __typename?: 'workspaceUrls', subdomainUrl: string, customUrl?: string | null } } | null }> } };
|
||||
|
||||
export type ActivateWorkflowVersionMutationVariables = Exact<{
|
||||
workflowVersionId: Scalars['String'];
|
||||
@ -2415,7 +2415,7 @@ export type UpdateWorkspaceMutationVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type UpdateWorkspaceMutation = { __typename?: 'Mutation', updateWorkspace: { __typename?: 'Workspace', id: any, hostname?: string | null, subdomain: string, displayName?: string | null, logo?: string | null, allowImpersonation: boolean, isPublicInviteLinkEnabled: boolean, isGoogleAuthEnabled: boolean, isMicrosoftAuthEnabled: boolean, isPasswordAuthEnabled: boolean } };
|
||||
export type UpdateWorkspaceMutation = { __typename?: 'Mutation', updateWorkspace: { __typename?: 'Workspace', id: any, customDomain?: string | null, subdomain: string, displayName?: string | null, logo?: string | null, allowImpersonation: boolean, isPublicInviteLinkEnabled: boolean, isGoogleAuthEnabled: boolean, isMicrosoftAuthEnabled: boolean, isPasswordAuthEnabled: boolean } };
|
||||
|
||||
export type UploadWorkspaceLogoMutationVariables = Exact<{
|
||||
file: Scalars['Upload'];
|
||||
@ -2424,10 +2424,10 @@ export type UploadWorkspaceLogoMutationVariables = Exact<{
|
||||
|
||||
export type UploadWorkspaceLogoMutation = { __typename?: 'Mutation', uploadWorkspaceLogo: string };
|
||||
|
||||
export type GetCustomHostnameDetailsQueryVariables = Exact<{ [key: string]: never; }>;
|
||||
export type GetCustomDomainDetailsQueryVariables = Exact<{ [key: string]: never; }>;
|
||||
|
||||
|
||||
export type GetCustomHostnameDetailsQuery = { __typename?: 'Query', getCustomHostnameDetails?: { __typename?: 'CustomHostnameDetails', hostname: string, records: Array<{ __typename?: 'CustomHostnameVerification', type: string, key: string, value: string, validationType: string, status: string }> } | null };
|
||||
export type GetCustomDomainDetailsQuery = { __typename?: 'Query', getCustomDomainDetails?: { __typename?: 'CustomDomainDetails', customDomain: string, records: Array<{ __typename?: 'CustomDomainVerification', type: string, key: string, value: string, validationType: string, status: string }> } | null };
|
||||
|
||||
export type GetWorkspaceFromInviteHashQueryVariables = Exact<{
|
||||
inviteHash: Scalars['String'];
|
||||
@ -2589,7 +2589,7 @@ export const UserQueryFragmentFragmentDoc = gql`
|
||||
isPasswordAuthEnabled
|
||||
subdomain
|
||||
hasValidEnterpriseKey
|
||||
hostname
|
||||
customDomain
|
||||
workspaceUrls {
|
||||
subdomainUrl
|
||||
customUrl
|
||||
@ -2618,7 +2618,7 @@ export const UserQueryFragmentFragmentDoc = gql`
|
||||
logo
|
||||
displayName
|
||||
subdomain
|
||||
hostname
|
||||
customDomain
|
||||
workspaceUrls {
|
||||
subdomainUrl
|
||||
customUrl
|
||||
@ -4791,7 +4791,7 @@ export const UpdateWorkspaceDocument = gql`
|
||||
mutation UpdateWorkspace($input: UpdateWorkspaceInput!) {
|
||||
updateWorkspace(data: $input) {
|
||||
id
|
||||
hostname
|
||||
customDomain
|
||||
subdomain
|
||||
displayName
|
||||
logo
|
||||
@ -4860,10 +4860,10 @@ export function useUploadWorkspaceLogoMutation(baseOptions?: Apollo.MutationHook
|
||||
export type UploadWorkspaceLogoMutationHookResult = ReturnType<typeof useUploadWorkspaceLogoMutation>;
|
||||
export type UploadWorkspaceLogoMutationResult = Apollo.MutationResult<UploadWorkspaceLogoMutation>;
|
||||
export type UploadWorkspaceLogoMutationOptions = Apollo.BaseMutationOptions<UploadWorkspaceLogoMutation, UploadWorkspaceLogoMutationVariables>;
|
||||
export const GetCustomHostnameDetailsDocument = gql`
|
||||
query GetCustomHostnameDetails {
|
||||
getCustomHostnameDetails {
|
||||
hostname
|
||||
export const GetCustomDomainDetailsDocument = gql`
|
||||
query GetCustomDomainDetails {
|
||||
getCustomDomainDetails {
|
||||
customDomain
|
||||
records {
|
||||
type
|
||||
key
|
||||
@ -4876,31 +4876,31 @@ export const GetCustomHostnameDetailsDocument = gql`
|
||||
`;
|
||||
|
||||
/**
|
||||
* __useGetCustomHostnameDetailsQuery__
|
||||
* __useGetCustomDomainDetailsQuery__
|
||||
*
|
||||
* To run a query within a React component, call `useGetCustomHostnameDetailsQuery` and pass it any options that fit your needs.
|
||||
* When your component renders, `useGetCustomHostnameDetailsQuery` returns an object from Apollo Client that contains loading, error, and data properties
|
||||
* To run a query within a React component, call `useGetCustomDomainDetailsQuery` and pass it any options that fit your needs.
|
||||
* When your component renders, `useGetCustomDomainDetailsQuery` returns an object from Apollo Client that contains loading, error, and data properties
|
||||
* you can use to render your UI.
|
||||
*
|
||||
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
|
||||
*
|
||||
* @example
|
||||
* const { data, loading, error } = useGetCustomHostnameDetailsQuery({
|
||||
* const { data, loading, error } = useGetCustomDomainDetailsQuery({
|
||||
* variables: {
|
||||
* },
|
||||
* });
|
||||
*/
|
||||
export function useGetCustomHostnameDetailsQuery(baseOptions?: Apollo.QueryHookOptions<GetCustomHostnameDetailsQuery, GetCustomHostnameDetailsQueryVariables>) {
|
||||
export function useGetCustomDomainDetailsQuery(baseOptions?: Apollo.QueryHookOptions<GetCustomDomainDetailsQuery, GetCustomDomainDetailsQueryVariables>) {
|
||||
const options = {...defaultOptions, ...baseOptions}
|
||||
return Apollo.useQuery<GetCustomHostnameDetailsQuery, GetCustomHostnameDetailsQueryVariables>(GetCustomHostnameDetailsDocument, options);
|
||||
return Apollo.useQuery<GetCustomDomainDetailsQuery, GetCustomDomainDetailsQueryVariables>(GetCustomDomainDetailsDocument, options);
|
||||
}
|
||||
export function useGetCustomHostnameDetailsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetCustomHostnameDetailsQuery, GetCustomHostnameDetailsQueryVariables>) {
|
||||
export function useGetCustomDomainDetailsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetCustomDomainDetailsQuery, GetCustomDomainDetailsQueryVariables>) {
|
||||
const options = {...defaultOptions, ...baseOptions}
|
||||
return Apollo.useLazyQuery<GetCustomHostnameDetailsQuery, GetCustomHostnameDetailsQueryVariables>(GetCustomHostnameDetailsDocument, options);
|
||||
return Apollo.useLazyQuery<GetCustomDomainDetailsQuery, GetCustomDomainDetailsQueryVariables>(GetCustomDomainDetailsDocument, options);
|
||||
}
|
||||
export type GetCustomHostnameDetailsQueryHookResult = ReturnType<typeof useGetCustomHostnameDetailsQuery>;
|
||||
export type GetCustomHostnameDetailsLazyQueryHookResult = ReturnType<typeof useGetCustomHostnameDetailsLazyQuery>;
|
||||
export type GetCustomHostnameDetailsQueryResult = Apollo.QueryResult<GetCustomHostnameDetailsQuery, GetCustomHostnameDetailsQueryVariables>;
|
||||
export type GetCustomDomainDetailsQueryHookResult = ReturnType<typeof useGetCustomDomainDetailsQuery>;
|
||||
export type GetCustomDomainDetailsLazyQueryHookResult = ReturnType<typeof useGetCustomDomainDetailsLazyQuery>;
|
||||
export type GetCustomDomainDetailsQueryResult = Apollo.QueryResult<GetCustomDomainDetailsQuery, GetCustomDomainDetailsQueryVariables>;
|
||||
export const GetWorkspaceFromInviteHashDocument = gql`
|
||||
query GetWorkspaceFromInviteHash($inviteHash: String!) {
|
||||
findWorkspaceFromInviteHash(inviteHash: $inviteHash) {
|
||||
|
||||
@ -20,7 +20,7 @@ export type CurrentWorkspace = Pick<
|
||||
| 'isPasswordAuthEnabled'
|
||||
| 'hasValidEnterpriseKey'
|
||||
| 'subdomain'
|
||||
| 'hostname'
|
||||
| 'customDomain'
|
||||
| 'workspaceUrls'
|
||||
| 'metadataVersion'
|
||||
>;
|
||||
|
||||
@ -161,7 +161,7 @@ export const queries = {
|
||||
isPasswordAuthEnabled
|
||||
subdomain
|
||||
hasValidEnterpriseKey
|
||||
hostname
|
||||
customDomain
|
||||
workspaceUrls {
|
||||
subdomainUrl
|
||||
customUrl
|
||||
@ -190,7 +190,7 @@ export const queries = {
|
||||
logo
|
||||
displayName
|
||||
subdomain
|
||||
hostname
|
||||
customDomain
|
||||
workspaceUrls {
|
||||
subdomainUrl
|
||||
customUrl
|
||||
@ -308,7 +308,7 @@ export const responseData = {
|
||||
},
|
||||
workspaceMembers: [],
|
||||
currentUserWorkspace: {
|
||||
settingsPermissions: ['DATA_MODEL']
|
||||
settingsPermissions: ['DATA_MODEL'],
|
||||
},
|
||||
currentWorkspace: {
|
||||
id: 'test-workspace-id',
|
||||
@ -323,7 +323,7 @@ export const responseData = {
|
||||
isMicrosoftAuthEnabled: false,
|
||||
isPasswordAuthEnabled: true,
|
||||
subdomain: 'test',
|
||||
hostname: null,
|
||||
customDomain: null,
|
||||
workspaceUrls: {
|
||||
customUrl: undefined,
|
||||
subdomainUrl: 'https://test.twenty.com/',
|
||||
|
||||
@ -6,7 +6,7 @@ import { ExpandableList } from '@/ui/layout/expandable-list/components/Expandabl
|
||||
import { isDefined } from 'twenty-shared';
|
||||
import { checkUrlType } from '~/utils/checkUrlType';
|
||||
import { getAbsoluteUrl } from '~/utils/url/getAbsoluteUrl';
|
||||
import { getUrlHostName } from '~/utils/url/getUrlHostName';
|
||||
import { getUrlHostname } from '~/utils/url/getUrlHostname';
|
||||
|
||||
type LinksDisplayProps = {
|
||||
value?: FieldLinksValue;
|
||||
@ -29,7 +29,7 @@ export const LinksDisplay = ({ value }: LinksDisplayProps) => {
|
||||
const absoluteUrl = getAbsoluteUrl(url);
|
||||
return {
|
||||
url: absoluteUrl,
|
||||
label: label || getUrlHostName(absoluteUrl),
|
||||
label: label || getUrlHostname(absoluteUrl),
|
||||
type: checkUrlType(absoluteUrl),
|
||||
};
|
||||
}),
|
||||
|
||||
@ -40,7 +40,7 @@ export const USER_QUERY_FRAGMENT = gql`
|
||||
isPasswordAuthEnabled
|
||||
subdomain
|
||||
hasValidEnterpriseKey
|
||||
hostname
|
||||
customDomain
|
||||
workspaceUrls {
|
||||
subdomainUrl
|
||||
customUrl
|
||||
@ -69,7 +69,7 @@ export const USER_QUERY_FRAGMENT = gql`
|
||||
logo
|
||||
displayName
|
||||
subdomain
|
||||
hostname
|
||||
customDomain
|
||||
workspaceUrls {
|
||||
subdomainUrl
|
||||
customUrl
|
||||
|
||||
@ -4,7 +4,7 @@ export const UPDATE_WORKSPACE = gql`
|
||||
mutation UpdateWorkspace($input: UpdateWorkspaceInput!) {
|
||||
updateWorkspace(data: $input) {
|
||||
id
|
||||
hostname
|
||||
customDomain
|
||||
subdomain
|
||||
displayName
|
||||
logo
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const GET_CUSTOM_HOSTNAME_DETAILS = gql`
|
||||
query GetCustomHostnameDetails {
|
||||
getCustomHostnameDetails {
|
||||
hostname
|
||||
export const GET_CUSTOM_DOMAIN_DETAILS = gql`
|
||||
query GetCustomDomainDetails {
|
||||
getCustomDomainDetails {
|
||||
customDomain
|
||||
records {
|
||||
type
|
||||
key
|
||||
@ -3,29 +3,29 @@ import styled from '@emotion/styled';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { Controller, useFormContext } from 'react-hook-form';
|
||||
import { H2Title, Section } from 'twenty-ui';
|
||||
import { useGetCustomHostnameDetailsQuery } from '~/generated/graphql';
|
||||
import { SettingsHostnameRecords } from '~/pages/settings/workspace/SettingsHostnameRecords';
|
||||
import { useGetCustomDomainDetailsQuery } from '~/generated/graphql';
|
||||
import { SettingsCustomDomainRecords } from '~/pages/settings/workspace/SettingsCustomDomainRecords';
|
||||
|
||||
const StyledDomainFromWrapper = styled.div`
|
||||
const StyledDomainFormWrapper = styled.div`
|
||||
align-items: center;
|
||||
display: flex;
|
||||
`;
|
||||
|
||||
export const SettingsHostname = () => {
|
||||
const { data: getHostnameDetailsData } = useGetCustomHostnameDetailsQuery();
|
||||
export const SettingsCustomDomain = () => {
|
||||
const { data: getCustomDomainDetailsData } = useGetCustomDomainDetailsQuery();
|
||||
|
||||
const { t } = useLingui();
|
||||
|
||||
const { control, getValues } = useFormContext<{
|
||||
hostname: string;
|
||||
customDomain: string;
|
||||
}>();
|
||||
|
||||
return (
|
||||
<Section>
|
||||
<H2Title title={t`Domain`} description={t`Set the name of your domain`} />
|
||||
<StyledDomainFromWrapper>
|
||||
<StyledDomainFormWrapper>
|
||||
<Controller
|
||||
name="hostname"
|
||||
name="customDomain"
|
||||
control={control}
|
||||
render={({ field: { onChange, value }, fieldState: { error } }) => (
|
||||
<TextInputV2
|
||||
@ -37,12 +37,12 @@ export const SettingsHostname = () => {
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</StyledDomainFromWrapper>
|
||||
{getHostnameDetailsData?.getCustomHostnameDetails &&
|
||||
getValues('hostname') ===
|
||||
getHostnameDetailsData?.getCustomHostnameDetails?.hostname && (
|
||||
<SettingsHostnameRecords
|
||||
records={getHostnameDetailsData.getCustomHostnameDetails.records}
|
||||
</StyledDomainFormWrapper>
|
||||
{getCustomDomainDetailsData?.getCustomDomainDetails &&
|
||||
getValues('customDomain') ===
|
||||
getCustomDomainDetailsData?.getCustomDomainDetails?.customDomain && (
|
||||
<SettingsCustomDomainRecords
|
||||
records={getCustomDomainDetailsData.getCustomDomainDetails.records}
|
||||
/>
|
||||
)}
|
||||
</Section>
|
||||
@ -2,16 +2,16 @@ import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';
|
||||
import { useEffect } from 'react';
|
||||
import { useRecoilValue } from 'recoil';
|
||||
import { isDefined } from 'twenty-shared';
|
||||
import { useGetCustomHostnameDetailsQuery } from '~/generated/graphql';
|
||||
import { useGetCustomDomainDetailsQuery } from '~/generated/graphql';
|
||||
|
||||
export const SettingsHostnameEffect = () => {
|
||||
const { refetch } = useGetCustomHostnameDetailsQuery();
|
||||
export const SettingsCustomDomainEffect = () => {
|
||||
const { refetch } = useGetCustomDomainDetailsQuery();
|
||||
|
||||
const currentWorkspace = useRecoilValue(currentWorkspaceState);
|
||||
|
||||
useEffect(() => {
|
||||
let pollIntervalFn: null | ReturnType<typeof setInterval> = null;
|
||||
if (isDefined(currentWorkspace?.hostname)) {
|
||||
if (isDefined(currentWorkspace?.customDomain)) {
|
||||
pollIntervalFn = setInterval(async () => {
|
||||
refetch();
|
||||
}, 3000);
|
||||
@ -22,7 +22,7 @@ export const SettingsHostnameEffect = () => {
|
||||
clearInterval(pollIntervalFn);
|
||||
}
|
||||
};
|
||||
}, [currentWorkspace?.hostname, refetch]);
|
||||
}, [currentWorkspace?.customDomain, refetch]);
|
||||
|
||||
return <></>;
|
||||
};
|
||||
@ -5,12 +5,12 @@ import { TableBody } from '@/ui/layout/table/components/TableBody';
|
||||
import { TableCell } from '@/ui/layout/table/components/TableCell';
|
||||
import { TextInputV2 } from '@/ui/input/components/TextInputV2';
|
||||
import { Table } from '@/ui/layout/table/components/Table';
|
||||
import { CustomHostnameDetails } from '~/generated/graphql';
|
||||
import { CustomDomainDetails } from '~/generated/graphql';
|
||||
|
||||
export const SettingsHostnameRecords = ({
|
||||
export const SettingsCustomDomainRecords = ({
|
||||
records,
|
||||
}: {
|
||||
records: CustomHostnameDetails['records'];
|
||||
records: CustomDomainDetails['records'];
|
||||
}) => {
|
||||
return (
|
||||
<Table>
|
||||
@ -12,7 +12,7 @@ import {
|
||||
useUpdateWorkspaceMutation,
|
||||
} from '~/generated/graphql';
|
||||
import { useRedirectToWorkspaceDomain } from '@/domain-manager/hooks/useRedirectToWorkspaceDomain';
|
||||
import { SettingsHostname } from '~/pages/settings/workspace/SettingsHostname';
|
||||
import { SettingsCustomDomain } from '~/pages/settings/workspace/SettingsCustomDomain';
|
||||
import { SettingsSubdomain } from '~/pages/settings/workspace/SettingsSubdomain';
|
||||
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
|
||||
import { useNavigateSettings } from '~/hooks/useNavigateSettings';
|
||||
@ -24,7 +24,7 @@ import { zodResolver } from '@hookform/resolvers/zod';
|
||||
import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';
|
||||
import { SettingsPath } from '@/types/SettingsPath';
|
||||
import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';
|
||||
import { SettingsHostnameEffect } from '~/pages/settings/workspace/SettingsHostnameEffect';
|
||||
import { SettingsCustomDomainEffect } from '~/pages/settings/workspace/SettingsCustomDomainEffect';
|
||||
import { isDefined } from 'twenty-shared';
|
||||
|
||||
export const SettingsDomain = () => {
|
||||
@ -40,12 +40,12 @@ export const SettingsDomain = () => {
|
||||
.regex(/^[a-z0-9][a-z0-9-]{1,28}[a-z0-9]$/, {
|
||||
message: t`Use letter, number and dash only. Start and finish with a letter or a number`,
|
||||
}),
|
||||
hostname: z
|
||||
customDomain: z
|
||||
.string()
|
||||
.regex(
|
||||
/^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$/,
|
||||
{
|
||||
message: t`Invalid custom hostname. Custom hostnames have to be smaller than 256 characters in length, cannot be IP addresses, cannot contain spaces, cannot contain any special characters such as _~\`!@#$%^*()=+{}[]|\\;:'",<>/? and cannot begin or end with a '-' character.`,
|
||||
message: t`Invalid custom domain. Custom domains have to be smaller than 256 characters in length, cannot be IP addresses, cannot contain spaces, cannot contain any special characters such as _~\`!@#$%^*()=+{}[]|\\;:'",<>/? and cannot begin or end with a '-' character.`,
|
||||
},
|
||||
)
|
||||
.max(256)
|
||||
@ -68,35 +68,37 @@ export const SettingsDomain = () => {
|
||||
|
||||
const form = useForm<{
|
||||
subdomain: string;
|
||||
hostname: string | null;
|
||||
customDomain: string | null;
|
||||
}>({
|
||||
mode: 'onChange',
|
||||
delayError: 500,
|
||||
defaultValues: {
|
||||
subdomain: currentWorkspace?.subdomain ?? '',
|
||||
hostname: currentWorkspace?.hostname ?? null,
|
||||
customDomain: currentWorkspace?.customDomain ?? null,
|
||||
},
|
||||
resolver: zodResolver(validationSchema),
|
||||
});
|
||||
|
||||
const subdomainValue = form.watch('subdomain');
|
||||
const hostnameValue = form.watch('hostname');
|
||||
const customDomainValue = form.watch('customDomain');
|
||||
|
||||
const updateHostname = (
|
||||
hostname: string | null | undefined,
|
||||
const updateCustomDomain = (
|
||||
customDomain: string | null | undefined,
|
||||
currentWorkspace: CurrentWorkspace,
|
||||
) => {
|
||||
updateWorkspace({
|
||||
variables: {
|
||||
input: {
|
||||
hostname:
|
||||
isDefined(hostname) && hostname.length > 0 ? hostname : null,
|
||||
customDomain:
|
||||
isDefined(customDomain) && customDomain.length > 0
|
||||
? customDomain
|
||||
: null,
|
||||
},
|
||||
},
|
||||
onCompleted: () => {
|
||||
setCurrentWorkspace({
|
||||
...currentWorkspace,
|
||||
hostname: hostname,
|
||||
customDomain,
|
||||
});
|
||||
},
|
||||
onError: (error) => {
|
||||
@ -173,8 +175,8 @@ export const SettingsDomain = () => {
|
||||
return updateSubdomain(values.subdomain, currentWorkspace);
|
||||
}
|
||||
|
||||
if (values.hostname !== currentWorkspace.hostname) {
|
||||
return updateHostname(values.hostname, currentWorkspace);
|
||||
if (values.customDomain !== currentWorkspace.customDomain) {
|
||||
return updateCustomDomain(values.customDomain, currentWorkspace);
|
||||
}
|
||||
};
|
||||
|
||||
@ -197,7 +199,7 @@ export const SettingsDomain = () => {
|
||||
isSaveDisabled={
|
||||
!form.formState.isValid ||
|
||||
(subdomainValue === currentWorkspace?.subdomain &&
|
||||
hostnameValue === currentWorkspace?.hostname)
|
||||
customDomainValue === currentWorkspace?.customDomain)
|
||||
}
|
||||
onCancel={() => navigate(SettingsPath.Workspace)}
|
||||
onSave={handleSave}
|
||||
@ -207,13 +209,13 @@ export const SettingsDomain = () => {
|
||||
<SettingsPageContainer>
|
||||
{/* eslint-disable-next-line react/jsx-props-no-spreading */}
|
||||
<FormProvider {...form}>
|
||||
{(!currentWorkspace?.hostname || !isCustomDomainEnabled) && (
|
||||
{(!currentWorkspace?.customDomain || !isCustomDomainEnabled) && (
|
||||
<SettingsSubdomain />
|
||||
)}
|
||||
{isCustomDomainEnabled && (
|
||||
<>
|
||||
<SettingsHostnameEffect />
|
||||
<SettingsHostname />
|
||||
<SettingsCustomDomainEffect />
|
||||
<SettingsCustomDomain />
|
||||
</>
|
||||
)}
|
||||
</FormProvider>
|
||||
|
||||
@ -1,25 +1,25 @@
|
||||
import { getUrlHostName } from '~/utils/url/getUrlHostName';
|
||||
import { getUrlHostname } from '~/utils/url/getUrlHostname';
|
||||
|
||||
describe('getUrlHostName', () => {
|
||||
describe('getUrlHostname', () => {
|
||||
it("returns the URL's hostname", () => {
|
||||
expect(getUrlHostName('https://www.example.com')).toBe('example.com');
|
||||
expect(getUrlHostName('http://subdomain.example.com')).toBe(
|
||||
expect(getUrlHostname('https://www.example.com')).toBe('example.com');
|
||||
expect(getUrlHostname('http://subdomain.example.com')).toBe(
|
||||
'subdomain.example.com',
|
||||
);
|
||||
expect(getUrlHostName('https://www.example.com/path')).toBe('example.com');
|
||||
expect(getUrlHostName('https://www.example.com?query=123')).toBe(
|
||||
expect(getUrlHostname('https://www.example.com/path')).toBe('example.com');
|
||||
expect(getUrlHostname('https://www.example.com?query=123')).toBe(
|
||||
'example.com',
|
||||
);
|
||||
expect(getUrlHostName('http://localhost:3000')).toBe('localhost');
|
||||
expect(getUrlHostName('example.com')).toBe('example.com');
|
||||
expect(getUrlHostName('www.subdomain.example.com')).toBe(
|
||||
expect(getUrlHostname('http://localhost:3000')).toBe('localhost');
|
||||
expect(getUrlHostname('example.com')).toBe('example.com');
|
||||
expect(getUrlHostname('www.subdomain.example.com')).toBe(
|
||||
'subdomain.example.com',
|
||||
);
|
||||
});
|
||||
|
||||
it('returns an empty string for invalid URLs', () => {
|
||||
expect(getUrlHostName('?o')).toBe('');
|
||||
expect(getUrlHostName('')).toBe('');
|
||||
expect(getUrlHostName('\\')).toBe('');
|
||||
expect(getUrlHostname('?o')).toBe('');
|
||||
expect(getUrlHostname('')).toBe('');
|
||||
expect(getUrlHostname('\\')).toBe('');
|
||||
});
|
||||
});
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { getAbsoluteUrl } from '~/utils/url/getAbsoluteUrl';
|
||||
|
||||
export const getUrlHostName = (url: string) => {
|
||||
export const getUrlHostname = (url: string) => {
|
||||
try {
|
||||
const absoluteUrl = getAbsoluteUrl(url);
|
||||
return new URL(absoluteUrl).hostname.replace(/^www\./i, '');
|
||||
Reference in New Issue
Block a user