From 94fa662b96b1580a04d2f92adec5f9f31fb17531 Mon Sep 17 00:00:00 2001 From: geek Date: Thu, 20 Jul 2017 12:20:42 +0900 Subject: [PATCH] =?UTF-8?q?=E3=85=87tslint?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +- config/webpack/webpack.config.dev.js | 11 +- .../member/react/components/PWChange.tsx | 33 +++--- .../member/react/components/SignIn.tsx | 2 +- .../member/react/components/SignUp.tsx | 110 ++++++++++-------- .../react/components/DiscoveryDetails.tsx | 55 +++++---- 6 files changed, 126 insertions(+), 88 deletions(-) diff --git a/.gitignore b/.gitignore index b3e913e..8198112 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ dist/ **/.vs **/.vscode .idea -yarn.lock \ No newline at end of file +yarn.lock +npm-debug.log \ No newline at end of file diff --git a/config/webpack/webpack.config.dev.js b/config/webpack/webpack.config.dev.js index 07484d4..458980f 100644 --- a/config/webpack/webpack.config.dev.js +++ b/config/webpack/webpack.config.dev.js @@ -9,7 +9,7 @@ module.exports = WebpackMerge(configBase, { app: [ ] }, - + devtool: 'inline-source-map', devServer: { @@ -17,11 +17,18 @@ module.exports = WebpackMerge(configBase, { inline: true, historyApiFallback: true, publicPath: '/', // match the output `publicPath` + contentBase: [__dirname + '/public', __dirname + '/dist', __dirname + '/node_modules'], // match the output path host: '127.0.0.1', - port: 9091, + port: 9093, stats: { colors: true }, + watchOptions: { + // ignored: [ Path.resolve(__dirname, '../../node_modules/') ], + ignored: /node_modules/, + aggregateTimeout: 300, + poll: 1000 + }, }, module: { diff --git a/src/ts/@overflow/member/react/components/PWChange.tsx b/src/ts/@overflow/member/react/components/PWChange.tsx index ce4b7ca..2900649 100644 --- a/src/ts/@overflow/member/react/components/PWChange.tsx +++ b/src/ts/@overflow/member/react/components/PWChange.tsx @@ -1,38 +1,39 @@ -import *as React from 'react' +import *as React from 'react'; import { - Input, InputOnChangeData, - Select, Button, Grid, Form, Container -} from 'semantic-ui-react' - + Input, + InputOnChangeData, + Select, + Button, + Grid, + Form, + Container, +} from 'semantic-ui-react'; export interface State { - + pass: string; + passCon: string; } export interface Props { } - - -export class PWChange extends React.Component { - constructor(props: any, context: any) { +export class PWChange extends React.Component { + constructor(props: Props, context: State) { super(props, context); this.state = { - pass:'', - passCon:'', - } + pass:null, + passCon:null, + }; } - public onSubmit = () => { + public onSubmit():void { console.log(this.state); } public render(): JSX.Element { - - return ( diff --git a/src/ts/@overflow/member/react/components/SignIn.tsx b/src/ts/@overflow/member/react/components/SignIn.tsx index c665edb..0245d8f 100644 --- a/src/ts/@overflow/member/react/components/SignIn.tsx +++ b/src/ts/@overflow/member/react/components/SignIn.tsx @@ -27,7 +27,7 @@ export interface State { } export class SignIn extends React.Component { - constructor(props: any, context: any) { + constructor(props: Props, context: State) { super(props, context); this.state = { diff --git a/src/ts/@overflow/member/react/components/SignUp.tsx b/src/ts/@overflow/member/react/components/SignUp.tsx index a2223d4..68fff0e 100644 --- a/src/ts/@overflow/member/react/components/SignUp.tsx +++ b/src/ts/@overflow/member/react/components/SignUp.tsx @@ -1,19 +1,31 @@ -import *as React from 'react' +import *as React from 'react'; import { - Input, InputOnChangeData, - Select, Button, Dropdown, Grid, Form, Container -} from 'semantic-ui-react' + Input, + InputOnChangeData, + Select, + Button, + Dropdown, + Grid, + Form, + Container, +} from 'semantic-ui-react'; - -export interface State { - -} export interface Props { } +export interface State { + email: string; + name: string; + pass: string; + passCon: string; + company: string; + phone: string; + country: string; +} + const options = [{ key: 'southkorea', value: '82', text: 'South Korea(82)' }, -{ key: 'unitedstates', value: '1', text: 'United States(1)' }] + { key: 'unitedstates', value: '1', text: 'United States(1)' }] export class SignUp extends React.Component { @@ -21,31 +33,27 @@ export class SignUp extends React.Component { super(props, context); this.state = { - email: '', - name: '', - pass: '', - passCon: '', - company: '', - phone: '', - country: '', + email: null, + name: null, + pass: null, + passCon: null, + company: null, + phone: null, + country: null, }; } - - public onSubmit = () => { - console.log(this.state) - + public onSubmit():void { + console.log(this.state); } - public onChange = (event: React.SyntheticEvent, data: InputOnChangeData) => { - + public onChange (event: React.SyntheticEvent, data: InputOnChangeData):void { + console.log(event); + console.log(data); } - public render(): JSX.Element { - - return ( @@ -58,24 +66,36 @@ export class SignUp extends React.Component { (event: React.SyntheticEvent, data: InputOnChangeData) => { this.setState({ email: data.value }); }} /> - , data: InputOnChangeData) => { - this.setState({ name: data.value }); - }} /> - , data: InputOnChangeData) => { - this.setState({ pass: data.value }); - }} /> - , data: InputOnChangeData) => { - this.setState({ passCon: data.value }); - }} /> - , data: InputOnChangeData) => { - this.setState({ company: data.value }); - }} /> - , data: InputOnChangeData) => { - this.setState({ country: data.value }); - }} /> - , data: InputOnChangeData) => { - this.setState({ phone: data.value }); - }} /> + , data: InputOnChangeData) => { + this.setState({ name: data.value }); + } + }/> + , data: InputOnChangeData) => { + this.setState({ pass: data.value }); + } + } /> + , data: InputOnChangeData) => { + this.setState({ passCon: data.value }); + } + } /> + , data: InputOnChangeData) => { + this.setState({ company: data.value }); + } + }/> + , data: InputOnChangeData) => { + this.setState({ country: data.value }); + } + } /> + , data: InputOnChangeData) => { + this.setState({ phone: data.value }); + } + } /> @@ -88,12 +108,8 @@ export class SignUp extends React.Component { - - ); } - - } diff --git a/src/ts/@overflow/temp/react/components/DiscoveryDetails.tsx b/src/ts/@overflow/temp/react/components/DiscoveryDetails.tsx index bf7ec8b..76867bf 100644 --- a/src/ts/@overflow/temp/react/components/DiscoveryDetails.tsx +++ b/src/ts/@overflow/temp/react/components/DiscoveryDetails.tsx @@ -1,63 +1,76 @@ import * as React from 'react'; -import { Button, Modal, Checkbox, Header, Container } from 'semantic-ui-react'; +import { + Button, + Modal, + Checkbox, + Header, + Container, +} from 'semantic-ui-react'; import { DiscoveryProbe } from './DiscoveryProbe'; import { DiscoveryTable } from './DiscoveryTable'; -export class DiscoveryDetails extends React.Component { +export interface Props { + +} + +export interface State { + startPopup:boolean; +} + + +export class DiscoveryDetails extends React.Component { private probeTemp: any; private submitData: any; - constructor(props: any, context: any) { + public constructor(props: Props, context: State) { super(props, context); this.handleProbeChange.bind(this); this.state = { - startPopup:false + startPopup:false, }; } - - - componentWillMount() { - this.probeTemp = - { + public componentWillMount():void { + super.componentWillMount(); + this.probeTemp = { 'id': '11', 'metaProbeStatus': { - 'name': 'STARTED' + 'name': 'STARTED', }, 'domain': { - 'name': 'overFlow\'s domain111' + 'name': 'overFlow\'s domain111', }, 'host': { 'ip': '192.168.1.103', 'mac': '44:8a:5b:44:8c:e8', 'os': 'Ubuntu 17.04', - 'name': '?????' + 'name': '?????', }, 'createAt': '2017-07-12', 'probeKey': 'AGBLKDFJ2452ASDGFL2KWJLKSDJ', 'description': 'description1111111111', 'lastPollingAt': '2017-07-12 14:20', - 'nextPollingAt': '2017-07-12 14:30' + 'nextPollingAt': '2017-07-12 14:30', }; } - handleProbeChange(obj: any) { - console.log(obj) + public handleProbeChange(obj: any): void { + console.log(obj); this.setState({ startPopup:true }); this.submitData = obj; } - handleSubmit() { - console.log(this.submitData) + public handleSubmit(): void { + console.log(this.submitData); } - handleCancel= () => this.setState({ startPopup: false }); + public handleCancel= () => this.setState({ startPopup: false }); - handlePopupClose = () => this.setState({ startPopup: false }); + public handlePopupClose = () => this.setState({ startPopup: false }); - render() { + public render(): JSX.Element { return (
Discovery Details
@@ -80,4 +93,4 @@ export class DiscoveryDetails extends React.Component { ); } -} \ No newline at end of file +}