1 of 10

Merlin

A cross-project UI framework

Timur Sufiev, Mirantis

Drago Rosson, Rackspace

2 of 10

Where do OpenStack UIs fail

  • Hard to input data in form of YAML templates
    • A lot of interdependencies, special DSL
    • Users should consult the documentation
    • Easy to make an error
    • Hard to debug
  • Affected projects: Mistral, Heat, Murano

3 of 10

How should good UI behave

  • Prevents errors
    • Imposes YAML structure restrictions
    • Offers values auto-completion
    • Provides validation hints
  • Facilitates understanding
    • Represents YAML document as a graph
  • Still allows to edit raw YAML

4 of 10

Provide a tool, not a solution

  • A tool for building UIs, not a single UI
  • Provide a reference UI implementation as well
    • Mistral Workbook Builder is the first one
  • Seamless Horizon integration

5 of 10

Assisted Editing UI pattern

The forms view: hinted template editing - input restriction, validations and autocompletions

Switch between YAML and Graph view

The YAML view: raw

template editing

6 of 10

Live Demo!

Merlin-powered UI in action

7 of 10

Under the hood, the model

Merlin classes

  • Angular.js integration
    • model setter/getter
    • autocompletion
    • choosing the right template (see later)

list

dictionary

string/number/text

frozendict/panel

Barricade.js classes

  • Schema enforcement
  • JSON serialization
  • Basic validation
  • Defaults handling

Primitive

ImmutableObj

MutableObj

Array

subclassing

8 of 10

Under the hood, the view

Angular factory

Merlin classes

definitions

Angular controller

root-level object

added to $scope

server-side

YAML

=value @type

Final HTML template

.create()

Angular

filters

Mistral WB DOM

<panel>

<group>

<typed-field>

ng-repeat

Render the right template based on model type passed within the scope (postpone template dispatch to directive’s linking phase).

recursively

9 of 10

Horizon integration

Merlin

hz

Mistral

base.html Template

Directives

Filters

Factories

Factories

Controllers

Workbook Builder Template

Merlin Framework

Workbook Builder

Horizon Framework

10 of 10

Contacts