Skip to content

Commit 285bb0f

Browse files
sachaS456benel
authored andcommitted
FIX : Linking an existing document should be clearer and more practical (fixes #383).
1 parent a382570 commit 285bb0f

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

frontend/src/components/ExistingDocument.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
import Card from 'react-bootstrap/Card';
22
import { useNavigate } from 'react-router';
3+
import { format } from 'date-fns';
34

45
function ExistingDocument({ document, relatedTo, verb, setLastUpdate, backend }) {
56
const navigate = useNavigate();
67
const title = document.dc_title || 'Untitled document';
8+
const isPartOf = document.dc_isPartOf || '';
9+
const creator = document.dc_creator || '';
10+
const issued = format(new Date(document.dc_issued), 'dd/MM/yyyy HH:mm') || '';
711
const sourceChunksToBeLinked = (verb !== 'includes' && relatedTo.length)
812
? [{ verb, object: relatedTo[0] }]
913
: relatedTo.map(object =>({ verb, object }));
@@ -37,7 +41,7 @@ function ExistingDocument({ document, relatedTo, verb, setLastUpdate, backend })
3741
return (
3842
<Card onClick={handleClick} className="existingDocument documentList">
3943
<Card.Body>
40-
<span>{title}</span>
44+
<span><strong>{title}</strong> - <i>{isPartOf} - {creator} - {issued}</i></span>
4145
</Card.Body>
4246
</Card>
4347
);

0 commit comments

Comments
 (0)