From f306c2e842882669fc9925a813e71ad727d8b4ff Mon Sep 17 00:00:00 2001 From: James Russo Date: Wed, 15 Jun 2022 00:30:31 -0400 Subject: [PATCH 1/6] Add type to EntityLinks Add an optional type field to entity links that will allow developers to group and categorize links based on types. closes #10404 Signed-off-by: James Russo --- packages/catalog-model/src/entity/Entity.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/catalog-model/src/entity/Entity.ts b/packages/catalog-model/src/entity/Entity.ts index 96f19b2c8a..80c9adaffb 100644 --- a/packages/catalog-model/src/entity/Entity.ts +++ b/packages/catalog-model/src/entity/Entity.ts @@ -210,4 +210,9 @@ export type EntityLink = { * An optional semantic key that represents a visual icon. */ icon?: string; + + /** + * An optional value to categorize links into specific groups + */ + type?: string; }; From 1380b389dc99bbb04e660a80ab9121599ab60f1b Mon Sep 17 00:00:00 2001 From: James Russo Date: Wed, 15 Jun 2022 00:32:32 -0400 Subject: [PATCH 2/6] add changeset Signed-off-by: James Russo --- .changeset/shaggy-melons-drive.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/shaggy-melons-drive.md diff --git a/.changeset/shaggy-melons-drive.md b/.changeset/shaggy-melons-drive.md new file mode 100644 index 0000000000..cff45954fe --- /dev/null +++ b/.changeset/shaggy-melons-drive.md @@ -0,0 +1,5 @@ +--- +'@backstage/catalog-model': patch +--- + +Adding an optional type field to entity links to group and categorize links From 90fb26a514f034d44c7deda2db87805ff6a01e6f Mon Sep 17 00:00:00 2001 From: James Russo Date: Wed, 15 Jun 2022 10:03:37 -0400 Subject: [PATCH 3/6] update additional files Signed-off-by: James Russo --- docs/features/software-catalog/descriptor-format.md | 5 ++++- packages/catalog-model/src/schema/EntityMeta.schema.json | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/features/software-catalog/descriptor-format.md b/docs/features/software-catalog/descriptor-format.md index 86c832e3d2..bb79f18738 100644 --- a/docs/features/software-catalog/descriptor-format.md +++ b/docs/features/software-catalog/descriptor-format.md @@ -55,6 +55,7 @@ metadata: - url: https://admin.example-org.com title: Admin Dashboard icon: dashboard + type: admin-dashboard spec: type: website lifecycle: production @@ -83,7 +84,8 @@ This is the same entity as returned in JSON from the software catalog API: { "url": "https://admin.example-org.com", "title": "Admin Dashboard", - "icon": "dashboard" + "icon": "dashboard", + "type": "admin-dashboard" } ], "tags": ["java"], @@ -353,6 +355,7 @@ Fields of a link are: | `url` | String | [Required] A `url` in a standard `uri` format (e.g. `https://example.com/some/page`) | | `title` | String | [Optional] A user friendly display name for the link. | | `icon` | String | [Optional] A key representing a visual icon to be displayed in the UI. | +| `type` | String | [Optional] An optional value to categorize links into specific groups. | _NOTE_: The `icon` field value is meant to be a semantic key that will map to a specific icon that may be provided by an icon library (e.g. `material-ui` diff --git a/packages/catalog-model/src/schema/EntityMeta.schema.json b/packages/catalog-model/src/schema/EntityMeta.schema.json index cfdf9539c2..483e69f672 100644 --- a/packages/catalog-model/src/schema/EntityMeta.schema.json +++ b/packages/catalog-model/src/schema/EntityMeta.schema.json @@ -108,6 +108,12 @@ "description": "A key representing a visual icon to be displayed in the UI.", "examples": ["dashboard"], "minLength": 1 + }, + "type": { + "type": "string", + "description": "An optional value to categorize links into specific groups.", + "examples": ["runbook", "documentation", "logs", "dashboard"], + "minLength": 1 } } } From f4f6d51b31ddaa4bfd9474ca521f8384e6f40e8a Mon Sep 17 00:00:00 2001 From: James Russo Date: Wed, 15 Jun 2022 10:05:36 -0400 Subject: [PATCH 4/6] update api-reports Signed-off-by: James Russo --- packages/catalog-model/api-report.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/catalog-model/api-report.md b/packages/catalog-model/api-report.md index fca23d6ab9..8427ef4112 100644 --- a/packages/catalog-model/api-report.md +++ b/packages/catalog-model/api-report.md @@ -159,6 +159,7 @@ export type EntityLink = { url: string; title?: string; icon?: string; + type?: string; }; // @public From 279fa6b116967c237677a759f9c0323c4ac3ecf7 Mon Sep 17 00:00:00 2001 From: James Russo Date: Wed, 15 Jun 2022 10:46:32 -0400 Subject: [PATCH 5/6] update docs again Signed-off-by: James Russo --- docs/features/software-catalog/descriptor-format.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/features/software-catalog/descriptor-format.md b/docs/features/software-catalog/descriptor-format.md index bb79f18738..81e3604ffe 100644 --- a/docs/features/software-catalog/descriptor-format.md +++ b/docs/features/software-catalog/descriptor-format.md @@ -365,6 +365,8 @@ Backstage integrator will ultimately be left to provide the appropriate icon component mappings. A generic fallback icon would be provided if a mapping cannot be resolved. +The semantics of the `type` field are undefined. The adopter is free to define their own set of types and utilize them as they wish. Some potential use cases can be to utilize the type field to validate certain links exist on entities or to create customized UI components for specific link types. + ## Common to All Kinds: Relations The `relations` root field is a read-only list of relations, between the current From 62d3912f1d9ef66fe62c00ed7efc6dc403d74832 Mon Sep 17 00:00:00 2001 From: James Russo Date: Wed, 15 Jun 2022 10:49:09 -0400 Subject: [PATCH 6/6] update to minor Signed-off-by: James Russo --- .changeset/shaggy-melons-drive.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/shaggy-melons-drive.md b/.changeset/shaggy-melons-drive.md index cff45954fe..b5674493f4 100644 --- a/.changeset/shaggy-melons-drive.md +++ b/.changeset/shaggy-melons-drive.md @@ -1,5 +1,5 @@ --- -'@backstage/catalog-model': patch +'@backstage/catalog-model': minor --- Adding an optional type field to entity links to group and categorize links