Skip to content

Commit

Permalink
fix(receiver): initial attempt to fix multi-receiver label
Browse files Browse the repository at this point in the history
  • Loading branch information
mirekys committed Dec 19, 2024
1 parent e87348a commit 6549e0a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
11 changes: 10 additions & 1 deletion oarepo_requests/resolvers/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,16 @@ def resolve(identity: Identity, reference: dict[str, str]) -> UIResolvedReferenc
return cache[(reference_type, reference_value)]

entity_resolvers = current_oarepo_requests.entity_reference_ui_resolvers
if reference_type in entity_resolvers:

if reference_type == 'multiple':
_resolved = []
for item_type, item_value in reference_value.items():
_resolved.append(entity_resolvers[item_type].resolve_one(
identity, item_value
))
print('CESNET', 'resolved', _resolved, flush=True)
resolved = ', '.join(_resolved)
elif reference_type in entity_resolvers:
resolved = entity_resolvers[reference_type].resolve_one(
identity, reference_value
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ export const SideRequestInfo = ({ request }) => {
</List.Content>
</List.Item>
)}
{request?.receiver && (
{request?.receiver &&
<List.Item>
<List.Header as="h3">{i18next.t("Receiver")}</List.Header>
<List.Content>
<Icon name="mail outline" />
<span>
{_has(request, "links.receiver.self_html") ? (
{_has(request, "links.receiver_html") ? (
<a
href={request.links.receiver.self_html}
href={request.links.receiver_html}
target="_blank"
rel="noreferrer"
>
Expand All @@ -51,7 +51,7 @@ export const SideRequestInfo = ({ request }) => {
</span>
</List.Content>
</List.Item>
)}
}
<List.Item>
<List.Header as="h3">{i18next.t("Status")}</List.Header>
<List.Content>
Expand Down

0 comments on commit 6549e0a

Please sign in to comment.