Move required reviews field into evaluation settings and add live voting migration
Move the "Required Reviews per Project" field from the Basic Information card into the Evaluation Settings section of RoundTypeSettings, where it contextually belongs. Add missing database migration for live voting enhancements (criteria voting, audience voting, AudienceVoter table). Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -304,33 +304,6 @@ function EditRoundContent({ roundId }: { roundId: string }) {
|
||||
)}
|
||||
/>
|
||||
|
||||
{ROUND_FIELD_VISIBILITY[roundType]?.showRequiredReviews && (
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="requiredReviews"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Required Reviews per Project</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
type="number"
|
||||
min={1}
|
||||
max={10}
|
||||
{...field}
|
||||
onChange={(e) =>
|
||||
field.onChange(parseInt(e.target.value) || 1)
|
||||
}
|
||||
/>
|
||||
</FormControl>
|
||||
<FormDescription>
|
||||
Minimum number of evaluations each project should receive
|
||||
</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
|
||||
{ROUND_FIELD_VISIBILITY[roundType]?.showAssignmentLimits && (
|
||||
<div className="grid gap-4 sm:grid-cols-2">
|
||||
<FormField
|
||||
@@ -393,6 +366,32 @@ function EditRoundContent({ roundId }: { roundId: string }) {
|
||||
onRoundTypeChange={setRoundType}
|
||||
settings={roundSettings}
|
||||
onSettingsChange={setRoundSettings}
|
||||
requiredReviewsField={
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="requiredReviews"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Required Reviews per Project</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
type="number"
|
||||
min={1}
|
||||
max={10}
|
||||
{...field}
|
||||
onChange={(e) =>
|
||||
field.onChange(parseInt(e.target.value) || 1)
|
||||
}
|
||||
/>
|
||||
</FormControl>
|
||||
<FormDescription>
|
||||
Minimum number of evaluations each project should receive
|
||||
</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
|
||||
{/* Voting Window */}
|
||||
|
||||
@@ -294,30 +294,6 @@ function CreateRoundContent() {
|
||||
)}
|
||||
/>
|
||||
|
||||
{ROUND_FIELD_VISIBILITY[roundType]?.showRequiredReviews && (
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="requiredReviews"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Required Reviews per Project</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
type="number"
|
||||
min={1}
|
||||
max={10}
|
||||
{...field}
|
||||
onChange={(e) => field.onChange(parseInt(e.target.value) || 1)}
|
||||
/>
|
||||
</FormControl>
|
||||
<FormDescription>
|
||||
Minimum number of evaluations each project should receive
|
||||
</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
@@ -327,6 +303,30 @@ function CreateRoundContent() {
|
||||
onRoundTypeChange={setRoundType}
|
||||
settings={roundSettings}
|
||||
onSettingsChange={setRoundSettings}
|
||||
requiredReviewsField={
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="requiredReviews"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Required Reviews per Project</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
type="number"
|
||||
min={1}
|
||||
max={10}
|
||||
{...field}
|
||||
onChange={(e) => field.onChange(parseInt(e.target.value) || 1)}
|
||||
/>
|
||||
</FormControl>
|
||||
<FormDescription>
|
||||
Minimum number of evaluations each project should receive
|
||||
</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
|
||||
{ROUND_FIELD_VISIBILITY[roundType]?.showVotingWindow && (
|
||||
|
||||
@@ -35,6 +35,7 @@ interface RoundTypeSettingsProps {
|
||||
onRoundTypeChange: (type: 'FILTERING' | 'EVALUATION' | 'LIVE_EVENT') => void
|
||||
settings: Record<string, unknown>
|
||||
onSettingsChange: (settings: Record<string, unknown>) => void
|
||||
requiredReviewsField?: React.ReactNode
|
||||
}
|
||||
|
||||
const roundTypeIcons = {
|
||||
@@ -54,6 +55,7 @@ export function RoundTypeSettings({
|
||||
onRoundTypeChange,
|
||||
settings,
|
||||
onSettingsChange,
|
||||
requiredReviewsField,
|
||||
}: RoundTypeSettingsProps) {
|
||||
const Icon = roundTypeIcons[roundType]
|
||||
|
||||
@@ -145,6 +147,7 @@ export function RoundTypeSettings({
|
||||
<EvaluationSettings
|
||||
settings={getEvaluationSettings()}
|
||||
onChange={(s) => onSettingsChange(s as unknown as Record<string, unknown>)}
|
||||
requiredReviewsField={requiredReviewsField}
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -319,14 +322,19 @@ function FilteringSettings({
|
||||
function EvaluationSettings({
|
||||
settings,
|
||||
onChange,
|
||||
requiredReviewsField,
|
||||
}: {
|
||||
settings: EvaluationRoundSettings
|
||||
onChange: (settings: EvaluationRoundSettings) => void
|
||||
requiredReviewsField?: React.ReactNode
|
||||
}) {
|
||||
return (
|
||||
<div className="space-y-6 border-t pt-4">
|
||||
<h4 className="font-medium">Evaluation Settings</h4>
|
||||
|
||||
{/* Required Reviews (passed from parent form) */}
|
||||
{requiredReviewsField}
|
||||
|
||||
{/* Target Finalists */}
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="targetFinalists">Target Finalists</Label>
|
||||
|
||||
Reference in New Issue
Block a user