File tree Expand file tree Collapse file tree 4 files changed +10
-4
lines changed
Expand file tree Collapse file tree 4 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,8 @@ metadata:
8383 # ...
8484 annotations:
8585 gitlab.com/project-id: 'project-id' #1234. This must be in quotes and can be found under Settings --> General
86+ or
87+ gitlab.com/project-slug: 'project-slug' # group_name/project_name
8688spec:
8789 type: service
8890 # ...
Original file line number Diff line number Diff line change 11{
22 "name" : " @loblaw/backstage-plugin-gitlab" ,
3- "version" : " 0.1.15 " ,
3+ "version" : " 0.1.16 " ,
44 "main" : " src/index.ts" ,
55 "types" : " src/index.ts" ,
66 "license" : " Apache-2.0" ,
Original file line number Diff line number Diff line change @@ -10,7 +10,11 @@ import { useEntity } from '@backstage/plugin-catalog-react';
1010const GITLAB_ANNOTATION_PROJECT_ID = 'gitlab.com/project-id' ;
1111export const GITLAB_ANNOTATION_PROJECT_SLUG = 'gitlab.com/project-slug' ;
1212
13- export const isGitlabAnnotationAvailable = ( entity : Entity ) =>
13+ export const isGitlabAvailable = ( entity : Entity ) =>
14+ isGitlabProjectIDAnnotationAvailable ( entity ) || isGitlabSlugAnnotationAvailable ( entity )
15+
16+
17+ export const isGitlabProjectIDAnnotationAvailable = ( entity : Entity ) =>
1418 Boolean ( entity . metadata . annotations ?. [ GITLAB_ANNOTATION_PROJECT_ID ] ) ;
1519
1620export const isGitlabSlugAnnotationAvailable = ( entity : Entity ) =>
@@ -25,7 +29,7 @@ export const Router = (_props: Props) => {
2529 const { entity } = useEntity ( ) ;
2630
2731 if (
28- isGitlabAnnotationAvailable ( entity ) ||
32+ isGitlabProjectIDAnnotationAvailable ( entity ) ||
2933 isGitlabSlugAnnotationAvailable ( entity )
3034 ) {
3135 return (
Original file line number Diff line number Diff line change 11export { gitlabPlugin , EntityGitlabContent } from './plugin' ;
2- export { isGitlabAvailable } from './Router' ;
2+ export { isGitlabAvailable } from './Router' ;
You can’t perform that action at this time.
0 commit comments