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

Implement a Feature to Create a Project Snapshot #1437

Closed
4 of 9 tasks
entrotech opened this issue Aug 27, 2023 · 8 comments · Fixed by #1514
Closed
4 of 9 tasks

Implement a Feature to Create a Project Snapshot #1437

entrotech opened this issue Aug 27, 2023 · 8 comments · Fixed by #1514
Labels
Dependency Issues that cannot be worked on until another issue is closed enhancement Release Note: Shows as visual or user experience Enhancement level: medium p-feature: My Projects Page /projects priority: MUST HAVE role: back-end Node/Express Development Task role: database Database Development Task role: front-end Front End Developer size: 2pt Can be done in 7-12 hours
Milestone

Comments

@entrotech
Copy link
Member

entrotech commented Aug 27, 2023

Dependency

Overview

We want users to be able to freeze a version of a Project by creating a "snapshot" that is no longer editable. We will use the term "draft" to describe an editable calculation/project, and "snapshot" to describe a calculation that has been converted to a non-editable snapshot. When a snapshot is created, the user will be able to change the project name and Alternate #. These changes do not count as a Modification to the project for purposes of the Modified By date. If the user wants to create a modified version of the calculation, they will do so by making a copy from the My Projects Page, which will then be an (editable) draft.

A separate follow-on issue will be created that allows the user to share a snapshot with other users, but the requirements are TBD.

Separate issues will be created for modifying the user access list for a snapshot. Snapshots may also be hidden or moved to the trash or deleted.

Action Items

  • Create a database migration script that adds a dateSnapshotted column to the Project table in the database. This column will be null for draft projects, but have the UTC datetime that the snapshot was created for projects that are a snapshot. there is no need to record which user hid or unhide the project, since it is the same as the createdBy user.
  • Create a stored procedure called Project_Snapshot with parameters id int and loginId int. The id identifies the projectd to snapshot. The loginId must match the loginId column of each or the update should fail and return an error code indicating that the operation is unauthorized.
  • Create a Web API endpoint with method PUT and path /api/projects/snapshot and a body object with a single integer parameter named "id" that indicates the project to create a snapshot from. (The loginId parameter for the user should be extracted from the JSON Web token, to avoid tampering.) Add the appropriate methods to the project.controller.js, project.routes.js, project.service.js methods to implement the endpoint and call the stored procedure. This ensures that the request is coming from a logged in user and reliably determines the loginId of the user.
  • At this time, it's not determined how many different places in the UI that the snapshot feature may be called, but we are assuming that the user must create snapshots for one project at a time. We can start by implementing the feature from the "More..." menu that appears on individual lines of the My Project page design if the selected line does not represent a project that is already a snapshot, is not deleted and not hidden.
    image

(This screenshot shows the TEMPORARY implementation of the My Projects Page, which includes icons to indicate if a project is hidden, trashed or snapshotted, since we need a visual indication of the project statuses until we can implement the desired filtering for the My Projects page.)

  • You will need to add a method to the /client/src/services/project.service.js to call the Web API endpoint mentioned above.
  • You will need to wire-up the snapshot menu item from the context menu shown above to call this new client-side service method.
  • As a starting point, clicking on the snapshot menu item will immediately create the snapshot without any kind of modal dialog or prompt. The UI team is working on a modal that will allow the user to re-name the project and add a list of email addresses to share the snapshot with, but the implementation will be in separate follow-on development issues.
  • It may also be desirable to show somewhere on the Project Wizard if a project is a snapshot and maybe to provide a button to convert a snapshot to a draft, but the requirements are TBD as of 9/7/23.

Resources/Instructions

@entrotech entrotech added enhancement Release Note: Shows as visual or user experience Enhancement role: front-end Front End Developer role: back-end Node/Express Development Task role: database Database Development Task level: medium priority: MUST HAVE p-feature: My Projects Page /projects size: 2pt Can be done in 7-12 hours labels Aug 27, 2023
@Biuwa Biuwa added the Dependency Issues that cannot be worked on until another issue is closed label Aug 30, 2023
@Biuwa Biuwa added this to the 10 - Launch milestone Aug 30, 2023
@Jonathanko52 Jonathanko52 self-assigned this Sep 14, 2023
@Biuwa
Copy link
Member

Biuwa commented Oct 5, 2023

ETA: Next Week

@Jonathanko52
Copy link
Member

Jonathanko52 commented Oct 5, 2023

Screen Shot 2023-10-04 at 7 40 39 PM

-Add auto refresh once snapshot is created to include camera icon

-Renaming functionality currently not in the API, so leave that out for now. (Empty string in api area?)

@Biuwa
Copy link
Member

Biuwa commented Oct 18, 2023

@Jonathanko52 Please provide update

  1. Progress:
  2. Blockers:
  3. Availability:
  4. ETA:
  5. Pictures (if necessary):

@Jonathanko52
Copy link
Member

Progress: Creating a new modal for the snapshot function.
Blockers: Issues running TDM locally, and therefore making any changes.
Availability: Weekdays.
ETA: One week once I get this blocker resolved.

Pictures (if necessary):

@Jonathanko52
Copy link
Member

Jonathanko52 commented Oct 26, 2023

Progress: Snapshot function implemented. Modal finished. Ready for review.
Blockers: None
Availability: Weekdays.

ETA: One week once I get this blocker resolved.

Pictures (if necessary):
Screen Shot 2023-10-25 at 5 54 39 PM

@Biuwa
Copy link
Member

Biuwa commented Nov 1, 2023

@Jonathanko52 Please provide update

Progress:
Blockers:
Availability:
ETA:
Pictures (if necessary):

@Jonathanko52
Copy link
Member

Progress: Added API calls for snapshot and rename paths. Added project name to the payload.
Blockers: None
Availability: Weekdays.
ETA:

@Parisajf
Copy link
Member

Parisajf commented Nov 9, 2023

John created a procedure and is working with JK next week

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dependency Issues that cannot be worked on until another issue is closed enhancement Release Note: Shows as visual or user experience Enhancement level: medium p-feature: My Projects Page /projects priority: MUST HAVE role: back-end Node/Express Development Task role: database Database Development Task role: front-end Front End Developer size: 2pt Can be done in 7-12 hours
Projects
Status: Released
Development

Successfully merging a pull request may close this issue.

4 participants