Commits (29)
{
"lerna": "2.0.0",
"version": "1.42.0",
"version": "1.44.3",
"npmClient": "yarn",
"useWorkspaces": true
}
......@@ -3,6 +3,35 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
<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)
### Bug Fixes
* **broadcast-message-component:** fix issue with xs prop in grid ([8a8c9c3](https://gitlab.com/4geit/react-packages/commit/8a8c9c3))
<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)
### Bug Fixes
* **broadcast-message-store:** changes to API call ([34f2dc6](https://gitlab.com/4geit/react-packages/commit/34f2dc6))
* **broadcast-message-store:** fix async method ([9b956ab](https://gitlab.com/4geit/react-packages/commit/9b956ab))
* **minor:** minor ([31bb7f7](https://gitlab.com/4geit/react-packages/commit/31bb7f7))
### Features
* **broadcast-message-store:** add broadcast-message-store and props to define API endpoint ([269d68f](https://gitlab.com/4geit/react-packages/commit/269d68f))
<a name="1.41.0"></a>
# [1.41.0](https://gitlab.com/4geit/react-packages/compare/v1.40.1...v1.41.0) (2017-09-22)
......
{
"name": "@4geit/rct-broadcast-message-component",
"version": "1.41.0",
"version": "1.44.2",
"description": "Broadcast message component to display an input zone for typing and sending messages",
"main": "dist/index.js",
"module": "dist/index.js",
......@@ -12,6 +12,7 @@
"author": "Geraldine Starke <geraldine@starke.fr>",
"license": "MIT",
"dependencies": {
"@4geit/rct-broadcast-message-store": "^1.43.0",
"enzyme": "^2.x",
"material-ui": "next",
"material-ui-icons": "^1.0.0-alpha.19",
......
......@@ -22,27 +22,40 @@ const styles = theme => ({
}
})
// @inject('xyzStore')
@inject('broadcastMessageStore')
@observer
class RctBroadcastMessageComponent extends Component {
componentWillUnmount() {
this.props.broadcastMessageStore.reset()
}
handleMessageChange(event) {
this.props.broadcastMessageStore.setMessage(event.target.value)
}
async handleSubmitForm(event) {
const { broadcastMessageOperationId } = this.props
await this.props.broadcastMessageStore.send({broadcastMessageOperationId})
}
render() {
const { classes, helper, label } = this.props
const { message } = this.props.broadcastMessageStore
return (
<div>
<Card>
<CardContent>
<Grid container align='center' justify='space-between'>
<Grid item xs='11'>
<form className={ classes.form }>
<Grid item xs={11}>
<form className={ classes.form } onSubmit={ this.handleSubmitForm.bind(this)}>
<TextField
label={ label }
helperText={ helper }
fullWidth
margin="normal"
value={ message }
onChange={ this.handleMessageChange.bind(this) }
/>
</form>
</Grid>
<Grid item xs='1'>
<Grid item xs={1}>
<Grid container justify='center'>
<Grid item>
<Button dense raised color="primary">Send</Button>
......@@ -62,11 +75,11 @@ RctBroadcastMessageComponent.propTypes = {
width: PropTypes.string.isRequired,
helper: PropTypes.string,
label: PropTypes.string.isRequired,
// TBD
broadcastMessageOperationId: PropTypes.string.isRequired,
}
RctBroadcastMessageComponent.defaultProps = {
// TBD
broadcastMessageOperationId: 'messageSend',
}
export default compose(withStyles(styles), withWidth())(RctBroadcastMessageComponent)
# include /dist to `npm publish`
!/dist
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
<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)
### Bug Fixes
* **broadcast-message-store:** changes to API call ([34f2dc6](https://gitlab.com/4geit/react-packages/commit/34f2dc6))
* **broadcast-message-store:** fix async method ([9b956ab](https://gitlab.com/4geit/react-packages/commit/9b956ab))
### Features
* **broadcast-message-store:** add broadcast-message-store and props to define API endpoint ([269d68f](https://gitlab.com/4geit/react-packages/commit/269d68f))
# @4geit/rct-broadcast-message-store [![npm version](//badge.fury.io/js/@4geit%2Frct-broadcast-message-store.svg)](//badge.fury.io/js/@4geit%2Frct-broadcast-message-store)
---
store for the broadcast message component
## Demo
A live storybook is available to see how the store looks like @ http://react-packages.ws3.4ge.it
## Installation
1. A recommended way to install ***@4geit/rct-broadcast-message-store*** is through [npm](//www.npmjs.com/search?q=@4geit/rct-broadcast-message-store) package manager using the following command:
```bash
npm i @4geit/rct-broadcast-message-store --save
```
Or use `yarn` using the following command:
```bash
yarn add @4geit/rct-broadcast-message-store
```
2. Depending on where you want to use the store you will need to import the class instance `broadcastMessageStore` or inject it to your project JS file.
If you are willing to use it within a component, then you must use the `inject` decorator provided by `mobx-react` library.
For instance if you want to use this store in your `App.js` component, you can use the RctBroadcastMessageStore store in the JSX code as follows:
```js
import React, { Component } from 'react'
import { inject } from 'mobx-react'
// ...
@inject('broadcastMessageStore')
class App extends Component {
handleClick() {
this.props.broadcastMessageStore.setVar1('dummy value')
}
render() {
return (
<div className="App">
<button onClick={ this.handleClick.bind(this) } >Click here</button>
</div>
)
}
}
```
If you are willing to use the class instance inside another store class, then you can just import the instance as follows:
```js
import broadcastMessageStore from '@4geit/rct-broadcast-message-store'
class DummyStore {
@action doSomething() {
broadcastMessageStore.setVar1('dummy value')
}
}
```
{
"name": "@4geit/rct-broadcast-message-store",
"version": "1.43.0",
"description": "store for the broadcast message component",
"main": "dist/index.js",
"module": "dist/index.js",
"bugs": {
"url": "https://gitlab.com/4geit/react-packages/issues"
},
"homepage": "https://gitlab.com/4geit/react-packages/tree/master/packages/rct-broadcast-message-store#README",
"keywords": [],
"author": "Geraldine Starke <geraldine@starke.fr>",
"license": "MIT",
"dependencies": {
"enzyme": "^2.x",
"mobx": "^3.x",
"react": "^15.x",
"react-dom": "^15.x",
"react-router-dom": "^4.x",
"react-test-renderer": "^15.x"
},
"devDependencies": {
"webpack": "^3.x"
},
"publishConfig": {
"access": "public"
}
}
export { default } from './rct-broadcast-message.store'
import { observable, action, runInAction, toJS } from 'mobx'
import { hashHistory } from 'react-router'
import moment from 'moment'
class RctBroadcastMessageStore {
@observable message = ''
@action setMessage(value) {
this.message = value
}
@action reset() {
this.message = ''
}
@action async send({operationId}) {
this.inProgress = true
try {
const { body } = await swaggerClientStore.client.apis.Account[operationId]({
body: {
message: this.message,
author: "Dummy Name",
date: moment()
}
})
} catch (err) {
console.error(err)
runInAction(() => {
notificationStore.newMessage(err.message)
})
}
}
}
export default new RctBroadcastMessageStore()
var path = require('path');
module.exports = {
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'index.js',
libraryTarget: 'umd',
},
externals: [
/^\@4geit\/[a-zA-Z\-0-9]+$/,
/^autosuggest\-highlight\/[a-zA-Z\-0-9]+$/,
/^babel\-runtime\/[a-zA-Z\-0-9]+$/,
'classnames',
'fbjs',
'keycode',
'material-ui',
/^material\-ui\/[a-zA-Z\-0-9]+$/,
/^material\-ui\/[a-zA-Z\-0-9]+\/[a-zA-Z\-0-9]+$/,
'material-ui-icons',
/^material-ui-icons\/[a-zA-Z\-0-9]+$/,
'mobx',
'mobx-react',
'prop-types',
'react',
/^react\-[a-zA-Z\-0-9]+$/,
'recompose',
/^recompose\/[a-zA-Z\-0-9]$/,
'swagger-client',
'typeface-roboto',
],
module: {
rules: [
// js and jsx
{
test: /\.jsx?$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['react-app'],
plugins: ['transform-decorators-legacy'],
}
}
},
// css
{
test: /\.css$/,
use: [
'style-loader',
'css-loader'
]
}
]
}
};
......@@ -3,6 +3,26 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
<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)
### Bug Fixes
* **chatbox-grid:** refactor operation ID prop types ([aa7029d](https://gitlab.com/4geit/react-packages/commit/aa7029d))
* **reorderable-grid-list:** fix setPosition call with destructured param instead of fixed params ([3e64768](https://gitlab.com/4geit/react-packages/commit/3e64768))
<a name="1.43.1"></a>
## [1.43.1](https://gitlab.com/4geit/react-packages/compare/v1.43.0...v1.43.1) (2017-09-25)
**Note:** Version bump only for package @4geit/rct-chatbox-grid-component
<a name="1.42.0"></a>
# [1.42.0](https://gitlab.com/4geit/react-packages/compare/v1.41.0...v1.42.0) (2017-09-22)
......
{
"name": "@4geit/rct-chatbox-grid-component",
"version": "1.42.0",
"version": "1.44.3",
"description": "chatbox grid component",
"main": "dist/index.js",
"module": "dist/index.js",
......@@ -12,6 +12,7 @@
"author": "Fabian Starke <fabian@starke.fr>",
"license": "MIT",
"dependencies": {
"@4geit/rct-reorderable-grid-list-component": "^1.44.3",
"enzyme": "^2.x",
"material-ui": "next",
"material-ui-icons": "^1.0.0-alpha.19",
......
......@@ -85,18 +85,15 @@ RctChatboxGridComponent.propTypes = {
classes: PropTypes.object.isRequired,
listOperationId: PropTypes.string.isRequired,
addOperationId: PropTypes.string.isRequired,
updateOperationId: PropTypes.string.isRequired,
deleteOperationId: PropTypes.string.isRequired,
activateOperationId: PropTypes.string.isRequired,
unactivateOperationId: PropTypes.string.isRequired,
}
RctChatboxGridComponent.defaultProps = {
listOperationId: 'userChatboxList',
addOperationId: 'addUserChatbox',
editOperationId: 'editUserChatbox',
deleteOperationId: 'deleteUserChatbox',
activateOperationId: 'activateUserChatbox',
unactivateOperationId: 'unactivateUserChatbox',
addOperationId: 'userChatboxAdd',
updateOperationId: 'userChatboxUpdate',
deleteOperationId: 'userChatboxDelete',
}
export default compose(withStyles(styles), withWidth())(RctChatboxGridComponent)
......@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
<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)
### Bug Fixes
* **chatbox-grid:** refactor operation ID prop types ([aa7029d](https://gitlab.com/4geit/react-packages/commit/aa7029d))
* **reorderable-grid-list:** fix setPosition call with destructured param instead of fixed params ([3e64768](https://gitlab.com/4geit/react-packages/commit/3e64768))
<a name="1.42.0"></a>
# [1.42.0](https://gitlab.com/4geit/react-packages/compare/v1.41.0...v1.42.0) (2017-09-22)
......
{
"name": "@4geit/rct-chatbox-grid-store",
"version": "1.42.0",
"version": "1.44.3",
"description": "store for the chatbox-grid component",
"main": "dist/index.js",
"module": "dist/index.js",
......
......@@ -32,11 +32,11 @@ class RctChatboxGridStore {
})
}
}
@action async setPosition({ editOperationId }) {
editOperationId = editOperationId || 'editChatboxList'
@action async setPosition({ updateOperationId, itemId, position }) {
updateOperationId = updateOperationId || 'userChatboxUpdate'
this.inProgress = true
try {
const { body } = await swaggerClientStore.client.apis.Account[editOperationId]()
const { body } = await swaggerClientStore.client.apis.Account[updateOperationId]()
if (body.length) {
runInAction(() => {
this.setData( body )
......@@ -51,6 +51,7 @@ class RctChatboxGridStore {
}
}
@action async addItem({ addOperationId, listOperationId }) {
addOperationId = addOperationId || 'userChatboxAdd'
this.inProgress = true
try {
const { body } = await swaggerClientStore.client.apis.Account[addOperationId]()
......@@ -66,6 +67,7 @@ class RctChatboxGridStore {
}
}
@action async deleteItem ({ deleteOperationId, listOperationId }) {
deleteOperationId = deleteOperationId || 'userChatboxDelete'
this.inProgress = true
try {
const {body } = await
......@@ -81,11 +83,12 @@ class RctChatboxGridStore {
})
}
}
@action async activateItem({ activateOperationId, listOperationId }) {
@action async activateItem({ updateOperationId, listOperationId }) {
updateOperationId = updateOperationId || 'userChatboxUpdate'
this.inProgress = true
try {
const { body } = await
swaggerClientStore.client.apis.Account[activateOperationId]()
swaggerClientStore.client.apis.Account[updateOperationId]()
await this.fetchData({ listOperationId })
runInAction(() => {
this.inProgress = false
......@@ -96,11 +99,12 @@ class RctChatboxGridStore {
})
}
}
@action async unactivateItem({ unactivateOperationId, listOperationId }) {
@action async unactivateItem({ updateOperationId, listOperationId }) {
updateOperationId = updateOperationId || 'userChatboxUpdate'
this.inProgress = true
try {
const { body } = await
swaggerClientStore.client.apis.Account[unactivateOperationId]()
swaggerClientStore.client.apis.Account[updateOperationId]()
await this.fetchData({ listOperationId })
runInAction(() => {
this.inProgress = false
......
......@@ -3,6 +3,28 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
<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)
### Bug Fixes
* **data-table:** fix columns menu issue ([dbac9e2](https://gitlab.com/4geit/react-packages/commit/dbac9e2))
<a name="1.44.0"></a>
# [1.44.0](https://gitlab.com/4geit/react-packages/compare/v1.43.1...v1.44.0) (2017-09-26)
### Features
* **Import action Button:** Added icon ([34e111e](https://gitlab.com/4geit/react-packages/commit/34e111e))
<a name="1.41.0"></a>
# [1.41.0](https://gitlab.com/4geit/react-packages/compare/v1.40.1...v1.41.0) (2017-09-22)
......
{
"name": "@4geit/rct-data-table-component",
"version": "1.41.0",
"version": "1.44.1",
"description": "data table component for react apps",
"main": "dist/index.js",
"module": "dist/index.js",
......