File tree Expand file tree Collapse file tree 4 files changed +45
-29
lines changed
Expand file tree Collapse file tree 4 files changed +45
-29
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ api_platform:
66 include_type : true
77 formats :
88 jsonld : ['application/ld+json']
9+ json : ["application/json"]
910 docs_formats :
1011 jsonld : ['application/ld+json']
1112 jsonopenapi : ['application/vnd.openapi+json']
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ import React from 'react' ;
2+ import type { Meta , StoryObj } from '@storybook/react' ;
3+ import { within } from '@storybook/test' ;
4+ import { HydraAdmin , type HydraAdminProps } from '../hydra' ;
5+ import { OpenApiAdmin } from '../openapi' ;
6+
7+ /**
8+ * # Basic `<HydraAdmin>` component
9+ * The `<HydraAdmin>` component without any parameter.
10+ */
11+ const Basic = ( { entrypoint } : BasicProps ) => (
12+ < HydraAdmin entrypoint = { entrypoint } />
13+ ) ;
14+
15+ interface BasicProps extends Pick < HydraAdminProps , 'entrypoint' > { }
16+
17+ const meta = {
18+ title : 'Admin/Basic' ,
19+ component : Basic ,
20+ parameters : {
21+ layout : 'fullscreen' ,
22+ } ,
23+ } satisfies Meta < typeof Basic > ;
24+
25+ export default meta ;
26+
27+ type Story = StoryObj < typeof meta > ;
28+
29+ export const Hydra : Story = {
30+ play : async ( { canvasElement } ) => {
31+ const canvas = within ( canvasElement ) ;
32+ await canvas . findByText ( 'Greetings' ) ;
33+ } ,
34+ args : {
35+ entrypoint : process . env . ENTRYPOINT ,
36+ } ,
37+ } ;
38+
39+ export const OpenApi = ( ) => (
40+ < OpenApiAdmin
41+ entrypoint = { process . env . ENTRYPOINT }
42+ docEntrypoint = { `${ process . env . ENTRYPOINT } /docs.jsonopenapi` }
43+ />
44+ ) ;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments