Skip to content

Commit

Permalink
Revert "Embed directly"
Browse files Browse the repository at this point in the history
This reverts commit 23b2fbe6ba6e6b6bcbbb461a3dd52d941993290e.
  • Loading branch information
ockham committed Jul 8, 2018
1 parent 4073b31 commit b1af337
Showing 1 changed file with 14 additions and 55 deletions.
69 changes: 14 additions & 55 deletions client/my-sites/plans/current-plan/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@ import { getDecoratedSiteDomains } from 'state/sites/domains/selectors';
import DomainWarnings from 'my-sites/domains/components/domain-warnings';
import isSiteAutomatedTransfer from 'state/selectors/is-site-automated-transfer';
import SidebarNavigation from 'my-sites/sidebar-navigation';
import Checklist from 'blocks/checklist';
import { isEnabled } from 'config';
import { jetpackTasks } from 'my-sites/checklist/jetpack-checklist';
import { launchTask } from 'my-sites/checklist/onboardingChecklist';
import getSiteChecklist from 'state/selectors/get-site-checklist';
import ChecklistShow from 'my-sites/checklist/checklist-show';

class CurrentPlan extends Component {
static propTypes = {
Expand Down Expand Up @@ -81,42 +77,18 @@ class CurrentPlan extends Component {
};
}

handleAction = id => {
const { requestTour, siteSlug, tasks, track } = this.props;
const task = find( tasks, { id } );

launchTask( {
task,
location: 'checklist_show',
requestTour,
siteSlug,
track,
} );
};

handleToggle = id => {
const { notify, siteId, tasks, update } = this.props;
const task = find( tasks, { id } );

if ( task && ! task.completed ) {
notify( 'is-success', 'You completed a task!' );
update( siteId, id );
}
};

render() {
const {
selectedSite,
selectedSiteId,
domains,
context,
currentPlan,
domains,
hasDomainsLoaded,
isAutomatedTransfer,
isExpiring,
isJetpack,
selectedSite,
selectedSiteId,
shouldShowDomainWarnings,
tasks,
translate,
} = this.props;

Expand Down Expand Up @@ -171,14 +143,7 @@ class CurrentPlan extends Component {
isAutomatedTransfer={ isAutomatedTransfer }
includePlansLink={ currentPlan && isFreeJetpackPlan( currentPlan ) }
/>
{ isJetpack && (
<Checklist
isLoading={ ! tasks }
tasks={ tasks }
onAction={ this.handleAction }
onToggle={ this.handleToggle }
/>
) }
{ isJetpack && <ChecklistShow /> }
<div
className={ classNames( 'current-plan__header-text current-plan__text', {
'is-placeholder': { isLoading },
Expand All @@ -195,31 +160,25 @@ class CurrentPlan extends Component {
}
}

export default connect( ( state, { context } ) => {
export default connect( ( state, ownProps ) => {
const selectedSite = getSelectedSite( state );
const selectedSiteId = getSelectedSiteId( state );
const siteChecklist = getSiteChecklist( state, selectedSiteId );
const domains = getDecoratedSiteDomains( state, selectedSiteId );

const isJetpack = isJetpackSite( state, selectedSiteId );
const isWpcom = ! isJetpackSite( state, selectedSiteId );
const isAutomatedTransfer = isSiteAutomatedTransfer( state, selectedSiteId );

const tasks = isJetpack ? jetpackTasks( siteChecklist ) : [];

return {
checklistAvailable:
! isAutomatedTransfer && ( isEnabled( 'jetpack/checklist' ) || ! isJetpack ),
context,
currentPlan: getCurrentPlan( state, selectedSiteId ),
selectedSite,
selectedSiteId,
domains,
hasDomainsLoaded: !! domains,
isAutomatedTransfer,
context: ownProps.context,
currentPlan: getCurrentPlan( state, selectedSiteId ),
isExpiring: isCurrentPlanExpiring( state, selectedSiteId ),
isJetpack,
shouldShowDomainWarnings: isWpcom || isAutomatedTransfer,
hasDomainsLoaded: !! domains,
isRequestingSitePlans: isRequestingSitePlans( state, selectedSiteId ),
selectedSite,
selectedSiteId,
shouldShowDomainWarnings: ! isJetpack || isAutomatedTransfer,
tasks,
isJetpack: isJetpackSite( state, selectedSiteId ),
};
} )( localize( CurrentPlan ) );

0 comments on commit b1af337

Please sign in to comment.