-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update README.md * Teams (#97) * Add prisma adapter. Remove unused code. Add session & accounts data in database. * Update prisma scheme to allow teams * Remove unused files in favour of CSS classes * Add team name * Add util for getting current user * Update dashboard route name * Add dialog to create team * Ensure github username, name and email are stored upon auth * Ensure user id is accessible in session * Automatically create team upon new user sign in. Add option to create new teams and route accordingly. * Redirect after team is successfully created * Add route for settings & add option to delete team * Ensure nav works correctly. Add route to handle team settings. Add placeholder button. * Fetch projects for a team * Ensure only projects per team are fetched * Update schema to track requests for adding projects * Add button to create project * Break up github webhook into smaller files. Ensure team id is matched with relevant project. * Update lockfile * Ensure all pathname work. Rename repo to project for consistency. * Refactor instructions * Remove unused code * Add slug to projects * Make sure all routes are consistent * Ensure feedback works. Allow longer feedback input. * Fix * Fix nav * Fix * Add back commented code * Update stripe API route * Update env variable name * Fix * Fix * Fix * Update schema for clarity * Rename files, remove unnecessary toasts * Ensure search works * Add team slug to usage redirects. Rename repo to project for consistency. * UI fixes * Make sure all nav components are consistent * Update README.md * Schema commit * migration schema (#98) * migration schema * onboarding flow for next-auth * onboard legacy projects * only connect orphaned projects * reinstall * set rubric ts pack at latest --------- Co-authored-by: Dexter Storey <36115192+DexterStorey@users.noreply.github.com> Co-authored-by: DexterStorey <dexter@dexterstorey.com> --------- Co-authored-by: Sarim Malik <sarim@rubriclabs.com>
- Loading branch information
1 parent
a9b096d
commit 36fcd40
Showing
83 changed files
with
1,452 additions
and
801 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import {redirect} from 'next/navigation' | ||
import {Suspense} from 'react' | ||
import Projects from '~/components/dashboard/Projects/ProjectsList' | ||
import {getCurrentUser} from '~/utils/session' | ||
|
||
export default async function Dashboard({params}: {params: {slug: string}}) { | ||
const user = await getCurrentUser() | ||
if (!user) redirect('/') | ||
|
||
const team = await prisma.team.findUnique({ | ||
where: {slug: params.slug}, | ||
select: {id: true} | ||
}) | ||
const projects = await prisma.project.findMany({ | ||
where: { | ||
teamId: team.id | ||
}, | ||
include: { | ||
instructions: true | ||
} | ||
}) | ||
|
||
return ( | ||
<div className='flex flex-col items-center'> | ||
<Suspense fallback={<p>Loading...</p>}> | ||
<Projects | ||
teamId={team.id} | ||
slug={params.slug} | ||
projects={projects} | ||
/> | ||
</Suspense> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import {TrashIcon} from 'lucide-react' | ||
import {Button} from '~/components/ui/button' | ||
|
||
export default function Settings() { | ||
return ( | ||
<div className='flex h-full w-full flex-col gap-4'> | ||
<h3>Settings</h3> | ||
<Button | ||
className='w-fit' | ||
variant='destructive'> | ||
Delete team <TrashIcon className='h-4 w-4' /> | ||
</Button> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import DashboardHeader from '~/components/dashboard/Navigation/DashboardHeader' | ||
import {getCurrentUser} from '~/utils/session' | ||
|
||
async function Teams() { | ||
const user = await getCurrentUser() | ||
if (!user) return <></> | ||
|
||
const teams = await prisma.membership | ||
.findMany({ | ||
where: {userId: user.id}, | ||
select: {team: true} | ||
}) | ||
.then(memberships => memberships.map(m => m.team)) | ||
|
||
return ( | ||
<DashboardHeader | ||
user={user} | ||
teams={teams} | ||
/> | ||
) | ||
} | ||
|
||
export default async function RootLayout({ | ||
children | ||
}: { | ||
children: React.ReactNode | ||
}) { | ||
return ( | ||
<div className='relative min-h-screen w-full px-8'> | ||
<Teams /> | ||
<div className='w-full'>{children}</div> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 8 additions & 4 deletions
12
app/dashboard/repo/[projectId]/layout.tsx → app/[slug]/project/[projectId]/layout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export default async function Page({params}: {params: {projectId: string}}) { | ||
const project = await prisma.project.findUnique({ | ||
where: {id: params.projectId} | ||
}) | ||
return ( | ||
<div className='flex flex-col gap-4'> | ||
<h3>{project.name}</h3> | ||
</div> | ||
) | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import {TrashIcon} from 'lucide-react' | ||
import {Button} from '~/components/ui/button' | ||
|
||
export default function Settings() { | ||
return ( | ||
<div className='flex h-full w-full flex-col gap-4'> | ||
<h3>Settings</h3> | ||
<Button | ||
variant='destructive' | ||
className='w-fit'> | ||
Delete project <TrashIcon className='h-4 w-4' /> | ||
</Button> | ||
</div> | ||
) | ||
} |
Oops, something went wrong.
36fcd40
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
maige – ./
maige-git-main-rubriclabs.vercel.app
maige.app
triage.rubric.sh
www.maige.app
maige-rubriclabs.vercel.app
maige.rubric.sh