Skip to content

Commit

Permalink
Add Security Checklist
Browse files Browse the repository at this point in the history
  • Loading branch information
jason5ng32 committed Dec 24, 2024
1 parent b34a0e7 commit 9c9e574
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions frontend/components/advanced-tools/SecurityChecklist.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,9 @@
countItems({ action: 'checked', category: item }) }}/{{ countItems({ action:
'total', category: item }) -
countItems({ action: 'ignored', category: item }) }})

</span>
<span class="jn-bi-font"
v-if=" countItems({ action: 'percentage', category: item }) === '100' ">
v-if=" countItems({ action: 'percentage', category: item }) === 100 ">
<i class=" bi bi-check-circle-fill text-success"></i>
</span>
<span v-else>
Expand Down Expand Up @@ -461,7 +460,8 @@ const countItems = ({ action, category, priority }) => {
const total = items.length;
const ignored = items.filter(item => item.ignored).length;
const checked = items.filter(item => item.checked).length;
return (total - ignored) === 0 ? '100' : ((checked / (total - ignored)) * 100).toFixed(0);
const denominator = total - ignored;
return denominator === 0 ? 100 : Math.round((checked / denominator) * 100);
},
};
Expand Down

0 comments on commit 9c9e574

Please sign in to comment.