Modifications for Preview page
Context
Some modifications needed in either the client side as well as the server side for the export/preview functionality. The changes should be implemented in:
- https://gitlab.coko.foundation/ketida/server
- https://gitlab.coko.foundation/ketida/lulu
- https://gitlab.coko.foundation/ketida/vanilla-client (needed for backward compatibility)
Proposal
Design
Implementation (if applicable)
- The queries that we need here are
getSpecificTemplates
,getPagedPreviewerLink
, andexportBook
. For theexportBook
mutation an example can be found here - The
getSpecificTemplates
query should take as arguments the following$where:TemplatesWhereInput!
(this new query as well as the new input should be created in the server, see below). - Create a new query here called
getSpecificTemplates
the output of that should be[Template!]
- Create a new type here called
TemplatesWhereInput
with propertiestarget:String!
andtrimSize:String
- Implement the logic in this controller file which will interact with the db and it will return all the templates of a given target (e.g.
pagedjs
,epub
) and more specifically for the case of targetpagedjs
and only for thattrimSize
should be used too. As an example the existing getTemplates should be used. - Remove
mode
from here, here and here - Create a new input declaration here with name
AdditionalExportOptionsInput
and propertiesincludeTOC:Boolean, includeCopyrights:Boolean, includeTitlePage:Boolean
- Add property
additionalExportOptions
here of typeAdditionalExportOptionsInput
- Make sure that after all the changes above you also update previewer.queries.js with the new types/inputs and declarations
Alternative approaches (if applicable)
Edited by Alexandros Georgantas