Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion client/dashboard/domains/dataviews/actions.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { DomainSubtype } from '@automattic/api-core';
import { userPurchasesQuery, siteSetPrimaryDomainMutation } from '@automattic/api-queries';
import config from '@automattic/calypso-config';
import { isFreeUrlDomainName } from '@automattic/domains-table/src/utils/is-free-url-domain-name';
import { useQuery, useMutation } from '@tanstack/react-query';
import { useRouter } from '@tanstack/react-router';
Expand All @@ -12,6 +13,7 @@ import {
domainDnsRoute,
domainContactInfoRoute,
domainConnectionSetupRoute,
domainTransferSetupRoute,
domainTransferToAnyUserRoute,
domainTransferToOtherSiteRoute,
domainsContactInfoRoute,
Expand Down Expand Up @@ -99,8 +101,16 @@ export const useActions = ( { user, sites }: { user: User; sites?: Site[] } ) =>
callback: ( items: DomainSummary[] ) => {
const domain = items[ 0 ];

const targetRoute =
domain.subtype.id === DomainSubtype.DOMAIN_TRANSFER &&
// TODO: When DOMAINS-1802 is completed, we should check if the domain has the `pending_registry` status
// and send the user to the `/v2/domains/<domain_name>/transfer` URL instead of the `domain-transfer-setup` URL
config.isEnabled( 'domain-transfer-redesign' )
? domainTransferSetupRoute
: domainOverviewRoute;

router.navigate( {
to: domainOverviewRoute.fullPath,
to: targetRoute.fullPath,
params: {
domainName: domain.domain,
},
Expand Down
13 changes: 11 additions & 2 deletions client/dashboard/domains/dataviews/field-domain-name.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { DomainSubtype } from '@automattic/api-core';
import config from '@automattic/calypso-config';
import { Link } from '@tanstack/react-router';
import { __experimentalVStack as VStack } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { domainOverviewRoute } from '../../app/router/domains';
import { domainOverviewRoute, domainTransferSetupRoute } from '../../app/router/domains';
import { Text } from '../../components/text';
import { textOverflowStyles } from './utils';
import type { DomainSummary, Site } from '@automattic/api-core';
Expand All @@ -20,9 +21,17 @@ export const DomainNameField = ( {
} ) => {
const siteSlug = site?.slug ?? domain.site_slug;

const href =
domain.subtype.id === DomainSubtype.DOMAIN_TRANSFER &&
// TODO: When DOMAINS-1802 is completed, we should check if the domain has the `pending_registry` status
// and send the user to the `/v2/domains/<domain_name>/transfer` URL instead of the `domain-transfer-setup` URL
config.isEnabled( 'domain-transfer-redesign' )
? domainTransferSetupRoute.fullPath
: domainOverviewRoute.fullPath;

return (
<Link
to={ domainOverviewRoute.fullPath }
to={ href }
params={ { siteSlug, domainName: domain.domain } }
disabled={ ! domain.subscription_id }
>
Expand Down