diff --git a/app/assets/javascripts/admin/addon/components/admin-config-area-card.gjs b/app/assets/javascripts/admin/addon/components/admin-config-area-card.gjs index 85b5541f654..6eb1f5a4481 100644 --- a/app/assets/javascripts/admin/addon/components/admin-config-area-card.gjs +++ b/app/assets/javascripts/admin/addon/components/admin-config-area-card.gjs @@ -6,7 +6,7 @@ import icon from "discourse-common/helpers/d-icon"; import { i18n } from "discourse-i18n"; export default class AdminConfigAreaCard extends Component { - @tracked collapsed = false; + @tracked collapsed = this.args.collapsed; get computedHeading() { if (this.args.heading) { diff --git a/app/assets/javascripts/admin/addon/controllers/admin-embedding-index.js b/app/assets/javascripts/admin/addon/controllers/admin-embedding-index.js index c03f6d9151b..1fedbcea5bb 100644 --- a/app/assets/javascripts/admin/addon/controllers/admin-embedding-index.js +++ b/app/assets/javascripts/admin/addon/controllers/admin-embedding-index.js @@ -10,11 +10,6 @@ export default class AdminEmbeddingIndexController extends Controller { @controller adminEmbedding; @alias("adminEmbedding.embedding") embedding; - get showEmbeddingCode() { - const hosts = this.get("embedding.embeddable_hosts"); - return hosts.length > 0 && !this.site.isMobileDevice; - } - @discourseComputed("embedding.base_url") embeddingCode(baseUrl) { const html = `
diff --git a/app/assets/javascripts/admin/addon/templates/embedding-index.hbs b/app/assets/javascripts/admin/addon/templates/embedding-index.hbs index d0fb9d0f125..47c59a4a08e 100644 --- a/app/assets/javascripts/admin/addon/templates/embedding-index.hbs +++ b/app/assets/javascripts/admin/addon/templates/embedding-index.hbs @@ -1,4 +1,18 @@ {{#if this.embedding.embeddable_hosts}} + + + <:content> +
+ {{html-safe (i18n "admin.embedding.sample")}} + +
+ +
+ @@ -7,7 +21,7 @@ {{#if this.embedding.embed_by_username}} {{else}} @@ -32,14 +46,4 @@ - -{{#if this.showEmbeddingCode}} -
-
- {{i18n "admin.embedding.configuration_snippet"}} - {{html-safe (i18n "admin.embedding.sample")}} - -
-
-{{/if}} \ No newline at end of file +/> \ No newline at end of file diff --git a/app/assets/javascripts/discourse/tests/integration/components/admin-config-area-card-test.gjs b/app/assets/javascripts/discourse/tests/integration/components/admin-config-area-card-test.gjs index 5bfa9ec5748..96298a0ef84 100644 --- a/app/assets/javascripts/discourse/tests/integration/components/admin-config-area-card-test.gjs +++ b/app/assets/javascripts/discourse/tests/integration/components/admin-config-area-card-test.gjs @@ -36,6 +36,20 @@ module("Integration | Component | AdminConfigAreaCard", function (hooks) { assert.dom(".admin-config-area-card__content").exists(); }); + test("renders admin config area card with toggle button and collapsed by default", async function (assert) { + await render(); + + assert.dom(".admin-config-area-card__title").exists(); + assert.dom(".admin-config-area-card__toggle-button").exists(); + assert.dom(".admin-config-area-card__content").doesNotExist(); + }); + test("renders admin config area card with header action", async function (assert) { await render(
{{i18n "admin.embedding.host"}}{{i18n "admin.embedding.tags"}}{{i18n - "admin.embedding.post_author" + "admin.embedding.post_author_with_default" author=this.embedding.embed_by_username }}