[WEB-5136] refactor: update admin ESLint configuration and refactor imports to use type imports (#7955)
- Enhanced ESLint configuration by adding new rules for import consistency and type imports. - Refactored multiple files to replace regular imports with type imports for better clarity and performance. - Ensured consistent use of type imports across the application to align with TypeScript best practices.
This commit is contained in:
parent
ffe38b592a
commit
c80c76b882
54 changed files with 135 additions and 91 deletions
|
|
@ -1,4 +1,18 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
root: true,
|
root: true,
|
||||||
extends: ["@plane/eslint-config/next.js"],
|
extends: ["@plane/eslint-config/next.js"],
|
||||||
|
rules: {
|
||||||
|
"no-duplicate-imports": "off",
|
||||||
|
"import/no-duplicates": ["error", { "prefer-inline": false }],
|
||||||
|
"import/consistent-type-specifier-style": ["error", "prefer-top-level"],
|
||||||
|
"@typescript-eslint/no-import-type-side-effects": "error",
|
||||||
|
"@typescript-eslint/consistent-type-imports": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
prefer: "type-imports",
|
||||||
|
fixStyle: "separate-type-imports",
|
||||||
|
disallowTypeAnnotations: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,13 @@
|
||||||
"use client";
|
"use client";
|
||||||
import { FC } from "react";
|
import type { FC } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
import { Lightbulb } from "lucide-react";
|
import { Lightbulb } from "lucide-react";
|
||||||
import { Button } from "@plane/propel/button";
|
import { Button } from "@plane/propel/button";
|
||||||
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
|
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
|
||||||
import { IFormattedInstanceConfiguration, TInstanceAIConfigurationKeys } from "@plane/types";
|
import type { IFormattedInstanceConfiguration, TInstanceAIConfigurationKeys } from "@plane/types";
|
||||||
// components
|
// components
|
||||||
import { ControllerInput, TControllerInputFormField } from "@/components/common/controller-input";
|
import type { TControllerInputFormField } from "@/components/common/controller-input";
|
||||||
|
import { ControllerInput } from "@/components/common/controller-input";
|
||||||
// hooks
|
// hooks
|
||||||
import { useInstance } from "@/hooks/store";
|
import { useInstance } from "@/hooks/store";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { ReactNode } from "react";
|
import type { ReactNode } from "react";
|
||||||
import { Metadata } from "next";
|
import type { Metadata } from "next";
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: "Artificial Intelligence Settings - God Mode",
|
title: "Artificial Intelligence Settings - God Mode",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { FC, useState } from "react";
|
import type { FC } from "react";
|
||||||
|
import { useState } from "react";
|
||||||
import { isEmpty } from "lodash-es";
|
import { isEmpty } from "lodash-es";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
|
|
@ -9,14 +10,16 @@ import { Monitor } from "lucide-react";
|
||||||
import { API_BASE_URL } from "@plane/constants";
|
import { API_BASE_URL } from "@plane/constants";
|
||||||
import { Button, getButtonStyling } from "@plane/propel/button";
|
import { Button, getButtonStyling } from "@plane/propel/button";
|
||||||
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
|
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
|
||||||
import { IFormattedInstanceConfiguration, TInstanceGithubAuthenticationConfigurationKeys } from "@plane/types";
|
import type { IFormattedInstanceConfiguration, TInstanceGithubAuthenticationConfigurationKeys } from "@plane/types";
|
||||||
|
|
||||||
import { cn } from "@plane/utils";
|
import { cn } from "@plane/utils";
|
||||||
// components
|
// components
|
||||||
import { CodeBlock } from "@/components/common/code-block";
|
import { CodeBlock } from "@/components/common/code-block";
|
||||||
import { ConfirmDiscardModal } from "@/components/common/confirm-discard-modal";
|
import { ConfirmDiscardModal } from "@/components/common/confirm-discard-modal";
|
||||||
import { ControllerInput, TControllerInputFormField } from "@/components/common/controller-input";
|
import type { TControllerInputFormField } from "@/components/common/controller-input";
|
||||||
import { CopyField, TCopyField } from "@/components/common/copy-field";
|
import { ControllerInput } from "@/components/common/controller-input";
|
||||||
|
import type { TCopyField } from "@/components/common/copy-field";
|
||||||
|
import { CopyField } from "@/components/common/copy-field";
|
||||||
// hooks
|
// hooks
|
||||||
import { useInstance } from "@/hooks/store";
|
import { useInstance } from "@/hooks/store";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { ReactNode } from "react";
|
import type { ReactNode } from "react";
|
||||||
import { Metadata } from "next";
|
import type { Metadata } from "next";
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: "GitHub Authentication - God Mode",
|
title: "GitHub Authentication - God Mode",
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import { FC, useState } from "react";
|
import type { FC } from "react";
|
||||||
|
import { useState } from "react";
|
||||||
import { isEmpty } from "lodash-es";
|
import { isEmpty } from "lodash-es";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
|
|
@ -6,13 +7,15 @@ import { useForm } from "react-hook-form";
|
||||||
import { API_BASE_URL } from "@plane/constants";
|
import { API_BASE_URL } from "@plane/constants";
|
||||||
import { Button, getButtonStyling } from "@plane/propel/button";
|
import { Button, getButtonStyling } from "@plane/propel/button";
|
||||||
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
|
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
|
||||||
import { IFormattedInstanceConfiguration, TInstanceGitlabAuthenticationConfigurationKeys } from "@plane/types";
|
import type { IFormattedInstanceConfiguration, TInstanceGitlabAuthenticationConfigurationKeys } from "@plane/types";
|
||||||
import { cn } from "@plane/utils";
|
import { cn } from "@plane/utils";
|
||||||
// components
|
// components
|
||||||
import { CodeBlock } from "@/components/common/code-block";
|
import { CodeBlock } from "@/components/common/code-block";
|
||||||
import { ConfirmDiscardModal } from "@/components/common/confirm-discard-modal";
|
import { ConfirmDiscardModal } from "@/components/common/confirm-discard-modal";
|
||||||
import { ControllerInput, TControllerInputFormField } from "@/components/common/controller-input";
|
import type { TControllerInputFormField } from "@/components/common/controller-input";
|
||||||
import { CopyField, TCopyField } from "@/components/common/copy-field";
|
import { ControllerInput } from "@/components/common/controller-input";
|
||||||
|
import type { TCopyField } from "@/components/common/copy-field";
|
||||||
|
import { CopyField } from "@/components/common/copy-field";
|
||||||
// hooks
|
// hooks
|
||||||
import { useInstance } from "@/hooks/store";
|
import { useInstance } from "@/hooks/store";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { ReactNode } from "react";
|
import type { ReactNode } from "react";
|
||||||
import { Metadata } from "next";
|
import type { Metadata } from "next";
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: "GitLab Authentication - God Mode",
|
title: "GitLab Authentication - God Mode",
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
"use client";
|
"use client";
|
||||||
import { FC, useState } from "react";
|
import type { FC } from "react";
|
||||||
|
import { useState } from "react";
|
||||||
import { isEmpty } from "lodash-es";
|
import { isEmpty } from "lodash-es";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
|
|
@ -8,13 +9,15 @@ import { Monitor } from "lucide-react";
|
||||||
import { API_BASE_URL } from "@plane/constants";
|
import { API_BASE_URL } from "@plane/constants";
|
||||||
import { Button, getButtonStyling } from "@plane/propel/button";
|
import { Button, getButtonStyling } from "@plane/propel/button";
|
||||||
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
|
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
|
||||||
import { IFormattedInstanceConfiguration, TInstanceGoogleAuthenticationConfigurationKeys } from "@plane/types";
|
import type { IFormattedInstanceConfiguration, TInstanceGoogleAuthenticationConfigurationKeys } from "@plane/types";
|
||||||
import { cn } from "@plane/utils";
|
import { cn } from "@plane/utils";
|
||||||
// components
|
// components
|
||||||
import { CodeBlock } from "@/components/common/code-block";
|
import { CodeBlock } from "@/components/common/code-block";
|
||||||
import { ConfirmDiscardModal } from "@/components/common/confirm-discard-modal";
|
import { ConfirmDiscardModal } from "@/components/common/confirm-discard-modal";
|
||||||
import { ControllerInput, TControllerInputFormField } from "@/components/common/controller-input";
|
import type { TControllerInputFormField } from "@/components/common/controller-input";
|
||||||
import { CopyField, TCopyField } from "@/components/common/copy-field";
|
import { ControllerInput } from "@/components/common/controller-input";
|
||||||
|
import type { TCopyField } from "@/components/common/copy-field";
|
||||||
|
import { CopyField } from "@/components/common/copy-field";
|
||||||
// hooks
|
// hooks
|
||||||
import { useInstance } from "@/hooks/store";
|
import { useInstance } from "@/hooks/store";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { ReactNode } from "react";
|
import type { ReactNode } from "react";
|
||||||
import { Metadata } from "next";
|
import type { Metadata } from "next";
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: "Google Authentication - God Mode",
|
title: "Google Authentication - God Mode",
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { ReactNode } from "react";
|
import type { ReactNode } from "react";
|
||||||
import { Metadata } from "next";
|
import type { Metadata } from "next";
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: "Authentication Settings - Plane Web",
|
title: "Authentication Settings - Plane Web",
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import { observer } from "mobx-react";
|
||||||
import useSWR from "swr";
|
import useSWR from "swr";
|
||||||
// plane internal packages
|
// plane internal packages
|
||||||
import { setPromiseToast } from "@plane/propel/toast";
|
import { setPromiseToast } from "@plane/propel/toast";
|
||||||
import { TInstanceConfigurationKeys } from "@plane/types";
|
import type { TInstanceConfigurationKeys } from "@plane/types";
|
||||||
import { Loader, ToggleSwitch } from "@plane/ui";
|
import { Loader, ToggleSwitch } from "@plane/ui";
|
||||||
import { cn } from "@plane/utils";
|
import { cn } from "@plane/utils";
|
||||||
// hooks
|
// hooks
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,17 @@
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import React, { FC, useMemo, useState } from "react";
|
import type { FC } from "react";
|
||||||
|
import React, { useMemo, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
// types
|
// types
|
||||||
import { Button } from "@plane/propel/button";
|
import { Button } from "@plane/propel/button";
|
||||||
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
|
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
|
||||||
import { IFormattedInstanceConfiguration, TInstanceEmailConfigurationKeys } from "@plane/types";
|
import type { IFormattedInstanceConfiguration, TInstanceEmailConfigurationKeys } from "@plane/types";
|
||||||
// ui
|
// ui
|
||||||
import { CustomSelect } from "@plane/ui";
|
import { CustomSelect } from "@plane/ui";
|
||||||
// components
|
// components
|
||||||
import { ControllerInput, TControllerInputFormField } from "@/components/common/controller-input";
|
import type { TControllerInputFormField } from "@/components/common/controller-input";
|
||||||
|
import { ControllerInput } from "@/components/common/controller-input";
|
||||||
// hooks
|
// hooks
|
||||||
import { useInstance } from "@/hooks/store";
|
import { useInstance } from "@/hooks/store";
|
||||||
// local components
|
// local components
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { ReactNode } from "react";
|
import type { ReactNode } from "react";
|
||||||
import { Metadata } from "next";
|
import type { Metadata } from "next";
|
||||||
|
|
||||||
interface EmailLayoutProps {
|
interface EmailLayoutProps {
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import React, { FC, useEffect, useState } from "react";
|
import type { FC } from "react";
|
||||||
|
import React, { useEffect, useState } from "react";
|
||||||
import { Dialog, Transition } from "@headlessui/react";
|
import { Dialog, Transition } from "@headlessui/react";
|
||||||
// plane imports
|
// plane imports
|
||||||
import { Button } from "@plane/propel/button";
|
import { Button } from "@plane/propel/button";
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
"use client";
|
"use client";
|
||||||
import { FC } from "react";
|
import type { FC } from "react";
|
||||||
import { observer } from "mobx-react";
|
import { observer } from "mobx-react";
|
||||||
import { Controller, useForm } from "react-hook-form";
|
import { Controller, useForm } from "react-hook-form";
|
||||||
import { Telescope } from "lucide-react";
|
import { Telescope } from "lucide-react";
|
||||||
// types
|
// types
|
||||||
import { Button } from "@plane/propel/button";
|
import { Button } from "@plane/propel/button";
|
||||||
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
|
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
|
||||||
import { IInstance, IInstanceAdmin } from "@plane/types";
|
import type { IInstance, IInstanceAdmin } from "@plane/types";
|
||||||
// ui
|
// ui
|
||||||
import { Input, ToggleSwitch } from "@plane/ui";
|
import { Input, ToggleSwitch } from "@plane/ui";
|
||||||
// components
|
// components
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { FC, useState } from "react";
|
import type { FC } from "react";
|
||||||
|
import { useState } from "react";
|
||||||
import { observer } from "mobx-react";
|
import { observer } from "mobx-react";
|
||||||
import useSWR from "swr";
|
import useSWR from "swr";
|
||||||
import { MessageSquare } from "lucide-react";
|
import { MessageSquare } from "lucide-react";
|
||||||
import { IFormattedInstanceConfiguration } from "@plane/types";
|
import type { IFormattedInstanceConfiguration } from "@plane/types";
|
||||||
import { ToggleSwitch } from "@plane/ui";
|
import { ToggleSwitch } from "@plane/ui";
|
||||||
// hooks
|
// hooks
|
||||||
import { useInstance } from "@/hooks/store";
|
import { useInstance } from "@/hooks/store";
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { ReactNode } from "react";
|
import type { ReactNode } from "react";
|
||||||
import { Metadata } from "next";
|
import type { Metadata } from "next";
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: "General Settings - God Mode",
|
title: "General Settings - God Mode",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { FC } from "react";
|
import type { FC } from "react";
|
||||||
import { observer } from "mobx-react";
|
import { observer } from "mobx-react";
|
||||||
import { usePathname } from "next/navigation";
|
import { usePathname } from "next/navigation";
|
||||||
import { Menu, Settings } from "lucide-react";
|
import { Menu, Settings } from "lucide-react";
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
"use client";
|
"use client";
|
||||||
import { FC } from "react";
|
import type { FC } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
import { Button } from "@plane/propel/button";
|
import { Button } from "@plane/propel/button";
|
||||||
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
|
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
|
||||||
import { IFormattedInstanceConfiguration, TInstanceImageConfigurationKeys } from "@plane/types";
|
import type { IFormattedInstanceConfiguration, TInstanceImageConfigurationKeys } from "@plane/types";
|
||||||
// components
|
// components
|
||||||
import { ControllerInput } from "@/components/common/controller-input";
|
import { ControllerInput } from "@/components/common/controller-input";
|
||||||
// hooks
|
// hooks
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { ReactNode } from "react";
|
import type { ReactNode } from "react";
|
||||||
import { Metadata } from "next";
|
import type { Metadata } from "next";
|
||||||
|
|
||||||
interface ImageLayoutProps {
|
interface ImageLayoutProps {
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { FC, ReactNode, useEffect } from "react";
|
import type { FC, ReactNode } from "react";
|
||||||
|
import { useEffect } from "react";
|
||||||
import { observer } from "mobx-react";
|
import { observer } from "mobx-react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
// components
|
// components
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { FC, useState, useRef } from "react";
|
import type { FC } from "react";
|
||||||
|
import { useState, useRef } from "react";
|
||||||
import { observer } from "mobx-react";
|
import { observer } from "mobx-react";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { ExternalLink, HelpCircle, MoveLeft } from "lucide-react";
|
import { ExternalLink, HelpCircle, MoveLeft } from "lucide-react";
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { FC, useEffect, useRef } from "react";
|
import type { FC } from "react";
|
||||||
|
import { useEffect, useRef } from "react";
|
||||||
import { observer } from "mobx-react";
|
import { observer } from "mobx-react";
|
||||||
// plane helpers
|
// plane helpers
|
||||||
import { useOutsideClickDetector } from "@plane/hooks";
|
import { useOutsideClickDetector } from "@plane/hooks";
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import { WEB_BASE_URL, ORGANIZATION_SIZE, RESTRICTED_URLS } from "@plane/constan
|
||||||
import { Button, getButtonStyling } from "@plane/propel/button";
|
import { Button, getButtonStyling } from "@plane/propel/button";
|
||||||
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
|
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
|
||||||
import { InstanceWorkspaceService } from "@plane/services";
|
import { InstanceWorkspaceService } from "@plane/services";
|
||||||
import { IWorkspace } from "@plane/types";
|
import type { IWorkspace } from "@plane/types";
|
||||||
// components
|
// components
|
||||||
import { CustomSelect, Input } from "@plane/ui";
|
import { CustomSelect, Input } from "@plane/ui";
|
||||||
// hooks
|
// hooks
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { ReactNode } from "react";
|
import type { ReactNode } from "react";
|
||||||
import { Metadata } from "next";
|
import type { Metadata } from "next";
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: "Workspace Management - God Mode",
|
title: "Workspace Management - God Mode",
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import { Loader as LoaderIcon } from "lucide-react";
|
||||||
// types
|
// types
|
||||||
import { Button, getButtonStyling } from "@plane/propel/button";
|
import { Button, getButtonStyling } from "@plane/propel/button";
|
||||||
import { setPromiseToast } from "@plane/propel/toast";
|
import { setPromiseToast } from "@plane/propel/toast";
|
||||||
import { TInstanceConfigurationKeys } from "@plane/types";
|
import type { TInstanceConfigurationKeys } from "@plane/types";
|
||||||
import { Loader, ToggleSwitch } from "@plane/ui";
|
import { Loader, ToggleSwitch } from "@plane/ui";
|
||||||
|
|
||||||
import { cn } from "@plane/utils";
|
import { cn } from "@plane/utils";
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { FC } from "react";
|
import type { FC } from "react";
|
||||||
import { Info, X } from "lucide-react";
|
import { Info, X } from "lucide-react";
|
||||||
// plane constants
|
// plane constants
|
||||||
import { TAdminAuthErrorInfo } from "@plane/constants";
|
import type { TAdminAuthErrorInfo } from "@plane/constants";
|
||||||
|
|
||||||
type TAuthBanner = {
|
type TAuthBanner = {
|
||||||
bannerData: TAdminAuthErrorInfo | undefined;
|
bannerData: TAdminAuthErrorInfo | undefined;
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
import { ReactNode } from "react";
|
import type { ReactNode } from "react";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { KeyRound, Mails } from "lucide-react";
|
import { KeyRound, Mails } from "lucide-react";
|
||||||
// plane packages
|
// plane packages
|
||||||
import { SUPPORT_EMAIL, EAdminAuthErrorCodes, TAdminAuthErrorInfo } from "@plane/constants";
|
import type { TAdminAuthErrorInfo } from "@plane/constants";
|
||||||
import { TGetBaseAuthenticationModeProps, TInstanceAuthenticationModes } from "@plane/types";
|
import { SUPPORT_EMAIL, EAdminAuthErrorCodes } from "@plane/constants";
|
||||||
|
import type { TGetBaseAuthenticationModeProps, TInstanceAuthenticationModes } from "@plane/types";
|
||||||
import { resolveGeneralTheme } from "@plane/utils";
|
import { resolveGeneralTheme } from "@plane/utils";
|
||||||
// components
|
// components
|
||||||
import { EmailCodesConfiguration } from "@/components/authentication/email-config-switch";
|
import { EmailCodesConfiguration } from "@/components/authentication/email-config-switch";
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,12 @@
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { FC, useEffect, useMemo, useState } from "react";
|
import type { FC } from "react";
|
||||||
|
import { useEffect, useMemo, useState } from "react";
|
||||||
import { useSearchParams } from "next/navigation";
|
import { useSearchParams } from "next/navigation";
|
||||||
import { Eye, EyeOff } from "lucide-react";
|
import { Eye, EyeOff } from "lucide-react";
|
||||||
// plane internal packages
|
// plane internal packages
|
||||||
import { API_BASE_URL, EAdminAuthErrorCodes, TAdminAuthErrorInfo } from "@plane/constants";
|
import type { EAdminAuthErrorCodes, TAdminAuthErrorInfo } from "@plane/constants";
|
||||||
|
import { API_BASE_URL } from "@plane/constants";
|
||||||
import { Button } from "@plane/propel/button";
|
import { Button } from "@plane/propel/button";
|
||||||
import { AuthService } from "@plane/services";
|
import { AuthService } from "@plane/services";
|
||||||
import { Input, Spinner } from "@plane/ui";
|
import { Input, Spinner } from "@plane/ui";
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { FC, ReactNode } from "react";
|
import type { FC, ReactNode } from "react";
|
||||||
import { observer } from "mobx-react";
|
import { observer } from "mobx-react";
|
||||||
import useSWR from "swr";
|
import useSWR from "swr";
|
||||||
// hooks
|
// hooks
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { ReactNode, createContext } from "react";
|
import type { ReactNode } from "react";
|
||||||
|
import { createContext } from "react";
|
||||||
// plane admin store
|
// plane admin store
|
||||||
import { RootStore } from "@/plane-admin/store/root.store";
|
import { RootStore } from "@/plane-admin/store/root.store";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { FC, ReactNode, useEffect } from "react";
|
import type { FC, ReactNode } from "react";
|
||||||
|
import { useEffect } from "react";
|
||||||
import { observer } from "mobx-react";
|
import { observer } from "mobx-react";
|
||||||
import useSWR from "swr";
|
import useSWR from "swr";
|
||||||
// hooks
|
// hooks
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { ReactNode } from "react";
|
import type { ReactNode } from "react";
|
||||||
import { Metadata } from "next";
|
import type { Metadata } from "next";
|
||||||
// plane imports
|
// plane imports
|
||||||
import { ADMIN_BASE_PATH } from "@plane/constants";
|
import { ADMIN_BASE_PATH } from "@plane/constants";
|
||||||
// styles
|
// styles
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import Image from "next/image";
|
||||||
import { useTheme } from "next-themes";
|
import { useTheme } from "next-themes";
|
||||||
import { KeyRound, Mails } from "lucide-react";
|
import { KeyRound, Mails } from "lucide-react";
|
||||||
// types
|
// types
|
||||||
import {
|
import type {
|
||||||
TGetBaseAuthenticationModeProps,
|
TGetBaseAuthenticationModeProps,
|
||||||
TInstanceAuthenticationMethodKeys,
|
TInstanceAuthenticationMethodKeys,
|
||||||
TInstanceAuthenticationModes,
|
TInstanceAuthenticationModes,
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { FC } from "react";
|
import type { FC } from "react";
|
||||||
// helpers
|
// helpers
|
||||||
import { cn } from "@plane/utils";
|
import { cn } from "@plane/utils";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { observer } from "mobx-react";
|
import { observer } from "mobx-react";
|
||||||
// hooks
|
// hooks
|
||||||
import { TInstanceAuthenticationMethodKeys } from "@plane/types";
|
import type { TInstanceAuthenticationMethodKeys } from "@plane/types";
|
||||||
import { ToggleSwitch } from "@plane/ui";
|
import { ToggleSwitch } from "@plane/ui";
|
||||||
import { useInstance } from "@/hooks/store";
|
import { useInstance } from "@/hooks/store";
|
||||||
// ui
|
// ui
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import Link from "next/link";
|
||||||
import { Settings2 } from "lucide-react";
|
import { Settings2 } from "lucide-react";
|
||||||
// plane internal packages
|
// plane internal packages
|
||||||
import { getButtonStyling } from "@plane/propel/button";
|
import { getButtonStyling } from "@plane/propel/button";
|
||||||
import { TInstanceAuthenticationMethodKeys } from "@plane/types";
|
import type { TInstanceAuthenticationMethodKeys } from "@plane/types";
|
||||||
import { ToggleSwitch } from "@plane/ui";
|
import { ToggleSwitch } from "@plane/ui";
|
||||||
import { cn } from "@plane/utils";
|
import { cn } from "@plane/utils";
|
||||||
// hooks
|
// hooks
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import Link from "next/link";
|
||||||
import { Settings2 } from "lucide-react";
|
import { Settings2 } from "lucide-react";
|
||||||
// plane internal packages
|
// plane internal packages
|
||||||
import { getButtonStyling } from "@plane/propel/button";
|
import { getButtonStyling } from "@plane/propel/button";
|
||||||
import { TInstanceAuthenticationMethodKeys } from "@plane/types";
|
import type { TInstanceAuthenticationMethodKeys } from "@plane/types";
|
||||||
import { ToggleSwitch } from "@plane/ui";
|
import { ToggleSwitch } from "@plane/ui";
|
||||||
import { cn } from "@plane/utils";
|
import { cn } from "@plane/utils";
|
||||||
// hooks
|
// hooks
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import Link from "next/link";
|
||||||
import { Settings2 } from "lucide-react";
|
import { Settings2 } from "lucide-react";
|
||||||
// plane internal packages
|
// plane internal packages
|
||||||
import { getButtonStyling } from "@plane/propel/button";
|
import { getButtonStyling } from "@plane/propel/button";
|
||||||
import { TInstanceAuthenticationMethodKeys } from "@plane/types";
|
import type { TInstanceAuthenticationMethodKeys } from "@plane/types";
|
||||||
import { ToggleSwitch } from "@plane/ui";
|
import { ToggleSwitch } from "@plane/ui";
|
||||||
import { cn } from "@plane/utils";
|
import { cn } from "@plane/utils";
|
||||||
// hooks
|
// hooks
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { observer } from "mobx-react";
|
import { observer } from "mobx-react";
|
||||||
// hooks
|
// hooks
|
||||||
import { TInstanceAuthenticationMethodKeys } from "@plane/types";
|
import type { TInstanceAuthenticationMethodKeys } from "@plane/types";
|
||||||
import { ToggleSwitch } from "@plane/ui";
|
import { ToggleSwitch } from "@plane/ui";
|
||||||
import { useInstance } from "@/hooks/store";
|
import { useInstance } from "@/hooks/store";
|
||||||
// ui
|
// ui
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { FC } from "react";
|
import type { FC } from "react";
|
||||||
import { AlertCircle, CheckCircle2 } from "lucide-react";
|
import { AlertCircle, CheckCircle2 } from "lucide-react";
|
||||||
|
|
||||||
type TBanner = {
|
type TBanner = {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { Controller, Control } from "react-hook-form";
|
import type { Control } from "react-hook-form";
|
||||||
|
import { Controller } from "react-hook-form";
|
||||||
// icons
|
// icons
|
||||||
import { Eye, EyeOff } from "lucide-react";
|
import { Eye, EyeOff } from "lucide-react";
|
||||||
// plane internal packages
|
// plane internal packages
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
"use client";
|
"use client";
|
||||||
import { FC } from "react";
|
import type { FC } from "react";
|
||||||
import { observer } from "mobx-react";
|
import { observer } from "mobx-react";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import { useTheme } from "next-themes";
|
import { useTheme } from "next-themes";
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { FC } from "react";
|
import type { FC } from "react";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { Button } from "@plane/propel/button";
|
import { Button } from "@plane/propel/button";
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { FC, useEffect, useMemo, useState } from "react";
|
import type { FC } from "react";
|
||||||
|
import { useEffect, useMemo, useState } from "react";
|
||||||
import { useSearchParams } from "next/navigation";
|
import { useSearchParams } from "next/navigation";
|
||||||
// icons
|
// icons
|
||||||
import { Eye, EyeOff } from "lucide-react";
|
import { Eye, EyeOff } from "lucide-react";
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { useContext } from "react";
|
import { useContext } from "react";
|
||||||
// store
|
// store
|
||||||
import { StoreContext } from "@/app/(all)/store.provider";
|
import { StoreContext } from "@/app/(all)/store.provider";
|
||||||
import { IInstanceStore } from "@/store/instance.store";
|
import type { IInstanceStore } from "@/store/instance.store";
|
||||||
|
|
||||||
export const useInstance = (): IInstanceStore => {
|
export const useInstance = (): IInstanceStore => {
|
||||||
const context = useContext(StoreContext);
|
const context = useContext(StoreContext);
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { useContext } from "react";
|
import { useContext } from "react";
|
||||||
// store
|
// store
|
||||||
import { StoreContext } from "@/app/(all)/store.provider";
|
import { StoreContext } from "@/app/(all)/store.provider";
|
||||||
import { IThemeStore } from "@/store/theme.store";
|
import type { IThemeStore } from "@/store/theme.store";
|
||||||
|
|
||||||
export const useTheme = (): IThemeStore => {
|
export const useTheme = (): IThemeStore => {
|
||||||
const context = useContext(StoreContext);
|
const context = useContext(StoreContext);
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { useContext } from "react";
|
import { useContext } from "react";
|
||||||
// store
|
// store
|
||||||
import { StoreContext } from "@/app/(all)/store.provider";
|
import { StoreContext } from "@/app/(all)/store.provider";
|
||||||
import { IUserStore } from "@/store/user.store";
|
import type { IUserStore } from "@/store/user.store";
|
||||||
|
|
||||||
export const useUser = (): IUserStore => {
|
export const useUser = (): IUserStore => {
|
||||||
const context = useContext(StoreContext);
|
const context = useContext(StoreContext);
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { useContext } from "react";
|
import { useContext } from "react";
|
||||||
// store
|
// store
|
||||||
import { StoreContext } from "@/app/(all)/store.provider";
|
import { StoreContext } from "@/app/(all)/store.provider";
|
||||||
import { IWorkspaceStore } from "@/store/workspace.store";
|
import type { IWorkspaceStore } from "@/store/workspace.store";
|
||||||
|
|
||||||
export const useWorkspace = (): IWorkspaceStore => {
|
export const useWorkspace = (): IWorkspaceStore => {
|
||||||
const context = useContext(StoreContext);
|
const context = useContext(StoreContext);
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
import { set } from "lodash-es";
|
import { set } from "lodash-es";
|
||||||
import { observable, action, computed, makeObservable, runInAction } from "mobx";
|
import { observable, action, computed, makeObservable, runInAction } from "mobx";
|
||||||
// plane internal packages
|
// plane internal packages
|
||||||
import { EInstanceStatus, TInstanceStatus } from "@plane/constants";
|
import type { TInstanceStatus } from "@plane/constants";
|
||||||
|
import { EInstanceStatus } from "@plane/constants";
|
||||||
import { InstanceService } from "@plane/services";
|
import { InstanceService } from "@plane/services";
|
||||||
import {
|
import type {
|
||||||
IInstance,
|
IInstance,
|
||||||
IInstanceAdmin,
|
IInstanceAdmin,
|
||||||
IInstanceConfiguration,
|
IInstanceConfiguration,
|
||||||
|
|
@ -12,7 +13,7 @@ import {
|
||||||
IInstanceConfig,
|
IInstanceConfig,
|
||||||
} from "@plane/types";
|
} from "@plane/types";
|
||||||
// root store
|
// root store
|
||||||
import { CoreRootStore } from "@/store/root.store";
|
import type { CoreRootStore } from "@/store/root.store";
|
||||||
|
|
||||||
export interface IInstanceStore {
|
export interface IInstanceStore {
|
||||||
// issues
|
// issues
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,13 @@
|
||||||
import { enableStaticRendering } from "mobx-react";
|
import { enableStaticRendering } from "mobx-react";
|
||||||
// stores
|
// stores
|
||||||
import { IInstanceStore, InstanceStore } from "./instance.store";
|
import type { IInstanceStore } from "./instance.store";
|
||||||
import { IThemeStore, ThemeStore } from "./theme.store";
|
import { InstanceStore } from "./instance.store";
|
||||||
import { IUserStore, UserStore } from "./user.store";
|
import type { IThemeStore } from "./theme.store";
|
||||||
import { IWorkspaceStore, WorkspaceStore } from "./workspace.store";
|
import { ThemeStore } from "./theme.store";
|
||||||
|
import type { IUserStore } from "./user.store";
|
||||||
|
import { UserStore } from "./user.store";
|
||||||
|
import type { IWorkspaceStore } from "./workspace.store";
|
||||||
|
import { WorkspaceStore } from "./workspace.store";
|
||||||
|
|
||||||
enableStaticRendering(typeof window === "undefined");
|
enableStaticRendering(typeof window === "undefined");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { action, observable, makeObservable } from "mobx";
|
import { action, observable, makeObservable } from "mobx";
|
||||||
// root store
|
// root store
|
||||||
import { CoreRootStore } from "@/store/root.store";
|
import type { CoreRootStore } from "@/store/root.store";
|
||||||
|
|
||||||
type TTheme = "dark" | "light";
|
type TTheme = "dark" | "light";
|
||||||
export interface IThemeStore {
|
export interface IThemeStore {
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
import { action, observable, runInAction, makeObservable } from "mobx";
|
import { action, observable, runInAction, makeObservable } from "mobx";
|
||||||
// plane internal packages
|
// plane internal packages
|
||||||
import { EUserStatus, TUserStatus } from "@plane/constants";
|
import type { TUserStatus } from "@plane/constants";
|
||||||
|
import { EUserStatus } from "@plane/constants";
|
||||||
import { AuthService, UserService } from "@plane/services";
|
import { AuthService, UserService } from "@plane/services";
|
||||||
import { IUser } from "@plane/types";
|
import type { IUser } from "@plane/types";
|
||||||
// root store
|
// root store
|
||||||
import { CoreRootStore } from "@/store/root.store";
|
import type { CoreRootStore } from "@/store/root.store";
|
||||||
|
|
||||||
export interface IUserStore {
|
export interface IUserStore {
|
||||||
// observables
|
// observables
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@ import { set } from "lodash-es";
|
||||||
import { action, observable, runInAction, makeObservable, computed } from "mobx";
|
import { action, observable, runInAction, makeObservable, computed } from "mobx";
|
||||||
// plane imports
|
// plane imports
|
||||||
import { InstanceWorkspaceService } from "@plane/services";
|
import { InstanceWorkspaceService } from "@plane/services";
|
||||||
import { IWorkspace, TLoader, TPaginationInfo } from "@plane/types";
|
import type { IWorkspace, TLoader, TPaginationInfo } from "@plane/types";
|
||||||
// root store
|
// root store
|
||||||
import { CoreRootStore } from "@/store/root.store";
|
import type { CoreRootStore } from "@/store/root.store";
|
||||||
|
|
||||||
export interface IWorkspaceStore {
|
export interface IWorkspaceStore {
|
||||||
// observables
|
// observables
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue