Add flock member notes and audit tabs
This commit is contained in:
@@ -342,9 +342,9 @@ export const ensureSchema = async (database: DatabaseClient = db) => {
|
|||||||
ON pending_bird_transfers (LOWER(destination_owner_email), created_at DESC)
|
ON pending_bird_transfers (LOWER(destination_owner_email), created_at DESC)
|
||||||
WHERE completed_at IS NULL;
|
WHERE completed_at IS NULL;
|
||||||
|
|
||||||
CREATE UNIQUE INDEX IF NOT EXISTS idx_pending_bird_transfers_open_bird
|
CREATE UNIQUE INDEX IF NOT EXISTS idx_pending_bird_transfers_open_bird
|
||||||
ON pending_bird_transfers (bird_id)
|
ON pending_bird_transfers (bird_id)
|
||||||
WHERE completed_at IS NULL;
|
WHERE completed_at IS NULL;
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS bird_transfer_codes (
|
CREATE TABLE IF NOT EXISTS bird_transfer_codes (
|
||||||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||||
@@ -368,9 +368,9 @@ export const ensureSchema = async (database: DatabaseClient = db) => {
|
|||||||
WHERE completed_at IS NULL
|
WHERE completed_at IS NULL
|
||||||
AND revoked_at IS NULL;
|
AND revoked_at IS NULL;
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS flock_notes (
|
CREATE TABLE IF NOT EXISTS flock_notes (
|
||||||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||||
workspace_id INTEGER NOT NULL REFERENCES workspaces(id) ON DELETE CASCADE,
|
workspace_id INTEGER NOT NULL REFERENCES workspaces(id) ON DELETE CASCADE,
|
||||||
bird_id UUID REFERENCES birds(id) ON DELETE SET NULL,
|
bird_id UUID REFERENCES birds(id) ON DELETE SET NULL,
|
||||||
title VARCHAR(160) NOT NULL,
|
title VARCHAR(160) NOT NULL,
|
||||||
body TEXT NOT NULL,
|
body TEXT NOT NULL,
|
||||||
|
|||||||
+32
-32
@@ -1627,7 +1627,7 @@ function App() {
|
|||||||
[birds, selectedBirdId],
|
[birds, selectedBirdId],
|
||||||
);
|
);
|
||||||
const selectedBirdAdoptionTransferCode = selectedBird ? adoptionTransferCodes[selectedBird.id] ?? '' : '';
|
const selectedBirdAdoptionTransferCode = selectedBird ? adoptionTransferCodes[selectedBird.id] ?? '' : '';
|
||||||
const editingBird = useMemo(
|
const editingBird = useMemo(
|
||||||
() => birds.find((bird) => bird.id === editingBirdId) ?? null,
|
() => birds.find((bird) => bird.id === editingBirdId) ?? null,
|
||||||
[birds, editingBirdId],
|
[birds, editingBirdId],
|
||||||
);
|
);
|
||||||
@@ -6073,26 +6073,26 @@ function App() {
|
|||||||
aria-selected={selectedBirdTab === 'notes'}
|
aria-selected={selectedBirdTab === 'notes'}
|
||||||
aria-label="Notes"
|
aria-label="Notes"
|
||||||
title="Notes"
|
title="Notes"
|
||||||
>
|
>
|
||||||
<svg className="note-tab-icon" viewBox="0 -960 960 960" aria-hidden="true" focusable="false">
|
<svg className="note-tab-icon" viewBox="0 -960 960 960" aria-hidden="true" focusable="false">
|
||||||
<path d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h360l280 280v360q0 33-23.5 56.5T760-120H200Zm320-400v-240H200v560h560v-320H520ZM280-280h400v-80H280v80Zm0-160h240v-80H280v80Zm-80-320v240-240 560-560Z" />
|
<path d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h360l280 280v360q0 33-23.5 56.5T760-120H200Zm320-400v-240H200v560h560v-320H520ZM280-280h400v-80H280v80Zm0-160h240v-80H280v80Zm-80-320v240-240 560-560Z" />
|
||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
className={`bird-detail-tab ${selectedBirdTab === 'reports' ? 'active' : ''}`}
|
className={`bird-detail-tab ${selectedBirdTab === 'reports' ? 'active' : ''}`}
|
||||||
onClick={() => setSelectedBirdTab('reports')}
|
onClick={() => setSelectedBirdTab('reports')}
|
||||||
type="button"
|
type="button"
|
||||||
role="tab"
|
role="tab"
|
||||||
aria-selected={selectedBirdTab === 'reports'}
|
aria-selected={selectedBirdTab === 'reports'}
|
||||||
aria-label="Reports"
|
aria-label="Reports"
|
||||||
title="Reports"
|
title="Reports"
|
||||||
>
|
>
|
||||||
<svg className="report-tab-icon" viewBox="0 -960 960 960" aria-hidden="true" focusable="false">
|
<svg className="report-tab-icon" viewBox="0 -960 960 960" aria-hidden="true" focusable="false">
|
||||||
<path d="M280-280h80v-240h-80v240Zm160 0h80v-400h-80v400Zm160 0h80v-120h-80v120ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Z" />
|
<path d="M280-280h80v-240h-80v240Zm160 0h80v-400h-80v400Zm160 0h80v-120h-80v120ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Z" />
|
||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
className={`bird-detail-tab ${selectedBirdTab === 'audit' ? 'active' : ''}`}
|
className={`bird-detail-tab ${selectedBirdTab === 'audit' ? 'active' : ''}`}
|
||||||
onClick={() => setSelectedBirdTab('audit')}
|
onClick={() => setSelectedBirdTab('audit')}
|
||||||
type="button"
|
type="button"
|
||||||
role="tab"
|
role="tab"
|
||||||
@@ -6452,11 +6452,11 @@ function App() {
|
|||||||
{selectedBirdTab === 'vet' ? (
|
{selectedBirdTab === 'vet' ? (
|
||||||
<div className="flock-member-sections" role="tabpanel">
|
<div className="flock-member-sections" role="tabpanel">
|
||||||
<section className="panel inset-panel">
|
<section className="panel inset-panel">
|
||||||
<div className="panel-header">
|
<div className="panel-header">
|
||||||
<div>
|
<div>
|
||||||
<p className="eyebrow">Veterinary</p>
|
<p className="eyebrow">Veterinary</p>
|
||||||
<h2>Clinic account</h2>
|
<h2>Clinic account</h2>
|
||||||
</div>
|
</div>
|
||||||
{!editingVeterinaryInfo ? (
|
{!editingVeterinaryInfo ? (
|
||||||
<button
|
<button
|
||||||
className="profile-icon-button"
|
className="profile-icon-button"
|
||||||
@@ -6550,9 +6550,9 @@ function App() {
|
|||||||
)}
|
)}
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section className="panel inset-panel">
|
<section className="panel inset-panel">
|
||||||
<div className="panel-header">
|
<div className="panel-header">
|
||||||
<div>
|
<div>
|
||||||
<p className="eyebrow">Vet visits</p>
|
<p className="eyebrow">Vet visits</p>
|
||||||
<h2>Care history and notes</h2>
|
<h2>Care history and notes</h2>
|
||||||
</div>
|
</div>
|
||||||
@@ -6695,13 +6695,13 @@ function App() {
|
|||||||
</article>
|
</article>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
{selectedBirdTab === 'reports' ? (
|
{selectedBirdTab === 'reports' ? (
|
||||||
<div className="flock-member-sections" role="tabpanel">
|
<div className="flock-member-sections" role="tabpanel">
|
||||||
<section className="panel inset-panel">
|
<section className="panel inset-panel">
|
||||||
<div className="panel-header">
|
<div className="panel-header">
|
||||||
<div>
|
<div>
|
||||||
<p className="eyebrow">Reports</p>
|
<p className="eyebrow">Reports</p>
|
||||||
@@ -6731,11 +6731,11 @@ function App() {
|
|||||||
{adoptionReportError}
|
{adoptionReportError}
|
||||||
</p>
|
</p>
|
||||||
) : null}
|
) : null}
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
{selectedBirdTab === 'audit' ? (
|
{selectedBirdTab === 'audit' ? (
|
||||||
<div className="flock-member-sections" role="tabpanel">
|
<div className="flock-member-sections" role="tabpanel">
|
||||||
<section className="panel inset-panel">
|
<section className="panel inset-panel">
|
||||||
<div className="panel-header">
|
<div className="panel-header">
|
||||||
|
|||||||
Reference in New Issue
Block a user