Compare commits

...

2 Commits

Author SHA1 Message Date
YasinShaikh123
a108dcdb17 Merge branch 'sprint10/reversal' of http://git.wdipl.com/Siddhesh.More/tanami-admin-panel into sprint10/reversal 2025-01-20 19:36:56 +05:30
YasinShaikh123
41a1bde62b [ deletion request modal bugs ] 2025-01-20 19:35:58 +05:30
2 changed files with 15 additions and 8 deletions

View File

@@ -3,6 +3,7 @@ import {
Box,
Button,
FormControl,
FormHelperText,
FormLabel,
Input,
Modal,
@@ -36,12 +37,12 @@ import {
const FILE_TYPES = ["image/jpeg", "image/png", "image/gif"];
// export const conformModalSchema = yup.object().shape({
// adminComment: yup.string().notRequired(),
// });
export const conformModalSchema = yup.object().shape({
adminComment: yup
.string()
.min(2, "Comment contain at least 2 character")
.max(150, "Comment contain at less then 150 character")
.notRequired(),
adminComment: yup.string().notRequired(),
});
const DeletionRequestApprove = ({
@@ -66,6 +67,7 @@ const DeletionRequestApprove = ({
const {
register,
reset,
watch,
handleSubmit,
formState: { errors },
} = useForm({
@@ -184,6 +186,10 @@ const DeletionRequestApprove = ({
{errors.adminComment.message}
</Text>
)}
<FormHelperText fontSize="xs" color="gray.500">
<Text as={'span'} me={2}> Maximum length should be 200 characters. You have entered</Text>
{watch("adminComment")?.length || 0} characters.
</FormHelperText>
</FormControl>
</ModalBody>
<ModalFooter>
@@ -193,9 +199,10 @@ const DeletionRequestApprove = ({
type="submit"
size={"sm"}
rounded={"sm"}
variant={"ghost"}
onClick={() => setIsReject(true)}
variant={'ghost'}
onClick={()=> setIsReject(true)}
isLoading={isBtnLoadingReject}
fontWeight={500}
>
Reject
</Button>

View File

@@ -140,7 +140,7 @@ const RequestApproveModal = ({ isOpen, onClose, firstField ,id}) => {
rounded={"md"}
resize={"none"}
maxLength={200}
/>
/>
{errors.checkerComment && (
<Text fontSize="xs" color="red">
{errors.checkerComment.message}