Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit ee15154

Browse files
DEV: Fix specs and lint
1 parent f5baa25 commit ee15154

File tree

5 files changed

+9
-19
lines changed

5 files changed

+9
-19
lines changed

assets/javascripts/discourse/components/ai-llms-list-editor.gjs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { action } from "@ember/object";
44
import { LinkTo } from "@ember/routing";
55
import { service } from "@ember/service";
66
import DBreadcrumbsItem from "discourse/components/d-breadcrumbs-item";
7-
import icon from "discourse-common/helpers/d-icon";
87
import i18n from "discourse-common/helpers/i18n";
98
import I18n from "discourse-i18n";
109
import AdminPageSubheader from "admin/components/admin-page-subheader";
@@ -142,9 +141,6 @@ export default class AiLlmsListEditor extends Component {
142141
class="ai-llm-list__row d-admin-row__content"
143142
>
144143
<td class="d-admin-row__overview">
145-
<div class="d-admin-row__mobile-label">
146-
{{i18n "discourse_ai.llms.display_name"}}
147-
</div>
148144
<h3>{{llm.display_name}}</h3>
149145
<p>
150146
{{this.modelDescription llm}}
@@ -168,7 +164,7 @@ export default class AiLlmsListEditor extends Component {
168164
<td class="d-admin-row__controls">
169165
<LinkTo
170166
@route="adminPlugins.show.discourse-ai-llms.show"
171-
class="btn btn-default btn-small"
167+
class="btn btn-default btn-small ai-llm-list__edit-button"
172168
@model={{llm.id}}
173169
>
174170
<div class="d-button-label">

assets/javascripts/discourse/components/ai-persona-list-editor.gjs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
import Component from "@glimmer/component";
2-
import AdminConfigAreaEmptyList from "admin/components/admin-config-area-empty-list";
3-
import { tracked } from "@glimmer/tracking";
42
import { fn } from "@ember/helper";
53
import { on } from "@ember/modifier";
64
import { action } from "@ember/object";
@@ -10,9 +8,8 @@ import DBreadcrumbsItem from "discourse/components/d-breadcrumbs-item";
108
import DToggleSwitch from "discourse/components/d-toggle-switch";
119
import concatClass from "discourse/helpers/concat-class";
1210
import { popupAjaxError } from "discourse/lib/ajax-error";
13-
import { cook } from "discourse/lib/text";
1411
import i18n from "discourse-common/helpers/i18n";
15-
import I18n from "discourse-i18n";
12+
import AdminConfigAreaEmptyList from "admin/components/admin-config-area-empty-list";
1613
import AdminPageSubheader from "admin/components/admin-page-subheader";
1714
import AiPersonaEditor from "./ai-persona-editor";
1815

@@ -108,7 +105,7 @@ export default class AiPersonaListEditor extends Component {
108105
<AdminConfigAreaEmptyList
109106
@ctaLabel="discourse_ai.ai_persona.new"
110107
@ctaRoute="adminPlugins.show.discourse-ai-personas.new"
111-
@ctaClass="ai-persona-list-editor__new-button"
108+
@ctaClass="ai-persona-list-editor__empty-new-button"
112109
@emptyLabel="discourse_ai.ai_persona.no_personas"
113110
/>
114111
{{/if}}

assets/javascripts/discourse/components/ai-tool-list-editor.gjs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import Component from "@glimmer/component";
2-
import AdminConfigAreaEmptyList from "admin/components/admin-config-area-empty-list";
32
import { LinkTo } from "@ember/routing";
43
import { service } from "@ember/service";
54
import DBreadcrumbsItem from "discourse/components/d-breadcrumbs-item";
65
import i18n from "discourse-common/helpers/i18n";
76
import I18n from "discourse-i18n";
7+
import AdminConfigAreaEmptyList from "admin/components/admin-config-area-empty-list";
88
import AdminPageSubheader from "admin/components/admin-page-subheader";
99

1010
export default class AiToolListEditor extends Component {
@@ -45,9 +45,6 @@ export default class AiToolListEditor extends Component {
4545
>
4646
<td class="d-admin-row__overview">
4747
<div class="ai-tool-list__name-with-description">
48-
<div class="d-admin-row__mobile-label">
49-
{{i18n "discourse_ai.tools.name"}}
50-
</div>
5148
<div class="ai-tool-list__name">
5249
<strong>
5350
{{tool.name}}
@@ -73,7 +70,7 @@ export default class AiToolListEditor extends Component {
7370
<AdminConfigAreaEmptyList
7471
@ctaLabel="discourse_ai.tools.new"
7572
@ctaRoute="adminPlugins.show.discourse-ai-tools.new"
76-
@ctaClass="ai-tool-list-editor__new-button"
73+
@ctaClass="ai-tool-list-editor__empty-new-button"
7774
@emptyLabel="discourse_ai.tools.no_tools"
7875
/>
7976
{{/if}}

spec/system/admin_ai_persona_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
it "allows creation of a persona" do
1313
visit "/admin/plugins/discourse-ai/ai-personas"
14-
find(".ai-persona-list-editor__header .btn-primary").click()
14+
find(".ai-persona-list-editor__new-button").click()
1515
find(".ai-persona-editor__name").set("Test Persona")
1616
find(".ai-persona-editor__description").fill_in(with: "I am a test persona")
1717
find(".ai-persona-editor__system_prompt").fill_in(with: "You are a helpful bot")

spec/system/llms/ai_llm_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,14 @@
7676
it "shows the provider as CDCK in the UI" do
7777
visit "/admin/plugins/discourse-ai/ai-llms"
7878
expect(page).to have_css(
79-
"[data-llm-id='cdck-hosted'] .column-provider",
79+
"[data-llm-id='cdck-hosted']",
8080
text: I18n.t("js.discourse_ai.llms.providers.CDCK"),
8181
)
8282
end
8383

8484
it "shows an info alert to the user about the seeded LLM" do
8585
visit "/admin/plugins/discourse-ai/ai-llms"
86-
find("[data-llm-id='#{llm_model.name}'] .column-edit .btn").click()
86+
find("[data-llm-id='#{llm_model.name}'] .ai-llm-list__edit-button").click()
8787
expect(page).to have_css(
8888
".alert.alert-info",
8989
text: I18n.t("js.discourse_ai.llms.seeded_warning"),
@@ -92,7 +92,7 @@
9292

9393
it "limits and shows disabled inputs for the seeded LLM" do
9494
visit "/admin/plugins/discourse-ai/ai-llms"
95-
find("[data-llm-id='cdck-hosted'] .column-edit .btn").click()
95+
find("[data-llm-id='cdck-hosted'] .ai-llm-list__edit-button").click()
9696
expect(page).to have_css(".ai-llm-editor__display-name[disabled]")
9797
expect(page).to have_css(".ai-llm-editor__name[disabled]")
9898
expect(page).to have_css(".ai-llm-editor__provider.is-disabled")

0 commit comments

Comments
 (0)