am2222 / strapi-plugin-postgis

Add native postgis support to strapi.
https://am2222.github.io/strapi-plugin-postgis/
40 stars 14 forks source link

Uppercase in field name causes renderer to fail ? #4

Open Xtrazyx opened 1 year ago

Xtrazyx commented 1 year ago

Thks for the plugin btw ! It is an odd behavior, but here it is.

"Toto": {
      "columnType": {
        "type": "specificType",
        "args": [
          "geometry(POINT,4326)"
        ]
      },
      "type": "json",
      "fieldRenderer": "postgis"
    }

image

"toto": {
      "columnType": {
        "type": "specificType",
        "args": [
          "geometry(POINT,4326)"
        ]
      },
      "type": "json",
      "fieldRenderer": "postgis"
    }

image

am2222 commented 1 year ago

Hi @Xtrazyx , can you please give me some more details about the error?

Xtrazyx commented 1 year ago

When the field name begins by an uppercase, the map does not display in the content manager when creating or editing the entity.

In the example schema below if i rename "geolocation" in "Geolocation", the bug happens.

api/spot/content-types/spot/schema.json

{
  "kind": "collectionType",
  "collectionName": "spots",
  "info": {
    "singularName": "spot",
    "pluralName": "spots",
    "displayName": "Spot",
    "description": ""
  },
  "options": {
    "draftAndPublish": true
  },
  "pluginOptions": {},
  "attributes": {
    "geolocation": {
      "columnType": {
        "type": "specificType",
        "args": [
          "geometry(POINT,4326)"
        ]
      },
      "type": "json",
      "fieldRenderer": "postgis",
      "isSpatial": true,
      "srid": 4326,
      "coord_dimension": 2,
      "f_table_schema": "public",
      "geoType": "POINT"
    }
  }
}

Thank you for your time !