From 0c6dafa61dfb14d058160f670b29dc97a5c30e4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor?= Date: Sun, 16 Jun 2024 18:43:55 +0200 Subject: [PATCH] regex --- .../AntDesign/modals/Detail_post_modal.tsx | 8 +- .../AntDesign/modals/Docent_post_modal.tsx | 127 +++++++++--------- .../modals/Enrolments_post_modal.tsx | 4 +- .../AntDesign/modals/Fault_post_modal.tsx | 24 ++-- .../AntDesign/modals/Profile_edit_modal.tsx | 21 +-- src/consts/regex.js | 4 +- 6 files changed, 97 insertions(+), 91 deletions(-) diff --git a/src/components/AntDesign/modals/Detail_post_modal.tsx b/src/components/AntDesign/modals/Detail_post_modal.tsx index 65a2132..31185b9 100644 --- a/src/components/AntDesign/modals/Detail_post_modal.tsx +++ b/src/components/AntDesign/modals/Detail_post_modal.tsx @@ -90,7 +90,7 @@ const ServiceConsumptionModal: React.FC = ({ footer={null} >
- + - + - + - + diff --git a/src/components/AntDesign/modals/Docent_post_modal.tsx b/src/components/AntDesign/modals/Docent_post_modal.tsx index b52fe94..d4a21ca 100644 --- a/src/components/AntDesign/modals/Docent_post_modal.tsx +++ b/src/components/AntDesign/modals/Docent_post_modal.tsx @@ -4,6 +4,7 @@ import { FaPhotoVideo, FaPencilAlt } from 'react-icons/fa'; import "@/styles/styles.css"; import imageBase64 from "@/services/client/logic/imageBase64"; import postCheckProfilePhoto from "@/services/client/fetching/hooks/postCheckProfilePhoto.tsx"; +import regex from '@/consts/regex'; import postStudent from '@/services/client/fetching/hooks/postStudent' import postTeacher from '@/services/client/fetching/hooks/postTeacher' @@ -149,7 +150,7 @@ const Docent_post_modal: React.FC = () => { - + { {profilePhotoSrc ? : } - - - - - - - - - - - - - - - - - - - - - - - - - - form.setFieldsValue({ active: e.target.checked })} /> - - - - - - - - - - - - - - - - - form.setFieldsValue({ employed: e.target.checked })} /> - - - - - - - - form.setFieldsValue({ is_admin: e.target.checked })} /> - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + form.setFieldsValue({ active: e.target.checked })} /> + + + + + + + + + + + + + + + + + form.setFieldsValue({ employed: e.target.checked })} /> + + + + + + + + form.setFieldsValue({ is_admin: e.target.checked })} /> + + + - - + + + + - diff --git a/src/components/AntDesign/modals/Enrolments_post_modal.tsx b/src/components/AntDesign/modals/Enrolments_post_modal.tsx index a182468..fd2ac0d 100644 --- a/src/components/AntDesign/modals/Enrolments_post_modal.tsx +++ b/src/components/AntDesign/modals/Enrolments_post_modal.tsx @@ -36,14 +36,14 @@ const Enrolments_post_modal: React.FC<{ students: Student[], subjects: Subject[]
- + - + {students.map((student: Student) => ( ))} - + - + - + form.setFieldsValue({ justified: e.target.checked })} /> - + diff --git a/src/components/AntDesign/modals/Profile_edit_modal.tsx b/src/components/AntDesign/modals/Profile_edit_modal.tsx index 19aaa0c..19b2f19 100644 --- a/src/components/AntDesign/modals/Profile_edit_modal.tsx +++ b/src/components/AntDesign/modals/Profile_edit_modal.tsx @@ -11,6 +11,7 @@ import {deleteCookieLoacalStorage} from "@/services/client/utils/utils_typed"; import Refresh from "@/services/client/logic/Refresh"; import postCheckProfilePhoto from "@/services/client/fetching/hooks/postCheckProfilePhoto.tsx"; import { ConfigProvider } from 'antd'; +import regex from '@/consts/regex'; const { Option } = Select; @@ -112,7 +113,7 @@ const Profile_edit_modal: React.FC = ({ onCancel={handleCancel} > - + = ({ - + - + - + - + - + - + - + - + - + diff --git a/src/consts/regex.js b/src/consts/regex.js index aa19522..e3ba8e7 100644 --- a/src/consts/regex.js +++ b/src/consts/regex.js @@ -6,7 +6,9 @@ const regex = { courseAcronym: /^[A-Z]{2}_[A-Z]{2}[0-9]$/, regularName: /^[a-zA-Z\s]+$/, address: /^[a-zA-Z0-9\s\.,#-]+$/, - username: /^[a-zA-Z0-9_]{4,16}$/ + username: /^[a-zA-Z0-9_]{4,16}$/, + description: /^[a-zA-Z0-9\s\.,#-]{1,200}$/, + dni: /^[0-9]{8}[A-Z]$/ }; export default regex; \ No newline at end of file