Skip to content

Commit

Permalink
fix: title fields validation and change poll max length title
Browse files Browse the repository at this point in the history
  • Loading branch information
andyesp committed Sep 27, 2023
1 parent 613dd39 commit 159d689
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/entities/Proposal/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ export const newProposalPollScheme = {
title: {
type: 'string',
minLength: 5,
maxLength: 200,
maxLength: 80,
},
description: {
type: 'string',
Expand Down
4 changes: 2 additions & 2 deletions src/pages/submit/governance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ export default function SubmitGovernanceProposal() {
name="title"
rules={{
required: { value: true, message: t('error.governance.title_empty') },
min: { value: schema.title.minLength, message: t('error.governance.title_too_short') },
max: { value: schema.title.maxLength, message: t('error.governance.title_too_long') },
minLength: { value: schema.title.minLength, message: t('error.governance.title_too_short') },
maxLength: { value: schema.title.maxLength, message: t('error.governance.title_too_large') },
}}
error={!!errors.title}
loading={isLoadingVpDistribution}
Expand Down
10 changes: 8 additions & 2 deletions src/pages/submit/pitch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,14 @@ export default function SubmitPitchProposal() {
name="initiative_name"
rules={{
required: { value: true, message: t('error.pitch.initiative_name_empty') },
min: { value: schema.initiative_name.minLength, message: t('error.pitch.initiative_name_too_short') },
max: { value: schema.initiative_name.maxLength, message: t('error.pitch.initiative_name_too_long') },
minLength: {
value: schema.initiative_name.minLength,
message: t('error.pitch.initiative_name_too_short'),
},
maxLength: {
value: schema.initiative_name.maxLength,
message: t('error.pitch.initiative_name_too_large'),
},
}}
error={!!errors.initiative_name}
loading={isLoadingVpDistribution}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/submit/tender.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ export default function SubmitTenderProposal() {
name="project_name"
rules={{
required: { value: true, message: t('error.tender.project_name_empty') },
min: { value: schema.project_name.minLength, message: t('error.tender.project_name_too_short') },
max: { value: schema.project_name.maxLength, message: t('error.tender.project_name_too_long') },
minLength: { value: schema.project_name.minLength, message: t('error.tender.project_name_too_short') },
maxLength: { value: schema.project_name.maxLength, message: t('error.tender.project_name_too_large') },
}}
error={!!errors.project_name}
loading={isLoadingVpDistribution}
Expand Down

0 comments on commit 159d689

Please sign in to comment.