File tree Expand file tree Collapse file tree 4 files changed +65
-5
lines changed
packages/node_modules/@ciscospark/widget-message-meet/src
src/demo-widget-message-meet Expand file tree Collapse file tree 4 files changed +65
-5
lines changed Original file line number Diff line number Diff line change 17
17
"eslint" : " eslint packages" ,
18
18
"serve" : " npm run start" ,
19
19
"stylelint" : " stylelint \" packages/node_modules/**/*.css\" " ,
20
- "start" : " NODE_ENV=development webpack-dev-server --config scripts/webpack/webpack.dev.babel.js --hot --inline --history-api-fallback"
20
+ "start" : " NODE_ENV=development webpack-dev-server --config scripts/webpack/webpack.dev.babel.js --hot --inline --history-api-fallback" ,
21
+ "start:demo" : " NODE_ENV=development webpack-dev-server --config scripts/webpack/webpack.demo.babel.js --hot --inline --history-api-fallback"
21
22
},
22
23
"repository" : {
23
24
"type" : " git" ,
99
100
"postcss-cssnext" : " ^2.9.0" ,
100
101
"postcss-loader" : " ^1.2.1" ,
101
102
"postcss-reporter" : " ^3.0.0" ,
103
+ "react-cookie" : " ^1.0.4" ,
102
104
"react-router" : " ^3.0.2" ,
103
105
"react-tap-event-plugin" : " ^2.0.1" ,
104
106
"react-test-renderer" : " ^15.4.1" ,
Original file line number Diff line number Diff line change
1
+ /**
2
+ * In development we assume that the code generated is going to be consumed by
3
+ * webpack dev server and we are bundling into a single js file.
4
+ */
5
+
6
+ import webpack from 'webpack' ;
7
+ import webpackConfigBase from './webpack.base.babel' ;
8
+ import HtmlWebpackPlugin from 'html-webpack-plugin' ;
9
+
10
+ const plugins = [
11
+ new HtmlWebpackPlugin ( {
12
+ template : `index.html`
13
+ } ) ,
14
+ new webpack . EnvironmentPlugin ( [
15
+ `CISCOSPARK_ACCESS_TOKEN` ,
16
+ `MESSAGE_DEMO_CLIENT_ID` ,
17
+ `MESSAGE_DEMO_CLIENT_SECRET` ,
18
+ `TO_PERSON_EMAIL` ,
19
+ `TO_PERSON_ID`
20
+ ] )
21
+ ] ;
22
+
23
+ export default webpackConfigBase ( {
24
+ entry : `./demo.js` ,
25
+ plugins,
26
+ devtool : `cheap-module-eval-source-map` ,
27
+ devServer : {
28
+ port : 8000 ,
29
+ stats : {
30
+ colors : true ,
31
+ hash : false ,
32
+ version : false ,
33
+ timings : false ,
34
+ assets : true ,
35
+ chunks : false ,
36
+ modules : false ,
37
+ reasons : false ,
38
+ children : false ,
39
+ source : false ,
40
+ errors : true ,
41
+ errorDetails : true ,
42
+ warnings : true ,
43
+ publicPath : false
44
+ }
45
+ }
46
+ } ) ;
Original file line number Diff line number Diff line change 1
1
/* eslint-disable react/no-set-state */
2
2
import React , { Component } from 'react' ;
3
3
import classNames from 'classnames' ;
4
+ import cookie from 'react-cookie' ;
4
5
5
6
import SparkLogo from '@ciscospark/react-component-spark-logo' ;
6
7
import SparkOAuth from '@ciscospark/react-component-spark-oauth' ;
@@ -19,8 +20,8 @@ class DemoWidgetMessageMeet extends Component {
19
20
this . state = {
20
21
authenticate : false ,
21
22
mode : MODE_INLINE ,
22
- accessToken : `` ,
23
- toPersonEmail : `` ,
23
+ accessToken : cookie . load ( `accessToken` ) || `` ,
24
+ toPersonEmail : cookie . load ( `toPersonEmail` ) || `` ,
24
25
running : false ,
25
26
clientId : process . env . MESSAGE_DEMO_CLIENT_ID ,
26
27
clientSecret : process . env . MESSAGE_DEMO_CLIENT_SECRET ,
@@ -41,6 +42,8 @@ class DemoWidgetMessageMeet extends Component {
41
42
42
43
handleSubmit ( e ) {
43
44
e . preventDefault ( ) ;
45
+ cookie . save ( `accessToken` , this . state . accessToken ) ;
46
+ cookie . save ( `toPersonEmail` , this . state . toPersonEmail ) ;
44
47
this . setState ( { running : true } ) ;
45
48
}
46
49
You can’t perform that action at this time.
0 commit comments