Displaying icons on asset overlays
You can display icons on asset overlays depending on certain conditions. You may want to display a lock icon on private assets or an HD icon on top high definition assets.
To do so you have to configure a set of rules in $.dam.explore.indicators (you may want to setup another config domain, for instance $.board.explore or $.dam-import).
Note that the object described in indicators is an array of objects.
Describing a rule :
Config path | Default value | Description |
|---|---|---|
| None | Describe a rule to check when trying to display an icon. |
|
| Define the operator to check the rule condition. See Operators list for details. |
| None | Path in the entity object to retrieve the value from (i.e : |
| None | Value(s) to check the rule against, in the form of an array (i.e : |
| None | Ordering order of rules in case of several rules applies. |
| false | Do we skip the rule if several rules applies. |
Other options :
In the same object that the one where you define the rule you have others options to set to display your icon.
Config path | Default Value | Description |
|---|---|---|
| None | CSS class to add to the icon container. You can use any of the fontawesome icons or you can create your own. Example : |
| None | Other class to add to the icon wrapper. You can use your own css or the two available positioning class ( |
Operators list
all, contains, ct : All values from rule must be in entityValue
gt : All values from entity must be greater than rule max value
lt : All values from entity must be lower than rule min value
in, some : Some values from rule must be in entityValue
someGt : Some values from entity must be greater than rule max value
someLt : Some values from entity must be lower than rule min value
match : All values from entity must match pattern
noneMatch : None values from entity must match pattern
someMatch : Some values from entity must match pattern
eq, equals, equal, exact : Values from rule must be the same than entityValue
different, ne, neq, none : None of rule values must be in entity
minCommon : At least count common values between rule and entity
maxCommon : At most count common values between rule and entity
minCount : At least <count> values in entity
maxCount : At most <count> values in entity
Here is an example with different use case of icone insertion.
[ { // for this rule we are verifiying "ids" of mediaquality (asset property) // so we will have to use the operation eq // asset.mediaquality.id === 1 "rule": { "operator": "eq", "path": "mediaquality.id", "value": [1], "priority": 10 //"skip": true }, "icon": "hq-icon",//, "class": "cw-status-indicator-icon-top-left" } , { // for this rule we are verifiying the property code of the property subcategory of the asset // in this case we have to use the opertor "in" with String value between "[]" // the difference in this example is that subcategory is an array (type of child) and not a direct string/int value // subcategory.code === "3D" "rule": { "operator": "in", "path": "subcategory.code", "value": ["3D"], "priority": 10 //"skip": true }, "icon": "treeD-icon", "class": "cw-status-indicator-icon-top-right" }, { // for this rule we are verifiying the property copyright, which is of type "activated" "rule": { "operator": "eq", "path": "copyright", "value": [true], "priority": 12 //"skip": true }, "icon": "fa fa-copyright" } ]