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 theexportBookmutation an example can be found here - The
getSpecificTemplatesquery 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
getSpecificTemplatesthe output of that should be[Template!] - Create a new type here called
TemplatesWhereInputwith 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 targetpagedjsand only for thattrimSizeshould be used too. As an example the existing getTemplates should be used. - Remove
modefrom here, here and here - Create a new input declaration here with name
AdditionalExportOptionsInputand propertiesincludeTOC:Boolean, includeCopyrights:Boolean, includeTitlePage:Boolean - Add property
additionalExportOptionshere 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