Skip to content

Commit

Permalink
Make char limits on result name and category on set_run_result action…
Browse files Browse the repository at this point in the history
…s be consistent with routers
  • Loading branch information
rowanseymour committed Dec 2, 2024
1 parent 3adaf44 commit cad83f7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ export default class SetRunResultForm extends React.PureComponent<
}

private handleCreateAssetFromInput(input: string): Asset {
// workaround for the lack of a length limit on the form itself
input = input.substring(0, 64);

Check warning on line 116 in src/components/flow/actions/setrunresult/SetRunResultForm.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/flow/actions/setrunresult/SetRunResultForm.tsx#L116

Added line #L116 was not covered by tests

return {
id: snakify(input),
name: input,
Expand Down Expand Up @@ -173,7 +176,7 @@ export default class SetRunResultForm extends React.PureComponent<
onChange={this.handleCategoryUpdate}
entry={this.state.category}
autocomplete={false}
maxLength={128}
maxLength={36}
helpText={i18n.t(
'forms.result_category_help',
"An optional category for your result. For age, the value might be 17, but the category might be 'Young Adult'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ exports[`SetRunResultForm render should render 1`] = `
}
}
helpText="An optional category for your result. For age, the value might be 17, but the category might be 'Young Adult'"
maxLength={128}
maxLength={36}
name="Category"
onChange={[Function]}
placeholder="Optional"
Expand Down

0 comments on commit cad83f7

Please sign in to comment.