Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • pubsweet-components pubsweet-components
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Merge requests 3
    • Merge requests 3
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • pubsweetpubsweet
  • pubsweet-componentspubsweet-components
  • Merge requests
  • !113

Allow different recipes to be called via the INK component

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Alf Eaton requested to merge ink-backend-recipe-parameter into master Nov 29, 2017
  • Overview 5
  • Commits 7
  • Pipelines 3
  • Changes 10

The existing INK components (frontend and backend) were built to handle conversion of DOCX files to HTML; this change allows any INK recipe to be called in the same way.

  • Adds a "recipe" parameter (fixes #54)
  • Adds an "outputFile" parameter (so the backend knows which file to download at the end of the process)
  • Refactor to improve promise handling

The changes to the backend component are backwards-compatible (tested in Editoria) - finding the recipe id works as follows:

  1. Read the "recipe" parameter.
  2. If there's a matching key (e.g. 'editoria-typescript') in config['pubsweet-component-ink-backend']['recipes'] use that value as the recipe ID. This is the ideal situation, where the app configuration maps keys used in the frontend to recipe IDs in the configured INK instance.
  3. If there's no key, use "Editoria Typescript" as the default (for backwards compatibility). Fetch the list of recipes from the INK API and find the recipe with title that matches this key (this is how it used to work, but is inefficient as it has to fetch and filter that list for every conversion).
Edited Nov 29, 2017 by Alf Eaton
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: ink-backend-recipe-parameter