nest-my-admin 0.7.3 → 0.7.4

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.
Files changed (2) hide show
  1. package/README.md +7 -1
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -328,7 +328,7 @@ export class ProductAdmin extends AdminResourceBase<Product> {
328
328
  - A widget that does not fit the type (`money` on a boolean) fails at boot.
329
329
  - `colors` for badges: gray, red, amber, green, blue, purple or pink.
330
330
  - `currency` for money: display only. Money is grouped as you leave the input, and the commas are dropped when saving.
331
- - **Validation at boot.** Unknown fields, widgets and colours fail at boot with a did-you-mean hint, and so do `showIf`/`slugFrom` names and enum labels for values the column does not have.
331
+ - **Validation at boot.** Unknown fields, widgets and colours fail at boot with a did-you-mean hint, and so do `showIf`/`slugFrom`/`fillFrom` names, defaults that do not fit their field and enum labels for values the column does not have.
332
332
  - **Read-only fields.**
333
333
  - `readonly: true` shows the field on edit forms as text with a lock and removes it from `form.update`.
334
334
  - `readonlyIf(record)` runs on the server for every record. Records carry `_readonly` (the fields it locks), and a PATCH that sends a locked field is a 422 `{ field: ['is read-only'] }` before your `update` runs. That covers inline cell edits too.
@@ -343,6 +343,8 @@ export class ProductAdmin extends AdminResourceBase<Product> {
343
343
  - Create ignores it.
344
344
  - **`showIf`** hides a field while other fields do not hold the given value (or one of the values), evaluated live in the browser. A hidden field is not sent and not checked. It is presentation, not a permission: the server keeps the stored value.
345
345
  - **`slugFrom`** makes the slug widget fill itself from another field. It keeps the letters of every script and stops once someone types in it, or when it already holds a value.
346
+ - **`default`** is the value a new form starts with: an action's input form, or a resource's create form (a duplicate starts from the copied record). It must fit the field (a string for text, enum, date and datetime fields, a number, or `true`/`false`); the DTO still validates whatever is sent.
347
+ - **`fillFrom`** makes a text field fill itself from other fields of the same form, as the user types: `domain: { fillFrom: '{crm}.example.com' }`, `apiDomain: { fillFrom: 'api.{domain}' }` (chains are fine, circles fail at boot). The value is empty while a field it names is empty. It stops following once someone types in it and follows again when they clear it; a field that already holds a value (a stored record) starts as typed. It works in action dialogs too, where `slugFrom` does not.
346
348
  - **Layout.**
347
349
  - `form.layout` has sections (a title, and 1–3 columns on wide screens, one on phones) and tabs.
348
350
  - Every name must be on a form and listed once. Fields left out go into a last section.
@@ -934,6 +936,10 @@ Things hosts tend to write by hand that the admin already does:
934
936
  - **Inline children stay out of the sidebar** by default (`nav: false` unless they set `nav`): no extra group to hide them in.
935
937
  - **Labels in one language** are plain strings; other languages can come from `translate` (see Languages, theme and branding).
936
938
 
939
+ ## Upgrading to 0.7.4
940
+
941
+ Nothing to change. New: `@AdminField({ default })` starts action input forms and create forms at a value (checked at boot to fit the field), and `@AdminField({ fillFrom: '{crm}.example.com' })` fills a text field from other fields of the same form until someone types in it, in action dialogs too (see Field config).
942
+
937
943
  ## Upgrading to 0.7.3
938
944
 
939
945
  Nothing to change. Smaller packages: `@nest-my-admin/core`, `/auth` and `/testing` no longer ship source maps (they pointed at sources the packages do not include), so core is about 1.2 MB instead of 1.9 MB; core no longer asks for `rxjs` and `@nest-my-admin/testing` no longer asks for `@nestjs/core`, neither of which they import.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nest-my-admin",
3
- "version": "0.7.3",
3
+ "version": "0.7.4",
4
4
  "description": "Django-admin-class admin panel for NestJS + TypeORM: @nest-my-admin/core, /auth and /testing under one name",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -39,8 +39,8 @@
39
39
  "typecheck": "tsc -p tsconfig.json --noEmit"
40
40
  },
41
41
  "dependencies": {
42
- "@nest-my-admin/auth": "0.7.3",
43
- "@nest-my-admin/core": "0.7.3",
44
- "@nest-my-admin/testing": "0.7.3"
42
+ "@nest-my-admin/auth": "0.7.4",
43
+ "@nest-my-admin/core": "0.7.4",
44
+ "@nest-my-admin/testing": "0.7.4"
45
45
  }
46
46
  }