UNPKG

@immobiliarelabs/backstage-plugin-gitlab

Version:
39 lines (36 loc) 1.71 kB
import { useEntity } from '@backstage/plugin-catalog-react'; import '@backstage/core-plugin-api'; import '@backstage/integration-react'; import '@backstage/catalog-model'; const GITLAB_ANNOTATION_PROJECT_ID = "gitlab.com/project-id"; const GITLAB_ANNOTATION_PROJECT_SLUG = "gitlab.com/project-slug"; const GITLAB_ANNOTATION_INSTANCE = "gitlab.com/instance"; const GITLAB_ANNOTATION_CODEOWNERS_PATH = "gitlab.com/codeowners-path"; const GITLAB_ANNOTATION_README_PATH = "gitlab.com/readme-path"; const gitlabProjectId = () => { const { entity } = useEntity(); const project_id = entity.metadata.annotations?.[GITLAB_ANNOTATION_PROJECT_ID] ?? ""; return project_id; }; const gitlabProjectSlug = () => { const { entity } = useEntity(); const project_slug = entity.metadata.annotations?.[GITLAB_ANNOTATION_PROJECT_SLUG] ?? ""; return project_slug; }; const gitlabInstance = () => { const { entity } = useEntity(); const instance = entity.metadata.annotations?.[GITLAB_ANNOTATION_INSTANCE] ?? ""; return instance; }; const gitlabCodeOwnerPath = () => { const { entity } = useEntity(); const codeowners_path = entity.metadata.annotations?.[GITLAB_ANNOTATION_CODEOWNERS_PATH] ?? ""; return codeowners_path; }; const gitlabReadmePath = () => { const { entity } = useEntity(); const readme_path = entity.metadata.annotations?.[GITLAB_ANNOTATION_README_PATH] ?? ""; return readme_path; }; export { GITLAB_ANNOTATION_CODEOWNERS_PATH, GITLAB_ANNOTATION_INSTANCE, GITLAB_ANNOTATION_PROJECT_ID, GITLAB_ANNOTATION_PROJECT_SLUG, GITLAB_ANNOTATION_README_PATH, gitlabCodeOwnerPath, gitlabInstance, gitlabProjectId, gitlabProjectSlug, gitlabReadmePath }; //# sourceMappingURL=gitlabAppData.esm.js.map