Skip to content

Commit

Permalink
Merge branch 'develop' into feat/hf-image-classification
Browse files Browse the repository at this point in the history
  • Loading branch information
jjerphan committed Sep 1, 2023
2 parents d7c34b1 + 0a8fbf1 commit f85088e
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 27 deletions.
6 changes: 3 additions & 3 deletions cypress/e2e/04_env_variable_modal.cy.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/// <reference types="cypress" />

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();
Expand Down
9 changes: 8 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta
http-equiv="Content-Security-Policy"
content="script-src http://cdn.usefathom.com 'self' 'unsafe-inline';"
content="default-src * self blob: data: gap:; style-src * self 'unsafe-inline' blob: data: gap:; script-src * 'self' 'unsafe-eval' 'unsafe-inline' blob: data: gap:; object-src * 'self' blob: data: gap:; img-src * self 'unsafe-inline' blob: data: gap:; connect-src self * 'unsafe-inline' blob: data: gap:; frame-src * self blob: data: gap:;"
/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML"></script>
<!-- Fathom - beautiful, simple website analytics -->
Expand All @@ -16,11 +16,18 @@
defer
></script>
<!-- / Fathom -->

<link
href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600;700;800&display=swap"
rel="stylesheet"
crossorigin="anonymous"
/>

<script
src="https://do.featurebase.app/js/sdk.js"
id="featurebase-sdk"
></script>

<title>Flojoy Studio</title>
</head>
<body>
Expand Down
52 changes: 29 additions & 23 deletions src/feature/flow_chart_panel/views/ControlBar.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -20,36 +20,35 @@ 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] =
useState<boolean>(false);
const [isEnvVarModalOpen, setIsEnvVarModalOpen] = useState<boolean>(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 (
<div className="flex items-center gap-2 p-2.5">
Expand Down Expand Up @@ -124,6 +123,13 @@ const ControlBar = () => {
{/* </MenubarItem> */}
</MenubarContent>
</MenubarMenu>
<MenubarMenu>
<MenubarTrigger>
<button data-featurebase-feedback>Feedback</button>
</MenubarTrigger>
{/* Below is a small hack such that the Feedback btn won't stay highlighted after closing the window */}
<MenubarContent className="hidden" />
</MenubarMenu>
</Menubar>
</div>

Expand Down

0 comments on commit f85088e

Please sign in to comment.