DEV: Remove the experimental_ prefix for fullpage login (#29546)

This commit is contained in:
Jan Cernik 2024-11-26 11:08:27 -03:00 committed by GitHub
parent 7333a00ddb
commit 93443adf22
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 29 additions and 18 deletions

View File

@ -118,7 +118,7 @@ export default class LoginPageController extends Controller {
get shouldTriggerRouteAction() {
return (
!this.siteSettings.experimental_full_page_login ||
!this.siteSettings.full_page_login ||
this.siteSettings.enable_discourse_connect
);
}

View File

@ -69,7 +69,7 @@ export default {
...properties,
};
if (siteSettings.experimental_full_page_login) {
if (siteSettings.full_page_login) {
router.transitionTo("login").then((login) => {
Object.keys(loginProps || {}).forEach((key) => {
login.controller.set(key, loginProps[key]);
@ -139,7 +139,7 @@ export default {
skipConfirmation: siteSettings.auth_skip_create_confirm,
};
if (siteSettings.experimental_full_page_login) {
if (siteSettings.full_page_login) {
router.transitionTo("signup").then((signup) => {
const signupController =
signup.controller || owner.lookup("controller:signup");

View File

@ -297,7 +297,7 @@ export default class ApplicationRoute extends DiscourseRoute {
} else {
if (this.isOnlyOneExternalLoginMethod) {
this.login.externalLogin(this.externalLoginMethods[0]);
} else if (this.siteSettings.experimental_full_page_login) {
} else if (this.siteSettings.full_page_login) {
this.router.transitionTo("login").then((login) => {
login.controller.set("canSignUp", this.controller.canSignUp);
if (this.siteSettings.login_required) {
@ -326,7 +326,7 @@ export default class ApplicationRoute extends DiscourseRoute {
this.login.externalLogin(this.externalLoginMethods[0], {
signup: true,
});
} else if (this.siteSettings.experimental_full_page_login) {
} else if (this.siteSettings.full_page_login) {
this.router.transitionTo("signup").then((signup) => {
Object.keys(createAccountProps || {}).forEach((key) => {
signup.controller.set(key, createAccountProps[key]);

View File

@ -11,7 +11,7 @@ export default class LoginRoute extends DiscourseRoute {
beforeModel() {
if (
!this.siteSettings.login_required &&
(!this.siteSettings.experimental_full_page_login ||
(!this.siteSettings.full_page_login ||
this.siteSettings.enable_discourse_connect)
) {
this.router

View File

@ -14,7 +14,7 @@ export default class SignupRoute extends DiscourseRoute {
@action
async showCreateAccount() {
const { canSignUp } = this.controllerFor("application");
if (canSignUp && this.siteSettings.experimental_full_page_login) {
if (canSignUp && this.siteSettings.full_page_login) {
return;
}
const route = await this.router

View File

@ -1,6 +1,6 @@
{{#if
(and
this.siteSettings.experimental_full_page_login
this.siteSettings.full_page_login
(or this.showLogin (not this.siteSettings.login_required))
)
}}

View File

@ -1884,7 +1884,7 @@ en:
pending_users_reminder_delay_minutes: "Notify moderators if new users have been waiting for approval for longer than this many minutes. Set to -1 to disable notifications."
persistent_sessions: "Users will remain logged in when the web browser is closed"
maximum_session_age: "User will remain logged in for n hours since last visit"
experimental_full_page_login: "Replace the login/signup modal with a full page login/signup form."
full_page_login: "Show the login and signup forms in a full page (when unchecked, users will see the forms in a modal). "
ga_version: "Version of Google Universal Analytics to use: v3 (analytics.js), v4 (gtag)"
ga_universal_tracking_code: "Google Universal Analytics tracking code ID, eg: UA-12345678-9; see <a href='https://google.com/analytics' target='_blank'>https://google.com/analytics</a>"
ga_universal_domain_name: "Google Universal Analytics domain name, eg: mysite.com; see <a href='https://google.com/analytics' target='_blank'>https://google.com/analytics</a>"

View File

@ -628,6 +628,9 @@ login:
default: 1440
min: 1
max: 175200
full_page_login:
default: false
client: true
users:
min_username_length:
@ -3295,9 +3298,6 @@ dashboard:
client: true
experimental:
experimental_full_page_login:
default: false
client: true
experimental_rename_faq_to_guidelines:
default: false
hidden: true

View File

@ -0,0 +1,11 @@
# frozen_string_literal: true
class RenameFullPageSiteSetting < ActiveRecord::Migration[7.1]
def up
execute "UPDATE site_settings SET name = 'full_page_login' where name = 'experimental_full_page_login'"
end
def down
execute "UPDATE site_settings SET name = 'experimental_full_page_login' where name = 'full_page_login'"
end
end

View File

@ -252,12 +252,12 @@ describe "Login", type: :system do
end
context "when fullpage desktop" do
before { SiteSetting.experimental_full_page_login = true }
before { SiteSetting.full_page_login = true }
include_examples "login scenarios", PageObjects::Pages::Login.new
end
context "when fullpage mobile", mobile: true do
before { SiteSetting.experimental_full_page_login = true }
before { SiteSetting.full_page_login = true }
include_examples "login scenarios", PageObjects::Pages::Login.new
end
end

View File

@ -295,14 +295,14 @@ describe "Signup", type: :system do
end
context "when fullpage desktop" do
before { SiteSetting.experimental_full_page_login = true }
before { SiteSetting.full_page_login = true }
include_examples "signup scenarios",
PageObjects::Pages::Signup.new,
PageObjects::Pages::Login.new
end
context "when fullpage mobile", mobile: true do
before { SiteSetting.experimental_full_page_login = true }
before { SiteSetting.full_page_login = true }
include_examples "signup scenarios",
PageObjects::Pages::Signup.new,
PageObjects::Pages::Login.new

View File

@ -348,14 +348,14 @@ describe "Social authentication", type: :system do
end
context "when fullpage desktop" do
before { SiteSetting.experimental_full_page_login = true }
before { SiteSetting.full_page_login = true }
include_examples "social authentication scenarios",
PageObjects::Pages::Signup.new,
PageObjects::Pages::Login.new
end
context "when fullpage mobile", mobile: true do
before { SiteSetting.experimental_full_page_login = true }
before { SiteSetting.full_page_login = true }
include_examples "social authentication scenarios",
PageObjects::Pages::Signup.new,
PageObjects::Pages::Login.new