Skip to content

Commit b02bca0

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

File tree

6 files changed

+197
-5
lines changed

6 files changed

+197
-5
lines changed

core/client/utils/utils.shapes.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,6 @@ export const Shapes = {
8080
translation: ['-50%', '-60%']
8181
},
8282
anchor: 'bottom-center'
83-
},
84-
add (name, shape) {
85-
this[name] = shape
8683
}
8784
}
8885

@@ -183,7 +180,7 @@ export function createShape (options) {
183180
const translation = shape.translation || [0, 0]
184181
const rotation = shape.rotation || 0
185182
beginSvgTag = `<svg xmlns="http://www.w3.org/2000/svg" width="${size.width}" height="${size.height}" preserveAspectRatio="none"
186-
style="transform: translate(${translation[0]},${translation[1]}) rotate(${rotation}deg); ${extraShapeStyle}">`
183+
style="transform: translate(${translation[0]},${translation[1]}) rotate(${rotation}deg); ${extraShapeStyle}">`
187184
beginSvgTag = addTagAttribute(beginSvgTag, 'viewBox', _.join(shape.viewBox, ' '))
188185
svgShapeContent = shape.content
189186
svgClipPath = ''
@@ -212,7 +209,7 @@ export function createShape (options) {
212209
if (options.stroke.opacity) svgShapeContent = addSvgAttribute(svgShapeContent, 'stroke-opacity', options.stroke.opacity)
213210
const clipId = uid()
214211
// clip the shape to avoid stroke overflow
215-
const clipPath = _.get(options.stroke, 'clipPath', true)
212+
const clipPath = _.get(shape, 'clipPath', true)
216213
if (clipPath) {
217214
svgShapeContent = addSvgAttribute(svgShapeContent, 'clip-path', `url(#${clipId})`)
218215
svgClipPath = `<clipPath id="${clipId}">${_.clone(shape.content)}</clipPath>`

extras/configs/helpers.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module.exports = {
2+
VERTICAL_SEPARATOR: {
3+
component: 'QSeparator',
4+
vertical: true
5+
},
6+
HORIZONTAL_SEPARATOR: {
7+
component: 'QSeparator',
8+
class: 'full-width',
9+
style: 'min-height: 1px;'
10+
}
11+
}

extras/configs/panes.left.js

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
module.exports = {
2+
activityLink: (name, icon, label) => {
3+
return {
4+
id: `${name}-activity-action`,
5+
icon,
6+
label,
7+
route: { name: `${name}-activity` }
8+
}
9+
},
10+
SETTINGS: {
11+
id: 'settings-action',
12+
icon: 'las la-cog',
13+
label: 'SETTINGS',
14+
renderer: 'item',
15+
dialog: {
16+
component: 'app/KSettings',
17+
title: 'SETTINGS',
18+
cancelAction: 'CANCEL',
19+
okAction: {
20+
id: 'apply-settings', label: 'APPLY', handler: 'apply'
21+
}
22+
}
23+
},
24+
ABOUT: {
25+
id: 'about-action',
26+
icon: 'las la-info',
27+
label: 'ABOUT',
28+
renderer: 'item',
29+
dialog: {
30+
component: 'app/KAbout', title: 'ABOUT', okAction: 'CLOSE'
31+
}
32+
},
33+
onlineHelp: (url) => {
34+
return {
35+
id: 'online-help-action',
36+
icon: 'las la-book',
37+
label: 'sideNav.ONLINE_HELP',
38+
url,
39+
renderer: 'item'
40+
}
41+
},
42+
CONTEXTUAL_HELP: {
43+
id: 'contextual-help-action',
44+
icon: 'las la-question-circle',
45+
label: 'sideNav.CONTEXTUAL_HELP',
46+
handler: { name: 'launchTour', params: ['home'] },
47+
renderer: 'item'
48+
},
49+
LOGOUT: {
50+
id: 'logout-action',
51+
icon: 'las la-sign-out-alt',
52+
label: 'sideNav.LOGOUT',
53+
route: { name: 'logout' },
54+
renderer: 'item'
55+
}
56+
}

extras/configs/panes.top.js

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
module.exports = {
2+
TOGGLE_LEGEND_VISIBILITY: {
3+
id: 'toggle-legend',
4+
component: 'action/KToggleWidgetVisibility',
5+
widgetId: 'legend-widget',
6+
icon: 'las la-list',
7+
tooltip: 'KToggleWidgetVisibility.SHOW_LEGEND',
8+
toggle: { tooltip: 'KToggleWidgetVisibility.HIDE_LEGEND' }
9+
},
10+
TOGGLE_POSITION_VISIBILITY: {
11+
id: 'toggle-position-sticky',
12+
component: 'action/KToggleStickyVisibility',
13+
stickyId: 'position-sticky',
14+
icon: 'las la-plus',
15+
label: 'KToggleStickyVisibility.SHOW_POSITION',
16+
toggle: { label: 'KToggleStickyVisibility.HIDE_POSITION' }
17+
},
18+
TOGGLE_NORTH_VISIBILITY: {
19+
id: 'toggle-north-sticky',
20+
component: 'action/KToggleStickyVisibility',
21+
stickyId: 'north-sticky',
22+
icon: 'las la-location-arrow',
23+
label: 'KToggleStickyVisibility.SHOW_NORTH',
24+
toggle: { label: 'KToggleStickyVisibility.HIDE_NORTH' }
25+
},
26+
TOGGLE_FULLSCREEN: {
27+
id: 'toggle-fullscreen',
28+
icon: 'las la-expand', tooltip: 'mixins.activity.ENTER_FULLSCREEN',
29+
toggle: { icon: 'las la-compress', tooltip: 'mixins.activity.EXIT_FULLSCREEN' },
30+
component: 'action/KToggleFullscreenAction'
31+
}
32+
}

extras/configs/widgets.left.js

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
module.exports = {
2+
LEGEND: {
3+
id: 'legend-widget',
4+
label: 'KLegend.LABEL',
5+
icon: 'las la-list',
6+
scrollable: true,
7+
content: { component: 'legend/KLegend' }
8+
},
9+
FEATURES_SELECTION: {
10+
id: 'selection-widget',
11+
label: 'KFeaturesSelection.LABEL',
12+
icon: 'las la-object-group',
13+
scrollable: true,
14+
content: { component: 'selection/KFeaturesSelection' }
15+
},
16+
STYLE_MANAGER: {
17+
id: 'style-manager',
18+
label: 'KStyleManager.TITLE',
19+
icon: 'las la-paint-brush',
20+
scrollable: true,
21+
content: { component: 'styles/KStyleManager' }
22+
}
23+
}

extras/configs/widgets.top.js

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
module.exports = {
2+
INFORMATION_BOX: {
3+
id: 'information-box',
4+
label: 'KInformationBox.LABEL',
5+
icon: 'las la-digital-tachograph',
6+
scrollable: true,
7+
content: { component: 'widget/KInformationBox' },
8+
header: [{
9+
id: 'center-view',
10+
icon: 'las la-eye',
11+
tooltip: 'KInformationBox.CENTER_ON',
12+
visible: 'hasFeature',
13+
handler: 'onCenterOn'
14+
}, {
15+
id: 'copy-properties',
16+
icon: 'las la-clipboard',
17+
tooltip: 'KInformationBox.COPY_PROPERTIES',
18+
visible: 'hasProperties',
19+
handler: 'onCopyProperties'
20+
}, {
21+
id: 'export-feature',
22+
icon: 'kdk:json.svg',
23+
tooltip: 'KInformationBox.EXPORT_FEATURE',
24+
visible: 'hasFeature',
25+
handler: 'onExportFeature'
26+
}]
27+
},
28+
TIME_SERIES: {
29+
id: 'time-series',
30+
label: 'TimeSeries.LABEL',
31+
icon: 'las la-chart-line',
32+
content: { component: 'TimeSeries' },
33+
header: [{ component: 'TimeSeriesToolbar' }]
34+
},
35+
ELEVATION_PROFILE: {
36+
id: 'elevation-profile',
37+
label: 'KElevationProfile.LABEL',
38+
icon: 'las la-mountain',
39+
content: { component: 'widget/KElevationProfile' },
40+
header: [{
41+
id: 'center-view',
42+
icon: 'las la-eye',
43+
tooltip: 'KElevationProfile.CENTER_ON',
44+
visible: 'hasFeature',
45+
handler: 'onCenterOn'
46+
}, {
47+
id: 'copy-properties',
48+
icon: 'las la-clipboard',
49+
tooltip: 'KElevationProfile.COPY_PROFILE',
50+
visible: 'hasProfile',
51+
handler: 'onCopyProfile'
52+
}, {
53+
id: 'export-feature',
54+
icon: 'kdk:json.svg',
55+
tooltip: 'KElevationProfile.EXPORT_PROFILE',
56+
visible: 'profile',
57+
handler: 'onExportProfile'
58+
}]
59+
},
60+
MAPILLARY_VIEWER: {
61+
id: 'mapillary-viewer',
62+
label: 'KMapillaryViewer.LABEL',
63+
icon: 'kdk:mapillary.png',
64+
content: { component: 'widget/KMapillaryViewer' },
65+
header: [{
66+
id: 'center',
67+
icon: 'las la-eye',
68+
tooltip: 'KMapillaryViewer.CENTER_ON',
69+
visible: 'hasImage',
70+
handler: 'centerMap'
71+
}]
72+
}
73+
}

0 commit comments

Comments
 (0)