Skip to content

Commit

Permalink
Resolve post rebase artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
alexnj committed Jan 18, 2023
1 parent 8cf66c8 commit 715a728
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 10 deletions.
1 change: 1 addition & 0 deletions core/lib/entity-classification.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ async function getEntityClassification(artifacts, context) {
const shortEntity = {
name: entity.name,
homepage: entity.homepage,
category: entity.category,
};

// Reduce payload size in LHR JSON by omitting whats falsy.
Expand Down
12 changes: 8 additions & 4 deletions core/test/fixtures/fraggle-rock/reports/sample-flow-result.json
Original file line number Diff line number Diff line change
Expand Up @@ -1676,7 +1676,8 @@
"key": "startTime",
"valueType": "ms",
"granularity": 1,
"label": "Start Time"
"label": "Start Time",
"dontAggregate": true
},
{
"key": "duration",
Expand Down Expand Up @@ -8705,7 +8706,8 @@
"key": "startTime",
"valueType": "ms",
"granularity": 1,
"label": "Start Time"
"label": "Start Time",
"dontAggregate": true
},
{
"key": "duration",
Expand Down Expand Up @@ -8845,7 +8847,8 @@
"key": "cacheLifetimeMs",
"valueType": "ms",
"label": "Cache TTL",
"displayUnit": "duration"
"displayUnit": "duration",
"dontAggregate": true
},
{
"key": "totalBytes",
Expand Down Expand Up @@ -17335,7 +17338,8 @@
"key": "startTime",
"valueType": "ms",
"granularity": 1,
"label": "Start Time"
"label": "Start Time",
"dontAggregate": true
},
{
"key": "duration",
Expand Down
6 changes: 4 additions & 2 deletions core/test/results/sample_v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -2396,7 +2396,8 @@
"key": "startTime",
"valueType": "ms",
"granularity": 1,
"label": "Start Time"
"label": "Start Time",
"dontAggregate": true
},
{
"key": "duration",
Expand Down Expand Up @@ -3675,7 +3676,8 @@
"key": "cacheLifetimeMs",
"valueType": "ms",
"label": "Cache TTL",
"displayUnit": "duration"
"displayUnit": "duration",
"dontAggregate": true
},
{
"key": "totalBytes",
Expand Down
2 changes: 1 addition & 1 deletion report/renderer/components.js

Large diffs are not rendered by default.

11 changes: 8 additions & 3 deletions report/renderer/details-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ export class DetailsRenderer {
/**
* @param {DOM} dom
* @param {{
* fullPageScreenshot?: LH.Audit.Details.FullPageScreenshot,
* entityClassification?: LH.Audit.Details.EntityClassification,
* fullPageScreenshot?: LH.Result.FullPageScreenshot,
* entityClassification?: LH.Result.EntityClassification,
* }} [options]
*/
constructor(dom, options = {}) {
Expand Down Expand Up @@ -389,7 +389,12 @@ export class DetailsRenderer {
renderedRows[0]?.classList.add('lh-row--group');

const entityName = group.entity?.toString() || '';
const matchedEntity = this._entityClassification?.entities[entityName];
const entityIndex = this._entityClassification?.nameLUT[entityName];
/** @type {LH.Result.Entity|undefined} */
let matchedEntity;
if (typeof entityIndex !== 'undefined') {
matchedEntity = this._entityClassification?.entities[entityIndex];
}

if (matchedEntity?.category) {
const categoryChipEl = this._dom.createElement('span');
Expand Down

0 comments on commit 715a728

Please sign in to comment.