-
Notifications
You must be signed in to change notification settings - Fork 12.1k
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
Dashboard: Add a feature that creates a table panel when a spreadsheet file is dropped on the dashboard. #62688
Conversation
This looks great! It would be even better if the drop would accept a dashboard JSON and then ask to import it... eg #61017 In addition to drag+drop CSV/text, we should also support general JSON. (use |
A couple of more things, the uneven padding (left vs top) becomes really obvious when the dropzone is shown and looks weird. As for the note about the dropzone message it seems like we should be able to tell cases with 1 file and more than 1 file? Seems like it would also be good to provide more file type guidance here, like show a short list of accepted file types |
Most browsers won't divulge any info about the dragged files until they are dropped. |
move accepted types and max size to file-import constants show which file types are allowed in file type error
@ryantxu the last commit added support for dropping json files that contain dataframes. However, adding support for importing dropped dashboard json files comes with a whole host of UX questions. |
return `${fileExtentions.slice(0, -1).join(', ')} or ${fileExtentions.slice(-1)}`; | ||
} | ||
|
||
export function filesToDataframes(files: File[]): Observable<FileImportResult> { |
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.
Rather than supporting multiple async files, can we limit this to a single file at a time? I don't think we want dropping a pile of csv files to generate a pile of table panels -- at least not to start!
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.
looks like the drop component enforces that, so maybe this is fine 🤷
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 for the updates Oscar. LGTM! 🚀
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 please add some docs around this?
…t file is dropped on the dashboard. (#62688) * drag files to dashboard * use file name as panel title * add file size limitation, file type limitation and error handling * Refactor file parsing for code sharing move accepted types and max size to file-import constants show which file types are allowed in file type error * update codeowners * Adjust max size to 1mb
What is this feature?
This feature lets users drag spreadsheet files to a dashboard to create a table panel with a spreadsheet query set up to the Grafana datasource.
Why do we need this feature?
It lets users quickly get data they have locally into Grafana.
Who is this feature for?
New users of Grafana that just wants to try it out together with some data they have, without setting up a datasource.
Existing users that have data locally that they want to be able to view together with data from their set up datasources.