Skip to content

admin: deleted records link with include_deleted parameter#3368

Draft
ptamarit wants to merge 1 commit into
inveniosoftware:masterfrom
ptamarit:admin-deleted-records-include-deleted
Draft

admin: deleted records link with include_deleted parameter#3368
ptamarit wants to merge 1 commit into
inveniosoftware:masterfrom
ptamarit:admin-deleted-records-include-deleted

Conversation

@ptamarit

Copy link
Copy Markdown
Member

When reviewing deleted records, administrators usually want to see the deleted records content and not the tombstones.
It probably does not make sense to expose the "include_deleted" links in the API response, so we built the URL client-side (only needed for the admin panel).

@ptamarit ptamarit requested review from carlinmack and slint March 13, 2026 15:44

@slint slint left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, just a tiny nit, not critical for merging.


let selfLink = result.links.self_html;
if (result?.deletion_status?.is_deleted) {
selfLink += "?include_deleted=1";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: could we "formally" build the URL, by parsing and setting the param? This is more of a future-proofing thing, in case at some point we already bake into the URL a different querystring param

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good point, done. Now using new URL and searchParams.set("include_deleted", "1").

@ptamarit ptamarit force-pushed the admin-deleted-records-include-deleted branch from bed5276 to e14c2fe Compare March 16, 2026 14:19
const recordOwner = result?.parent?.access?.owned_by;

let selfLink = result.links.self_html;
if (result?.deletion_status?.is_deleted) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

question: why do we do that in the component and not in the backend?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I don't think it makes sense to expose the "include_deleted" links in the API response, since only admins have access to it, and it's only needed for the admin panel.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

my concerns are that we mix responsibilities and that could introduce problems in the future. as of now i thought the only place where links are created is in the links section in the service layer.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We would need a conditional self_html_deleted link that also takes into account the user's identity... Which I think we have access to from ctx["identity"]. It could work tbh, and it would be more backend-driven indeed.

Though another PR in invenio-rdm-records 😬

@github-actions

Copy link
Copy Markdown
Contributor

This PR was automatically marked as stale.

@github-actions github-actions Bot added the stale No activity for more than 60 days. label May 19, 2026
@ptamarit ptamarit marked this pull request as draft June 5, 2026 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale No activity for more than 60 days.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants