small integration fixes to kafka client plugin

This commit is contained in:
Nir Gazit
2021-01-05 19:08:33 +02:00
parent b617083159
commit 343026aade
2 changed files with 7 additions and 5 deletions
+4 -2
View File
@@ -15,11 +15,13 @@
*/
import { Entity } from '@backstage/catalog-model';
import { MissingAnnotationEmptyState } from '@backstage/core';
import React from 'react';
import { Route, Routes } from 'react-router';
import { rootCatalogKafkaRouteRef } from './plugin';
import { KAFKA_CONSUMER_GROUP_ANNOTATION } from './constants';
import { KafkaTopicsForConsumer } from './components/ConsumerGroupOffsets/ConsumerGroupOffsets';
import { MissingAnnotationEmptyState } from '@backstage/core';
export const isPluginApplicableToEntity = (entity: Entity) =>
Boolean(entity.metadata.annotations?.[KAFKA_CONSUMER_GROUP_ANNOTATION]);
@@ -30,7 +32,7 @@ export const Router = ({ entity }: { entity: Entity }) => {
) : (
<Routes>
<Route
path={`/$(rootRouteRef.path)`}
path={`${rootCatalogKafkaRouteRef.path}`}
element={<KafkaTopicsForConsumer />}
/>
</Routes>
+3 -3
View File
@@ -22,9 +22,9 @@ import {
} from '@backstage/core';
import { KafkaApi, kafkaApiRef } from './api/KafkaApi';
export const rootRouteRef = createRouteRef({
path: '/kafka',
title: 'kafka',
export const rootCatalogKafkaRouteRef = createRouteRef({
path: '*',
title: 'Kafka',
});
export const plugin = createPlugin({