From d35a927cf430538cc0c485a9b107e60763b5c48b Mon Sep 17 00:00:00 2001 From: Volodymyr Makukha Date: Fri, 13 Sep 2024 15:24:08 +0100 Subject: [PATCH 1/3] refactor(hosting-server-settings): move to the right place, rename and a bit clean up --- .../scheduled-updates-gate/index.tsx | 2 +- .../overview/components/hosting-overview.tsx | 2 +- client/hosting/overview/controller.tsx | 4 +- client/hosting/overview/index.tsx | 2 +- .../edge-cache-loading-placeholder.tsx | 0 .../server-settings}/cache-card/index.js | 0 .../server-settings}/cache-card/test/index.js | 0 .../server-settings}/controller.js | 0 .../github-deployments-card.tsx | 0 .../hosting-activate-status.tsx | 0 .../server-settings}/hosting-activate.js | 0 .../hosting-upsell-nudge/icons/icon-cloud.svg | 0 .../icons/icon-comments.svg | 0 .../icons/icon-database.svg | 0 .../icons/icon-server-racks.svg | 0 .../hosting-upsell-nudge/icons/icon-ssh.svg | 0 .../icons/icon-terminal.svg | 0 .../hosting-upsell-nudge/index.tsx | 0 .../hosting-upsell-nudge/style.scss | 0 .../server-settings}/index.js | 2 + .../server-settings}/main.js | 17 +++-- .../server-settings}/phpmyadmin-card/index.js | 0 .../phpmyadmin-card/restore-db-password.js | 0 .../phpmyadmin-card/style.scss | 0 .../restore-plan-software-card/index.js | 0 .../server-settings}/sftp-card/index.js | 0 .../sftp-card-loading-placeholder.tsx | 0 .../sftp-card/ssh-key-card.tsx | 0 .../server-settings}/sftp-card/ssh-keys.scss | 0 .../server-settings}/sftp-card/ssh-keys.tsx | 0 .../server-settings}/sftp-card/test/index.js | 0 .../sftp-card/use-atomic-ssh-keys.ts | 0 .../sftp-card/use-attach-ssh-key.ts | 0 .../sftp-card/use-detach-ssh-key.ts | 0 .../server-settings}/style.scss | 72 +++++++------------ .../server-settings}/support-card/index.js | 0 .../server-settings}/support-card/style.scss | 0 .../test/hosting-activate-status.jsx | 0 .../server-settings}/test/index.js | 0 .../web-server-settings-card/index.tsx | 0 .../web-server-settings-card/style.scss | 0 client/hosting/staging-site/index.tsx | 2 +- .../use-update-ssh-key-mutation.ts | 2 +- .../components/page-shell/index.tsx | 2 +- .../my-sites/plugins/plugin-upload/index.jsx | 2 +- .../plugins/plugins-discovery-page/index.jsx | 2 +- client/my-sites/themes/theme-upload/index.jsx | 2 +- .../components/wpcom-smp-commands.tsx | 2 +- 48 files changed, 47 insertions(+), 68 deletions(-) rename client/{my-sites/hosting => hosting/server-settings}/cache-card/edge-cache-loading-placeholder.tsx (100%) rename client/{my-sites/hosting => hosting/server-settings}/cache-card/index.js (100%) rename client/{my-sites/hosting => hosting/server-settings}/cache-card/test/index.js (100%) rename client/{my-sites/hosting => hosting/server-settings}/controller.js (100%) rename client/{my-sites/hosting => hosting/server-settings}/github-deployments-card.tsx (100%) rename client/{my-sites/hosting => hosting/server-settings}/hosting-activate-status.tsx (100%) rename client/{my-sites/hosting => hosting/server-settings}/hosting-activate.js (100%) rename client/{my-sites/hosting => hosting/server-settings}/hosting-upsell-nudge/icons/icon-cloud.svg (100%) rename client/{my-sites/hosting => hosting/server-settings}/hosting-upsell-nudge/icons/icon-comments.svg (100%) rename client/{my-sites/hosting => hosting/server-settings}/hosting-upsell-nudge/icons/icon-database.svg (100%) rename client/{my-sites/hosting => hosting/server-settings}/hosting-upsell-nudge/icons/icon-server-racks.svg (100%) rename client/{my-sites/hosting => hosting/server-settings}/hosting-upsell-nudge/icons/icon-ssh.svg (100%) rename client/{my-sites/hosting => hosting/server-settings}/hosting-upsell-nudge/icons/icon-terminal.svg (100%) rename client/{my-sites/hosting => hosting/server-settings}/hosting-upsell-nudge/index.tsx (100%) rename client/{my-sites/hosting => hosting/server-settings}/hosting-upsell-nudge/style.scss (100%) rename client/{my-sites/hosting => hosting/server-settings}/index.js (88%) rename client/{my-sites/hosting => hosting/server-settings}/main.js (94%) rename client/{my-sites/hosting => hosting/server-settings}/phpmyadmin-card/index.js (100%) rename client/{my-sites/hosting => hosting/server-settings}/phpmyadmin-card/restore-db-password.js (100%) rename client/{my-sites/hosting => hosting/server-settings}/phpmyadmin-card/style.scss (100%) rename client/{my-sites/hosting => hosting/server-settings}/restore-plan-software-card/index.js (100%) rename client/{my-sites/hosting => hosting/server-settings}/sftp-card/index.js (100%) rename client/{my-sites/hosting => hosting/server-settings}/sftp-card/sftp-card-loading-placeholder.tsx (100%) rename client/{my-sites/hosting => hosting/server-settings}/sftp-card/ssh-key-card.tsx (100%) rename client/{my-sites/hosting => hosting/server-settings}/sftp-card/ssh-keys.scss (100%) rename client/{my-sites/hosting => hosting/server-settings}/sftp-card/ssh-keys.tsx (100%) rename client/{my-sites/hosting => hosting/server-settings}/sftp-card/test/index.js (100%) rename client/{my-sites/hosting => hosting/server-settings}/sftp-card/use-atomic-ssh-keys.ts (100%) rename client/{my-sites/hosting => hosting/server-settings}/sftp-card/use-attach-ssh-key.ts (100%) rename client/{my-sites/hosting => hosting/server-settings}/sftp-card/use-detach-ssh-key.ts (100%) rename client/{my-sites/hosting => hosting/server-settings}/style.scss (75%) rename client/{my-sites/hosting => hosting/server-settings}/support-card/index.js (100%) rename client/{my-sites/hosting => hosting/server-settings}/support-card/style.scss (100%) rename client/{my-sites/hosting => hosting/server-settings}/test/hosting-activate-status.jsx (100%) rename client/{my-sites/hosting => hosting/server-settings}/test/index.js (100%) rename client/{my-sites/hosting => hosting/server-settings}/web-server-settings-card/index.tsx (100%) rename client/{my-sites/hosting => hosting/server-settings}/web-server-settings-card/style.scss (100%) diff --git a/client/components/scheduled-updates/scheduled-updates-gate/index.tsx b/client/components/scheduled-updates/scheduled-updates-gate/index.tsx index fd8a21a5fd648..6dcdf175bb51b 100644 --- a/client/components/scheduled-updates/scheduled-updates-gate/index.tsx +++ b/client/components/scheduled-updates/scheduled-updates-gate/index.tsx @@ -3,7 +3,7 @@ import { FC, ReactNode, FocusEvent, useState } from 'react'; import { useIsEligibleForFeature } from 'calypso/blocks/plugins-scheduled-updates/hooks/use-is-eligible-for-feature'; import Notice from 'calypso/components/notice'; import NoticeAction from 'calypso/components/notice/notice-action'; -import HostingActivateStatus from 'calypso/my-sites/hosting/hosting-activate-status'; +import HostingActivateStatus from 'calypso/hosting/server-settings/hosting-activate-status'; import { useDispatch, useSelector } from 'calypso/state'; import { transferInProgress } from 'calypso/state/automated-transfer/constants'; import { getAutomatedTransferStatus } from 'calypso/state/automated-transfer/selectors'; diff --git a/client/hosting/overview/components/hosting-overview.tsx b/client/hosting/overview/components/hosting-overview.tsx index dfff259178499..59721e475d6b4 100644 --- a/client/hosting/overview/components/hosting-overview.tsx +++ b/client/hosting/overview/components/hosting-overview.tsx @@ -5,7 +5,7 @@ import ActiveDomainsCard from 'calypso/hosting/overview/components/active-domain import PlanCard from 'calypso/hosting/overview/components/plan-card'; import QuickActionsCard from 'calypso/hosting/overview/components/quick-actions-card'; import SiteBackupCard from 'calypso/hosting/overview/components/site-backup-card'; -import SupportCard from 'calypso/my-sites/hosting/support-card'; +import SupportCard from 'calypso/hosting/server-settings/support-card'; import { isNotAtomicJetpack } from 'calypso/sites-dashboard/utils'; import { useSelector } from 'calypso/state'; import { getSelectedSite } from 'calypso/state/ui/selectors'; diff --git a/client/hosting/overview/controller.tsx b/client/hosting/overview/controller.tsx index 118bdf756abfe..d00e73d8344f9 100644 --- a/client/hosting/overview/controller.tsx +++ b/client/hosting/overview/controller.tsx @@ -1,7 +1,7 @@ import { Context as PageJSContext } from '@automattic/calypso-router'; import HostingOverview from 'calypso/hosting/overview/components/hosting-overview'; -import HostingActivate from 'calypso/my-sites/hosting/hosting-activate'; -import Hosting from 'calypso/my-sites/hosting/main'; +import HostingActivate from 'calypso/hosting/server-settings/hosting-activate'; +import Hosting from 'calypso/hosting/server-settings/main'; export function hostingOverview( context: PageJSContext, next: () => void ) { context.primary = ; diff --git a/client/hosting/overview/index.tsx b/client/hosting/overview/index.tsx index 50a971134d23d..90f113c93c3c8 100644 --- a/client/hosting/overview/index.tsx +++ b/client/hosting/overview/index.tsx @@ -7,13 +7,13 @@ import { redirectIfP2, redirectIfJetpackNonAtomic, } from 'calypso/controller'; +import { handleHostingPanelRedirect } from 'calypso/hosting/server-settings/controller'; import { DOTCOM_HOSTING_CONFIG, DOTCOM_OVERVIEW, } from 'calypso/hosting/sites/components/site-preview-pane/constants'; import { siteDashboard } from 'calypso/hosting/sites/controller'; import { navigation, siteSelection, sites } from 'calypso/my-sites/controller'; -import { handleHostingPanelRedirect } from 'calypso/my-sites/hosting/controller'; import { hostingOverview, hostingConfiguration, hostingActivate } from './controller'; export default function () { diff --git a/client/my-sites/hosting/cache-card/edge-cache-loading-placeholder.tsx b/client/hosting/server-settings/cache-card/edge-cache-loading-placeholder.tsx similarity index 100% rename from client/my-sites/hosting/cache-card/edge-cache-loading-placeholder.tsx rename to client/hosting/server-settings/cache-card/edge-cache-loading-placeholder.tsx diff --git a/client/my-sites/hosting/cache-card/index.js b/client/hosting/server-settings/cache-card/index.js similarity index 100% rename from client/my-sites/hosting/cache-card/index.js rename to client/hosting/server-settings/cache-card/index.js diff --git a/client/my-sites/hosting/cache-card/test/index.js b/client/hosting/server-settings/cache-card/test/index.js similarity index 100% rename from client/my-sites/hosting/cache-card/test/index.js rename to client/hosting/server-settings/cache-card/test/index.js diff --git a/client/my-sites/hosting/controller.js b/client/hosting/server-settings/controller.js similarity index 100% rename from client/my-sites/hosting/controller.js rename to client/hosting/server-settings/controller.js diff --git a/client/my-sites/hosting/github-deployments-card.tsx b/client/hosting/server-settings/github-deployments-card.tsx similarity index 100% rename from client/my-sites/hosting/github-deployments-card.tsx rename to client/hosting/server-settings/github-deployments-card.tsx diff --git a/client/my-sites/hosting/hosting-activate-status.tsx b/client/hosting/server-settings/hosting-activate-status.tsx similarity index 100% rename from client/my-sites/hosting/hosting-activate-status.tsx rename to client/hosting/server-settings/hosting-activate-status.tsx diff --git a/client/my-sites/hosting/hosting-activate.js b/client/hosting/server-settings/hosting-activate.js similarity index 100% rename from client/my-sites/hosting/hosting-activate.js rename to client/hosting/server-settings/hosting-activate.js diff --git a/client/my-sites/hosting/hosting-upsell-nudge/icons/icon-cloud.svg b/client/hosting/server-settings/hosting-upsell-nudge/icons/icon-cloud.svg similarity index 100% rename from client/my-sites/hosting/hosting-upsell-nudge/icons/icon-cloud.svg rename to client/hosting/server-settings/hosting-upsell-nudge/icons/icon-cloud.svg diff --git a/client/my-sites/hosting/hosting-upsell-nudge/icons/icon-comments.svg b/client/hosting/server-settings/hosting-upsell-nudge/icons/icon-comments.svg similarity index 100% rename from client/my-sites/hosting/hosting-upsell-nudge/icons/icon-comments.svg rename to client/hosting/server-settings/hosting-upsell-nudge/icons/icon-comments.svg diff --git a/client/my-sites/hosting/hosting-upsell-nudge/icons/icon-database.svg b/client/hosting/server-settings/hosting-upsell-nudge/icons/icon-database.svg similarity index 100% rename from client/my-sites/hosting/hosting-upsell-nudge/icons/icon-database.svg rename to client/hosting/server-settings/hosting-upsell-nudge/icons/icon-database.svg diff --git a/client/my-sites/hosting/hosting-upsell-nudge/icons/icon-server-racks.svg b/client/hosting/server-settings/hosting-upsell-nudge/icons/icon-server-racks.svg similarity index 100% rename from client/my-sites/hosting/hosting-upsell-nudge/icons/icon-server-racks.svg rename to client/hosting/server-settings/hosting-upsell-nudge/icons/icon-server-racks.svg diff --git a/client/my-sites/hosting/hosting-upsell-nudge/icons/icon-ssh.svg b/client/hosting/server-settings/hosting-upsell-nudge/icons/icon-ssh.svg similarity index 100% rename from client/my-sites/hosting/hosting-upsell-nudge/icons/icon-ssh.svg rename to client/hosting/server-settings/hosting-upsell-nudge/icons/icon-ssh.svg diff --git a/client/my-sites/hosting/hosting-upsell-nudge/icons/icon-terminal.svg b/client/hosting/server-settings/hosting-upsell-nudge/icons/icon-terminal.svg similarity index 100% rename from client/my-sites/hosting/hosting-upsell-nudge/icons/icon-terminal.svg rename to client/hosting/server-settings/hosting-upsell-nudge/icons/icon-terminal.svg diff --git a/client/my-sites/hosting/hosting-upsell-nudge/index.tsx b/client/hosting/server-settings/hosting-upsell-nudge/index.tsx similarity index 100% rename from client/my-sites/hosting/hosting-upsell-nudge/index.tsx rename to client/hosting/server-settings/hosting-upsell-nudge/index.tsx diff --git a/client/my-sites/hosting/hosting-upsell-nudge/style.scss b/client/hosting/server-settings/hosting-upsell-nudge/style.scss similarity index 100% rename from client/my-sites/hosting/hosting-upsell-nudge/style.scss rename to client/hosting/server-settings/hosting-upsell-nudge/style.scss diff --git a/client/my-sites/hosting/index.js b/client/hosting/server-settings/index.js similarity index 88% rename from client/my-sites/hosting/index.js rename to client/hosting/server-settings/index.js index 851c0db67915a..55a023ba4e6f4 100644 --- a/client/my-sites/hosting/index.js +++ b/client/hosting/server-settings/index.js @@ -7,6 +7,8 @@ import { import { navigation, siteSelection, sites } from 'calypso/my-sites/controller'; import { handleHostingPanelRedirect, layout, activationLayout } from './controller'; +// TODO: remove this old unused code +// Details - https://a8c.slack.com/archives/C06DN6QQVAQ/p1726157495064039 export default function () { page( '/hosting-config', siteSelection, sites, makeLayout, clientRender ); page( diff --git a/client/my-sites/hosting/main.js b/client/hosting/server-settings/main.js similarity index 94% rename from client/my-sites/hosting/main.js rename to client/hosting/server-settings/main.js index 3c64df5032818..5df504d9649b7 100644 --- a/client/my-sites/hosting/main.js +++ b/client/hosting/server-settings/main.js @@ -20,7 +20,10 @@ import NoticeAction from 'calypso/components/notice/notice-action'; import { ScrollToAnchorOnMount } from 'calypso/components/scroll-to-anchor-on-mount'; import PageViewTracker from 'calypso/lib/analytics/page-view-tracker'; import TrackComponentView from 'calypso/lib/analytics/track-component-view'; +import { TrialAcknowledgeModal } from 'calypso/my-sites/plans/trials/trial-acknowledge/acknowlege-modal'; +import { WithOnclickTrialRequest } from 'calypso/my-sites/plans/trials/trial-acknowledge/with-onclick-trial-request'; import TrialBanner from 'calypso/my-sites/plans/trials/trial-banner'; +import SiteAdminInterface from 'calypso/my-sites/site-settings/site-admin-interface'; import { recordTracksEvent } from 'calypso/state/analytics/actions'; import { fetchAutomatedTransferStatus } from 'calypso/state/automated-transfer/actions'; import { transferStates } from 'calypso/state/automated-transfer/constants'; @@ -39,9 +42,6 @@ import { getSelectedSiteId, getSelectedSiteSlug, } from 'calypso/state/ui/selectors'; -import { TrialAcknowledgeModal } from '../plans/trials/trial-acknowledge/acknowlege-modal'; -import { WithOnclickTrialRequest } from '../plans/trials/trial-acknowledge/with-onclick-trial-request'; -import SiteAdminInterface from '../site-settings/site-admin-interface'; import CacheCard from './cache-card'; import HostingActivateStatus from './hosting-activate-status'; import { HostingUpsellNudge } from './hosting-upsell-nudge'; @@ -119,7 +119,7 @@ const AllCards = ( { isAdvancedHostingDisabled, isBasicHostingDisabled, siteId, return ; }; -const Hosting = ( props ) => { +const ServerSettings = ( props ) => { const { clickActivate, isECommerceTrial, @@ -222,7 +222,7 @@ const Hosting = ( props ) => { { isSiteAtomic && } { isJetpack && } - + { const banner = shouldShowUpgradeBanner ? getUpgradeBanner() : getAtomicActivationNotice(); return ( -
+
{ ! isLoadingSftpData && ( { ); }; -export const clickActivate = () => - recordTracksEvent( 'calypso_hosting_configuration_activate_click' ); +const clickActivate = () => recordTracksEvent( 'calypso_hosting_configuration_activate_click' ); export default connect( ( state ) => { @@ -321,4 +320,4 @@ export default connect( fetchAutomatedTransferStatus, requestSiteById: requestSite, } -)( localize( WithOnclickTrialRequest( Hosting ) ) ); +)( localize( WithOnclickTrialRequest( ServerSettings ) ) ); diff --git a/client/my-sites/hosting/phpmyadmin-card/index.js b/client/hosting/server-settings/phpmyadmin-card/index.js similarity index 100% rename from client/my-sites/hosting/phpmyadmin-card/index.js rename to client/hosting/server-settings/phpmyadmin-card/index.js diff --git a/client/my-sites/hosting/phpmyadmin-card/restore-db-password.js b/client/hosting/server-settings/phpmyadmin-card/restore-db-password.js similarity index 100% rename from client/my-sites/hosting/phpmyadmin-card/restore-db-password.js rename to client/hosting/server-settings/phpmyadmin-card/restore-db-password.js diff --git a/client/my-sites/hosting/phpmyadmin-card/style.scss b/client/hosting/server-settings/phpmyadmin-card/style.scss similarity index 100% rename from client/my-sites/hosting/phpmyadmin-card/style.scss rename to client/hosting/server-settings/phpmyadmin-card/style.scss diff --git a/client/my-sites/hosting/restore-plan-software-card/index.js b/client/hosting/server-settings/restore-plan-software-card/index.js similarity index 100% rename from client/my-sites/hosting/restore-plan-software-card/index.js rename to client/hosting/server-settings/restore-plan-software-card/index.js diff --git a/client/my-sites/hosting/sftp-card/index.js b/client/hosting/server-settings/sftp-card/index.js similarity index 100% rename from client/my-sites/hosting/sftp-card/index.js rename to client/hosting/server-settings/sftp-card/index.js diff --git a/client/my-sites/hosting/sftp-card/sftp-card-loading-placeholder.tsx b/client/hosting/server-settings/sftp-card/sftp-card-loading-placeholder.tsx similarity index 100% rename from client/my-sites/hosting/sftp-card/sftp-card-loading-placeholder.tsx rename to client/hosting/server-settings/sftp-card/sftp-card-loading-placeholder.tsx diff --git a/client/my-sites/hosting/sftp-card/ssh-key-card.tsx b/client/hosting/server-settings/sftp-card/ssh-key-card.tsx similarity index 100% rename from client/my-sites/hosting/sftp-card/ssh-key-card.tsx rename to client/hosting/server-settings/sftp-card/ssh-key-card.tsx diff --git a/client/my-sites/hosting/sftp-card/ssh-keys.scss b/client/hosting/server-settings/sftp-card/ssh-keys.scss similarity index 100% rename from client/my-sites/hosting/sftp-card/ssh-keys.scss rename to client/hosting/server-settings/sftp-card/ssh-keys.scss diff --git a/client/my-sites/hosting/sftp-card/ssh-keys.tsx b/client/hosting/server-settings/sftp-card/ssh-keys.tsx similarity index 100% rename from client/my-sites/hosting/sftp-card/ssh-keys.tsx rename to client/hosting/server-settings/sftp-card/ssh-keys.tsx diff --git a/client/my-sites/hosting/sftp-card/test/index.js b/client/hosting/server-settings/sftp-card/test/index.js similarity index 100% rename from client/my-sites/hosting/sftp-card/test/index.js rename to client/hosting/server-settings/sftp-card/test/index.js diff --git a/client/my-sites/hosting/sftp-card/use-atomic-ssh-keys.ts b/client/hosting/server-settings/sftp-card/use-atomic-ssh-keys.ts similarity index 100% rename from client/my-sites/hosting/sftp-card/use-atomic-ssh-keys.ts rename to client/hosting/server-settings/sftp-card/use-atomic-ssh-keys.ts diff --git a/client/my-sites/hosting/sftp-card/use-attach-ssh-key.ts b/client/hosting/server-settings/sftp-card/use-attach-ssh-key.ts similarity index 100% rename from client/my-sites/hosting/sftp-card/use-attach-ssh-key.ts rename to client/hosting/server-settings/sftp-card/use-attach-ssh-key.ts diff --git a/client/my-sites/hosting/sftp-card/use-detach-ssh-key.ts b/client/hosting/server-settings/sftp-card/use-detach-ssh-key.ts similarity index 100% rename from client/my-sites/hosting/sftp-card/use-detach-ssh-key.ts rename to client/hosting/server-settings/sftp-card/use-detach-ssh-key.ts diff --git a/client/my-sites/hosting/style.scss b/client/hosting/server-settings/style.scss similarity index 75% rename from client/my-sites/hosting/style.scss rename to client/hosting/server-settings/style.scss index b89797b8afdc3..f77627bc8b1c3 100644 --- a/client/my-sites/hosting/style.scss +++ b/client/hosting/server-settings/style.scss @@ -2,17 +2,12 @@ $areas: sftp, site-backup, support, phpmyadmin, staging-site, restore-plan-software, cache, web-server-settings, admin-interface-style; -.hosting { +.page-server-settings { /* Rely on the standard spacing for the underlying elements. */ .feature-example { margin-top: 0; } - .hosting__layout .layout__column, - .hosting__layout .layout__column fieldset { - min-width: 0; - } - .hosting-card { padding-left: 22px; margin-bottom: 12px; @@ -23,57 +18,40 @@ $areas: sftp, site-backup, support, phpmyadmin, staging-site, restore-plan-softw margin-bottom: 32px; } - &--is-two-columns { - .hosting__layout { - .card { - width: 100%; - - @include breakpoint-deprecated( ">1280px" ) { - margin-bottom: 0; - min-width: 0; + .page-server-settings__layout { + .layout__column, + .layout__column fieldset { + min-width: 0; + } - fieldset { - min-width: 0; - } - } - } + .card { + width: 100%; @include breakpoint-deprecated( ">1280px" ) { - @each $area in $areas { - .#{$area}-card { - grid-area: $area; - } - } + margin-bottom: 0; + min-width: 0; - box-sizing: border-box; - display: grid; - grid-template-columns: 1fr 1fr; - grid-template-areas: - "sftp phpmyadmin" - "sftp cache" - "restore-plan-software web-server-settings" - "admin-interface-style web-server-settings"; + fieldset { + min-width: 0; + } } } - } - &:not(.hosting--is-two-columns) { @include breakpoint-deprecated( ">1280px" ) { - .hosting__layout { - gap: 0; - - .layout__column { - box-sizing: border-box; - flex-basis: 30%; - padding-left: 8px; - - &.hosting__main-layout-col { - flex-basis: 70%; - padding-left: 0; - padding-right: 8px; - } + @each $area in $areas { + .#{$area}-card { + grid-area: $area; } } + + box-sizing: border-box; + display: grid; + grid-template-columns: 1fr 1fr; + grid-template-areas: + "sftp phpmyadmin" + "sftp cache" + "restore-plan-software web-server-settings" + "admin-interface-style web-server-settings"; } } diff --git a/client/my-sites/hosting/support-card/index.js b/client/hosting/server-settings/support-card/index.js similarity index 100% rename from client/my-sites/hosting/support-card/index.js rename to client/hosting/server-settings/support-card/index.js diff --git a/client/my-sites/hosting/support-card/style.scss b/client/hosting/server-settings/support-card/style.scss similarity index 100% rename from client/my-sites/hosting/support-card/style.scss rename to client/hosting/server-settings/support-card/style.scss diff --git a/client/my-sites/hosting/test/hosting-activate-status.jsx b/client/hosting/server-settings/test/hosting-activate-status.jsx similarity index 100% rename from client/my-sites/hosting/test/hosting-activate-status.jsx rename to client/hosting/server-settings/test/hosting-activate-status.jsx diff --git a/client/my-sites/hosting/test/index.js b/client/hosting/server-settings/test/index.js similarity index 100% rename from client/my-sites/hosting/test/index.js rename to client/hosting/server-settings/test/index.js diff --git a/client/my-sites/hosting/web-server-settings-card/index.tsx b/client/hosting/server-settings/web-server-settings-card/index.tsx similarity index 100% rename from client/my-sites/hosting/web-server-settings-card/index.tsx rename to client/hosting/server-settings/web-server-settings-card/index.tsx diff --git a/client/my-sites/hosting/web-server-settings-card/style.scss b/client/hosting/server-settings/web-server-settings-card/style.scss similarity index 100% rename from client/my-sites/hosting/web-server-settings-card/style.scss rename to client/hosting/server-settings/web-server-settings-card/style.scss diff --git a/client/hosting/staging-site/index.tsx b/client/hosting/staging-site/index.tsx index 5a5ad25687c0a..11c4b3187c721 100644 --- a/client/hosting/staging-site/index.tsx +++ b/client/hosting/staging-site/index.tsx @@ -5,10 +5,10 @@ import { redirectIfCurrentUserCannot, redirectToHostingPromoIfNotAtomic, } from 'calypso/controller'; +import { handleHostingPanelRedirect } from 'calypso/hosting/server-settings/controller'; import { DOTCOM_STAGING_SITE } from 'calypso/hosting/sites/components/site-preview-pane/constants'; import { siteDashboard } from 'calypso/hosting/sites/controller'; import { navigation, siteSelection, sites } from 'calypso/my-sites/controller'; -import { handleHostingPanelRedirect } from 'calypso/my-sites/hosting/controller'; import { renderStagingSite } from './controller'; export default function () { diff --git a/client/me/security-ssh-key/use-update-ssh-key-mutation.ts b/client/me/security-ssh-key/use-update-ssh-key-mutation.ts index 9de3e24082846..fd315ed729878 100644 --- a/client/me/security-ssh-key/use-update-ssh-key-mutation.ts +++ b/client/me/security-ssh-key/use-update-ssh-key-mutation.ts @@ -1,7 +1,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'; import { useCallback } from 'react'; +import { USE_ATOMIC_SSH_KEYS_QUERY_KEY } from 'calypso/hosting/server-settings/sftp-card/use-atomic-ssh-keys'; import wp from 'calypso/lib/wp'; -import { USE_ATOMIC_SSH_KEYS_QUERY_KEY } from 'calypso/my-sites/hosting/sftp-card/use-atomic-ssh-keys'; import { SSH_KEY_QUERY_KEY } from './use-ssh-key-query'; interface MutationVariables { diff --git a/client/my-sites/github-deployments/components/page-shell/index.tsx b/client/my-sites/github-deployments/components/page-shell/index.tsx index f86e6785c766f..5b107b08c64d8 100644 --- a/client/my-sites/github-deployments/components/page-shell/index.tsx +++ b/client/my-sites/github-deployments/components/page-shell/index.tsx @@ -7,7 +7,7 @@ import Main from 'calypso/components/main'; import NavigationHeader from 'calypso/components/navigation-header'; import Notice from 'calypso/components/notice'; import NoticeAction from 'calypso/components/notice/notice-action'; -import HostingActivateStatus from 'calypso/my-sites/hosting/hosting-activate-status'; +import HostingActivateStatus from 'calypso/hosting/server-settings/hosting-activate-status'; import { useDispatch, useSelector } from 'calypso/state'; import { transferInProgress } from 'calypso/state/automated-transfer/constants'; import { getAutomatedTransferStatus } from 'calypso/state/automated-transfer/selectors'; diff --git a/client/my-sites/plugins/plugin-upload/index.jsx b/client/my-sites/plugins/plugin-upload/index.jsx index bdbd4f9bc2097..1b0a4fe352e3f 100644 --- a/client/my-sites/plugins/plugin-upload/index.jsx +++ b/client/my-sites/plugins/plugin-upload/index.jsx @@ -13,8 +13,8 @@ import FeatureExample from 'calypso/components/feature-example'; import HeaderCake from 'calypso/components/header-cake'; import Main from 'calypso/components/main'; import NavigationHeader from 'calypso/components/navigation-header'; +import HostingActivateStatus from 'calypso/hosting/server-settings/hosting-activate-status'; import PageViewTracker from 'calypso/lib/analytics/page-view-tracker'; -import HostingActivateStatus from 'calypso/my-sites/hosting/hosting-activate-status'; import { TrialAcknowledgeModal } from 'calypso/my-sites/plans/trials/trial-acknowledge/acknowlege-modal'; import { WithOnclickTrialRequest } from 'calypso/my-sites/plans/trials/trial-acknowledge/with-onclick-trial-request'; import { isHostingTrialSite } from 'calypso/sites-dashboard/utils'; diff --git a/client/my-sites/plugins/plugins-discovery-page/index.jsx b/client/my-sites/plugins/plugins-discovery-page/index.jsx index 44c1b03ba4893..6fab821ee4174 100644 --- a/client/my-sites/plugins/plugins-discovery-page/index.jsx +++ b/client/my-sites/plugins/plugins-discovery-page/index.jsx @@ -1,5 +1,5 @@ import { useSelector } from 'react-redux'; -import HostingActivateStatus from 'calypso/my-sites/hosting/hosting-activate-status'; +import HostingActivateStatus from 'calypso/hosting/server-settings/hosting-activate-status'; import { TrialAcknowledgeModal } from 'calypso/my-sites/plans/trials/trial-acknowledge/acknowlege-modal'; import { WithOnclickTrialRequest } from 'calypso/my-sites/plans/trials/trial-acknowledge/with-onclick-trial-request'; import { isCompatiblePlugin } from 'calypso/my-sites/plugins/plugin-compatibility'; diff --git a/client/my-sites/themes/theme-upload/index.jsx b/client/my-sites/themes/theme-upload/index.jsx index 6507185aaa40f..1e42231851fe7 100644 --- a/client/my-sites/themes/theme-upload/index.jsx +++ b/client/my-sites/themes/theme-upload/index.jsx @@ -27,8 +27,8 @@ import InlineSupportLink from 'calypso/components/inline-support-link'; import Main from 'calypso/components/main'; import NavigationHeader from 'calypso/components/navigation-header'; import WpAdminAutoLogin from 'calypso/components/wpadmin-auto-login'; +import HostingActivateStatus from 'calypso/hosting/server-settings/hosting-activate-status'; import PageViewTracker from 'calypso/lib/analytics/page-view-tracker'; -import HostingActivateStatus from 'calypso/my-sites/hosting/hosting-activate-status'; import { TrialAcknowledgeModal } from 'calypso/my-sites/plans/trials/trial-acknowledge/acknowlege-modal'; import { WithOnclickTrialRequest } from 'calypso/my-sites/plans/trials/trial-acknowledge/with-onclick-trial-request'; import ActivationModal from 'calypso/my-sites/themes/activation-modal'; diff --git a/client/sites-dashboard/components/wpcom-smp-commands.tsx b/client/sites-dashboard/components/wpcom-smp-commands.tsx index cc162c994904f..a29419819c5ab 100644 --- a/client/sites-dashboard/components/wpcom-smp-commands.tsx +++ b/client/sites-dashboard/components/wpcom-smp-commands.tsx @@ -9,9 +9,9 @@ import { useSetEdgeCacheMutation, purgeEdgeCache, } from 'calypso/data/hosting/use-cache'; +import { useOpenPhpMyAdmin } from 'calypso/hosting/server-settings/phpmyadmin-card'; import { navigate } from 'calypso/lib/navigate'; import wpcom from 'calypso/lib/wp'; -import { useOpenPhpMyAdmin } from 'calypso/my-sites/hosting/phpmyadmin-card'; import { useDispatch } from 'calypso/state'; import { clearWordPressCache } from 'calypso/state/hosting/actions'; import { createNotice, removeNotice } from 'calypso/state/notices/actions'; From 4b13127b5fbe6e8f820524017366622a8b3b8805 Mon Sep 17 00:00:00 2001 From: Volodymyr Makukha Date: Fri, 13 Sep 2024 15:36:15 +0100 Subject: [PATCH 2/3] chore: move cards to components folder --- .../hosting/overview/components/hosting-overview.tsx | 2 +- .../cache-card/edge-cache-loading-placeholder.tsx | 0 .../{ => components}/cache-card/index.js | 0 .../{ => components}/cache-card/test/index.js | 0 .../hosting-upsell-nudge/icons/icon-cloud.svg | 0 .../hosting-upsell-nudge/icons/icon-comments.svg | 0 .../hosting-upsell-nudge/icons/icon-database.svg | 0 .../hosting-upsell-nudge/icons/icon-server-racks.svg | 0 .../hosting-upsell-nudge/icons/icon-ssh.svg | 0 .../hosting-upsell-nudge/icons/icon-terminal.svg | 0 .../{ => components}/hosting-upsell-nudge/index.tsx | 0 .../{ => components}/hosting-upsell-nudge/style.scss | 0 .../{ => components}/phpmyadmin-card/index.js | 0 .../phpmyadmin-card/restore-db-password.js | 0 .../{ => components}/phpmyadmin-card/style.scss | 0 .../restore-plan-software-card/index.js | 0 .../{ => components}/sftp-card/index.js | 0 .../sftp-card/sftp-card-loading-placeholder.tsx | 0 .../{ => components}/sftp-card/ssh-key-card.tsx | 0 .../{ => components}/sftp-card/ssh-keys.scss | 0 .../{ => components}/sftp-card/ssh-keys.tsx | 0 .../{ => components}/sftp-card/test/index.js | 0 .../sftp-card/use-atomic-ssh-keys.ts | 0 .../{ => components}/sftp-card/use-attach-ssh-key.ts | 0 .../{ => components}/sftp-card/use-detach-ssh-key.ts | 0 .../{ => components}/support-card/index.js | 0 .../{ => components}/support-card/style.scss | 0 .../web-server-settings-card/index.tsx | 0 .../web-server-settings-card/style.scss | 0 client/hosting/server-settings/main.js | 12 ++++++------ .../security-ssh-key/use-update-ssh-key-mutation.ts | 2 +- .../components/wpcom-smp-commands.tsx | 2 +- 32 files changed, 9 insertions(+), 9 deletions(-) rename client/hosting/server-settings/{ => components}/cache-card/edge-cache-loading-placeholder.tsx (100%) rename client/hosting/server-settings/{ => components}/cache-card/index.js (100%) rename client/hosting/server-settings/{ => components}/cache-card/test/index.js (100%) rename client/hosting/server-settings/{ => components}/hosting-upsell-nudge/icons/icon-cloud.svg (100%) rename client/hosting/server-settings/{ => components}/hosting-upsell-nudge/icons/icon-comments.svg (100%) rename client/hosting/server-settings/{ => components}/hosting-upsell-nudge/icons/icon-database.svg (100%) rename client/hosting/server-settings/{ => components}/hosting-upsell-nudge/icons/icon-server-racks.svg (100%) rename client/hosting/server-settings/{ => components}/hosting-upsell-nudge/icons/icon-ssh.svg (100%) rename client/hosting/server-settings/{ => components}/hosting-upsell-nudge/icons/icon-terminal.svg (100%) rename client/hosting/server-settings/{ => components}/hosting-upsell-nudge/index.tsx (100%) rename client/hosting/server-settings/{ => components}/hosting-upsell-nudge/style.scss (100%) rename client/hosting/server-settings/{ => components}/phpmyadmin-card/index.js (100%) rename client/hosting/server-settings/{ => components}/phpmyadmin-card/restore-db-password.js (100%) rename client/hosting/server-settings/{ => components}/phpmyadmin-card/style.scss (100%) rename client/hosting/server-settings/{ => components}/restore-plan-software-card/index.js (100%) rename client/hosting/server-settings/{ => components}/sftp-card/index.js (100%) rename client/hosting/server-settings/{ => components}/sftp-card/sftp-card-loading-placeholder.tsx (100%) rename client/hosting/server-settings/{ => components}/sftp-card/ssh-key-card.tsx (100%) rename client/hosting/server-settings/{ => components}/sftp-card/ssh-keys.scss (100%) rename client/hosting/server-settings/{ => components}/sftp-card/ssh-keys.tsx (100%) rename client/hosting/server-settings/{ => components}/sftp-card/test/index.js (100%) rename client/hosting/server-settings/{ => components}/sftp-card/use-atomic-ssh-keys.ts (100%) rename client/hosting/server-settings/{ => components}/sftp-card/use-attach-ssh-key.ts (100%) rename client/hosting/server-settings/{ => components}/sftp-card/use-detach-ssh-key.ts (100%) rename client/hosting/server-settings/{ => components}/support-card/index.js (100%) rename client/hosting/server-settings/{ => components}/support-card/style.scss (100%) rename client/hosting/server-settings/{ => components}/web-server-settings-card/index.tsx (100%) rename client/hosting/server-settings/{ => components}/web-server-settings-card/style.scss (100%) diff --git a/client/hosting/overview/components/hosting-overview.tsx b/client/hosting/overview/components/hosting-overview.tsx index 59721e475d6b4..840baead5fdb9 100644 --- a/client/hosting/overview/components/hosting-overview.tsx +++ b/client/hosting/overview/components/hosting-overview.tsx @@ -5,7 +5,7 @@ import ActiveDomainsCard from 'calypso/hosting/overview/components/active-domain import PlanCard from 'calypso/hosting/overview/components/plan-card'; import QuickActionsCard from 'calypso/hosting/overview/components/quick-actions-card'; import SiteBackupCard from 'calypso/hosting/overview/components/site-backup-card'; -import SupportCard from 'calypso/hosting/server-settings/support-card'; +import SupportCard from 'calypso/hosting/server-settings/components/support-card'; import { isNotAtomicJetpack } from 'calypso/sites-dashboard/utils'; import { useSelector } from 'calypso/state'; import { getSelectedSite } from 'calypso/state/ui/selectors'; diff --git a/client/hosting/server-settings/cache-card/edge-cache-loading-placeholder.tsx b/client/hosting/server-settings/components/cache-card/edge-cache-loading-placeholder.tsx similarity index 100% rename from client/hosting/server-settings/cache-card/edge-cache-loading-placeholder.tsx rename to client/hosting/server-settings/components/cache-card/edge-cache-loading-placeholder.tsx diff --git a/client/hosting/server-settings/cache-card/index.js b/client/hosting/server-settings/components/cache-card/index.js similarity index 100% rename from client/hosting/server-settings/cache-card/index.js rename to client/hosting/server-settings/components/cache-card/index.js diff --git a/client/hosting/server-settings/cache-card/test/index.js b/client/hosting/server-settings/components/cache-card/test/index.js similarity index 100% rename from client/hosting/server-settings/cache-card/test/index.js rename to client/hosting/server-settings/components/cache-card/test/index.js diff --git a/client/hosting/server-settings/hosting-upsell-nudge/icons/icon-cloud.svg b/client/hosting/server-settings/components/hosting-upsell-nudge/icons/icon-cloud.svg similarity index 100% rename from client/hosting/server-settings/hosting-upsell-nudge/icons/icon-cloud.svg rename to client/hosting/server-settings/components/hosting-upsell-nudge/icons/icon-cloud.svg diff --git a/client/hosting/server-settings/hosting-upsell-nudge/icons/icon-comments.svg b/client/hosting/server-settings/components/hosting-upsell-nudge/icons/icon-comments.svg similarity index 100% rename from client/hosting/server-settings/hosting-upsell-nudge/icons/icon-comments.svg rename to client/hosting/server-settings/components/hosting-upsell-nudge/icons/icon-comments.svg diff --git a/client/hosting/server-settings/hosting-upsell-nudge/icons/icon-database.svg b/client/hosting/server-settings/components/hosting-upsell-nudge/icons/icon-database.svg similarity index 100% rename from client/hosting/server-settings/hosting-upsell-nudge/icons/icon-database.svg rename to client/hosting/server-settings/components/hosting-upsell-nudge/icons/icon-database.svg diff --git a/client/hosting/server-settings/hosting-upsell-nudge/icons/icon-server-racks.svg b/client/hosting/server-settings/components/hosting-upsell-nudge/icons/icon-server-racks.svg similarity index 100% rename from client/hosting/server-settings/hosting-upsell-nudge/icons/icon-server-racks.svg rename to client/hosting/server-settings/components/hosting-upsell-nudge/icons/icon-server-racks.svg diff --git a/client/hosting/server-settings/hosting-upsell-nudge/icons/icon-ssh.svg b/client/hosting/server-settings/components/hosting-upsell-nudge/icons/icon-ssh.svg similarity index 100% rename from client/hosting/server-settings/hosting-upsell-nudge/icons/icon-ssh.svg rename to client/hosting/server-settings/components/hosting-upsell-nudge/icons/icon-ssh.svg diff --git a/client/hosting/server-settings/hosting-upsell-nudge/icons/icon-terminal.svg b/client/hosting/server-settings/components/hosting-upsell-nudge/icons/icon-terminal.svg similarity index 100% rename from client/hosting/server-settings/hosting-upsell-nudge/icons/icon-terminal.svg rename to client/hosting/server-settings/components/hosting-upsell-nudge/icons/icon-terminal.svg diff --git a/client/hosting/server-settings/hosting-upsell-nudge/index.tsx b/client/hosting/server-settings/components/hosting-upsell-nudge/index.tsx similarity index 100% rename from client/hosting/server-settings/hosting-upsell-nudge/index.tsx rename to client/hosting/server-settings/components/hosting-upsell-nudge/index.tsx diff --git a/client/hosting/server-settings/hosting-upsell-nudge/style.scss b/client/hosting/server-settings/components/hosting-upsell-nudge/style.scss similarity index 100% rename from client/hosting/server-settings/hosting-upsell-nudge/style.scss rename to client/hosting/server-settings/components/hosting-upsell-nudge/style.scss diff --git a/client/hosting/server-settings/phpmyadmin-card/index.js b/client/hosting/server-settings/components/phpmyadmin-card/index.js similarity index 100% rename from client/hosting/server-settings/phpmyadmin-card/index.js rename to client/hosting/server-settings/components/phpmyadmin-card/index.js diff --git a/client/hosting/server-settings/phpmyadmin-card/restore-db-password.js b/client/hosting/server-settings/components/phpmyadmin-card/restore-db-password.js similarity index 100% rename from client/hosting/server-settings/phpmyadmin-card/restore-db-password.js rename to client/hosting/server-settings/components/phpmyadmin-card/restore-db-password.js diff --git a/client/hosting/server-settings/phpmyadmin-card/style.scss b/client/hosting/server-settings/components/phpmyadmin-card/style.scss similarity index 100% rename from client/hosting/server-settings/phpmyadmin-card/style.scss rename to client/hosting/server-settings/components/phpmyadmin-card/style.scss diff --git a/client/hosting/server-settings/restore-plan-software-card/index.js b/client/hosting/server-settings/components/restore-plan-software-card/index.js similarity index 100% rename from client/hosting/server-settings/restore-plan-software-card/index.js rename to client/hosting/server-settings/components/restore-plan-software-card/index.js diff --git a/client/hosting/server-settings/sftp-card/index.js b/client/hosting/server-settings/components/sftp-card/index.js similarity index 100% rename from client/hosting/server-settings/sftp-card/index.js rename to client/hosting/server-settings/components/sftp-card/index.js diff --git a/client/hosting/server-settings/sftp-card/sftp-card-loading-placeholder.tsx b/client/hosting/server-settings/components/sftp-card/sftp-card-loading-placeholder.tsx similarity index 100% rename from client/hosting/server-settings/sftp-card/sftp-card-loading-placeholder.tsx rename to client/hosting/server-settings/components/sftp-card/sftp-card-loading-placeholder.tsx diff --git a/client/hosting/server-settings/sftp-card/ssh-key-card.tsx b/client/hosting/server-settings/components/sftp-card/ssh-key-card.tsx similarity index 100% rename from client/hosting/server-settings/sftp-card/ssh-key-card.tsx rename to client/hosting/server-settings/components/sftp-card/ssh-key-card.tsx diff --git a/client/hosting/server-settings/sftp-card/ssh-keys.scss b/client/hosting/server-settings/components/sftp-card/ssh-keys.scss similarity index 100% rename from client/hosting/server-settings/sftp-card/ssh-keys.scss rename to client/hosting/server-settings/components/sftp-card/ssh-keys.scss diff --git a/client/hosting/server-settings/sftp-card/ssh-keys.tsx b/client/hosting/server-settings/components/sftp-card/ssh-keys.tsx similarity index 100% rename from client/hosting/server-settings/sftp-card/ssh-keys.tsx rename to client/hosting/server-settings/components/sftp-card/ssh-keys.tsx diff --git a/client/hosting/server-settings/sftp-card/test/index.js b/client/hosting/server-settings/components/sftp-card/test/index.js similarity index 100% rename from client/hosting/server-settings/sftp-card/test/index.js rename to client/hosting/server-settings/components/sftp-card/test/index.js diff --git a/client/hosting/server-settings/sftp-card/use-atomic-ssh-keys.ts b/client/hosting/server-settings/components/sftp-card/use-atomic-ssh-keys.ts similarity index 100% rename from client/hosting/server-settings/sftp-card/use-atomic-ssh-keys.ts rename to client/hosting/server-settings/components/sftp-card/use-atomic-ssh-keys.ts diff --git a/client/hosting/server-settings/sftp-card/use-attach-ssh-key.ts b/client/hosting/server-settings/components/sftp-card/use-attach-ssh-key.ts similarity index 100% rename from client/hosting/server-settings/sftp-card/use-attach-ssh-key.ts rename to client/hosting/server-settings/components/sftp-card/use-attach-ssh-key.ts diff --git a/client/hosting/server-settings/sftp-card/use-detach-ssh-key.ts b/client/hosting/server-settings/components/sftp-card/use-detach-ssh-key.ts similarity index 100% rename from client/hosting/server-settings/sftp-card/use-detach-ssh-key.ts rename to client/hosting/server-settings/components/sftp-card/use-detach-ssh-key.ts diff --git a/client/hosting/server-settings/support-card/index.js b/client/hosting/server-settings/components/support-card/index.js similarity index 100% rename from client/hosting/server-settings/support-card/index.js rename to client/hosting/server-settings/components/support-card/index.js diff --git a/client/hosting/server-settings/support-card/style.scss b/client/hosting/server-settings/components/support-card/style.scss similarity index 100% rename from client/hosting/server-settings/support-card/style.scss rename to client/hosting/server-settings/components/support-card/style.scss diff --git a/client/hosting/server-settings/web-server-settings-card/index.tsx b/client/hosting/server-settings/components/web-server-settings-card/index.tsx similarity index 100% rename from client/hosting/server-settings/web-server-settings-card/index.tsx rename to client/hosting/server-settings/components/web-server-settings-card/index.tsx diff --git a/client/hosting/server-settings/web-server-settings-card/style.scss b/client/hosting/server-settings/components/web-server-settings-card/style.scss similarity index 100% rename from client/hosting/server-settings/web-server-settings-card/style.scss rename to client/hosting/server-settings/components/web-server-settings-card/style.scss diff --git a/client/hosting/server-settings/main.js b/client/hosting/server-settings/main.js index 5df504d9649b7..5f495ce20a7c8 100644 --- a/client/hosting/server-settings/main.js +++ b/client/hosting/server-settings/main.js @@ -42,13 +42,13 @@ import { getSelectedSiteId, getSelectedSiteSlug, } from 'calypso/state/ui/selectors'; -import CacheCard from './cache-card'; +import CacheCard from './components/cache-card'; +import { HostingUpsellNudge } from './components/hosting-upsell-nudge'; +import PhpMyAdminCard from './components/phpmyadmin-card'; +import RestorePlanSoftwareCard from './components/restore-plan-software-card'; +import SFTPCard from './components/sftp-card'; +import WebServerSettingsCard from './components/web-server-settings-card'; import HostingActivateStatus from './hosting-activate-status'; -import { HostingUpsellNudge } from './hosting-upsell-nudge'; -import PhpMyAdminCard from './phpmyadmin-card'; -import RestorePlanSoftwareCard from './restore-plan-software-card'; -import SFTPCard from './sftp-card'; -import WebServerSettingsCard from './web-server-settings-card'; import './style.scss'; const HEADING_OFFSET = 30; diff --git a/client/me/security-ssh-key/use-update-ssh-key-mutation.ts b/client/me/security-ssh-key/use-update-ssh-key-mutation.ts index fd315ed729878..449dde29cd0a4 100644 --- a/client/me/security-ssh-key/use-update-ssh-key-mutation.ts +++ b/client/me/security-ssh-key/use-update-ssh-key-mutation.ts @@ -1,6 +1,6 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'; import { useCallback } from 'react'; -import { USE_ATOMIC_SSH_KEYS_QUERY_KEY } from 'calypso/hosting/server-settings/sftp-card/use-atomic-ssh-keys'; +import { USE_ATOMIC_SSH_KEYS_QUERY_KEY } from 'calypso/hosting/server-settings/components/sftp-card/use-atomic-ssh-keys'; import wp from 'calypso/lib/wp'; import { SSH_KEY_QUERY_KEY } from './use-ssh-key-query'; diff --git a/client/sites-dashboard/components/wpcom-smp-commands.tsx b/client/sites-dashboard/components/wpcom-smp-commands.tsx index a29419819c5ab..b9918b3b60c1a 100644 --- a/client/sites-dashboard/components/wpcom-smp-commands.tsx +++ b/client/sites-dashboard/components/wpcom-smp-commands.tsx @@ -9,7 +9,7 @@ import { useSetEdgeCacheMutation, purgeEdgeCache, } from 'calypso/data/hosting/use-cache'; -import { useOpenPhpMyAdmin } from 'calypso/hosting/server-settings/phpmyadmin-card'; +import { useOpenPhpMyAdmin } from 'calypso/hosting/server-settings/components/phpmyadmin-card'; import { navigate } from 'calypso/lib/navigate'; import wpcom from 'calypso/lib/wp'; import { useDispatch } from 'calypso/state'; From bdf656eb33473cdba5cd333376c8d0f7537a5c3c Mon Sep 17 00:00:00 2001 From: Volodymyr Makukha Date: Fri, 13 Sep 2024 15:50:54 +0100 Subject: [PATCH 3/3] chore: move cards and remove unused code --- .../overview/components/hosting-overview.tsx | 2 +- .../components/support-card/index.js | 0 .../components/support-card/style.scss | 0 .../github-deployments-card.tsx | 31 ------------------- client/hosting/server-settings/style.scss | 12 +------ 5 files changed, 2 insertions(+), 43 deletions(-) rename client/hosting/{server-settings => overview}/components/support-card/index.js (100%) rename client/hosting/{server-settings => overview}/components/support-card/style.scss (100%) delete mode 100644 client/hosting/server-settings/github-deployments-card.tsx diff --git a/client/hosting/overview/components/hosting-overview.tsx b/client/hosting/overview/components/hosting-overview.tsx index 840baead5fdb9..b936b83b2b8ca 100644 --- a/client/hosting/overview/components/hosting-overview.tsx +++ b/client/hosting/overview/components/hosting-overview.tsx @@ -5,10 +5,10 @@ import ActiveDomainsCard from 'calypso/hosting/overview/components/active-domain import PlanCard from 'calypso/hosting/overview/components/plan-card'; import QuickActionsCard from 'calypso/hosting/overview/components/quick-actions-card'; import SiteBackupCard from 'calypso/hosting/overview/components/site-backup-card'; -import SupportCard from 'calypso/hosting/server-settings/components/support-card'; import { isNotAtomicJetpack } from 'calypso/sites-dashboard/utils'; import { useSelector } from 'calypso/state'; import { getSelectedSite } from 'calypso/state/ui/selectors'; +import SupportCard from './support-card'; import './style.scss'; diff --git a/client/hosting/server-settings/components/support-card/index.js b/client/hosting/overview/components/support-card/index.js similarity index 100% rename from client/hosting/server-settings/components/support-card/index.js rename to client/hosting/overview/components/support-card/index.js diff --git a/client/hosting/server-settings/components/support-card/style.scss b/client/hosting/overview/components/support-card/style.scss similarity index 100% rename from client/hosting/server-settings/components/support-card/style.scss rename to client/hosting/overview/components/support-card/style.scss diff --git a/client/hosting/server-settings/github-deployments-card.tsx b/client/hosting/server-settings/github-deployments-card.tsx deleted file mode 100644 index 0666252baadc7..0000000000000 --- a/client/hosting/server-settings/github-deployments-card.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import { useI18n } from '@wordpress/react-i18n'; -import { useDispatch } from 'react-redux'; -import { useSelector } from 'calypso/state'; -import { recordTracksEvent } from 'calypso/state/analytics/actions'; -import { getSelectedSiteSlug } from 'calypso/state/ui/selectors'; -import Banner from '../../components/banner'; -import SocialLogo from '../../components/social-logo'; -import { indexPage } from '../github-deployments/routes'; - -export const GitHubDeploymentsCard = () => { - const { __ } = useI18n(); - const dispatch = useDispatch(); - const siteSlug = useSelector( getSelectedSiteSlug ); - - return ( - } - disableCircle - callToAction={ __( 'Get started' ) } - href={ indexPage( siteSlug! ) } - title={ __( 'GitHub Deployments' ) } - onClick={ () => { - dispatch( recordTracksEvent( 'calypso_hosting_github_nudge_clicked' ) ); - } } - description={ __( - 'Effortlessly deploy themes, plugins, or your entire site directly from GitHub!' - ) } - /> - ); -}; diff --git a/client/hosting/server-settings/style.scss b/client/hosting/server-settings/style.scss index f77627bc8b1c3..ba7d01235c689 100644 --- a/client/hosting/server-settings/style.scss +++ b/client/hosting/server-settings/style.scss @@ -117,7 +117,7 @@ $areas: sftp, site-backup, support, phpmyadmin, staging-site, restore-plan-softw } &__main-layout-col { - .card:not(.github-deployments-card) { + .card { padding-left: 72px; > .card-icon, @@ -145,16 +145,6 @@ $areas: sftp, site-backup, support, phpmyadmin, staging-site, restore-plan-softw margin-right: auto; } - .github-deployments-card { - .banner__icons .banner__icon-no-circle { - margin-right: 13px; - } - - .banner__action { - margin-right: 0; - } - } - .happiness-engineers-tray { align-items: flex-start; display: flex;