Skip to content

Commit

Permalink
fix: yes/no in table stats for boolean fields
Browse files Browse the repository at this point in the history
  • Loading branch information
popstas committed Aug 26, 2020
1 parent e07b95a commit 8214c0c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ Demo:
- [Default report](https://viasite.github.io/site-audit-seo-viewer/?url=https://site-audit.viasite.ru/reports/blog.popstas.ru-default.json)
- [Lighthouse report](https://viasite.github.io/site-audit-seo-viewer/?url=https://site-audit.viasite.ru/reports/blog.popstas.ru-lighthouse.json)
- [Default + Basic Lighthouse report](https://viasite.github.io/site-audit-seo-viewer/?url=https://site-audit.viasite.ru/reports/blog.popstas.ru-default-plus-lighthouse.json)

# TODO
- show diff between reports
9 changes: 7 additions & 2 deletions components/Stats.vue
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,15 @@ export default {
for (let valName in vals) {
const count = vals[valName];
let valClass = this.getColumnValidateClass(valName, field.validate);
if (valClass == 'danger') validateClass = valClass;
else if (valClass == 'warning' && validateClass != 'danger') validateClass = valClass;
if (valClass === 'danger') validateClass = valClass;
else if (valClass === 'warning' && validateClass !== 'danger') validateClass = valClass;
else if (!validateClass) validateClass = valClass;
// TODO: universal renderItemValue, getColumnValue
if (field.type === 'boolean') {
valName = parseInt(valName) ? 'yes' : 'no'; // tolang
}
subvalues.push({
validateClass: valClass,
value: valName,
Expand Down
2 changes: 1 addition & 1 deletion pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ export default {
valueText = `<img alt="error loading image" style="width: 150px; height: auto;" src="${valueText}" title="${valueText}"/>`;
}
if (field.type == "boolean") {
if (field.type === 'boolean') {
valueText = parseInt(valueText) ? "yes" : "no"; // tolang
}
Expand Down

0 comments on commit 8214c0c

Please sign in to comment.