mirror of
https://github.com/discourse/discourse.git
synced 2025-03-03 02:45:43 +08:00
Merge diffs from main
This commit is contained in:
parent
42caef4719
commit
9830b192f3
@ -5,7 +5,6 @@ export default Component.extend({
|
|||||||
fixed: false,
|
fixed: false,
|
||||||
submitOnEnter: true,
|
submitOnEnter: true,
|
||||||
dismissable: true,
|
dismissable: true,
|
||||||
autoFocus: true,
|
|
||||||
|
|
||||||
didInsertElement() {
|
didInsertElement() {
|
||||||
this._super(...arguments);
|
this._super(...arguments);
|
||||||
@ -53,8 +52,7 @@ export default Component.extend({
|
|||||||
"rawSubtitle",
|
"rawSubtitle",
|
||||||
"submitOnEnter",
|
"submitOnEnter",
|
||||||
"dismissable",
|
"dismissable",
|
||||||
"headerClass",
|
"headerClass"
|
||||||
"autoFocus"
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -40,8 +40,6 @@ export default Component.extend({
|
|||||||
classNameBindings: [":topic-list-item", "unboundClassNames", "topic.visited"],
|
classNameBindings: [":topic-list-item", "unboundClassNames", "topic.visited"],
|
||||||
attributeBindings: ["data-topic-id", "role", "ariaLevel:aria-level"],
|
attributeBindings: ["data-topic-id", "role", "ariaLevel:aria-level"],
|
||||||
"data-topic-id": alias("topic.id"),
|
"data-topic-id": alias("topic.id"),
|
||||||
role: "heading",
|
|
||||||
ariaLevel: "2",
|
|
||||||
|
|
||||||
didReceiveAttrs() {
|
didReceiveAttrs() {
|
||||||
this._super(...arguments);
|
this._super(...arguments);
|
||||||
|
@ -8,7 +8,6 @@ import { ajax } from "discourse/lib/ajax";
|
|||||||
import { get } from "@ember/object";
|
import { get } from "@ember/object";
|
||||||
import { getOwner } from "discourse-common/lib/get-owner";
|
import { getOwner } from "discourse-common/lib/get-owner";
|
||||||
import getURL from "discourse-common/lib/get-url";
|
import getURL from "discourse-common/lib/get-url";
|
||||||
import { escapeExpression } from "discourse/lib/utilities";
|
|
||||||
|
|
||||||
const STAFF_GROUP_NAME = "staff";
|
const STAFF_GROUP_NAME = "staff";
|
||||||
|
|
||||||
@ -70,11 +69,6 @@ const Category = RestModel.extend({
|
|||||||
return { type: "category", id, category: this };
|
return { type: "category", id, category: this };
|
||||||
},
|
},
|
||||||
|
|
||||||
@discourseComputed("name")
|
|
||||||
escapeName(name) {
|
|
||||||
return escapeExpression(name);
|
|
||||||
},
|
|
||||||
|
|
||||||
@discourseComputed("parentCategory.ancestors")
|
@discourseComputed("parentCategory.ancestors")
|
||||||
ancestors(parentAncestors) {
|
ancestors(parentAncestors) {
|
||||||
return [...(parentAncestors || []), this];
|
return [...(parentAncestors || []), this];
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
{{#if category.read_restricted}}
|
{{#if category.read_restricted}}
|
||||||
{{d-icon lockIcon}}
|
{{d-icon lockIcon}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<span class="category-name">{{dir-span category.escapeName}}</span>
|
<span class="category-name">{{dir-span category.name}}</span>
|
||||||
</div>
|
</div>
|
||||||
{{#if category.uploaded_logo.url}}
|
{{#if category.uploaded_logo.url}}
|
||||||
{{cdn-img
|
{{cdn-img
|
||||||
|
@ -162,10 +162,10 @@ export default function initLazyYt($) {
|
|||||||
$.fn.lazyYT = function (newSettings) {
|
$.fn.lazyYT = function (newSettings) {
|
||||||
let defaultSettings = {
|
let defaultSettings = {
|
||||||
default_ratio: "16:9",
|
default_ratio: "16:9",
|
||||||
callback: null, // ToDO execute callback if given
|
callback: null, // TODO: execute callback if given
|
||||||
container_class: "lazyYT-container",
|
container_class: "lazyYT-container",
|
||||||
};
|
};
|
||||||
let settings = $.extend(defaultSettings, newSettings);
|
let settings = Object.assign(defaultSettings, newSettings);
|
||||||
|
|
||||||
return this.each(function () {
|
return this.each(function () {
|
||||||
let $el = $(this).addClass(settings.container_class);
|
let $el = $(this).addClass(settings.container_class);
|
||||||
|
@ -55,20 +55,6 @@ class Onebox::Engine::YoutubeOnebox
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
alias_method :old_video_id, :video_id
|
|
||||||
alias_method :old_list_id, :list_id
|
|
||||||
|
|
||||||
def video_id
|
|
||||||
sanitize_yt_id(old_video_id)
|
|
||||||
end
|
|
||||||
|
|
||||||
def list_id
|
|
||||||
sanitize_yt_id(old_list_id)
|
|
||||||
end
|
|
||||||
|
|
||||||
def sanitize_yt_id(raw)
|
|
||||||
raw&.match?(/\A[\w-]+\z/) ? raw : nil
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
after_initialize do
|
after_initialize do
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -55,14 +55,6 @@ en:
|
|||||||
one: A minimum of %{count} vote is required for this poll.
|
one: A minimum of %{count} vote is required for this poll.
|
||||||
other: A minimum of %{count} votes is required for this poll.
|
other: A minimum of %{count} votes is required for this poll.
|
||||||
|
|
||||||
one_vote_per_user: "Only 1 vote is allowed for this poll."
|
|
||||||
max_vote_per_user:
|
|
||||||
one: Only %{count} vote is allowed for this poll.
|
|
||||||
other: A maximum of %{count} votes is allowed for this poll.
|
|
||||||
min_vote_per_user:
|
|
||||||
one: A minimum of %{count} vote is required for this poll.
|
|
||||||
other: A minimum of %{count} votes is required for this poll.
|
|
||||||
|
|
||||||
topic_must_be_open_to_toggle_status: "The topic must be open to toggle status."
|
topic_must_be_open_to_toggle_status: "The topic must be open to toggle status."
|
||||||
only_staff_or_op_can_toggle_status: "Only a staff member or the original poster can toggle a poll status."
|
only_staff_or_op_can_toggle_status: "Only a staff member or the original poster can toggle a poll status."
|
||||||
|
|
||||||
|
@ -3075,19 +3075,6 @@ describe UsersController do
|
|||||||
|
|
||||||
expect(user1.email_tokens.first.email).to eq(user1.email)
|
expect(user1.email_tokens.first.email).to eq(user1.email)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "can destroy associated email tokens" do
|
|
||||||
new_email = 'new.n.cool@example.com'
|
|
||||||
updater = EmailUpdater.new(guardian: user.guardian, user: user)
|
|
||||||
|
|
||||||
expect { updater.change_to(new_email) }
|
|
||||||
.to change { user.email_tokens.count }.by(1)
|
|
||||||
|
|
||||||
expect { delete "/u/#{user.username}/preferences/email.json", params: { email: new_email } }
|
|
||||||
.to change { user.email_tokens.count }.by(-1)
|
|
||||||
|
|
||||||
expect(user.email_tokens.first.email).to eq(user.email)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#is_local_username' do
|
describe '#is_local_username' do
|
||||||
@ -3722,16 +3709,6 @@ describe UsersController do
|
|||||||
expect(response.body).not_to include("Hello world!")
|
expect(response.body).not_to include("Hello world!")
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should not be able to view a private user profile" do
|
|
||||||
user1.user_profile.update!(bio_raw: "Hello world!")
|
|
||||||
user1.user_option.update!(hide_profile_and_presence: true)
|
|
||||||
|
|
||||||
get "/u/#{user1.username}"
|
|
||||||
|
|
||||||
expect(response.status).to eq(200)
|
|
||||||
expect(response.body).not_to include("Hello world!")
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'when username contains a period' do
|
describe 'when username contains a period' do
|
||||||
before_all do
|
before_all do
|
||||||
user1.update!(username: 'test.test')
|
user1.update!(username: 'test.test')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user