Skip to content

Commit

Permalink
feat: lighthouse_all метрика по всем оценкам
Browse files Browse the repository at this point in the history
  • Loading branch information
popstas committed Nov 15, 2018
1 parent e6d6534 commit a640a04
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ export default {
'prod',
'engine',
'errors',
'lighthouse_all',
'lighthouse_performance',
'lighthouse_pwa',
'lighthouse_accessibility',
Expand Down Expand Up @@ -541,7 +542,7 @@ export default {
getColumnValidateClass(props, domain, column) {
const site = this.filteredSites.find(site => site.domain == domain);
let result;
if (!site || !site.tests) return '';
if (!site) return '';
// пустые не валидируются
if([undefined, ''].indexOf(site[column]) !== -1) return '';
Expand Down Expand Up @@ -599,17 +600,22 @@ export default {
lighthouse_seo: {
warn: { min: 50, max: 79 },
error: { max: 50 }
},
lighthouse_all: {
warn: { min: 50, max: 79 },
error: { max: 50 }
}
};
// проверка на соответствие из массива
if (column in validateMap) {
const r = validateMap[column];
if ('error' in r && isFits(site[column], r.error)) result = 'fail';
else if ('warn' in r && isFits(site[column], r.warn)) result = 'warn';
else result = 'pass';
}
if (!result) {
if (!result && site.tests) {
const test = site.tests.find(test => test.name == column);
if (!test || !test.valid) return '';
result = test.valid;
Expand Down

0 comments on commit a640a04

Please sign in to comment.