Commit 8cb105cf authored by Pawel Chojnacki's avatar Pawel Chojnacki

Fix order of checks in editable? method.

+ address small nitpicks
parent 277f7fef
......@@ -28,7 +28,7 @@ class PrometheusService < MonitoringService
end
def editable?
!prometheus_installed? || manual_configuration?
manual_configuration? || !prometheus_installed?
end
def title
......@@ -126,7 +126,8 @@ class PrometheusService < MonitoringService
end
def prometheus_installed?
return false if template? || !project
return false if template?
return false unless project
project.clusters.enabled.any? { |cluster| cluster.application_prometheus&.installed? }
end
......@@ -157,7 +158,7 @@ class PrometheusService < MonitoringService
end
def synchronize_service_state!
self.active = prometheus_installed? || self.manual_configuration?
self.active = prometheus_installed? || manual_configuration?
true
end
......
......@@ -249,7 +249,7 @@ FactoryBot.define do
project.create_prometheus_service(
active: true,
properties: {
api_url: 'https://prometheus.example.com',
api_url: 'https://prometheus.example.com/',
manual_configuration: true
}
)
......
......@@ -30,8 +30,8 @@ FactoryBot.define do
project
active true
properties({
manual_configuration: true,
api_url: 'https://prometheus.example.com/'
api_url: 'https://prometheus.example.com/',
manual_configuration: true
})
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment