-
Notifications
You must be signed in to change notification settings - Fork 55
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
fix(frontend): improve error handling for MaterialTable #3465
Changes from all commits
2e454fc
eea3827
c48a935
48b6146
4bf1098
b0f84e8
5a71d56
f4baba3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,6 @@ | |
ref="quantity" | ||
v-model="materialItem.quantity" | ||
dense | ||
vee-rules="numeric" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is that no longer useful? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Numeric only allows integer values. Our API allows float values. There's a built-in validation rule called "double" for float values. However, the "double" validation fails for empty values, which we explicitly allow. Because we already set the html attribute type="number", the validation is not really needed, because the user cannot enter anything else than numbers anyway. |
||
type="number" | ||
:name="$tc('entity.materialItem.fields.quantity')" | ||
fieldname="quantity" | ||
|
@@ -23,6 +22,7 @@ | |
dense | ||
:name="$tc('entity.materialItem.fields.unit')" | ||
fieldname="unit" | ||
maxlength="32" | ||
/> | ||
</td> | ||
<td> | ||
|
@@ -32,6 +32,7 @@ | |
vee-rules="required" | ||
:name="$tc('entity.materialItem.fields.article')" | ||
fieldname="article" | ||
maxlength="64" | ||
/> | ||
</td> | ||
<td :colspan="columns - 4"> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
INTERNAL_API_ROOT_URL=http://caddy:3000/api | ||
FRONTEND_URL=http://localhost:3000 | ||
SENTRY_PRINT_DSN= | ||
SENTRY_ENVIRONMENT=http://localhost:3000 | ||
SENTRY_ENVIRONMENT=local | ||
BROWSER_WS_ENDPOINT=ws://browserless:3000 | ||
PRINT_URL=http://print:3003 | ||
COOKIE_PREFIX=localhost_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not see directly in which case you needed this.
A test which covers this path would be nice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test added in f4baba3
Many symfony internal validators have violations messages that have a singular and a plural version. The
%count%
parameter needs to be provided to the translator such that it selects the right version:https://github.com/symfony/symfony/blob/6.3/src/Symfony/Contracts/Translation/TranslatorInterface.php#L22
https://github.com/symfony/symfony/blob/6.3/src/Symfony/Component/Validator/Violation/ConstraintViolationBuilder.php#L123
Without this adjustment, the output would be the following (both singular+plural version returned):