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

change: [M3-8290] - Improve experience of closing out of Support Ticket Dialog #10703

Merged

Conversation

mjac0bs
Copy link
Contributor

@mjac0bs mjac0bs commented Jul 23, 2024

Description 📝

Currently, when a user closes (but not cancels) out of the support ticket dialog, their ticket title and description are saved to local storage. No other field values are intentionally saved.

To provide a consistent experience, this PR saves all of the general support ticket form in local storage if a user closes out the dialog and repopulates them upon reopening the dialog. Currently, there is no way to close out of and then reopen a special support ticket type (smtp or accountLimit), since only a general support ticket can be created with the Open New Ticket button.

Additionally, we tag the Cancel and Close buttons with analytics to see which users are making more use of. The discrepancy in behavior between Cancel (clear form) and Close (store and reload data) behavior is intentional, but may be odd/unexpected, and we can consider improving the UX in the future.

Changes 🔄

  • Updates local storage to store additional fields for general support tickets.
  • Tags the Cancel and X buttons with analytics event.
  • Fixes a edge case bug where opening a general support ticket after starting, but closing out of an account limit support ticket (not submitting) would pre-populate the account limit support ticket title, instead of clearing that value for the new general ticket.

Preview 📷

Before After
prod.mov
this.branch.mov
Screenshot 2024-07-23 at 1 05 30 PM Screenshot 2024-07-23 at 12 52 40 PM

How to test 🧪

Prerequisites

(How to setup test environment)

  • Please test this on your dev account so we don't bother Customer Support with real tickets.
  • Turn the Support Ticket Severity flag on in devtools.

Reproduction steps

(How to reproduce the issue, if applicable)

  • Go to cloud.linode.com/support/tickets, fill out all fields of the support ticket form, including severity and an entity selection, and then hit the close (x) button.
  • Click the "Open New Ticket" button and observe that although the title and description are restored from data saved in local storage, the other values have been cleared.

Verification steps

(How to verify changes)
Please verify:

  • All general support ticket form values are stored in local storage when the user closes out of the dialog
  • These values are then repopulated when the dialog is reopened
  • There are no regressions in the Cancel behavior (all form fields are cleared) when this button is clicked
  • There are no crashes – we've fixed the issue where creating (and successfully submitting) one support ticket and then attempting to create another would crash the app
  • Analytics events are tagged on the close and cancel buttons
  • There are no regressions when viewing and then closing out of the form (or actually creating) support tickets of various types (smtp, accountLimit, general).

Important

Please let me know if you see any crashes or white screens. In working with this PR, I would occasionally see the screen go white and a console failure about loading the splashscreen. I couldn't reliably replicate it and assume it was related to local storage updates while I was making changes, but want to be sure it's not still happening now.

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

@mjac0bs mjac0bs self-assigned this Jul 23, 2024
}
};

const handleClose = () => {
props.onClose();
if (ticketType === 'smtp') {
if (ticketType !== 'general') {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed a small bug mentioned in the PR description. For accountLimit tickets, the drawer wasn't been reset properly when it was closed out.

Videos

Bug:

accountLimit.bug.mov

Fixed:

accountLimit.fix.mov

@mjac0bs mjac0bs marked this pull request as ready for review July 23, 2024 20:28
@mjac0bs mjac0bs requested a review from a team as a code owner July 23, 2024 20:28
@mjac0bs mjac0bs requested review from jaalah-akamai and AzureLatte and removed request for a team July 23, 2024 20:28
@mjac0bs mjac0bs force-pushed the M3-8290-improve-support-ticket-dialog-close branch from ae346b8 to 9f4cb29 Compare July 23, 2024 20:32
@mjac0bs mjac0bs requested a review from hana-akamai July 23, 2024 20:37
Copy link
Contributor

@jaalah-akamai jaalah-akamai left a comment

Choose a reason for hiding this comment

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

✅ Storage defaults and data are being stored properly
✅ Storage is reset when cancelled
✅ DIdn't notice any regressions in the experience after submitting multiple tickets
✅ Code changes look good to me

@mjac0bs
Copy link
Contributor Author

mjac0bs commented Jul 24, 2024

The unit test failure on BillingActivityPanel.test.tsx appears to repro consistently on this branch; the test passes in develop. 🤔 Looking into this...

@hana-akamai
Copy link
Contributor

hana-akamai commented Jul 24, 2024

@mjac0bs according to git bisect, the bad commit started a78ec2286aeddd7d4320d386a9ba734b023f13c6

@mjac0bs
Copy link
Contributor Author

mjac0bs commented Jul 24, 2024

@mjac0bs according to git bisect, the bad commit started a78ec2286aeddd7d4320d386a9ba734b023f13c6

Yeah, a78ec22 was where the real work was done for this PR.

I don't understand why any of it is affecting the billing access panel test, though. These changes should be unrelated. yarn cy:run -s "cypress/e2e/core/billing/*" all pass. @AzureLatte - any ideas on what's tripping up yarn test BillingActivityPanel where the test can't seem to find mock invoices in the table?

supportText: {
get: () => getStorage(SUPPORT, { description: '', title: '' }),
supportTicket: {
get: () => getStorage(SUPPORT, supportTicketStorageDefaults),
Copy link
Contributor

Choose a reason for hiding this comment

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

@mjac0bs I've narrowed it down to this line 🔍

Copy link
Contributor

Choose a reason for hiding this comment

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

This may be influencing the local storage behavior or interaction in ways that were not present before, potentially causing the test to fail.

Copy link
Contributor

Choose a reason for hiding this comment

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

Directly passing in the object from supportTicketStorageDefaults seems to fix things, but still figuring out what's going on here...

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok this is definitely (99% confidence 😅) due to how imports are handled in the test environment. When you import supportTicketStorageDefaults from another file, it might not be available or properly mocked during the test execution, causing the test to fail. My suggestion would be to move the definition of supportTicketStorageDefaults and export it from storage.ts.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My suggestion would be to move the definition of supportTicketStorageDefaults and export it from storage.ts

Done in 6c63947. I ran the unit tests repeatedly locally and didn't see any more unexpected failures or flake. Thank you for the investigation 🙏🏼 and good find!! 🔍 🙌🏼

Copy link
Contributor

Choose a reason for hiding this comment

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

Good to learn about this too! Thank you

Copy link

Coverage Report:
Base Coverage: 82.51%
Current Coverage: 82.5%

@mjac0bs mjac0bs added the Add'tl Approval Needed Waiting on another approval! label Jul 25, 2024
@hana-akamai hana-akamai added Approved Multiple approvals and ready to merge! and removed Add'tl Approval Needed Waiting on another approval! labels Jul 25, 2024
@mjac0bs mjac0bs merged commit 56fed23 into linode:develop Jul 25, 2024
19 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.

4 participants