Canadian-Geospatial-Platform / geoview-plugins-config

Store and access plugins configuration from GeoCore for GeoView and RAMP
0 stars 2 forks source link

Document schema creation best practice #15

Open jolevesq opened 2 years ago

jolevesq commented 2 years ago

For the moment, we have one schema in French and one in English. This cause duplication and possible confusion if French and English does not deliver the same result. To overcome this we should have a schema that holds any languages we need. User will be able to switch from supported language and fill at the same time places where input in more then one language is needed.

As we migrate plugins from RAMP to GeoView, everyone of them will need a revised mono language schema. Those schemas will be use to generate on the fly the interface to fill the information and post to GeoCore.

At the same time, GeoView packages may also need configuration. It will work the same way from a schema to generate the interface.

    "swiper": {
        "type": "object",
        "properties": {
            "enable": {
                "type": "boolean",
                "title":  { "en": "Enable", "fr": "Actif" }
            },
            "type": {
                "type": "string",
                "title": { "en": "Type", "fr": "Mon type" },
                "enum": [
                    "en": { vertical", "horizontal" },
                    "fr": { vertical", "horizontal" },
                ],
                "default":  { "en": "vertical", "fr": ""vertical" }
            },
            "keyboardOffset": {
                "type": "number",
                "title": { "en": "Keyboard Movement", "fr" : "Mouvement Clavier" },
                "description": "{ "en": "Pixel value of swiper displacement.", "fr": "Valeur pixel" },
                "default": 10,
                "minimum": 1,
                "maximum": 100
            },
         ........
                    },
                    "required": ["id"]
                }
            }
        },
        "required": ["type", "keyboardOffset", "layers"]
    }