Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions assets/javascripts/discourse/components/ai-llms-list-editor.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { action } from "@ember/object";
import { LinkTo } from "@ember/routing";
import { service } from "@ember/service";
import DBreadcrumbsItem from "discourse/components/d-breadcrumbs-item";
import DPageSubheader from "discourse/components/d-page-subheader";
import i18n from "discourse-common/helpers/i18n";
import I18n from "discourse-i18n";
import AdminPageSubheader from "admin/components/admin-page-subheader";
import AdminSectionLandingItem from "admin/components/admin-section-landing-item";
import AdminSectionLandingWrapper from "admin/components/admin-section-landing-wrapper";
import AiLlmEditor from "./ai-llm-editor";
Expand Down Expand Up @@ -121,9 +121,11 @@ export default class AiLlmsListEditor extends Component {
{{else}}
{{#if this.hasLlmElements}}
<section class="ai-llms-list-editor__configured">
<AdminPageSubheader
@titleLabel="discourse_ai.llms.configured.title"
@descriptionLabel="discourse_ai.llms.preconfigured.description"
<DPageSubheader
@titleLabel={{i18n "discourse_ai.llms.configured.title"}}
@descriptionLabel={{i18n
"discourse_ai.llms.preconfigured.description"
}}
@learnMoreUrl="https://meta.discourse.org/t/discourse-ai-large-language-model-llm-settings-page/319903"
/>
<table class="d-admin-table">
Expand Down Expand Up @@ -183,11 +185,11 @@ export default class AiLlmsListEditor extends Component {
</section>
{{/if}}
<section class="ai-llms-list-editor__templates">
<AdminPageSubheader
@titleLabel={{this.preconfiguredTitle}}
<DPageSubheader
@titleLabel={{i18n this.preconfiguredTitle}}
@descriptionLabel={{unless
this.hasLlmElements
"discourse_ai.llms.preconfigured.description"
(i18n "discourse_ai.llms.preconfigured.description")
}}
@learnMoreUrl={{unless
this.hasLlmElements
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import { action } from "@ember/object";
import { LinkTo } from "@ember/routing";
import { service } from "@ember/service";
import DBreadcrumbsItem from "discourse/components/d-breadcrumbs-item";
import DPageSubheader from "discourse/components/d-page-subheader";
import DToggleSwitch from "discourse/components/d-toggle-switch";
import concatClass from "discourse/helpers/concat-class";
import { popupAjaxError } from "discourse/lib/ajax-error";
import i18n from "discourse-common/helpers/i18n";
import AdminConfigAreaEmptyList from "admin/components/admin-config-area-empty-list";
import AdminPageSubheader from "admin/components/admin-page-subheader";
import AiPersonaEditor from "./ai-persona-editor";

export default class AiPersonaListEditor extends Component {
Expand Down Expand Up @@ -39,9 +39,11 @@ export default class AiPersonaListEditor extends Component {
{{#if @currentPersona}}
<AiPersonaEditor @model={{@currentPersona}} @personas={{@personas}} />
{{else}}
<AdminPageSubheader
@titleLabel="discourse_ai.ai_persona.short_title"
@descriptionLabel="discourse_ai.ai_persona.persona_description"
<DPageSubheader
@titleLabel={{i18n "discourse_ai.ai_persona.short_title"}}
@descriptionLabel={{i18n
"discourse_ai.ai_persona.persona_description"
}}
@learnMoreUrl="https://meta.discourse.org/t/ai-bot-personas/306099"
>
<:actions as |actions|>
Expand All @@ -52,7 +54,7 @@ export default class AiPersonaListEditor extends Component {
class="ai-persona-list-editor__new-button"
/>
</:actions>
</AdminPageSubheader>
</DPageSubheader>

{{#if @personas}}
<table class="content-list ai-persona-list-editor d-admin-table">
Expand Down
8 changes: 4 additions & 4 deletions assets/javascripts/discourse/components/ai-spam.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { action } from "@ember/object";
import { LinkTo } from "@ember/routing";
import { service } from "@ember/service";
import DButton from "discourse/components/d-button";
import DPageSubheader from "discourse/components/d-page-subheader";
import DStatTiles from "discourse/components/d-stat-tiles";
import DToggleSwitch from "discourse/components/d-toggle-switch";
import DTooltip from "discourse/components/d-tooltip";
Expand All @@ -15,7 +16,6 @@ import { popupAjaxError } from "discourse/lib/ajax-error";
import i18n from "discourse-common/helpers/i18n";
import getURL from "discourse-common/lib/get-url";
import AdminConfigAreaCard from "admin/components/admin-config-area-card";
import AdminPageSubheader from "admin/components/admin-page-subheader";
import ComboBox from "select-kit/components/combo-box";
import SpamTestModal from "./modal/spam-test-modal";

Expand Down Expand Up @@ -165,9 +165,9 @@ export default class AiSpam extends Component {
<template>
<div class="ai-spam">
<section class="ai-spam__settings">
<AdminPageSubheader
@titleLabel="discourse_ai.spam.title"
@descriptionLabel="discourse_ai.spam.spam_description"
<DPageSubheader
@titleLabel={{i18n "discourse_ai.spam.title"}}
@descriptionLabel={{i18n "discourse_ai.spam.spam_description"}}
/>

<div class="control-group ai-spam__enabled">
Expand Down
10 changes: 5 additions & 5 deletions assets/javascripts/discourse/components/ai-tool-list-editor.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import Component from "@glimmer/component";
import { LinkTo } from "@ember/routing";
import { service } from "@ember/service";
import DBreadcrumbsItem from "discourse/components/d-breadcrumbs-item";
import DPageSubheader from "discourse/components/d-page-subheader";
import i18n from "discourse-common/helpers/i18n";
import I18n from "discourse-i18n";
import AdminConfigAreaEmptyList from "admin/components/admin-config-area-empty-list";
import AdminPageSubheader from "admin/components/admin-page-subheader";

export default class AiToolListEditor extends Component {
@service adminPluginNavManager;
Expand All @@ -16,10 +16,10 @@ export default class AiToolListEditor extends Component {
@label={{i18n "discourse_ai.tools.short_title"}}
/>
<section class="ai-tool-list-editor__current admin-detail pull-left">
<AdminPageSubheader
@titleLabel="discourse_ai.tools.short_title"
<DPageSubheader
@titleLabel={{i18n "discourse_ai.tools.short_title"}}
@learnMoreUrl="https://meta.discourse.org/t/ai-bot-custom-tools/314103"
@descriptionLabel="discourse_ai.tools.subheader_description"
@descriptionLabel={{i18n "discourse_ai.tools.subheader_description"}}
>
<:actions as |actions|>
<actions.Primary
Expand All @@ -29,7 +29,7 @@ export default class AiToolListEditor extends Component {
class="ai-tool-list-editor__new-button"
/>
</:actions>
</AdminPageSubheader>
</DPageSubheader>

{{#if @tools}}
<table class="d-admin-table ai-tool-list-editor">
Expand Down
8 changes: 4 additions & 4 deletions assets/javascripts/discourse/components/ai-usage.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { service } from "@ember/service";
import { eq, gt, lt } from "truth-helpers";
import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";
import DButton from "discourse/components/d-button";
import DPageSubheader from "discourse/components/d-page-subheader";
import DStatTiles from "discourse/components/d-stat-tiles";
import DateTimeInputRange from "discourse/components/date-time-input-range";
import avatar from "discourse/helpers/avatar";
Expand All @@ -17,7 +18,6 @@ import i18n from "discourse-common/helpers/i18n";
import { bind } from "discourse-common/utils/decorators";
import AdminConfigAreaCard from "admin/components/admin-config-area-card";
import AdminConfigAreaEmptyList from "admin/components/admin-config-area-empty-list";
import AdminPageSubheader from "admin/components/admin-page-subheader";
import Chart from "admin/components/chart";
import ComboBox from "select-kit/components/combo-box";

Expand Down Expand Up @@ -309,10 +309,10 @@ export default class AiUsage extends Component {

<template>
<div class="ai-usage admin-detail">
<AdminPageSubheader
@titleLabel="discourse_ai.usage.short_title"
<DPageSubheader
@titleLabel={{i18n "discourse_ai.usage.short_title"}}
@learnMoreUrl="https://meta.discourse.org/t/estimating-costs-of-using-llms-for-discourse-ai/307243"
@descriptionLabel="discourse_ai.usage.subheader_description"
@descriptionLabel={{i18n "discourse_ai.usage.subheader_description"}}
/>
<div class="ai-usage__filters">
<div class="ai-usage__filters-dates">
Expand Down
6 changes: 3 additions & 3 deletions spec/system/admin_ai_persona_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

RSpec.describe "Admin AI persona configuration", type: :system, js: true do
fab!(:admin)
let(:admin_header) { PageObjects::Components::AdminHeader.new }
let(:page_header) { PageObjects::Components::DPageHeader.new }

before do
SiteSetting.ai_bot_enabled = true
Expand All @@ -13,11 +13,11 @@
it "allows creation of a persona" do
visit "/admin/plugins/discourse-ai/ai-personas"

expect(admin_header).to be_visible
expect(page_header).to be_visible

find(".ai-persona-list-editor__new-button").click()

expect(admin_header).to be_hidden
expect(page_header).to be_hidden

find(".ai-persona-editor__name").set("Test Persona")
find(".ai-persona-editor__description").fill_in(with: "I am a test persona")
Expand Down
6 changes: 3 additions & 3 deletions spec/system/ai_bot/tool_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

describe "AI Tool Management", type: :system do
fab!(:admin)
let(:admin_header) { PageObjects::Components::AdminHeader.new }
let(:page_header) { PageObjects::Components::DPageHeader.new }

before do
SiteSetting.ai_embeddings_enabled = true
Expand Down Expand Up @@ -37,11 +37,11 @@ def ensure_can_run_test
it "allows admin to create a new AI tool from preset" do
visit "/admin/plugins/discourse-ai/ai-tools"

expect(admin_header).to be_visible
expect(page_header).to be_visible
expect(page).to have_content("Tools")

find(".ai-tool-list-editor__new-button").click
expect(admin_header).to be_hidden
expect(page_header).to be_hidden

select_kit = PageObjects::Components::SelectKit.new(".ai-tool-editor__presets")
select_kit.expand
Expand Down
6 changes: 3 additions & 3 deletions spec/system/llms/ai_llm_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

RSpec.describe "Managing LLM configurations", type: :system, js: true do
fab!(:admin)
let(:admin_header) { PageObjects::Components::AdminHeader.new }
let(:page_header) { PageObjects::Components::DPageHeader.new }

before do
SiteSetting.ai_bot_enabled = true
Expand Down Expand Up @@ -37,10 +37,10 @@

it "manually configures an LLM" do
visit "/admin/plugins/discourse-ai/ai-llms"
expect(admin_header).to be_visible
expect(page_header).to be_visible

find("[data-llm-id='none'] button").click()
expect(admin_header).to be_hidden
expect(page_header).to be_hidden

find("input.ai-llm-editor__display-name").fill_in(with: "Self-hosted LLM")
find("input.ai-llm-editor__name").fill_in(with: "llava-hf/llava-v1.6-mistral-7b-hf")
Expand Down
Loading