Skip to content

Commit

Permalink
* fix the domain only domain management pages not working from the al…
Browse files Browse the repository at this point in the history
…l domains view (#44362)

Fixex some routing issues for domain management pages for standalone domains
  • Loading branch information
hambai authored Jul 27, 2020
1 parent 8dc3ddb commit 0d72cba
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions client/my-sites/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import {
domainManagementTransfer,
domainManagementTransferOut,
domainManagementTransferToOtherSite,
domainManagementRoot,
} from 'my-sites/domains/paths';
import {
emailManagement,
Expand Down Expand Up @@ -181,6 +182,12 @@ function isPathAllowedForDomainOnlySite( path, slug, primaryDomain, contextParam
return pathFactory( slug, slug );
} );

domainManagementPaths = domainManagementPaths.concat(
allPaths.map( ( pathFactory ) => {
return pathFactory( slug, slug, domainManagementRoot() );
} )
);

if ( primaryDomain && slug !== primaryDomain.name ) {
domainManagementPaths = domainManagementPaths.concat(
allPaths.map( ( pathFactory ) => pathFactory( slug, primaryDomain.name ) )
Expand Down
3 changes: 2 additions & 1 deletion client/my-sites/sidebar/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { connect } from 'react-redux';
import Gridicon from 'components/gridicon';
// eslint-disable-next-line no-restricted-imports
import { format as formatUrl, parse as parseUrl } from 'url';
import { memoize } from 'lodash';
import { ProgressBar } from '@automattic/components';
Expand Down Expand Up @@ -1061,7 +1062,7 @@ function mapStateToProps( state ) {
scanState: getScanState( state, siteId ),
rewindState: getRewindState( state, siteId ),
isCloudEligible: isJetpackCloudEligible( state, siteId ),
isAllSitesView: getSelectedSiteId( state ) === null,
isAllSitesView: isAllDomainsView || getSelectedSiteId( state ) === null,
};
}

Expand Down

0 comments on commit 0d72cba

Please sign in to comment.