georchestra / mapstore2-georchestra

geOrchestra newest viewer
Other
6 stars 23 forks source link

attribute table - Possibility to override display field label #637

Open Gaetanbrl opened 1 year ago

Gaetanbrl commented 1 year ago

Description

With the aim of display complexe attributes for many users profils, some users asked to rename many fiels. This seems not possibile in mapstore config (attribute table plugin).

With this enhancement, it could be possible to display a label for a specific attribute/field name to ease user understanding.

Here an example to rename "s_r0.6" field name by "scenario_0.6" with new displayLabel config property (could be another prop name) :

{
  "name": "FeatureEditor",
  "cfg": {
    "maxZoom": 21,
    "customEditorsOptions": {
      "rules": [
        {
          "regex": {
            "attribute": "s_r0.6",
            "url": "regex to match a specific url",
            "typeName": "layerName"
          },
          "displayLabel": "scenario_0.6"
        }
      ]
    }
  }
}

@offtherailz @tdipisa Is it a complicated / acceptable contribution ? I will create a dedicated ticket if acceptable.

What do you thing about this enhancement ?

What kind of improvement you want to add? (check one with "x", remove the others)

Gaetanbrl commented 1 year ago

Maybe this is already possible with label (to override this name)? .

https://github.com/geosolutions-it/MapStore2/blob/3e1d020e5799de91d61a141e2bae6835456ac13b/web/client/plugins/FeatureGrid.jsx#L42

Not sur becayse i don't find anytyhing about that in the MS2 doc :

https://mapstore2.geosolutionsgroup.com/mapstore/docs/api/plugins#plugins.FeatureEditor

tdipisa commented 1 year ago

@Gaetanbrl as far as I understand you need this that will be available starting from v2023.02.00

Gaetanbrl commented 1 year ago

thanks @tdipisa, It's a great feature !

Just to undestand, if we change an alias for a random field, the attribute table (featureEditor) will display this alias into header col label ?

tdipisa commented 1 year ago

@Gaetanbrl yes, the alias is used in the whole application (eg. style editor, filter layer and so on) where the attribute name is displayed somehow.