-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Files] Filepicker #143111
[Files] Filepicker #143111
Conversation
… adding of duplicates
…ve on upload controls
…n texts for empty state prompt
I'll address this in a follow up PR. We can probably just add the compact version of the filepicker somewhere. |
@elasticmachine merge upstream |
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.
A few comments:
Uploading a file
Should the text inside the file upload simply say 'Select or drop a file' to be more concise? Removes the extra conjunction.
When uploading the file, let's use the [loading button](https://elastic.github.io/eui/#/navigation/button#loading-state) , and then change it to a `success` button with the check icon. The label could then say 'Upload complete'. We would not need to use the pink line loading indicator in this case then. I would imagine this would be the same behavior for the `Basic` and `Allow repeated uploads` options.The Long error
scenario should also use the default button, instead of an empty button. Though in this case, we could use the danger
styling. The error messages seem fine though.
If I abort the upload, should that message not appear somewhere? Also switching this to a default button rather than empty like the other scenarios can help keep this upload button the main focus. Perhaps reusing the Max size
option here, but simply changing the text to 'File upload cancelled'
The Allow clear after upload
should probably be colored as danger
and say 'Remove file', since this is what we use within the file upload box as well. Perhaps also including the crossInCircleFilled
icon here keeps this consistent with our clearing an input box.
The Immediate upload
can use the same success message as the previous scenarios, rather than only an icon.
Same feedback for Immediate upload error
.
The Immediate upload abort
Retry should show a default button as mentioned in previous scenarios.
File picker
Not sure if this is part of the component, but if the button says Pick a file
, the modal title should likely say 'Pick a file' rather than 'Select a file'. I would vote for 'Select a file' as the button label, but I believe these two should be consistent (as well as the save/confirmation button).
The Empty
version has 'No files found' and 'Upload your first file'. These seem to contradict each other. Is this also reused as the empty state for searching? Maybe we don't need to include 'Upload your first file' if so?
The Error loading
screen has the word 'stop' as the description text. Is this necessary? Or can we change it something more meaningful?
Im obviously reviewing the storybook examples, but will run this locally shortly as well. Please reach out if these comments don't make sense. This is really nice overall!
Update - File upload screen
Note sure if these are necessary for the component...but here goes:
-
I would also suggest using the left-aligned, default (stacked) description list, rather than reversing these and using columns.
-
I think the close button should be on the left side of the flyout, with 'Download' being on the right.
-
What are the possibilities for the
Status
column? Do we need this? -
Wondering if we need to use the
eye
icon here. And just let them click on the file name? -
And I would use our typical Confirm modal dialog when deleting a file. Unless I'm missing this pattern being adopted elsewhere? Perhaps the delete icon doesn't need to always be visible, but only show on row hover?
At the moment the modal's title is "Select a file" and the button says "Select file". When the user selects more than one file the text on the button changes to "Select x files" where x is the number of selected files. This does still need copy review, I'll be sure to get it!
Good point, this also needs copy review. I was trying to use the empty to prompt the user to action. The user should only see this state if they have no files uploaded. This "no data" view will probably not be seen by most users.
😄 the text "stop" is from the error I was throwing in the story book. Normally, this would contain the error of the network request. Telling users "stop!" would be pretty funny in this context though! |
This was regarding the button that launches the modal...shown in the PR description. Again, didn't know if this was part of the component or up to the developer using it. But would be good to add a note that these should match, or a recommended label.
What if they search and return no results? I agree pushing an action on the empty state. Perhaps just removing the word 'first' would avoid any potential confusion?
So not something this component controls? Do we have a set of common network errors that we provide stock copy for? Thanks for bearing with me on the follow up questions. Just wanted to clarify and then I'll ✅ |
I see, apologies for the misunderstanding. This is the developer examples app, shouldn't ever be seen by non-devs, but happy to go with your recommendation!
Ah I see, in that case the user will see "No files matched filter".
Right, not something this component controls. This is intended as a catch-all message where the summary is "We couldn't load the files". The action will always be to just retry. If that doesn't work, they have an error message that might help or that they can report to us if it comes to it. |
@@ -0,0 +1,5 @@ | |||
.filesFilePicker { | |||
.euiCard__content, .euiCard__description { | |||
margin :0; // make the cards a little bit more compact |
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.
Not that I don't agree with you. But I'm not sure there's a significant reason to overwrite our EUI styles here. Ideally we wouldn't need to do this to save future maintenance (and work for you)
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.
Just a comment on the margin override. Not a huge deal, thanks for setting up the other issue with my comments 🙇
@elasticmachine merge upstream |
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
async chunk count
ESLint disabled in files
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
* main: (57 commits) [Files] Filepicker (elastic#143111) [Infrastructure UI] Replace Lens table with EUI table and own api (elastic#142871) [api-docs] Daily api_docs build (elastic#143829) [api-docs] Daily api_docs build (elastic#143825) [api-docs] Daily api_docs build (elastic#143823) [Security Solution] Restructuring folders of Detection Engine + refactoring Rule Management (elastic#142950) [Dev tools] Fix performance issue with autocomplete suggestions (elastic#143428) [Security Solution] Disable ML rule's edit button link under basic license (elastic#143260) [Lens] Use the language-documentation package for formula (elastic#143649) [api-docs] Daily api_docs build (elastic#143811) [Security Solution] Fix missing title on inspect pop-up (elastic#143601) fix incorrect filters being passed to events table causing duplicate entries in our inpsect tool request tab (elastic#143239) [Security Solution][Endpoint] `get-file` response action kibana download file API (elastic#143708) Rely on refresh context to update stats independently of overview cards. (elastic#143308) [RAM] Rule event log - Fix incorrect results when filtering by message and outcome simultaneously (elastic#143119) [ML] Display link to create data view from error cases in data frame analytics results pages (elastic#143596) Update links in README :) (elastic#143675) Add more tests for ml_inference_logic (elastic#143764) skip failing test suite (elastic#143717) [DOCS] Add assignees to case APIs (elastic#143610) ...
defaultMessage: 'my-file-*', | ||
}), | ||
emptyFileGridPrompt: i18n.translate('xpack.files.filePicker.emptyGridPrompt', { | ||
defaultMessage: 'No files matched filter', |
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.
No files match your filter
|
||
export const i18nTexts = { | ||
title: i18n.translate('xpack.files.filePicker.title', { | ||
defaultMessage: 'Select a file', |
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.
The title is good if you can select 1 file. If you can select multiple files, then the title should be "Select files",
defaultMessage: 'Select a file', | ||
}), | ||
loadingFilesErrorTitle: i18n.translate('xpack.files.filePicker.error.loadingTitle', { | ||
defaultMessage: 'Could not load files', |
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.
The title is "Select a file" (singular) but the message is "Could not load files" (plural). This should match.
Also, suggest this wording "Cannot load files"
The body of the message says "stop". Can you give a reason as to why the files cannot be loaded?
retryButtonLabel: i18n.translate('xpack.files.filePicker.error.retryButtonLabel', { | ||
defaultMessage: 'Retry', | ||
}), | ||
emptyStatePrompt: i18n.translate('xpack.files.filePicker.emptyStatePrompt', { |
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.
Is this an empty state? If so, can "Upload your first file" be the heading?
Adds the new Filepicker component (modal). See the resulting files storybooks to test it out.
Notes to reviewers
This component does not use "true" pagination at the moment because thelist
endpoint does not support filtering, we should add this in a follow up PRyarn start --run-examples
and open thefilesExample
plugin (atapp/filesExample
). Upload a few documents via the "Upload" button and then pick 'em in "Picker"!Screenshots
Screenshots