From 94d737fc3ace377e18ac392bba728f7c42d48df3 Mon Sep 17 00:00:00 2001 From: snoop Date: Thu, 20 Jul 2017 10:56:21 +0900 Subject: [PATCH] fixed lint --- .../temp/react/components/SensorItems.tsx | 6 +- .../temp/react/components/Sensors.tsx | 82 ++++++++++--------- .../react/components/TableExampleSortable.tsx | 16 ++-- .../temp/react/components/TargetDetails.tsx | 15 ++-- .../temp/react/components/Targets.tsx | 70 ++++++++-------- .../temp/react/components/TopBar.tsx | 21 +++-- 6 files changed, 105 insertions(+), 105 deletions(-) diff --git a/src/ts/@overflow/temp/react/components/SensorItems.tsx b/src/ts/@overflow/temp/react/components/SensorItems.tsx index 20f67a8..39fb8e8 100644 --- a/src/ts/@overflow/temp/react/components/SensorItems.tsx +++ b/src/ts/@overflow/temp/react/components/SensorItems.tsx @@ -9,11 +9,11 @@ export class SensorItems extends React.Component { }; } - componentWillMount() { - + public componentWillMount() { + console.log('componentWillMount'); } - render() { + public render(): JSX.Element { return (
Sensor Item
diff --git a/src/ts/@overflow/temp/react/components/Sensors.tsx b/src/ts/@overflow/temp/react/components/Sensors.tsx index 7fc240b..6420cbb 100644 --- a/src/ts/@overflow/temp/react/components/Sensors.tsx +++ b/src/ts/@overflow/temp/react/components/Sensors.tsx @@ -10,75 +10,75 @@ export class Sensors extends React.Component { super(props, context); this.state = { selected: null, - isDetail: false, //temp + isDetail: false, // temp }; } - componentWillMount() { + public componentWillMount = () => { this.data = [ { - "id": "111", - "metaSensorStatus": { - "name": "NORMAL" + 'id': '111', + 'metaSensorStatus': { + 'name': 'NORMAL', }, - "target": { - "id": "1", + 'target': { + 'id': '1', }, - "metaCrawler": { - "name": "WMI", - "description": "WMI description", + 'metaCrawler': { + 'name': 'WMI', + 'description': 'WMI description', }, - "crawlerInputItems": "json value", - "description": "description1111111111", + 'crawlerInputItems': 'json value', + 'description': 'description1111111111', }, { - "id": "222", - "metaSensorStatus": { - "name": "NORMAL" + 'id': '222', + 'metaSensorStatus': { + 'name': 'NORMAL', }, - "target": { - "id": "1", + 'target': { + 'id': '1', }, - "metaCrawler": { - "name": "SNMP", - "description": "SNMP description", + 'metaCrawler': { + 'name': 'SNMP', + 'description': 'SNMP description', }, - "crawlerInputItems": "json value", - "description": "description1111111111", + 'crawlerInputItems': 'json value', + 'description': 'description1111111111', }, { - "id": "333", - "metaSensorStatus": { - "name": "NORMAL" + 'id': '333', + 'metaSensorStatus': { + 'name': 'NORMAL', }, - "target": { - "id": "1", + 'target': { + 'id': '1', }, - "metaCrawler": { - "name": "JMX", - "description": "JMX description", + 'metaCrawler': { + 'name': 'JMX', + 'description': 'JMX description', }, - "crawlerInputItems": "json value", - "description": "description1111111111", + 'crawlerInputItems': 'json value', + 'description': 'description1111111111', }, ]; } - handleSelect(selectedSensor: object) { + public handleSelect = (selectedSensor: object) => { this.setState({ selected: selectedSensor, isDetail: true, }); } - checkCellStatus(status: any): boolean { + public checkCellStatus = (status: any): boolean => { if (status.name === 'STOPPED') { return true; } return false; } - showStartStopBtn(status: any) { + public showStartStopBtn = (status: any) => { if (status.name === 'STARTED') { return -
); } -} \ No newline at end of file +} diff --git a/src/ts/@overflow/temp/react/components/Targets.tsx b/src/ts/@overflow/temp/react/components/Targets.tsx index d23f66d..2e309c3 100644 --- a/src/ts/@overflow/temp/react/components/Targets.tsx +++ b/src/ts/@overflow/temp/react/components/Targets.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { Table, Button, Modal, Input, Header, Container } from 'semantic-ui-react'; +import { Table, Button, Modal, Input, Header, Container, InputOnChangeData, ButtonProps } from 'semantic-ui-react'; import { TargetDetails } from './TargetDetails'; export class Targets extends React.Component { @@ -11,17 +11,17 @@ export class Targets extends React.Component { }; } - componentWillMount() { - + public componentWillMount = ():void => { + console.log('componentWillMount'); } - handleAddTarget() { + public handleAddTarget = (event: React.MouseEvent, data: ButtonProps) => { this.setState({ openAddTarget: true, }); } - render() { + public render(): JSX.Element { const options = [ { key: 'm', text: 'Male', value: 'male' }, { key: 'f', text: 'Female', value: 'female' }, @@ -66,18 +66,18 @@ export class TargetTable extends React.Component { list: [], }; } - handleSelect(selectedTarget: object) { + public handleSelect = (selectedTarget: object) => { this.setState({ selected: selectedTarget, }); } - handleSearch(e: any, data: any) { + public handleSearch = (event: React.SyntheticEvent, data: InputOnChangeData) => { let searchWord = data.value.toLowerCase(); let foundTarget = new Array(); - for(let target of this.data) { + for (let target of this.data) { let typeName = target.infra.metaInfraType.name.toLowerCase(); - if(typeName.indexOf(searchWord) !== -1) { + if (typeName.indexOf(searchWord) !== -1) { foundTarget.push(target); } } @@ -86,40 +86,40 @@ export class TargetTable extends React.Component { }); } - componentWillMount() { + public componentWillMount = () => { this.data = [ { - "id": "1", - "createDate": "", - "probe": { - "id": "1", + 'id': '1', + 'createDate': '', + 'probe': { + 'id': '1', }, - "infra": { - "id": "1", - "metaInfraType": { - "id": "1", - "name": "OS", - "createDate": "424252" + 'infra': { + 'id': '1', + 'metaInfraType': { + 'id': '1', + 'name': 'OS', + 'createDate': '424252', }, - "childId": "1", - "createDate": "13345235" + 'childId': '1', + 'createDate': '13345235', }, }, { - "id": "2", - "createDate": "", - "probe": { - "id": "1", + 'id': '2', + 'createDate': '', + 'probe': { + 'id': '1', }, - "infra": { - "id": "1", - "metaInfraType": { - "id": "1", - "name": "Host", - "createDate": "424252" + 'infra': { + 'id': '1', + 'metaInfraType': { + 'id': '1', + 'name': 'Host', + 'createDate': '424252', }, - "childId": "1", - "createDate": "13345235" + 'childId': '1', + 'createDate': '13345235', }, }, ]; @@ -128,7 +128,7 @@ export class TargetTable extends React.Component { }); } - render() { + public render(): JSX.Element { return (
Targets
diff --git a/src/ts/@overflow/temp/react/components/TopBar.tsx b/src/ts/@overflow/temp/react/components/TopBar.tsx index 5fb16ed..b2cb940 100644 --- a/src/ts/@overflow/temp/react/components/TopBar.tsx +++ b/src/ts/@overflow/temp/react/components/TopBar.tsx @@ -1,9 +1,9 @@ -import *as React from 'react' +import *as React from 'react'; import { Dropdown, Icon, Menu, Label, Sidebar, Segment, Button, Image, Header, -} from 'semantic-ui-react' +} from 'semantic-ui-react'; import { Link, Route } from 'react-router-dom'; import * as History from 'history'; @@ -27,7 +27,7 @@ const options = [ { key: 'ruby', text: 'Ruby', value: 'ruby' }, { key: 'ui', text: 'UI Design', value: 'ui' }, { key: 'ux', text: 'User Experience', value: 'ux' }, -] +]; @@ -43,9 +43,8 @@ export class TopBar extends React.Component { } - render() { - {/*

React Redux sample

- + public render(): JSX.Element { + {/*

React Redux sample

  • TopBar
  • Signup
  • SignIn
  • @@ -57,14 +56,14 @@ export class TopBar extends React.Component { return ( - +
    - + overFlow Home - + Probe List Noauth Probes @@ -73,7 +72,7 @@ export class TopBar extends React.Component { Sensors - + Maps @@ -95,7 +94,7 @@ export class TopBar extends React.Component { Tree - +