From a87d29fce7508bb40b454f9706f7ed93c38fca24 Mon Sep 17 00:00:00 2001 From: Matthew Birtch Date: Tue, 3 Jun 2025 15:37:20 -0400 Subject: [PATCH] Remove redundant button styles and use proper button classes (#30929) * remove redundant button styles and use proper button classes * remove import for contact_us css * fix view plans button to be xs * tweak to disabled state on save button in floating bar * change contact us to tertiary button like before * updated btn-full on free edition right panel * update contact button to be primary when shown in the trial card * fix issue with hover state on save changes panel error state * fix style lint issues * update snapshots * fixed a few license page buttons * fix lint issue * Update index.test.tsx.snap * add empty end lines * fixed scope of css so it doesn't affect product switcher * upate button font size for xs, update bg color for button in announce bar * fix lint error * update missed cancel buttons to use proper classes * fixed text spec to find the right button * updated snapshots * fix issue with test on cancel button * update snapshots --- .../system_console/team_guest_channel_spec.js | 2 +- .../incoming_webhook_is_image_only_spec.js | 2 +- .../setup_incoming_webhook_spec.js | 2 +- .../__snapshots__/actions_menu.test.tsx.snap | 4 +- .../components/actions_menu/actions_menu.scss | 29 ++----- .../components/actions_menu/actions_menu.tsx | 4 +- .../billing_subscriptions.scss | 80 ------------------ .../cancel_subscription.tsx | 2 +- .../contact_sales_card.tsx | 4 +- .../billing_summary/billing_summary.scss | 46 ---------- .../billing_summary/billing_summary.tsx | 2 +- .../billing/company_info_display.scss | 44 ---------- .../billing/company_info_display.tsx | 4 +- .../billing/company_info_edit.tsx | 2 +- .../billing/plan_details/plan_details.scss | 22 ----- .../custom_policy_form.test.tsx.snap | 4 +- .../custom_policy_form/custom_policy_form.tsx | 2 +- .../global_policy_form.test.tsx.snap | 2 +- .../global_policy_form/global_policy_form.tsx | 2 +- .../feature_discovery/feature_discovery.scss | 41 --------- .../feature_discovery/feature_discovery.tsx | 4 +- .../add_edit_ip_filter_modal.scss | 46 ---------- .../ip_filtering/add_edit_ip_filter_modal.tsx | 4 +- .../ip_filtering/delete_confirmation.scss | 17 ---- .../ip_filtering/delete_confirmation.tsx | 4 +- .../edit_section/edit_section_header.tsx | 2 +- .../edit_section_ip_not_in_range_panel.tsx | 2 +- .../edit_section_no_filters_panel.tsx | 2 +- .../ip_filtering/save_confirmation_modal.scss | 17 ---- .../ip_filtering/save_confirmation_modal.tsx | 4 +- .../enterprise_edition.scss | 41 +-------- .../enterprise_edition_left_panel.tsx | 6 +- .../enterprise_edition_right_panel.tsx | 1 - .../license_settings/license_settings.scss | 13 +-- .../modals/confirm_license_removal_modal.tsx | 2 +- .../renew_license_card.scss | 83 ++++++++++--------- .../renew_license_card/renew_license_card.tsx | 2 +- .../starter_edition/starter_edition.scss | 24 ------ .../starter_edition/starter_left_panel.tsx | 4 +- .../starter_edition/starter_right_panel.tsx | 1 + .../trial_license_card.scss | 6 -- .../trial_license_card/trial_license_card.tsx | 2 +- ...ssion_system_scheme_settings.test.tsx.snap | 4 + .../permission_system_scheme_settings.tsx | 1 + ...mission_team_scheme_settings.test.tsx.snap | 15 ++-- .../permission_team_scheme_settings.tsx | 3 +- .../__snapshots__/cta_buttons.test.tsx.snap | 4 +- .../workspace-optimization/cta_buttons.tsx | 4 +- .../contact_sales/contact_us.scss | 18 ---- .../contact_sales/contact_us.tsx | 4 +- .../announcement_bar.tsx | 2 + .../__snapshots__/index.test.tsx.snap | 8 +- .../purchase_link/purchase_link.scss | 11 --- .../purchase_link/purchase_link.tsx | 2 +- webapp/channels/src/components/copy_text.tsx | 2 +- .../emoji_picker_custom_emoji_button.tsx | 2 +- .../start_trial_form_modal.test.tsx.snap | 2 +- .../air_gapped_modal.scss | 23 ----- .../air_gapped_modal.tsx | 2 +- .../start_trial_form_modal/index.tsx | 2 +- .../start_trial_form_modal.scss | 23 ----- .../modals/components/save_changes_panel.scss | 61 +++++--------- .../modals/components/save_changes_panel.tsx | 4 +- .../sass/components/_announcement-bar.scss | 22 ++--- .../src/sass/components/_buttons.scss | 2 +- .../components/src/tour_tip/tour_tip.scss | 8 -- 66 files changed, 162 insertions(+), 654 deletions(-) delete mode 100644 webapp/channels/src/components/announcement_bar/contact_sales/contact_us.scss diff --git a/e2e-tests/cypress/tests/integration/channels/enterprise/system_console/team_guest_channel_spec.js b/e2e-tests/cypress/tests/integration/channels/enterprise/system_console/team_guest_channel_spec.js index 2c56e8bf65..d14c4bebcf 100644 --- a/e2e-tests/cypress/tests/integration/channels/enterprise/system_console/team_guest_channel_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/enterprise/system_console/team_guest_channel_spec.js @@ -89,7 +89,7 @@ describe('Team Scheme Guest Permissions Test', () => { // * Ensure all checkboxes have the correct unchecked state verifyAllGuestPermissions(false); - cy.get('.cancel-button').click(); + cy.findByTestId('permission-scheme-cancel-button').should('be.visible').click(); //Clean up - Delete scheme cy.findByText(`TestScheme-${randomId}`).siblings('.actions').children('.delete-button').click().wait(TIMEOUTS.HALF_SEC); diff --git a/e2e-tests/cypress/tests/integration/channels/integrations/incoming_webhook/incoming_webhook_is_image_only_spec.js b/e2e-tests/cypress/tests/integration/channels/integrations/incoming_webhook/incoming_webhook_is_image_only_spec.js index a48e4c1c8a..5d77c0b290 100644 --- a/e2e-tests/cypress/tests/integration/channels/integrations/incoming_webhook/incoming_webhook_is_image_only_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/integrations/incoming_webhook/incoming_webhook_is_image_only_spec.js @@ -62,7 +62,7 @@ describe('Incoming webhook', () => { // * Verify that the hook ID in the URL matches with the one shown in a page // * Verify that the copy link is shown. cy.findByText(hookUrl).should('be.visible'). - parent().siblings('.fa-copy').should('be.visible'); + parent().siblings('[data-testid="copyText"]').should('be.visible'); // # Click "Done" and verify that it redirects to incoming webhooks URL cy.findByText('Done').click(); diff --git a/e2e-tests/cypress/tests/integration/channels/integrations/incoming_webhook/setup_incoming_webhook_spec.js b/e2e-tests/cypress/tests/integration/channels/integrations/incoming_webhook/setup_incoming_webhook_spec.js index 8ad451b039..eb1156f33f 100644 --- a/e2e-tests/cypress/tests/integration/channels/integrations/incoming_webhook/setup_incoming_webhook_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/integrations/incoming_webhook/setup_incoming_webhook_spec.js @@ -64,7 +64,7 @@ describe('Incoming webhook', () => { // * Verify that the hook ID in the URL matches with the one shown in a page // * Verify that the copy link is shown. cy.findByText(hookUrl).should('be.visible'). - parent().siblings('.fa-copy').should('be.visible'); + parent().siblings('[data-testid="copyText"]').should('be.visible'); // # Click "Done" and verify that it redirects to incoming webhooks URL cy.findByText('Done').click(); diff --git a/webapp/channels/src/components/actions_menu/__snapshots__/actions_menu.test.tsx.snap b/webapp/channels/src/components/actions_menu/__snapshots__/actions_menu.test.tsx.snap index 5863912c1c..ace3a145f9 100644 --- a/webapp/channels/src/components/actions_menu/__snapshots__/actions_menu.test.tsx.snap +++ b/webapp/channels/src/components/actions_menu/__snapshots__/actions_menu.test.tsx.snap @@ -182,12 +182,12 @@ exports[`components/actions_menu/ActionsMenu no actions - sysadmin - menu should className="visit-marketplace" > diff --git a/webapp/channels/src/components/admin_console/ip_filtering/add_edit_ip_filter_modal.scss b/webapp/channels/src/components/admin_console/ip_filtering/add_edit_ip_filter_modal.scss index 908f3aea11..2d53a7e728 100644 --- a/webapp/channels/src/components/admin_console/ip_filtering/add_edit_ip_filter_modal.scss +++ b/webapp/channels/src/components/admin_console/ip_filtering/add_edit_ip_filter_modal.scss @@ -140,29 +140,6 @@ .buttons { margin-top: 32px; text-align: right; - - .confirm-btn { - &:hover, - &:active, - &:focus, - &:active:focus { - background: - linear-gradient(0deg, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0.16)), - var(--button-bg); - } - - height: 40px; - flex: none; - padding: 12px 20px; - border: none; - border-radius: 4px; - margin-left: 8px; - background: var(--button-bg); - color: var(--sys-button-color); - font-size: 14px; - font-weight: 600; - line-height: 14px; - } } } @@ -175,28 +152,5 @@ font-style: normal; font-weight: 600; line-height: 20px; - - .btn-cancel { - padding: 10px 20px; - border: none; - border-radius: 4px; - background: var(--button-bg-8, rgba(28, 88, 217, 0.08)); - color: var(--button-bg, #1c58d9); - } - - .btn-save { - &:disabled { - background: rgba(63, 67, 80, 0.08); - color: rgba(63, 67, 80, 0.32); - cursor: not-allowed; - } - - padding: 10px 20px; - border: none; - border-radius: 4px; - margin-left: 8px; - background: var(--button-bg, #1c58d9); - color: var(--button-color, #fff); - } } } diff --git a/webapp/channels/src/components/admin_console/ip_filtering/add_edit_ip_filter_modal.tsx b/webapp/channels/src/components/admin_console/ip_filtering/add_edit_ip_filter_modal.tsx index cf5c2dbe00..e1d2b3f410 100644 --- a/webapp/channels/src/components/admin_console/ip_filtering/add_edit_ip_filter_modal.tsx +++ b/webapp/channels/src/components/admin_console/ip_filtering/add_edit_ip_filter_modal.tsx @@ -126,7 +126,7 @@ export default function IPFilteringAddOrEditModal({onExited, onSave, existingRan diff --git a/webapp/channels/src/components/announcement_bar/notification_permission_bar/__snapshots__/index.test.tsx.snap b/webapp/channels/src/components/announcement_bar/notification_permission_bar/__snapshots__/index.test.tsx.snap index 1724b7476c..4d57b8c32f 100644 --- a/webapp/channels/src/components/announcement_bar/notification_permission_bar/__snapshots__/index.test.tsx.snap +++ b/webapp/channels/src/components/announcement_bar/notification_permission_bar/__snapshots__/index.test.tsx.snap @@ -14,7 +14,9 @@ exports[`NotificationPermissionBar should render the NotificationPermissionNever We need your permission to show notifications in the browser. - @@ -42,7 +44,9 @@ exports[`NotificationPermissionBar should render the NotificationUnsupportedBar Your browser does not support browser notifications. - diff --git a/webapp/channels/src/components/announcement_bar/purchase_link/purchase_link.scss b/webapp/channels/src/components/announcement_bar/purchase_link/purchase_link.scss index 6ee247cce4..ecc0cdafb6 100644 --- a/webapp/channels/src/components/announcement_bar/purchase_link/purchase_link.scss +++ b/webapp/channels/src/components/announcement_bar/purchase_link/purchase_link.scss @@ -2,16 +2,5 @@ .annnouncementBar__purchaseNow { display: block; - padding: 12px 20px; - border: none; - border-radius: 4px; margin-top: 15px; - background: var(--sys-button-bg); - color: var(--sys-button-color); - - span { - font-size: 14px; - font-weight: 600; - line-height: 14px; - } } diff --git a/webapp/channels/src/components/announcement_bar/purchase_link/purchase_link.tsx b/webapp/channels/src/components/announcement_bar/purchase_link/purchase_link.tsx index 10b40b135a..f946416b88 100644 --- a/webapp/channels/src/components/announcement_bar/purchase_link/purchase_link.tsx +++ b/webapp/channels/src/components/announcement_bar/purchase_link/purchase_link.tsx @@ -27,7 +27,7 @@ const PurchaseLink: React.FC = (props: Props) => { return (