DEV: Update linting (#933)

This commit is contained in:
David Taylor 2024-11-20 14:43:28 +00:00 committed by GitHub
parent b68a4ca718
commit 2900d2c87d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 41 additions and 26 deletions

View File

@ -2,7 +2,7 @@ import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking";
import { on } from "@ember/modifier";
import { action } from "@ember/object";
import { inject as service } from "@ember/service";
import { service } from "@ember/service";
import DButton from "discourse/components/d-button";
import htmlClass from "discourse/helpers/html-class";
import getURL from "discourse-common/lib/get-url";

View File

@ -37,6 +37,15 @@ export default class RagUploader extends Component {
},
});
willDestroy() {
super.willDestroy(...arguments);
this.appEvents.off(
`upload-mixin:${this.uppyUpload.config}:all-uploads-complete`,
this,
"_updateTargetWithUploads"
);
}
didReceiveAttrs() {
super.didReceiveAttrs(...arguments);
@ -64,15 +73,6 @@ export default class RagUploader extends Component {
);
}
willDestroy() {
super.willDestroy(...arguments);
this.appEvents.off(
`upload-mixin:${this.uppyUpload.config}:all-uploads-complete`,
this,
"_updateTargetWithUploads"
);
}
_updateTargetWithUploads() {
this.updateUploads(this.ragUploads);
}
@ -152,7 +152,7 @@ export default class RagUploader extends Component {
@icon="times"
@title="discourse_ai.rag.uploads.remove"
@action={{fn this.removeUpload upload}}
@class="btn-flat"
class="btn-flat"
/>
</td>
</tr>
@ -173,7 +173,7 @@ export default class RagUploader extends Component {
@icon="times"
@title="discourse_ai.rag.uploads.remove"
@action={{fn this.cancelUploading upload}}
@class="btn-flat"
class="btn-flat"
/>
</td>
</tr>

View File

@ -168,6 +168,7 @@ export default class SemanticSearch extends Component {
this.#resetAndSearchOnEvent();
}
}
<template>
<span {{didInsert this.checkQueryParamsAndSearch}}></span>
{{#if this.searchEnabled}}

View File

@ -30,6 +30,11 @@ export default class AiPostHelperTrigger extends Component {
options: "OPTIONS",
};
willDestroy() {
super.willDestroy(...arguments);
this.removeHighlightedText();
}
highlightSelectedText() {
const postId = this.args.outletArgs.data.quoteState.postId;
const postElement = document.querySelector(
@ -120,11 +125,6 @@ export default class AiPostHelperTrigger extends Component {
this.postHighlighted = false;
}
willDestroy() {
super.willDestroy(...arguments);
this.removeHighlightedText();
}
@action
async showAiPostHelperMenu() {
this.highlightSelectedText();

View File

@ -245,7 +245,7 @@ export default class AiSummaryBox extends Component {
@title="discourse_ai.summarization.topic.close"
@action={{this.onClose}}
@icon="times"
@class="btn-transparent ai-summary__close"
class="btn-transparent ai-summary__close"
/>
{{/if}}
</header>

View File

@ -223,7 +223,7 @@ function initializeShareWidgetButton(api) {
function initializeShareTopicButton(api) {
const modal = api.container.lookup("service:modal");
const currentUser = api.container.lookup("current-user:main");
const currentUser = api.container.lookup("service:current-user");
api.registerTopicFooterButton({
id: "share-ai-conversation",

View File

@ -52,7 +52,7 @@ export default apiInitializer("1.25.0", (api) => {
imageCaptionPopup.toggleLoadingState(true);
const site = api.container.lookup("site:main");
const site = api.container.lookup("service:site");
if (!site.mobileView) {
imageCaptionPopup.showPopup = !imageCaptionPopup.showPopup;
}

View File

@ -1,7 +1,7 @@
{
"private": true,
"devDependencies": {
"@discourse/lint-configs": "2.0.1",
"@discourse/lint-configs": "2.2.0",
"ember-template-lint": "6.0.0",
"eslint": "9.14.0",
"prettier": "2.8.8"

View File

@ -9,8 +9,8 @@ importers:
.:
devDependencies:
'@discourse/lint-configs':
specifier: 2.0.1
version: 2.0.1(ember-template-lint@6.0.0)(eslint@9.14.0)(prettier@2.8.8)
specifier: 2.2.0
version: 2.2.0(ember-template-lint@6.0.0)(eslint@9.14.0)(prettier@2.8.8)
ember-template-lint:
specifier: 6.0.0
version: 6.0.0
@ -141,8 +141,8 @@ packages:
resolution: {integrity: sha512-Z/yiTPj+lDVnF7lWeKCIJzaIkI0vYO87dMpZ4bg4TDrFe4XXLFWL1TbXU27gBP3QccxV9mZICCrnjnYlJjXHOA==}
engines: {node: '>=6.9.0'}
'@discourse/lint-configs@2.0.1':
resolution: {integrity: sha512-4AKSzX4EYIEAtTCj+1+VKx0ziQ5XbYJZuQQ8cxhE7/amRloWyuM3YuDpa5x1r2zaLRbfEHXjlveVk+obMRLPqw==}
'@discourse/lint-configs@2.2.0':
resolution: {integrity: sha512-lj13X+3/DRV2ZBQe3eJvxOO23e87DPfUSSqm0UPfP04VJ7141BHwWn9VVF0rOr+bMe2eiirsqlg2AbMn7gMb+A==}
peerDependencies:
ember-template-lint: 6.0.0
eslint: ^9.14.0
@ -288,6 +288,12 @@ packages:
resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==}
engines: {node: '>=18'}
'@stylistic/eslint-plugin-js@2.11.0':
resolution: {integrity: sha512-btchD0P3iij6cIk5RR5QMdEhtCCV0+L6cNheGhGCd//jaHILZMTi/EOqgEDAf1s4ZoViyExoToM+S2Iwa3U9DA==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies:
eslint: '>=8.40.0'
'@types/eslint@8.56.12':
resolution: {integrity: sha512-03ruubjWyOHlmljCVoxSuNDdmfZDzsrrz0P2LeJsOXr+ZwFQ+0yQIwNCwt/GYhV7Z31fgtXJTAEs+FYlEL851g==}
@ -1935,11 +1941,12 @@ snapshots:
'@babel/helper-string-parser': 7.25.9
'@babel/helper-validator-identifier': 7.25.9
'@discourse/lint-configs@2.0.1(ember-template-lint@6.0.0)(eslint@9.14.0)(prettier@2.8.8)':
'@discourse/lint-configs@2.2.0(ember-template-lint@6.0.0)(eslint@9.14.0)(prettier@2.8.8)':
dependencies:
'@babel/core': 7.26.0
'@babel/eslint-parser': 7.25.9(@babel/core@7.26.0)(eslint@9.14.0)
'@babel/plugin-proposal-decorators': 7.25.9(@babel/core@7.26.0)
'@stylistic/eslint-plugin-js': 2.11.0(eslint@9.14.0)
ember-template-lint: 6.0.0
eslint: 9.14.0
eslint-plugin-decorator-position: 6.0.0(@babel/eslint-parser@7.25.9(@babel/core@7.26.0)(eslint@9.14.0))(eslint@9.14.0)
@ -2118,6 +2125,12 @@ snapshots:
'@sindresorhus/merge-streams@2.3.0': {}
'@stylistic/eslint-plugin-js@2.11.0(eslint@9.14.0)':
dependencies:
eslint: 9.14.0
eslint-visitor-keys: 4.2.0
espree: 10.3.0
'@types/eslint@8.56.12':
dependencies:
'@types/estree': 1.0.6

View File

@ -16,6 +16,7 @@ class FakeStreamUpdater {
get streaming() {
return this._streaming;
}
set streaming(value) {
this._streaming = value;
}