diff --git a/packages/twenty-front/src/pages/settings/workspace/SettingsCustomDomain.tsx b/packages/twenty-front/src/pages/settings/workspace/SettingsCustomDomain.tsx index 3098e1231..bab6cb689 100644 --- a/packages/twenty-front/src/pages/settings/workspace/SettingsCustomDomain.tsx +++ b/packages/twenty-front/src/pages/settings/workspace/SettingsCustomDomain.tsx @@ -92,18 +92,20 @@ export const SettingsCustomDomain = () => { Icon={IconTrash} variant="primary" onClick={deleteCustomDomain} - type="button" /> {currentWorkspace?.customDomain && ( - {customDomainRecords && ( - - )} + {customDomainRecords && + customDomainRecords.records.some( + (record) => record.status !== 'success', + ) && ( + + )} )} diff --git a/packages/twenty-front/src/pages/settings/workspace/SettingsCustomDomainRecords.tsx b/packages/twenty-front/src/pages/settings/workspace/SettingsCustomDomainRecords.tsx index c74545444..a30b0ce47 100644 --- a/packages/twenty-front/src/pages/settings/workspace/SettingsCustomDomainRecords.tsx +++ b/packages/twenty-front/src/pages/settings/workspace/SettingsCustomDomainRecords.tsx @@ -70,33 +70,35 @@ export const SettingsCustomDomainRecords = ({ Value - {records.map((record) => ( - - - copyToClipboardDebounced(record.key)} - type="button" - /> - - - - copyToClipboardDebounced(record.type.toUpperCase()) - } - type="button" - /> - - - copyToClipboardDebounced(record.value)} - type="button" - /> - - - ))} + {records + .filter((record) => record.status !== 'success') + .map((record) => ( + + + copyToClipboardDebounced(record.key)} + type="button" + /> + + + + copyToClipboardDebounced(record.type.toUpperCase()) + } + type="button" + /> + + + copyToClipboardDebounced(record.value)} + type="button" + /> + + + ))} ); diff --git a/packages/twenty-server/src/engine/core-modules/domain-manager/services/custom-domain.service.spec.ts b/packages/twenty-server/src/engine/core-modules/domain-manager/services/custom-domain.service.spec.ts index 5ee6f91f1..22978fd6f 100644 --- a/packages/twenty-server/src/engine/core-modules/domain-manager/services/custom-domain.service.spec.ts +++ b/packages/twenty-server/src/engine/core-modules/domain-manager/services/custom-domain.service.spec.ts @@ -36,7 +36,7 @@ describe('CustomDomainService', () => { { provide: DomainManagerService, useValue: { - getFrontUrl: jest.fn(), + getBaseUrl: jest.fn(), }, }, ], @@ -148,7 +148,7 @@ describe('CustomDomainService', () => { jest.spyOn(twentyConfigService, 'get').mockReturnValue('test-zone-id'); jest - .spyOn(domainManagerService, 'getFrontUrl') + .spyOn(domainManagerService, 'getBaseUrl') .mockReturnValue(new URL('https://front.domain')); (customDomainService as any).cloudflareClient = cloudflareMock; @@ -185,7 +185,7 @@ describe('CustomDomainService', () => { jest.spyOn(twentyConfigService, 'get').mockReturnValue('test-zone-id'); jest - .spyOn(domainManagerService, 'getFrontUrl') + .spyOn(domainManagerService, 'getBaseUrl') .mockReturnValue(new URL('https://front.domain')); (customDomainService as any).cloudflareClient = cloudflareMock; diff --git a/packages/twenty-server/src/engine/core-modules/domain-manager/services/custom-domain.service.ts b/packages/twenty-server/src/engine/core-modules/domain-manager/services/custom-domain.service.ts index 56787244e..ebd4ae159 100644 --- a/packages/twenty-server/src/engine/core-modules/domain-manager/services/custom-domain.service.ts +++ b/packages/twenty-server/src/engine/core-modules/domain-manager/services/custom-domain.service.ts @@ -133,7 +133,7 @@ export class CustomDomainService { ? 'error' : 'success', key: response.result[0].hostname, - value: this.domainManagerService.getFrontUrl().hostname, + value: this.domainManagerService.getBaseUrl().hostname, }, ]), };