Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ lib
esm
es6
docs/_site/
docs/.jekyll-metadata
packages/react-admin/docs
examples/**/static
examples/**/dist
Expand Down
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,15 @@ build: build-ra-core build-ra-ui-materialui build-react-admin build-ra-data-fake
doc: ## compile doc as html and launch doc web server
@yarn -s doc

serve-github-pages: ## Serve the doc from a Github Pages docker container
@docker run -it --rm \
Comment thread
Kmaschta marked this conversation as resolved.
-p 4000:4000 \
-v "${PWD}/docs:/usr/src/app" \
starefossen/github-pages:onbuild \
jekyll serve \
--host=0.0.0.0 \
--incremental

lint: ## lint the code and check coding conventions
@echo "Running linter..."
@yarn -s tslint 'packages/*/src/**/*.*s'
Expand Down
2 changes: 1 addition & 1 deletion docs/Admin.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ const App = () => (

## `menu`

**Tip**: This prop is deprecated. To override the menu component, use a [custom layout](#appLayout) instead.
**Tip**: This prop is deprecated. To override the menu component, use a [custom layout](#applayout) instead.

React-admin uses the list of `<Resource>` components passed as children of `<Admin>` to build a menu to each resource with a `list` component.

Expand Down
26 changes: 26 additions & 0 deletions docs/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ title: "FAQ"
- [A form with validation freezes when rendering](#a-form-with-validation-freezes-when-rendering)
- [How can I customize the UI depending on the user permissions?](#how-can-i-customize-the-ui-depending-on-the-user-permissions)
- [How can I customize forms depending on its inputs values?](#how-can-i-customize-forms-depending-on-its-inputs-values)
- [My Resource is defined but not displayed on the Menu](#my-resource-is-defined-but-not-displayed-on-the-menu)

## Can I have custom identifiers/primary keys for my resources?

Expand Down Expand Up @@ -106,3 +107,28 @@ You have probably specified a version requirement for `@material-ui/core` that i
Please align your version requirement with the one of the `ra-ui-materialui` package.

See this [issue for more information](https://github.com/marmelab/react-admin/issues/1782).

## My Resource is defined but not displayed on the Menu

You can declare a resource without `list` prop, to manage reference for example:

```jsx
<Admin>
<Resource name="reference" create={PostReference} edit={EditReference} />
</Admin>
```

But with the default menu, resources without `list` prop aren't shown.

In order to have a specific resource without `list` prop listed on the menu, you have to [write your own custom menu](./Theming.html#using-a-custom-menu).

```jsx
const MyMenu = ({ resources, onMenuClick, logout }) => (
<div>
{resources.map(resource => (
<MenuItemLink to={`/${resource.name}`} primaryText={resource.name} onClick={onMenuClick} />
))}
<MenuItemLink to="/reference/create" primaryText="New Reference" onClick={onMenuClick} />
</div>
);
```
2 changes: 1 addition & 1 deletion docs/Resource.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const App = () => (

`<Resource>` allows you to define a component for each CRUD operation, using the following prop names:

* `list`
* `list` (if defined, the resource is displayed on the Menu)
* `create`
* `edit`
* `show`
Expand Down