fixed small changed like heading, font change

This commit is contained in:
pramod.mahajan 2025-09-30 11:59:16 +05:30
parent 764b145ad9
commit cfd3986479
5 changed files with 94 additions and 72 deletions

View File

@ -77,7 +77,7 @@ export const ReportTask = ({ report, closeModal }) => {
return ( return (
<div className="container m-0"> <div className="container m-0">
<div className="text-center"> <div className="text-center">
<p className="fs-6 fw-semibold">Report Task</p> <p className="fs-5 fw-semibold">Report Task</p>
</div> </div>
<div className="mb-1 row text-start"> <div className="mb-1 row text-start">
<label htmlFor="html5-text-input" className="col-md-4 col-form-label"> <label htmlFor="html5-text-input" className="col-md-4 col-form-label">
@ -101,16 +101,14 @@ export const ReportTask = ({ report, closeModal }) => {
<label htmlFor="html5-email-input" className="col-md-4 col-form-label"> <label htmlFor="html5-email-input" className="col-md-4 col-form-label">
Wrok Area : Wrok Area :
</label> </label>
<div className="col-md-8 text-start text-wrap"> <div className="col-md-8 text-start">
<label className=" col-form-label"> <div className="text-wrap">
{" "} {report?.workItem?.workArea?.floor?.building?.name} <i className="bx bx-chevron-right"></i>
{report?.workItem?.workArea?.floor?.building?.name}{" "} {report?.workItem?.workArea?.floor?.floorName} <i className="bx bx-chevron-right"></i>
<i className="bx bx-chevron-right"></i>{" "} {report?.workItem?.workArea?.areaName}
{report?.workItem?.workArea?.floor?.floorName}{" "} </div>
<i className="bx bx-chevron-right"> </i> </div>
{report?.workItem?.workArea?.areaName}
</label>
</div>
</div> </div>
<div className="mb-1 row text-start"> <div className="mb-1 row text-start">
<label htmlFor="html5-email-input" className="col-md-4 col-form-label"> <label htmlFor="html5-email-input" className="col-md-4 col-form-label">

View File

@ -4,6 +4,7 @@ import { zodResolver } from "@hookform/resolvers/zod";
import { string, z } from "zod"; import { string, z } from "zod";
import { import {
useActivitiesMaster, useActivitiesMaster,
useServices,
useWorkCategoriesMaster, useWorkCategoriesMaster,
} from "../../hooks/masterHook/useMaster"; } from "../../hooks/masterHook/useMaster";
import showToast from "../../services/toastService"; import showToast from "../../services/toastService";
@ -25,6 +26,8 @@ const SubTask = ({ activity, onClose }) => {
const { activities, loading } = useActivitiesMaster(); const { activities, loading } = useActivitiesMaster();
const { categories, categoryLoading } = useWorkCategoriesMaster(); const { categories, categoryLoading } = useWorkCategoriesMaster();
const { Task, loading: TaskLoading } = useTaskById(activity?.id); const { Task, loading: TaskLoading } = useTaskById(activity?.id);
const {data,isError,isLoading,error} = useServices();
const { const {
register, register,
handleSubmit, handleSubmit,
@ -97,8 +100,8 @@ const SubTask = ({ activity, onClose }) => {
}; };
return ( return (
<div className="container-xxl my-1"> <div className="container-xxl my-1">
<p className="fw-semibold">Create Sub Task</p> <p className="fw-semibold fs-5">Create Sub Task</p>
<form className="row g-2" onSubmit={handleSubmit(onSubmitForm)}> <form className="row g-2 text-start" onSubmit={handleSubmit(onSubmitForm)}>
<div className="col-6"> <div className="col-6">
<label className="form-label">Building</label> <label className="form-label">Building</label>
<input <input
@ -128,27 +131,15 @@ const SubTask = ({ activity, onClose }) => {
disabled disabled
/> />
</div> </div>
<div className="col-12">
<div className="col-12"> <label className="form-label">Service</label>
<label className="form-label">Work Category</label> <input
<select type="text"
className="form-select form-select-sm" className="form-control form-control-sm"
{...register("workCategoryId")} value={activity?.workItem?.activityMaster?.activityGroup?.service?.name || ""}
onChange={handleCategoryChange} disabled
> />
<option value=""> </div>
{categoryLoading ? "Loading..." : "-- Select Category --"}
</option>
{categoryData.map((category) => (
<option key={category.id} value={category.id}>
{category.name}
</option>
))}
</select>
{errors.workCategoryId && (
<div className="danger-text">{errors.workCategoryId.message}</div>
)}
</div>
<div className="col-12"> <div className="col-12">
<label className="form-label">Select Activity</label> <label className="form-label">Select Activity</label>
<select <select
@ -172,6 +163,27 @@ const SubTask = ({ activity, onClose }) => {
)} )}
</div> </div>
<div className="col-12">
<label className="form-label">Work Category</label>
<select
className="form-select form-select-sm"
{...register("workCategoryId")}
onChange={handleCategoryChange}
>
<option value="">
{categoryLoading ? "Loading..." : "-- Select Category --"}
</option>
{categoryData.map((category) => (
<option key={category.id} value={category.id}>
{category.name}
</option>
))}
</select>
{errors.workCategoryId && (
<div className="danger-text">{errors.workCategoryId.message}</div>
)}
</div>
<div className="col-4"> <div className="col-4">
<label className="form-label">Planned Work</label> <label className="form-label">Planned Work</label>
<input <input
@ -219,7 +231,15 @@ const SubTask = ({ activity, onClose }) => {
)} )}
</div> </div>
<div className="col-12 text-center"> <div className="d-flex flex-row gap-3 justify-content-end py-2">
<button
type="button"
className="btn btn-sm btn-label-secondary"
onClick={() => onClose()}
disabled={isPending}
>
Cancel
</button>
<button <button
type="submit" type="submit"
className="btn btn-sm btn-primary me-2" className="btn btn-sm btn-primary me-2"
@ -227,14 +247,7 @@ const SubTask = ({ activity, onClose }) => {
> >
{isPending ? "Please wait..." : "Submit"} {isPending ? "Please wait..." : "Submit"}
</button> </button>
<button
type="button"
className="btn btn-sm btn-secondary"
onClick={() => onClose()}
disabled={isPending}
>
Cancel
</button>
</div> </div>
</form> </form>
</div> </div>

View File

@ -8,6 +8,7 @@ import {
useCreateDocumentCatgory, useCreateDocumentCatgory,
useUpdateDocumentCategory, useUpdateDocumentCategory,
} from "../../hooks/masterHook/useMaster"; } from "../../hooks/masterHook/useMaster";
import Label from "../common/Label";
export const Document_Entity = Object.entries(DOCUMENTS_ENTITIES).map( export const Document_Entity = Object.entries(DOCUMENTS_ENTITIES).map(
([key, value]) => ({ key, value }) ([key, value]) => ({ key, value })
@ -74,9 +75,9 @@ const ManageDocumentCategory = ({ data, onClose }) => {
) : ( ) : (
<div> <div>
<div> <div>
<p className="fw-semibold"> {/* <p className="fw-semibold">
{data ? "Update Document Category" : "Add Document Category"} {data ? "Update Document Category" : "Add Document Category"}
</p> </p> */}
</div> </div>
<form <form
@ -84,7 +85,7 @@ const ManageDocumentCategory = ({ data, onClose }) => {
onSubmit={handleSubmit(onSubmit)} onSubmit={handleSubmit(onSubmit)}
> >
<div className="col-12"> <div className="col-12">
<label className="form-label">Category Name</label> <Label required >Category Name</Label>
<input <input
type="text" type="text"
{...register("name")} {...register("name")}
@ -96,7 +97,7 @@ const ManageDocumentCategory = ({ data, onClose }) => {
</div> </div>
<div className="col-12"> <div className="col-12">
<label className="form-label">Select Entity</label> <Label required >Select Entity</Label>
<select <select
className="form-select form-select-sm" className="form-select form-select-sm"
{...register("entityTypeId")} {...register("entityTypeId")}
@ -114,7 +115,7 @@ const ManageDocumentCategory = ({ data, onClose }) => {
</div> </div>
<div className="col-12"> <div className="col-12">
<label className="form-label">Description</label> <Label required >Description</Label>
<textarea <textarea
rows="3" rows="3"
{...register("description")} {...register("description")}
@ -125,7 +126,15 @@ const ManageDocumentCategory = ({ data, onClose }) => {
)} )}
</div> </div>
<div className="col-12 text-center"> <div className="d-flex flex-row justify-content-end gap-3 ">
<button
type="button"
className="btn btn-sm btn-label-secondary"
onClick={onClose}
disabled={isPending || Updating}
>
Cancel
</button>
<button <button
type="submit" type="submit"
className="btn btn-sm btn-primary me-3" className="btn btn-sm btn-primary me-3"
@ -137,14 +146,7 @@ const ManageDocumentCategory = ({ data, onClose }) => {
? "Update" ? "Update"
: "Submit"} : "Submit"}
</button> </button>
<button
type="button"
className="btn btn-sm btn-secondary"
onClick={onClose}
disabled={isPending || Updating}
>
Cancel
</button>
</div> </div>
</form> </form>
</div> </div>

View File

@ -4,6 +4,7 @@ import { z } from "zod";
import { zodResolver } from "@hookform/resolvers/zod"; import { zodResolver } from "@hookform/resolvers/zod";
import { useCreateDocumentType, useDocumentCategories, useUpdateDocumentType } from "../../hooks/masterHook/useMaster"; import { useCreateDocumentType, useDocumentCategories, useUpdateDocumentType } from "../../hooks/masterHook/useMaster";
import { DOCUMENTS_ENTITIES } from "../../utils/constants"; import { DOCUMENTS_ENTITIES } from "../../utils/constants";
import Label from "../common/Label";
export const Document_Entity = Object.entries(DOCUMENTS_ENTITIES).map( export const Document_Entity = Object.entries(DOCUMENTS_ENTITIES).map(
@ -84,14 +85,14 @@ const onSubmit = (payload) => {
<FormProvider {...methods}> <FormProvider {...methods}>
<form className="row g-2 text-start" onSubmit={handleSubmit(onSubmit)}> <form className="row g-2 text-start" onSubmit={handleSubmit(onSubmit)}>
<div className="text-center"> <div className="text-center">
<p className="fw-semibold"> {/* <p className="fw-semibold">
{data ? "Edit Document Type" : "Add Document Type"} {data ? "Edit Document Type" : "Add Document Type"}
</p> </p> */}
</div> </div>
{/* Name */} {/* Name */}
<div className="col-12"> <div className="col-12">
<label className="form-label">Name</label> <Label required>Name</Label>
<input <input
type="text" type="text"
{...register("name")} {...register("name")}
@ -112,7 +113,7 @@ const onSubmit = (payload) => {
{/* Allowed Content Type */} {/* Allowed Content Type */}
<div className="col-12"> <div className="col-12">
<label className="form-label">Allowed Content Type</label> <Label required>Allowed Content Type</Label>
<input <input
type="text" type="text"
{...register("allowedContentType")} {...register("allowedContentType")}
@ -174,7 +175,7 @@ const onSubmit = (payload) => {
</div> </div>
{/* Category */} {/* Category */}
<div className="col-12"> <div className="col-12">
<label className="form-label">Document Category</label> <Label required> Document Category</Label>
<select <select
{...register("documentCategoryId")} {...register("documentCategoryId")}
className={`form-select form-select-sm`} className={`form-select form-select-sm`}
@ -194,7 +195,15 @@ const onSubmit = (payload) => {
</div> </div>
{/* Buttons */} {/* Buttons */}
<div className="col-12 text-center"> <div className="d-flex flex-row justify-content-end gap-3 ">
<button
type="button"
className="btn btn-sm btn-label-secondary"
onClick={onClose}
disabled={creating || updating}
>
Cancel
</button>
<button <button
type="submit" type="submit"
className="btn btn-sm btn-primary me-3" className="btn btn-sm btn-primary me-3"
@ -206,14 +215,7 @@ const onSubmit = (payload) => {
? "Update" ? "Update"
: "Submit"} : "Submit"}
</button> </button>
<button
type="button"
className="btn btn-sm btn-secondary"
onClick={onClose}
disabled={creating || updating}
>
Cancel
</button>
</div> </div>
</form> </form>
</FormProvider> </FormProvider>

View File

@ -69,7 +69,14 @@ const MasterModal = ({ modaldata, closeModal }) => {
), ),
}; };
return modalComponents[modalType] || null; return (
<>
<div className="text-center">
<p className="fs-5 fw-semibold" >{`${masterType, " ", modalType}`}</p>
</div>
{ modalComponents[modalType] || null}
</>
);
}; };
export default MasterModal; export default MasterModal;