DEV: introduces prettier for es6 files

This commit is contained in:
Joffrey JAFFEUX
2018-06-15 17:03:24 +02:00
committed by GitHub
parent c7ee70941e
commit 03a7d532cf
1162 changed files with 60667 additions and 29659 deletions

View File

@ -1,22 +1,20 @@
import computed from 'ember-addons/ember-computed-decorators';
import { popupAjaxError } from 'discourse/lib/ajax-error';
import computed from "ember-addons/ember-computed-decorators";
import { popupAjaxError } from "discourse/lib/ajax-error";
export default Ember.Controller.extend({
saved: false,
embedding: null,
// show settings if we have at least one created host
@computed('embedding.embeddable_hosts.@each.isCreated')
@computed("embedding.embeddable_hosts.@each.isCreated")
showSecondary() {
const hosts = this.get('embedding.embeddable_hosts');
return hosts.length && hosts.findBy('isCreated');
const hosts = this.get("embedding.embeddable_hosts");
return hosts.length && hosts.findBy("isCreated");
},
@computed('embedding.base_url')
@computed("embedding.base_url")
embeddingCode(baseUrl) {
const html =
`<div id='discourse-comments'></div>
const html = `<div id='discourse-comments'></div>
<script type="text/javascript">
DiscourseEmbed = { discourseUrl: '${baseUrl}/',
@ -34,20 +32,23 @@ export default Ember.Controller.extend({
actions: {
saveChanges() {
const embedding = this.get('embedding');
const updates = embedding.getProperties(embedding.get('fields'));
const embedding = this.get("embedding");
const updates = embedding.getProperties(embedding.get("fields"));
this.set('saved', false);
this.get('embedding').update(updates).then(() => this.set('saved', true)).catch(popupAjaxError);
this.set("saved", false);
this.get("embedding")
.update(updates)
.then(() => this.set("saved", true))
.catch(popupAjaxError);
},
addHost() {
const host = this.store.createRecord('embeddable-host');
this.get('embedding.embeddable_hosts').pushObject(host);
const host = this.store.createRecord("embeddable-host");
this.get("embedding.embeddable_hosts").pushObject(host);
},
deleteHost(host) {
this.get('embedding.embeddable_hosts').removeObject(host);
this.get("embedding.embeddable_hosts").removeObject(host);
}
}
});