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

Commit

Permalink
feat(search): summary click
Browse files Browse the repository at this point in the history
clicking on file count in search summary updates facets
Closes 660
  • Loading branch information
Daniel Stern committed Mar 23, 2015
1 parent ce7e20d commit b7c70b0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
10 changes: 8 additions & 2 deletions app/scripts/search/search.controllers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ module ngApp.search.controllers {
private UserService: IUserService,
public CoreService: ICoreService,
private SearchTableFilesModel: TableiciousConfig,
private SearchTableParticipantsModel: TableiciousConfig) {
private SearchTableParticipantsModel: TableiciousConfig,
public FacetService) {
var data = $state.current.data || {};
this.SearchState.setActive("tabs", data.tab);
this.SearchState.setActive("facets", data.tab);
Expand All @@ -65,6 +66,10 @@ module ngApp.search.controllers {
$scope.$on("gdc-user-reset", () => {
this.refresh();
});

// $scope.addFacet = function(a,b){
// FacetService.addTerm(a,b);
// }

$scope.fileTableConfig = this.SearchTableFilesModel;
$scope.participantTableConfig = this.SearchTableParticipantsModel;
Expand Down Expand Up @@ -198,7 +203,8 @@ module ngApp.search.controllers {
"participants.services",
"search.table.files.model",
'search.table.participants.model',
"files.services"
"files.services",
"facets.services"
])
.controller("SearchController", SearchController);
}
Expand Down
12 changes: 8 additions & 4 deletions app/scripts/search/templates/search.summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ <h4 class="panel-title">Data Type</h4>
<tbody>
<tr data-ng-repeat='type in sc.summary.data_type.buckets'>
<th scope="row" data-translate>{{type.key | humanify: true:true }}</th>
<td class="text-right">{{ type.doc_count | number }}</td>
<td ng-click="sc.FacetService.addTerm('files.data_type', type.key)" class="text-right">
<a href="">{{ type.doc_count | number }}</a></td>
<td class="text-right">{{ type.file_size.value | size}}</td>
</tr>
</tbody>
Expand All @@ -67,7 +68,9 @@ <h4 class="panel-title">Experimental Strategy</h4>
<tbody>
<tr data-ng-repeat='type in sc.summary.experimental_strategy.buckets'>
<th scope="row" data-translate>{{type.key | humanify: true:true }}</th>
<td class="text-right">{{ type.doc_count | number }}</td>
<td ng-click="sc.FacetService.addTerm('files.experimental_strategy', type.key)" class="text-right" class="text-right">
<a href="">{{ type.doc_count | number }}
</a></td>
<td class="text-right">{{ type.file_size.value | size}}</td>
</tr>
</tbody>
Expand All @@ -90,7 +93,8 @@ <h4 class="panel-title">Data Format</h4>
<tbody>
<tr data-ng-repeat='type in sc.summary.data_format.buckets'>
<th scope="row" data-translate>{{type.key | humanify: true:true }}</th>
<td class="text-right">{{ type.doc_count | number }}</td>
<td ng-click="sc.FacetService.addTerm('files.data_format', type.key)" class="text-right">
<a href="">{{ type.doc_count | number }}</a></td>
<td class="text-right">{{ type.file_size.value | size}}</td>
</tr>
</tbody>
Expand All @@ -111,7 +115,7 @@ <h4 class="panel-title">Data Access</h4>
<tbody>
<tr data-ng-repeat='type in sc.summary.access.buckets'>
<th scope="row" data-translate>{{type.key | humanify: true:true }}</th>
<td class="text-right">{{ type.doc_count | number }}</td>
<td ng-click="sc.FacetService.addTerm('files.access', type.key)" class="text-right"><a href="">{{ type.doc_count | number }}</a></td>
<td class="text-right">{{ type.file_size.value | size}}</td>
</tr>
</tbody>
Expand Down

0 comments on commit b7c70b0

Please sign in to comment.