metasfresh / metasfresh-webui-frontend-legacy

metasfresh Webui Frontend
GNU General Public License v2.0
57 stars 35 forks source link

Advanced tooltip support #1952

Closed metas-ts closed 5 years ago

metas-ts commented 6 years ago

Is this a bug or feature request?

FR

What is the current behavior?

What is the expected or desired behavior?

Widget with additional included fields

this is the JSON layout info that the API provides today:

```json "sections": [{ "columns": [{ "elementGroups": [{ "type": "primary", "elementsLine": [{ "elements": [{ "caption": "C_BPartner_ID | C_BPartner_Location_ID | AD_User_ID", "description": "Bezeichnet einen Geschäftspartner", "widgetType": "Lookup", "type": "primary", "size": "L", "viewEditorRenderMode": "never", "fields": [{ "field": "C_BPartner_ID", "source": "lookup", "emptyText": "leer", "newRecordWindowId": "540327", "newRecordCaption": "Neuer Geschäftspartner", "supportZoomInto": true }, { "field": "C_BPartner_Location_ID", "source": "list", "emptyText": "leer", "supportZoomInto": true }, { "field": "AD_User_ID", "source": "list", "emptyText": "leer", "supportZoomInto": true }] }] }, { "elements": [{ "caption": "Bill_BPartner_ID | Bill_Location_ID | Bill_User_ID", "description": "Geschäftspartners für die Rechnungsstellung", [..] }] ```

in the frontend, this look like this (more or less, note that in the screeshot, AD_User_ID is null): order

if e.g. the field AD_User_ID shall not be a widget, but tooltip. how should the json look in that case.. idea: introduse a property (or is it called variable?) called type which can be widget or overlay. in case of widget, everything stays the same. in case of overlay ...

there is an additional property icon ... icon-values can be text, help and more...they refer to small images..e.g. there is a tooltip-help.png file somewhere in the webui-frontend. so the API might return some JSON like:

```json "sections": [{ "columns": [{ "elementGroups": [{ "type": "primary", "elementsLine": [{ "elements": [{ "caption": "C_BPartner_ID | C_BPartner_Location_ID | AD_User_ID", "description": "Bezeichnet einen Geschäftspartner", "widgetType": "Lookup", "type": "primary", "size": "L", "viewEditorRenderMode": "never", "fields": [{ "field": "C_BPartner_ID", "source": "lookup", "emptyText": "leer", "newRecordWindowId": "540327", "newRecordCaption": "Neuer Geschäftspartner", "supportZoomInto": true, }, { "field": "C_BPartner_Location_ID", "source": "list", "emptyText": "leer", "supportZoomInto": true, }, { "field": "AD_User_ID", "type": "tooltip", "source": "text", "emptyText": "leer", "supportZoomInto": false, "icon": "text" }, { "field": "C_BPartner_ID_Help", "type": "tooltip", "source": "text", "emptyText": "leer", "supportZoomInto": false, "icon": "help" }] }] }, { "elements": [{ "caption": "Bill_BPartner_ID | Bill_Location_ID | Bill_User_ID", "description": "Geschäftspartners für die Rechnungsstellung", [..] }] ```

which could look like this: order_with_tooltip_bottons

"Single-Field" widget

The example above is about the case of a lookup widget that contains "internal" widget. There is also the case of a "normal field"

Right without any tooltip (right now) the JSON for the M_Warehouse_ID looks like this:

```json { "elements": [{ "caption": "M_Warehouse_ID", "description": "Lager oder Ort für Dienstleistung", "widgetType": "List", "viewEditorRenderMode": "never", "fields": [{ "field": "M_Warehouse_ID", "source": "list", "emptyText": "leer", "supportZoomInto": true }] }, [..] ```

with the same two tooltips that we have above, the JSON would look like this:

```json { "elements": [{ "caption": "M_Warehouse_ID", "description": "Lager oder Ort für Dienstleistung", "widgetType": "List", "viewEditorRenderMode": "never", "fields": [{ "field": "M_Warehouse_ID", "source": "list", "emptyText": "leer", "supportZoomInto": true }, { "field": "M_Warehouse_ID_Note", "type": "tooltip", "source": "text", "supportZoomInto": false, "icon": "text" }, { "field": "M_Warehouse_ID_HelpText", "type": "tooltip", "source": "text", "emptyText": "leer", "supportZoomInto": false, "icon": "help" }] }, [..] ```
metas-dh commented 6 years ago

from IT for https://github.com/metasfresh/metasfresh/issues/4556:

Show Product note as tooltip in order line:

siemiatj commented 6 years ago

I think it makes sense but will be tricky to implement, as tooltip is a widget which only gets active after clicking the product name. I'll try to think of something.

metas-ts commented 6 years ago

@siemiatj maybe you can thread the tooltip-composite-field like a field or table column of it's own right. Apart from needing to be near it's "main" field (in this case M_Product), it'S pretty independent afaiu.