Preview page Integration
- A new
Previewer.page.js
file should be created under theapp/pages
folder - A new folder of
graphql
should be created under app folder - A new file with name
previewer.queries.js
should be created underapp/graphql
folder - This file should contain all the
queries
,mutations
andsubscriptions
(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.js
should take advantage ofuseQuery
anduseMutation
from@apollo/client
for 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