Skip to content

Commit

Permalink
feat(search): support single-instance use-cases
Browse files Browse the repository at this point in the history
  • Loading branch information
mirekys committed Jan 26, 2024
1 parent ff003dc commit 0f70ecc
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions oarepo_ui/theme/assets/semantic-ui/js/oarepo_ui/search/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,21 @@ export function createSearchAppInit ({
rootElement.dataset[_camelCase(autoInitDataAttr)]
);

const componentPrefix = multi ? `${appId}.` : ''
const SearchAppSearchbarContainerWithConfig = parametrize(SearchAppSearchbarContainer, { appName: appId })
const internalComponentDefaults = {
[`${appId}.ActiveFilters.element`]: ActiveFiltersElement,
[`${appId}.BucketAggregation.element`]: BucketAggregationElement,
[`${appId}.BucketAggregationValues.element`]: BucketAggregationValuesElement,
[`${appId}.Count.element`]: CountElement,
[`${appId}.EmptyResults.element`]: EmptyResultsElement,
[`${appId}.Error.element`]: ErrorElement,
[`${appId}.SearchApp.facets`]: SearchAppFacets,
[`${appId}.SearchApp.layout`]: SearchAppLayout,
[`${appId}.SearchApp.resultOptions`]: SearchAppResultOptions,
[`${appId}.SearchApp.searchbarContainer`]: SearchAppSearchbarContainerWithConfig,
[`${appId}.SearchFilters.Toggle.element`]: SearchFiltersToggleElement,
[`${appId}.SearchApp.sort`]: SearchAppSort,
[`${componentPrefix}ActiveFilters.element`]: ActiveFiltersElement,
[`${componentPrefix}BucketAggregation.element`]: BucketAggregationElement,
[`${componentPrefix}BucketAggregationValues.element`]: BucketAggregationValuesElement,
[`${componentPrefix}Count.element`]: CountElement,
[`${componentPrefix}EmptyResults.element`]: EmptyResultsElement,
[`${componentPrefix}Error.element`]: ErrorElement,
[`${componentPrefix}SearchApp.facets`]: SearchAppFacets,
[`${componentPrefix}SearchApp.layout`]: SearchAppLayout,
[`${componentPrefix}SearchApp.resultOptions`]: SearchAppResultOptions,
[`${componentPrefix}SearchApp.searchbarContainer`]: SearchAppSearchbarContainerWithConfig,
[`${componentPrefix}SearchFilters.Toggle.element`]: SearchFiltersToggleElement,
[`${componentPrefix}SearchApp.sort`]: SearchAppSort,
};

loadComponents(appId, {
Expand Down

0 comments on commit 0f70ecc

Please sign in to comment.