Browse Source

Fixed lots of lint issues

update-deps
Alex Mikhalev 7 years ago
parent
commit
a3c6fa2b8e
  1. 6
      app/components/ProgramTable.tsx
  2. 2
      app/components/ScheduleView/ScheduleDate.tsx
  3. 9
      app/components/ScheduleView/ScheduleTimes.tsx
  4. 8
      app/components/ScheduleView/TimeInput.tsx
  5. 6
      app/components/ScheduleView/WeekdaysView.tsx
  6. 2
      app/components/ScheduleView/index.tsx
  7. 6
      app/pages/ProgramPage.tsx

6
app/components/ProgramTable.tsx

@ -2,7 +2,7 @@ import { observer } from "mobx-react"; @@ -2,7 +2,7 @@ import { observer } from "mobx-react";
import { RouterStore } from "mobx-react-router";
import * as React from "react";
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 * as rp from "@app/routePaths";
@ -54,8 +54,10 @@ class ProgramRows extends React.Component<{ @@ -54,8 +54,10 @@ class ProgramRows extends React.Component<{
const detailRow = expanded && (
<Table.Row>
<Table.Cell className="program--sequence" colSpan="5">
<Form>
<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.Row>
);

2
app/components/ScheduleView/ScheduleDate.tsx

@ -56,7 +56,7 @@ export default class ScheduleDate extends React.Component<ScheduleDateProps, Sch @@ -56,7 +56,7 @@ export default class ScheduleDate extends React.Component<ScheduleDateProps, Sch
let labelNode: React.ReactNode = null;
if (typeof label === "string") {
labelNode = <label>{label}</label>
labelNode = <label>{label}</label>;
} else if (label != null) {
labelNode = label;
}

9
app/components/ScheduleView/ScheduleTimes.tsx

@ -27,10 +27,11 @@ export default class ScheduleTimes extends React.Component<{ @@ -27,10 +27,11 @@ export default class ScheduleTimes extends React.Component<{
</span>
);
}
return (<Form.Field inline className="scheduleTimes">
<label>At</label>
{timesNode}
</Form.Field>);
return (
<Form.Field inline className="scheduleTimes">
<label>At</label> {timesNode}
</Form.Field>
);
}
private onTimeChange = (newTime: TimeOfDay, index: number) => {
const { times, onChange } = this.props;

8
app/components/ScheduleView/TimeInput.tsx

@ -28,18 +28,22 @@ export default class TimeInput extends React.Component<TimeInputProps, TimeInput @@ -28,18 +28,22 @@ export default class TimeInput extends React.Component<TimeInputProps, TimeInput
}
return {};
}
constructor(p: any) {
super(p);
this.state = { rawValue: "", lastTime: null };
}
render() {
return <Input type="time" value={this.state.rawValue} onChange={this.onChange} onBlur={this.onBlur} />;
}
private onChange = (e: React.SyntheticEvent<HTMLInputElement>, data: InputOnChangeData) => {
this.setState({
rawValue: data.value,
});
};
}
private onBlur: React.FocusEventHandler<HTMLInputElement> = (e) => {
const m = moment(this.state.rawValue, HTML_TIME_INPUT_FORMAT);
if (m.isValid()) {
@ -47,5 +51,5 @@ export default class TimeInput extends React.Component<TimeInputProps, TimeInput @@ -47,5 +51,5 @@ export default class TimeInput extends React.Component<TimeInputProps, TimeInput
} else {
this.setState({ rawValue: timeOfDayToHtmlDateInput(this.props.value) });
}
};
}
}

6
app/components/ScheduleView/WeekdaysView.tsx

@ -31,9 +31,11 @@ export default class WeekdaysView extends React.Component<WeekdaysViewProps> { @@ -31,9 +31,11 @@ export default class WeekdaysView extends React.Component<WeekdaysViewProps> {
} else {
node = weekdays.map((weekday) => Weekday[weekday]).join(", ");
}
return (<Form.Group inline>
return (
<Form.Group inline>
<label>On</label> {node}
</Form.Group>);
</Form.Group>
);
}
private toggleWeekday = (event: React.FormEvent<HTMLInputElement>, data: CheckboxProps) => {
const { weekdays, onChange } = this.props;

2
app/components/ScheduleView/index.tsx

@ -23,7 +23,7 @@ export default class ScheduleView extends React.Component<ScheduleViewProps> { @@ -23,7 +23,7 @@ export default class ScheduleView extends React.Component<ScheduleViewProps> {
let labelNode: React.ReactNode;
if (typeof label === "string") {
labelNode = <label>{label}</label>
labelNode = <label>{label}</label>;
} else if (label != null) {
labelNode = label;
}

6
app/pages/ProgramPage.tsx

@ -145,7 +145,11 @@ class ProgramPage extends React.Component<ProgramPageProps> { @@ -145,7 +145,11 @@ class ProgramPage extends React.Component<ProgramPageProps> {
</Form.Group>
<Form.Field>
<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>
<ScheduleView schedule={schedule} editing={editing} label={<h4>Schedule</h4>} />
</Form>

Loading…
Cancel
Save