π₯π₯π₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.
TypeScript boardsbug-trackerdjangodockerganttissue-trackerjirajira-alternativekanbanlinearpostgresqlproduct-managementproject-managementproject-planningpythonreactredistypesciptvitework-management
[WEB-2413] chore: admin application restructuring. (#5557)
Prateek Shourya8cf1c2d136e0
diff --git a/admin/ce/components/authentication/authentication-modes.tsx b/admin/ce/components/authentication/authentication-modes.tsxindex e7891e0bcc..84cde94d44 100644--- a/admin/ce/components/authentication/authentication-modes.tsx+++ b/admin/ce/components/authentication/authentication-modes.tsx@@ -10,8 +10,9 @@ import {// componentsimport { AuthenticationMethodCard } from "@/components/authentication";// helpers-import { UpgradeButton } from "@/components/common/upgrade-button";import { getBaseAuthenticationModes } from "@/helpers/authentication.helper";+// plane admin components+import { UpgradeButton } from "@/plane-admin/components/common";// imagesimport OIDCLogo from "@/public/logos/oidc-logo.svg";import SAMLLogo from "@/public/logos/saml-logo.svg";@@ -27,24 +28,24 @@ export const getAuthenticationModes: (props: TGetBaseAuthenticationModeProps) =>updateConfig,resolvedTheme,}) => [- ...getBaseAuthenticationModes({ disabled, updateConfig, resolvedTheme }),- {- key: "oidc",- name: "OIDC",- description: "Authenticate your users via the OpenID Connect protocol.",- icon: <Image src={OIDCLogo} height={22} width={22} alt="OIDC Logo" />,- config: <UpgradeButton />,- unavailable: true,- },- {- key: "saml",- name: "SAML",- description: "Authenticate your users via the Security Assertion Markup Language protocol.",- icon: <Image src={SAMLLogo} height={22} width={22} alt="SAML Logo" className="pl-0.5" />,- config: <UpgradeButton />,- unavailable: true,- },- ];+ ...getBaseAuthenticationModes({ disabled, updateConfig, resolvedTheme }),+ {+ key: "oidc",+ name: "OIDC",+ description: "Authenticate your users via the OpenID Connect protocol.",+ icon: <Image src={OIDCLogo} height={22} width={22} alt="OIDC Logo" />,+ config: <UpgradeButton />,+ unavailable: true,+ },+ {+ key: "saml",+ name: "SAML",+ description: "Authenticate your users via the Security Assertion Markup Language protocol.",+ icon: <Image src={SAMLLogo} height={22} width={22} alt="SAML Logo" className="pl-0.5" />,+ config: <UpgradeButton />,+ unavailable: true,+ },+];export const AuthenticationModes: React.FC<TAuthenticationModeProps> = observer((props) => {const { disabled, updateConfig } = props;diff --git a/admin/ce/components/common/index.ts b/admin/ce/components/common/index.tsnew file mode 100644index 0000000000..c6a1da8b62--- /dev/null+++ b/admin/ce/components/common/index.ts@@ -0,0 +1 @@+export * from "./upgrade-button";diff --git a/admin/core/components/common/upgrade-button.tsx b/admin/ce/components/common/upgrade-button.tsxsimilarity index 100%rename from admin/core/components/common/upgrade-button.tsxrename to admin/ce/components/common/upgrade-button.tsxdiff --git a/admin/ce/store/root.store.ts b/admin/ce/store/root.store.tsnew file mode 100644index 0000000000..1be816f70a--- /dev/null+++ b/admin/ce/store/root.store.ts@@ -0,0 +1,19 @@+import { enableStaticRendering } from "mobx-react";+// stores+import { CoreRootStore } from "@/store/root.store";++enableStaticRendering(typeof window === "undefined");++export class RootStore extends CoreRootStore {+ constructor() {+ super();+ }++ hydrate(initialData: any) {+ super.hydrate(initialData);+ }++ resetOnSignOut() {+ super.resetOnSignOut();+ }+}diff --git a/admin/core/components/common/index.ts b/admin/core/components/common/index.tsindex 2043926acd..4d664b0a4a 100644--- a/admin/core/components/common/index.ts+++ b/admin/core/components/common/index.ts@@ -8,4 +8,3 @@ export * from "./empty-state";export * from "./logo-spinner";export * from "./page-header";export * from "./code-block";-export * from "./upgrade-button";diff --git a/admin/core/layouts/admin-layout.tsx b/admin/core/layouts/admin-layout.tsxindex 6308aecd17..88f71aa3c4 100644--- a/admin/core/layouts/admin-layout.tsx+++ b/admin/core/layouts/admin-layout.tsx@@ -18,6 +18,7 @@ export const AdminLayout: FC<TAdminLayout> = observer((props) => {const { children } = props;// routerconst router = useRouter();+ // store hooksconst { isUserLoggedIn } = useUser();useEffect(() => {diff --git a/admin/core/lib/store-provider.tsx b/admin/core/lib/store-provider.tsxindex 8425138600..7a0d485591 100644--- a/admin/core/lib/store-provider.tsx+++ b/admin/core/lib/store-provider.tsx@@ -1,8 +1,8 @@"use client";import { ReactNode, createContext } from "react";-// store-import { RootStore } from "@/store/root.store";+// plane admin store+import { RootStore } from "@/plane-admin/store/root.store";let rootStore = new RootStore();diff --git a/admin/core/store/instance.store.ts b/admin/core/store/instance.store.tsindex 7be8deec69..01ab552846 100644--- a/admin/core/store/instance.store.ts+++ b/admin/core/store/instance.store.ts@@ -13,7 +13,7 @@ import { EInstanceStatus, TInstanceStatus } from "@/helpers/instance.helper";// servicesimport { InstanceService } from "@/services/instance.service";// root store-import { RootStore } from "@/store/root.store";+import { CoreRootStore } from "@/store/root.store";export interface IInstanceStore {// issues@@ -46,7 +46,7 @@ export class InstanceStore implements IInstanceStore {// serviceinstanceService;- constructor(private store: RootStore) {+ constructor(private store: CoreRootStore) {makeObservable(this, {// observableisLoading: observable.ref,diff --git a/admin/core/store/root.store.ts b/admin/core/store/root.store.tsindex 32977422ec..4b25bcc686 100644--- a/admin/core/store/root.store.ts+++ b/admin/core/store/root.store.ts@@ -6,7 +6,7 @@ import { IUserStore, UserStore } from "./user.store";enableStaticRendering(typeof window === "undefined");-export class RootStore {+export abstract class CoreRootStore {theme: IThemeStore;instance: IInstanceStore;user: IUserStore;diff --git a/admin/core/store/theme.store.ts b/admin/core/store/theme.store.tsindex a3f3b3d5ab..f47042d6e9 100644--- a/admin/core/store/theme.store.ts+++ b/admin/core/store/theme.store.ts@@ -1,6 +1,6 @@import { action, observable, makeObservable } from "mobx";// root store-import { RootStore } from "@/store/root.store";+import { CoreRootStore } from "@/store/root.store";type TTheme = "dark" | "light";export interface IThemeStore {@@ -21,7 +21,7 @@ export class ThemeStore implements IThemeStore {isSidebarCollapsed: boolean | undefined = undefined;theme: string | undefined = undefined;- constructor(private store: RootStore) {+ constructor(private store: CoreRootStore) {makeObservable(this, {// observablesisNewUserPopup: observable.ref,diff --git a/admin/core/store/user.store.ts b/admin/core/store/user.store.tsindex fd3132169a..df17c9b004 100644--- a/admin/core/store/user.store.ts+++ b/admin/core/store/user.store.ts@@ -6,7 +6,7 @@ import { EUserStatus, TUserStatus } from "@/helpers/user.helper";import { AuthService } from "@/services/auth.service";import { UserService } from "@/services/user.service";// root store-import { RootStore } from "@/store/root.store";+import { CoreRootStore } from "@/store/root.store";export interface IUserStore {// observables@@ -31,7 +31,7 @@ export class UserStore implements IUserStore {userService;authService;- constructor(private store: RootStore) {+ constructor(private store: CoreRootStore) {makeObservable(this, {// observablesisLoading: observable.ref,diff --git a/admin/ee/components/common/index.ts b/admin/ee/components/common/index.tsnew file mode 100644index 0000000000..60441ee25b--- /dev/null+++ b/admin/ee/components/common/index.ts@@ -0,0 +1 @@+export * from "ce/components/common";diff --git a/admin/ee/store/root.store.ts b/admin/ee/store/root.store.tsnew file mode 100644index 0000000000..c514c4c25f--- /dev/null+++ b/admin/ee/store/root.store.ts@@ -0,0 +1 @@+export * from "ce/store/root.store";