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

Support Version Management (without sharing modes) #111

Merged
merged 57 commits into from
Nov 21, 2024

Conversation

farisd16
Copy link
Member

@farisd16 farisd16 commented Nov 4, 2024

Description

This PR adds version management as described in #97, with two exceptions:

  • Version management is disabled in sharing modes. (edit, give/see feedback, collaborate) A follow-up PR is planned after this one is merged.
  • I proposed two approaches in Version Management Proposal #97 for the modification of the diagram datatype to support version management. I made a different modification in my implementation as it seemed to be easier to implement, more efficient and avoided breaking changes:
id: string;
title: string;
model: UMLModel;
lastUpdate: string;
versions: Diagram[]; (recursive)
description: string;
token: string;

This avoids breaking changes because no existing fields are removed and only new fields are added. A diagram with two versions can then for example look like this:

{
  "id": "722378dd-e549-4621-9405-fe7f884e0689",
  "title": "Addressed Feedback",
  "model": {...},
  "lastUpdate": "2024-11-16T13:31:29.135Z",
  "description": "Incorporated feedback from the group",
  "versions": [
    {
      "id": "722378dd-e549-4621-9405-fe7f884e0689",
      "title": "Initial Draft",
      "model": {...},
      "lastUpdate": "2024-11-16T13:31:52.849Z",
      "description": "Proposal for the system"
    },
    {
      "id": "722378dd-e549-4621-9405-fe7f884e0689",
      "title": "Addressed Feedback",
      "model": {...},
      "lastUpdate": "2024-11-16T13:32:22.695Z",
      "description": "Incorporated feedback from the group"
    }
  ],
  "token": "pUX0hHPj5UYJE3an7Xk5"
}

Steps for Testing

  1. Model a diagram
  2. Publish a version by opening the sidebar and pressing the '+' button in the top right
  3. Make further changes and publish another version
  4. Make sure that it is possible to delete, edit, preview, and restore versions. The button for restoring a version is visible after previewing the respective version.

farisd16 and others added 30 commits September 26, 2024 12:53
@farisd16 farisd16 added the enhancement New feature or request label Nov 4, 2024
@farisd16 farisd16 self-assigned this Nov 4, 2024
@farisd16 farisd16 linked an issue Nov 4, 2024 that may be closed by this pull request
@egenerse
Copy link
Contributor

egenerse commented Nov 7, 2024

@farisd16 I found an edge case while testing
Steps:

  • Preview a version
  • Create a new diagram
  • The side menu doesn't come back and diagram versions are gone so I cannot cancel preview
Screen.Recording.2024-11-07.at.22.32.30.mov

@FelixTJDietrich
Copy link
Contributor

@farisd16 are you fixing the issue @egenerse found in this PR? Or are you planning to do it as a follow-up?

@farisd16
Copy link
Member Author

farisd16 commented Nov 11, 2024

@farisd16 are you fixing the issue @egenerse found in this PR? Or are you planning to do it as a follow-up?

Should be fixed now

Copy link
Contributor

@egenerse egenerse left a comment

Choose a reason for hiding this comment

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

I reviewed the code and I tested in my local, looks good to me

@FelixTJDietrich FelixTJDietrich changed the title Version Management (without sharing modes) Support Version Management (without sharing modes) Nov 14, 2024
Copy link
Contributor

@FelixTJDietrich FelixTJDietrich left a comment

Choose a reason for hiding this comment

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

Code looks good to me but after testing the functionality on https://test1.apollon.ase.in.tum.de/ I still found some minor issues.

If I delete a version and then move an element the version will reappear.

Some views need to be adjusted for dark mode, I think they need a dark background with light text:
image (15)
image (16)

Also, the current unpublished version never disappears. I think until there are no changes it should select the published version and not show current unpublished version.
image (17)

The current unpublished version also does not have the dot to show that it is selected/active.

@FelixTJDietrich FelixTJDietrich self-requested a review November 18, 2024 10:26
Copy link
Contributor

@FelixTJDietrich FelixTJDietrich left a comment

Choose a reason for hiding this comment

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

Code changes look good to me and the functionality is now as expected. Thank you for implementing that feature!

@FelixTJDietrich FelixTJDietrich merged commit 891744d into main Nov 21, 2024
2 checks passed
@FelixTJDietrich FelixTJDietrich deleted the feature/version-management branch November 21, 2024 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Version Management Proposal
3 participants