From 0b43e03ca9bbc2325528075a64d4aed6375f430b Mon Sep 17 00:00:00 2001 From: Spencer Will Date: Thu, 4 Apr 2024 20:02:42 -0400 Subject: [PATCH 1/3] Add applicability visually --- util/gh-pages/index.html | 27 ++++++++++++++++++++++++++- util/gh-pages/script.js | 10 ++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/util/gh-pages/index.html b/util/gh-pages/index.html index c88c298d5..6fb94c14a 100644 --- a/util/gh-pages/index.html +++ b/util/gh-pages/index.html @@ -496,7 +496,32 @@ Otherwise, have a great day =^.^= - +
+ + +
diff --git a/util/gh-pages/script.js b/util/gh-pages/script.js index f59245e55..fa72b7de0 100644 --- a/util/gh-pages/script.js +++ b/util/gh-pages/script.js @@ -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() { From e4ce248af46d2bd3ce59a6dcb82c431bfed4162b Mon Sep 17 00:00:00 2001 From: Spencer Will Date: Tue, 9 Apr 2024 15:00:12 -0400 Subject: [PATCH 2/3] Complete filter functionality. Formatted upper filters to take more visual column space. Force filter wrapping with flex for small screens. --- util/gh-pages/index.html | 7 ++++--- util/gh-pages/script.js | 38 +++++++++++++++++++++++++++++++------- 2 files changed, 35 insertions(+), 10 deletions(-) diff --git a/util/gh-pages/index.html b/util/gh-pages/index.html index 6fb94c14a..8de36fc40 100644 --- a/util/gh-pages/index.html +++ b/util/gh-pages/index.html @@ -103,6 +103,7 @@ Otherwise, have a great day =^.^= @media (min-width: 405px) { #upper-filters { display: flex; + flex-wrap: wrap; } } @@ -404,7 +405,7 @@ Otherwise, have a great day =^.^=
-
+
-
+
-
+

diff --git a/util/gh-pages/script.js b/util/gh-pages/script.js index fa72b7de0..99868b044 100644 --- a/util/gh-pages/script.js +++ b/util/gh-pages/script.js @@ -156,15 +156,17 @@ Object.entries(versionFilterKeyMap).map(([key, value]) => [value, key]) ); - const APPLICABILITIES_DEFAULT = { - unspecified: true, - unresolved: true, - machineApplicable: true, - maybeIncorrect: true, - hasPlaceholders: true + const APPLICABILITIES_FILTER_DEFAULT = { + Unspecified: true, + Unresolved: true, + MachineApplicable: true, + MaybeIncorrect: true, + HasPlaceholders: true }; - $scope.applicabilities = APPLICABILITIES_DEFAULT; + $scope.applicabilities = { + ...APPLICABILITIES_FILTER_DEFAULT + } // loadFromURLParameters retrieves filter settings from the URL parameters and assigns them // to corresponding $scope variables. @@ -192,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) { @@ -259,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 @@ -280,6 +284,13 @@ } }, true); + $scope.$watch('applicabilities', function (newVal, oldVal) { + console.log("Test"); + 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); @@ -337,6 +348,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 @@ -440,6 +460,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; From c8a7e6e5e6dff1e42483390e43514b986f635e66 Mon Sep 17 00:00:00 2001 From: Spencer Will Date: Thu, 11 Apr 2024 17:27:55 -0400 Subject: [PATCH 3/3] Remove debug helper. Co-authored-by: Fridtjof Stoldt --- util/gh-pages/script.js | 1 - 1 file changed, 1 deletion(-) diff --git a/util/gh-pages/script.js b/util/gh-pages/script.js index 99868b044..793ddb94f 100644 --- a/util/gh-pages/script.js +++ b/util/gh-pages/script.js @@ -285,7 +285,6 @@ }, true); $scope.$watch('applicabilities', function (newVal, oldVal) { - console.log("Test"); if (newVal !== oldVal) { updateURLParameter(newVal, 'applicabilities', APPLICABILITIES_FILTER_DEFAULT) }