@object-ui/plugin-form 11.4.0 → 11.5.0
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/CHANGELOG.md +55 -0
- package/dist/MasterDetailForm.d.ts +3 -0
- package/dist/WizardForm.d.ts +12 -2
- package/dist/index.js +186 -124
- package/dist/index.umd.cjs +1 -1
- package/dist/successBehavior.d.ts +3 -0
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,60 @@
|
|
|
1
1
|
# @object-ui/plugin-form
|
|
2
2
|
|
|
3
|
+
## 11.5.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- fae75e2: Fix two bugs verified still-present after #2254 claimed to resolve them (framework#2620 / framework#2616 Showcase UX pass, tracked in #2268):
|
|
8
|
+
|
|
9
|
+
- **Wizard/form `submitBehavior: 'thank-you'` allowed duplicate resubmission.** #2254 fixed the spec-bridge dropping `submitBehavior` before it reached the renderer, so the configured toast message started appearing — but `WizardForm`'s last step and `ObjectForm`'s submit handler only ever called `toast.success(...)` for `thank-you`/`next-record`; the form stayed mounted and fully filled with its submit button re-enabled once the request settled, so a second click created a second record. Both components now track a terminal `submitted` state and, when set, replace the form with a confirmation panel (using the behavior's `title`/`message`, which were also never read before) — mirroring the pattern `apps/console/src/components/FormPage.tsx` already used for its own standalone forms.
|
|
10
|
+
|
|
11
|
+
- **Command Center-style 3-up chart bands stayed collapsed to ~100-130px, and a dataset-bound chart's measure leaked its raw field name.**
|
|
12
|
+
- `responsiveStyles` (and `style`) were declared on the page-spec `PageComponent` bridge input type but never copied onto the `SchemaNode` in `spec-bridge/bridges/page.ts::mapComponent()` — so a page author's ADR-0065 layout override (e.g. forcing `display: 'grid'` on a `type: 'flex'` band) never reached `SchemaRenderer`, and the node silently fell back to its default flex layout. Both fields are now mapped through.
|
|
13
|
+
- `ObjectChart`'s dataset-bound fetch path (`schema.dataset` + `ds.queryDataset(...)`) discarded the response's `fields` array (which carries each measure's `label`, e.g. `{ name: 'task_count', label: 'Tasks' }`) before it ever reached `buildChartSeries()` — whose `fields` param already resolves this correctly (see `chart-series.test.ts`) — so the legend/tooltip always fell back to the raw field name. The fetched `fields` are now captured and threaded through.
|
|
14
|
+
|
|
15
|
+
- ec9c8ee: Fix master-detail record create: stop double success toast + localize the Cancel button.
|
|
16
|
+
|
|
17
|
+
Objects with inline subforms (master-detail, e.g. a Lead with product line items)
|
|
18
|
+
render `MasterDetailForm` inside `ModalForm`/`DrawerForm` instead of the plain
|
|
19
|
+
footer, which exposed two mismatches with the host contract:
|
|
20
|
+
|
|
21
|
+
- **Double success toast.** Flat `ObjectForm` delegates confirmation to the host
|
|
22
|
+
when an `onSuccess` is supplied (skips its own default toast), but
|
|
23
|
+
`MasterDetailForm.handleSaved` ALWAYS toasted `Created`/`Saved` AND ran
|
|
24
|
+
`onSuccess`. In the console the host's `onSuccess` chains into the `crud_success`
|
|
25
|
+
handler, which toasts a localized message — so create fired both `Created` and
|
|
26
|
+
e.g. `线索创建成功`. `handleSaved` now only toasts as a fallback when no host
|
|
27
|
+
`onSuccess` is provided, matching the `ObjectForm` contract; saves without a host
|
|
28
|
+
handler stay non-silent.
|
|
29
|
+
|
|
30
|
+
- **Hardcoded English `Cancel`.** The master-detail action bar wrote `Cancel` as a
|
|
31
|
+
literal and accepted no `cancelText`, so the button stayed English while the
|
|
32
|
+
submit button was localized (`submitText` was already forwarded).
|
|
33
|
+
`MasterDetailForm` now takes `cancelText`, and `ModalForm`/`DrawerForm`/`ObjectForm`
|
|
34
|
+
forward the host's localized label down the subforms branch.
|
|
35
|
+
|
|
36
|
+
Adds regression tests: create with a host `onSuccess` fires no built-in toast (no
|
|
37
|
+
double-confirm), and the Cancel button renders the host-supplied `cancelText`.
|
|
38
|
+
|
|
39
|
+
- 6c1ad9e: Record task flows open as derived overlays with lossless return (framework#2604, extends framework#2578).
|
|
40
|
+
|
|
41
|
+
- **Create/Edit never route** — the global record form is URL-driven (`?form=new` / `?form=<id>`): browser Back closes the overlay with the origin (list scroll/filters, detail state) intact; field-heavy objects derive a full-screen modal (`modalSize:'full'`) via the new `deriveRecordFlowSurface` mirror in plugin-view, light ones keep the auto-sized modal. `editMode:'page'` opt-in unchanged.
|
|
42
|
+
- **Save invariant** — _edit never moves you_ (origin refetches in place); _create lands on the new record's detail_ on its derived surface (drawer over the still-intact list for light objects, detail route for heavy), with `replace:true` so Back skips the transient form entry.
|
|
43
|
+
- **Subtable child create/edit = overlay over the parent detail, never a route** — related-list New/Edit push `?form=…&formObject=<child>&formLink=<fk>:<parentId>`; the one global overlay pre-links the parent (refresh-safe), sizes to the CHILD object, and on save stays on the parent while only the child's related lists refetch. ModalForm now forwards `initialValues` into its master-detail (subforms) branch so pre-links survive for children with inline line items.
|
|
44
|
+
|
|
45
|
+
- Updated dependencies [544d8eb]
|
|
46
|
+
- Updated dependencies [6fffd3d]
|
|
47
|
+
- Updated dependencies [9255686]
|
|
48
|
+
- Updated dependencies [fae75e2]
|
|
49
|
+
- Updated dependencies [1072701]
|
|
50
|
+
- @object-ui/i18n@11.5.0
|
|
51
|
+
- @object-ui/react@11.5.0
|
|
52
|
+
- @object-ui/components@11.5.0
|
|
53
|
+
- @object-ui/types@11.5.0
|
|
54
|
+
- @object-ui/fields@11.5.0
|
|
55
|
+
- @object-ui/core@11.5.0
|
|
56
|
+
- @object-ui/permissions@11.5.0
|
|
57
|
+
|
|
3
58
|
## 11.4.0
|
|
4
59
|
|
|
5
60
|
### Minor Changes
|
|
@@ -48,6 +48,9 @@ export interface MasterDetailFormSchema {
|
|
|
48
48
|
formType?: 'simple' | 'tabbed';
|
|
49
49
|
title?: string;
|
|
50
50
|
submitText?: string;
|
|
51
|
+
/** Label for the Cancel button in the action bar. i18n is the host's job
|
|
52
|
+
* (this plugin is locale-agnostic); defaults to English 'Cancel'. */
|
|
53
|
+
cancelText?: string;
|
|
51
54
|
/** Hide the bottom Save/Cancel action bar — e.g. a non-persisting design
|
|
52
55
|
* preview. Defaults to shown (the form owns the only Save in this layout). */
|
|
53
56
|
showSubmit?: boolean;
|
package/dist/WizardForm.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { DataSource } from '@object-ui/types';
|
|
3
|
+
import { SubmitBehavior } from './successBehavior';
|
|
3
4
|
import { FormSectionConfig } from './TabbedForm';
|
|
4
5
|
export interface WizardFormSchema {
|
|
5
6
|
type: 'object-form';
|
|
@@ -47,15 +48,24 @@ export interface WizardFormSchema {
|
|
|
47
48
|
/**
|
|
48
49
|
* Declarative success toast text shown when no `onSuccess` handler is given
|
|
49
50
|
* (metadata pages cannot pass a function). Falls back to 'Created'/'Saved'.
|
|
51
|
+
* Ignored when `submitBehavior` is set.
|
|
50
52
|
*/
|
|
51
53
|
successMessage?: string;
|
|
52
54
|
/** Navigate here after a successful create/update (declarative; metadata
|
|
53
55
|
* pages can't pass onSuccess). Supports `{id}`/`{recordId}` interpolation
|
|
54
|
-
* from the saved record. Same-origin-guarded. Takes precedence over the toast.
|
|
56
|
+
* from the saved record. Same-origin-guarded. Takes precedence over the toast.
|
|
57
|
+
* Ignored when `submitBehavior` is set. */
|
|
55
58
|
navigateOnSuccess?: string;
|
|
56
59
|
/** Reset the wizard (back to step 1, cleared) after a successful create so the
|
|
57
|
-
* user can enter another. Ignored when `navigateOnSuccess`
|
|
60
|
+
* user can enter another. Ignored when `navigateOnSuccess` or `submitBehavior`
|
|
61
|
+
* is set. */
|
|
58
62
|
resetOnSuccess?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Declarative post-submit behavior aligned with `@objectstack/spec`'s
|
|
65
|
+
* `FormView.submitBehavior`. When present, takes precedence over
|
|
66
|
+
* `successMessage` / `navigateOnSuccess` / `resetOnSuccess`.
|
|
67
|
+
*/
|
|
68
|
+
submitBehavior?: SubmitBehavior;
|
|
59
69
|
/**
|
|
60
70
|
* Show cancel button
|
|
61
71
|
* @default true
|