Fixed review comments

Signed-off-by: Deepak Bhardwaj <deepak.bhardwaj@outlook.com>
This commit is contained in:
Deepak Bhardwaj
2021-08-27 16:16:55 +05:30
parent 7ad9f1016e
commit 56c2684b8f
9 changed files with 68 additions and 29 deletions
+11
View File
@@ -0,0 +1,11 @@
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: allure-example-service
description: Allure Example Service
annotations:
qameta.io/allure-project: sample
spec:
type: service
lifecycle: experimental
owner: team-a
+30 -2
View File
@@ -16,11 +16,39 @@
import React from 'react';
import { createDevApp } from '@backstage/dev-utils';
import { EntityAllureReportContent } from '../src/plugin';
import { Content, Header, Page } from '@backstage/core-components';
import { EntityProvider } from '@backstage/plugin-catalog-react';
import { Entity } from '@backstage/catalog-model';
import exampleEntity from './example-entity.yaml';
import { allureApiRef } from '../src/api';
createDevApp()
.registerPlugin()
.registerApi({
api: allureApiRef,
deps: {},
factory: () =>
({
async getReportUrl(projectId: string) {
return Promise.resolve(
// Follow the instructions from https://github.com/fescobar/allure-docker-service-ui
// to setup Allure service locally
`http://localhost:5050/allure-docker-service/projects/${projectId}/reports/latest/index.html`,
);
},
} as unknown as typeof allureApiRef.T),
})
.addPage({
element: <EntityAllureReportContent />,
element: (
<Page themeId="home">
<Header title="Allure Report" />
<Content>
<EntityProvider entity={exampleEntity as any as Entity}>
<EntityAllureReportContent />
</EntityProvider>
</Content>
</Page>
),
title: 'Allure Report',
path: '/allure',
})