mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 04:14:38 +08:00
@ -16,9 +16,9 @@ export default class TrapTabModifier extends Modifier {
|
|||||||
modify(element, _, { preventScroll, autofocus }) {
|
modify(element, _, { preventScroll, autofocus }) {
|
||||||
autofocus ??= true;
|
autofocus ??= true;
|
||||||
this.preventScroll = preventScroll ?? true;
|
this.preventScroll = preventScroll ?? true;
|
||||||
this.orignalElement = element;
|
this.originalElement = element;
|
||||||
this.element = element.querySelector(".modal-inner-container") || element;
|
this.element = element.querySelector(".modal-inner-container") || element;
|
||||||
this.orignalElement.addEventListener("keydown", this.trapTab);
|
this.originalElement.addEventListener("keydown", this.trapTab);
|
||||||
|
|
||||||
// on first trap we don't allow to focus modal-close
|
// on first trap we don't allow to focus modal-close
|
||||||
// and apply manual focus only if we don't have any autofocus element
|
// and apply manual focus only if we don't have any autofocus element
|
||||||
@ -72,6 +72,6 @@ export default class TrapTabModifier extends Modifier {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cleanup() {
|
cleanup() {
|
||||||
this.orignalElement.removeEventListener("keydown", this.trapTab);
|
this.originalElement.removeEventListener("keydown", this.trapTab);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -241,7 +241,7 @@ acceptance("User Preference - No Secondary Emails Allowed", function (needs) {
|
|||||||
needs.pretender(preferencesPretender);
|
needs.pretender(preferencesPretender);
|
||||||
needs.settings({ max_allowed_secondary_emails: 0 });
|
needs.settings({ max_allowed_secondary_emails: 0 });
|
||||||
|
|
||||||
test("Add Alternate Email Button is unvailable", async function (assert) {
|
test("Add Alternate Email Button is unavailable", async function (assert) {
|
||||||
await visit("/u/eviltrout/preferences");
|
await visit("/u/eviltrout/preferences");
|
||||||
|
|
||||||
assert.dom(".pref-email a").doesNotExist();
|
assert.dom(".pref-email a").doesNotExist();
|
||||||
|
@ -118,7 +118,7 @@ class PrivateMessageTopicTrackingState
|
|||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Note: At some point we may want to make the same peformance optimisation
|
# Note: At some point we may want to make the same performance optimisation
|
||||||
# here as we did with the other topic tracking state, where we only send
|
# here as we did with the other topic tracking state, where we only send
|
||||||
# one 'unread' update to all users, not a more accurate unread update to
|
# one 'unread' update to all users, not a more accurate unread update to
|
||||||
# each individual user with their own read state.
|
# each individual user with their own read state.
|
||||||
|
@ -57,7 +57,7 @@ class BaseBookmarkable
|
|||||||
#
|
#
|
||||||
# @param [User] user The user to perform the query for, this scopes the bookmarks returned.
|
# @param [User] user The user to perform the query for, this scopes the bookmarks returned.
|
||||||
# @param [Guardian] guardian An instance of Guardian for the user to be used for security filters.
|
# @param [Guardian] guardian An instance of Guardian for the user to be used for security filters.
|
||||||
# @return [Bookmark::ActiveRecord_AssociationRelation] Should be an approprialely scoped list of bookmarks for the user.
|
# @return [Bookmark::ActiveRecord_AssociationRelation] Should be an appropriately scoped list of bookmarks for the user.
|
||||||
def self.list_query(user, guardian)
|
def self.list_query(user, guardian)
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
end
|
end
|
||||||
@ -200,7 +200,7 @@ class BaseBookmarkable
|
|||||||
# may be deleted 3 days after the post or topic is deleted.
|
# may be deleted 3 days after the post or topic is deleted.
|
||||||
#
|
#
|
||||||
# In the case of bookmarkable records that are not trashable, and where
|
# In the case of bookmarkable records that are not trashable, and where
|
||||||
# dependent_destroy is not used, this shouldjust delete the bookmarks pointing
|
# dependent_destroy is not used, this should just delete the bookmarks pointing
|
||||||
# to the record which no longer exists in the database.
|
# to the record which no longer exists in the database.
|
||||||
def self.cleanup_deleted
|
def self.cleanup_deleted
|
||||||
# noop
|
# noop
|
||||||
|
@ -25,7 +25,7 @@ class CategoryHashtagDataSource
|
|||||||
item.relative_url = category.url
|
item.relative_url = category.url
|
||||||
item.id = category.id
|
item.id = category.id
|
||||||
|
|
||||||
# Single-level category heirarchy should be enough to distinguish between
|
# Single-level category hierarchy should be enough to distinguish between
|
||||||
# categories here.
|
# categories here.
|
||||||
item.ref = category.slug_ref
|
item.ref = category.slug_ref
|
||||||
end
|
end
|
||||||
|
@ -17,13 +17,13 @@ module(
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("@includeOriginalMessageUser=true", async function (assert) {
|
test("@includeOriginalMessageUser=true", async function (assert) {
|
||||||
const orignalMessageUser = fabricators.user({ username: "bob" });
|
const originalMessageUser = fabricators.user({ username: "bob" });
|
||||||
this.thread = fabricators.thread({
|
this.thread = fabricators.thread({
|
||||||
original_message: fabricators.message({ user: orignalMessageUser }),
|
original_message: fabricators.message({ user: originalMessageUser }),
|
||||||
preview: fabricators.threadPreview({
|
preview: fabricators.threadPreview({
|
||||||
channel: this.channel,
|
channel: this.channel,
|
||||||
participant_users: [
|
participant_users: [
|
||||||
orignalMessageUser,
|
originalMessageUser,
|
||||||
fabricators.user({ username: "alice" }),
|
fabricators.user({ username: "alice" }),
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
@ -35,13 +35,13 @@ module(
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("@includeOriginalMessageUser=false", async function (assert) {
|
test("@includeOriginalMessageUser=false", async function (assert) {
|
||||||
const orignalMessageUser = fabricators.user({ username: "bob" });
|
const originalMessageUser = fabricators.user({ username: "bob" });
|
||||||
this.thread = fabricators.thread({
|
this.thread = fabricators.thread({
|
||||||
original_message: fabricators.message({ user: orignalMessageUser }),
|
original_message: fabricators.message({ user: originalMessageUser }),
|
||||||
preview: fabricators.threadPreview({
|
preview: fabricators.threadPreview({
|
||||||
channel: this.channel,
|
channel: this.channel,
|
||||||
participant_users: [
|
participant_users: [
|
||||||
orignalMessageUser,
|
originalMessageUser,
|
||||||
fabricators.user({ username: "alice" }),
|
fabricators.user({ username: "alice" }),
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
|
@ -4,7 +4,7 @@ import { setupTest } from "ember-qunit";
|
|||||||
import { module, test } from "qunit";
|
import { module, test } from "qunit";
|
||||||
import pretender from "discourse/tests/helpers/create-pretender";
|
import pretender from "discourse/tests/helpers/create-pretender";
|
||||||
|
|
||||||
function emojisReponse() {
|
function emojisResponse() {
|
||||||
return { favorites: [{ name: "sad" }] };
|
return { favorites: [{ name: "sad" }] };
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -15,7 +15,7 @@ module(
|
|||||||
|
|
||||||
hooks.beforeEach(function () {
|
hooks.beforeEach(function () {
|
||||||
pretender.get("/chat/emojis.json", () => {
|
pretender.get("/chat/emojis.json", () => {
|
||||||
return [200, {}, emojisReponse()];
|
return [200, {}, emojisResponse()];
|
||||||
});
|
});
|
||||||
|
|
||||||
this.manager = getOwner(this).lookup("service:chat-emoji-picker-manager");
|
this.manager = getOwner(this).lookup("service:chat-emoji-picker-manager");
|
||||||
@ -61,7 +61,7 @@ module(
|
|||||||
|
|
||||||
await settled();
|
await settled();
|
||||||
|
|
||||||
assert.deepEqual(this.manager.emojis, emojisReponse());
|
assert.deepEqual(this.manager.emojis, emojisResponse());
|
||||||
assert.strictEqual(this.manager.loading, false);
|
assert.strictEqual(this.manager.loading, false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
describe "Admin Revamp | Sidebar Naviagion", type: :system do
|
describe "Admin Revamp | Sidebar Navigation", type: :system do
|
||||||
fab!(:admin)
|
fab!(:admin)
|
||||||
let(:sidebar_page) { PageObjects::Components::NavigationMenu::Sidebar.new }
|
let(:sidebar_page) { PageObjects::Components::NavigationMenu::Sidebar.new }
|
||||||
|
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
describe "Flagging post", type: :system, js: true do
|
describe "Flagging post", type: :system, js: true do
|
||||||
fab!(:current_user) { Fabricate(:admin) }
|
fab!(:current_user) { Fabricate(:admin) }
|
||||||
fab!(:first_post) { Fabricate(:post) }
|
fab!(:first_post) { Fabricate(:post) }
|
||||||
|
Reference in New Issue
Block a user