Skip to content

Commit c5a4207

Browse files
authored
Merge pull request #47 from briehl/redirect
Redirect
2 parents 8659ccf + 3957f6f commit c5a4207

File tree

6 files changed

+64
-8
lines changed

6 files changed

+64
-8
lines changed

dist.tgz

177 Bytes
Binary file not shown.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@
2121
"eslint": "6.4.0",
2222
"standard": "14.3.1"
2323
}
24-
}
24+
}

src/plugin/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ install:
1818
- name: dashboard
1919
definition:
2020
path: ["dashboard"]
21-
label: Dashboard
22-
icon: dashboard
21+
label: Narratives
22+
icon: files-o

src/plugin/iframe_root/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,5 @@ install:
4444
menus: ["authenticated"]
4545
definition:
4646
path: ["dashboard"]
47-
label: Dashboard
47+
label: Narratives
4848
icon: dashboard

src/plugin/iframe_root/modules/config.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ source:
1414
- file: styles.css
1515
install:
1616
widgets:
17-
- module: ./dashboardPanel
18-
id: dashboardPanel
17+
- module: ./dashboardRedirect
18+
id: dashboardRedirect
1919
type: factory
2020
- module: ./widgets/CollaboratorsWidget
2121
id: dashboardCollaborators
@@ -37,7 +37,7 @@ install:
3737
type: object
3838
routes:
3939
- path: ["dashboard"]
40-
widget: dashboardPanel
40+
widget: dashboardRedirect
4141
authorization: true
4242
menu:
4343
- name: dashboard
@@ -49,5 +49,5 @@ install:
4949

5050
views:
5151
- view: main
52-
module: dashboardPanel
52+
module: dashboardRedirect
5353
type: factory
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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+
});

0 commit comments

Comments
 (0)