[MGNLUI-4538] Implement more and better column renderers for the tabular views Created: 28/May/18  Updated: 26/Jun/19  Resolved: 08/Aug/18

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: None
Fix Version/s: 6.0

Type: New Feature Priority: Neutral
Reporter: Aleksandr Pchelintcev Assignee: Roman Kovařík
Resolution: Done Votes: 0
Labels: v8-grid, vaadin8
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
dependency
is depended upon by MGNLUI-4554 Implement Vaadin 8 - based inline row... Closed
Template:
Acceptance criteria:
Empty
Date of First Response:
Epic Link: UI framework: grids and browsing
Sprint: Kromeriz 157, Kromeriz 158
Story Points: 8

 Description   

Replacing the former ColumnFormatter abstraction, we now have column renderers provided by Vaadin 8. We currently don't have many stock renderers though. We need to do at least:

  • carefully review the column definition and see what is the best way to configure the renderer
  • figure out how to supply column icons via renderers
  • implement node status renderer
  • implement boolean (with ticks/crosses)
  • implement renderer for tags
  • consider some free-form renderer with HTML/JSON

User story

When I want to know how my landing pages are performing, I want to see content performance data aggregated and displayed with an up/down arrow in a column in the Pages app, so that I can quickly tell which pages are doing well and which are doing poorly.

Acceptance criteria:

  • Implement 3 example column renderers:
    • Node status renderer (publishing status, read-only status)
    • Boolean renderer (tick/cross, up/down, yes/no)
    • Content tags renderer
  • Provide a basic document that explains how a third-party developer can implement their own column renderer.


 Comments   
Comment by Aleksandr Pchelintcev [ 23/Jul/18 ]

I have been looking at this topic a bit closer lately and have made some findings:

  • re: Renderer. It is a very useful concept, but looks like it is not a direct replacement of a column formatter abstraction from the M5 implementation. Renderers should come into play when there should be some sort of customisation on the client-side. Hence, by default we only should use the Text/Html renderers with HTML enabled by default.

In order to customise the rendered value, Grid seems to use the converter-like utility aka 'presentationProvider' (see https://vaadin.com/api/com/vaadin/ui/Grid.Column.html). This looks more like a current ColumnFormatter.

The renderers in turn could complement the presentation providers to add some light-weight interactivity (see ClickableRenderer etc). For instance, with renderers we could replace our current tag column with an implementation that doesn't require to use TokenField component to be rendered with the cells.

Re: databinding.

  • The whole way how we bind columns to the items/nodes may need to be refactored. We currently delegate binding of properties to the cells to a PropertySet (i.e. via public Grid.Column<T,?> addColumn(String propertyName) API) which complicates the value formatting.

Instead we probably should eventually use the public <V> Grid.Column<T,V> addColumn(ValueProvider<T,V> valueProvider) API and definition should provide the value provider implementation class (by default such class should be configured to smth like 'simplePropertyValueProvider' which merely gets a property value according to the current datasource logic).

Comment by Roman Kovařík [ 05/Sep/18 ]

We still use plain HTML for column icons, Vaadin doesn't support font renderers out of the box, see https://github.com/vaadin/framework/issues/7278.

Generated at Mon Feb 12 09:17:37 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.