DEV: Fix template linting issues (#124)

* Update test
* Remove the empty line in table
This commit is contained in:
Jarek Radosz 2021-07-05 23:15:57 +02:00 committed by GitHub
parent da4ad30477
commit cf2735162a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 59 additions and 50 deletions

View File

@ -67,7 +67,7 @@
</span> </span>
{{#if runDisabled}} {{#if runDisabled}}
{{#unless editing}} {{#unless editing}}
<span class='setting-controls'> <span class="setting-controls">
{{d-button class="ok" action=(action "save") icon="check"}} {{d-button class="ok" action=(action "save") icon="check"}}
{{d-button class="cancel" action=(action "discard") icon="times"}} {{d-button class="cancel" action=(action "discard") icon="times"}}
</span> </span>
@ -75,6 +75,7 @@
{{/if}} {{/if}}
</div> </div>
</div> </div>
<div class="clear"></div> <div class="clear"></div>
{{! the SQL editor will show the first time you }} {{! the SQL editor will show the first time you }}
@ -93,9 +94,11 @@
</div> </div>
</div> </div>
</div> </div>
<div class="grippie"> <div class="grippie">
{{d-icon "discourse-expand"}} {{d-icon "discourse-expand"}}
</div> </div>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
{{else}} {{else}}
@ -119,6 +122,7 @@
{{d-button action=(action "showHelpModal") label="explorer.help.label" icon="question-circle"}} {{d-button action=(action "showHelpModal") label="explorer.help.label" icon="question-circle"}}
{{/if}} {{/if}}
</div> </div>
<div class="pull-right"> <div class="pull-right">
{{#if selectedItem.destroyed}} {{#if selectedItem.destroyed}}
{{d-button action=(action "recover") class="" icon="undo" label="explorer.recover"}} {{d-button action=(action "recover") class="" icon="undo" label="explorer.recover"}}
@ -131,6 +135,7 @@
{{/unless}} {{/unless}}
{{/if}} {{/if}}
</div> </div>
<div class="clear"></div> <div class="clear"></div>
{{/if}} {{/if}}
</div> </div>
@ -143,6 +148,7 @@
{{/each}} {{/each}}
</div> </div>
{{/if}} {{/if}}
{{#if runDisabled}} {{#if runDisabled}}
{{#if saveDisabled}} {{#if saveDisabled}}
{{d-button label="explorer.run" disabled="true" class="btn-primary"}} {{d-button label="explorer.run" disabled="true" class="btn-primary"}}
@ -152,12 +158,15 @@
{{else}} {{else}}
{{d-button action=(action "run") icon="play" 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}} {{/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>
<hr> <hr>
{{/unless}} {{/unless}}
{{conditional-loading-spinner condition=loading}} {{conditional-loading-spinner condition=loading}}
{{#unless selectedItem.fake}} {{#unless selectedItem.fake}}
{{#if results}} {{#if results}}
<div class="query-results"> <div class="query-results">
@ -177,27 +186,26 @@
<table class="recent-queries"> <table class="recent-queries">
<thead class="heading-container"> <thead class="heading-container">
<th class="col heading name"> <th class="col heading name">
<div class="heading-toggle" {{action "sortByProperty" "name"}}> <div role="button" class="heading-toggle" {{action "sortByProperty" "name"}}>
{{table-header-toggle field="name" labelKey="explorer.query_name" order=order asc=asc automatic=true}} {{table-header-toggle field="name" labelKey="explorer.query_name" order=order asc=asc automatic=true}}
</div> </div>
</th> </th>
<th class="col heading created-by"> <th class="col heading created-by">
<div class="heading-toggle" {{action "sortByProperty" "username"}}> <div role="button" class="heading-toggle" {{action "sortByProperty" "username"}}>
{{table-header-toggle field="username" labelKey="explorer.query_user" order=order asc=asc automatic=true}} {{table-header-toggle field="username" labelKey="explorer.query_user" order=order asc=asc automatic=true}}
</div> </div>
</th> </th>
<th class='col heading group-names'> <th class="col heading group-names">
<div class='group-names-header'> <div class="group-names-header">
{{i18n "explorer.query_groups"}} {{i18n "explorer.query_groups"}}
</div> </div>
</th> </th>
<th class="col heading created-at"> <th class="col heading created-at">
<div class="heading-toggle" {{action "sortByProperty" "last_run_at"}}> <div role="button" class="heading-toggle" {{action "sortByProperty" "last_run_at"}}>
{{table-header-toggle field="last_run_at" labelKey="explorer.query_time" order=order asc=asc automatic=true}} {{table-header-toggle field="last_run_at" labelKey="explorer.query_time" order=order asc=asc automatic=true}}
</div> </div>
</th> </th>
</thead> </thead>
<tr></tr>
<tbody> <tbody>
{{#each filteredContent as |query|}} {{#each filteredContent as |query|}}
<tr class="query-row"> <tr class="query-row">
@ -241,7 +249,6 @@
{{/if}} {{/if}}
<div class="explorer-pad-bottom"></div> <div class="explorer-pad-bottom"></div>
{{/if}} {{/if}}
{{/if}} {{/if}}
{{/explorer-container}} {{/explorer-container}}

View File

@ -1,7 +1,8 @@
<div onclick={{action "open"}}> <div role="button" onclick={{action "open"}}>
{{d-icon "link"}} {{d-icon "link"}}
{{group}} {{group}}
</div> </div>
{{#if visible}} {{#if visible}}
<div class="popup"> <div class="popup">
<label>{{i18n "explorer.link"}} {{group}}</label> <label>{{i18n "explorer.link"}} {{group}}</label>

View File

@ -1,8 +1,8 @@
import { import {
acceptance, acceptance,
count,
exists, exists,
query, query,
queryAll,
} from "discourse/tests/helpers/qunit-helpers"; } from "discourse/tests/helpers/qunit-helpers";
import { clearPopupMenuOptionsCallback } from "discourse/controllers/composer"; import { clearPopupMenuOptionsCallback } from "discourse/controllers/composer";
import I18n from "I18n"; import I18n from "I18n";
@ -162,8 +162,9 @@ acceptance("Data Explorer Plugin | List Queries", function (needs) {
"the import button was rendered" "the import button was rendered"
); );
assert.ok( assert.equal(
queryAll("div.container table.recent-queries tbody tr").length === 2, count("div.container table.recent-queries tbody tr"),
2,
"the list of queries was rendered" "the list of queries was rendered"
); );