@@ -14,6 +14,10 @@ import { FC } from "react";
14
14
import { isApiValidationError } from "api/errors" ;
15
15
import { ErrorAlert } from "components/Alert/ErrorAlert" ;
16
16
import { WorkspaceBuildParameter } from "api/typesGenerated" ;
17
+ import { EmptyState } from "components/EmptyState/EmptyState" ;
18
+ import Button from "@mui/material/Button" ;
19
+ import OpenInNewOutlined from "@mui/icons-material/OpenInNewOutlined" ;
20
+ import { docs } from "utils/docs" ;
17
21
18
22
const WorkspaceParametersPage = ( ) => {
19
23
const workspace = useWorkspaceSettings ( ) ;
@@ -88,14 +92,36 @@ export const WorkspaceParametersPageView: FC<
88
92
) }
89
93
90
94
{ data ? (
91
- < WorkspaceParametersForm
92
- buildParameters = { data . buildParameters }
93
- templateVersionRichParameters = { data . templateVersionRichParameters }
94
- error = { submitError }
95
- isSubmitting = { isSubmitting }
96
- onSubmit = { onSubmit }
97
- onCancel = { onCancel }
98
- />
95
+ data . templateVersionRichParameters . length > 0 ? (
96
+ < WorkspaceParametersForm
97
+ buildParameters = { data . buildParameters }
98
+ templateVersionRichParameters = { data . templateVersionRichParameters }
99
+ error = { submitError }
100
+ isSubmitting = { isSubmitting }
101
+ onSubmit = { onSubmit }
102
+ onCancel = { onCancel }
103
+ />
104
+ ) : (
105
+ < EmptyState
106
+ message = "This workspace has no parameters"
107
+ cta = {
108
+ < Button
109
+ component = "a"
110
+ href = { docs ( "/templates/parameters" ) }
111
+ startIcon = { < OpenInNewOutlined /> }
112
+ variant = "contained"
113
+ target = "_blank"
114
+ rel = "noreferrer"
115
+ >
116
+ Learn more about parameters
117
+ </ Button >
118
+ }
119
+ css = { ( theme ) => ( {
120
+ border : `1px solid ${ theme . palette . divider } ` ,
121
+ borderRadius : theme . shape . borderRadius ,
122
+ } ) }
123
+ />
124
+ )
99
125
) : (
100
126
< Loader />
101
127
) }
0 commit comments