muffin-admin 2.8.0 → 2.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/types.d.ts CHANGED
@@ -42,6 +42,7 @@ export type AdminResourceProps = {
42
42
  limit: number;
43
43
  limitMax: number;
44
44
  actions: AdminAction[];
45
+ create: boolean;
45
46
  filters: AdminInput[];
46
47
  fields: AdminField[];
47
48
  show: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muffin-admin",
3
- "version": "2.8.0",
3
+ "version": "2.8.2",
4
4
  "description": "NPM package for https://github.com/klen/muffin-admin",
5
5
  "files": [
6
6
  "src",
@@ -1,6 +1,6 @@
1
1
  import sortBy from "lodash/sortBy"
2
2
  import uniq from "lodash/uniq"
3
- import { BulkDeleteButton, Datagrid, EditButton, List, Pagination } from "react-admin"
3
+ import { BulkDeleteButton, Datagrid, EditButton, List, ListActions, Pagination } from "react-admin"
4
4
  import { buildRA } from "./buildRA"
5
5
  import { BulkActionButton } from "./buttons"
6
6
  import { useMuffinResourceOpts } from "./hooks"
@@ -9,7 +9,7 @@ import { buildAdmin, findBuilder, setupAdmin } from "./utils"
9
9
 
10
10
  export function MuffinResourceList() {
11
11
  const { name, list } = useMuffinResourceOpts()
12
- const { fields, edit, show, limit, limitMax, filters, actions, remove, sort } = list
12
+ const { fields, create, edit, show, limit, limitMax, filters, actions, remove, sort } = list
13
13
 
14
14
  const Actions = findBuilder(["list-actions", name])
15
15
 
@@ -17,6 +17,7 @@ export function MuffinResourceList() {
17
17
  <List
18
18
  sort={sort}
19
19
  perPage={limit}
20
+ actions={<ListActions hasCreate={create} />}
20
21
  filters={buildAdmin(["list-filters", name], filters)}
21
22
  bulkActionButtons={<Actions actions={actions} remove={remove} />}
22
23
  pagination={
package/src/types.ts CHANGED
@@ -43,6 +43,7 @@ export type AdminResourceProps = {
43
43
  limit: number
44
44
  limitMax: number
45
45
  actions: AdminAction[]
46
+ create: boolean
46
47
  filters: AdminInput[]
47
48
  fields: AdminField[]
48
49
  // Enable show button