Skip to content

Commit

Permalink
Merge pull request #1256 from nyaruka/set_run_result_limits
Browse files Browse the repository at this point in the history
Make char limits on result name and category on `set_run_result` actions consistent with routers
  • Loading branch information
rowanseymour authored Dec 2, 2024
2 parents 3adaf44 + cad83f7 commit 2c8fa3e
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);

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 2c8fa3e

Please sign in to comment.