File tree Expand file tree Collapse file tree 5 files changed +29
-16
lines changed Expand file tree Collapse file tree 5 files changed +29
-16
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,10 @@ import { pageTitle } from "utils/page";
26
26
import type { AutofillBuildParameter } from "utils/richParameters" ;
27
27
import { paramsUsedToCreateWorkspace } from "utils/workspace" ;
28
28
import { CreateWorkspacePageView } from "./CreateWorkspacePageView" ;
29
- import { type CreateWorkspacePermissions , createWorkspaceChecks } from "./permissions" ;
29
+ import {
30
+ type CreateWorkspacePermissions ,
31
+ createWorkspaceChecks ,
32
+ } from "./permissions" ;
30
33
31
34
export const createWorkspaceModes = [ "form" , "auto" , "duplicate" ] as const ;
32
35
export type CreateWorkspaceMode = ( typeof createWorkspaceModes ) [ number ] ;
Original file line number Diff line number Diff line change @@ -28,7 +28,10 @@ import { paramsUsedToCreateWorkspace } from "utils/workspace";
28
28
import { CreateWorkspacePageViewExperimental } from "./CreateWorkspacePageViewExperimental" ;
29
29
export const createWorkspaceModes = [ "form" , "auto" , "duplicate" ] as const ;
30
30
export type CreateWorkspaceMode = ( typeof createWorkspaceModes ) [ number ] ;
31
- import { type CreateWorkspacePermissions , createWorkspaceChecks } from "./permissions" ;
31
+ import {
32
+ type CreateWorkspacePermissions ,
33
+ createWorkspaceChecks ,
34
+ } from "./permissions" ;
32
35
33
36
export type ExternalAuthPollingState = "idle" | "polling" | "abandoned" ;
34
37
Original file line number Diff line number Diff line change @@ -6,7 +6,10 @@ import { Loader } from "components/Loader/Loader";
6
6
import { Margins } from "components/Margins/Margins" ;
7
7
import { TabLink , Tabs , TabsList } from "components/Tabs/Tabs" ;
8
8
import { useAuthenticated } from "contexts/auth/RequireAuth" ;
9
- import { workspacePermissionChecks , type WorkspacePermissions } from "modules/permissions/workspaces" ;
9
+ import {
10
+ type WorkspacePermissions ,
11
+ workspacePermissionChecks ,
12
+ } from "modules/permissions/workspaces" ;
10
13
import {
11
14
type FC ,
12
15
type PropsWithChildren ,
@@ -113,7 +116,9 @@ export const TemplateLayout: FC<PropsWithChildren> = ({
113
116
template = { data . template }
114
117
activeVersion = { data . activeVersion }
115
118
permissions = { data . permissions }
116
- workspacePermissions = { workspacePermissionsQuery . data as WorkspacePermissions }
119
+ workspacePermissions = {
120
+ workspacePermissionsQuery . data as WorkspacePermissions
121
+ }
117
122
onDeleteTemplate = { ( ) => {
118
123
navigate ( "/templates" ) ;
119
124
} }
Original file line number Diff line number Diff line change @@ -31,11 +31,11 @@ import {
31
31
import { Pill } from "components/Pill/Pill" ;
32
32
import { Stack } from "components/Stack/Stack" ;
33
33
import { linkToTemplate , useLinks } from "modules/navigation" ;
34
+ import type { WorkspacePermissions } from "modules/permissions/workspaces" ;
34
35
import type { FC } from "react" ;
35
36
import { useQuery } from "react-query" ;
36
37
import { Link as RouterLink , useNavigate } from "react-router-dom" ;
37
38
import { useDeletionDialogState } from "./useDeletionDialogState" ;
38
- import type { WorkspacePermissions } from "modules/permissions/workspaces" ;
39
39
40
40
type TemplateMenuProps = {
41
41
organizationName : string ;
@@ -180,16 +180,17 @@ export const TemplatePageHeader: FC<TemplatePageHeaderProps> = ({
180
180
< PageHeader
181
181
actions = {
182
182
< >
183
- { ! template . deprecated && workspacePermissions . createWorkspaceForUserID && (
184
- < Button
185
- variant = "contained"
186
- startIcon = { < AddIcon /> }
187
- component = { RouterLink }
188
- to = { `${ templateLink } /workspace` }
189
- >
190
- Create Workspace
191
- </ Button >
192
- ) }
183
+ { ! template . deprecated &&
184
+ workspacePermissions . createWorkspaceForUserID && (
185
+ < Button
186
+ variant = "contained"
187
+ startIcon = { < AddIcon /> }
188
+ component = { RouterLink }
189
+ to = { `${ templateLink } /workspace` }
190
+ >
191
+ Create Workspace
192
+ </ Button >
193
+ ) }
193
194
194
195
{ permissions . canUpdateTemplate && (
195
196
< TemplateMenu
Original file line number Diff line number Diff line change @@ -59,7 +59,8 @@ const WorkspacesPage: FC = () => {
59
59
}
60
60
61
61
return templatesQuery . data . filter ( ( template ) => {
62
- const workspacePermission = workspacePermissionsQuery . data [ template . organization_id ] ;
62
+ const workspacePermission =
63
+ workspacePermissionsQuery . data [ template . organization_id ] ;
63
64
return workspacePermission ?. createWorkspaceForUserID ;
64
65
} ) ;
65
66
} , [ templatesQuery . data , workspacePermissionsQuery . data ] ) ;
You can’t perform that action at this time.
0 commit comments