Skip to content

Commit

Permalink
chore(headless): add a wider range of types for the ssr-commerce summ…
Browse files Browse the repository at this point in the history
…aryState (#4643)

https://coveord.atlassian.net/browse/KIT-3719

state.query was not available before in the current ssr-commerce summary
implementation since query is in an extended type of the default state
of the headless-commerce-summary controller.

<img width="837" alt="image"
src="https://github.com/user-attachments/assets/25dff79e-57ca-47d0-b59e-019fdd1c9cd6">
<img width="425" alt="image"
src="https://github.com/user-attachments/assets/bdd3d3b7-111c-4115-95f5-cd70d30850c1">

---------

Co-authored-by: ylakhdar <ylakhdar@coveo.com>
  • Loading branch information
alexprudhomme and y-lakhdar authored Nov 11, 2024
1 parent ce8d7c8 commit b52d936
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,12 @@ export function defineSummary<
solutionType === SolutionType.listing
? buildProductListing(engine).summary()
: buildSearch(engine).summary(),
} as SubControllerDefinitionWithoutProps<Summary, TOptions>;
} as SubControllerDefinitionWithoutProps<
Summary<
| ProductListingSummaryState
| SearchSummaryState
| RecommendationsSummaryState
>,
TOptions
>;
}
11 changes: 5 additions & 6 deletions packages/samples/headless-ssr-commerce/components/summary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ export default function Summary() {
return null;
}

// TODO: KIT-3719 - add query to summary state
// return (
// <span>
// for <b>{state.query}</b>
// </span>
// );
return (
<span>
for <b>{state.query}</b>
</span>
);
};

const renderSummary = () => {
Expand Down

0 comments on commit b52d936

Please sign in to comment.