Commit Graph

6 Commits

Author SHA1 Message Date
Timur Sufiev 7021718ab2 Rewrite <labeled> directive to render editable labels
Common part of <labeled>, <panel> and <collapsible-group> is moved to
a separate <editable-title> directive.

Implements blueprint: composable-templates

Change-Id: If5f8da39aad0f4f3195e9af18e384de9f3ed2d75
2015-07-30 12:06:01 +03:00
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
Vlad Okhrimenko 7c09eb5fb5 No need to use disableDefaultClickBehaviour
removed `#` from `href-tag`. Fixed scroll to top.

Co-Authored-By: Timur Sufiev <tsufiev@mirantis.com>
Change-Id: I04bb343b0a4365c437d0f4625cb7a7c3ed7dc740
closes-bug: #1459342
closes-bug: #1448546
2015-06-15 18:24:30 +03:00
Timur Sufiev 531dc56c64 Fix changing Action/Workflow/Task id
To make it happen <collapsible-group> directive had to undergo the
same transformation that was applied to <panel> directive: instead of
passing just a '@title' reference, the whole '=content' reference is
now passed to the <collapsible-group>'s scope. This allows to use
<editable> directive inside it with 'ng-model=group.title' as
getter/setter method. Yet <collapsible-group>'s scope wasn't remade as
radically as <panel>'s was - '&on-add' and '&on-remove' are still
there and left for future refactoring.

Change-Id: I4de7a542f282efee6deb34d4957a5873d617ad64
Closes-Bug: #1446171
Closes-Bug: #1446226
2015-04-28 21:05:32 +03:00
Timur Sufiev e5b8fb8a3a Rewrite <panel> and <collapsible-group> directives
Use 'collapse' directive from angular-bootstrap inside them instead of
hand-written bootstrap css transitions. Clicking on panel title no
longer collapses/expands panel contents - this is done in order enable
panel entity name in-line editing in next commit.

Change-Id: Ifcc32cd74a5482a59b417333824522ebf48c73b5
Closes-Bug: #1411636
Closes-Bug: #1428719
2015-04-28 15:52:27 +03:00
Timur Sufiev fc14e3c993 Take data for Angular.js from Barricade.js object
Along with this perform major code cleanup and change directory
structure.

Change-Id: I1736ded46ab5b9b635acce7e938a803001884393
2015-02-26 14:41:04 -08:00