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

feat: [M3-7919] Add Fonoa tax id event notification on invalidation #10512

Merged
merged 16 commits into from
Jun 6, 2024

Conversation

jaalah-akamai
Copy link
Contributor

@jaalah-akamai jaalah-akamai commented May 23, 2024

Description 📝

To enhance our tax ID validation process, we've updated Cloud Manager to offer clearer guidance on these UX changes.

Changes 🔄

  • Non-US countries will display a helper text below the tax id input field
    • When this value changes, we display a toast alerting the user that their tax id is being validated
  • A new event tax_id_invalid is returned and emitted if the tax id is invalid.

Target release date 🗓️

6/10

Preview 📷

Desc Screenshot
Non-US Helper Text Screenshot 2024-05-23 at 12 35 29 PM
Event Notification / Event Page Screenshot 2024-05-23 at 12 12 36 PM Screenshot 2024-05-23 at 12 12 14 PM
Non-US Helper Text Screenshot 2024-05-24 at 11 06 19 AM

How to test 🧪

Prerequisites

  • If you want to test the events part of this, you'll need to setup DevEnv (see me about details)

Reproduction steps

Verification steps

  • Observe no helper text is visible and toast doesn't appear for US locations
  • For non-US countries, observe both helper text and toast when field if changed

As an Author I have considered 🤔

Check all that apply

  • 👀 Doing a self review
  • ❔ Our contribution guidelines
  • 🤏 Splitting feature into small PRs
  • ➕ Adding a changeset
  • 🧪 Providing/Improving test coverage
  • 🔐 Removing all sensitive information from the code and PR description
  • 🚩 Using a feature flag to protect the release
  • 👣 Providing comprehensive reproduction steps
  • 📑 Providing or updating our documentation
  • 🕛 Scheduling a pair reviewing session
  • 📱 Providing mobile support
  • ♿ Providing accessibility support

@@ -96,6 +96,7 @@ export const EVENT_ACTIONS: Event['action'][] = [
'subnet_create',
'subnet_delete',
'subnet_update',
'tax_id_invalid',
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 the only new action, all the others needed alphabetization

@@ -861,6 +861,9 @@ export const eventMessageCreators: { [index: string]: CreatorsForStatus } = {
tag_delete: {
notification: (e) => `Tag ${e.entity!.label} has been deleted.`,
},
tax_id_invalid: {
notification: (e) => `Tax Identification Number format is invalid.`,
},
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 the only new notification, all the others were just formatting done by eslint

Copy link
Contributor

Choose a reason for hiding this comment

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

You will need to rebase your PR cause there's been a whole lot of changes to this and this new event will need to be added to event messages V2. pls reach out if needs clarification

@jaalah-akamai jaalah-akamai marked this pull request as ready for review May 24, 2024 16:30
@jaalah-akamai jaalah-akamai requested review from a team as code owners May 24, 2024 16:30
@jaalah-akamai jaalah-akamai requested review from jdamore-linode, mjac0bs and carrillo-erik and removed request for a team May 24, 2024 16:30
@jaalah-akamai
Copy link
Contributor Author

@bnussman-akamai thanks for review, see: 0d23300

Copy link

github-actions bot commented May 30, 2024

Coverage Report:
Base Coverage: 82.29%
Current Coverage: 82.29%

Copy link
Contributor

@mjac0bs mjac0bs left a comment

Choose a reason for hiding this comment

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

I tested everything but the events/notifications. Generally, things looked good but I noticed a couple of edge cases:

  • Do we expect the US Virgin Islands and US Minor outlying islands have tax IDs?
    Screenshot 2024-06-03 at 8 12 14 AM

Screenshot 2024-06-03 at 8 13 09 AM

  • If a user lives in a country with a Tax ID and sets + saves that value, and then reopens the drawer to update their country to the United States of America, they will still see the Tax ID text field and, when submitting the form, also see the Tax ID show up in the saved Billing Contact section of the Account landing page. They will not see a toast upon form submission, though, as we'd expect.

Screenshot 2024-06-03 at 8 16 10 AM

Screenshot 2024-06-03 at 8 19 02 AM

And one UX question: did UX opt to place the helper text outside of a tooltip for visibility, even though it is long?

@bnussman-akamai
Copy link
Member

General question: I see we have an event for an invalid tax ID but nothing else. I'm curious as to why we didn't go for an account notification or a new endpoint/field. There is no way for us to know on the frontend if the event is still relevant/true

@jaalah-akamai
Copy link
Contributor Author

jaalah-akamai commented Jun 4, 2024

@mjac0bs

Do we expect the US Virgin Islands and US Minor outlying islands have tax IDs?

This is a good question! I proposed it to the team for an answer.

If a user lives in a country with a Tax ID and sets + saves that value, and then reopens the drawer to update their country to the United States of America, they will still see the Tax ID text field and, when submitting the form, also see the
Tax ID show up in the saved Billing Contact section of the Account landing page. They will not see a toast upon form submission, though, as we'd expect.

I believe this is expected if I'm understanding what you're saying correctly. If the country is the US, they will not see a toast indicating their tax id is being validated even if it's included in the POST.

Did UX opt to place the helper text outside of a tooltip for visibility, even though it is long?

Yea due to the fact that invalid or no tax ids (when required) will be caught and rejected at the time of initiating any B2C sales

@jaalah-akamai
Copy link
Contributor Author

jaalah-akamai commented Jun 4, 2024

@bnussman-akamai

I'm curious as to why we didn't go for an account notification or a new endpoint/field.

Spoke with API and we're going to improve this (transition to using /notifications) in a separate PR. We will also be able to add the additional UX invalid tax warning to the "Billing Contact" card. 👍 Great feedback

Copy link
Contributor

@mjac0bs mjac0bs 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 clarifying and checking on the US islands.

If a user lives in a country with a Tax ID and sets + saves that value, and then reopens the drawer to update their country to the United States of America, they will still see the Tax ID text field and, when submitting the form, also see the
Tax ID show up in the saved Billing Contact section of the Account landing page. They will not see a toast upon form submission, though, as we'd expect.

I believe this is expected if I'm understanding what you're saying correctly. If the country is the US, they will not see a toast indicating their tax id is being validated even if it's included in the POST.

If this is the case, then the UI can show another country's Tax ID beside a US address, which seems strange. I think a user would expect that, if they were to select a new country (or at least a country without Tax ID - i.e. US and maybe US islands) then the Tax ID text field would get cleared.

packages/manager/src/features/Account/utils.ts Outdated Show resolved Hide resolved
@@ -432,6 +432,7 @@ export const EventActionKeys = [
'subnet_update',
'tag_create',
'tag_delete',
'tax_id_invalid',
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 the only real change here

@jaalah-akamai
Copy link
Contributor Author

@mjac0bs I should have fixed the issue you pointed out

Copy link
Contributor

@mjac0bs mjac0bs left a comment

Choose a reason for hiding this comment

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

factory.test.tsx is failing because we no longer have a defined event message for the new event key tax_id_invalid. This looks like it will need a new factory for tax, as described here with "Tax Identification Number format is invalid." added as a message for this action.

image

Approving pending that is fixed and tests pass, as well as we get confirmation of whether the US Virgin and Minor Outlying Islands are not being validated for tax ids.
The clearing of the Tax ID field upon selection of another tax id is working as expected now.

@jaalah-akamai
Copy link
Contributor Author

I haven't received any information about US territories, so we'll proceed without that for now

@jaalah-akamai
Copy link
Contributor Author

This looks like it will need a new factory for tax, as described here with "Tax Identification Number format is invalid." added as a message for this action.

Thanks, I like the new way events are typed now 🎉

@jaalah-akamai jaalah-akamai added the Add'tl Approval Needed Waiting on another approval! label Jun 6, 2024
Copy link
Contributor

@abailly-akamai abailly-akamai left a comment

Choose a reason for hiding this comment

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

Approving pending a couple nits

packages/manager/src/dev-tools/FeatureFlagTool.tsx Outdated Show resolved Hide resolved
packages/manager/src/features/Events/factories/tax.tsx Outdated Show resolved Hide resolved
@abailly-akamai
Copy link
Contributor

Private User Image

fortunately new event messages will read better than this with the username separated from the message, cause this reads weird

@mjac0bs mjac0bs added Approved Multiple approvals and ready to merge! and removed Add'tl Approval Needed Waiting on another approval! Ready for Review labels Jun 6, 2024
@jaalah-akamai jaalah-akamai merged commit d4139ad into linode:develop Jun 6, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved Multiple approvals and ready to merge!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants