Release Notes: September 2017 Release

Repositories

A release consists of new versions of the livingdocs-server, the livingdocs-editor and the livingdocs-framework.

Livingdocs Server

How to require the server in your package.json:

"dependencies": {
  "@livingdocs/server": "61.2.1",
}

Patches

  • 61.2.1 - hooks: Log errors instead of crashing on registration

Livingdocs Editor

How to require the editor in your package.json:

"dependencies": {
  "@livingdocs/editor": "20.10.4",
}

Patches

  • 20.10.1 - add archived state to articles details pages
  • 20.10.2 - spellchecker: unload editable when removing the main (interactive) view
  • 20.10.3 - reinitialise componentTree events when removing the mainView
  • 20.10.4 - guard resrc image service call via framework

Livingdocs Framework

The framework is already integrated in the package.json of the upstream server and editor. It’s not necessary to integrate the framework from your side.

The framework does not have a release branch.

How to require the framework in your package.json:

dependencies: {
  "@livingdocs/framework": "7.12.2"
}

Component changes

ComponentTypeDescriptionPRsIssues
ServerBugfixEnable cdata after updating xml2js to 0.4.18bae17234-
ServerBREAKING CHANGE, FeatureCategories API. Read more#1566#1288
ServerBugfixRemove new channel configuration (accidentally slipped in)#1607-
ServerBugfixEnable metadata in import. Read more#1615#1490
ServerFeatureChannel configuration: Hooks are now registered on the feature.#1589#1348
ServerBREAKING CHANGERemovе deprecated doc-include methods and pusher endpoint. Read More#1613#1430
ServerFeatureAdd getRoyaltyRecipients endpoint#1606-
ServerBREAKING CHANGE, Featuregrunt-setup works now properly within a Docker container. Read More#1617#1041
ServerFeatureAdd document count to document-list endpoint.#1627#1471
ServerBugfixLog errors instead of crashing on registration#commit-
EditorBugfixShow build settings on admin screen.#1646-
EditorBugfixUpdate to new framework api. Read More#1651-
EditorBugfixUse the correct package for semantic-release on maintenance branches#1654-
EditorBugfixAllow print template selection on hugo import.#1656#1490
EditorBugfixApply print layout change to document metadata. Read more#1658#1469
EditorFeatureEnhance the list’s dashboard with document count#1661#1471
EditorFeatureDefine default image component on containers for drag & drop Read more#1663, #255#1264
EditorBugfixWhen a focus image component gets deleted the image upload icon disappears#1663#1383
EditorBugfixview: cannot transition from viewing to viewing#commmit#1432
EditorBugfixAs an editor I would like to see if I’m working on an archived article#commmit#1432
EditorBugfixComponents are not shown on drag and drop#1680#1516
EditorBugfixUncaught TypeError: Cannot read property ‘configure’ of undefined#1689#1527
EditorBugfixTypeError: Cannot read property ‘rangeCount’ of null#1678#1497
FrameworkFeatureComponentModel Api Improvements Read more#241-
FrameworkFeatureIntegrate Livingdocs release tools Read more#241#1363
FrameworkBugfixImage order on multi-upload from local machine Read more#259#326

Known issues

ComponentTypeDescriptionIssue
EditorBugThe controller with the name ‘TasksController’ is not registered.#1481

In detail

Categories API

BREAKING CHANGE

We’re adding an experimental Categories api and did some renaming in the event sourcing setup. Additionally to the new database table which is created by the database migration script, we also renamed some columns on the menu and groups tables. If your setup automatically applies the migration, there’s nothing you have to do. If that’s not the case, you’ll need to run grunt migrate.

API

const categories = liServer.features.api('li-categories')

categories.getCategoryTrees({projectId, channelId}, cb)
categories.getPublishedCategoryTree({projectId, channelId}, cb)
categories.getPublishedCategoryTrees({projectId, channelId, categoryTreeId}, cb)

// required params for all methods: {action, projectId, channelId, categoryTreeId, data}
//` action` must equal the method name
categories.createCategoryTree({params..., data: {label}, cb)
categories.publishCategoryTree(params, cb)
categories.deleteCategoryTree(params, cb)
categories.addCategory({params..., data: {id, label, slug, pathToHere, metadata}}, cb)
categories.updateCategory({params..., data: {id, label, slug, pathToHere, metadata}}, cb)
categories.removeCategory({params..., data: {id}}, cb)
categories.moveCategory({params..., data: {id, previous, parent}}, cb)

Enable metadata in import

The data object passed to the HugoImportApi can now contain a metadata object. E.g. NZZ can use it to pass their print metadata to the importer so an imported print article can be exported correctly.

Removing deprecated doc-include methods

BREAKING CHANGES

  • The registerServiceRenderer method on the server.features.api('li-includes') feature was removed. Please use the registerService method, which was introduced in https://github.com/livingdocsIO/livingdocs-server/pull/1470

  • The method includeApi.getServiceRendererMethod got removed. Please use includeApi.resolveInclude to render an include.

  • We’ve removed the deprecated /authenticate/pusher endpoint. Please make sure your editor is up to date and that your pusher configuration isn’t using that endpoint.

  • The url you should use is /pusher/authorize:

      pusher:
        isEnabled: true
        endpoint: '/pusher/authorize'
    

grunt-setup works now properly within a docker container

  • The config option config.docker.enabled has been replaced by config.db.run_db_setup_commands_within_docker_container.

  • config.db.run_db_setup_commands_within_docker_container defaults to true and executes the db commands during grunt setup in a Docker container. grunt setup is not supported, when you start Docker containers with docker-compose and point to a container by a dns name.

  • config.db.run_db_setup_commands_within_docker_container = false executes the db commands during grunt setup on the host system. For that createdb and dropdb needs to be available as binaries on the host system.

  • the documentation has been updated as well: https://github.com/livingdocsIO/livingdocs/pull/136/files.

Update to new framework api

The framework’s livingdoc objects has changed its signature with regard to removing event listerners. The following code does not work anymore:

livingdoc.off()

It was replaced by:

livingdoc.removeListener()

Apply print layout change to document metadata

Each time when the metadata was applied to the document (e.g. document.update()) the metadata reference which was passed to the MetadataService in the Workspace went stale and metadata updates didn’t arrive on the document.

Define default image component on containers for drag & drop

Feature: New defaultComponents configuration option

Image components can now also be defined as default components. A use case may be an image gallery where a different component should be used for images by default.

Example component configuration in a Livingdocs design:

{
  name: 'gallery',
  label: 'Image Gallery',
  directives: {
    children: {
      defaultComponents: {
        image: 'image-slide'
      }
    }
  }
}

Feature: Browser Drag API

Interactive pages have a new startBrowserDrag() method. This method has an onDrop callback that provides a dropLocation.

livingdoc.createView({host, interactive, wrapper}).then ({iframe, renderer}) => {
  renderer.page.startBrowserDrag({
    event: event,
    onDrop: ({event, dropLocation}) => {
      // getDefaultComponent() will return the defaultComponent for the droplocation.
      // Possible types are `editable` and `image`.
      const imageComponentName = dropLocation.getDefaultComponent({type: 'image'})
      const component = livingdoc.createComponent(imageComponentName)

      // insert can be called multiple times. It will append each inserted component at the
      // end of the dropLocation.
      dropLocation.insert(component)
    }
  })
}

ComponentModel Api Improvements

ComponentModel

Allow to call setContent with an object:

componentModel.setContent({
  title: 'Moby Dick',
  tagline: 'Whaling Weekly'
})

Allow to call getContent without passing a directive name:

componentModel.getContent()
// returns
// {
//    title: 'Moby Dick'
//    tagline: 'Whaling Weekly'
// }

ComponentTree

Allow to pass content when creating a component:

componentTree.createComponent('title', {
  title: 'Moby Dick'
})

(this also works for livingdoc.createComponentTree())

Integrate Livingdocs release tools

  • With the introduction of the release-tools it’s possible to create and maintain a maintenance branch for an old version with a proper semantic-release approach. You can read more here.

  • We introduced a check to verify that on a maintenance branch only patch commits are allowed.

Image order on multi-upload from local machine

This is a framework fix and you need to ensure that your framework version is at least 7.12.1. Since the editor and the server consumes the framework with ^, they both should get the latest framework version.