CharmCollectionView Class
Charm collection view. Show a list of charms, each clickable through for a description, or deployed directly with a "Deploy" button.
Item Index
Methods
- _setScroll
- _showErrors
- CharmCollectionView.events.mouseenter
- CharmCollectionView.events.mouseleave
- CharmCollectionView.initializer
- CharmCollectionView.render
- filterEntries static
- findCharms
- getInterfaces static
- hideCharmFilterPicker
- isDeployedFilter
- isSubFilter
- makeRenderableResults static
- normalizeCharms.
- setScroll static
- showCharmFilterPicker
- showConfiguration
- showDetails
- toggleSectionVisibility static
Methods
_setScroll
()
Undefined
protected
When the view's "height" attribute is set, adjust the internal scrollable div to have the appropriate height.
Returns:
_showErrors
()
Show errors on both console and notifications.
CharmCollectionView.events.mouseenter
()
Show the charm deploy button on mouse pointer enter.
CharmCollectionView.events.mouseleave
()
Hide the charm deploy button on mouse pointer leave.
CharmCollectionView.initializer
()
Set searchText to cause the results to be found and rendered.
Set defaultSeries to cause all the results for the default series to be found and rendered.
CharmCollectionView.render
()
filterEntries
-
entries -
filter -
services
Given a set of entries as returned by the charm store "find" method (charms grouped by series), return the list filtered by 'filter'.
Parameters:
-
entriesArrayAn ordered collection of groups of charms, as returned by the charm store "find" method.
-
filterStringEither 'all', 'subordinates', or 'deployed'.
-
servicesObjectThe db.services model list.
Returns:
findCharms
()
Find charms that match a query.
getInterfaces
-
data
Given an array of interface data as stored in a charm's "required" and "provided" attributes, return an array of interface names.
Parameters:
-
dataArrayA collection of interfaces as stored in a charm's "required" and "provided" attributes.
Returns:
hideCharmFilterPicker
-
evt
Event handler to hide the charm filter picker
Parameters:
-
evtObjectThe event.
Returns:
isDeployedFilter
-
charm
Filter to determine if a charm is the same as any deployed services.
Parameters:
-
charmObjectThe charm to test.
Returns:
isSubFilter
-
charm
Filter to determine if a charm is a subordinate.
Parameters:
-
charmObjectThe charm to test.
Returns:
makeRenderableResults
-
entries
Given a set of grouped entries as returned by the charm store "find" method, return the same data but with the charms converted into data objects that are more amenable to rendering with handlebars.
Parameters:
-
entriesArrayAn ordered collection of groups of charms, as returned by the charm store "find" method.
Returns:
normalizeCharms.
()
Create a data structure friendly to the view.
setScroll
()
Undefined
private
static
Given a container node and a total height available, set the height of a '.charm-panel' node to fill the remaining height available to it within the container. This expects '.charm-panel' node to possibly have siblings before it, but not any siblings after it.
Returns:
showCharmFilterPicker
-
evt
Event handler to show the charm filter picker.
Parameters:
-
evtObjectThe event.
Returns:
showConfiguration
-
ev
Fire an event indicating that the charm panel should switch to the "configuration" for a given charm.
Parameters:
-
evObjectAn event object (with a
haltmethod).
Returns:
showDetails
-
ev
Fire an event indicating that the charm panel should switch to the "description" for a given charm.
Parameters:
-
evObjectAn event object (with a
haltmethod).
Returns:
toggleSectionVisibility
()
Undefined
private
static
A shared listener for click events on headers that open and close associated divs.
It expects the event target to contain an i tag used as a bootstrap icon, and to have a parent with the 'charm-section' class. The parent must contain an element with the 'collapsible' class. The i switches back and forth between up and down icons, and the collapsible element opens and closes.
