From b156cf763e4442c9ea0ba8359c48b78ee9a7e4f5 Mon Sep 17 00:00:00 2001 From: Matt Casey Date: Mon, 5 Feb 2024 11:48:36 -0700 Subject: [PATCH] remove use of proposal category (#3590) * remove use of proposal category * undo special core v --- lib/proposal/createRewardsForProposal.ts | 1 - lib/templates/exportWorkspacePages.ts | 4 ---- scripts/exportProposalScores.ts | 8 -------- .../2023_12_04_createDefaultRewardsAndProposals.ts | 1 + .../migrations/2024_01_03_transferProposalCategories.ts | 2 +- 5 files changed, 2 insertions(+), 14 deletions(-) diff --git a/lib/proposal/createRewardsForProposal.ts b/lib/proposal/createRewardsForProposal.ts index 00b87cfdaf..49f8a7da66 100644 --- a/lib/proposal/createRewardsForProposal.ts +++ b/lib/proposal/createRewardsForProposal.ts @@ -96,7 +96,6 @@ export async function createRewardsForProposal({ proposalId, userId }: { userId: include: { authors: true, reviewers: true, - category: true, rubricAnswers: true, rubricCriteria: { orderBy: { diff --git a/lib/templates/exportWorkspacePages.ts b/lib/templates/exportWorkspacePages.ts index abb143baeb..5b62a72837 100644 --- a/lib/templates/exportWorkspacePages.ts +++ b/lib/templates/exportWorkspacePages.ts @@ -187,10 +187,6 @@ export async function exportWorkspacePages({ } } }); - // unset categoryId until its removed from the db - if (proposal?.categoryId) { - proposal.categoryId = null; - } node.proposal = proposal; } diff --git a/scripts/exportProposalScores.ts b/scripts/exportProposalScores.ts index d9880d17a1..141feb9862 100644 --- a/scripts/exportProposalScores.ts +++ b/scripts/exportProposalScores.ts @@ -9,7 +9,6 @@ type ExportedProposal = { proposalUrl: string; authors: string; title: string; - category: string; total: string | number; average: string | number; rubricResults: string; @@ -21,7 +20,6 @@ const exportedFormat: Record = { authors: 'Author', proposalUrl: 'Proposal URL', title: 'Title', - category: 'Category', total: 'Total', average: 'Average', rubricResults: 'Rubric Results' @@ -50,11 +48,6 @@ async function exportEvaluatedProposalScores({ domain }: { domain: string }) { } }, include: { - category: { - select: { - title: true - } - }, rubricAnswers: true, rubricCriteria: { orderBy: { @@ -142,7 +135,6 @@ async function exportEvaluatedProposalScores({ domain }: { domain: string }) { authors: p.authors.map((a) => a.author.username).join(newLine), average: results.allScores.average ?? '-', total: results.allScores.sum ?? '-', - category: p.category?.title ?? 'Unnamed Category', title: p.page?.title ?? 'Proposal', proposalUrl: `https://app.charmverse.io/${domain}/${p.page?.path}`, rubricResults: rubricDetails?.trim() ? rubricDetails.trim() : '-' diff --git a/scripts/migrations/2023_12_04_createDefaultRewardsAndProposals.ts b/scripts/migrations/2023_12_04_createDefaultRewardsAndProposals.ts index 8558f74779..ea8091192c 100644 --- a/scripts/migrations/2023_12_04_createDefaultRewardsAndProposals.ts +++ b/scripts/migrations/2023_12_04_createDefaultRewardsAndProposals.ts @@ -1,3 +1,4 @@ +// @ts-nocheck import { prisma } from '@charmverse/core/prisma-client'; import { createDefaultProposal } from 'lib/proposal/createDefaultProposal'; import { upsertDefaultRewardsBoard } from 'lib/rewards/blocks/upsertDefaultRewardsBoard'; diff --git a/scripts/migrations/2024_01_03_transferProposalCategories.ts b/scripts/migrations/2024_01_03_transferProposalCategories.ts index 64ca8ad31f..c5fe6c177b 100644 --- a/scripts/migrations/2024_01_03_transferProposalCategories.ts +++ b/scripts/migrations/2024_01_03_transferProposalCategories.ts @@ -1,3 +1,4 @@ +// @ts-nocheck import { prisma } from '@charmverse/core/prisma-client'; import { getDefaultBoard, getDefaultTableView } from 'components/proposals/components/ProposalsBoard/utils/boardData'; import { Block, blockToPrisma } from 'lib/focalboard/block'; @@ -14,7 +15,6 @@ async function transferProposalCategories() { proposals: { select: { id: true, - categoryId: true, fields: true } },