Skip to content

User has role site filter #2273

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

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open

Conversation

jimsafley
Copy link
Member

This will filter out sites where the logged in user has no role (this is on the admin browse page ). There's a "View all" checkbox there that may need styling - maybe in the same way as the .batch-inputs div on the item browse page? To see the checkbox, you'll need to be logged in as a non-admin user.

@jimsafley jimsafley requested a review from zerocrates March 11, 2025 15:31
@erseco
Copy link

erseco commented Mar 25, 2025

This PR is extremely valuable for large Omeka S installations! We currently manage over 500 sites in our installation, and this filter would significantly improve both performance and usability.

By limiting the displayed sites to only those where a user has a role, it would:

  1. Reduce initial page load times
  2. Simplify navigation for non-admin users
  3. Create a more focused and relevant admin experience

I'm looking forward to seeing this merged into the main codebase as it addresses a real pain point for large-scale Omeka S deployments.

Regarding the failing tests: there appears to be a minor code style issue in application/src/Api/Adapter/SiteAdapter.php around line 42-43 with parenthesis indentation that's causing the PHP CS Fixer to fail. A small adjustment to the indentation should resolve this.

@zerocrates
Copy link
Member

Can we fix the codestyle checker whining here? I think it's asking for that weird indentation because one of the closing parens for the previous line has been accidentally included in the )) line it's asking to move.

@zerocrates
Copy link
Member

zerocrates commented May 2, 2025

The "view all" option here just goes always to ?user_has_role=0 (or the "normal" browse if unchecking).

Maybe simpler to just make it a link in that case? I don't think it's necessarily a big deal whether that's just statically to the full set with/without the has_role parameter, or is to the current query with just that param changed.

I guess aproblem with doing it this way is that you need to then come up with wording for what the opposite of "view all" is here. "Your sites" vs "All sites" or something, maybe.

@jimsafley
Copy link
Member Author

Maybe simpler to just make it a link in that case?

That would it the only browse control that's a link and not an input. @kimisgold What are your thoughts on this?

@kimisgold
Copy link
Member

In past a11y audits, we've gotten complaints for input elements that unexpectedly trigger a page load, so using a link here makes sense to me. I also think the labeling needs to provide more functional context like @zerocrates. I'm thinking of something like this:

image

We could also do "Your sites | All sites" styled like filters/subnavigation if we want it to be less wordy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants