well, let's clean up some more

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2022-08-18 15:42:17 +02:00
parent e195112c5c
commit f6be17460d
17 changed files with 101 additions and 114 deletions
+3 -3
View File
@@ -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)) {
+3
View File
@@ -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';
+3
View File
@@ -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',