@@ -14,29 +14,28 @@ Deprecated resources are hidden by default, but you can add them back using an e
14
14
15
15
``` javascript
16
16
// App.js
17
- import { AdminGuesser , ResourceGuesser } from " @api-platform/admin" ;
17
+ import { AdminGuesser , ResourceGuesser } from ' @api-platform/admin' ;
18
18
19
19
const App = () => (
20
- < AdminGuesser
21
- dataProvider= {dataProvider}
22
- authProvider= {authProvider}>
20
+ < AdminGuesser dataProvider= {dataProvider} authProvider= {authProvider}>
23
21
< ResourceGuesser
24
22
name= " books"
25
23
list= {BooksList}
26
24
show= {BooksShow}
27
25
edit= {BooksEdit}
28
- create= {BooksCreate} / >
26
+ create= {BooksCreate}
27
+ / >
29
28
< ResourceGuesser name= " authors" / >
30
29
< / AdminGuesser>
31
- )
30
+ );
32
31
33
32
export default App ;
34
33
```
35
34
36
35
#### Props
37
36
38
37
| Name | Type | Value | required | Description |
39
- | ------------------- | --------- | ---------------- | ---------- | ---------------------------------------------------------------------------------- |
38
+ | ----------------- | ------- | -------------- | -------- | -------------------------------------------------------------------------------- |
40
39
| dataProvider | object | dataProvider | yes | communicates with your API |
41
40
| schemaAnalyzer | object | schemaAnalyzer | yes | retrieves resource type according to [ Schema.org] ( https://schema.org ) vocabulary |
42
41
| theme | object | theme | no | theme of your Admin App |
@@ -50,19 +49,17 @@ Otherwise, you can pass it your own CRUD components using `create`, `list`, `edi
50
49
51
50
``` javascript
52
51
// App.js
53
- import { AdminGuesser , ResourceGuesser } from " @api-platform/admin" ;
52
+ import { AdminGuesser , ResourceGuesser } from ' @api-platform/admin' ;
54
53
55
54
const App = () => (
56
- < AdminGuesser
57
- dataProvider= {dataProvider}
58
- schemaAnalyzer= {schemaAnalyzer}
59
- >
55
+ < AdminGuesser dataProvider= {dataProvider} schemaAnalyzer= {schemaAnalyzer}>
60
56
< ResourceGuesser
61
57
name= " books"
62
58
list= {BooksList}
63
59
show= {BooksShow}
64
60
create= {BooksCreate}
65
- edit= {BooksEdit} / >
61
+ edit= {BooksEdit}
62
+ / >
66
63
< ResourceGuesser name= " reviews" / >
67
64
< / AdminGuesser>
68
65
);
@@ -73,7 +70,7 @@ export default App;
73
70
#### ResourceGuesser Props
74
71
75
72
| Name | Type | Value | required | Description |
76
- | ------ | -------- | ------- | ---------- | -------------------------- |
73
+ | ---- | ------ | ----- | -------- | ------------------------ |
77
74
| name | string | - | yes | endpoint of the resource |
78
75
79
76
You can also use props accepted by React Admin [ Resource component] ( https://marmelab.com/react-admin/Resource.html ) . For example, the props ` list ` , ` show ` , ` create ` or ` edit ` .
@@ -91,10 +88,10 @@ By default, `<ListGuesser>` comes with [Pagination](components.md#pagination).
91
88
92
89
``` javascript
93
90
// BooksList.js
94
- import { FieldGuesser , ListGuesser } from " @api-platform/admin" ;
95
- import { ReferenceField , TextField } from " react-admin" ;
91
+ import { FieldGuesser , ListGuesser } from ' @api-platform/admin' ;
92
+ import { ReferenceField , TextField } from ' react-admin' ;
96
93
97
- export const BooksList = props => (
94
+ export const BooksList = ( props ) => (
98
95
< ListGuesser {... props}>
99
96
< FieldGuesser source= " author" / >
100
97
< FieldGuesser source= " title" / >
@@ -107,9 +104,9 @@ export const BooksList = props => (
107
104
108
105
#### ListGuesser Props
109
106
110
- | Name | Type | Value | required | Description |
111
- | ---------- | --------- | ------- | ---------- | ----------------------------------------- |
112
- | filters | element | - | no | filters that can be applied to the list |
107
+ | Name | Type | Value | required | Description |
108
+ | ------- | ------- | ----- | -------- | --------------------------------------- |
109
+ | filters | element | - | no | filters that can be applied to the list |
113
110
114
111
You can also use props accepted by React Admin [ List] ( https://marmelab.com/react-admin/List.html ) .
115
112
@@ -120,9 +117,9 @@ For simple inputs, you can pass as children API Platform Admin [InputGuesser](co
120
117
121
118
``` javascript
122
119
// BooksCreate.js
123
- import { CreateGuesser , InputGuesser } from " @api-platform/admin" ;
120
+ import { CreateGuesser , InputGuesser } from ' @api-platform/admin' ;
124
121
125
- export const BooksCreate = props => (
122
+ export const BooksCreate = ( props ) => (
126
123
< CreateGuesser {... props}>
127
124
< InputGuesser source= " author" / >
128
125
< InputGuesser source= " title" / >
@@ -144,9 +141,9 @@ For simple inputs, you can use API Platform Admin [InputGuesser](components.md#i
144
141
145
142
``` javascript
146
143
// BooksEdit.js
147
- import { EditGuesser , InputGuesser } from " @api-platform/admin" ;
144
+ import { EditGuesser , InputGuesser } from ' @api-platform/admin' ;
148
145
149
- export const BooksEdit = props => (
146
+ export const BooksEdit = ( props ) => (
150
147
< EditGuesser {... props}>
151
148
< InputGuesser source= " author" / >
152
149
< InputGuesser source= " title" / >
@@ -167,9 +164,9 @@ Displays a detailed page for one item. Based on React Admin [Show component](htt
167
164
168
165
``` javascript
169
166
// BooksShow.js
170
- import { FieldGuesser , ShowGuesser } from " @api-platform/admin" ;
167
+ import { FieldGuesser , ShowGuesser } from ' @api-platform/admin' ;
171
168
172
- export const BooksShow = props => (
169
+ export const BooksShow = ( props ) => (
173
170
< ShowGuesser {... props}>
174
171
< FieldGuesser source= " author" / >
175
172
< FieldGuesser source= " title" / >
@@ -193,16 +190,16 @@ If you want to use other formats (see supported formats: `@api-platform/api-doc-
193
190
194
191
``` javascript
195
192
// App.js
196
- import { HydraAdmin , ResourceGuesser } from " @api-platform/admin" ;
193
+ import { HydraAdmin , ResourceGuesser } from ' @api-platform/admin' ;
197
194
198
195
const App = () => (
199
196
< HydraAdmin
200
197
entrypoint= {entrypoint}
201
198
dataProvider= {dataProvider}
202
199
authProvider= {authProvider}
203
- >
204
- < ResourceGuesser name= " books" / >
205
- { /* ... */ }
200
+ >
201
+ < ResourceGuesser name= " books" / >
202
+ { /* ... */ }
206
203
< / HydraAdmin>
207
204
);
208
205
@@ -212,12 +209,13 @@ export default App;
212
209
#### HydraAdmin Props
213
210
214
211
| Name | Type | Value | required | Description |
215
- | -------------- | --------------------- | -------------- | ---------- | ------------------------------ |
212
+ | ------------ | ------------------- | ------------ | -------- | ---------------------------- |
216
213
| entrypoint | string | - | yes | entrypoint of the API |
217
- | mercure | object| ; boolean | * | no | configuration to use Mercure |
214
+ | mercure | object| ; boolean | \* | no | configuration to use Mercure |
218
215
| dataProvider | object | dataProvider | no | hydra data provider to use |
219
216
220
217
\* ` false ` to explicitly disable, ` true ` to enable with default parameters or an object with the following properties:
218
+
221
219
- ` hub ` : the URL to your Mercure hub
222
220
- ` jwt ` : a subscriber JWT to access your Mercure hub
223
221
- ` topicUrl ` : the topic URL of your resources
@@ -241,17 +239,17 @@ If you want to use other formats (see supported formats: `@api-platform/api-doc-
241
239
242
240
``` javascript
243
241
// App.js
244
- import { OpenApiAdmin , ResourceGuesser } from " @api-platform/admin" ;
242
+ import { OpenApiAdmin , ResourceGuesser } from ' @api-platform/admin' ;
245
243
246
244
const App = () => (
247
245
< OpenApiAdmin
248
246
entrypoint= {entrypoint}
249
247
docEntrypoint= {docEntrypoint}
250
248
dataProvider= {dataProvider}
251
249
authProvider= {authProvider}
252
- >
253
- < ResourceGuesser name= " books" / >
254
- { /* ... */ }
250
+ >
251
+ < ResourceGuesser name= " books" / >
252
+ { /* ... */ }
255
253
< / OpenApiAdmin>
256
254
);
257
255
@@ -261,13 +259,14 @@ export default App;
261
259
#### OpenApiAdmin Props
262
260
263
261
| Name | Type | Value | required | Description |
264
- | --------------- | --------------------- | ------- | ---------- | ------------------------------ |
262
+ | ------------- | ------------------- | ----- | -------- | ---------------------------- |
265
263
| dataProvider | dataProvider | - | yes | data provider to use |
266
264
| docEntrypoint | string | - | yes | doc entrypoint of the API |
267
265
| entrypoint | string | - | yes | entrypoint of the API |
268
- | mercure | object| ; boolean | * | no | configuration to use Mercure |
266
+ | mercure | object| ; boolean | \* | no | configuration to use Mercure |
269
267
270
268
\* ` false ` to explicitly disable, ` true ` to enable with default parameters or an object with the following properties:
269
+
271
270
- ` hub ` : the URL to your Mercure hub
272
271
- ` jwt ` : a subscriber JWT to access your Mercure hub
273
272
- ` topicUrl ` : the topic URL of your resources
@@ -291,23 +290,23 @@ Based on React Admin [field components](https://marmelab.com/react-admin/Fields.
291
290
292
291
``` javascript
293
292
// BooksShow.js
294
- import { FieldGuesser , ShowGuesser } from " @api-platform/admin" ;
293
+ import { FieldGuesser , ShowGuesser } from ' @api-platform/admin' ;
295
294
296
- export const BooksShow = props => (
295
+ export const BooksShow = ( props ) => (
297
296
< ShowGuesser {... props}>
298
297
< FieldGuesser source= " author" / >
299
298
< FieldGuesser source= " title" / >
300
299
< FieldGuesser source= " rating" / >
301
300
< FieldGuesser source= " description" / >
302
301
< FieldGuesser source= " publicationDate" / >
303
302
< / ShowGuesser>
304
- )
303
+ );
305
304
```
306
305
307
306
#### FieldGuesser Props
308
307
309
308
| Name | Type | Value | required | Description |
310
- | -------- | -------- | ------- | ---------- | -------------------------------------- |
309
+ | ------ | ------ | ----- | -------- | ------------------------------------ |
311
310
| source | string | - | yes | name of the property of the resource |
312
311
313
312
You can also use props accepted by React Admin [ basic fields] ( https://marmelab.com/react-admin/Fields.html#basic-fields ) .
@@ -319,5 +318,5 @@ Uses React Admin [input components](https://marmelab.com/react-admin/Inputs.html
319
318
#### InputGuesser Props
320
319
321
320
| Name | Type | Value | required | Description |
322
- | -------- | -------- | ------- | ---------- | -------------------------------------- |
321
+ | ------ | ------ | ----- | -------- | ------------------------------------ |
323
322
| source | string | - | yes | name of the property of the resource |
0 commit comments