Browse Source

Fixed compilation issues

update-deps
Alex Mikhalev 7 years ago
parent
commit
5ff2825fb1
  1. 4
      app/components/DeviceView.tsx
  2. 4
      app/components/MessageTest.tsx
  3. 4
      app/components/MessagesView.tsx
  4. 2
      app/components/RunSectionForm.tsx
  5. 5
      app/index.tsx
  6. 2
      app/state/StateBase.ts

4
app/components/DeviceView.tsx

@ -3,7 +3,7 @@ import { observer } from "mobx-react";
import * as React from "react"; import * as React from "react";
import { Grid, Header, Icon, Item } from "semantic-ui-react"; import { Grid, Header, Icon, Item } from "semantic-ui-react";
import { injectState, MqttApiState } from "@app/state"; import { injectState, StateBase } from "@app/state";
import { SprinklersDevice } from "@common/sprinklers"; import { SprinklersDevice } from "@common/sprinklers";
import { ProgramTable, RunSectionForm, SectionRunnerView, SectionTable } from "."; import { ProgramTable, RunSectionForm, SectionRunnerView, SectionTable } from ".";
@ -23,7 +23,7 @@ function ConnectionState({ connected, className }: { connected: boolean, classNa
interface DeviceViewProps { interface DeviceViewProps {
deviceId: string; deviceId: string;
state: MqttApiState; state: StateBase;
} }
class DeviceView extends React.Component<DeviceViewProps> { class DeviceView extends React.Component<DeviceViewProps> {

4
app/components/MessageTest.tsx

@ -1,10 +1,10 @@
import * as React from "react"; import * as React from "react";
import { Button, Segment } from "semantic-ui-react"; import { Button, Segment } from "semantic-ui-react";
import { injectState, MqttApiState } from "@app/state"; import { injectState, StateBase } from "@app/state";
import { getRandomId } from "@common/utils"; import { getRandomId } from "@common/utils";
class MessageTest extends React.Component<{ state: MqttApiState }> { class MessageTest extends React.Component<{ state: StateBase }> {
render() { render() {
return ( return (
<Segment> <Segment>

4
app/components/MessagesView.tsx

@ -3,7 +3,7 @@ import { observer } from "mobx-react";
import * as React from "react"; import * as React from "react";
import { Message, MessageProps, TransitionGroup } from "semantic-ui-react"; import { Message, MessageProps, TransitionGroup } from "semantic-ui-react";
import { injectState, MqttApiState, UiMessage, UiStore } from "@app/state/"; import { injectState, StateBase, UiMessage, UiStore } from "@app/state/";
@observer @observer
class MessageView extends React.Component<{ class MessageView extends React.Component<{
@ -33,7 +33,7 @@ class MessageView extends React.Component<{
} }
} }
class MessagesView extends React.Component<{ state: MqttApiState }> { class MessagesView extends React.Component<{ state: StateBase }> {
render() { render() {
const { uiStore } = this.props.state; const { uiStore } = this.props.state;
const messages = uiStore.messages.map((message) => ( const messages = uiStore.messages.map((message) => (

2
app/components/RunSectionForm.tsx

@ -1,7 +1,7 @@
import { computed } from "mobx"; import { computed } from "mobx";
import { observer } from "mobx-react"; import { observer } from "mobx-react";
import * as React from "react"; import * as React from "react";
import { DropdownItemProps, DropdownProps, Form, Grid, Header, Segment } from "semantic-ui-react"; import { DropdownItemProps, DropdownProps, Form, Header, Segment } from "semantic-ui-react";
import { Duration } from "@common/Duration"; import { Duration } from "@common/Duration";
import log from "@common/logger"; import log from "@common/logger";

5
app/index.tsx

@ -3,12 +3,13 @@ import * as ReactDOM from "react-dom";
import { AppContainer } from "react-hot-loader"; import { AppContainer } from "react-hot-loader";
import App from "@app/components/App"; import App from "@app/components/App";
import { ProvideState, WebApiState } from "@app/state"; import { ProvideState, StateBase } from "@app/state";
import { WebApiState as StateClass } from "@app/state/web";
// import log from "@common/logger"; // import log from "@common/logger";
// Object.assign(log, { name: "sprinklers3/app", level: "debug" }); // Object.assign(log, { name: "sprinklers3/app", level: "debug" });
const state = new WebApiState(); const state: StateBase = new StateClass();
state.start(); state.start();
const rootElem = document.getElementById("app"); const rootElem = document.getElementById("app");

2
app/state/StateBase.ts

@ -1,5 +1,5 @@
import { ISprinklersApi } from "@common/sprinklers"; import { ISprinklersApi } from "@common/sprinklers";
import { UiMessage, UiStore } from "./ui"; import { UiStore } from "./ui";
export default abstract class StateBase { export default abstract class StateBase {
abstract readonly sprinklersApi: ISprinklersApi; abstract readonly sprinklersApi: ISprinklersApi;

Loading…
Cancel
Save