diff --git a/plugins/todo/dev/index.tsx b/plugins/todo/dev/index.tsx index 9560c49ecb..08936f3657 100644 --- a/plugins/todo/dev/index.tsx +++ b/plugins/todo/dev/index.tsx @@ -13,10 +13,20 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import { Entity, LOCATION_ANNOTATION } from '@backstage/catalog-model'; -import { Content, Header, HeaderLabel, Page } from '@backstage/core'; +import { + ApiProvider, + ApiRegistry, + Content, + Header, + HeaderLabel, + Page, +} from '@backstage/core'; import { createDevApp } from '@backstage/dev-utils'; import { EntityProvider } from '@backstage/plugin-catalog-react'; +import OnlineIcon from '@material-ui/icons/Cloud'; +import OfflineIcon from '@material-ui/icons/Storage'; import React from 'react'; import { EntityTodoContent, todoApiRef, todoPlugin } from '../src'; @@ -35,36 +45,49 @@ const entity: Entity = { }, }; +const mockedApi = { + listTodos: async () => ({ + items: [ + { + text: 'Make sure this works', + author: 'Rugvip', + viewUrl: 'https://github.com/backstage/backstage', + }, + ], + totalCount: 15, + cursors: { + prev: 'prev', + self: 'self', + next: 'next', + }, + }), +}; + createDevApp() .registerPlugin(todoPlugin) - .registerApi({ - api: todoApiRef, - deps: {}, - factory() { - return { - listTodos: async () => ({ - items: [ - { - text: 'Make sure this works', - author: 'Rugvip', - viewUrl: 'https://github.com/backstage/backstage', - }, - ], - totalCount: 15, - cursors: { - prev: 'prev', - self: 'self', - next: 'next', - }, - }), - }; - }, + .addPage({ + element: ( + + + +
+ +
+ + + +
+
+
+ ), + title: 'Entity Todo Content', + icon: OfflineIcon, }) .addPage({ element: ( -
+
@@ -73,6 +96,7 @@ createDevApp() ), - title: 'Entity Todo Content', + title: 'Backend Connected', + icon: OnlineIcon, }) .render();