fix IndexFieldMetadata availability in IndexMetadata/ObjectMetadata in front (#12886)
Context : - IndexFieldMetadata was no longer available on 'objects' gql query ([since this PR](https://github.com/twentyhq/twenty/pull/12785)). Then, unicity checks on import do not work anymore. Fix : - Add a dataloader logic in indexFieldMetadata - Add extra check in unicity hook on import
This commit is contained in:
@ -1,31 +0,0 @@
|
||||
import { lowercaseDomainAndRemoveTrailingSlash } from 'src/engine/api/graphql/workspace-query-runner/utils/query-runner-links.util';
|
||||
|
||||
describe('queryRunner LINKS util', () => {
|
||||
it('should leave lowcased domain unchanged', () => {
|
||||
const primaryLinkUrl = 'https://www.example.com/test';
|
||||
const result = lowercaseDomainAndRemoveTrailingSlash(primaryLinkUrl);
|
||||
|
||||
expect(result).toBe('https://www.example.com/test');
|
||||
});
|
||||
|
||||
it('should lowercase the domain of the primary link url', () => {
|
||||
const primaryLinkUrl = 'htTps://wwW.exAmple.coM/TEST';
|
||||
const result = lowercaseDomainAndRemoveTrailingSlash(primaryLinkUrl);
|
||||
|
||||
expect(result).toBe('https://www.example.com/TEST');
|
||||
});
|
||||
|
||||
it('should not add a trailing slash', () => {
|
||||
const primaryLinkUrl = 'https://www.example.com';
|
||||
const result = lowercaseDomainAndRemoveTrailingSlash(primaryLinkUrl);
|
||||
|
||||
expect(result).toBe('https://www.example.com');
|
||||
});
|
||||
|
||||
it('should not add a trailing slash', () => {
|
||||
const primaryLinkUrl = 'https://www.example.com/toto/';
|
||||
const result = lowercaseDomainAndRemoveTrailingSlash(primaryLinkUrl);
|
||||
|
||||
expect(result).toBe('https://www.example.com/toto');
|
||||
});
|
||||
});
|
||||
@ -1,7 +0,0 @@
|
||||
export const lowercaseDomainAndRemoveTrailingSlash = (url: string) => {
|
||||
try {
|
||||
return new URL(url).toString().replace(/\/$/, '');
|
||||
} catch {
|
||||
return url;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user