-
-
Notifications
You must be signed in to change notification settings - Fork 725
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
[CIty OFN Voucher]Fix VINE settings page #13015
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- As per the new changes, unit_type change will create a new product rather than give errors. - on bulk-update screen as well, two products can have same name with different unit_type
These were added a couple of years ago in openfoodfoundation#8763 But I guess we never noticed the names weren't getting anonymised. The old 'name' field is still in the DB. It was kept for compatibility during migraiton but never cleaned up. I've added the tech debt task to the welcome new devs board now: openfoodfoundation#8835
I couldn't fix it easily. But I also think that the testing approach had low value here. It raised: ``` Failures: 1) Map map can load does not show alert Failure/Error: assert_raises(Capybara::ModalNotFound) do accept_alert { visit '/map' } end Minitest::Assertion: Capybara::ModalNotFound expected but nothing was raised. [Screenshot Image]: /home/runner/work/openfoodnetwork/openfoodnetwork/tmp/capybara/screenshots/failures_r_spec_example_groups_map_map_can_load_does_not_show_alert_64.png # ./spec/system/consumer/map_spec.rb:11:in `block (3 levels) in <top (required)>' # ./spec/system/support/cuprite_setup.rb:39:in `block (2 levels) in <top (required)>' # ./spec/base_spec_helper.rb:153:in `block (3 levels) in <main>' # ./spec/base_spec_helper.rb:153:in `block (2 levels) in <main>' ```
This reverts commit 2d193a6.
This reverts commit 2eec3d6. We started tracking 404 errors out of interest without an actual problem to solve. Now we face rate-limiting in our Bugsnag account. And we didn't use these 404 reports in the two years this code was active. We don't even act on all 500 errors. So while our resources are so constrained, let's keep our focus on the severe errors and user reports and ignore the rest. 404 errors are mostly generated by vulnerability scanners.
Needs human to review Bugsnag account.
Bugsnag expects a string as value, not an ActiveRecord object. The result was just "filtered" data, not showing any of the order's attributes. Since wanting to share the order data seems a common pattern, I added a convenience method for it.
I still think that some of these objects won't be visible in Bugsnag but I don't want to test any more on cases that were broken before and may not be relevant now.
Somehow Bugsnag doesn't report in CI environment and I have no idea how to circumvent that. And I don't want to spend more time on this.
It is used to validate a voucher using the given short code
It handles validating and creating vine voucher
Plus specs
It is used to redeem a voucher
And small refactor
It handles redeeming a voucher
'Spree::Payment#capture_and_complete!' will try to complete the order, so we want to redeem any VINE voucher associated with the order first.
Move them under Vine module to keep the code nicely organised
- use IS DISTINCT FROM instead of two conditions - added spec for scope
A Vine voucher is really a specific type of FlatRate voucher but because a Vine voucher can be used by mutiple enterprise, it can be considered different enough to warrant it's own class. It still share a lot of the behaviour of a FlatRate voucher, so to avoid duplication, all the shared functionality have been moved to a Vouchers::FlatRatable concern.
Description is now hidden when the enterprise is connected to VINE
rioug
force-pushed
the
13006-fix-VINE-setting
branch
from
December 3, 2024 04:45
125cd0c
to
404f9e8
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What? Why?
Split the description and link to VINE in two translatable string. Description is now hidden when an enterprise is connected to VINE.
What should we test?
Release notes
Changelog Category (reviewers may add a label for the release notes):
The title of the pull request will be included in the release notes.