diff --git a/CHANGELOG.md b/CHANGELOG.md index 30301fb..0efceca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog - project.linkedcorp.net +## [2.10.2] - 2026-10-12 +### Added +- Tarjetas de Notas: ícono junto a la fecha cuando la nota está compartida (ya sea que la + compartiste con alguien, o que te la compartieron a ti). +- Buscador junto al título "Notas" que filtra las tarjetas en vivo por contenido. + ## [2.10.1] - 2026-10-12 ### Fixed - "Probar correo" en Configuración → Correo mostraba "Error interno" en vez de un mensaje diff --git a/VERSION b/VERSION index 8bbb6e4..c6436a8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.10.1 +2.10.2 diff --git a/backend/package.json b/backend/package.json index f949b35..4ace589 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "project-linkedcorp-backend", - "version": "2.10.1", + "version": "2.10.2", "private": true, "type": "module", "main": "src/server.js", diff --git a/backend/src/modules/notes/repository.js b/backend/src/modules/notes/repository.js index ca64b58..8ebb8dd 100644 --- a/backend/src/modules/notes/repository.js +++ b/backend/src/modules/notes/repository.js @@ -5,14 +5,15 @@ import { pool } from '../../config/db.js'; export async function findVisibleToUser(userId) { const [rows] = await pool.query( `SELECT n.id, n.user_id, n.content, n.created_at, n.updated_at, - (n.user_id = ?) AS is_owner, u.name AS owner_name + (n.user_id = ?) AS is_owner, u.name AS owner_name, + (SELECT COUNT(*) FROM note_shares ns WHERE ns.note_id = n.id) AS share_count FROM notes n JOIN users u ON u.id = n.user_id WHERE n.user_id = ? OR n.id IN (SELECT note_id FROM note_shares WHERE user_id = ?) ORDER BY n.updated_at DESC`, [userId, userId, userId] ); - return rows.map((r) => ({ ...r, is_owner: !!r.is_owner })); + return rows.map((r) => ({ ...r, is_owner: !!r.is_owner, share_count: Number(r.share_count) })); } export async function findById(id) { diff --git a/frontend/package.json b/frontend/package.json index 495b0a4..af2c7d4 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,7 +1,7 @@ { "name": "project-linkedcorp-frontend", "private": true, - "version": "2.10.1", + "version": "2.10.2", "type": "module", "scripts": { "dev": "vite", diff --git a/frontend/src/pages/Notas/NotasPage.jsx b/frontend/src/pages/Notas/NotasPage.jsx index 2bdfcf3..cf71b8a 100644 --- a/frontend/src/pages/Notas/NotasPage.jsx +++ b/frontend/src/pages/Notas/NotasPage.jsx @@ -10,6 +10,7 @@ import { Button } from '../../components/Button.jsx'; import { Field } from '../../components/Field.jsx'; import { ComboBox } from '../../components/ComboBox.jsx'; import { DetailPopup } from '../../components/DetailPopup.jsx'; +import { SearchInput } from '../../components/SearchInput.jsx'; function formatDateTime(value) { return String(value).slice(0, 16).replace('T', ' '); @@ -26,6 +27,7 @@ export default function NotasPage() { const [content, setContent] = useState(''); const [shares, setShares] = useState([]); const [sharingWith, setSharingWith] = useState(''); + const [search, setSearch] = useState(''); function openCreate() { setSelected(null); @@ -101,20 +103,27 @@ export default function NotasPage() { if (!notes) return
{t('common_loading')}
; + const query = search.trim().toLowerCase(); + const filteredNotes = query ? notes.filter((n) => n.content.toLowerCase().includes(query)) : notes; + return (
-

{t('notes_title')}

+
+

{t('notes_title')}

+ +
- {notes.map((note) => ( + {filteredNotes.map((note) => (
openNote(note)}>
{note.content}
- + + {(note.is_owner ? note.share_count > 0 : true) && } {note.created_at === note.updated_at ? formatDateTime(note.created_at) : `${t('notes_updated')} ${formatDateTime(note.updated_at)}`} @@ -125,7 +134,11 @@ export default function NotasPage() { ))}
- {notes.length === 0 &&
{t('notes_empty')}
} + {filteredNotes.length === 0 && ( +
+ {query ? t('common_search_no_results') : t('notes_empty')} +
+ )}