refactor(search-react): move everything to alpha file
Signed-off-by: Camila Belo <camilaibs@gmail.com>
This commit is contained in:
@@ -9,13 +9,13 @@
|
||||
},
|
||||
"exports": {
|
||||
".": "./src/index.ts",
|
||||
"./alpha": "./src/alpha.ts",
|
||||
"./alpha": "./src/alpha.tsx",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"typesVersions": {
|
||||
"*": {
|
||||
"alpha": [
|
||||
"src/alpha.ts"
|
||||
"src/alpha.tsx"
|
||||
],
|
||||
"package.json": [
|
||||
"package.json"
|
||||
|
||||
+3
-3
@@ -31,8 +31,8 @@ import { MockConfigApi } from '@backstage/test-utils';
|
||||
import {
|
||||
BaseSearchResultListItemProps,
|
||||
createSearchResultListItemExtension,
|
||||
searchResultItemExtensionData,
|
||||
} from './createSearchResultListItemExtension';
|
||||
searchResultItemExtensionData as searchResultListItemExtensionData,
|
||||
} from './alpha';
|
||||
|
||||
// TODO: Remove this mock when we have a permanent solution for nav items extensions
|
||||
// The `GraphiQLIcon` used in "packages/frontend-app-api/src/extensions/CoreNav.tsx" file
|
||||
@@ -89,7 +89,7 @@ describe('createSearchResultListItemExtension', () => {
|
||||
defaultPath: '/',
|
||||
inputs: {
|
||||
items: createExtensionInput({
|
||||
item: searchResultItemExtensionData,
|
||||
item: searchResultListItemExtensionData,
|
||||
}),
|
||||
},
|
||||
loader: async ({ inputs }) => {
|
||||
@@ -1,17 +0,0 @@
|
||||
/*
|
||||
* Copyright 2023 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export * from './wiring';
|
||||
+8
-8
@@ -28,7 +28,13 @@ import {
|
||||
import { Progress } from '@backstage/core-components';
|
||||
import { SearchDocument, SearchResult } from '@backstage/plugin-search-common';
|
||||
|
||||
import { SearchResultListItemExtension } from '../extensions';
|
||||
import { SearchResultListItemExtension } from './extensions';
|
||||
|
||||
/** @alpha */
|
||||
export type BaseSearchResultListItemProps<T = {}> = T & {
|
||||
rank?: number;
|
||||
result?: SearchDocument;
|
||||
} & Omit<ListItemProps, 'button'>;
|
||||
|
||||
/** @alpha */
|
||||
export type SearchResultItemExtensionComponent = <
|
||||
@@ -77,12 +83,6 @@ export type SearchResultItemExtensionOptions<
|
||||
predicate?: SearchResultItemExtensionPredicate;
|
||||
};
|
||||
|
||||
/** @alpha */
|
||||
export type BaseSearchResultListItemProps<T = {}> = T & {
|
||||
rank?: number;
|
||||
result?: SearchDocument;
|
||||
} & Omit<ListItemProps, 'button'>;
|
||||
|
||||
/** @alpha */
|
||||
export function createSearchResultListItemExtension<
|
||||
TConfig extends { noTrack?: boolean },
|
||||
@@ -92,7 +92,7 @@ export function createSearchResultListItemExtension<
|
||||
? options.configSchema
|
||||
: (createSchemaFromZod(z =>
|
||||
z.object({
|
||||
noTrack: z.boolean().default(true),
|
||||
noTrack: z.boolean().default(false),
|
||||
}),
|
||||
) as PortableSchema<TConfig>);
|
||||
return createExtension({
|
||||
@@ -1,17 +0,0 @@
|
||||
/*
|
||||
* Copyright 2023 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export * from './createSearchResultListItemExtension';
|
||||
Reference in New Issue
Block a user