Skip to content

Commit 1d47af8

Browse files
authored
Merge pull request #351 from nexB/344-fix-barchart-package-counts
Fix barchat package attribute counts #344
2 parents cf2014b + 8da9de9 commit 1d47af8

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

assets/app/js/controllers/barChart.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,15 @@ class WorkbenchBarChart extends Controller {
8383

8484
if (this.chartAttributesSelect.val()) {
8585
const attribute = this.chartAttributesSelect.val();
86+
87+
const directoryAttributes = ['packages_type', 'packages_name', 'packages_primary_language'];
88+
const where = directoryAttributes.includes(attribute)
89+
? {path: {$like: `${this.selectedPath()}%`}}
90+
: {path: {$like: `${this.selectedPath()}%`}, type: { $ne: 'directory' }};
91+
8692
const query = {
8793
attributes: [Sequelize.fn('TRIM', Sequelize.col(attribute)), attribute],
88-
where: {
89-
path: { $like: `${this.selectedPath()}%` },
90-
type: { $ne: 'directory' },
91-
}
94+
where: where
9295
};
9396

9497

0 commit comments

Comments
 (0)