Add applicability visually

This commit is contained in:
Spencer Will 2024-04-04 20:02:42 -04:00
parent 9725c4a162
commit 0b43e03ca9
2 changed files with 36 additions and 1 deletions

View File

@ -496,7 +496,32 @@ Otherwise, have a great day =^.^=
</ul>
</div>
</div>
<div class="btn-group" filter-dropdown>
<button type="button" class="btn btn-default dropdown-toggle">
Applicability <span class="badge">{{selectedValuesCount(applicabilities)}}</span> <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li class="checkbox">
<label ng-click="toggleApplicabilities(true)">
<input type="checkbox" class="invisible" />
All
</label>
</li>
<li class="checkbox">
<label ng-click="toggleApplicabilities(false)">
<input type="checkbox" class="invisible" />
None
</label>
</li>
<li role="separator" class="divider"></li>
<li class="checkbox" ng-repeat="(applicability, enabled) in applicabilities">
<label class="text-capitalize">
<input type="checkbox" ng-model="applicabilities[applicability]" />
{{applicability}}
</label>
</li>
</ul>
</div>
</div>
<div class="col-12 col-md-7 search-control">
<div class="input-group">

View File

@ -156,6 +156,16 @@
Object.entries(versionFilterKeyMap).map(([key, value]) => [value, key])
);
const APPLICABILITIES_DEFAULT = {
unspecified: true,
unresolved: true,
machineApplicable: true,
maybeIncorrect: true,
hasPlaceholders: true
};
$scope.applicabilities = APPLICABILITIES_DEFAULT;
// loadFromURLParameters retrieves filter settings from the URL parameters and assigns them
// to corresponding $scope variables.
function loadFromURLParameters() {