hivemq / hivemq-edge

HiveMQ Edge is an MQTT gateway that enables interoperability between OT devices and IT systems. It translates diverse protocols into MQTT for streamlined communication and helps organize data into a unified namespace, making managing and streaming data across your infrastructure easier.
http://hivemq.com
Apache License 2.0
91 stars 20 forks source link

feat(18944): Add codeless interpolation for the Data Hub messages #344

Closed vanch3d closed 2 months ago

vanch3d commented 3 months ago

See https://hivemq.kanbanize.com/ctrl_board/57/cards/18944/details/

The PR introduces a reusable message (text) editor with support for variable interpolation.

The driving principle of the editor is to avoid the manual editing of the internal representation of a variable, i.e. ${policyId}. This is fraught with error due to misspellings (e.g.${policyid}or $(policyId) or$policyId}`), which will limit parsing and feedback in the text field.

The editor introduces the variables as a single token, created by auto-complete from the trigger character (@, see below) and selection from a filtered list of acceptable terms.

The variables are rendered differently from the rest of the text, cannot be edited by can be deleted as a single character (backspace for eemple).

The variables are converted to their proper internal syntax (e.g. @policyId to ${policyId}) on publishing. The internal syntax is also parsed and transformed to the token at loading (see below for caveats).

Design

Out-of-scope

Before

screenshot-localhost_3000-2024 03 28-14_08_15

After

screenshot-localhost_3000-2024 03 28-14_06_38

sfrehse commented 3 months ago

The placeholder name for the text field contains metricName which isn't correct for System.log. Screenshot 2024-04-02 at 17 41 28

sfrehse commented 2 months ago

Screenshot 2024-04-10 at 08 29 26

vanch3d commented 2 months ago

screenshot-localhost_3000-2024 04 10-15_19_15