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:
Sam Saffron
2019-10-31 10:18:29 +11:00
parent 02a886ce13
commit 13cca3eaa0
25 changed files with 38 additions and 151 deletions

View File

@ -59,10 +59,7 @@ export default Component.extend({
showTitle: true, showTitle: true,
showFilteringUI: false, showFilteringUI: false,
showDatesOptions: alias("model.dates_filtering"), showDatesOptions: alias("model.dates_filtering"),
showRefresh: or( showRefresh: or("showDatesOptions", "model.available_filters.length"),
"showDatesOptions",
"model.available_filters.length"
),
shouldDisplayTrend: and("showTrend", "model.prev_period"), shouldDisplayTrend: and("showTrend", "model.prev_period"),
init() { init() {
@ -84,11 +81,7 @@ export default Component.extend({
} }
}, },
showError: or( showError: or("showTimeoutError", "showExceptionError", "showNotFoundError"),
"showTimeoutError",
"showExceptionError",
"showNotFoundError"
),
showNotFoundError: equal("model.error", "not_found"), showNotFoundError: equal("model.error", "not_found"),
showTimeoutError: equal("model.error", "timeout"), showTimeoutError: equal("model.error", "timeout"),
showExceptionError: equal("model.error", "exception"), showExceptionError: equal("model.error", "exception"),

View File

@ -14,9 +14,7 @@ export default Controller.extend(bufferedProperty("model"), {
badgeTypes: alias("adminBadges.badgeTypes"), badgeTypes: alias("adminBadges.badgeTypes"),
badgeGroupings: alias("adminBadges.badgeGroupings"), badgeGroupings: alias("adminBadges.badgeGroupings"),
badgeTriggers: alias("adminBadges.badgeTriggers"), badgeTriggers: alias("adminBadges.badgeTriggers"),
protectedSystemFields: alias( protectedSystemFields: alias("adminBadges.protectedSystemFields"),
"adminBadges.protectedSystemFields"
),
readOnly: alias("buffered.system"), readOnly: alias("buffered.system"),
showDisplayName: propertyNotEqual("name", "displayName"), showDisplayName: propertyNotEqual("name", "displayName"),

View File

@ -149,10 +149,7 @@ export default Controller.extend({
"scss" "scss"
); );
}, },
sourceIsHttp: match( sourceIsHttp: match("model.remote_theme.remote_url", /^http(s)?:\/\//),
"model.remote_theme.remote_url",
/^http(s)?:\/\//
),
actions: { actions: {
updateToLatest() { updateToLatest() {
this.set("updatingRemote", true); this.set("updatingRemote", true);

View File

@ -17,9 +17,7 @@ export default Controller.extend(CanCheckEmails, {
userTitleValue: null, userTitleValue: null,
showBadges: setting("enable_badges"), showBadges: setting("enable_badges"),
hasLockedTrustLevel: notEmpty( hasLockedTrustLevel: notEmpty("model.manual_locked_trust_level"),
"model.manual_locked_trust_level"
),
primaryGroupDirty: propertyNotEqual( primaryGroupDirty: propertyNotEqual(
"originalPrimaryGroupId", "originalPrimaryGroupId",

View File

@ -12,14 +12,8 @@ const wrapAdmin = user => (user ? AdminUser.create(user) : null);
const AdminUser = Discourse.User.extend({ const AdminUser = Discourse.User.extend({
adminUserView: true, adminUserView: true,
customGroups: filter( customGroups: filter("groups", g => !g.automatic && Group.create(g)),
"groups", automaticGroups: filter("groups", g => g.automatic && Group.create(g)),
g => !g.automatic && Group.create(g)
),
automaticGroups: filter(
"groups",
g => g.automatic && Group.create(g)
),
canViewProfile: or("active", "staged"), canViewProfile: or("active", "staged"),

View File

@ -11,9 +11,7 @@ export default buildCategoryPanel("general", {
this.foregroundColors = ["FFFFFF", "000000"]; this.foregroundColors = ["FFFFFF", "000000"];
}, },
canSelectParentCategory: not( canSelectParentCategory: not("category.isUncategorizedCategory"),
"category.isUncategorizedCategory"
),
uncategorizedSiteSettingLink: Discourse.getURL( uncategorizedSiteSettingLink: Discourse.getURL(
"/admin/site_settings/category/all_results?filter=allow_uncategorized_topics" "/admin/site_settings/category/all_results?filter=allow_uncategorized_topics"
), ),

View File

@ -4,8 +4,5 @@ import { buildCategoryPanel } from "discourse/components/edit-category-panel";
export default buildCategoryPanel("tags", { export default buildCategoryPanel("tags", {
allowedTagsEmpty: empty("category.allowed_tags"), allowedTagsEmpty: empty("category.allowed_tags"),
allowedTagGroupsEmpty: empty("category.allowed_tag_groups"), allowedTagGroupsEmpty: empty("category.allowed_tag_groups"),
disableAllowGlobalTags: and( disableAllowGlobalTags: and("allowedTagsEmpty", "allowedTagGroupsEmpty")
"allowedTagsEmpty",
"allowedTagGroupsEmpty"
)
}); });

View File

@ -22,17 +22,9 @@ export default Component.extend({
autoClose: equal("selection", CLOSE_STATUS_TYPE), autoClose: equal("selection", CLOSE_STATUS_TYPE),
autoDelete: equal("selection", DELETE_STATUS_TYPE), autoDelete: equal("selection", DELETE_STATUS_TYPE),
autoBump: equal("selection", BUMP_TYPE), autoBump: equal("selection", BUMP_TYPE),
publishToCategory: equal( publishToCategory: equal("selection", PUBLISH_TO_CATEGORY_STATUS_TYPE),
"selection",
PUBLISH_TO_CATEGORY_STATUS_TYPE
),
reminder: equal("selection", REMINDER_TYPE), reminder: equal("selection", REMINDER_TYPE),
showTimeOnly: or( showTimeOnly: or("autoOpen", "autoDelete", "reminder", "autoBump"),
"autoOpen",
"autoDelete",
"reminder",
"autoBump"
),
@computed( @computed(
"topicTimer.updateTime", "topicTimer.updateTime",

View File

@ -13,10 +13,7 @@ export default Component.extend({
time: null, time: null,
includeDateTime: true, includeDateTime: true,
isCustom: equal("selection", "pick_date_and_time"), isCustom: equal("selection", "pick_date_and_time"),
isBasedOnLastPost: equal( isBasedOnLastPost: equal("selection", "set_based_on_last_post"),
"selection",
"set_based_on_last_post"
),
displayDateAndTimePicker: and("includeDateTime", "isCustom"), displayDateAndTimePicker: and("includeDateTime", "isCustom"),
displayLabel: null, displayLabel: null,

View File

@ -36,11 +36,7 @@ export default Component.extend({
canDefer: alias("currentUser.enable_defer"), canDefer: alias("currentUser.enable_defer"),
inviteDisabled: or( inviteDisabled: or("topic.archived", "topic.closed", "topic.deleted"),
"topic.archived",
"topic.closed",
"topic.deleted"
),
@computed @computed
showAdminButton() { showAdminButton() {
@ -51,10 +47,7 @@ export default Component.extend({
); );
}, },
showEditOnFooter: and( showEditOnFooter: and("topic.isPrivateMessage", "site.can_tag_pms"),
"topic.isPrivateMessage",
"site.can_tag_pms"
),
@computed("topic.message_archived") @computed("topic.message_archived")
archiveIcon: archived => (archived ? "envelope" : "folder"), archiveIcon: archived => (archived ? "envelope" : "folder"),

View File

@ -36,17 +36,10 @@ export default Component.extend(CardContentsBase, CanCheckEmails, CleansUp, {
showName: propertyNotEqual("user.name", "user.username"), showName: propertyNotEqual("user.name", "user.username"),
hasUserFilters: gt("postStream.userFilters.length", 0), hasUserFilters: gt("postStream.userFilters.length", 0),
showMoreBadges: gt("moreBadgesCount", 0), showMoreBadges: gt("moreBadgesCount", 0),
showDelete: and( showDelete: and("viewingAdmin", "showName", "user.canBeDeleted"),
"viewingAdmin",
"showName",
"user.canBeDeleted"
),
linkWebsite: not("user.isBasic"), linkWebsite: not("user.isBasic"),
hasLocationOrWebsite: or("user.location", "user.website_name"), hasLocationOrWebsite: or("user.location", "user.website_name"),
isSuspendedOrHasBio: or( isSuspendedOrHasBio: or("user.suspend_reason", "user.bio_cooked"),
"user.suspend_reason",
"user.bio_cooked"
),
showCheckEmail: and("user.staged", "canCheckEmails"), showCheckEmail: and("user.staged", "canCheckEmails"),
user: null, user: null,

View File

@ -12,12 +12,8 @@ export default Controller.extend(ModalFunctionality, {
saving: false, saving: false,
new_user: null, new_user: null,
selectedPostsCount: alias( selectedPostsCount: alias("topicController.selectedPostsCount"),
"topicController.selectedPostsCount" selectedPostsUsername: alias("topicController.selectedPostsUsername"),
),
selectedPostsUsername: alias(
"topicController.selectedPostsUsername"
),
@computed("saving", "new_user") @computed("saving", "new_user")
buttonDisabled(saving, newUser) { buttonDisabled(saving, newUser) {

View File

@ -17,9 +17,7 @@ const controllerOpts = {
canStar: alias("currentUser.id"), canStar: alias("currentUser.id"),
showTopicPostBadges: not("discoveryTopics.new"), showTopicPostBadges: not("discoveryTopics.new"),
redirectedReason: alias( redirectedReason: alias("currentUser.redirected_to_top.reason"),
"currentUser.redirected_to_top.reason"
),
order: "default", order: "default",
ascending: false, ascending: false,

View File

@ -33,12 +33,8 @@ export default Controller.extend(ModalFunctionality, {
} }
}, },
previousFeaturedLink: alias( previousFeaturedLink: alias("model.featured_link_changes.previous"),
"model.featured_link_changes.previous" currentFeaturedLink: alias("model.featured_link_changes.current"),
),
currentFeaturedLink: alias(
"model.featured_link_changes.current"
),
previousTagChanges: customTagArray("model.tags_changes.previous"), previousTagChanges: customTagArray("model.tags_changes.previous"),
currentTagChanges: customTagArray("model.tags_changes.current"), currentTagChanges: customTagArray("model.tags_changes.current"),
@ -174,10 +170,7 @@ export default Controller.extend(ModalFunctionality, {
return this.currentUser && this.currentUser.get("staff"); return this.currentUser && this.currentUser.get("staff");
}, },
isEitherRevisionHidden: or( isEitherRevisionHidden: or("model.previous_hidden", "model.current_hidden"),
"model.previous_hidden",
"model.current_hidden"
),
@computed("model.previous_hidden", "model.current_hidden", "displayingInline") @computed("model.previous_hidden", "model.current_hidden", "displayingInline")
hiddenClasses(prevHidden, currentHidden, displayingInline) { hiddenClasses(prevHidden, currentHidden, displayingInline) {
@ -197,10 +190,7 @@ export default Controller.extend(ModalFunctionality, {
displayingInline: equal("viewMode", "inline"), displayingInline: equal("viewMode", "inline"),
displayingSideBySide: equal("viewMode", "side_by_side"), displayingSideBySide: equal("viewMode", "side_by_side"),
displayingSideBySideMarkdown: equal( displayingSideBySideMarkdown: equal("viewMode", "side_by_side_markdown"),
"viewMode",
"side_by_side_markdown"
),
@computed("displayingInline") @computed("displayingInline")
inlineClass(displayingInline) { inlineClass(displayingInline) {

View File

@ -7,9 +7,7 @@ export default Controller.extend(ModalFunctionality, {
model: null, model: null,
postNumber: null, postNumber: null,
postDate: null, postDate: null,
filteredPostsCount: alias( filteredPostsCount: alias("topic.postStream.filteredPostsCount"),
"topic.postStream.filteredPostsCount"
),
onShow() { onShow() {
next(() => $("#post-jump").focus()); next(() => $("#post-jump").focus());

View File

@ -41,9 +41,7 @@ export default Controller.extend(ModalFunctionality, {
}, },
topicController: inject("topic"), topicController: inject("topic"),
selectedPostsCount: alias( selectedPostsCount: alias("topicController.selectedPostsCount"),
"topicController.selectedPostsCount"
),
selectedAllPosts: alias("topicController.selectedAllPosts"), selectedAllPosts: alias("topicController.selectedAllPosts"),
selectedPosts: alias("topicController.selectedPosts"), selectedPosts: alias("topicController.selectedPosts"),

View File

@ -36,11 +36,7 @@ export default Controller.extend(CanCheckEmails, PreferencesTabController, {
revoking: null, revoking: null,
cannotDeleteAccount: not("currentUser.can_delete_account"), cannotDeleteAccount: not("currentUser.can_delete_account"),
deleteDisabled: or( deleteDisabled: or("model.isSaving", "deleting", "cannotDeleteAccount"),
"model.isSaving",
"deleting",
"cannotDeleteAccount"
),
reset() { reset() {
this.set("passwordProgress", null); this.set("passwordProgress", null);

View File

@ -29,10 +29,7 @@ export default Controller.extend(ModalFunctionality, Ember.Evented, {
return categories.map(c => bufProxy.create({ content: c })); return categories.map(c => bufProxy.create({ content: c }));
}, },
categoriesOrdered: sort( categoriesOrdered: sort("categoriesBuffered", "categoriesSorting"),
"categoriesBuffered",
"categoriesSorting"
),
@computed("categoriesBuffered.@each.hasBufferedChanges") @computed("categoriesBuffered.@each.hasBufferedChanges")
showApplyAll() { showApplyAll() {

View File

@ -10,9 +10,7 @@ export default Controller.extend(ModalFunctionality, {
errorMessage: null, errorMessage: null,
successMessage: null, successMessage: null,
backupEnabled: alias("model.second_factor_backup_enabled"), backupEnabled: alias("model.second_factor_backup_enabled"),
remainingCodes: alias( remainingCodes: alias("model.second_factor_remaining_backup_codes"),
"model.second_factor_remaining_backup_codes"
),
backupCodes: null, backupCodes: null,
secondFactorMethod: SECOND_FACTOR_METHODS.TOTP, secondFactorMethod: SECOND_FACTOR_METHODS.TOTP,

View File

@ -20,10 +20,7 @@ export default Controller.extend({
pmTaggingEnabled: alias("site.can_tag_pms"), pmTaggingEnabled: alias("site.can_tag_pms"),
tagId: null, tagId: null,
showNewPM: and( showNewPM: and("user.viewingSelf", "currentUser.can_send_private_messages"),
"user.viewingSelf",
"currentUser.can_send_private_messages"
),
@computed("selected.[]", "bulkSelectEnabled") @computed("selected.[]", "bulkSelectEnabled")
hasSelection(selected, bulkSelectEnabled) { hasSelection(selected, bulkSelectEnabled) {

View File

@ -39,10 +39,7 @@ export default Controller.extend(CanCheckEmails, {
} }
return (!indexStream || viewingSelf) && !forceExpand; return (!indexStream || viewingSelf) && !forceExpand;
}, },
canMuteOrIgnoreUser: or( canMuteOrIgnoreUser: or("model.can_ignore_user", "model.can_mute_user"),
"model.can_ignore_user",
"model.can_mute_user"
),
hasGivenFlags: gt("model.number_of_flags_given", 0), hasGivenFlags: gt("model.number_of_flags_given", 0),
hasFlaggedPosts: gt("model.number_of_flagged_posts", 0), hasFlaggedPosts: gt("model.number_of_flagged_posts", 0),
hasDeletedPosts: gt("model.number_of_deleted_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"); return User.currentProp("can_invite_to_forum");
}, },
canDeleteUser: and( canDeleteUser: and("model.can_be_deleted", "model.can_delete_all_posts"),
"model.can_be_deleted",
"model.can_delete_all_posts"
),
@computed("model.user_fields.@each.value") @computed("model.user_fields.@each.value")
publicUserFields() { publicUserFields() {

View File

@ -5,10 +5,7 @@ import Mixin from "@ember/object/mixin";
export default Mixin.create({ export default Mixin.create({
isCurrentUser: propertyEqual("model.id", "currentUser.id"), isCurrentUser: propertyEqual("model.id", "currentUser.id"),
showEmailOnProfile: setting("moderators_view_emails"), showEmailOnProfile: setting("moderators_view_emails"),
canStaffCheckEmails: and( canStaffCheckEmails: and("showEmailOnProfile", "currentUser.staff"),
"showEmailOnProfile",
"currentUser.staff"
),
canAdminCheckEmails: alias("currentUser.admin"), canAdminCheckEmails: alias("currentUser.admin"),
canCheckEmails: or( canCheckEmails: or(
"isCurrentUser", "isCurrentUser",

View File

@ -44,12 +44,7 @@ export default RestModel.extend({
}); });
}, },
loading: or( loading: or("loadingAbove", "loadingBelow", "loadingFilter", "stagingPost"),
"loadingAbove",
"loadingBelow",
"loadingFilter",
"stagingPost"
),
notLoading: not("loading"), notLoading: not("loading"),
@computed("isMegaTopic", "stream.length", "topic.highest_post_number") @computed("isMegaTopic", "stream.length", "topic.highest_post_number")
@ -67,16 +62,8 @@ export default RestModel.extend({
return hasPosts && filteredPostsCount > 0; return hasPosts && filteredPostsCount > 0;
}, },
canAppendMore: and( canAppendMore: and("notLoading", "hasPosts", "lastPostNotLoaded"),
"notLoading", canPrependMore: and("notLoading", "hasPosts", "firstPostNotLoaded"),
"hasPosts",
"lastPostNotLoaded"
),
canPrependMore: and(
"notLoading",
"hasPosts",
"firstPostNotLoaded"
),
@computed("hasLoadedData", "firstPostId", "posts.[]") @computed("hasLoadedData", "firstPostId", "posts.[]")
firstPostPresent(hasLoadedData, firstPostId) { firstPostPresent(hasLoadedData, firstPostId) {

View File

@ -497,10 +497,7 @@ const Topic = RestModel.extend({
); );
}, },
isPinnedUncategorized: and( isPinnedUncategorized: and("pinned", "category.isUncategorizedCategory"),
"pinned",
"category.isUncategorizedCategory"
),
clearPin() { clearPin() {
// Clear the pin optimistically from the object // Clear the pin optimistically from the object

View File

@ -109,14 +109,8 @@ const UserAction = RestModel.extend({
postType: equal("action_type", UserActionTypes.posts), postType: equal("action_type", UserActionTypes.posts),
topicType: equal("action_type", UserActionTypes.topics), topicType: equal("action_type", UserActionTypes.topics),
bookmarkType: equal("action_type", UserActionTypes.bookmarks), bookmarkType: equal("action_type", UserActionTypes.bookmarks),
messageSentType: equal( messageSentType: equal("action_type", UserActionTypes.messages_sent),
"action_type", messageReceivedType: equal("action_type", UserActionTypes.messages_received),
UserActionTypes.messages_sent
),
messageReceivedType: equal(
"action_type",
UserActionTypes.messages_received
),
mentionType: equal("action_type", UserActionTypes.mentions), mentionType: equal("action_type", UserActionTypes.mentions),
isPM: or("messageSentType", "messageReceivedType"), isPM: or("messageSentType", "messageReceivedType"),
postReplyType: or("postType", "replyType"), postReplyType: or("postType", "replyType"),