cleanup
parent
1c78c14cb4
commit
4c31f47860
|
@ -146,6 +146,7 @@ fieldset {
|
||||||
.connectivity-diagram svg {
|
.connectivity-diagram svg {
|
||||||
max-height: 200px !important;
|
max-height: 200px !important;
|
||||||
}
|
}
|
||||||
|
.network-info,
|
||||||
.fbos-info {
|
.fbos-info {
|
||||||
@media (max-width:767px) {
|
@media (max-width:767px) {
|
||||||
display: none;
|
display: none;
|
||||||
|
@ -219,6 +220,7 @@ fieldset {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.network-info,
|
||||||
.fbos-info {
|
.fbos-info {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
margin-bottom: 2rem;
|
margin-bottom: 2rem;
|
||||||
|
@ -855,9 +857,6 @@ ul {
|
||||||
a {
|
a {
|
||||||
color: $panel_yellow;
|
color: $panel_yellow;
|
||||||
}
|
}
|
||||||
.empty-state-graphic {
|
|
||||||
filter: sepia(1) contrast(1.2) saturate(1.2);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
&.points {
|
&.points {
|
||||||
p,
|
p,
|
||||||
|
@ -882,9 +881,6 @@ ul {
|
||||||
a {
|
a {
|
||||||
color: $panel_blue;
|
color: $panel_blue;
|
||||||
}
|
}
|
||||||
// .empty-state-graphic {
|
|
||||||
// filter: hue-rotate(60deg) saturate(0.6);
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -88,6 +88,9 @@
|
||||||
&.if-step {
|
&.if-step {
|
||||||
background: $purple;
|
background: $purple;
|
||||||
}
|
}
|
||||||
|
&.assertion-step {
|
||||||
|
background: $purple;
|
||||||
|
}
|
||||||
&.execute-step {
|
&.execute-step {
|
||||||
background: $gray;
|
background: $gray;
|
||||||
}
|
}
|
||||||
|
@ -180,18 +183,21 @@
|
||||||
}
|
}
|
||||||
&.if-step {
|
&.if-step {
|
||||||
background: $light_purple;
|
background: $light_purple;
|
||||||
h4 {
|
|
||||||
margin: 0 0 0.4rem;
|
|
||||||
font-style: italic;
|
|
||||||
&:not(.top) {
|
|
||||||
margin: 1.4rem 0 0.4rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
input {
|
input {
|
||||||
height: 3rem;
|
height: 3rem;
|
||||||
}
|
}
|
||||||
.execute-row{
|
.execute-row {
|
||||||
margin-top:1rem;
|
margin-top: 1rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&.assertion-step {
|
||||||
|
background: $light_purple;
|
||||||
|
input {
|
||||||
|
height: 3rem;
|
||||||
|
}
|
||||||
|
.assertion-sequence,
|
||||||
|
.assertion-type {
|
||||||
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&.execute-step {
|
&.execute-step {
|
||||||
|
|
|
@ -53,15 +53,15 @@ export class QosPanel extends React.Component<Props, {}> {
|
||||||
const errorRateDecimal = ((r.complete) / r.total);
|
const errorRateDecimal = ((r.complete) / r.total);
|
||||||
const errorRate = Math.round(100 * errorRateDecimal).toFixed(0);
|
const errorRate = Math.round(100 * errorRateDecimal).toFixed(0);
|
||||||
|
|
||||||
return <div className="fbos-info">
|
return <div className="network-info">
|
||||||
<label>{t("Network Quality")}</label>
|
<label>{t("Network Quality")}</label>
|
||||||
<div className="chip-temp-display">
|
<div className="qos-display">
|
||||||
<Row k="Percent OK" v={pct(errorRate, PCT)} />
|
<Row k={t("Percent OK")} v={pct(errorRate, PCT)} />
|
||||||
<Row k="Pings sent" v={pct(r.total, NONE)} />
|
<Row k={t("Pings sent")} v={pct(r.total, NONE)} />
|
||||||
<Row k="Pings received" v={pct(r.complete, NONE)} />
|
<Row k={t("Pings received")} v={pct(r.complete, NONE)} />
|
||||||
<Row k="Best time" v={pct(r.best, MS)} />
|
<Row k={t("Best time")} v={pct(r.best, MS)} />
|
||||||
<Row k="Worst time" v={pct(r.worst, MS)} />
|
<Row k={t("Worst time")} v={pct(r.worst, MS)} />
|
||||||
<Row k="Average time" v={pct(r.average, MS)} />
|
<Row k={t("Average time")} v={pct(r.average, MS)} />
|
||||||
</div>
|
</div>
|
||||||
</div>;
|
</div>;
|
||||||
|
|
||||||
|
|
|
@ -141,7 +141,7 @@ export class PureFarmEvents
|
||||||
title={t("No events scheduled.")}
|
title={t("No events scheduled.")}
|
||||||
text={t(Content.NOTHING_SCHEDULED)}
|
text={t(Content.NOTHING_SCHEDULED)}
|
||||||
colorScheme="events"
|
colorScheme="events"
|
||||||
graphic={EmptyStateGraphic.no_farm_events}>
|
graphic={EmptyStateGraphic.farm_events}>
|
||||||
{this.renderCalendarRows()}
|
{this.renderCalendarRows()}
|
||||||
</EmptyStateWrapper>
|
</EmptyStateWrapper>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
jest.mock("../../../api/crud", () => ({
|
jest.mock("../../../api/crud", () => ({
|
||||||
save: jest.fn(),
|
save: jest.fn(),
|
||||||
overwrite: jest.fn()
|
overwrite: jest.fn(),
|
||||||
|
edit: jest.fn(),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
jest.mock("../../actions", () => ({
|
jest.mock("../../actions", () => ({
|
||||||
|
@ -13,7 +14,7 @@ import { mount, shallow } from "enzyme";
|
||||||
import {
|
import {
|
||||||
fakePointGroup, fakePlant
|
fakePointGroup, fakePlant
|
||||||
} from "../../../__test_support__/fake_state/resources";
|
} from "../../../__test_support__/fake_state/resources";
|
||||||
import { save, overwrite } from "../../../api/crud";
|
import { save, overwrite, edit } from "../../../api/crud";
|
||||||
import { toggleHoveredPlant } from "../../actions";
|
import { toggleHoveredPlant } from "../../actions";
|
||||||
|
|
||||||
describe("<GroupDetailActive/>", () => {
|
describe("<GroupDetailActive/>", () => {
|
||||||
|
@ -27,6 +28,7 @@ describe("<GroupDetailActive/>", () => {
|
||||||
return { dispatch: jest.fn(), group, plants };
|
return { dispatch: jest.fn(), group, plants };
|
||||||
}
|
}
|
||||||
const icon = "doge.jpg";
|
const icon = "doge.jpg";
|
||||||
|
|
||||||
it("removes points onClick", () => {
|
it("removes points onClick", () => {
|
||||||
const { plants, dispatch, group } = fakeProps();
|
const { plants, dispatch, group } = fakeProps();
|
||||||
const el = shallow(<LittleIcon
|
const el = shallow(<LittleIcon
|
||||||
|
@ -81,4 +83,13 @@ describe("<GroupDetailActive/>", () => {
|
||||||
const el = mount(<GroupDetailActive {...props} />);
|
const el = mount(<GroupDetailActive {...props} />);
|
||||||
expect(el.find("input").prop("defaultValue")).toContain("XYZ");
|
expect(el.find("input").prop("defaultValue")).toContain("XYZ");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("changes group name", () => {
|
||||||
|
const NEW_NAME = "new group name";
|
||||||
|
const wrapper = shallow(<GroupDetailActive {...fakeProps()} />);
|
||||||
|
wrapper.find("input").first().simulate("change", {
|
||||||
|
currentTarget: { value: NEW_NAME }
|
||||||
|
});
|
||||||
|
expect(edit).toHaveBeenCalledWith(expect.any(Object), { name: NEW_NAME });
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -56,7 +56,7 @@ export class GroupListPanel extends React.Component<GroupListPanelProps, State>
|
||||||
title={t("No groups yet.")}
|
title={t("No groups yet.")}
|
||||||
text={t(Content.NO_GROUPS)}
|
text={t(Content.NO_GROUPS)}
|
||||||
colorScheme="groups"
|
colorScheme="groups"
|
||||||
graphic={EmptyStateGraphic.no_groups}>
|
graphic={EmptyStateGraphic.groups}>
|
||||||
{this.props.groups
|
{this.props.groups
|
||||||
.filter(p => p.body.name.toLowerCase()
|
.filter(p => p.body.name.toLowerCase()
|
||||||
.includes(this.state.searchTerm.toLowerCase()))
|
.includes(this.state.searchTerm.toLowerCase()))
|
||||||
|
|
|
@ -40,7 +40,7 @@ export const AdditionalMenu = (props: AccountMenuProps) => {
|
||||||
<div className="app-version">
|
<div className="app-version">
|
||||||
<label>{t("VERSION")}</label>:
|
<label>{t("VERSION")}</label>:
|
||||||
<a href="https://github.com/FarmBot/Farmbot-Web-App" target="_blank">
|
<a href="https://github.com/FarmBot/Farmbot-Web-App" target="_blank">
|
||||||
{shortRevision().slice(0, 7)}
|
{shortRevision().slice(0, 8)}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>;
|
</div>;
|
||||||
|
|
|
@ -12,8 +12,7 @@ export interface AssertionStepProps extends StepParams {
|
||||||
currentStep: Assertion;
|
currentStep: Assertion;
|
||||||
}
|
}
|
||||||
|
|
||||||
const CLASS_NAME = "if-step";
|
const CLASS_NAME = "assertion-step";
|
||||||
const MOVE_THIS_CSS_PLZ = { marginTop: "10px" };
|
|
||||||
|
|
||||||
export function TileAssertion(props: StepParams) {
|
export function TileAssertion(props: StepParams) {
|
||||||
const step = props.currentStep;
|
const step = props.currentStep;
|
||||||
|
@ -37,9 +36,13 @@ export function TileAssertion(props: StepParams) {
|
||||||
<LuaPart {...p} />
|
<LuaPart {...p} />
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
<Row >
|
<Row>
|
||||||
<Col xs={6}><div style={MOVE_THIS_CSS_PLZ}> <TypePart {...p} /></div> </Col>
|
<Col xs={6}>
|
||||||
<Col xs={6}><div style={MOVE_THIS_CSS_PLZ}> <SequencePart {...p} /></div> </Col>
|
<TypePart {...p} />
|
||||||
|
</Col>
|
||||||
|
<Col xs={6}>
|
||||||
|
<SequencePart {...p} />
|
||||||
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
</StepContent>
|
</StepContent>
|
||||||
</StepWrapper>;
|
</StepWrapper>;
|
||||||
|
|
|
@ -4,6 +4,7 @@ import { Assertion } from "farmbot/dist/corpus";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { SequenceSelectBox } from "../../sequence_select_box";
|
import { SequenceSelectBox } from "../../sequence_select_box";
|
||||||
import { AssertionStepProps } from "../tile_assertion";
|
import { AssertionStepProps } from "../tile_assertion";
|
||||||
|
import { t } from "../../../i18next_wrapper";
|
||||||
|
|
||||||
export function SequencePart(props: AssertionStepProps) {
|
export function SequencePart(props: AssertionStepProps) {
|
||||||
const onChange = (ddi: DropDownItem) => props.dispatch(editStep({
|
const onChange = (ddi: DropDownItem) => props.dispatch(editStep({
|
||||||
|
@ -23,8 +24,8 @@ export function SequencePart(props: AssertionStepProps) {
|
||||||
if (_then.kind == "execute") {
|
if (_then.kind == "execute") {
|
||||||
sequenceId = _then.args.sequence_id;
|
sequenceId = _then.args.sequence_id;
|
||||||
}
|
}
|
||||||
return <span>
|
return <span className="assertion-sequence">
|
||||||
<label>Recovery Sequence</label>
|
<label>{t("Recovery Sequence")}</label>
|
||||||
<SequenceSelectBox
|
<SequenceSelectBox
|
||||||
key={JSON.stringify(props.currentStep)}
|
key={JSON.stringify(props.currentStep)}
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
|
|
|
@ -3,6 +3,7 @@ import { ALLOWED_ASSERTION_TYPES, Assertion } from "farmbot";
|
||||||
import { DropDownItem, FBSelect } from "../../../ui";
|
import { DropDownItem, FBSelect } from "../../../ui";
|
||||||
import { editStep } from "../../../api/crud";
|
import { editStep } from "../../../api/crud";
|
||||||
import { AssertionStepProps } from "../tile_assertion";
|
import { AssertionStepProps } from "../tile_assertion";
|
||||||
|
import { t } from "../../../i18next_wrapper";
|
||||||
|
|
||||||
const ASSERTION_TYPES: Record<ALLOWED_ASSERTION_TYPES, DropDownItem> = {
|
const ASSERTION_TYPES: Record<ALLOWED_ASSERTION_TYPES, DropDownItem> = {
|
||||||
"continue": { label: "Continue", value: "continue" },
|
"continue": { label: "Continue", value: "continue" },
|
||||||
|
@ -13,8 +14,8 @@ const ASSERTION_TYPES: Record<ALLOWED_ASSERTION_TYPES, DropDownItem> = {
|
||||||
|
|
||||||
export function TypePart(props: AssertionStepProps) {
|
export function TypePart(props: AssertionStepProps) {
|
||||||
const { assertion_type } = props.currentStep.args;
|
const { assertion_type } = props.currentStep.args;
|
||||||
return <span>
|
return <span className="assertion-type">
|
||||||
<label>If Test Fails</label>
|
<label>{t("If Test Fails")}</label>
|
||||||
<FBSelect
|
<FBSelect
|
||||||
key={JSON.stringify(props.currentStep)}
|
key={JSON.stringify(props.currentStep)}
|
||||||
selectedItem={ASSERTION_TYPES[assertion_type]}
|
selectedItem={ASSERTION_TYPES[assertion_type]}
|
||||||
|
|
|
@ -7,8 +7,8 @@ export enum EmptyStateGraphic {
|
||||||
no_crop_results = "no_crop_results",
|
no_crop_results = "no_crop_results",
|
||||||
sequences = "sequences",
|
sequences = "sequences",
|
||||||
regimens = "regimens",
|
regimens = "regimens",
|
||||||
no_farm_events = "no_farm_events",
|
farm_events = "farm_events",
|
||||||
no_groups = "no_groups"
|
groups = "groups"
|
||||||
}
|
}
|
||||||
|
|
||||||
interface EmptyStateWrapperProps {
|
interface EmptyStateWrapperProps {
|
||||||
|
|
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 51 KiB |
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 53 KiB |
Loading…
Reference in New Issue