Skip to content

Commit 7274152

Browse files
committed
fix: add missing descriptions to form elements in Ask component
1 parent e737969 commit 7274152

File tree

1 file changed

+4
-6
lines changed
  • plugins/plugin-codeflare/src/components

1 file changed

+4
-6
lines changed

Diff for: plugins/plugin-codeflare/src/components/Ask.tsx

+4-6
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,12 @@ export default class AskUI extends React.PureComponent<Props, State> {
139139
)
140140
}
141141

142-
private card(title: React.ReactNode, body: React.ReactNode) {
142+
private card(ask: Ask, body: React.ReactNode) {
143143
return (
144144
<Card isLarge isPlain className="sans-serif">
145145
<CardBody>
146146
<Hint actions={this.actions()} className="somewhat-larger-text">
147-
{title}
147+
<Markdown nested source={`### ${this.title(ask)}\n\n${ask.description || ""}`} />
148148
</Hint>
149149

150150
{body}
@@ -292,12 +292,10 @@ export default class AskUI extends React.PureComponent<Props, State> {
292292
children: mkOptions(),
293293
}
294294

295-
const title = <Markdown nested source={`### ${this.title(ask)}\n\n${ask.description || ""}`} />
296-
297295
return (
298296
<React.Fragment>
299297
<span id={titleId} hidden />
300-
{this.card(title, <Select {...props} />)}
298+
{this.card(ask, <Select {...props} />)}
301299
</React.Fragment>
302300
)
303301
}
@@ -318,7 +316,7 @@ export default class AskUI extends React.PureComponent<Props, State> {
318316
this._form = form
319317

320318
return this.card(
321-
this.title(ask),
319+
ask,
322320
<Form onSubmit={this._onFormSubmit} className="top-pad">
323321
<Grid hasGutter md={6}>
324322
{ask.prompt.choices.map((_) => (

0 commit comments

Comments
 (0)