-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 50f139a
Showing
7 changed files
with
128 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"presets": [ | ||
"es2015", | ||
"react" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{ | ||
"name": "mozaik-ext-slack", | ||
"version": "0.1.0", | ||
"description": "Slack widgets to Mozaik dashboard", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "ava" | ||
}, | ||
"keywords": [ | ||
"slack", | ||
"mozaik", | ||
"dashboard", | ||
"extension" | ||
], | ||
"author": "Juha Mustonen <[email protected]>", | ||
"license": "MIT", | ||
"dependencies": { | ||
"babel-core": "6.7.6", | ||
"babel-preset-es2015": "6.6.0", | ||
"babel-preset-react": "6.5.0", | ||
"babelify": "7.2.0", | ||
"bluebird": "3.3.5", | ||
"chalk": "1.1.3", | ||
"convict": "^0.6.1", | ||
"lodash": "^3.5.0", | ||
"react-mixin": "3.0.4", | ||
"reflux": "0.4.1", | ||
"superagent": "1.8.3", | ||
"superagent-bluebird-promise": "3.0.0", | ||
"dotenv": "^0.5.1", | ||
"pretty-print": "^1.0.0", | ||
"react-classset": "0.0.2", | ||
"validator": "^3.30.0" | ||
}, | ||
"devDependencies": { | ||
"ava": "^0.15.2", | ||
"babel-eslint": "6.0.2", | ||
"babel-register": "6.7.2", | ||
"eslint": "^2.13.0", | ||
"eslint-plugin-react": "^5.2.2", | ||
"gulp": "^3.8.11", | ||
"jsdom": "^9.2.1", | ||
"proxyquire": "^1.7.9", | ||
"touch": "0.0.3" | ||
}, | ||
"peerDependencies": { | ||
"mozaik": ">=1.4.2", | ||
"react": "^0.13.3" | ||
}, | ||
"browserify": { | ||
"transform": [ | ||
"babelify" | ||
] | ||
}, | ||
"ava": { | ||
"files": [ | ||
"tests/*.test.js" | ||
], | ||
"tap": false, | ||
"failFast": true, | ||
"require": [ | ||
"babel-register" | ||
], | ||
"babel": "inherit" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import Promise from 'bluebird'; | ||
|
||
const client = mozaik => { | ||
const count = 0; | ||
|
||
return { | ||
channel(send, params) { | ||
setInterval(() => { | ||
count += 1; | ||
send({ count }); | ||
}, 800); | ||
} | ||
}; | ||
}; | ||
|
||
export default client; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import React, { Component } from 'react'; | ||
import reactMixin from 'react-mixin'; | ||
import { ListenerMixin } from 'reflux'; | ||
import Mozaik from 'mozaik/browser'; | ||
|
||
class Channel extends Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = { count: 0 }; | ||
} | ||
|
||
getApiRequest() { | ||
return { id: 'slack.channel.123' }; | ||
} | ||
|
||
onApiData(data) { | ||
console.log(data); | ||
this.setState({ count: data.count }); | ||
} | ||
|
||
render() { | ||
const { count } = this.state; | ||
|
||
return ( | ||
<div>{count}</div> | ||
); | ||
} | ||
} | ||
|
||
// apply the mixins on the component | ||
reactMixin(ClientConsumer.prototype, ListenerMixin); | ||
reactMixin(ClientConsumer.prototype, Mozaik.Mixin.ApiConsumer); | ||
|
||
export default ClientConsumer; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import test from 'ava'; | ||
|
||
test('returns methods', t => { | ||
t.true(true); | ||
}); |