DEV: Update linting config and run gjs-codemod (#376)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
< 3.5.0.beta5-dev: 71141cb6b274c778ad00c8f5eb17b3b6bc59dce9
|
||||
< 3.5.0.beta1-dev: 2ba204a1de2638a7959e588b88f3b6c7fcf7a70f
|
||||
< 3.4.0.beta2-dev: bdff229ca088ead9512ba333eea4fdbbb258b250
|
||||
< 3.4.0.beta1-dev: 2d0dc39767f0c68d333f113c550731a5546c3137
|
||||
|
||||
+23
-21
@@ -14,30 +14,31 @@ GEM
|
||||
securerandom (>= 0.3)
|
||||
tzinfo (~> 2.0, >= 2.0.5)
|
||||
uri (>= 0.13.1)
|
||||
ast (2.4.2)
|
||||
base64 (0.2.0)
|
||||
benchmark (0.4.0)
|
||||
bigdecimal (3.1.9)
|
||||
ast (2.4.3)
|
||||
base64 (0.3.0)
|
||||
benchmark (0.4.1)
|
||||
bigdecimal (3.2.0)
|
||||
concurrent-ruby (1.3.5)
|
||||
connection_pool (2.5.0)
|
||||
drb (2.2.1)
|
||||
connection_pool (2.5.3)
|
||||
drb (2.2.3)
|
||||
i18n (1.14.7)
|
||||
concurrent-ruby (~> 1.0)
|
||||
json (2.10.2)
|
||||
language_server-protocol (3.17.0.4)
|
||||
json (2.12.2)
|
||||
language_server-protocol (3.17.0.5)
|
||||
lint_roller (1.1.0)
|
||||
logger (1.6.6)
|
||||
logger (1.7.0)
|
||||
minitest (5.25.5)
|
||||
parallel (1.26.3)
|
||||
parser (3.3.7.1)
|
||||
parallel (1.27.0)
|
||||
parser (3.3.8.0)
|
||||
ast (~> 2.4.1)
|
||||
racc
|
||||
prettier_print (1.2.1)
|
||||
prism (1.4.0)
|
||||
racc (1.8.1)
|
||||
rack (3.1.12)
|
||||
rack (3.1.15)
|
||||
rainbow (3.1.1)
|
||||
regexp_parser (2.10.0)
|
||||
rubocop (1.74.0)
|
||||
rubocop (1.75.8)
|
||||
json (~> 2.3)
|
||||
language_server-protocol (~> 3.17.0.2)
|
||||
lint_roller (~> 1.1.0)
|
||||
@@ -45,11 +46,12 @@ GEM
|
||||
parser (>= 3.3.0.2)
|
||||
rainbow (>= 2.2.2, < 4.0)
|
||||
regexp_parser (>= 2.9.3, < 3.0)
|
||||
rubocop-ast (>= 1.38.0, < 2.0)
|
||||
rubocop-ast (>= 1.44.0, < 2.0)
|
||||
ruby-progressbar (~> 1.7)
|
||||
unicode-display_width (>= 2.4.0, < 4.0)
|
||||
rubocop-ast (1.38.1)
|
||||
parser (>= 3.3.1.0)
|
||||
rubocop-ast (1.44.1)
|
||||
parser (>= 3.3.7.2)
|
||||
prism (~> 1.4)
|
||||
rubocop-capybara (2.22.1)
|
||||
lint_roller (~> 1.1)
|
||||
rubocop (~> 1.72, >= 1.72.1)
|
||||
@@ -65,13 +67,13 @@ GEM
|
||||
rubocop-factory_bot (2.27.1)
|
||||
lint_roller (~> 1.1)
|
||||
rubocop (~> 1.72, >= 1.72.1)
|
||||
rubocop-rails (2.30.3)
|
||||
rubocop-rails (2.32.0)
|
||||
activesupport (>= 4.2.0)
|
||||
lint_roller (~> 1.1)
|
||||
rack (>= 1.1)
|
||||
rubocop (>= 1.72.1, < 2.0)
|
||||
rubocop-ast (>= 1.38.0, < 2.0)
|
||||
rubocop-rspec (3.5.0)
|
||||
rubocop (>= 1.75.0, < 2.0)
|
||||
rubocop-ast (>= 1.44.0, < 2.0)
|
||||
rubocop-rspec (3.6.0)
|
||||
lint_roller (~> 1.1)
|
||||
rubocop (~> 1.72, >= 1.72.1)
|
||||
rubocop-rspec_rails (2.31.0)
|
||||
@@ -97,4 +99,4 @@ DEPENDENCIES
|
||||
syntax_tree
|
||||
|
||||
BUNDLED WITH
|
||||
2.6.6
|
||||
2.6.9
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
const CodeView = <template>
|
||||
<pre><code class={{@codeClass}}>{{@value}}</code></pre>
|
||||
</template>;
|
||||
|
||||
export default CodeView;
|
||||
@@ -1 +0,0 @@
|
||||
<pre><code class={{@codeClass}}>{{@value}}</code></pre>
|
||||
+9
@@ -1,5 +1,7 @@
|
||||
import Component from "@glimmer/component";
|
||||
import { on } from "@ember/modifier";
|
||||
import { action } from "@ember/object";
|
||||
import didInsert from "@ember/render-modifiers/modifiers/did-insert";
|
||||
import { bind } from "discourse/lib/decorators";
|
||||
import loadScript from "discourse/lib/load-script";
|
||||
import themeColor from "../lib/themeColor";
|
||||
@@ -89,4 +91,11 @@ export default class DataExplorerBarChart extends Component {
|
||||
this.chart.data = this.data;
|
||||
this.chart.update();
|
||||
}
|
||||
|
||||
<template>
|
||||
<canvas
|
||||
{{didInsert this.initChart}}
|
||||
{{on "change" this.updateChartData}}
|
||||
></canvas>
|
||||
</template>
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
<canvas
|
||||
{{did-insert this.initChart}}
|
||||
{{on "change" this.updateChartData}}
|
||||
></canvas>
|
||||
+38
@@ -1,8 +1,12 @@
|
||||
import Component from "@glimmer/component";
|
||||
import { tracked } from "@glimmer/tracking";
|
||||
import { on } from "@ember/modifier";
|
||||
import { action } from "@ember/object";
|
||||
import { isBlank, isEmpty } from "@ember/utils";
|
||||
import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";
|
||||
import DButton from "discourse/components/d-button";
|
||||
import { debounce } from "discourse/lib/decorators";
|
||||
import OneTable from "./explorer-schema/one-table";
|
||||
|
||||
export default class ExplorerSchema extends Component {
|
||||
@tracked filter;
|
||||
@@ -135,4 +139,38 @@ export default class ExplorerSchema extends Component {
|
||||
this.hideSchema = false;
|
||||
this.args.updateHideSchema(false);
|
||||
}
|
||||
|
||||
<template>
|
||||
{{#if this.hideSchema}}
|
||||
<DButton
|
||||
@action={{this.expandSchema}}
|
||||
@icon="chevron-left"
|
||||
class="no-text unhide"
|
||||
/>
|
||||
{{else}}
|
||||
<div class="schema">
|
||||
<div class="schema-search inline-form full-width">
|
||||
<input
|
||||
type="text"
|
||||
{{on "input" (action "filterChanged" value="target.value")}}
|
||||
/>
|
||||
<DButton
|
||||
@action={{this.collapseSchema}}
|
||||
@icon="chevron-right"
|
||||
class="no-text"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="schema-container">
|
||||
<ConditionalLoadingSpinner @condition={{this.loading}}>
|
||||
<ul>
|
||||
{{#each this.filteredTables as |table|}}
|
||||
<OneTable @table={{table}} />
|
||||
{{/each}}
|
||||
</ul>
|
||||
</ConditionalLoadingSpinner>
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
</template>
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
{{#if this.hideSchema}}
|
||||
<DButton
|
||||
@action={{this.expandSchema}}
|
||||
@icon="chevron-left"
|
||||
class="no-text unhide"
|
||||
/>
|
||||
{{else}}
|
||||
<div class="schema">
|
||||
<div class="schema-search inline-form full-width">
|
||||
<input
|
||||
type="text"
|
||||
{{on "input" (action "filterChanged" value="target.value")}}
|
||||
/>
|
||||
<DButton
|
||||
@action={{this.collapseSchema}}
|
||||
@icon="chevron-right"
|
||||
class="no-text"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="schema-container">
|
||||
<ConditionalLoadingSpinner @condition={{this.loading}}>
|
||||
<ul>
|
||||
{{#each this.filteredTables as |table|}}
|
||||
<ExplorerSchema::OneTable @table={{table}} />
|
||||
{{/each}}
|
||||
</ul>
|
||||
</ConditionalLoadingSpinner>
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
+10
@@ -7,4 +7,14 @@ export default class EnumInfo extends Component {
|
||||
name,
|
||||
}));
|
||||
}
|
||||
|
||||
<template>
|
||||
<ol>
|
||||
{{#each this.enuminfo as |enum|}}
|
||||
<li value={{enum.value}}>
|
||||
{{enum.name}}
|
||||
</li>
|
||||
{{/each}}
|
||||
</ol>
|
||||
</template>
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
<ol>
|
||||
{{#each this.enuminfo as |enum|}}
|
||||
<li value={{enum.value}}>
|
||||
{{enum.name}}
|
||||
</li>
|
||||
{{/each}}
|
||||
</ol>
|
||||
@@ -0,0 +1,78 @@
|
||||
import Component from "@glimmer/component";
|
||||
import { tracked } from "@glimmer/tracking";
|
||||
import { on } from "@ember/modifier";
|
||||
import icon from "discourse/helpers/d-icon";
|
||||
import { bind } from "discourse/lib/decorators";
|
||||
import { i18n } from "discourse-i18n";
|
||||
import EnumInfo from "./enum-info";
|
||||
|
||||
export default class OneTable extends Component {
|
||||
@tracked open = this.args.table.open;
|
||||
|
||||
get styles() {
|
||||
return this.open ? "open" : "";
|
||||
}
|
||||
|
||||
@bind
|
||||
toggleOpen() {
|
||||
this.open = !this.open;
|
||||
}
|
||||
|
||||
<template>
|
||||
<li class="schema-table {{this.styles}}">
|
||||
{{! template-lint-enable no-invalid-interactive }}
|
||||
<div
|
||||
class="schema-table-name"
|
||||
role="button"
|
||||
{{on "click" this.toggleOpen}}
|
||||
>
|
||||
{{#if this.open}}
|
||||
{{icon "caret-down"}}
|
||||
{{else}}
|
||||
{{icon "caret-right"}}
|
||||
{{/if}}
|
||||
{{@table.name}}
|
||||
</div>
|
||||
|
||||
<div class="schema-table-cols">
|
||||
{{#if this.open}}
|
||||
<dl>
|
||||
{{#each @table.columns as |col|}}
|
||||
<div>
|
||||
<dt
|
||||
class={{if col.sensitive "sensitive"}}
|
||||
title={{if col.sensitive (i18n "explorer.schema.sensitive")}}
|
||||
>
|
||||
{{#if col.sensitive}}
|
||||
{{icon "triangle-exclamation"}}
|
||||
{{/if}}
|
||||
{{col.column_name}}
|
||||
</dt>
|
||||
<dd>
|
||||
{{col.data_type}}
|
||||
{{#if col.havetypeinfo}}
|
||||
<br />
|
||||
{{#if col.havepopup}}
|
||||
<div class="popup-info">
|
||||
{{icon "info"}}
|
||||
<div class="popup">
|
||||
{{col.column_desc}}
|
||||
{{#if col.enum}}
|
||||
<EnumInfo @col={{col}} />
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
<span class="schema-typenotes">
|
||||
{{col.notes}}
|
||||
</span>
|
||||
{{/if}}
|
||||
</dd>
|
||||
</div>
|
||||
{{/each}}
|
||||
</dl>
|
||||
{{/if}}
|
||||
</div>
|
||||
</li>
|
||||
</template>
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
<li class="schema-table {{this.styles}}">
|
||||
{{! template-lint-enable no-invalid-interactive }}
|
||||
<div class="schema-table-name" role="button" {{on "click" this.toggleOpen}}>
|
||||
{{#if this.open}}
|
||||
{{d-icon "caret-down"}}
|
||||
{{else}}
|
||||
{{d-icon "caret-right"}}
|
||||
{{/if}}
|
||||
{{@table.name}}
|
||||
</div>
|
||||
|
||||
<div class="schema-table-cols">
|
||||
{{#if this.open}}
|
||||
<dl>
|
||||
{{#each @table.columns as |col|}}
|
||||
<div>
|
||||
<dt
|
||||
class={{if col.sensitive "sensitive"}}
|
||||
title={{if col.sensitive (i18n "explorer.schema.sensitive")}}
|
||||
>
|
||||
{{#if col.sensitive}}
|
||||
{{d-icon "triangle-exclamation"}}
|
||||
{{/if}}
|
||||
{{col.column_name}}
|
||||
</dt>
|
||||
<dd>
|
||||
{{col.data_type}}
|
||||
{{#if col.havetypeinfo}}
|
||||
<br />
|
||||
{{#if col.havepopup}}
|
||||
<div class="popup-info">
|
||||
{{d-icon "info"}}
|
||||
<div class="popup">
|
||||
{{col.column_desc}}
|
||||
{{#if col.enum}}
|
||||
<ExplorerSchema::EnumInfo @col={{col}} />
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
<span class="schema-typenotes">
|
||||
{{col.notes}}
|
||||
</span>
|
||||
{{/if}}
|
||||
</dd>
|
||||
</div>
|
||||
{{/each}}
|
||||
</dl>
|
||||
{{/if}}
|
||||
</div>
|
||||
</li>
|
||||
@@ -1,16 +0,0 @@
|
||||
import Component from "@glimmer/component";
|
||||
import { tracked } from "@glimmer/tracking";
|
||||
import { bind } from "discourse/lib/decorators";
|
||||
|
||||
export default class OneTable extends Component {
|
||||
@tracked open = this.args.table.open;
|
||||
|
||||
get styles() {
|
||||
return this.open ? "open" : "";
|
||||
}
|
||||
|
||||
@bind
|
||||
toggleOpen() {
|
||||
this.open = !this.open;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import { i18n } from "discourse-i18n";
|
||||
|
||||
const BooleanThree = <template>
|
||||
<@field.Select name={{@info.identifier}} as |select|>
|
||||
<select.Option @value="Y">
|
||||
{{i18n "explorer.types.bool.true"}}
|
||||
</select.Option>
|
||||
<select.Option @value="N">
|
||||
{{i18n "explorer.types.bool.false"}}
|
||||
</select.Option>
|
||||
<select.Option @value="#null">
|
||||
{{i18n "explorer.types.bool.null_"}}
|
||||
</select.Option>
|
||||
</@field.Select>
|
||||
</template>;
|
||||
|
||||
export default BooleanThree;
|
||||
@@ -1,11 +0,0 @@
|
||||
<@field.Select name={{@info.identifier}} as |select|>
|
||||
<select.Option @value="Y">
|
||||
{{i18n "explorer.types.bool.true"}}
|
||||
</select.Option>
|
||||
<select.Option @value="N">
|
||||
{{i18n "explorer.types.bool.false"}}
|
||||
</select.Option>
|
||||
<select.Option @value="#null">
|
||||
{{i18n "explorer.types.bool.null_"}}
|
||||
</select.Option>
|
||||
</@field.Select>
|
||||
@@ -0,0 +1,15 @@
|
||||
import { hash } from "@ember/helper";
|
||||
import EmailGroupUserChooser from "select-kit/components/email-group-user-chooser";
|
||||
|
||||
const UserIdInput = <template>
|
||||
<@field.Custom id={{@field.id}}>
|
||||
<EmailGroupUserChooser
|
||||
@value={{@field.value}}
|
||||
@options={{hash maximum=1}}
|
||||
@onChange={{@field.set}}
|
||||
name={{@info.identifier}}
|
||||
/>
|
||||
</@field.Custom>
|
||||
</template>;
|
||||
|
||||
export default UserIdInput;
|
||||
@@ -1,8 +0,0 @@
|
||||
<@field.Custom id={{@field.id}}>
|
||||
<EmailGroupUserChooser
|
||||
@value={{@field.value}}
|
||||
@options={{hash maximum=1}}
|
||||
@onChange={{@field.set}}
|
||||
name={{@info.identifier}}
|
||||
/>
|
||||
</@field.Custom>
|
||||
@@ -0,0 +1,13 @@
|
||||
import EmailGroupUserChooser from "select-kit/components/email-group-user-chooser";
|
||||
|
||||
const UserListInput = <template>
|
||||
<@field.Custom id={{@field.id}}>
|
||||
<EmailGroupUserChooser
|
||||
@value={{@field.value}}
|
||||
@onChange={{@field.set}}
|
||||
name={{@info.identifier}}
|
||||
/>
|
||||
</@field.Custom>
|
||||
</template>;
|
||||
|
||||
export default UserListInput;
|
||||
@@ -1,7 +0,0 @@
|
||||
<@field.Custom id={{@field.id}}>
|
||||
<EmailGroupUserChooser
|
||||
@value={{@field.value}}
|
||||
@onChange={{@field.set}}
|
||||
name={{@info.identifier}}
|
||||
/>
|
||||
</@field.Custom>
|
||||
+96
@@ -4,11 +4,14 @@ import { action } from "@ember/object";
|
||||
import { schedule } from "@ember/runloop";
|
||||
import { service } from "@ember/service";
|
||||
import { capitalize } from "@ember/string";
|
||||
import DButton from "discourse/components/d-button";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
import getURL from "discourse/lib/get-url";
|
||||
import Badge from "discourse/models/badge";
|
||||
import Category from "discourse/models/category";
|
||||
import I18n, { i18n } from "discourse-i18n";
|
||||
import DataExplorerBarChart from "./data-explorer-bar-chart";
|
||||
import QueryRowContent from "./query-row-content";
|
||||
import BadgeViewComponent from "./result-types/badge";
|
||||
import CategoryViewComponent from "./result-types/category";
|
||||
import GroupViewComponent from "./result-types/group";
|
||||
@@ -288,6 +291,99 @@ export default class QueryResult extends Component {
|
||||
schedule("afterRender", () => document.body.removeChild(form));
|
||||
});
|
||||
}
|
||||
|
||||
<template>
|
||||
<article>
|
||||
<header class="result-header">
|
||||
<div class="result-info">
|
||||
<DButton
|
||||
@action={{this.downloadResultJson}}
|
||||
@icon="download"
|
||||
@label="explorer.download_json"
|
||||
/>
|
||||
|
||||
<DButton
|
||||
@action={{this.downloadResultCsv}}
|
||||
@icon="download"
|
||||
@label="explorer.download_csv"
|
||||
/>
|
||||
|
||||
{{#if this.canShowChart}}
|
||||
{{#if this.chartDisplayed}}
|
||||
<DButton
|
||||
@action={{this.hideChart}}
|
||||
@icon="table"
|
||||
@label="explorer.show_table"
|
||||
/>
|
||||
{{else}}
|
||||
<DButton
|
||||
@action={{this.showChart}}
|
||||
@icon="chart-bar"
|
||||
@label="explorer.show_graph"
|
||||
/>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
<div class="result-about">
|
||||
{{this.resultCount}}
|
||||
{{this.duration}}
|
||||
</div>
|
||||
|
||||
<br />
|
||||
|
||||
{{~#if this.explainText}}
|
||||
<pre class="result-explain">
|
||||
<code>
|
||||
{{~this.explainText}}
|
||||
</code>
|
||||
</pre>
|
||||
{{~/if}}
|
||||
|
||||
<br />
|
||||
</header>
|
||||
|
||||
<section>
|
||||
{{#if this.chartDisplayed}}
|
||||
<DataExplorerBarChart
|
||||
@labels={{this.chartLabels}}
|
||||
@values={{this.chartValues}}
|
||||
@datasetName={{this.chartDatasetName}}
|
||||
/>
|
||||
{{else}}
|
||||
<table>
|
||||
<thead>
|
||||
<tr class="headers">
|
||||
{{#each this.columnNames as |col|}}
|
||||
<th>{{col}}</th>
|
||||
{{/each}}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#each this.rows as |row|}}
|
||||
<QueryRowContent
|
||||
@row={{row}}
|
||||
@columnComponents={{this.columnComponents}}
|
||||
@lookupUser={{this.lookupUser}}
|
||||
@lookupBadge={{this.lookupBadge}}
|
||||
@lookupPost={{this.lookupPost}}
|
||||
@lookupTopic={{this.lookupTopic}}
|
||||
@lookupGroup={{this.lookupGroup}}
|
||||
@lookupCategory={{this.lookupCategory}}
|
||||
@transformedPostTable={{this.transformedPostTable}}
|
||||
@transformedBadgeTable={{this.transformedBadgeTable}}
|
||||
@transformedUserTable={{this.transformedUserTable}}
|
||||
@transformedGroupTable={{this.transformedGroupTable}}
|
||||
@transformedTopicTable={{this.transformedTopicTable}}
|
||||
@site={{this.site}}
|
||||
/>
|
||||
{{/each}}
|
||||
</tbody>
|
||||
</table>
|
||||
{{/if}}
|
||||
</section>
|
||||
</article>
|
||||
</template>
|
||||
}
|
||||
|
||||
function randomIdShort() {
|
||||
@@ -1,90 +0,0 @@
|
||||
<article>
|
||||
<header class="result-header">
|
||||
<div class="result-info">
|
||||
<DButton
|
||||
@action={{this.downloadResultJson}}
|
||||
@icon="download"
|
||||
@label="explorer.download_json"
|
||||
/>
|
||||
|
||||
<DButton
|
||||
@action={{this.downloadResultCsv}}
|
||||
@icon="download"
|
||||
@label="explorer.download_csv"
|
||||
/>
|
||||
|
||||
{{#if this.canShowChart}}
|
||||
{{#if this.chartDisplayed}}
|
||||
<DButton
|
||||
@action={{this.hideChart}}
|
||||
@icon="table"
|
||||
@label="explorer.show_table"
|
||||
/>
|
||||
{{else}}
|
||||
<DButton
|
||||
@action={{this.showChart}}
|
||||
@icon="chart-bar"
|
||||
@label="explorer.show_graph"
|
||||
/>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
<div class="result-about">
|
||||
{{this.resultCount}}
|
||||
{{this.duration}}
|
||||
</div>
|
||||
|
||||
<br />
|
||||
|
||||
{{~#if this.explainText}}
|
||||
<pre class="result-explain">
|
||||
<code>
|
||||
{{~this.explainText}}
|
||||
</code>
|
||||
</pre>
|
||||
{{~/if}}
|
||||
|
||||
<br />
|
||||
</header>
|
||||
|
||||
<section>
|
||||
{{#if this.chartDisplayed}}
|
||||
<DataExplorerBarChart
|
||||
@labels={{this.chartLabels}}
|
||||
@values={{this.chartValues}}
|
||||
@datasetName={{this.chartDatasetName}}
|
||||
/>
|
||||
{{else}}
|
||||
<table>
|
||||
<thead>
|
||||
<tr class="headers">
|
||||
{{#each this.columnNames as |col|}}
|
||||
<th>{{col}}</th>
|
||||
{{/each}}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#each this.rows as |row|}}
|
||||
<QueryRowContent
|
||||
@row={{row}}
|
||||
@columnComponents={{this.columnComponents}}
|
||||
@lookupUser={{this.lookupUser}}
|
||||
@lookupBadge={{this.lookupBadge}}
|
||||
@lookupPost={{this.lookupPost}}
|
||||
@lookupTopic={{this.lookupTopic}}
|
||||
@lookupGroup={{this.lookupGroup}}
|
||||
@lookupCategory={{this.lookupCategory}}
|
||||
@transformedPostTable={{this.transformedPostTable}}
|
||||
@transformedBadgeTable={{this.transformedBadgeTable}}
|
||||
@transformedUserTable={{this.transformedUserTable}}
|
||||
@transformedGroupTable={{this.transformedGroupTable}}
|
||||
@transformedTopicTable={{this.transformedTopicTable}}
|
||||
@site={{this.site}}
|
||||
/>
|
||||
{{/each}}
|
||||
</tbody>
|
||||
</table>
|
||||
{{/if}}
|
||||
</section>
|
||||
</article>
|
||||
@@ -0,0 +1,17 @@
|
||||
import QueryResult from "./query-result";
|
||||
|
||||
const QueryResultsWrapper = <template>
|
||||
{{#if @results}}
|
||||
<div class="query-results">
|
||||
{{#if @showResults}}
|
||||
<QueryResult @query={{@query}} @content={{@results}} />
|
||||
{{else}}
|
||||
{{#each @results.errors as |err|}}
|
||||
<pre class="query-error"><code>{{~err}}</code></pre>
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</template>;
|
||||
|
||||
export default QueryResultsWrapper;
|
||||
@@ -1,11 +0,0 @@
|
||||
{{#if @results}}
|
||||
<div class="query-results">
|
||||
{{#if @showResults}}
|
||||
<QueryResult @query={{@query}} @content={{@results}} />
|
||||
{{else}}
|
||||
{{#each @results.errors as |err|}}
|
||||
<pre class="query-error"><code>{{~err}}</code></pre>
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/if}}
|
||||
+14
@@ -52,6 +52,20 @@ export default class QueryRowContent extends Component {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
<template>
|
||||
<tr>
|
||||
{{#each this.results as |result|}}
|
||||
<td>
|
||||
<result.component
|
||||
@ctx={{result.ctx}}
|
||||
@params={{result.params}}
|
||||
@textValue={{result.textValue}}
|
||||
/>
|
||||
</td>
|
||||
{{/each}}
|
||||
</tr>
|
||||
</template>
|
||||
}
|
||||
|
||||
function guessUrl(columnValue) {
|
||||
@@ -1,11 +0,0 @@
|
||||
<tr>
|
||||
{{#each this.results as |result|}}
|
||||
<td>
|
||||
<result.component
|
||||
@ctx={{result.ctx}}
|
||||
@params={{result.params}}
|
||||
@textValue={{result.textValue}}
|
||||
/>
|
||||
</td>
|
||||
{{/each}}
|
||||
</tr>
|
||||
+12
@@ -16,4 +16,16 @@ export default class Badge extends Component {
|
||||
return htmlSafe("<img src='" + this.args.ctx.badge.icon + "'>");
|
||||
}
|
||||
}
|
||||
|
||||
<template>
|
||||
<a
|
||||
href="{{@ctx.baseuri}}/badges/{{@ctx.badge.id}}/{{@ctx.badge.name}}"
|
||||
class="user-badge {{@ctx.badge.badgeTypeClassName}}"
|
||||
title={{@ctx.badge.display_name}}
|
||||
data-badge-name={{@ctx.badge.name}}
|
||||
>
|
||||
{{this.iconOrImageReplacement}}
|
||||
<span class="badge-display-name">{{@ctx.badge.display_name}}</span>
|
||||
</a>
|
||||
</template>
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
<a
|
||||
href="{{@ctx.baseuri}}/badges/{{@ctx.badge.id}}/{{@ctx.badge.name}}"
|
||||
class="user-badge {{@ctx.badge.badgeTypeClassName}}"
|
||||
title={{@ctx.badge.display_name}}
|
||||
data-badge-name={{@ctx.badge.name}}
|
||||
>
|
||||
{{this.iconOrImageReplacement}}
|
||||
<span class="badge-display-name">{{@ctx.badge.display_name}}</span>
|
||||
</a>
|
||||
+8
@@ -7,4 +7,12 @@ export default class Category extends Component {
|
||||
allowUncategorized: true,
|
||||
});
|
||||
}
|
||||
|
||||
<template>
|
||||
{{#if @ctx.category}}
|
||||
{{this.categoryBadgeReplacement}}
|
||||
{{else}}
|
||||
<a href="{{@ctx.baseuri}}/t/{{@ctx.id}}">{{@ctx.id}}</a>
|
||||
{{/if}}
|
||||
</template>
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{{#if @ctx.category}}
|
||||
{{this.categoryBadgeReplacement}}
|
||||
{{else}}
|
||||
<a href="{{@ctx.baseuri}}/t/{{@ctx.id}}">{{@ctx.id}}</a>
|
||||
{{/if}}
|
||||
@@ -0,0 +1,11 @@
|
||||
const Group = <template>
|
||||
{{#if @ctx.group}}
|
||||
<a
|
||||
href="{{@ctx.baseuri}}/groups/{{@ctx.group.name}}"
|
||||
>{{@ctx.group.name}}</a>
|
||||
{{else}}
|
||||
{{@ctx.id}}
|
||||
{{/if}}
|
||||
</template>;
|
||||
|
||||
export default Group;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user