@@ -8,47 +8,55 @@ module.exports = {
8
8
route : { name : `${ name } -activity` , params }
9
9
}
10
10
} ,
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
+ }
22
24
}
23
- }
25
+ } , options )
24
26
} ,
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 )
33
37
} ,
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 )
45
51
} ,
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 )
52
60
} ,
53
61
legalNotice : ( options ) => {
54
62
return Object . assign ( {
@@ -71,30 +79,36 @@ module.exports = {
71
79
} , options )
72
80
} ,
73
81
onlineHelp : ( options ) => {
74
- return {
82
+ return Object . assign ( {
75
83
id : 'online-help-action' ,
76
84
icon : 'las la-book' ,
77
85
label : 'layout.ONLINE_HELP' ,
78
86
url,
79
87
renderer : 'item'
80
- }
88
+ } , options )
81
89
} ,
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 )
88
100
} ,
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 ( {
91
105
id : 'logout-action' ,
92
106
icon : 'las la-sign-out-alt' ,
93
107
label : 'layout.LOGOUT' ,
94
108
route : {
95
109
name : 'logout' , ...( provider && { params : { provider } } )
96
110
} ,
97
111
renderer : 'item'
98
- }
112
+ } , options )
99
113
}
100
114
}
0 commit comments