From b66c016f2d8f3e3517c4918a1722b3ce2256bd01 Mon Sep 17 00:00:00 2001 From: Timothy Earley Date: Wed, 10 Jan 2024 17:29:16 +0100 Subject: [PATCH] feat: hide archived projects --- CONFIGURATION.md | 3 +++ charts/gitlab-monitor/README.md | 1 + charts/gitlab-monitor/values.yaml | 1 + src/components/app.vue | 5 +++++ src/config.default.json | 1 + 5 files changed, 11 insertions(+) diff --git a/CONFIGURATION.md b/CONFIGURATION.md index 53c34c1..d8d5d33 100644 --- a/CONFIGURATION.md +++ b/CONFIGURATION.md @@ -59,6 +59,9 @@ fetchCount: 20 # Show only projects with recent pipelines pipelinesOnly: false +# Whether to include archived projects +includeArchived: false + # Zooms the dashboard to fill the screen with all displayed projects. # Not compatible with all browsers! See https://caniuse.com/#feat=css-zoom autoZoom: false diff --git a/charts/gitlab-monitor/README.md b/charts/gitlab-monitor/README.md index 6bb2442..52795ea 100644 --- a/charts/gitlab-monitor/README.md +++ b/charts/gitlab-monitor/README.md @@ -31,6 +31,7 @@ config: | "maxAge": 168, "fetchCount": 20, "pipelinesOnly": false, + "includeArchived": false, "autoZoom": false, "showPipelineIds": true, "showJobs": "iconAndName", diff --git a/charts/gitlab-monitor/values.yaml b/charts/gitlab-monitor/values.yaml index 99ef557..3822e06 100755 --- a/charts/gitlab-monitor/values.yaml +++ b/charts/gitlab-monitor/values.yaml @@ -30,6 +30,7 @@ config: | "maxAge": 168, "fetchCount": 20, "pipelinesOnly": false, + "includeArchived": false, "autoZoom": false, "showPipelineIds": true, "showJobs": "iconAndName", diff --git a/src/components/app.vue b/src/components/app.vue index 927b696..6ae5d2b 100644 --- a/src/components/app.vue +++ b/src/components/app.vue @@ -151,6 +151,11 @@ gitlabApiParams.include_subgroups = includeSubgroups } + const includeArchived = Config.root.includeArchived + if (includeArchived === false) { + gitlabApiParams.archived = "false" + } + // Only use main level projects API if tighter scope not defined const scopeType = Config.root.projectScope // Reformat the variable as a flat list of Ids diff --git a/src/config.default.json b/src/config.default.json index 03f7e58..3b3cc22 100644 --- a/src/config.default.json +++ b/src/config.default.json @@ -4,6 +4,7 @@ "maxAge": 168, "fetchCount": 20, "pipelinesOnly": false, + "includeArchived": false, "autoZoom": false, "showPipelineIds": true, "showProjectOnlyOn": [],