-
Notifications
You must be signed in to change notification settings - Fork 361
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
M3-5988: Add SMTP restriction support ticket form #8636
Merged
mjac0bs
merged 14 commits into
linode:develop
from
mjac0bs:M3-5988-SMTP-support-ticket-create-form
Dec 12, 2022
Merged
Changes from 12 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
f461d90
WIP to display SMTP support ticket form
mjac0bs 9057af3
Use prefilled ticketType to render SMTP fields
mjac0bs e9eac90
Expand width of form fields; minor code clean up
mjac0bs b6fd533
Display helperText depending on ticket type
mjac0bs 89fb91b
Remove stray comment for unused field
mjac0bs 04820d8
Submit form with SMTP fields in ticket description
mjac0bs 6b4ca05
Address demo prep feedback on description markdown
mjac0bs ca92272
Fix truncated description due to async state update
mjac0bs 798e3bd
Cleanup
mjac0bs 2317c1c
Address demo feedback
mjac0bs 805d379
Address code cleanup feedback
mjac0bs c64e6f9
Fix bug preventing submit; add entity to ticket
mjac0bs 5860129
Clear SMTP desc from localstorage on any form close
mjac0bs 164ac26
Only update description state for general ticketType
mjac0bs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this might be the culprit for why smtp fields are displaying in the desc for normal support tickets. If I comment this out and clear my application storage, the desc is no longer filled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe only format the description on submission and not on every change would be a fix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, so there is different behavior for the dialog based on how the user cancels it, as documented in this PR:
ticketType
, it was saving that description to local storage and then repopulating it for a normal ticket's description.Agreed, it would be best to only format the custom fields -> description
onSubmit
rather than on each update to the SMTP fields… but sinceonSubmit
's call tocreateSupportTicket
needs a description param, we're expecting to usedescription
from state. If we format and attempt a final state update withsetDescription
on submission, the update may not happen before the ticket is created. Always open to suggestions or ideas I've missed, but the latest commit conditionally checkingticketType
in theclose
function should address this bug by clearingdescription
for SMTP tickets.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disregard the last bit of above ^^ Formatting of the description now only occurs on submission, with an adjustment to the logic that toggles the boolean controlling the submit button from disabled to enabled.
I left the conditional checking
ticketType
inclose()
in order to always clear the title of the SMTP ticket when the form is closed out. Note: there is still an edge case when a form title can repopulate in a new support ticket's title field if the user was first redirected tosupport/tickets
with any support ticket having a prefilled title. This behavior exists in prod and predates the SMTP form addition.