Skip to content

Commit

Permalink
Issue #544: export component results-list
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzov96 authored and danielecalda committed Aug 29, 2023
1 parent 59ed587 commit 79d9435
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
6 changes: 5 additions & 1 deletion js-packages/search-frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,11 @@ export function App() {
></div>
<div
className="openk9-results-container openk9-box"
ref={(element) => openk9.updateConfiguration({ results: element })}
ref={(element) =>
openk9.updateConfiguration({
resultList: { element: element, changeOnOver: false },
})
}
css={css`
grid-area: result;
overflow-y: auto;
Expand Down
15 changes: 15 additions & 0 deletions js-packages/search-frontend/src/embeddable/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,21 @@ export function Main({
</I18nextProvider>,
configuration.results,
)}
{renderPortal(
<I18nextProvider i18n={i18next}>
<ResultsMemo
displayMode={configuration.resultsDisplayMode}
searchQuery={searchQuery}
onDetail={setDetail}
setDetailMobile={setDetailMobile}
sort={completelySort}
setSortResult={setSortResult}
isMobile={isMobile}
overChangeCard={configuration.resultList?.changeOnOver || false}
/>
</I18nextProvider>,
configuration.resultList ? configuration.resultList.element : null,
)}
{renderPortal(
<I18nextProvider i18n={i18next}>
<DetailMemo result={detail} />
Expand Down
7 changes: 7 additions & 0 deletions js-packages/search-frontend/src/embeddable/entry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,19 @@ type DataRangePickerProps = {
end?: any;
};

type ResultListProps = {
element: Element | string | null;
changeOnOver: boolean;
};

export type Configuration = {
enabled: boolean;
search: Element | string | null;
activeFilters: Element | string | null;
tabs: Element | string | null;
filters: Element | string | null;
calendarMobile: CalendarMobileConfiguration | null;
resultList: ResultListProps | null;
searchMobile: SearchMobileConfiguration | null;
filtersMobile: FiltersHorizontalMobileConfiguration | null;
filtersMobileLiveChange: FiltersLiveMobileConfiguration | null;
Expand Down Expand Up @@ -251,6 +257,7 @@ const defaultConfiguration: Configuration = {
tenant: null,
token: null,
calendar: null,
resultList: null,
useKeycloak: true,
searchAutoselect: true,
searchReplaceText: true,
Expand Down

0 comments on commit 79d9435

Please sign in to comment.