-
Notifications
You must be signed in to change notification settings - Fork 29
feature: add default spreadsheet ID to config editor #370
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
base: main
Are you sure you want to change the base?
Conversation
|
Sorry, merged in #377 but forgot it could be a separate PR (on main instead later). Let me know if you want me to separate it and if I need to redo the changelog. |
| const options = await datasource.getSpreadSheets(); | ||
| const { query } = this.props; | ||
| if (query.spreadsheet) { | ||
| const matchingOption = options.find((opt) => opt.value === query.spreadsheet); | ||
| if (matchingOption && this.state.selectedSheetOption !== matchingOption) { | ||
| this.setState({ selectedSheetOption: matchingOption }); | ||
| } | ||
| } | ||
| return options; |
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.
Seems we are duplicating the code here. Can we extract into function reuse along with updateSelectedSheetOption
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.
Can you check and see if it's what you had in mind?
yesoreyeram
left a comment
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.
Thanks @fridgepoet . Sorry this took long. Overall LGTM. some nit changes needed for consistency.
|
No problem, thanks for having a look @yesoreyeram |
This PR makes it possible to choose a default spreadsheet ID in the Config Editor.
Once the datasource is saved, the user can use the dropdown menu (similar to the Query Editor) and choose the default query. They do need to save again.
This closes #108