diff --git a/plugins/bazaar/dev/__fixtures__/get-projects-response.json b/plugins/bazaar/dev/__fixtures__/get-projects-response.json new file mode 100644 index 0000000000..7aee019a6e --- /dev/null +++ b/plugins/bazaar/dev/__fixtures__/get-projects-response.json @@ -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" + } + ] +} diff --git a/plugins/bazaar/dev/index.tsx b/plugins/bazaar/dev/index.tsx index a4509bc1fc..f2c40df8e1 100644 --- a/plugins/bazaar/dev/index.tsx +++ b/plugins/bazaar/dev/index.tsx @@ -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: , title: 'Root Page',