mirror of
https://github.com/makeplane/plane.git
synced 2026-07-12 13:29:56 +02:00
refactor: enhance command palette modularity (#1909)
This commit is contained in:
@@ -1 +1,3 @@
|
||||
export * from "ce/components/command-palette/modals";
|
||||
export * from "./workspace-level";
|
||||
export * from "./project-level";
|
||||
export * from "./issue-level";
|
||||
|
||||
9
web/ee/components/command-palette/modals/issue-level.tsx
Normal file
9
web/ee/components/command-palette/modals/issue-level.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
import { observer } from "mobx-react";
|
||||
// ce components
|
||||
import { IssueLevelModals as BaseIssueLevelModals } from "@/ce/components/command-palette/modals/issue-level";
|
||||
|
||||
export const IssueLevelModals = observer(() => (
|
||||
<>
|
||||
<BaseIssueLevelModals />
|
||||
</>
|
||||
));
|
||||
12
web/ee/components/command-palette/modals/project-level.tsx
Normal file
12
web/ee/components/command-palette/modals/project-level.tsx
Normal file
@@ -0,0 +1,12 @@
|
||||
import { observer } from "mobx-react";
|
||||
// ce components
|
||||
import {
|
||||
ProjectLevelModals as BaseProjectLevelModals,
|
||||
TProjectLevelModalsProps,
|
||||
} from "@/ce/components/command-palette/modals/project-level";
|
||||
|
||||
export const ProjectLevelModals = observer((props: TProjectLevelModalsProps) => (
|
||||
<>
|
||||
<BaseProjectLevelModals {...props} />
|
||||
</>
|
||||
));
|
||||
12
web/ee/components/command-palette/modals/workspace-level.tsx
Normal file
12
web/ee/components/command-palette/modals/workspace-level.tsx
Normal file
@@ -0,0 +1,12 @@
|
||||
import { observer } from "mobx-react";
|
||||
// ce components
|
||||
import {
|
||||
WorkspaceLevelModals as BaseWorkspaceLevelModals,
|
||||
TWorkspaceLevelModalsProps,
|
||||
} from "@/ce/components/command-palette/modals/workspace-level";
|
||||
|
||||
export const WorkspaceLevelModals = observer((props: TWorkspaceLevelModalsProps) => (
|
||||
<>
|
||||
<BaseWorkspaceLevelModals {...props} />
|
||||
</>
|
||||
));
|
||||
@@ -1 +1,33 @@
|
||||
export * from "ce/helpers/command-palette";
|
||||
// types
|
||||
import { TCommandPaletteActionList, TCommandPaletteShortcut, TCommandPaletteShortcutList } from "@plane/types";
|
||||
// ce helpers
|
||||
import {
|
||||
getGlobalShortcutsList as getGlobalShortcutsListCE,
|
||||
getWorkspaceShortcutsList as getWorkspaceShortcutsListCE,
|
||||
getProjectShortcutsList as getProjectShortcutsListCE,
|
||||
getNavigationShortcutsList as getNavigationShortcutsListCE,
|
||||
getCommonShortcutsList as getCommonShortcutsListCE,
|
||||
} from "@/ce/helpers/command-palette";
|
||||
|
||||
export const getGlobalShortcutsList: () => TCommandPaletteActionList = () => ({
|
||||
...getGlobalShortcutsListCE(),
|
||||
});
|
||||
|
||||
export const getWorkspaceShortcutsList: () => TCommandPaletteActionList = () => ({
|
||||
...getWorkspaceShortcutsListCE(),
|
||||
});
|
||||
|
||||
export const getProjectShortcutsList: () => TCommandPaletteActionList = () => ({
|
||||
...getProjectShortcutsListCE(),
|
||||
});
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
export const handleAdditionalKeyDownEvents = (e: KeyboardEvent) => null;
|
||||
|
||||
export const getNavigationShortcutsList = (): TCommandPaletteShortcut[] => [...getNavigationShortcutsListCE()];
|
||||
|
||||
export const getCommonShortcutsList = (platform: string): TCommandPaletteShortcut[] => [
|
||||
...getCommonShortcutsListCE(platform),
|
||||
];
|
||||
|
||||
export const getAdditionalShortcutsList = (): TCommandPaletteShortcutList[] => [];
|
||||
|
||||
@@ -1 +1,12 @@
|
||||
export * from "ce/store/command-palette.store";
|
||||
import { makeObservable } from "mobx";
|
||||
// types / constants
|
||||
import { BaseCommandPaletteStore, IBaseCommandPaletteStore } from "@/store/base-command-palette.store";
|
||||
|
||||
export type ICommandPaletteStore = IBaseCommandPaletteStore;
|
||||
|
||||
export class CommandPaletteStore extends BaseCommandPaletteStore implements ICommandPaletteStore {
|
||||
constructor() {
|
||||
super();
|
||||
makeObservable(this, {});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user