Resolving Error in EditActivitymodal.
This commit is contained in:
parent
5a8a8c4676
commit
7eb2274584
@ -263,90 +263,25 @@ const EditActivityModal = ({
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="col-12 text-start">
|
<div className="col-12 text-end mt-5">
|
||||||
<label className="form-label">Select Work Category</label>
|
<button
|
||||||
<select
|
type="button"
|
||||||
{...register("workCategoryId")}
|
className="btn btn-sm btn-label-secondary me-2"
|
||||||
className="form-select form-select-sm"
|
onClick={onClose}
|
||||||
>
|
disabled={isPending}
|
||||||
<option disabled>Select Category</option>
|
>
|
||||||
{loadingCategories ? (
|
Cancel
|
||||||
<option>Loading...</option>
|
</button>
|
||||||
) : (
|
<button
|
||||||
sortedCategories.map((c) => (
|
type="submit"
|
||||||
<option key={c.id} value={c.id}>
|
className="btn btn-sm btn-primary"
|
||||||
{c.name}
|
disabled={isPending}
|
||||||
</option>
|
>
|
||||||
))
|
{isPending ? "Please Wait..." : "Edit Task"}
|
||||||
)}
|
</button>
|
||||||
</select>
|
</div>
|
||||||
{errors.workCategoryId && (
|
</form>
|
||||||
<p className="danger-text">{errors.workCategoryId.message}</p>
|
</AppFormProvider>
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="col-5 text-start">
|
|
||||||
<label className="form-label">Planned Work</label>
|
|
||||||
<input
|
|
||||||
{...register("plannedWork", { valueAsNumber: true })}
|
|
||||||
type="number"
|
|
||||||
step="0.01" // <-- allows 2 decimal places
|
|
||||||
className="form-control form-control-sm"
|
|
||||||
/>
|
|
||||||
|
|
||||||
{errors.plannedWork && (
|
|
||||||
<p className="danger-text">{errors.plannedWork.message}</p>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="col-5 text-start">
|
|
||||||
<label className="form-label">Completed Work</label>
|
|
||||||
<input
|
|
||||||
{...register("completedWork", { valueAsNumber: true })}
|
|
||||||
type="number"
|
|
||||||
disabled={getValues("completedWork") > 0}
|
|
||||||
className="form-control form-control-sm"
|
|
||||||
/>
|
|
||||||
{errors.completedWork && (
|
|
||||||
<p className="danger-text">{errors.completedWork.message}</p>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="col-2 text-start">
|
|
||||||
<label className="form-label">Unit</label>
|
|
||||||
<input
|
|
||||||
className="form-control form-control-sm"
|
|
||||||
disabled
|
|
||||||
value={selectedActivity?.unitOfMeasurement || ""}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="col-12 text-start">
|
|
||||||
<label className="form-label">Comment</label>
|
|
||||||
<textarea {...register("comment")} rows="2" className="form-control" />
|
|
||||||
{errors.comment && (
|
|
||||||
<div className="danger-text">{errors.comment.message}</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="col-12 text-end mt-5">
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className="btn btn-sm btn-label-secondary me-2"
|
|
||||||
onClick={onClose}
|
|
||||||
disabled={isPending}
|
|
||||||
>
|
|
||||||
Cancel
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
type="submit"
|
|
||||||
className="btn btn-sm btn-primary"
|
|
||||||
disabled={isPending}
|
|
||||||
>
|
|
||||||
{isPending ? "Please Wait..." : "Edit Task"}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user