Skip to content

Commit

Permalink
Add applicability visually
Browse files Browse the repository at this point in the history
  • Loading branch information
SpencerAWill committed Apr 5, 2024
1 parent 9725c4a commit 0b43e03
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
27 changes: 26 additions & 1 deletion util/gh-pages/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,32 @@ <h1>Clippy Lints</h1>
</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">
Expand Down
10 changes: 10 additions & 0 deletions util/gh-pages/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 0b43e03

Please sign in to comment.