Skip to content

Do not allow spaces in external billing #13081

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

Conversation

pacodelaluna
Copy link
Contributor

@pacodelaluna pacodelaluna commented Jan 19, 2025

⚠️ when working on this use #12942 Invoicing ID clockify code

What? Why?

I forgot to add a basic validation on the external_billing_id field on my last PR.

What should we test?

  • Visit an enterprise page as superadmin
  • Try to change the External Billing Id field on Primary Details tab
  • Verify that adding a space on the value is failing the form submission

Release notes

  • Do not allow spaces in external billing id on enterprises

Changelog Category (reviewers may add a label for the release notes):

  • User facing changes
  • API changes (V0, V1, DFC or Webhook)
  • Technical changes only
  • Feature toggled

@pacodelaluna pacodelaluna force-pushed the do-not-allow-spaces-in-external-billing-id branch from dbb2515 to 39825a9 Compare January 19, 2025 19:57
@rioug rioug added the user facing changes Thes pull requests affect the user experience label Jan 20, 2025
Copy link
Collaborator

@rioug rioug left a comment

Choose a reason for hiding this comment

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

Can you address the rubocop warning ?

@pacodelaluna
Copy link
Contributor Author

@rioug I have requested the merge of the last master changes, and it seems that the Rubocop warning is gone, but now I have a test failing, it seems to be a flaky one. Do you know waht to do in this case? Can I trigger the checks without pushing a commit?

@rioug
Copy link
Collaborator

rioug commented Jan 27, 2025

Can I trigger the checks without pushing a commit?

On your fork you should be able to, but probably not in the OFN repo, but I can :) All good now, thanks !

Copy link
Collaborator

@rioug rioug left a comment

Choose a reason for hiding this comment

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

Looks good 👍

@sigmundpetersen
Copy link
Contributor

Hey @pacodelaluna , how are you 👋
Did you want to continue on this?

@pacodelaluna
Copy link
Contributor Author

Hey @pacodelaluna , how are you 👋 Did you want to continue on this?

Hi @sigmundpetersen, yes sorry, I was quite busy lately, I will take a look at this asap.

@pacodelaluna pacodelaluna force-pushed the do-not-allow-spaces-in-external-billing-id branch from baf8905 to 243d81c Compare April 9, 2025 21:21
@rioug rioug moved this from In Progress ⚙ to Code review 🔎 in OFN Delivery board Apr 13, 2025
Copy link
Collaborator

@rioug rioug left a comment

Choose a reason for hiding this comment

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

Thanks for updating the regexp, could you add test to make sure the regexp is doing what we want ?

@github-project-automation github-project-automation bot moved this from Code review 🔎 to In Progress ⚙ in OFN Delivery board Apr 14, 2025
@pacodelaluna
Copy link
Contributor Author

@rioug I have added 2 tests for the new validation, please tell me if it is fine.

@rioug rioug moved this from In Progress ⚙ to Code review 🔎 in OFN Delivery board Apr 21, 2025
@rioug
Copy link
Collaborator

rioug commented Apr 22, 2025

Looks good, thanks for adding the test !

@rioug rioug moved this from Code review 🔎 to Test Ready 🧪 in OFN Delivery board Apr 22, 2025
@filipefurtad0 filipefurtad0 self-assigned this Apr 23, 2025
@filipefurtad0 filipefurtad0 added the pr-staged-fr staging.coopcircuits.fr label Apr 23, 2025
@filipefurtad0
Copy link
Contributor

Hey @pacodelaluna ,

I've tested the superadmin field External Billing ID, and tried to introduce white spaces. Doing so, triggers this validation error:

Image

And does not change the previously introduced data, so that the ID remains without spaces. I've tested this for empty spaces in the:

  • beginning of the ID: CU2412-00005
  • middle of the ID: CU2412 00005
  • end of the ID: CU2412_00005

Also tested removing the ID completely (deleting it), which is possible and works as before. Noticed though, that the report does not display none, as for other hubs, after a previously saved ID is deleted (notice the empty space on the column below):

Image

This is not introduced by this PR. So, with the validation you've introduced, we can be sure that the ID does not have empty spaces 🎉

Merging.

@filipefurtad0 filipefurtad0 merged commit 07842bf into openfoodfoundation:master Apr 23, 2025
35 checks passed
@github-project-automation github-project-automation bot moved this from Test Ready 🧪 to Done in OFN Delivery board Apr 23, 2025
@filipefurtad0 filipefurtad0 removed the pr-staged-fr staging.coopcircuits.fr label Apr 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
user facing changes Thes pull requests affect the user experience
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Don't allow spaces in external billing id
5 participants