diff --git a/invenio_administration/assets/semantic-ui/js/invenio_administration/src/search/SearchComponents.js b/invenio_administration/assets/semantic-ui/js/invenio_administration/src/search/SearchComponents.js index 96d1ffb..337689b 100644 --- a/invenio_administration/assets/semantic-ui/js/invenio_administration/src/search/SearchComponents.js +++ b/invenio_administration/assets/semantic-ui/js/invenio_administration/src/search/SearchComponents.js @@ -20,8 +20,9 @@ import { ContribBucketAggregationValuesElement, } from "@js/invenio_search_ui/components"; import { SearchBar } from "./SearchBar"; +import _mapKeys from "lodash/mapKeys"; -export const initDefaultSearchComponents = (domContainer) => { +export const initDefaultSearchComponents = (domContainer, appId = null) => { const sortColumns = (columns) => Object.entries(columns).sort((a, b) => a[1].order - b[1].order); const title = JSON.parse(domContainer.dataset.title); @@ -63,11 +64,11 @@ export const initDefaultSearchComponents = (domContainer) => { resourceSchema: resourceSchema, }); - return { + const components = { "ResultsList.item": SearchResultItemWithConfig, "BucketAggregation.element": ContribBucketAggregationElement, "BucketAggregationValues.element": ContribBucketAggregationValuesElement, - "ResultsGrid.item": () => {}, + "ResultsGrid.item": () => null, "SearchApp.results": SearchResultsWithConfig, "ResultsList.container": ResultsContainerWithConfig, "EmptyResults.element": SearchEmptyResults, @@ -77,4 +78,13 @@ export const initDefaultSearchComponents = (domContainer) => { "SearchApp.resultOptions": () => null, "SearchBar.element": displaySearch ? SearchBarElement : () => null, }; + + if (appId) { + const nameSpacedComponents = _mapKeys(components, function (value, key) { + return `${appId}.${key}`; + }); + return nameSpacedComponents; + } + + return components; }; diff --git a/invenio_administration/templates/semantic-ui/invenio_administration/search.html b/invenio_administration/templates/semantic-ui/invenio_administration/search.html index 04bde36..8004fe1 100644 --- a/invenio_administration/templates/semantic-ui/invenio_administration/search.html +++ b/invenio_administration/templates/semantic-ui/invenio_administration/search.html @@ -38,7 +38,7 @@