Skip to content

Commit

Permalink
query teams inside sites dashboard and disable other row items
Browse files Browse the repository at this point in the history
  • Loading branch information
vykes-mac committed Jun 20, 2024
1 parent 966354a commit ceee600
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import LayoutTop from 'calypso/a8c-for-agencies/components/layout/top';
import MobileSidebarNavigation from 'calypso/a8c-for-agencies/components/sidebar/mobile-sidebar-navigation';
import useNoActiveSite from 'calypso/a8c-for-agencies/hooks/use-no-active-site';
import JetpackSitesDataViews from 'calypso/a8c-for-agencies/sections/sites/features/jetpack/jetpack-sites-dataviews';
import QueryReaderTeams from 'calypso/components/data/query-reader-teams';
import useFetchDashboardSites from 'calypso/data/agency-dashboard/use-fetch-dashboard-sites';
import useFetchMonitorVerifiedContacts from 'calypso/data/agency-dashboard/use-fetch-monitor-verified-contacts';
import DashboardDataContext from 'calypso/jetpack-cloud/sections/agency-dashboard/sites-overview/dashboard-data-context';
Expand All @@ -46,7 +47,6 @@ import { updateSitesDashboardUrl } from './update-sites-dashboard-url';

import './style.scss';
import './sites-dataviews-style.scss';

export default function SitesDashboard() {
const jetpackSiteDisconnected = useSelector( checkIfJetpackSiteGotDisconnected );
const dispatch = useDispatch();
Expand Down Expand Up @@ -246,7 +246,7 @@ export default function SitesDashboard() {

<SiteNotifications />
{ tourId && <GuidedTour defaultTourId={ tourId } /> }

<QueryReaderTeams />
<DashboardDataContext.Provider
value={ {
verifiedContacts: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export default function ToggleActivateMonitoring( {
borderless
compact
onClick={ handleToggleNotificationSettings }
disabled={ isLoading }
disabled={ isLoading || site.sticker.includes( 'migration-in-progress' ) }
aria-label={
translate(
'The current notification schedule is set to %(currentSchedule)s. Click here to update the settings',
Expand Down Expand Up @@ -147,7 +147,7 @@ export default function ToggleActivateMonitoring( {
<ToggleControl
onChange={ handleToggleActivateMonitoring }
checked={ isChecked }
disabled={ isLoading || siteError }
disabled={ isLoading || siteError || site.sticker.includes( 'migration-in-progress' ) }
label={ isChecked && currentSettings() }
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ export default function SiteBoostColumn( { site, siteError }: Props ) {
recordEvent( 'boost_column_get_score_click' );
};

const isSiteMigrationInProgress = site.sticker.includes( 'migration-in-progress' );

const noBoostHrefOption = site.is_atomic ? jetpackHref : addBoostHref;
if ( overallScore && ! hasBoost ) {
return (
Expand All @@ -57,7 +59,7 @@ export default function SiteBoostColumn( { site, siteError }: Props ) {
}
href={ siteError ? '' : noBoostHrefOption }
target="_blank"
disabled={ siteError || site.sticker.includes( 'migration-in-progress' ) }
disabled={ siteError || isSiteMigrationInProgress }
onClick={ () =>
recordEvent( 'boost_column_score_click', {
score: overallScore,
Expand Down Expand Up @@ -122,15 +124,15 @@ export default function SiteBoostColumn( { site, siteError }: Props ) {
<>
<span
className={
siteError
siteError || isSiteMigrationInProgress
? 'sites-overview__disabled sites-overview__row-status'
: 'sites-overview__row-status'
}
>
<button
className="sites-overview__column-action-button"
onClick={ handleGetBoostScoreAction }
disabled={ siteError }
disabled={ siteError || isSiteMigrationInProgress }
>
<Gridicon icon="plus-small" size={ 16 } />
<span>{ translate( 'Add' ) }</span>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
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 @@ -43,7 +42,6 @@ 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 ceee600

Please sign in to comment.