chore: make more things swoppable
Signed-off-by: benjdlambert <ben@blam.sh> Signed-off-by: benjdlambert <ben@blam.sh>
This commit is contained in:
+6
-6
@@ -18,16 +18,16 @@ import {
|
||||
SwappableComponentBlueprint,
|
||||
createExtensionInput,
|
||||
ApiBlueprint,
|
||||
componentsApiRef,
|
||||
swappableComponentsApiRef,
|
||||
} from '@backstage/frontend-plugin-api';
|
||||
// eslint-disable-next-line @backstage/no-relative-monorepo-imports
|
||||
import { DefaultComponentsApi } from '../../../../packages/frontend-app-api/src/apis/implementations/ComponentsApi';
|
||||
import { DefaultSwappableComponentsApi } from '../../../../packages/frontend-app-api/src/apis/implementations/SwappableComponentsApi';
|
||||
|
||||
/**
|
||||
* Contains the shareable components installed into the app.
|
||||
*/
|
||||
export const ComponentsApi = ApiBlueprint.makeWithOverrides({
|
||||
name: 'components',
|
||||
export const SwappableComponentsApi = ApiBlueprint.makeWithOverrides({
|
||||
name: 'swappable-components',
|
||||
inputs: {
|
||||
components: createExtensionInput(
|
||||
[SwappableComponentBlueprint.dataRefs.component],
|
||||
@@ -37,10 +37,10 @@ export const ComponentsApi = ApiBlueprint.makeWithOverrides({
|
||||
factory: (originalFactory, { inputs }) => {
|
||||
return originalFactory(defineParams =>
|
||||
defineParams({
|
||||
api: componentsApiRef,
|
||||
api: swappableComponentsApiRef,
|
||||
deps: {},
|
||||
factory: () =>
|
||||
DefaultComponentsApi.fromComponents(
|
||||
DefaultSwappableComponentsApi.fromComponents(
|
||||
inputs.components.map(i =>
|
||||
i.get(SwappableComponentBlueprint.dataRefs.component),
|
||||
),
|
||||
@@ -20,7 +20,7 @@ export { AppNav } from './AppNav';
|
||||
export { AppRoot } from './AppRoot';
|
||||
export { AppRoutes } from './AppRoutes';
|
||||
export { AppThemeApi, DarkTheme, LightTheme } from './AppThemeApi';
|
||||
export { ComponentsApi } from './ComponentsApi';
|
||||
export { SwappableComponentsApi } from './SwappableComponentsApi';
|
||||
export { IconsApi } from './IconsApi';
|
||||
export { FeatureFlagsApi } from './FeatureFlagsApi';
|
||||
export { TranslationsApi } from './TranslationsApi';
|
||||
|
||||
@@ -25,7 +25,7 @@ import {
|
||||
AppThemeApi,
|
||||
DarkTheme,
|
||||
LightTheme,
|
||||
ComponentsApi,
|
||||
SwappableComponentsApi,
|
||||
IconsApi,
|
||||
FeatureFlagsApi,
|
||||
TranslationsApi,
|
||||
@@ -54,7 +54,7 @@ export const appPlugin = createFrontendPlugin({
|
||||
AppThemeApi,
|
||||
DarkTheme,
|
||||
LightTheme,
|
||||
ComponentsApi,
|
||||
SwappableComponentsApi,
|
||||
IconsApi,
|
||||
FeatureFlagsApi,
|
||||
TranslationsApi,
|
||||
|
||||
Reference in New Issue
Block a user