Skip to content

feat: mark coder_parameter as "required" #6433

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 21 commits into from
Mar 7, 2023
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
Use HTML API to mark fields required
  • Loading branch information
mtojek committed Mar 6, 2023
commit 60ffd8639365c1cfa0055280dde6fd6460df15c2
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ const RichParameterField: React.FC<RichParameterInputProps> = ({
type={parameter.type}
size="small"
disabled={disabled}
required={parameter.required}
placeholder={parameter.default_value}
value={parameterValue}
onChange={(event) => {
Expand Down
1 change: 0 additions & 1 deletion site/src/i18n/en/workspaceBuildParametersPage.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"title": "Workspace build parameters",
"detail": "Those values were provided by the workspace owner.",
"noParametersDefined": "This template does not use any rich parameters.",
"validationRequiredParameter": "Parameter is required.",
"validationNumberNotInRange": "Value must be between {{min}} and {{max}}.",
"validationPatternNotMatched": "{{error}} (value does not match the pattern {{pattern}}).",
"updateWorkspace": "Update workspace",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,6 @@ export const ValidationSchemaForRichParameters = (
Yup.object().shape({
name: Yup.string().required(),
value: Yup.string()
.required(t("validationRequiredParameter"))
.test("verify with template", (val, ctx) => {
const name = ctx.parent.name
const templateParameter = templateParameters.find(
Expand Down