Skip to content

Commit

Permalink
drafts: provide fallback value for missing titles (inveniosoftware#2725)
Browse files Browse the repository at this point in the history
  • Loading branch information
Samk13 authored Jul 4, 2024
1 parent c4b4932 commit bf3c245
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* This file is part of Invenio.
* Copyright (C) 2023-2024 CERN.
* Copyright (C) 2024 KTH Royal Institute of Technology.
*
* Invenio is free software; you can redistribute it and/or modify it
* under the terms of the MIT License; see LICENSE file for more details.
Expand Down Expand Up @@ -57,7 +58,9 @@ class SearchResultItemComponent extends Component {
icon="lock"
/>
<a target="_blank" rel="noreferrer" href={result.links.self_html}>
{_truncate(result.metadata.title, { length: 50 })}
{_truncate(result.metadata.title || i18next.t("Empty draft title"), {
length: 50,
})}
</a>
<br />
<div className="text-muted">
Expand Down

0 comments on commit bf3c245

Please sign in to comment.