Change favicon/company enrichment urls (#9065)

We're moving favicon/telemetry/company enrichment to a separate url for
better security/monitoring
This commit is contained in:
Félix Malfait
2024-12-13 18:41:57 +01:00
committed by GitHub
parent abaf2651ec
commit 042b6c65ed
8 changed files with 13 additions and 13 deletions

View File

@ -75,7 +75,7 @@ describe('getActivityPreview', () => {
props: { props: {
backgroundColor: 'default', backgroundColor: 'default',
textAlignment: 'left', textAlignment: 'left',
url: 'https://favicon.twenty.com/qonto.com', url: 'https://twenty-icons.com/qonto.com',
caption: '', caption: '',
width: 230, width: 230,
}, },

View File

@ -75,7 +75,7 @@ describe('getActivitySummary', () => {
props: { props: {
backgroundColor: 'default', backgroundColor: 'default',
textAlignment: 'left', textAlignment: 'left',
url: 'https://favicon.twenty.com/qonto.com', url: 'https://twenty-icons.com/qonto.com',
caption: '', caption: '',
width: 230, width: 230,
}, },

View File

@ -64,7 +64,7 @@ describe('useGetObjectRecordIdentifierByNameSingular', () => {
expect(result.current.linkToShowPage).toBe('/object/company/recordId'); expect(result.current.linkToShowPage).toBe('/object/company/recordId');
expect(result.current.avatarUrl).toBe( expect(result.current.avatarUrl).toBe(
'https://favicon.twenty.com/cool-company.com', 'https://twenty-icons.com/cool-company.com',
); );
expect(result.current.avatarType).toBe('squared'); expect(result.current.avatarType).toBe('squared');
}); });

View File

@ -17,27 +17,27 @@ describe('sanitizeURL', () => {
describe('getLogoUrlFromDomainName', () => { describe('getLogoUrlFromDomainName', () => {
test('should return the correct logo URL for a given domain', () => { test('should return the correct logo URL for a given domain', () => {
expect(getLogoUrlFromDomainName('example.com')).toBe( expect(getLogoUrlFromDomainName('example.com')).toBe(
'https://favicon.twenty.com/example.com', 'https://twenty-icons.com/example.com',
); );
expect(getLogoUrlFromDomainName('http://example.com/')).toBe( expect(getLogoUrlFromDomainName('http://example.com/')).toBe(
'https://favicon.twenty.com/example.com', 'https://twenty-icons.com/example.com',
); );
expect(getLogoUrlFromDomainName('https://www.example.com/')).toBe( expect(getLogoUrlFromDomainName('https://www.example.com/')).toBe(
'https://favicon.twenty.com/example.com', 'https://twenty-icons.com/example.com',
); );
expect(getLogoUrlFromDomainName('www.example.com')).toBe( expect(getLogoUrlFromDomainName('www.example.com')).toBe(
'https://favicon.twenty.com/example.com', 'https://twenty-icons.com/example.com',
); );
expect(getLogoUrlFromDomainName('example.com/')).toBe( expect(getLogoUrlFromDomainName('example.com/')).toBe(
'https://favicon.twenty.com/example.com', 'https://twenty-icons.com/example.com',
); );
expect(getLogoUrlFromDomainName('apple.com')).toBe( expect(getLogoUrlFromDomainName('apple.com')).toBe(
'https://favicon.twenty.com/apple.com', 'https://twenty-icons.com/apple.com',
); );
}); });

View File

@ -9,6 +9,6 @@ export const getLogoUrlFromDomainName = (
): string | undefined => { ): string | undefined => {
const sanitizedDomain = sanitizeURL(domainName); const sanitizedDomain = sanitizeURL(domainName);
return sanitizedDomain return sanitizedDomain
? `https://favicon.twenty.com/${sanitizedDomain}` ? `https://twenty-icons.com/${sanitizedDomain}`
: undefined; : undefined;
}; };

View File

@ -7,7 +7,7 @@ import { TelemetryService } from './telemetry.service';
providers: [TelemetryService], providers: [TelemetryService],
imports: [ imports: [
HttpModule.register({ HttpModule.register({
baseURL: 'https://t.twenty.com/api/v2', baseURL: 'https://twenty-telemetry.com/api/v2',
}), }),
], ],
exports: [TelemetryService], exports: [TelemetryService],

View File

@ -25,7 +25,7 @@ export class CreateCompanyService {
constructor(private readonly twentyORMGlobalManager: TwentyORMGlobalManager) { constructor(private readonly twentyORMGlobalManager: TwentyORMGlobalManager) {
this.httpService = axios.create({ this.httpService = axios.create({
baseURL: 'https://companies.twenty.com', baseURL: 'https://twenty-companies.com',
}); });
} }

View File

@ -124,7 +124,7 @@ export const Card = ({ data }: { data: OssData }) => {
return ( return (
<Container> <Container>
<StyledContent> <StyledContent>
<Icon src={`https://favicon.twenty.com/${removeProtocol(data.href)}`} /> <Icon src={`https://twenty-icons.com/${removeProtocol(data.href)}`} />
<Title>{data.name}</Title> <Title>{data.name}</Title>
<Description>{data.description}</Description> <Description>{data.description}</Description>
</StyledContent> </StyledContent>