mirror of
https://github.com/discourse/discourse.git
synced 2025-03-21 19:02:23 +08:00
DEV: run files through prettier
2ae21e9 was prettiered using an old version of prettier. This re-applies it using latest.
This commit is contained in:
parent
02a886ce13
commit
13cca3eaa0
app/assets/javascripts
admin
components
controllers
models
discourse
components
edit-category-general.js.es6edit-category-tags.js.es6edit-topic-timer-form.js.es6future-date-input.js.es6topic-footer-buttons.js.es6user-card-contents.js.es6
controllers
change-owner.js.es6
discovery
history.js.es6jump-to-post.js.es6move-to-topic.js.es6preferences
reorder-categories.js.es6second-factor-backup-edit.js.es6user-private-messages.js.es6user.js.es6mixins
models
@ -59,10 +59,7 @@ export default Component.extend({
|
||||
showTitle: true,
|
||||
showFilteringUI: false,
|
||||
showDatesOptions: alias("model.dates_filtering"),
|
||||
showRefresh: or(
|
||||
"showDatesOptions",
|
||||
"model.available_filters.length"
|
||||
),
|
||||
showRefresh: or("showDatesOptions", "model.available_filters.length"),
|
||||
shouldDisplayTrend: and("showTrend", "model.prev_period"),
|
||||
|
||||
init() {
|
||||
@ -84,11 +81,7 @@ export default Component.extend({
|
||||
}
|
||||
},
|
||||
|
||||
showError: or(
|
||||
"showTimeoutError",
|
||||
"showExceptionError",
|
||||
"showNotFoundError"
|
||||
),
|
||||
showError: or("showTimeoutError", "showExceptionError", "showNotFoundError"),
|
||||
showNotFoundError: equal("model.error", "not_found"),
|
||||
showTimeoutError: equal("model.error", "timeout"),
|
||||
showExceptionError: equal("model.error", "exception"),
|
||||
|
@ -14,9 +14,7 @@ export default Controller.extend(bufferedProperty("model"), {
|
||||
badgeTypes: alias("adminBadges.badgeTypes"),
|
||||
badgeGroupings: alias("adminBadges.badgeGroupings"),
|
||||
badgeTriggers: alias("adminBadges.badgeTriggers"),
|
||||
protectedSystemFields: alias(
|
||||
"adminBadges.protectedSystemFields"
|
||||
),
|
||||
protectedSystemFields: alias("adminBadges.protectedSystemFields"),
|
||||
|
||||
readOnly: alias("buffered.system"),
|
||||
showDisplayName: propertyNotEqual("name", "displayName"),
|
||||
|
@ -149,10 +149,7 @@ export default Controller.extend({
|
||||
"scss"
|
||||
);
|
||||
},
|
||||
sourceIsHttp: match(
|
||||
"model.remote_theme.remote_url",
|
||||
/^http(s)?:\/\//
|
||||
),
|
||||
sourceIsHttp: match("model.remote_theme.remote_url", /^http(s)?:\/\//),
|
||||
actions: {
|
||||
updateToLatest() {
|
||||
this.set("updatingRemote", true);
|
||||
|
@ -17,9 +17,7 @@ export default Controller.extend(CanCheckEmails, {
|
||||
userTitleValue: null,
|
||||
|
||||
showBadges: setting("enable_badges"),
|
||||
hasLockedTrustLevel: notEmpty(
|
||||
"model.manual_locked_trust_level"
|
||||
),
|
||||
hasLockedTrustLevel: notEmpty("model.manual_locked_trust_level"),
|
||||
|
||||
primaryGroupDirty: propertyNotEqual(
|
||||
"originalPrimaryGroupId",
|
||||
|
@ -12,14 +12,8 @@ const wrapAdmin = user => (user ? AdminUser.create(user) : null);
|
||||
|
||||
const AdminUser = Discourse.User.extend({
|
||||
adminUserView: true,
|
||||
customGroups: filter(
|
||||
"groups",
|
||||
g => !g.automatic && Group.create(g)
|
||||
),
|
||||
automaticGroups: filter(
|
||||
"groups",
|
||||
g => g.automatic && Group.create(g)
|
||||
),
|
||||
customGroups: filter("groups", g => !g.automatic && Group.create(g)),
|
||||
automaticGroups: filter("groups", g => g.automatic && Group.create(g)),
|
||||
|
||||
canViewProfile: or("active", "staged"),
|
||||
|
||||
|
@ -11,9 +11,7 @@ export default buildCategoryPanel("general", {
|
||||
this.foregroundColors = ["FFFFFF", "000000"];
|
||||
},
|
||||
|
||||
canSelectParentCategory: not(
|
||||
"category.isUncategorizedCategory"
|
||||
),
|
||||
canSelectParentCategory: not("category.isUncategorizedCategory"),
|
||||
uncategorizedSiteSettingLink: Discourse.getURL(
|
||||
"/admin/site_settings/category/all_results?filter=allow_uncategorized_topics"
|
||||
),
|
||||
|
@ -4,8 +4,5 @@ import { buildCategoryPanel } from "discourse/components/edit-category-panel";
|
||||
export default buildCategoryPanel("tags", {
|
||||
allowedTagsEmpty: empty("category.allowed_tags"),
|
||||
allowedTagGroupsEmpty: empty("category.allowed_tag_groups"),
|
||||
disableAllowGlobalTags: and(
|
||||
"allowedTagsEmpty",
|
||||
"allowedTagGroupsEmpty"
|
||||
)
|
||||
disableAllowGlobalTags: and("allowedTagsEmpty", "allowedTagGroupsEmpty")
|
||||
});
|
||||
|
@ -22,17 +22,9 @@ export default Component.extend({
|
||||
autoClose: equal("selection", CLOSE_STATUS_TYPE),
|
||||
autoDelete: equal("selection", DELETE_STATUS_TYPE),
|
||||
autoBump: equal("selection", BUMP_TYPE),
|
||||
publishToCategory: equal(
|
||||
"selection",
|
||||
PUBLISH_TO_CATEGORY_STATUS_TYPE
|
||||
),
|
||||
publishToCategory: equal("selection", PUBLISH_TO_CATEGORY_STATUS_TYPE),
|
||||
reminder: equal("selection", REMINDER_TYPE),
|
||||
showTimeOnly: or(
|
||||
"autoOpen",
|
||||
"autoDelete",
|
||||
"reminder",
|
||||
"autoBump"
|
||||
),
|
||||
showTimeOnly: or("autoOpen", "autoDelete", "reminder", "autoBump"),
|
||||
|
||||
@computed(
|
||||
"topicTimer.updateTime",
|
||||
|
@ -13,10 +13,7 @@ export default Component.extend({
|
||||
time: null,
|
||||
includeDateTime: true,
|
||||
isCustom: equal("selection", "pick_date_and_time"),
|
||||
isBasedOnLastPost: equal(
|
||||
"selection",
|
||||
"set_based_on_last_post"
|
||||
),
|
||||
isBasedOnLastPost: equal("selection", "set_based_on_last_post"),
|
||||
displayDateAndTimePicker: and("includeDateTime", "isCustom"),
|
||||
displayLabel: null,
|
||||
|
||||
|
@ -36,11 +36,7 @@ export default Component.extend({
|
||||
|
||||
canDefer: alias("currentUser.enable_defer"),
|
||||
|
||||
inviteDisabled: or(
|
||||
"topic.archived",
|
||||
"topic.closed",
|
||||
"topic.deleted"
|
||||
),
|
||||
inviteDisabled: or("topic.archived", "topic.closed", "topic.deleted"),
|
||||
|
||||
@computed
|
||||
showAdminButton() {
|
||||
@ -51,10 +47,7 @@ export default Component.extend({
|
||||
);
|
||||
},
|
||||
|
||||
showEditOnFooter: and(
|
||||
"topic.isPrivateMessage",
|
||||
"site.can_tag_pms"
|
||||
),
|
||||
showEditOnFooter: and("topic.isPrivateMessage", "site.can_tag_pms"),
|
||||
|
||||
@computed("topic.message_archived")
|
||||
archiveIcon: archived => (archived ? "envelope" : "folder"),
|
||||
|
@ -36,17 +36,10 @@ export default Component.extend(CardContentsBase, CanCheckEmails, CleansUp, {
|
||||
showName: propertyNotEqual("user.name", "user.username"),
|
||||
hasUserFilters: gt("postStream.userFilters.length", 0),
|
||||
showMoreBadges: gt("moreBadgesCount", 0),
|
||||
showDelete: and(
|
||||
"viewingAdmin",
|
||||
"showName",
|
||||
"user.canBeDeleted"
|
||||
),
|
||||
showDelete: and("viewingAdmin", "showName", "user.canBeDeleted"),
|
||||
linkWebsite: not("user.isBasic"),
|
||||
hasLocationOrWebsite: or("user.location", "user.website_name"),
|
||||
isSuspendedOrHasBio: or(
|
||||
"user.suspend_reason",
|
||||
"user.bio_cooked"
|
||||
),
|
||||
isSuspendedOrHasBio: or("user.suspend_reason", "user.bio_cooked"),
|
||||
showCheckEmail: and("user.staged", "canCheckEmails"),
|
||||
|
||||
user: null,
|
||||
|
@ -12,12 +12,8 @@ export default Controller.extend(ModalFunctionality, {
|
||||
saving: false,
|
||||
new_user: null,
|
||||
|
||||
selectedPostsCount: alias(
|
||||
"topicController.selectedPostsCount"
|
||||
),
|
||||
selectedPostsUsername: alias(
|
||||
"topicController.selectedPostsUsername"
|
||||
),
|
||||
selectedPostsCount: alias("topicController.selectedPostsCount"),
|
||||
selectedPostsUsername: alias("topicController.selectedPostsUsername"),
|
||||
|
||||
@computed("saving", "new_user")
|
||||
buttonDisabled(saving, newUser) {
|
||||
|
@ -17,9 +17,7 @@ const controllerOpts = {
|
||||
|
||||
canStar: alias("currentUser.id"),
|
||||
showTopicPostBadges: not("discoveryTopics.new"),
|
||||
redirectedReason: alias(
|
||||
"currentUser.redirected_to_top.reason"
|
||||
),
|
||||
redirectedReason: alias("currentUser.redirected_to_top.reason"),
|
||||
|
||||
order: "default",
|
||||
ascending: false,
|
||||
|
@ -33,12 +33,8 @@ export default Controller.extend(ModalFunctionality, {
|
||||
}
|
||||
},
|
||||
|
||||
previousFeaturedLink: alias(
|
||||
"model.featured_link_changes.previous"
|
||||
),
|
||||
currentFeaturedLink: alias(
|
||||
"model.featured_link_changes.current"
|
||||
),
|
||||
previousFeaturedLink: alias("model.featured_link_changes.previous"),
|
||||
currentFeaturedLink: alias("model.featured_link_changes.current"),
|
||||
|
||||
previousTagChanges: customTagArray("model.tags_changes.previous"),
|
||||
currentTagChanges: customTagArray("model.tags_changes.current"),
|
||||
@ -174,10 +170,7 @@ export default Controller.extend(ModalFunctionality, {
|
||||
return this.currentUser && this.currentUser.get("staff");
|
||||
},
|
||||
|
||||
isEitherRevisionHidden: or(
|
||||
"model.previous_hidden",
|
||||
"model.current_hidden"
|
||||
),
|
||||
isEitherRevisionHidden: or("model.previous_hidden", "model.current_hidden"),
|
||||
|
||||
@computed("model.previous_hidden", "model.current_hidden", "displayingInline")
|
||||
hiddenClasses(prevHidden, currentHidden, displayingInline) {
|
||||
@ -197,10 +190,7 @@ export default Controller.extend(ModalFunctionality, {
|
||||
|
||||
displayingInline: equal("viewMode", "inline"),
|
||||
displayingSideBySide: equal("viewMode", "side_by_side"),
|
||||
displayingSideBySideMarkdown: equal(
|
||||
"viewMode",
|
||||
"side_by_side_markdown"
|
||||
),
|
||||
displayingSideBySideMarkdown: equal("viewMode", "side_by_side_markdown"),
|
||||
|
||||
@computed("displayingInline")
|
||||
inlineClass(displayingInline) {
|
||||
|
@ -7,9 +7,7 @@ export default Controller.extend(ModalFunctionality, {
|
||||
model: null,
|
||||
postNumber: null,
|
||||
postDate: null,
|
||||
filteredPostsCount: alias(
|
||||
"topic.postStream.filteredPostsCount"
|
||||
),
|
||||
filteredPostsCount: alias("topic.postStream.filteredPostsCount"),
|
||||
|
||||
onShow() {
|
||||
next(() => $("#post-jump").focus());
|
||||
|
@ -41,9 +41,7 @@ export default Controller.extend(ModalFunctionality, {
|
||||
},
|
||||
|
||||
topicController: inject("topic"),
|
||||
selectedPostsCount: alias(
|
||||
"topicController.selectedPostsCount"
|
||||
),
|
||||
selectedPostsCount: alias("topicController.selectedPostsCount"),
|
||||
selectedAllPosts: alias("topicController.selectedAllPosts"),
|
||||
selectedPosts: alias("topicController.selectedPosts"),
|
||||
|
||||
|
@ -36,11 +36,7 @@ export default Controller.extend(CanCheckEmails, PreferencesTabController, {
|
||||
revoking: null,
|
||||
|
||||
cannotDeleteAccount: not("currentUser.can_delete_account"),
|
||||
deleteDisabled: or(
|
||||
"model.isSaving",
|
||||
"deleting",
|
||||
"cannotDeleteAccount"
|
||||
),
|
||||
deleteDisabled: or("model.isSaving", "deleting", "cannotDeleteAccount"),
|
||||
|
||||
reset() {
|
||||
this.set("passwordProgress", null);
|
||||
|
@ -29,10 +29,7 @@ export default Controller.extend(ModalFunctionality, Ember.Evented, {
|
||||
return categories.map(c => bufProxy.create({ content: c }));
|
||||
},
|
||||
|
||||
categoriesOrdered: sort(
|
||||
"categoriesBuffered",
|
||||
"categoriesSorting"
|
||||
),
|
||||
categoriesOrdered: sort("categoriesBuffered", "categoriesSorting"),
|
||||
|
||||
@computed("categoriesBuffered.@each.hasBufferedChanges")
|
||||
showApplyAll() {
|
||||
|
@ -10,9 +10,7 @@ export default Controller.extend(ModalFunctionality, {
|
||||
errorMessage: null,
|
||||
successMessage: null,
|
||||
backupEnabled: alias("model.second_factor_backup_enabled"),
|
||||
remainingCodes: alias(
|
||||
"model.second_factor_remaining_backup_codes"
|
||||
),
|
||||
remainingCodes: alias("model.second_factor_remaining_backup_codes"),
|
||||
backupCodes: null,
|
||||
secondFactorMethod: SECOND_FACTOR_METHODS.TOTP,
|
||||
|
||||
|
@ -20,10 +20,7 @@ export default Controller.extend({
|
||||
pmTaggingEnabled: alias("site.can_tag_pms"),
|
||||
tagId: null,
|
||||
|
||||
showNewPM: and(
|
||||
"user.viewingSelf",
|
||||
"currentUser.can_send_private_messages"
|
||||
),
|
||||
showNewPM: and("user.viewingSelf", "currentUser.can_send_private_messages"),
|
||||
|
||||
@computed("selected.[]", "bulkSelectEnabled")
|
||||
hasSelection(selected, bulkSelectEnabled) {
|
||||
|
@ -39,10 +39,7 @@ export default Controller.extend(CanCheckEmails, {
|
||||
}
|
||||
return (!indexStream || viewingSelf) && !forceExpand;
|
||||
},
|
||||
canMuteOrIgnoreUser: or(
|
||||
"model.can_ignore_user",
|
||||
"model.can_mute_user"
|
||||
),
|
||||
canMuteOrIgnoreUser: or("model.can_ignore_user", "model.can_mute_user"),
|
||||
hasGivenFlags: gt("model.number_of_flags_given", 0),
|
||||
hasFlaggedPosts: gt("model.number_of_flagged_posts", 0),
|
||||
hasDeletedPosts: gt("model.number_of_deleted_posts", 0),
|
||||
@ -106,10 +103,7 @@ export default Controller.extend(CanCheckEmails, {
|
||||
return User.currentProp("can_invite_to_forum");
|
||||
},
|
||||
|
||||
canDeleteUser: and(
|
||||
"model.can_be_deleted",
|
||||
"model.can_delete_all_posts"
|
||||
),
|
||||
canDeleteUser: and("model.can_be_deleted", "model.can_delete_all_posts"),
|
||||
|
||||
@computed("model.user_fields.@each.value")
|
||||
publicUserFields() {
|
||||
|
@ -5,10 +5,7 @@ import Mixin from "@ember/object/mixin";
|
||||
export default Mixin.create({
|
||||
isCurrentUser: propertyEqual("model.id", "currentUser.id"),
|
||||
showEmailOnProfile: setting("moderators_view_emails"),
|
||||
canStaffCheckEmails: and(
|
||||
"showEmailOnProfile",
|
||||
"currentUser.staff"
|
||||
),
|
||||
canStaffCheckEmails: and("showEmailOnProfile", "currentUser.staff"),
|
||||
canAdminCheckEmails: alias("currentUser.admin"),
|
||||
canCheckEmails: or(
|
||||
"isCurrentUser",
|
||||
|
@ -44,12 +44,7 @@ export default RestModel.extend({
|
||||
});
|
||||
},
|
||||
|
||||
loading: or(
|
||||
"loadingAbove",
|
||||
"loadingBelow",
|
||||
"loadingFilter",
|
||||
"stagingPost"
|
||||
),
|
||||
loading: or("loadingAbove", "loadingBelow", "loadingFilter", "stagingPost"),
|
||||
notLoading: not("loading"),
|
||||
|
||||
@computed("isMegaTopic", "stream.length", "topic.highest_post_number")
|
||||
@ -67,16 +62,8 @@ export default RestModel.extend({
|
||||
return hasPosts && filteredPostsCount > 0;
|
||||
},
|
||||
|
||||
canAppendMore: and(
|
||||
"notLoading",
|
||||
"hasPosts",
|
||||
"lastPostNotLoaded"
|
||||
),
|
||||
canPrependMore: and(
|
||||
"notLoading",
|
||||
"hasPosts",
|
||||
"firstPostNotLoaded"
|
||||
),
|
||||
canAppendMore: and("notLoading", "hasPosts", "lastPostNotLoaded"),
|
||||
canPrependMore: and("notLoading", "hasPosts", "firstPostNotLoaded"),
|
||||
|
||||
@computed("hasLoadedData", "firstPostId", "posts.[]")
|
||||
firstPostPresent(hasLoadedData, firstPostId) {
|
||||
|
@ -497,10 +497,7 @@ const Topic = RestModel.extend({
|
||||
);
|
||||
},
|
||||
|
||||
isPinnedUncategorized: and(
|
||||
"pinned",
|
||||
"category.isUncategorizedCategory"
|
||||
),
|
||||
isPinnedUncategorized: and("pinned", "category.isUncategorizedCategory"),
|
||||
|
||||
clearPin() {
|
||||
// Clear the pin optimistically from the object
|
||||
|
@ -109,14 +109,8 @@ const UserAction = RestModel.extend({
|
||||
postType: equal("action_type", UserActionTypes.posts),
|
||||
topicType: equal("action_type", UserActionTypes.topics),
|
||||
bookmarkType: equal("action_type", UserActionTypes.bookmarks),
|
||||
messageSentType: equal(
|
||||
"action_type",
|
||||
UserActionTypes.messages_sent
|
||||
),
|
||||
messageReceivedType: equal(
|
||||
"action_type",
|
||||
UserActionTypes.messages_received
|
||||
),
|
||||
messageSentType: equal("action_type", UserActionTypes.messages_sent),
|
||||
messageReceivedType: equal("action_type", UserActionTypes.messages_received),
|
||||
mentionType: equal("action_type", UserActionTypes.mentions),
|
||||
isPM: or("messageSentType", "messageReceivedType"),
|
||||
postReplyType: or("postType", "replyType"),
|
||||
|
Loading…
x
Reference in New Issue
Block a user