diff --git a/cypress/e2e/04_env_variable_modal.cy.ts b/cypress/e2e/04_env_variable_modal.cy.ts index 815cbca70..4197cbbb0 100644 --- a/cypress/e2e/04_env_variable_modal.cy.ts +++ b/cypress/e2e/04_env_variable_modal.cy.ts @@ -1,8 +1,8 @@ /// -import { text } from "stream/consumers"; - -describe("Verify Env Variable Modal", () => { +// FIXME: Test doesn't pass due to needing to unlock the system keyring in order +// to add a new credential. Skipping until we can find a workaround for this. +describe.skip("Verify Env Variable Modal", () => { it("env variable modal test", () => { cy.visit("/").wait(1000); cy.get('[data-testid="close-welcome-modal"]').click(); diff --git a/index.html b/index.html index 3f29320c4..5ff4e2d50 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,7 @@ @@ -16,11 +16,18 @@ defer > + + + + Flojoy Studio diff --git a/src/feature/flow_chart_panel/views/ControlBar.tsx b/src/feature/flow_chart_panel/views/ControlBar.tsx index d2389ae3f..221fe0ae4 100644 --- a/src/feature/flow_chart_panel/views/ControlBar.tsx +++ b/src/feature/flow_chart_panel/views/ControlBar.tsx @@ -1,4 +1,4 @@ -import { memo, useState } from "react"; +import { memo, useEffect, useState } from "react"; import "react-tabs/style/react-tabs.css"; import KeyboardShortcutModal from "./KeyboardShortcutModal"; import { NodeSettingsModal } from "./NodeSettingsModal"; @@ -20,6 +20,7 @@ import { SaveAsButton, SaveButton } from "./ControlBar/SaveButtons"; import { LoadButton } from "./ControlBar/LoadButton"; import { ExportResultButton } from "./ControlBar/ExportResultButton"; import FlowControlButtons from "./ControlBar/FlowControlButtons"; +import { useTheme } from "@src/providers/themeProvider"; const ControlBar = () => { const [isKeyboardShortcutOpen, setIsKeyboardShortcutOpen] = @@ -27,29 +28,27 @@ const ControlBar = () => { const [isEnvVarModalOpen, setIsEnvVarModalOpen] = useState(false); const [isNodeSettingsOpen, setIsNodeSettingsOpen] = useState(false); const [isEditorSettingsOpen, setIsEditorSettingsOpen] = useState(false); + const { resolvedTheme } = useTheme(); - // const handleUpdate = async () => { - // const resp = await fetch(`${API_URI}/update/`, { - // method: "GET", - // }); - // - // const hasUpdate = await resp.json(); - // - // if (hasUpdate) { - // toast("Update available!", { - // action: { - // label: "Update", - // onClick: async () => { - // await fetch(`${API_URI}/update/`, { - // method: "POST", - // }); - // }, - // }, - // }); - // } else { - // toast("Your Flojoy Studio is up to date"); - // } - // }; + useEffect(() => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const win = window as any; + + if (typeof win.Featurebase !== "function") { + win.Featurebase = function () { + // eslint-disable-next-line prefer-rest-params + (win.Featurebase.q = win.Featurebase.q || []).push(arguments); + }; + } + win.Featurebase("initialize_feedback_widget", { + organization: "flojoy", + theme: resolvedTheme, + // dynamic theme currently does not work + // featurebase team is already working on supporting it + // so I will just leave this here for now and it will start working + // right away when they implement it. + }); + }, [resolvedTheme]); return (
@@ -124,6 +123,13 @@ const ControlBar = () => { {/* */} + + + + + {/* Below is a small hack such that the Feedback btn won't stay highlighted after closing the window */} + +