Skip to content
Snippets Groups Projects
Unverified Commit aacaf1af authored by Eduardo Sanz-Garcia's avatar Eduardo Sanz-Garcia
Browse files

Remove JS functionality

parent eed3e6f5
Branches andrey-remove-group-caching
No related tags found
No related merge requests found
Loading
Loading
@@ -5,31 +5,6 @@ import RecoveryCodes from './components/recovery_codes.vue';
import TwoFactorActionConfirm from './components/two_factor_action_confirm.vue';
import { SUCCESS_QUERY_PARAM } from './constants';
 
export const initConfigureTwoFactorLater = () => {
const el = document.querySelector('.js-two-factor-configure-later');
const flashAlert = document.querySelector('.flash-alert');
if (!el || !flashAlert) {
return;
}
const { twoFactorConfigureLater, twoFactorSkipUrl, button } = el.dataset;
const canConfigureLater = parseBoolean(twoFactorConfigureLater);
const alertActionsAlt = `<div class="gl-alert-actions">
<a class="btn gl-button btn-md btn-confirm gl-alert-action" data-testid="configure-it-later-button" data-method="patch" href="${twoFactorSkipUrl}">Configure it later</a>
</div>`;
const alertActions = `<div class="gl-alert-actions">${button}</div>`;
if (canConfigureLater) {
// eslint-disable-next-line no-unsanitized/method
flashAlert.insertAdjacentHTML('beforeend', alertActions);
// eslint-disable-next-line no-unsanitized/method
flashAlert.insertAdjacentHTML('beforeend', alertActionsAlt);
}
};
export const initRecoveryCodes = () => {
const el = document.querySelector('.js-2fa-recovery-codes');
 
Loading
Loading
import { mount2faRegistration } from '~/authentication/mount_2fa';
import { initWebAuthnRegistration } from '~/authentication/webauthn/registration';
import {
initConfigureTwoFactorLater,
initRecoveryCodes,
initTwoFactorConfirm,
} from '~/authentication/two_factor_auth';
import { initRecoveryCodes, initTwoFactorConfirm } from '~/authentication/two_factor_auth';
 
mount2faRegistration();
initWebAuthnRegistration();
initConfigureTwoFactorLater();
initRecoveryCodes();
initTwoFactorConfirm();
Loading
Loading
@@ -3,8 +3,6 @@
- add_to_breadcrumbs _('Account'), profile_account_path
- troubleshooting_link = link_to _('Try the troubleshooting steps here.'), help_page_path('user/profile/account/two_factor_authentication_troubleshooting.md'), target: '_blank', rel: 'noopener noreferrer'
 
.js-two-factor-configure-later{ data: { two_factor_configure_later: two_factor_skippable?.to_s, button: link_button_to(_('Configure it later'), skip_profile_two_factor_auth_path, { variant: :confirm, method: :patch, data: { testid: 'configure-it-later-button' } }) }}
- if @error
= render Pajamas::AlertComponent.new(title: @error[:message],
variant: :danger,
Loading
Loading
Loading
Loading
@@ -4,7 +4,7 @@ module QA
module Page
module Profile
class TwoFactorAuth < Page::Base
view 'app/assets/javascripts/pages/profiles/two_factor_auths/index.js' do
view 'app/controllers/profiles/two_factor_auths_controller.rb' do
element 'configure-it-later-button'
end
 
Loading
Loading
@@ -23,10 +23,7 @@ class TwoFactorAuth < Page::Base
end
 
def click_configure_it_later_button
# TO DO: Investigate why button does not appear sometimes:
# https://gitlab.com/gitlab-org/gitlab/-/issues/382698
page.refresh
return unless has_element?('configure-it-later-button', wait: 60)
 
click_element 'configure-it-later-button'
wait_until(max_duration: 10, message: "Waiting for create a group page") do
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment