-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for pausing and resuming projects, refs #52
feat: add DangerZone component to Overview page to handle project deletion and notice deletion fix: change project prop to projectId in ConfirmationDialog component fix: change handleDeleteProjectConfirm and handleDeleteProjectNoticesConfirm to not receive projectId as parameter fix: add invalidateProjectsCache, invalidateProjectCache and invalidateAllProjectCache functions to invalidate cache when a project is deleted or paused fix: toggleProjectPausedStatus function to toggle paused status of a project fix: add paused field to Project model in Prisma schema fix: add paused column to projects table in migration file
- Loading branch information
1 parent
75403c2
commit 2680907
Showing
6 changed files
with
84 additions
and
37 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import ConfirmationDialog from '@/components/ConfirmationDialog'; | ||
import { getProjectById } from '@/lib/queries/projects'; | ||
|
||
type DangerZoneProps = { | ||
projectId: string; | ||
}; | ||
|
||
async function DangerZone({ projectId }: DangerZoneProps) { | ||
const project = await getProjectById(projectId); | ||
if (!project) { | ||
throw new Error('Project not found'); | ||
} | ||
|
||
return ( | ||
<> | ||
<h3 className="text-base font-semibold leading-6 text-rose-500">Danger Zone</h3> | ||
<div className="mt-6 space-y-4"> | ||
<div className="grid grid-cols-1 justify-items-center gap-4"> | ||
<ConfirmationDialog | ||
projectId={project.id} | ||
title="Delete All Errors" | ||
body={`Are you sure you want to delete all exceptions for the project "${project.name}"? This action cannot be undone.`} | ||
btnId="deleteAllErrors" | ||
/> | ||
|
||
<ConfirmationDialog | ||
projectId={project.id} | ||
title="Delete Project" | ||
body={`Are you sure you want to delete the project "${project.name}"? This action cannot be undone.`} | ||
btnId="deleteProject" | ||
/> | ||
</div> | ||
</div> | ||
</> | ||
); | ||
} | ||
|
||
export default DangerZone as unknown as (props: DangerZoneProps) => JSX.Element; |
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
2 changes: 2 additions & 0 deletions
2
prisma/migrations/20230529041233_add_paused_to_projects/migration.sql
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,2 @@ | ||
-- AlterTable | ||
ALTER TABLE "projects" ADD COLUMN "paused" BOOLEAN NOT NULL DEFAULT false; |
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