Skip to content

Commit

Permalink
Adds coming soon (#333)
Browse files Browse the repository at this point in the history
Fixes #332
  • Loading branch information
paullewis authored and paulirish committed May 17, 2016
1 parent 4d2b462 commit ff2fcc7
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 4 deletions.
8 changes: 8 additions & 0 deletions report/styles/report.css
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,14 @@ a {
transform: translateX(96px);
}

.coming-soon, .coming-soon * {
color: #AAA;
}

.coming-soon .report-section__item-value {
font-size: 70%;
}

@media print {
.report {
box-shadow: none;
Expand Down
15 changes: 12 additions & 3 deletions report/templates/report.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,16 @@ <h1 class="report-section__subtitle">{{ aggregation.name }}</h1>

<ul class="report-section__individual-results">
{{#each aggregation.score.subItems as |subItem| }}
<li class="report-section__item">
<li class="report-section__item {{#if subItem.comingSoon}}coming-soon{{/if}}">
<div class="report-section__item-details">
<span class="report-section__item-description">
{{ subItem.description }}
{{#if subItem.optimalValue }}
(target value: {{ subItem.optimalValue }})
{{/if}}
{{#if subItem.comingSoon}}
(Coming soon)
{{/if}}
</span>
<span class="report-section__item-value report-section__item-value--{{ getItemRating subItem.value }}">{{ getItemValue subItem.value }}</span>
{{#if subItem.rawValue }}
Expand All @@ -121,13 +124,16 @@ <h1 class="report-section__subtitle">{{ @key }}</h1>

<ul class="report-section__individual-results">
{{#each this as |subItem| }}
<li class="report-section__item">
<li class="report-section__item {{#if subItem.comingSoon}}coming-soon{{/if}}">
<div class="report-section__item-details">
<span class="report-section__item-description">
{{ subItem.description }}
{{#if subItem.optimalValue }}
(target value: {{ subItem.optimalValue }} )
{{/if}}
{{#if subItem.comingSoon}}
(Coming soon)
{{/if}}
</span>
<span class="report-section__item-value report-section__item-value--{{ getItemRating subItem.value }}">{{ getItemValue subItem.value }}</span>
{{#if subItem.rawValue }}
Expand Down Expand Up @@ -157,13 +163,16 @@ <h1 class="report-section__title" id="best-practices">Best Practices</h1>

<ul class="report-section__individual-results">
{{#each aggregation.score.subItems as |subItem| }}
<li class="report-section__item">
<li class="report-section__item {{#if subItem.comingSoon}}coming-soon{{/if}}">
<div class="report-section__item-details">
<span class="report-section__item-description">
<!-- <span class="report-section__item-category">{{ subItem.category }}:</span> --> {{ subItem.description }}
{{#if subItem.optimalValue }}
(target: {{ subItem.optimalValue }})
{{/if}}
{{#if subItem.comingSoon}}
(Coming soon)
{{/if}}
</span>
<span class="report-section__item-value report-section__item-value--{{ getItemRating subItem.value }}">{{ getItemValue subItem.value aggregation.type.name }}</span>
{{#if subItem.rawValue }}
Expand Down
15 changes: 14 additions & 1 deletion src/aggregators/aggregate.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,21 @@ class Aggregate {
const subItems = [];
let overallScore = 0;

// Step through each item in the expected results, and
// Step through each item in the expected results
expectedNames.forEach(e => {
// TODO(paullewis): Remove once coming soon audits have landed.
if (expected[e].comingSoon) {
subItems.push({
value: String.raw`¯\_(ツ)_/¯`,
name: 'coming-soon',
category: expected[e].category,
description: expected[e].description,
comingSoon: true
});

return;
}

if (!filteredAndRemappedResults[e]) {
return;
}
Expand Down
40 changes: 40 additions & 0 deletions src/aggregators/best-practices/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,46 @@ class IsAccessible extends Aggregate {
weight: 0
};

criteria['serviceworker-push'] = {
value: true,
weight: 0,
comingSoon: true,
description: 'Service worker makes use of push notifications, if appropriate',
category: 'UX'
};

criteria['tap-targets'] = {
value: true,
weight: 0,
comingSoon: true,
description: 'Tap targets are appropriately sized for touch',
category: 'UX'
};

criteria['payments-autocomplete'] = {
value: true,
weight: 0,
comingSoon: true,
description: 'Payment forms marked up with [autocomplete] attributes',
category: 'UX'
};

criteria['login-autocomplete'] = {
value: true,
weight: 0,
comingSoon: true,
description: 'Login forms marked up with [autocomplete] attributes',
category: 'UX'
};

criteria['input-type'] = {
value: true,
weight: 0,
comingSoon: true,
description: 'Input fields use appropriate [type] attributes for custom keyboards',
category: 'UX'
};

return criteria;
}
}
Expand Down
8 changes: 8 additions & 0 deletions src/aggregators/can-load-offline/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ class WorksOffline extends Aggregate {
weight: 1
};

criteria['manifest-start-url'] = {
value: true,
weight: 0,
comingSoon: true,
description: 'Manifest\'s start_url is in cache storage for offline use',
category: 'Offline'
};

return criteria;
}
}
Expand Down
24 changes: 24 additions & 0 deletions src/aggregators/is-performant/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,30 @@ class IsPerformant extends Aggregate {
weight: 1
};

criteria['scrolling-60fps'] = {
value: true,
weight: 0,
comingSoon: true,
description: 'Content scrolls at 60fps',
category: 'UX'
};

criteria['touch-150ms'] = {
value: true,
weight: 0,
comingSoon: true,
description: 'Touch input gets a response in < 150ms',
category: 'UX'
};

criteria['fmp-no-jank'] = {
value: true,
weight: 0,
comingSoon: true,
description: 'App is interactive without jank after the first meaningful paint',
category: 'UX'
};

return criteria;
}
}
Expand Down

0 comments on commit ff2fcc7

Please sign in to comment.