Skip to content

Tenant Selector doesn’t honor the custom order when ‘orderable’ is enabled for Tenant collection #12246

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

Closed
anyuj opened this issue Apr 29, 2025 · 1 comment · Fixed by #12314

Comments

@anyuj
Copy link
Contributor

anyuj commented Apr 29, 2025

Describe the Bug

When the “orderable” option is enabled for the Tenant collection, the Tenant Selector should honor the custom order we’ve defined. In some use cases, for example, when a user manages multiple tenants that have an inherent priority (such as usage frequency), sorting purely by the useAsTitle isn’t very practical. We’d appreciate having the custom order honored whenever ‘orderable’ is enabled.

Link to the code that reproduces this issue

https://github.com/anyuj/multi-tenant-plug-issue

Reproduction Steps

  1. Create a blank payload project, and follow the doc to set up multi-tenant plugin or simple clone the repo above.
  2. Add some tenants, and refresh the page of the admin panel.

Which area(s) are affected? (Select all that apply)

plugin: other

Environment Info

Payload: 3.35.1
Next: 15.3.1
Node: 22.13.0
@anyuj anyuj added status: needs-triage Possible bug which hasn't been reproduced yet validate-reproduction Auto-added tag on create to tell bot to check recreation URL, removed after check. labels Apr 29, 2025
@github-actions github-actions bot removed the validate-reproduction Auto-added tag on create to tell bot to check recreation URL, removed after check. label Apr 29, 2025
@anyuj anyuj changed the title Tenant Selector ignores custom order when ‘orderable’ is enabled Tenant Selector doesn’t honor the custom order when ‘orderable’ is enabled for Tenant collection Apr 29, 2025
DanRibbens pushed a commit that referenced this issue May 5, 2025
…able enabled for tenant collection (#12314)

### What?
Tenant Selector doesn’t honor the custom order when ‘orderable’ is
enabled for Tenant collection
### Why?
Currently, it uses "useAsTitle" to sort. In some use cases, for example,
when a user manages multiple tenants that have an inherent priority
(such as usage frequency), sorting purely by the useAsTitle isn’t very
practical.
### How?
Get "orderable" config from the tenant collection's config, if it has
"orderable" set as true, it will use _order to sort. If not, it will use
"useAsTitle" to sort as default.

Fixes #12246


![image](https://github.com/user-attachments/assets/b5c4ad5e-3503-4789-91f6-a7aafb326e32)
@github-actions github-actions bot removed the status: needs-triage Possible bug which hasn't been reproduced yet label May 5, 2025
Copy link
Contributor

github-actions bot commented May 5, 2025

🚀 This is included in version v3.37.0

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