Commit Graph

3 Commits

Author SHA1 Message Date
Timur Sufiev f605ff7b8c Refactor templates to make them composable
The main goal of this change is to free the potential Merlin users
from the burden of writing their custom templates when it just
involves combining widgets into different levels of nesting. Writing
custom templates still remains obligatory when some additional
controls/rendering (not provided with built-in widgets) is needed,
e.g. YAQLField.

To ease the pain of laying out the DOM snippets not known in advance I
switched from conventional Bootstrap Grid system to the Flexgrid
package which reimplements Bootstrap Grid over CSS3 Flexbox module. It
provides all the existing grid features w/o the need to cancel
floating effects with div.clearfix and adds pretty vertical/horizontal
aligning options which are very useful in Merlin.

Besides templates refactoring the filters system was also
rewritten. Filter extractPanels() now accepts one required argument,
keyExtractor function which is used to calculate a numeric values for
every field of Barricade object recursively. The fields with the same
numeric values go to the same panel, so we could define the logic of
panel extraction separately for each application built on Merlin. For
the filters following on the pipeline extractPanels() provides .each()
method, which they should use for enumeration over the panel
contents. This way the panel implements the same interface as every
other Barricade container does.

Old extractRows() and extractItems() filters are removed, as well as
the necessity to embed positioning hints into the model. As of now
precise fields ordering is lost, but will be reimplemented with an
extractFields() upgrade (ability to pass a list of field keys is yet
to come, as well as the removal of 'index' hints).

Implements blueprint: composable-templates
Implements blueprint: decouple-ui-hints-and-models

Change-Id: I73f480034730099b33afec88cddf919a7bfc441b
2015-07-30 12:06:01 +03:00
Timur Sufiev 6fa8b92891 Refactor third-party libraries usage and clean up karma config
* handle js-yaml and underscore libraries with bower (use libraries
  downloaded with bower by sym-linking bower_components to libs dir in
  static);
* get rid of no longer used angular-filter;
* move libraries without official releases to custom-libs
* simplify file requirements in karma config.

Change-Id: Ie3d1d90c6f2ccc89c7cf91fe0d9dae4b2b88442f
2015-04-25 19:18:52 +00:00
Paul Karikh 05451e3e59 Add karma testing
This patch adds configuration for Karma.

Change-Id: Ibb65060836f967ac81a57ea279d7fa494e238d49
Implements blueprint: merlin-unittests
2015-04-17 15:27:11 +03:00