Skip to content

fix: fix loading states and permissions checks in organization settings #16465

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

Merged
merged 25 commits into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add missing query to terminal page story
  • Loading branch information
aslilac committed Feb 19, 2025
commit 37d87d3790e5aaa8bed4d87a11c619e510767b9f
7 changes: 6 additions & 1 deletion site/src/api/queries/organizations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,14 @@ export const organizationsPermissions = (
};
};

export const anyOrganizationPermissionsKey = [
"authorization",
"anyOrganization",
];

export const anyOrganizationPermissions = () => {
return {
queryKey: ["authorization", "anyOrganization"],
queryKey: anyOrganizationPermissionsKey,
queryFn: () =>
API.checkAuthorization({
checks: anyOrganizationPermissionChecks,
Expand Down
2 changes: 2 additions & 0 deletions site/src/pages/TerminalPage/TerminalPage.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
} from "testHelpers/entities";
import { withWebSocket } from "testHelpers/storybook";
import TerminalPage from "./TerminalPage";
import { anyOrganizationPermissionsKey } from "api/queries/organizations";

const createWorkspaceWithAgent = (lifecycle: WorkspaceAgentLifecycle) => {
return {
Expand Down Expand Up @@ -76,6 +77,7 @@ const meta = {
key: getAuthorizationKey({ checks: permissionsToCheck }),
data: { editWorkspaceProxies: true },
},
{ key: anyOrganizationPermissionsKey, data: {} },
],
chromatic: { delay: 300 },
},
Expand Down
Loading