Content Search result customizability

オープン
#395 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

@cr0ybot がすでに取り組んでいます。

2025年9月16日 から。

  • #396 @cr0ybot による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
42/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
typescript
領域
frontend

調査の方向性

components/content-search/utils.ts から始め、特にリンクされた行付近の queryFilter の処理と normalizeResults を確認してから、正規化された項目がどのように ContentSearch の renderItemType に到達するかを追跡します。検索エンドポイントのレスポンススキーマと正規化された結果の型を比較します。カスタムレンダラーから埋め込まれたレスポンスデータにアクセスでき、既存の結果フィールドも引き続き機能すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

I work on a news publisher site with loads of content. We used to be able to customize the ContentSearch component's query and renderItemType in order to extract additional necessary information for content editors, particularly the publish date of a post. We did this by:

  1. Using the queryFilter prop and adding the _links and _embedded fields (_embed=true is already added by the component but without these other fields nothing is actually embedded)
  2. Utilizing the _embedded property passed to renderItemType to customize the results items to display the post date

After this normalizeResults line was added, it is now impossible to reference any properties of the response items other than id, subtype, title, type, and url, which makes renderItemType almost completely useless for our purposes.

I'm not sure what the correct answer is here, but I would love to at least be able to include the _embedded property as part of the normalized results type since that is a standard part of the search endpoint schema. It would be a nice bonus to be able to make use of custom fields added to the search results schema, but that would probably be harder to account for.

主要言語
TypeScript
スター
330
フォーク
54
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

10up/block-components のほかの issue

10up/block-components の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。