-
Notifications
You must be signed in to change notification settings - Fork 20
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
feat(archive): revamp archive-upload view #532
Conversation
Works really nicely. I think the nested modal dialogs for uploading a recording and then "uploading" the associated metadata feels a little funny, though. It is kinda nice that this allows the user to upload/submit multiple metadata files for a single recording so they can add a lot of labels this way, I suppose, but I imagined this working more as either having a single file chooser which would ask the user just to select a JFR file to upload and the associated labels JSON would be read and applied automatically if it also existed, otherwise if that's not feasible then the modal would have two separate file choosers for the recording and for the metadata, and both would be submitted at once. |
I am unsure if it should be covered by this PR or I should open a new issue, but it seems that the |
Good catch, I didn't try/notice that. It should be part of this PR, I think, unless that bug is also present in other places where |
Oh yess, noticed this happens only in the uploaded archive views. Still happens before refactoring so I am looking into this :D |
Right! I am thinking of another way is that when the user clicks on the upload button (inside label editor), they are directly prompted to select a file. Once selected, the file is read and label editors are filled with those labels if any. This way we can skip the metadata modal. What do you think? |
Sure, that sounds good too. This way the user can select the file and have its contents automatically added to the labels visible on the upload modal. If they do this multiple times then the latest file read should merge labels, overwriting anything that was there previously if there are any label key collisions. I think it would still be good to have the label editor controls present on this one modal too, so the user can fine-tune their labels manually before uploading the recording. |
Right! Also do you think it's a better option to not overwrite any existing keys but shows an error helper-text under any duplicate keys? This way, the user can choose which one to remove? |
7c65157
to
773fa96
Compare
That's a good option too. If there are any conflicts then the helper text should be red, or maybe the label itself should have a red warning outline, and the submission button should be disabled. |
773fa96
to
1b9a932
Compare
Right! I added it this such that individual key/value cells are indicated with warning if invalid. Also, implemented the new flow for uploading recording metadata. Ready for review :D |
If the labels are invalid because of non-unique keys then I'm still able to Submit on the modal. The upload succeeds and I think the last-uploaded/last-added labels are used? In this case I think I should be blocked from submitting the modal. Also perhaps the button should be renamed to the plural "Upload Labels" since the JSON file can and often will contain multiple? |
Oh right I thought i fixed that. Let me have a closer look. And I will rename the button too. Editted: Oh I think selecting a valid recording file overwrites invalidity of labels. Will fix this now. |
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.
One thing about the UI itself, when I click the 'Show metadata options', as a user it feels annoying that the button goes up after clicking on the dropdown and then you have to move your mouse up to click it again because of the modal resizing, but it just might be me. Thoughts?
Other than that looks great!
Also, I'm not sure if I would know what the naming convention for cryostat archived recordings as a user, would it make sense to have a helper icon somewhere to mention this? |
Oh yess been thinking about that. I will add this. |
I think it should be EDIT: Also maybe is it possible to have the |
Yehh agreed but the way the modal resizing is to make sure itself it is centered, so there is not much we can do about it :( |
No worries then! |
Looks nice! I would put the title as |
You could change the example to look a little more generic? Either just something very placeholder like |
^ looks good otherwise |
ef868b9
to
700a0bd
Compare
Fixes #510
Fixes #521 (dup)
Fixes #522
Feat:
Fix:
Chore:
RecordingLabelField
component to reduce re-rendering.ArchivedRecordingTable
to useprops.target
for consistency.