Skip to content
Open
Show file tree
Hide file tree
Changes from all 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: 19 additions & 0 deletions assets/js/components/search/overrides/CDSRangeFacet.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// This file is part of CDS RDM
// Copyright (C) 2026 CERN.
//
// CDS RDM is free software; you can redistribute it and/or modify it
// under the terms of the GPL-2.0 License; see LICENSE file for more details.

import { RangeFacet } from "react-searchkit";
import { parametrize } from "react-overridable";

export const parameters = {
defaultRanges: [
{ label: "Last 1 year", type: "years", value: 1 },
{ label: "Last 5 years", type: "years", value: 5 },
{ label: "Last 6 months", type: "months", value: 6 },
],
enableCustomRange: true,
};

export const CDSRangeFacet = parametrize(RangeFacet, parameters);
2 changes: 2 additions & 0 deletions assets/js/invenio_app_rdm/overridableRegistry/mapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { CDSCarouselItem } from "../../components/communities_carousel/overrides
import { CDSRecordsList } from "../../components/frontpage/overrides/RecordsList";
import { CDSRecordsResultsListItem } from "../../components/frontpage/overrides/RecordsResultsListItem";
import { CDSRecordsResultsListItemDescription } from "../../components/search/overrides/CDSRecordsResultsListItemDescription";
import { CDSRangeFacet } from "../../components/search/overrides/CDSRangeFacet";
import { CDSAffiliationsSuggestions } from "../../components/deposit/overrides/CDSAffiliationsSuggestions";
import { CLCSync } from "../../components/record_details/clc_sync";
import {
Expand All @@ -35,4 +36,5 @@ export const overriddenComponents = {
"InvenioRdmRecords.PublishModal.container": PublishModalComponent,
"InvenioRequests.LockRequest": LockRequestComponent,
"InvenioAppRdm.RecordVersionsList.Item.container": RecordVersionItemContent,
RangeFacet: CDSRangeFacet,
Copy link
Member

@palkerecsenyi palkerecsenyi Feb 5, 2026

Choose a reason for hiding this comment

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

Is this missing the full name? I'm not sure what the full name should be but it's something like [${appName}.RangeFacet.element\] right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is intentional. We are overriding the full RangeFacet component (registered via Overridable.component("RangeFacet", …) see here) so we can parametrize its behavior.

RangeFacet.element is a separate internal override point, which it's not the target here(we want to customize the optional filters only).

};
Loading