Bazaar: Fix stand alone devApp

The Bazaar stand alone devApp can now be started and will list two
projects with dummy data.

Signed-off-by: Niklas Aronsson <niklasar@axis.com>
This commit is contained in:
Niklas Aronsson
2023-04-19 13:02:29 +02:00
parent a8b4e44831
commit af266b55be
2 changed files with 55 additions and 0 deletions
@@ -0,0 +1,35 @@
{
"status": "ok",
"data": [
{
"id": 10,
"entity_ref": null,
"title": "Lorem ipsum 1",
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"status": "proposed",
"updated_at": "2023-03-10T12:41:41.941Z",
"community": "",
"size": "medium",
"start_date": null,
"end_date": null,
"responsible": "Responsible Adult 1",
"docs": null,
"members_count": "3"
},
{
"id": 11,
"entity_ref": null,
"title": "Lorem ipsum 2",
"description": "sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud",
"status": "proposed",
"updated_at": "2023-03-09T12:41:41.941Z",
"community": "",
"size": "medium",
"start_date": null,
"end_date": null,
"responsible": "Responsible Adult 2",
"docs": null,
"members_count": "5"
}
]
}
+20
View File
@@ -16,10 +16,30 @@
import React from 'react';
import { createDevApp } from '@backstage/dev-utils';
import { CatalogApi, catalogApiRef } from '@backstage/plugin-catalog-react';
import { bazaarPlugin, BazaarPage } from '../src/plugin';
import { bazaarApiRef } from '../src/api';
import getProjectsData from './__fixtures__/get-projects-response.json';
createDevApp()
.registerPlugin(bazaarPlugin)
.registerApi({
api: bazaarApiRef,
deps: {},
factory: () =>
({
getProjects: async () => getProjectsData,
} as any),
})
.registerApi({
api: catalogApiRef,
deps: {},
factory: () =>
({
getEntities: () => ({}),
} as CatalogApi),
})
.addPage({
element: <BazaarPage />,
title: 'Root Page',