Skip to content

Commit

Permalink
fix: pluralize issues number (#125)
Browse files Browse the repository at this point in the history
Displays '2 issues' rather than '2 issue' if multiple issues have been
found by an advisory source.

Pluralize tested against: 
https://www.npmjs.com/package/react-scripts
https://pypi.org/project/openpyxl-templates/

Checking for regression issues against the following, which should show
singular issues in one of the artifacts.
https://www.npmjs.com/package/react-day-picker
https://www.npmjs.com/package/node-sass
https://pypi.org/project/pydub/

Lint output:
```
xxxxxxxxxxxxxx:~/Projects/overlay$ npm run lint

> lint
> eslint src tests e2e
```

yarn test output:
```
Test Suites: 12 passed, 12 total
Tests:       1 skipped, 193 passed, 194 total
Snapshots:   0 total
Time:        5.022 s
Ran all test suites.
Done in 5.98s.
```

Co-authored-by: Marcus Watson <[email protected]>
  • Loading branch information
dipsylala and Marcus Watson committed Jun 23, 2023
1 parent 21b4b76 commit 1c3a8a8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/custom-elements/PackageReport.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@
</div>

<div class="overlay-indicator__tooltip__source__issues" v-if="source.issues">
<div class="overlay-indicator__tooltip__source__issues__wrapper">{{ source.issues }} issue</div>
<div class="overlay-indicator__tooltip__source__issues__wrapper">
{{ source.issues }} issue{{ source.issues !== 1 ? 's' : '' }}
</div>
</div>

<div class="overlay-indicator__tooltip__source__actions">
Expand Down

0 comments on commit 1c3a8a8

Please sign in to comment.