summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-13 21:07:39 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-13 21:07:39 +0000
commit74a89b1221eaf780374bd1d4c5b2ee4a0f488908 (patch)
tree27dbcfdbc4216e9bee04b9be9c974d86744d51ba /app
parentb0abae12affecc466aeb10889e8a6c000d6f67f5 (diff)
downloadgitlab-ce-74a89b1221eaf780374bd1d4c5b2ee4a0f488908.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/vue_shared/components/bar_chart.vue13
-rw-r--r--app/finders/merge_requests_finder.rb12
-rw-r--r--app/models/application_setting.rb1
3 files changed, 22 insertions, 4 deletions
diff --git a/app/assets/javascripts/vue_shared/components/bar_chart.vue b/app/assets/javascripts/vue_shared/components/bar_chart.vue
index 25d7bfe515c..ff718eacc5b 100644
--- a/app/assets/javascripts/vue_shared/components/bar_chart.vue
+++ b/app/assets/javascripts/vue_shared/components/bar_chart.vue
@@ -124,9 +124,7 @@ export default {
},
},
mounted() {
- if (!this.allValuesEmpty) {
- this.draw();
- }
+ this.draw();
},
methods: {
draw() {
@@ -153,7 +151,14 @@ export default {
this.yScale = d3.scaleLinear().rangeRound([this.vbHeight, 0]);
this.xScale.domain(this.graphData.map(d => d.name));
- this.yScale.domain([0, d3.max(this.graphData.map(d => d.value))]);
+ /*
+ If we have all-zero graph we want graph to center 0 on axis and not to draw
+ any kind of ticks on Y axis. Infinity allows us to do that.
+
+ See https://gitlab.com/gitlab-org/gitlab/merge_requests/20627#note_251484582
+ for detailed explanation
+ */
+ this.yScale.domain([0, d3.max(this.graphData.map(d => d.value)) || Infinity]);
// Zoom/Panning Function
this.zoom = d3
diff --git a/app/finders/merge_requests_finder.rb b/app/finders/merge_requests_finder.rb
index 275a01330bf..410ad645cd9 100644
--- a/app/finders/merge_requests_finder.rb
+++ b/app/finders/merge_requests_finder.rb
@@ -39,6 +39,7 @@ class MergeRequestsFinder < IssuableFinder
def filter_items(_items)
items = by_commit(super)
+ items = by_deployment(items)
items = by_source_branch(items)
items = by_wip(items)
items = by_target_branch(items)
@@ -101,6 +102,17 @@ class MergeRequestsFinder < IssuableFinder
.or(table[:title].matches('WIP %'))
.or(table[:title].matches('[WIP]%'))
end
+
+ def by_deployment(items)
+ return items unless deployment_id
+
+ items.includes(:deployment_merge_requests)
+ .where(deployment_merge_requests: { deployment_id: deployment_id })
+ end
+
+ def deployment_id
+ @deployment_id ||= params[:deployment_id].presence
+ end
end
MergeRequestsFinder.prepend_if_ee('EE::MergeRequestsFinder')
diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb
index a0a600a340e..10d15e84b8d 100644
--- a/app/models/application_setting.rb
+++ b/app/models/application_setting.rb
@@ -11,6 +11,7 @@ class ApplicationSetting < ApplicationRecord
add_authentication_token_field :static_objects_external_storage_auth_token
belongs_to :instance_administration_project, class_name: "Project"
+ belongs_to :instance_administrators_group, class_name: "Group"
# Include here so it can override methods from
# `add_authentication_token_field`