Skip to content

Commit

Permalink
Fixed duplicate export dynamics
Browse files Browse the repository at this point in the history
  • Loading branch information
AlessandroMarc committed Oct 18, 2024
1 parent 0aaa18d commit c75e477
Show file tree
Hide file tree
Showing 7 changed files with 132 additions and 166 deletions.
18 changes: 8 additions & 10 deletions client/app/(ee)/settings/logs/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@ import React from "react";
import { GetLogs } from "@/services/logs";
import LogsCard from "./logs-card";

export const dynamic = 'force-dynamic';
export const dynamic = "force-dynamic";

export default async function Logs() {
const data = await GetLogs();
const data = await GetLogs();

return (
<div className="w-full h-full overflow-y-auto custom-scroll mt-5 px-2 md:px-4">
<h1 className="text-2xl font-bold dark:text-white mb-10">Logs</h1>
<LogsCard logs={data?.logs || []} logs_count={data?.logs_count} />
</div>
);
return (
<div className="w-full h-full overflow-y-auto custom-scroll mt-5 px-2 md:px-4">
<h1 className="text-2xl font-bold dark:text-white mb-10">Logs</h1>
<LogsCard logs={data?.logs || []} logs_count={data?.logs_count} />
</div>
);
}
export const dynamic='force-dynamic';

44 changes: 21 additions & 23 deletions client/app/settings/datasets/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,32 @@ import Link from "next/link";
import DatasetCard from "./DatasetCard";
import { GetDatasetDetails } from "@/services/datasets";

export const dynamic = 'force-dynamic';
export const dynamic = "force-dynamic";

interface PageProps {
params: {
id: string;
};
params: {
id: string;
};
}

export default async function DatasetDetailsPage({ params }: PageProps) {
const data = await GetDatasetDetails(params.id);
const dataframe = data?.dataset;
const data = await GetDatasetDetails(params.id);
const dataframe = data?.dataset;

return (
<>
<div className="w-full h-full overflow-y-auto custom-scroll mt-5 px-2 md:px-4">
<h1 className="text-2xl font-bold dark:text-white mb-10">
<Link href="/settings/datasets">Datasets</Link>
<small>{` › ${dataframe?.name || ""}`}</small>
</h1>
return (
<>
<div className="w-full h-full overflow-y-auto custom-scroll mt-5 px-2 md:px-4">
<h1 className="text-2xl font-bold dark:text-white mb-10">
<Link href="/settings/datasets">Datasets</Link>
<small>{` › ${dataframe?.name || ""}`}</small>
</h1>

<div className="flex flex-col p-2 md:p-4 font-montserrat">
<div className="flex items-center justify-center w-[50%]">
<DatasetCard dataframe={dataframe} />
</div>
</div>
</div>
</>
);
<div className="flex flex-col p-2 md:p-4 font-montserrat">
<div className="flex items-center justify-center w-[50%]">
<DatasetCard dataframe={dataframe} />
</div>
</div>
</div>
</>
);
}
export const dynamic='force-dynamic';

80 changes: 35 additions & 45 deletions client/app/settings/datasets/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,53 +7,43 @@ import { Button } from "@/components/ui/button";
import { GetAllDataSets } from "@/services/datasets";
import AddNewCard from "./AddNewCard";

export const dynamic = 'force-dynamic';
export const dynamic = "force-dynamic";

export default async function Datasets() {
const data = await GetAllDataSets();
const data = await GetAllDataSets();

return (
<div className="w-full h-full overflow-y-auto custom-scroll mt-5 px-2 md:px-4">
<h1 className="text-2xl font-bold dark:text-white mb-10">Datasets</h1>
<div className="grid 2xl:grid-cols-4 xl:grid-cols-3 lg:grid-cols-2 gap-4">
{data?.datasets?.map((item) => (
<Card
key={item.id}
extra={
"w-full pt-4 px-6 h-full border dark:border-none border-[#ccc] pb-8"
}
>
<header className="relative flex items-center justify-between">
<div className="w-full">
<div className="flex justify-center h-24">
<FaFileCsv size="4em" key={0} />
</div>
<div className="h-[65px] w-full overflow-hidden">
<AppTooltip text={item.name}>
<h1
data-tooltip-id={`${item.id}`}
className="dark:text-white font-bold font-montserrat text-[20px] text-center customellipsis"
>
{item.name}
</h1>
</AppTooltip>
</div>
</div>
</header>
<div className="w-full flex flex-wrap items-center justify-center mt-1">
<Link href={`/settings/datasets/${item?.id}`}>
<Button>Details</Button>
</Link>
</div>
</Card>
))}
return (
<div className="w-full h-full overflow-y-auto custom-scroll mt-5 px-2 md:px-4">
<h1 className="text-2xl font-bold dark:text-white mb-10">Datasets</h1>
<div className="grid 2xl:grid-cols-4 xl:grid-cols-3 lg:grid-cols-2 gap-4">
{data?.datasets?.map(item => (
<Card key={item.id} extra={"w-full pt-4 px-6 h-full border dark:border-none border-[#ccc] pb-8"}>
<header className="relative flex items-center justify-between">
<div className="w-full">
<div className="flex justify-center h-24">
<FaFileCsv size="4em" key={0} />
</div>
<div className="h-[65px] w-full overflow-hidden">
<AppTooltip text={item.name}>
<h1 data-tooltip-id={`${item.id}`} className="dark:text-white font-bold font-montserrat text-[20px] text-center customellipsis">
{item.name}
</h1>
</AppTooltip>
</div>
</div>
</header>
<div className="w-full flex flex-wrap items-center justify-center mt-1">
<Link href={`/settings/datasets/${item?.id}`}>
<Button>Details</Button>
</Link>
</div>
</Card>
))}

<Link href={`/settings/datasets/add`}>
<AddNewCard text="New dataset" />
</Link>
</div>
</div>
);
<Link href={`/settings/datasets/add`}>
<AddNewCard text="New dataset" />
</Link>
</div>
</div>
);
}
export const dynamic='force-dynamic';

6 changes: 2 additions & 4 deletions client/app/settings/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { redirect } from "next/navigation";

export const dynamic = 'force-dynamic';
export const dynamic = "force-dynamic";

export default function Home() {
redirect("/settings/datasets");
redirect("/settings/datasets");
}
export const dynamic='force-dynamic';

42 changes: 19 additions & 23 deletions client/app/settings/workspaces/addspaces/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,28 @@ import { GetAllDataSets } from "@/services/datasets";
import AddSpaceCard from "./AddSpaceCard";
import { Button } from "@/components/ui/button";

export const dynamic = 'force-dynamic';
export const dynamic = "force-dynamic";

export default async function AddSpaces() {
const data = await GetAllDataSets();
const data = await GetAllDataSets();

return (
<div className="w-full h-full overflow-y-auto custom-scroll mt-5 px-2 md:px-4">
<h1 className="text-2xl font-bold dark:text-white mb-10">
<Link href="/settings/workspaces">Workspaces</Link>
<small> › New</small>
</h1>
return (
<div className="w-full h-full overflow-y-auto custom-scroll mt-5 px-2 md:px-4">
<h1 className="text-2xl font-bold dark:text-white mb-10">
<Link href="/settings/workspaces">Workspaces</Link>
<small> › New</small>
</h1>

{data?.datasets?.length === 0 ? (
<div className="flex flex-col items-center justify-center m-auto">
<p className="dark:text-white font-montserrat text-lg mb-3">
No datasets available, please add one
</p>
{data?.datasets?.length === 0 ? (
<div className="flex flex-col items-center justify-center m-auto">
<p className="dark:text-white font-montserrat text-lg mb-3">No datasets available, please add one</p>

<Link href={"/settings/datasets/add"}></Link>
<Button>Add</Button>
</div>
) : (
<AddSpaceCard datasets={data?.datasets} />
)}
</div>
);
<Link href={"/settings/datasets/add"}></Link>
<Button>Add</Button>
</div>
) : (
<AddSpaceCard datasets={data?.datasets} />
)}
</div>
);
}
export const dynamic='force-dynamic';

38 changes: 17 additions & 21 deletions client/app/settings/workspaces/editspaces/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,24 @@ import { GetAllDataSets } from "@/services/datasets";
import EditSpaceCard from "./EditSpaceCard";
import { GetWorkspaceDetails } from "@/services/spaces";

export const dynamic = 'force-dynamic';
export const dynamic = "force-dynamic";

export default async function EditWorkSpaces({ searchParams }) {
const data = await GetAllDataSets();
const workspaceDetails = await GetWorkspaceDetails(searchParams.id);
const data = await GetAllDataSets();
const workspaceDetails = await GetWorkspaceDetails(searchParams.id);

return (
<div className="w-full h-full overflow-y-auto custom-scroll mt-5 px-2 md:px-4">
<h1 className="text-2xl font-bold dark:text-white mb-10">
<Link href={`/settings/workspaces`}>Workspaces</Link>
<small>
<Link href={`/settings/workspaces/${searchParams.id}`}>
<small>
{workspaceDetails?.name && ` › ${workspaceDetails?.name}`}
</small>
</Link>{" "}
› Edit
</small>
</h1>
<EditSpaceCard datasets={data?.datasets} workspaceId={searchParams?.id} />
</div>
);
return (
<div className="w-full h-full overflow-y-auto custom-scroll mt-5 px-2 md:px-4">
<h1 className="text-2xl font-bold dark:text-white mb-10">
<Link href={`/settings/workspaces`}>Workspaces</Link>
<small>
<Link href={`/settings/workspaces/${searchParams.id}`}>
<small>{workspaceDetails?.name && ` › ${workspaceDetails?.name}`}</small>
</Link>{" "}
› Edit
</small>
</h1>
<EditSpaceCard datasets={data?.datasets} workspaceId={searchParams?.id} />
</div>
);
}
export const dynamic='force-dynamic';

70 changes: 30 additions & 40 deletions client/app/settings/workspaces/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,49 +6,39 @@ import AppTooltip from "@/components/AppTooltip";
import { Button } from "@/components/ui/button";
import { GetAllWorkspaces } from "@/services/spaces";

export const dynamic = 'force-dynamic';
export const dynamic = "force-dynamic";

export default async function WorkSpaces() {
const data = await GetAllWorkspaces();
const data = await GetAllWorkspaces();

return (
<div className="w-full overflow-y-auto custom-scroll px-2 mt-5 md:px-4 h-full">
<h1 className="text-2xl font-bold dark:text-white mb-10">Workspaces</h1>
return (
<div className="w-full overflow-y-auto custom-scroll px-2 mt-5 md:px-4 h-full">
<h1 className="text-2xl font-bold dark:text-white mb-10">Workspaces</h1>

<div className="grid 2xl:grid-cols-4 xl:grid-cols-3 lg:grid-cols-2 gap-4">
{data?.map((item, index) => (
<Card
key={index}
extra={
"w-full py-4 px-6 h-full border dark:border-none border-[#ccc]"
}
>
<div className="flex flex-col justify-center items-center gap-6 py-[30px]">
<div className="h-[65px] w-full overflow-hidden">
<AppTooltip text={item.name}>
<h1
data-tooltip-id={item.id}
className="dark:text-white font-bold font-montserrat text-[20px] text-center customellipsis"
>
{item.name}
</h1>
</AppTooltip>
</div>
<div className="grid 2xl:grid-cols-4 xl:grid-cols-3 lg:grid-cols-2 gap-4">
{data?.map((item, index) => (
<Card key={index} extra={"w-full py-4 px-6 h-full border dark:border-none border-[#ccc]"}>
<div className="flex flex-col justify-center items-center gap-6 py-[30px]">
<div className="h-[65px] w-full overflow-hidden">
<AppTooltip text={item.name}>
<h1 data-tooltip-id={item.id} className="dark:text-white font-bold font-montserrat text-[20px] text-center customellipsis">
{item.name}
</h1>
</AppTooltip>
</div>

<div className="w-full flex flex-wrap items-center justify-center mt-1">
<Link href={`/settings/workspaces/${item?.id}`}>
<Button>Details</Button>
</Link>
</div>
</div>
</Card>
))}
<Link href={"/settings/workspaces/addspaces"}>
<AddNewCard text="New workspace" />
</Link>
</div>
</div>
);
<div className="w-full flex flex-wrap items-center justify-center mt-1">
<Link href={`/settings/workspaces/${item?.id}`}>
<Button>Details</Button>
</Link>
</div>
</div>
</Card>
))}
<Link href={"/settings/workspaces/addspaces"}>
<AddNewCard text="New workspace" />
</Link>
</div>
</div>
);
}
export const dynamic='force-dynamic';

0 comments on commit c75e477

Please sign in to comment.