Skip to content

Commit

Permalink
Merge pull request Ericsson#4058 from vodorok/statistics_filter_keepa…
Browse files Browse the repository at this point in the history
…live_fix

[gui] Retain filter configuration between reports and statistics views
  • Loading branch information
bruntib authored Oct 26, 2023
2 parents c016398 + 09b29b5 commit c054acf
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 query_namespace = to.name;
if (to.name === "reports"
|| to.name === "product-overview"
|| to.name === "checker-statistics"
|| to.name === "severity-statistics"
|| to.name === "component-statistics"
)
query_namespace = "report_filter";

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

new Vue({
Expand Down

0 comments on commit c054acf

Please sign in to comment.