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
d1f0275a
Commit
d1f0275a
authored
Mar 26, 2020
by
Illya Klymov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix toggles not removing is-disabled class
parent
258ea127
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
ee/app/assets/javascripts/saml_providers/saml_settings_form.js
...p/assets/javascripts/saml_providers/saml_settings_form.js
+5
-5
ee/spec/frontend/saml_providers/saml_settings_form_spec.js
ee/spec/frontend/saml_providers/saml_settings_form_spec.js
+2
-0
No files found.
ee/app/assets/javascripts/saml_providers/saml_settings_form.js
View file @
d1f0275a
...
@@ -114,16 +114,16 @@ export default class SamlSettingsForm {
...
@@ -114,16 +114,16 @@ export default class SamlSettingsForm {
.
filter
(
setting
=>
setting
.
dependsOn
)
.
filter
(
setting
=>
setting
.
dependsOn
)
.
forEach
(
setting
=>
{
.
forEach
(
setting
=>
{
const
{
helperText
,
callout
,
toggle
}
=
setting
;
const
{
helperText
,
callout
,
toggle
}
=
setting
;
const
dependentToggleValue
=
this
.
getValueWithDeps
(
setting
.
dependsOn
);
const
isRelatedToggleOn
=
this
.
getValueWithDeps
(
setting
.
dependsOn
);
if
(
helperText
)
{
if
(
helperText
)
{
helperText
.
style
.
display
=
dependentToggleValue
?
'
none
'
:
'
block
'
;
helperText
.
style
.
display
=
isRelatedToggleOn
?
'
none
'
:
'
block
'
;
}
}
toggle
.
classList
.
toggle
(
'
is-disabled
'
,
dependentToggleValue
);
toggle
.
classList
.
toggle
(
'
is-disabled
'
,
!
isRelatedToggleOn
);
toggle
.
disabled
=
!
dependentToggleValue
;
toggle
.
disabled
=
!
isRelatedToggleOn
;
if
(
callout
)
{
if
(
callout
)
{
callout
.
style
.
display
=
setting
.
value
&&
dependentToggleValue
?
'
block
'
:
'
none
'
;
callout
.
style
.
display
=
setting
.
value
&&
isRelatedToggleOn
?
'
block
'
:
'
none
'
;
}
}
});
});
}
}
...
...
ee/spec/frontend/saml_providers/saml_settings_form_spec.js
View file @
d1f0275a
...
@@ -54,12 +54,14 @@ describe('SamlSettingsForm', () => {
...
@@ -54,12 +54,14 @@ describe('SamlSettingsForm', () => {
samlSettingsForm
.
updateSAMLSettings
();
samlSettingsForm
.
updateSAMLSettings
();
samlSettingsForm
.
updateView
();
samlSettingsForm
.
updateView
();
expect
(
findProhibitForksSetting
().
toggle
.
hasAttribute
(
'
disabled
'
)).
toBe
(
false
);
expect
(
findProhibitForksSetting
().
toggle
.
hasAttribute
(
'
disabled
'
)).
toBe
(
false
);
expect
(
findProhibitForksSetting
().
toggle
.
classList
.
contains
(
'
is-disabled
'
)).
toBe
(
false
);
findEnforcedGroupManagedAccountSetting
().
input
.
value
=
false
;
findEnforcedGroupManagedAccountSetting
().
input
.
value
=
false
;
samlSettingsForm
.
updateSAMLSettings
();
samlSettingsForm
.
updateSAMLSettings
();
samlSettingsForm
.
updateView
();
samlSettingsForm
.
updateView
();
expect
(
findProhibitForksSetting
().
toggle
.
hasAttribute
(
'
disabled
'
)).
toBe
(
true
);
expect
(
findProhibitForksSetting
().
toggle
.
hasAttribute
(
'
disabled
'
)).
toBe
(
true
);
expect
(
findProhibitForksSetting
().
toggle
.
classList
.
contains
(
'
is-disabled
'
)).
toBe
(
true
);
expect
(
findProhibitForksSetting
().
value
).
toBe
(
true
);
expect
(
findProhibitForksSetting
().
value
).
toBe
(
true
);
});
});
...
...
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