Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expanding record on detail #237

Merged
merged 5 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions oarepo_ui/resources/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@


class UIComponentsMixin:

#
# Pluggable components
#
Expand Down Expand Up @@ -260,10 +259,14 @@ def _detail(self, *, is_preview=False):
"is_preview": is_preview,
}

response = Response(current_oarepo_ui.catalog.render(
render_method,
**render_kwargs,
), mimetype="text/html", status=200)
response = Response(
current_oarepo_ui.catalog.render(
render_method,
**render_kwargs,
),
mimetype="text/html",
status=200,
)
response._api_record = api_record
return response

Expand Down Expand Up @@ -316,7 +319,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.14
version = 5.2.15
description = UI module for invenio 3.5+
long_description = file: README.md
long_description_content_type = text/markdown
Expand Down
Loading