✅ Versiones actualizadas:
Frontend: v1.2.1 → v1.2.2 Backend: v1.0.97 → v1.0.98 Cambios en v1.2.2 / v1.0.98: ✅ Fix crítico: Error createObjectURL al continuar inspecciones existentes ✅ Soporte para fotos como File (nuevas) y URL string (existentes)
This commit is contained in:
@@ -276,7 +276,7 @@ def extract_pdf_text_smart(pdf_content: bytes, max_chars: int = None) -> dict:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BACKEND_VERSION = "1.0.97"
|
BACKEND_VERSION = "1.0.98"
|
||||||
app = FastAPI(title="Checklist Inteligente API", version=BACKEND_VERSION)
|
app = FastAPI(title="Checklist Inteligente API", version=BACKEND_VERSION)
|
||||||
|
|
||||||
# S3/MinIO configuration
|
# S3/MinIO configuration
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "checklist-frontend",
|
"name": "checklist-frontend",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "1.2.1",
|
"version": "1.2.2",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Service Worker para PWA con detección de actualizaciones
|
// Service Worker para PWA con detección de actualizaciones
|
||||||
// IMPORTANTE: Actualizar esta versión cada vez que se despliegue una nueva versión
|
// IMPORTANTE: Actualizar esta versión cada vez que se despliegue una nueva versión
|
||||||
const CACHE_NAME = 'ayutec-v1.2.1';
|
const CACHE_NAME = 'ayutec-v1.2.2';
|
||||||
const urlsToCache = [
|
const urlsToCache = [
|
||||||
'/',
|
'/',
|
||||||
'/index.html'
|
'/index.html'
|
||||||
|
|||||||
@@ -5175,33 +5175,40 @@ function InspectionModal({ checklist, existingInspection, user, onClose, onCompl
|
|||||||
{answers[currentQuestion.id].photos.length} archivo(s) cargado(s):
|
{answers[currentQuestion.id].photos.length} archivo(s) cargado(s):
|
||||||
</div>
|
</div>
|
||||||
<div className="grid grid-cols-3 gap-2">
|
<div className="grid grid-cols-3 gap-2">
|
||||||
{answers[currentQuestion.id].photos.map((photo, index) => (
|
{answers[currentQuestion.id].photos.map((photo, index) => {
|
||||||
<div key={index} className="relative group">
|
// Determinar si es un archivo nuevo (File/Blob) o una URL existente (string)
|
||||||
{photo.type === 'application/pdf' ? (
|
const isFile = photo instanceof File || photo instanceof Blob
|
||||||
<div className="w-full h-24 flex flex-col items-center justify-center bg-red-50 border-2 border-red-300 rounded-lg">
|
const isPDF = isFile ? photo.type === 'application/pdf' : photo.endsWith('.pdf')
|
||||||
<span className="text-3xl">📝</span>
|
const photoURL = isFile ? URL.createObjectURL(photo) : photo
|
||||||
<span className="text-xs text-red-700 mt-1">PDF</span>
|
|
||||||
|
return (
|
||||||
|
<div key={index} className="relative group">
|
||||||
|
{isPDF ? (
|
||||||
|
<div className="w-full h-24 flex flex-col items-center justify-center bg-red-50 border-2 border-red-300 rounded-lg">
|
||||||
|
<span className="text-3xl">📝</span>
|
||||||
|
<span className="text-xs text-red-700 mt-1">PDF</span>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<img
|
||||||
|
src={photoURL}
|
||||||
|
alt={`Foto ${index + 1}`}
|
||||||
|
className="w-full h-24 object-cover rounded-lg border border-gray-300"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={() => handleRemovePhoto(currentQuestion.id, index)}
|
||||||
|
className="absolute top-1 right-1 bg-red-600 text-white rounded-full p-1 opacity-0 group-hover:opacity-100 transition-opacity"
|
||||||
|
title="Eliminar foto"
|
||||||
|
>
|
||||||
|
✕
|
||||||
|
</button>
|
||||||
|
<div className="text-xs text-center text-gray-600 mt-1">
|
||||||
|
{isPDF ? (isFile ? photo.name : 'PDF') : `Foto ${index + 1}`}
|
||||||
</div>
|
</div>
|
||||||
) : (
|
|
||||||
<img
|
|
||||||
src={URL.createObjectURL(photo)}
|
|
||||||
alt={`Foto ${index + 1}`}
|
|
||||||
className="w-full h-24 object-cover rounded-lg border border-gray-300"
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
onClick={() => handleRemovePhoto(currentQuestion.id, index)}
|
|
||||||
className="absolute top-1 right-1 bg-red-600 text-white rounded-full p-1 opacity-0 group-hover:opacity-100 transition-opacity"
|
|
||||||
title="Eliminar foto"
|
|
||||||
>
|
|
||||||
✕
|
|
||||||
</button>
|
|
||||||
<div className="text-xs text-center text-gray-600 mt-1">
|
|
||||||
{photo.type === 'application/pdf' ? photo.name : `Foto ${index + 1}`}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
)
|
||||||
))}
|
})}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Analyze Button - Solo para ai_mode assisted/full y NO para ai_assistant */}
|
{/* Analyze Button - Solo para ai_mode assisted/full y NO para ai_assistant */}
|
||||||
|
|||||||
@@ -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"
|
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">
|
<p className="text-xs text-indigo-300 font-medium hover:text-indigo-200">
|
||||||
Ayutec v1.2.1
|
Ayutec v1.2.2
|
||||||
</p>
|
</p>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user