-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Foreign key dropdown #2348
Foreign key dropdown #2348
Conversation
…to test if github actions can test properly in sauce labs with the version of chrome + chromedriver
…se padding so content better overflows
…put component. improve decision making for when to add padding to the form
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functionality
After reverting the submit preventDefault
change, everything works properly for me. The new test cases pass locally. That being said, we need to "invalidate" the currently fetched rows if users made any changes to the form and the current input has domain filter. The URL to fetch the rows might change if users made a change to the form and dropdownReference
is still based on the initial data. To test this, we could change on of the fks in the domain-filter spec to be a dropdown.
UI
The only UI problems that I could find are related to the spinner:
- The foreignkeys in the "select-all-row" are not showing the spinner properly. Moving the
.column-cell-spinner-container
rules under.entity-value
to be under the next line.entity-value,.match-entity-value
will help a bit. Apart from that we should add aposition: relative
to the input and also adjust the top position. - The spinner is not showing up during search. It's only displayed for initial load and fetching the next page.
Code
Apart from the comments that I made inline, I think we should avoid duplicating code. I understand why instead of just adding branching logic to existing ForeignkeyField
you added a new ForeignkeyDropdownField
, but there are a bunch of duplicated code that we should refactor.
I can think of two ways to tackle this:
- We could just move the three common functions to
recordedit-utils.ts
. Similar to howpopulateLinkedData
is moved there. - Change existing
foreignkey-field.tsx
to only have the common functionalities and add a newforeignkey-popup-field.tsx
. Similar to how we refactoredinput-field.tsx
.
…functions used by both fk fields
This PR adds UI support for showing foreign key inputs in recordedit as typeahead dropdown elements. These changes go alongside changes in ermrestJS that add a new property to multiple annotations for configuring this display mode.
Changes included:
recordedit-form
to signal a dropdown is open. This class addspadding-bottom: 400px
to extend the height of the div to allow for content to overflow down. These 2 dropdowns have a max-height of395 px
.To test this, I added a foreign key dropdown input to the defaults schema in
ErmrestDataUtils
.