Skip to content

Commit

Permalink
Merge pull request #692 from manikumarreddyu/revert-629-main
Browse files Browse the repository at this point in the history
Revert "Improve Client side form validation in Soil & Fertilizer section"
  • Loading branch information
manikumarreddyu authored Oct 27, 2024
2 parents c78af84 + 5ca4a21 commit c8687b8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 55 deletions.
27 changes: 8 additions & 19 deletions frontend/src/components/models/Fertilizer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,7 @@ export default function Component() {
<div className="mb-4">
<label className="block text-base font-medium mb-2" htmlFor="Temparature">Temparature</label>
<input
type="number"
max={50}
type="text"
id="Temparature"
name="Temparature"
value={formData.Temparature}
Expand All @@ -246,9 +245,7 @@ export default function Component() {
<div className="mb-4">
<label className="block text-base font-medium mb-2" htmlFor="Humidity">Humidity</label>
<input
type="number"
max={100}
min={0}
type="text"
id="Humidity"
name="Humidity"
value={formData.Humidity}
Expand All @@ -262,9 +259,7 @@ export default function Component() {
<div className="mb-4">
<label className="block text-base font-medium mb-2" htmlFor="Moisture">Moisture</label>
<input
type="number"
max={100}
min={0}
type="text"
id="Moisture"
name="Moisture"
value={formData.Moisture}
Expand Down Expand Up @@ -324,9 +319,7 @@ export default function Component() {
<div className="mb-4">
<label className="block text-base font-medium mb-2 " htmlFor="Nitrogen">Nitrogen</label>
<input
type="number"
max={50}
min={0}
type="text"
id="Nitrogen"
name="Nitrogen"
value={formData.Nitrogen}
Expand All @@ -340,9 +333,7 @@ export default function Component() {
<div className="mb-4">
<label className="block text-base font-medium mb-2" htmlFor="Potassium">Potassium</label>
<input
type="number"
max={50}
min={0}
type="text"
id="Potassium"
name="Potassium"
value={formData.Potassium}
Expand All @@ -356,9 +347,7 @@ export default function Component() {
<div className="mb-4">
<label className="block text-base font-medium mb-2" htmlFor="Phosphorous">Phosphorous</label>
<input
type="number"
max={50}
min={0}
type="text"
id="Phosphorous"
name="Phosphorous"
value={formData.Phosphorous}
Expand Down Expand Up @@ -483,7 +472,7 @@ export default function Component() {
</button>
</div>

<div className="fixed bottom-6 left-6 flex items-center space-x-3 rounded-full px-3 py-2 bg-green-600 shadow-lg">
<div className="fixed bottom-6 left-6 flex items-center space-x-3">
<div className="relative inline-block w-12 mr-2 align-middle select-none">
<input
type="checkbox"
Expand Down Expand Up @@ -514,4 +503,4 @@ export default function Component() {
`}</style>
</div>
)
}
}
48 changes: 12 additions & 36 deletions frontend/src/components/models/SoilQuality.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,7 @@ const SoilQuality = () => {
<div className="flex flex-col">
<label className="block text-left text-gray-700 font-semibold">Nitrogen</label>
<input
type="number"
min={0}
max={400}
type="text"
className="w-full px-4 py-2 mt-1 border border-green-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:outline-none transition-shadow"
id="N"
name="N"
Expand All @@ -356,9 +354,7 @@ const SoilQuality = () => {
<div className="flex flex-col">
<label className="block text-left text-gray-700 font-semibold">Phosphorus</label>
<input
type="number"
min={0}
max={150}
type="text"
className="w-full px-4 py-2 mt-1 border border-green-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:outline-none transition-shadow"
id="P"
name="P"
Expand All @@ -372,9 +368,7 @@ const SoilQuality = () => {
<div className="flex flex-col">
<label className="block text-left text-gray-700 font-semibold">Potassium</label>
<input
type="number"
min={0}
max={900}
type="text"
className="w-full px-4 py-2 mt-1 border border-green-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:outline-none transition-shadow"
id="K"
name="K"
Expand All @@ -388,9 +382,7 @@ const SoilQuality = () => {
<div className="flex flex-col">
<label className="block text-left text-gray-700 font-semibold">pH Level</label>
<input
type="number"
min={0}
max={14}
type="text"
className="w-full px-4 py-2 mt-1 border border-green-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:outline-none transition-shadow"
id="pH"
name="pH"
Expand All @@ -404,9 +396,7 @@ const SoilQuality = () => {
<div className="flex flex-col">
<label className="block text-left text-gray-700 font-semibold">Electrical Conductivity</label>
<input
type="number"
min={0}
max={1}
type="text"
className="w-full px-4 py-2 mt-1 border border-green-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:outline-none transition-shadow"
id="EC"
name="EC"
Expand All @@ -420,9 +410,7 @@ const SoilQuality = () => {
<div className="flex flex-col">
<label className="block text-left text-gray-700 font-semibold">Organic Carbon</label>
<input
type="number"
min={0}
max={2}
type="text"
className="w-full px-4 py-2 mt-1 border border-green-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:outline-none transition-shadow"
id="OC"
name="OC"
Expand All @@ -436,9 +424,7 @@ const SoilQuality = () => {
<div className="flex flex-col">
<label className="block text-left text-gray-700 font-semibold">Sulphur</label>
<input
type="number"
min={0}
max={30}
type="text"
className="w-full px-4 py-2 mt-1 border border-green-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:outline-none transition-shadow"
id="S"
name="S"
Expand All @@ -452,9 +438,7 @@ const SoilQuality = () => {
<div className="flex flex-col">
<label className="block text-left text-gray-700 font-semibold">Zinc</label>
<input
type="number"
min={0}
max={1}
type="text"
className="w-full px-4 py-2 mt-1 border border-green-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:outline-none transition-shadow"
id="Zn"
name="Zn"
Expand All @@ -468,9 +452,7 @@ const SoilQuality = () => {
<div className="flex flex-col">
<label className="block text-left text-gray-700 font-semibold">Iron</label>
<input
type="number"
min={0}
max={50}
type="text"
className="w-full px-4 py-2 mt-1 border border-green-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:outline-none transition-shadow"
id="Fe"
name="Fe"
Expand All @@ -484,9 +466,7 @@ const SoilQuality = () => {
<div className="flex flex-col">
<label className="block text-left text-gray-700 font-semibold">Copper</label>
<input
type="number"
min={0}
max={3}
type="text"
className="w-full px-4 py-2 mt-1 border border-green-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:outline-none transition-shadow"
id="Cu"
name="Cu"
Expand All @@ -500,9 +480,7 @@ const SoilQuality = () => {
<div className="flex flex-col">
<label className="block text-left text-gray-700 font-semibold">Manganese</label>
<input
type="number"
min={0}
max={30}
type="text"
className="w-full px-4 py-2 mt-1 border border-green-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:outline-none transition-shadow"
id="Mn"
name="Mn"
Expand All @@ -516,9 +494,7 @@ const SoilQuality = () => {
<div className="flex flex-col">
<label className="block text-left text-gray-700 font-semibold">Boron</label>
<input
type="number"
min={0}
max={3}
type="text"
className="w-full px-4 py-2 mt-1 border border-green-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:outline-none transition-shadow"
id="B"
name="B"
Expand Down

0 comments on commit c8687b8

Please sign in to comment.