diff --git a/packages/frontend-plugin-api/src/blueprints/NavLogoBlueprint.test.tsx b/packages/frontend-plugin-api/src/blueprints/NavLogoBlueprint.test.tsx deleted file mode 100644 index bbd96ea53b..0000000000 --- a/packages/frontend-plugin-api/src/blueprints/NavLogoBlueprint.test.tsx +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2024 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. - */ - -import { NavLogoBlueprint } from './NavLogoBlueprint'; -import { createExtensionTester } from '@backstage/frontend-test-utils'; - -describe('NavLogoBlueprint', () => { - it('should create an extension with sensible defaults', () => { - const extension = NavLogoBlueprint.make({ - params: { - logoFull:
Logo Full
, - logoIcon:
Logo Icon
, - }, - }); - - expect(extension).toMatchInlineSnapshot(` - { - "$$type": "@backstage/ExtensionDefinition", - "T": undefined, - "attachTo": { - "id": "app/nav", - "input": "logos", - }, - "configSchema": undefined, - "disabled": false, - "factory": [Function], - "inputs": {}, - "kind": "nav-logo", - "name": undefined, - "output": [ - [Function], - ], - "override": [Function], - "toString": [Function], - "version": "v2", - } - `); - }); - - it('should return a valid component ref', () => { - const logoFull =
Logo Full
; - const logoIcon =
Logo Icon
; - - const extension = NavLogoBlueprint.make({ - name: 'test', - params: { - logoFull, - logoIcon, - }, - }); - - const tester = createExtensionTester(extension); - - expect(tester.get(NavLogoBlueprint.dataRefs.logoElements)).toEqual({ - logoFull, - logoIcon, - }); - }); -}); diff --git a/packages/frontend-plugin-api/src/blueprints/NavLogoBlueprint.ts b/packages/frontend-plugin-api/src/blueprints/NavLogoBlueprint.ts deleted file mode 100644 index 4a37859975..0000000000 --- a/packages/frontend-plugin-api/src/blueprints/NavLogoBlueprint.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2024 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. - */ - -import { createExtensionBlueprint, createExtensionDataRef } from '../wiring'; - -const logoElementsDataRef = createExtensionDataRef<{ - logoIcon?: JSX.Element; - logoFull?: JSX.Element; -}>().with({ id: 'core.nav-logo.logo-elements' }); - -/** - * Creates an extension that replaces the logo in the nav bar with your own. - * - * @public - */ -export const NavLogoBlueprint = createExtensionBlueprint({ - kind: 'nav-logo', - attachTo: { id: 'app/nav', input: 'logos' }, - output: [logoElementsDataRef], - dataRefs: { - logoElements: logoElementsDataRef, - }, - *factory({ - logoIcon, - logoFull, - }: { - logoIcon: JSX.Element; - logoFull: JSX.Element; - }) { - yield logoElementsDataRef({ - logoIcon, - logoFull, - }); - }, -}); diff --git a/packages/frontend-plugin-api/src/blueprints/index.ts b/packages/frontend-plugin-api/src/blueprints/index.ts index 5460e05fa3..047b007226 100644 --- a/packages/frontend-plugin-api/src/blueprints/index.ts +++ b/packages/frontend-plugin-api/src/blueprints/index.ts @@ -24,7 +24,6 @@ export { type NavContentComponentProps, } from './NavContentBlueprint'; export { NavItemBlueprint } from './NavItemBlueprint'; -export { NavLogoBlueprint } from './NavLogoBlueprint'; export { PageBlueprint } from './PageBlueprint'; export { RouterBlueprint } from './RouterBlueprint'; export { SignInPageBlueprint } from './SignInPageBlueprint';