Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
6b0b2adc
Commit
6b0b2adc
authored
Oct 30, 2019
by
allison.browne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code review feedback
Use predicate method and boolean rather than string
parent
b2e86043
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
6 deletions
+6
-6
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+1
-1
app/models/grafana_integration.rb
app/models/grafana_integration.rb
+3
-3
changelogs/unreleased/33672-add-enable-checkbox-for-grafana-authentication-settings.yml
...d-enable-checkbox-for-grafana-authentication-settings.yml
+1
-1
spec/factories/grafana_integrations.rb
spec/factories/grafana_integrations.rb
+1
-1
No files found.
app/helpers/projects_helper.rb
View file @
6b0b2adc
...
...
@@ -363,7 +363,7 @@ module ProjectsHelper
end
def
grafana_integration_enabled
@project
.
grafana_integration
&
.
enabled
@project
.
grafana_integration
&
.
enabled
?
end
private
...
...
app/models/grafana_integration.rb
View file @
6b0b2adc
...
...
@@ -17,8 +17,8 @@ class GrafanaIntegration < ApplicationRecord
validates
:enabled
,
inclusion:
{
in:
[
true
,
false
]
}
def
client
if
enabled?
@client
||=
::
Grafana
::
Client
.
new
(
api_url:
grafana_url
.
chomp
(
'/'
),
token:
token
)
end
return
unless
enabled?
@client
||=
::
Grafana
::
Client
.
new
(
api_url:
grafana_url
.
chomp
(
'/'
),
token:
token
)
end
end
changelogs/unreleased/33672-add-enable-checkbox-for-grafana-authentication-settings.yml
View file @
6b0b2adc
---
title
:
Add flag to enable and disable grafana integration
title
:
Migrate enabled flag on grafana_integrations table
merge_request
:
19234
author
:
type
:
changed
spec/factories/grafana_integrations.rb
View file @
6b0b2adc
...
...
@@ -5,6 +5,6 @@ FactoryBot.define do
project
grafana_url
{
'https://grafana.example.com'
}
token
{
SecureRandom
.
hex
(
10
)
}
enabled
{
'true'
}
enabled
{
true
}
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment