From a879bcdc356d4e691fd217abd34a9f9a2022539c Mon Sep 17 00:00:00 2001 From: Martin Brennan Date: Wed, 18 Dec 2024 08:13:39 +1000 Subject: [PATCH] DEV: Introduce and components (#30146) This converts the `` component and the `` components into new components that can be used outside of admin, and updates the CSS classes. Also introduces a `` component and child components for the header action buttons. I have to keep the old admin-only components around for now until plugins are updated, then we can remove it, and remove the re-exports that are done within admin-page-action-button.gjs --- .../look-and-feel-themes.gjs | 10 +- .../components/admin-page-action-button.gjs | 159 +++------------- .../components/admin-plugin-config-page.gjs | 12 +- .../components/admin-section-landing-item.gjs | 8 +- .../admin/addon/templates/admin-badges.hbs | 9 +- .../admin/addon/templates/backups-index.hbs | 4 +- .../admin/addon/templates/backups.hbs | 10 +- .../admin/addon/templates/config-about.hbs | 9 +- .../admin/addon/templates/config-flags.hbs | 9 +- .../addon/templates/config-look-and-feel.hbs | 9 +- .../admin/addon/templates/dashboard.hbs | 4 +- .../admin/addon/templates/emojis.hbs | 9 +- .../addon/templates/permalinks-index.hbs | 9 +- .../admin/addon/templates/plugins-index.hbs | 9 +- .../admin/addon/templates/plugins.hbs | 4 +- .../admin/addon/templates/section-account.hbs | 7 +- .../admin/addon/templates/user-fields.hbs | 9 +- .../admin/addon/templates/users-list-show.hbs | 4 +- .../admin/addon/templates/users-list.hbs | 9 +- .../admin/addon/templates/whats-new.hbs | 9 +- .../app/components/d-page-action-button.gjs | 124 ++++++++++++ .../app/components/d-page-header.gjs | 145 ++++++++++++++ .../app/components/d-page-subheader.gjs | 76 ++++++++ .../discourse/app/lib/plugin-api.gjs | 2 +- .../tests/acceptance/admin-users-list-test.js | 8 +- .../components/admin-page-subheader-test.gjs | 177 ------------------ ...header-test.gjs => d-page-header-test.gjs} | 119 +++++------- .../components/d-page-subheader-test.gjs | 154 +++++++++++++++ .../stylesheets/common/admin/badges.scss | 2 +- .../stylesheets/common/admin/customize.scss | 1 + .../stylesheets/common/admin/plugins.scss | 2 +- .../stylesheets/common/components/_index.scss | 1 + .../common/components/d-page-header.scss | 92 +++++++++ .../index.hbs | 8 +- .../system/admin/incoming_webhooks_spec.rb | 6 +- spec/system/admin_flags_spec.rb | 11 +- spec/system/admin_user_fields_spec.rb | 8 +- .../{admin-header.rb => admin_header.rb} | 7 +- .../page_objects/components/d_page_header.rb | 19 ++ .../page_objects/pages/admin_plugins_list.rb | 2 +- .../page_objects/pages/admin_user_fields.rb | 2 +- 41 files changed, 789 insertions(+), 489 deletions(-) create mode 100644 app/assets/javascripts/discourse/app/components/d-page-action-button.gjs create mode 100644 app/assets/javascripts/discourse/app/components/d-page-header.gjs create mode 100644 app/assets/javascripts/discourse/app/components/d-page-subheader.gjs delete mode 100644 app/assets/javascripts/discourse/tests/integration/components/admin-page-subheader-test.gjs rename app/assets/javascripts/discourse/tests/integration/components/{admin-page-header-test.gjs => d-page-header-test.gjs} (54%) create mode 100644 app/assets/javascripts/discourse/tests/integration/components/d-page-subheader-test.gjs create mode 100644 app/assets/stylesheets/common/components/d-page-header.scss rename spec/system/page_objects/components/{admin-header.rb => admin_header.rb} (50%) create mode 100644 spec/system/page_objects/components/d_page_header.rb diff --git a/app/assets/javascripts/admin/addon/components/admin-config-areas/look-and-feel-themes.gjs b/app/assets/javascripts/admin/addon/components/admin-config-areas/look-and-feel-themes.gjs index 66c8b369b3f..d47f9b85671 100644 --- a/app/assets/javascripts/admin/addon/components/admin-config-areas/look-and-feel-themes.gjs +++ b/app/assets/javascripts/admin/addon/components/admin-config-areas/look-and-feel-themes.gjs @@ -1,8 +1,8 @@ import Component from "@glimmer/component"; import { action } from "@ember/object"; import { service } from "@ember/service"; +import DPageSubheader from "discourse/components/d-page-subheader"; import { i18n } from "discourse-i18n"; -import AdminPageSubheader from "admin/components/admin-page-subheader"; import InstallThemeModal from "admin/components/modal/install-theme"; import ThemesGrid from "admin/components/themes-grid"; @@ -47,9 +47,9 @@ export default class AdminConfigAreasLookAndFeelThemes extends Component { }