Skip to content

Conversation

@jrcastro2
Copy link
Contributor

@jrcastro2 jrcastro2 commented Dec 14, 2025

Comment on lines +15 to +26
const layoutProps = (result) => {
return {
accessStatusId: _get(result, "ui.access_status.id", "open"),
accessStatus: _get(result, "ui.access_status.title_l10n", "Open"),
accessStatusIcon: _get(result, "ui.access_status.icon", "unlock"),
createdDate: _get(result, "ui.created_date_l10n_long", "Unknown date"),
creators: _get(result, "ui.creators.creators", []).slice(0, 3),
resourceType: _get(result, "ui.resource_type.title_l10n", "No resource type"),
title: _get(result, "metadata.title", "No title"),
link: _get(result, "links.self_html", "#"),
};
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could this part be imported from somewhere so we don't need to maintain it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless I am mistaken there is no other place we can import this from. I see that we usually do it on the cmp itself, f.e. check here RecordsResultsListItem from invenio-app-rdm. Not sure how reusable this is, as different cmps might want to display different things. I am happy to move this somewhere more resusable. If you think we should, let me know where we should do it, invenio-rdm-records or invenio-app-rdm (or somewhere else?)

# Part 1: Records that this record references (forward)
# Search by record id using the CDS identifier
for cds_id in cds_related_ids:
query_parts.append(f'id:"{cds_id}"')
Copy link
Contributor

@kpsherva kpsherva Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this might be a bit tricky, because we now have a mix of old CDS recids and new pids in this field. The old recids sometimes point to the new platform, but sometimes they point to the old (f.e. if record was published in a conference, it will still refer to the legacy conference record).
My point is if you search for id:123456, even if the record is migrated, search will not find it, because it has a new recid.
If you have old recid pattern, you need to search also in identifiers.identifier:{cds_id}
if it is a new pid pattern, this is correct

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! Thanks for this, I fixed it 👍

# Exclude the current record and only show published records
final_query = f'({combined_query}) AND is_published:true NOT id:"{record_id}"'

return final_query
Copy link
Contributor

@kpsherva kpsherva Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there any way to find sibling references too? fe
I am on detail page of record A.
I find record B references record A.
there is also record C which references B but not A.
Can I include record C in this search too? Should I? tbd, ping @zzacharo @ntarocco

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too complicated no? Do you have any specific use case in mind? Otherwise, I would keep it simple maybe for now i.e only direct relations X -> A, and A -> X.

@jrcastro2 jrcastro2 force-pushed the add-related-records branch 2 times, most recently from 619424e to 83beeee Compare December 17, 2025 17:42
jrcastro2 added a commit to jrcastro2/invenio-theme that referenced this pull request Jan 16, 2026
@jrcastro2 jrcastro2 force-pushed the add-related-records branch from 83beeee to 59b84c2 Compare January 22, 2026 15:45
@jrcastro2 jrcastro2 force-pushed the add-related-records branch from 59b84c2 to 2fa82f5 Compare January 22, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 - Show related records on landing page (based on related identifiers)

3 participants