-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Imports: Add the UI for the Squarespace importer (#26609)
* Imports: Add the UI for the Squarespace importer Although the Squarespace export is in WXR format so can be imported using the WordPress importer, this sets up the UI so the import can be identified as from Squarespace, and sets the stage for us to do further preprocessing on the file. * Rebase after importer header refactor The `importer-header` component had a much needed refactor. This meant that the Squarespace logo needed to be added to the options for importer icons.
- Loading branch information
Showing
13 changed files
with
111 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/** @format */ | ||
|
||
/** | ||
* External dependencies | ||
*/ | ||
|
||
import PropTypes from 'prop-types'; | ||
import React from 'react'; | ||
import { localize } from 'i18n-calypso'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import FileImporter from './file-importer'; | ||
import InlineSupportLink from 'components/inline-support-link'; | ||
|
||
const importerName = 'Squarespace'; | ||
|
||
class ImporterSquarespace extends React.PureComponent { | ||
static displayName = 'ImporterSquarespace'; | ||
|
||
static propTypes = { | ||
site: PropTypes.shape( { | ||
title: PropTypes.string.isRequired, | ||
} ).isRequired, | ||
importerStatus: PropTypes.shape( { | ||
filename: PropTypes.string, | ||
importerState: PropTypes.string.isRequired, | ||
errorData: PropTypes.shape( { | ||
type: PropTypes.string.isRequired, | ||
description: PropTypes.string.isRequired, | ||
} ), | ||
percentComplete: PropTypes.number, | ||
siteTitle: PropTypes.string.isRequired, | ||
statusMessage: PropTypes.string, | ||
} ), | ||
}; | ||
|
||
render() { | ||
const importerData = { | ||
title: importerName, | ||
icon: 'squarespace', | ||
description: this.props.translate( | ||
'Import posts, pages, comments, tags, and images from a %(importerName)s export file.', | ||
{ | ||
args: { | ||
importerName, | ||
}, | ||
} | ||
), | ||
uploadDescription: this.props.translate( | ||
'To import content from a %(importerName)s site to ' + | ||
'{{b}}%(siteTitle)s{{/b}}, upload your ' + | ||
'{{b}}%(importerName)s export file{{/b}} here. ' + | ||
"Don't have one, or don't know where to find one? " + | ||
'Get step by step instructions in our {{inlineSupportLink/}}.', | ||
{ | ||
args: { | ||
importerName, | ||
siteTitle: this.props.site.title, | ||
}, | ||
components: { | ||
b: <strong />, | ||
inlineSupportLink: ( | ||
<InlineSupportLink | ||
supportPostId={ 87696 } | ||
supportLink={ 'https://en.support.wordpress.com/import/import-from-squarespace' } | ||
text={ this.props.translate( '%(importerName)s import guide', { | ||
args: { | ||
importerName, | ||
}, | ||
} ) } | ||
showIcon={ false } | ||
/> | ||
), | ||
}, | ||
} | ||
), | ||
}; | ||
return <FileImporter importerData={ importerData } { ...this.props } />; | ||
} | ||
} | ||
|
||
export default localize( ImporterSquarespace ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters