diff --git a/frontend/devices/components/fbos_settings/__tests__/os_update_button_test.tsx b/frontend/devices/components/fbos_settings/__tests__/os_update_button_test.tsx
index d83f97440..5b3896b83 100644
--- a/frontend/devices/components/fbos_settings/__tests__/os_update_button_test.tsx
+++ b/frontend/devices/components/fbos_settings/__tests__/os_update_button_test.tsx
@@ -11,12 +11,15 @@ import { OsUpdateButton } from "../os_update_button";
import { OsUpdateButtonProps } from "../interfaces";
import { ShouldDisplay } from "../../../interfaces";
import { Content } from "../../../../constants";
+import { ConfigurationName } from "farmbot";
+
+const UPDATE_CHANNEL = "update_channel" as ConfigurationName;
describe("", () => {
beforeEach(() => {
bot.currentOSVersion = "6.1.6";
bot.hardware.informational_settings.controller_version = "6.1.6";
- bot.hardware.configuration.beta_opt_in = false;
+ (bot.hardware.configuration[UPDATE_CHANNEL] as string) = "stable";
});
const fakeProps = (): OsUpdateButtonProps => ({
@@ -33,7 +36,6 @@ describe("", () => {
availableVersion: string | undefined;
availableBetaVersion: string | undefined;
availableBetaCommit: string | undefined;
- betaOptIn: boolean | undefined;
onBeta: boolean | undefined;
update_available?: boolean | undefined;
shouldDisplay: ShouldDisplay;
@@ -46,7 +48,6 @@ describe("", () => {
availableVersion: "6.1.6",
availableBetaVersion: undefined,
availableBetaCommit: undefined,
- betaOptIn: false,
onBeta: false,
shouldDisplay: () => false,
update_channel: "stable",
@@ -104,7 +105,7 @@ describe("", () => {
expected: Results) => {
const {
installedVersion, installedCommit, onBeta, update_available,
- availableVersion, availableBetaVersion, availableBetaCommit, betaOptIn,
+ availableVersion, availableBetaVersion, availableBetaCommit,
shouldDisplay, update_channel,
} = testProps;
bot.hardware.informational_settings.controller_version = installedVersion;
@@ -115,9 +116,7 @@ describe("", () => {
bot.currentOSVersion = availableVersion;
bot.currentBetaOSVersion = availableBetaVersion;
bot.currentBetaOSCommit = availableBetaCommit;
- bot.hardware.configuration.beta_opt_in = betaOptIn;
- // tslint:disable-next-line:no-any
- (bot.hardware.configuration as any).update_channel = update_channel;
+ (bot.hardware.configuration[UPDATE_CHANNEL] as string) = update_channel;
const p = fakeProps();
p.shouldDisplay = shouldDisplay;
@@ -156,7 +155,7 @@ describe("", () => {
const testProps = defaultTestProps();
testProps.installedVersion = "6.1.6";
testProps.availableVersion = undefined;
- testProps.betaOptIn = true;
+ testProps.update_channel = "beta";
const expectedResults = cantConnect("release server");
testButtonState(testProps, expectedResults);
});
@@ -166,7 +165,7 @@ describe("", () => {
testProps.installedVersion = "6.1.6";
testProps.availableVersion = undefined;
testProps.availableBetaVersion = "6.1.7-beta";
- testProps.betaOptIn = true;
+ testProps.update_channel = "beta";
const expectedResults = updateNeeded("6.1.7-beta");
testButtonState(testProps, expectedResults);
});
@@ -175,7 +174,7 @@ describe("", () => {
const testProps = defaultTestProps();
testProps.installedVersion = "6.1.6";
testProps.availableBetaVersion = undefined;
- testProps.betaOptIn = true;
+ testProps.update_channel = "beta";
const expectedResults = upToDate("6.1.6");
testButtonState(testProps, expectedResults);
});
@@ -205,7 +204,7 @@ describe("", () => {
const testProps = defaultTestProps();
testProps.installedVersion = "6.1.5";
testProps.availableBetaVersion = "7.0.0-beta";
- testProps.betaOptIn = true;
+ testProps.update_channel = "beta";
const expectedResults = updateNeeded("7.0.0-beta");
testButtonState(testProps, expectedResults);
});
@@ -214,7 +213,7 @@ describe("", () => {
const testProps = defaultTestProps();
testProps.installedVersion = "6.1.6";
testProps.availableBetaVersion = "6.1.6-beta";
- testProps.betaOptIn = true;
+ testProps.update_channel = "beta";
const expectedResults = upToDate("6.1.6");
testButtonState(testProps, expectedResults);
});
@@ -223,7 +222,7 @@ describe("", () => {
const testProps = defaultTestProps();
testProps.installedVersion = "6.1.6";
testProps.availableBetaVersion = "6.1.6-beta";
- testProps.betaOptIn = true;
+ testProps.update_channel = "beta";
testProps.onBeta = true;
const expectedResults = updateNeeded("6.1.6");
testButtonState(testProps, expectedResults);
@@ -233,7 +232,7 @@ describe("", () => {
const testProps = defaultTestProps();
testProps.installedVersion = "6.1.6";
testProps.availableBetaVersion = "6.1.6-beta";
- testProps.betaOptIn = false;
+ testProps.update_channel = "stable";
testProps.onBeta = true;
const expectedResults = updateNeeded("6.1.6");
testButtonState(testProps, expectedResults);
@@ -243,7 +242,7 @@ describe("", () => {
const testProps = defaultTestProps();
testProps.installedVersion = "6.1.7";
testProps.availableBetaVersion = "6.1.7-beta";
- testProps.betaOptIn = true;
+ testProps.update_channel = "beta";
testProps.onBeta = true;
const expectedResults = upToDate("6.1.7-beta");
testButtonState(testProps, expectedResults);
@@ -253,7 +252,7 @@ describe("", () => {
const testProps = defaultTestProps();
testProps.installedVersion = "6.1.7-beta";
testProps.availableBetaVersion = "6.1.7-beta";
- testProps.betaOptIn = true;
+ testProps.update_channel = "beta";
const expectedResults = upToDate("6.1.7-beta");
testButtonState(testProps, expectedResults);
});
@@ -264,7 +263,7 @@ describe("", () => {
testProps.installedCommit = "old commit";
testProps.availableBetaVersion = "7.0.0-beta";
testProps.availableBetaCommit = "new commit";
- testProps.betaOptIn = true;
+ testProps.update_channel = "beta";
testProps.onBeta = true;
const expectedResults = updateNeeded("7.0.0-beta");
testButtonState(testProps, expectedResults);
@@ -273,7 +272,7 @@ describe("", () => {
it("handles installed version newer than available (beta enabled)", () => {
const testProps = defaultTestProps();
testProps.installedVersion = "6.1.7";
- testProps.betaOptIn = true;
+ testProps.update_channel = "beta";
testProps.onBeta = false;
testProps.availableBetaVersion = "6.1.7-beta";
const expectedResults = upToDate("6.1.7-beta");
@@ -308,16 +307,6 @@ describe("", () => {
testButtonState(testProps, expectedResults);
});
- it("doesn't use update_channel value", () => {
- const testProps = defaultTestProps();
- testProps.installedVersion = "6.1.6";
- testProps.shouldDisplay = () => false;
- testProps.update_channel = "beta";
- testProps.availableBetaVersion = "6.1.7-beta";
- const expectedResults = upToDate("6.1.6");
- testButtonState(testProps, expectedResults);
- });
-
it("compares release candidates: newer", () => {
const testProps = defaultTestProps();
testProps.availableVersion = "6.1.5";
diff --git a/frontend/devices/components/fbos_settings/os_update_button.tsx b/frontend/devices/components/fbos_settings/os_update_button.tsx
index 7cd41412d..b0893a786 100644
--- a/frontend/devices/components/fbos_settings/os_update_button.tsx
+++ b/frontend/devices/components/fbos_settings/os_update_button.tsx
@@ -4,7 +4,7 @@ import { SemverResult, semverCompare } from "../../../util";
import { OsUpdateButtonProps } from "./interfaces";
import { checkControllerUpdates } from "../../actions";
import { isString } from "lodash";
-import { BotState, Feature } from "../../interfaces";
+import { BotState } from "../../interfaces";
import { Content } from "../../../constants";
import { t } from "../../../i18next_wrapper";
@@ -154,9 +154,8 @@ export const OsUpdateButton = (props: OsUpdateButtonProps) => {
const { controller_version } = bot.hardware.informational_settings;
/** FBOS beta release opt-in setting. */
- const betaOptIn = props.shouldDisplay(Feature.use_update_channel)
- ? sourceFbosConfig("update_channel" as ConfigurationName).value !== "stable"
- : !!sourceFbosConfig("beta_opt_in").value;
+ const betaOptIn =
+ sourceFbosConfig("update_channel" as ConfigurationName).value !== "stable";
/** FBOS update availability. */
const buttonStatusProps = buttonVersionStatus({ bot, betaOptIn });
diff --git a/frontend/logs/__tests__/index_test.tsx b/frontend/logs/__tests__/index_test.tsx
index ac5f67230..95432ba4d 100644
--- a/frontend/logs/__tests__/index_test.tsx
+++ b/frontend/logs/__tests__/index_test.tsx
@@ -117,7 +117,6 @@ describe("", () => {
it("shows filtered overall filter status", () => {
const p = fakeProps();
- p.shouldDisplay = () => true;
const wrapper = mount();
const state = fakeLogsState();
state.assertion = 2;
@@ -129,10 +128,9 @@ describe("", () => {
it("shows unfiltered overall filter status", () => {
const p = fakeProps();
- p.shouldDisplay = () => false;
const wrapper = mount();
const state = fakeLogsState();
- state.assertion = 2;
+ state.assertion = 3;
wrapper.setState(state);
const filterBtn = wrapper.find("button").first();
expect(filterBtn.text().toLowerCase()).toEqual("filter");
diff --git a/frontend/logs/components/filter_menu.tsx b/frontend/logs/components/filter_menu.tsx
index 8a5da3c0b..7b4c1bd07 100644
--- a/frontend/logs/components/filter_menu.tsx
+++ b/frontend/logs/components/filter_menu.tsx
@@ -5,7 +5,6 @@ import { Filters } from "../interfaces";
import { startCase } from "lodash";
import { MESSAGE_TYPES, MessageType } from "../../sequences/interfaces";
import { t } from "../../i18next_wrapper";
-import { Feature, ShouldDisplay } from "../../devices/interfaces";
const MENU_ORDER: string[] = [
MessageType.success,
@@ -26,11 +25,9 @@ const menuSort = (a: string, b: string) =>
/** Get log filter keys from LogsState. */
export const filterStateKeys =
- (state: LogsState, shouldDisplay: ShouldDisplay) =>
+ (state: LogsState) =>
Object.keys(state)
- .filter(key => !["autoscroll", "markdown", "searchTerm"].includes(key))
- .filter(key => shouldDisplay(Feature.assertion_block)
- || key !== "assertion");
+ .filter(key => !["autoscroll", "markdown", "searchTerm"].includes(key));
export const LogsFilterMenu = (props: LogsFilterMenuProps) => {
/** Filter level 0: logs hidden. */
@@ -56,7 +53,7 @@ export const LogsFilterMenu = (props: LogsFilterMenuProps) => {
{t("normal")}
- {filterStateKeys(props.state, props.shouldDisplay).sort(menuSort)
+ {filterStateKeys(props.state).sort(menuSort)
.map((logType: keyof Filters) =>