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

Issue 261 and 263 #266

Merged
merged 5 commits into from
Apr 19, 2024
Merged

Issue 261 and 263 #266

merged 5 commits into from
Apr 19, 2024

Conversation

edwin5588
Copy link
Collaborator

To test:

  1. create a new project, and then make edits of it to get previous versions list
    OR
  2. Edit a project that doesn't have previous versions on it, since the last iteration of previous versions had the wrong format.

What I tested:

  • Created a new project, make edits, and click through the previous versions list to visit old versions of projects, and download the links.
  • Go to a project without any edits, make an edit, click through the previous versions list to visit old versions of projects, and download the links.

liefeld and others added 3 commits April 10, 2024 14:37
…andle using updated flag instead of deleted flag for projects that have newer versions. The find_one_project does not take that into account yet. This checkin is primarily to fix the serialization and desrialization of the previous_versions field which was being saved as an array, holding another array, holding a json dumped string representing an array of objects with date and id. now its just an array of objects with date and linkid (renamed so that it does not have to be trans-named every time its used).
- added new "current" field to db
- integrate with Ted's changes for the string to array
- get_one_project: added a check to find old IDs with current = False, to find and load old projects
- changes to project.html template with ability to  render old projects
- changed _create project so previous versions list is directly loaded into it, inserts into DB once.

NOTE:
- edited projects will not set flag to delete anymore
@edwin5588 edwin5588 requested a review from liefeld April 11, 2024 23:42
Copy link
Collaborator

@liefeld liefeld left a comment

Choose a reason for hiding this comment

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

Behavior is not yet right. After versioning a project, its old versions still shows up in the private projects on the home page and profile page. They can also still be edited again so now you have a branching history [1->2->3, and also 1->2->2A]. Now when I go to the old original version 1 project page it does not give the banner of being an old project or show the newer versions in its history.

Also the find_one_project changes we discussed over slack.

Data in the MongoDB looks to be OK and otherwise the version project links seem to be working

- projects of previous versions no longer editable
- changes to get_one_proj so it looks for a 'previous_version' project with current:false, delete:True
- moved actual project deletion code to a new function called "admin_permanent_delete_project"
- Changes to admin_delete_project: checks if previous versions exists in the project, if previous versions exists, then iterate through the previous versions and delete all of the previous versions.
- Projects that are not current (current:false, a previous version of another project) will not show up on profile page anymore.
Copy link
Collaborator

@liefeld liefeld left a comment

Choose a reason for hiding this comment

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

Edwin, this looks good and my testing this morning did not turn up any errors or oddities. Good work!
One thing we should ask Jens is whether he anticipates a need to be able to revert to an older version (this was not in scope for 261/263) so in effect, a 'delete current version' button. Probably we don't need it though since you can always just make another new version with the file downloaded from the previous version and its unlikely to be a common action worth cluttering the UI.

@jluebeck
Copy link
Member

@liefeld @edwin5588 - thank you for implementing this! Given the emerging importance of having a permalink (based on UUID) for projects, it is very likely we will need to have functionality to delete a specific version of a project, without deleting the entire history or making a new project (with a new UUID).

@liefeld liefeld merged commit 41f5b00 into main Apr 19, 2024
@liefeld liefeld deleted the issue261_263 branch April 19, 2024 19:41
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

Successfully merging this pull request may close these issues.

3 participants