Skip to content

Commit

Permalink
[MM-1028]: Fixed the issue of title being truncated without ellipses …
Browse files Browse the repository at this point in the history
…in tooltip modal (#1123)

* [MM-1028]: Fixed the issue of title being truncated without ellipses in tooltip modal

* [MM-1028]: Updated the handling of jira summary in tooltip

* [MM-1028]: review fixes

* [MM-1028]: Added hover text to tooltip title
  • Loading branch information
Kshitij-Katiyar authored Nov 12, 2024
1 parent dc1f1e2 commit b54d4c6
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,11 @@ export default class TicketPopover extends React.PureComponent<Props, State> {
}

const {ticketDetails} = this.state;

// Format the ticket summary by trimming spaces, replacing multiple spaces with one, truncating to `jiraTicketSummaryMaxLength`, and adding '...' if it exceeds the limit.
const formattedSummary = ticketDetails?.summary ? `${ticketDetails.summary.trim().split(/\s+/).join(' ')
.substring(0, jiraTicketSummaryMaxLength)}${ticketDetails.summary.trim().split(/\s+/).join(' ').length > jiraTicketSummaryMaxLength ? '...' : ''}` : '';

if (!ticketDetails) {
// Display the spinner loader while ticket details are being fetched
return (
Expand Down Expand Up @@ -204,9 +209,10 @@ export default class TicketPopover extends React.PureComponent<Props, State> {
<a
href={this.props.href}
target='_blank'
title={ticketDetails?.summary}
rel='noopener noreferrer'
>
<h5>{ticketDetails.summary && ticketDetails.summary.substring(0, jiraTicketSummaryMaxLength)}</h5>
<h5>{formattedSummary}</h5>
</a>
{this.tagTicketStatus(ticketDetails.statusKey)}
</div>
Expand Down

0 comments on commit b54d4c6

Please sign in to comment.