A platform for community discussion. Free, open, simple.
UX: convert AI admin feature buttons to links (#33840)
Krisbcc4ef1e6d6e
diff --git a/plugins/discourse-ai/assets/javascripts/discourse/components/ai-features-list.gjs b/plugins/discourse-ai/assets/javascripts/discourse/components/ai-features-list.gjsindex 4cd52499e80..c80da869c6c 100644--- a/plugins/discourse-ai/assets/javascripts/discourse/components/ai-features-list.gjs+++ b/plugins/discourse-ai/assets/javascripts/discourse/components/ai-features-list.gjs@@ -2,6 +2,7 @@ import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";import { concat } from "@ember/helper";import { action } from "@ember/object";+import { LinkTo } from "@ember/routing";import DButton from "discourse/components/d-button";import { i18n } from "discourse-i18n";@@ -165,15 +166,16 @@ export default class AiFeaturesList extends Component {@maxItemsToShow={{5}}as |persona index isLastItem|>- <DButton- class="btn-flat ai-feature-card__persona-button btn-text"- @translatedLabel={{concat+ <LinkTo+ @route="adminPlugins.show.discourse-ai-personas.edit"+ @model={{persona.id}}+ class="ai-feature-card__persona-link"+ >+ {{concatpersona.name(unless (isLastItem index) ", ")}}- @route="adminPlugins.show.discourse-ai-personas.edit"- @routeModels={{persona.id}}- />+ </LinkTo></ExpandableList>{{else}}<span class="ai-feature-card__label">@@ -196,15 +198,13 @@ export default class AiFeaturesList extends Component {@maxItemsToShow={{5}}as |llm index isLastItem|>- <DButton- class="btn-flat ai-feature-card__llm-button"- @translatedLabel={{concat- llm.name- (unless (isLastItem index) ", ")- }}+ <LinkTo@route="adminPlugins.show.discourse-ai-llms.edit"- @routeModels={{llm.id}}- />+ @model={{llm.id}}+ class="ai-feature-card__llm-link"+ >+ {{concat llm.name (unless (isLastItem index) ", ")}}+ </LinkTo></ExpandableList>{{else}}<span class="ai-feature-card__label">diff --git a/plugins/discourse-ai/assets/stylesheets/common/ai-features.scss b/plugins/discourse-ai/assets/stylesheets/common/ai-features.scssindex a97243a777e..63686965267 100644--- a/plugins/discourse-ai/assets/stylesheets/common/ai-features.scss+++ b/plugins/discourse-ai/assets/stylesheets/common/ai-features.scss@@ -55,17 +55,14 @@@include ellipsis;}- &__persona-button,- &__llm-button {+ &__persona-link,+ &__llm-link {padding: 0;margin-right: var(--space-1);overflow: hidden;+ min-height: 1.5em;- .d-button-label {- min-height: 1.5em;-- @include ellipsis;- }+ @include ellipsis;}&__groups {diff --git a/plugins/discourse-ai/spec/system/page_objects/pages/admin_ai_features.rb b/plugins/discourse-ai/spec/system/page_objects/pages/admin_ai_features.rbindex e37c3b2a321..b2afbe54080 100644--- a/plugins/discourse-ai/spec/system/page_objects/pages/admin_ai_features.rb+++ b/plugins/discourse-ai/spec/system/page_objects/pages/admin_ai_features.rb@@ -26,7 +26,7 @@ module PageObjectsdef has_feature_persona?(feature_name, name)page.has_css?(- "#{FEATURES_PAGE} .ai-feature-card[data-feature-name='#{feature_name}'] .ai-feature-card__persona-button .d-button-label",+ "#{FEATURES_PAGE} .ai-feature-card[data-feature-name='#{feature_name}'] .ai-feature-card__persona-link",text: name,)end