Frontend v1.3.5:
CORREGIDO: Validación de fotos obligatorias ahora usa photo_requirement === 'required' en lugar de allow_photos Las preguntas con photo_requirement configurado como 'none' o 'optional' ya NO exigirán fotos obligatorias Aplica para ambos botones: "Siguiente →" y "Finalizar Inspección" Problema corregido: Antes: La validación usaba currentQuestion.allow_photos (campo antiguo booleano) Ahora: Usa currentQuestion.photo_requirement === 'required' (nuevo sistema de 3 estados)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "checklist-frontend",
|
||||
"private": true,
|
||||
"version": "1.3.4",
|
||||
"version": "1.3.5",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Service Worker para PWA con detección de actualizaciones
|
||||
// IMPORTANTE: Actualizar esta versión cada vez que se despliegue una nueva versión
|
||||
const CACHE_NAME = 'ayutec-v1.3.4';
|
||||
const CACHE_NAME = 'ayutec-v1.3.5';
|
||||
const urlsToCache = [
|
||||
'/',
|
||||
'/index.html'
|
||||
|
||||
@@ -5347,7 +5347,7 @@ function InspectionModal({ checklist, existingInspection, user, onClose, onCompl
|
||||
<button
|
||||
onClick={() => {
|
||||
// Validar que se hayan subido fotos si son obligatorias
|
||||
if (currentQuestion.allow_photos && (!answers[currentQuestion.id]?.photos || answers[currentQuestion.id].photos.length === 0)) {
|
||||
if (currentQuestion.photo_requirement === 'required' && (!answers[currentQuestion.id]?.photos || answers[currentQuestion.id].photos.length === 0)) {
|
||||
alert('⚠️ Debes subir al menos una fotografía para esta pregunta')
|
||||
return
|
||||
}
|
||||
@@ -5393,7 +5393,7 @@ function InspectionModal({ checklist, existingInspection, user, onClose, onCompl
|
||||
<button
|
||||
onClick={() => {
|
||||
// Validar que se hayan subido fotos si son obligatorias
|
||||
if (currentQuestion.allow_photos && (!answers[currentQuestion.id]?.photos || answers[currentQuestion.id].photos.length === 0)) {
|
||||
if (currentQuestion.photo_requirement === 'required' && (!answers[currentQuestion.id]?.photos || answers[currentQuestion.id].photos.length === 0)) {
|
||||
alert('⚠️ Debes subir al menos una fotografía para esta pregunta')
|
||||
return
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ export default function Sidebar({ user, activeTab, setActiveTab, sidebarOpen, se
|
||||
className="w-10 h-10 object-contain bg-white rounded p-1"
|
||||
/>
|
||||
<p className="text-xs text-indigo-300 font-medium hover:text-indigo-200">
|
||||
Ayutec v1.3.4
|
||||
Ayutec v1.3.5
|
||||
</p>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user