-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import docs from archive and handle reporting #21
Conversation
PRO-4271 As an editor, I can import Apostrophe documents in my site
As an editor, I am able to import documents, related ones and related attachments to another site. These are contained in a ZIP file generated from a documents export in another site (or the current one). The ZIP file itself must be imported as it is to be sure everything is correctly imported and its content unchanged. When the import button from the import modal is triggered, the zip file must be sent to the server through a single POST request for this iteration (so will be limited in size). Read from ZIP fileThe backend will unzip the file using the same lib used to generate it, We would prefer using the node native lib. You might look a way to stream the content of the ZIP file to avoid having to load everything in memory before to read it. It should be ok now since we don't handle big loads of data, but in the future we will. AttachmentsIt must import attachments and documents from The you might need to make some modifications here to be able to write a file and to insert an existing attachment, you need at least, to keep the ID. If the attachment already exist (by ID) it must not be created, and the file not uploaded. We'll consider here that it has been imported in the past. DocumentsThen we need to import We will also need to keep track of duplicated documents IDs, to ask later to the user if we must override them. You must use the proper manager for each piece depending its type, and to use the the import process must be wrapped by the See this ticket for more information about the notification progress bar implementation. SingletonsIf the piece is from a module that has the option PagesFor this iteration we won't manage the download of all the exported page children. We still want to check the location of the page in the tree, if this one exists then we want to import the page at the same location (at least for the parent). If the path doesn't exists, simply put the page as a Home page child. PermissionsSince we will use the official insert/update Apostrophe methods, if they fail due to permissions the import should stop with an appropriate error. Acceptance Criteria
|
667ee71
to
f0caafc
Compare
dc16fe3
to
dbac1bf
Compare
… is finished or abadonned, do not await dismiss notifs
0d45516
to
6e19546
Compare
PRO-4271
What this PR does
import-duplicates
even triggered by a success notification that opens the modal and passes right data.Run following mongo command to remove docs and re-import them, in order to test an import with no duplicates:
reporting:
Testing PR
Should be test with the branch of this PR in core.
Perform imports with unexisting documents with and without related documents it should import them properly.
Perform imports with existing documents with and without relatated documents it should update them properly as well as their related attachments.