new file: public/favicon.svg

deleted:    src/assets/hero.png
modified:   src/components/AppShell.jsx
modified:   src/components/calendar/AgendaDailyView.jsx
modified:   src/components/calendar/AgendaMonthlyView.jsx
modified:   src/components/calendar/AgendaWeeklyView.jsx
modified:   src/hooks/useAgenda.js
modified:   src/index.css
modified:   src/mappers/appointmentMapper.js
modified:   src/mappers/reportMapper.js
modified:   src/pages/AgendaPage.jsx
modified:   src/pages/AuthPages.jsx
modified:   src/pages/HomePage.jsx
modified:   src/pages/MessagesPage.jsx
modified:   src/pages/PatientsPage.jsx
modified:   src/pages/ProfilePage.jsx
modified:   src/pages/ReportsPage.jsx
modified:   src/pages/SettingsPage.jsx
modified:   src/repositories/appointmentRepository.js
modified:   src/repositories/settingsRepository.js
This commit is contained in:
2026-05-08 01:32:46 -03:00
parent bc900fbdd4
commit 94dab58d85
20 changed files with 1206 additions and 447 deletions

View File

@@ -47,8 +47,6 @@ const emptyEditor = {
conclusion: '',
contentHtml: '',
contentJson: undefined,
hideDate: false,
hideSignature: false,
dueAt: '',
}
@@ -253,15 +251,16 @@ export function ReportsPage({ role }) {
conclusion: report.conclusion,
contentHtml: report.contentHtml,
contentJson: report.contentJson,
hideDate: report.hideDate,
hideSignature: report.hideSignature,
dueAt: toDateTimeLocal(report.dueAt),
})
setEditorOpen(true)
}
async function handleSave() {
if (!editor.patientId) return
if (!isReportEditorValid(editor)) {
alert('Preencha todos os campos obrigatórios antes de salvar o relatório.')
return
}
setSaving(true)
@@ -276,8 +275,6 @@ export function ReportsPage({ role }) {
conclusion: editor.conclusion,
contentHtml: editor.contentHtml,
contentJson: editor.contentJson,
hideDate: editor.hideDate,
hideSignature: editor.hideSignature,
dueAt: editor.dueAt ? new Date(editor.dueAt).toISOString() : '',
createdBy: editor.id ? undefined : viewerProfile?.id || currentProfessional?.userId || currentProfessional?.id || undefined,
updatedBy: viewerProfile?.id || currentProfessional?.userId || currentProfessional?.id || undefined,
@@ -525,7 +522,7 @@ function ReportRow({ onEdit, onView, report }) {
function ReportEditorModal({ editor, onChange, onClose, onSave, patientOptions, professionalOptions, saving }) {
const [requesterSearch, setRequesterSearch] = useState(editor.requestedBy || '')
const isValid = Boolean(editor.patientId)
const isValid = isReportEditorValid(editor)
const filteredRequesterOptions = professionalOptions
.filter((professional) => normalizeSearch(professional.name).includes(normalizeSearch(requesterSearch)))
.slice(0, 6)
@@ -563,7 +560,7 @@ function ReportEditorModal({ editor, onChange, onClose, onSave, patientOptions,
</select>
</DarkField>
<DarkField label="Status">
<DarkField label="Status *">
<select className={inputClass} onChange={(event) => updateField('status', event.target.value)} value={editor.status}>
<option value="draft">Rascunho</option>
<option value="finalized">Finalizado</option>
@@ -572,7 +569,7 @@ function ReportEditorModal({ editor, onChange, onClose, onSave, patientOptions,
</div>
<div className="grid gap-4 md:grid-cols-2">
<DarkField label="Exame">
<DarkField label="Exame *">
<input
className={inputClass}
onChange={(event) => updateField('exam', event.target.value)}
@@ -581,7 +578,7 @@ function ReportEditorModal({ editor, onChange, onClose, onSave, patientOptions,
/>
</DarkField>
<DarkField label="Solicitante">
<DarkField label="Solicitante *">
<div className="space-y-2">
<input
className={inputClass}
@@ -620,7 +617,7 @@ function ReportEditorModal({ editor, onChange, onClose, onSave, patientOptions,
</div>
<div className="grid gap-4 md:grid-cols-2">
<DarkField label="CID-10">
<DarkField label="CID-10 *">
<input
className={inputClass}
onChange={(event) => updateField('cidCode', event.target.value)}
@@ -629,7 +626,7 @@ function ReportEditorModal({ editor, onChange, onClose, onSave, patientOptions,
/>
</DarkField>
<DarkField label="Prazo">
<DarkField label="Prazo *">
<input
className={`${inputClass} [color-scheme:dark]`}
onChange={(event) => updateField('dueAt', event.target.value)}
@@ -639,7 +636,7 @@ function ReportEditorModal({ editor, onChange, onClose, onSave, patientOptions,
</DarkField>
</div>
<DarkField label="Diagnóstico">
<DarkField label="Diagnóstico *">
<textarea
className={textareaClass}
onChange={(event) => updateField('diagnosis', event.target.value)}
@@ -648,7 +645,7 @@ function ReportEditorModal({ editor, onChange, onClose, onSave, patientOptions,
/>
</DarkField>
<DarkField label="Conclusão">
<DarkField label="Conclusão *">
<textarea
className={textareaClass}
onChange={(event) => updateField('conclusion', event.target.value)}
@@ -664,28 +661,6 @@ function ReportEditorModal({ editor, onChange, onClose, onSave, patientOptions,
value={editor.contentHtml}
/>
</DarkField>
<div className="flex flex-wrap items-center gap-6">
<label className="flex cursor-pointer items-center gap-2 text-sm text-[#e5e5e5]">
<input
checked={editor.hideDate}
className="size-4 accent-[#3b82f6]"
onChange={(event) => updateField('hideDate', event.target.checked)}
type="checkbox"
/>
Ocultar data
</label>
<label className="flex cursor-pointer items-center gap-2 text-sm text-[#e5e5e5]">
<input
checked={editor.hideSignature}
className="size-4 accent-[#3b82f6]"
onChange={(event) => updateField('hideSignature', event.target.checked)}
type="checkbox"
/>
Ocultar assinatura
</label>
</div>
</div>
</div>
@@ -760,16 +735,6 @@ function ReportViewModal({ onClose, report }) {
<DetailBlock label="Diagnóstico" value={report.diagnosis || '-'} />
<DetailBlock label="Conclusão" value={report.conclusion || '-'} />
</div>
<div className="mt-4 flex flex-wrap gap-3 text-xs text-[#a3a3a3]">
<span className="rounded-full border border-[#404040] px-3 py-1">
{report.hideDate ? 'Data oculta' : 'Data visivel'}
</span>
<span className="rounded-full border border-[#404040] px-3 py-1">
{report.hideSignature ? 'Assinatura oculta' : 'Assinatura visivel'}
</span>
</div>
<div className="mt-6 rounded-xl border border-[#404040] bg-[#1a1a1a] p-5">
<p className="mb-3 text-xs font-semibold uppercase tracking-wide text-[#a3a3a3]">Complemento</p>
{report.contentHtml ? (
@@ -884,6 +849,19 @@ function uniqueValues(values) {
return [...new Set(values.map((value) => String(value || '').trim()).filter(Boolean))]
}
function isReportEditorValid(editor) {
return [
editor.patientId,
editor.status,
editor.exam,
editor.requestedBy,
editor.cidCode,
editor.diagnosis,
editor.conclusion,
editor.dueAt,
].every((value) => String(value || '').trim())
}
function normalizeSearch(value) {
return String(value || '')
.normalize('NFD')