make code prettier 🎀

This commit is contained in:
Régis Hanol 2018-07-18 13:09:16 +02:00
parent 6d6e026e3c
commit f55ac892e4
8 changed files with 17 additions and 12 deletions

View File

@ -6,7 +6,7 @@ export default Ember.Component.extend({
showModal("admin-uploaded-image-list", {
admin: true,
title: `admin.site_settings.${setting.setting}.title`,
model: { value, setting },
model: { value, setting }
}).setProperties({
save: v => this.set("value", v)
});

View File

@ -1,8 +1,7 @@
import { on, observes } from "ember-addons/ember-computed-decorators";
import ModalFunctionality from 'discourse/mixins/modal-functionality';
import ModalFunctionality from "discourse/mixins/modal-functionality";
export default Ember.Controller.extend(ModalFunctionality, {
@on("init")
@observes("model.value")
_setup() {

View File

@ -10,7 +10,7 @@ const CUSTOM_TYPES = [
"category_list",
"value_list",
"category",
"uploaded_image_list",
"uploaded_image_list"
];
export default Ember.Mixin.create({

View File

@ -7,7 +7,9 @@ export default Em.Component.extend(UploadMixin, {
@computed("uploading")
uploadButtonText(uploading) {
return uploading ? I18n.t("uploading") : I18n.t("user.change_avatar.upload_picture");
return uploading
? I18n.t("uploading")
: I18n.t("user.change_avatar.upload_picture");
},
validateUploadedFilesOptions() {
@ -16,5 +18,5 @@ export default Em.Component.extend(UploadMixin, {
uploadDone(upload) {
this.sendAction("done", upload);
},
}
});

View File

@ -520,9 +520,11 @@ const User = RestModel.extend({
},
isAllowedToUploadAFile(type) {
return this.get("staff") ||
return (
this.get("staff") ||
this.get("trust_level") > 0 ||
Discourse.SiteSettings[`newuser_max_${type}s`] > 0;
Discourse.SiteSettings[`newuser_max_${type}s`] > 0
);
},
createInvite(email, group_names, custom_message) {

View File

@ -38,8 +38,9 @@ export default RestrictedUserRoute.extend({
controller.setProperties(props);
if (this.siteSettings.selectable_avatars_enabled) {
ajax("/site/selectable-avatars.json")
.then(avatars => controller.set("selectableAvatars", avatars));
ajax("/site/selectable-avatars.json").then(avatars =>
controller.set("selectableAvatars", avatars)
);
}
},

View File

@ -106,4 +106,3 @@
color: $danger;
}
}

View File

@ -191,7 +191,9 @@ QUnit.test("selectable avatars", assert => {
click(".pref-avatar .btn");
andThen(() => {
assert.ok(exists(".selectable-avatars", "opens the avatar selection modal"));
assert.ok(
exists(".selectable-avatars", "opens the avatar selection modal")
);
});
});