twenty
twenty copied to clipboard
Added sanitize funtion to normalize the link input
feat: add sanitizeLinkRecordInput for link normalization
Addresses issue #2546
- Introduce a new utility function, sanitizeLinkRecordInput, to normalize link input specifically for the companies tab.
- This function is added to packages/twenty-front/src/modules/object-record/utils/sanitizeLinkRecordInput.ts.
- Modify existing utility function sanitizeRecordInput in packages/twenty-front/src/modules/object-record/utils/sanitizeRecordInput.ts to incorporate link sanitization logic.
Fixes: #2546
Hi @SujithThirumalaisamy! Have you seen @charlesBochet's comment about how we want to address this issue? #2546 (comment) This PR seems to address the third item, would be nice if we could address the other two in the same PR as well! I can answer your questions if you need help! Thanks a lot for your contribution 🙏
EDIT: sorry I read @charlesBochet's check list too fast, he mentioned
persistLinkFieldfor the third item, notsanitizeRecordInput. @charlesBochet, is it ok if we normalize before saving as mentioned in the issue's title and as implemented in this PR? Or do we want to only normalize on field display?
I actually think we should normalize before persisting the field (it should be normalize in DB)
Hi @SujithThirumalaisamy! Have you seen @charlesBochet's comment about how we want to address this issue? #2546 (comment) This PR seems to address the third item, would be nice if we could address the other two in the same PR as well! I can answer your questions if you need help! Thanks a lot for your contribution 🙏 EDIT: sorry I read @charlesBochet's check list too fast, he mentioned
persistLinkFieldfor the third item, notsanitizeRecordInput. @charlesBochet, is it ok if we normalize before saving as mentioned in the issue's title and as implemented in this PR? Or do we want to only normalize on field display?I actually think we should normalize before persisting the field (it should be normalize in DB)
In this case this PR is on the right track! I would say there is no need to implement the check list items mentioned in https://github.com/twentyhq/twenty/issues/2546#issuecomment-1845621874 as normalizing domainName in sanitizeRecordInput should do the job.
@SujithThirumalaisamy the 2 comments I left above are still relevant, if you can address them it would be awesome 🙏
Thankyou for your wonderful review on this. Will work on this ASAP and will get back with the PR. Thanyou so much for you time! ❤️ @thaisguigon
I have tested this jest tests in my local. Surprisingly I have got no fails.
I am confused about the fail in the CI/CD. Is this normal @thaisguigon ?