From dc490c236de92492f3ef990732368a06d52a396e Mon Sep 17 00:00:00 2001 From: jacobshandling <61553566+jacobshandling@users.noreply.github.com> Date: Fri, 2 May 2025 09:14:30 -0700 Subject: [PATCH] UI: Clean up various states on the Settings page (#28752) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## For #28266 Screenshot 2025-05-01 at 9 48 06 PM Screenshot 2025-05-01 at 9 48 44 PM Screenshot 2025-05-01 at 9 49 43 PM Screenshot 2025-05-01 at 9 51 42 PM - [x] Changes file added for user-visible changes in `changes/` - [x] Manual QA for all new/changed functionality --------- Co-authored-by: Jacob Shandling --- changes/28266-clean-up-settings | 1 + .../cards/Integrations/Integrations.tsx | 65 +++++++++++-------- .../pages/admin/OrgSettingsPage/_styles.scss | 20 ++++++ .../admin/OrgSettingsPage/cards/Smtp/Smtp.tsx | 30 +++++---- frontend/pages/admin/_styles.scss | 2 +- 5 files changed, 77 insertions(+), 41 deletions(-) create mode 100644 changes/28266-clean-up-settings diff --git a/changes/28266-clean-up-settings b/changes/28266-clean-up-settings new file mode 100644 index 0000000000..0bfd2bd45b --- /dev/null +++ b/changes/28266-clean-up-settings @@ -0,0 +1 @@ +* Clean up various empty and configured states on the settings pages diff --git a/frontend/pages/admin/IntegrationsPage/cards/Integrations/Integrations.tsx b/frontend/pages/admin/IntegrationsPage/cards/Integrations/Integrations.tsx index 5199de829c..496bf67abd 100644 --- a/frontend/pages/admin/IntegrationsPage/cards/Integrations/Integrations.tsx +++ b/frontend/pages/admin/IntegrationsPage/cards/Integrations/Integrations.tsx @@ -17,6 +17,7 @@ import configAPI from "services/entities/config"; import TableContainer from "components/TableContainer"; import TableDataError from "components/DataError"; import SectionHeader from "components/SectionHeader"; +import Spinner from "components/Spinner"; import AddIntegrationModal from "./components/AddIntegrationModal"; import DeleteIntegrationModal from "./components/DeleteIntegrationModal"; @@ -267,6 +268,41 @@ const Integrations = (): JSX.Element => { [jiraIntegrations, zendeskIntegrations] ); + const renderTable = () => { + if (loadingIntegrationsError) { + return ; + } + if (isLoadingIntegrations) { + return ; + } + return ( + ( + + )} + showMarkAllPages={false} + isAllPagesSelected={false} + disablePagination + /> + ); + }; + return (
@@ -274,34 +310,7 @@ const Integrations = (): JSX.Element => { Add or edit integrations to create tickets when Fleet detects new vulnerabilities.

- {loadingIntegrationsError ? ( - - ) : ( - ( - - )} - showMarkAllPages={false} - isAllPagesSelected={false} - disablePagination - /> - )} + {renderTable()} {showAddIntegrationModal && ( { - const header = "Email already configured"; - const info = ( - <> - To configure SMTP,{" "} - - + const sesBaseClass = `${baseClass}__ses-enabled`; + return ( + +
+

Email already configured

+

+ To configure SMTP,{" "} + +

+
+
); - return ; }; const renderSmtpForm = () => { diff --git a/frontend/pages/admin/_styles.scss b/frontend/pages/admin/_styles.scss index 10c4aa141c..66f1be2406 100644 --- a/frontend/pages/admin/_styles.scss +++ b/frontend/pages/admin/_styles.scss @@ -30,7 +30,7 @@ .side-nav__card-container { // all side navs in the admin section we want to limit the max width - > * { + > *:not(.loading-spinner) { width: 100%; max-width: $settings-form-max-width; }