Skip to content

Commit

Permalink
Merge pull request #61 from techulus/main
Browse files Browse the repository at this point in the history
Weekly release
  • Loading branch information
arjunkomath authored Jan 26, 2025
2 parents 5899ceb + 7f30595 commit 975e02f
Show file tree
Hide file tree
Showing 76 changed files with 5,206 additions and 1,574 deletions.
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ ENV NEXT_TELEMETRY_DISABLED=1
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs

COPY --from=builder /app/public ./public

COPY --from=builder --chown=nextjs:nodejs /app/public ./public
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static

Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@ Manage is an open-source project management app inspired by Basecamp. With its i
- [x] Files - Uploading and sharing files
- [x] Comments
- [x] Events / Calendar
- [ ] Activity logs
- [x] Activity logs
- [ ] Notifications
- [ ] Discussions / Forums
- [ ] Chat
- [ ] Search
- [ ] Permissions
- [ ] Billing

## Development

Expand Down
28 changes: 26 additions & 2 deletions app/(auth)/sign-in/page.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
import { logtoConfig } from "@/app/logto";
import { Button } from "@/components/ui/button";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { DotPattern } from "@/components/ui/dot-pattern";
import { cn } from "@/lib/utils";
import { signIn } from "@logto/next/server-actions";
import Image from "next/image";
import Link from "next/link";
import logo from "../../../public/images/logo.png";

export default function SignInForm() {
export default async function SignInForm(props: {
searchParams: Promise<{
demo: string;
}>;
}) {
const query = await props.searchParams;
const isDemo = query.demo === "true";

return (
<div className="m-6 flex h-full items-center justify-center">
<Card className="w-full max-w-md">
<DotPattern />
<Card className="w-full max-w-md z-10">
<div className="flex p-6 lg:flex-1">
<Image
src={logo}
Expand All @@ -34,6 +44,20 @@ export default function SignInForm() {
</CardHeader>

<CardContent className="grid gap-4">
{isDemo ? (
<div className="bg-gray-100 dark:bg-gray-800 p-4 rounded-md space-y-2">
<p className="text-sm text-gray-600 dark:text-gray-300">
Try the demo account to see how it works, login with the
following credentials.
</p>
<div className="text-sm text-gray-600 dark:text-gray-300">
User ID: <pre className="font-semibold">demo</pre>
</div>
<div className="text-sm text-gray-600 dark:text-gray-300">
Password: <pre className="font-semibold">w-okDQsz</pre>
</div>
</div>
) : null}
<Button
type="button"
onClick={async () => {
Expand Down
35 changes: 22 additions & 13 deletions app/(dashboard)/[tenant]/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import NavBar from "@/components/console/navbar";
import { AppSidebar } from "@/components/app-sidebar";
import { ReportTimezone } from "@/components/core/report-timezone";
import { SidebarProvider, SidebarTrigger } from "@/components/ui/sidebar";
import { isDatabaseReady } from "@/lib/utils/useDatabase";
import { getOwner } from "@/lib/utils/useOwner";
import { getOwner, getUser } from "@/lib/utils/useOwner";
import { redirect } from "next/navigation";

export const fetchCache = "force-no-store"; // disable cache for console pages
Expand All @@ -13,12 +14,13 @@ export default async function ConsoleLayout(props: {
tenant: string;
}>;
}) {
const params = await props.params;
const { tenant } = await props.params;

const { children } = props;
const { orgId, orgSlug, userId } = await getOwner();
const { orgSlug } = await getOwner();
const user = await getUser();

if (params.tenant !== orgSlug) {
if (tenant !== orgSlug) {
redirect("/start");
}

Expand All @@ -28,17 +30,24 @@ export default async function ConsoleLayout(props: {
}

return (
<div className="relative flex min-h-full flex-col">
<NavBar activeOrgId={orgId ?? userId} activeOrgSlug={orgSlug} />

<div className="mx-auto w-full flex-grow lg:flex">
<SidebarProvider>
<AppSidebar
user={{
firstName: user.firstName ?? "",
email: user.email ?? "",
imageUrl: null,
}}
/>
<main className="relative mx-auto w-full flex-grow lg:flex">
<SidebarTrigger className="absolute top-[18px] left-4 z-50" />
<div className="min-w-0 flex-1 xl:flex">
<div className="min-h-screen bg-gray-50 dark:bg-gray-900 lg:min-w-0 lg:flex-1">
<div className="min-h-screen bg-gray-50 dark:bg-gray-900 lg:min-w-0 lg:flex-1 pb-8">
{children}
</div>
</div>
</div>
<ReportTimezone />
</div>

<ReportTimezone />
</main>
</SidebarProvider>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ type Props = {
};

export default async function EditDocument(props: Props) {
const params = await props.params;
const { orgSlug } = await getOwner();
const document = await getDocumentById(params.documentId);
const backUrl = `/${orgSlug}/projects/${params.projectId}/documents/${document.id}`;
const params = await props.params;
const { orgSlug } = await getOwner();
const document = await getDocumentById(params.documentId);
const backUrl = `/${orgSlug}/projects/${params.projectId}/documents/${document.id}`;

return (
return (
<>
<PageTitle title="Update Document" backUrl={backUrl} />
<PageTitle title="Update Document" />

<PageSection topInset>
<form action={updateDocument}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ type Props = {
};

export default async function DocumentDetails(props: Props) {
const params = await props.params;
const { projectId, documentId } = params;
const params = await props.params;
const { projectId, documentId } = params;

const { orgSlug } = await getOwner();
const db = await database();
const documentDetails = await db.query.document.findFirst({
const { orgSlug } = await getOwner();
const db = await database();
const documentDetails = await db.query.document.findFirst({
where: eq(document.id, +documentId),
with: {
folder: true,
},
});

if (!documentDetails) {
if (!documentDetails) {
return null;
}

return (
return (
<>
<PageTitle
title={documentDetails.name}
Expand All @@ -42,13 +42,9 @@ export default async function DocumentDetails(props: Props) {
? `Documents / ${documentDetails.folder?.name}`
: "Document"
}
backUrl={
documentDetails.folderId
? `/${orgSlug}/projects/${projectId}/documents/folders/${documentDetails.folderId}`
: `/${orgSlug}/projects/${projectId}/documents`
}
actionLabel="Edit"
actionLink={`/${orgSlug}/projects/${projectId}/documents/${documentId}/edit`}
actionType="edit"
/>

<PageSection topInset>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ type Props = {
};

export default async function EditDocumentFolder(props: Props) {
const params = await props.params;
const { orgSlug } = await getOwner();
const backUrl = `/${orgSlug}/projects/${params.projectId}/documents/folders/${params.folderId}`;
const db = await database();
const folder = await db.query.documentFolder.findFirst({
const params = await props.params;
const { orgSlug } = await getOwner();
const backUrl = `/${orgSlug}/projects/${params.projectId}/documents/folders/${params.folderId}`;
const db = await database();
const folder = await db.query.documentFolder.findFirst({
where: eq(documentFolder.id, +params.folderId),
});

return (
return (
<>
<PageTitle title="Update Folder" backUrl={backUrl} />
<PageTitle title="Update Folder" />

<PageSection topInset>
<form action={updateDocumentFolder}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ type Props = {
};

export default async function CreateDocument(props: Props) {
const params = await props.params;
const { orgSlug } = await getOwner();
const backUrl = `/${orgSlug}/projects/${params.projectId}/documents/folders/${params.folderId}`;
return (
const params = await props.params;
const { orgSlug } = await getOwner();
const backUrl = `/${orgSlug}/projects/${params.projectId}/documents/folders/${params.folderId}`;
return (
<>
<PageTitle title="Create Document" backUrl={backUrl} />
<PageTitle title="Create Document" />
<PageSection topInset>
<form action={createDocument}>
<input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ type Props = {
};

export default async function FolderDetails(props: Props) {
const params = await props.params;
const { orgSlug } = await getOwner();
const { projectId, folderId } = params;
const params = await props.params;
const { orgSlug } = await getOwner();
const { projectId, folderId } = params;

const db = await database();
const folder: FolderWithContents | undefined =
const db = await database();
const folder: FolderWithContents | undefined =
await db.query.documentFolder.findFirst({
where: eq(documentFolder.id, Number(folderId)),
with: {
Expand All @@ -63,18 +63,18 @@ export default async function FolderDetails(props: Props) {
},
});

if (!folder) {
if (!folder) {
return null;
}

return (
return (
<>
<PageTitle
title={folder?.name}
subTitle="Documents"
backUrl={`/${orgSlug}/projects/${projectId}/documents`}
actionLabel="Edit"
actionLink={`/${orgSlug}/projects/${projectId}/documents/folders/${folderId}/edit`}
actionType="edit"
/>

<PageSection topInset>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ type Props = {
};

export default async function CreateDocumentFolder(props: Props) {
const params = await props.params;
const { orgSlug } = await getOwner();
const backUrl = `/${orgSlug}/projects/${params.projectId}/documents`;
return (
const params = await props.params;
const { orgSlug } = await getOwner();
const backUrl = `/${orgSlug}/projects/${params.projectId}/documents`;
return (
<>
<PageTitle title="Create Folder" backUrl={backUrl} />
<PageTitle title="Create Folder" />
<PageSection topInset>
<form action={createDocumentFolder}>
<input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ type Props = {
};

export default async function CreateDocument(props: Props) {
const params = await props.params;
const { orgSlug } = await getOwner();
const backUrl = `/${orgSlug}/projects/${params.projectId}/documents`;
return (
const params = await props.params;
const { orgSlug } = await getOwner();
const backUrl = `/${orgSlug}/projects/${params.projectId}/documents`;
return (
<>
<PageTitle title="Create Document" backUrl={backUrl} />
<PageTitle title="Create Document" />
<PageSection topInset>
<form action={createDocument}>
<input
Expand Down
12 changes: 6 additions & 6 deletions app/(dashboard)/[tenant]/projects/[projectId]/edit/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ interface Props {
}

export default async function EditProject(props: Props) {
const params = await props.params;
const { projectId } = params;
const params = await props.params;
const { projectId } = params;

const project = await getProjectById(projectId);
const { orgSlug } = await getOwner();
const project = await getProjectById(projectId);
const { orgSlug } = await getOwner();

return (
return (
<>
<PageTitle title={project.name} backUrl={`/${orgSlug}/projects`} />
<PageTitle title={project.name} />

<PageSection topInset>
<form action={updateProject}>
Expand Down
Loading

0 comments on commit 975e02f

Please sign in to comment.