Preview page Integration
- A new
Previewer.page.jsfile should be created under theapp/pagesfolder - A new folder of
graphqlshould be created under app folder - A new file with name
previewer.queries.jsshould be created underapp/graphqlfolder - This file should contain all the
queries,mutationsandsubscriptions(schemas) needed for the Previewer page like:- e.g.
getTemplates,getPagedPreviewerLink,updatePreviewerParameters,(examples can be found https://gitlab.coko.foundation/ketida/ketida/-/tree/master/packages/client/app/components/templates/src/queries and https://gitlab.coko.foundation/ketida/ketida/-/blob/master/packages/client/app/components/bookbuilder/src/queries/getPagedPreviewLink.js)
- e.g.
-
Previewer.page.jsshould take advantage ofuseQueryanduseMutationfrom@apollo/clientfor the execution of the above queries
Until the actual UI become ready the Previewer.page.js should return a dummy div.
An example of a connected page is like here https://gitlab.coko.foundation/ketida/ketida/-/blob/websocket-locks/packages/client/app/components/wax/src/EditorPageWithData.js
Additionally, inside the connected layer Previewer.page.js the following handlers should be implemented:
downloadPDFHandler and downloadEPUBHandler as well as a placeholder handler which will contain the logic of communicating with Lulu's system in order to post print jobs to their queue. These actions, will rely on axios as they will be calling REST endpoints thus outside the scope of graphql
Edited by Alexandros Georgantas