File tree Expand file tree Collapse file tree 1 file changed +98
-2
lines changed
Expand file tree Collapse file tree 1 file changed +98
-2
lines changed Original file line number Diff line number Diff line change @@ -7,8 +7,104 @@ export default Base.extend({
77 parser : "mockup" ,
88
99 async init ( ) {
10- let contentbrowser = await import ( "@plone/volto/components/manage/Contents/Contents.jsx" ) ; // prettier-ignore
10+ window . __CLIENT__ = true ; // Define as volto client
1111
12- this . el . style [ "background-color" ] = "green" ;
12+ const React = ( await import ( "react" ) ) . default ;
13+ const ReactDOM = ( await import ( "react-dom" ) ) . default ;
14+ const IntlProvider = ( await import ( "react-intl" ) ) . IntlProvider ;
15+ const Provider = ( await import ( "react-redux" ) ) . Provider ;
16+ const ContentBrowser = ( await import ( "@plone/volto/components/manage/Contents/Contents.jsx" ) ) . default ; // prettier-ignore
17+ const MemoryRouter = ( await import ( "react-router-dom" ) ) . MemoryRouter ;
18+ const configureStore = ( await import ( "redux-mock-store" ) ) . default ;
19+ const mockStore = configureStore ( ) ;
20+
21+ const store = mockStore ( {
22+ actions : {
23+ actions : {
24+ document_actions : [ ] ,
25+ object : [
26+ {
27+ icon : "" ,
28+ id : "folderContents" ,
29+ title : "Contents" ,
30+ } ,
31+ ] ,
32+ } ,
33+ } ,
34+ userSession : {
35+ token : "14134234123qwdaf" ,
36+ } ,
37+ search : {
38+ items : [
39+ {
40+ "@id" : "/blog" ,
41+ "@type" : "Folder" ,
42+ "title" : "Blog" ,
43+ "descripton" : "My Blog" ,
44+ "ModificationDate" : "2017-04-19T22:48:56+02:00" ,
45+ "EffectiveDate" : "2017-04-19T22:48:56+02:00" ,
46+ "review_state" : "private" ,
47+ } ,
48+ ] ,
49+ total : 1 ,
50+ } ,
51+ breadcrumbs : {
52+ items : [
53+ {
54+ url : "/blog" ,
55+ title : "Blog" ,
56+ } ,
57+ ] ,
58+ } ,
59+ clipboard : {
60+ action : "copy" ,
61+ source : [ "/blog" ] ,
62+ request : {
63+ loading : false ,
64+ loaded : false ,
65+ } ,
66+ } ,
67+ content : {
68+ delete : {
69+ loading : false ,
70+ loaded : false ,
71+ } ,
72+ update : {
73+ loading : false ,
74+ loaded : false ,
75+ } ,
76+ updatecolumns : {
77+ loading : false ,
78+ loaded : false ,
79+ } ,
80+ } ,
81+ intl : {
82+ locale : "en" ,
83+ messages : { } ,
84+ } ,
85+ } ) ;
86+
87+ ReactDOM . render (
88+ React . createElement (
89+ Provider ,
90+ { store : store } ,
91+ React . createElement (
92+ MemoryRouter ,
93+ { } ,
94+ React . createElement (
95+ IntlProvider ,
96+ { locale : "en" } ,
97+ React . createElement (
98+ ContentBrowser ,
99+ {
100+ location : { pathname : "/blog" } ,
101+ } ,
102+ null
103+ )
104+ )
105+ )
106+ ) ,
107+ this . el
108+ ) ;
13109 } ,
14110} ) ;
You can’t perform that action at this time.
0 commit comments