From bf3c2454db8418aa8ad65b70acbf025fcb972d88 Mon Sep 17 00:00:00 2001
From: Sam Arbid <36583694+Samk13@users.noreply.github.com>
Date: Thu, 4 Jul 2024 16:04:15 +0200
Subject: [PATCH] drafts: provide fallback value for missing titles (#2725)
---
.../administration/records/search/SearchResultItemLayout.js | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/records/search/SearchResultItemLayout.js b/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/records/search/SearchResultItemLayout.js
index c937cef81..64f1c4c55 100644
--- a/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/records/search/SearchResultItemLayout.js
+++ b/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/records/search/SearchResultItemLayout.js
@@ -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.
@@ -57,7 +58,9 @@ class SearchResultItemComponent extends Component {
icon="lock"
/>
- {_truncate(result.metadata.title, { length: 50 })}
+ {_truncate(result.metadata.title || i18next.t("Empty draft title"), {
+ length: 50,
+ })}