Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(site): offer every authorized organization in the templates filter - #29054

Open
arpitjain099 wants to merge 1 commit into
coder:mainfrom
arpitjain099:fix/templates-filter-org-options
Open

fix(site): offer every authorized organization in the templates filter#29054
arpitjain099 wants to merge 1 commit into
coder:mainfrom
arpitjain099:fix/templates-filter-org-options

Conversation

@arpitjain099

Copy link
Copy Markdown

Closes #28985.

TemplatesFilter's organization dropdown gets its options from API.getMyOrganizations(), which is GET /api/v2/users/me/organizations and therefore membership-scoped. The tables the filter drives are permission-scoped: TemplatesPage narrows useDashboard().organizations by updateTemplates. A user with template permissions in an organization they are not a member of sees that organization's templates in the table and cannot pick it in the dropdown.

Switched to API.getOrganizations(), which is what the issue suggests and what the rest of the component already assumes: getSelectedOption a few lines up resolves the organization through API.getOrganization(...) with no membership check, so filtering by such an organization already works if you put it in the URL by hand. Only the picker hid it.

New TemplatesFilter.test.tsx stubs the two endpoints so they disagree, with one organization in both and one only in getOrganizations, opens the picker, and asserts the non-member organization is offered. Against the current code it fails with

Unable to find an element with the text: Not A Member

and passes with the change. tsc --noEmit and biome check are clean on both files.

I left the related useOrganizationsFilterMenu note in the issue alone. It gates options on audit_log:read, which is right for the Audit and Connection Log pages and wrong for Workspaces, so the fix there is to make the gate a parameter rather than to drop it, and that felt like a separate change from this one.

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@github-actions github-actions Bot added the community Pull Requests and issues created by the community. label Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community Pull Requests and issues created by the community.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: organization filter dropdown omits orgs whose templates are listed

1 participant