Hidden Units
Last updated
Was this helpful?
Last updated
Was this helpful?
The HideUnitsService
service delivers a filter capability to all current methods present in the UnitsResource (used by the frontend in many situations including dashboards and channels management).
This service is customizable since plugin-liverig 3.7.0
, hiding the Unit on all frontend (HIDE_ALL) or maintaining the autocomplete feature on the channels management screen (NOT_INPUT_CHANNEL). The HIDE_ALL type of filtering is the default type, even if it is not specified. This service is exposed to be used by any plugin.
This service provides two methods on 3.3.0
release:
hideUnits
- hide desired units
contains
- check whether a unit is already hidden
applyFilter
- returns a boolean that represents if a unit is being hidden on all frontend (HIDE_ALL) or maintaining the autocomplete feature on the channels management screen (NOT_INPUT_CHANNEL).
filtersUOM
- returns a list containing all filtered units (only the unit).
filters
- returns a list containing all filtered units and their respective filterTyper (HIDE_ALL or NOT_INPUT_CHANNEL).
filtersByUnit
- returns a UnitsFilter.Type if the filter list contains specified unit
filtersByType
- returns all filtered units by filter type (UnitsFilter.Type)
The following Groovy plugin example hides "UGT" and "rad" units on all frontend (HIDE_ALL) and "miUS2" unit while maintaining the autocomplete feature on the channels management screen (NOT_INPUT_CHANNEL):
It's expected the following behaviors in case an unit be hidden but was being used at:
It's expected the following behaviors in case an unit be hidden but was being used at:
Standard Channels: the user will receive an warning
Data Normalization (either as the source or target channel unit): no warning is shown at the Data Management screen, and the normalization will be executed as the unit was visible.
Asset Parameters, Data Management or Unit Management Tools: The user will receive no warning, but the unit will not be suggested by the autocomplete (HIDE_ALL) or retain the suggestion by the autocomplete (NOT_INPUT_CHANNEL).
Note: This in administration page since it uses the @requirePlugins
statement. .
Hidden units will not be available in Live's autocomplete tools if the HIDE_ALL type is used (like those available at the , , , and screens). The NOT_INPUT_CHANNEL filter type will retain the autocomplete tools on the screen.
Display Units: the user will be prevented from saving until they modify the hidden variable. This can break some widgets, just like when an alias or an unit extension is modified ()