-
Notifications
You must be signed in to change notification settings - Fork 6
change file version #633
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
change file version #633
Conversation
does not work
going to try version number as a parameter?
needs to be fixed on dataset page file version chips
this will eventually have info from the history and not the current version
|
The following now works: Right now there is no change for visualization. Will make that a separate issue. To test, upload a text file, run wordcount extractor, and then modify it to create some new versions and re-run extractor. When you change, you will see the metadata change and also, the file details will change. |
hover over text for what it does
max-zilla
left a comment
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.
There is a bug where I uploaded Squirrel.gif, then tried to upload a new file version using OtherFile.gif. The API does not allow a new file version to have different filename from before, so it returns a 400, but the UI does not seem to catch this and tries to show the newer version of the file (that didn't successfully get created). Not sure if this bug was introduced here but we should fix it here. (see routers/files update_file method for this logic - we should catch the 400)

backend/app/models/files.py
Outdated
| main_type: str = "N/A" | ||
|
|
||
|
|
||
| class FileVersionDetails(BaseModel): |
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.
this is not used, please remove
frontend/src/actions/file.js
Outdated
| export const CHANGE_SELECTED_VERSION = "CHANGE_SELECTED_VERSION"; | ||
|
|
||
| export function changeSelectedVersion(fileId, selectedVersion) { | ||
| console.log('change selected version in actions', fileId, selectedVersion); |
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.
remove
| const fileVersions = useSelector( | ||
| (state: RootState) => state.file.fileVersions | ||
| ); | ||
| console.log(fileVersions[0], 'the fisrt'); |
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.
remove
max-zilla
left a comment
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.
tested uploading a file and triggering a rejection on the update, switching versions, everything seemed to work.
|
@tcnichol i think if you resolve merge conflict we can merge |
|
To do in this or future PR:
|
# Conflicts: # frontend/src/components/files/File.tsx
# Conflicts: # frontend/src/components/files/FileActionsMenu.tsx # frontend/src/reducers/file.ts # frontend/src/types/data.ts


Right now we can change the file version.
The file summary has not changed to reflect the old version information yet. That will be done after metadata. Only the name of the left component changes.
I am now sending the selected version to the file metadata, but I am not sure that this is providing the correct version's metadata. Will need to start over with a new file with new metadata to test.
Another thing that does not work. If you have the metadata tab open, and then you change the file version using the modal, it does not change to reflect the new file version. I was not sure how to handle this.