File tree Expand file tree Collapse file tree 9 files changed +33
-5
lines changed
components/dialog/content/error Expand file tree Collapse file tree 9 files changed +33
-5
lines changed Original file line number Diff line number Diff line change 124124 :aria-label =" $t('issueReport.provideAdditionalDetails')"
125125 />
126126 <Message
127- v-if =" $field?.error && $field.touched && $field.value "
127+ v-if =" $field?.error && $field.touched"
128128 severity =" error"
129129 size =" small"
130130 variant =" simple"
131131 >
132- {{ t('issueReport.validation.maxLength') }}
132+ {{
133+ $field.value
134+ ? t('issueReport.validation.maxLength')
135+ : t('issueReport.validation.descriptionRequired')
136+ }}
133137 </Message >
134138 </FormField >
135139 </div >
Original file line number Diff line number Diff line change 203203 "validation" : {
204204 "maxLength" : " Message too long" ,
205205 "invalidEmail" : " Please enter a valid email address" ,
206- "selectIssueType" : " Please select an issue type"
206+ "selectIssueType" : " Please select an issue type" ,
207+ "descriptionRequired" : " Description is required" ,
208+ "helpTypeRequired" : " Help type is required"
207209 }
208210 },
209211 "color" : {
Original file line number Diff line number Diff line change 498498 "submitErrorReport" : " Enviar Reporte de Error (Opcional)" ,
499499 "systemStats" : " Estadísticas del Sistema" ,
500500 "validation" : {
501+ "descriptionRequired" : " Se requiere una descripción" ,
502+ "helpTypeRequired" : " Se requiere el tipo de ayuda" ,
501503 "invalidEmail" : " Por favor ingresa una dirección de correo electrónico válida" ,
502504 "maxLength" : " Mensaje demasiado largo" ,
503505 "selectIssueType" : " Por favor, seleccione un tipo de problema"
Original file line number Diff line number Diff line change 498498 "submitErrorReport" : " Soumettre un rapport d'erreur (Facultatif)" ,
499499 "systemStats" : " Statistiques du système" ,
500500 "validation" : {
501+ "descriptionRequired" : " La description est requise" ,
502+ "helpTypeRequired" : " Le type d'aide est requis" ,
501503 "invalidEmail" : " Veuillez entrer une adresse e-mail valide" ,
502504 "maxLength" : " Message trop long" ,
503505 "selectIssueType" : " Veuillez sélectionner un type de problème"
Original file line number Diff line number Diff line change 498498 "submitErrorReport" : " エラーレポートを提出する(オプション)" ,
499499 "systemStats" : " システム統計" ,
500500 "validation" : {
501+ "descriptionRequired" : " 説明は必須です" ,
502+ "helpTypeRequired" : " ヘルプの種類は必須です" ,
501503 "invalidEmail" : " 有効なメールアドレスを入力してください" ,
502504 "maxLength" : " メッセージが長すぎます" ,
503505 "selectIssueType" : " 問題の種類を選択してください"
Original file line number Diff line number Diff line change 498498 "submitErrorReport" : " 오류 보고서 제출 (선택 사항)" ,
499499 "systemStats" : " 시스템 통계" ,
500500 "validation" : {
501+ "descriptionRequired" : " 설명은 필수입니다" ,
502+ "helpTypeRequired" : " 도움 유형은 필수입니다" ,
501503 "invalidEmail" : " 유효한 이메일 주소를 입력해 주세요" ,
502504 "maxLength" : " 메시지가 너무 깁니다" ,
503505 "selectIssueType" : " 문제 유형을 선택해 주세요"
Original file line number Diff line number Diff line change 498498 "submitErrorReport" : " Отправить отчёт об ошибке (необязательно)" ,
499499 "systemStats" : " Статистика системы" ,
500500 "validation" : {
501+ "descriptionRequired" : " Описание обязательно" ,
502+ "helpTypeRequired" : " Тип помощи обязателен" ,
501503 "invalidEmail" : " Пожалуйста, введите действительный адрес электронной почты" ,
502504 "maxLength" : " Сообщение слишком длинное" ,
503505 "selectIssueType" : " Пожалуйста, выберите тип проблемы"
Original file line number Diff line number Diff line change 498498 "submitErrorReport" : " 提交错误报告(可选)" ,
499499 "systemStats" : " 系统状态" ,
500500 "validation" : {
501+ "descriptionRequired" : " 描述为必填项" ,
502+ "helpTypeRequired" : " 帮助类型为必选项" ,
501503 "invalidEmail" : " 请输入有效的电子邮件地址" ,
502504 "maxLength" : " 消息过长" ,
503505 "selectIssueType" : " 请选择一个问题类型"
Original file line number Diff line number Diff line change 11import { z } from 'zod'
22
3+ import { t } from '@/i18n'
4+
35const checkboxField = z . boolean ( ) . optional ( )
46export const issueReportSchema = z
57 . object ( {
68 contactInfo : z . string ( ) . email ( ) . max ( 320 ) . optional ( ) . or ( z . literal ( '' ) ) ,
7- details : z . string ( ) . max ( 5_000 ) . optional ( ) ,
9+ details : z
10+ . string ( )
11+ . min ( 1 , { message : t ( 'validation.descriptionRequired' ) } )
12+ . max ( 5_000 , { message : t ( 'validation.maxLength' , { length : 5_000 } ) } )
13+ . optional ( ) ,
814 helpType : z . string ( ) . optional ( )
915 } )
1016 . catchall ( checkboxField )
1117 . refine ( ( data ) => Object . values ( data ) . some ( ( value ) => value ) , {
1218 path : [ 'details' , 'helpType' ]
1319 } )
1420 . refine ( ( data ) => data . helpType !== undefined && data . helpType !== '' , {
15- message : 'Help type is required' ,
21+ message : t ( 'issueReport.validation.helpTypeRequired' ) ,
1622 path : [ 'helpType' ]
1723 } )
24+ . refine ( ( data ) => data . details !== undefined && data . details !== '' , {
25+ message : t ( 'issueReport.validation.descriptionRequired' ) ,
26+ path : [ 'details' ]
27+ } )
1828export type IssueReportFormData = z . infer < typeof issueReportSchema >
You can’t perform that action at this time.
0 commit comments