FIX: ember 3 support

This commit is contained in:
Joffrey JAFFEUX 2018-12-16 15:22:23 +01:00 committed by GitHub
parent 2edd11fd16
commit 2b6357f8b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 25 additions and 25 deletions

View File

@ -60,7 +60,7 @@ const QueryResultComponent = Ember.Component.extend({
}
}
return arr;
}.property("params.@each"),
}.property("params.[]"),
columnDispNames: function() {
if (!this.get("columns")) {
@ -76,7 +76,7 @@ const QueryResultComponent = Ember.Component.extend({
}
return colName;
});
}.property("content", "columns.@each"),
}.property("content", "columns.[]"),
fallbackTemplate: function() {
return getOwner(this).lookup("template:explorer/text.raw");
@ -103,7 +103,7 @@ const QueryResultComponent = Ember.Component.extend({
return { name: viewName, template };
});
}.property("content", "columns.@each"),
}.property("content", "columns.[]"),
transformedUserTable: function() {
return transformedRelTable(this.get("content.relations.user"));

View File

@ -44,7 +44,7 @@ export default Ember.Controller.extend({
selectedItem: function() {
const id = parseInt(this.get("selectedQueryId"));
const item = this.get("content").find(q => q.get("id") === id);
const item = this.get("model").find(q => q.get("id") === id);
!isNaN(id)
? this.set("showRecentQueries", false)
: this.set("showRecentQueries", true);
@ -54,7 +54,7 @@ export default Ember.Controller.extend({
othersDirty: function() {
const selected = this.get("selectedItem");
return !!this.get("content").find(q => q !== selected && q.get("dirty"));
return !!this.get("model").find(q => q !== selected && q.get("dirty"));
}.property("selectedItem", "selectedItem.dirty"),
setEverEditing: function() {

View File

@ -27,6 +27,7 @@ export default Discourse.Route.extend({
actions: {
refreshModel: function() {
this.refresh();
return false;
}
}
});

View File

@ -1,19 +1,18 @@
{{#explorer-container hideSchema=hideSchema everEditing=everEditing}}
{{#if disallow}}
<h1>{{i18n "explorer.admins_only"}}</h1>
{{else}}
{{#unless selectedQueryId}}
<div class="query-list">
{{text-field value=search placeholderKey="explorer.search_placeholder"}}
{{d-button action="showCreate" icon="plus" class="no-text btn-right"}}
{{d-button action="importQuery" label="explorer.import.label" icon="upload"}}
{{d-button action=(action "showCreate") icon="plus" class="no-text btn-right"}}
{{d-button action=(action "importQuery") label="explorer.import.label" icon="upload"}}
</div>
{{#if showCreate}}
<div class="query-create">
{{text-field value=newQueryName placeholderKey="explorer.create_placeholder"}}
{{d-button action="create" disabled=createDisabled label="explorer.create" icon="plus" class="btn-primary"}}
{{d-button action=(action "create") disabled=createDisabled label="explorer.create" icon="plus" class="btn-primary"}}
</div>
{{/if}}
@ -25,13 +24,13 @@
{{/if}}
{{/unless}}
{{#if content.length}}
{{#if model.length}}
{{#unless selectedItem.fake}}
<div class="query-edit {{if editName "editing"}}">
{{#if selectedItem}}
{{#if editing}}
<div class="name">
{{d-button action="goHome" icon="chevron-left" class="previous"}}
{{d-button action=(action "goHome") icon="chevron-left" class="previous"}}
<div class="name-text-field">
{{text-field value=selectedItem.name}}
</div>
@ -41,7 +40,7 @@
</div>
{{else}}
<div class="name">
{{d-button action="goHome" icon="chevron-left" class="previous"}}
{{d-button action=(action "goHome") icon="chevron-left" class="previous"}}
<h1>{{selectedItem.name}}
{{#unless editDisabled}}
<a {{action "editName" class="edit-query-name"}}>{{d-icon "pencil"}}</a>
@ -77,23 +76,23 @@
<div class="pull-left">
{{#if everEditing}}
{{d-button action="save" label="explorer.save" disabled=saveDisabled class="btn-primary"}}
{{d-button action=(action "save") label="explorer.save" disabled=saveDisabled class="btn-primary"}}
{{else}}
{{#unless editDisabled}}
{{d-button action="editName" label="explorer.edit" icon="pencil" class="btn-primary"}}
{{d-button action=(action "editName") label="explorer.edit" icon="pencil" class="btn-primary"}}
{{/unless}}
{{/if}}
{{d-button action="download" label="explorer.export" disabled=runDisabled icon="download"}}
{{d-button action=(action "download") label="explorer.export" disabled=runDisabled icon="download"}}
</div>
<div class="pull-right">
{{#if selectedItem.destroyed}}
{{d-button action="recover" class="" icon="undo" label="explorer.recover"}}
{{d-button action=(action "recover") class="" icon="undo" label="explorer.recover"}}
{{else}}
{{#if everEditing}}
{{d-button action="discard" class="btn-danger" icon="undo" label="explorer.undo" disabled=saveDisabled}}
{{d-button action=(action "discard") class="btn-danger" icon="undo" label="explorer.undo" disabled=saveDisabled}}
{{/if}}
{{#unless editDisabled}}
{{d-button action="destroy" class="btn-danger" icon="trash" label="explorer.delete"}}
{{d-button action=(action "destroy") class="btn-danger" icon="trash" label="explorer.delete"}}
{{/unless}}
{{/if}}
</div>
@ -117,10 +116,10 @@
{{#if saveDisabled}}
{{d-button label="explorer.run" disabled="true" class="btn-primary"}}
{{else}}
{{d-button action="saverun" label="explorer.saverun"}}
{{d-button action=(action "saverun") label="explorer.saverun"}}
{{/if}}
{{else}}
{{d-button action="run" label="explorer.run" disabled=runDisabled class="btn-primary" type="submit"}}
{{d-button action=(action "run") label="explorer.run" disabled=runDisabled class="btn-primary" type="submit"}}
{{/if}}
<label class="query-plan">{{input type="checkbox" checked=explain name="explain"}} {{i18n "explorer.explain_label"}}</label>
</form>

View File

@ -1,9 +1,9 @@
{{#if hideSchema}}
{{d-button action="expandSchema" icon="chevron-left" class="no-text unhide"}}
{{d-button action=(action "expandSchema") icon="chevron-left" class="no-text unhide"}}
{{/if}}
<div class="{{if hideSchema "hidden"}}">
{{text-field value=filter placeholderKey="explorer.schema.filter"}}
{{d-button action="collapseSchema" icon="chevron-right" class="no-text"}}
{{d-button action=(action "collapseSchema") icon="chevron-right" class="no-text"}}
{{conditional-loading-spinner condition=loading}}
<div class="schema-container">
<ul>

View File

@ -1,7 +1,7 @@
<div class="jsfu-shade-container">
<div class="jsfu-file">
<input id="js-file-input" type="file" style="display:none;" accept={{accept}}>
{{d-button class="fileSelect" action="selectFile" class="" icon="upload" label="upload_selector.select_file"}}
{{d-button class="fileSelect" action=(action "selectFile") class="" icon="upload" label="upload_selector.select_file"}}
{{conditional-loading-spinner condition=loading size="small"}}
</div>
<div class="jsfu-separator">{{i18n "alternation"}}</div>

View File

@ -1,6 +1,6 @@
<div class="result-info">
{{d-button action="downloadResultJson" icon="download" label="explorer.download_json"}}
{{d-button action="downloadResultCsv" icon="download" label="explorer.download_csv"}}
{{d-button action=(action "downloadResultJson") icon="download" label="explorer.download_json"}}
{{d-button action=(action "downloadResultCsv") icon="download" label="explorer.download_csv"}}
</div>
<div class="result-about">