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

materialItem: validate that quantity is greater than 0 #5579

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

BacLuc
Copy link
Contributor

@BacLuc BacLuc commented Jul 21, 2024

closes #5077

@BacLuc BacLuc marked this pull request as ready for review July 21, 2024 19:40
@BacLuc BacLuc requested a review from a team July 21, 2024 19:40
@BacLuc BacLuc force-pushed the disallow-negative-numbers branch from 06c7f0d to d31b8bd Compare July 21, 2024 19:42
@BacLuc BacLuc force-pushed the disallow-negative-numbers branch from d31b8bd to 0d235fe Compare July 21, 2024 19:46
@@ -110,6 +110,7 @@ class MaterialItem extends BaseEntity implements BelongsToCampInterface, CopyFro
* The number of items or the amount in the unit of items that are required.
*/
#[ApiProperty(example: 1.5)]
#[Assert\GreaterThan(0)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are there any implications for existing (now invalid) data?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, existing values with invalid content cannot be saved anymore until you make a valid value out of it

@@ -512,6 +512,7 @@
"copied": "{source} kopiert"
},
"validation": {
"greaterThan": "{_field_} muss grösser sein als {min}",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks not so great in the UI, can we improve this?
grafik

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a separate bug in firefox for all validations:
image
-> new issue

Copy link
Contributor Author

@BacLuc BacLuc Aug 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@usu usu added the deploy! Creates a feature branch deployment for this PR label Aug 6, 2024
Copy link

github-actions bot commented Aug 6, 2024

Feature branch deployment currently inactive.

If the PR is still open, you can add the deploy! label to this PR to trigger a feature branch deployment.

@BacLuc BacLuc requested a review from simfeld August 11, 2024 11:38
@BacLuc BacLuc added this pull request to the merge queue Aug 12, 2024
Merged via the queue into ecamp:devel with commit 1bf1f3d Aug 12, 2024
41 checks passed
@BacLuc BacLuc deleted the disallow-negative-numbers branch August 12, 2024 20:16
@BacLuc BacLuc mentioned this pull request Sep 10, 2024
@manuelmeister manuelmeister mentioned this pull request Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deploy! Creates a feature branch deployment for this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disallow negative numbers for MaterialItem quantity
4 participants