Skip to content

Commit

Permalink
Allowing a8n to click at the disabled site
Browse files Browse the repository at this point in the history
  • Loading branch information
paulopmt1 committed Jun 20, 2024
1 parent 59e037d commit 966354a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ import SiteActions from 'calypso/jetpack-cloud/sections/agency-dashboard/sites-o
import SiteStatusContent from 'calypso/jetpack-cloud/sections/agency-dashboard/sites-overview/site-status-content';
import { JETPACK_MANAGE_ONBOARDING_TOURS_EXAMPLE_SITE } from 'calypso/jetpack-cloud/sections/onboarding-tours/constants';
import TextPlaceholder from 'calypso/jetpack-cloud/sections/partner-portal/text-placeholder';
import { isAutomatticTeamMember } from 'calypso/reader/lib/teams';
import { useSelector } from 'calypso/state';
import { getReaderTeams } from 'calypso/state/teams/selectors';
import { useFetchTestConnections } from '../../hooks/use-fetch-test-connection';
import useFormattedSites from '../../hooks/use-formatted-sites';
import { AllowedTypes, Site, SiteData } from '../../types';
Expand Down Expand Up @@ -66,9 +69,12 @@ export const JetpackSitesDataViews = ( {
[]
);

const teams = useSelector( getReaderTeams );
const isTeamMember = isAutomatticTeamMember( teams );

const openSitePreviewPane = useCallback(
( site: Site ) => {
if ( site.sticker.includes( 'migration-in-progress' ) ) {
if ( site.sticker.includes( 'migration-in-progress' ) && ! isTeamMember ) {
return;
}

Expand Down Expand Up @@ -384,7 +390,8 @@ export const JetpackSitesDataViews = ( {
onClick={ ( e: MouseEvent ) => e.stopPropagation() }
onKeyDown={ ( e: KeyboardEvent ) => e.stopPropagation() }
>
{ ! item.site.value.sticker.includes( 'migration-in-progress' ) && (
{ ( ! item.site.value.sticker.includes( 'migration-in-progress' ) ||
isTeamMember ) && (
<>
<SiteActions
isLargeScreen={ isLargeScreen }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Badge, Button } from '@automattic/components';
import { translate } from 'i18n-calypso';
import SiteFavicon from 'calypso/a8c-for-agencies/components/items-dashboard/site-favicon';
import TextPlaceholder from 'calypso/jetpack-cloud/sections/partner-portal/text-placeholder';
import { Site } from '../types';
Expand Down Expand Up @@ -32,7 +33,7 @@ const SiteDataField = ( { isLoading, site, onSiteTitleClick }: SiteDataFieldProp
{ ! migrationInProgress && <div className="sites-dataviews__site-url">{ site.url }</div> }
{ migrationInProgress && (
<Badge className="migration-badge" type="info-blue">
Migration in progress
{ translate( 'Migration in progress' ) }
</Badge>
) }
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Icon, starFilled, info } from '@wordpress/icons';
import clsx from 'clsx';
import { useContext, useState, forwardRef, Ref } from 'react';
import QueryReaderTeams from 'calypso/components/data/query-reader-teams';
import AddNewSiteTourStep2 from 'calypso/jetpack-cloud/sections/onboarding-tours/add-new-site-tour-step-2';
import TextPlaceholder from 'calypso/jetpack-cloud/sections/partner-portal/text-placeholder';
import './style.scss';
Expand Down Expand Up @@ -42,6 +43,7 @@ const SiteTable = ( { isLoading, columns, items }: Props, ref: Ref< HTMLTableEle

return (
<>
<QueryReaderTeams />
<table ref={ ref } className="site-table__table">
<thead>
<tr>
Expand Down

0 comments on commit 966354a

Please sign in to comment.