diff --git a/apps/app/src/App.tsx b/apps/app/src/App.tsx index 88dcd88..298f0b0 100644 --- a/apps/app/src/App.tsx +++ b/apps/app/src/App.tsx @@ -1,10 +1,5 @@ -import React, { useEffect, useMemo } from "react"; -import { - Outlet, - useNavigate, - useParams, - useSearchParams, -} from "react-router-dom"; +import _React, { useEffect, useMemo } from "react"; +import { Outlet, useSearchParams } from "react-router-dom"; import { AppShell, Navbar, Header, Flex, Modal, Box } from "@mantine/core"; import { useDisclosure } from "@mantine/hooks"; import { useSnapshot } from "valtio"; @@ -36,12 +31,9 @@ import { notifications } from "@mantine/notifications"; function App() { const configSnapshot = useSnapshot(config); - const remoteConfigSnapshot = useSnapshot(remoteConfig); - const remoteMetadataSnapshot = useSnapshot(remoteMetadata); - const [searchParams, setSearchParams] = useSearchParams(); - const navigate = useNavigate(); - - const hasLoggedInParam = searchParams.has("logged_in"); + useSnapshot(remoteConfig); + useSnapshot(remoteMetadata); + const [_searchParams, setSearchParams] = useSearchParams(); const [ hostingConfigModalOpened, @@ -55,14 +47,7 @@ function App() { } }, []); - const { - accessToken, - repositoryName, - owner, - targetBranch, - shouldCreatePullRequest, - branchNamePrefix, - } = + const { accessToken, repositoryName, owner, targetBranch } = config.hosting.provider === "github" ? config.hosting : { @@ -70,8 +55,6 @@ function App() { repositoryName: "", owner: "", targetBranch: "", - shouldCreatePullRequest: true, - branchNamePrefix: "", }; const groups = config.groups; @@ -243,8 +226,8 @@ function App() { if (cleanConfig.hosting.providerType === "git") { cleanConfig.hosting.accessToken = ""; } else if (cleanConfig.hosting.providerType === "direct") { - cleanConfig.hosting.accessKeyId = ""; - cleanConfig.hosting.secretAccessKey = ""; + // cleanConfig.hosting.accessKeyId = ""; + // cleanConfig.hosting.secretAccessKey = ""; } cleanConfig.groups = cleanConfig.groups.map((group) => { diff --git a/apps/app/src/components/CustomCard.tsx b/apps/app/src/components/CustomCard.tsx index 1991010..4db17e7 100644 --- a/apps/app/src/components/CustomCard.tsx +++ b/apps/app/src/components/CustomCard.tsx @@ -1,4 +1,4 @@ -import React, { PropsWithChildren, ReactNode } from "react"; +import _React, { PropsWithChildren, ReactNode } from "react"; import { Box, Flex, Text } from "@mantine/core"; import { CustomTooltip } from "./CustomTooltip"; diff --git a/apps/app/src/components/CustomList.tsx b/apps/app/src/components/CustomList.tsx index f1fcaa3..0582fe7 100644 --- a/apps/app/src/components/CustomList.tsx +++ b/apps/app/src/components/CustomList.tsx @@ -1,5 +1,5 @@ -import React, { ReactNode } from "react"; -import { Outlet, Link, NavLink } from "react-router-dom"; +import _React, { ReactNode } from "react"; +import { Link } from "react-router-dom"; import { Flex, ActionIcon, diff --git a/apps/app/src/components/CustomNumberInput.tsx b/apps/app/src/components/CustomNumberInput.tsx index 0af825f..3daa28b 100644 --- a/apps/app/src/components/CustomNumberInput.tsx +++ b/apps/app/src/components/CustomNumberInput.tsx @@ -1,4 +1,4 @@ -import React, { useMemo } from "react"; +import _React, { useMemo } from "react"; import { Input, NumberInput } from "@mantine/core"; import { VexillaNumberType } from "@vexilla/types"; diff --git a/apps/app/src/components/CustomSlider.tsx b/apps/app/src/components/CustomSlider.tsx index e67366e..612899f 100644 --- a/apps/app/src/components/CustomSlider.tsx +++ b/apps/app/src/components/CustomSlider.tsx @@ -1,4 +1,4 @@ -import React, { useRef } from "react"; +import _React, { useRef } from "react"; import { Slider, Flex, NumberInput, Button, Text } from "@mantine/core"; import { nanoid } from "../utils/nanoid"; diff --git a/apps/app/src/components/CustomTooltip.tsx b/apps/app/src/components/CustomTooltip.tsx index 1b9bcdf..a88df21 100644 --- a/apps/app/src/components/CustomTooltip.tsx +++ b/apps/app/src/components/CustomTooltip.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import _React from "react"; import { ActionIcon, Tooltip } from "@mantine/core"; import Icon from "@iconify/react"; diff --git a/apps/app/src/components/PageLayout.tsx b/apps/app/src/components/PageLayout.tsx index db467f7..2ae95a1 100644 --- a/apps/app/src/components/PageLayout.tsx +++ b/apps/app/src/components/PageLayout.tsx @@ -1,5 +1,4 @@ -import { Box } from "@mantine/core"; -import React, { PropsWithChildren } from "react"; +import _React, { PropsWithChildren } from "react"; export function PageLayout({ children, diff --git a/apps/app/src/components/Status.tsx b/apps/app/src/components/Status.tsx index f70531a..53c7104 100644 --- a/apps/app/src/components/Status.tsx +++ b/apps/app/src/components/Status.tsx @@ -1,4 +1,4 @@ -import React, { PropsWithChildren, useState } from "react"; +import _React, { PropsWithChildren, useState } from "react"; import { useSnapshot } from "valtio"; import { Difference } from "microdiff"; import { @@ -63,9 +63,9 @@ export function Status({ mergeRemoteConfig, }: StatusProps) { const validationSnapshot = useSnapshot(validation); - const localDifferencesSnapshot = useSnapshot(localDifferences); - const remoteDifferencesSnapshot = useSnapshot(remoteDifferences); - const remoteMetadataSnapshot = useSnapshot(remoteMetadata); + useSnapshot(localDifferences); + useSnapshot(remoteDifferences); + useSnapshot(remoteMetadata); const [ remoteChangesModalOpened, diff --git a/apps/app/src/components/TimelineItemTitle.tsx b/apps/app/src/components/TimelineItemTitle.tsx index eb3a923..4e6deb1 100644 --- a/apps/app/src/components/TimelineItemTitle.tsx +++ b/apps/app/src/components/TimelineItemTitle.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import _React from "react"; import { Flex } from "@mantine/core"; import { CustomTooltip } from "./CustomTooltip"; diff --git a/apps/app/src/components/app/OnboardingForm.tsx b/apps/app/src/components/app/OnboardingForm.tsx index 550f10f..d81a4f6 100644 --- a/apps/app/src/components/app/OnboardingForm.tsx +++ b/apps/app/src/components/app/OnboardingForm.tsx @@ -1,7 +1,7 @@ -import React, { useState } from "react"; -import { Select, Flex, Switch } from "@mantine/core"; +import _React, { useState } from "react"; +import { Select, Flex } from "@mantine/core"; import { AppState } from "@vexilla/types"; -import { snapshot, useSnapshot } from "valtio"; +import { useSnapshot } from "valtio"; import { EmptyForm } from "./forms/_EmptyForm"; import { GithubForm } from "./forms/GithubForm"; import { HostingProvider, HostingProviderType } from "@vexilla/hosts"; @@ -68,7 +68,7 @@ export function OnboardingForm({ updateProvider, }: OnboardingFormProps) { const configSnapshot = useSnapshot(config); - const [providerType, setProviderType] = useState( + const [_providerType, setProviderType] = useState( configSnapshot?.hosting?.providerType ); diff --git a/apps/app/src/components/app/forms/GithubForm.tsx b/apps/app/src/components/app/forms/GithubForm.tsx index 1a02650..401ed7b 100644 --- a/apps/app/src/components/app/forms/GithubForm.tsx +++ b/apps/app/src/components/app/forms/GithubForm.tsx @@ -1,23 +1,12 @@ -import React, { useEffect, useState, useCallback, useMemo } from "react"; -import { - Button, - Timeline, - Select, - ActionIcon, - Flex, - Tooltip, -} from "@mantine/core"; +import _React, { useEffect, useState, useMemo } from "react"; +import { Button, Timeline, Select, ActionIcon, Flex } from "@mantine/core"; import { cloneDeep } from "lodash-es"; import { AppState } from "@vexilla/types"; import { Branch, Repository } from "./_GitForm.types"; import { GitHubFetcher } from "./GithubForm.fetchers"; -import { - GitHubBranch, - GitHubInstallation, - GitHubRepository, -} from "./GithubForm.types"; +import { GitHubInstallation } from "./GithubForm.types"; import { GitForm } from "./_GitForm"; import { TimelineItemTitle } from "../../TimelineItemTitle"; @@ -57,7 +46,7 @@ const disabledButtonStyling = { maxWidth: "calc(100% - 28px - 0.25rem)", }; -export function GithubForm({ config, updateConfig }: GithubFormProps) { +export function GithubForm({ config }: GithubFormProps) { const configSnapshot = useSnapshot(config); const { accessToken, diff --git a/apps/app/src/components/app/forms/GithubForm.types.ts b/apps/app/src/components/app/forms/GithubForm.types.ts index 1178041..2508d48 100644 --- a/apps/app/src/components/app/forms/GithubForm.types.ts +++ b/apps/app/src/components/app/forms/GithubForm.types.ts @@ -853,11 +853,11 @@ export interface GitHubApp { * The set of permissions for the GitHub app */ permissions: { - issues?: string; - checks?: string; - metadata?: string; - contents?: string; - deployments?: string; + issues: string; + checks: string; + metadata: string; + contents: string; + deployments: string; [k: string]: string; }; /** diff --git a/apps/app/src/components/app/forms/S3Form.tsx b/apps/app/src/components/app/forms/S3Form.tsx index bba9cb3..96377c4 100644 --- a/apps/app/src/components/app/forms/S3Form.tsx +++ b/apps/app/src/components/app/forms/S3Form.tsx @@ -1,86 +1,86 @@ -import React from "react"; -import { Button } from "@mantine/core"; -import { AppState } from "@vexilla/types"; +// import _React from "react"; +// import { Button } from "@mantine/core"; +// import { AppState } from "@vexilla/types"; -import { GithubLogo } from "../../logos/GithubLogo"; +// import { GithubLogo } from "../../logos/GithubLogo"; -import { Icon } from "@iconify/react"; -import verifiedCheckBold from "@iconify/icons-solar/verified-check-bold"; +// import { Icon } from "@iconify/react"; +// import verifiedCheckBold from "@iconify/icons-solar/verified-check-bold"; -const githubAppName = `vexilla-dev`; -// const githubAppName = `vexilla`; +// const githubAppName = `vexilla-dev`; +// // const githubAppName = `vexilla`; -interface S3FormProps { - config: AppState; -} +// interface S3FormProps { +// config: AppState; +// } -const buttonStyling = { backgroundColor: "black", color: "white" }; -const disabledButtonStyling = { - backgroundColor: "black", - color: "white", - opacity: 0.6, -}; +// const buttonStyling = { backgroundColor: "black", color: "white" }; +// const disabledButtonStyling = { +// backgroundColor: "black", +// color: "white", +// opacity: 0.6, +// }; -export function GithubForm({ config }: S3FormProps) { - return ( -
The app must be installed into a repo via the Github marketplace.
- {!config.hosting?.config.installationId && ( - } - onClick={() => { - window.location.href = `https://github.com/apps/${githubAppName}/installations/new`; - }} - > - Install - - )} +// export function GithubForm({ config }: S3FormProps) { +// return ( +//The app must be installed into a repo via the Github marketplace.
+// {!config.hosting?.config.installationId && ( +// } +// onClick={() => { +// window.location.href = `https://github.com/apps/${githubAppName}/installations/new`; +// }} +// > +// Install +// +// )} - {!!config.hosting?.config.installationId && ( - } - rightIcon={- You need to login via Github so that the app can make PRs on your - behalf. -
+//+// You need to login via Github so that the app can make PRs on your +// behalf. +//
- {!config.hosting?.config.accessToken && ( - } - onClick={() => { - window.location.href = `https://github.com/login/oauth/authorize?client_id=${githubClientId}&redirect_uri=${encodeURIComponent( - `${baseAuthCallbackUrl}/github` - )}`; - }} - > - Login - - )} +// {!config.hosting?.config.accessToken && ( +// } +// onClick={() => { +// window.location.href = `https://github.com/login/oauth/authorize?client_id=${githubClientId}&redirect_uri=${encodeURIComponent( +// `${baseAuthCallbackUrl}/github` +// )}`; +// }} +// > +// Login +// +// )} - {!!config.hosting?.config.accessToken && ( - } - rightIcon={