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
15cd756f
Commit
15cd756f
authored
Sep 11, 2018
by
James Edwards-Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GroupSAML test button has tooltip when disabled
parent
443f4207
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
ee/app/assets/javascripts/saml_providers/saml_settings_form.js
...p/assets/javascripts/saml_providers/saml_settings_form.js
+18
-1
ee/app/views/groups/saml_providers/_form.html.haml
ee/app/views/groups/saml_providers/_form.html.haml
+1
-1
No files found.
ee/app/assets/javascripts/saml_providers/saml_settings_form.js
View file @
15cd756f
...
...
@@ -5,7 +5,8 @@ export default class SamlSettingsForm {
constructor
(
formSelector
)
{
this
.
form
=
document
.
querySelector
(
formSelector
);
this
.
enabledToggle
=
this
.
form
.
querySelector
(
'
#saml_provider_enabled
'
);
this
.
testButton
=
this
.
form
.
querySelector
(
'
#js-saml-test-button a
'
);
this
.
testButtonTooltipWrapper
=
this
.
form
.
querySelector
(
'
#js-saml-test-button
'
);
this
.
testButton
=
this
.
testButtonTooltipWrapper
.
querySelector
(
'
a
'
);
this
.
dirtyFormChecker
=
new
DirtyFormChecker
(
formSelector
,
()
=>
this
.
updateView
());
}
...
...
@@ -26,11 +27,27 @@ export default class SamlSettingsForm {
this
.
enabled
=
this
.
enabledToggle
.
checked
;
}
testButtonTooltip
()
{
if
(
!
this
.
enabled
)
{
return
'
Group SAML must be enabled to test
'
;
}
if
(
this
.
dirtyFormChecker
.
isDirty
)
{
return
'
Save changes before testing
'
;
}
return
'
Redirect to SAML provider to test configuration
'
;
}
updateView
()
{
if
(
this
.
enabled
&&
!
this
.
dirtyFormChecker
.
isDirty
)
{
this
.
testButton
.
removeAttribute
(
'
disabled
'
);
}
else
{
this
.
testButton
.
setAttribute
(
'
disabled
'
,
true
);
}
// Update tooltip using wrapper so it works when input disabled
this
.
testButtonTooltipWrapper
.
setAttribute
(
'
title
'
,
this
.
testButtonTooltip
());
$
(
this
.
testButtonTooltipWrapper
).
tooltip
(
'
_fixTitle
'
);
}
}
ee/app/views/groups/saml_providers/_form.html.haml
View file @
15cd756f
...
...
@@ -26,5 +26,5 @@
.form-actions
=
f
.
submit
_
(
"Save changes"
),
class:
'btn btn-success qa-save-changes-button'
#js-saml-test-button
.pull-right
#js-saml-test-button
.
has-tooltip.
pull-right
=
render
'test_button'
,
saml_provider:
@saml_provider
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