Skip to content

Commit

Permalink
[gui] Retain filter configuration between reports and statistics views
Browse files Browse the repository at this point in the history
Previously when changing between the reports and statistics views the
report filter configuration wasn't retained.

This patch implements the feature of retaining the filter configuration
between the reports view and the different substatistics pages.
  • Loading branch information
vodorok committed Oct 25, 2023
1 parent fa41e4e commit 064e987
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
8 changes: 6 additions & 2 deletions web/server/vue-cli/src/components/Layout/TheHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@
:key="item.name"
:to="{
name: item.route,
query: queries[item.route] === undefined
query: queries[item.query_namespace] === undefined
? item.query || {}
: queries[item.route]
: queries[item.query_namespace]
}"
:class="item.active.includes($route.name) &&
'v-btn--active router-link-active'"
Expand Down Expand Up @@ -165,6 +165,7 @@ export default {
menuButtons: [
{
name: "Products",
query_namespace: "products",
icon: "mdi-briefcase-outline",
route: "products",
active: [ "products" ],
Expand All @@ -173,6 +174,7 @@ export default {
},
{
name: "Runs",
query_namespace: "runs",
icon: "mdi-run-fast",
route: "runs",
active: [ "runs", "main_runs" ],
Expand All @@ -181,6 +183,7 @@ export default {
},
{
name: "Reports",
query_namespace: "report_filter",
icon: "mdi-bug",
route: "reports",
active: [ "reports" ],
Expand All @@ -190,6 +193,7 @@ export default {
},
{
name: "Statistics",
query_namespace: "report_filter",
icon: "mdi-chart-line",
route: "statistics",
active: [ "statistics" ],
Expand Down
11 changes: 10 additions & 1 deletion web/server/vue-cli/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,16 @@ router.afterEach(to => {
if (to.name === "products")
store.commit(CLEAR_QUERIES, { except: [ "products" ] });

store.commit(SET_QUERIES, { location: to.name, query: to.query });
let to_name = to.name;
if (to.name === "reports"
|| to.name === "product-overview"
|| to.name === "checker-statistics"
|| to.name === "severity-statistics"
|| to.name === "component-statistics"
)
to_name = "report_filter";

store.commit(SET_QUERIES, { location: to_name, query: to.query });
});

new Vue({
Expand Down

0 comments on commit 064e987

Please sign in to comment.