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
64cd1428
Commit
64cd1428
authored
Sep 11, 2019
by
lauraMon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactors and brings back boolean_to_icon in form
parent
c25b1a43
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
7 deletions
+14
-7
app/views/projects/services/_form.html.haml
app/views/projects/services/_form.html.haml
+4
-2
ee/app/assets/javascripts/alerts_service_settings/components/alerts_service_form.vue
...lerts_service_settings/components/alerts_service_form.vue
+10
-5
No files found.
app/views/projects/services/_form.html.haml
View file @
64cd1428
...
...
@@ -2,8 +2,10 @@
.col-lg-3
%h4
.prepend-top-0
=
@service
.
title
=
boolean_to_icon
@service
.
activated?
-
[
true
,
false
].
each
do
|
value
|
-
hide_class
=
'd-none'
if
@service
.
activated?
!=
value
%span
.js-service-active-status
{
class:
hide_class
,
data:
{
value:
value
.
to_s
}
}
=
boolean_to_icon
value
%p
=
#{@service.description}.
-
if
@service
.
respond_to?
(
:detailed_description
)
...
...
ee/app/assets/javascripts/alerts_service_settings/components/alerts_service_form.vue
View file @
64cd1428
...
...
@@ -82,14 +82,19 @@ export default {
},
watch
:
{
activated
()
{
const
inactive
=
document
.
querySelector
(
'
.fa-power-off
'
);
const
active
=
document
.
querySelector
(
'
.fa-circle
'
);
this
.
activated
?
inactive
&&
inactive
.
setAttribute
(
'
class
'
,
'
fa fa-circle cgreen
'
)
:
active
&&
active
.
setAttribute
(
'
class
'
,
'
fa fa-power-off clgray
'
);
this
.
updateIcon
();
},
},
methods
:
{
updateIcon
()
{
return
document
.
querySelectorAll
(
'
.js-service-active-status
'
).
forEach
(
icon
=>
{
if
(
icon
.
dataset
.
value
===
this
.
activated
.
toString
())
{
icon
.
classList
.
remove
(
'
d-none
'
);
}
else
{
icon
.
classList
.
add
(
'
d-none
'
);
}
});
},
resetKey
()
{
return
axios
.
put
(
this
.
formPath
,
{
service
:
{
token
:
''
}
})
...
...
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