diff --git a/apiserver/plane/space/urls/project.py b/apiserver/plane/space/urls/project.py index 7676c959924..068b8c5c17f 100644 --- a/apiserver/plane/space/urls/project.py +++ b/apiserver/plane/space/urls/project.py @@ -10,9 +10,15 @@ ProjectStatesEndpoint, ProjectLabelsEndpoint, ProjectMembersEndpoint, + ProjectMetaDataEndpoint, ) urlpatterns = [ + path( + "anchor//meta/", + ProjectMetaDataEndpoint.as_view(), + name="project-meta", + ), path( "anchor//settings/", ProjectDeployBoardPublicSettingsEndpoint.as_view(), diff --git a/apiserver/plane/space/views/__init__.py b/apiserver/plane/space/views/__init__.py index afdc1d33741..22acfd15bd2 100644 --- a/apiserver/plane/space/views/__init__.py +++ b/apiserver/plane/space/views/__init__.py @@ -25,3 +25,5 @@ from .label import ProjectLabelsEndpoint from .asset import EntityAssetEndpoint, AssetRestoreEndpoint, EntityBulkAssetEndpoint + +from .meta import ProjectMetaDataEndpoint diff --git a/apiserver/plane/space/views/meta.py b/apiserver/plane/space/views/meta.py new file mode 100644 index 00000000000..fa441359964 --- /dev/null +++ b/apiserver/plane/space/views/meta.py @@ -0,0 +1,34 @@ +# third party +from rest_framework.permissions import AllowAny +from rest_framework import status +from rest_framework.response import Response + +from plane.db.models import DeployBoard, Project + +from .base import BaseAPIView +from plane.space.serializer.project import ProjectLiteSerializer + + +class ProjectMetaDataEndpoint(BaseAPIView): + permission_classes = [AllowAny] + + def get(self, request, anchor): + try: + deploy_board = DeployBoard.objects.filter( + anchor=anchor, entity_name="project" + ).first() + except DeployBoard.DoesNotExist: + return Response( + {"error": "Project is not published"}, status=status.HTTP_404_NOT_FOUND + ) + + try: + project_id = deploy_board.entity_identifier + project = Project.objects.get(id=project_id) + except Project.DoesNotExist: + return Response( + {"error": "Project is not published"}, status=status.HTTP_404_NOT_FOUND + ) + + serializer = ProjectLiteSerializer(project) + return Response(serializer.data, status=status.HTTP_200_OK) diff --git a/packages/constants/src/endpoints.ts b/packages/constants/src/endpoints.ts index 751ee20dd3d..fa6db6ec73c 100644 --- a/packages/constants/src/endpoints.ts +++ b/packages/constants/src/endpoints.ts @@ -13,3 +13,6 @@ export const SITES_URL = encodeURI(`${SPACE_BASE_URL}${SPACE_BASE_PATH}/`); export const LIVE_BASE_URL = process.env.NEXT_PUBLIC_LIVE_BASE_URL || ""; export const LIVE_BASE_PATH = process.env.NEXT_PUBLIC_LIVE_BASE_PATH || ""; export const LIVE_URL = encodeURI(`${LIVE_BASE_URL}${LIVE_BASE_PATH}/`); +// plane website url +export const WEBSITE_URL = + process.env.NEXT_PUBLIC_WEBSITE_URL || "https://plane.so"; diff --git a/space/app/issues/[anchor]/client-layout.tsx b/space/app/issues/[anchor]/client-layout.tsx new file mode 100644 index 00000000000..b100e57c6f5 --- /dev/null +++ b/space/app/issues/[anchor]/client-layout.tsx @@ -0,0 +1,54 @@ +"use client"; + +import { observer } from "mobx-react"; +import useSWR from "swr"; +// components +import { LogoSpinner } from "@/components/common"; +import { IssuesNavbarRoot } from "@/components/issues"; +import { SomethingWentWrongError } from "@/components/issues/issue-layouts/error"; +// hooks +import { useIssueFilter, usePublish, usePublishList } from "@/hooks/store"; + +type Props = { + children: React.ReactNode; + anchor: string; +}; + +export const IssuesClientLayout = observer((props: Props) => { + const { children, anchor } = props; + // store hooks + const { fetchPublishSettings } = usePublishList(); + const publishSettings = usePublish(anchor); + const { updateLayoutOptions } = useIssueFilter(); + // fetch publish settings + const { error } = useSWR( + anchor ? `PUBLISH_SETTINGS_${anchor}` : null, + anchor + ? async () => { + const response = await fetchPublishSettings(anchor); + if (response.view_props) { + updateLayoutOptions({ + list: !!response.view_props.list, + kanban: !!response.view_props.kanban, + calendar: !!response.view_props.calendar, + gantt: !!response.view_props.gantt, + spreadsheet: !!response.view_props.spreadsheet, + }); + } + } + : null + ); + + if (!publishSettings && !error) return ; + + if (error) return ; + + return ( +
+
+ +
+
{children}
+
+ ); +}); diff --git a/space/app/issues/[anchor]/layout.tsx b/space/app/issues/[anchor]/layout.tsx index ac5dba43078..f4502a127fd 100644 --- a/space/app/issues/[anchor]/layout.tsx +++ b/space/app/issues/[anchor]/layout.tsx @@ -1,16 +1,6 @@ -"use client"; +"use server"; -import { observer } from "mobx-react"; -import Image from "next/image"; -import useSWR from "swr"; -// components -import { LogoSpinner } from "@/components/common"; -import { IssuesNavbarRoot } from "@/components/issues"; -import { SomethingWentWrongError } from "@/components/issues/issue-layouts/error"; -// hooks -import { useIssueFilter, usePublish, usePublishList } from "@/hooks/store"; -// assets -import planeLogo from "@/public/plane-logo.svg"; +import { IssuesClientLayout } from "./client-layout"; type Props = { children: React.ReactNode; @@ -19,58 +9,22 @@ type Props = { }; }; -const IssuesLayout = observer((props: Props) => { - const { children, params } = props; - // params +export async function generateMetadata({ params }: Props) { const { anchor } = params; - // store hooks - const { fetchPublishSettings } = usePublishList(); - const publishSettings = usePublish(anchor); - const { updateLayoutOptions } = useIssueFilter(); - // fetch publish settings - const { error } = useSWR( - anchor ? `PUBLISH_SETTINGS_${anchor}` : null, - anchor - ? async () => { - const response = await fetchPublishSettings(anchor); - if (response.view_props) { - updateLayoutOptions({ - list: !!response.view_props.list, - kanban: !!response.view_props.kanban, - calendar: !!response.view_props.calendar, - gantt: !!response.view_props.gantt, - spreadsheet: !!response.view_props.spreadsheet, - }); - } - } - : null - ); - - if (!publishSettings && !error) return ; - - if (error) return ; + const DEFAULT_TITLE = "Plane"; + const DEFAULT_DESCRIPTION = "Made with Plane, an AI-powered work management platform with publishing capabilities."; + try { + const response = await fetch(`${process.env.NEXT_PUBLIC_API_BASE_URL}/api/public/anchor/${anchor}/meta/`); + const data = await response.json(); + return { title: data?.name || DEFAULT_TITLE, description: data?.description || DEFAULT_DESCRIPTION }; + } catch { + return { title: DEFAULT_TITLE, description: DEFAULT_DESCRIPTION }; + } +} - return ( - - ); -}); +export default async function IssuesLayout(props: Props) { + const { children, params } = props; + const { anchor } = params; -export default IssuesLayout; + return {children}; +} diff --git a/space/app/layout.tsx b/space/app/layout.tsx index ca6d11ea167..e457ae5d1d1 100644 --- a/space/app/layout.tsx +++ b/space/app/layout.tsx @@ -1,12 +1,10 @@ import { Metadata } from "next"; // helpers -import { ASSET_PREFIX } from "@/helpers/common.helper"; -// components -import { InstanceProvider } from "@/lib/instance-provider"; -import { StoreProvider } from "@/lib/store-provider"; +import { SPACE_BASE_PATH } from "@plane/constants"; // styles import "@/styles/globals.css"; -import { ToastProvider } from "@/lib/toast-provider"; +// components +import { AppProvider } from "./provider"; export const metadata: Metadata = { title: "Plane Publish | Make your Plane boards public with one-click", @@ -27,18 +25,14 @@ export default function RootLayout({ children }: { children: React.ReactNode }) return ( - - - - - + + + + + - - - {children} - - + {children} ); diff --git a/space/app/provider.tsx b/space/app/provider.tsx new file mode 100644 index 00000000000..c3ab6673f5a --- /dev/null +++ b/space/app/provider.tsx @@ -0,0 +1,23 @@ +"use client"; + +import { FC, ReactNode } from "react"; +// components +import { InstanceProvider } from "@/lib/instance-provider"; +import { StoreProvider } from "@/lib/store-provider"; +import { ToastProvider } from "@/lib/toast-provider"; + +interface IAppProvider { + children: ReactNode; +} + +export const AppProvider: FC = (props) => { + const { children } = props; + + return ( + + + {children} + + + ); +}; diff --git a/space/app/views/[anchor]/layout.tsx b/space/app/views/[anchor]/layout.tsx index cf7643bb607..6f286efe2e8 100644 --- a/space/app/views/[anchor]/layout.tsx +++ b/space/app/views/[anchor]/layout.tsx @@ -1,7 +1,6 @@ "use client"; import { observer } from "mobx-react"; -import Image from "next/image"; import useSWR from "swr"; // components import { LogoSpinner } from "@/components/common"; @@ -11,8 +10,6 @@ import { usePublish, usePublishList } from "@/hooks/store"; // Plane web import { ViewNavbarRoot } from "@/plane-web/components/navbar"; import { useView } from "@/plane-web/hooks/store"; -// assets -import planeLogo from "@/public/plane-logo.svg"; type Props = { children: React.ReactNode; @@ -53,19 +50,6 @@ const IssuesLayout = observer((props: Props) => {
{children}
- -
- Plane logo -
-
- Powered by Plane Publish -
-
); }); diff --git a/space/core/components/account/auth-forms/password.tsx b/space/core/components/account/auth-forms/password.tsx index 3d87cded59c..5f0384f9bbc 100644 --- a/space/core/components/account/auth-forms/password.tsx +++ b/space/core/components/account/auth-forms/password.tsx @@ -3,11 +3,11 @@ import React, { useEffect, useMemo, useRef, useState } from "react"; import { observer } from "mobx-react"; import { Eye, EyeOff, XCircle } from "lucide-react"; +import { API_BASE_URL } from "@plane/constants"; import { Button, Input, Spinner } from "@plane/ui"; // components import { PasswordStrengthMeter } from "@/components/account"; // helpers -import { API_BASE_URL } from "@/helpers/common.helper"; import { E_PASSWORD_STRENGTH, getPasswordStrength } from "@/helpers/password.helper"; // services import { AuthService } from "@/services/auth.service"; diff --git a/space/core/components/account/auth-forms/unique-code.tsx b/space/core/components/account/auth-forms/unique-code.tsx index 10c7b4f00a1..f16796d0589 100644 --- a/space/core/components/account/auth-forms/unique-code.tsx +++ b/space/core/components/account/auth-forms/unique-code.tsx @@ -2,9 +2,8 @@ import React, { useEffect, useState } from "react"; import { CircleCheck, XCircle } from "lucide-react"; +import { API_BASE_URL } from "@plane/constants"; import { Button, Input, Spinner } from "@plane/ui"; -// helpers -import { API_BASE_URL } from "@/helpers/common.helper"; // hooks import useTimer from "@/hooks/use-timer"; // services diff --git a/space/core/components/account/oauth/github-button.tsx b/space/core/components/account/oauth/github-button.tsx index ba65f38c4d0..eaa83ebbbd4 100644 --- a/space/core/components/account/oauth/github-button.tsx +++ b/space/core/components/account/oauth/github-button.tsx @@ -2,8 +2,7 @@ import { FC } from "react"; import { useSearchParams } from "next/navigation"; import Image from "next/image"; import { useTheme } from "next-themes"; -// helpers -import { API_BASE_URL } from "@/helpers/common.helper"; +import { API_BASE_URL } from "@plane/constants"; // images import githubLightModeImage from "/public/logos/github-black.png"; import githubDarkModeImage from "/public/logos/github-dark.svg"; diff --git a/space/core/components/account/oauth/gitlab-button.tsx b/space/core/components/account/oauth/gitlab-button.tsx index 072a2f628cd..ba1880ae97f 100644 --- a/space/core/components/account/oauth/gitlab-button.tsx +++ b/space/core/components/account/oauth/gitlab-button.tsx @@ -2,8 +2,7 @@ import { FC } from "react"; import { useSearchParams } from "next/navigation"; import Image from "next/image"; import { useTheme } from "next-themes"; -// helpers -import { API_BASE_URL } from "@/helpers/common.helper"; +import { API_BASE_URL } from "@plane/constants"; // images import GitlabLogo from "/public/logos/gitlab-logo.svg"; diff --git a/space/core/components/account/oauth/google-button.tsx b/space/core/components/account/oauth/google-button.tsx index 179b1c35ad1..dc28bdae489 100644 --- a/space/core/components/account/oauth/google-button.tsx +++ b/space/core/components/account/oauth/google-button.tsx @@ -2,8 +2,7 @@ import { FC } from "react"; import { useSearchParams } from "next/navigation"; import Image from "next/image"; import { useTheme } from "next-themes"; -// helpers -import { API_BASE_URL } from "@/helpers/common.helper"; +import { API_BASE_URL } from "@plane/constants"; // images import GoogleLogo from "/public/logos/google-logo.svg"; diff --git a/space/core/components/common/index.ts b/space/core/components/common/index.ts index 1949c069bef..0a63ca1ac8b 100644 --- a/space/core/components/common/index.ts +++ b/space/core/components/common/index.ts @@ -1,2 +1,3 @@ export * from "./project-logo"; export * from "./logo-spinner"; +export * from "./powered-by"; diff --git a/space/core/components/common/powered-by.tsx b/space/core/components/common/powered-by.tsx new file mode 100644 index 00000000000..654089c55c3 --- /dev/null +++ b/space/core/components/common/powered-by.tsx @@ -0,0 +1,34 @@ +"use client"; + +import { FC } from "react"; +import Image from "next/image"; +import { WEBSITE_URL } from "@plane/constants"; +// assets +import planeLogo from "@/public/plane-logo.svg"; + +type TPoweredBy = { + disabled?: boolean; +}; + +export const PoweredBy: FC = (props) => { + // props + const { disabled = false } = props; + + if (disabled || !WEBSITE_URL) return null; + + return ( + +
+ Plane logo +
+
+ Powered by Plane Publish +
+
+ ); +}; diff --git a/space/core/components/issues/navbar/user-avatar.tsx b/space/core/components/issues/navbar/user-avatar.tsx index 40339bb5c04..4c41677fc7e 100644 --- a/space/core/components/issues/navbar/user-avatar.tsx +++ b/space/core/components/issues/navbar/user-avatar.tsx @@ -7,9 +7,9 @@ import { usePathname, useSearchParams } from "next/navigation"; import { usePopper } from "react-popper"; import { LogOut } from "lucide-react"; import { Popover, Transition } from "@headlessui/react"; +import { API_BASE_URL } from "@plane/constants"; import { Avatar, Button } from "@plane/ui"; // helpers -import { API_BASE_URL } from "@/helpers/common.helper"; import { getFileURL } from "@/helpers/file.helper"; import { queryParamGenerator } from "@/helpers/query-param-generator"; // hooks diff --git a/space/core/components/views/auth.tsx b/space/core/components/views/auth.tsx index 2c5a8a2f4de..d9dbbb3bc40 100644 --- a/space/core/components/views/auth.tsx +++ b/space/core/components/views/auth.tsx @@ -4,15 +4,14 @@ import { observer } from "mobx-react"; import Image from "next/image"; import Link from "next/link"; import { useTheme } from "next-themes"; +import { SPACE_BASE_PATH } from "@plane/constants"; // components import { AuthRoot } from "@/components/account"; -// helpers -import { SPACE_BASE_PATH } from "@/helpers/common.helper"; // images import PlaneBackgroundPatternDark from "@/public/auth/background-pattern-dark.svg"; import PlaneBackgroundPattern from "@/public/auth/background-pattern.svg"; -import BlackHorizontalLogo from "public/plane-logos/black-horizontal-with-blue-logo.png"; -import WhiteHorizontalLogo from "public/plane-logos/white-horizontal-with-blue-logo.png"; +import BlackHorizontalLogo from "@/public/plane-logos/black-horizontal-with-blue-logo.png"; +import WhiteHorizontalLogo from "@/public/plane-logos/white-horizontal-with-blue-logo.png"; export const AuthView = observer(() => { // hooks diff --git a/space/core/lib/instance-provider.tsx b/space/core/lib/instance-provider.tsx index 4f28dbcf9b5..a09e5f9a6c4 100644 --- a/space/core/lib/instance-provider.tsx +++ b/space/core/lib/instance-provider.tsx @@ -6,18 +6,17 @@ import Image from "next/image"; import Link from "next/link"; import { useTheme } from "next-themes"; import useSWR from "swr"; +import { SPACE_BASE_PATH } from "@plane/constants"; // components -import { LogoSpinner } from "@/components/common"; +import { LogoSpinner, PoweredBy } from "@/components/common"; import { InstanceFailureView } from "@/components/instance"; -// helpers -import { SPACE_BASE_PATH } from "@/helpers/common.helper"; // hooks import { useInstance, useUser } from "@/hooks/store"; // assets -import PlaneBackgroundPatternDark from "public/auth/background-pattern-dark.svg"; -import PlaneBackgroundPattern from "public/auth/background-pattern.svg"; -import BlackHorizontalLogo from "public/plane-logos/black-horizontal-with-blue-logo.png"; -import WhiteHorizontalLogo from "public/plane-logos/white-horizontal-with-blue-logo.png"; +import PlaneBackgroundPatternDark from "@/public/auth/background-pattern-dark.svg"; +import PlaneBackgroundPattern from "@/public/auth/background-pattern.svg"; +import BlackHorizontalLogo from "@/public/plane-logos/black-horizontal-with-blue-logo.png"; +import WhiteHorizontalLogo from "@/public/plane-logos/white-horizontal-with-blue-logo.png"; export const InstanceProvider = observer(({ children }: { children: ReactNode }) => { const { fetchInstanceInfo, instance, error } = useInstance(); @@ -69,5 +68,10 @@ export const InstanceProvider = observer(({ children }: { children: ReactNode }) ); } - return <>{children}; + return ( + <> + {children} + + + ); }); diff --git a/space/core/lib/store-provider.tsx b/space/core/lib/store-provider.tsx index c1256ddc29b..b810c10562f 100644 --- a/space/core/lib/store-provider.tsx +++ b/space/core/lib/store-provider.tsx @@ -9,13 +9,8 @@ let rootStore = new RootStore(); export const StoreContext = createContext(rootStore); -function initializeStore(initialData = {}) { +function initializeStore() { const singletonRootStore = rootStore ?? new RootStore(); - // If your page has Next.js data fetching methods that use a Mobx store, it will - // get hydrated here, check `pages/ssg.js` and `pages/ssr.js` for more details - if (initialData) { - singletonRootStore.hydrate(initialData); - } // For SSG and SSR always create a new store if (typeof window === "undefined") return singletonRootStore; // Create the store once in the client @@ -29,8 +24,14 @@ export type StoreProviderProps = { initialState?: any; }; -export const StoreProvider = ({ children, initialState = {} }: StoreProviderProps) => { - const store = initializeStore(initialState); +export const StoreProvider = ({ children, initialState = undefined }: StoreProviderProps) => { + const store = initializeStore(); + // If your page has Next.js data fetching methods that use a Mobx store, it will + // get hydrated here, check `pages/ssg.js` and `pages/ssr.js` for more details + if (initialState) { + store.hydrate(initialState); + } + return ( {children} diff --git a/space/core/services/auth.service.ts b/space/core/services/auth.service.ts index 060da53f4a0..3bbfd149e62 100644 --- a/space/core/services/auth.service.ts +++ b/space/core/services/auth.service.ts @@ -1,5 +1,4 @@ -// helpers -import { API_BASE_URL } from "@/helpers/common.helper"; +import { API_BASE_URL } from "@plane/constants"; // services import { APIService } from "@/services/api.service"; // types diff --git a/space/core/services/cycle.service.ts b/space/core/services/cycle.service.ts index 6df75ebde12..7d4ff9a10fd 100644 --- a/space/core/services/cycle.service.ts +++ b/space/core/services/cycle.service.ts @@ -1,5 +1,7 @@ -import { API_BASE_URL } from "@/helpers/common.helper"; +import { API_BASE_URL } from "@plane/constants"; +// services import { APIService } from "@/services/api.service"; +// types import { TPublicCycle } from "@/types/cycle"; export class CycleService extends APIService { diff --git a/space/core/services/file.service.ts b/space/core/services/file.service.ts index 168738804e2..01986a1b4be 100644 --- a/space/core/services/file.service.ts +++ b/space/core/services/file.service.ts @@ -1,7 +1,6 @@ -// plane types import { TFileEntityInfo, TFileSignedURLResponse } from "@plane/types"; +import { API_BASE_URL } from "@plane/constants"; // helpers -import { API_BASE_URL } from "@/helpers/common.helper"; import { generateFileUploadPayload, getAssetIdFromUrl, getFileMetaDataForUpload } from "@/helpers/file.helper"; // services import { APIService } from "@/services/api.service"; diff --git a/space/core/services/instance.service.ts b/space/core/services/instance.service.ts index a11599b0c73..03cb1a73e80 100644 --- a/space/core/services/instance.service.ts +++ b/space/core/services/instance.service.ts @@ -1,7 +1,5 @@ -// types import type { IInstanceInfo } from "@plane/types"; -// helpers -import { API_BASE_URL } from "@/helpers/common.helper"; +import { API_BASE_URL } from "@plane/constants"; // services import { APIService } from "@/services/api.service"; diff --git a/space/core/services/issue.service.ts b/space/core/services/issue.service.ts index b5ecb807782..8ec67ee45f9 100644 --- a/space/core/services/issue.service.ts +++ b/space/core/services/issue.service.ts @@ -1,4 +1,4 @@ -import { API_BASE_URL } from "@/helpers/common.helper"; +import { API_BASE_URL } from "@plane/constants"; // services import { APIService } from "@/services/api.service"; // types diff --git a/space/core/services/label.service.ts b/space/core/services/label.service.ts index 2a2ee5ad979..c2343160527 100644 --- a/space/core/services/label.service.ts +++ b/space/core/services/label.service.ts @@ -1,5 +1,6 @@ import { IIssueLabel } from "@plane/types"; -import { API_BASE_URL } from "@/helpers/common.helper"; +import { API_BASE_URL } from "@plane/constants"; +// services import { APIService } from "./api.service"; export class LabelService extends APIService { diff --git a/space/core/services/member.service.ts b/space/core/services/member.service.ts index 02cd1f77620..9de19455b16 100644 --- a/space/core/services/member.service.ts +++ b/space/core/services/member.service.ts @@ -1,5 +1,7 @@ -import { API_BASE_URL } from "@/helpers/common.helper"; +import { API_BASE_URL } from "@plane/constants"; +// services import { APIService } from "@/services/api.service"; +// types import { TPublicMember } from "@/types/member"; export class MemberService extends APIService { diff --git a/space/core/services/module.service.ts b/space/core/services/module.service.ts index f89202b6b6c..30d6ebecf17 100644 --- a/space/core/services/module.service.ts +++ b/space/core/services/module.service.ts @@ -1,5 +1,7 @@ -import { API_BASE_URL } from "@/helpers/common.helper"; +import { API_BASE_URL } from "@plane/constants"; +// services import { APIService } from "@/services/api.service"; +// types import { TPublicModule } from "@/types/modules"; export class ModuleService extends APIService { diff --git a/space/core/services/project-member.service.ts b/space/core/services/project-member.service.ts index 722380efafe..9bbdb3ad2d4 100644 --- a/space/core/services/project-member.service.ts +++ b/space/core/services/project-member.service.ts @@ -1,6 +1,5 @@ -// types import type { IProjectMember, IProjectMembership } from "@plane/types"; -import { API_BASE_URL } from "@/helpers/common.helper"; +import { API_BASE_URL } from "@plane/constants"; // services import { APIService } from "@/services/api.service"; diff --git a/space/core/services/publish.service.ts b/space/core/services/publish.service.ts index 896f36ee991..fd8e8e78698 100644 --- a/space/core/services/publish.service.ts +++ b/space/core/services/publish.service.ts @@ -1,7 +1,5 @@ -// types import { TProjectPublishSettings } from "@plane/types"; -// helpers -import { API_BASE_URL } from "@/helpers/common.helper"; +import { API_BASE_URL } from "@plane/constants"; // services import { APIService } from "@/services/api.service"; diff --git a/space/core/services/state.service.ts b/space/core/services/state.service.ts index 153f965280d..7278f1a8dc4 100644 --- a/space/core/services/state.service.ts +++ b/space/core/services/state.service.ts @@ -1,5 +1,6 @@ import { IState } from "@plane/types"; -import { API_BASE_URL } from "@/helpers/common.helper"; +import { API_BASE_URL } from "@plane/constants"; +// services import { APIService } from "./api.service"; export class StateService extends APIService { diff --git a/space/core/services/user.service.ts b/space/core/services/user.service.ts index 1aeb134668a..a97a8f24b2b 100644 --- a/space/core/services/user.service.ts +++ b/space/core/services/user.service.ts @@ -1,7 +1,5 @@ -// types import { IUser, TUserProfile } from "@plane/types"; -// helpers -import { API_BASE_URL } from "@/helpers/common.helper"; +import { API_BASE_URL } from "@plane/constants"; // services import { APIService } from "@/services/api.service"; diff --git a/space/helpers/common.helper.ts b/space/helpers/common.helper.ts index 6db73a4a100..3ffc59573c5 100644 --- a/space/helpers/common.helper.ts +++ b/space/helpers/common.helper.ts @@ -1,21 +1,8 @@ import { clsx, type ClassValue } from "clsx"; 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 SUPPORT_EMAIL = process.env.NEXT_PUBLIC_SUPPORT_EMAIL || ""; -export const WEB_BASE_URL = process.env.NEXT_PUBLIC_WEB_BASE_URL || ""; - -export const GOD_MODE_URL = encodeURI(`${ADMIN_BASE_URL}${ADMIN_BASE_PATH}`); - -export const ASSET_PREFIX = SPACE_BASE_PATH; - export const cn = (...inputs: ClassValue[]) => twMerge(clsx(inputs)); export const resolveGeneralTheme = (resolvedTheme: string | undefined) => diff --git a/space/helpers/file.helper.ts b/space/helpers/file.helper.ts index b149ebc7cf0..452bfd6f4eb 100644 --- a/space/helpers/file.helper.ts +++ b/space/helpers/file.helper.ts @@ -1,7 +1,5 @@ -// plane types import { TFileMetaDataLite, TFileSignedURLResponse } from "@plane/types"; -// helpers -import { API_BASE_URL } from "@/helpers/common.helper"; +import { API_BASE_URL } from "@plane/constants"; /** * @description from the provided signed URL response, generate a payload to be used to upload the file diff --git a/space/next.config.js b/space/next.config.js index d18ce805f4d..58b6cfa0be8 100644 --- a/space/next.config.js +++ b/space/next.config.js @@ -1,3 +1,4 @@ +// eslint-disable-next-line @typescript-eslint/no-var-requires /* eslint-disable @typescript-eslint/no-var-requires */ /** @type {import('next').NextConfig} */ require("dotenv").config({ path: ".env" }); @@ -28,7 +29,6 @@ const nextConfig = { }, }; - const sentryConfig = { // For all available options, see: // https://github.com/getsentry/sentry-webpack-plugin#options @@ -62,12 +62,10 @@ const sentryConfig = { // https://docs.sentry.io/product/crons/ // https://vercel.com/docs/cron-jobs automaticVercelMonitors: true, -} - +}; if (parseInt(process.env.SENTRY_MONITORING_ENABLED || "0", 10)) { module.exports = withSentryConfig(nextConfig, sentryConfig); } else { module.exports = nextConfig; } -