-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
relation selector component (close #2296) #4089
Conversation
Review app for commit 8371f43 deployed to Heroku: https://hge-ci-pull-4089.herokuapp.com |
Deploy preview for hasura-docs ready! Built with commit 66c8244 |
Review app for commit 88493f3 deployed to Heroku: https://hge-ci-pull-4089.herokuapp.com |
Review app for commit 01fec00 deployed to Heroku: https://hge-ci-pull-4089.herokuapp.com |
Review app for commit e224a48 deployed to Heroku: https://hge-ci-pull-4089.herokuapp.com |
Review app for commit ccf0657 deployed to Heroku: https://hge-ci-pull-4089.herokuapp.com |
Review app for commit 364a35c deployed to Heroku: https://hge-ci-pull-4089.herokuapp.com |
Review app for commit 404e67a deployed to Heroku: https://hge-ci-pull-4089.herokuapp.com |
Review app for commit bc1298b deployed to Heroku: https://hge-ci-pull-4089.herokuapp.com |
Review app for commit ef36206 deployed to Heroku: https://hge-ci-pull-4089.herokuapp.com |
Review app for commit f46ef08 deployed to Heroku: https://hge-ci-pull-4089.herokuapp.com |
Review app for commit eb0720b deployed to Heroku: https://hge-ci-pull-4089.herokuapp.com |
Review app for commit ff45f55 deployed to Heroku: https://hge-ci-pull-4089.herokuapp.com |
@@ -196,6 +238,127 @@ const initQueries = { | |||
}, | |||
}; | |||
|
|||
const loadConsoleOpts = () => { |
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.
Get rid of this
}; | ||
}; | ||
|
||
const getForeignKeyOptions = () => { |
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.
Get rid of this — move to LS
* | ||
* @param {DisplayConfig} displayConfig | ||
*/ | ||
const setConsoleFKOptions = displayConfig => (dispatch, getState) => { |
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.
Get rid of in favor of LS
a7a8d31
to
e9e7698
Compare
Review app for commit 5deaded deployed to Heroku: https://hge-ci-pull-4089.herokuapp.com |
Review app for commit ab8fbab deployed to Heroku: https://hge-ci-pull-4089.herokuapp.com |
Review app for commit f1b64df deployed to Heroku: https://hge-ci-pull-4089.herokuapp.com |
Review app for commit 00a72d2 deployed to Heroku: https://hge-ci-pull-4089.herokuapp.com |
Review app for commit 9c54750 deployed to Heroku: https://hge-ci-pull-4089.herokuapp.com |
9c54750
to
7961226
Compare
Review app for commit 7961226 deployed to Heroku: https://hge-ci-pull-4089.herokuapp.com |
@soorajshankar could you fix the conflicts? |
99af5e2
to
7961226
Compare
66c8244
to
e017643
Compare
e017643
to
fea6776
Compare
/heroku deploy |
Solves #2296
Description
This PR adds a select component for columns with foreign key relation. For example, if we have table
users
with columnsid
andname
, and tablearticles
with columnsid
,author_id
(referencing users.id), then when adding/editing foreign we can specifydisplay_column
:Then in
insert row
andedit row
view, we can choose a value from a dropdown where column specified asdisplay column
is used as a label. By default, only 20 rows are displayed in the dropdown. When typing data is filtered by the current input value.We're not limited to using the dropdown and filtering the data by
display column
. Providing own value (in this case user.id) also works.Affected components
Design solution
Modify Table
Insert/edit item
Limitations
Since I'm using
ilike
for filtering data, the user can only choose column of typetext
,varchar
orcitext
for display column.Affected console components
onSearchValueChange
It was done because we were taking advantage of JavaScript accepting the following code:
I changed it because TypeScript doesn't accept it: link.
Ideas