Skip to content

Commit

Permalink
Merge pull request #237 from oarepo/stojanovic/fe-264-detail-sidebar-…
Browse files Browse the repository at this point in the history
…correction

expanding record on detail
  • Loading branch information
mirekys authored Oct 22, 2024
2 parents 65adb0d + bcb4db1 commit 222b949
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
7 changes: 5 additions & 2 deletions oarepo_ui/resources/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@


class UIComponentsMixin:

#
# Pluggable components
#
Expand Down Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions oarepo_ui/templates/components/IdentifiersAndLinks.jinja
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{# def originalRecordUrl=None, objectIdentifiers=None #}

{% if objectIdentifiers|length > 0 or originalRecordUrl %}
<section aria-label='{{ _("Identifiers and links") }}' class="ui segment identifiers-and-links">
<h2 class="ui small header detail-sidebar-header">{{_('Identifiers and links')}}</h2>
<div class="ui link list">
Expand Down Expand Up @@ -52,3 +53,5 @@
{% endif %}
</div>
</section>
{% endif %}

2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 2 additions & 1 deletion tests/test_edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit 222b949

Please sign in to comment.