File tree Expand file tree Collapse file tree 6 files changed +64
-8
lines changed Expand file tree Collapse file tree 6 files changed +64
-8
lines changed Original file line number Diff line number Diff line change 21
21
"eslint" : " 6.4.0" ,
22
22
"standard" : " 14.3.1"
23
23
}
24
- }
24
+ }
Original file line number Diff line number Diff line change @@ -18,5 +18,5 @@ install:
18
18
- name : dashboard
19
19
definition :
20
20
path : ["dashboard"]
21
- label : Dashboard
22
- icon : dashboard
21
+ label : Narratives
22
+ icon : files-o
Original file line number Diff line number Diff line change @@ -44,5 +44,5 @@ install:
44
44
menus : ["authenticated"]
45
45
definition :
46
46
path : ["dashboard"]
47
- label : Dashboard
47
+ label : Narratives
48
48
icon : dashboard
Original file line number Diff line number Diff line change @@ -14,8 +14,8 @@ source:
14
14
- file : styles.css
15
15
install :
16
16
widgets :
17
- - module : ./dashboardPanel
18
- id : dashboardPanel
17
+ - module : ./dashboardRedirect
18
+ id : dashboardRedirect
19
19
type : factory
20
20
- module : ./widgets/CollaboratorsWidget
21
21
id : dashboardCollaborators
@@ -37,7 +37,7 @@ install:
37
37
type : object
38
38
routes :
39
39
- path : ["dashboard"]
40
- widget : dashboardPanel
40
+ widget : dashboardRedirect
41
41
authorization : true
42
42
menu :
43
43
- name : dashboard
@@ -49,5 +49,5 @@ install:
49
49
50
50
views :
51
51
- view : main
52
- module : dashboardPanel
52
+ module : dashboardRedirect
53
53
type : factory
Original file line number Diff line number Diff line change
1
+ define ( [ ] , ( ) => {
2
+ 'use strict' ;
3
+
4
+ /*
5
+ * Following the widget API in case anything goes wrong.
6
+ * But this should be mostly a no-op that just redirects to the correct route.
7
+ */
8
+ const widget = ( config ) => {
9
+ const path = '/dashboard-redesign' ;
10
+ window . top . location . href = path ;
11
+
12
+ let container ,
13
+ mount ;
14
+ const runtime = config . runtime ;
15
+
16
+ // API
17
+ function attach ( node ) {
18
+ return Promise . try ( function ( ) {
19
+ mount = node ;
20
+ container = document . createElement ( 'div' ) ;
21
+ mount . appendChild ( container ) ;
22
+ runtime . send ( 'ui' , 'setTitle' , 'Your Narratives' ) ;
23
+ container . innerHTML = `This should redirect to ${ path } ` ;
24
+ } ) ;
25
+ }
26
+
27
+ function start ( ) {
28
+ return Promise . all ( ( ) => { } ) ;
29
+ }
30
+
31
+ function run ( ) {
32
+ return Promise . all ( ( ) => { } ) ;
33
+ }
34
+
35
+ function stop ( ) {
36
+ return Promise . all ( ( ) => { } ) ;
37
+ }
38
+
39
+ function detach ( ) {
40
+ return Promise . all ( ( ) => {
41
+ container . innerHTML = '' ;
42
+ } ) ;
43
+ }
44
+ return {
45
+ attach : attach ,
46
+ start : start ,
47
+ run : run ,
48
+ stop : stop ,
49
+ detach : detach
50
+ } ;
51
+ }
52
+
53
+ return {
54
+ make : ( config ) => widget ( config )
55
+ } ;
56
+ } ) ;
You can’t perform that action at this time.
0 commit comments