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

Commit

Permalink
Merge pull request #212 from AppliedIS/fix-summarydropdowns
Browse files Browse the repository at this point in the history
fix issue with duplicate options in drop downs
  • Loading branch information
jefferey committed Dec 2, 2016
2 parents 3becb43 + a597cad commit 3920e88
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ module.exports = function(ngModule) {
customFilters: {
filterType: function (items, value, predicate) {
return items.filter(function (item) {
return value && item[predicate] ? findIndex(item[predicate], ['id', value]) !== -1 : true;
return value && item[predicate] ? findIndex(item[predicate], ['id', +value]) !== -1 : true;
});
},
filterStatus: function (items, value, predicate) {
return items.filter(function (item) {
return value ? get(item, predicate, undefined) === value : true;
return value ? get(item, predicate, undefined) === +value : true;
});
}
}
Expand All @@ -46,5 +46,6 @@ module.exports = function(ngModule) {
$scope.gotoUsers = function() {
$location.path("/admin/users");
}

});
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@ <h1>Dashboard</h1>
</div>
<div class="admin-filter">
<label for="admin_filter_status">Filter by Certificate Status</label>
<select id="admin_filter_status" name="admin_filter_status" ng-model="filterStatus" ng-options="status.id as status.name for status in filterStatuses" ng-change="gridActions.filter()" filter-by="status.id" filter-type="select">
<select id="admin_filter_status" name="admin_filter_status" ng-model="filterStatus" ng-change="gridActions.filter()" filter-by="status.id" filter-type="select">
<option value="">All</option>
<option ng-repeat="status in filterStatuses track by status.id" value="{{status.id}}">{{ status.name }}</option>
</select>
</div>
<div class="admin-filter">
<label for="admin_filter_type">Filter by Certificate Type</label>
<select id="admin_filter_type" name="admin_filter_type" ng-model="filterType" ng-options="estType.id as estType.display for estType in establishmentTypes" ng-change="gridActions.filter()" filter-by="certificateType" filter-type="select">
<select id="admin_filter_type" name="admin_filter_type" ng-model="filterType" ng-change="gridActions.filter()" filter-by="certificateType" filter-type="select">
<option value="">All</option>
<option ng-repeat="estType in establishmentTypes track by estType.id" value="{{estType.id}}">{{ estType.display }}</option>
</select>
</div>
</div>
Expand Down

0 comments on commit 3920e88

Please sign in to comment.