-
Notifications
You must be signed in to change notification settings - Fork 2k
Dashboard v2: Add the ability to delete a site #103764
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Jetpack Cloud live (direct link)
Automattic for Agencies live (direct link)
|
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: App Entrypoints (~123 bytes added 📈 [gzipped])
Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used. Sections (~220 bytes added 📈 [gzipped])
Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Generated by performance advisor bot at iscalypsofastyet.com. |
This PR modifies the release build for the following Calypso Apps: For info about this notification, see here: PCYsg-OT6-p2
To test WordPress.com changes, run |
12b2ca0
to
0c29ed3
Compare
export default function DangerZone( { site }: { site: Site } ) { | ||
const canTransferSite = useCanTransferSite( { site } ); | ||
|
||
const actions = [ | ||
canTransferSite && <SiteTransferAction key="transfer-site" site={ site } />, | ||
<SiteLeaveAction key="leave-site" site={ site } />, | ||
showSiteDeleteAction( site ) && <SiteDeleteAction key="delete-site" site={ site } />, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it be canDeleteSite( site )
from site-delete-modal
; why do we have two different checks 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the staging site, we don't show the "Delete site" on the Settings screen. Instead, you should go to the production site to manage your staging site. As a result, we need this to determine whether to show the action
}; | ||
|
||
const canDeleteSite = ( site: Site ) => | ||
( site.is_wpcom_atomic || ! site.jetpack ) && ! site.is_vip && ! site.options?.p2_hub_blog_id; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know it's existing code but I wonder what || ! site.jetpack
is doing here. Seems not used in other logic in dashboard v2...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's self-hosted jetpack sites and we cannot delete those sites on our end.
}; | ||
|
||
return ( | ||
<Modal title={ __( 'Delete site' ) } size="medium" onRequestClose={ onClose }> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't create new modals in #103723 because I thought maybe we could get transitions added to the modal, and we would have this multiple pop-up experience where the user has to watch it close and reopen. Maybe that's a conspiracy that I don't need to think about.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done by 137245e.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
137245e
to
3f83570
Compare
3f83570
to
17dfb93
Compare
This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/17524451 Some locales (Hebrew, Japanese) have been temporarily machine-translated due to translator availability. All other translations are usually ready within a few days. Untranslated and machine-translated strings will be sent for translation next Monday and are expected to be completed by the following Friday. Thank you @arthur791004 for including a screenshot in the description! This is really helpful for our translators. |
Part of DOTCOM-13249
Proposed Changes
This PR implements the option to delete a site via the modal component SiteDeleteModal. The action is visible if the site is not a staging site.
The SiteDeleteModal has following states:
Why are these changes being made?
Testing Instructions
Pre-merge Checklist