From 9fb0503c15264e4779a48f724a5861bfce11053e Mon Sep 17 00:00:00 2001 From: Jussi Hallila Date: Wed, 15 Sep 2021 15:31:03 +0200 Subject: [PATCH] Tweak lowecasing, export Optios type Signed-off-by: Jussi Hallila --- plugins/techdocs-backend/api-report.md | 14 ++++++++++++-- .../src/search/DefaultTechDocsCollator.ts | 4 ++-- plugins/techdocs-backend/src/search/index.ts | 2 ++ .../src/reader/components/TechDocsSearch.tsx | 2 +- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/plugins/techdocs-backend/api-report.md b/plugins/techdocs-backend/api-report.md index f955cea906..466b02a307 100644 --- a/plugins/techdocs-backend/api-report.md +++ b/plugins/techdocs-backend/api-report.md @@ -25,8 +25,6 @@ export function createRouter(options: RouterOptions): Promise; // // @public (undocumented) export class DefaultTechDocsCollator implements DocumentCollator { - // Warning: (ae-forgotten-export) The symbol "TechDocsCollatorOptions" needs to be exported by the entry point index.d.ts - // // @deprecated constructor({ discovery, @@ -56,6 +54,18 @@ export class DefaultTechDocsCollator implements DocumentCollator { readonly type: string; } +// Warning: (ae-missing-release-tag) "TechDocsCollatorOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type TechDocsCollatorOptions = { + discovery: PluginEndpointDiscovery; + logger: Logger_2; + locationTemplate?: string; + catalogClient?: CatalogApi; + parallelismLimit?: number; + legacyPathCasing?: boolean; +}; + export { TechDocsDocument }; export * from '@backstage/techdocs-common'; diff --git a/plugins/techdocs-backend/src/search/DefaultTechDocsCollator.ts b/plugins/techdocs-backend/src/search/DefaultTechDocsCollator.ts index 5f0bc5f79e..cb7d40206b 100644 --- a/plugins/techdocs-backend/src/search/DefaultTechDocsCollator.ts +++ b/plugins/techdocs-backend/src/search/DefaultTechDocsCollator.ts @@ -31,7 +31,7 @@ interface MkSearchIndexDoc { location: string; } -type TechDocsCollatorOptions = { +export type TechDocsCollatorOptions = { discovery: PluginEndpointDiscovery; logger: Logger; locationTemplate?: string; @@ -173,7 +173,7 @@ export class DefaultTechDocsCollator implements DocumentCollator { return legacyPaths ? entityInfo : Object.entries(entityInfo).reduce((acc, [key, value]) => { - return { ...acc, [key]: value.toLowerCase() }; + return { ...acc, [key]: value.toLocaleLowerCase('en-US') }; }, {} as EntityInfo); } } diff --git a/plugins/techdocs-backend/src/search/index.ts b/plugins/techdocs-backend/src/search/index.ts index fcb970bcee..53e0934789 100644 --- a/plugins/techdocs-backend/src/search/index.ts +++ b/plugins/techdocs-backend/src/search/index.ts @@ -15,6 +15,8 @@ */ export { DefaultTechDocsCollator } from './DefaultTechDocsCollator'; +export type { TechDocsCollatorOptions } from './DefaultTechDocsCollator'; + /** * @deprecated Use directly from @backstage/techdocs-common */ diff --git a/plugins/techdocs/src/reader/components/TechDocsSearch.tsx b/plugins/techdocs/src/reader/components/TechDocsSearch.tsx index 2ec5559bb9..5d330100ce 100644 --- a/plugins/techdocs/src/reader/components/TechDocsSearch.tsx +++ b/plugins/techdocs/src/reader/components/TechDocsSearch.tsx @@ -61,7 +61,7 @@ export const buildInitialFilters = ( return legacyPaths ? entityId : Object.entries(entityId).reduce((acc, [key, value]) => { - return { ...acc, [key]: value.toLowerCase() }; + return { ...acc, [key]: value.toLocaleLowerCase('en-US') }; }, {}); };