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

🐛 Update the TrackerStatus popover to handle long error messages #1079

Merged
merged 1 commit into from
Jul 5, 2023

Conversation

sjd78
Copy link
Member

@sjd78 sjd78 commented Jun 29, 2023

Since a Jira tracker "Not connected" error message can be an unlimited length, update the popover such that:

  • The width will be between 30em and 50em
  • The message height itself will be a maximum of 450px tall
  • Message content will overflow with scroll bars as needed
  • If the message is longer than 300 characters, an expandable toggle is added to the code block header to allow showing the message in full

These changes should allow long messages to be displayed in a reasonable way.

Resolves: #1067

@sjd78
Copy link
Member Author

sjd78 commented Jun 29, 2023

Screencap overview

screencast-localhost_9000-2023.06.29-17_55_05.mp4

Screenshots

Short error message:
screenshot-localhost_9000-2023 06 29-17_57_06

Long error message (the same one displayed in #1067 (comment)) initially displayed with truncated content:
screenshot-localhost_9000-2023 06 29-17_57_17

Long error message with expanded content (scrolled to the end of content):
screenshot-localhost_9000-2023 06 29-17_57_26

@mturley
Copy link
Collaborator

mturley commented Jun 30, 2023

Hmm, I wonder if we can do anything better than display the HTML to the user? we could clean it with something like sanitize-html and render it, but then we'd get a "Go to Jira home" link in it that we don't want the user to click. I guess any further parsing of that HTML means we're hard-coding assumptions about the response body from Jira. We could disallow/remove <a> tags when santizing? We could also just extract any text nodes (maybe excluding <a>) and render them in simple paragraphs instead of trying to render the given HTML structure.

Maybe nothing to be done, just thinking out loud

@sjd78
Copy link
Member Author

sjd78 commented Jun 30, 2023

Hmm, I wonder if we can do anything better than display the HTML to the user? we could clean it with something like sanitize-html and render it, but then we'd get a "Go to Jira home" link in it that we don't want the user to click. I guess any further parsing of that HTML means we're hard-coding assumptions about the response body from Jira. We could disallow/remove <a> tags when santizing? We could also just extract any text nodes (maybe excluding <a>) and render them in simple paragraphs instead of trying to render the given HTML structure.

Maybe nothing to be done, just thinking out loud

I'd rather have the backend save a meaningful erorr message instead of the full HTTP response when it encounters a 403 response code trying to connect to a service. I see this change as a stop-gap until the error message can make sense to an end user.

See #1067 (comment)

Since a "Not connected" error message can be an unlimited length,
update the popover such that:
  - The width will be between 30em and 50em
  - The message height itself will be a maximum of 450px tall
  - Message content will overflow with scroll bars as needed
  - If the message is longer than 300 characters, an expandable
    toggle is added to the code block header to allow showing the
    message in full

These changes should allow long messages to be displayed in a
reasonable way.

Signed-off-by: Scott J Dickerson <sdickers@redhat.com>
@sjd78 sjd78 force-pushed the fixup-tracker-status-popover branch from 50e00b6 to a4c5efd Compare June 30, 2023 20:55
@codecov
Copy link

codecov bot commented Jun 30, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (cd9ecaf) 46.91% compared to head (a4c5efd) 46.91%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1079   +/-   ##
=======================================
  Coverage   46.91%   46.91%           
=======================================
  Files         177      177           
  Lines        4442     4442           
  Branches     1027     1027           
=======================================
  Hits         2084     2084           
  Misses       2285     2285           
  Partials       73       73           
Flag Coverage Δ
unitests 46.91% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@mturley
Copy link
Collaborator

mturley commented Jul 1, 2023

Agreed, that would be better. Sounds good for a stopgap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Jira configuration: Not connected message needs adjustment
3 participants