Changeset 247168 in webkit
- Timestamp:
- Jul 5, 2019 12:19:28 PM (5 years ago)
- Location:
- trunk/Websites/perf.webkit.org
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Websites/perf.webkit.org/ChangeLog
r246847 r247168 1 2019-07-03 Dewei Zhu <dewei_zhu@apple.com> 2 3 Test freshness page should expose revision information for latest build on tooltip. 4 https://bugs.webkit.org/show_bug.cgi?id=199483 5 6 Reviewed by Ryosuke Niwa. 7 8 Added latest build revision information on test freshness page tooltip. 9 10 * public/v3/pages/test-freshness-page.js: Add build revision information on tooltip. 11 (TestFreshnessPage.prototype.didConstructShadowTree): 12 (TestFreshnessPage.prototype._fetchTestResults): 13 (TestFreshnessPage.prototype.render): 14 (TestFreshnessPage.prototype._renderTooltip): 15 (TestFreshnessPage.cssTemplate): 16 1 17 2019-06-26 Dewei Zhu <dewei_zhu@apple.com> 2 18 -
trunk/Websites/perf.webkit.org/public/v3/pages/test-freshness-page.js
r243123 r247168 20 20 didConstructShadowTree() 21 21 { 22 const tooltip Container = this.content('tooltip-container');23 tooltip Container.addEventListener('mouseenter', () => {22 const tooltipTable = this.content('tooltip-table'); 23 tooltipTable.addEventListener('mouseenter', () => { 24 24 this._hoveringTooltip = true; 25 25 this.enqueueToRender(); 26 26 }); 27 tooltip Container.addEventListener('mouseleave', () => {27 tooltipTable.addEventListener('mouseleave', () => { 28 28 this._hoveringTooltip = false; 29 29 this.enqueueToRender(); … … 90 90 91 91 let timeForLatestBuild = startTime; 92 let lastBuild Link= null;92 let lastBuild = null; 93 93 let builder = null; 94 let commitSetOfLastPoint = null; 94 95 const lastPoint = currentTimeSeries.lastPoint(); 95 96 if (lastPoint) { … … 102 103 if (build.buildTime().getTime() >= timeForLatestBuild) { 103 104 timeForLatestBuild = build.buildTime().getTime(); 104 lastBuild Link = build.url();105 lastBuild = build; 105 106 builder = build.builder(); 106 107 } 107 108 } 109 commitSetOfLastPoint = lastPoint.commitSet(); 108 110 } 109 111 110 112 lastDataPointByMetric.set(metric, {time: timeForLatestBuild, hasCurrentDataPoint: !!lastPoint, 111 lastBuild Link, builder});113 lastBuild, builder, commitSetOfLastPoint}); 112 114 this.enqueueToRender(); 113 115 }); … … 123 125 124 126 let buildSummaryForCurrentlyHighlightedIndicator = null; 125 let buildLinkForCurrentlyHighlightedIndicator = null; 127 let buildForCurrentlyHighlightedIndicator = null; 128 let commitSetForCurrentHighlightedIndicator = null; 126 129 const builderForCurrentlyHighlightedIndicator = this._currentlyHighlightedIndicator ? this._builderByIndicator.get(this._currentlyHighlightedIndicator) : null; 127 130 for (const [platform, lastDataPointByMetric] of this._lastDataPointByConfiguration.entries()) { … … 137 140 if (this._currentlyHighlightedIndicator && this._currentlyHighlightedIndicator === indicator) { 138 141 buildSummaryForCurrentlyHighlightedIndicator = summary; 139 buildLinkForCurrentlyHighlightedIndicator = lastDataPoint.lastBuildLink; 142 buildForCurrentlyHighlightedIndicator = lastDataPoint.lastBuild; 143 commitSetForCurrentHighlightedIndicator = lastDataPoint.commitSetOfLastPoint; 140 144 } 141 145 this._builderByIndicator.set(indicator, lastDataPoint.builder); … … 143 147 } 144 148 } 145 this._renderTooltipLazily.evaluate(this._currentlyHighlightedIndicator, this._hoveringTooltip, buildSummaryForCurrentlyHighlightedIndicator, build LinkForCurrentlyHighlightedIndicator);146 } 147 148 _renderTooltip(indicator, hoveringTooltip, buildSummary, build Link)149 this._renderTooltipLazily.evaluate(this._currentlyHighlightedIndicator, this._hoveringTooltip, buildSummaryForCurrentlyHighlightedIndicator, buildForCurrentlyHighlightedIndicator, commitSetForCurrentHighlightedIndicator); 150 } 151 152 _renderTooltip(indicator, hoveringTooltip, buildSummary, build, commitSet) 149 153 { 150 154 if (!indicator || !buildSummary) { 151 this.content('tooltip- container').style.display = hoveringTooltip ? null : 'none';155 this.content('tooltip-table').style.display = hoveringTooltip ? null : 'none'; 152 156 return; 153 157 } 154 158 const element = ComponentBase.createElement; 159 const link = ComponentBase.createLink; 155 160 156 161 const rect = indicator.element().getBoundingClientRect(); 157 const tooltip Container = this.content('tooltip-container');158 tooltip Container.style.display = null;159 160 const tooltipContainerComputedStyle = getComputedStyle(tooltip Container);162 const tooltipTable = this.content('tooltip-table'); 163 tooltipTable.style.display = null; 164 165 const tooltipContainerComputedStyle = getComputedStyle(tooltipTable); 161 166 const containerMarginTop = parseFloat(tooltipContainerComputedStyle.paddingTop); 162 167 const containerMarginLeft = parseFloat(tooltipContainerComputedStyle.marginLeft); 163 168 164 tooltipContainer.style.position = 'absolute'; 165 tooltipContainer.style.top = rect.top - (tooltipContainer.offsetHeight + containerMarginTop) + 'px'; 166 tooltipContainer.style.left = rect.left + rect.width / 2 - tooltipContainer.offsetWidth / 2 + containerMarginLeft + 'px'; 167 168 this.renderReplace(tooltipContainer, [element('p', buildSummary), buildLink ? element('a', {href: buildLink}, 'Latest Build') : []]); 169 tooltipTable.style.position = 'absolute'; 170 tooltipTable.style.top = rect.top - (tooltipTable.offsetHeight + containerMarginTop) + 'px'; 171 tooltipTable.style.left = rect.left + rect.width / 2 - tooltipTable.offsetWidth / 2 + containerMarginLeft + 'px'; 172 173 let tableContent = [element('tr', element('td', {colspan: 2}, buildSummary))]; 174 if (commitSet.repositories().length) 175 tableContent.push(element('tr', element('th', {colspan: 2}, 'Latest build information'))); 176 177 tableContent.push(Repository.sortByNamePreferringOnesWithURL(commitSet.repositories()).map((repository) => { 178 const commit = commitSet.commitForRepository(repository); 179 return element('tr', [ 180 element('td', repository.name()), 181 element('td', commit.url() ? link(commit.label(), commit.label(), commit.url(), true) : commit.label()) 182 ]); 183 })); 184 185 if (build) { 186 const url = build.url(); 187 const buildNumber = build.buildNumber(); 188 tableContent.push(element('tr', [ 189 element('td', 'Build'), 190 element('td', {colspan: 2}, [ 191 url ? link(buildNumber, build.label(), url, true) : buildNumber 192 ]), 193 ])); 194 } 195 196 this.renderReplace(tooltipTable, tableContent); 169 197 } 170 198 … … 218 246 static htmlTemplate() 219 247 { 220 return `<section class="page-with-heading">< div id="tooltip-container"></div><table id="test-health"></table></section>`;248 return `<section class="page-with-heading"><table id="tooltip-table"></table><table id="test-health"></table></section>`; 221 249 } 222 250 … … 309 337 border-top: calc(1.6rem - 1px) solid transparent; 310 338 } 311 #tooltip- container{339 #tooltip-table { 312 340 width: 22rem; 313 height: 2rem;314 341 background-color: #34495E; 315 342 opacity: 0.9; … … 319 346 z-index: 1; 320 347 text-align: center; 321 } 322 #tooltip-container::after { 348 display: inline-table; 349 color: white; 350 } 351 #tooltip-table td { 352 overflow: hidden; 353 max-width: 22rem; 354 text-overflow: ellipsis; 355 } 356 #tooltip-table::after { 323 357 content: " "; 324 358 position: absolute; … … 330 364 border-color: #34495E transparent transparent transparent; 331 365 } 332 #tooltip-container p { 333 color: white; 334 margin: 0; 335 } 336 #tooltip-container a { 366 #tooltip-table a { 337 367 color: #B03A2E; 338 368 font-weight: bold;
Note: See TracChangeset
for help on using the changeset viewer.