Make final Auth Provider Refactor code changes (#11303)
This commit is contained in:
parent
08796b5cee
commit
4d93112084
3 changed files with 12 additions and 12 deletions
|
|
@ -130,13 +130,13 @@ label {
|
|||
}
|
||||
|
||||
&--label {
|
||||
.enabled-indicator-hidden {
|
||||
.enabled-indicator {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.enabled-indicator-visible {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
&.visible {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ export default class ConfigController extends Controller {
|
|||
if (this.emailAuthSettingsBtnTarget.dataset.buttonText === 'enable') {
|
||||
emailSigninAndLoginCheckbox.checked = true;
|
||||
this.emailAuthSettingsBtnTarget.setAttribute('data-button-text', 'edit');
|
||||
this.enabledIndicatorTarget.classList.toggle('enabled-indicator-visible');
|
||||
this.enabledIndicatorTarget.classList.add('visible');
|
||||
}
|
||||
this.emailAuthSettingsBtnTarget.classList.add('hidden');
|
||||
emailAuthSettingsSection.classList.remove('hidden');
|
||||
|
|
@ -111,7 +111,7 @@ export default class ConfigController extends Controller {
|
|||
emailSigninAndLoginCheckbox.checked = false;
|
||||
this.emailAuthSettingsBtnTarget.innerHTML = 'Enable';
|
||||
this.emailAuthSettingsBtnTarget.setAttribute('data-button-text', 'enable');
|
||||
this.enabledIndicatorTarget.classList.toggle('enabled-indicator-visible');
|
||||
this.enabledIndicatorTarget.classList.remove('visible');
|
||||
this.hideEmailAuthSettings(event);
|
||||
}
|
||||
|
||||
|
|
@ -126,7 +126,7 @@ export default class ConfigController extends Controller {
|
|||
`#${provider}-enabled-indicator`,
|
||||
);
|
||||
if (event.target.dataset.buttonText === 'enable') {
|
||||
enabledIndicator.classList.add('enabled-indicator-visible');
|
||||
enabledIndicator.classList.add('visible');
|
||||
event.target.setAttribute('data-enable-auth', 'true');
|
||||
this.listAuthToBeEnabled();
|
||||
}
|
||||
|
|
@ -146,7 +146,7 @@ export default class ConfigController extends Controller {
|
|||
`[data-auth-provider-enable="${provider}"]`,
|
||||
);
|
||||
authEnableButton.setAttribute('data-enable-auth', 'false');
|
||||
enabledIndicator.classList.remove('enabled-indicator-visible');
|
||||
enabledIndicator.classList.remove('visible');
|
||||
this.listAuthToBeEnabled(event);
|
||||
this.hideAuthProviderSettings(event);
|
||||
}
|
||||
|
|
@ -188,7 +188,7 @@ export default class ConfigController extends Controller {
|
|||
authEnableButton.setAttribute('data-enable-auth', 'false');
|
||||
this.listAuthToBeEnabled(event);
|
||||
this.checkForAndGuardSoleAuthProvider();
|
||||
enabledIndicator.classList.remove('enabled-indicator-visible');
|
||||
enabledIndicator.classList.remove('visible');
|
||||
this.hideAuthProviderSettings(event);
|
||||
this.closeAdminConfigModal(event);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@
|
|||
Email address
|
||||
</p>
|
||||
<div
|
||||
class="enabled-indicator-hidden <%= SiteConfig.allow_both_email_signup_and_login ? "enabled-indicator-visible" : "" %>"
|
||||
class="enabled-indicator <%= SiteConfig.allow_both_email_signup_and_login ? "visible" : "" %>"
|
||||
data-target="config.enabledIndicator">
|
||||
<%= inline_svg_tag("checkmark.svg", aria: true, class: "crayons-icon admin-config-checkmark", title: "Checkmark") %>
|
||||
<small class="crayons-field__description ml-1">Enabled</small>
|
||||
|
|
@ -278,7 +278,7 @@
|
|||
</p>
|
||||
<div
|
||||
id="<%= provider.provider_name %>-enabled-indicator"
|
||||
class="enabled-indicator-hidden <%= authentication_enabled_providers.include?(provider) ? "enabled-indicator-visible" : "" %>">
|
||||
class="enabled-indicator <%= authentication_enabled_providers.include?(provider) ? "visible" : "" %>">
|
||||
<%= inline_svg_tag("checkmark.svg", aria: true, class: "crayons-icon admin-config-checkmark", title: "Checkmark") %>
|
||||
<small class="crayons-field__description ml-1">Enabled</small>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue