Skip to content

Search plugin show null or undefined in displayName #11792

@stefanocudini

Description

@stefanocudini

Description

In Search Services results appear null or undefined in case of subproperties not exists in the layer

Image

How to reproduce

Look ${properties.not_exists_prop} at displayName
Below is the configuration that can reproduce the bug to add in localConfig, section desktop:

{
        "name": "Search",
        "cfg": {
          "withToggle": [
            "max-width: 768px",
            "min-width: 768px"
          ],
          "searchOptions": {
            "services": [
              {
                "type": "wfs",
                "name": "Search1",
                "displayName": "${properties.not_exists_prop} hello world",
                "subTitle": "level: mapstore:states",
                "priority": 1,
                "options": {
                  "url": "https://gs-stable.geo-solutions.it/geoserver/wfs",
                  "typeName": "mapstore:states",
                  "queriableAttributes": [
                    "state_name"
                  ],
                  "sortBy": "",
                  "maxFeatures": 5
                }
              },
              {
                "type": "wfs",
                "name": "Search2",
                "displayName": "${properties.not_exists_prop} cose",
                "subTitle": "level: mapstore:states",
                "priority": 1,
                "options": {
                  "url": "https://gs-stable.geo-solutions.it/geoserver/wfs",
                  "typeName": "mapstore:states",
                  "queriableAttributes": [
                    "state_name"
                  ],
                  "sortBy": "",
                  "maxFeatures": 5
                }
              }
            ]
          }
        }
      }

Expected Result
strip all null or undefined subprop with empty char or white space

Current Result
show null or undefined

  • Not browser related

Metadata

Metadata

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions