[WEB-2413] chore: admin application restructuring. (#5557)
This commit is contained in:
parent
fe280b2beb
commit
8cf1c2d136
13 changed files with 52 additions and 29 deletions
|
|
@ -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";
|
||||||
|
|
|
||||||
1
admin/ce/components/common/index.ts
Normal file
1
admin/ce/components/common/index.ts
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
export * from "./upgrade-button";
|
||||||
19
admin/ce/store/root.store.ts
Normal file
19
admin/ce/store/root.store.ts
Normal 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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";
|
|
||||||
|
|
|
||||||
|
|
@ -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(() => {
|
||||||
|
|
|
||||||
|
|
@ -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();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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,
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
|
|
@ -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,
|
||||||
|
|
|
||||||
|
|
@ -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,
|
||||||
|
|
|
||||||
1
admin/ee/components/common/index.ts
Normal file
1
admin/ee/components/common/index.ts
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
export * from "ce/components/common";
|
||||||
1
admin/ee/store/root.store.ts
Normal file
1
admin/ee/store/root.store.ts
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
export * from "ce/store/root.store";
|
||||||
Loading…
Add table
Add a link
Reference in a new issue