twenty
twenty copied to clipboard
Normalize companies URL before saving it
Current behavior
Expected behavior
Hey @FelixMalfait , I would like to work on this issue
@ShantanuSutar thanks a lot!
@FelixMalfait I feel this should be part of the DomainName fieldType. Generally when we leave a cell we should try:
- validate (get back to the previous value if invalid / proceed to cast if valid)
- cast if possible (for an integer, we should round the number / for an url we should remove trailing slash / for domainName we should remove non domain information...)
For each type we should implement validate and cast function to generalise this. @ShantanuSutar do you still plan to work on it? I can guide you if needed :)
@charlesBochet Sorry for the late reply. I've tried setting up the project locally on WSL, but I ran into errors with GraphQL. Despite exploring solutions on Discord, Stack Overflow, and other platforms, I couldn't find a resolution. I will retry setting up the project again this weekend and start contributing until then you may carry on with solving the issue. I request @FelixMalfait to unassign me. Thank you for understanding :)
No problem! Feel free to open a thread in #help on discord, we can help you from there if you want :)
Hey I would like to work on this, can you assign for me ?
@charlesBochet could you guide me?
Sure!
Vision: I have discussed with @Bonapara and he things that Domain name should be a field of type Link with a specific option. However, we are planning to migrate the URL field type which is a compositeField to a compositeArrayField (enabling to put multiples urls, domains...). As this is not ready on the backend side, we want to hold on this change
Plan: Currently, the domain is a field of type TEXT. We should stick with it but display a Link field ype.
- in FieldInput and FieldDisplay, add a case on top: if objectName === 'company' and fieldName = 'domainName' (this is a hack for now, we are doing it for other fields)
- In useLinkField, LinkDisplay and LinkInput, also add a custom logic to detect if objectName === 'company' && fieldName = 'domainName' (you'll need to load value and not value.url and value.label as the data is of type text and not link:{ url, label }
- You can apply the normalization scoped in this ticket by adding the logic to trim the domain in persistLinkField
Let me know if you need more instructions! It should work! Once we implement the new field type, we will replace these hacky conditions by proper Link with proper isDomainName option
Is this issue still being unfixed? I would like to work on
@SujithThirumalaisamy assigning you since it's been a long time for Mattheus. Thanks a lot!
Hey @SujithThirumalaisamy any news on this? Thanks 🙏
I was using WSL. I faced some difficulties. Just got my linux machine a week ago. Was out of track. Got back. Will revert you about this in a day or two. Sorry for the late reply. Thankyou!
No problem! Thanks @SujithThirumalaisamy