Skip to content

Commit

Permalink
Towards integrating the content browser.
Browse files Browse the repository at this point in the history
  • Loading branch information
thet committed May 23, 2021
1 parent a105f33 commit 18c1ff1
Showing 1 changed file with 98 additions and 2 deletions.
100 changes: 98 additions & 2 deletions src/pat/contentbrowser/contentbrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,104 @@ export default Base.extend({
parser: "mockup",

async init() {
let contentbrowser = await import("@plone/volto/components/manage/Contents/Contents.jsx"); // prettier-ignore
window.__CLIENT__ = true; // Define as volto client

this.el.style["background-color"] = "green";
const React = (await import("react")).default;
const ReactDOM = (await import("react-dom")).default;
const IntlProvider = (await import("react-intl")).IntlProvider;
const Provider = (await import("react-redux")).Provider;
const ContentBrowser = (await import("@plone/volto/components/manage/Contents/Contents.jsx")).default; // prettier-ignore
const MemoryRouter = (await import("react-router-dom")).MemoryRouter;
const configureStore = (await import("redux-mock-store")).default;
const mockStore = configureStore();

const store = mockStore({
actions: {
actions: {
document_actions: [],
object: [
{
icon: "",
id: "folderContents",
title: "Contents",
},
],
},
},
userSession: {
token: "14134234123qwdaf",
},
search: {
items: [
{
"@id": "/blog",
"@type": "Folder",
"title": "Blog",
"descripton": "My Blog",
"ModificationDate": "2017-04-19T22:48:56+02:00",
"EffectiveDate": "2017-04-19T22:48:56+02:00",
"review_state": "private",
},
],
total: 1,
},
breadcrumbs: {
items: [
{
url: "/blog",
title: "Blog",
},
],
},
clipboard: {
action: "copy",
source: ["/blog"],
request: {
loading: false,
loaded: false,
},
},
content: {
delete: {
loading: false,
loaded: false,
},
update: {
loading: false,
loaded: false,
},
updatecolumns: {
loading: false,
loaded: false,
},
},
intl: {
locale: "en",
messages: {},
},
});

ReactDOM.render(
React.createElement(
Provider,
{ store: store },
React.createElement(
MemoryRouter,
{},
React.createElement(
IntlProvider,
{ locale: "en" },
React.createElement(
ContentBrowser,
{
location: { pathname: "/blog" },
},
null
)
)
)
),
this.el
);
},
});

0 comments on commit 18c1ff1

Please sign in to comment.