UX: Clean up button styles for query pages

UX: Clean up button styles for query pages

  • Add a “play” glyph for the Run & SaveRun buttons
  • ensure that there’s only one primary button on the page i.e. Run
  • Remove btn-danger from discard button
  • remove redundant button class from create button
  • Improve redundant copy by removing the word “Query”
diff --git a/assets/javascripts/discourse/templates/admin/plugins-explorer.hbs b/assets/javascripts/discourse/templates/admin/plugins-explorer.hbs
index c397e1b..5c55a91 100644
--- a/assets/javascripts/discourse/templates/admin/plugins-explorer.hbs
+++ b/assets/javascripts/discourse/templates/admin/plugins-explorer.hbs
@@ -12,7 +12,7 @@
       {{#if showCreate}}
         <div class="query-create">
           {{text-field value=newQueryName placeholderKey="explorer.create_placeholder"}}
-          {{d-button action=(action "create") disabled=createDisabled label="explorer.create" icon="plus" class="btn-primary"}}
+          {{d-button action=(action "create") disabled=createDisabled label="explorer.create" icon="plus"}}
         </div>
       {{/if}}
 
@@ -76,10 +76,10 @@
 
             <div class="pull-left">
               {{#if everEditing}}
-                {{d-button action=(action "save") label="explorer.save" disabled=saveDisabled class="btn-primary"}}
+                {{d-button action=(action "save") label="explorer.save" disabled=saveDisable}}
               {{else}}
                 {{#unless editDisabled}}
-                  {{d-button action=(action "editName") label="explorer.edit" icon="pencil" class="btn-primary"}}
+                  {{d-button action=(action "editName") label="explorer.edit" icon="pencil"}}
                 {{/unless}}
               {{/if}}
               {{d-button action=(action "download") label="explorer.export" disabled=runDisabled icon="download"}}
@@ -89,7 +89,7 @@
                 {{d-button action=(action "recover") class="" icon="undo" label="explorer.recover"}}
               {{else}}
                 {{#if everEditing}}
-                  {{d-button action=(action "discard") class="btn-danger" icon="undo" label="explorer.undo" disabled=saveDisabled}}
+                  {{d-button action=(action "discard") icon="undo" label="explorer.undo" disabled=saveDisabled}}
                 {{/if}}
                 {{#unless editDisabled}}
                   {{d-button action=(action "destroy") class="btn-danger" icon="trash" label="explorer.delete"}}
@@ -116,10 +116,10 @@
             {{#if saveDisabled}}
               {{d-button label="explorer.run" disabled="true" class="btn-primary"}}
             {{else}}
-              {{d-button action=(action "saverun") label="explorer.saverun"}}
+              {{d-button action=(action "saverun") icon="play" label="explorer.saverun" class="btn-primary"}}
             {{/if}}
           {{else}}
-            {{d-button action=(action "run") label="explorer.run" disabled=runDisabled class="btn-primary" type="submit"}}
+            {{d-button action=(action "run") icon="play" 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>
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index 8970f51..c931185 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -42,8 +42,8 @@ en:
           null_: "Null"
       export: "Export"
       save: "Save Changes"
-      saverun: "Save Changes and Run Query"
-      run: "Run Query"
+      saverun: "Save Changes and Run"
+      run: "Run"
       undo: "Discard Changes"
       edit: "Edit"
       delete: "Delete"

GitHub sha: 6a69daf3

1 Like


1 Like