Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/scenarios/link_document.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Scénario: pour commenter un document

Soit un document existant affiché comme document principal
Et une session active avec mon compte
Quand je réutilise "Glossaire" comme glose
Quand je réutilise "Glossaire - Projet Perrault, 28/03/2025 - " comme glose
Alors "Glossaire" est la glose ouverte
Et la glose contient :
"""
Expand Down
7 changes: 5 additions & 2 deletions frontend/src/components/ExistingDocument.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import Card from 'react-bootstrap/Card';
import { useNavigate } from 'react-router';
import {format } from 'date-fns';

function ExistingDocument({ document, relatedTo, verb, setLastUpdate, backend }) {
const navigate = useNavigate();
const title = document.dc_title || 'Untitled document';
const isPartOf = document.dc_isPartOf || '';
const creator = document.dc_creator || '';
const issued = format(new Date(document.dc_issued), 'dd/MM/yyyy HH:mm') || '';
const sourceChunksToBeLinked = (verb !== 'includes' && relatedTo.length)
? [{ verb, object: relatedTo[0] }]
: relatedTo.map(object =>({ verb, object }));
Expand Down Expand Up @@ -33,11 +37,10 @@ function ExistingDocument({ document, relatedTo, verb, setLastUpdate, backend })
})
.catch(console.error);
};

return (
<Card onClick={handleClick} className="existingDocument documentList">
<Card.Body>
<span>{title}</span>
<span><strong>{title}</strong> - <i>{isPartOf} - {creator} - {issued}</i></span>
</Card.Body>
</Card>
);
Expand Down
Loading