DEV: Bump eslint-config-discourse (#14868)
Changes for 4f7aba06c0
Also fixes all of the object-shorthand violations in our JS code.
This commit is contained in:
parent
a8c63ddb54
commit
23b7b42acd
|
@ -48,7 +48,7 @@ export default Component.extend({
|
|||
}
|
||||
// update the formatted logs & cache index
|
||||
this.setProperties({
|
||||
formattedLogs: formattedLogs,
|
||||
formattedLogs,
|
||||
index: logs.length,
|
||||
});
|
||||
// force rerender
|
||||
|
|
|
@ -24,7 +24,7 @@ export default Component.extend({
|
|||
|
||||
const config = {
|
||||
type: this.type,
|
||||
data: data,
|
||||
data,
|
||||
options: {
|
||||
responsive: true,
|
||||
plugins: {
|
||||
|
|
|
@ -63,7 +63,7 @@ export default Component.extend({
|
|||
},
|
||||
|
||||
_addValue(value, secret) {
|
||||
this.collection.addObject({ key: value, secret: secret });
|
||||
this.collection.addObject({ key: value, secret });
|
||||
this._saveValues();
|
||||
},
|
||||
|
||||
|
|
|
@ -121,7 +121,7 @@ export default Controller.extend({
|
|||
},
|
||||
|
||||
filterBySubject(subject) {
|
||||
this.changeFilters({ subject: subject });
|
||||
this.changeFilters({ subject });
|
||||
},
|
||||
|
||||
exportStaffActionLogs() {
|
||||
|
|
|
@ -49,7 +49,7 @@ export default Controller.extend(GrantBadgeController, {
|
|||
let result = {
|
||||
badge: badges[0].badge,
|
||||
granted_at: lastGranted,
|
||||
badges: badges,
|
||||
badges,
|
||||
count: badges.length,
|
||||
grouped: true,
|
||||
};
|
||||
|
|
|
@ -592,7 +592,7 @@ export default Controller.extend(CanCheckEmails, {
|
|||
(deletedPosts * 100) / user.get("post_count")
|
||||
);
|
||||
progressModal.setProperties({
|
||||
deletedPercentage: deletedPercentage,
|
||||
deletedPercentage,
|
||||
});
|
||||
performDelete(progressModal);
|
||||
}
|
||||
|
|
|
@ -35,11 +35,11 @@ const Permalink = EmberObject.extend({
|
|||
|
||||
Permalink.reopenClass({
|
||||
findAll: function (filter) {
|
||||
return ajax("/admin/permalinks.json", { data: { filter: filter } }).then(
|
||||
function (permalinks) {
|
||||
return permalinks.map((p) => Permalink.create(p));
|
||||
}
|
||||
);
|
||||
return ajax("/admin/permalinks.json", { data: { filter } }).then(function (
|
||||
permalinks
|
||||
) {
|
||||
return permalinks.map((p) => Permalink.create(p));
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
|
|
|
@ -672,7 +672,7 @@ Report.reopenClass({
|
|||
Report.fillMissingDates(json.report);
|
||||
}
|
||||
|
||||
const model = Report.create({ type: type });
|
||||
const model = Report.create({ type });
|
||||
model.setProperties(json.report);
|
||||
|
||||
if (json.report.related_report) {
|
||||
|
|
|
@ -42,7 +42,7 @@ const ScreenedIpAddress = EmberObject.extend({
|
|||
ScreenedIpAddress.reopenClass({
|
||||
findAll(filter) {
|
||||
return ajax("/admin/logs/screened_ip_addresses.json", {
|
||||
data: { filter: filter },
|
||||
data: { filter },
|
||||
}).then((screened_ips) =>
|
||||
screened_ips.map((b) => ScreenedIpAddress.create(b))
|
||||
);
|
||||
|
|
|
@ -44,7 +44,7 @@ export default RestModel.extend({
|
|||
},
|
||||
|
||||
groupFinder(term) {
|
||||
return Group.findAll({ term: term, ignore_automatic: false });
|
||||
return Group.findAll({ term, ignore_automatic: false });
|
||||
},
|
||||
|
||||
@discourseComputed("wildcard_web_hook", "web_hook_event_types.[]")
|
||||
|
|
|
@ -32,7 +32,7 @@ export default DiscourseRoute.extend({
|
|||
});
|
||||
|
||||
controller.setProperties({
|
||||
badgeGroupings: badgeGroupings,
|
||||
badgeGroupings,
|
||||
badgeTypes: json.badge_types,
|
||||
protectedSystemFields: json.admin_badges.protected_system_fields,
|
||||
badgeTriggers,
|
||||
|
|
|
@ -39,8 +39,8 @@ export default Route.extend({
|
|||
});
|
||||
|
||||
controller.setProperties({
|
||||
model: model,
|
||||
parentController: parentController,
|
||||
model,
|
||||
parentController,
|
||||
allThemes: parentController.get("model"),
|
||||
colorSchemeId: model.get("color_scheme_id"),
|
||||
colorSchemes: parentController.get("model.extras.color_schemes"),
|
||||
|
|
|
@ -24,7 +24,7 @@ export default Route.extend({
|
|||
controller.setProperties({
|
||||
siteText,
|
||||
saved: false,
|
||||
localeFullName: localeFullName,
|
||||
localeFullName,
|
||||
});
|
||||
},
|
||||
});
|
||||
|
|
|
@ -550,7 +550,7 @@ export default Component.extend(ComposerUpload, {
|
|||
if (found.indexOf(name) === -1) {
|
||||
this.groupsMentioned([
|
||||
{
|
||||
name: name,
|
||||
name,
|
||||
user_count: $e.data("mentionable-user-count"),
|
||||
max_mentions: $e.data("max-mentions"),
|
||||
},
|
||||
|
|
|
@ -83,7 +83,7 @@ export default Component.extend({
|
|||
!topic.archived &&
|
||||
!topic.closed &&
|
||||
!topic.deleted,
|
||||
topic: topic,
|
||||
topic,
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
@ -37,12 +37,12 @@ export default Component.extend({
|
|||
const inboxFilter = suggestedGroupName ? "group" : "user";
|
||||
|
||||
const unreadCount = this.pmTopicTrackingState.lookupCount("unread", {
|
||||
inboxFilter: inboxFilter,
|
||||
inboxFilter,
|
||||
groupName: suggestedGroupName,
|
||||
});
|
||||
|
||||
const newCount = this.pmTopicTrackingState.lookupCount("new", {
|
||||
inboxFilter: inboxFilter,
|
||||
inboxFilter,
|
||||
groupName: suggestedGroupName,
|
||||
});
|
||||
|
||||
|
@ -54,7 +54,7 @@ export default Component.extend({
|
|||
BOTH: hasBoth,
|
||||
UNREAD: unreadCount,
|
||||
NEW: newCount,
|
||||
username: username,
|
||||
username,
|
||||
groupName: suggestedGroupName,
|
||||
groupLink: this._groupLink(username, suggestedGroupName),
|
||||
basePath: getURL(""),
|
||||
|
|
|
@ -37,7 +37,7 @@ export default Controller.extend({
|
|||
ajax({
|
||||
url: `/session/email-login/${this.model.token}`,
|
||||
type: "POST",
|
||||
data: data,
|
||||
data,
|
||||
})
|
||||
.then((result) => {
|
||||
if (result.success) {
|
||||
|
|
|
@ -48,8 +48,8 @@ export default Controller.extend(ModalFunctionality, GrantBadgeController, {
|
|||
UserBadge.findByUsername(this.get("post.username")),
|
||||
]).then(([allBadges, userBadges]) => {
|
||||
this.setProperties({
|
||||
allBadges: allBadges,
|
||||
userBadges: userBadges,
|
||||
allBadges,
|
||||
userBadges,
|
||||
loading: false,
|
||||
});
|
||||
});
|
||||
|
|
|
@ -83,7 +83,7 @@ export default Controller.extend(
|
|||
|
||||
@discourseComputed("email")
|
||||
yourEmailMessage(email) {
|
||||
return I18n.t("invites.your_email", { email: email });
|
||||
return I18n.t("invites.your_email", { email });
|
||||
},
|
||||
|
||||
@discourseComputed
|
||||
|
|
|
@ -273,9 +273,7 @@ export default Controller.extend(ModalFunctionality, {
|
|||
}
|
||||
|
||||
this.set("loggingIn", true);
|
||||
loginMethod
|
||||
.doLogin({ signup: signup })
|
||||
.catch(() => this.set("loggingIn", false));
|
||||
loginMethod.doLogin({ signup }).catch(() => this.set("loggingIn", false));
|
||||
},
|
||||
|
||||
createAccount() {
|
||||
|
|
|
@ -121,7 +121,7 @@ export default Controller.extend(PasswordValidation, {
|
|||
this.setProperties({
|
||||
securityKeyRequired: true,
|
||||
password: null,
|
||||
errorMessage: errorMessage,
|
||||
errorMessage,
|
||||
});
|
||||
}
|
||||
);
|
||||
|
|
|
@ -73,7 +73,7 @@ export default Controller.extend(ModalFunctionality, {
|
|||
name: this.model.username_lower,
|
||||
},
|
||||
pubKeyCredParams: this.supported_algorithms.map((alg) => {
|
||||
return { type: "public-key", alg: alg };
|
||||
return { type: "public-key", alg };
|
||||
}),
|
||||
excludeCredentials: this.existing_active_credential_ids.map(
|
||||
(credentialId) => {
|
||||
|
|
|
@ -60,7 +60,7 @@ export default Controller.extend(BulkTopicSelection, {
|
|||
|
||||
const opts = {
|
||||
inbox: this.inbox,
|
||||
topicIds: topicIds,
|
||||
topicIds,
|
||||
};
|
||||
|
||||
if (this.group) {
|
||||
|
|
|
@ -25,9 +25,9 @@ registerUnbound("format-date", function (val, params) {
|
|||
let date = new Date(val);
|
||||
return htmlSafe(
|
||||
autoUpdatingRelativeAge(date, {
|
||||
format: format,
|
||||
title: title,
|
||||
leaveAgo: leaveAgo,
|
||||
format,
|
||||
title,
|
||||
leaveAgo,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ function renderAvatar(user, options) {
|
|||
size: options.imageSize,
|
||||
extraClasses: get(user, "extras") || options.extraClasses,
|
||||
title: title || displayName,
|
||||
avatarTemplate: avatarTemplate,
|
||||
avatarTemplate,
|
||||
});
|
||||
} else {
|
||||
return "";
|
||||
|
|
|
@ -110,7 +110,7 @@ export function ajax() {
|
|||
});
|
||||
|
||||
if (args.returnXHR) {
|
||||
data = { result: data, xhr: xhr };
|
||||
data = { result: data, xhr };
|
||||
}
|
||||
|
||||
run(null, resolve, data);
|
||||
|
@ -145,8 +145,8 @@ export function ajax() {
|
|||
|
||||
run(null, reject, {
|
||||
jqXHR: xhr,
|
||||
textStatus: textStatus,
|
||||
errorThrown: errorThrown,
|
||||
textStatus,
|
||||
errorThrown,
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ function searchTags(term, categories, limit) {
|
|||
function () {
|
||||
oldSearch = $.ajax(getURL("/tags/filter/search"), {
|
||||
type: "GET",
|
||||
data: { limit: limit, q },
|
||||
data: { limit, q },
|
||||
});
|
||||
|
||||
let returnVal = CANCELLED_STATUS;
|
||||
|
|
|
@ -27,10 +27,10 @@ export function extractLinkMeta(topic) {
|
|||
}
|
||||
|
||||
const meta = {
|
||||
target: target,
|
||||
target,
|
||||
href,
|
||||
domain: domain,
|
||||
rel: rel,
|
||||
domain,
|
||||
rel,
|
||||
};
|
||||
|
||||
if (_decorators.length) {
|
||||
|
|
|
@ -147,7 +147,7 @@ export default class {
|
|||
|
||||
const { timings, topicTime, topicId } = this._consolidatedTimings.pop();
|
||||
const data = {
|
||||
timings: timings,
|
||||
timings,
|
||||
topic_time: topicTime,
|
||||
topic_id: topicId,
|
||||
};
|
||||
|
|
|
@ -143,7 +143,7 @@ export function searchForTerm(term, opts) {
|
|||
}
|
||||
|
||||
// Only include the data we have
|
||||
const data = { term: term };
|
||||
const data = { term };
|
||||
if (opts.typeFilter) {
|
||||
data.type_filter = opts.typeFilter;
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ function performSearch(
|
|||
}
|
||||
|
||||
let data = {
|
||||
term: term,
|
||||
term,
|
||||
topic_id: topicId,
|
||||
category_id: categoryId,
|
||||
include_groups: includeGroups,
|
||||
|
@ -65,7 +65,7 @@ function performSearch(
|
|||
topic_allowed_users: allowedUsers,
|
||||
include_staged_users: includeStagedUsers,
|
||||
last_seen_users: lastSeenUsers,
|
||||
limit: limit,
|
||||
limit,
|
||||
};
|
||||
|
||||
if (customUserSearchOptions) {
|
||||
|
|
|
@ -99,9 +99,7 @@ export function avatarImg(options, customGetURL) {
|
|||
}
|
||||
|
||||
export function tinyAvatar(avatarTemplate, options) {
|
||||
return avatarImg(
|
||||
deepMerge({ avatarTemplate: avatarTemplate, size: "tiny" }, options)
|
||||
);
|
||||
return avatarImg(deepMerge({ avatarTemplate, size: "tiny" }, options));
|
||||
}
|
||||
|
||||
export function postUrl(slug, topicId, postNumber) {
|
||||
|
@ -219,7 +217,7 @@ export function caretRowCol(el) {
|
|||
return sum + row.length + 1;
|
||||
}, 0);
|
||||
|
||||
return { rowNum: rowNum, colNum: colNum };
|
||||
return { rowNum, colNum };
|
||||
}
|
||||
|
||||
// Determine the position of the caret in an element
|
||||
|
|
|
@ -38,7 +38,7 @@ export function getWebauthnCredential(
|
|||
.get({
|
||||
publicKey: {
|
||||
challenge: challengeBuffer,
|
||||
allowCredentials: allowCredentials,
|
||||
allowCredentials,
|
||||
timeout: 60000,
|
||||
|
||||
// see https://chromium.googlesource.com/chromium/src/+/master/content/browser/webauth/uv_preferred.md for why
|
||||
|
|
|
@ -53,7 +53,7 @@ export default Mixin.create({
|
|||
topicBody,
|
||||
archetypeId: "private_message",
|
||||
draftKey: Composer.NEW_PRIVATE_MESSAGE_KEY,
|
||||
hasGroups: hasGroups,
|
||||
hasGroups,
|
||||
});
|
||||
},
|
||||
});
|
||||
|
|
|
@ -157,7 +157,7 @@ const Bookmark = RestModel.extend({
|
|||
return User.create({
|
||||
username: post_user_username,
|
||||
avatar_template: avatarTemplate,
|
||||
name: name,
|
||||
name,
|
||||
});
|
||||
},
|
||||
});
|
||||
|
|
|
@ -28,7 +28,7 @@ const NavItem = EmberObject.extend({
|
|||
count = 0;
|
||||
}
|
||||
|
||||
let extra = { count: count };
|
||||
let extra = { count };
|
||||
const titleKey = count === 0 ? ".title" : ".title_with_count";
|
||||
|
||||
return emojiUnescape(
|
||||
|
|
|
@ -549,7 +549,7 @@ export default RestModel.extend({
|
|||
|
||||
post.setProperties({
|
||||
post_number: topic.get("highest_post_number"),
|
||||
topic: topic,
|
||||
topic,
|
||||
created_at: new Date(),
|
||||
id: -1,
|
||||
});
|
||||
|
@ -1063,7 +1063,7 @@ export default RestModel.extend({
|
|||
const url = `/t/${this.get("topic.id")}/posts.json`;
|
||||
let data = {
|
||||
post_number: postNumber,
|
||||
asc: asc,
|
||||
asc,
|
||||
include_suggested: includeSuggested,
|
||||
};
|
||||
|
||||
|
|
|
@ -219,7 +219,7 @@ const Post = RestModel.extend({
|
|||
: "post.deleted_by_author_simple";
|
||||
promise = cookAsync(I18n.t(key)).then((cooked) => {
|
||||
this.setProperties({
|
||||
cooked: cooked,
|
||||
cooked,
|
||||
can_delete: false,
|
||||
can_permanently_delete: false,
|
||||
version: this.version + 1,
|
||||
|
|
|
@ -49,7 +49,7 @@ const TopicDetails = RestModel.extend({
|
|||
|
||||
return ajax("/t/" + this.get("topic.id") + "/remove-allowed-group", {
|
||||
type: "PUT",
|
||||
data: { name: name },
|
||||
data: { name },
|
||||
}).then(() => {
|
||||
groups.removeObject(groups.findBy("name", name));
|
||||
});
|
||||
|
@ -61,7 +61,7 @@ const TopicDetails = RestModel.extend({
|
|||
|
||||
return ajax("/t/" + this.get("topic.id") + "/remove-allowed-user", {
|
||||
type: "PUT",
|
||||
data: { username: username },
|
||||
data: { username },
|
||||
}).then(() => {
|
||||
users.removeObject(users.findBy("username", username));
|
||||
});
|
||||
|
|
|
@ -155,9 +155,9 @@ UserBadge.reopenClass({
|
|||
return ajax("/user_badges", {
|
||||
type: "POST",
|
||||
data: {
|
||||
username: username,
|
||||
username,
|
||||
badge_id: badgeId,
|
||||
reason: reason,
|
||||
reason,
|
||||
},
|
||||
}).then(function (json) {
|
||||
return UserBadge.createFromJson(json);
|
||||
|
|
|
@ -382,7 +382,7 @@ const User = RestModel.extend({
|
|||
// TODO: We can remove this when migrated fully to rest model.
|
||||
this.set("isSaving", true);
|
||||
return ajax(userPath(`${this.username_lower}.json`), {
|
||||
data: data,
|
||||
data,
|
||||
type: "PUT",
|
||||
})
|
||||
.then((result) => {
|
||||
|
@ -1037,7 +1037,7 @@ User.reopenClass(Singleton, {
|
|||
|
||||
// Find a `User` for a given username.
|
||||
findByUsername(username, options) {
|
||||
const user = User.create({ username: username });
|
||||
const user = User.create({ username });
|
||||
return user.findDetails(options);
|
||||
},
|
||||
|
||||
|
|
|
@ -151,9 +151,9 @@ export default (filterArg, params) => {
|
|||
canCreateTopic && category.get("permission") === PermissionType.FULL;
|
||||
|
||||
this.controllerFor("navigation/category").setProperties({
|
||||
canCreateTopicOnCategory: canCreateTopicOnCategory,
|
||||
canCreateTopicOnCategory,
|
||||
cannotCreateTopicOnCategory: !canCreateTopicOnCategory,
|
||||
canCreateTopic: canCreateTopic,
|
||||
canCreateTopic,
|
||||
});
|
||||
|
||||
let topicOpts = {
|
||||
|
@ -165,8 +165,8 @@ export default (filterArg, params) => {
|
|||
selected: [],
|
||||
noSubcategories: params && !!params.no_subcategories,
|
||||
expandAllPinned: true,
|
||||
canCreateTopic: canCreateTopic,
|
||||
canCreateTopicOnCategory: canCreateTopicOnCategory,
|
||||
canCreateTopic,
|
||||
canCreateTopicOnCategory,
|
||||
};
|
||||
|
||||
const p = category.get("params");
|
||||
|
|
|
@ -61,7 +61,7 @@ export default (inboxType, filter) => {
|
|||
.get("groups")
|
||||
.filterBy("name", groupName)[0];
|
||||
|
||||
this.setProperties({ groupName: groupName, group });
|
||||
this.setProperties({ groupName, group });
|
||||
},
|
||||
|
||||
setupController() {
|
||||
|
|
|
@ -67,7 +67,7 @@ export default (inboxType, path, filter) => {
|
|||
tagsForUser: this.modelFor("user").get("username_lower"),
|
||||
selected: [],
|
||||
showToggleBulkSelect: true,
|
||||
filter: filter,
|
||||
filter,
|
||||
group: null,
|
||||
inbox: inboxType,
|
||||
});
|
||||
|
|
|
@ -30,7 +30,7 @@ export default DiscourseRoute.extend(OpenComposer, {
|
|||
const period = User.currentProp("redirected_to_top.period") || "all";
|
||||
this.replaceWith("discovery.top", {
|
||||
queryParams: {
|
||||
period: period,
|
||||
period,
|
||||
},
|
||||
});
|
||||
} else if (url && (matches = url.match(/top\/(.*)$/))) {
|
||||
|
|
|
@ -14,7 +14,7 @@ export default RestrictedUserRoute.extend({
|
|||
setupController: function (controller, model) {
|
||||
controller.reset();
|
||||
controller.setProperties({
|
||||
model: model,
|
||||
model,
|
||||
oldEmail: controller.new ? "" : model.get("email"),
|
||||
newEmail: controller.new ? "" : model.get("email"),
|
||||
});
|
||||
|
|
|
@ -221,7 +221,7 @@ export default DiscourseRoute.extend(FilterModeMixin, {
|
|||
|
||||
if (categoryId) {
|
||||
options = $.extend({}, options, {
|
||||
categoryId: categoryId,
|
||||
categoryId,
|
||||
includeSubcategories: !controller.noSubcategories,
|
||||
});
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ export default DiscourseRoute.extend(ViewingActionType, {
|
|||
this.get("currentUser.admin")
|
||||
) {
|
||||
return this.store.find("notification", {
|
||||
username: username,
|
||||
username,
|
||||
filter: params.filter,
|
||||
});
|
||||
}
|
||||
|
|
|
@ -355,7 +355,7 @@ export default class PresenceService extends Service {
|
|||
this._queuedEvents.push({
|
||||
channel: channelName,
|
||||
type: "enter",
|
||||
promiseProxy: promiseProxy,
|
||||
promiseProxy,
|
||||
});
|
||||
|
||||
this._scheduleNextUpdate();
|
||||
|
@ -384,7 +384,7 @@ export default class PresenceService extends Service {
|
|||
this._queuedEvents.push({
|
||||
channel: channelName,
|
||||
type: "leave",
|
||||
promiseProxy: promiseProxy,
|
||||
promiseProxy,
|
||||
});
|
||||
|
||||
this._scheduleNextUpdate();
|
||||
|
|
|
@ -103,7 +103,7 @@ export default createWidget("home-logo", {
|
|||
: { src: getURL(url), alt: title };
|
||||
|
||||
const imgElement = h(`img#site-logo.${key}`, {
|
||||
key: key,
|
||||
key,
|
||||
attributes,
|
||||
});
|
||||
|
||||
|
|
|
@ -38,9 +38,9 @@ function preloadInvite({
|
|||
title: "team",
|
||||
},
|
||||
username: "invited",
|
||||
email_verified_by_link: email_verified_by_link,
|
||||
different_external_email: different_external_email,
|
||||
hidden_email: hidden_email,
|
||||
email_verified_by_link,
|
||||
different_external_email,
|
||||
hidden_email,
|
||||
};
|
||||
|
||||
if (link) {
|
||||
|
|
|
@ -24,7 +24,7 @@ async function triggerSwipeStart(touchTarget) {
|
|||
);
|
||||
|
||||
const touchStart = {
|
||||
touchTarget: touchTarget,
|
||||
touchTarget,
|
||||
x:
|
||||
zoom *
|
||||
(touchTarget.getBoundingClientRect().x +
|
||||
|
|
|
@ -123,7 +123,7 @@ acceptance(
|
|||
|
||||
return helper.response({
|
||||
topic_list: {
|
||||
topics: topics,
|
||||
topics,
|
||||
},
|
||||
});
|
||||
});
|
||||
|
|
|
@ -8,7 +8,7 @@ import hbs from "htmlbars-inline-precompile";
|
|||
|
||||
const createArgs = (topic) => {
|
||||
return {
|
||||
topic: topic,
|
||||
topic,
|
||||
openUpwards: "true",
|
||||
toggleMultiSelect: () => {},
|
||||
deleteTopic: () => {},
|
||||
|
|
|
@ -149,7 +149,7 @@ function writeSummaryLine(message) {
|
|||
if (window.Testem) {
|
||||
window.Testem.useCustomAdapter(function (socket) {
|
||||
socket.emit("test-metadata", "summary-line", {
|
||||
message: message,
|
||||
message,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -107,8 +107,8 @@ window.keyEvent = function (selector, contextOrType, typeOrKeyCode, keyCode) {
|
|||
let key = keyFromKeyCode[keyCode];
|
||||
|
||||
return window.triggerEvent(selector, context, type, {
|
||||
keyCode: keyCode,
|
||||
keyCode,
|
||||
which: keyCode,
|
||||
key: key,
|
||||
key,
|
||||
});
|
||||
};
|
||||
|
|
|
@ -1011,7 +1011,7 @@ eviltrout</p>
|
|||
"[test.pdf|attachment](upload://o8iobpLcW3WSFvVH7YQmyGlKmGM.pdf)",
|
||||
{
|
||||
siteSettings: { secure_media: false },
|
||||
lookupUploadUrls: lookupUploadUrls,
|
||||
lookupUploadUrls,
|
||||
},
|
||||
`<p><a class="attachment" href="/uploads/short-url/blah">test.pdf</a></p>`,
|
||||
"It returns the correct attachment link HTML when the URL is mapped without secure media"
|
||||
|
@ -1033,7 +1033,7 @@ eviltrout</p>
|
|||
"[test.pdf|attachment](upload://o8iobpLcW3WSFvVH7YQmyGlKmGM.pdf)",
|
||||
{
|
||||
siteSettings: { secure_media: true },
|
||||
lookupUploadUrls: lookupUploadUrls,
|
||||
lookupUploadUrls,
|
||||
},
|
||||
`<p><a class="attachment" href="/secure-media-uploads/original/3X/c/b/o8iobpLcW3WSFvVH7YQmyGlKmGM.pdf">test.pdf</a></p>`,
|
||||
"It returns the correct attachment link HTML when the URL is mapped with secure media"
|
||||
|
@ -1067,7 +1067,7 @@ eviltrout</p>
|
|||
"![baby shark|video](upload://eyPnj7UzkU0AkGkx2dx8G4YM1Jx.mp4)",
|
||||
{
|
||||
siteSettings: { secure_media: true },
|
||||
lookupUploadUrls: lookupUploadUrls,
|
||||
lookupUploadUrls,
|
||||
},
|
||||
`<p><div class="video-container">
|
||||
<video width="100%" height="100%" preload="metadata" controls>
|
||||
|
@ -1104,7 +1104,7 @@ eviltrout</p>
|
|||
"![baby shark|audio](upload://eyPnj7UzkU0AkGkx2dx8G4YM1Jx.mp3)",
|
||||
{
|
||||
siteSettings: { secure_media: true },
|
||||
lookupUploadUrls: lookupUploadUrls,
|
||||
lookupUploadUrls,
|
||||
},
|
||||
`<p><audio preload="metadata" controls>
|
||||
<source src="/secure-media-uploads/original/3X/c/b/test.mp3">
|
||||
|
|
|
@ -103,14 +103,14 @@ discourseModule("Unit | Utilities", function () {
|
|||
|
||||
let avatarTemplate = "/path/to/avatar/{size}.png";
|
||||
assert.strictEqual(
|
||||
avatarImg({ avatarTemplate: avatarTemplate, size: "tiny" }),
|
||||
avatarImg({ avatarTemplate, size: "tiny" }),
|
||||
"<img loading='lazy' alt='' width='20' height='20' src='/path/to/avatar/40.png' class='avatar'>",
|
||||
"it returns the avatar html"
|
||||
);
|
||||
|
||||
assert.strictEqual(
|
||||
avatarImg({
|
||||
avatarTemplate: avatarTemplate,
|
||||
avatarTemplate,
|
||||
size: "tiny",
|
||||
title: "evilest trout",
|
||||
}),
|
||||
|
@ -120,7 +120,7 @@ discourseModule("Unit | Utilities", function () {
|
|||
|
||||
assert.strictEqual(
|
||||
avatarImg({
|
||||
avatarTemplate: avatarTemplate,
|
||||
avatarTemplate,
|
||||
size: "tiny",
|
||||
extraClasses: "evil fish",
|
||||
}),
|
||||
|
|
|
@ -39,7 +39,7 @@ module("Unit | Model | category", function () {
|
|||
slugFor(
|
||||
store.createRecord("category", {
|
||||
slug: "luke",
|
||||
parentCategory: parentCategory,
|
||||
parentCategory,
|
||||
}),
|
||||
"darth/luke",
|
||||
"it uses the parent slug before the child"
|
||||
|
@ -48,7 +48,7 @@ module("Unit | Model | category", function () {
|
|||
slugFor(
|
||||
store.createRecord("category", {
|
||||
id: 555,
|
||||
parentCategory: parentCategory,
|
||||
parentCategory,
|
||||
}),
|
||||
"darth/555-category",
|
||||
"it uses the parent slug before the child and then uses id"
|
||||
|
@ -58,7 +58,7 @@ module("Unit | Model | category", function () {
|
|||
slugFor(
|
||||
store.createRecord("category", {
|
||||
id: 555,
|
||||
parentCategory: parentCategory,
|
||||
parentCategory,
|
||||
}),
|
||||
"345-category/555-category",
|
||||
"it uses the parent before the child and uses ids for both"
|
||||
|
|
|
@ -277,7 +277,7 @@ discourseModule("Unit | Model | composer", function () {
|
|||
assert.ok(!composer.get("editingFirstPost"), "it's false by default");
|
||||
|
||||
const post = Post.create({ id: 123, post_number: 2 });
|
||||
composer.setProperties({ post: post, action: EDIT });
|
||||
composer.setProperties({ post, action: EDIT });
|
||||
assert.ok(
|
||||
!composer.get("editingFirstPost"),
|
||||
"it's false when not editing the first post"
|
||||
|
@ -337,7 +337,7 @@ discourseModule("Unit | Model | composer", function () {
|
|||
action: REPLY,
|
||||
draftKey: "asfd",
|
||||
draftSequence: 1,
|
||||
quote: quote,
|
||||
quote,
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -363,7 +363,7 @@ discourseModule("Unit | Model | composer", function () {
|
|||
post_number: 2,
|
||||
static_doc: true,
|
||||
});
|
||||
composer.setProperties({ post: post, action: EDIT });
|
||||
composer.setProperties({ post, action: EDIT });
|
||||
|
||||
composer.set("title", "asdf");
|
||||
assert.ok(composer.get("titleLengthValid"), "admins can use short titles");
|
||||
|
|
|
@ -889,7 +889,7 @@ module("Unit | Model | post-stream", function () {
|
|||
|
||||
[1, 2, 3, 5].forEach((id) => {
|
||||
postStream.appendPost(
|
||||
store.createRecord("post", { id: id, post_number: id })
|
||||
store.createRecord("post", { id, post_number: id })
|
||||
);
|
||||
});
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ module("Unit | Model | post", function () {
|
|||
|
||||
test("destroy by staff", async function (assert) {
|
||||
let user = User.create({ username: "staff", moderator: true });
|
||||
let post = buildPost({ user: user });
|
||||
let post = buildPost({ user });
|
||||
|
||||
await post.destroy(user);
|
||||
|
||||
|
@ -85,7 +85,7 @@ module("Unit | Model | post", function () {
|
|||
test("destroy by non-staff", async function (assert) {
|
||||
const originalCooked = "this is the original cooked value";
|
||||
const user = User.create({ username: "evil trout" });
|
||||
const post = buildPost({ user: user, cooked: originalCooked });
|
||||
const post = buildPost({ user, cooked: originalCooked });
|
||||
|
||||
await post.destroy(user);
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ module("Unit | Model | user", function () {
|
|||
|
||||
assert.deepEqual(
|
||||
user.get("searchContext"),
|
||||
{ type: "user", id: "eviltrout", user: user },
|
||||
{ type: "user", id: "eviltrout", user },
|
||||
"has a search context"
|
||||
);
|
||||
});
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
"chart.js": "3.5.1",
|
||||
"chartjs-plugin-datalabels": "^2.0.0",
|
||||
"diffhtml": "^1.0.0-beta.20",
|
||||
"eslint-config-discourse": "^1.1.8",
|
||||
"eslint-config-discourse": "^1.1.9",
|
||||
"handlebars": "^4.7.7",
|
||||
"jquery": "3.5.1",
|
||||
"jquery-color": "3.0.0-alpha.1",
|
||||
|
|
|
@ -1492,10 +1492,10 @@ escape-string-regexp@^1.0.5:
|
|||
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
|
||||
integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
|
||||
|
||||
eslint-config-discourse@^1.1.8:
|
||||
version "1.1.8"
|
||||
resolved "https://registry.yarnpkg.com/eslint-config-discourse/-/eslint-config-discourse-1.1.8.tgz#c297831876811ea08203aa348d1ba2a963b2ae78"
|
||||
integrity sha512-ZSQfhliiO5Cfa7WcKoMkN4wW/1rBJpecpMJpfjiFsElfgPj4EV4Pzksi5CvFnRbJDoZh6DYYrQfO+tW062VOUA==
|
||||
eslint-config-discourse@^1.1.9:
|
||||
version "1.1.9"
|
||||
resolved "https://registry.yarnpkg.com/eslint-config-discourse/-/eslint-config-discourse-1.1.9.tgz#9a5ee6b3a4b986e5243f517e7945d1709c4e22df"
|
||||
integrity sha512-a4KG+/9/7ZhYVV0URGK70K7QtxlydYKjie0ZssHEGxl2auOUTDcdRMBfZQBtIxQr9X8TF0+eeUUsScBXNU6xZw==
|
||||
dependencies:
|
||||
babel-eslint "^10.1.0"
|
||||
ember-template-lint "^2.11.0"
|
||||
|
|
Loading…
Reference in New Issue