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

Delete Submissions from UI #709

Closed
matthew-white opened this issue Sep 18, 2024 · 7 comments · Fixed by getodk/central-frontend#1043 or getodk/central-frontend#1076
Closed

Delete Submissions from UI #709

matthew-white opened this issue Sep 18, 2024 · 7 comments · Fixed by getodk/central-frontend#1043 or getodk/central-frontend#1076
Assignees
Labels
backend Requires a change to the API server behavior verified Behavior has been manually verified design verified Verified by a designer enhancement New feature or behavior frontend Requires a change to the UI

Comments

@matthew-white
Copy link
Member

matthew-white commented Sep 18, 2024

As of v2024.2, submission deletion is possible via the API (#667). Submissions will be purged after 30 days. We also want to add submission deletion to Frontend, which is what this issue is for.

We support entity deletion in Frontend, and we can probably adapt that same code for submission deletion. There are some details to consider, for example, after an entity is deleted, the entity count is updated. We support entity deletion from the entities table and from the entity detail page, and I think it'd be nice to similarly be able to delete a submission from either the submissions table or the submission detail page.

We don't yet support listing deleted entities or restoring/undeleting them, but we will want to be able to list and (I think) also restore deleted submissions from Frontend. To do so, we'll need to make a Backend change so that it's possible to retrieve the list of deleted submissions (something like the ?deleted=true flag that we support for the forms endpoint).

There is a related mockup in the release criteria for v2024.3. There are also some old notes from the block 14 release criteria (under Later Release). Submission deletion has been discussed on the forum, for example, here.

Here's an idea that was in the parking lot that I'm not sure is captured elsewhere:

there will be some language on the projects table (or maybe an activity feed) showing that there are pending deleted submissions.

@matthew-white matthew-white added enhancement New feature or behavior backend Requires a change to the API server frontend Requires a change to the UI needs testing Needs manual testing needs design review Needs verification from designer labels Sep 18, 2024
@github-project-automation github-project-automation bot moved this to 🕒 backlog in ODK Central Sep 18, 2024
@matthew-white matthew-white changed the title Delete submissions from Frontend Delete submissions from UI Oct 2, 2024
@matthew-white matthew-white changed the title Delete submissions from UI Delete Submissions from UI Oct 2, 2024
@matthew-white
Copy link
Member Author

we'll need to make a Backend change so that it's possible to retrieve the list of deleted submissions (something like the ?deleted=true flag that we support for the forms endpoint).

I think we should probably add something like the ?deleted=true flag to the REST API endpoint to list submissions. But Frontend actually doesn't use that endpoint: it uses OData instead. We'll need to modify the OData endpoint so that it can return deleted submissions. As part of that, we'll need to return deletedAt under __system. I think we should also include a deletedAt property in the OData schema/metadata. (Should we include it in the schema all the time or only when deleted submissions are requested?)

@issa-tseng
Copy link
Member

suggested css adjustments:

.toggle-deleted-submissions {
  margin-left: 8px;    // up from 5
  .icon-close { margin-left: 3px; } // up from 0
}
.purge-description {
  left: 12px; // up from 5
}

otherwise it seems like it works great!

@matthew-white
Copy link
Member Author

matthew-white commented Nov 19, 2024

Thanks, @issa-tseng! I have a PR up for these changes here: getodk/central-frontend#1055.

@dbemke
Copy link

dbemke commented Dec 4, 2024

Should it be possible to view or download media from a deleted submission?

Steps to reproduce:

  1. In All widgets form attach media files.
  2. Delete the submission.
  3. Go to the deleted Submissions and try to view or download the media. (there's 404.1 error)
    Image
    Image

@sadiqkhoja
Copy link
Contributor

Good catch! I don't think it should be possible. I will make the change

@dbemke
Copy link

dbemke commented Dec 6, 2024

Tested with success!

@WKobus
Copy link

WKobus commented Dec 6, 2024

Tested with success!

@srujner srujner added behavior verified Behavior has been manually verified and removed needs testing Needs manual testing labels Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Requires a change to the API server behavior verified Behavior has been manually verified design verified Verified by a designer enhancement New feature or behavior frontend Requires a change to the UI
Projects
Status: ✅ done
6 participants