diff --git a/util/gh-pages/script.js b/util/gh-pages/script.js
index 7cca298df..921bb0376 100644
--- a/util/gh-pages/script.js
+++ b/util/gh-pages/script.js
@@ -156,6 +156,18 @@
Object.entries(versionFilterKeyMap).map(([key, value]) => [value, key])
);
+ const APPLICABILITIES_FILTER_DEFAULT = {
+ Unspecified: true,
+ Unresolved: true,
+ MachineApplicable: true,
+ MaybeIncorrect: true,
+ HasPlaceholders: true
+ };
+
+ $scope.applicabilities = {
+ ...APPLICABILITIES_FILTER_DEFAULT
+ }
+
// loadFromURLParameters retrieves filter settings from the URL parameters and assigns them
// to corresponding $scope variables.
function loadFromURLParameters() {
@@ -182,6 +194,7 @@
handleParameter('levels', $scope.levels, LEVEL_FILTERS_DEFAULT);
handleParameter('groups', $scope.groups, GROUPS_FILTER_DEFAULT);
+ handleParameter('applicabilities', $scope.applicabilities, APPLICABILITIES_FILTER_DEFAULT);
// Handle 'versions' parameter separately because it needs additional processing
if (urlParameters.versions) {
@@ -249,6 +262,7 @@
updateURLParameter($scope.levels, 'levels', LEVEL_FILTERS_DEFAULT);
updateURLParameter($scope.groups, 'groups', GROUPS_FILTER_DEFAULT);
updateVersionURLParameter($scope.versionFilters);
+ updateURLParameter($scope.applicabilities, 'applicabilities', APPLICABILITIES_FILTER_DEFAULT);
}
// Add $watches to automatically update URL parameters when the data changes
@@ -270,6 +284,12 @@
}
}, true);
+ $scope.$watch('applicabilities', function (newVal, oldVal) {
+ if (newVal !== oldVal) {
+ updateURLParameter(newVal, 'applicabilities', APPLICABILITIES_FILTER_DEFAULT)
+ }
+ }, true);
+
// Watch for changes in the URL path and update the search and lint display
$scope.$watch(function () { return $location.path(); }, function (newPath) {
const searchParameter = newPath.substring(1);
@@ -327,6 +347,15 @@
}
};
+ $scope.toggleApplicabilities = function (value) {
+ const applicabilities = $scope.applicabilities;
+ for (const key in applicabilities) {
+ if (applicabilities.hasOwnProperty(key)) {
+ applicabilities[key] = value;
+ }
+ }
+ }
+
$scope.resetGroupsToDefault = function () {
$scope.groups = {
...GROUPS_FILTER_DEFAULT
@@ -430,6 +459,10 @@
return true;
}
+ $scope.byApplicabilities = function (lint) {
+ return $scope.applicabilities[lint.applicability.applicability];
+ };
+
// Show details for one lint
$scope.openLint = function (lint) {
$scope.open[lint.id] = true;