Filters

Capabilities

Capability

Support

Comment

Customize menu

Supported feature

See menus and toolbar

Choice data to display (filter)

Supported feature

Filter can be used to choose the data displayed to a user. See menus and toolbar

Define a default filter by table

Supported feature

A unique default filter can be set for each view. See Default filter

Define a default filter by user or group of user

Not supported feature

The filter cannot be set by user or group of user, only by dashboard. But the local storage can be used to store the filter for a user.

Set views or filter by URL parameters

Supported feature

The filter can be set by URL parameters, which allows creating links from other widgets or dashboards. See URL parameters

Concept

There are two kinds of tables on OnSphere Collection Table and Alarm Table, each of them permits to display some information in rows and columns. The alarms table is dedicated to display alarms with a lot of mechanisms linked to this kind of feature. The collection tables permit to display any kind of data in a table.

Filter

A filter is a kind of rule that permits to choose data to display on a table.

Filters

Default filter

Limit the filters for a table

Concept

By default all the filters available for a kind of tables and for the user are showed in the filter dropdown. But it’s possible to limit the filters available for a table.

Use-case

  • Create multiples collections or alarms tables with different usage, therefore different filters

  • Have specific filter by kind of user.

Usage

There are two ways to limit the filters available for a table:

  • Limit the rights Define rights to be able to use a filter the read rights must be set for the user.

  • Limit the filters available for a table with the property includeFilters and excludeFilters.

Includes/excludes

The filter to include in the table. Theses filters can be filtered by using the properties includeFilters and excludeFilters. If you set both, it will first remove all filters not present in the include list and then remove, from that list, the filters presents in the exclude list.

The wildcard “*” can be used to replace any subpath.

“root.alarms.*” will match any direct filter children of “alarms” but excludes “root.alarms” itself.

Views

Views define the structure of the table. It defines the different columns with options to filter or sort the content of the table.

The column views options are (in view):

  • formatter: specifies the date format (see https://day.js.org/docs/en/display/format). Used by TIMESTAMP render.

  • formatterExport: specifies the date Excel format export. Used by TIMESTAMP render when exporting.

  • disableTimezoneExport: disables user timezone usage when exporting to Excel format. The date will be displayed in UTC. Used by TIMESTAMP render when exporting.

  • schemaId: specifies the schema ID to use (ie. root.collection.schema) to query. Used by COLLECTION render.

  • format: specifies the property to display from schema ID. Used by COLLECTION render.

  • depth: specifies the depth at which to get nodes from. Used by COLLECTION render.

  • dependsOn: change the behavior of a column filter based on the content of another filter. Used by COLLECTION render. Can be used with schemaId and depth to filter a query results based on another filter we made before.

  • search: defines how the column filter searches the entries it offers, as {"method": "<local or remote>", "fields": ["<field-name>", ...]}. Used by COLLECTION render. With local, the default, the front-end filters the entries it already received. With remote, the term is sent to the collections module and matched against fields. A query returns at most 1000 entries, so remote is the only way to reach them all in a larger collection. The equivalent options on the form component are named searchMethod and searchTerms.

  • samePage: specifies whether to open URL in the same page or not (boolean value). Used by URL render.

JSON render

A column can use the JSON render to display a JSON value (object, array or scalar) held by a cell.

In the table, objects and arrays are shown as a compact summary ({...} / [...] with the number of items). Clicking the cell opens a modal displaying the value with the same collapsible, theme-aware viewer as the Json widget. Scalar values are displayed directly in the cell.

A JSON column is filterable with a contains / not contains predicate, matched against the JSON content of the cell.

The JSON render column options are:

  • display: viewer display options used in the modal (collapsed, displayObjectSize, objectSortKeys, keyName, …). See the Json widget display options.

  • style: viewer appearance in the modal, as a map of CSS variables with optional light / dark overrides. See the Json widget appearance.

{
  "name": "JSON",
  "render": "JSON",
  "position": 8,
  "options": {
    "display": {
      "displayDataTypes": true,
      "displayObjectSize": true,
      "keyName": "additionalData.json"
    },
    "style": {
      "--w-rjv-font-family": "\"Roboto Mono\", monospace",
      "light": {"--w-rjv-type-string-color": "#1b5e20"},
      "dark": {"--w-rjv-type-string-color": "#a5d6a7"}
    }
  }
}

Severity render

A column with the SEVERITY render shows the severity held by a cell and colors the row with it. A view has at most one SEVERITY column. A cell can hold:

  • a severity level, such as 300, matched against the severities defined in the system;

  • the id of a severity defined in the system;

  • a severity object, with its own name and colors;

  • one of the keywords notice, success, warning and error.

The keywords take their colors from the theme of the dashboard, in light and dark: notice is blue, success green, warning orange and error red. A severity defined in the system with the same id as a keyword takes precedence. The keywords are not listed in the severity filter of the column.

A severity object shows its name field. To show another field, set its path in options.format, such as label or display.text. The cell shows name when that field is empty. options.format does not apply to a severity level, an id or a keyword.

{
  "name": "Priority",
  "field": "priority",
  "render": "SEVERITY",
  "options": {
    "format": "label"
  }
}

Actions render

A column can use the ACTIONS render to show the entries of one or more menus as buttons on every row. Row buttons explains which entries show and the context they receive.

The actions render column options are:

  • menuReferences: the ids of the menus to show, in the same format as the widget menuReferences. A wrong id is refused when the configuration is pushed.

  • buttonContent: what each button shows. iconAndLabel (default) shows the icon of the entry, then its label. icon shows only the icon, with the label in a tooltip, and label only the label. An entry without icon shows its label whatever the value.

Buttons use the text color of the row for their text, icon and border, so they follow the severity colors of an alarm table.

The journalSettingsOverride.tableView of a journal can declare the column too, in a collection schema view or in a Journal element of a form. Its buttons then show on every journal entry, rows.clicked is that entry, and the menu contexts use the type Journal.

The column has no field and is never sortable or filterable: sortable and filterable default to false, and a configuration that sets a field, sortable: true or filterable: true is refused. In an alarm view, the column is only declared in the view.web file, not in the view properties. The column chooser hides and shows it like any other column. The Excel export skips it, and it is left out of columnOrder and hiddenColumnNames in the menu context, which exports rely on.

{
  "name": "Actions",
  "render": "ACTIONS",
  "position": 0,
  "width": "260 px",
  "options": {
    "menuReferences": ["root.collections.row-actions"],
    "buttonContent": "icon"
  }
}