Skip to content

Commit 40af5d4

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

File tree

1 file changed

+62
-48
lines changed

1 file changed

+62
-48
lines changed

extras/configs/panes.left.js

+62-48
Original file line numberDiff line numberDiff line change
@@ -8,47 +8,55 @@ module.exports = {
88
route: { name: `${name}-activity`, params }
99
}
1010
},
11-
SETTINGS: {
12-
id: 'settings-action',
13-
icon: 'las la-cog',
14-
label: 'layout.SETTINGS',
15-
renderer: 'item',
16-
dialog: {
17-
component: 'app/KSettings',
18-
title: 'SETTINGS',
19-
cancelAction: 'CANCEL',
20-
okAction: {
21-
id: 'apply-settings', label: 'APPLY', handler: 'apply'
11+
settings: (options) => {
12+
return Object.assign({
13+
id: 'settings-action',
14+
icon: 'las la-cog',
15+
label: 'layout.SETTINGS',
16+
renderer: 'item',
17+
dialog: {
18+
component: 'app/KSettings',
19+
title: 'SETTINGS',
20+
cancelAction: 'CANCEL',
21+
okAction: {
22+
id: 'apply-settings', label: 'APPLY', handler: 'apply'
23+
}
2224
}
23-
}
25+
}, options)
2426
},
25-
ABOUT: {
26-
id: 'about-action',
27-
icon: 'las la-info',
28-
label: 'layout.ABOUT',
29-
renderer: 'item',
30-
dialog: {
31-
component: 'app/KAbout', title: 'ABOUT', okAction: 'CLOSE'
32-
}
27+
about: (options) => {
28+
return Object.assign({
29+
id: 'about-action',
30+
icon: 'las la-info',
31+
label: 'layout.ABOUT',
32+
renderer: 'item',
33+
dialog: {
34+
component: 'app/KAbout', title: 'ABOUT', okAction: 'CLOSE'
35+
},
36+
}, options)
3337
},
34-
PLATFORM_INFO: {
35-
id: 'platform-info',
36-
icon: 'las la-desktop',
37-
label: 'KAbout.PLATFORM_INFO',
38-
stack: true,
39-
dialog: {
40-
title: 'KAbout.PLATFORM_INFO',
41-
component: 'app/KPlatform',
42-
okAction: 'CLOSE',
43-
widthPolicy: 'narrow'
44-
}
38+
platformInfo: (options) => {
39+
return Object.assign({
40+
id: 'platform-info',
41+
icon: 'las la-desktop',
42+
label: 'KAbout.PLATFORM_INFO',
43+
stack: true,
44+
dialog: {
45+
title: 'KAbout.PLATFORM_INFO',
46+
component: 'app/KPlatform',
47+
okAction: 'CLOSE',
48+
widthPolicy: 'narrow'
49+
}
50+
}, options)
4551
},
46-
REPORT_BUG: {
47-
id: 'report-bug',
48-
icon: 'las la-bug',
49-
label: 'KAbout.BUG_REPORT',
50-
stack: true,
51-
component: 'action/KBugReportAction'
52+
reportBug: (options) => {
53+
return Object.assign({
54+
id: 'report-bug',
55+
icon: 'las la-bug',
56+
label: 'KAbout.BUG_REPORT',
57+
stack: true,
58+
component: 'action/KBugReportAction'
59+
}, options)
5260
},
5361
legalNotice: (options) => {
5462
return Object.assign({
@@ -71,30 +79,36 @@ module.exports = {
7179
}, options)
7280
},
7381
onlineHelp: (options) => {
74-
return {
82+
return Object.assign({
7583
id: 'online-help-action',
7684
icon: 'las la-book',
7785
label: 'layout.ONLINE_HELP',
7886
url,
7987
renderer: 'item'
80-
}
88+
}, options)
8189
},
82-
CONTEXTUAL_HELP: {
83-
id: 'contextual-help-action',
84-
icon: 'las la-question-circle',
85-
label: 'layout.CONTEXTUAL_HELP',
86-
handler: { name: 'launchTour', params: ['home'] },
87-
renderer: 'item'
90+
contextualHelp: (options) => {
91+
// route: default tour route. Default to 'home'
92+
const route = options?.route || 'home'
93+
return Object.assign({
94+
id: 'contextual-help-action',
95+
icon: 'las la-question-circle',
96+
label: 'layout.CONTEXTUAL_HELP',
97+
handler: { name: 'launchTour', params: [route] },
98+
renderer: 'item'
99+
}, options)
88100
},
89-
logout: (provider = null) => {
90-
return {
101+
logout: (options) => {
102+
// provider: whether to use an Oauth provider to logout
103+
const provider = options?.provider
104+
return Object.assign({
91105
id: 'logout-action',
92106
icon: 'las la-sign-out-alt',
93107
label: 'layout.LOGOUT',
94108
route: {
95109
name: 'logout', ...(provider && { params: { provider } })
96110
},
97111
renderer: 'item'
98-
}
112+
}, options)
99113
}
100114
}

0 commit comments

Comments
 (0)