DEV: Bump dependencies and fix linting (#355)

This commit is contained in:
David Taylor 2025-02-06 16:45:00 +00:00 committed by GitHub
parent d4be33dcc4
commit bd6263e9b8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
17 changed files with 789 additions and 639 deletions

View File

@ -1,7 +1,7 @@
import Component from "@glimmer/component";
import { action } from "@ember/object";
import { bind } from "discourse/lib/decorators";
import loadScript from "discourse/lib/load-script";
import { bind } from "discourse-common/utils/decorators";
import themeColor from "../lib/themeColor";
export default class DataExplorerBarChart extends Component {

View File

@ -2,7 +2,7 @@ import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking";
import { action } from "@ember/object";
import { isBlank, isEmpty } from "@ember/utils";
import { debounce } from "discourse-common/utils/decorators";
import { debounce } from "discourse/lib/decorators";
export default class ExplorerSchema extends Component {
@tracked filter;

View File

@ -1,6 +1,6 @@
import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking";
import { bind } from "discourse-common/utils/decorators";
import { bind } from "discourse/lib/decorators";
export default class OneTable extends Component {
@tracked open = this.args.table.open;

View File

@ -1,6 +1,6 @@
import { htmlSafe } from "@ember/template";
import DModal from "discourse/components/d-modal";
import i18n from "discourse-common/helpers/i18n";
import { i18n } from "discourse-i18n";
const QueryHelp = <template>
<DModal

View File

@ -6,7 +6,7 @@ import { isEmpty } from "@ember/utils";
import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";
import Form from "discourse/components/form";
import Category from "discourse/models/category";
import I18n from "I18n";
import { i18n } from "discourse-i18n";
import BooleanThree from "./param-input/boolean-three";
import CategoryIdInput from "./param-input/category-id-input";
import GroupInput from "./param-input/group-input";
@ -37,16 +37,16 @@ const layoutMap = {
};
export const ERRORS = {
REQUIRED: I18n.t("form_kit.errors.required"),
NOT_AN_INTEGER: I18n.t("form_kit.errors.not_an_integer"),
NOT_A_NUMBER: I18n.t("form_kit.errors.not_a_number"),
OVERFLOW_HIGH: I18n.t("form_kit.errors.too_high", { count: 2147484647 }),
OVERFLOW_LOW: I18n.t("form_kit.errors.too_low", { count: -2147484648 }),
INVALID: I18n.t("explorer.form.errors.invalid"),
NO_SUCH_CATEGORY: I18n.t("explorer.form.errors.no_such_category"),
NO_SUCH_GROUP: I18n.t("explorer.form.errors.no_such_group"),
INVALID_DATE: (date) => I18n.t("explorer.form.errors.invalid_date", { date }),
INVALID_TIME: (time) => I18n.t("explorer.form.errors.invalid_time", { time }),
REQUIRED: i18n("form_kit.errors.required"),
NOT_AN_INTEGER: i18n("form_kit.errors.not_an_integer"),
NOT_A_NUMBER: i18n("form_kit.errors.not_a_number"),
OVERFLOW_HIGH: i18n("form_kit.errors.too_high", { count: 2147484647 }),
OVERFLOW_LOW: i18n("form_kit.errors.too_low", { count: -2147484648 }),
INVALID: i18n("explorer.form.errors.invalid"),
NO_SUCH_CATEGORY: i18n("explorer.form.errors.no_such_category"),
NO_SUCH_GROUP: i18n("explorer.form.errors.no_such_group"),
INVALID_DATE: (date) => i18n("explorer.form.errors.invalid_date", { date }),
INVALID_TIME: (time) => i18n("explorer.form.errors.invalid_time", { time }),
};
function digitalizeCategoryId(value) {

View File

@ -5,10 +5,10 @@ import { schedule } from "@ember/runloop";
import { service } from "@ember/service";
import { capitalize } from "@ember/string";
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 getURL from "discourse-common/lib/get-url";
import I18n from "I18n";
import I18n, { i18n } from "discourse-i18n";
import BadgeViewComponent from "./result-types/badge";
import CategoryViewComponent from "./result-types/category";
import GroupViewComponent from "./result-types/group";
@ -104,14 +104,14 @@ export default class QueryResult extends Component {
get resultCount() {
const count = this.args.content.result_count;
if (count === this.args.content.default_limit) {
return I18n.t("explorer.max_result_count", { count });
return i18n("explorer.max_result_count", { count });
} else {
return I18n.t("explorer.result_count", { count });
return i18n("explorer.result_count", { count });
}
}
get duration() {
return I18n.t("explorer.run_time", {
return i18n("explorer.run_time", {
value: I18n.toNumber(this.args.content.duration, { precision: 1 }),
});
}

View File

@ -1,8 +1,8 @@
import Component from "@glimmer/component";
import { cached } from "@glimmer/tracking";
import { capitalize } from "@ember/string";
import getURL from "discourse/lib/get-url";
import { escapeExpression } from "discourse/lib/utilities";
import getURL from "discourse-common/lib/get-url";
import TextViewComponent from "./result-types/text";
export default class QueryRowContent extends Component {

View File

@ -1,7 +1,7 @@
import Component from "@glimmer/component";
import { htmlSafe } from "@ember/template";
import { isEmpty } from "@ember/utils";
import { convertIconClass, iconHTML } from "discourse-common/lib/icon-library";
import { convertIconClass, iconHTML } from "discourse/lib/icon-library";
export default class Badge extends Component {
get iconOrImageReplacement() {

View File

@ -1,8 +1,8 @@
import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking";
import { action } from "@ember/object";
import getURL from "discourse-common/lib/get-url";
import { bind } from "discourse-common/utils/decorators";
import { bind } from "discourse/lib/decorators";
import getURL from "discourse/lib/get-url";
export default class ShareReport extends Component {
@tracked visible = false;

View File

@ -5,8 +5,8 @@ import { service } from "@ember/service";
import { Promise } from "rsvp";
import { ajax } from "discourse/lib/ajax";
import { popupAjaxError } from "discourse/lib/ajax-error";
import { bind } from "discourse-common/utils/decorators";
import I18n from "I18n";
import { bind } from "discourse/lib/decorators";
import { i18n } from "discourse-i18n";
import QueryHelp from "discourse/plugins/discourse-data-explorer/discourse/components/modal/query-help";
import { ParamValidationError } from "discourse/plugins/discourse-data-explorer/discourse/components/param-input-form";
import Query from "discourse/plugins/discourse-data-explorer/discourse/models/query";
@ -223,11 +223,11 @@ export default class PluginsExplorerController extends Controller {
if (e.jqXHR) {
popupAjaxError(e);
} else if (e instanceof SyntaxError) {
this.dialog.alert(I18n.t("explorer.import.unparseable_json"));
this.dialog.alert(i18n("explorer.import.unparseable_json"));
} else if (e instanceof TypeError) {
this.dialog.alert(I18n.t("explorer.import.wrong_json"));
this.dialog.alert(i18n("explorer.import.wrong_json"));
} else {
this.dialog.alert(I18n.t("errors.desc.unknown"));
this.dialog.alert(i18n("errors.desc.unknown"));
// eslint-disable-next-line no-console
console.error(e);
}

View File

@ -6,11 +6,11 @@ import BookmarkModal from "discourse/components/modal/bookmark";
import { ajax } from "discourse/lib/ajax";
import { popupAjaxError } from "discourse/lib/ajax-error";
import { BookmarkFormData } from "discourse/lib/bookmark-form-data";
import { bind } from "discourse/lib/decorators";
import {
NO_REMINDER_ICON,
WITH_REMINDER_ICON,
} from "discourse/models/bookmark";
import { bind } from "discourse-common/utils/decorators";
import { ParamValidationError } from "discourse/plugins/discourse-data-explorer/discourse/components/param-input-form";
export default class GroupReportsShowController extends Controller {

View File

@ -1,6 +1,6 @@
import { computed } from "@ember/object";
import getURL from "discourse/lib/get-url";
import RestModel from "discourse/models/rest";
import getURL from "discourse-common/lib/get-url";
export default class Query extends RestModel {
static updatePropertyNames = [

View File

@ -1,15 +1,16 @@
{
"private": true,
"devDependencies": {
"@discourse/lint-configs": "2.2.2",
"ember-template-lint": "6.0.0",
"eslint": "9.15.0",
"@discourse/lint-configs": "2.4.0",
"ember-template-lint": "6.1.0",
"eslint": "9.19.0",
"prettier": "2.8.8"
},
"engines": {
"node": ">= 18",
"node": ">= 22",
"npm": "please-use-pnpm",
"yarn": "please-use-pnpm",
"pnpm": ">= 9"
}
"pnpm": "9.x"
},
"packageManager": "pnpm@9.15.5"
}

1317
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
import { visit } from "@ember/test-helpers";
import { test } from "qunit";
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
import I18n from "discourse-i18n";
import { i18n } from "discourse-i18n";
acceptance("Data Explorer Plugin | List Queries", function (needs) {
needs.user();
@ -140,7 +140,7 @@ acceptance("Data Explorer Plugin | List Queries", function (needs) {
.dom("div.query-list input.ember-text-field")
.hasAttribute(
"placeholder",
I18n.t("explorer.search_placeholder"),
i18n("explorer.search_placeholder"),
"the search box was rendered"
);
@ -150,10 +150,7 @@ acceptance("Data Explorer Plugin | List Queries", function (needs) {
assert
.dom("div.query-list button.btn-icon-text span.d-button-label")
.hasText(
I18n.t("explorer.import.label"),
"the import button was rendered"
);
.hasText(i18n("explorer.import.label"), "the import button was rendered");
assert
.dom("div.container table.recent-queries tbody tr")

View File

@ -1,7 +1,7 @@
import { click, visit } from "@ember/test-helpers";
import { test } from "qunit";
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
import I18n from "discourse-i18n";
import { i18n } from "discourse-i18n";
acceptance("Data Explorer Plugin | Run Query", function (needs) {
needs.user();
@ -187,7 +187,7 @@ acceptance("Data Explorer Plugin | Run Query", function (needs) {
assert
.dom("form.query-run button span")
.hasText(I18n.t("explorer.run"), "the run button was rendered");
.hasText(i18n("explorer.run"), "the run button was rendered");
await click("form.query-run button");
@ -197,7 +197,7 @@ acceptance("Data Explorer Plugin | Run Query", function (needs) {
assert
.dom("div.result-info button:nth-child(3) span")
.hasText(I18n.t("explorer.show_graph"), "the chart button was rendered");
.hasText(i18n("explorer.show_graph"), "the chart button was rendered");
await click("div.result-info button:nth-child(3)");
@ -213,7 +213,7 @@ acceptance("Data Explorer Plugin | Run Query", function (needs) {
assert
.dom("form.query-run button span")
.hasText(I18n.t("explorer.run"), "the run button was rendered");
.hasText(i18n("explorer.run"), "the run button was rendered");
await click("form.query-run button");

View File

@ -1,7 +1,7 @@
import { click, render } from "@ember/test-helpers";
import { module, test } from "qunit";
import { setupRenderingTest } from "discourse/tests/helpers/component-test";
import I18n from "discourse-i18n";
import { i18n } from "discourse-i18n";
import QueryResult from "../../discourse/components/query-result";
module(
@ -24,15 +24,15 @@ module(
assert
.dom("div.result-info button:nth-child(1) span")
.hasText(I18n.t("explorer.download_json"), "renders the JSON button");
.hasText(i18n("explorer.download_json"), "renders the JSON button");
assert
.dom("div.result-info button:nth-child(2) span")
.hasText(I18n.t("explorer.download_csv"), "renders the CSV button");
.hasText(i18n("explorer.download_csv"), "renders the CSV button");
assert
.dom("div.result-info button:nth-child(3) span")
.hasText(I18n.t("explorer.show_graph"), "renders the chart button");
.hasText(i18n("explorer.show_graph"), "renders the chart button");
assert.dom("div.result-about").exists("renders a query summary");
@ -157,10 +157,7 @@ module(
assert
.dom("div.result-info button:nth-child(3) span")
.hasText(
I18n.t("explorer.show_graph"),
"the chart button was rendered"
);
.hasText(i18n("explorer.show_graph"), "the chart button was rendered");
assert.dom("table").exists("the table was rendered");
await click("div.result-info button:nth-child(3)");
@ -168,7 +165,7 @@ module(
assert
.dom("div.result-info button:nth-child(3) span")
.hasText(
I18n.t("explorer.show_table"),
i18n("explorer.show_table"),
"the chart button was changed to the table button"
);
assert.dom("canvas").exists("the chart was rendered");
@ -177,7 +174,7 @@ module(
assert
.dom("div.result-info button:nth-child(3) span")
.hasText(
I18n.t("explorer.show_graph"),
i18n("explorer.show_graph"),
"the table button was changed to the chart button"
);
assert.dom("table").exists("the table was rendered");
@ -198,7 +195,7 @@ module(
assert
.dom("div.result-info button:nth-child(3) span")
.hasText(I18n.t("explorer.show_graph"));
.hasText(i18n("explorer.show_graph"));
});
test("doesn't render a chart button when data contains identifiers in the second column", async function (assert) {