[WEB-2413] chore: admin application restructuring. (#5557)

This commit is contained in:
Prateek Shourya 2024-09-09 17:43:56 +05:30 committed by GitHub
parent fe280b2beb
commit 8cf1c2d136
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 52 additions and 29 deletions

View file

@ -10,8 +10,9 @@ import {
// components // components
import { AuthenticationMethodCard } from "@/components/authentication"; import { AuthenticationMethodCard } from "@/components/authentication";
// helpers // helpers
import { UpgradeButton } from "@/components/common/upgrade-button";
import { getBaseAuthenticationModes } from "@/helpers/authentication.helper"; import { getBaseAuthenticationModes } from "@/helpers/authentication.helper";
// plane admin components
import { UpgradeButton } from "@/plane-admin/components/common";
// images // images
import OIDCLogo from "@/public/logos/oidc-logo.svg"; import OIDCLogo from "@/public/logos/oidc-logo.svg";
import SAMLLogo from "@/public/logos/saml-logo.svg"; import SAMLLogo from "@/public/logos/saml-logo.svg";

View file

@ -0,0 +1 @@
export * from "./upgrade-button";

View file

@ -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();
}
}

View file

@ -8,4 +8,3 @@ export * from "./empty-state";
export * from "./logo-spinner"; export * from "./logo-spinner";
export * from "./page-header"; export * from "./page-header";
export * from "./code-block"; export * from "./code-block";
export * from "./upgrade-button";

View file

@ -18,6 +18,7 @@ export const AdminLayout: FC<TAdminLayout> = observer((props) => {
const { children } = props; const { children } = props;
// router // router
const router = useRouter(); const router = useRouter();
// store hooks
const { isUserLoggedIn } = useUser(); const { isUserLoggedIn } = useUser();
useEffect(() => { useEffect(() => {

View file

@ -1,8 +1,8 @@
"use client"; "use client";
import { ReactNode, createContext } from "react"; import { ReactNode, createContext } from "react";
// store // plane admin store
import { RootStore } from "@/store/root.store"; import { RootStore } from "@/plane-admin/store/root.store";
let rootStore = new RootStore(); let rootStore = new RootStore();

View file

@ -13,7 +13,7 @@ import { EInstanceStatus, TInstanceStatus } from "@/helpers/instance.helper";
// services // services
import { InstanceService } from "@/services/instance.service"; import { InstanceService } from "@/services/instance.service";
// root store // root store
import { RootStore } from "@/store/root.store"; import { CoreRootStore } from "@/store/root.store";
export interface IInstanceStore { export interface IInstanceStore {
// issues // issues
@ -46,7 +46,7 @@ export class InstanceStore implements IInstanceStore {
// service // service
instanceService; instanceService;
constructor(private store: RootStore) { constructor(private store: CoreRootStore) {
makeObservable(this, { makeObservable(this, {
// observable // observable
isLoading: observable.ref, isLoading: observable.ref,

View file

@ -6,7 +6,7 @@ import { IUserStore, UserStore } from "./user.store";
enableStaticRendering(typeof window === "undefined"); enableStaticRendering(typeof window === "undefined");
export class RootStore { export abstract class CoreRootStore {
theme: IThemeStore; theme: IThemeStore;
instance: IInstanceStore; instance: IInstanceStore;
user: IUserStore; user: IUserStore;

View file

@ -1,6 +1,6 @@
import { action, observable, makeObservable } from "mobx"; import { action, observable, makeObservable } from "mobx";
// root store // root store
import { RootStore } from "@/store/root.store"; import { CoreRootStore } from "@/store/root.store";
type TTheme = "dark" | "light"; type TTheme = "dark" | "light";
export interface IThemeStore { export interface IThemeStore {
@ -21,7 +21,7 @@ export class ThemeStore implements IThemeStore {
isSidebarCollapsed: boolean | undefined = undefined; isSidebarCollapsed: boolean | undefined = undefined;
theme: string | undefined = undefined; theme: string | undefined = undefined;
constructor(private store: RootStore) { constructor(private store: CoreRootStore) {
makeObservable(this, { makeObservable(this, {
// observables // observables
isNewUserPopup: observable.ref, isNewUserPopup: observable.ref,

View file

@ -6,7 +6,7 @@ import { EUserStatus, TUserStatus } from "@/helpers/user.helper";
import { AuthService } from "@/services/auth.service"; import { AuthService } from "@/services/auth.service";
import { UserService } from "@/services/user.service"; import { UserService } from "@/services/user.service";
// root store // root store
import { RootStore } from "@/store/root.store"; import { CoreRootStore } from "@/store/root.store";
export interface IUserStore { export interface IUserStore {
// observables // observables
@ -31,7 +31,7 @@ export class UserStore implements IUserStore {
userService; userService;
authService; authService;
constructor(private store: RootStore) { constructor(private store: CoreRootStore) {
makeObservable(this, { makeObservable(this, {
// observables // observables
isLoading: observable.ref, isLoading: observable.ref,

View file

@ -0,0 +1 @@
export * from "ce/components/common";

View file

@ -0,0 +1 @@
export * from "ce/store/root.store";