Description
Changes proposed in this Pull Request
- Adds Substack Importer UI to Calypso
- Adds a
url
key to the POST request sent to /importers/new for processing Substack entries from wpcom backend.
CleanShot.2021-06-30.at.14.43.23.mp4
Code Changes Overview
- A new Substack entry in importer-config that contains a new key
optionalUrl
that contains title
, description
and invalidDescription
and a function validate
.
- A SubstackImporter that continues to use FileImporter.
- Modifications in UploadingPane to display an optional URL field when the key
optionalUrl
is present.
- Client-side validation of URL, including default, error & success states.
- Modify the
startUpload
action and wpcom
undocumented API to send across a url
for /imports/new
Testing instructions
- Go to Tools > Import and test any existing importer (Blogger for e.g.). Make sure the E2E flow works.
- Now open Substack. The UI should be self-explanatory. The Upload button should be activated only if a valid file and a valid URL, or a valid file alone is present.
- The Upload itself will throw an error as we haven’t implemented the backend functionality, but examine the network request to ensure the url is passed correctly:
4. Try to break this & code suggestions welcome! 🙂
Unfortunately, no screenshots were provided by the developer.