-
Notifications
You must be signed in to change notification settings - Fork 79
/
index.js
42 lines (36 loc) · 1.13 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/* global document */
import Config from 'lib/Config';
import reactRouteRegister from 'lib/ReactRouteRegister';
import AssetAdminRouter from 'containers/AssetAdmin/AssetAdminRouter';
import applyTransform from 'boot/applyTransform';
import registerReducers from 'boot/registerReducers';
import registerComponents from 'boot/registerComponents';
import registerQueries from 'boot/registerQueries';
document.addEventListener('DOMContentLoaded', () => {
registerComponents();
applyTransform();
const sectionConfig = Config.getSection('SilverStripe\\AssetAdmin\\Controller\\AssetAdmin');
reactRouteRegister.add({
path: '/',
routes: [
{
path: `/${sectionConfig.url}/show/:folderId/:viewAction/:fileId`,
component: AssetAdminRouter,
},
{
path: `/${sectionConfig.url}/show/:folderId/:viewAction`,
component: AssetAdminRouter,
},
{
path: `/${sectionConfig.url}/show/:folderId`,
component: AssetAdminRouter,
},
{
path: `/${sectionConfig.url}`,
component: AssetAdminRouter,
},
],
});
registerQueries();
registerReducers();
});