Skip to content

Commit 19fcd6f

Browse files
committed
fix: format
1 parent 55ed653 commit 19fcd6f

File tree

5 files changed

+22
-18
lines changed

5 files changed

+22
-18
lines changed

site/src/api/queries/organizations.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,10 +316,9 @@ export const workspacePermissionsByOrganization = (
316316
queryKey: ["workspaces", organizationIds.sort(), "permissions"],
317317
queryFn: async () => {
318318
const prefixedChecks = organizationIds.flatMap((orgId) =>
319-
Object.entries(workspacePermissionChecks(orgId, userId)).map(([key, val]) => [
320-
`${orgId}.${key}`,
321-
val,
322-
]),
319+
Object.entries(workspacePermissionChecks(orgId, userId)).map(
320+
([key, val]) => [`${orgId}.${key}`, val],
321+
),
323322
);
324323

325324
const response = await API.checkAuthorization({

site/src/modules/permissions/workspaces.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
export const workspacePermissionChecks = (organizationId: string, userId: string) =>
1+
export const workspacePermissionChecks = (
2+
organizationId: string,
3+
userId: string,
4+
) =>
25
({
36
createWorkspace: {
47
object: {

site/src/pages/CreateWorkspacePage/CreateWorkspacePage.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,10 @@ const CreateWorkspacePage: FC = () => {
6767
const permissionsQuery = useQuery(
6868
templateQuery.data
6969
? checkAuthorization({
70-
checks: workspacePermissionChecks(templateQuery.data.organization_id, me.id),
70+
checks: workspacePermissionChecks(
71+
templateQuery.data.organization_id,
72+
me.id,
73+
),
7174
})
7275
: { enabled: false },
7376
);

site/src/pages/TemplatePage/TemplateLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import { ErrorAlert } from "components/Alert/ErrorAlert";
55
import { Loader } from "components/Loader/Loader";
66
import { Margins } from "components/Margins/Margins";
77
import { TabLink, Tabs, TabsList } from "components/Tabs/Tabs";
8-
import { workspacePermissionChecks } from "modules/permissions/workspaces";
98
import { useAuthenticated } from "contexts/auth/RequireAuth";
9+
import { workspacePermissionChecks } from "modules/permissions/workspaces";
1010
import {
1111
type FC,
1212
type PropsWithChildren,

site/src/pages/TemplatePage/TemplatePageHeader.tsx

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -179,17 +179,16 @@ export const TemplatePageHeader: FC<TemplatePageHeaderProps> = ({
179179
<PageHeader
180180
actions={
181181
<>
182-
{!template.deprecated &&
183-
workspacePermissions.createWorkspace && (
184-
<Button
185-
variant="contained"
186-
startIcon={<AddIcon />}
187-
component={RouterLink}
188-
to={`${templateLink}/workspace`}
189-
>
190-
Create Workspace
191-
</Button>
192-
)}
182+
{!template.deprecated && workspacePermissions.createWorkspace && (
183+
<Button
184+
variant="contained"
185+
startIcon={<AddIcon />}
186+
component={RouterLink}
187+
to={`${templateLink}/workspace`}
188+
>
189+
Create Workspace
190+
</Button>
191+
)}
193192

194193
{permissions.canUpdateTemplate && (
195194
<TemplateMenu

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy