Fixed lots of lint issues
This commit is contained in:
parent
03f317c1ba
commit
a3c6fa2b8e
@ -2,7 +2,7 @@ import { observer } from "mobx-react";
|
|||||||
import { RouterStore } from "mobx-react-router";
|
import { RouterStore } from "mobx-react-router";
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import { Button, ButtonProps, Icon, Table } from "semantic-ui-react";
|
import { Button, ButtonProps, Form, Icon, Table } from "semantic-ui-react";
|
||||||
|
|
||||||
import { ProgramSequenceView, ScheduleView } from "@app/components";
|
import { ProgramSequenceView, ScheduleView } from "@app/components";
|
||||||
import * as rp from "@app/routePaths";
|
import * as rp from "@app/routePaths";
|
||||||
@ -54,8 +54,10 @@ class ProgramRows extends React.Component<{
|
|||||||
const detailRow = expanded && (
|
const detailRow = expanded && (
|
||||||
<Table.Row>
|
<Table.Row>
|
||||||
<Table.Cell className="program--sequence" colSpan="5">
|
<Table.Cell className="program--sequence" colSpan="5">
|
||||||
|
<Form>
|
||||||
<h4>Sequence: </h4> <ProgramSequenceView sequence={sequence} sections={sections} />
|
<h4>Sequence: </h4> <ProgramSequenceView sequence={sequence} sections={sections} />
|
||||||
<h4>Schedule: </h4> <ScheduleView schedule={schedule}/>
|
<ScheduleView schedule={schedule} label={<h4>Schedule: </h4>} />
|
||||||
|
</Form>
|
||||||
</Table.Cell>
|
</Table.Cell>
|
||||||
</Table.Row>
|
</Table.Row>
|
||||||
);
|
);
|
||||||
|
@ -56,7 +56,7 @@ export default class ScheduleDate extends React.Component<ScheduleDateProps, Sch
|
|||||||
|
|
||||||
let labelNode: React.ReactNode = null;
|
let labelNode: React.ReactNode = null;
|
||||||
if (typeof label === "string") {
|
if (typeof label === "string") {
|
||||||
labelNode = <label>{label}</label>
|
labelNode = <label>{label}</label>;
|
||||||
} else if (label != null) {
|
} else if (label != null) {
|
||||||
labelNode = label;
|
labelNode = label;
|
||||||
}
|
}
|
||||||
|
@ -27,10 +27,11 @@ export default class ScheduleTimes extends React.Component<{
|
|||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return (<Form.Field inline className="scheduleTimes">
|
return (
|
||||||
<label>At</label>
|
<Form.Field inline className="scheduleTimes">
|
||||||
{timesNode}
|
<label>At</label> {timesNode}
|
||||||
</Form.Field>);
|
</Form.Field>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
private onTimeChange = (newTime: TimeOfDay, index: number) => {
|
private onTimeChange = (newTime: TimeOfDay, index: number) => {
|
||||||
const { times, onChange } = this.props;
|
const { times, onChange } = this.props;
|
||||||
|
@ -28,18 +28,22 @@ export default class TimeInput extends React.Component<TimeInputProps, TimeInput
|
|||||||
}
|
}
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(p: any) {
|
constructor(p: any) {
|
||||||
super(p);
|
super(p);
|
||||||
this.state = { rawValue: "", lastTime: null };
|
this.state = { rawValue: "", lastTime: null };
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return <Input type="time" value={this.state.rawValue} onChange={this.onChange} onBlur={this.onBlur} />;
|
return <Input type="time" value={this.state.rawValue} onChange={this.onChange} onBlur={this.onBlur} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
private onChange = (e: React.SyntheticEvent<HTMLInputElement>, data: InputOnChangeData) => {
|
private onChange = (e: React.SyntheticEvent<HTMLInputElement>, data: InputOnChangeData) => {
|
||||||
this.setState({
|
this.setState({
|
||||||
rawValue: data.value,
|
rawValue: data.value,
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
|
||||||
private onBlur: React.FocusEventHandler<HTMLInputElement> = (e) => {
|
private onBlur: React.FocusEventHandler<HTMLInputElement> = (e) => {
|
||||||
const m = moment(this.state.rawValue, HTML_TIME_INPUT_FORMAT);
|
const m = moment(this.state.rawValue, HTML_TIME_INPUT_FORMAT);
|
||||||
if (m.isValid()) {
|
if (m.isValid()) {
|
||||||
@ -47,5 +51,5 @@ export default class TimeInput extends React.Component<TimeInputProps, TimeInput
|
|||||||
} else {
|
} else {
|
||||||
this.setState({ rawValue: timeOfDayToHtmlDateInput(this.props.value) });
|
this.setState({ rawValue: timeOfDayToHtmlDateInput(this.props.value) });
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
}
|
}
|
@ -31,9 +31,11 @@ export default class WeekdaysView extends React.Component<WeekdaysViewProps> {
|
|||||||
} else {
|
} else {
|
||||||
node = weekdays.map((weekday) => Weekday[weekday]).join(", ");
|
node = weekdays.map((weekday) => Weekday[weekday]).join(", ");
|
||||||
}
|
}
|
||||||
return (<Form.Group inline>
|
return (
|
||||||
|
<Form.Group inline>
|
||||||
<label>On</label> {node}
|
<label>On</label> {node}
|
||||||
</Form.Group>);
|
</Form.Group>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
private toggleWeekday = (event: React.FormEvent<HTMLInputElement>, data: CheckboxProps) => {
|
private toggleWeekday = (event: React.FormEvent<HTMLInputElement>, data: CheckboxProps) => {
|
||||||
const { weekdays, onChange } = this.props;
|
const { weekdays, onChange } = this.props;
|
||||||
|
@ -23,7 +23,7 @@ export default class ScheduleView extends React.Component<ScheduleViewProps> {
|
|||||||
|
|
||||||
let labelNode: React.ReactNode;
|
let labelNode: React.ReactNode;
|
||||||
if (typeof label === "string") {
|
if (typeof label === "string") {
|
||||||
labelNode = <label>{label}</label>
|
labelNode = <label>{label}</label>;
|
||||||
} else if (label != null) {
|
} else if (label != null) {
|
||||||
labelNode = label;
|
labelNode = label;
|
||||||
}
|
}
|
||||||
|
@ -145,7 +145,11 @@ class ProgramPage extends React.Component<ProgramPageProps> {
|
|||||||
</Form.Group>
|
</Form.Group>
|
||||||
<Form.Field>
|
<Form.Field>
|
||||||
<label><h4>Sequence</h4></label>
|
<label><h4>Sequence</h4></label>
|
||||||
<ProgramSequenceView sequence={sequence} sections={this.device.sections} editing={editing}/>
|
<ProgramSequenceView
|
||||||
|
sequence={sequence}
|
||||||
|
sections={this.device.sections}
|
||||||
|
editing={editing}
|
||||||
|
/>
|
||||||
</Form.Field>
|
</Form.Field>
|
||||||
<ScheduleView schedule={schedule} editing={editing} label={<h4>Schedule</h4>} />
|
<ScheduleView schedule={schedule} editing={editing} label={<h4>Schedule</h4>} />
|
||||||
</Form>
|
</Form>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user