Add Select2 to relation view dropdowns and auto-select foreign table - #20357
Open
strtob wants to merge 1 commit into
Open
Add Select2 to relation view dropdowns and auto-select foreign table#20357strtob wants to merge 1 commit into
strtob wants to merge 1 commit into
Conversation
The dropdowns in the "Relation view" (database/table selectors for internal relations and foreign key constraints) are replaced with Select2 widgets, so the related table can be found with a search field instead of scrolling through a long plain dropdown. Additionally, when a source column following the <table>_id naming convention is selected (e.g. tbl_property_id or property_id and a table tbl_property/property exists), the foreign table is selected automatically and its primary key column is preselected. Fixes phpmyadmin#18031 Signed-off-by: STRATON REA <streckelt@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The plain dropdowns in the table Relation view (database/table/column selectors for internal relations and foreign key constraints) are replaced with Select2 widgets, so the related table can be found with a search field instead of scrolling through one long dropdown list.
Fixes #18031
Additionally, when a source column that follows the
<table>_idnaming convention is selected (e.g.tbl_property_idorproperty_id, while a tabletbl_property/propertyexists), the foreign table is selected automatically and its primary key column is preselected.Select2 4.0.13 (MIT licensed) is bundled under
js/vendor/select2/.Note: this targets the 5.2 codebase (QA_5_2 branch). I am happy to port it to master (select2 via yarn/webpack instead of bundled vendor files) if you would prefer to land this in 6.0.
A demo GIF follows in a comment below.