@backstage-community/plugin-allure 0.1.51 → 0.1.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/api/AllureApi.esm.js +8 -0
- package/dist/api/AllureApi.esm.js.map +1 -0
- package/dist/api/AllureApiClient.esm.js +13 -0
- package/dist/api/AllureApiClient.esm.js.map +1 -0
- package/dist/{esm/index-DMPeCQyc.esm.js → components/AllureReportComponent/AllureReportComponent.esm.js} +4 -4
- package/dist/components/AllureReportComponent/AllureReportComponent.esm.js.map +1 -0
- package/dist/components/AllureReportComponent/index.esm.js +2 -0
- package/dist/components/AllureReportComponent/index.esm.js.map +1 -0
- package/dist/components/annotationHelpers.esm.js +8 -0
- package/dist/components/annotationHelpers.esm.js.map +1 -0
- package/dist/index.esm.js +2 -2
- package/dist/plugin.esm.js +34 -0
- package/dist/plugin.esm.js.map +1 -0
- package/package.json +13 -9
- package/dist/esm/index-DMPeCQyc.esm.js.map +0 -1
- package/dist/esm/index-i1EiZshE.esm.js +0 -63
- package/dist/esm/index-i1EiZshE.esm.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AllureApi.esm.js","sources":["../../src/api/AllureApi.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createApiRef } from '@backstage/core-plugin-api';\n\nexport type AllureApi = {\n getReportUrl(projectId: string): Promise<string>;\n};\n\nexport const allureApiRef = createApiRef<AllureApi>({\n id: 'allure-api',\n});\n"],"names":[],"mappings":";;AAqBO,MAAM,eAAe,YAAwB,CAAA;AAAA,EAClD,EAAI,EAAA,YAAA;AACN,CAAC;;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
class AllureApiClient {
|
|
2
|
+
configApi;
|
|
3
|
+
constructor(options) {
|
|
4
|
+
this.configApi = options.configApi;
|
|
5
|
+
}
|
|
6
|
+
async getReportUrl(projectId) {
|
|
7
|
+
const baseUrl = this.configApi.getString("allure.baseUrl");
|
|
8
|
+
return `${baseUrl}/projects/${projectId}/reports/latest/index.html`;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { AllureApiClient };
|
|
13
|
+
//# sourceMappingURL=AllureApiClient.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AllureApiClient.esm.js","sources":["../../src/api/AllureApiClient.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ConfigApi } from '@backstage/core-plugin-api';\nimport { AllureApi } from './AllureApi';\n\nexport class AllureApiClient implements AllureApi {\n readonly configApi: ConfigApi;\n\n constructor(options: { configApi: ConfigApi }) {\n this.configApi = options.configApi;\n }\n\n async getReportUrl(projectId: string): Promise<string> {\n const baseUrl = this.configApi.getString('allure.baseUrl');\n return `${baseUrl}/projects/${projectId}/reports/latest/index.html`;\n }\n}\n"],"names":[],"mappings":"AAkBO,MAAM,eAAqC,CAAA;AAAA,EACvC,SAAA,CAAA;AAAA,EAET,YAAY,OAAmC,EAAA;AAC7C,IAAA,IAAA,CAAK,YAAY,OAAQ,CAAA,SAAA,CAAA;AAAA,GAC3B;AAAA,EAEA,MAAM,aAAa,SAAoC,EAAA;AACrD,IAAA,MAAM,OAAU,GAAA,IAAA,CAAK,SAAU,CAAA,SAAA,CAAU,gBAAgB,CAAA,CAAA;AACzD,IAAO,OAAA,CAAA,EAAG,OAAO,CAAA,UAAA,EAAa,SAAS,CAAA,0BAAA,CAAA,CAAA;AAAA,GACzC;AACF;;;;"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useApi } from '@backstage/core-plugin-api';
|
|
3
|
-
import {
|
|
3
|
+
import { allureApiRef } from '../../api/AllureApi.esm.js';
|
|
4
4
|
import { useEntity, MissingAnnotationEmptyState } from '@backstage/plugin-catalog-react';
|
|
5
|
+
import { isAllureReportAvailable, ALLURE_PROJECT_ID_ANNOTATION, getAllureProjectId } from '../annotationHelpers.esm.js';
|
|
5
6
|
import { Progress } from '@backstage/core-components';
|
|
6
7
|
import useAsync from 'react-use/esm/useAsync';
|
|
7
8
|
|
|
@@ -31,10 +32,9 @@ const AllureReport = (props) => {
|
|
|
31
32
|
const AllureReportComponent = () => {
|
|
32
33
|
const { entity } = useEntity();
|
|
33
34
|
const isReportAvailable = entity && isAllureReportAvailable(entity);
|
|
34
|
-
if (isReportAvailable)
|
|
35
|
-
return /* @__PURE__ */ React.createElement(AllureReport, { entity });
|
|
35
|
+
if (isReportAvailable) return /* @__PURE__ */ React.createElement(AllureReport, { entity });
|
|
36
36
|
return /* @__PURE__ */ React.createElement(MissingAnnotationEmptyState, { annotation: ALLURE_PROJECT_ID_ANNOTATION });
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
export { AllureReportComponent };
|
|
40
|
-
//# sourceMappingURL=
|
|
40
|
+
//# sourceMappingURL=AllureReportComponent.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AllureReportComponent.esm.js","sources":["../../../src/components/AllureReportComponent/AllureReportComponent.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React from 'react';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { allureApiRef } from '../../api';\nimport {\n useEntity,\n MissingAnnotationEmptyState,\n} from '@backstage/plugin-catalog-react';\nimport {\n ALLURE_PROJECT_ID_ANNOTATION,\n isAllureReportAvailable,\n getAllureProjectId,\n} from '../annotationHelpers';\nimport { Progress } from '@backstage/core-components';\nimport useAsync from 'react-use/esm/useAsync';\nimport { Entity } from '@backstage/catalog-model';\n\nconst AllureReport = (props: { entity: Entity }) => {\n const allureApi = useApi(allureApiRef);\n\n const allureProjectId = getAllureProjectId(props.entity);\n const { value, loading } = useAsync(async () => {\n const url = await allureApi.getReportUrl(allureProjectId);\n return url;\n });\n\n if (loading) {\n return <Progress />;\n }\n return (\n <iframe\n style={{\n display: 'table',\n width: '100%',\n height: '100%',\n }}\n title=\"Allure Report\"\n src={value}\n />\n );\n};\n\nexport const AllureReportComponent = () => {\n const { entity } = useEntity();\n const isReportAvailable = entity && isAllureReportAvailable(entity);\n\n if (isReportAvailable) return <AllureReport entity={entity} />;\n return (\n <MissingAnnotationEmptyState annotation={ALLURE_PROJECT_ID_ANNOTATION} />\n );\n};\n"],"names":[],"mappings":";;;;;;;;AA+BA,MAAM,YAAA,GAAe,CAAC,KAA8B,KAAA;AAClD,EAAM,MAAA,SAAA,GAAY,OAAO,YAAY,CAAA,CAAA;AAErC,EAAM,MAAA,eAAA,GAAkB,kBAAmB,CAAA,KAAA,CAAM,MAAM,CAAA,CAAA;AACvD,EAAA,MAAM,EAAE,KAAA,EAAO,OAAQ,EAAA,GAAI,SAAS,YAAY;AAC9C,IAAA,MAAM,GAAM,GAAA,MAAM,SAAU,CAAA,YAAA,CAAa,eAAe,CAAA,CAAA;AACxD,IAAO,OAAA,GAAA,CAAA;AAAA,GACR,CAAA,CAAA;AAED,EAAA,IAAI,OAAS,EAAA;AACX,IAAA,2CAAQ,QAAS,EAAA,IAAA,CAAA,CAAA;AAAA,GACnB;AACA,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,KAAO,EAAA;AAAA,QACL,OAAS,EAAA,OAAA;AAAA,QACT,KAAO,EAAA,MAAA;AAAA,QACP,MAAQ,EAAA,MAAA;AAAA,OACV;AAAA,MACA,KAAM,EAAA,eAAA;AAAA,MACN,GAAK,EAAA,KAAA;AAAA,KAAA;AAAA,GACP,CAAA;AAEJ,CAAA,CAAA;AAEO,MAAM,wBAAwB,MAAM;AACzC,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA,CAAA;AAC7B,EAAM,MAAA,iBAAA,GAAoB,MAAU,IAAA,uBAAA,CAAwB,MAAM,CAAA,CAAA;AAElE,EAAA,IAAI,iBAAmB,EAAA,uBAAQ,KAAA,CAAA,aAAA,CAAA,YAAA,EAAA,EAAa,MAAgB,EAAA,CAAA,CAAA;AAC5D,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,2BAA4B,EAAA,EAAA,UAAA,EAAY,4BAA8B,EAAA,CAAA,CAAA;AAE3E;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const ALLURE_PROJECT_ID_ANNOTATION = "qameta.io/allure-project";
|
|
2
|
+
const isAllureReportAvailable = (entity) => Boolean(entity.metadata.annotations?.[ALLURE_PROJECT_ID_ANNOTATION]);
|
|
3
|
+
const getAllureProjectId = (entity) => {
|
|
4
|
+
return entity?.metadata.annotations?.[ALLURE_PROJECT_ID_ANNOTATION] ?? "";
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export { ALLURE_PROJECT_ID_ANNOTATION, getAllureProjectId, isAllureReportAvailable };
|
|
8
|
+
//# sourceMappingURL=annotationHelpers.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"annotationHelpers.esm.js","sources":["../../src/components/annotationHelpers.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Entity } from '@backstage/catalog-model';\n\n/** @public */\nexport const ALLURE_PROJECT_ID_ANNOTATION = 'qameta.io/allure-project';\n\n/** @public */\nexport const isAllureReportAvailable = (entity: Entity) =>\n Boolean(entity.metadata.annotations?.[ALLURE_PROJECT_ID_ANNOTATION]);\n\nexport const getAllureProjectId = (entity: Entity) => {\n return entity?.metadata.annotations?.[ALLURE_PROJECT_ID_ANNOTATION] ?? '';\n};\n"],"names":[],"mappings":"AAkBO,MAAM,4BAA+B,GAAA,2BAAA;AAG/B,MAAA,uBAAA,GAA0B,CAAC,MACtC,KAAA,OAAA,CAAQ,OAAO,QAAS,CAAA,WAAA,GAAc,4BAA4B,CAAC,EAAA;AAExD,MAAA,kBAAA,GAAqB,CAAC,MAAmB,KAAA;AACpD,EAAA,OAAO,MAAQ,EAAA,QAAA,CAAS,WAAc,GAAA,4BAA4B,CAAK,IAAA,EAAA,CAAA;AACzE;;;;"}
|
package/dist/index.esm.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
1
|
+
export { EntityAllureReportContent, allurePlugin } from './plugin.esm.js';
|
|
2
|
+
export { ALLURE_PROJECT_ID_ANNOTATION, isAllureReportAvailable } from './components/annotationHelpers.esm.js';
|
|
3
3
|
//# sourceMappingURL=index.esm.js.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { createRouteRef, createPlugin, createApiFactory, configApiRef, createRoutableExtension } from '@backstage/core-plugin-api';
|
|
2
|
+
import { allureApiRef } from './api/AllureApi.esm.js';
|
|
3
|
+
import { AllureApiClient } from './api/AllureApiClient.esm.js';
|
|
4
|
+
|
|
5
|
+
const allureRouteRef = createRouteRef({
|
|
6
|
+
id: "allure"
|
|
7
|
+
});
|
|
8
|
+
const allurePlugin = createPlugin({
|
|
9
|
+
id: "allure",
|
|
10
|
+
apis: [
|
|
11
|
+
createApiFactory({
|
|
12
|
+
api: allureApiRef,
|
|
13
|
+
deps: {
|
|
14
|
+
configApi: configApiRef
|
|
15
|
+
},
|
|
16
|
+
factory: ({ configApi }) => new AllureApiClient({ configApi })
|
|
17
|
+
})
|
|
18
|
+
],
|
|
19
|
+
routes: {
|
|
20
|
+
root: allureRouteRef
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const EntityAllureReportContent = allurePlugin.provide(
|
|
24
|
+
createRoutableExtension({
|
|
25
|
+
name: "EntityAllureReportContent",
|
|
26
|
+
component: () => import('./components/AllureReportComponent/index.esm.js').then(
|
|
27
|
+
(m) => m.AllureReportComponent
|
|
28
|
+
),
|
|
29
|
+
mountPoint: allureRouteRef
|
|
30
|
+
})
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
export { EntityAllureReportContent, allurePlugin, allureRouteRef };
|
|
34
|
+
//# sourceMappingURL=plugin.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.esm.js","sources":["../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n configApiRef,\n createApiFactory,\n createPlugin,\n createRoutableExtension,\n createRouteRef,\n} from '@backstage/core-plugin-api';\nimport { AllureApiClient, allureApiRef } from './api';\n\nexport const allureRouteRef = createRouteRef({\n id: 'allure',\n});\n\n/** @public */\nexport const allurePlugin = createPlugin({\n id: 'allure',\n apis: [\n createApiFactory({\n api: allureApiRef,\n deps: {\n configApi: configApiRef,\n },\n factory: ({ configApi }) => new AllureApiClient({ configApi }),\n }),\n ],\n routes: {\n root: allureRouteRef,\n },\n});\n\n/** @public */\nexport const EntityAllureReportContent = allurePlugin.provide(\n createRoutableExtension({\n name: 'EntityAllureReportContent',\n component: () =>\n import('./components/AllureReportComponent').then(\n m => m.AllureReportComponent,\n ),\n mountPoint: allureRouteRef,\n }),\n);\n"],"names":[],"mappings":";;;;AAwBO,MAAM,iBAAiB,cAAe,CAAA;AAAA,EAC3C,EAAI,EAAA,QAAA;AACN,CAAC,EAAA;AAGM,MAAM,eAAe,YAAa,CAAA;AAAA,EACvC,EAAI,EAAA,QAAA;AAAA,EACJ,IAAM,EAAA;AAAA,IACJ,gBAAiB,CAAA;AAAA,MACf,GAAK,EAAA,YAAA;AAAA,MACL,IAAM,EAAA;AAAA,QACJ,SAAW,EAAA,YAAA;AAAA,OACb;AAAA,MACA,OAAA,EAAS,CAAC,EAAE,SAAA,OAAgB,IAAI,eAAA,CAAgB,EAAE,SAAA,EAAW,CAAA;AAAA,KAC9D,CAAA;AAAA,GACH;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA,cAAA;AAAA,GACR;AACF,CAAC,EAAA;AAGM,MAAM,4BAA4B,YAAa,CAAA,OAAA;AAAA,EACpD,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,2BAAA;AAAA,IACN,SAAW,EAAA,MACT,OAAO,iDAAoC,CAAE,CAAA,IAAA;AAAA,MAC3C,OAAK,CAAE,CAAA,qBAAA;AAAA,KACT;AAAA,IACF,UAAY,EAAA,cAAA;AAAA,GACb,CAAA;AACH;;;;"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage-community/plugin-allure",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.52",
|
|
4
4
|
"description": "A Backstage plugin that integrates with Allure",
|
|
5
5
|
"backstage": {
|
|
6
|
-
"role": "frontend-plugin"
|
|
6
|
+
"role": "frontend-plugin",
|
|
7
|
+
"pluginId": "allure",
|
|
8
|
+
"pluginPackages": [
|
|
9
|
+
"@backstage-community/plugin-allure"
|
|
10
|
+
]
|
|
7
11
|
},
|
|
8
12
|
"publishConfig": {
|
|
9
13
|
"access": "public",
|
|
@@ -33,17 +37,17 @@
|
|
|
33
37
|
"test": "backstage-cli package test"
|
|
34
38
|
},
|
|
35
39
|
"dependencies": {
|
|
36
|
-
"@backstage/catalog-model": "^1.
|
|
37
|
-
"@backstage/core-components": "^0.14.
|
|
38
|
-
"@backstage/core-plugin-api": "^1.9.
|
|
39
|
-
"@backstage/plugin-catalog-react": "^1.
|
|
40
|
+
"@backstage/catalog-model": "^1.5.0",
|
|
41
|
+
"@backstage/core-components": "^0.14.9",
|
|
42
|
+
"@backstage/core-plugin-api": "^1.9.3",
|
|
43
|
+
"@backstage/plugin-catalog-react": "^1.12.2",
|
|
40
44
|
"@types/react": "^16.13.1 || ^17.0.0 || ^18.0.0",
|
|
41
45
|
"react-use": "^17.2.4"
|
|
42
46
|
},
|
|
43
47
|
"devDependencies": {
|
|
44
|
-
"@backstage/cli": "^0.26.
|
|
45
|
-
"@backstage/dev-utils": "^1.0.
|
|
46
|
-
"@backstage/test-utils": "^1.5.
|
|
48
|
+
"@backstage/cli": "^0.26.11",
|
|
49
|
+
"@backstage/dev-utils": "^1.0.35",
|
|
50
|
+
"@backstage/test-utils": "^1.5.8",
|
|
47
51
|
"@testing-library/dom": "^10.0.0",
|
|
48
52
|
"@testing-library/jest-dom": "^6.0.0",
|
|
49
53
|
"@testing-library/react": "^15.0.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-DMPeCQyc.esm.js","sources":["../../src/components/AllureReportComponent/AllureReportComponent.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React from 'react';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { allureApiRef } from '../../api';\nimport {\n useEntity,\n MissingAnnotationEmptyState,\n} from '@backstage/plugin-catalog-react';\nimport {\n ALLURE_PROJECT_ID_ANNOTATION,\n isAllureReportAvailable,\n getAllureProjectId,\n} from '../annotationHelpers';\nimport { Progress } from '@backstage/core-components';\nimport useAsync from 'react-use/esm/useAsync';\nimport { Entity } from '@backstage/catalog-model';\n\nconst AllureReport = (props: { entity: Entity }) => {\n const allureApi = useApi(allureApiRef);\n\n const allureProjectId = getAllureProjectId(props.entity);\n const { value, loading } = useAsync(async () => {\n const url = await allureApi.getReportUrl(allureProjectId);\n return url;\n });\n\n if (loading) {\n return <Progress />;\n }\n return (\n <iframe\n style={{\n display: 'table',\n width: '100%',\n height: '100%',\n }}\n title=\"Allure Report\"\n src={value}\n />\n );\n};\n\nexport const AllureReportComponent = () => {\n const { entity } = useEntity();\n const isReportAvailable = entity && isAllureReportAvailable(entity);\n\n if (isReportAvailable) return <AllureReport entity={entity} />;\n return (\n <MissingAnnotationEmptyState annotation={ALLURE_PROJECT_ID_ANNOTATION} />\n );\n};\n"],"names":[],"mappings":";;;;;;;AA+BA,MAAM,YAAA,GAAe,CAAC,KAA8B,KAAA;AAClD,EAAM,MAAA,SAAA,GAAY,OAAO,YAAY,CAAA,CAAA;AAErC,EAAM,MAAA,eAAA,GAAkB,kBAAmB,CAAA,KAAA,CAAM,MAAM,CAAA,CAAA;AACvD,EAAA,MAAM,EAAE,KAAA,EAAO,OAAQ,EAAA,GAAI,SAAS,YAAY;AAC9C,IAAA,MAAM,GAAM,GAAA,MAAM,SAAU,CAAA,YAAA,CAAa,eAAe,CAAA,CAAA;AACxD,IAAO,OAAA,GAAA,CAAA;AAAA,GACR,CAAA,CAAA;AAED,EAAA,IAAI,OAAS,EAAA;AACX,IAAA,2CAAQ,QAAS,EAAA,IAAA,CAAA,CAAA;AAAA,GACnB;AACA,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,KAAO,EAAA;AAAA,QACL,OAAS,EAAA,OAAA;AAAA,QACT,KAAO,EAAA,MAAA;AAAA,QACP,MAAQ,EAAA,MAAA;AAAA,OACV;AAAA,MACA,KAAM,EAAA,eAAA;AAAA,MACN,GAAK,EAAA,KAAA;AAAA,KAAA;AAAA,GACP,CAAA;AAEJ,CAAA,CAAA;AAEO,MAAM,wBAAwB,MAAM;AACzC,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA,CAAA;AAC7B,EAAM,MAAA,iBAAA,GAAoB,MAAU,IAAA,uBAAA,CAAwB,MAAM,CAAA,CAAA;AAElE,EAAI,IAAA,iBAAA;AAAmB,IAAO,uBAAA,KAAA,CAAA,aAAA,CAAC,gBAAa,MAAgB,EAAA,CAAA,CAAA;AAC5D,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,2BAA4B,EAAA,EAAA,UAAA,EAAY,4BAA8B,EAAA,CAAA,CAAA;AAE3E;;;;"}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { createApiRef, createRouteRef, createPlugin, createApiFactory, configApiRef, createRoutableExtension } from '@backstage/core-plugin-api';
|
|
2
|
-
|
|
3
|
-
const allureApiRef = createApiRef({
|
|
4
|
-
id: "allure-api"
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
var __defProp = Object.defineProperty;
|
|
8
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
-
var __publicField = (obj, key, value) => {
|
|
10
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
11
|
-
return value;
|
|
12
|
-
};
|
|
13
|
-
class AllureApiClient {
|
|
14
|
-
constructor(options) {
|
|
15
|
-
__publicField(this, "configApi");
|
|
16
|
-
this.configApi = options.configApi;
|
|
17
|
-
}
|
|
18
|
-
async getReportUrl(projectId) {
|
|
19
|
-
const baseUrl = this.configApi.getString("allure.baseUrl");
|
|
20
|
-
return `${baseUrl}/projects/${projectId}/reports/latest/index.html`;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const allureRouteRef = createRouteRef({
|
|
25
|
-
id: "allure"
|
|
26
|
-
});
|
|
27
|
-
const allurePlugin = createPlugin({
|
|
28
|
-
id: "allure",
|
|
29
|
-
apis: [
|
|
30
|
-
createApiFactory({
|
|
31
|
-
api: allureApiRef,
|
|
32
|
-
deps: {
|
|
33
|
-
configApi: configApiRef
|
|
34
|
-
},
|
|
35
|
-
factory: ({ configApi }) => new AllureApiClient({ configApi })
|
|
36
|
-
})
|
|
37
|
-
],
|
|
38
|
-
routes: {
|
|
39
|
-
root: allureRouteRef
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
const EntityAllureReportContent = allurePlugin.provide(
|
|
43
|
-
createRoutableExtension({
|
|
44
|
-
name: "EntityAllureReportContent",
|
|
45
|
-
component: () => import('./index-DMPeCQyc.esm.js').then(
|
|
46
|
-
(m) => m.AllureReportComponent
|
|
47
|
-
),
|
|
48
|
-
mountPoint: allureRouteRef
|
|
49
|
-
})
|
|
50
|
-
);
|
|
51
|
-
|
|
52
|
-
const ALLURE_PROJECT_ID_ANNOTATION = "qameta.io/allure-project";
|
|
53
|
-
const isAllureReportAvailable = (entity) => {
|
|
54
|
-
var _a;
|
|
55
|
-
return Boolean((_a = entity.metadata.annotations) == null ? void 0 : _a[ALLURE_PROJECT_ID_ANNOTATION]);
|
|
56
|
-
};
|
|
57
|
-
const getAllureProjectId = (entity) => {
|
|
58
|
-
var _a, _b;
|
|
59
|
-
return (_b = (_a = entity == null ? void 0 : entity.metadata.annotations) == null ? void 0 : _a[ALLURE_PROJECT_ID_ANNOTATION]) != null ? _b : "";
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export { ALLURE_PROJECT_ID_ANNOTATION as A, EntityAllureReportContent as E, allureApiRef as a, allurePlugin as b, getAllureProjectId as g, isAllureReportAvailable as i };
|
|
63
|
-
//# sourceMappingURL=index-i1EiZshE.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-i1EiZshE.esm.js","sources":["../../src/api/AllureApi.ts","../../src/api/AllureApiClient.ts","../../src/plugin.ts","../../src/components/annotationHelpers.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createApiRef } from '@backstage/core-plugin-api';\n\nexport type AllureApi = {\n getReportUrl(projectId: string): Promise<string>;\n};\n\nexport const allureApiRef = createApiRef<AllureApi>({\n id: 'allure-api',\n});\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ConfigApi } from '@backstage/core-plugin-api';\nimport { AllureApi } from './AllureApi';\n\nexport class AllureApiClient implements AllureApi {\n readonly configApi: ConfigApi;\n\n constructor(options: { configApi: ConfigApi }) {\n this.configApi = options.configApi;\n }\n\n async getReportUrl(projectId: string): Promise<string> {\n const baseUrl = this.configApi.getString('allure.baseUrl');\n return `${baseUrl}/projects/${projectId}/reports/latest/index.html`;\n }\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n configApiRef,\n createApiFactory,\n createPlugin,\n createRoutableExtension,\n createRouteRef,\n} from '@backstage/core-plugin-api';\nimport { AllureApiClient, allureApiRef } from './api';\n\nexport const allureRouteRef = createRouteRef({\n id: 'allure',\n});\n\n/** @public */\nexport const allurePlugin = createPlugin({\n id: 'allure',\n apis: [\n createApiFactory({\n api: allureApiRef,\n deps: {\n configApi: configApiRef,\n },\n factory: ({ configApi }) => new AllureApiClient({ configApi }),\n }),\n ],\n routes: {\n root: allureRouteRef,\n },\n});\n\n/** @public */\nexport const EntityAllureReportContent = allurePlugin.provide(\n createRoutableExtension({\n name: 'EntityAllureReportContent',\n component: () =>\n import('./components/AllureReportComponent').then(\n m => m.AllureReportComponent,\n ),\n mountPoint: allureRouteRef,\n }),\n);\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Entity } from '@backstage/catalog-model';\n\n/** @public */\nexport const ALLURE_PROJECT_ID_ANNOTATION = 'qameta.io/allure-project';\n\n/** @public */\nexport const isAllureReportAvailable = (entity: Entity) =>\n Boolean(entity.metadata.annotations?.[ALLURE_PROJECT_ID_ANNOTATION]);\n\nexport const getAllureProjectId = (entity: Entity) => {\n return entity?.metadata.annotations?.[ALLURE_PROJECT_ID_ANNOTATION] ?? '';\n};\n"],"names":[],"mappings":";;AAqBO,MAAM,eAAe,YAAwB,CAAA;AAAA,EAClD,EAAI,EAAA,YAAA;AACN,CAAC;;;;;;;;ACLM,MAAM,eAAqC,CAAA;AAAA,EAGhD,YAAY,OAAmC,EAAA;AAF/C,IAAS,aAAA,CAAA,IAAA,EAAA,WAAA,CAAA,CAAA;AAGP,IAAA,IAAA,CAAK,YAAY,OAAQ,CAAA,SAAA,CAAA;AAAA,GAC3B;AAAA,EAEA,MAAM,aAAa,SAAoC,EAAA;AACrD,IAAA,MAAM,OAAU,GAAA,IAAA,CAAK,SAAU,CAAA,SAAA,CAAU,gBAAgB,CAAA,CAAA;AACzD,IAAO,OAAA,CAAA,EAAG,OAAO,CAAA,UAAA,EAAa,SAAS,CAAA,0BAAA,CAAA,CAAA;AAAA,GACzC;AACF;;ACLO,MAAM,iBAAiB,cAAe,CAAA;AAAA,EAC3C,EAAI,EAAA,QAAA;AACN,CAAC,CAAA,CAAA;AAGM,MAAM,eAAe,YAAa,CAAA;AAAA,EACvC,EAAI,EAAA,QAAA;AAAA,EACJ,IAAM,EAAA;AAAA,IACJ,gBAAiB,CAAA;AAAA,MACf,GAAK,EAAA,YAAA;AAAA,MACL,IAAM,EAAA;AAAA,QACJ,SAAW,EAAA,YAAA;AAAA,OACb;AAAA,MACA,OAAA,EAAS,CAAC,EAAE,SAAA,OAAgB,IAAI,eAAA,CAAgB,EAAE,SAAA,EAAW,CAAA;AAAA,KAC9D,CAAA;AAAA,GACH;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA,cAAA;AAAA,GACR;AACF,CAAC,EAAA;AAGM,MAAM,4BAA4B,YAAa,CAAA,OAAA;AAAA,EACpD,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,2BAAA;AAAA,IACN,SAAW,EAAA,MACT,OAAO,yBAAoC,CAAE,CAAA,IAAA;AAAA,MAC3C,OAAK,CAAE,CAAA,qBAAA;AAAA,KACT;AAAA,IACF,UAAY,EAAA,cAAA;AAAA,GACb,CAAA;AACH;;ACrCO,MAAM,4BAA+B,GAAA,2BAAA;AAG/B,MAAA,uBAAA,GAA0B,CAAC,MAAgB,KAAA;AArBxD,EAAA,IAAA,EAAA,CAAA;AAsBE,EAAA,OAAA,OAAA,CAAA,CAAQ,EAAO,GAAA,MAAA,CAAA,QAAA,CAAS,WAAhB,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAA8B,4BAA6B,CAAA,CAAA,CAAA;AAAA,EAAA;AAExD,MAAA,kBAAA,GAAqB,CAAC,MAAmB,KAAA;AAxBtD,EAAA,IAAA,EAAA,EAAA,EAAA,CAAA;AAyBE,EAAA,OAAA,CAAO,EAAQ,GAAA,CAAA,EAAA,GAAA,MAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,MAAA,CAAA,QAAA,CAAS,WAAjB,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAA+B,kCAA/B,IAAgE,GAAA,EAAA,GAAA,EAAA,CAAA;AACzE;;;;"}
|