feat: soft delete dataset draft - #226
Draft
kairoaraujo wants to merge 3 commits into
Draft
Conversation
kairoaraujo
force-pushed
the
feat/soft-delete-dataset-draft
branch
from
August 3, 2026 06:40
c84b8da to
ef8388b
Compare
allows users to recovery from delete mistaken - schema/migrations/0002_add_dataset_is_deleted.ttl: declares djht:is_deleted and djht:deleted_date predicates. - sparql_templates/soft_delete_dataset_draft.sparql: sets the deleted flag + timestamp, keeps all triples. - sparql_templates/restore_dataset_draft.sparql: clears the deleted flag. - sparql_templates/datasets.sparql: selects/binds is_deleted + deleted_date, adds the is_deleted filter. - web/database.py:datasets() gains is_deleted aset_draft / restore_dataset_draft methods +shared cache-invalidation helper. Hard delete_dataset_draft untouched. - web/wsgi.py: routes + handlers for restore anlete; the two everyday delete callers nowsoft-delete; ui_my_data gains a "Deleted" bucket; new-version guard uses is_deleted=None to block on soft-deleted drafts too. - html_templates/depositor/my-data.html: "Deleted" section with Restore / Delete-permanently. - html_templates/depositor/delete-dataset-permanitle: confirmation page. Signed-off-by: Kairo de Araujo <kairo@dearaujo.nl> Signed-off-by: Kairo de Araujo <kairo@dearaujo.nl> Signed-off-by: Kairo de Araujo <kairo@dearaujo.nl>
kairoaraujo
force-pushed
the
feat/soft-delete-dataset-draft
branch
from
August 3, 2026 07:57
ef8388b to
f6039b8
Compare
Signed-off-by: Kairo de Araujo <kairo@dearaujo.nl>
Signed-off-by: Kairo de Araujo <kairo@dearaujo.nl>
kairoaraujo
force-pushed
the
feat/soft-delete-dataset-draft
branch
from
August 3, 2026 09:52
f6039b8 to
2e80b43
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #226 +/- ##
==========================================
- Coverage 17.28% 17.22% -0.06%
==========================================
Files 21 21
Lines 10414 10477 +63
Branches 2022 2035 +13
==========================================
+ Hits 1800 1805 +5
- Misses 8425 8483 +58
Partials 189 189 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Collaborator
Author
|
Follow up on this PR:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Draft deletion is currently a hard delete: the depositor's "delete" removes every triple of the draft, and it cannot be undone. This change makes draft deletion a soft delete, so the draft is flagged and hidden instead of removed, listed in a new "Deleted" section on /my/datasets, from where the depositor can restore it or permanently delete it behind a typed-title confirmation. The existing hard-delete query is reused unchanged for the permanent path. Uploaded files on S3 are not touched by either path.
Changes
Approval Checklist
Issue Reference (optional - PRs may not be associated with an issue)
Screenshots (optional)
Notes (optional)
Additional context, caveats, or follow-up tasks.