diff --git a/god-mode/.eslintrc.js b/god-mode/.eslintrc.js deleted file mode 100644 index 2278de30f1..0000000000 --- a/god-mode/.eslintrc.js +++ /dev/null @@ -1,14 +0,0 @@ -module.exports = { - root: true, - extends: ["custom"], - parser: "@typescript-eslint/parser", - settings: { - "import/resolver": { - typescript: {}, - node: { - moduleDirectory: ["node_modules", "."], - }, - }, - }, - rules: {} -} \ No newline at end of file diff --git a/god-mode/.prettierignore b/god-mode/.prettierignore deleted file mode 100644 index 43e8a7b8ff..0000000000 --- a/god-mode/.prettierignore +++ /dev/null @@ -1,6 +0,0 @@ -.next -.vercel -.tubro -out/ -dis/ -build/ \ No newline at end of file diff --git a/god-mode/.prettierrc b/god-mode/.prettierrc deleted file mode 100644 index 87d988f1b2..0000000000 --- a/god-mode/.prettierrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "printWidth": 120, - "tabWidth": 2, - "trailingComma": "es5" -} diff --git a/god-mode/Dockerfile.dev b/god-mode/Dockerfile.dev deleted file mode 100644 index 6ad715eb29..0000000000 --- a/god-mode/Dockerfile.dev +++ /dev/null @@ -1,13 +0,0 @@ -FROM node:18-alpine -RUN apk add --no-cache libc6-compat -# Set working directory -WORKDIR /app - -COPY . . -RUN yarn global add turbo -RUN yarn install -EXPOSE 3333 -ENV NEXT_PUBLIC_DEPLOY_WITH_NGINX=1 - -VOLUME [ "/app/node_modules", "/app/god-mode/node_modules"] -CMD ["yarn","dev", "--filter=god-mode"] diff --git a/god-mode/Dockerfile.godmode b/god-mode/Dockerfile.godmode deleted file mode 100644 index 7faa347db1..0000000000 --- a/god-mode/Dockerfile.godmode +++ /dev/null @@ -1,41 +0,0 @@ -FROM node:18-alpine AS builder -RUN apk add --no-cache libc6-compat -WORKDIR /app - -RUN yarn global add turbo -COPY . . - -RUN turbo prune --scope=god-mode --docker - -FROM node:18-alpine AS installer - -RUN apk add --no-cache libc6-compat -WORKDIR /app - -COPY .gitignore .gitignore -COPY --from=builder /app/out/json/ . -COPY --from=builder /app/out/yarn.lock ./yarn.lock -RUN yarn install --network-timeout 500000 - -COPY --from=builder /app/out/full/ . -COPY turbo.json turbo.json - -USER root - -ARG NEXT_PUBLIC_API_BASE_URL="" -ARG NEXT_PUBLIC_DEPLOY_WITH_NGINX=1 - -ENV NEXT_PUBLIC_API_BASE_URL=$NEXT_PUBLIC_API_BASE_URL - -RUN yarn turbo run build --filter=god-mode - -FROM nginx:1.25.0-alpine AS runner -WORKDIR /app - -ARG NEXT_PUBLIC_API_BASE_URL="" -ENV NEXT_PUBLIC_API_BASE_URL=$NEXT_PUBLIC_API_BASE_URL -ENV NEXT_TELEMETRY_DISABLED 1 -ENV TURBO_TELEMETRY_DISABLED 1 - -COPY --from=installer /app/god-mode/out /usr/share/nginx/html - diff --git a/god-mode/app/ai/page.tsx b/god-mode/app/ai/page.tsx deleted file mode 100644 index a50225c99b..0000000000 --- a/god-mode/app/ai/page.tsx +++ /dev/null @@ -1,56 +0,0 @@ -"use client"; - -import useSWR from "swr"; -import { observer } from "mobx-react-lite"; -// hooks -import useInstance from "hooks/use-instance"; -// ui -import { Loader } from "@plane/ui"; -// icons -import { Lightbulb } from "lucide-react"; -// components -import { InstanceAIForm } from "components/ai"; - -const InstanceAIPage = observer(() => { - // store - const { fetchInstanceConfigurations, formattedConfig } = useInstance(); - - useSWR("INSTANCE_CONFIGURATIONS", () => fetchInstanceConfigurations()); - - return ( -
-
-
AI features for all your workspaces
-
- Configure your AI API credentials so Plane AI features are turned on for all your workspaces. -
-
- {formattedConfig ? ( - <> -
-
OpenAI
-
If you use ChatGPT, this is for you.
-
- -
-
- -
If you have a preferred AI models vendor, please get in touch with us.
-
-
- - ) : ( - - -
- - -
- -
- )} -
- ); -}); - -export default InstanceAIPage; diff --git a/god-mode/app/authentication/github/page.tsx b/god-mode/app/authentication/github/page.tsx deleted file mode 100644 index b9d298d2c6..0000000000 --- a/god-mode/app/authentication/github/page.tsx +++ /dev/null @@ -1,107 +0,0 @@ -"use client"; - -import { useState } from "react"; -import Image from "next/image"; -import { useTheme } from "next-themes"; -import { observer } from "mobx-react-lite"; -import useSWR from "swr"; -// hooks -import useInstance from "hooks/use-instance"; -// ui -import { Loader, ToggleSwitch, setPromiseToast } from "@plane/ui"; -// components -import { AuthenticationMethodCard, InstanceGithubConfigForm } from "components/authentication"; -// icons -import githubLightModeImage from "/public/logos/github-black.png"; -import githubDarkModeImage from "/public/logos/github-white.png"; -// helpers -import { resolveGeneralTheme } from "helpers/common.helper"; - -const InstanceGithubAuthenticationPage = observer(() => { - // store - const { fetchInstanceConfigurations, formattedConfig, updateInstanceConfigurations } = useInstance(); - // state - const [isSubmitting, setIsSubmitting] = useState(false); - // theme - const { resolvedTheme } = useTheme(); - // config - const enableGithubConfig = formattedConfig?.IS_GITHUB_ENABLED ?? ""; - - useSWR("INSTANCE_CONFIGURATIONS", () => fetchInstanceConfigurations()); - - const updateConfig = async (key: "IS_GITHUB_ENABLED", value: string) => { - setIsSubmitting(true); - - const payload = { - [key]: value, - }; - - const updateConfigPromise = updateInstanceConfigurations(payload); - - setPromiseToast(updateConfigPromise, { - loading: "Saving Configuration...", - success: { - title: "Configuration saved", - message: () => `Github authentication is now ${value ? "active" : "disabled"}.`, - }, - error: { - title: "Error", - message: () => "Failed to save configuration", - }, - }); - - await updateConfigPromise - .then(() => { - setIsSubmitting(false); - }) - .catch((err) => { - console.error(err); - setIsSubmitting(false); - }); - }; - return ( -
-
- - } - config={ - { - Boolean(parseInt(enableGithubConfig)) === true - ? updateConfig("IS_GITHUB_ENABLED", "0") - : updateConfig("IS_GITHUB_ENABLED", "1"); - }} - size="sm" - disabled={isSubmitting || !formattedConfig} - /> - } - disabled={isSubmitting || !formattedConfig} - withBorder={false} - /> -
- {formattedConfig ? ( - - ) : ( - - - - - - - - )} -
- ); -}); - -export default InstanceGithubAuthenticationPage; diff --git a/god-mode/app/authentication/google/page.tsx b/god-mode/app/authentication/google/page.tsx deleted file mode 100644 index ad0d12afab..0000000000 --- a/god-mode/app/authentication/google/page.tsx +++ /dev/null @@ -1,95 +0,0 @@ -"use client"; - -import { useState } from "react"; -import Image from "next/image"; -import { observer } from "mobx-react-lite"; -import useSWR from "swr"; -// hooks -import useInstance from "hooks/use-instance"; -// ui -import { Loader, ToggleSwitch, setPromiseToast } from "@plane/ui"; -// components -import { AuthenticationMethodCard, InstanceGoogleConfigForm } from "components/authentication"; -// icons -import GoogleLogo from "/public/logos/google-logo.svg"; - -const InstanceGoogleAuthenticationPage = observer(() => { - // store - const { fetchInstanceConfigurations, formattedConfig, updateInstanceConfigurations } = useInstance(); - // state - const [isSubmitting, setIsSubmitting] = useState(false); - // config - const enableGoogleConfig = formattedConfig?.IS_GOOGLE_ENABLED ?? ""; - - useSWR("INSTANCE_CONFIGURATIONS", () => fetchInstanceConfigurations()); - - const updateConfig = async (key: "IS_GOOGLE_ENABLED", value: string) => { - setIsSubmitting(true); - - const payload = { - [key]: value, - }; - - const updateConfigPromise = updateInstanceConfigurations(payload); - - setPromiseToast(updateConfigPromise, { - loading: "Saving Configuration...", - success: { - title: "Configuration saved", - message: () => `Google authentication is now ${value ? "active" : "disabled"}.`, - }, - error: { - title: "Error", - message: () => "Failed to save configuration", - }, - }); - - await updateConfigPromise - .then(() => { - setIsSubmitting(false); - }) - .catch((err) => { - console.error(err); - setIsSubmitting(false); - }); - }; - return ( -
-
- } - config={ - { - Boolean(parseInt(enableGoogleConfig)) === true - ? updateConfig("IS_GOOGLE_ENABLED", "0") - : updateConfig("IS_GOOGLE_ENABLED", "1"); - }} - size="sm" - disabled={isSubmitting || !formattedConfig} - /> - } - disabled={isSubmitting || !formattedConfig} - withBorder={false} - /> -
- {formattedConfig ? ( - - ) : ( - - - - - - - - )} -
- ); -}); - -export default InstanceGoogleAuthenticationPage; diff --git a/god-mode/app/authentication/oidc/page.tsx b/god-mode/app/authentication/oidc/page.tsx deleted file mode 100644 index 1d87558286..0000000000 --- a/god-mode/app/authentication/oidc/page.tsx +++ /dev/null @@ -1,95 +0,0 @@ -"use client"; - -import { useState } from "react"; -import Image from "next/image"; -import { observer } from "mobx-react-lite"; -import useSWR from "swr"; -// hooks -import useInstance from "hooks/use-instance"; -// ui -import { Loader, ToggleSwitch, setPromiseToast } from "@plane/ui"; -// components -import { AuthenticationMethodCard, InstanceOIDCConfigForm } from "components/authentication"; -// icons -import OIDCLogo from "/public/logos/oidc-logo.png"; - -const InstanceOIDCAuthenticationPage = observer(() => { - // store - const { fetchInstanceConfigurations, formattedConfig, updateInstanceConfigurations } = useInstance(); - // state - const [isSubmitting, setIsSubmitting] = useState(false); - // config - const enableOIDCConfig = formattedConfig?.IS_OIDC_ENABLED ?? ""; - - useSWR("INSTANCE_CONFIGURATIONS", () => fetchInstanceConfigurations()); - - const updateConfig = async (key: "IS_OIDC_ENABLED", value: string) => { - setIsSubmitting(true); - - const payload = { - [key]: value, - }; - - const updateConfigPromise = updateInstanceConfigurations(payload); - - setPromiseToast(updateConfigPromise, { - loading: "Saving Configuration...", - success: { - title: "Configuration saved", - message: () => `OIDC authentication is now ${value ? "active" : "disabled"}.`, - }, - error: { - title: "Error", - message: () => "Failed to save configuration", - }, - }); - - await updateConfigPromise - .then(() => { - setIsSubmitting(false); - }) - .catch((err) => { - console.error(err); - setIsSubmitting(false); - }); - }; - return ( -
-
- } - config={ - { - Boolean(parseInt(enableOIDCConfig)) === true - ? updateConfig("IS_OIDC_ENABLED", "0") - : updateConfig("IS_OIDC_ENABLED", "1"); - }} - size="sm" - disabled={isSubmitting || !formattedConfig} - /> - } - disabled={isSubmitting || !formattedConfig} - withBorder={false} - /> -
- {formattedConfig ? ( - - ) : ( - - - - - - - - - )} -
- ); -}); - -export default InstanceOIDCAuthenticationPage; diff --git a/god-mode/app/authentication/page.tsx b/god-mode/app/authentication/page.tsx deleted file mode 100644 index 115eee94da..0000000000 --- a/god-mode/app/authentication/page.tsx +++ /dev/null @@ -1,207 +0,0 @@ -"use client"; - -import { useState } from "react"; -import Image from "next/image"; -import { useTheme } from "next-themes"; -import useSWR from "swr"; -import { observer } from "mobx-react-lite"; -// hooks -import useInstance from "hooks/use-instance"; -// ui -import { Loader, ToggleSwitch, setPromiseToast } from "@plane/ui"; -// types -import { TInstanceConfigurationKeys } from "@plane/types"; -// icons -import { Mails, KeyRound } from "lucide-react"; -import GoogleLogo from "/public/logos/google-logo.svg"; -import githubLightModeImage from "/public/logos/github-black.png"; -import githubDarkModeImage from "/public/logos/github-white.png"; -// icons - enterprise -import OIDCLogo from "/public/logos/oidc-logo.png"; -import SAMLLogo from "/public/logos/saml-logo.svg"; -// helpers -import { resolveGeneralTheme } from "helpers/common.helper"; -// components -import { - AuthenticationMethodCard, - EmailCodesConfiguration, - PasswordLoginConfiguration, - GoogleConfiguration, - GithubConfiguration, - // enterprise - OIDCConfiguration, - SAMLConfiguration, -} from "components/authentication"; - -type TInstanceAuthenticationMethodCard = { - key: string; - name: string; - description: string; - icon: JSX.Element; - config: JSX.Element; -}; - -const InstanceAuthenticationPage = observer(() => { - // store - const { fetchInstanceConfigurations, formattedConfig, updateInstanceConfigurations } = useInstance(); - - useSWR("INSTANCE_CONFIGURATIONS", () => fetchInstanceConfigurations()); - - // state - const [isSubmitting, setIsSubmitting] = useState(false); - // theme - const { resolvedTheme } = useTheme(); - - // Sign-up config - const enableSignup = formattedConfig?.ENABLE_SIGNUP ?? ""; - - const updateConfig = async (key: TInstanceConfigurationKeys, value: string) => { - setIsSubmitting(true); - - const payload = { - [key]: value, - }; - - const updateConfigPromise = updateInstanceConfigurations(payload); - - setPromiseToast(updateConfigPromise, { - loading: "Saving Configuration...", - success: { - title: "Success", - message: () => "Configuration saved successfully", - }, - error: { - title: "Error", - message: () => "Failed to save configuration", - }, - }); - - await updateConfigPromise - .then(() => { - setIsSubmitting(false); - }) - .catch((err) => { - console.error(err); - setIsSubmitting(false); - }); - }; - - // Authentication methods - const authenticationMethodsCard: TInstanceAuthenticationMethodCard[] = [ - { - key: "email-codes", - name: "Email codes", - description: "Login or sign up using codes sent via emails. You need to have email setup here and enabled.", - icon: , - config: , - }, - { - key: "password-login", - name: "Password based login", - description: "Allow members to create accounts with passwords for emails to sign in.", - icon: , - config: , - }, - { - key: "google", - name: "Google", - description: "Allow members to login or sign up to plane with their Google accounts.", - icon: Google Logo, - config: , - }, - { - key: "github", - name: "Github", - description: "Allow members to login or sign up to plane with their Github accounts.", - icon: ( - GitHub Logo - ), - config: , - }, - ]; - - // Enterprise authentication methods - authenticationMethodsCard.push( - { - key: "oidc", - name: "OIDC", - description: "Authenticate your users via the OpenID connect protocol.", - icon: OIDC Logo, - config: , - }, - { - key: "saml", - name: "SAML", - description: "Authenticate your users via Security Assertion Markup Language protocol.", - icon: SAML Logo, - config: , - } - ); - - return ( -
-
-
Manage authentication for your instance
-
- Configure authentication modes for your team and restrict sign ups to be invite only. -
-
- {formattedConfig ? ( - <> -
Sign-up configuration
-
-
-
- Allow anyone to sign up without invite -
-
- Toggling this off will disable self sign ups. -
-
-
- { - Boolean(parseInt(enableSignup)) === true - ? updateConfig("ENABLE_SIGNUP", "0") - : updateConfig("ENABLE_SIGNUP", "1"); - }} - size="sm" - disabled={isSubmitting} - /> -
-
- {/* Authentication modes */} -
Authentication modes
- {authenticationMethodsCard.map((method) => ( - - ))} - - ) : ( - - - - - - - - - - )} -
- ); -}); - -export default InstanceAuthenticationPage; diff --git a/god-mode/app/authentication/saml/page.tsx b/god-mode/app/authentication/saml/page.tsx deleted file mode 100644 index 8ce3fa3493..0000000000 --- a/god-mode/app/authentication/saml/page.tsx +++ /dev/null @@ -1,95 +0,0 @@ -"use client"; - -import { useState } from "react"; -import Image from "next/image"; -import { observer } from "mobx-react-lite"; -import useSWR from "swr"; -// hooks -import useInstance from "hooks/use-instance"; -// ui -import { Loader, ToggleSwitch, setPromiseToast } from "@plane/ui"; -// components -import { AuthenticationMethodCard, InstanceSAMLConfigForm } from "components/authentication"; -// icons -import SAMLLogo from "/public/logos/saml-logo.svg"; - -const InstanceSAMLAuthenticationPage = observer(() => { - // store - const { fetchInstanceConfigurations, formattedConfig, updateInstanceConfigurations } = useInstance(); - // state - const [isSubmitting, setIsSubmitting] = useState(false); - // config - const enableSAMLConfig = formattedConfig?.IS_SAML_ENABLED ?? ""; - - useSWR("INSTANCE_CONFIGURATIONS", () => fetchInstanceConfigurations()); - - const updateConfig = async (key: "IS_SAML_ENABLED", value: string) => { - setIsSubmitting(true); - - const payload = { - [key]: value, - }; - - const updateConfigPromise = updateInstanceConfigurations(payload); - - setPromiseToast(updateConfigPromise, { - loading: "Saving Configuration...", - success: { - title: "Configuration saved", - message: () => `SAML authentication is now ${value ? "active" : "disabled"}.`, - }, - error: { - title: "Error", - message: () => "Failed to save configuration", - }, - }); - - await updateConfigPromise - .then(() => { - setIsSubmitting(false); - }) - .catch((err) => { - console.error(err); - setIsSubmitting(false); - }); - }; - return ( -
-
- } - config={ - { - Boolean(parseInt(enableSAMLConfig)) === true - ? updateConfig("IS_SAML_ENABLED", "0") - : updateConfig("IS_SAML_ENABLED", "1"); - }} - size="sm" - disabled={isSubmitting || !formattedConfig} - /> - } - disabled={isSubmitting || !formattedConfig} - withBorder={false} - /> -
- {formattedConfig ? ( - - ) : ( - - - - - - - - )} -
- ); -}); - -export default InstanceSAMLAuthenticationPage; diff --git a/god-mode/app/create-workspace-popup.tsx b/god-mode/app/create-workspace-popup.tsx deleted file mode 100644 index 1b73860c4e..0000000000 --- a/god-mode/app/create-workspace-popup.tsx +++ /dev/null @@ -1,61 +0,0 @@ -"use client"; - -import React from "react"; -import { observer } from "mobx-react-lite"; -import Link from "next/link"; -import Image from "next/image"; -import { useTheme } from "next-themes"; -// ui -import { Button, getButtonStyling } from "@plane/ui"; -// helpers -import { resolveGeneralTheme } from "helpers/common.helper"; -// icons -import TakeoffIconLight from "/public/logos/takeoff-icon-light.svg"; -import TakeoffIconDark from "/public/logos/takeoff-icon-dark.svg"; - -type Props = { - isOpen: boolean; - onClose?: () => void; -}; - -export const CreateWorkspacePopup: React.FC = observer((props) => { - const { isOpen, onClose } = props; - // theme - const { resolvedTheme } = useTheme(); - - const handleClose = () => { - onClose && onClose(); - }; - - if (!isOpen) return null; - - return ( -
-
-
-
Create workspace
-
- Instance setup done! Welcome to Plane instance portal. Start your journey with by creating your first - workspace, you will need to login again. -
-
- - Create workspace - - -
-
-
- Plane icon -
-
-
- ); -}); diff --git a/god-mode/app/email/page.tsx b/god-mode/app/email/page.tsx deleted file mode 100644 index a86063ed4d..0000000000 --- a/god-mode/app/email/page.tsx +++ /dev/null @@ -1,45 +0,0 @@ -"use client"; - -import useSWR from "swr"; -import { observer } from "mobx-react-lite"; -// hooks -import useInstance from "hooks/use-instance"; -// ui -import { Loader } from "@plane/ui"; -// components -import { InstanceEmailForm } from "components/email"; - -const InstanceEmailPage = observer(() => { - // store - const { fetchInstanceConfigurations, formattedConfig } = useInstance(); - - useSWR("INSTANCE_CONFIGURATIONS", () => fetchInstanceConfigurations()); - - return ( -
-
-
Secure emails from your own instance
-
- Plane can send useful emails to you and your users from your own instance without talking to the Internet. -
-
- Set it up below and please test your settings before you save them.{" "} - Misconfigs can lead to email bounces and errors. -
-
- {formattedConfig ? ( - - ) : ( - - - - - - - - )} -
- ); -}); - -export default InstanceEmailPage; diff --git a/god-mode/app/globals.css b/god-mode/app/globals.css deleted file mode 100644 index 4a7599d497..0000000000 --- a/god-mode/app/globals.css +++ /dev/null @@ -1,466 +0,0 @@ -@import url("https://fonts.googleapis.com/css2?family=Inter:wght@200;300;400;500;600;700;800&display=swap"); -@import url("https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@48,400,0,0&display=swap"); - -@tailwind base; -@tailwind components; -@tailwind utilities; - -@layer components { - .text-1\.5xl { - font-size: 1.375rem; - line-height: 1.875rem; - } - - .text-2\.5xl { - font-size: 1.75rem; - line-height: 2.25rem; - } -} - -@layer base { - html { - font-family: "Inter", sans-serif; - } - - :root { - color-scheme: light !important; - - --color-primary-10: 236, 241, 255; - --color-primary-20: 217, 228, 255; - --color-primary-30: 197, 214, 255; - --color-primary-40: 178, 200, 255; - --color-primary-50: 159, 187, 255; - --color-primary-60: 140, 173, 255; - --color-primary-70: 121, 159, 255; - --color-primary-80: 101, 145, 255; - --color-primary-90: 82, 132, 255; - --color-primary-100: 63, 118, 255; - --color-primary-200: 57, 106, 230; - --color-primary-300: 50, 94, 204; - --color-primary-400: 44, 83, 179; - --color-primary-500: 38, 71, 153; - --color-primary-600: 32, 59, 128; - --color-primary-700: 25, 47, 102; - --color-primary-800: 19, 35, 76; - --color-primary-900: 13, 24, 51; - - --color-background-100: 255, 255, 255; /* primary bg */ - --color-background-90: 250, 250, 250; /* secondary bg */ - --color-background-80: 245, 245, 245; /* tertiary bg */ - - --color-text-100: 23, 23, 23; /* primary text */ - --color-text-200: 58, 58, 58; /* secondary text */ - --color-text-300: 82, 82, 82; /* tertiary text */ - --color-text-400: 163, 163, 163; /* placeholder text */ - - --color-scrollbar: 163, 163, 163; /* scrollbar thumb */ - - --color-border-100: 245, 245, 245; /* subtle border= 1 */ - --color-border-200: 229, 229, 229; /* subtle border- 2 */ - --color-border-300: 212, 212, 212; /* strong border- 1 */ - --color-border-400: 185, 185, 185; /* strong border- 2 */ - - --color-shadow-2xs: 0px 0px 1px 0px rgba(23, 23, 23, 0.06), - 0px 1px 2px 0px rgba(23, 23, 23, 0.06), - 0px 1px 2px 0px rgba(23, 23, 23, 0.14); - --color-shadow-xs: 0px 1px 2px 0px rgba(0, 0, 0, 0.16), - 0px 2px 4px 0px rgba(16, 24, 40, 0.12), - 0px 1px 8px -1px rgba(16, 24, 40, 0.1); - --color-shadow-sm: 0px 1px 4px 0px rgba(0, 0, 0, 0.01), - 0px 4px 8px 0px rgba(0, 0, 0, 0.02), 0px 1px 12px 0px rgba(0, 0, 0, 0.12); - --color-shadow-rg: 0px 3px 6px 0px rgba(0, 0, 0, 0.1), - 0px 4px 4px 0px rgba(16, 24, 40, 0.08), - 0px 1px 12px 0px rgba(16, 24, 40, 0.04); - --color-shadow-md: 0px 4px 8px 0px rgba(0, 0, 0, 0.12), - 0px 6px 12px 0px rgba(16, 24, 40, 0.12), - 0px 1px 16px 0px rgba(16, 24, 40, 0.12); - --color-shadow-lg: 0px 6px 12px 0px rgba(0, 0, 0, 0.12), - 0px 8px 16px 0px rgba(0, 0, 0, 0.12), - 0px 1px 24px 0px rgba(16, 24, 40, 0.12); - --color-shadow-xl: 0px 0px 18px 0px rgba(0, 0, 0, 0.16), - 0px 0px 24px 0px rgba(16, 24, 40, 0.16), - 0px 0px 52px 0px rgba(16, 24, 40, 0.16); - --color-shadow-2xl: 0px 8px 16px 0px rgba(0, 0, 0, 0.12), - 0px 12px 24px 0px rgba(16, 24, 40, 0.12), - 0px 1px 32px 0px rgba(16, 24, 40, 0.12); - --color-shadow-3xl: 0px 12px 24px 0px rgba(0, 0, 0, 0.12), - 0px 16px 32px 0px rgba(0, 0, 0, 0.12), - 0px 1px 48px 0px rgba(16, 24, 40, 0.12); - --color-shadow-4xl: 0px 8px 40px 0px rgba(0, 0, 61, 0.05), - 0px 12px 32px -16px rgba(0, 0, 0, 0.05); - - --color-sidebar-background-100: var( - --color-background-100 - ); /* primary sidebar bg */ - --color-sidebar-background-90: var( - --color-background-90 - ); /* secondary sidebar bg */ - --color-sidebar-background-80: var( - --color-background-80 - ); /* tertiary sidebar bg */ - - --color-sidebar-text-100: var(--color-text-100); /* primary sidebar text */ - --color-sidebar-text-200: var( - --color-text-200 - ); /* secondary sidebar text */ - --color-sidebar-text-300: var(--color-text-300); /* tertiary sidebar text */ - --color-sidebar-text-400: var( - --color-text-400 - ); /* sidebar placeholder text */ - - --color-sidebar-border-100: var( - --color-border-100 - ); /* subtle sidebar border= 1 */ - --color-sidebar-border-200: var( - --color-border-100 - ); /* subtle sidebar border- 2 */ - --color-sidebar-border-300: var( - --color-border-100 - ); /* strong sidebar border- 1 */ - --color-sidebar-border-400: var( - --color-border-100 - ); /* strong sidebar border- 2 */ - - --color-sidebar-shadow-2xs: var(--color-shadow-2xs); - --color-sidebar-shadow-xs: var(--color-shadow-xs); - --color-sidebar-shadow-sm: var(--color-shadow-sm); - --color-sidebar-shadow-rg: var(--color-shadow-rg); - --color-sidebar-shadow-md: var(--color-shadow-md); - --color-sidebar-shadow-lg: var(--color-shadow-lg); - --color-sidebar-shadow-xl: var(--color-shadow-xl); - --color-sidebar-shadow-2xl: var(--color-shadow-2xl); - --color-sidebar-shadow-3xl: var(--color-shadow-3xl); - --color-sidebar-shadow-4xl: var(--color-shadow-4xl); - } - - [data-theme="light"], - [data-theme="light-contrast"] { - color-scheme: light !important; - - --color-background-100: 255, 255, 255; /* primary bg */ - --color-background-90: 250, 250, 250; /* secondary bg */ - --color-background-80: 245, 245, 245; /* tertiary bg */ - } - - [data-theme="light"] { - --color-text-100: 23, 23, 23; /* primary text */ - --color-text-200: 58, 58, 58; /* secondary text */ - --color-text-300: 82, 82, 82; /* tertiary text */ - --color-text-400: 163, 163, 163; /* placeholder text */ - - --color-scrollbar: 163, 163, 163; /* scrollbar thumb */ - - --color-border-100: 245, 245, 245; /* subtle border= 1 */ - --color-border-200: 229, 229, 229; /* subtle border- 2 */ - --color-border-300: 212, 212, 212; /* strong border- 1 */ - --color-border-400: 185, 185, 185; /* strong border- 2 */ - - /* onboarding colors */ - --gradient-onboarding-100: linear-gradient( - 106deg, - #f2f6ff 29.8%, - #e1eaff 99.34% - ); - --gradient-onboarding-200: linear-gradient( - 129deg, - rgba(255, 255, 255, 0) -22.23%, - rgba(255, 255, 255, 0.8) 62.98% - ); - --gradient-onboarding-300: linear-gradient( - 164deg, - #fff 4.25%, - rgba(255, 255, 255, 0.06) 93.5% - ); - --gradient-onboarding-400: linear-gradient( - 129deg, - rgba(255, 255, 255, 0) -22.23%, - rgba(255, 255, 255, 0.8) 62.98% - ); - - --color-onboarding-text-100: 23, 23, 23; - --color-onboarding-text-200: 58, 58, 58; - --color-onboarding-text-300: 82, 82, 82; - --color-onboarding-text-400: 163, 163, 163; - - --color-onboarding-background-100: 236, 241, 255; - --color-onboarding-background-200: 255, 255, 255; - --color-onboarding-background-300: 236, 241, 255; - --color-onboarding-background-400: 177, 206, 250; - - --color-onboarding-border-100: 229, 229, 229; - --color-onboarding-border-200: 217, 228, 255; - --color-onboarding-border-300: 229, 229, 229, 0.5; - - --color-onboarding-shadow-sm: 0px 4px 20px 0px rgba(126, 139, 171, 0.1); - - /* toast theme */ - --color-toast-success-text: 62, 155, 79; - --color-toast-error-text: 220, 62, 66; - --color-toast-warning-text: 255, 186, 24; - --color-toast-info-text: 51, 88, 212; - --color-toast-loading-text: 28, 32, 36; - --color-toast-secondary-text: 128, 131, 141; - --color-toast-tertiary-text: 96, 100, 108; - - --color-toast-success-background: 253, 253, 254; - --color-toast-error-background: 255, 252, 252; - --color-toast-warning-background: 254, 253, 251; - --color-toast-info-background: 253, 253, 254; - --color-toast-loading-background: 253, 253, 254; - - --color-toast-success-border: 218, 241, 219; - --color-toast-error-border: 255, 219, 220; - --color-toast-warning-border: 255, 247, 194; - --color-toast-info-border: 210, 222, 255; - --color-toast-loading-border: 224, 225, 230; - } - - [data-theme="light-contrast"] { - --color-text-100: 11, 11, 11; /* primary text */ - --color-text-200: 38, 38, 38; /* secondary text */ - --color-text-300: 58, 58, 58; /* tertiary text */ - --color-text-400: 115, 115, 115; /* placeholder text */ - - --color-scrollbar: 115, 115, 115; /* scrollbar thumb */ - - --color-border-100: 34, 34, 34; /* subtle border= 1 */ - --color-border-200: 38, 38, 38; /* subtle border- 2 */ - --color-border-300: 46, 46, 46; /* strong border- 1 */ - --color-border-400: 58, 58, 58; /* strong border- 2 */ - } - - [data-theme="dark"], - [data-theme="dark-contrast"] { - color-scheme: dark !important; - - --color-background-100: 7, 7, 7; /* primary bg */ - --color-background-90: 11, 11, 11; /* secondary bg */ - --color-background-80: 23, 23, 23; /* tertiary bg */ - - --color-shadow-2xs: 0px 0px 1px 0px rgba(0, 0, 0, 0.15), - 0px 1px 3px 0px rgba(0, 0, 0, 0.5); - --color-shadow-xs: 0px 0px 2px 0px rgba(0, 0, 0, 0.2), - 0px 2px 4px 0px rgba(0, 0, 0, 0.5); - --color-shadow-sm: 0px 0px 4px 0px rgba(0, 0, 0, 0.2), - 0px 2px 6px 0px rgba(0, 0, 0, 0.5); - --color-shadow-rg: 0px 0px 6px 0px rgba(0, 0, 0, 0.2), - 0px 4px 6px 0px rgba(0, 0, 0, 0.5); - --color-shadow-md: 0px 2px 8px 0px rgba(0, 0, 0, 0.2), - 0px 4px 8px 0px rgba(0, 0, 0, 0.5); - --color-shadow-lg: 0px 4px 12px 0px rgba(0, 0, 0, 0.25), - 0px 4px 10px 0px rgba(0, 0, 0, 0.55); - --color-shadow-xl: 0px 0px 14px 0px rgba(0, 0, 0, 0.25), - 0px 6px 10px 0px rgba(0, 0, 0, 0.55); - --color-shadow-2xl: 0px 0px 18px 0px rgba(0, 0, 0, 0.25), - 0px 8px 12px 0px rgba(0, 0, 0, 0.6); - --color-shadow-3xl: 0px 4px 24px 0px rgba(0, 0, 0, 0.3), - 0px 12px 40px 0px rgba(0, 0, 0, 0.65); - } - - [data-theme="dark"] { - --color-text-100: 229, 229, 229; /* primary text */ - --color-text-200: 163, 163, 163; /* secondary text */ - --color-text-300: 115, 115, 115; /* tertiary text */ - --color-text-400: 82, 82, 82; /* placeholder text */ - - --color-scrollbar: 82, 82, 82; /* scrollbar thumb */ - - --color-border-100: 34, 34, 34; /* subtle border= 1 */ - --color-border-200: 38, 38, 38; /* subtle border- 2 */ - --color-border-300: 46, 46, 46; /* strong border- 1 */ - --color-border-400: 58, 58, 58; /* strong border- 2 */ - - /* onboarding colors */ - --gradient-onboarding-100: linear-gradient( - 106deg, - #18191b 25.17%, - #18191b 99.34% - ); - --gradient-onboarding-200: linear-gradient( - 129deg, - rgba(47, 49, 53, 0.8) -22.23%, - rgba(33, 34, 37, 0.8) 62.98% - ); - --gradient-onboarding-300: linear-gradient( - 167deg, - rgba(47, 49, 53, 0.45) 19.22%, - #212225 98.48% - ); - - --color-onboarding-text-100: 237, 238, 240; - --color-onboarding-text-200: 176, 180, 187; - --color-onboarding-text-300: 118, 123, 132; - --color-onboarding-text-400: 105, 110, 119; - - --color-onboarding-background-100: 54, 58, 64; - --color-onboarding-background-200: 40, 42, 45; - --color-onboarding-background-300: 40, 42, 45; - --color-onboarding-background-400: 67, 72, 79; - - --color-onboarding-border-100: 54, 58, 64; - --color-onboarding-border-200: 54, 58, 64; - --color-onboarding-border-300: 34, 35, 38, 0.5; - - --color-onboarding-shadow-sm: 0px 4px 20px 0px rgba(39, 44, 56, 0.1); - - /* toast theme */ - --color-toast-success-text: 178, 221, 181; - --color-toast-error-text: 206, 44, 49; - --color-toast-warning-text: 255, 186, 24; - --color-toast-info-text: 141, 164, 239; - --color-toast-loading-text: 255, 255, 255; - --color-toast-secondary-text: 185, 187, 198; - --color-toast-tertiary-text: 139, 141, 152; - - --color-toast-success-background: 46, 46, 46; - --color-toast-error-background: 46, 46, 46; - --color-toast-warning-background: 46, 46, 46; - --color-toast-info-background: 46, 46, 46; - --color-toast-loading-background: 46, 46, 46; - - --color-toast-success-border: 42, 126, 59; - --color-toast-error-border: 100, 23, 35; - --color-toast-warning-border: 79, 52, 34; - --color-toast-info-border: 58, 91, 199; - --color-toast-loading-border: 96, 100, 108; - } - - [data-theme="dark-contrast"] { - --color-text-100: 250, 250, 250; /* primary text */ - --color-text-200: 241, 241, 241; /* secondary text */ - --color-text-300: 212, 212, 212; /* tertiary text */ - --color-text-400: 115, 115, 115; /* placeholder text */ - - --color-scrollbar: 115, 115, 115; /* scrollbar thumb */ - - --color-border-100: 245, 245, 245; /* subtle border= 1 */ - --color-border-200: 229, 229, 229; /* subtle border- 2 */ - --color-border-300: 212, 212, 212; /* strong border- 1 */ - --color-border-400: 185, 185, 185; /* strong border- 2 */ - } - - [data-theme="light"], - [data-theme="dark"], - [data-theme="light-contrast"], - [data-theme="dark-contrast"] { - --color-primary-10: 236, 241, 255; - --color-primary-20: 217, 228, 255; - --color-primary-30: 197, 214, 255; - --color-primary-40: 178, 200, 255; - --color-primary-50: 159, 187, 255; - --color-primary-60: 140, 173, 255; - --color-primary-70: 121, 159, 255; - --color-primary-80: 101, 145, 255; - --color-primary-90: 82, 132, 255; - --color-primary-100: 63, 118, 255; - --color-primary-200: 57, 106, 230; - --color-primary-300: 50, 94, 204; - --color-primary-400: 44, 83, 179; - --color-primary-500: 38, 71, 153; - --color-primary-600: 32, 59, 128; - --color-primary-700: 25, 47, 102; - --color-primary-800: 19, 35, 76; - --color-primary-900: 13, 24, 51; - - --color-sidebar-background-100: var( - --color-background-100 - ); /* primary sidebar bg */ - --color-sidebar-background-90: var( - --color-background-90 - ); /* secondary sidebar bg */ - --color-sidebar-background-80: var( - --color-background-80 - ); /* tertiary sidebar bg */ - - --color-sidebar-text-100: var(--color-text-100); /* primary sidebar text */ - --color-sidebar-text-200: var( - --color-text-200 - ); /* secondary sidebar text */ - --color-sidebar-text-300: var(--color-text-300); /* tertiary sidebar text */ - --color-sidebar-text-400: var( - --color-text-400 - ); /* sidebar placeholder text */ - - --color-sidebar-border-100: var( - --color-border-100 - ); /* subtle sidebar border= 1 */ - --color-sidebar-border-200: var( - --color-border-200 - ); /* subtle sidebar border- 2 */ - --color-sidebar-border-300: var( - --color-border-300 - ); /* strong sidebar border- 1 */ - --color-sidebar-border-400: var( - --color-border-400 - ); /* strong sidebar border- 2 */ - } -} - -* { - margin: 0; - padding: 0; - box-sizing: border-box; - -webkit-text-size-adjust: 100%; - -ms-text-size-adjust: 100%; - font-variant-ligatures: none; - -webkit-font-variant-ligatures: none; - text-rendering: optimizeLegibility; - -moz-osx-font-smoothing: grayscale; - -webkit-font-smoothing: antialiased; -} - -body { - color: rgba(var(--color-text-100)); -} - -/* scrollbar style */ -::-webkit-scrollbar { - display: none; -} - -.horizontal-scroll-enable { - overflow-x: scroll; -} - -.horizontal-scroll-enable::-webkit-scrollbar { - display: block; - height: 7px; - width: 0; -} - -.horizontal-scroll-enable::-webkit-scrollbar-track { - height: 7px; - background-color: rgba(var(--color-background-100)); -} - -.horizontal-scroll-enable::-webkit-scrollbar-thumb { - border-radius: 5px; - background-color: rgba(var(--color-scrollbar)); -} - -.vertical-scroll-enable::-webkit-scrollbar { - display: block; - width: 5px; -} - -.vertical-scroll-enable::-webkit-scrollbar-track { - width: 5px; -} - -.vertical-scroll-enable::-webkit-scrollbar-thumb { - border-radius: 5px; - background-color: rgba(var(--color-background-90)); -} -/* end scrollbar style */ - -/* progress bar */ -.progress-bar { - fill: currentColor; - color: rgba(var(--color-sidebar-background-100)); -} - -::-webkit-input-placeholder, -::placeholder, -:-ms-input-placeholder { - color: rgb(var(--color-text-400)); -} diff --git a/god-mode/app/header.tsx b/god-mode/app/header.tsx deleted file mode 100644 index 160622fa41..0000000000 --- a/god-mode/app/header.tsx +++ /dev/null @@ -1,88 +0,0 @@ -"use client"; - -import { FC } from "react"; -import { usePathname } from "next/navigation"; -// mobx -import { observer } from "mobx-react-lite"; -// ui -import { Settings } from "lucide-react"; -// icons -import { Breadcrumbs } from "@plane/ui"; -// components -import { BreadcrumbLink } from "components/common"; -import { SidebarHamburgerToggle } from "components/sidebar"; - -export const InstanceHeader: FC = observer(() => { - const pathName = usePathname(); - - const getHeaderTitle = (pathName: string) => { - switch (pathName) { - case "": - return "General"; - case "ai": - return "Artificial Intelligence"; - case "email": - return "Email"; - case "authentication": - return "Authentication"; - case "image": - return "Image"; - case "google": - return "Google"; - case "github": - return "Github"; - default: - return pathName.toUpperCase(); - } - }; - - // Function to dynamically generate breadcrumb items based on pathname - const generateBreadcrumbItems = (pathname: string) => { - const pathSegments = pathname.split("/").slice(1); // removing the first empty string. - let currentUrl = ""; - const breadcrumbItems = pathSegments.map((segment) => { - currentUrl += "/" + segment; - return { - title: getHeaderTitle(segment), - href: currentUrl, - }; - }); - return breadcrumbItems; - }; - - const breadcrumbItems = generateBreadcrumbItems(pathName); - - return ( -
-
- - {breadcrumbItems.length >= 0 && ( -
- - } - /> - } - /> - {breadcrumbItems.map( - (item) => - item.title && ( - } - /> - ) - )} - -
- )} -
-
- ); -}); diff --git a/god-mode/app/image/page.tsx b/god-mode/app/image/page.tsx deleted file mode 100644 index e78d026799..0000000000 --- a/god-mode/app/image/page.tsx +++ /dev/null @@ -1,38 +0,0 @@ -"use client"; - -import useSWR from "swr"; -import { observer } from "mobx-react-lite"; -// hooks -import useInstance from "hooks/use-instance"; -// ui -import { Loader } from "@plane/ui"; -// components -import { InstanceImageConfigForm } from "components/image"; - -const InstanceImagePage = observer(() => { - // store - const { fetchInstanceConfigurations, formattedConfig } = useInstance(); - - useSWR("INSTANCE_CONFIGURATIONS", () => fetchInstanceConfigurations()); - - return ( -
-
-
Third-party image libraries
-
- Let your users search and choose images from third-party libraries -
-
- {formattedConfig ? ( - - ) : ( - - - - - )} -
- ); -}); - -export default InstanceImagePage; diff --git a/god-mode/app/layout.tsx b/god-mode/app/layout.tsx deleted file mode 100644 index b64f70a865..0000000000 --- a/god-mode/app/layout.tsx +++ /dev/null @@ -1,44 +0,0 @@ -// lib -// import { ThemeProvider } from "lib/theme-provider"; -// import AppWrapper from "lib/wrappers/app-wrapper"; -// import { UserAuthWrapper } from "lib/wrappers/user-auth-wrapper"; -// components -// import { InstanceSidebar } from "./sidebar"; -// import { InstanceHeader } from "./header"; -import { DefaultLayout } from "@/layouts"; -// styles -import "./globals.css"; - -export const metadata = { - title: "God Mode", - description: "You are god now.", -}; - -interface RootLayoutProps { - children: React.ReactNode; -} - -export const RootLayout = async ({ children }: RootLayoutProps) => ( - - - {children} - {/* - - -
- -
- -
-
{children}
-
-
-
-
-
-
*/} - - -); - -export default RootLayout; diff --git a/god-mode/app/page.tsx b/god-mode/app/page.tsx deleted file mode 100644 index dbd16979b8..0000000000 --- a/god-mode/app/page.tsx +++ /dev/null @@ -1,56 +0,0 @@ -"use client"; - -import { observer } from "mobx-react-lite"; -// import useSWR from "swr"; -// hooks -// import useInstance from "hooks/use-instance"; -// ui -// import { Loader } from "@plane/ui"; -// components -// import { InstanceGeneralForm } from "components/general"; -// import { PageHead } from "components/core"; -import { InstanceSignInForm, InstanceSignUpForm } from "@/components/user-authentication-forms"; - -const GeneralSettingsPage = observer(() => { - // store - // const { instance, instanceAdmins, fetchInstanceInfo, fetchInstanceAdmins } = useInstance(); - - // fetching instance information - // useSWR("INSTANCE_INFO", () => fetchInstanceInfo()); - // fetching instance admins - // useSWR("INSTANCE_ADMINS", () => fetchInstanceAdmins()); - - console.log("init page"); - - return ( - <> - {/* */} - {/*
-
-
General settings
-
- Change the name of your instance and instance admin e-mail addresses. Enable or disable telemetry in your - instance. -
-
- {instance && instanceAdmins ? ( - <> -
Instance details
- - - ) : ( - - - - - - - )} -
*/} - - {/* */} - - ); -}); - -export default GeneralSettingsPage; diff --git a/god-mode/app/sidebar.tsx b/god-mode/app/sidebar.tsx deleted file mode 100644 index cb65fcf93b..0000000000 --- a/god-mode/app/sidebar.tsx +++ /dev/null @@ -1,57 +0,0 @@ -"use client"; - -import { FC, useEffect, useRef } from "react"; -import { observer } from "mobx-react-lite"; -// hooks -import useAppTheme from "hooks/use-theme"; -import useOutsideClickDetector from "hooks/use-outside-click-detector"; -// components -import { HelpSection, SidebarMenu, SidebarDropdown } from "components/sidebar"; - -export interface IInstanceSidebar {} - -export const InstanceSidebar: FC = observer(() => { - // store - const themeStore = useAppTheme(); - - const ref = useRef(null); - - useOutsideClickDetector(ref, () => { - if (themeStore.sidebarCollapsed === false) { - if (window.innerWidth < 768) { - themeStore.toggleSidebar(); - } - } - }); - - useEffect(() => { - const handleResize = () => { - if (window.innerWidth <= 768) { - themeStore.toggleSidebar(true); - } - }; - handleResize(); - window.addEventListener("resize", handleResize); - return () => { - window.removeEventListener("resize", handleResize); - }; - }, [themeStore]); - - return ( -
-
- - - -
-
- ); -}); diff --git a/god-mode/components/ai/ai-config-form.tsx b/god-mode/components/ai/ai-config-form.tsx deleted file mode 100644 index fd5d98cc4b..0000000000 --- a/god-mode/components/ai/ai-config-form.tsx +++ /dev/null @@ -1,124 +0,0 @@ -import { FC } from "react"; -import { useForm } from "react-hook-form"; -// hooks -import useInstance from "hooks/use-instance"; -// ui -import { Button, TOAST_TYPE, setToast } from "@plane/ui"; -// components -import { ControllerInput, TControllerInputFormField } from "components/common"; -// types -import { - IFormattedInstanceConfiguration, - TInstanceAIConfigurationKeys, -} from "@plane/types"; - -type IInstanceAIForm = { - config: IFormattedInstanceConfiguration; -}; - -type AIFormValues = Record; - -export const InstanceAIForm: FC = (props) => { - const { config } = props; - // store - const { updateInstanceConfigurations } = useInstance(); - // form data - const { - handleSubmit, - control, - formState: { errors, isSubmitting }, - } = useForm({ - defaultValues: { - OPENAI_API_KEY: config["OPENAI_API_KEY"], - GPT_ENGINE: config["GPT_ENGINE"], - }, - }); - - const aiFormFields: TControllerInputFormField[] = [ - { - key: "GPT_ENGINE", - type: "text", - label: "GPT_ENGINE", - description: ( - <> - Choose an OpenAI engine.{" "} - - Learn more - - - ), - placeholder: "gpt-3.5-turbo", - error: Boolean(errors.GPT_ENGINE), - required: false, - }, - { - key: "OPENAI_API_KEY", - type: "password", - label: "API key", - description: ( - <> - You will find your API key{" "} - - here. - - - ), - placeholder: "sk-asddassdfasdefqsdfasd23das3dasdcasd", - error: Boolean(errors.OPENAI_API_KEY), - required: false, - }, - ]; - - const onSubmit = async (formData: AIFormValues) => { - const payload: Partial = { ...formData }; - - await updateInstanceConfigurations(payload) - .then(() => - setToast({ - type: TOAST_TYPE.SUCCESS, - title: "Success", - message: "AI Settings updated successfully", - }) - ) - .catch((err) => console.error(err)); - }; - - return ( - <> -
- {aiFormFields.map((field) => ( - - ))} -
-
- -
- - ); -}; diff --git a/god-mode/components/ai/index.ts b/god-mode/components/ai/index.ts deleted file mode 100644 index 8c1763b760..0000000000 --- a/god-mode/components/ai/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./ai-config-form"; \ No newline at end of file diff --git a/god-mode/components/authentication/authentication-method-card.tsx b/god-mode/components/authentication/authentication-method-card.tsx deleted file mode 100644 index 1346a730ec..0000000000 --- a/god-mode/components/authentication/authentication-method-card.tsx +++ /dev/null @@ -1,51 +0,0 @@ -"use client"; - -import { FC } from "react"; -// helpers -import { cn } from "helpers/common.helper"; - -type Props = { - name: string; - description: string; - icon: JSX.Element; - config: JSX.Element; - disabled?: boolean; - withBorder?: boolean; -}; - -export const AuthenticationMethodCard: FC = (props) => { - const { name, description, icon, config, disabled = false, withBorder = true } = props; - - return ( -
-
-
-
{icon}
-
-
-
- {name} -
-
- {description} -
-
-
-
{config}
-
- ); -}; diff --git a/god-mode/components/authentication/email-codes/index.ts b/god-mode/components/authentication/email-codes/index.ts deleted file mode 100644 index 50a9c47c01..0000000000 --- a/god-mode/components/authentication/email-codes/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./root"; \ No newline at end of file diff --git a/god-mode/components/authentication/email-codes/root.tsx b/god-mode/components/authentication/email-codes/root.tsx deleted file mode 100644 index c1328bc1e4..0000000000 --- a/god-mode/components/authentication/email-codes/root.tsx +++ /dev/null @@ -1,36 +0,0 @@ -"use client"; - -import React from "react"; -import { observer } from "mobx-react-lite"; -// hooks -import useInstance from "hooks/use-instance"; -// ui -import { ToggleSwitch } from "@plane/ui"; -// types -import { TInstanceAuthenticationMethodKeys } from "@plane/types"; - -type Props = { - disabled: boolean; - updateConfig: (key: TInstanceAuthenticationMethodKeys, value: string) => void; -}; - -export const EmailCodesConfiguration: React.FC = observer((props) => { - const { disabled, updateConfig } = props; - // store - const { formattedConfig } = useInstance(); - // derived values - const enableMagicLogin = formattedConfig?.ENABLE_MAGIC_LINK_LOGIN ?? ""; - - return ( - { - Boolean(parseInt(enableMagicLogin)) === true - ? updateConfig("ENABLE_MAGIC_LINK_LOGIN", "0") - : updateConfig("ENABLE_MAGIC_LINK_LOGIN", "1"); - }} - size="sm" - disabled={disabled} - /> - ); -}); diff --git a/god-mode/components/authentication/github/github-config-form.tsx b/god-mode/components/authentication/github/github-config-form.tsx deleted file mode 100644 index 2c307bb966..0000000000 --- a/god-mode/components/authentication/github/github-config-form.tsx +++ /dev/null @@ -1,205 +0,0 @@ -import { FC, useState } from "react"; -import { useForm } from "react-hook-form"; -import Link from "next/link"; -// hooks -import useInstance from "hooks/use-instance"; -// ui -import { Button, TOAST_TYPE, getButtonStyling, setToast } from "@plane/ui"; -// components -import { - ConfirmDiscardModal, - ControllerInput, - CopyField, - TControllerInputFormField, - TCopyField, -} from "components/common"; -// types -import { IFormattedInstanceConfiguration, TInstanceGithubAuthenticationConfigurationKeys } from "@plane/types"; -// helpers -import { cn } from "helpers/common.helper"; - -type Props = { - config: IFormattedInstanceConfiguration; -}; - -type GithubConfigFormValues = Record; - -export const InstanceGithubConfigForm: FC = (props) => { - const { config } = props; - // states - const [isDiscardChangesModalOpen, setIsDiscardChangesModalOpen] = useState(false); - // store hooks - const { updateInstanceConfigurations } = useInstance(); - // form data - const { - handleSubmit, - control, - reset, - formState: { errors, isDirty, isSubmitting }, - } = useForm({ - defaultValues: { - GITHUB_CLIENT_ID: config["GITHUB_CLIENT_ID"], - GITHUB_CLIENT_SECRET: config["GITHUB_CLIENT_SECRET"], - }, - }); - - const originURL = typeof window !== "undefined" ? window.location.origin : ""; - - const githubFormFields: TControllerInputFormField[] = [ - { - key: "GITHUB_CLIENT_ID", - type: "text", - label: "Client ID", - description: ( - <> - You will get this from your{" "} - - GitHub OAuth application settings. - - - ), - placeholder: "70a44354520df8bd9bcd", - error: Boolean(errors.GITHUB_CLIENT_ID), - required: true, - }, - { - key: "GITHUB_CLIENT_SECRET", - type: "password", - label: "Client secret", - description: ( - <> - Your client secret is also found in your{" "} - - GitHub OAuth application settings. - - - ), - placeholder: "9b0050f94ec1b744e32ce79ea4ffacd40d4119cb", - error: Boolean(errors.GITHUB_CLIENT_SECRET), - required: true, - }, - ]; - - const githubCopyFields: TCopyField[] = [ - { - key: "Origin_URL", - label: "Origin URL", - url: originURL, - description: ( - <> - We will auto-generate this. Paste this into the Authorized origin URL field{" "} - - here. - - - ), - }, - { - key: "Callback_URI", - label: "Callback URI", - url: `${originURL}/auth/github/callback/`, - description: ( - <> - We will auto-generate this. Paste this into your Authorized Callback URI field{" "} - - here. - - - ), - }, - ]; - - const onSubmit = async (formData: GithubConfigFormValues) => { - const payload: Partial = { ...formData }; - - await updateInstanceConfigurations(payload) - .then(() => { - setToast({ - type: TOAST_TYPE.SUCCESS, - title: "Success", - message: "Github Configuration Settings updated successfully", - }); - reset(); - }) - .catch((err) => console.error(err)); - }; - - const handleGoBack = (e: React.MouseEvent) => { - if (isDirty) { - e.preventDefault(); - setIsDiscardChangesModalOpen(true); - } - }; - - return ( - <> - setIsDiscardChangesModalOpen(false)} - /> -
-
-
-
Configuration
- {githubFormFields.map((field) => ( - - ))} -
-
- - - Go back - -
-
-
-
-
-
Service provider details
- {githubCopyFields.map((field) => ( - - ))} -
-
-
-
- - ); -}; diff --git a/god-mode/components/authentication/github/index.ts b/god-mode/components/authentication/github/index.ts deleted file mode 100644 index e9e36e988a..0000000000 --- a/god-mode/components/authentication/github/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./root"; -export * from "./github-config-form"; \ No newline at end of file diff --git a/god-mode/components/authentication/github/root.tsx b/god-mode/components/authentication/github/root.tsx deleted file mode 100644 index a690b54814..0000000000 --- a/god-mode/components/authentication/github/root.tsx +++ /dev/null @@ -1,70 +0,0 @@ -"use client"; - -import React from "react"; -import Link from "next/link"; -import { observer } from "mobx-react-lite"; -// hooks -import useInstance from "hooks/use-instance"; -// ui -import { ToggleSwitch, getButtonStyling } from "@plane/ui"; -// icons -import { Settings2 } from "lucide-react"; -// types -import { TInstanceAuthenticationMethodKeys } from "@plane/types"; -// helpers -import { cn } from "helpers/common.helper"; - -type Props = { - disabled: boolean; - updateConfig: (key: TInstanceAuthenticationMethodKeys, value: string) => void; -}; - -export const GithubConfiguration: React.FC = observer((props) => { - const { disabled, updateConfig } = props; - // store - const { formattedConfig } = useInstance(); - // derived values - const enableGithubConfig = formattedConfig?.IS_GITHUB_ENABLED ?? ""; - const isGithubConfigured = - !!formattedConfig?.GITHUB_CLIENT_ID && - !!formattedConfig?.GITHUB_CLIENT_SECRET; - - return ( - <> - {isGithubConfigured ? ( -
- - Edit - - { - Boolean(parseInt(enableGithubConfig)) === true - ? updateConfig("IS_GITHUB_ENABLED", "0") - : updateConfig("IS_GITHUB_ENABLED", "1"); - }} - size="sm" - disabled={disabled} - /> -
- ) : ( - - - Configure - - )} - - ); -}); diff --git a/god-mode/components/authentication/google/google-config-form.tsx b/god-mode/components/authentication/google/google-config-form.tsx deleted file mode 100644 index 8c08b69f29..0000000000 --- a/god-mode/components/authentication/google/google-config-form.tsx +++ /dev/null @@ -1,205 +0,0 @@ -import { FC, useState } from "react"; -import { useForm } from "react-hook-form"; -import Link from "next/link"; -// hooks -import useInstance from "hooks/use-instance"; -// ui -import { Button, TOAST_TYPE, getButtonStyling, setToast } from "@plane/ui"; -// components -import { - ConfirmDiscardModal, - ControllerInput, - CopyField, - TControllerInputFormField, - TCopyField, -} from "components/common"; -// types -import { IFormattedInstanceConfiguration, TInstanceGoogleAuthenticationConfigurationKeys } from "@plane/types"; -// helpers -import { cn } from "helpers/common.helper"; - -type Props = { - config: IFormattedInstanceConfiguration; -}; - -type GoogleConfigFormValues = Record; - -export const InstanceGoogleConfigForm: FC = (props) => { - const { config } = props; - // states - const [isDiscardChangesModalOpen, setIsDiscardChangesModalOpen] = useState(false); - // store hooks - const { updateInstanceConfigurations } = useInstance(); - // form data - const { - handleSubmit, - control, - reset, - formState: { errors, isDirty, isSubmitting }, - } = useForm({ - defaultValues: { - GOOGLE_CLIENT_ID: config["GOOGLE_CLIENT_ID"], - GOOGLE_CLIENT_SECRET: config["GOOGLE_CLIENT_SECRET"], - }, - }); - - const originURL = typeof window !== "undefined" ? window.location.origin : ""; - - const googleFormFields: TControllerInputFormField[] = [ - { - key: "GOOGLE_CLIENT_ID", - type: "text", - label: "Client ID", - description: ( - <> - Your client ID lives in your Google API Console.{" "} - - Learn more - - - ), - placeholder: "840195096245-0p2tstej9j5nc4l8o1ah2dqondscqc1g.apps.googleusercontent.com", - error: Boolean(errors.GOOGLE_CLIENT_ID), - required: true, - }, - { - key: "GOOGLE_CLIENT_SECRET", - type: "password", - label: "Client secret", - description: ( - <> - Your client secret should also be in your Google API Console.{" "} - - Learn more - - - ), - placeholder: "GOCShX-ADp4cI0kPqav1gGCBg5bE02E", - error: Boolean(errors.GOOGLE_CLIENT_SECRET), - required: true, - }, - ]; - - const googleCopyFeilds: TCopyField[] = [ - { - key: "Origin_URL", - label: "Origin URL", - url: originURL, - description: ( -

- We will auto-generate this. Paste this into your Authorized JavaScript origins field. For this OAuth client{" "} - - here. - -

- ), - }, - { - key: "Callback_URI", - label: "Callback URI", - url: `${originURL}/auth/google/callback/`, - description: ( -

- We will auto-generate this. Paste this into your Authorized Redirect URI field. For this OAuth client{" "} - - here. - -

- ), - }, - ]; - - const onSubmit = async (formData: GoogleConfigFormValues) => { - const payload: Partial = { ...formData }; - - await updateInstanceConfigurations(payload) - .then(() => { - setToast({ - type: TOAST_TYPE.SUCCESS, - title: "Success", - message: "Google Configuration Settings updated successfully", - }); - reset(); - }) - .catch((err) => console.error(err)); - }; - - const handleGoBack = (e: React.MouseEvent) => { - if (isDirty) { - e.preventDefault(); - setIsDiscardChangesModalOpen(true); - } - }; - - return ( - <> - setIsDiscardChangesModalOpen(false)} - /> -
-
-
-
Configuration
- {googleFormFields.map((field) => ( - - ))} -
-
- - - Go back - -
-
-
-
-
-
Service provider details
- {googleCopyFeilds.map((field) => ( - - ))} -
-
-
-
- - ); -}; diff --git a/god-mode/components/authentication/google/index.ts b/god-mode/components/authentication/google/index.ts deleted file mode 100644 index d0d37f3057..0000000000 --- a/god-mode/components/authentication/google/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./root"; -export * from "./google-config-form"; \ No newline at end of file diff --git a/god-mode/components/authentication/google/root.tsx b/god-mode/components/authentication/google/root.tsx deleted file mode 100644 index e713f381c0..0000000000 --- a/god-mode/components/authentication/google/root.tsx +++ /dev/null @@ -1,70 +0,0 @@ -"use client"; - -import React from "react"; -import Link from "next/link"; -import { observer } from "mobx-react-lite"; -// hooks -import useInstance from "hooks/use-instance"; -// ui -import { ToggleSwitch, getButtonStyling } from "@plane/ui"; -// icons -import { Settings2 } from "lucide-react"; -// types -import { TInstanceAuthenticationMethodKeys } from "@plane/types"; -// helpers -import { cn } from "helpers/common.helper"; - -type Props = { - disabled: boolean; - updateConfig: (key: TInstanceAuthenticationMethodKeys, value: string) => void; -}; - -export const GoogleConfiguration: React.FC = observer((props) => { - const { disabled, updateConfig } = props; - // store - const { formattedConfig } = useInstance(); - // derived values - const enableGoogleConfig = formattedConfig?.IS_GOOGLE_ENABLED ?? ""; - const isGoogleConfigured = - !!formattedConfig?.GOOGLE_CLIENT_ID && - !!formattedConfig?.GOOGLE_CLIENT_SECRET; - - return ( - <> - {isGoogleConfigured ? ( -
- - Edit - - { - Boolean(parseInt(enableGoogleConfig)) === true - ? updateConfig("IS_GOOGLE_ENABLED", "0") - : updateConfig("IS_GOOGLE_ENABLED", "1"); - }} - size="sm" - disabled={disabled} - /> -
- ) : ( - - - Configure - - )} - - ); -}); diff --git a/god-mode/components/authentication/index.ts b/god-mode/components/authentication/index.ts deleted file mode 100644 index 144a96fcfe..0000000000 --- a/god-mode/components/authentication/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -export * from "./authentication-method-card"; -export * from "./email-codes"; -export * from "./password"; -export * from "./google"; -export * from "./github"; - -// enterprise -export * from "./oidc"; -export * from "./saml"; diff --git a/god-mode/components/authentication/oidc/index.ts b/god-mode/components/authentication/oidc/index.ts deleted file mode 100644 index e39a6b18ec..0000000000 --- a/god-mode/components/authentication/oidc/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./root"; -export * from "./oidc-config-form"; \ No newline at end of file diff --git a/god-mode/components/authentication/oidc/oidc-config-form.tsx b/god-mode/components/authentication/oidc/oidc-config-form.tsx deleted file mode 100644 index 4799d3442e..0000000000 --- a/god-mode/components/authentication/oidc/oidc-config-form.tsx +++ /dev/null @@ -1,204 +0,0 @@ -import { FC, useState } from "react"; -import { useForm } from "react-hook-form"; -import Link from "next/link"; -// hooks -import useInstance from "hooks/use-instance"; -// ui -import { Button, TOAST_TYPE, getButtonStyling, setToast } from "@plane/ui"; -// components -import { - ConfirmDiscardModal, - ControllerInput, - TControllerInputFormField, - CopyField, - TCopyField, -} from "components/common"; -// types -import { IFormattedInstanceConfiguration, TInstanceOIDCAuthenticationConfigurationKeys } from "@plane/types"; -// helpers -import { cn } from "helpers/common.helper"; - -type Props = { - config: IFormattedInstanceConfiguration; -}; - -type OIDCConfigFormValues = Record; - -export const InstanceOIDCConfigForm: FC = (props) => { - const { config } = props; - // states - const [isDiscardChangesModalOpen, setIsDiscardChangesModalOpen] = useState(false); - // store hooks - const { updateInstanceConfigurations } = useInstance(); - // form data - const { - handleSubmit, - control, - reset, - formState: { errors, isDirty, isSubmitting }, - } = useForm({ - defaultValues: { - OIDC_CLIENT_ID: config["OIDC_CLIENT_ID"], - OIDC_CLIENT_SECRET: config["OIDC_CLIENT_SECRET"], - OIDC_TOKEN_URL: config["OIDC_TOKEN_URL"], - OIDC_USERINFO_URL: config["OIDC_USERINFO_URL"], - OIDC_AUTHORIZE_URL: config["OIDC_AUTHORIZE_URL"], - OIDC_LOGOUT_URL: config["OIDC_LOGOUT_URL"], - }, - }); - - const originURL = typeof window !== "undefined" ? window.location.origin : ""; - - const oidcFormFields: TControllerInputFormField[] = [ - { - key: "OIDC_CLIENT_ID", - type: "text", - label: "Client ID", - description: "Your authentication provider's public identifier for the client.", - placeholder: "abc123xyz789", - error: Boolean(errors.OIDC_CLIENT_ID), - required: true, - }, - { - key: "OIDC_CLIENT_SECRET", - type: "password", - label: "Client secret", - description: "Secret key provided by your authentication provider for the client.", - placeholder: "s3cr3tK3y123!", - error: Boolean(errors.OIDC_CLIENT_SECRET), - required: true, - }, - { - key: "OIDC_AUTHORIZE_URL", - type: "text", - label: "Authorize URL", - description: "The URL for interacting with the resource owner to obtain an authorization grant.", - placeholder: "https://example.com/", - error: Boolean(errors.OIDC_AUTHORIZE_URL), - required: true, - }, - { - key: "OIDC_TOKEN_URL", - type: "text", - label: "Token URL", - description: "URL to fetch the access token from a grant or refresh token.", - placeholder: "https://example.com/oauth/token", - error: Boolean(errors.OIDC_TOKEN_URL), - required: true, - }, - { - key: "OIDC_USERINFO_URL", - type: "text", - label: "UserInfo URL", - description: "The URL to fetch user claims and information.", - placeholder: "https://example.com/userinfo", - error: Boolean(errors.OIDC_USERINFO_URL), - required: true, - }, - { - key: "OIDC_LOGOUT_URL", - type: "text", - label: "Logout URL", - description: "Add your OIDC logout URL here for seamless session management.", - placeholder: "https://example.com/logout", - error: Boolean(errors.OIDC_LOGOUT_URL), - required: false, - }, - ]; - - const oidcCopyFields: TCopyField[] = [ - { - key: "Callback_URI", - label: "Callback URI", - url: `${originURL}/auth/oidc/callback/`, - description: - "We will auto generate this. Paste this in the sign-in redirect URI section in your identity provider.", - }, - { - key: "Logout_URI", - label: "Logout URI", - url: `${originURL}/auth/oidc/logout/`, - description: "We will auto-generate this. Paste this in sign-out redirect URI in your identity provider", - }, - { - key: "Origin_URI", - label: "Origin URI", - url: `${originURL}/auth/oidc/`, - description: "We will auto-generate this. Add this as a trusted origin in your identity provider.", - }, - ]; - - const onSubmit = async (formData: OIDCConfigFormValues) => { - const payload: Partial = { ...formData }; - - await updateInstanceConfigurations(payload) - .then(() => { - setToast({ - type: TOAST_TYPE.SUCCESS, - title: "Success", - message: "OIDC Configuration Settings updated successfully", - }); - reset(); - }) - .catch((err) => console.error(err)); - }; - - const handleGoBack = (e: React.MouseEvent) => { - if (isDirty) { - e.preventDefault(); - setIsDiscardChangesModalOpen(true); - } - }; - - return ( - <> - setIsDiscardChangesModalOpen(false)} - /> -
-
-
-
Configuration
- {oidcFormFields.map((field) => ( - - ))} -
-
- - - Go back - -
-
-
-
-
-
Service provider details
- {oidcCopyFields.map((field) => ( - - ))} -
-
-
-
- - ); -}; diff --git a/god-mode/components/authentication/oidc/root.tsx b/god-mode/components/authentication/oidc/root.tsx deleted file mode 100644 index 6bedf12584..0000000000 --- a/god-mode/components/authentication/oidc/root.tsx +++ /dev/null @@ -1,72 +0,0 @@ -"use client"; - -import React from "react"; -import Link from "next/link"; -import { observer } from "mobx-react-lite"; -// hooks -import useInstance from "hooks/use-instance"; -// ui -import { ToggleSwitch, getButtonStyling } from "@plane/ui"; -// icons -import { Settings2 } from "lucide-react"; -// types -import { TInstanceEnterpriseAuthenticationMethodKeys } from "@plane/types"; -// helpers -import { cn } from "helpers/common.helper"; - -type Props = { - disabled: boolean; - updateConfig: ( - key: TInstanceEnterpriseAuthenticationMethodKeys, - value: string - ) => void; -}; - -export const OIDCConfiguration: React.FC = observer((props) => { - const { disabled, updateConfig } = props; - // store - const { formattedConfig } = useInstance(); - // derived values - const enableOIDCConfig = formattedConfig?.IS_OIDC_ENABLED ?? ""; - const isOIDCConfigured = - !!formattedConfig?.OIDC_CLIENT_ID && !!formattedConfig?.OIDC_CLIENT_SECRET; - - return ( - <> - {isOIDCConfigured ? ( -
- - Edit - - { - Boolean(parseInt(enableOIDCConfig)) === true - ? updateConfig("IS_OIDC_ENABLED", "0") - : updateConfig("IS_OIDC_ENABLED", "1"); - }} - size="sm" - disabled={disabled} - /> -
- ) : ( - - - Configure - - )} - - ); -}); diff --git a/god-mode/components/authentication/password/index.ts b/god-mode/components/authentication/password/index.ts deleted file mode 100644 index 50a9c47c01..0000000000 --- a/god-mode/components/authentication/password/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./root"; \ No newline at end of file diff --git a/god-mode/components/authentication/password/root.tsx b/god-mode/components/authentication/password/root.tsx deleted file mode 100644 index 0f15a9eb9b..0000000000 --- a/god-mode/components/authentication/password/root.tsx +++ /dev/null @@ -1,36 +0,0 @@ -"use client"; - -import React from "react"; -import { observer } from "mobx-react-lite"; -// hooks -import useInstance from "hooks/use-instance"; -// ui -import { ToggleSwitch } from "@plane/ui"; -// types -import { TInstanceAuthenticationMethodKeys } from "@plane/types"; - -type Props = { - disabled: boolean; - updateConfig: (key: TInstanceAuthenticationMethodKeys, value: string) => void; -}; - -export const PasswordLoginConfiguration: React.FC = observer((props) => { - const { disabled, updateConfig } = props; - // store - const { formattedConfig } = useInstance(); - // derived values - const enableEmailPassword = formattedConfig?.ENABLE_EMAIL_PASSWORD ?? ""; - - return ( - { - Boolean(parseInt(enableEmailPassword)) === true - ? updateConfig("ENABLE_EMAIL_PASSWORD", "0") - : updateConfig("ENABLE_EMAIL_PASSWORD", "1"); - }} - size="sm" - disabled={disabled} - /> - ); -}); diff --git a/god-mode/components/authentication/saml/index.ts b/god-mode/components/authentication/saml/index.ts deleted file mode 100644 index b46c0ff1a4..0000000000 --- a/god-mode/components/authentication/saml/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./root"; -export * from "./saml-config-form"; \ No newline at end of file diff --git a/god-mode/components/authentication/saml/root.tsx b/god-mode/components/authentication/saml/root.tsx deleted file mode 100644 index f5a02fcfa9..0000000000 --- a/god-mode/components/authentication/saml/root.tsx +++ /dev/null @@ -1,72 +0,0 @@ -"use client"; - -import React from "react"; -import Link from "next/link"; -import { observer } from "mobx-react-lite"; -// hooks -import useInstance from "hooks/use-instance"; -// ui -import { ToggleSwitch, getButtonStyling } from "@plane/ui"; -// icons -import { Settings2 } from "lucide-react"; -// types -import { TInstanceEnterpriseAuthenticationMethodKeys } from "@plane/types"; -// helpers -import { cn } from "helpers/common.helper"; - -type Props = { - disabled: boolean; - updateConfig: ( - key: TInstanceEnterpriseAuthenticationMethodKeys, - value: string - ) => void; -}; - -export const SAMLConfiguration: React.FC = observer((props) => { - const { disabled, updateConfig } = props; - // store - const { formattedConfig } = useInstance(); - // derived values - const enableSAMLConfig = formattedConfig?.IS_SAML_ENABLED ?? ""; - const isSAMLConfigured = - !!formattedConfig?.SAML_ENTITY_ID && !!formattedConfig?.SAML_CERTIFICATE; - - return ( - <> - {isSAMLConfigured ? ( -
- - Edit - - { - Boolean(parseInt(enableSAMLConfig)) === true - ? updateConfig("IS_SAML_ENABLED", "0") - : updateConfig("IS_SAML_ENABLED", "1"); - }} - size="sm" - disabled={disabled} - /> -
- ) : ( - - - Configure - - )} - - ); -}); diff --git a/god-mode/components/authentication/saml/saml-config-form.tsx b/god-mode/components/authentication/saml/saml-config-form.tsx deleted file mode 100644 index 15ba4d6e93..0000000000 --- a/god-mode/components/authentication/saml/saml-config-form.tsx +++ /dev/null @@ -1,210 +0,0 @@ -import { FC, useState } from "react"; -import { Controller, useForm } from "react-hook-form"; -import Link from "next/link"; -// hooks -import useInstance from "hooks/use-instance"; -// ui -import { Button, TOAST_TYPE, TextArea, getButtonStyling, setToast } from "@plane/ui"; -// components -import { - ConfirmDiscardModal, - ControllerInput, - TControllerInputFormField, - CopyField, - TCopyField, -} from "components/common"; -// types -import { IFormattedInstanceConfiguration, TInstanceSAMLAuthenticationConfigurationKeys } from "@plane/types"; -// helpers -import { cn } from "helpers/common.helper"; - -type Props = { - config: IFormattedInstanceConfiguration; -}; - -type SAMLConfigFormValues = Record; - -export const InstanceSAMLConfigForm: FC = (props) => { - const { config } = props; - // states - const [isDiscardChangesModalOpen, setIsDiscardChangesModalOpen] = useState(false); - // store hooks - const { updateInstanceConfigurations } = useInstance(); - // form data - const { - handleSubmit, - control, - reset, - formState: { errors, isDirty, isSubmitting }, - } = useForm({ - defaultValues: { - SAML_ENTITY_ID: config["SAML_ENTITY_ID"], - SAML_SSO_URL: config["SAML_SSO_URL"], - SAML_LOGOUT_URL: config["SAML_LOGOUT_URL"], - SAML_CERTIFICATE: config["SAML_CERTIFICATE"], - }, - }); - - const originURL = typeof window !== "undefined" ? window.location.origin : ""; - - const samlFormFields: TControllerInputFormField[] = [ - { - key: "SAML_ENTITY_ID", - type: "text", - label: "Entity ID", - description: "Unique identifier for your Identity Provider (IdP) entity.", - placeholder: "70a44354520df8bd9bcd", - error: Boolean(errors.SAML_ENTITY_ID), - required: true, - }, - { - key: "SAML_SSO_URL", - type: "text", - label: "SSO URLs", - description: "URL used for Single Sign-On (SSO) with your Identity Provider (IdP).", - placeholder: "https://example.com/sso", - error: Boolean(errors.SAML_SSO_URL), - required: true, - }, - { - key: "SAML_LOGOUT_URL", - type: "text", - label: "Logout URL", - description: "Add your SAML logout URL here for seamless session management.", - placeholder: "https://example.com/logout", - error: Boolean(errors.SAML_LOGOUT_URL), - required: false, - }, - ]; - - const samlCopyFields: TCopyField[] = [ - { - key: "Callback_URI", - label: "Callback URI", - url: `${originURL}/auth/saml/callback/`, - description: - "We will auto-generate this. Paste this in the single sign on callback url section of your identity provider.", - }, - { - key: "Metadata_Information", - label: "Metadata Information", - url: `${originURL}/auth/saml/metadata/`, - description: - "We will auto-generate this. Paste this into your audience URI or SP entity ID section of your identity provider.", - }, - { - key: "Logout_URI", - label: "Logout URI", - url: `${originURL}/auth/saml/logout/`, - description: "We will auto-generate this. Add this as a trusted origin in your identity provider.", - }, - ]; - - const onSubmit = async (formData: SAMLConfigFormValues) => { - const payload: Partial = { ...formData }; - - await updateInstanceConfigurations(payload) - .then(() => { - setToast({ - type: TOAST_TYPE.SUCCESS, - title: "Success", - message: "SAML Configuration Settings updated successfully", - }); - reset(); - }) - .catch((err) => console.error(err)); - }; - - const handleGoBack = (e: React.MouseEvent) => { - if (isDirty) { - e.preventDefault(); - setIsDiscardChangesModalOpen(true); - } - }; - - return ( - <> - setIsDiscardChangesModalOpen(false)} - /> -
-
-
-
Configuration
- {samlFormFields.map((field) => ( - - ))} -
-

Certificate

- ( -