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

Snail when editing non-numeric characters on enterprise fees #8250

Closed
filipefurtad0 opened this issue Sep 27, 2021 · 7 comments · Fixed by #8308 or #9791
Closed

Snail when editing non-numeric characters on enterprise fees #8250

filipefurtad0 opened this issue Sep 27, 2021 · 7 comments · Fixed by #8308 or #9791
Assignees
Labels
bug-s4 The bug is annoying, but doesn't prevent from using the platform. Not so many users are impacted. good first issue hackathon Issues for upcoming hackathons

Comments

@filipefurtad0
Copy link
Contributor

filipefurtad0 commented Sep 27, 2021

Description

In all things similar to #6942 and #8249, but concerning enterprise fees.

Updating an enterprise fee can cause a server error when entering invalid values.

Expected Behavior

Invalid values should not be allowed or there should be a proper error message.

Actual Behaviour

It shows the snail.

Steps to Reproduce

  1. Edit an enterprise fee.
  2. Select the "per item" calculator.
  3. Enter '20.0' with the single quotes as fee amount.
  4. Click Update.

Animated Gif/Screenshot

Workaround

Severity

bug-s1: a critical feature is broken: checkout, payments, signup, login
bug-s2: a non-critical feature is broken, no workaround
bug-s3: a feature is broken but there is a workaround
bug-s4: it's annoying, but you can use it
bug-s5: we can live with it, only a few users impacted

https://github.com/openfoodfoundation/openfoodnetwork/wiki/Bug-severity

Your Environment

  • Version used: v4.1.2
  • Browser name and version: Firefox 92
  • Operating System and version (desktop or mobile): Ubuntu 20.04

Possible Fix

The only figures that should be allowed are:

  • numbers 0123456789
  • decimal point .
  • negative sign -

The error message should read:
Invalid input. Please use only numbers. For example: 10, 5.5, -20

See PR which introduces a fix for a similar issue, regarding transaction fees.

@filipefurtad0 filipefurtad0 added good first issue bug-s4 The bug is annoying, but doesn't prevent from using the platform. Not so many users are impacted. hackathon Issues for upcoming hackathons labels Sep 27, 2021
@filipefurtad0
Copy link
Contributor Author

PR #8308 adresses the flat percent per item calculator, however, this issue should remain open till the following calculators are addressed (ideally with specs smoke-testing/covering these 💪 ):

  • Flat Rate (per order)
  • Flexible Rate
  • Flate Rate (per Item)
  • Price Sack
  • Weight (per kg or lb)

@drummer83
Copy link
Contributor

Looking at Filipe's comment in #8308 , I think this was closed by accident. I can confirm, that there are still some snails to fight.

Summary

Payment methods are covered in #7841 and have been fixed in #8204, only weight calculator is still triggering the snail.
Shipping methods are covered in #8249 and have been addressed in #8312, but incomplete - should be reopened.
Enterprise fees are covered in #8250 and have been addressed in #8308, but incomplete - should be reopened.

Things left to do in this issue

This is the current status of the calculators:

  • flat percent --> OK
  • flat rate (per order) --> snail
  • flexible rate --> snail
  • flat rate (per item) --> snail
  • price sack --> snail
  • weight (per kg or lb) --> snail

Steps to Reproduce
As an Admin:

  • edit an enterprise fee
  • choose one of the calculators marked with "snail" above
  • click update
  • type in an invalid value (e.g. some text or numbers with comma as separator)
  • click update --> snail

I am reopening, but let me know if I am wrong.

@RachL
Copy link
Contributor

RachL commented Oct 14, 2022

Unless I'm wrong PR #8308 has fixed this. closing.

@RachL RachL closed this as completed Oct 14, 2022
@drummer83
Copy link
Contributor

You are wrong. 😉
See #8308 (comment).
Reopening.

@drummer83 drummer83 reopened this Oct 14, 2022
@RachL
Copy link
Contributor

RachL commented Oct 14, 2022

ok thanks, what was confusing is that this was in progress on the welcome new dev board

@vsmay98
Copy link

vsmay98 commented Oct 16, 2022

Hello @filipefurtad0 @drummer83
Can I work on this issue?

@drummer83
Copy link
Contributor

Sure @vsmay98! I have assigned it to you.
Maybe worth looking at the linked issues and their pull requests (if any).
Have fun! 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-s4 The bug is annoying, but doesn't prevent from using the platform. Not so many users are impacted. good first issue hackathon Issues for upcoming hackathons
Projects
4 participants