Fix link formatting (#13210)

closes https://github.com/twentyhq/twenty/issues/13207

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
This commit is contained in:
Paul Rastoin
2025-07-15 12:27:00 +02:00
committed by GitHub
parent eed502778a
commit d916ec0af9
12 changed files with 87 additions and 60 deletions

View File

@ -79,11 +79,10 @@ describe('spreadsheetImportGetUnicityRowHook', () => {
it('should return row with error if row is not unique - index on composite field', () => {
const hook = spreadsheetImportGetUnicityRowHook(mockObjectMetadataItem);
const testData: ImportedStructuredRow<string>[] = [
{ 'Link URL (domainName)': 'duplicaTe.com' },
{ 'Link URL (domainName)': 'duplicate.com ' },
{ 'Link URL (domainName)': 'other.com' },
{ 'Link URL (domainName)': 'https://duplicaTe.com' },
{ 'Link URL (domainName)': 'https://duplicate.com' },
{ 'Link URL (domainName)': 'https://other.com' },
];
const addErrorMock = jest.fn();

View File

@ -12,7 +12,7 @@ import { isNonEmptyString } from '@sniptt/guards';
import { FieldMetadataType } from 'twenty-shared/types';
import {
isDefined,
lowercaseUrlAndRemoveTrailingSlash,
lowercaseUrlOriginAndRemoveTrailingSlash,
} from 'twenty-shared/utils';
type Column = {
@ -108,7 +108,7 @@ const getUniqueValues = (
.primaryLinkUrl,
)
) {
return lowercaseUrlAndRemoveTrailingSlash(
return lowercaseUrlOriginAndRemoveTrailingSlash(
row?.[columnName]?.toString().trim() || '',
);
}