Commits (41)
{
"lerna": "2.0.0",
"version": "1.47.0",
"version": "1.52.0",
"npmClient": "yarn",
"useWorkspaces": true
}
......@@ -3,6 +3,47 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
<a name="1.52.0"></a>
# [1.52.0](https://gitlab.com/4geit/react-packages/compare/v1.51.2...v1.52.0) (2017-10-04)
### Features
* **chatbox-grid:** add fetchMaximizedItem to store and use within component ([e1df4e4](https://gitlab.com/4geit/react-packages/commit/e1df4e4))
<a name="1.48.2"></a>
## [1.48.2](https://gitlab.com/4geit/react-packages/compare/v1.48.1...v1.48.2) (2017-10-03)
### Bug Fixes
* **broadcast-message:** use new endpoint operation id ([6cbff47](https://gitlab.com/4geit/react-packages/commit/6cbff47))
<a name="1.48.1"></a>
## [1.48.1](https://gitlab.com/4geit/react-packages/compare/v1.48.0...v1.48.1) (2017-10-03)
**Note:** Version bump only for package @4geit/rct-broadcast-message-component
<a name="1.47.1"></a>
## [1.47.1](https://gitlab.com/4geit/react-packages/compare/v1.47.0...v1.47.1) (2017-10-03)
### Bug Fixes
* **broadcast-message:** use new addOperationId ([b6b704b](https://gitlab.com/4geit/react-packages/commit/b6b704b))
<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)
......
{
"name": "@4geit/rct-broadcast-message-component",
"version": "1.46.0",
"version": "1.52.0",
"description": "Broadcast message component to display an input zone for typing and sending messages",
"main": "dist/index.js",
"module": "dist/index.js",
......@@ -12,10 +12,10 @@
"author": "Geraldine Starke <geraldine@starke.fr>",
"license": "MIT",
"dependencies": {
"@4geit/rct-broadcast-message-store": "^1.43.0",
"@4geit/rct-broadcast-message-store": "^1.48.1",
"enzyme": "^2.x",
"material-ui": "next",
"material-ui-icons": "^1.0.0-alpha.19",
"material-ui-icons": "^1.0.0-beta.14",
"mobx": "^3.x",
"mobx-react": "^4.x",
"prop-types": "^15.x",
......
......@@ -30,10 +30,10 @@ import './rct-broadcast-message.component.css'
width: PropTypes.string.isRequired,
helper: PropTypes.string,
label: PropTypes.string.isRequired,
broadcastMessageOperationId: PropTypes.string.isRequired,
addOperationId: PropTypes.string.isRequired,
})
@defaultProps({
broadcastMessageOperationId: 'messageSend',
addOperationId: 'messageBulkAdd',
})
export default class RctBroadcastMessageComponent extends Component {
componentWillUnmount() {
......@@ -43,8 +43,8 @@ export default class RctBroadcastMessageComponent extends Component {
this.props.broadcastMessageStore.setMessage(event.target.value)
}
async handleSubmitForm(event) {
const { broadcastMessageOperationId } = this.props
await this.props.broadcastMessageStore.send({broadcastMessageOperationId})
const { broadcastMessageStore, addOperationId } = this.props
await broadcastMessageStore.send({ addOperationId })
}
render() {
const { classes, helper, label } = this.props
......@@ -55,7 +55,7 @@ export default class RctBroadcastMessageComponent extends Component {
<CardContent>
<Grid container align='center' justify='space-between'>
<Grid item xs={11}>
<form className={ classes.form } onSubmit={ this.handleSubmitForm.bind(this)}>
<form className={ classes.form } onSubmit={ this.handleSubmitForm.bind(this) }>
<TextField
label={ label }
helperText={ helper }
......@@ -69,7 +69,7 @@ export default class RctBroadcastMessageComponent extends Component {
<Grid item xs={1}>
<Grid container justify='center'>
<Grid item>
<Button dense raised color="primary">Send</Button>
<Button dense raised color="primary" type="submit">Send</Button>
</Grid>
</Grid>
</Grid>
......
......@@ -3,6 +3,25 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
<a name="1.48.1"></a>
## [1.48.1](https://gitlab.com/4geit/react-packages/compare/v1.48.0...v1.48.1) (2017-10-03)
**Note:** Version bump only for package @4geit/rct-broadcast-message-store
<a name="1.47.1"></a>
## [1.47.1](https://gitlab.com/4geit/react-packages/compare/v1.47.0...v1.47.1) (2017-10-03)
### Bug Fixes
* **broadcast-message:** use new addOperationId ([b6b704b](https://gitlab.com/4geit/react-packages/commit/b6b704b))
<a name="1.43.0"></a>
# [1.43.0](https://gitlab.com/4geit/react-packages/compare/v1.42.0...v1.43.0) (2017-09-24)
......
{
"name": "@4geit/rct-broadcast-message-store",
"version": "1.43.0",
"version": "1.48.1",
"description": "store for the broadcast message component",
"main": "dist/index.js",
"module": "dist/index.js",
......@@ -14,6 +14,7 @@
"dependencies": {
"enzyme": "^2.x",
"mobx": "^3.x",
"moment": "^2.18.1",
"react": "^15.x",
"react-dom": "^15.x",
"react-router-dom": "^4.x",
......
......@@ -10,10 +10,11 @@ class RctBroadcastMessageStore {
@action reset() {
this.message = ''
}
@action async send({operationId}) {
@action async send({ addOperationId }) {
this.inProgress = true
try {
const { body } = await swaggerClientStore.client.apis.Account[operationId]({
const { client: { apis: Account } } = swaggerClientStore
const { body } = await Account[addOperationId]({
body: {
message: this.message,
author: "Dummy Name",
......
......@@ -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.52.0"></a>
# [1.52.0](https://gitlab.com/4geit/react-packages/compare/v1.51.2...v1.52.0) (2017-10-04)
### Features
* **chatbox-grid:** add fetchMaximizedItem to store and use within component ([e1df4e4](https://gitlab.com/4geit/react-packages/commit/e1df4e4))
<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)
......
{
"name": "@4geit/rct-chatbox-grid-component",
"version": "1.47.0",
"version": "1.52.0",
"description": "chatbox grid component",
"main": "dist/index.js",
"module": "dist/index.js",
......@@ -12,10 +12,10 @@
"author": "Fabian Starke <fabian@starke.fr>",
"license": "MIT",
"dependencies": {
"@4geit/rct-reorderable-grid-list-component": "^1.45.0",
"@4geit/rct-reorderable-grid-list-component": "^1.52.0",
"enzyme": "^2.x",
"material-ui": "next",
"material-ui-icons": "^1.0.0-alpha.19",
"material-ui-icons": "^1.0.0-beta.14",
"mobx": "^3.x",
"mobx-react": "^4.x",
"prop-types": "^15.x",
......
......@@ -119,15 +119,21 @@ class ItemComponent extends Component {
})
export default class RctChatboxGridComponent extends Component {
async componentWillMount() {
const { listOperationId } = this.props
await this.props.chatboxGridStore.fetchData({ listOperationId })
const { listOperationId, chatboxGridStore } = this.props
await chatboxGridStore.fetchMaximizedItem({ listOperationId })
await chatboxGridStore.fetchData({ listOperationId })
}
render() {
const { classes, chatboxGridStore } = this.props
const { typeContainer } = classes
const { data, fetchData, setPosition, sortedData } = chatboxGridStore
console.log(data)
const { data, fetchData, setPosition, sortedData, maximizedItem } = chatboxGridStore
if (maximizedItem) {
const { id } = maximizedItem
return (
<Typography>{ id }</Typography>
)
}
return (
<RctReorderableGridListComponent
cellHeight={ 180 }
......
......@@ -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.52.0"></a>
# [1.52.0](https://gitlab.com/4geit/react-packages/compare/v1.51.2...v1.52.0) (2017-10-04)
### Features
* **chatbox-grid:** add fetchMaximizedItem to store and use within component ([e1df4e4](https://gitlab.com/4geit/react-packages/commit/e1df4e4))
<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)
......
{
"name": "@4geit/rct-chatbox-grid-store",
"version": "1.47.0",
"version": "1.52.0",
"description": "store for the chatbox-grid component",
"main": "dist/index.js",
"module": "dist/index.js",
......
......@@ -6,6 +6,7 @@ import notificationStore from '@4geit/rct-notification-store'
class RctChatboxGridStore {
@observable data = []
@observable maximizedItem
@computed get sortedData() {
return this.data.slice().sort((a, b) => a.position > b.position)
}
......@@ -14,11 +15,18 @@ class RctChatboxGridStore {
@action setData(value) {
this.data = value
}
@action setMaximizedItem(value) {
this.maximizedItem = value
}
@action removeMaximizedItem() {
this.maximizedItem = undefined
}
@action async fetchData({ listOperationId }) {
listOperationId = listOperationId || 'userChatboxList'
this.inProgress = true
try {
const { body } = await swaggerClientStore.client.apis.Account[listOperationId]()
const { client: { apis: { Account } } } = swaggerClientStore
const { body } = await Account[listOperationId]()
if (body.length) {
runInAction(() => {
this.setData( body )
......@@ -36,7 +44,8 @@ class RctChatboxGridStore {
updateOperationId = updateOperationId || 'userChatboxUpdate'
this.inProgress = true
try {
const { body } = await swaggerClientStore.client.apis.Account[updateOperationId]()
const { client: { apis: { Account } } } = swaggerClientStore
const { body } = await Account[updateOperationId]()
if (body.length) {
runInAction(() => {
this.setData( body )
......@@ -54,7 +63,8 @@ class RctChatboxGridStore {
addOperationId = addOperationId || 'userChatboxAdd'
this.inProgress = true
try {
const { body } = await swaggerClientStore.client.apis.Account[addOperationId]()
const { client: { apis: { Account } } } = swaggerClientStore
const { body } = await Account[addOperationId]()
await this.fetchData({ listOperationId })
runInAction(() => {
this.inProgress = false
......@@ -70,8 +80,8 @@ class RctChatboxGridStore {
deleteOperationId = deleteOperationId || 'userChatboxDelete'
this.inProgress = true
try {
const {body } = await
swaggerClientStore.client.apis.Account[deleteOperationId]()
const { client: { apis: { Account } } } = swaggerClientStore
const {body } = await Account[deleteOperationId]()
await this.fetchData({ listOperationId })
runInAction(() => {
this.inProgress = false
......@@ -87,8 +97,8 @@ class RctChatboxGridStore {
updateOperationId = updateOperationId || 'userChatboxUpdate'
this.inProgress = true
try {
const { body } = await
swaggerClientStore.client.apis.Account[updateOperationId]()
const { client: { apis: { Account } } } = swaggerClientStore
const { body } = await Account[updateOperationId]()
await this.fetchData({ listOperationId })
runInAction(() => {
this.inProgress = false
......@@ -103,8 +113,8 @@ class RctChatboxGridStore {
updateOperationId = updateOperationId || 'userChatboxUpdate'
this.inProgress = true
try {
const { body } = await
swaggerClientStore.client.apis.Account[updateOperationId]()
const { client: { apis: { Account } } } = swaggerClientStore
const { body } = await Account[updateOperationId]()
await this.fetchData({ listOperationId })
runInAction(() => {
this.inProgress = false
......@@ -118,6 +128,31 @@ class RctChatboxGridStore {
@action toggleMaximize(value) {
this.data = value
}
@action async fetchMaximizedItem({ listOperationId }) {
listOperationId = listOperationId || 'userChatboxList'
this.inProgress = true
try {
const { client: { apis: { Account } } } = swaggerClientStore
console.log(Account)
const { body } = await Account[listOperationId]({
maximized: true,
})
runInAction(() => {
if (body.length) {
const [ item ] = body
this.setMaximizedItem(item)
} else {
this.removeMaximizedItem()
}
this.inProgress = false
})
} catch (err) {
console.error(err)
runInAction(() => {
notificationStore.newMessage(err.message)
})
}
}
}
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.52.0"></a>
# [1.52.0](https://gitlab.com/4geit/react-packages/compare/v1.51.2...v1.52.0) (2017-10-04)
### Features
* **chatbox-grid:** add fetchMaximizedItem to store and use within component ([e1df4e4](https://gitlab.com/4geit/react-packages/commit/e1df4e4))
<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)
......
{
"name": "@4geit/rct-chatbox-list-component",
"version": "1.46.0",
"version": "1.52.0",
"description": "list chatbox items component",
"main": "dist/index.js",
"module": "dist/index.js",
......@@ -15,7 +15,7 @@
"@4geit/rct-chatbox-list-store": "^1.46.0",
"enzyme": "^2.x",
"material-ui": "next",
"material-ui-icons": "^1.0.0-alpha.19",
"material-ui-icons": "^1.0.0-beta.14",
"mobx": "^3.x",
"mobx-react": "^4.x",
"prop-types": "^15.x",
......
......@@ -3,6 +3,61 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
<a name="1.52.0"></a>
# [1.52.0](https://gitlab.com/4geit/react-packages/compare/v1.51.2...v1.52.0) (2017-10-04)
### Features
* **chatbox-grid:** add fetchMaximizedItem to store and use within component ([e1df4e4](https://gitlab.com/4geit/react-packages/commit/e1df4e4))
<a name="1.50.0"></a>
# [1.50.0](https://gitlab.com/4geit/react-packages/compare/v1.49.0...v1.50.0) (2017-10-04)
### Features
* **DataTable:** Add Remove button to data table ([472be8d](https://gitlab.com/4geit/react-packages/commit/472be8d))
<a name="1.49.0"></a>
# [1.49.0](https://gitlab.com/4geit/react-packages/compare/v1.48.2...v1.49.0) (2017-10-03)
### Bug Fixes
* **DataTable:** Add Edit button ([9f22f88](https://gitlab.com/4geit/react-packages/commit/9f22f88))
* **DataTable:** Edit button mior fix ([8a56f28](https://gitlab.com/4geit/react-packages/commit/8a56f28))
### Features
* **DataTable:** Add Edit button and click event ([1956374](https://gitlab.com/4geit/react-packages/commit/1956374))
<a name="1.48.0"></a>
# [1.48.0](https://gitlab.com/4geit/react-packages/compare/v1.47.1...v1.48.0) (2017-10-03)
### Bug Fixes
* **Datatable:** add icon ([2b2f16b](https://gitlab.com/4geit/react-packages/commit/2b2f16b))
### Features
* **DataTable:** add buton ([6c73e29](https://gitlab.com/4geit/react-packages/commit/6c73e29))
<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)
......
{
"name": "@4geit/rct-data-table-component",
"version": "1.46.0",
"version": "1.52.0",
"description": "data table component for react apps",
"main": "dist/index.js",
"module": "dist/index.js",
......@@ -12,10 +12,10 @@
"author": "Caner Candan <caner@candan.fr>",
"license": "MIT",
"dependencies": {
"@4geit/rct-data-table-store": "^1.35.0",
"@4geit/rct-data-table-store": "^1.50.0",
"enzyme": "^2.x",
"material-ui": "next",
"material-ui-icons": "^1.0.0-alpha.19",
"material-ui-icons": "^1.0.0-beta.14",
"mobx": "^3.x",
"mobx-react": "^4.x",
"prop-types": "^15.x",
......
......@@ -18,6 +18,8 @@ import Grid from 'material-ui/Grid'
import Toolbar from 'material-ui/Toolbar'
import IconButton from 'material-ui/IconButton'
import DeleteIcon from 'material-ui-icons/Delete';
import AddIcon from 'material-ui-icons/Add';
import EditIcon from 'material-ui-icons/Edit';
import ImportExportIcon from 'material-ui-icons/ImportExport'
import ViewColumnIcon from 'material-ui-icons/ViewColumn'
import FilterListIcon from 'material-ui-icons/FilterList'
......@@ -53,7 +55,15 @@ export default class RctDataTableComponent extends Component {
componentWillUnmount() {
this.props.dataTableStore.reset()
}
handleAddClick() {
this.props.dataTableStore.addItem(true)
}
handleEditClick() {
this.props.dataTableStore.editItem(true)
}
handleRemoveClick() {
this.props.dataTableStore.removeItem(true)
}
handleClick(event) {
this.props.dataTableStore.setOpen(true)
this.props.dataTableStore.setElement(event.currentTarget)
......@@ -85,6 +95,9 @@ export default class RctDataTableComponent extends Component {
}}>
{ title }
</Typography>
<IconButton onClick={ this.handleAddClick.bind(this) }>
<AddIcon/>
</IconButton>
<IconButton>
<ImportExportIcon/>
</IconButton>
......@@ -129,6 +142,14 @@ export default class RctDataTableComponent extends Component {
{ enabledColumns.map((item, index) => (
<TableCell key={ index }>{item.name}</TableCell>
)) }
<TableCell>
<IconButton onClick={ this.handleEditClick.bind(this) }>
<EditIcon/>
</IconButton>
<IconButton onClick={ this.handleRemoveClick.bind(this) }>
<DeleteIcon/>
</IconButton>
</TableCell>
</TableRow>
</TableHead>
<TableBody>
......@@ -140,6 +161,14 @@ export default class RctDataTableComponent extends Component {
{ enabledColumns.map((column, colIndex) => (
<TableCell key={ colIndex } >{ item[column.name]}</TableCell>
)) }
<TableCell>
<IconButton onClick={ this.handleEditClick.bind(this) }>
<EditIcon/>
</IconButton>
<IconButton onClick={ this.handleRemoveClick.bind(this) }>
<DeleteIcon/>
</IconButton>
</TableCell>
</TableRow>
)) }
</TableBody>
......
......@@ -3,6 +3,54 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
<a name="1.50.0"></a>
# [1.50.0](https://gitlab.com/4geit/react-packages/compare/v1.49.0...v1.50.0) (2017-10-04)
### Bug Fixes
* **data-table-store:** fix brackets issue ([d092957](https://gitlab.com/4geit/react-packages/commit/d092957))
### Features
* **DataTable:** Add Remove button to data table ([472be8d](https://gitlab.com/4geit/react-packages/commit/472be8d))
<a name="1.49.0"></a>
# [1.49.0](https://gitlab.com/4geit/react-packages/compare/v1.48.2...v1.49.0) (2017-10-03)
### Bug Fixes
* **DataTable:** Edit button mior fix ([8a56f28](https://gitlab.com/4geit/react-packages/commit/8a56f28))
### Features
* **DataTable:** Add Edit button and click event ([1956374](https://gitlab.com/4geit/react-packages/commit/1956374))
<a name="1.48.0"></a>
# [1.48.0](https://gitlab.com/4geit/react-packages/compare/v1.47.1...v1.48.0) (2017-10-03)
### Bug Fixes
* **Datatable:** add icon ([2b2f16b](https://gitlab.com/4geit/react-packages/commit/2b2f16b))
### Features
* **DataTable:** add buton ([6c73e29](https://gitlab.com/4geit/react-packages/commit/6c73e29))
<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)
......