Rename the stylesheet

This commit is contained in:
Kane York
2015-06-30 10:37:48 -07:00
parent ee1cc2d96d
commit 78dafcc631
4 changed files with 28 additions and 12 deletions
@@ -3,6 +3,7 @@ import Query from 'discourse/plugins/discourse-data-explorer/discourse/models/qu
export default Ember.ArrayController.extend({
selectedQueryId: null,
results: null,
dirty: false,
loading: false,
@@ -25,11 +26,13 @@ export default Ember.ArrayController.extend({
create() {
const self = this;
this.set('loading', true);
this.set('showCreate', false);
var newQuery = this.store.createRecord('query', {name: this.get('newQueryName')});
newQuery.save().then(function(result) {
self.pushObject(result.target);
self.set('selectedItem', result.target);
self.set('selectedQueryId', result.target.id);
self.set('selectedItem.dirty', false);
self.set('results', null);
}).finally(function() {
self.set('loading', false);
});
@@ -37,6 +40,11 @@ export default Ember.ArrayController.extend({
importQuery() {
showModal('import-query');
this.set('showCreate', false);
},
showCreate() {
this.set('showCreate', true);
},
editName() {
@@ -59,11 +67,11 @@ export default Ember.ArrayController.extend({
const self = this;
this.set('loading', true);
this.store.find('query', this.get('selectedItem.id')).then(function(result) {
debugger;
const query = self.get('selectedItem');
query.setProperties(result.getProperties(Query.updatePropertyNames));
query.markNotDirty();
self.set('editName', false);
self.set('results', null);
}).finally(function() {
self.set('loading', false);
});
@@ -1,10 +1,16 @@
<h3>Queries</h3>
{{text-field value=newQueryName placeholderKey="explorer.create_placeholder"}}
{{d-button action="create" label="explorer.create" icon="plus"}}
{{d-button action="importQuery" label="explorer.import.label" icon="upload" class="import-button"}}
{{combo-box valueAttribute="id" value=selectedQueryId nameProperty="name" content=content castInteger="true"}}
<div class="query-list">
{{combo-box valueAttribute="id" value=selectedQueryId nameProperty="name" content=content castInteger="true"}}
{{d-button action="showCreate" icon="plus" class="no-text"}}
{{d-button 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" label="explorer.create" icon="plus"}}
</div>
{{/if}}
<hr>
<div class="query-edit">
{{partial "admin/plugins-explorer-show" model=selectedItem}}
</div>