Skip to content

Commit

Permalink
3.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Fi1osof committed Jul 27, 2019
1 parent e626791 commit ffa7329
Show file tree
Hide file tree
Showing 10 changed files with 266 additions and 19 deletions.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
3.4.1
============================================
- Added chat Components

3.4.0
============================================
- Improved performance
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@prisma-cms/boilerplate",
"version": "3.4.0",
"version": "3.4.1",
"description": "Opensource framework CMS powered by GraphQL, Prisma, MySQL, React & Apollo GraphQL",
"private": false,
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
import React from 'react';

import EditorComponent from '@prisma-cms/front-editor/lib/components/App/components/';
import { ObjectContext } from '@prisma-cms/front-editor/lib/components/App/components/public/Connectors/Connector/ListView/';
import ChatRoomView from '@prisma-cms/webrtc/lib/components/pages/society/ChatRooms/ChatRoom/View';
import { EditableObjectContext } from '@prisma-cms/front-editor/lib/components/App/context';

export class ChatRoom extends EditorComponent {

static Name = 'ChatRoom';

static defaultProps = {
...EditorComponent.defaultProps,
}


renderPanelView(content) {

const {
classes,
} = this.getEditorContext();

return super.renderPanelView(
content ||
<div
className={classes.panelButton}
>
ChatRoom
</div>
);
}


getRootElement() {

return super.getRootElement();
}


canBeParent(parent) {

return super.canBeParent(parent);
}


canBeChild(child) {

return super.canBeChild(child);
}


renderChildren() {

const {
} = this.context;

const {
} = this.getEditorContext();

const {
...other
} = this.getComponentProps(this);

return <EditableObjectContext.Consumer>
{objectContext => {

const {
object,
...otherContext
} = objectContext;


return <ChatRoomView
{...otherContext}
data={{
object: object,
}}
/>

}}
</EditableObjectContext.Consumer>

return `super.renderChildren()`;
}

}

export default ChatRoom;
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import React from 'react';

import EditorComponent from '@prisma-cms/front-editor/lib/components/App/components/';
import ChatRoomsPage from '../../../../society/ChatRooms';

export class ChatRooms extends EditorComponent {

static Name = 'ChatRooms';

static defaultProps = {
...EditorComponent.defaultProps,
}


renderPanelView(content) {

const {
classes,
} = this.getEditorContext();

return super.renderPanelView(
content ||
<div
className={classes.panelButton}
>
ChatRooms
</div>
);
}


getRootElement() {

return super.getRootElement();
}


canBeParent(parent) {

return super.canBeParent(parent);
}


canBeChild(child) {

// return super.canBeChild(child);
return false;
}


renderChildren() {

const {
} = this.context;

const {
} = this.getEditorContext();

const {
...other
} = this.getComponentProps(this);

// return super.renderChildren();

return <ChatRoomsPage
{...other}
/>
}

}

export default ChatRooms;
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import React from 'react';

import EditorComponent from '@prisma-cms/front-editor/lib/components/App/components/';

import { Notices } from '@prisma-cms/society';

export class NoticesMenu extends EditorComponent {

static Name = 'NoticesMenu';

static defaultProps = {
...EditorComponent.defaultProps,
}


renderPanelView(content) {

const {
classes,
} = this.getEditorContext();

return super.renderPanelView(
content ||
<div
className={classes.panelButton}
>
NoticesMenu
</div>
);
}


getRootElement() {

return super.getRootElement();
}


canBeParent(parent) {

return super.canBeParent(parent);
}


canBeChild(child) {

return false;
}


renderChildren() {

const {
user: currentUser,
} = this.context;

const {
} = this.getEditorContext();

const {
...other
} = this.getComponentProps(this);

if (!currentUser) {
return null;
}

const {
id: currentUserId,
} = currentUser;

return <Notices
key={currentUserId}
user={currentUser}
classes={{}}
/>
}

}

export default NoticesMenu;
6 changes: 6 additions & 0 deletions src/components/Renderer/pages/Root/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import RootConnector from '@prisma-cms/front-editor/lib/components/Root';
import UserPage from './components/pages/Users/User';
// import PdfView from './components/PdfView';
import CreateUserPage from './components/pages/Users/User/Create';
import ChatRooms from './components/pages/ChatRooms';
import NoticesMenu from './components/society/NoticesMenu';
import ChatRoom from './components/pages/ChatRooms/ChatRoom';



Expand All @@ -20,8 +23,11 @@ class RootPage extends PrismaCmsComponent {

return <RootConnector
CustomComponents={CustomComponents.concat([
NoticesMenu,
UserPage,
CreateUserPage,
ChatRooms,
ChatRoom,
// PdfView,
])}
{...other}
Expand Down
2 changes: 1 addition & 1 deletion src/server/modules/user/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ export class ModxclubUserProcessor extends UserPayload {

}

console.log("ethConnectAuthAccount ethAccount", JSON.stringify(ethAccount, true, 2));
// console.log("ethConnectAuthAccount ethAccount", JSON.stringify(ethAccount, true, 2));

return result || this.prepareResponse();

Expand Down
8 changes: 0 additions & 8 deletions src/styles/less/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,3 @@ body,
#root {
height: 100%;
}
#root {
display: flex;
flex-direction: column;
}
#root #Renderer--body {
flex: 1;
overflow: auto;
}
2 changes: 1 addition & 1 deletion src/styles/less/styles.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 12 additions & 8 deletions src/styles/less/styles.less
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@

html, body, #root {
height: 100%;

// border: 1px solid red;
}

#root {
// #root {

// height: 100%;

display: flex;
flex-direction: column;
// // display: flex;
// // flex-direction: column;

#Renderer--body {
flex: 1;
overflow: auto;
}
}
// // #Renderer--body {
// // flex: 1;
// // overflow: auto;
// // }
// }

0 comments on commit ffa7329

Please sign in to comment.