Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
include = include.split( ',' );
}
console.log( `[sections-loader] Limiting build to ${ include.join( ', ' ) } sections` );
const allSections = sections;
sections = allSections.filter( section => include.includes( section.name ) );
if ( ! sections.length ) {
// nothing matched. warn.
console.warn( `[sections-loader] No sections matched ${ include.join( ',' ) }` );
console.warn( `[sections-loader] Available sections are:` );
printSectionsAndPaths( allSections );
}
}
return addModuleImportToSections( {
sections,
shouldSplit: config.isEnabled( 'code-splitting' ) && ! forceRequire,
onlyIsomorphic,
} );
};
loader.addModuleImportToSections = addModuleImportToSections;
recordFiltersReset,
recordFiltersSubmit,
recordMapDomainButtonClick,
recordSearchFormSubmit,
recordSearchFormView,
recordSearchResultsReceive,
recordShowMoreResults,
recordTransferDomainButtonClick,
recordUseYourDomainButtonClick,
} from 'components/domains/register-domain-step/analytics';
import Spinner from 'components/spinner';
const debug = debugFactory( 'calypso:domains:register-domain-step' );
// TODO: Enable A/B test handling for M2.1 release
const isPaginationEnabled = config.isEnabled( 'domains/kracken-ui/pagination' );
const domains = wpcom.domains();
// max amount of domain suggestions we should fetch/display
const INITIAL_SUGGESTION_QUANTITY = 2;
const PAGE_SIZE = 10;
const MAX_PAGES = 3;
const SUGGESTION_QUANTITY = isPaginationEnabled ? PAGE_SIZE * MAX_PAGES : PAGE_SIZE;
const FEATURED_SUGGESTIONS_AT_TOP = [ 'group_7', 'group_8' ];
let searchVendor = 'domainsbot';
let searchQueue = [];
let searchStackTimer = null;
let lastSearchTimestamp = null;
let searchCount = 0;
componentDidMount() {
const { importStage } = this.props;
if ( 'importable' === importStage ) {
// Clear any leftover state from previous imports
this.props.clearSiteImporterImport();
}
this.validateSite();
if ( config.isEnabled( 'manage/import/site-importer-endpoints' ) ) {
this.fetchEndpoints();
}
}
const context = Object.assign( {}, request.context, {
commitSha: process.env.hasOwnProperty( 'COMMIT_SHA' ) ? process.env.COMMIT_SHA : '(unknown)',
compileDebug: process.env.NODE_ENV === 'development',
user: false,
env: calypsoEnv,
sanitize: sanitize,
isRTL: config( 'rtl' ),
requestFrom: request.query.from,
isWCComConnect,
badge: false,
lang,
entrypoint: getFilesForEntrypoint( target, entrypoint ),
manifest: getAssets( target ).manifests.manifest,
faviconURL: config( 'favicon_url' ),
isFluidWidth: !! config.isEnabled( 'fluid-width' ),
abTestHelper: !! config.isEnabled( 'dev/test-helper' ),
preferencesHelper: !! config.isEnabled( 'dev/preferences-helper' ),
devDocsURL: '/devdocs',
store: createReduxStore( initialServerState ),
bodyClasses,
addEvergreenCheck: target === 'evergreen' && calypsoEnv !== 'development',
target: target || 'fallback',
} );
context.app = {
// use ipv4 address when is ipv4 mapped address
clientIp: request.ip ? request.ip.replace( '::ffff:', '' ) : request.ip,
isDebug,
staticUrls: staticFilesUrls,
};
.then( data => {
// Only need to check the feature flag. If WCS isn't enabled, no "wc_services_*" methods will be returned in the first place
const wcsMethods = config.isEnabled( 'woocommerce/extension-wcservices' )
? data.filter( ( { method_id } ) => startsWith( method_id, 'wc_services' ) )
: [];
wcsMethods.forEach( ( { id, method_id } ) =>
dispatch( fetchShippingZoneMethodSettings( siteId, method_id, id ) )
);
} )
.catch( err => {
export default router => {
if ( config.isEnabled( 'login/magic-login' ) ) {
router(
`/log-in/link/use/${ lang }`,
setUpLocale,
setSection( LOGIN_SECTION_DEFINITION ),
redirectLoggedIn,
magicLoginUse,
makeLoggedOutLayout
);
router(
[ `/log-in/link/${ lang }`, `/log-in/jetpack/link/${ lang }` ],
setUpLocale,
setSection( LOGIN_SECTION_DEFINITION ),
redirectLoggedIn,
magicLogin,
makeLoggedOutLayout
renderSearchFilters() {
const isKrackenUi =
config.isEnabled( 'domains/kracken-ui/dashes-filter' ) ||
config.isEnabled( 'domains/kracken-ui/exact-match-filter' ) ||
config.isEnabled( 'domains/kracken-ui/max-characters-filter' );
const isRenderingInitialSuggestions =
! Array.isArray( this.state.searchResults ) &&
! this.state.loadingResults &&
! this.props.showExampleSuggestions;
const showFilters = isKrackenUi && ! isRenderingInitialSuggestions;
return (
showFilters && (
hasDataToDetermineVariation = () => {
const ticketReadyOrError =
this.props.ticketSupportConfigurationReady || this.props.ticketSupportRequestError !== null;
const happychatReadyOrDisabled =
! config.isEnabled( 'happychat' ) || this.props.isHappychatUserEligible !== null;
return ticketReadyOrError && happychatReadyOrDisabled;
};
renderPopover() {
const {
filters: { includeDashes, maxCharacters, exactSldMatchesOnly },
popoverId,
translate,
} = this.props;
const isDashesFilterEnabled = config.isEnabled( 'domains/kracken-ui/dashes-filter' );
const isExactMatchFilterEnabled = config.isEnabled( 'domains/kracken-ui/exact-match-filter' );
const isLengthFilterEnabled = config.isEnabled( 'domains/kracken-ui/max-characters-filter' );
return (
{ isLengthFilterEnabled && (
render() {
if ( ! isEnabled( 'manage/import-to-jetpack' ) ) {
return this.renderUnsupportedCard();
}
return (
<h2>
A8C NOTICE: Jetpack Importing is currently in development -- please use wp-admin / wp-cli
tooling in the meantime
</h2>
<hr>
{ ' would go here' }
<hr>
<div>@TODO URL Importer here</div>
<hr>
<div>@TODO Info / Icons for supported services here</div>