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

fix: various fixes for the Run > Files view #78

Merged
merged 14 commits into from
Aug 25, 2020

Conversation

bodom0015
Copy link
Member

@bodom0015 bodom0015 commented Jul 2, 2020

Problem

Fixes #89 - Files upload twice
Fixes #50 - Adding External Data would return a 400
Fixes #48 - Uploading a file would result in a 400, even though the file appeared to upload successfully
Fixes #41 - Create Folder in Home actually creates the folder in the Tale Workspace
Fixes #37 - Files cannot be removed/downloaded until after refreshing
Fixes #33 - Data registration dropdown should auto-select first result
Fixes #31 - Show previously-added data on select-data-modal
Fixes #30 - Add button should be disabled for read-only Tales
Fixes #28 - External Data shows nothing even after adding a dataset

Approach

How to Test

Prerequisites: at least one Tale created, LIGO Tale

  1. Checkout this branch locally, rebuild the dashboard
  2. Login to the WholeTale Dashboard
  3. Choose a Tale you own and navigate to the Run > Files view
  4. Select Home and upload a file
    • You should see that your file is uploaded successfully (Upload file results in 400 bad request #48)
    • You should see that your file has a Last Modified date (this indicates that it is now displaying an Item, as expected, and not a File)
  5. Without refreshing the view, expand the dropdown beside the new file and choose Remove
  6. Select Home, create a folder, and refresh the page
  7. Select External Data, click (+), and choose "Web (DOI or URL)"
    • The data registration modal should open
  8. Enter 10.5065/D6862DM8 and search
  9. Click Register to close the modal, then click (+) again, and choose "WT Data Catalog"
    • The Select Data modal should open
  10. Click the "Humans & Hydrology" dataset to select it, optionally double-click to drill down into it and select individual folders/files, and click "Add Selected. and then
    • The modal should close
    • You should see the new dataset(s) appear on the right after adding it
  11. Click "Save" below to confirm
    • You should see the new dataset(s) appear in the view shortly after the modal closes
    • You should no longer see 400 errors appear in the console when adding the dataset (Adding external data results in 400 #50)
  12. Click (+) again, and choose "WT Data Catalog" once more
  13. Refresh the page
  14. Navigate to the Run > Files view for the LIGO Tale

@Xarthisius
Copy link
Contributor

Xarthisius commented Jul 6, 2020

With this pull request #41 gets reverted. Now when I upload files to Workspace they end up in Home.

@bodom0015
Copy link
Member Author

@Xarthisius Good catch! #41 was actually about creating folders, but was likely the same problem as it uses the same logic to determine the parentId to use for the operation. There was a typo in the nav it was searching for: tale_workspaces should have instead been tale_workspace. Thank you for pointing this out 👍

@craig-willis
Copy link
Contributor

Looking good. Testing no. 10 from your list, I got into a very strange state.

I selected the checkbox for the top level "Humans and Hydrology" dataset and that worked fine. I went to deselect it and instead select a single item from within the folder and things got weird. I can uncheck the checkbox, but clicking "Select" results in a new entry for the top level "Humans and Hydrology" folder.

image

image

I can select a single file from within the dataset, but the top level folder remains:

image

Basic test case:

  • Select External Data > WT Catalog, check "Humans and Hydrology" folder, click "Select". You should see a single folder in external data.
  • Select External Data > WT Catalog, uncheck "Humans and Hydrology" folder, click "Select". You should see two folders in external data.
  • Select External Data > WT Catalog, select "Humans and Hydrology" folder, check "usco2005.xls", click "Select". You should see two folders and the file.

@bodom0015
Copy link
Member Author

bodom0015 commented Jul 13, 2020

@craig-willis good catch, I've noticed this before... I think that modal needs to be reworked quite a bit for #31 as well. The current implementation seems to get confused between what was previously added and what you're trying to add now. The navigation bits can still be preserved, but the additional panel showing a list of what has already been selected may help keep things straight.

@bodom0015
Copy link
Member Author

So I have a fix for the select-data-modal, but am not sure whether to amend this PR or to make a new one.

@Xarthisius any preference here? Should I make a new PR after this one gets merged, since there's already a lot going on in this one? What do you think?

@Xarthisius
Copy link
Contributor

So I have a fix for the select-data-modal, but am not sure whether to amend this PR or to make a new one.

@Xarthisius any preference here? Should I make a new PR after this one gets merged, since there's already a lot going on in this one? What do you think?

Please add it here and let's review it in a one go.

Copy link
Member

@ThomasThelen ThomasThelen left a comment

Choose a reason for hiding this comment

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

Re-tested with the new commits and things look great!

@craig-willis
Copy link
Contributor

Ran into an unexpected behavior while testing the fix. Should "Remove" remove the file/dataset from My External Data (i.e., deselect) or remove from the system catalog? Currently, the "Remove" menu calls DELETE https://girder.local.wholetale.org/api/v1/folder/, effectively removing the dataset/file from Girder. Selected dataset or file still remain selected in "Selected Data"

To repeat:

  • Register Humans and Hydrology (10.5065/D6862DM8)
  • Select + > My External Data
  • Browse to Humans and Hydrology > Add Selected, Save
  • H&H appears in external data
  • Select "Remove"
  • Select "My External Data" -- H&H appears in Selected list
  • Go to https://girder.local.wholetale.org/ > Whole Tale Catalog > Whole Tale Catalog -- dataset has been removed from catalog

Something I can't readily repeat -- when I select an individual file in the folder, sometimes the folder is automatically selected for me. I'll try to get a repeatable test case.

@bodom0015
Copy link
Member Author

@craig-willis ahhh, I think this was an oversight on my part. While fixing #30, I think I accidentally made this view writeable.

Will make a new commit to hide the "Remove" option there, is it is in fact deleting the dataset from Girder.

@Xarthisius
Copy link
Contributor

@bodom0015 I went through the test plan (and some more). Very nice! I filed issues for some minor things I've found. In particular #89 looks like something you might want to address here, but I'm open to merging this PR as-is and dealing with it in a separate branch. Please let me know what would you prefer.

@bodom0015
Copy link
Member Author

bodom0015 commented Aug 20, 2020

Good catch on these! I've pushed a fix for #89 as well as another minor bug I noticed.

Apparently we could not upload the same file twice in a row due to using the onChange handler.. since the selected file technically wasn't changing, the upload would never trigger :D

Clearing out the selected file(s) after it/them to the queue seems to workaround the issue

@@ -209,6 +209,8 @@ export class TaleFilesComponent implements OnInit, OnChanges {
});*/
});
});

this.uploadQueue.delete(upload);
Copy link
Member Author

@bodom0015 bodom0015 Aug 20, 2020

Choose a reason for hiding this comment

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

While it did successfully workaround the issue, I am amazed that this did not trigger a concurrent modification exception.. in other languages, deleting an item from an array that you're looping over is not allowed and likely not advisable here

@Xarthisius Xarthisius merged commit 6f2c7f0 into master Aug 25, 2020
@Xarthisius Xarthisius deleted the fix-file-upload-bad-request branch September 18, 2020 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment