@@ -127,11 +127,8 @@ const MonospaceDiv = styled.div`
127127const ReturnedRows = styled . div `
128128 font-size: 13px;
129129 line-height: 24px;
130- .limitMessage {
131- color: ${ ( { theme } ) => theme . colors . secondary . light1 } ;
132- margin-left: ${ ( { theme } ) => theme . gridUnit * 2 } px;
133- }
134130` ;
131+
135132const ResultSetControls = styled . div `
136133 display: flex;
137134 justify-content: space-between;
@@ -148,6 +145,19 @@ const ResultSetErrorMessage = styled.div`
148145 padding-top: ${ ( { theme } ) => 4 * theme . gridUnit } px;
149146` ;
150147
148+ const ResultSetRowsReturned = styled . span `
149+ white-space: nowrap;
150+ text-overflow: ellipsis;
151+ width: 100%;
152+ overflow: hidden;
153+ display: inline-block;
154+ ` ;
155+
156+ const LimitMessage = styled . span `
157+ color: ${ ( { theme } ) => theme . colors . secondary . light1 } ;
158+ margin-left: ${ ( { theme } ) => theme . gridUnit * 2 } px;
159+ ` ;
160+
151161const updateDataset = async (
152162 dbId : number ,
153163 datasetId : number ,
@@ -608,42 +618,38 @@ export default class ResultSet extends React.PureComponent<
608618 limitingFactor === LIMITING_FACTOR . DROPDOWN ;
609619
610620 if ( limitingFactor === LIMITING_FACTOR . QUERY && this . props . csv ) {
611- limitMessage = (
612- < span className = "limitMessage" >
613- { t (
614- 'The number of rows displayed is limited to %(rows)d by the query' ,
615- { rows } ,
616- ) }
617- </ span >
621+ limitMessage = t (
622+ 'The number of rows displayed is limited to %(rows)d by the query' ,
623+ { rows } ,
618624 ) ;
619625 } else if (
620626 limitingFactor === LIMITING_FACTOR . DROPDOWN &&
621627 ! shouldUseDefaultDropdownAlert
622628 ) {
623- limitMessage = (
624- < span className = "limitMessage" >
625- { t (
626- 'The number of rows displayed is limited to %(rows)d by the limit dropdown.' ,
627- { rows } ,
628- ) }
629- </ span >
629+ limitMessage = t (
630+ 'The number of rows displayed is limited to %(rows)d by the limit dropdown.' ,
631+ { rows } ,
630632 ) ;
631633 } else if ( limitingFactor === LIMITING_FACTOR . QUERY_AND_DROPDOWN ) {
632- limitMessage = (
633- < span className = "limitMessage" >
634- { t (
635- 'The number of rows displayed is limited to %(rows)d by the query and limit dropdown.' ,
636- { rows } ,
637- ) }
638- </ span >
634+ limitMessage = t (
635+ 'The number of rows displayed is limited to %(rows)d by the query and limit dropdown.' ,
636+ { rows } ,
639637 ) ;
640638 }
639+
640+ const rowsReturnedMessage = t ( '%(rows)d rows returned' , {
641+ rows,
642+ } ) ;
643+
644+ const tooltipText = `${ rowsReturnedMessage } . ${ limitMessage } ` ;
645+
641646 return (
642647 < ReturnedRows >
643648 { ! limitReached && ! shouldUseDefaultDropdownAlert && (
644- < span >
645- { t ( '%(rows)d rows returned' , { rows } ) } { limitMessage }
646- </ span >
649+ < ResultSetRowsReturned title = { tooltipText } >
650+ { rowsReturnedMessage }
651+ < LimitMessage > { limitMessage } </ LimitMessage >
652+ </ ResultSetRowsReturned >
647653 ) }
648654 { ! limitReached && shouldUseDefaultDropdownAlert && (
649655 < div ref = { this . calculateAlertRefHeight } >
@@ -678,6 +684,7 @@ export default class ResultSet extends React.PureComponent<
678684
679685 render ( ) {
680686 const { query } = this . props ;
687+ const limitReached = query ?. results ?. displayLimitReached ;
681688 let sql ;
682689 let exploreDBId = query . dbId ;
683690 if ( this . props . database && this . props . database . explore_database_id ) {
@@ -747,9 +754,17 @@ export default class ResultSet extends React.PureComponent<
747754 }
748755 if ( query . state === 'success' && query . results ) {
749756 const { results } = query ;
757+ // Accounts for offset needed for height of ResultSetRowsReturned component if !limitReached
758+ const rowMessageHeight = ! limitReached ? 32 : 0 ;
759+ // Accounts for offset needed for height of Alert if this.state.alertIsOpen
760+ const alertContainerHeight = 70 ;
761+ // We need to calculate the height of this.renderRowsReturned()
762+ // if we want results panel to be propper height because the
763+ // FilterTable component nedds an explcit height to render
764+ // react-virtualized Table component
750765 const height = this . state . alertIsOpen
751- ? this . props . height - 70
752- : this . props . height ;
766+ ? this . props . height - alertContainerHeight
767+ : this . props . height - rowMessageHeight ;
753768 let data ;
754769 if ( this . props . cache && query . cached ) {
755770 ( { data } = this . state ) ;
0 commit comments