well, let's clean up some more
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
@@ -22,12 +22,12 @@ import { KAFKA_CONSUMER_GROUP_ANNOTATION } from './constants';
|
||||
import { KafkaTopicsForConsumer } from './components/ConsumerGroupOffsets/ConsumerGroupOffsets';
|
||||
import { MissingAnnotationEmptyState } from '@backstage/core-components';
|
||||
|
||||
/** @public */
|
||||
export const isPluginApplicableToEntity = (entity: Entity) =>
|
||||
Boolean(entity.metadata.annotations?.[KAFKA_CONSUMER_GROUP_ANNOTATION]);
|
||||
|
||||
type Props = {};
|
||||
|
||||
export const Router = (_props: Props) => {
|
||||
/** @public */
|
||||
export const Router = () => {
|
||||
const { entity } = useEntity();
|
||||
|
||||
if (!isPluginApplicableToEntity(entity)) {
|
||||
|
||||
@@ -13,6 +13,9 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/** @public */
|
||||
export const KAFKA_CONSUMER_GROUP_ANNOTATION =
|
||||
'kafka.apache.org/consumer-groups';
|
||||
|
||||
export const KAFKA_DASHBOARD_URL = 'kafka.apache.org/dashboard-urls';
|
||||
|
||||
@@ -26,10 +26,12 @@ import {
|
||||
} from '@backstage/core-plugin-api';
|
||||
import { KafkaDashboardClient } from './api/KafkaDashboardClient';
|
||||
|
||||
/** @public */
|
||||
export const rootCatalogKafkaRouteRef = createRouteRef({
|
||||
id: 'kafka',
|
||||
});
|
||||
|
||||
/** @public */
|
||||
export const kafkaPlugin = createPlugin({
|
||||
id: 'kafka',
|
||||
apis: [
|
||||
@@ -50,6 +52,7 @@ export const kafkaPlugin = createPlugin({
|
||||
},
|
||||
});
|
||||
|
||||
/** @public */
|
||||
export const EntityKafkaContent = kafkaPlugin.provide(
|
||||
createRoutableExtension({
|
||||
name: 'EntityKafkaContent',
|
||||
|
||||
Reference in New Issue
Block a user