mirror of
https://github.com/makeplane/plane.git
synced 2026-07-12 13:29:56 +02:00
fix: build errors. (#804)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
"use client";
|
||||
|
||||
// layouts
|
||||
import { useParams } from "next/navigation";
|
||||
import { WorkspaceAuthWrapper } from "@/layouts/auth-layout";
|
||||
// wrappers
|
||||
import { AuthenticationWrapper } from "@/lib/wrappers";
|
||||
@@ -12,10 +13,17 @@ import { WorkspacePagesUpgrade } from "@/plane-web/components/pages";
|
||||
import { PagesAppSidebar } from "./sidebar";
|
||||
|
||||
export default function WorkspacePagesLayout({ children }: { children: React.ReactNode }) {
|
||||
// router
|
||||
const { workspaceSlug } = useParams();
|
||||
|
||||
return (
|
||||
<AuthenticationWrapper>
|
||||
<WorkspaceAuthWrapper>
|
||||
<WithFeatureFlagHOC flag="WORKSPACE_PAGES" fallback={<WorkspacePagesUpgrade />}>
|
||||
<WithFeatureFlagHOC
|
||||
workspaceSlug={workspaceSlug?.toString()}
|
||||
flag="WORKSPACE_PAGES"
|
||||
fallback={<WorkspacePagesUpgrade />}
|
||||
>
|
||||
<>
|
||||
<PagesAppCommandPalette />
|
||||
<div className="relative flex h-screen w-full overflow-hidden">
|
||||
|
||||
@@ -43,7 +43,11 @@ const WorklogsPage = observer(() => {
|
||||
return (
|
||||
<>
|
||||
<PageHead title={pageTitle} />
|
||||
<WithFeatureFlagHOC flag={E_FEATURE_FLAGS.ISSUE_WORKLOG} fallback={<WorkspaceWorklogsUpgrade />}>
|
||||
<WithFeatureFlagHOC
|
||||
workspaceSlug={workspaceSlug?.toString()}
|
||||
flag={E_FEATURE_FLAGS.ISSUE_WORKLOG}
|
||||
fallback={<WorkspaceWorklogsUpgrade />}
|
||||
>
|
||||
<WorkspaceWorklogRoot workspaceSlug={workspaceSlug.toString()} workspaceId={currentWorkspace.id} />
|
||||
</WithFeatureFlagHOC>
|
||||
</>
|
||||
|
||||
@@ -1,9 +1,19 @@
|
||||
import { useParams } from "next/navigation";
|
||||
// plane web components
|
||||
import { WorkspaceActiveCyclesList, WorkspaceActiveCyclesUpgrade } from "@/plane-web/components/active-cycles";
|
||||
import { WithFeatureFlagHOC } from "@/plane-web/components/feature-flags";
|
||||
|
||||
export const WorkspaceActiveCyclesRoot = () => (
|
||||
<WithFeatureFlagHOC flag="WORKSPACE_ACTIVE_CYCLES" fallback={<WorkspaceActiveCyclesUpgrade />}>
|
||||
<WorkspaceActiveCyclesList />
|
||||
</WithFeatureFlagHOC>
|
||||
)
|
||||
export const WorkspaceActiveCyclesRoot = () => {
|
||||
// router
|
||||
const { workspaceSlug } = useParams();
|
||||
|
||||
return (
|
||||
<WithFeatureFlagHOC
|
||||
workspaceSlug={workspaceSlug?.toString()}
|
||||
flag="WORKSPACE_ACTIVE_CYCLES"
|
||||
fallback={<WorkspaceActiveCyclesUpgrade />}
|
||||
>
|
||||
<WorkspaceActiveCyclesList />
|
||||
</WithFeatureFlagHOC>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -12,7 +12,7 @@ interface IWithFeatureFlagHOC {
|
||||
|
||||
export const WithFeatureFlagHOC = observer((props: IWithFeatureFlagHOC) => {
|
||||
const { workspaceSlug, flag, fallback, children } = props;
|
||||
// check if the feature flag is enableds
|
||||
// check if the feature flag is enabled
|
||||
const isFeatureEnabled = useFlag(workspaceSlug, flag);
|
||||
// return the children if the feature flag is enabled else return the fallback
|
||||
return <>{isFeatureEnabled ? children : fallback}</>;
|
||||
|
||||
@@ -128,7 +128,9 @@ export class WorkspaceWorklogStore implements IWorkspaceWorklogStore {
|
||||
* @returns { boolean }
|
||||
*/
|
||||
get isFeatureFlagEnabled(): boolean {
|
||||
return this.store.featureFlags.flags[E_FEATURE_FLAGS.ISSUE_WORKLOG] || false;
|
||||
const workspaceSlug = this.store.router.workspaceSlug;
|
||||
if (!workspaceSlug) return false;
|
||||
return this.store.featureFlags.flags[workspaceSlug]?.[E_FEATURE_FLAGS.ISSUE_WORKLOG] || false;
|
||||
}
|
||||
|
||||
// computed functions
|
||||
|
||||
Reference in New Issue
Block a user