Commits (37)
{
"lerna": "2.0.0",
"version": "1.44.3",
"version": "1.47.0",
"npmClient": "yarn",
"useWorkspaces": true
}
......@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
<a name="1.46.0"></a>
# [1.46.0](https://gitlab.com/4geit/react-packages/compare/v1.45.0...v1.46.0) (2017-10-03)
**Note:** Version bump only for package @4geit/rct-broadcast-message-component
<a name="1.44.2"></a>
## [1.44.2](https://gitlab.com/4geit/react-packages/compare/v1.44.1...v1.44.2) (2017-09-26)
......
{
"name": "@4geit/rct-broadcast-message-component",
"version": "1.44.2",
"version": "1.46.0",
"description": "Broadcast message component to display an input zone for typing and sending messages",
"main": "dist/index.js",
"module": "dist/index.js",
......@@ -21,6 +21,7 @@
"prop-types": "^15.x",
"react": "^15.x",
"react-dom": "^15.x",
"react-props-decorators": "^0.x",
"react-router-dom": "^4.x",
"react-test-renderer": "^15.x",
"typeface-roboto": "^0.x"
......
import React, { Component } from 'react'
// eslint-disable-next-line
import PropTypes from 'prop-types'
import { propTypes, defaultProps } from 'react-props-decorators'
// eslint-disable-next-line
import { observable, action, toJS } from 'mobx'
// eslint-disable-next-line
......@@ -16,15 +17,25 @@ import Grid from 'material-ui/Grid'
import './rct-broadcast-message.component.css'
const styles = theme => ({
@withStyles(theme => ({
form: {
width: '100%'
}
})
}))
@withWidth()
@inject('broadcastMessageStore')
@observer
class RctBroadcastMessageComponent extends Component {
@propTypes({
classes: PropTypes.object.isRequired,
width: PropTypes.string.isRequired,
helper: PropTypes.string,
label: PropTypes.string.isRequired,
broadcastMessageOperationId: PropTypes.string.isRequired,
})
@defaultProps({
broadcastMessageOperationId: 'messageSend',
})
export default class RctBroadcastMessageComponent extends Component {
componentWillUnmount() {
this.props.broadcastMessageStore.reset()
}
......@@ -69,17 +80,3 @@ class RctBroadcastMessageComponent extends Component {
)
}
}
RctBroadcastMessageComponent.propTypes = {
classes: PropTypes.object.isRequired,
width: PropTypes.string.isRequired,
helper: PropTypes.string,
label: PropTypes.string.isRequired,
broadcastMessageOperationId: PropTypes.string.isRequired,
}
RctBroadcastMessageComponent.defaultProps = {
broadcastMessageOperationId: 'messageSend',
}
export default compose(withStyles(styles), withWidth())(RctBroadcastMessageComponent)
......@@ -3,6 +3,55 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
<a name="1.47.0"></a>
# [1.47.0](https://gitlab.com/4geit/react-packages/compare/v1.46.0...v1.47.0) (2017-10-03)
### Bug Fixes
* **Chatboxgrid:** minor fix ([aa6c6b2](https://gitlab.com/4geit/react-packages/commit/aa6c6b2))
* **ChatboxGrid:** minor changes ([528fcfc](https://gitlab.com/4geit/react-packages/commit/528fcfc))
### Features
* **Chatbox Grid:** Add Maximize button ([d2a850c](https://gitlab.com/4geit/react-packages/commit/d2a850c))
* **ChatboxGrid:** Add Onclick directive ([27aa892](https://gitlab.com/4geit/react-packages/commit/27aa892))
<a name="1.46.0"></a>
# [1.46.0](https://gitlab.com/4geit/react-packages/compare/v1.45.0...v1.46.0) (2017-10-03)
**Note:** Version bump only for package @4geit/rct-chatbox-grid-component
<a name="1.45.0"></a>
# [1.45.0](https://gitlab.com/4geit/react-packages/compare/v1.44.5...v1.45.0) (2017-10-02)
### Bug Fixes
* **chatboxgrid:** minor fix ([b98724e](https://gitlab.com/4geit/react-packages/commit/b98724e))
* **chatboxgrid:** minor fix ([025d70f](https://gitlab.com/4geit/react-packages/commit/025d70f))
* **chatboxgrid:** minor fix css ([248b9ab](https://gitlab.com/4geit/react-packages/commit/248b9ab))
* **ChatboxGridComponent:** css minor change ([536b7de](https://gitlab.com/4geit/react-packages/commit/536b7de))
### Features
* **Chatboxgrid:** Added border to the style of ListItem ([e1f0c4d](https://gitlab.com/4geit/react-packages/commit/e1f0c4d))
* **ChatboxGrid:** Added Avatar, minor css change ([031b032](https://gitlab.com/4geit/react-packages/commit/031b032))
* **ChatboxGrid:** padding ([484dd71](https://gitlab.com/4geit/react-packages/commit/484dd71))
* **style chatbox:** added css ([5acf043](https://gitlab.com/4geit/react-packages/commit/5acf043))
* **Style itemcomponent:** css ([f6bdbc6](https://gitlab.com/4geit/react-packages/commit/f6bdbc6))
<a name="1.44.3"></a>
## [1.44.3](https://gitlab.com/4geit/react-packages/compare/v1.44.2...v1.44.3) (2017-09-27)
......
{
"name": "@4geit/rct-chatbox-grid-component",
"version": "1.44.3",
"version": "1.47.0",
"description": "chatbox grid component",
"main": "dist/index.js",
"module": "dist/index.js",
......@@ -12,7 +12,7 @@
"author": "Fabian Starke <fabian@starke.fr>",
"license": "MIT",
"dependencies": {
"@4geit/rct-reorderable-grid-list-component": "^1.44.3",
"@4geit/rct-reorderable-grid-list-component": "^1.45.0",
"enzyme": "^2.x",
"material-ui": "next",
"material-ui-icons": "^1.0.0-alpha.19",
......@@ -21,6 +21,7 @@
"prop-types": "^15.x",
"react": "^15.x",
"react-dom": "^15.x",
"react-props-decorators": "^0.x",
"react-router-dom": "^4.x",
"react-test-renderer": "^15.x",
"typeface-roboto": "^0.x"
......
import React, { Component } from 'react'
// eslint-disable-next-line
import PropTypes from 'prop-types'
import { propTypes, defaultProps } from 'react-props-decorators'
// eslint-disable-next-line
import { observable, action, toJS } from 'mobx'
// eslint-disable-next-line
......@@ -16,48 +17,107 @@ import IconButton from 'material-ui/IconButton';
import DeleteIcon from 'material-ui-icons/Delete';
import List, { ListItem, ListItemText } from 'material-ui/List';
import Switch from 'material-ui/Switch';
import FullscreenIcon from 'material-ui-icons/Fullscreen';
import Grid from 'material-ui/Grid';
import Typography from 'material-ui/Typography';
import './rct-chatbox-grid.component.css'
import Card, { CardActions, CardContent } from 'material-ui/Card';
import Avatar from 'material-ui/Avatar';
import RctReorderableGridListComponent, { ReorderableGridListTile } from '@4geit/rct-reorderable-grid-list-component'
const ItemComponent = props => (
<div>
<List>
<ListItem button dense={true}>
<ListItemText primary="Hello"/>
</ListItem>
<ListItem button dense={true}>
<ListItemText primary="How are you"/>
</ListItem>
</List>
<Grid container align="center" style={ {
height: '40px',
paddingLeft: '10px',
background: '#CCC7C5',
} } >
<Grid item xs>
<Typography align="left">Name</Typography>
</Grid>
<Grid item>
<IconButton>
<DeleteIcon color='#797777'/>
</IconButton>
<Switch
aria-label="checkedA"/>
</Grid>
</Grid>
</div>
)
@withStyles(theme => ({
}))
class ItemComponent extends Component {
handleClick() {
this.props.chatboxGridStore.toggleMaximize(true)
}
render() {
return (
<div>
<Card>
<CardContent>
<List>
<ListItem
style= { {
border: '2px solid darkgrey',
borderRadius:'10px',
margin: '2px 20px 1px 2px',
textAlign: 'left',
padding: '2px',
} }
button dense={true}>
<Avatar style={ {
backgroundColor:"darkgrey",
width:'30',
height:'30',
}}>A</Avatar>
<ListItemText primary="Hello"/>
</ListItem>
<ListItem
style= { {
border: '2px solid lightgrey',
borderRadius:'10px',
margin: '10px 2px 1px 20px',
textAlign: 'right',
padding: '2px',
} }
button dense={true}>
<ListItemText primary="How are you"/>
<Avatar style={ {
backgroundColor:"lightgrey",
width:'30',
height:'30',
}}>B</Avatar>
</ListItem>
</List>
</CardContent>
<CardActions>
<Grid container align="center" style={ {
height: '40px',
paddingLeft: '10px',
background: '#83ceec',
} } >
<Grid item xs>
<Typography align="left">Name</Typography>
</Grid>
<Grid item >
<Switch aria-label="checkedA"/>
<IconButton onClick={ this.handleClick.bind(this) }>
<FullscreenIcon/>
</IconButton>
<IconButton>
<DeleteIcon/>
</IconButton>
</Grid>
</Grid>
</CardActions>
</Card>
</div>
)
}
}
const styles = theme => ({
@withStyles(theme => ({
// TBD
})
@observer
}))
@withWidth()
@inject('chatboxGridStore')
class RctChatboxGridComponent extends Component {
@observer
@propTypes({
classes: PropTypes.object.isRequired,
listOperationId: PropTypes.string.isRequired,
addOperationId: PropTypes.string.isRequired,
updateOperationId: PropTypes.string.isRequired,
deleteOperationId: PropTypes.string.isRequired,
})
@defaultProps({
listOperationId: 'userChatboxList',
addOperationId: 'userChatboxAdd',
updateOperationId: 'userChatboxUpdate',
deleteOperationId: 'userChatboxDelete',
})
export default class RctChatboxGridComponent extends Component {
async componentWillMount() {
const { listOperationId } = this.props
await this.props.chatboxGridStore.fetchData({ listOperationId })
......@@ -76,24 +136,9 @@ class RctChatboxGridComponent extends Component {
handleFetchData={ fetchData.bind(chatboxGridStore) }
data={ sortedData }
itemComponent={ <ItemComponent/> }
style={ { }}
cols={ 4 }
/>
)
}
}
RctChatboxGridComponent.propTypes = {
classes: PropTypes.object.isRequired,
listOperationId: PropTypes.string.isRequired,
addOperationId: PropTypes.string.isRequired,
updateOperationId: PropTypes.string.isRequired,
deleteOperationId: PropTypes.string.isRequired,
}
RctChatboxGridComponent.defaultProps = {
listOperationId: 'userChatboxList',
addOperationId: 'userChatboxAdd',
updateOperationId: 'userChatboxUpdate',
deleteOperationId: 'userChatboxDelete',
}
export default compose(withStyles(styles), withWidth())(RctChatboxGridComponent)
......@@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
<a name="1.47.0"></a>
# [1.47.0](https://gitlab.com/4geit/react-packages/compare/v1.46.0...v1.47.0) (2017-10-03)
### Bug Fixes
* **ChatboxGrid:** minor changes ([528fcfc](https://gitlab.com/4geit/react-packages/commit/528fcfc))
### Features
* **ChatboxGrid:** Add Onclick directive ([27aa892](https://gitlab.com/4geit/react-packages/commit/27aa892))
<a name="1.44.3"></a>
## [1.44.3](https://gitlab.com/4geit/react-packages/compare/v1.44.2...v1.44.3) (2017-09-27)
......
{
"name": "@4geit/rct-chatbox-grid-store",
"version": "1.44.3",
"version": "1.47.0",
"description": "store for the chatbox-grid component",
"main": "dist/index.js",
"module": "dist/index.js",
......
......@@ -115,6 +115,9 @@ class RctChatboxGridStore {
})
}
}
@action toggleMaximize(value) {
this.data = value
}
}
export default new RctChatboxGridStore()
......@@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
<a name="1.46.0"></a>
# [1.46.0](https://gitlab.com/4geit/react-packages/compare/v1.45.0...v1.46.0) (2017-10-03)
### Features
* **chatbox-list:** add switch logic add remove user chatbox ([8934788](https://gitlab.com/4geit/react-packages/commit/8934788))
<a name="1.35.0"></a>
# [1.35.0](https://gitlab.com/4geit/react-packages/compare/v1.34.4...v1.35.0) (2017-09-20)
......
{
"name": "@4geit/rct-chatbox-list-component",
"version": "1.35.0",
"version": "1.46.0",
"description": "list chatbox items component",
"main": "dist/index.js",
"module": "dist/index.js",
......@@ -12,7 +12,7 @@
"author": "Caner Candan <caner@candan.fr>",
"license": "MIT",
"dependencies": {
"@4geit/rct-chatbox-list-store": "^1.35.0",
"@4geit/rct-chatbox-list-store": "^1.46.0",
"enzyme": "^2.x",
"material-ui": "next",
"material-ui-icons": "^1.0.0-alpha.19",
......@@ -21,6 +21,7 @@
"prop-types": "^15.x",
"react": "^15.x",
"react-dom": "^15.x",
"react-props-decorators": "^0.x",
"react-router-dom": "^4.x",
"react-test-renderer": "^15.x",
"typeface-roboto": "^0.x"
......
import React, { Component } from 'react'
// eslint-disable-next-line
import PropTypes from 'prop-types'
import { propTypes, defaultProps } from 'react-props-decorators'
// eslint-disable-next-line
import { observable, action, toJS } from 'mobx'
// eslint-disable-next-line
......@@ -15,7 +16,7 @@ import Switch from 'material-ui/Switch'
import './rct-chatbox-list.component.css'
const styles = theme => ({
@withStyles(theme => ({
root: {
// [theme.breakpoints.down('md')]: {
// width: '100%',
......@@ -23,14 +24,40 @@ const styles = theme => ({
width: 300,
},
// TBD
})
}))
@withWidth()
@inject('chatboxListStore')
@observer
class RctChatboxListComponent extends Component {
@propTypes({
classes: PropTypes.object.isRequired,
width: PropTypes.string.isRequired,
listOperationId: PropTypes.string.isRequired,
addOperationId: PropTypes.string.isRequired,
deleteOperationId: PropTypes.string.isRequired,
// TBD
})
@defaultProps({
listOperationId: 'chatboxList',
addOperationId: 'userChatboxAdd',
deleteOperationId: 'userChatboxDelete',
// TBD
})
export default class RctChatboxListComponent extends Component {
constructor() {
super()
this.handleSwitchChange = ({ id }) => (event, checked) => {
const { chatboxListStore, addOperationId, deleteOperationId } = this.props
if (checked) {
chatboxListStore.addUserChatbox({ addOperationId, id })
} else {
chatboxListStore.removeUserChatbox({ deleteOperationId, id })
}
}
}
async componentWillMount() {
const { operationId } = this.props
await this.props.chatboxListStore.fetchData(operationId)
const { listOperationId } = this.props
await this.props.chatboxListStore.fetchData({ listOperationId })
}
render() {
......@@ -38,14 +65,14 @@ class RctChatboxListComponent extends Component {
const { chatboxList } = this.props.chatboxListStore
return (
<List className={ classes.root } subheader={ <ListSubheader>Chatboxes</ListSubheader> } >
{ chatboxList.map(item => (
<ListItem button key={ item.id }>
{ chatboxList.map(({ id, name, description}) => (
<ListItem button key={ id }>
<ListItemIcon>
<ChatIcon/>
</ListItemIcon>
<ListItemText primary={ item.name } secondary={ item.description } />
<ListItemText primary={ name } secondary={ description } />
<ListItemSecondaryAction>
<Switch/>
<Switch onChange={ this.handleSwitchChange({ id }) }/>
</ListItemSecondaryAction>
</ListItem>
)) }
......@@ -53,17 +80,3 @@ class RctChatboxListComponent extends Component {
)
}
}
RctChatboxListComponent.propTypes = {
classes: PropTypes.object.isRequired,
width: PropTypes.string.isRequired,
operationId: PropTypes.string.isRequired,
// TBD
}
RctChatboxListComponent.defaultProps = {
operationId: 'chatboxList',
// TBD
}
export default compose(withStyles(styles), withWidth())(RctChatboxListComponent)
......@@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
<a name="1.46.0"></a>
# [1.46.0](https://gitlab.com/4geit/react-packages/compare/v1.45.0...v1.46.0) (2017-10-03)
### Features
* **chatbox-list:** add switch logic add remove user chatbox ([8934788](https://gitlab.com/4geit/react-packages/commit/8934788))
<a name="1.35.0"></a>
# [1.35.0](https://gitlab.com/4geit/react-packages/compare/v1.34.4...v1.35.0) (2017-09-20)
......
{
"name": "@4geit/rct-chatbox-list-store",
"version": "1.35.0",
"version": "1.46.0",
"description": "store class to handle chatbox list component observables",
"main": "dist/index.js",
"module": "dist/index.js",
......
......@@ -11,10 +11,11 @@ class RctChatboxListStore {
@action setChatboxList(value) {
this.chatboxList = value
}
@action async fetchData(operationId) {
@action async fetchData({ listOperationId }) {
this.inProgress = true
try {
const { body } = await swaggerClientStore.client.apis.Account[operationId]()
const { client: { apis: { Account } } } = swaggerClientStore
const { body } = await Account[listOperationId]()
if (body.length) {
runInAction(() => {
this.setChatboxList(body)
......@@ -28,6 +29,40 @@ class RctChatboxListStore {
})
}
}
@action async addUserChatbox({ addOperationId, id }) {
this.inProgress = true
try {
const { client: { apis: { Account } } } = swaggerClientStore
await Account[addOperationId]({
body: {
chatboxId: id,
}
})
runInAction(() => {
this.inProgress = false
})
} catch (err) {
console.error(err)
runInAction(() => {
notificationStore.newMessage(err.message)
})
}
}
@action async removeUserChatbox({ deleteOperationId, id }) {
this.inProgress = true
try {
const { client: { apis: { Account } } } = swaggerClientStore
await Account[deleteOperationId]({ id })
runInAction(() => {
this.inProgress = false
})
} catch (err) {
console.error(err)
runInAction(() => {
notificationStore.newMessage(err.message)
})
}
}
}
export default new RctChatboxListStore()
......@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
<a name="1.46.0"></a>
# [1.46.0](https://gitlab.com/4geit/react-packages/compare/v1.45.0...v1.46.0) (2017-10-03)
**Note:** Version bump only for package @4geit/rct-data-table-component
<a name="1.44.1"></a>
## [1.44.1](https://gitlab.com/4geit/react-packages/compare/v1.44.0...v1.44.1) (2017-09-26)
......
{
"name": "@4geit/rct-data-table-component",
"version": "1.44.1",
"version": "1.46.0",
"description": "data table component for react apps",
"main": "dist/index.js",
"module": "dist/index.js",
......@@ -21,6 +21,7 @@
"prop-types": "^15.x",
"react": "^15.x",
"react-dom": "^15.x",
"react-props-decorators": "^0.x",
"react-router": "^4.x",
"react-test-renderer": "^15.x",
"typeface-roboto": "^0.x"
......
......@@ -45,7 +45,7 @@ import './rct-data-table.component.css'
enabledColumns: [],
// TBD
})
class RctDataTableComponent extends Component {
export default class RctDataTableComponent extends Component {
async componentWillMount() {
const { operationId, enabledColumns } = this.props
await this.props.dataTableStore.fetchData(operationId, enabledColumns)
......@@ -149,5 +149,3 @@ class RctDataTableComponent extends Component {
)
}
}
export default RctDataTableComponent
......@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
<a name="1.46.0"></a>
# [1.46.0](https://gitlab.com/4geit/react-packages/compare/v1.45.0...v1.46.0) (2017-10-03)
**Note:** Version bump only for package @4geit/rct-date-picker-component
<a name="1.39.4"></a>
## [1.39.4](https://gitlab.com/4geit/react-packages/compare/v1.39.3...v1.39.4) (2017-09-21)
......