From ea84c66fe0675976b2005d010c142f6171be3335 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Thu, 2 Sep 2021 14:15:04 -0400 Subject: [PATCH 001/411] DEV: This constructs a `pluginId` for `modifyClass` when dispatching events It also helpfully adds the `ignoreMissing` option which was causing logging issues on optional modifications before. --- .../javascripts/discourse/app/lib/plugin-api.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/discourse/app/lib/plugin-api.js b/app/assets/javascripts/discourse/app/lib/plugin-api.js index 35877fa5aa..64299bcd5a 100644 --- a/app/assets/javascripts/discourse/app/lib/plugin-api.js +++ b/app/assets/javascripts/discourse/app/lib/plugin-api.js @@ -1387,12 +1387,17 @@ class PluginApi { * is converted to camelCase and used as the method name for you. */ dispatchWidgetAppEvent(mountedComponent, widgetKey, appEvent) { - this.modifyClass(`component:${mountedComponent}`, { - didInsertElement() { - this._super(); - this.dispatch(appEvent, widgetKey); + this.modifyClass( + `component:${mountedComponent}`, + { + pluginId: `#{mountedComponent}/#{widgetKey}/#{appEvent}`, + didInsertElement() { + this._super(); + this.dispatch(appEvent, widgetKey); + }, }, - }); + { ignoreMissing: true } + ); } } From 90a23c6fc8c58de64a0433c9c427e4d44b43ba69 Mon Sep 17 00:00:00 2001 From: Penar Musaraj Date: Thu, 2 Sep 2021 14:55:38 -0400 Subject: [PATCH 002/411] FEATURE: Enable auto dark mode on new instances (#14208) --- db/fixtures/600_themes.rb | 8 ++++ lib/wizard/builder.rb | 16 +++++--- spec/components/wizard/step_updater_spec.rb | 45 +++++++++++++++++++-- 3 files changed, 59 insertions(+), 10 deletions(-) diff --git a/db/fixtures/600_themes.rb b/db/fixtures/600_themes.rb index c5945864b5..14ec9170f4 100644 --- a/db/fixtures/600_themes.rb +++ b/db/fixtures/600_themes.rb @@ -18,4 +18,12 @@ if !Theme.exists? name = I18n.t('color_schemes.default_theme_name') default_theme = Theme.create!(name: name, user_id: -1) default_theme.set_default! + + if SiteSetting.default_dark_mode_color_scheme_id == SiteSetting.defaults[:default_dark_mode_color_scheme_id] + dark_scheme_id = ColorScheme.where(base_scheme_id: "Dark").pluck_first(:id) + + if dark_scheme_id.present? + SiteSetting.default_dark_mode_color_scheme_id = dark_scheme_id + end + end end diff --git a/lib/wizard/builder.rb b/lib/wizard/builder.rb index d6006682a1..34bcaad386 100644 --- a/lib/wizard/builder.rb +++ b/lib/wizard/builder.rb @@ -203,6 +203,14 @@ class Wizard updater.update_setting(:base_font, updater.fields[:body_font]) updater.update_setting(:heading_font, updater.fields[:heading_font]) + if updater.fields[:homepage_style] == 'latest' + top_menu = "latest|new|unread|top|categories" + else + top_menu = "categories|latest|new|unread|top" + updater.update_setting(:desktop_category_page_style, updater.fields[:homepage_style]) + end + updater.update_setting(:top_menu, top_menu) + scheme_name = ( (updater.fields[:color_scheme] || "") || ColorScheme::LIGHT_THEME_ID @@ -228,13 +236,9 @@ class Wizard theme.set_default! end - if updater.fields[:homepage_style] == 'latest' - top_menu = "latest|new|unread|top|categories" - else - top_menu = "categories|latest|new|unread|top" - updater.update_setting(:desktop_category_page_style, updater.fields[:homepage_style]) + if scheme.is_dark? + updater.update_setting(:default_dark_mode_color_scheme_id, -1) end - updater.update_setting(:top_menu, top_menu) end end diff --git a/spec/components/wizard/step_updater_spec.rb b/spec/components/wizard/step_updater_spec.rb index d0d3f38865..fdf50b81b0 100644 --- a/spec/components/wizard/step_updater_spec.rb +++ b/spec/components/wizard/step_updater_spec.rb @@ -169,7 +169,11 @@ describe Wizard::StepUpdater do context "styling step" do it "updates fonts" do - updater = wizard.create_updater('styling', body_font: 'open_sans', heading_font: 'oswald') + updater = wizard.create_updater('styling', + body_font: 'open_sans', + heading_font: 'oswald', + homepage_style: 'latest' + ) updater.update expect(updater.success?).to eq(true) expect(wizard.completed_steps?('styling')).to eq(true) @@ -182,7 +186,12 @@ describe Wizard::StepUpdater do fab!(:color_scheme) { Fabricate(:color_scheme, name: 'existing', via_wizard: true) } it "updates the scheme" do - updater = wizard.create_updater('styling', color_scheme: 'Dark', body_font: 'arial', heading_font: 'arial', homepage_style: 'latest') + updater = wizard.create_updater('styling', + color_scheme: 'Dark', + body_font: 'arial', + heading_font: 'arial', + homepage_style: 'latest' + ) updater.update expect(updater.success?).to eq(true) expect(wizard.completed_steps?('styling')).to eq(true) @@ -277,12 +286,41 @@ describe Wizard::StepUpdater do expect(theme.color_scheme_id).to eq(color_scheme.id) end end + + context "auto dark mode" do + before do + dark_scheme = ColorScheme.where(name: "Dark").first + SiteSetting.default_dark_mode_color_scheme_id = dark_scheme.id + end + + it "does nothing when selected scheme is light" do + updater = wizard.create_updater('styling', + color_scheme: 'Neutral', + body_font: 'arial', + heading_font: 'arial', + homepage_style: 'latest' + ) + + expect { updater.update }.not_to change { SiteSetting.default_dark_mode_color_scheme_id } + end + + it "unsets auto dark mode site setting when default selected scheme is also dark" do + updater = wizard.create_updater('styling', + color_scheme: 'Latte', + body_font: 'arial', + heading_font: 'arial', + homepage_style: 'latest' + ) + + expect { updater.update }.to change { SiteSetting.default_dark_mode_color_scheme_id }.to(-1) + end + end + end context "homepage style" do it "updates the fields correctly" do updater = wizard.create_updater('styling', - color_scheme: 'Dark', body_font: 'arial', heading_font: 'arial', homepage_style: "categories_and_top_topics" @@ -295,7 +333,6 @@ describe Wizard::StepUpdater do expect(SiteSetting.desktop_category_page_style).to eq('categories_and_top_topics') updater = wizard.create_updater('styling', - color_scheme: 'Dark', body_font: 'arial', heading_font: 'arial', homepage_style: "latest" From 75041dbbebddd677d7421984a2fb3a42dda8fcb7 Mon Sep 17 00:00:00 2001 From: Kris Date: Thu, 2 Sep 2021 15:35:35 -0400 Subject: [PATCH 003/411] UX: Remove `:empty` on topic-statuses, clean up (#14227) --- app/assets/stylesheets/common/base/_topic-list.scss | 3 --- app/assets/stylesheets/common/base/discourse.scss | 7 ++----- app/assets/stylesheets/common/base/reviewables.scss | 5 ----- app/assets/stylesheets/common/base/topic.scss | 4 ---- .../stylesheets/common/components/bookmark-list.scss | 4 ---- app/assets/stylesheets/desktop/category-list.scss | 3 --- app/assets/stylesheets/desktop/compose.scss | 3 --- 7 files changed, 2 insertions(+), 27 deletions(-) diff --git a/app/assets/stylesheets/common/base/_topic-list.scss b/app/assets/stylesheets/common/base/_topic-list.scss index f7421d090d..cf1105b23c 100644 --- a/app/assets/stylesheets/common/base/_topic-list.scss +++ b/app/assets/stylesheets/common/base/_topic-list.scss @@ -287,9 +287,6 @@ line-height: $line-height-large; padding-right: 20px; } - .topic-statuses:empty { - display: none; - } .num { text-align: center; diff --git a/app/assets/stylesheets/common/base/discourse.scss b/app/assets/stylesheets/common/base/discourse.scss index 9302558e83..0ab244d69c 100644 --- a/app/assets/stylesheets/common/base/discourse.scss +++ b/app/assets/stylesheets/common/base/discourse.scss @@ -829,20 +829,17 @@ table { } .topic-statuses { - display: inline; + // avoid adding margin/padding on this parent; sometimes it appears as an empty container float: left; - margin-right: 0.15em; .topic-status { margin: 0; display: inline-flex; color: var(--primary-medium); + margin-right: 0.2em; .d-icon { height: 0.74em; width: 0.75em; } - &:not(:last-child) { - margin-right: 0.15em; - } } .topic-status-warning .d-icon-envelope { diff --git a/app/assets/stylesheets/common/base/reviewables.scss b/app/assets/stylesheets/common/base/reviewables.scss index a612151746..f61657fe66 100644 --- a/app/assets/stylesheets/common/base/reviewables.scss +++ b/app/assets/stylesheets/common/base/reviewables.scss @@ -465,11 +465,6 @@ font-size: $font-up-2; margin-right: 0.75em; } - .topic-statuses { - &:empty { - display: none; - } - } } } diff --git a/app/assets/stylesheets/common/base/topic.scss b/app/assets/stylesheets/common/base/topic.scss index 69c4b6445b..0a5bdc56ab 100644 --- a/app/assets/stylesheets/common/base/topic.scss +++ b/app/assets/stylesheets/common/base/topic.scss @@ -158,10 +158,6 @@ } .topic-statuses { line-height: 1.2; - margin-right: 0.15em; - &:empty { - margin-right: 0; - } .d-icon { color: var(--primary-medium); } diff --git a/app/assets/stylesheets/common/components/bookmark-list.scss b/app/assets/stylesheets/common/components/bookmark-list.scss index 1777e6b1df..ce922a71d2 100644 --- a/app/assets/stylesheets/common/components/bookmark-list.scss +++ b/app/assets/stylesheets/common/components/bookmark-list.scss @@ -70,10 +70,6 @@ $mobile-breakpoint: 700px; } .topic-statuses { float: none; - &:empty { - // avoids extra margin - display: none; - } } } diff --git a/app/assets/stylesheets/desktop/category-list.scss b/app/assets/stylesheets/desktop/category-list.scss index 66e11d1626..28f4ebb1dd 100644 --- a/app/assets/stylesheets/desktop/category-list.scss +++ b/app/assets/stylesheets/desktop/category-list.scss @@ -84,9 +84,6 @@ @include ellipsis; flex: 0 1 auto; } - .topic-statuses { - margin-right: 0.15em; - } .topic-post-badges .badge.unread-posts, .title { margin-right: 5px; diff --git a/app/assets/stylesheets/desktop/compose.scss b/app/assets/stylesheets/desktop/compose.scss index 2e9dde05fc..4a4613d612 100644 --- a/app/assets/stylesheets/desktop/compose.scss +++ b/app/assets/stylesheets/desktop/compose.scss @@ -195,9 +195,6 @@ flex: 0 1 auto; margin-right: 0.5em; } - .topic-statuses:empty { - display: none; - } span.badge-wrapper { margin-left: 0; } From e0d2de73d89cdea13e9681b2daaa52074ee510a5 Mon Sep 17 00:00:00 2001 From: Martin Brennan Date: Fri, 3 Sep 2021 08:59:22 +1000 Subject: [PATCH 004/411] A11Y: Improve create account modal for screen readers (#14204) Improves the create account modal for screen readers by doing the following: * Making the `modal-alert` section into an `aria-role="alert"` region and making it show and hide using height instead of display:none so screen readers pick it up. Made a change so the field-related error messages are always shown beneath the field. * Add `aria-invalid` and `aria-describedby` attributes to each field in the modal, so the screen reader will read out the error hint on error. This necessitated an Ember component extension to allow both the `aria-*` attributes to be bound and to render on `{{input}}`. * Moved the social login buttons to the right in the HTML structure so they are not read out first. * Added `aria-label` attributes to the login buttons so they can have different content for screen readers. * In some cases for modals, the title that should be used for the `aria-labelledby` attribute is within the modal content and not the discourse-modal-title title. This introduces a new titleAriaElementId property to the d-modal component that is then used by the create-account modal to read out the --- app/assets/javascripts/discourse-loader.js | 3 + .../discourse/app/components/d-modal-body.js | 25 ++++-- .../discourse/app/components/d-modal.js | 18 ++-- .../app/controllers/create-account.js | 30 ++++--- .../discourse/app/controllers/login.js | 5 +- .../ember-input-component-extension.js | 11 +++ .../discourse/app/lib/show-modal.js | 4 + .../discourse/app/mixins/name-validation.js | 8 +- .../app/mixins/password-validation.js | 10 ++- .../app/mixins/username-validation.js | 8 +- .../discourse/app/models/login-method.js | 5 ++ .../discourse/app/routes/application.js | 13 ++- .../app/templates/components/d-modal.hbs | 2 +- .../templates/components/login-buttons.hbs | 2 +- .../discourse/app/templates/modal.hbs | 1 + .../app/templates/modal/create-account.hbs | 82 +++++++++++++------ .../create-account-user-fields-test.js | 8 +- app/assets/stylesheets/common/base/login.scss | 5 +- config/locales/client.en.yml | 6 ++ 19 files changed, 177 insertions(+), 69 deletions(-) create mode 100644 app/assets/javascripts/discourse/app/initializers/ember-input-component-extension.js diff --git a/app/assets/javascripts/discourse-loader.js b/app/assets/javascripts/discourse-loader.js index f903dbe491..54cef936e6 100644 --- a/app/assets/javascripts/discourse-loader.js +++ b/app/assets/javascripts/discourse-loader.js @@ -163,6 +163,9 @@ var define, requirejs; "@ember/object/internals": { guidFor: Ember.guidFor, }, + "@ember/views/text-support": { + default: Ember.TextSupport, + }, I18n: { // eslint-disable-next-line default: I18n, diff --git a/app/assets/javascripts/discourse/app/components/d-modal-body.js b/app/assets/javascripts/discourse/app/components/d-modal-body.js index 2ea7d11324..1e46c4442a 100644 --- a/app/assets/javascripts/discourse/app/components/d-modal-body.js +++ b/app/assets/javascripts/discourse/app/components/d-modal-body.js @@ -8,7 +8,10 @@ export default Component.extend({ didInsertElement() { this._super(...arguments); - $("#modal-alert").hide(); + this._modalAlertElement = document.getElementById("modal-alert"); + if (this._modalAlertElement) { + this._modalAlertElement.innerHTML = ""; + } let fixedParent = $(this.element).closest(".d-modal.fixed-modal"); if (fixedParent.length) { @@ -55,10 +58,10 @@ export default Component.extend({ }, _clearFlash() { - const modalAlert = document.getElementById("modal-alert"); - if (modalAlert) { - modalAlert.style.display = "none"; - modalAlert.classList.remove( + if (this._modalAlertElement) { + this._modalAlertElement.innerHTML = ""; + this._modalAlertElement.classList.remove( + "alert", "alert-error", "alert-info", "alert-success", @@ -69,10 +72,14 @@ export default Component.extend({ _flash(msg) { this._clearFlash(); + if (!this._modalAlertElement) { + return; + } - $("#modal-alert") - .addClass(`alert alert-${msg.messageClass || "success"}`) - .html(msg.text || "") - .fadeIn(); + this._modalAlertElement.classList.add( + "alert", + `alert-${msg.messageClass || "success"}` + ); + this._modalAlertElement.innerHTML = msg.text || ""; }, }); diff --git a/app/assets/javascripts/discourse/app/components/d-modal.js b/app/assets/javascripts/discourse/app/components/d-modal.js index a08ec543e9..941a0ca556 100644 --- a/app/assets/javascripts/discourse/app/components/d-modal.js +++ b/app/assets/javascripts/discourse/app/components/d-modal.js @@ -1,8 +1,7 @@ -import { computed } from "@ember/object"; import Component from "@ember/component"; import I18n from "I18n"; import { next, schedule } from "@ember/runloop"; -import { bind, on } from "discourse-common/utils/decorators"; +import discourseComputed, { bind, on } from "discourse-common/utils/decorators"; export default Component.extend({ classNameBindings: [ @@ -21,6 +20,7 @@ export default Component.extend({ submitOnEnter: true, dismissable: true, title: null, + titleAriaElementId: null, subtitle: null, role: "dialog", headerClass: null, @@ -41,9 +41,17 @@ export default Component.extend({ // Inform screenreaders of the modal "aria-modal": "true", - ariaLabelledby: computed("title", function () { - return this.title ? "discourse-modal-title" : null; - }), + @discourseComputed("title", "titleAriaElementId") + ariaLabelledby(title, titleAriaElementId) { + if (titleAriaElementId) { + return titleAriaElementId; + } + if (title) { + return "discourse-modal-title"; + } + + return; + }, @on("didInsertElement") setUp() { diff --git a/app/assets/javascripts/discourse/app/controllers/create-account.js b/app/assets/javascripts/discourse/app/controllers/create-account.js index 52a3f7230a..b58957450d 100644 --- a/app/assets/javascripts/discourse/app/controllers/create-account.js +++ b/app/assets/javascripts/discourse/app/controllers/create-account.js @@ -140,16 +140,19 @@ export default Controller.extend( "serverAccountEmail", "serverEmailValidation", "accountEmail", - "rejectedEmails.[]" + "rejectedEmails.[]", + "forceValidationReason" ) emailValidation( serverAccountEmail, serverEmailValidation, email, - rejectedEmails + rejectedEmails, + forceValidationReason ) { const failedAttrs = { failed: true, + ok: false, element: document.querySelector("#new-account-email"), }; @@ -162,6 +165,9 @@ export default Controller.extend( return EmberObject.create( Object.assign(failedAttrs, { message: I18n.t("user.email.required"), + reason: forceValidationReason + ? I18n.t("user.email.required") + : null, }) ); } @@ -426,6 +432,7 @@ export default Controller.extend( createAccount() { this.clearFlash(); + this.set("forceValidationReason", true); const validation = [ this.emailValidation, this.usernameValidation, @@ -435,23 +442,22 @@ export default Controller.extend( ].find((v) => v.failed); if (validation) { - if (validation.message) { - this.flash(validation.message, "error"); - } - const element = validation.element; - if (element.tagName === "DIV") { - if (element.scrollIntoView) { - element.scrollIntoView(); + if (element) { + if (element.tagName === "DIV") { + if (element.scrollIntoView) { + element.scrollIntoView(); + } + element.click(); + } else { + element.focus(); } - element.click(); - } else { - element.focus(); } return; } + this.set("forceValidationReason", false); this.performAccountCreation(); }, }, diff --git a/app/assets/javascripts/discourse/app/controllers/login.js b/app/assets/javascripts/discourse/app/controllers/login.js index fe6b32b757..a3a8934e52 100644 --- a/app/assets/javascripts/discourse/app/controllers/login.js +++ b/app/assets/javascripts/discourse/app/controllers/login.js @@ -428,7 +428,10 @@ export default Controller.extend(ModalFunctionality, { }); next(() => { - showModal("createAccount", { modalClass: "create-account" }); + showModal("createAccount", { + modalClass: "create-account", + titleAriaElementId: "create-account-title", + }); }); }, }); diff --git a/app/assets/javascripts/discourse/app/initializers/ember-input-component-extension.js b/app/assets/javascripts/discourse/app/initializers/ember-input-component-extension.js new file mode 100644 index 0000000000..c909a4e86d --- /dev/null +++ b/app/assets/javascripts/discourse/app/initializers/ember-input-component-extension.js @@ -0,0 +1,11 @@ +import TextSupport from "@ember/views/text-support"; + +export default { + name: "ember-input-component-extensions", + + initialize() { + TextSupport.reopen({ + attributeBindings: ["aria-describedby", "aria-invalid"], + }); + }, +}; diff --git a/app/assets/javascripts/discourse/app/lib/show-modal.js b/app/assets/javascripts/discourse/app/lib/show-modal.js index db3067fbcf..dde3094b31 100644 --- a/app/assets/javascripts/discourse/app/lib/show-modal.js +++ b/app/assets/javascripts/discourse/app/lib/show-modal.js @@ -47,6 +47,10 @@ export default function (name, opts) { modalController.set("title", null); } + if (opts.titleAriaElementId) { + modalController.set("titleAriaElementId", opts.titleAriaElementId); + } + if (opts.panels) { modalController.setProperties({ panels: opts.panels, diff --git a/app/assets/javascripts/discourse/app/mixins/name-validation.js b/app/assets/javascripts/discourse/app/mixins/name-validation.js index 52623f537e..65287c9732 100644 --- a/app/assets/javascripts/discourse/app/mixins/name-validation.js +++ b/app/assets/javascripts/discourse/app/mixins/name-validation.js @@ -15,12 +15,14 @@ export default Mixin.create({ }, // Validate the name. - @discourseComputed("accountName") - nameValidation() { - if (this.siteSettings.full_name_required && isEmpty(this.accountName)) { + @discourseComputed("accountName", "forceValidationReason") + nameValidation(accountName, forceValidationReason) { + if (this.siteSettings.full_name_required && isEmpty(accountName)) { return EmberObject.create({ failed: true, + ok: false, message: I18n.t("user.name.required"), + reason: forceValidationReason ? I18n.t("user.name.required") : null, element: document.querySelector("#new-account-name"), }); } diff --git a/app/assets/javascripts/discourse/app/mixins/password-validation.js b/app/assets/javascripts/discourse/app/mixins/password-validation.js index feb020cbf7..eea9b942de 100644 --- a/app/assets/javascripts/discourse/app/mixins/password-validation.js +++ b/app/assets/javascripts/discourse/app/mixins/password-validation.js @@ -33,7 +33,8 @@ export default Mixin.create({ "rejectedPasswords.[]", "accountUsername", "accountEmail", - "passwordMinLength" + "passwordMinLength", + "forceValidationReason" ) passwordValidation( password, @@ -41,10 +42,12 @@ export default Mixin.create({ rejectedPasswords, accountUsername, accountEmail, - passwordMinLength + passwordMinLength, + forceValidationReason ) { const failedAttrs = { failed: true, + ok: false, element: document.querySelector("#new-account-password"), }; @@ -67,6 +70,9 @@ export default Mixin.create({ return EmberObject.create( Object.assign(failedAttrs, { message: I18n.t("user.password.required"), + reason: forceValidationReason + ? I18n.t("user.password.required") + : null, }) ); } diff --git a/app/assets/javascripts/discourse/app/mixins/username-validation.js b/app/assets/javascripts/discourse/app/mixins/username-validation.js index b8f14bc818..522b40ad5f 100644 --- a/app/assets/javascripts/discourse/app/mixins/username-validation.js +++ b/app/assets/javascripts/discourse/app/mixins/username-validation.js @@ -11,6 +11,7 @@ function failedResult(attrs) { let result = EmberObject.create({ shouldCheck: false, failed: true, + ok: false, element: document.querySelector("#new-account-username"), }); result.setProperties(attrs); @@ -60,7 +61,12 @@ export default Mixin.create({ } if (isEmpty(username)) { - return failedResult({ message: I18n.t("user.username.required") }); + return failedResult({ + message: I18n.t("user.username.required"), + reason: this.forceValidationReason + ? I18n.t("user.username.required") + : null, + }); } if (username.length < this.siteSettings.min_username_length) { diff --git a/app/assets/javascripts/discourse/app/models/login-method.js b/app/assets/javascripts/discourse/app/models/login-method.js index efe7c438bc..bebb069b93 100644 --- a/app/assets/javascripts/discourse/app/models/login-method.js +++ b/app/assets/javascripts/discourse/app/models/login-method.js @@ -13,6 +13,11 @@ const LoginMethod = EmberObject.extend({ return this.title_override || I18n.t(`login.${this.name}.title`); }, + @discourseComputed + screenReaderTitle() { + return this.title_override || I18n.t(`login.${this.name}.sr_title`); + }, + @discourseComputed prettyName() { return this.pretty_name_override || I18n.t(`login.${this.name}.name`); diff --git a/app/assets/javascripts/discourse/app/routes/application.js b/app/assets/javascripts/discourse/app/routes/application.js index 4f9558c292..a283404cf5 100644 --- a/app/assets/javascripts/discourse/app/routes/application.js +++ b/app/assets/javascripts/discourse/app/routes/application.js @@ -267,11 +267,18 @@ const ApplicationRoute = DiscourseRoute.extend(OpenComposer, { const returnPath = encodeURIComponent(window.location.pathname); window.location = getURL("/session/sso?return_path=" + returnPath); } else { - this._autoLogin("createAccount", "create-account", { signup: true }); + this._autoLogin("createAccount", "create-account", { + signup: true, + titleAriaElementId: "create-account-title", + }); } }, - _autoLogin(modal, modalClass, { notAuto = null, signup = false } = {}) { + _autoLogin( + modal, + modalClass, + { notAuto = null, signup = false, titleAriaElementId = null } = {} + ) { const methods = findAll(); if (!this.siteSettings.enable_local_logins && methods.length === 1) { @@ -279,7 +286,7 @@ const ApplicationRoute = DiscourseRoute.extend(OpenComposer, { signup: signup, }); } else { - showModal(modal); + showModal(modal, { titleAriaElementId }); this.controllerFor("modal").set("modalClass", modalClass); if (notAuto) { notAuto(); diff --git a/app/assets/javascripts/discourse/app/templates/components/d-modal.hbs b/app/assets/javascripts/discourse/app/templates/components/d-modal.hbs index 7067f487ef..a0da06d06a 100644 --- a/app/assets/javascripts/discourse/app/templates/components/d-modal.hbs +++ b/app/assets/javascripts/discourse/app/templates/components/d-modal.hbs @@ -30,7 +30,7 @@ {{/if}} - + {{yield}} diff --git a/app/assets/javascripts/discourse/app/templates/components/login-buttons.hbs b/app/assets/javascripts/discourse/app/templates/components/login-buttons.hbs index bc2bc0aba9..c4e553f5b1 100644 --- a/app/assets/javascripts/discourse/app/templates/components/login-buttons.hbs +++ b/app/assets/javascripts/discourse/app/templates/components/login-buttons.hbs @@ -1,5 +1,5 @@ {{#each buttons as |b|}} -