diff --git a/admin/components/admin-sidebar/help-section.tsx b/admin/components/admin-sidebar/help-section.tsx index 8b3f5baeb..84e28c67a 100644 --- a/admin/components/admin-sidebar/help-section.tsx +++ b/admin/components/admin-sidebar/help-section.tsx @@ -7,9 +7,10 @@ import { Transition } from "@headlessui/react"; import { ExternalLink, FileText, HelpCircle, MoveLeft } from "lucide-react"; import { DiscordIcon, GithubIcon, Tooltip } from "@plane/ui"; // hooks -import { useInstance, useTheme } from "@/hooks/store"; +import { useTheme } from "@/hooks/store"; // assets import packageJson from "package.json"; +import { WEB_BASE_URL } from "@/helpers/common.helper"; const helpOptions = [ { @@ -30,8 +31,6 @@ const helpOptions = [ ]; export const HelpSection: FC = observer(() => { - // hooks - const { instance } = useInstance(); // states const [isNeedHelpOpen, setIsNeedHelpOpen] = useState(false); // store @@ -39,7 +38,7 @@ export const HelpSection: FC = observer(() => { // refs const helpOptionsRef = useRef(null); - const redirectionLink = `${instance?.config?.app_base_url ? `${instance?.config?.app_base_url}/create-workspace` : `/god-mode/`}`; + const redirectionLink = encodeURI(WEB_BASE_URL + "/create-workspace"); return (
void; +}; + +export const InstanceFailureView: FC = (props) => { + const { mutate } = props; + const { resolvedTheme } = useTheme(); + + const instanceImage = resolvedTheme === "dark" ? InstanceFailureDarkImage : InstanceFailureImage; + + return ( +
+
+
+ Plane Logo +

Unable to fetch instance details.

+

+ We were unable to fetch the details of the instance.
+ Fret not, it might just be a connectivity issue. +

+
+
+ +
+
+
+ ); +}; diff --git a/space/components/instance/not-ready-view.tsx b/space/components/instance/not-ready-view.tsx index a28fcf3e7..815e0d1fe 100644 --- a/space/components/instance/not-ready-view.tsx +++ b/space/components/instance/not-ready-view.tsx @@ -1,40 +1,33 @@ import { FC } from "react"; import Image from "next/image"; -import { useTheme } from "next-themes"; -// icons -import { UserCog2 } from "lucide-react"; +import Link from "next/link"; // ui -import { getButtonStyling } from "@plane/ui"; +import { Button } from "@plane/ui"; +// helpers +import { ADMIN_BASE_URL, ADMIN_BASE_PATH } from "@/helpers/common.helper"; // images -import instanceNotReady from "public/instance/plane-instance-not-ready.webp"; -import PlaneBlackLogo from "public/plane-logos/black-horizontal-with-blue-logo.svg"; -import PlaneWhiteLogo from "public/plane-logos/white-horizontal-with-blue-logo.svg"; +import PlaneTakeOffImage from "@/public/instance/plane-takeoff.png"; export const InstanceNotReady: FC = () => { - const { resolvedTheme } = useTheme(); - - const planeLogo = resolvedTheme === "dark" ? PlaneWhiteLogo : PlaneBlackLogo; + const GOD_MODE_URL = encodeURI(ADMIN_BASE_URL + ADMIN_BASE_PATH + "/setup/?auth_enabled=0"); return ( -
-
-
-
-
- Plane logo -
-
- Instance not ready -
-
-

Your Plane instance isn{"'"}t ready yet

-

Ask your Instance Admin to complete set-up first.

- - - Get started - -
-
+
+
+
+

Welcome aboard Plane!

+ Plane Logo +

+ Get started by setting up your instance and workspace +

+
+ +
+ + +
diff --git a/space/helpers/common.helper.ts b/space/helpers/common.helper.ts index f39cddc0e..99e04e559 100644 --- a/space/helpers/common.helper.ts +++ b/space/helpers/common.helper.ts @@ -3,6 +3,9 @@ import { twMerge } from "tailwind-merge"; export const API_BASE_URL = process.env.NEXT_PUBLIC_API_BASE_URL || ""; +export const ADMIN_BASE_URL = process.env.NEXT_PUBLIC_ADMIN_BASE_URL || ""; +export const ADMIN_BASE_PATH = process.env.NEXT_PUBLIC_ADMIN_BASE_PATH || ""; + export const SPACE_BASE_PATH = process.env.NEXT_PUBLIC_SPACE_BASE_PATH || ""; export const WEB_BASE_URL = process.env.NEXT_PUBLIC_WEB_BASE_URL || ""; diff --git a/space/layouts/project-layout.tsx b/space/layouts/project-layout.tsx index c5946277f..0411bcbcc 100644 --- a/space/layouts/project-layout.tsx +++ b/space/layouts/project-layout.tsx @@ -1,10 +1,9 @@ -import Image from "next/image"; - -// mobx import { observer } from "mobx-react-lite"; -import planeLogo from "public/plane-logo.svg"; +import Image from "next/image"; // components import IssueNavbar from "@/components/issues/navbar"; +// logo +import planeLogo from "public/plane-logo.svg"; const ProjectLayout = ({ children }: { children: React.ReactNode }) => (
@@ -12,7 +11,6 @@ const ProjectLayout = ({ children }: { children: React.ReactNode }) => (
{children}
- = observer((props) => {
); + if (pageType === EPageTypes.PUBLIC) return <>{children}; if (pageType === EPageTypes.INIT) { diff --git a/space/lib/wrappers/instance-wrapper.tsx b/space/lib/wrappers/instance-wrapper.tsx index 05390fad8..3be92ed05 100644 --- a/space/lib/wrappers/instance-wrapper.tsx +++ b/space/lib/wrappers/instance-wrapper.tsx @@ -4,7 +4,7 @@ import useSWR from "swr"; // ui import { Spinner } from "@plane/ui"; // components -import { InstanceNotReady } from "@/components/instance"; +import { InstanceNotReady, InstanceFailureView } from "@/components/instance"; // hooks import { useInstance } from "@/hooks/store"; @@ -17,8 +17,11 @@ export const InstanceWrapper: FC = observer((props) => { // hooks const { isLoading, instance, fetchInstanceInfo } = useInstance(); - const { isLoading: isSWRLoading } = useSWR("INSTANCE_INFORMATION", () => fetchInstanceInfo(), { + const { isLoading: isSWRLoading, mutate } = useSWR("INSTANCE_INFORMATION", () => fetchInstanceInfo(), { revalidateOnFocus: false, + revalidateIfStale: false, + revalidateOnReconnect: false, + errorRetryCount: 0, }); if (isSWRLoading || isLoading) @@ -28,6 +31,8 @@ export const InstanceWrapper: FC = observer((props) => {
); + if (!instance) return ; + if (instance?.instance?.is_setup_done === false) return ; return <>{children}; diff --git a/space/public/instance/instance-failure-dark.svg b/space/public/instance/instance-failure-dark.svg new file mode 100644 index 000000000..58d691705 --- /dev/null +++ b/space/public/instance/instance-failure-dark.svg @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/space/public/instance/instance-failure.svg b/space/public/instance/instance-failure.svg new file mode 100644 index 000000000..a59862283 --- /dev/null +++ b/space/public/instance/instance-failure.svg @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/space/public/instance/plane-takeoff.png b/space/public/instance/plane-takeoff.png new file mode 100644 index 000000000..417ff8299 Binary files /dev/null and b/space/public/instance/plane-takeoff.png differ