diff --git a/app/assets/javascripts/initializers/initializeBodyData.js b/app/assets/javascripts/initializers/initializeBodyData.js index 2edd5f748..b8679f522 100644 --- a/app/assets/javascripts/initializers/initializeBodyData.js +++ b/app/assets/javascripts/initializers/initializeBodyData.js @@ -42,7 +42,6 @@ function fetchBaseData() { if (checkUserLoggedIn()) { document.body.dataset.user = json.user; document.body.dataset.creator = json.creator; - document.body.dataset.creatorOnboarding = json.creator_onboarding; browserStoreCache('set', json.user); setTimeout(() => { @@ -54,7 +53,6 @@ function fetchBaseData() { // Ensure user data is not exposed if no one is logged in delete document.body.dataset.user; delete document.body.dataset.creator; - delete document.body.dataset.creatorOnboarding; browserStoreCache('remove'); } } diff --git a/app/controllers/async_info_controller.rb b/app/controllers/async_info_controller.rb index 4b1d84f93..1f7e86ef3 100644 --- a/app/controllers/async_info_controller.rb +++ b/app/controllers/async_info_controller.rb @@ -19,8 +19,7 @@ class AsyncInfoController < ApplicationController param: request_forgery_protection_token, token: form_authenticity_token, user: user_data, - creator: user_is_a_creator, - creator_onboarding: use_creator_onboarding + creator: user_is_a_creator } end end @@ -67,10 +66,6 @@ class AsyncInfoController < ApplicationController @user.creator? end - def use_creator_onboarding - FeatureFlag.enabled?(:creator_onboarding) && user_is_a_creator - end - def user_cache_key "user-info-#{current_user&.id}__ #{current_user&.last_sign_in_at}__ diff --git a/app/controllers/confirmations_controller.rb b/app/controllers/confirmations_controller.rb index 74949d12a..bfe780918 100644 --- a/app/controllers/confirmations_controller.rb +++ b/app/controllers/confirmations_controller.rb @@ -11,11 +11,7 @@ class ConfirmationsController < Devise::ConfirmationsController set_flash_message!(:notice, :confirmed) if resource.creator? sign_in(resource) - if FeatureFlag.enabled?(:creator_onboarding) - redirect_to new_admin_creator_setting_path - else - redirect_to root_path - end + redirect_to new_admin_creator_setting_path else respond_with_navigational(resource) { redirect_to after_confirmation_path_for(resource_name, resource) } end diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index 26942f5d1..346506dc3 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -28,7 +28,7 @@ class RegistrationsController < Devise::RegistrationsController redirect_to confirm_email_path(email: resource.email) else sign_in(resource) - if FeatureFlag.enabled?(:creator_onboarding) + if resource.roles.includes(:creator).any? redirect_to new_admin_creator_setting_path else redirect_to root_path @@ -78,7 +78,7 @@ class RegistrationsController < Devise::RegistrationsController resource.registered_at = Time.current resource.build_setting(editor_version: "v2") resource.remote_profile_image_url = Users::ProfileImageGenerator.call if resource.profile_image.blank? - if FeatureFlag.enabled?(:creator_onboarding) + if Settings::General.waiting_on_first_user resource.password_confirmation = resource.password end check_allowed_email(resource) if resource.email.present? diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 6144ab32e..cae03a8c0 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -301,7 +301,6 @@ module ApplicationHelper end def creator_settings_form? - return unless FeatureFlag.enabled?(:creator_onboarding) return unless User.with_role(:creator).any? creator = User.with_role(:creator).first diff --git a/app/helpers/authentication_helper.rb b/app/helpers/authentication_helper.rb index 9fa2845cb..738a963ea 100644 --- a/app/helpers/authentication_helper.rb +++ b/app/helpers/authentication_helper.rb @@ -37,10 +37,6 @@ module AuthenticationHelper Authentication::Providers.available.map(&:to_s) end - def forem_creator_flow_enabled? - FeatureFlag.enabled?(:creator_onboarding) && waiting_on_first_user? - end - def waiting_on_first_user? Settings::General.waiting_on_first_user end diff --git a/app/javascript/packs/onboardingRedirectCheck.jsx b/app/javascript/packs/onboardingRedirectCheck.jsx index 3f3e114e8..e63920ffc 100644 --- a/app/javascript/packs/onboardingRedirectCheck.jsx +++ b/app/javascript/packs/onboardingRedirectCheck.jsx @@ -34,9 +34,7 @@ function onboardingSkippable(currentUser) { function onboardCreator(currentUser) { return ( - document.body.dataset.creator === 'true' && - document.body.dataset.creatorOnboarding === 'true' && - !currentUser.saw_onboarding + document.body.dataset.creator === 'true' && !currentUser.saw_onboarding ); } diff --git a/app/views/admin/creator_settings/new.html.erb b/app/views/admin/creator_settings/new.html.erb index e54bc1e4a..9cea455c0 100644 --- a/app/views/admin/creator_settings/new.html.erb +++ b/app/views/admin/creator_settings/new.html.erb @@ -1,4 +1,4 @@ -<% if FeatureFlag.enabled?(:creator_onboarding) && User.with_role(:creator).any? %> +<% if User.with_role(:creator).any? %> diff --git a/app/views/admin/settings/forms/_images.html.erb b/app/views/admin/settings/forms/_images.html.erb index d9773d7ed..910636d5d 100644 --- a/app/views/admin/settings/forms/_images.html.erb +++ b/app/views/admin/settings/forms/_images.html.erb @@ -11,25 +11,7 @@ } %>
- - <% if FeatureFlag.enabled?(:creator_onboarding) %> - <%= render partial: "admin/shared/logo_upload", locals: { f: f, allowed_types: logo_allowed_types, max_file_size: logo_max_file_size, logo: Settings::General.resized_logo } %> - <% else %> -
- <%= admin_config_label :logo_svg, "SVG logo (soon to be deprecated)" %> - <%= admin_config_description Constants::Settings::General::DETAILS[:logo_svg][:description] %> - <%= f.text_area :logo_svg, - class: "crayons-textfield", - value: Settings::General.logo_svg, - rows: 6, - placeholder: Constants::Settings::General::DETAILS[:logo_svg][:placeholder] %> - <% if Settings::General.logo_svg.present? %> - - <% end %> -
- <% end %> + <%= render partial: "admin/shared/logo_upload", locals: { f: f, allowed_types: logo_allowed_types, max_file_size: logo_max_file_size, logo: Settings::General.resized_logo } %>
<%= admin_config_label :logo_png, "Secondary Logo" %> diff --git a/app/views/admin/shared/_logo_upload.html.erb b/app/views/admin/shared/_logo_upload.html.erb index ef299f029..b0239b558 100644 --- a/app/views/admin/shared/_logo_upload.html.erb +++ b/app/views/admin/shared/_logo_upload.html.erb @@ -3,11 +3,7 @@ Logo <% end %> - <% if FeatureFlag.enabled?(:creator_onboarding) %> -

Your logo will display in the upper left hand corner of your Forem. Upload a PNG or JPEG with a maximum size of 4096x4096px.

- <% else %> -

You can adjust what your logo will look like here but it will not be live on the visitor facing site until after the release on 17 January. Upload a PNG or JPEG with a maximum size of 4096x4096px.

- <% end %> +

Your logo will display in the upper left hand corner of your Forem. Upload a PNG or JPEG with a maximum size of 4096x4096px.

<%= f.file_field :logo, accept: allowed_types.to_s, aria_describedby: "logo-subtitle", data: { "max-file-size-mb": max_file_size.to_s, action: "change->logo-upload#previewLogo" } %> diff --git a/app/views/devise/confirmations/new.html.erb b/app/views/devise/confirmations/new.html.erb index 2e4fa6801..ab277ff02 100644 --- a/app/views/devise/confirmations/new.html.erb +++ b/app/views/devise/confirmations/new.html.erb @@ -1,68 +1,41 @@ <% title "Confirm your email" %> <% proper_email = params[:email] || (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %>
- <% if FeatureFlag.enabled?(:creator_onboarding) %> - - <%= javascript_packs_with_chunks_tag "confirmationEmail", defer: true %> + + <%= javascript_packs_with_chunks_tag "confirmationEmail", defer: true %> -
- <%= render "devise/shared/error_messages", resource: resource %> - <%= inline_svg_tag("mail.svg", aria: true, title: "Email", class: "mb-6") %> -

Great! Now confirm your email address.

- <% if proper_email.present? %> -

- We've sent an email to <%= proper_email %>. - Click the button inside to confirm your email.

-

- <% end %> -
-
- if you didn't get the email... -
+
+ <%= render "devise/shared/error_messages", resource: resource %> + <%= inline_svg_tag("mail.svg", aria: true, title: "Email", class: "mb-6") %> +

Great! Now confirm your email address.

+ <% if proper_email.present? %> +

+ We've sent an email to <%= proper_email %>. + Click the button inside to confirm your email.

+

+ <% end %> +
+
+ if you didn't get the email... +
- <%= inline_svg_tag("forem-background.svg", aria: true, title: "forem background", class: "forem-background absolute bottom-0 right-0 hidden m:block") %> + <%= inline_svg_tag("forem-background.svg", aria: true, title: "forem background", class: "forem-background absolute bottom-0 right-0 hidden m:block") %> - - <% else %> -
- - <% if came_from_sign_up? %> -

Welcome to <%= community_name %>! 🎉

- <% end %> - <% if proper_email.present? %> -

A confirmation email has been sent to <%= proper_email %>

- <% end %> - -
-

Didn't get the email?

- <%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }, data: { testid: "resend-confirmation-form" }) do |f| %> - <%= render "devise/shared/error_messages", resource: resource %> - -
- <%= f.email_field :email, class: "crayons-textfield", aria: { label: "Confirmation email address" }, autofocus: false, value: proper_email %> -
- -
- <%= f.submit "Resend confirmation instructions", class: "crayons-btn" %> -
- <% end %> + - <% end %> + +
+ <%= f.submit "Resend", role: "button", class: "crayons-btn mr-1" %> + +
+ <% end %> +
diff --git a/app/views/devise/registrations/by_email.html.erb b/app/views/devise/registrations/by_email.html.erb index 8f83f1610..c60f5dbaa 100644 --- a/app/views/devise/registrations/by_email.html.erb +++ b/app/views/devise/registrations/by_email.html.erb @@ -1,4 +1,4 @@ -<% if forem_creator_flow_enabled? && waiting_on_first_user? %> +<% if waiting_on_first_user? %> <%= render "shared/authentication/forem_creator_signup" %> <% else %> <%= render "shared/authentication/email_registration_form" %> diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb index dda5e9ca5..e7fc23c30 100644 --- a/app/views/devise/registrations/new.html.erb +++ b/app/views/devise/registrations/new.html.erb @@ -6,14 +6,11 @@ -<% elsif forem_creator_flow_enabled? %> +<% elsif waiting_on_first_user? %> <%= render "shared/authentication/forem_creator_signup" %> -<% elsif waiting_on_first_user? %> - <%# TODO: [@ridhwana]: Delete this view once forem creator onboarding is shipped %> - <%= render "shared/authentication/initial_account_wizard" %> <% else %> <%= render "devise/shared/authorization_error" %> <%= render "devise/registrations/registration_form" %> diff --git a/app/views/layouts/_logo.html.erb b/app/views/layouts/_logo.html.erb index 91289e05f..0590b2869 100644 --- a/app/views/layouts/_logo.html.erb +++ b/app/views/layouts/_logo.html.erb @@ -1,21 +1,9 @@ diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index d287abc24..b2a44fe47 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -44,9 +44,7 @@ <% end %> <% unless internal_navigation? %> - - <% cache(release_adjusted_cache_key("top-html-and-config--#{user_signed_in?}--#{FeatureFlag.enabled?(:creator_onboarding)}")) do %> + <% cache(release_adjusted_cache_key("top-html-and-config--#{user_signed_in?}")) do %> Some svg" } let(:resized_logo) { "default.png" } before do sign_in user end - context "when Feature flag creator_onboarding is disabled" do - before do - allow(Settings::General).to receive(:logo_svg).and_return(logo_svg) - allow(FeatureFlag).to receive(:enabled?).with(:creator_onboarding).and_return(false) - end - - it "renders the logo_svg" do - visit root_path - expect(page).to have_css(".site-logo") - within(".site-logo") do - expect(page.html).to have_text("Some svg") - end - end - end - context "when Feature flag creator_onboarding is enabled" do before do allow(FeatureFlag).to receive(:enabled?).with(:creator_onboarding).and_return(true)