nest-my-admin 0.10.4 → 0.10.5
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/README.md +5 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -861,7 +861,11 @@ export class OrderAdmin extends AdminResourceBase<Order> {
|
|
|
861
861
|
```
|
|
862
862
|
|
|
863
863
|
- **`inline`**: the child resource class. Its entity needs exactly one many-to-one (or owning one-to-one) relation to the parent's entity: that relation's field is the **link** (`orderId`). With several candidates, name it with `link: 'orderId'`. The server sets the link; a client that sends it is refused (422), and an update cannot change it.
|
|
864
|
-
- **`display`**: `cards` (default; each child is a card with the child's own form layout) or `table` (one row per child, one cell per field: for short rows like order lines; on phones the table scrolls sideways).
|
|
864
|
+
- **`display`**: `cards` (default; each child is a card with the child's own form layout) or `table` (one row per child, one cell per field: for short rows like order lines; on phones the table scrolls sideways), or `gallery` (a product's pictures: one box of thumbnails, one child per picture). A gallery needs `order`, and its picture is the first single-file `image` field in `fields`. Several files can be chosen or dropped at once (a new row each, up to `max`), each thumbnail has × (remove) and ☆ (make it the first by `order`; `cards.markFirst` labels it), thumbnails reorder by dragging, and the other fields of the thumbnail chosen (alt text, a variant) are edited below the box:
|
|
865
|
+
|
|
866
|
+
```ts
|
|
867
|
+
{ section: 'Pictures', inline: ProductPictureAdmin, display: 'gallery', fields: ['path', 'alt'], order: 'sort', max: 40, cards: { markFirst: 'Main picture' } }
|
|
868
|
+
```
|
|
865
869
|
- **`fields`**: which of the child's form fields the inline shows, in order (default: the child's update form fields without the link). Fields it does not show keep their stored values, and their DTO defaults on create.
|
|
866
870
|
- **`order`**: a number field of the child. Rows are read sorted by it (then by key), and dragging or the up/down buttons write 0, 1, 2… into it on save. Without it rows go by key and cannot be reordered.
|
|
867
871
|
- **`min`**, **`max`** (default 100, at most 500): how many rows a save may leave, checked on the server after the changes (422 on the inline). `max` is also how many rows are read: a record with more shows them read-only, with a link to the child's list filtered by the parent.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nest-my-admin",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.5",
|
|
4
4
|
"description": "An admin panel for NestJS + TypeORM in the spirit of Django admin: lists, forms, roles, audit log and a prebuilt UI, served by your own app",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@nest-my-admin/auth": "0.10.
|
|
45
|
-
"@nest-my-admin/core": "0.10.
|
|
46
|
-
"@nest-my-admin/testing": "0.10.
|
|
44
|
+
"@nest-my-admin/auth": "0.10.5",
|
|
45
|
+
"@nest-my-admin/core": "0.10.5",
|
|
46
|
+
"@nest-my-admin/testing": "0.10.5"
|
|
47
47
|
}
|
|
48
48
|
}
|