Skip to content

TK-32: Preserve Documents and Knowledge Items When Reverting an ISA to Draft - #71

Merged
burkkyy merged 2 commits into
mainfrom
tk-32/amendments-to-isa
Sep 8, 2026
Merged

TK-32: Preserve Documents and Knowledge Items When Reverting an ISA to Draft#71
burkkyy merged 2 commits into
mainfrom
tk-32/amendments-to-isa

Conversation

@burkkyy

@burkkyy burkkyy commented Sep 5, 2026

Copy link
Copy Markdown
Member

Fixes https://yg-hpw.atlassian.net/browse/TK-32

Context

Amending a signed Information Sharing Agreement lost work:

Revert to Draft should not wipe the uploaded documents.
Revert to Draft should be available even if knowledge items exist.

Reverting a signed agreement to draft deleted the uploaded signed documents, and the action was hidden/blocked entirely once a knowledge item was linked. Signed documents also showed only a date, not a time.

Several acceptance criteria were already met and are unchanged: the downloadable Word agreement is generated on demand from the latest saved data (so edits are always reflected), draft agreements already offer "Mark as Signed" to upload the signed version with the same options as the first time, and reverting still removes the agreement's groups.

Implementation

  1. Keep the uploaded signed documents when reverting a signed agreement to draft, instead of deleting them.
  2. Keep any linked knowledge items when reverting, and allow the revert action even when knowledge items exist (previously hidden and server-blocked).
  3. Continue removing the agreement's groups and access on revert, as before.
  4. Show the upload date and time (not just the date) on each signed document.
  5. Update the revert-to-draft confirmation copy to state that groups and access are removed while signed documents and knowledge items are kept.

Screenshots

TODO - signed documents timestamp and the updated revert-to-draft dialog.

Testing Instructions

  1. Run the test suite via dev test.
  2. Boot the app via dev up.
  3. Log in to the app at http://localhost:3000.
  4. Create an Information Sharing Agreement, then use its actions menu to Mark as Signed and upload a signed document (and a signed confidentiality receipt if the agreement is "Accepted in Confidence").
  5. On the signed agreement, open the Signed Documents card and verify each document shows an upload date and time.
  6. Create/link a knowledge item to the agreement.
  7. Open the actions menu and verify Revert to Draft is available even though a knowledge item exists.
  8. Click Revert to Draft and verify the dialog says the signed documents and linked knowledge items will be kept; confirm.
  9. Verify the agreement is now a draft, the signed documents are still attached and downloadable, the knowledge item is still linked, and the agreement's groups/access have been removed.
  10. In the draft, verify Mark as Signed is available again to re-upload the signed version with the same options as before.
  11. Edit the draft, save a change, then Download Information Sharing Agreement and verify the Word document reflects the saved change.

Reverting a signed agreement previously wiped the uploaded signed documents and
was blocked entirely once knowledge items were linked, so amendments lost work.

- Keep the signed documents and any linked knowledge items on revert to draft;
  only the groups and their access grants are removed, as before.
- Allow reverting to draft even when knowledge items are linked (policy and UI).
- Show the upload date and time on each signed document.
- Update the revert-to-draft confirmation copy to reflect what is kept.

See https://yg-hpw.atlassian.net/browse/TK-32
@burkkyy burkkyy self-assigned this Sep 8, 2026
@burkkyy burkkyy added the enhancement New feature or request label Sep 8, 2026
@burkkyy
burkkyy marked this pull request as ready for review September 8, 2026 22:51
@burkkyy
burkkyy merged commit f659663 into main Sep 8, 2026
@burkkyy
burkkyy deleted the tk-32/amendments-to-isa branch September 8, 2026 22:52
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.

1 participant