Skip to content

Commit 770c7b2

Browse files
committed
wip: Provide ready-made configuration snippets to help set up the app's configuration file #1140
1 parent bb11b35 commit 770c7b2

File tree

4 files changed

+99
-69
lines changed

4 files changed

+99
-69
lines changed

extras/configs/panes.left.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ module.exports = {
6666
icon: 'las la-gavel',
6767
label: 'LEGAL_NOTICE',
6868
dialog: {
69-
title: 'LEGAL_NOTICE',
69+
title: 'LEGAL_NOTICE',
7070
component: 'document/KHtml',
7171
'component.url': 'legal-notice.html',
7272
okAction: 'CLOSE'
@@ -85,7 +85,6 @@ module.exports = {
8585
id: 'online-help-action',
8686
icon: 'las la-book',
8787
label: 'layout.ONLINE_HELP',
88-
url,
8988
renderer: 'item'
9089
}, options)
9190
},
@@ -108,7 +107,8 @@ module.exports = {
108107
icon: 'las la-sign-out-alt',
109108
label: 'layout.LOGOUT',
110109
route: {
111-
name: 'logout', ...(provider && { params: { provider } })
110+
name: 'logout',
111+
...(provider && { params: { provider } })
112112
},
113113
renderer: 'item'
114114
}, options)

extras/configs/panes.top.js

+62-40
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module.exports = {
2424
// fields: fields to search on
2525
const fields = options?.fields || ['name', 'description']
2626
return {
27-
component: 'collection/KFilter',
27+
component: 'collection/KFilter',
2828
label: options?.label,
2929
fields
3030
}
@@ -33,15 +33,15 @@ module.exports = {
3333
// renderer: renderer to be used to display the action
3434
const renderer = options?.renderer || 'button'
3535
return {
36-
id: 'locate-user',
36+
id: 'locate-user',
3737
label: renderer === 'item' ? 'layout.SHOW_USER_LOCATION' : null,
3838
tooltip: renderer === 'button' ? 'layout.SHOW_USER_LOCATION' : null,
39-
toggle: {
39+
toggle: {
4040
label: renderer === 'item' ? 'layout.HIDE_USER_LOCATION' : null,
41-
tooltip: renderer === 'button' ? 'layout.HIDE_USER_LOCATION': null,
41+
tooltip: renderer === 'button' ? 'layout.HIDE_USER_LOCATION' : null,
4242
},
4343
renderer,
44-
component: 'tools/KGeolocateTool'
44+
component: 'tools/KGeolocateTool'
4545
}
4646
},
4747
activeLocationSearchMode: (options) => {
@@ -50,8 +50,8 @@ module.exports = {
5050
const renderer = options?.renderer || 'button'
5151
const mode = options?.mode || 'search-location'
5252
return {
53-
id: 'search-location',
54-
icon: 'las la-search-location',
53+
id: 'search-location',
54+
icon: 'las la-search-location',
5555
label: renderer === 'item' ? 'layout.SEARCH_LOCATION' : null,
5656
tooltip: renderer === 'button' ? 'layout.SEARCH_LOCATION' : null,
5757
handler: { name: 'setTopPaneMode', params: [mode] },
@@ -66,29 +66,29 @@ module.exports = {
6666
return [
6767
module.exports.restoreMode({ mode: restoreMode, icon: options?.icon, tooltip: options?.tooltip }),
6868
helpers.verticalSeparator(),
69-
{
70-
component: 'tools/KSearchTool',
69+
{
70+
component: 'tools/KSearchTool',
7171
geocoders,
72-
autofocus: true
72+
autofocus: true
7373
}
7474
]
7575
},
7676
activeMeasureToolMode: (options) => {
77-
// renderer: renderer to be used to display the action
77+
// renderer: renderer to be used to display the action
7878
// mode: the mode used to declare the location search
7979
const renderer = options?.renderer || 'item'
8080
const mode = options?.mode || 'measure-tool'
8181
return {
82-
id: 'measure-tool',
83-
icon: 'las la-ruler-combined',
82+
id: 'measure-tool',
83+
icon: 'las la-ruler-combined',
8484
label: renderer === 'item' ? 'layout.MEASURE_TOOL' : null,
8585
tooltip: renderer === 'button' ? 'layout.MEASURE_TOOL' : null,
8686
handler: { name: 'setTopPaneMode', params: [mode] },
8787
renderer
8888
}
8989
},
9090
measureToolMode: (options) => {
91-
// restoreMode: mode to be restored when closing the mode
91+
// restoreMode: mode to be restored when closing the mode
9292
const restoreMode = options?.restoreMode || 'default'
9393
return [
9494
module.exports.restoreMode({ mode: restoreMode, icon: options?.icon, tooltip: options?.tooltip }),
@@ -98,59 +98,81 @@ module.exports = {
9898
},
9999
toggleLegend: (options) => {
100100
// renderer: renderer to be used to display the action
101-
const renderer = options?.renderer || 'item'
101+
const renderer = options?.renderer || 'item'
102102
return helpers.toggleWidget({
103-
widgetId: 'legend-widget',
104-
icon: 'las la-atlas',
105-
showMessage: 'layout.SHOW_LEGEND',
106-
hideMessage: 'layout.HIDE_LEGEND',
103+
widgetId: 'legend-widget',
104+
icon: 'las la-atlas',
105+
showMessage: 'layout.SHOW_LEGEND',
106+
hideMessage: 'layout.HIDE_LEGEND',
107107
renderer
108108
})
109109
},
110110
toggleTimeSeries: (options) => {
111111
// renderer: renderer to be used to display the action
112112
const renderer = options?.renderer || 'item'
113113
return helpers.toggleWidget({
114-
widgetId: 'time-series-widget',
115-
icon: 'las la-chart-line',
116-
showMessage: 'layout.SHOW_TIME_SERIES',
117-
hideMessage: 'layout.HIDE_TIME_SERIES',
114+
widgetId: 'time-series-widget',
115+
icon: 'las la-chart-line',
116+
showMessage: 'layout.SHOW_TIME_SERIES',
117+
hideMessage: 'layout.HIDE_TIME_SERIES',
118+
renderer
119+
})
120+
},
121+
toggleSelection: (options) => {
122+
// renderer: renderer to be used to display the action
123+
const renderer = options?.renderer || 'item'
124+
return helpers.toggleWidget({
125+
widgetId: 'selection-widget',
126+
icon: 'las la-object-group',
127+
showMessage: 'layout.SHOW_DISPLAY_SELECTION',
128+
hideMessage: 'layout.HIDE_DISPLAY_SELECTION',
118129
renderer
119-
})
130+
})
131+
},
132+
toggleStyleManager: (options) => {
133+
// renderer: renderer to be used to display the action
134+
const renderer = options?.renderer || 'item'
135+
return helpers.toggleWidget({
136+
widgetId: 'style-manager',
137+
icon: 'las la-paint-brush',
138+
showMessage: 'layout.SHOW_DISPLAY_STYLES',
139+
hideMessage: 'layout.HIDE_DISPLAY_STYLES',
140+
renderer
141+
})
120142
},
121143
togglePosition: (options) => {
122144
// renderer: renderer to be used to display the action
123-
const renderer = options?.renderer || 'item'
145+
const renderer = options?.renderer || 'item'
124146
return helpers.toggleSticky({
125-
stickyId: 'position-sticky',
126-
icon: 'las la-plus',
127-
showMessage: 'layout.SHOW_POSITION',
128-
hideMessage: 'layout.HIDE_POSITION',
147+
stickyId: 'position-sticky',
148+
icon: 'las la-plus',
149+
showMessage: 'layout.SHOW_POSITION',
150+
hideMessage: 'layout.HIDE_POSITION',
129151
renderer
130152
})
131153
},
132154
toggleNorthArrow: (options) => {
133155
// renderer: renderer to be used to display the action
134-
const renderer = options?.renderer || 'item'
156+
const renderer = options?.renderer || 'item'
135157
return helpers.toggleSticky({
136-
stickyId: 'north-arrow-sticky',
137-
icon: 'las la-location-arrow',
138-
showMessage: 'layout.SHOW_NORTH_ARROW',
139-
hideMessage: 'layout.HIDE_NORTH_ARROW',
158+
stickyId: 'north-arrow-sticky',
159+
icon: 'las la-location-arrow',
160+
showMessage: 'layout.SHOW_NORTH_ARROW',
161+
hideMessage: 'layout.HIDE_NORTH_ARROW',
140162
renderer
141163
})
142164
},
143165
toggleFullscreen: (options) => {
144166
// renderer: renderer to be used to display the action
145-
const renderer = options?.renderer || 'item'
167+
const renderer = options?.renderer || 'item'
146168
return {
147169
id: 'toggle-fullscreen',
148170
component: 'action/KToggleFullscreenAction',
149-
icon: 'las la-expand',
150-
label: renderer === 'item' ? 'layout.ENTER_FULLSCREEN' : null,
171+
icon: 'las la-expand',
172+
label: renderer === 'item' ? 'layout.ENTER_FULLSCREEN' : null,
151173
tooltip: renderer === 'button' ? 'layout.ENTER_FULLSCREEN' : null,
152-
toggle: {
153-
icon: 'las la-compress',
174+
toggle: {
175+
icon: 'las la-compress',
154176
label: renderer === 'item' ? 'layout.EXIT_FULLSCREEN' : null,
155177
tooltip: renderer === 'button' ? 'layout.EXIT_FULLSCREEN' : null
156178
},
@@ -165,7 +187,7 @@ module.exports = {
165187
const icon = options?.icon || 'las la-times'
166188
const tooltip = options?.tooltip || null
167189
return {
168-
id: `restore-${mode}`,
190+
id: `restore-${mode}`,
169191
icon,
170192
tooltip,
171193
handler: { name: 'setTopPaneMode', params: [mode] }

map/client/i18n/map_en.json

+16-12
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@
66
"PROJECT_LAYERS_LABEL": "Data",
77
"PROJECT_VIEWS_LABEL": "Views",
88
"layout": {
9-
"SHOW_USER_LOCATION": "Display my location",
9+
"SHOW_USER_LOCATION": "Display my location",
1010
"HIDE_USER_LOCATION": "Hide my location",
1111
"SEARCH_LOCATION": "Search a location",
1212
"MEASURE_TOOL": "Active measure tool",
1313
"SHOW_LEGEND": "Show legend",
1414
"HIDE_LEGEND": "Hide legend",
15+
"SHOW_DISPLAY_SELECTION": "Show display selection",
16+
"HIDE_DISPLAY_SELECTION": "Hide display selection",
17+
"SHOW_DISPLAY_STYLES": "Show display styles",
18+
"HIDE_DISPLAY_STYLES": "Hide display styles",
1519
"SHOW_POSITION": "Show geographical coordinates",
1620
"HIDE_POSITION": "Hide geographical coordinates",
1721
"SHOW_NORTH_ARROW": "Show north arrow",
@@ -93,10 +97,10 @@
9397
"DISPLAY_STYLES": "Display styles",
9498
"HIDE_LEGEND": "Hide legend",
9599
"SEARCH_LOCATION": "Search a location",
96-
"ADD_VIEW": "Add view",
100+
"ADD_VIEW": "Add view",
97101
"CREATE_VIEW": "Create view",
98102
"CREATE_PROJECT": "Create project",
99-
"MANAGE_PROJECT": "Manage project",
103+
"MANAGE_PROJECT": "Manage project",
100104
"SYNCHRONIZE_TIMELINE_LABEL": "Synchronize with timeline",
101105
"TOOLS": "Tools",
102106
"SAVE_LAYER_EDITION_CHANGES": "Save edition changes",
@@ -377,7 +381,7 @@
377381
"CREATE_NEW_LAYER_LABEL": "Confirm the creation of your new layer and start editing the data on the map."
378382
},
379383
"create-view": {
380-
"NAME_FIELD_LABEL": "Saisissez un nom pour votre nouvelle vue",
384+
"NAME_FIELD_LABEL": "Saisissez un nom pour votre nouvelle vue",
381385
"DESCRIPTION_FIELD_LABEL": "Enter the name of your new view.",
382386
"LAYERS_FIELD_LABEL": "Select whether the currently active layers will be restaured with this view or not.",
383387
"APPLY_BUTTON_LABEL": "Confirm the creation of your new favorite view."
@@ -442,7 +446,7 @@
442446
"PLACEHOLDER": "Navigate the see the coordinates",
443447
"COPY": "Copy the coordinates",
444448
"CLEAR": "Clear",
445-
"POSITION_COPIED":"Position copied to clipboard",
449+
"POSITION_COPIED": "Position copied to clipboard",
446450
"CANNOT_COPY_POSITION": "Unable to copy the position to clipboard. Your browser does not support this functionality",
447451
"OUTSIDE_MAP": "Indeterminated position"
448452
},
@@ -490,7 +494,7 @@
490494
},
491495
"KProjectEditor": {
492496
"BACKGROUND_LAYER_REQUIRED": "A project at least requires a background layer."
493-
},
497+
},
494498
"KFeaturesFilter": {
495499
"TITLE": "Data filter for layer",
496500
"SELECT_PROPERTY_LABEL": "Select a target property to start",
@@ -633,8 +637,8 @@
633637
"KInformationBox": {
634638
"LABEL": "Information box",
635639
"NO_FEATURE_PROPERTIES": "No information available",
636-
"CENTER_ON": "Center the view on the object",
637-
"COPY_PROPERTIES": "Copy the values to the clipboard",
640+
"CENTER_ON": "Center the view on the object",
641+
"COPY_PROPERTIES": "Copy the values to the clipboard",
638642
"PROPERTIES_COPIED": "Values copied to clipboard",
639643
"CANNOT_COPY_PROPERTIES": "Unable to copy the values to clipboard. Your browser does not support this functionality",
640644
"EXPORT_FEATURE": "Export the object",
@@ -743,8 +747,8 @@
743747
"NO_DATA_AVAILABLE": "No profile available",
744748
"INVALID_GEOMETRY": "Selected object geometry is invalid",
745749
"COMPUTING_PROFILE": "Profile computation in progress",
746-
"CENTER_ON": "Center the view on the object",
747-
"COPY_PROFILE": "Copy the profile to the clipboard",
750+
"CENTER_ON": "Center the view on the object",
751+
"COPY_PROFILE": "Copy the profile to the clipboard",
748752
"PROFILE_COPIED": "Profile copied to clipboard",
749753
"CANNOT_COPY_PROFILE": "Unable to copy the profile to clipboard. Your browser does not support this functionality",
750754
"EXPORT_PROFILE": "Export the profile",
@@ -769,7 +773,7 @@
769773
"KPosition": {
770774
"COPY": "Copy the coordinates",
771775
"CLOSE": "Close",
772-
"POSITION_COPIED":"Position copied to clipboard",
776+
"POSITION_COPIED": "Position copied to clipboard",
773777
"CANNOT_COPY_POSITION": "Unable to copy the position to clipboard. Your browser does not support this functionality",
774778
"OUTSIDE_MAP": "Undefined position"
775779
},
@@ -807,4 +811,4 @@
807811
"STROKE_OPACITY": "Stroke opacity",
808812
"STROKE_WIDTH": "Stroke width"
809813
}
810-
}
814+
}

0 commit comments

Comments
 (0)