Skip to content
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

front: no specific error message when input is too long #5935

Closed
celine-sncf opened this issue Nov 30, 2023 · 9 comments · Fixed by #7920
Closed

front: no specific error message when input is too long #5935

celine-sncf opened this issue Nov 30, 2023 · 9 comments · Fixed by #7920
Assignees
Labels
area:front Work on Standard OSRD Interface modules difficulty:good first issue Good for newcomers kind:bug Something isn't working module:operational-studies Multi-train simulation with structured studies management severity:minor Minor severity bug

Comments

@celine-sncf
Copy link

What happened?

No specific error message when input is too long in "code service" or "code business" or "description" when creating a study, and in "name" and "description" when creating a scenario. Best to check all open fields just in case ?
image

What did you expect to happen?

I think the error message should look like this ?
image

How can we reproduce it (as minimally and precisely as possible)?

  1. go to études d'exploitation
  2. create study or scenario
  3. input long "code service" or "code business" or "description" or "name"
  4. watch the error message

What operating system, browser and environment are you using?

OSRD version (top right corner Account button > Informations)

staging 3df6fbc

@celine-sncf celine-sncf added kind:bug Something isn't working area:front Work on Standard OSRD Interface modules severity:minor Minor severity bug module:operational-studies Multi-train simulation with structured studies management labels Nov 30, 2023
@nicolaswurtz
Copy link
Contributor

I suggest to forbid more than 10 characters (more or less according to possible values of theses fields ?). So add a max={10} to input component. Easy peasy.

@clarani clarani added the difficulty:good first issue Good for newcomers label Jan 23, 2024
@SharglutDev
Copy link
Contributor

Current characters back breakpoints are 124 for codes and 1024 for description.

Waiting for a PO to give us max for each field.

@axrolld
Copy link
Contributor

axrolld commented Mar 5, 2024

Gotta ask how long those inputs can be, i'll ask and be right back to you when i have more info ! :)

@axrolld
Copy link
Contributor

axrolld commented Mar 5, 2024

For names & description, i suggest to stick to a number and have the same for projects, studies, and scenarios. The value should be big enough not to restrict the user in my opinion, especially now that we collapse & deal with long descriptions with ellipsis.

@axrolld
Copy link
Contributor

axrolld commented Mar 14, 2024

Just for fun:
image

@axrolld
Copy link
Contributor

axrolld commented Apr 3, 2024

10 characters should do ! Codes i've received are composed of 7. I think it's good to keep this small margin.

This is what it would look like with 8 and 10 characters :
image

@theocrsb theocrsb self-assigned this Jun 21, 2024
@flomonster
Copy link
Contributor

@flomonster I will give you the list of limits we have in the backend.

@flomonster
Copy link
Contributor

flomonster commented Jun 28, 2024

Limits

I hope I haven't forgotten anything

Note

How to read this. Each field has a length limits.

  • name: 128 means the name field has a limit of 128 chars (\0 included)
  • budget: i32::MAX means the budget is an interger on 32 bits so its max value is 2_147_483_647

Projects

  • name: 128
  • objectives: 4096
  • description: 1024
  • funders: 255
  • budget: i32
  • tags: no limit

Studies

  • name: 128
  • description: 1024
  • business_code: 128
  • service_code: 128
  • tags: no limit
  • budget: i32
  • state: 16

Scenarios

  • name: 128
  • description: 1024
  • tags: no limit

@theocrsb
Copy link
Contributor

theocrsb commented Jul 2, 2024

Thanks, I think it's just missing 'service_code' which has the same length limit as 'business_code'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:front Work on Standard OSRD Interface modules difficulty:good first issue Good for newcomers kind:bug Something isn't working module:operational-studies Multi-train simulation with structured studies management severity:minor Minor severity bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants