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
44f2504a
Commit
44f2504a
authored
May 29, 2017
by
kushalpandya
Committed by
Jarka Kadlecova
Jun 01, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initialize canTestService from form meta
parent
095d9b5b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
app/assets/javascripts/integrations/integration_settings_form.js
...ets/javascripts/integrations/integration_settings_form.js
+6
-4
No files found.
app/assets/javascripts/integrations/integration_settings_form.js
View file @
44f2504a
...
...
@@ -6,6 +6,7 @@ export default class IntegrationSettingsForm {
// Form Metadata
this
.
endPoint
=
this
.
$form
.
attr
(
'
action
'
);
this
.
canTestService
=
this
.
$form
.
data
(
'
can-test
'
);
// Form Child Elements
this
.
$serviceToggle
=
this
.
$form
.
find
(
'
#service_active
'
);
...
...
@@ -31,7 +32,8 @@ export default class IntegrationSettingsForm {
handleSettingsSave
(
e
)
{
if
(
this
.
$serviceToggle
.
is
(
'
:checked
'
))
{
if
(
this
.
$form
.
get
(
0
).
checkValidity
())
{
if
(
this
.
$form
.
get
(
0
).
checkValidity
()
&&
this
.
canTestService
)
{
e
.
preventDefault
();
this
.
testSettings
(
this
.
$form
.
serialize
());
}
...
...
@@ -43,7 +45,7 @@ export default class IntegrationSettingsForm {
}
toggleServiceState
(
serviceActive
)
{
this
.
toggleSubmitBtnLabel
(
serviceActive
);
this
.
toggleSubmitBtnLabel
(
serviceActive
,
this
.
canTestService
);
if
(
serviceActive
)
{
this
.
$form
.
removeAttr
(
'
novalidate
'
);
}
else
if
(
!
this
.
$form
.
attr
(
'
novalidate
'
))
{
...
...
@@ -54,9 +56,9 @@ export default class IntegrationSettingsForm {
/**
* Toggle Submit button label based on Integration status
*/
toggleSubmitBtnLabel
(
serviceActive
)
{
toggleSubmitBtnLabel
(
serviceActive
,
canTestService
)
{
this
.
$submitBtnLabel
.
text
(
serviceActive
?
serviceActive
&&
canTestService
?
'
Test settings and save changes
'
:
'
Save changes
'
);
}
...
...
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