Remove all `let` exports in favor of `const` exports.
parent
f0dcbcd54f
commit
92869beb32
|
@ -1,6 +1,6 @@
|
||||||
import { Everything } from "../../interfaces";
|
import { Everything } from "../../interfaces";
|
||||||
|
|
||||||
export let bot: Everything["bot"] = {
|
export const bot: Everything["bot"] = {
|
||||||
"consistent": true,
|
"consistent": true,
|
||||||
"stepSize": 100,
|
"stepSize": 100,
|
||||||
"controlPanelState": {
|
"controlPanelState": {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Everything } from "../../interfaces";
|
import { Everything } from "../../interfaces";
|
||||||
|
|
||||||
export let config: Everything["config"] = {
|
export const config: Everything["config"] = {
|
||||||
"host": "localhost",
|
"host": "localhost",
|
||||||
"port": "3000"
|
"port": "3000"
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Everything } from "../../interfaces";
|
import { Everything } from "../../interfaces";
|
||||||
|
|
||||||
export let draggable: Everything["draggable"] = {
|
export const draggable: Everything["draggable"] = {
|
||||||
"dataTransfer": {}
|
"dataTransfer": {}
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { TaggedImage, SpecialStatus } from "farmbot";
|
import { TaggedImage, SpecialStatus } from "farmbot";
|
||||||
|
|
||||||
export let fakeImages: TaggedImage[] = [
|
export const fakeImages: TaggedImage[] = [
|
||||||
{
|
{
|
||||||
"kind": "Image",
|
"kind": "Image",
|
||||||
"specialStatus": SpecialStatus.SAVED,
|
"specialStatus": SpecialStatus.SAVED,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Everything } from "../../interfaces";
|
import { Everything } from "../../interfaces";
|
||||||
|
|
||||||
export let peripherals: Everything["Peripheral"] = {
|
export const peripherals: Everything["Peripheral"] = {
|
||||||
"isEditing": true
|
"isEditing": true
|
||||||
};
|
};
|
||||||
|
|
|
@ -34,7 +34,7 @@ import {
|
||||||
import { FirmwareConfig } from "farmbot/dist/resources/configs/firmware";
|
import { FirmwareConfig } from "farmbot/dist/resources/configs/firmware";
|
||||||
import { MessageType } from "../../sequences/interfaces";
|
import { MessageType } from "../../sequences/interfaces";
|
||||||
|
|
||||||
export let resources: Everything["resources"] = buildResourceIndex();
|
export const resources: Everything["resources"] = buildResourceIndex();
|
||||||
let idCounter = 1;
|
let idCounter = 1;
|
||||||
|
|
||||||
export function fakeSequence(): TaggedSequence {
|
export function fakeSequence(): TaggedSequence {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { AuthState } from "../../auth/interfaces";
|
import { AuthState } from "../../auth/interfaces";
|
||||||
|
|
||||||
export let auth: AuthState = {
|
export const auth: AuthState = {
|
||||||
"token": {
|
"token": {
|
||||||
"unencoded": {
|
"unencoded": {
|
||||||
"jti": "xyz",
|
"jti": "xyz",
|
||||||
|
|
|
@ -12,7 +12,7 @@ export const TIME = {
|
||||||
SATURDAY: moment("2017-06-24T06:30:00.000-05:00")
|
SATURDAY: moment("2017-06-24T06:30:00.000-05:00")
|
||||||
};
|
};
|
||||||
|
|
||||||
export let fakeFarmEventWithExecutable = (): FarmEventWithExecutable => {
|
export const fakeFarmEventWithExecutable = (): FarmEventWithExecutable => {
|
||||||
return {
|
return {
|
||||||
id: 1,
|
id: 1,
|
||||||
start_time: "---",
|
start_time: "---",
|
||||||
|
@ -29,7 +29,7 @@ export let fakeFarmEventWithExecutable = (): FarmEventWithExecutable => {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export let calendarRows = [
|
export const calendarRows = [
|
||||||
{
|
{
|
||||||
"sortKey": 1500922800,
|
"sortKey": 1500922800,
|
||||||
"year": 17,
|
"year": 17,
|
||||||
|
|
|
@ -328,7 +328,7 @@ const log: TaggedLog = {
|
||||||
uuid: "Log.1091396.70"
|
uuid: "Log.1091396.70"
|
||||||
};
|
};
|
||||||
|
|
||||||
export let FAKE_RESOURCES: TaggedResource[] = [
|
export const FAKE_RESOURCES: TaggedResource[] = [
|
||||||
tr1,
|
tr1,
|
||||||
fakeDevice(),
|
fakeDevice(),
|
||||||
tr2,
|
tr2,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { User } from "farmbot/dist/resources/api_resources";
|
import { User } from "farmbot/dist/resources/api_resources";
|
||||||
import { TaggedUser, SpecialStatus } from "farmbot";
|
import { TaggedUser, SpecialStatus } from "farmbot";
|
||||||
|
|
||||||
export let user: User = {
|
export const user: User = {
|
||||||
created_at: "2016-10-05T03:02:58.000Z",
|
created_at: "2016-10-05T03:02:58.000Z",
|
||||||
email: "farmbot1@farmbot.io",
|
email: "farmbot1@farmbot.io",
|
||||||
id: 2,
|
id: 2,
|
||||||
|
@ -9,7 +9,7 @@ export let user: User = {
|
||||||
updated_at: "2017-08-04T19:53:29.724Z"
|
updated_at: "2017-08-04T19:53:29.724Z"
|
||||||
};
|
};
|
||||||
|
|
||||||
export let taggedUser: TaggedUser = {
|
export const taggedUser: TaggedUser = {
|
||||||
kind: "User",
|
kind: "User",
|
||||||
uuid: "1234-5678",
|
uuid: "1234-5678",
|
||||||
specialStatus: SpecialStatus.SAVED,
|
specialStatus: SpecialStatus.SAVED,
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { AuthState } from "./interfaces";
|
||||||
import { generateReducer } from "../redux/generate_reducer";
|
import { generateReducer } from "../redux/generate_reducer";
|
||||||
import { Actions } from "../constants";
|
import { Actions } from "../constants";
|
||||||
|
|
||||||
export let authReducer = generateReducer<AuthState | undefined>(undefined)
|
export const authReducer = generateReducer<AuthState | undefined>(undefined)
|
||||||
.add<AuthState>(Actions.REPLACE_TOKEN, (_, { payload }) => {
|
.add<AuthState>(Actions.REPLACE_TOKEN, (_, { payload }) => {
|
||||||
return payload;
|
return payload;
|
||||||
});
|
});
|
||||||
|
|
|
@ -10,7 +10,7 @@ const initialState: ConfigState = {
|
||||||
port: API.inferPort()
|
port: API.inferPort()
|
||||||
};
|
};
|
||||||
|
|
||||||
export let configReducer = generateReducer<ConfigState>(initialState)
|
export const configReducer = generateReducer<ConfigState>(initialState)
|
||||||
.add<ChangeApiPort>(Actions.CHANGE_API_PORT, (s, { payload }) => {
|
.add<ChangeApiPort>(Actions.CHANGE_API_PORT, (s, { payload }) => {
|
||||||
s.port = payload.port.replace(/\D/g, "");
|
s.port = payload.port.replace(/\D/g, "");
|
||||||
return s;
|
return s;
|
||||||
|
|
|
@ -14,4 +14,4 @@ const change = (state: "up" | "down") =>
|
||||||
|
|
||||||
export const networkUp = change("up");
|
export const networkUp = change("up");
|
||||||
|
|
||||||
export let networkDown = change("down");
|
export const networkDown = change("down");
|
||||||
|
|
|
@ -202,6 +202,6 @@ export const attachEventListeners =
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Connect to MQTT and attach all relevant event handlers. */
|
/** Connect to MQTT and attach all relevant event handlers. */
|
||||||
export let connectDevice = (token: AuthState) =>
|
export const connectDevice = (token: AuthState) =>
|
||||||
(dispatch: Function, getState: GetState) => fetchNewDevice(token)
|
(dispatch: Function, getState: GetState) => fetchNewDevice(token)
|
||||||
.then(bot => attachEventListeners(bot, dispatch, getState), onOffline);
|
.then(bot => attachEventListeners(bot, dispatch, getState), onOffline);
|
||||||
|
|
|
@ -37,13 +37,13 @@ export const dispatchQosStart = (id: string) => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export let dispatchNetworkUp = (edge: Edge, at: number) => {
|
export const dispatchNetworkUp = (edge: Edge, at: number) => {
|
||||||
if (shouldThrottle(edge, at)) { return; }
|
if (shouldThrottle(edge, at)) { return; }
|
||||||
store.dispatch(networkUp(edge, at));
|
store.dispatch(networkUp(edge, at));
|
||||||
bumpThrottle(edge, at);
|
bumpThrottle(edge, at);
|
||||||
};
|
};
|
||||||
|
|
||||||
export let dispatchNetworkDown = (edge: Edge, at: number) => {
|
export const dispatchNetworkDown = (edge: Edge, at: number) => {
|
||||||
if (shouldThrottle(edge, at)) { return; }
|
if (shouldThrottle(edge, at)) { return; }
|
||||||
store.dispatch(networkDown(edge, at));
|
store.dispatch(networkDown(edge, at));
|
||||||
bumpThrottle(edge, at);
|
bumpThrottle(edge, at);
|
||||||
|
|
|
@ -17,7 +17,7 @@ export const DEFAULT_STATE: ConnectionState = {
|
||||||
};
|
};
|
||||||
export type PingResultPayload = { id: string, at: number };
|
export type PingResultPayload = { id: string, at: number };
|
||||||
|
|
||||||
export let connectivityReducer =
|
export const connectivityReducer =
|
||||||
generateReducer<ConnectionState>(DEFAULT_STATE)
|
generateReducer<ConnectionState>(DEFAULT_STATE)
|
||||||
.add<{ id: string }>(Actions.PING_START, (s, { payload }) => {
|
.add<{ id: string }>(Actions.PING_START, (s, { payload }) => {
|
||||||
return { ...s, pings: startPing(s.pings, payload.id) };
|
return { ...s, pings: startPing(s.pings, payload.id) };
|
||||||
|
|
|
@ -8,7 +8,7 @@ const Axis = ({ val }: { val: number | undefined }) => <Col xs={3}>
|
||||||
<input disabled value={isNumber(val) ? val : "---"} />
|
<input disabled value={isNumber(val) ? val : "---"} />
|
||||||
</Col>;
|
</Col>;
|
||||||
|
|
||||||
export let AxisDisplayGroup = ({ position, label }: AxisDisplayGroupProps) => {
|
export const AxisDisplayGroup = ({ position, label }: AxisDisplayGroupProps) => {
|
||||||
const { x, y, z } = position;
|
const { x, y, z } = position;
|
||||||
return <Row>
|
return <Row>
|
||||||
<Axis val={x} />
|
<Axis val={x} />
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { AxisInputBoxProps } from "./interfaces";
|
||||||
import { Col, BlurableInput } from "../ui/index";
|
import { Col, BlurableInput } from "../ui/index";
|
||||||
import { isUndefined } from "lodash";
|
import { isUndefined } from "lodash";
|
||||||
|
|
||||||
export let AxisInputBox = ({ onChange, value, axis }: AxisInputBoxProps) => {
|
export const AxisInputBox = ({ onChange, value, axis }: AxisInputBoxProps) => {
|
||||||
return <Col xs={3}>
|
return <Col xs={3}>
|
||||||
<BlurableInput
|
<BlurableInput
|
||||||
value={(isUndefined(value) ? "" : value)}
|
value={(isUndefined(value) ? "" : value)}
|
||||||
|
|
|
@ -245,7 +245,7 @@ function validMinOsFeatureLookup(x: MinOsFeatureLookup): boolean {
|
||||||
* Fetch and save minimum FBOS version data for UI feature display.
|
* Fetch and save minimum FBOS version data for UI feature display.
|
||||||
* @param url location of data
|
* @param url location of data
|
||||||
*/
|
*/
|
||||||
export let fetchMinOsFeatureData = (url: string) =>
|
export const fetchMinOsFeatureData = (url: string) =>
|
||||||
(dispatch: Function) => {
|
(dispatch: Function) => {
|
||||||
axios
|
axios
|
||||||
.get<MinOsFeatureLookup>(url)
|
.get<MinOsFeatureLookup>(url)
|
||||||
|
|
|
@ -10,7 +10,7 @@ interface Props {
|
||||||
expanded: boolean;
|
expanded: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export let Header = (props: Props) => {
|
export const Header = (props: Props) => {
|
||||||
const { dispatch, name, title, expanded } = props;
|
const { dispatch, name, title, expanded } = props;
|
||||||
return <ExpandableHeader
|
return <ExpandableHeader
|
||||||
expanded={expanded}
|
expanded={expanded}
|
||||||
|
|
|
@ -18,7 +18,7 @@ const afterEach = (state: BotState, a: ReduxAction<{}>) => {
|
||||||
return state;
|
return state;
|
||||||
};
|
};
|
||||||
|
|
||||||
export let initialState = (): BotState => ({
|
export const initialState = (): BotState => ({
|
||||||
consistent: true,
|
consistent: true,
|
||||||
stepSize: 100,
|
stepSize: 100,
|
||||||
controlPanelState: {
|
controlPanelState: {
|
||||||
|
@ -81,7 +81,7 @@ export let initialState = (): BotState => ({
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export let botReducer = generateReducer<BotState>(initialState())
|
export const botReducer = generateReducer<BotState>(initialState())
|
||||||
.afterEach(afterEach)
|
.afterEach(afterEach)
|
||||||
.add<boolean>(Actions.SET_CONSISTENCY, (s, a) => {
|
.add<boolean>(Actions.SET_CONSISTENCY, (s, a) => {
|
||||||
s.consistent = a.payload;
|
s.consistent = a.payload;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export let list = ["Africa/Abidjan",
|
export const list = ["Africa/Abidjan",
|
||||||
"Africa/Accra",
|
"Africa/Accra",
|
||||||
"Africa/Addis_Ababa",
|
"Africa/Addis_Ababa",
|
||||||
"Africa/Algiers",
|
"Africa/Algiers",
|
||||||
|
|
|
@ -6,7 +6,7 @@ const INITIAL_STATE: DraggableState = {
|
||||||
dataTransfer: {}
|
dataTransfer: {}
|
||||||
};
|
};
|
||||||
|
|
||||||
export let draggableReducer = generateReducer<DraggableState>(INITIAL_STATE)
|
export const draggableReducer = generateReducer<DraggableState>(INITIAL_STATE)
|
||||||
.add<DataXfer>(Actions.PUT_DATA_XFER, (s, { payload }) => {
|
.add<DataXfer>(Actions.PUT_DATA_XFER, (s, { payload }) => {
|
||||||
s.dataTransfer[payload.uuid] = payload;
|
s.dataTransfer[payload.uuid] = payload;
|
||||||
return s;
|
return s;
|
||||||
|
|
|
@ -18,7 +18,7 @@ export const NULL_DRAGGER_ID = 0xCAFEF00D;
|
||||||
* Drag this!
|
* Drag this!
|
||||||
* </button>
|
* </button>
|
||||||
* */
|
* */
|
||||||
export let stepDragEventHandler = (dispatch: Function,
|
export const stepDragEventHandler = (dispatch: Function,
|
||||||
step: Step,
|
step: Step,
|
||||||
intent: DataXferIntent,
|
intent: DataXferIntent,
|
||||||
draggerId: number) => {
|
draggerId: number) => {
|
||||||
|
|
|
@ -161,4 +161,4 @@ export class PureFarmEvents
|
||||||
* It avoids mocking `connect` in unit tests.
|
* It avoids mocking `connect` in unit tests.
|
||||||
* See testing pattern noted here: https://github.com/airbnb/enzyme/issues/98
|
* See testing pattern noted here: https://github.com/airbnb/enzyme/issues/98
|
||||||
*/
|
*/
|
||||||
export let FarmEvents = connect(mapStateToProps)(PureFarmEvents);
|
export const FarmEvents = connect(mapStateToProps)(PureFarmEvents);
|
||||||
|
|
|
@ -65,7 +65,7 @@ export const nextRegItemTimes =
|
||||||
&& time.isSameOrAfter(moment(startTime)));
|
&& time.isSameOrAfter(moment(startTime)));
|
||||||
};
|
};
|
||||||
|
|
||||||
export let regimenCalendarAdder = (
|
export const regimenCalendarAdder = (
|
||||||
index: ResourceIndex, timeSettings: TimeSettings) =>
|
index: ResourceIndex, timeSettings: TimeSettings) =>
|
||||||
(f: FarmEventWithRegimen, c: Calendar, now = moment()) => {
|
(f: FarmEventWithRegimen, c: Calendar, now = moment()) => {
|
||||||
const { regimen_items } = f.executable;
|
const { regimen_items } = f.executable;
|
||||||
|
@ -96,7 +96,7 @@ export let regimenCalendarAdder = (
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export let addSequenceToCalendar =
|
export const addSequenceToCalendar =
|
||||||
(f: FarmEventWithSequence, c: Calendar, timeSettings: TimeSettings,
|
(f: FarmEventWithSequence, c: Calendar, timeSettings: TimeSettings,
|
||||||
now = moment()) => {
|
now = moment()) => {
|
||||||
const schedule = scheduleForFarmEvent(f, now);
|
const schedule = scheduleForFarmEvent(f, now);
|
||||||
|
|
|
@ -36,17 +36,17 @@ import { getFbosConfig } from "../../resources/getters";
|
||||||
import { t } from "../../i18next_wrapper";
|
import { t } from "../../i18next_wrapper";
|
||||||
import { DevSettings } from "../../account/dev/dev_support";
|
import { DevSettings } from "../../account/dev/dev_support";
|
||||||
|
|
||||||
export let formatTime = (input: string, timeSettings: TimeSettings) => {
|
export const formatTime = (input: string, timeSettings: TimeSettings) => {
|
||||||
const iso = new Date(input).toISOString();
|
const iso = new Date(input).toISOString();
|
||||||
return moment(iso).utcOffset(timeSettings.utcOffset).format("HH:mm");
|
return moment(iso).utcOffset(timeSettings.utcOffset).format("HH:mm");
|
||||||
};
|
};
|
||||||
|
|
||||||
export let formatDate = (input: string, timeSettings: TimeSettings) => {
|
export const formatDate = (input: string, timeSettings: TimeSettings) => {
|
||||||
const iso = new Date(input).toISOString();
|
const iso = new Date(input).toISOString();
|
||||||
return moment(iso).utcOffset(timeSettings.utcOffset).format("YYYY-MM-DD");
|
return moment(iso).utcOffset(timeSettings.utcOffset).format("YYYY-MM-DD");
|
||||||
};
|
};
|
||||||
|
|
||||||
export let repeatOptions = [
|
export const repeatOptions = [
|
||||||
{ label: t("Minutes"), value: "minutely", name: "time_unit" },
|
{ label: t("Minutes"), value: "minutely", name: "time_unit" },
|
||||||
{ label: t("Hours"), value: "hourly", name: "time_unit" },
|
{ label: t("Hours"), value: "hourly", name: "time_unit" },
|
||||||
{ label: t("Days"), value: "daily", name: "time_unit" },
|
{ label: t("Days"), value: "daily", name: "time_unit" },
|
||||||
|
|
|
@ -68,8 +68,8 @@ export namespace OpenFarm {
|
||||||
attributes: ImageAttrs;
|
attributes: ImageAttrs;
|
||||||
}
|
}
|
||||||
|
|
||||||
export let cropUrl = "https://openfarm.cc/api/v1/crops";
|
export const cropUrl = "https://openfarm.cc/api/v1/crops";
|
||||||
export let browsingCropUrl = "https://openfarm.cc/crops/";
|
export const browsingCropUrl = "https://openfarm.cc/crops/";
|
||||||
}
|
}
|
||||||
/** Returned by https://openfarm.cc/api/v1/crops?filter=q */
|
/** Returned by https://openfarm.cc/api/v1/crops?filter=q */
|
||||||
export interface CropSearchResult {
|
export interface CropSearchResult {
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { Actions } from "../constants";
|
||||||
import { BotPosition } from "../devices/interfaces";
|
import { BotPosition } from "../devices/interfaces";
|
||||||
import { PointGroupSortType } from "farmbot/dist/resources/api_resources";
|
import { PointGroupSortType } from "farmbot/dist/resources/api_resources";
|
||||||
|
|
||||||
export let initialState: DesignerState = {
|
export const initialState: DesignerState = {
|
||||||
selectedPlants: undefined,
|
selectedPlants: undefined,
|
||||||
hoveredPlant: {
|
hoveredPlant: {
|
||||||
plantUUID: undefined,
|
plantUUID: undefined,
|
||||||
|
@ -24,7 +24,7 @@ export let initialState: DesignerState = {
|
||||||
tryGroupSortType: undefined,
|
tryGroupSortType: undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
export let designer = generateReducer<DesignerState>(initialState)
|
export const designer = generateReducer<DesignerState>(initialState)
|
||||||
.add<string>(Actions.SEARCH_QUERY_CHANGE, (s, { payload }) => {
|
.add<string>(Actions.SEARCH_QUERY_CHANGE, (s, { payload }) => {
|
||||||
s.cropSearchInProgress = true;
|
s.cropSearchInProgress = true;
|
||||||
const state = cloneDeep(s);
|
const state = cloneDeep(s);
|
||||||
|
|
|
@ -15,7 +15,7 @@ interface IdURL {
|
||||||
}
|
}
|
||||||
|
|
||||||
const FALLBACK: OpenFarm.Included[] = [];
|
const FALLBACK: OpenFarm.Included[] = [];
|
||||||
export let OFSearch = (searchTerm: string) =>
|
export const OFSearch = (searchTerm: string) =>
|
||||||
(dispatch: Function) => {
|
(dispatch: Function) => {
|
||||||
dispatch({ type: Actions.OF_SEARCH_RESULTS_START, payload: undefined });
|
dispatch({ type: Actions.OF_SEARCH_RESULTS_START, payload: undefined });
|
||||||
openFarmSearchQuery(searchTerm)
|
openFarmSearchQuery(searchTerm)
|
||||||
|
|
|
@ -3,14 +3,14 @@ import { FarmwareState } from "./interfaces";
|
||||||
import { TaggedResource } from "farmbot";
|
import { TaggedResource } from "farmbot";
|
||||||
import { Actions } from "../constants";
|
import { Actions } from "../constants";
|
||||||
|
|
||||||
export let farmwareState: FarmwareState = {
|
export const farmwareState: FarmwareState = {
|
||||||
currentFarmware: undefined,
|
currentFarmware: undefined,
|
||||||
currentImage: undefined,
|
currentImage: undefined,
|
||||||
firstPartyFarmwareNames: [],
|
firstPartyFarmwareNames: [],
|
||||||
infoOpen: false,
|
infoOpen: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
export let farmwareReducer = generateReducer<FarmwareState>(farmwareState)
|
export const farmwareReducer = generateReducer<FarmwareState>(farmwareState)
|
||||||
.add<TaggedResource>(Actions.INIT_RESOURCE, (s, { payload }) => {
|
.add<TaggedResource>(Actions.INIT_RESOURCE, (s, { payload }) => {
|
||||||
if (payload.kind === "Image") {
|
if (payload.kind === "Image") {
|
||||||
s.currentImage = payload.uuid;
|
s.currentImage = payload.uuid;
|
||||||
|
|
|
@ -5,14 +5,14 @@ import { envGet } from "./remote_env/selectors";
|
||||||
|
|
||||||
/** Convert values like SPECIAL_VALUES.TRUE to drop down items with friendly
|
/** Convert values like SPECIAL_VALUES.TRUE to drop down items with friendly
|
||||||
* label/value pairs. */
|
* label/value pairs. */
|
||||||
export let translateSpecialValue = (input: number): DropDownItem => {
|
export const translateSpecialValue = (input: number): DropDownItem => {
|
||||||
return SPECIAL_VALUE_DDI[input] || NULL_CHOICE;
|
return SPECIAL_VALUE_DDI[input] || NULL_CHOICE;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Generates a lookup function to convert WeedDetector ENV items to
|
/** Generates a lookup function to convert WeedDetector ENV items to
|
||||||
* DropDownItems. Used to display currently selected options within dropdown
|
* DropDownItems. Used to display currently selected options within dropdown
|
||||||
* menus. */
|
* menus. */
|
||||||
export let getDropdownSelection = (env: Partial<WD_ENV>) =>
|
export const getDropdownSelection = (env: Partial<WD_ENV>) =>
|
||||||
(key: keyof WD_ENV): DropDownItem => {
|
(key: keyof WD_ENV): DropDownItem => {
|
||||||
return translateSpecialValue(envGet(key, env));
|
return translateSpecialValue(envGet(key, env));
|
||||||
};
|
};
|
||||||
|
|
|
@ -5,11 +5,11 @@ export interface HelpState {
|
||||||
currentTour: string | undefined;
|
currentTour: string | undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
export let initialState: HelpState = {
|
export const initialState: HelpState = {
|
||||||
currentTour: undefined,
|
currentTour: undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
export let helpReducer = generateReducer<HelpState>(initialState)
|
export const helpReducer = generateReducer<HelpState>(initialState)
|
||||||
.add<string>(Actions.START_TOUR, (s, { payload }) => {
|
.add<string>(Actions.START_TOUR, (s, { payload }) => {
|
||||||
s.currentTour = payload;
|
s.currentTour = payload;
|
||||||
return s;
|
return s;
|
||||||
|
|
|
@ -2,13 +2,13 @@ import { DataChangeType, Dictionary } from "farmbot/dist";
|
||||||
import { box } from "boxed_value";
|
import { box } from "boxed_value";
|
||||||
import { isNumber, isNaN } from "lodash";
|
import { isNumber, isNaN } from "lodash";
|
||||||
|
|
||||||
export let METHOD_MAP: Dictionary<DataChangeType> = {
|
export const METHOD_MAP: Dictionary<DataChangeType> = {
|
||||||
"post": "add",
|
"post": "add",
|
||||||
"put": "update",
|
"put": "update",
|
||||||
"patch": "update",
|
"patch": "update",
|
||||||
"delete": "remove"
|
"delete": "remove"
|
||||||
};
|
};
|
||||||
export let METHODS = ["post", "put", "patch", "delete"];
|
export const METHODS = ["post", "put", "patch", "delete"];
|
||||||
|
|
||||||
/** More nasty hacks until we have time to implement proper API push state
|
/** More nasty hacks until we have time to implement proper API push state
|
||||||
* notifications. */
|
* notifications. */
|
||||||
|
|
|
@ -5,7 +5,7 @@ import { MobileMenuProps } from "./interfaces";
|
||||||
|
|
||||||
const classes = [Classes.CARD, Classes.ELEVATION_4, "mobile-menu"];
|
const classes = [Classes.CARD, Classes.ELEVATION_4, "mobile-menu"];
|
||||||
|
|
||||||
export let MobileMenu = (props: MobileMenuProps) => {
|
export const MobileMenu = (props: MobileMenuProps) => {
|
||||||
const isActive = props.mobileMenuOpen ? "active" : "inactive";
|
const isActive = props.mobileMenuOpen ? "active" : "inactive";
|
||||||
const { alertCount } = props;
|
const { alertCount } = props;
|
||||||
return <div>
|
return <div>
|
||||||
|
|
|
@ -72,7 +72,7 @@ const Ticker = (log: TaggedLog, timeSettings: TimeSettings) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
/** The logs ticker, with closed/open views, and a link to the Logs page. */
|
/** The logs ticker, with closed/open views, and a link to the Logs page. */
|
||||||
export let TickerList = (props: TickerListProps) => {
|
export const TickerList = (props: TickerListProps) => {
|
||||||
return <ErrorBoundary>
|
return <ErrorBoundary>
|
||||||
<div className="ticker-list" onClick={props.toggle("tickerListOpen")}>
|
<div className="ticker-list" onClick={props.toggle("tickerListOpen")}>
|
||||||
<div className="first-ticker">
|
<div className="first-ticker">
|
||||||
|
|
|
@ -21,7 +21,7 @@ export interface OFCropResponse {
|
||||||
}
|
}
|
||||||
|
|
||||||
export namespace OpenFarmAPI {
|
export namespace OpenFarmAPI {
|
||||||
export let OFBaseURL = BASE;
|
export const OFBaseURL = BASE;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function svgToUrl(xml: string | undefined): string {
|
export function svgToUrl(xml: string | undefined): string {
|
||||||
|
|
|
@ -20,7 +20,7 @@ export interface MiddlewareConfig { fn: MW; env: EnvName; }
|
||||||
|
|
||||||
/** To make it easier to manage all things watching the state tree,
|
/** To make it easier to manage all things watching the state tree,
|
||||||
* we keep subscriber functions in this array. */
|
* we keep subscriber functions in this array. */
|
||||||
export let mwConfig: MiddlewareConfig[] = [
|
export const mwConfig: MiddlewareConfig[] = [
|
||||||
{ env: "*", fn: thunk },
|
{ env: "*", fn: thunk },
|
||||||
{ env: "development", fn: require("redux-immutable-state-invariant").default() },
|
{ env: "development", fn: require("redux-immutable-state-invariant").default() },
|
||||||
stateFetchMiddlewareConfig,
|
stateFetchMiddlewareConfig,
|
||||||
|
|
|
@ -17,7 +17,7 @@ const reducerRecord = {
|
||||||
resources: resourceReducer,
|
resources: resourceReducer,
|
||||||
};
|
};
|
||||||
|
|
||||||
export let reducers = combineReducers(reducerRecord);
|
export const reducers = combineReducers(reducerRecord);
|
||||||
|
|
||||||
Object.keys(reducerRecord).map((x: keyof typeof reducerRecord) => {
|
Object.keys(reducerRecord).map((x: keyof typeof reducerRecord) => {
|
||||||
if (!reducerRecord[x]) {
|
if (!reducerRecord[x]) {
|
||||||
|
|
|
@ -6,10 +6,9 @@ import { getMiddleware } from "./middlewares";
|
||||||
import { set } from "lodash";
|
import { set } from "lodash";
|
||||||
|
|
||||||
function dev(): Store {
|
function dev(): Store {
|
||||||
store = createStore(rootReducer,
|
return createStore(rootReducer,
|
||||||
maybeFetchOldState(),
|
maybeFetchOldState(),
|
||||||
getMiddleware("development"));
|
getMiddleware("development"));
|
||||||
return store;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function prod(): Store {
|
function prod(): Store {
|
||||||
|
@ -26,7 +25,7 @@ export function configureStore() {
|
||||||
return store2;
|
return store2;
|
||||||
}
|
}
|
||||||
|
|
||||||
export let store = configureStore();
|
export const store = configureStore();
|
||||||
|
|
||||||
/** Tries to fetch previous state from `sessionStorage`.
|
/** Tries to fetch previous state from `sessionStorage`.
|
||||||
* Returns {} if nothing is found. Used mostly for hot reloading. */
|
* Returns {} if nothing is found. Used mostly for hot reloading. */
|
||||||
|
|
|
@ -52,7 +52,7 @@ export interface Subscription { fn: (state: Everything) => void; env: EnvName; }
|
||||||
|
|
||||||
/** To make it easier to manage all things watching the state tree,
|
/** To make it easier to manage all things watching the state tree,
|
||||||
* we keep subscriber functions in this array. */
|
* we keep subscriber functions in this array. */
|
||||||
export let subscriptions: Subscription[] = [{ env: "*", fn: unsavedCheck }];
|
export const subscriptions: Subscription[] = [{ env: "*", fn: unsavedCheck }];
|
||||||
|
|
||||||
export function registerSubscribers(store: Store) {
|
export function registerSubscribers(store: Store) {
|
||||||
const ENV_LIST = [process.env.NODE_ENV, "*"];
|
const ENV_LIST = [process.env.NODE_ENV, "*"];
|
||||||
|
|
|
@ -11,7 +11,7 @@ const ok = (x: AxiosResponse<AuthState>) => {
|
||||||
|
|
||||||
/** Grab a new token from the API (won't extend token's exp. date).
|
/** Grab a new token from the API (won't extend token's exp. date).
|
||||||
* Redirect to home page on failure. */
|
* Redirect to home page on failure. */
|
||||||
export let maybeRefreshToken
|
export const maybeRefreshToken
|
||||||
= (old: AuthState): Promise<AuthState | undefined> => {
|
= (old: AuthState): Promise<AuthState | undefined> => {
|
||||||
API.setBaseUrl(old.token.unencoded.iss);
|
API.setBaseUrl(old.token.unencoded.iss);
|
||||||
setToken(old); // Precaution: The Axios interceptors might not be set yet.
|
setToken(old); // Precaution: The Axios interceptors might not be set yet.
|
||||||
|
|
|
@ -36,9 +36,9 @@ function newState(): RegimenState {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export let initialState: RegimenState = newState();
|
export const initialState: RegimenState = newState();
|
||||||
|
|
||||||
export let regimensReducer = generateReducer<RegimenState>(initialState)
|
export const regimensReducer = generateReducer<RegimenState>(initialState)
|
||||||
.add<TaggedResource>(Actions.DESTROY_RESOURCE_OK, (s, { payload }) => {
|
.add<TaggedResource>(Actions.DESTROY_RESOURCE_OK, (s, { payload }) => {
|
||||||
switch (payload.uuid) {
|
switch (payload.uuid) {
|
||||||
case s.selectedSequenceUUID:
|
case s.selectedSequenceUUID:
|
||||||
|
|
|
@ -33,6 +33,6 @@ export const generalizedError = (payload: GeneralizedError) => {
|
||||||
return { type: Actions._RESOURCE_NO, payload };
|
return { type: Actions._RESOURCE_NO, payload };
|
||||||
};
|
};
|
||||||
|
|
||||||
export let destroyNO = generalizedError;
|
export const destroyNO = generalizedError;
|
||||||
export let createNO = generalizedError;
|
export const createNO = generalizedError;
|
||||||
export let updateNO = generalizedError;
|
export const updateNO = generalizedError;
|
||||||
|
|
|
@ -40,7 +40,7 @@ export * from "./selectors_for_indexing";
|
||||||
* unless there is actually a reason for the resource to not have a UUID.
|
* unless there is actually a reason for the resource to not have a UUID.
|
||||||
* `findId()` is more appropriate 99% of the time because it can spot
|
* `findId()` is more appropriate 99% of the time because it can spot
|
||||||
* referential integrity issues. */
|
* referential integrity issues. */
|
||||||
export let maybeDetermineUuid =
|
export const maybeDetermineUuid =
|
||||||
(index: ResourceIndex, kind: ResourceName, id: number) => {
|
(index: ResourceIndex, kind: ResourceName, id: number) => {
|
||||||
const kni = joinKindAndId(kind, id);
|
const kni = joinKindAndId(kind, id);
|
||||||
const uuid = index.byKindAndId[kni];
|
const uuid = index.byKindAndId[kni];
|
||||||
|
@ -50,7 +50,7 @@ export let maybeDetermineUuid =
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export let findId = (index: ResourceIndex, kind: ResourceName, id: number): UUID => {
|
export const findId = (index: ResourceIndex, kind: ResourceName, id: number): UUID => {
|
||||||
const uuid = maybeDetermineUuid(index, kind, id);
|
const uuid = maybeDetermineUuid(index, kind, id);
|
||||||
if (uuid) {
|
if (uuid) {
|
||||||
return uuid;
|
return uuid;
|
||||||
|
@ -59,7 +59,7 @@ export let findId = (index: ResourceIndex, kind: ResourceName, id: number): UUID
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export let isKind = (name: ResourceName) => (tr: TaggedResource) => tr.kind === name;
|
export const isKind = (name: ResourceName) => (tr: TaggedResource) => tr.kind === name;
|
||||||
|
|
||||||
export function groupPointsByType(index: ResourceIndex) {
|
export function groupPointsByType(index: ResourceIndex) {
|
||||||
return chain(selectAllActivePoints(index))
|
return chain(selectAllActivePoints(index))
|
||||||
|
@ -151,7 +151,7 @@ export function getSequenceByUUID(index: ResourceIndex,
|
||||||
|
|
||||||
/** GIVEN: a slot UUID.
|
/** GIVEN: a slot UUID.
|
||||||
* FINDS: Tool in that slot (if any) */
|
* FINDS: Tool in that slot (if any) */
|
||||||
export let currentToolInSlot = (index: ResourceIndex) =>
|
export const currentToolInSlot = (index: ResourceIndex) =>
|
||||||
(toolSlotUUID: string): TaggedTool | undefined => {
|
(toolSlotUUID: string): TaggedTool | undefined => {
|
||||||
const currentSlot = selectCurrentToolSlot(index, toolSlotUUID);
|
const currentSlot = selectCurrentToolSlot(index, toolSlotUUID);
|
||||||
if (currentSlot
|
if (currentSlot
|
||||||
|
|
|
@ -31,7 +31,7 @@ export const findAllById =
|
||||||
return output;
|
return output;
|
||||||
};
|
};
|
||||||
|
|
||||||
export let byId =
|
export const byId =
|
||||||
<T extends TaggedResource>(name: T["kind"]) =>
|
<T extends TaggedResource>(name: T["kind"]) =>
|
||||||
(index: ResourceIndex, id: number): T | undefined => {
|
(index: ResourceIndex, id: number): T | undefined => {
|
||||||
const resources = findAll(index, name);
|
const resources = findAll(index, name);
|
||||||
|
@ -40,7 +40,7 @@ export let byId =
|
||||||
return resources.filter(f)[0] as T | undefined;
|
return resources.filter(f)[0] as T | undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
export let findFarmEventById = (ri: ResourceIndex, fe_id: number) => {
|
export const findFarmEventById = (ri: ResourceIndex, fe_id: number) => {
|
||||||
const fe = byId("FarmEvent")(ri, fe_id);
|
const fe = byId("FarmEvent")(ri, fe_id);
|
||||||
if (fe && isTaggedFarmEvent(fe) && sanityCheck(fe)) {
|
if (fe && isTaggedFarmEvent(fe) && sanityCheck(fe)) {
|
||||||
return fe;
|
return fe;
|
||||||
|
@ -50,7 +50,7 @@ export let findFarmEventById = (ri: ResourceIndex, fe_id: number) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export let maybeFindToolById = (ri: ResourceIndex, tool_id?: number):
|
export const maybeFindToolById = (ri: ResourceIndex, tool_id?: number):
|
||||||
TaggedTool | undefined => {
|
TaggedTool | undefined => {
|
||||||
const tool = tool_id && byId("Tool")(ri, tool_id);
|
const tool = tool_id && byId("Tool")(ri, tool_id);
|
||||||
if (tool && isTaggedTool(tool) && sanityCheck(tool)) {
|
if (tool && isTaggedTool(tool) && sanityCheck(tool)) {
|
||||||
|
@ -60,7 +60,7 @@ export let maybeFindToolById = (ri: ResourceIndex, tool_id?: number):
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export let findToolById = (ri: ResourceIndex, tool_id: number) => {
|
export const findToolById = (ri: ResourceIndex, tool_id: number) => {
|
||||||
const tool = maybeFindToolById(ri, tool_id);
|
const tool = maybeFindToolById(ri, tool_id);
|
||||||
if (tool) {
|
if (tool) {
|
||||||
return tool;
|
return tool;
|
||||||
|
@ -69,7 +69,7 @@ export let findToolById = (ri: ResourceIndex, tool_id: number) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export let findSequenceById = (ri: ResourceIndex, sequence_id: number) => {
|
export const findSequenceById = (ri: ResourceIndex, sequence_id: number) => {
|
||||||
const sequence = byId("Sequence")(ri, sequence_id);
|
const sequence = byId("Sequence")(ri, sequence_id);
|
||||||
if (sequence && isTaggedSequence(sequence) && sanityCheck(sequence)) {
|
if (sequence && isTaggedSequence(sequence) && sanityCheck(sequence)) {
|
||||||
return sequence;
|
return sequence;
|
||||||
|
@ -78,9 +78,9 @@ export let findSequenceById = (ri: ResourceIndex, sequence_id: number) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export let findSlotById = byId<TaggedToolSlotPointer>("Point");
|
export const findSlotById = byId<TaggedToolSlotPointer>("Point");
|
||||||
/** Find a Tool's corresponding Slot. */
|
/** Find a Tool's corresponding Slot. */
|
||||||
export let findSlotByToolId = (index: ResourceIndex, tool_id: number) => {
|
export const findSlotByToolId = (index: ResourceIndex, tool_id: number) => {
|
||||||
const tool = findToolById(index, tool_id);
|
const tool = findToolById(index, tool_id);
|
||||||
const query = { body: { tool_id: tool.body.id } };
|
const query = { body: { tool_id: tool.body.id } };
|
||||||
const every = Object
|
const every = Object
|
||||||
|
@ -122,7 +122,7 @@ export function maybeFindSavedGardenById(index: ResourceIndex, id: number) {
|
||||||
if (resource && isTaggedSavedGarden(resource)) { return resource; }
|
if (resource && isTaggedSavedGarden(resource)) { return resource; }
|
||||||
}
|
}
|
||||||
|
|
||||||
export let findRegimenById = (ri: ResourceIndex, regimen_id: number) => {
|
export const findRegimenById = (ri: ResourceIndex, regimen_id: number) => {
|
||||||
const regimen = byId("Regimen")(ri, regimen_id);
|
const regimen = byId("Regimen")(ri, regimen_id);
|
||||||
if (regimen && isTaggedRegimen(regimen) && sanityCheck(regimen)) {
|
if (regimen && isTaggedRegimen(regimen) && sanityCheck(regimen)) {
|
||||||
return regimen;
|
return regimen;
|
||||||
|
|
|
@ -54,13 +54,13 @@ const uuidFinder = <T extends TaggedResource>(r: T["kind"]) =>
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export let findTool = uuidFinder<TaggedTool>("Tool");
|
export const findTool = uuidFinder<TaggedTool>("Tool");
|
||||||
export let findSequence = uuidFinder<TaggedSequence>("Sequence");
|
export const findSequence = uuidFinder<TaggedSequence>("Sequence");
|
||||||
export let findRegimen = uuidFinder<TaggedRegimen>("Regimen");
|
export const findRegimen = uuidFinder<TaggedRegimen>("Regimen");
|
||||||
export let findFarmEvent = uuidFinder<TaggedFarmEvent>("FarmEvent");
|
export const findFarmEvent = uuidFinder<TaggedFarmEvent>("FarmEvent");
|
||||||
export let findPoints = uuidFinder<TaggedPoint>("Point");
|
export const findPoints = uuidFinder<TaggedPoint>("Point");
|
||||||
export let findPointGroup = uuidFinder<TaggedPoint>("Point");
|
export const findPointGroup = uuidFinder<TaggedPoint>("Point");
|
||||||
export let findSavedGarden = uuidFinder<TaggedSavedGarden>("SavedGarden");
|
export const findSavedGarden = uuidFinder<TaggedSavedGarden>("SavedGarden");
|
||||||
|
|
||||||
export const selectAllCrops =
|
export const selectAllCrops =
|
||||||
(i: ResourceIndex) => findAll<TaggedCrop>(i, "Crop");
|
(i: ResourceIndex) => findAll<TaggedCrop>(i, "Crop");
|
||||||
|
|
|
@ -79,29 +79,29 @@ function isTaggedPoint(x: {}): x is PointerType {
|
||||||
return (is("Point")(x)) && (x.kind === "Point");
|
return (is("Point")(x)) && (x.kind === "Point");
|
||||||
}
|
}
|
||||||
|
|
||||||
export let isTaggedRegimen =
|
export const isTaggedRegimen =
|
||||||
(x: object): x is TaggedRegimen => is("Regimen")(x);
|
(x: object): x is TaggedRegimen => is("Regimen")(x);
|
||||||
export let isTaggedFolder =
|
export const isTaggedFolder =
|
||||||
(x: object): x is TaggedRegimen => is("Folder")(x);
|
(x: object): x is TaggedRegimen => is("Folder")(x);
|
||||||
export let isTaggedSequence =
|
export const isTaggedSequence =
|
||||||
(x: object): x is TaggedSequence => is("Sequence")(x);
|
(x: object): x is TaggedSequence => is("Sequence")(x);
|
||||||
export let isTaggedTool =
|
export const isTaggedTool =
|
||||||
(x: object): x is TaggedTool => is("Tool")(x);
|
(x: object): x is TaggedTool => is("Tool")(x);
|
||||||
export let isTaggedFarmEvent =
|
export const isTaggedFarmEvent =
|
||||||
(x: object): x is TaggedFarmEvent => is("FarmEvent")(x);
|
(x: object): x is TaggedFarmEvent => is("FarmEvent")(x);
|
||||||
export let isTaggedToolSlotPointer =
|
export const isTaggedToolSlotPointer =
|
||||||
(x: object): x is TaggedToolSlotPointer => {
|
(x: object): x is TaggedToolSlotPointer => {
|
||||||
return isTaggedPoint(x) && (x.body.pointer_type === "ToolSlot");
|
return isTaggedPoint(x) && (x.body.pointer_type === "ToolSlot");
|
||||||
};
|
};
|
||||||
export let isTaggedPlantPointer =
|
export const isTaggedPlantPointer =
|
||||||
(x: object): x is TaggedPlantPointer => {
|
(x: object): x is TaggedPlantPointer => {
|
||||||
return isTaggedPoint(x) && (x.body.pointer_type === "Plant");
|
return isTaggedPoint(x) && (x.body.pointer_type === "Plant");
|
||||||
};
|
};
|
||||||
export let isTaggedGenericPointer =
|
export const isTaggedGenericPointer =
|
||||||
(x: object): x is TaggedGenericPointer => {
|
(x: object): x is TaggedGenericPointer => {
|
||||||
return isTaggedPoint(x) && (x.body.pointer_type === "GenericPointer");
|
return isTaggedPoint(x) && (x.body.pointer_type === "GenericPointer");
|
||||||
};
|
};
|
||||||
export let isTaggedSavedGarden =
|
export const isTaggedSavedGarden =
|
||||||
(x: object): x is TaggedSavedGarden => is("SavedGarden")(x);
|
(x: object): x is TaggedSavedGarden => is("SavedGarden")(x);
|
||||||
export let isTaggedPlantTemplate =
|
export const isTaggedPlantTemplate =
|
||||||
(x: object): x is TaggedPlantTemplate => is("PlantTemplate")(x);
|
(x: object): x is TaggedPlantTemplate => is("PlantTemplate")(x);
|
||||||
|
|
|
@ -9,7 +9,7 @@ export const initialState: SequenceReducerState = {
|
||||||
stepIndex: undefined,
|
stepIndex: undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
export let sequenceReducer = generateReducer<SequenceReducerState>(initialState)
|
export const sequenceReducer = generateReducer<SequenceReducerState>(initialState)
|
||||||
.add<TaggedResource>(Actions.DESTROY_RESOURCE_OK, (s, { payload }) => {
|
.add<TaggedResource>(Actions.DESTROY_RESOURCE_OK, (s, { payload }) => {
|
||||||
switch (payload.uuid) {
|
switch (payload.uuid) {
|
||||||
case s.current:
|
case s.current:
|
||||||
|
|
|
@ -118,7 +118,7 @@ export function InnerIf(props: IfParams) {
|
||||||
/** Creates a function that can be used in the `onChange` event of a _else or
|
/** Creates a function that can be used in the `onChange` event of a _else or
|
||||||
* _then block in the sequence editor.
|
* _then block in the sequence editor.
|
||||||
*/
|
*/
|
||||||
export let IfBlockDropDownHandler = (props: ThenElseParams) => {
|
export const IfBlockDropDownHandler = (props: ThenElseParams) => {
|
||||||
|
|
||||||
const { dispatch, index, thenElseKey } = props;
|
const { dispatch, index, thenElseKey } = props;
|
||||||
const step = props.currentStep;
|
const step = props.currentStep;
|
||||||
|
|
|
@ -7,7 +7,7 @@ interface Props {
|
||||||
expanded: boolean;
|
expanded: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export let ExpandableHeader = (props: Props) => {
|
export const ExpandableHeader = (props: Props) => {
|
||||||
const { onClick, title, expanded } = props;
|
const { onClick, title, expanded } = props;
|
||||||
const icon_string = expanded ? "minus" : "plus";
|
const icon_string = expanded ? "minus" : "plus";
|
||||||
const nbwhitespace = title != "";
|
const nbwhitespace = title != "";
|
||||||
|
|
|
@ -18,7 +18,7 @@ import {
|
||||||
} from "lodash";
|
} from "lodash";
|
||||||
import { t } from "../i18next_wrapper";
|
import { t } from "../i18next_wrapper";
|
||||||
|
|
||||||
export let colors: Array<ResourceColor> = [
|
export const colors: Array<ResourceColor> = [
|
||||||
"blue",
|
"blue",
|
||||||
"green",
|
"green",
|
||||||
"yellow",
|
"yellow",
|
||||||
|
|
Loading…
Reference in New Issue