Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(site): Do not show template params if there is no param to be shown#7263

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
BrunoQuaresma merged 1 commit intomainfrombq/fix-empty-template-params
Apr 25, 2023
Merged
Changes fromall commits
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
37 changes: 19 additions & 18 deletionssite/src/pages/CreateWorkspacePage/CreateWorkspacePageView.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -135,6 +135,10 @@ export const CreateWorkspacePageView: FC<
})

const isLoading = props.loadingTemplateSchema || props.loadingTemplates
// We only want to show schema that have redisplay_value equals true
const schemaToBeDisplayed = props.templateSchema?.filter(
(schema) => schema.redisplay_value,
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

The linked bug ticket mentions that terraform values set tosensitive shouldn't appear in the UI. Does thesensitive key map toredisplay_value or is this something we have to check for separately?

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Yeap, it should do!


const getFieldHelpers = getFormHelpers<TypesGen.CreateWorkspaceRequest>(
form,
Expand DownExpand Up@@ -271,29 +275,26 @@ export const CreateWorkspacePageView: FC<
)}

{/* Template params */}
{props.templateSchema &&props.templateSchema.length > 0 && (
{schemaToBeDisplayed &&schemaToBeDisplayed.length > 0 && (
<FormSection
title="Template params"
description="These values are provided by your template's Terraform configuration."
>
<FormFields>
{props.templateSchema
// We only want to show schema that have redisplay_value equals true
.filter((schema) => schema.redisplay_value)
.map((schema) => (
<ParameterInput
disabled={form.isSubmitting}
key={schema.id}
defaultValue={parameterValues[schema.name]}
onChange={(value) => {
setParameterValues({
...parameterValues,
[schema.name]: value,
})
}}
schema={schema}
/>
))}
{schemaToBeDisplayed.map((schema) => (
<ParameterInput
disabled={form.isSubmitting}
key={schema.id}
defaultValue={parameterValues[schema.name]}
onChange={(value) => {
setParameterValues({
...parameterValues,
[schema.name]: value,
})
}}
schema={schema}
/>
))}
</FormFields>
</FormSection>
)}
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp