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

moderation: fix admin links generation #2722

Closed
wants to merge 1 commit into from

Conversation

Samk13
Copy link
Member

@Samk13 Samk13 commented Jun 26, 2024

❤️ Thank you for your contribution!

Description

Initially, I planned to approach it from the backend here, but then I wondered why it was done this way in the first place. There must be a reason that I might not be aware of.
So I decided to limit the change to the frontend.
the backend link might be intended for use elsewhere in the existing form; otherwise, why would the author implement it this way?

In case I am wrong, here is the backend PR: inveniosoftware/invenio-users-resources#136

ScreenRecord

fix-moderation-links

Checklist

Ticks in all boxes and 🟢 on all GitHub actions status checks are required to merge:

Frontend

Reminder

By using GitHub, you have already agreed to the GitHub’s Terms of Service including that:

  1. You license your contribution under the same terms as the current repository’s license.
  2. You agree that you have the right to license your contribution under the current repository’s license.

* Update SearchResultItemLayout.js to use adminLinks for admin links
@Samk13 Samk13 added the bug Something isn't working label Jul 10, 2024
buildAdminLinks = (userId) => {
const baseQuery = `parent.access.owned_by.user:${userId}`;
return {
admin_records_html: `/administration/records?q=${baseQuery}&f=allversions`,
Copy link
Contributor

Choose a reason for hiding this comment

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

I would like to suggest not to generate the links in the ui whenever not absolutely unavoidable, but to use the ones supplied by REST API, otherwise the code becomes very difficult to maintain

@kpsherva
Copy link
Contributor

closing in favour of inveniosoftware/invenio-users-resources#136

@kpsherva kpsherva closed this Jul 10, 2024
@Samk13 Samk13 deleted the moderation-links branch July 10, 2024 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Administration: Checking the records/drafts for a user lists no results
2 participants