ENH: Streamline link creation if only one type of link is allowed#420
Conversation
…ng toggle function to return early and select the first item in the allowedTypes array if only one exists. Updating returned react to exclude caret when only one link type is applicable, using allowedTypes array in the dropdownmenu map
|
Hi there, Thanks for submitting this. I have added the checklist back into the PR description - please don't remove it. It's there for you as the contributor to tick off the boxes that apply. If you don't think you should tick one of the boxes that's usually an indication that you need to do something - in this case I have left several boxes unticked (e.g. the commit message doesn't meet our guidelines, and CI isn't passing). Can you please tidy up the PR by fixing the commit message, resolving the CI failure, and updating the tests to cover this new scenario? |
|
@GuySartorelli Sorry for the delay with making changes to the PR, I have fixed everything up and it is now passing clean If you would like me to make any further revisions, please let me know Thanks, |
GuySartorelli
left a comment
There was a problem hiding this comment.
Thanks for this! Works as expected locally. Great work!
Adding a memoized variable with the pre-filtered allowedTypes, updating toggle function to return early and select the first item in the allowedTypes array if only one exists. Updating returned react to exclude caret when only one link type is applicable, using allowedTypes array in the dropdownmenu map
Description
Updating the link creation process to be more streamlined as per this issue: #185
Issues
Manual testing steps
With either a LinkField or MultiLinkField, set the allowedTypes to a single type - you will then notice the caret will be hidden and upon clicking the button, the modal will appear directly
Example code:
Pull request checklist