Fix Prettier using correct version (1.19.1)
This commit is contained in:
parent
655e610357
commit
cc8baa1a7c
|
@ -4,7 +4,10 @@ import Backup from "admin/models/backup";
|
||||||
export default Route.extend({
|
export default Route.extend({
|
||||||
activate() {
|
activate() {
|
||||||
this.messageBus.subscribe("/admin/backups", backups =>
|
this.messageBus.subscribe("/admin/backups", backups =>
|
||||||
this.controller.set("model", backups.map(backup => Backup.create(backup)))
|
this.controller.set(
|
||||||
|
"model",
|
||||||
|
backups.map(backup => Backup.create(backup))
|
||||||
|
)
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -75,9 +75,7 @@ export default Component.extend(
|
||||||
buffer.push(
|
buffer.push(
|
||||||
notices
|
notices
|
||||||
.map(n => {
|
.map(n => {
|
||||||
var html = `<div class='row'><div class='alert alert-info ${
|
var html = `<div class='row'><div class='alert alert-info ${n[1]}'>`;
|
||||||
n[1]
|
|
||||||
}'>`;
|
|
||||||
if (n[2]) html += n[2];
|
if (n[2]) html += n[2];
|
||||||
html += `${n[0]}</div></div>`;
|
html += `${n[0]}</div></div>`;
|
||||||
return html;
|
return html;
|
||||||
|
|
|
@ -107,7 +107,7 @@ export default Controller.extend(ModalFunctionality, {
|
||||||
|
|
||||||
@discourseComputed("canSplitTopic")
|
@discourseComputed("canSplitTopic")
|
||||||
canSplitToPM(canSplitTopic) {
|
canSplitToPM(canSplitTopic) {
|
||||||
return canSplitTopic && (this.currentUser && this.currentUser.admin);
|
return canSplitTopic && this.currentUser && this.currentUser.admin;
|
||||||
},
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
|
|
@ -81,7 +81,10 @@ export default Controller.extend(ModalFunctionality, {
|
||||||
const topics = this.get("model.topics");
|
const topics = this.get("model.topics");
|
||||||
// const relistButtonIndex = _buttons.findIndex(b => b.action === 'relistTopics');
|
// const relistButtonIndex = _buttons.findIndex(b => b.action === 'relistTopics');
|
||||||
|
|
||||||
this.set("buttons", _buttons.filter(b => b.buttonVisible(topics)));
|
this.set(
|
||||||
|
"buttons",
|
||||||
|
_buttons.filter(b => b.buttonVisible(topics))
|
||||||
|
);
|
||||||
this.set("modal.modalClass", "topic-bulk-actions-modal small");
|
this.set("modal.modalClass", "topic-bulk-actions-modal small");
|
||||||
this.send("changeBulkTemplate", "modal/bulk-actions-buttons");
|
this.send("changeBulkTemplate", "modal/bulk-actions-buttons");
|
||||||
},
|
},
|
||||||
|
|
|
@ -28,9 +28,11 @@ export default Controller.extend({
|
||||||
|
|
||||||
@observes("searchTerm")
|
@observes("searchTerm")
|
||||||
_searchTermChanged: discourseDebounce(function() {
|
_searchTermChanged: discourseDebounce(function() {
|
||||||
Invite.findInvitedBy(this.user, this.filter, this.searchTerm).then(
|
Invite.findInvitedBy(
|
||||||
invites => this.set("model", invites)
|
this.user,
|
||||||
);
|
this.filter,
|
||||||
|
this.searchTerm
|
||||||
|
).then(invites => this.set("model", invites));
|
||||||
}, 250),
|
}, 250),
|
||||||
|
|
||||||
inviteRedeemed: equal("filter", "redeemed"),
|
inviteRedeemed: equal("filter", "redeemed"),
|
||||||
|
|
|
@ -49,10 +49,10 @@ export function isPushNotificationsSupported(mobileView) {
|
||||||
if (
|
if (
|
||||||
!(
|
!(
|
||||||
"serviceWorker" in navigator &&
|
"serviceWorker" in navigator &&
|
||||||
(ServiceWorkerRegistration &&
|
ServiceWorkerRegistration &&
|
||||||
typeof Notification !== "undefined" &&
|
typeof Notification !== "undefined" &&
|
||||||
"showNotification" in ServiceWorkerRegistration.prototype &&
|
"showNotification" in ServiceWorkerRegistration.prototype &&
|
||||||
"PushManager" in window)
|
"PushManager" in window
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -239,7 +239,7 @@ export default function transformPost(
|
||||||
postAtts.showFlagDelete =
|
postAtts.showFlagDelete =
|
||||||
!postAtts.canDelete &&
|
!postAtts.canDelete &&
|
||||||
postAtts.yours &&
|
postAtts.yours &&
|
||||||
(currentUser && !currentUser.staff);
|
currentUser && !currentUser.staff;
|
||||||
} else {
|
} else {
|
||||||
postAtts.canRecover = postAtts.isDeleted && postAtts.canRecover;
|
postAtts.canRecover = postAtts.isDeleted && postAtts.canRecover;
|
||||||
postAtts.canDelete =
|
postAtts.canDelete =
|
||||||
|
|
|
@ -652,10 +652,7 @@ const Composer = RestModel.extend({
|
||||||
const replyBlank = isEmpty(this.reply);
|
const replyBlank = isEmpty(this.reply);
|
||||||
|
|
||||||
const composer = this;
|
const composer = this;
|
||||||
if (
|
if (!replyBlank && (opts.reply || isEdit(opts.action)) && this.replyDirty) {
|
||||||
!replyBlank &&
|
|
||||||
((opts.reply || isEdit(opts.action)) && this.replyDirty)
|
|
||||||
) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -53,9 +53,9 @@ Invite.reopenClass({
|
||||||
findInvitedCount(user) {
|
findInvitedCount(user) {
|
||||||
if (!user) Promise.resolve();
|
if (!user) Promise.resolve();
|
||||||
|
|
||||||
return ajax(userPath(`${user.username_lower}/invited_count.json`)).then(
|
return ajax(
|
||||||
result => EmberObject.create(result.counts)
|
userPath(`${user.username_lower}/invited_count.json`)
|
||||||
);
|
).then(result => EmberObject.create(result.counts));
|
||||||
},
|
},
|
||||||
|
|
||||||
reinviteAll() {
|
reinviteAll() {
|
||||||
|
|
|
@ -8,7 +8,10 @@ export default RestrictedUserRoute.extend({
|
||||||
const user = this.modelFor("user");
|
const user = this.modelFor("user");
|
||||||
if (this.siteSettings.enable_badges) {
|
if (this.siteSettings.enable_badges) {
|
||||||
return UserBadge.findByUsername(user.get("username")).then(userBadges => {
|
return UserBadge.findByUsername(user.get("username")).then(userBadges => {
|
||||||
user.set("badges", userBadges.map(ub => ub.badge));
|
user.set(
|
||||||
|
"badges",
|
||||||
|
userBadges.map(ub => ub.badge)
|
||||||
|
);
|
||||||
return user;
|
return user;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -19,7 +19,10 @@ createWidget("menu-links", {
|
||||||
|
|
||||||
const result = [];
|
const result = [];
|
||||||
result.push(
|
result.push(
|
||||||
h("ul.menu-links.columned", links.map(l => h("li", liOpts, l)))
|
h(
|
||||||
|
"ul.menu-links.columned",
|
||||||
|
links.map(l => h("li", liOpts, l))
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
result.push(h("div.clearfix"));
|
result.push(h("div.clearfix"));
|
||||||
|
|
|
@ -211,7 +211,7 @@ createWidget("timeline-scrollarea", {
|
||||||
position.lastRead > 3 &&
|
position.lastRead > 3 &&
|
||||||
Math.abs(position.lastRead - position.current) > 3 &&
|
Math.abs(position.lastRead - position.current) > 3 &&
|
||||||
Math.abs(position.lastRead - position.total) > 1 &&
|
Math.abs(position.lastRead - position.total) > 1 &&
|
||||||
(position.lastRead && position.lastRead !== position.total);
|
position.lastRead && position.lastRead !== position.total;
|
||||||
|
|
||||||
if (hasBackPosition) {
|
if (hasBackPosition) {
|
||||||
const lastReadTop = Math.round(
|
const lastReadTop = Math.round(
|
||||||
|
|
|
@ -115,7 +115,10 @@ createWidget("user-menu-links", {
|
||||||
|
|
||||||
return h("ul.menu-links-row", [
|
return h("ul.menu-links-row", [
|
||||||
links.map(l => h("li.user", this.linkHtml(l))),
|
links.map(l => h("li.user", this.linkHtml(l))),
|
||||||
h("li.glyphs", glyphs.map(l => this.glyphHtml(l)))
|
h(
|
||||||
|
"li.glyphs",
|
||||||
|
glyphs.map(l => this.glyphHtml(l))
|
||||||
|
)
|
||||||
]);
|
]);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -185,7 +185,10 @@ export function setup(helper) {
|
||||||
if (simpleUrlRegex.test(url)) {
|
if (simpleUrlRegex.test(url)) {
|
||||||
startToken.type = "link_open";
|
startToken.type = "link_open";
|
||||||
startToken.tag = "a";
|
startToken.tag = "a";
|
||||||
startToken.attrs = [["href", url], ["data-bbcode", "true"]];
|
startToken.attrs = [
|
||||||
|
["href", url],
|
||||||
|
["data-bbcode", "true"]
|
||||||
|
];
|
||||||
startToken.content = "";
|
startToken.content = "";
|
||||||
startToken.nesting = 1;
|
startToken.nesting = 1;
|
||||||
|
|
||||||
|
@ -214,7 +217,10 @@ export function setup(helper) {
|
||||||
let email = tagInfo.attrs["_default"] || content;
|
let email = tagInfo.attrs["_default"] || content;
|
||||||
|
|
||||||
token = state.push("link_open", "a", 1);
|
token = state.push("link_open", "a", 1);
|
||||||
token.attrs = [["href", "mailto:" + email], ["data-bbcode", "true"]];
|
token.attrs = [
|
||||||
|
["href", "mailto:" + email],
|
||||||
|
["data-bbcode", "true"]
|
||||||
|
];
|
||||||
|
|
||||||
token = state.push("text", "", 0);
|
token = state.push("text", "", 0);
|
||||||
token.content = content;
|
token.content = content;
|
||||||
|
@ -228,7 +234,10 @@ export function setup(helper) {
|
||||||
tag: "img",
|
tag: "img",
|
||||||
replace: function(state, tagInfo, content) {
|
replace: function(state, tagInfo, content) {
|
||||||
let token = state.push("image", "img", 0);
|
let token = state.push("image", "img", 0);
|
||||||
token.attrs = [["src", content], ["alt", ""]];
|
token.attrs = [
|
||||||
|
["src", content],
|
||||||
|
["alt", ""]
|
||||||
|
];
|
||||||
token.children = [];
|
token.children = [];
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,10 @@ function addHashtag(buffer, matches, state) {
|
||||||
|
|
||||||
if (result) {
|
if (result) {
|
||||||
token = new state.Token("link_open", "a", 1);
|
token = new state.Token("link_open", "a", 1);
|
||||||
token.attrs = [["class", "hashtag"], ["href", result[0]]];
|
token.attrs = [
|
||||||
|
["class", "hashtag"],
|
||||||
|
["href", result[0]]
|
||||||
|
];
|
||||||
token.block = false;
|
token.block = false;
|
||||||
buffer.push(token);
|
buffer.push(token);
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,10 @@ export default MultiSelectComponent.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
mutateValues(values) {
|
mutateValues(values) {
|
||||||
this.set("categories", values.map(v => Category.findById(v)));
|
this.set(
|
||||||
|
"categories",
|
||||||
|
values.map(v => Category.findById(v))
|
||||||
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
filterComputedContent(computedContent, computedValues, filter) {
|
filterComputedContent(computedContent, computedValues, filter) {
|
||||||
|
|
|
@ -132,7 +132,7 @@ export default DropdownSelectBoxComponent.extend({
|
||||||
(action !== REPLY && _topicSnapshot) ||
|
(action !== REPLY && _topicSnapshot) ||
|
||||||
(action === REPLY &&
|
(action === REPLY &&
|
||||||
_topicSnapshot &&
|
_topicSnapshot &&
|
||||||
(options.userAvatar && options.userLink && options.topicLink))
|
options.userAvatar && options.userLink && options.topicLink)
|
||||||
) {
|
) {
|
||||||
items.push({
|
items.push({
|
||||||
name: I18n.t("composer.composer_actions.reply_to_topic.label"),
|
name: I18n.t("composer.composer_actions.reply_to_topic.label"),
|
||||||
|
|
|
@ -54,7 +54,10 @@ export default MultiSelectComponent.extend(TagsMixin, {
|
||||||
},
|
},
|
||||||
|
|
||||||
mutateValues(values) {
|
mutateValues(values) {
|
||||||
this.set("tags", values.filter(v => v));
|
this.set(
|
||||||
|
"tags",
|
||||||
|
values.filter(v => v)
|
||||||
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
@discourseComputed("tags")
|
@discourseComputed("tags")
|
||||||
|
|
|
@ -27,7 +27,10 @@ export default MultiSelectComponent.extend(TagsMixin, {
|
||||||
},
|
},
|
||||||
|
|
||||||
mutateValues(values) {
|
mutateValues(values) {
|
||||||
this.set("tagGroups", values.filter(v => v));
|
this.set(
|
||||||
|
"tagGroups",
|
||||||
|
values.filter(v => v)
|
||||||
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
@discourseComputed("tagGroups")
|
@discourseComputed("tagGroups")
|
||||||
|
|
|
@ -187,7 +187,7 @@ export default Mixin.create({
|
||||||
const offsetBottom = this.element.getBoundingClientRect().bottom;
|
const offsetBottom = this.element.getBoundingClientRect().bottom;
|
||||||
const windowWidth = $(window).width();
|
const windowWidth = $(window).width();
|
||||||
|
|
||||||
if (this.fullWidthOnMobile && (this.site && this.site.isMobileDevice)) {
|
if (this.fullWidthOnMobile && this.site && this.site.isMobileDevice) {
|
||||||
const margin = 10;
|
const margin = 10;
|
||||||
const relativeLeft =
|
const relativeLeft =
|
||||||
$(this.element).offset().left - $(window).scrollLeft();
|
$(this.element).offset().left - $(window).scrollLeft();
|
||||||
|
|
|
@ -126,5 +126,8 @@ QUnit.test("Group Requests", async assert => {
|
||||||
.trim(),
|
.trim(),
|
||||||
"denied"
|
"denied"
|
||||||
);
|
);
|
||||||
assert.deepEqual(requests, [["19", "true"], ["20", undefined]]);
|
assert.deepEqual(requests, [
|
||||||
|
["19", "true"],
|
||||||
|
["20", undefined]
|
||||||
|
]);
|
||||||
});
|
});
|
||||||
|
|
|
@ -11,7 +11,10 @@ moduleForComponent("combo-box", {
|
||||||
componentTest("default", {
|
componentTest("default", {
|
||||||
template: "{{combo-box content=items}}",
|
template: "{{combo-box content=items}}",
|
||||||
beforeEach() {
|
beforeEach() {
|
||||||
this.set("items", [{ id: 1, name: "hello" }, { id: 2, name: "world" }]);
|
this.set("items", [
|
||||||
|
{ id: 1, name: "hello" },
|
||||||
|
{ id: 2, name: "world" }
|
||||||
|
]);
|
||||||
},
|
},
|
||||||
|
|
||||||
async test(assert) {
|
async test(assert) {
|
||||||
|
@ -43,7 +46,10 @@ componentTest("with valueAttribute", {
|
||||||
componentTest("with nameProperty", {
|
componentTest("with nameProperty", {
|
||||||
template: '{{combo-box content=items nameProperty="text"}}',
|
template: '{{combo-box content=items nameProperty="text"}}',
|
||||||
beforeEach() {
|
beforeEach() {
|
||||||
this.set("items", [{ id: 0, text: "hello" }, { id: 1, text: "world" }]);
|
this.set("items", [
|
||||||
|
{ id: 0, text: "hello" },
|
||||||
|
{ id: 1, text: "world" }
|
||||||
|
]);
|
||||||
},
|
},
|
||||||
|
|
||||||
async test(assert) {
|
async test(assert) {
|
||||||
|
|
|
@ -14,7 +14,10 @@ componentTest("with objects and values", {
|
||||||
template: "{{multi-select content=items values=values}}",
|
template: "{{multi-select content=items values=values}}",
|
||||||
|
|
||||||
beforeEach() {
|
beforeEach() {
|
||||||
this.set("items", [{ id: 1, name: "hello" }, { id: 2, name: "world" }]);
|
this.set("items", [
|
||||||
|
{ id: 1, name: "hello" },
|
||||||
|
{ id: 2, name: "world" }
|
||||||
|
]);
|
||||||
this.set("values", [1, 2]);
|
this.set("values", [1, 2]);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,10 @@ componentTest("accepts a value by reference", {
|
||||||
|
|
||||||
beforeEach() {
|
beforeEach() {
|
||||||
this.set("value", 1);
|
this.set("value", 1);
|
||||||
this.set("content", [{ id: 1, name: "robin" }, { id: 2, name: "regis" }]);
|
this.set("content", [
|
||||||
|
{ id: 1, name: "robin" },
|
||||||
|
{ id: 2, name: "regis" }
|
||||||
|
]);
|
||||||
},
|
},
|
||||||
|
|
||||||
async test(assert) {
|
async test(assert) {
|
||||||
|
@ -148,7 +151,10 @@ componentTest("dynamic headerText", {
|
||||||
template: "{{single-select value=1 content=content}}",
|
template: "{{single-select value=1 content=content}}",
|
||||||
|
|
||||||
beforeEach() {
|
beforeEach() {
|
||||||
this.set("content", [{ id: 1, name: "robin" }, { id: 2, name: "regis" }]);
|
this.set("content", [
|
||||||
|
{ id: 1, name: "robin" },
|
||||||
|
{ id: 2, name: "regis" }
|
||||||
|
]);
|
||||||
},
|
},
|
||||||
|
|
||||||
async test(assert) {
|
async test(assert) {
|
||||||
|
@ -246,7 +252,10 @@ componentTest("supports keyboard events", {
|
||||||
template: "{{single-select content=content filterable=true}}",
|
template: "{{single-select content=content filterable=true}}",
|
||||||
|
|
||||||
beforeEach() {
|
beforeEach() {
|
||||||
this.set("content", [{ id: 1, name: "robin" }, { id: 2, name: "regis" }]);
|
this.set("content", [
|
||||||
|
{ id: 1, name: "robin" },
|
||||||
|
{ id: 2, name: "regis" }
|
||||||
|
]);
|
||||||
},
|
},
|
||||||
|
|
||||||
skip: true,
|
skip: true,
|
||||||
|
|
|
@ -324,7 +324,10 @@ QUnit.test("canChangeOwner", function(assert) {
|
||||||
this.registry.injection("controller", "currentUser", "current-user:main");
|
this.registry.injection("controller", "currentUser", "current-user:main");
|
||||||
|
|
||||||
const postStream = {
|
const postStream = {
|
||||||
posts: [{ id: 1, username: "gary" }, { id: 2, username: "lili" }],
|
posts: [
|
||||||
|
{ id: 1, username: "gary" },
|
||||||
|
{ id: 2, username: "lili" }
|
||||||
|
],
|
||||||
stream: [1, 2]
|
stream: [1, 2]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -141,7 +141,11 @@ QUnit.test("closestPostNumberFor", assert => {
|
||||||
|
|
||||||
QUnit.test("closestDaysAgoFor", assert => {
|
QUnit.test("closestDaysAgoFor", assert => {
|
||||||
const postStream = buildStream(1231);
|
const postStream = buildStream(1231);
|
||||||
postStream.set("timelineLookup", [[1, 10], [3, 8], [5, 1]]);
|
postStream.set("timelineLookup", [
|
||||||
|
[1, 10],
|
||||||
|
[3, 8],
|
||||||
|
[5, 1]
|
||||||
|
]);
|
||||||
|
|
||||||
assert.equal(postStream.closestDaysAgoFor(1), 10);
|
assert.equal(postStream.closestDaysAgoFor(1), 10);
|
||||||
assert.equal(postStream.closestDaysAgoFor(2), 10);
|
assert.equal(postStream.closestDaysAgoFor(2), 10);
|
||||||
|
|
Loading…
Reference in New Issue