FEATURE: Hide unnecessary create/import bar when visiting a query

This commit is contained in:
Rishabh Nambiar 2018-08-17 15:59:48 +05:30
parent 915657b8cd
commit 2b4c056fe5
2 changed files with 11 additions and 3 deletions

View File

@ -19,6 +19,7 @@ export default Ember.Controller.extend({
results: Em.computed.alias('selectedItem.results'),
editing: false,
showNavbar: true,
everEditing: false,
showRecentQueries: true,
sortBy: ['id:desc'],
@ -90,13 +91,16 @@ export default Ember.Controller.extend({
window.open(this.get('selectedItem.downloadUrl'), "_blank");
},
scrollTop() {
visitQuery() {
window.scrollTo(0,0);
this.set('editing', false);
this.set('showCreate', false);
this.set('showNavbar', false);
this.set('everEditing', false);
},
goHome() {
this.set('showNavbar', true);
this.set('selectedQueryId', null);
this.transitionToRoute('adminPlugins.explorer');
},

View File

@ -3,11 +3,13 @@
{{#if disallow}}
<h2>{{i18n "explorer.admins_only"}}</h2>
{{else}}
{{#if showNavbar}}
<div class="query-list">
{{combo-box valueAttribute="id" value=selectedQueryId nameProperty="listName" none="explorer.menu_none" content=content castInteger="true" nameChanges="true"}}
{{d-button action="showCreate" icon="plus" class="no-text"}}
{{d-button action="importQuery" label="explorer.import.label" icon="upload"}}
</div>
{{/if}}
{{#if showCreate}}
<div class="query-create">
@ -23,7 +25,9 @@
</div>
{{/if}}
{{#if showNavbar}}
<hr>
{{/if}}
{{#if content.length}}
{{#if selectedItem.fake}}
@ -151,7 +155,7 @@
{{#each sortedQueries as |query|}}
<tr>
<td>
<a {{action "scrollTop"}} href="/admin/plugins/explorer/?id={{query.id}}">
<a {{action "visitQuery"}} href="/admin/plugins/explorer/?id={{query.id}}">
<b class="query-name">{{query.name}}</b>
<br>
<medium class="query-desc">{{query.description}}</medium>