Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

showing open merge request count. #98

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ fetchCount: 20
# Show only projects with recent pipelines
pipelinesOnly: false

# Show open merge request count on project card
showOpenMergeRequestCount: 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
Expand Down
1 change: 1 addition & 0 deletions charts/gitlab-monitor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ config: |
"maxAge": 168,
"fetchCount": 20,
"pipelinesOnly": false,
"showOpenMergeRequestCount": false,
"autoZoom": false,
"showPipelineIds": true,
"showJobs": "iconAndName",
Expand Down
1 change: 1 addition & 0 deletions charts/gitlab-monitor/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ config: |
"pipelinesOnly": false,
"autoZoom": false,
"showPipelineIds": true,
"showOpenMergeRequestCount": false,
"showJobs": "iconAndName",
"showDurations": true,
"showUsers": false,
Expand Down
17 changes: 17 additions & 0 deletions src/components/project-card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
<a class="title" target="_blank" rel="noopener noreferrer" :href="project !== null ? project.web_url : '#'">
{{ project !== null ? project.name : 'Loading project...' }}
</a>
<div style="float: right">
<a class="title" target="_blank" rel="noopener noreferrer" :href="project !== null ? project.web_url + '/merge_requests' : '#'">
<font color=yellow>{{ openMergeRequestCount !== 0 ? "Open Merge Requests: " + openMergeRequestCount : '' }}</font>
</a>
</div>
<div class="pipeline-container">
<em v-if="pipelines !== null && pipelineCount === 0" class="no-pipelines">
No recent pipelines
Expand Down Expand Up @@ -56,6 +61,7 @@
project: null,
pipelines: null,
pipelineCount: 0,
openMergeRequestCount: 0,
refNames: [],
badges: [],
status: '',
Expand All @@ -73,6 +79,9 @@
showPipelinesOnly() {
return Config.root.pipelinesOnly
},
showOpenMergeRequestCount() {
return Config.root.showOpenMergeRequestCount
},
config() {
let config = Config.root.projectConfig['*']

Expand Down Expand Up @@ -178,6 +187,14 @@
this.loading = true

this.project = await this.$api(`/projects/${this.projectId}`)

const showOpenMergeRequestCount = this.showOpenMergeRequestCount
if (showOpenMergeRequestCount) {
const mergeRequests = await this.$api(`/projects/${this.projectId}/merge_requests?state=opened`)
this.openMergeRequestCount = mergeRequests.length
} else {
this.openMergeRequestCount = 0
}
this.$emit('input', this.project.last_activity_at)

this.loading = false
Expand Down
1 change: 1 addition & 0 deletions src/config.default.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"pipelinesOnly": false,
"autoZoom": false,
"showPipelineIds": true,
"showOpenMergeRequestCount": false,
"showJobs": "icon",
"showJobsNameOnlyOn": [],
"showRestartedJobs": true,
Expand Down