chore: Always put type before impacts in the schema definition.

This commit is contained in:
Alexis Métaireau 2024-04-01 14:57:29 +02:00
parent 0e12e0e5c3
commit d52a0c63f0

View file

@ -5,25 +5,25 @@ import { translate } from './i18n.js'
export const SCHEMA = { export const SCHEMA = {
browsable: { browsable: {
type: Boolean,
impacts: ['ui'], impacts: ['ui'],
type: Boolean,
}, },
captionBar: { captionBar: {
impacts: ['ui'],
type: Boolean, type: Boolean,
impacts: ['ui'],
label: translate('Do you want to display a caption bar?'), label: translate('Do you want to display a caption bar?'),
default: false, default: false,
impacts: [], impacts: [],
}, },
captionMenus: { captionMenus: {
impacts: ['ui'],
type: Boolean, type: Boolean,
impacts: ['ui'],
label: translate('Do you want to display caption menus?'), label: translate('Do you want to display caption menus?'),
default: true, default: true,
}, },
color: { color: {
impacts: ['data'],
type: String, type: String,
impacts: ['data'],
handler: 'ColorPicker', handler: 'ColorPicker',
label: translate('color'), label: translate('color'),
helpEntries: 'colorValue', helpEntries: 'colorValue',
@ -39,23 +39,23 @@ export const SCHEMA = {
impacts: ['data'], impacts: ['data'],
}, },
dashArray: { dashArray: {
impacts: ['data'],
type: String, type: String,
impacts: ['data'],
label: translate('dash array'), label: translate('dash array'),
helpEntries: 'dashArray', helpEntries: 'dashArray',
inheritable: true, inheritable: true,
}, },
datalayersControl: { datalayersControl: {
impacts: ['ui'],
type: Boolean, type: Boolean,
impacts: ['ui'],
nullable: true, nullable: true,
handler: 'DataLayersControl', handler: 'DataLayersControl',
label: translate('Display the data layers control'), label: translate('Display the data layers control'),
default: true, default: true,
}, },
defaultView: { defaultView: {
impacts: [], // no need to update the ui, only useful when loading the map
type: String, type: String,
impacts: [], // no need to update the ui, only useful when loading the map
label: translate('Default view'), label: translate('Default view'),
choices: [ choices: [
['center', translate('Saved center and zoom')], ['center', translate('Saved center and zoom')],
@ -66,9 +66,9 @@ export const SCHEMA = {
default: 'center', default: 'center',
}, },
description: { description: {
label: translate('description'),
impacts: ['ui'],
type: 'Text', type: 'Text',
impacts: ['ui'],
label: translate('description'),
helpEntries: 'textFormatting', helpEntries: 'textFormatting',
}, },
displayOnLoad: { displayOnLoad: {
@ -83,39 +83,39 @@ export const SCHEMA = {
}, },
easing: { impacts: [], type: Boolean, default: false }, easing: { impacts: [], type: Boolean, default: false },
editinosmControl: { editinosmControl: {
impacts: ['ui'],
type: Boolean, type: Boolean,
impacts: ['ui'],
nullable: true, nullable: true,
label: translate('Display the control to open OpenStreetMap editor'), label: translate('Display the control to open OpenStreetMap editor'),
default: null, default: null,
}, },
embedControl: { embedControl: {
impacts: ['ui'],
type: Boolean, type: Boolean,
impacts: ['ui'],
nullable: true, nullable: true,
label: translate('Display the embed control'), label: translate('Display the embed control'),
default: true, default: true,
}, },
facetKey: { impacts: ['ui'], type: String }, facetKey: { impacts: ['ui'], type: String },
fill: { fill: {
impacts: ['data'],
type: Boolean, type: Boolean,
impacts: ['data'],
label: translate('fill'), label: translate('fill'),
helpEntries: 'fill', helpEntries: 'fill',
inheritable: true, inheritable: true,
default: true, default: true,
}, },
fillColor: { fillColor: {
impacts: ['data'],
type: String, type: String,
impacts: ['data'],
handler: 'ColorPicker', handler: 'ColorPicker',
label: translate('fill color'), label: translate('fill color'),
helpEntries: 'fillColor', helpEntries: 'fillColor',
inheritable: true, inheritable: true,
}, },
fillOpacity: { fillOpacity: {
impacts: ['data'],
type: Number, type: Number,
impacts: ['data'],
min: 0.1, min: 0.1,
max: 1, max: 1,
step: 0.1, step: 0.1,
@ -125,14 +125,14 @@ export const SCHEMA = {
}, },
filterKey: { impacts: [], type: String }, filterKey: { impacts: [], type: String },
fromZoom: { fromZoom: {
impacts: [], // not needed
type: Number, type: Number,
impacts: [], // not needed
label: translate('From zoom'), label: translate('From zoom'),
helpText: translate('Optional.'), helpText: translate('Optional.'),
}, },
fullscreenControl: { fullscreenControl: {
impacts: ['ui'],
type: Boolean, type: Boolean,
impacts: ['ui'],
nullable: true, nullable: true,
label: translate('Display the fullscreen control'), label: translate('Display the fullscreen control'),
default: true, default: true,
@ -142,8 +142,8 @@ export const SCHEMA = {
impacts: ['data'], impacts: ['data'],
}, },
iconClass: { iconClass: {
impacts: ['data'],
type: String, type: String,
impacts: ['data'],
label: translate('Icon shape'), label: translate('Icon shape'),
inheritable: true, inheritable: true,
choices: [ choices: [
@ -155,8 +155,8 @@ export const SCHEMA = {
default: 'Default', default: 'Default',
}, },
iconOpacity: { iconOpacity: {
impacts: ['data'],
type: Number, type: Number,
impacts: ['data'],
min: 0.1, min: 0.1,
max: 1, max: 1,
step: 0.1, step: 0.1,
@ -165,8 +165,8 @@ export const SCHEMA = {
default: 1, default: 1,
}, },
iconUrl: { iconUrl: {
impacts: ['data'],
type: String, type: String,
impacts: ['data'],
handler: 'IconUrl', handler: 'IconUrl',
label: translate('Icon symbol'), label: translate('Icon symbol'),
inheritable: true, inheritable: true,
@ -177,16 +177,16 @@ export const SCHEMA = {
}, },
interactive: { interactive: {
impacts: ['data'],
type: Boolean, type: Boolean,
impacts: ['data'],
label: translate('Allow interactions'), label: translate('Allow interactions'),
helpEntries: 'interactive', helpEntries: 'interactive',
inheritable: true, inheritable: true,
default: true, default: true,
}, },
labelDirection: { labelDirection: {
impacts: ['data'],
type: String, type: String,
impacts: ['data'],
label: translate('Label direction'), label: translate('Label direction'),
inheritable: true, inheritable: true,
choices: [ choices: [
@ -199,14 +199,14 @@ export const SCHEMA = {
default: 'auto', default: 'auto',
}, },
labelInteractive: { labelInteractive: {
impacts: ['data'],
type: Boolean, type: Boolean,
impacts: ['data'],
label: translate('Labels are clickable'), label: translate('Labels are clickable'),
inheritable: true, inheritable: true,
}, },
labelKey: { labelKey: {
impacts: ['data'],
type: String, type: String,
impacts: ['data'],
helpEntries: 'labelKey', helpEntries: 'labelKey',
placeholder: translate('Default: name'), placeholder: translate('Default: name'),
label: translate('Label key'), label: translate('Label key'),
@ -215,20 +215,20 @@ export const SCHEMA = {
licence: { impacts: ['ui'], type: String, label: translate('licence') }, licence: { impacts: ['ui'], type: String, label: translate('licence') },
limitBounds: { impacts: ['limit-bounds'], type: Object }, limitBounds: { impacts: ['limit-bounds'], type: Object },
locateControl: { locateControl: {
impacts: ['ui'],
type: Boolean, type: Boolean,
impacts: ['ui'],
nullable: true, nullable: true,
label: translate('Display the locate control'), label: translate('Display the locate control'),
}, },
longCredit: { longCredit: {
impacts: ['ui'],
type: 'Text', type: 'Text',
impacts: ['ui'],
label: translate('Long credits'), label: translate('Long credits'),
helpEntries: ['longCredit', 'textFormatting'], helpEntries: ['longCredit', 'textFormatting'],
}, },
measureControl: { measureControl: {
impacts: ['ui'],
type: Boolean, type: Boolean,
impacts: ['ui'],
nullable: true, nullable: true,
label: translate('Display the measure control'), label: translate('Display the measure control'),
}, },
@ -239,14 +239,14 @@ export const SCHEMA = {
default: false, default: false,
}, },
moreControl: { moreControl: {
impacts: ['ui'],
type: Boolean, type: Boolean,
impacts: ['ui'],
label: translate('Do you want to display the «more» control?'), label: translate('Do you want to display the «more» control?'),
default: true, default: true,
}, },
name: { name: {
impacts: ['ui', 'data'],
type: String, type: String,
impacts: ['ui', 'data'],
label: translate('name'), label: translate('name'),
}, },
onLoadPanel: { onLoadPanel: {
@ -262,8 +262,8 @@ export const SCHEMA = {
default: 'none', default: 'none',
}, },
opacity: { opacity: {
impacts: ['data'],
type: Number, type: Number,
impacts: ['data'],
min: 0.1, min: 0.1,
max: 1, max: 1,
step: 0.1, step: 0.1,
@ -279,8 +279,8 @@ export const SCHEMA = {
inheritable: true, inheritable: true,
}, },
outlinkTarget: { outlinkTarget: {
impacts: [],
type: String, type: String,
impacts: [],
label: translate('Open link in…'), label: translate('Open link in…'),
inheritable: true, inheritable: true,
default: 'blank', default: 'blank',
@ -292,20 +292,20 @@ export const SCHEMA = {
}, },
overlay: { impacts: ['background'], type: Object }, overlay: { impacts: ['background'], type: Object },
permanentCredit: { permanentCredit: {
impacts: ['ui'],
type: 'Text', type: 'Text',
impacts: ['ui'],
label: translate('Permanent credits'), label: translate('Permanent credits'),
helpEntries: ['permanentCredit', 'textFormatting'], helpEntries: ['permanentCredit', 'textFormatting'],
}, },
permanentCreditBackground: { permanentCreditBackground: {
impacts: ['ui'],
type: Boolean, type: Boolean,
impacts: ['ui'],
label: translate('Permanent credits background'), label: translate('Permanent credits background'),
default: true, default: true,
}, },
popupContentTemplate: { popupContentTemplate: {
impacts: [], // not needed
type: 'Text', type: 'Text',
impacts: [], // not needed
label: translate('Popup content template'), label: translate('Popup content template'),
helpEntries: ['dynamicProperties', 'textFormatting'], helpEntries: ['dynamicProperties', 'textFormatting'],
placeholder: '# {name}', placeholder: '# {name}',
@ -313,8 +313,8 @@ export const SCHEMA = {
default: '# {name}\n{description}', default: '# {name}\n{description}',
}, },
popupShape: { popupShape: {
impacts: [], // not needed
type: String, type: String,
impacts: [], // not needed
label: translate('Popup shape'), label: translate('Popup shape'),
inheritable: true, inheritable: true,
choices: [ choices: [
@ -325,8 +325,8 @@ export const SCHEMA = {
default: 'Default', default: 'Default',
}, },
popupTemplate: { popupTemplate: {
impacts: [], // not needed
type: String, type: String,
impacts: [], // not needed
label: translate('Popup content style'), label: translate('Popup content style'),
inheritable: true, inheritable: true,
choices: [ choices: [
@ -349,36 +349,42 @@ export const SCHEMA = {
default: true, default: true,
}, },
scrollWheelZoom: { scrollWheelZoom: {
impacts: ['ui'],
type: Boolean, type: Boolean,
impacts: ['ui'],
label: translate('Allow scroll wheel zoom?'), label: translate('Allow scroll wheel zoom?'),
}, },
searchControl: { searchControl: {
impacts: ['ui'],
type: Boolean, type: Boolean,
impacts: ['ui'],
nullable: true, nullable: true,
label: translate('Display the search control'), label: translate('Display the search control'),
default: true, default: true,
}, },
shortCredit: { shortCredit: {
impacts: ['ui'],
type: String, type: String,
impacts: ['ui'],
label: translate('Short credits'), label: translate('Short credits'),
helpEntries: ['shortCredit', 'textFormatting'], helpEntries: ['shortCredit', 'textFormatting'],
}, },
showLabel: { showLabel: {
impacts: ['data'],
type: Boolean, type: Boolean,
impacts: ['data'],
nullable: true, nullable: true,
label: translate('Display label'), label: translate('Display label'),
inheritable: true, inheritable: true,
default: false, default: false,
}, },
slideshow: { impacts: ['ui'], type: Object }, slideshow: {
slugKey: { impacts: [], type: String }, type: Object,
impacts: ['ui'],
},
slugKey: {
type: String,
impacts: [],
},
smoothFactor: { smoothFactor: {
impacts: ['data'],
type: Number, type: Number,
impacts: ['data'],
min: 0, min: 0,
max: 10, max: 10,
step: 0.5, step: 0.5,
@ -389,23 +395,26 @@ export const SCHEMA = {
}, },
sortKey: { impacts: ['data', 'datalayer-index'], type: String }, sortKey: { impacts: ['data', 'datalayer-index'], type: String },
starControl: { starControl: {
impacts: ['ui'],
type: Boolean, type: Boolean,
impacts: ['ui'],
nullable: true, nullable: true,
label: translate('Display the star map button'), label: translate('Display the star map button'),
}, },
stroke: { stroke: {
impacts: ['data'],
type: Boolean, type: Boolean,
impacts: ['data'],
label: translate('stroke'), label: translate('stroke'),
helpEntries: 'stroke', helpEntries: 'stroke',
inheritable: true, inheritable: true,
default: true, default: true,
}, },
tilelayer: { impacts: ['background'], type: Object }, tilelayer: {
type: Object,
impacts: ['background'],
},
tilelayersControl: { tilelayersControl: {
impacts: ['ui'],
type: Boolean, type: Boolean,
impacts: ['ui'],
nullable: true, nullable: true,
label: translate('Display the tile layers control'), label: translate('Display the tile layers control'),
}, },
@ -420,8 +429,8 @@ export const SCHEMA = {
impacts: ['data'], impacts: ['data'],
}, },
weight: { weight: {
impacts: ['data'],
type: Number, type: Number,
impacts: ['data'],
min: 1, min: 1,
max: 20, max: 20,
step: 1, step: 1,
@ -430,19 +439,19 @@ export const SCHEMA = {
default: 3, default: 3,
}, },
zoom: { zoom: {
impacts: [], // default zoom, doesn't need to be updated
type: Number, type: Number,
impacts: [], // default zoom, doesn't need to be updated
}, },
zoomControl: { zoomControl: {
impacts: ['ui'],
type: Boolean, type: Boolean,
impacts: ['ui'],
nullable: true, nullable: true,
label: translate('Display the zoom control'), label: translate('Display the zoom control'),
default: true, default: true,
}, },
zoomTo: { zoomTo: {
impacts: [], // not need to update the view
type: Number, type: Number,
impacts: [], // not need to update the view
placeholder: translate('Inherit'), placeholder: translate('Inherit'),
helpEntries: 'zoomTo', helpEntries: 'zoomTo',
label: translate('Default zoom level'), label: translate('Default zoom level'),