diff --git a/oarepo_ui/resources/resource.py b/oarepo_ui/resources/resource.py index 5640e63f..1e1c4348 100644 --- a/oarepo_ui/resources/resource.py +++ b/oarepo_ui/resources/resource.py @@ -65,7 +65,6 @@ class UIComponentsMixin: - # # Pluggable components # @@ -340,7 +339,11 @@ def _get_record(self, resource_requestctx, allow_draft=False): else: read_method = self.api_service.read - return read_method(g.identity, resource_requestctx.view_args["pid_value"]) + return read_method( + g.identity, + resource_requestctx.view_args["pid_value"], + expand=True, + ) except PermissionDenied as e: raise Forbidden() from e diff --git a/oarepo_ui/templates/components/IdentifiersAndLinks.jinja b/oarepo_ui/templates/components/IdentifiersAndLinks.jinja index f385d319..c7d20a1f 100644 --- a/oarepo_ui/templates/components/IdentifiersAndLinks.jinja +++ b/oarepo_ui/templates/components/IdentifiersAndLinks.jinja @@ -1,5 +1,6 @@ {# def originalRecordUrl=None, objectIdentifiers=None #} +{% if objectIdentifiers|length > 0 or originalRecordUrl %} +{% endif %} + diff --git a/setup.cfg b/setup.cfg index 799603d6..b0388672 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = oarepo-ui -version = 5.2.16 +version = 5.2.17 description = UI module for invenio 3.5+ long_description = file: README.md long_description_content_type = text/markdown diff --git a/tests/test_edit.py b/tests/test_edit.py index 455e7ce2..09e70422 100644 --- a/tests/test_edit.py +++ b/tests/test_edit.py @@ -10,10 +10,11 @@ def test_edit( assert json.loads(c.text) == { "api_record": simple_record.id, "data": { + "expanded": {}, "links": { "self": f"https://127.0.0.1:5000/api/simple-model/{simple_record.id}", "ui": f"https://127.0.0.1:5000/simple-model/{simple_record.id}", - } + }, }, "extra_context": { "permissions": {