packages/core: rename NavTargets to RouteRefs

This commit is contained in:
Patrik Oldsberg
2020-05-25 12:47:44 +02:00
parent cbd4a34c8c
commit a79f120fa5
14 changed files with 43 additions and 42 deletions
+1 -1
View File
@@ -17,5 +17,5 @@
export { plugin } from './plugin';
export * from './api';
export * from './proxy';
export * from './navTargets';
export * from './route-refs';
export { CircleCIWidget } from './components/App';
+2 -2
View File
@@ -15,11 +15,11 @@
*/
import { createPlugin } from '@backstage/core';
import { App } from './components/App';
import { navTargetCircleCI } from './navTargets';
import { circleCIRouteRef } from './route-refs';
export const plugin = createPlugin({
id: 'circleci',
register({ router }) {
router.addRoute(navTargetCircleCI, App, { exact: false });
router.addRoute(circleCIRouteRef, App, { exact: false });
},
});
@@ -15,10 +15,10 @@
*/
import React, { FC } from 'react';
import { createNavTarget } from '@backstage/core';
import { createRouteRef } from '@backstage/core';
import { SvgIcon, SvgIconProps } from '@material-ui/core';
const CircleCIIcon: FC<SvgIconProps> = (props) => (
const CircleCIIcon: FC<SvgIconProps> = props => (
<SvgIcon
{...props}
enableBackground="new 0 0 200 200"
@@ -31,7 +31,7 @@ const CircleCIIcon: FC<SvgIconProps> = (props) => (
</SvgIcon>
);
export const navTargetCircleCI = createNavTarget({
export const circleCIRouteRef = createRouteRef({
icon: CircleCIIcon,
path: '/circleci',
title: 'CircleCI',
+1 -1
View File
@@ -16,4 +16,4 @@
export { plugin } from './plugin';
export * from './lib/api';
export * from './navTargets';
export * from './route-refs';
+2 -2
View File
@@ -16,11 +16,11 @@
import { createPlugin } from '@backstage/core';
import { GraphiQLPage } from './components';
import { navTargetGraphiQL } from './navTargets';
import { graphiQLRouteRef } from './route-refs';
export const plugin = createPlugin({
id: 'graphiql',
register({ router }) {
router.addRoute(navTargetGraphiQL, GraphiQLPage);
router.addRoute(graphiQLRouteRef, GraphiQLPage);
},
});
@@ -15,10 +15,10 @@
*/
import React, { FC } from 'react';
import { createNavTarget } from '@backstage/core';
import { createRouteRef } from '@backstage/core';
import { SvgIcon, SvgIconProps } from '@material-ui/core';
const GraphiQLIcon: FC<SvgIconProps> = (props) => (
const GraphiQLIcon: FC<SvgIconProps> = props => (
<SvgIcon {...props}>
<g id="surface1">
<path
@@ -85,7 +85,7 @@ const GraphiQLIcon: FC<SvgIconProps> = (props) => (
</SvgIcon>
);
export const navTargetGraphiQL = createNavTarget({
export const graphiQLRouteRef = createRouteRef({
icon: GraphiQLIcon,
path: '/graphiql',
title: 'GraphiQL',