forked from github/plane
Compare commits
3 Commits
preview
...
Update-Bui
Author | SHA1 | Date | |
---|---|---|---|
|
260b752ae4 | ||
|
b0eee08499 | ||
|
a718056b93 |
@ -8,7 +8,6 @@
|
||||
"packages/*"
|
||||
],
|
||||
"scripts": {
|
||||
"prepare": "husky install",
|
||||
"build": "turbo run build",
|
||||
"dev": "turbo run dev",
|
||||
"start": "turbo run start",
|
||||
|
@ -4,6 +4,8 @@ import { useRouter } from "next/router";
|
||||
|
||||
import useSWRInfinite from "swr/infinite";
|
||||
|
||||
import getConfig from "next/config";
|
||||
|
||||
// services
|
||||
import projectService from "services/project.service";
|
||||
// ui
|
||||
@ -31,11 +33,13 @@ export const SelectRepository: React.FC<Props> = ({
|
||||
const router = useRouter();
|
||||
const { workspaceSlug } = router.query;
|
||||
|
||||
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
|
||||
|
||||
const getKey = (pageIndex: number) => {
|
||||
if (!workspaceSlug || !integration) return;
|
||||
|
||||
return `${
|
||||
process.env.NEXT_PUBLIC_API_BASE_URL
|
||||
NEXT_PUBLIC_API_BASE_URL
|
||||
}/api/workspaces/${workspaceSlug}/workspace-integrations/${
|
||||
integration.id
|
||||
}/github-repositories/?page=${++pageIndex}`;
|
||||
|
@ -6,6 +6,7 @@ import { Controller, useForm } from "react-hook-form";
|
||||
// headless ui
|
||||
import { Dialog, Transition } from "@headlessui/react";
|
||||
// ui components
|
||||
import getConfig from "next/config";
|
||||
import {
|
||||
ToggleSwitch,
|
||||
PrimaryButton,
|
||||
@ -63,9 +64,11 @@ export const PublishProjectModal: React.FC<Props> = observer(() => {
|
||||
const [isUnpublishing, setIsUnpublishing] = useState(false);
|
||||
const [isUpdateRequired, setIsUpdateRequired] = useState(false);
|
||||
|
||||
const plane_deploy_url = process.env.NEXT_PUBLIC_DEPLOY_URL ?? "http://localhost:4000";
|
||||
const { publicRuntimeConfig: { NEXT_PUBLIC_DEPLOY_URL } } = getConfig();
|
||||
|
||||
const router = useRouter();
|
||||
const plane_deploy_url = NEXT_PUBLIC_DEPLOY_URL ?? "http://localhost:4000";
|
||||
|
||||
const router = useRouter()
|
||||
const { workspaceSlug } = router.query;
|
||||
|
||||
const store: RootStore = useMobxStore();
|
||||
|
@ -8,6 +8,8 @@ import { Tooltip } from "components/ui";
|
||||
// hooks
|
||||
import useProjectDetails from "hooks/use-project-details";
|
||||
|
||||
import getConfig from "next/config";
|
||||
|
||||
type Props = {
|
||||
breadcrumbs?: JSX.Element;
|
||||
left?: JSX.Element;
|
||||
@ -16,7 +18,7 @@ type Props = {
|
||||
noHeader: boolean;
|
||||
};
|
||||
|
||||
const { NEXT_PUBLIC_DEPLOY_URL } = process.env;
|
||||
const { publicRuntimeConfig: { NEXT_PUBLIC_DEPLOY_URL } } = getConfig();
|
||||
const plane_deploy_url = NEXT_PUBLIC_DEPLOY_URL ? NEXT_PUBLIC_DEPLOY_URL : "http://localhost:3001";
|
||||
|
||||
const Header: React.FC<Props> = ({ breadcrumbs, left, right, setToggleSidebar, noHeader }) => {
|
||||
|
@ -1,4 +1,5 @@
|
||||
// cookies
|
||||
import getConfig from "next/config";
|
||||
import { convertCookieStringToObject } from "./cookie";
|
||||
// types
|
||||
import type { IProjectMember, IUser, IWorkspace, IWorkspaceMember } from "types";
|
||||
@ -9,7 +10,9 @@ export const requiredAuth = async (cookie?: string) => {
|
||||
|
||||
if (!token) return null;
|
||||
|
||||
const baseUrl = process.env.NEXT_PUBLIC_API_BASE_URL || "https://api.plane.so";
|
||||
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
|
||||
|
||||
const baseUrl = NEXT_PUBLIC_API_BASE_URL || "https://api.plane.so";
|
||||
|
||||
let user: IUser | null = null;
|
||||
|
||||
@ -41,7 +44,9 @@ export const requiredAdmin = async (workspaceSlug: string, projectId: string, co
|
||||
const cookies = convertCookieStringToObject(cookie);
|
||||
const token = cookies?.accessToken;
|
||||
|
||||
const baseUrl = process.env.NEXT_PUBLIC_API_BASE_URL || "https://api.plane.so";
|
||||
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
|
||||
|
||||
const baseUrl = NEXT_PUBLIC_API_BASE_URL || "https://api.plane.so";
|
||||
|
||||
let memberDetail: IProjectMember | null = null;
|
||||
|
||||
@ -75,7 +80,9 @@ export const requiredWorkspaceAdmin = async (workspaceSlug: string, cookie?: str
|
||||
const cookies = convertCookieStringToObject(cookie);
|
||||
const token = cookies?.accessToken;
|
||||
|
||||
const baseUrl = process.env.NEXT_PUBLIC_API_BASE_URL || "https://api.plane.so";
|
||||
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
|
||||
|
||||
const baseUrl = NEXT_PUBLIC_API_BASE_URL || "https://api.plane.so";
|
||||
|
||||
let memberDetail: IWorkspaceMember | null = null;
|
||||
|
||||
@ -119,7 +126,8 @@ export const homePageRedirect = async (cookie?: string) => {
|
||||
|
||||
let workspaces: IWorkspace[] = [];
|
||||
|
||||
const baseUrl = process.env.NEXT_PUBLIC_API_BASE_URL || "https://api.plane.so";
|
||||
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
|
||||
const baseUrl = NEXT_PUBLIC_API_BASE_URL || "https://api.plane.so";
|
||||
|
||||
const cookies = convertCookieStringToObject(cookie);
|
||||
const token = cookies?.accessToken;
|
||||
|
@ -9,6 +9,10 @@ const extraImageDomains = (process.env.NEXT_PUBLIC_EXTRA_IMAGE_DOMAINS ?? "")
|
||||
const nextConfig = {
|
||||
reactStrictMode: false,
|
||||
swcMinify: true,
|
||||
publicRuntimeConfig: {
|
||||
NEXT_PUBLIC_DEPLOY_URL: process.env.NEXT_PUBLIC_DEPLOY_URL,
|
||||
NEXT_PUBLIC_API_BASE_URL: process.env.NEXT_PUBLIC_API_BASE_URL
|
||||
},
|
||||
images: {
|
||||
domains: [
|
||||
"vinci-web.s3.amazonaws.com",
|
||||
|
@ -2,6 +2,7 @@
|
||||
import Head from "next/head";
|
||||
import dynamic from "next/dynamic";
|
||||
import Router from "next/router";
|
||||
import App, { AppContext, AppProps } from 'next/app'
|
||||
|
||||
// themes
|
||||
import { ThemeProvider } from "next-themes";
|
||||
@ -20,8 +21,6 @@ import NProgress from "nprogress";
|
||||
import { UserProvider } from "contexts/user.context";
|
||||
import { ToastContextProvider } from "contexts/toast.context";
|
||||
import { ThemeContextProvider } from "contexts/theme.context";
|
||||
// types
|
||||
import type { AppProps } from "next/app";
|
||||
// constants
|
||||
import { THEMES } from "constants/themes";
|
||||
// constants
|
||||
@ -45,6 +44,12 @@ Router.events.on("routeChangeStart", NProgress.start);
|
||||
Router.events.on("routeChangeError", NProgress.done);
|
||||
Router.events.on("routeChangeComplete", NProgress.done);
|
||||
|
||||
MyApp.getInitialProps = async (appContext: AppContext) => {
|
||||
const appProps = await App.getInitialProps(appContext)
|
||||
|
||||
return { ...appProps }
|
||||
}
|
||||
|
||||
function MyApp({ Component, pageProps }: AppProps) {
|
||||
return (
|
||||
// <UserProvider>
|
||||
|
@ -29,6 +29,7 @@ import { useMobxStore } from "lib/mobx/store-provider";
|
||||
// next themes
|
||||
import { useTheme } from "next-themes";
|
||||
import { IUser } from "types";
|
||||
import getConfig from "next/config";
|
||||
|
||||
// types
|
||||
type EmailPasswordFormValues = {
|
||||
@ -41,6 +42,10 @@ const HomePage: NextPage = observer(() => {
|
||||
const store: any = useMobxStore();
|
||||
const { setTheme } = useTheme();
|
||||
|
||||
const {
|
||||
publicRuntimeConfig: { PROJECT_API },
|
||||
} = getConfig()
|
||||
|
||||
const { isLoading, mutateUser } = useUserAuth("sign-in");
|
||||
|
||||
const { setToastAlert } = useToast();
|
||||
@ -176,7 +181,7 @@ const HomePage: NextPage = observer(() => {
|
||||
{parseInt(process.env.NEXT_PUBLIC_ENABLE_OAUTH || "0") ? (
|
||||
<>
|
||||
<h1 className="text-center text-2xl sm:text-2.5xl font-semibold text-custom-text-100">
|
||||
Sign in to Plane
|
||||
{ `Sign in to ${PROJECT_API} Plane` }
|
||||
</h1>
|
||||
<div className="flex flex-col divide-y divide-custom-border-200">
|
||||
<div className="pb-7">
|
||||
|
@ -1,11 +1,12 @@
|
||||
// services
|
||||
import getConfig from "next/config";
|
||||
import APIService from "services/api.service";
|
||||
import trackEventServices from "services/track-event.service";
|
||||
|
||||
// types
|
||||
import { ICurrentUserResponse, IGptResponse } from "types";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
|
||||
|
||||
const trackEvent =
|
||||
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";
|
||||
|
@ -9,7 +9,8 @@ import {
|
||||
ISaveAnalyticsFormData,
|
||||
} from "types";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
import getConfig from "next/config";
|
||||
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
|
||||
|
||||
class AnalyticsServices extends APIService {
|
||||
constructor() {
|
||||
|
@ -2,7 +2,8 @@
|
||||
import axios from "axios";
|
||||
import APIService from "services/api.service";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
import getConfig from "next/config";
|
||||
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
|
||||
|
||||
class AppInstallationsService extends APIService {
|
||||
constructor() {
|
||||
|
@ -2,7 +2,8 @@
|
||||
import APIService from "services/api.service";
|
||||
import { ICurrentUserResponse } from "types";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
import getConfig from "next/config";
|
||||
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
|
||||
|
||||
class AuthService extends APIService {
|
||||
constructor() {
|
||||
|
@ -5,7 +5,8 @@ import trackEventServices from "services/track-event.service";
|
||||
// types
|
||||
import type { CycleDateCheckData, ICurrentUserResponse, ICycle, IIssue } from "types";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
import getConfig from "next/config";
|
||||
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
|
||||
|
||||
const trackEvent =
|
||||
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";
|
||||
|
@ -4,7 +4,8 @@ import APIService from "services/api.service";
|
||||
import type { ICurrentUserResponse, IEstimate, IEstimateFormData } from "types";
|
||||
import trackEventServices from "services/track-event.service";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
import getConfig from "next/config";
|
||||
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
|
||||
|
||||
const trackEvent =
|
||||
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";
|
||||
|
@ -1,7 +1,8 @@
|
||||
// services
|
||||
import APIService from "services/api.service";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
import getConfig from "next/config";
|
||||
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
|
||||
|
||||
interface UnSplashImage {
|
||||
id: string;
|
||||
|
@ -1,7 +1,8 @@
|
||||
import APIService from "services/api.service";
|
||||
import trackEventServices from "services/track-event.service";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
import getConfig from "next/config";
|
||||
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
|
||||
|
||||
const trackEvent =
|
||||
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";
|
||||
|
@ -3,7 +3,8 @@ import trackEventServices from "services/track-event.service";
|
||||
|
||||
import { ICurrentUserResponse } from "types";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
import getConfig from "next/config";
|
||||
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
|
||||
|
||||
const trackEvent =
|
||||
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";
|
||||
|
@ -3,7 +3,8 @@ import trackEventServices from "services/track-event.service";
|
||||
|
||||
import { ICurrentUserResponse, IGithubRepoInfo, IGithubServiceImportFormData } from "types";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
import getConfig from "next/config";
|
||||
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
|
||||
|
||||
const trackEvent =
|
||||
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";
|
||||
|
@ -10,7 +10,8 @@ import {
|
||||
IExportServiceResponse,
|
||||
} from "types";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
import getConfig from "next/config";
|
||||
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
|
||||
|
||||
const trackEvent =
|
||||
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";
|
||||
|
@ -4,7 +4,8 @@ import trackEventServices from "services/track-event.service";
|
||||
// types
|
||||
import { IJiraMetadata, IJiraResponse, IJiraImporterForm, ICurrentUserResponse } from "types";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
import getConfig from "next/config";
|
||||
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
|
||||
|
||||
const trackEvent =
|
||||
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";
|
||||
|
@ -12,7 +12,8 @@ import type {
|
||||
ISubIssueResponse,
|
||||
} from "types";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
import getConfig from "next/config";
|
||||
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
|
||||
|
||||
const trackEvent =
|
||||
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";
|
||||
|
@ -5,7 +5,8 @@ import trackEventServices from "./track-event.service";
|
||||
// types
|
||||
import type { IIssueViewOptions, IModule, IIssue, ICurrentUserResponse } from "types";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
import getConfig from "next/config";
|
||||
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
|
||||
|
||||
const trackEvent =
|
||||
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";
|
||||
|
@ -1,7 +1,8 @@
|
||||
// services
|
||||
import APIService from "services/api.service";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
import getConfig from "next/config";
|
||||
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
|
||||
|
||||
// types
|
||||
import type {
|
||||
|
@ -5,7 +5,8 @@ import trackEventServices from "services/track-event.service";
|
||||
// types
|
||||
import { IPage, IPageBlock, RecentPagesResponse, IIssue, ICurrentUserResponse } from "types";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
import getConfig from "next/config";
|
||||
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
|
||||
|
||||
const trackEvent =
|
||||
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";
|
||||
|
@ -5,7 +5,8 @@ import trackEventServices from "services/track-event.service";
|
||||
import { ICurrentUserResponse } from "types";
|
||||
import { IProjectPublishSettings } from "store/project-publish";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
import getConfig from "next/config";
|
||||
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
|
||||
|
||||
const trackEvent =
|
||||
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";
|
||||
|
@ -16,7 +16,8 @@ import type {
|
||||
TProjectIssuesSearchParams,
|
||||
} from "types";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
import getConfig from "next/config";
|
||||
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
|
||||
|
||||
const trackEvent =
|
||||
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";
|
||||
|
@ -11,7 +11,8 @@ import type {
|
||||
IssueCommentReactionForm,
|
||||
} from "types";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
import getConfig from "next/config";
|
||||
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
|
||||
|
||||
const trackEvent =
|
||||
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";
|
||||
|
@ -2,7 +2,8 @@
|
||||
import APIService from "services/api.service";
|
||||
import trackEventServices from "services/track-event.service";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
import getConfig from "next/config";
|
||||
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
|
||||
|
||||
const trackEvent =
|
||||
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";
|
||||
|
@ -12,7 +12,8 @@ import type {
|
||||
IUserWorkspaceDashboard,
|
||||
} from "types";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
import getConfig from "next/config";
|
||||
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
|
||||
|
||||
const trackEvent =
|
||||
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";
|
||||
|
@ -6,7 +6,8 @@ import { ICurrentUserResponse } from "types";
|
||||
// types
|
||||
import { IView } from "types/views";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
import getConfig from "next/config";
|
||||
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
|
||||
|
||||
const trackEvent =
|
||||
process.env.NEXT_PUBLIC_TRACK_EVENTS === "true" || process.env.NEXT_PUBLIC_TRACK_EVENTS === "1";
|
||||
|
@ -2,7 +2,8 @@
|
||||
import APIService from "services/api.service";
|
||||
import trackEventServices from "services/track-event.service";
|
||||
|
||||
const { NEXT_PUBLIC_API_BASE_URL } = process.env;
|
||||
import getConfig from "next/config";
|
||||
const { publicRuntimeConfig: { NEXT_PUBLIC_API_BASE_URL } } = getConfig();
|
||||
|
||||
// types
|
||||
import {
|
||||
|
Loading…
Reference in New Issue
Block a user