techdocs: switch to using constants from techdocs-common for annotations

Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
This commit is contained in:
MT Lewis
2024-07-24 18:03:55 +01:00
parent 4698e1f4d4
commit 69bd940408
16 changed files with 61 additions and 44 deletions
+1
View File
@@ -68,6 +68,7 @@
"@backstage/plugin-catalog-common": "workspace:^",
"@backstage/plugin-permission-common": "workspace:^",
"@backstage/plugin-search-backend-module-techdocs": "workspace:^",
"@backstage/plugin-techdocs-common": "workspace:^",
"@backstage/plugin-techdocs-node": "workspace:^",
"@types/express": "^4.17.6",
"express": "^4.17.1",
@@ -28,6 +28,7 @@ import {
import { setupServer } from 'msw/node';
import { rest } from 'msw';
import { ConfigReader } from '@backstage/config';
import { TECHDOCS_ANNOTATION } from '@backstage/plugin-techdocs-common';
const logger = loggerToWinstonLogger(mockServices.logger.mock());
@@ -66,7 +67,7 @@ const expectedEntities: Entity[] = [
name: 'test-entity-with-docs',
description: 'Documented description',
annotations: {
'backstage.io/techdocs-ref': './',
[TECHDOCS_ANNOTATION]: './',
},
},
spec: {
@@ -37,6 +37,7 @@ import {
CATALOG_FILTER_EXISTS,
} from '@backstage/catalog-client';
import { TechDocsDocument } from '@backstage/plugin-techdocs-node';
import { TECHDOCS_ANNOTATION } from '@backstage/plugin-techdocs-common';
interface MkSearchIndexDoc {
title: string;
@@ -107,7 +108,7 @@ export class DefaultTechDocsCollator {
).getEntities(
{
filter: {
'metadata.annotations.backstage.io/techdocs-ref':
[`metadata.annotations.${TECHDOCS_ANNOTATION}`]:
CATALOG_FILTER_EXISTS,
},
fields: [