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

View File

@ -44,7 +44,7 @@ export default Ember.Controller.extend({
selectedItem: function() { selectedItem: function() {
const id = parseInt(this.get("selectedQueryId")); 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) !isNaN(id)
? this.set("showRecentQueries", false) ? this.set("showRecentQueries", false)
: this.set("showRecentQueries", true); : this.set("showRecentQueries", true);
@ -54,7 +54,7 @@ export default Ember.Controller.extend({
othersDirty: function() { othersDirty: function() {
const selected = this.get("selectedItem"); 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"), }.property("selectedItem", "selectedItem.dirty"),
setEverEditing: function() { setEverEditing: function() {

View File

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

View File

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

View File

@ -1,9 +1,9 @@
{{#if hideSchema}} {{#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}} {{/if}}
<div class="{{if hideSchema "hidden"}}"> <div class="{{if hideSchema "hidden"}}">
{{text-field value=filter placeholderKey="explorer.schema.filter"}} {{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}} {{conditional-loading-spinner condition=loading}}
<div class="schema-container"> <div class="schema-container">
<ul> <ul>

View File

@ -1,7 +1,7 @@
<div class="jsfu-shade-container"> <div class="jsfu-shade-container">
<div class="jsfu-file"> <div class="jsfu-file">
<input id="js-file-input" type="file" style="display:none;" accept={{accept}}> <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"}} {{conditional-loading-spinner condition=loading size="small"}}
</div> </div>
<div class="jsfu-separator">{{i18n "alternation"}}</div> <div class="jsfu-separator">{{i18n "alternation"}}</div>

View File

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