Skip to content
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

[explore v2] populate dynamic select field options #1543

Merged
merged 16 commits into from
Nov 8, 2016
Merged

[explore v2] populate dynamic select field options #1543

merged 16 commits into from
Nov 8, 2016

Conversation

ascott
Copy link
Contributor

@ascott ascott commented Nov 4, 2016

  • add dynamic field options to fetch_datasource_metadata
  • add fields to initial state
  • render fields from state, not store
  • populate select field options once /fetch_datasource_metadata/ returns

todo:

  • datasource options are missing

@@ -11,7 +11,8 @@ const defaultProps = {
fieldOverrides: {},
};

function getFieldData(fs, fieldOverrides) {
function getFieldData(fs, fieldOverrides, fields) {
console.log('fields', fields)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we delete this?

@ascott ascott changed the title WIP -- [explore v2] select field options [explore v2] populate dynamic select field options Nov 8, 2016
@ascott
Copy link
Contributor Author

ascott commented Nov 8, 2016

@mistercrunch @vera-liu PTAL, this is ready for review now.

}
});
} else {
// Clear all Select options
dispatch(clearAllOpts());
// in what case don't we have a datasource id?
Copy link
Contributor

@vera-liu vera-liu Nov 8, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in react-select there's an option to empty the select field, namely datasource could be null, not sure if this is needed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm not sure it's needed either. in the explore view we should always have a datasource. we can remove in a follow up PR.

}

export function setColumnOpts(columnOpts) {
return { type: SET_COLUMN_OPTS, columnOpts };
export function setDatasourceType(datasourceType) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used to think this would be used for setting Druid/Table for datasource, but it seems that we don't have the option to switch datasource type in explore view? @mistercrunch

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't think we actually need this. we can change a datasource but there is not a concept of changing the datasource type only. datasource type is tied to the datasource. i think this shows up like this because of some white space diffing. we can remove in a follow up pr.

@@ -1655,16 +1658,11 @@ export const initialState = {
metricsOpts: [],
columnOpts: [],
orderingOpts: [],
searchBox: false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could delete 1661-1664 here since we now have them in form_data. I deleted it in a previous PR but somehow it must be accidentally restored during the rebase.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah ok will do. thx!

@@ -1655,16 +1658,11 @@ export const initialState = {
metricsOpts: [],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These Opts could be deleted as well.

@vera-liu
Copy link
Contributor

vera-liu commented Nov 8, 2016

looks good!

@ascott ascott merged commit 51c0470 into apache:master Nov 8, 2016
@ascott ascott deleted the alanna-explore-v2-field-options branch November 8, 2016 23:55
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.13.0 labels Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants