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

Edit the position of files in a directory structure #5565

Closed
TaniaSchlatter opened this issue Feb 20, 2019 · 26 comments
Closed

Edit the position of files in a directory structure #5565

TaniaSchlatter opened this issue Feb 20, 2019 · 26 comments
Assignees
Milestone

Comments

@TaniaSchlatter
Copy link
Member

TaniaSchlatter commented Feb 20, 2019

As part of adding the ability to display file hierarchy at the dataset level (#2249), we want to allow files to be added a directory structure. Completing this work will mean that a user will be able to add a file to a dataset that has files imported from a .zip file or any file, and edit the relative position of files in a dataset.

Anticipated workflow is adding file(s), selecting files from the files table, selecting edit, and editing path(s).

UI impact is exposing the path, and making it editable.

Changes will be visible in a revised view of the directory structure.

@djbrooke
Copy link
Contributor

@mheppler can you add the mockup here? Thank you!

@mheppler
Copy link
Contributor

Previous mockups were in Balsamiq, but I whipped up this mock File Upload pg screenshot quick for this issue.

screen shot 2019-02-26 at 1 28 09 pm

@mheppler mheppler removed their assignment Feb 26, 2019
@djbrooke djbrooke self-assigned this Feb 27, 2019
@djbrooke
Copy link
Contributor

djbrooke commented Feb 27, 2019

  • we should allow this editing through the API as well
  • we should have some discussion about whether or not to have leading /
  • changes should be recorded as a different version
  • we should validate the inputs
  • changes here would override changes that were previously made or that we set by uploading a zip
  • (Gustavo to add the note about updated zip behavior here)

@scolapasta
Copy link
Contributor

In the context of this issue, we discussed the current zip upload process of unzipping and whether it should add a folder to the path for the zip file. We decided we would leave it as is, i.e. no folder gets added. If you upload a zip with three files at the top level and a second zip with three files at the top level, the resulting dataset will have six files at the top level.

Related: #5576

@sekmiller
Copy link
Contributor

Per discussion we will track editing all file metadata via api in another issue.

@mheppler
Copy link
Contributor

mheppler commented Mar 6, 2019

API for file metadata viewing/editing is at Add an API endpoint for File Level metadata #4616.

@mheppler
Copy link
Contributor

mheppler commented Mar 7, 2019

Merged develop into the branch 6f87904 in order to take advantage all those glorious, new tooltip icons. :dataverseman:

@kcondon
Copy link
Contributor

kcondon commented Mar 22, 2019

Issues found:

  1. Validation text indicates \ is allowed but when used as a folder separator character, throws validation error and does not save.
  2. Note to retest after Leonid's zip cleaning logic is added:
    If upload a zip file containing at least one invalid char in path, it fails upload for all with error in UI: The files could not be updated, server log errors:
    [2019-03-22T15:41:56.918-0400] [glassfish 4.1] [INFO] [] [edu.harvard.iq.dataverse.DatasetVersion] [tid: _ThreadID=54 ThreadName=jk-connector(5)] [timeMillis: 1553283716918] [levelValue: 800] [[
    Constraint violation found in FileMetadata. Directory Name cannot contain invalid characters. Valid characters are a-Z, 0-9, '
    ', '-', '.', '', '/' and ' ' (white space). The invalid value is "testzip/%3".]]
    Caused by: java.lang.ClassCastException: edu.harvard.iq.dataverse.FileMetadata cannot be cast to edu.harvard.iq.dataverse.DatasetField
    at edu.harvard.iq.dataverse.engine.command.impl.AbstractDatasetCommand.lambda$validateOrDie$0(AbstractDatasetCommand.java:104)

@sekmiller sekmiller self-assigned this Mar 22, 2019
@sekmiller sekmiller removed their assignment Mar 22, 2019
landreev added a commit that referenced this issue Mar 22, 2019
…ip archives, as discussed earlier today.

(ref. #5565)
@landreev
Copy link
Contributor

Zip uploads: folder names are now preemptively sanitized; all the invalid characters are removed. I discussed this approach with @scolapasta earlier today and we are going to review and finalize it on Monday.

landreev added a commit that referenced this issue Mar 25, 2019
…umber scheme we (seem to have) agreed to use.

also cleaned up synchronized the migration rules with the ones used for real time sanitizing of the folder paths in zip uploads. (#5565)
pdurbin added a commit that referenced this issue Mar 25, 2019
@pdurbin
Copy link
Member

pdurbin commented Mar 25, 2019

A couple of updates from standup:

  • Updating the directory structure is now possible from the native API "add" and "replace" endpoint because we merged pull request Set directoryLabel (File Path) via API #5678 into the branch under test for this issue. An update to the API Guide was included.
  • I haven't been following very closely the naming convention we are converging on for Flyway scripts but I pushed b2f04e4 to the branch to attempt to document it. This could use some review.

landreev added a commit that referenced this issue Mar 26, 2019
@landreev
Copy link
Contributor

Added doc. info (to the guide and the release notes), as discussed yesterday.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants