Redirect to creator settings page where necessary (#15298)

* fix: closing divs and  alignments

* fix: closing divs, alignments and add z-elevate

* refactor: remove the confirm email css annd add it to setup_mode

* improve mobile responsiveness

* feat: redirect directly to the new_admin_creator_setting_path from the confirmation email adn the signup

* feat: update the test to no longer show the referral which seems no longer relevant

* fix: update the tests to conform to the new URLS

* update the link
This commit is contained in:
Ridhwana 2021-11-11 14:44:49 +02:00 committed by GitHub
parent 8f7e0b1744
commit 2e31b4ba02
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 12 deletions

View file

@ -11,7 +11,11 @@ class ConfirmationsController < Devise::ConfirmationsController
set_flash_message!(:notice, :confirmed)
if resource.creator?
sign_in(resource)
redirect_to root_path
if FeatureFlag.enabled?(:creator_onboarding)
redirect_to new_admin_creator_setting_path
else
redirect_to root_path
end
else
respond_with_navigational(resource) { redirect_to after_confirmation_path_for(resource_name, resource) }
end

View file

@ -28,7 +28,11 @@ class RegistrationsController < Devise::RegistrationsController
redirect_to confirm_email_path(email: resource.email)
else
sign_in(resource)
redirect_to root_path
if FeatureFlag.enabled?(:creator_onboarding)
redirect_to new_admin_creator_setting_path
else
redirect_to root_path
end
end
else
render action: "by_email"

View file

@ -1,4 +1,4 @@
describe('Creator Setup Page', () => {
describe('Creator Settings Page', () => {
const { baseUrl } = Cypress.config();
beforeEach(() => {
@ -8,7 +8,7 @@ describe('Creator Setup Page', () => {
cy.loginCreator(creator);
});
cy.visit(`${baseUrl}admin/creator_settings/new?referrer=${baseUrl}`);
cy.visit(`${baseUrl}admin/creator_settings/new`);
});
it('should submit the creator settings form', () => {
@ -63,9 +63,6 @@ describe('Creator Setup Page', () => {
cy.findByRole('button', { name: /logo/i }).should('have.attr', 'required');
// should not redirect the creator to the home page when the form is not completely filled out and 'Finish' is clicked
cy.findByRole('button', { name: 'Finish' }).click();
cy.url().should(
'equal',
`${baseUrl}admin/creator_settings/new?referrer=${baseUrl}`,
);
cy.url().should('equal', `${baseUrl}admin/creator_settings/new`);
});
});

View file

@ -96,9 +96,6 @@ describe('Creator Signup Page', () => {
.click();
const { baseUrl } = Cypress.config();
cy.url().should(
'equal',
`${baseUrl}admin/creator_settings/new?referrer=${baseUrl}`,
);
cy.url().should('equal', `${baseUrl}admin/creator_settings/new`);
});
});