Skip to content

Commit b1ef22b

Browse files
committed
Enable facets after new DS version released
1 parent 09555c1 commit b1ef22b

3 files changed

Lines changed: 10 additions & 20 deletions

File tree

‎packages/docusaurus-theme-search-algolia/src/__tests__/validateThemeConfig.test.ts‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -402,16 +402,12 @@ describe('validateThemeConfig', () => {
402402
});
403403
});
404404

405-
// TODO Enable once DocSearch releases fix for facets with multiple
406-
// selected values. Currently the contextual search facets do no work.
407-
// https://github.com/algolia/docsearch/issues/3037
408-
describe.todo('facets config', () => {
405+
describe('facets config', () => {
409406
it('accepts facets and a result badge key', () => {
410407
const algolia: AlgoliaInput = {
411408
appId: 'BH4D9OD16A',
412409
indices: ['index'],
413410
apiKey: 'apiKey',
414-
// @ts-expect-error: expected type error
415411
facets: [{key: 'language', label: 'Language'}, {key: 'version'}],
416412
resultBadgeKey: 'language',
417413
};

‎packages/docusaurus-theme-search-algolia/src/theme-search-algolia.d.ts‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,7 @@ declare module '@docusaurus/theme-search-algolia' {
3333
| 'insights'
3434
| 'initialQuery'
3535
| 'indices'
36-
// TODO Enable once DocSearch releases fix for facets with multiple
37-
// selected values. Currently the contextual search facets do no work.
38-
// https://github.com/algolia/docsearch/issues/3037
39-
// | 'facets'
36+
| 'facets'
4037
| 'resultBadgeKey'
4138
> & {
4239
// Docusaurus normalizes the AskAI config to an object

‎packages/docusaurus-theme-search-algolia/src/validateThemeConfig.ts‎

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,14 @@ const Schema = Joi.object<ThemeConfig>({
7575
}).required(),
7676
to: Joi.string().required(),
7777
}).optional(),
78-
// TODO Enable once DocSearch releases fix for facets with multiple
79-
// selected values. Currently the contextual search facets do no work.
80-
// https://github.com/algolia/docsearch/issues/3037
81-
// facets: Joi.array()
82-
// .items(
83-
// Joi.object({
84-
// key: Joi.string().required(),
85-
// label: Joi.string().optional(),
86-
// }).unknown(false),
87-
// )
88-
// .optional(),
78+
facets: Joi.array()
79+
.items(
80+
Joi.object({
81+
key: Joi.string().required(),
82+
label: Joi.string().optional(),
83+
}).unknown(false),
84+
)
85+
.optional(),
8986
resultBadgeKey: Joi.string().optional(),
9087
// Optional Ask AI configuration
9188
askAi: Joi.alternatives()

0 commit comments

Comments
 (0)