Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
feat(app): blacklist data_categories in summary
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-wilmer committed Apr 21, 2016
1 parent f444fe9 commit 0a46414
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 9 deletions.
13 changes: 11 additions & 2 deletions app/scripts/components/summary-card/summary-card.directives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ module ngApp.components.summaryCard.directives {
if (newVal) {
// Ensure pie chart data is always sorted highest to lowest
// for tables

if (config.sortData) {
newVal.sort(function(a, b) {
if (a[config.sortKey] > b[config.sortKey]) {
Expand All @@ -128,7 +129,11 @@ module ngApp.components.summaryCard.directives {
item.color = color(index);
});

$scope.tableData = newVal;
$scope.tableData = newVal.filter(x =>
!config.blacklist.some(y =>
y.toLowerCase() === x.data_category.toLowerCase()
)
);
}
});
}
Expand Down Expand Up @@ -195,7 +200,11 @@ module ngApp.components.summaryCard.directives {
item.color = color(index);
});

$scope.tableData = newVal;
$scope.tableData = newVal.filter(x =>
!config.blacklist.some(y =>
y.toLowerCase() === x.data_category.toLowerCase()
)
);
}
});
}
Expand Down
1 change: 1 addition & 0 deletions app/scripts/participant/participants.controllers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ module ngApp.participants.controllers {
state: {
name: "search.files"
},
blacklist: ["structural rearrangement", "dna methylation"],
filters: {
"default": {
params: {
Expand Down
1 change: 1 addition & 0 deletions app/scripts/projects/projects.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ module ngApp.projects.controllers {
state: {
name: "search.files"
},
blacklist: ["structural rearrangement", "dna methylation"],
filters: {
"default": {
params: {
Expand Down
8 changes: 4 additions & 4 deletions app/scripts/projects/projects.githut.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ angular.module('projects.githut.config', [])
},
{
id:'Clinical',
display_name:['Clin.'],
display_name:['Clinical'],
scale:'ordinal',
is_subtype:true,
dimensional:true,
Expand All @@ -172,8 +172,8 @@ angular.module('projects.githut.config', [])
},
// Biospecimen
{
id:'Other',
display_name:['Bio.'],
id:'Biospecimen',
display_name:['Biospecimen'],
scale:'ordinal',
is_subtype:true,
dimensional:true,
Expand Down Expand Up @@ -275,7 +275,7 @@ angular.module('projects.githut.config', [])
},
superhead:{
start:'Clinical',
end:'Other',
end:'Biospecimen',
text: ProjectsService.getTableHeading() //Case count per data type
},

Expand Down
4 changes: 2 additions & 2 deletions app/scripts/projects/projects.table.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,10 @@ module ngApp.projects.models {
}, {
name: 'Biospecimen',
id: 'biospecimen',
td: (row, $scope) => dataCategoryWithFilters("Other", row, $scope.$filter),
td: (row, $scope) => dataCategoryWithFilters("Biospecimen", row, $scope.$filter),
thClassName: 'text-right',
tdClassName: 'text-right',
total: (data, $scope) => dataCategoryTotalWithFilters('Other', data, $scope.$filter)
total: (data, $scope) => dataCategoryTotalWithFilters('Biospecimen', data, $scope.$filter)
}
]
}, {
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/search/search.participants.table.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ module ngApp.search.models {
}, {
name: 'Biospecimen',
id: 'biospecimen',
td: (row, $scope) => dataCategoryWithFilters("Other", row, $scope.$filter),
td: (row, $scope) => dataCategoryWithFilters("Biospecimen", row, $scope.$filter),
thClassName: 'text-right',
tdClassName: 'text-right'
}
Expand Down

0 comments on commit 0a46414

Please sign in to comment.