mirror of
https://github.com/R0m1k3/Regisflow.git
synced 2026-10-20 13:48:21 +02:00
Set the default quantity to one when adding new products to a sale
Sets the default `quantite` value to '1' in `NewSaleForm.tsx` and updates the input placeholder. Replit-Commit-Author: Agent Replit-Commit-Session-Id: e80fed01-7137-4997-b9af-dad57132d430 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/0715008c-7244-40f4-befc-26c014852236/e80fed01-7137-4997-b9af-dad57132d430/J2iBQMm
This commit is contained in:
1 parent
76d47c72c7
commit
e0f15ad15d
2 files changed
+8
-3
No files matched your search
@@ -64,7 +64,7 @@ export default function NewSaleForm() {
|
|||||||
const form = useForm<FormData>({
|
const form = useForm<FormData>({
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
vendeur: '',
|
vendeur: '',
|
||||||
products: [{ typeArticle: '', categorie: '', quantite: '', gencode: '' }],
|
products: [{ typeArticle: '', categorie: '', quantite: '1', gencode: '' }],
|
||||||
nom: '',
|
nom: '',
|
||||||
prenom: '',
|
prenom: '',
|
||||||
dateNaissance: '',
|
dateNaissance: '',
|
||||||
@@ -85,7 +85,7 @@ export default function NewSaleForm() {
|
|||||||
|
|
||||||
const addProduct = () => {
|
const addProduct = () => {
|
||||||
const currentProducts = form.getValues('products');
|
const currentProducts = form.getValues('products');
|
||||||
form.setValue('products', [...currentProducts, { typeArticle: '', categorie: '', quantite: '', gencode: '' }]);
|
form.setValue('products', [...currentProducts, { typeArticle: '', categorie: '', quantite: '1', gencode: '' }]);
|
||||||
};
|
};
|
||||||
|
|
||||||
const removeProduct = (index: number) => {
|
const removeProduct = (index: number) => {
|
||||||
@@ -454,7 +454,7 @@ export default function NewSaleForm() {
|
|||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>Quantité <span className="text-destructive">*</span></FormLabel>
|
<FormLabel>Quantité <span className="text-destructive">*</span></FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Input type="number" min="1" placeholder="Entrez la quantité" className="modern-input" {...field} />
|
<Input type="number" min="1" placeholder="1" className="modern-input" {...field} />
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|||||||
@@ -332,6 +332,11 @@ Preferred communication style: Simple, everyday language.
|
|||||||
- ✅ **Validation Adjustment**: Photos no longer required for form submission compliance
|
- ✅ **Validation Adjustment**: Photos no longer required for form submission compliance
|
||||||
- ✅ **User Experience**: Added explanatory text to reduce confusion about photo requirements
|
- ✅ **User Experience**: Added explanatory text to reduce confusion about photo requirements
|
||||||
|
|
||||||
|
### Form Usability Improvements (January 19, 2025)
|
||||||
|
- ✅ **Default Quantity**: Set product quantity field to default value of 1 for better user experience
|
||||||
|
- ✅ **Streamlined Input**: Users no longer need to manually enter quantity for single item purchases
|
||||||
|
- ✅ **Placeholder Update**: Changed placeholder text to reflect default value
|
||||||
|
|
||||||
### Docker Configuration & Cleanup (January 9, 2025)
|
### Docker Configuration & Cleanup (January 9, 2025)
|
||||||
- ✅ Complete Docker setup optimized for external PostgreSQL database
|
- ✅ Complete Docker setup optimized for external PostgreSQL database
|
||||||
- ✅ Docker Compose configuration with RegisFlow application only
|
- ✅ Docker Compose configuration with RegisFlow application only
|
||||||
|
|||||||
Reference in new issue
Block a user