From 4e972c3fe2adf9bb8be46c38e2448b946297f8b9 Mon Sep 17 00:00:00 2001 From: German Jablonski <43938777+GermanJablo@users.noreply.github.com> Date: Tue, 2 Sep 2025 18:38:23 +0100 Subject: [PATCH 1/2] docs(plugin-form-builder): add RadioField documentation (#13529) ### What? Adds comprehensive documentation for the RadioField component in the form builder plugin documentation. ### Why? Addresses review feedback from #11908 noting that the RadioField was not documented after being exported for end-user use. ### How? - Added RadioField section with complete property documentation - Added detailed Radio Options sub-section explaining option structure - Updated Select field documentation for consistency (added missing placeholder property and detailed options structure) - Added radio field to configuration example to show all available fields Fixes the documentation gap identified in #11908 review comments. --- docs/plugins/form-builder.mdx | 49 +++++++++++++++++++++++++++++------ 1 file changed, 41 insertions(+), 8 deletions(-) diff --git a/docs/plugins/form-builder.mdx b/docs/plugins/form-builder.mdx index 5872c887d0..32247e36c0 100644 --- a/docs/plugins/form-builder.mdx +++ b/docs/plugins/form-builder.mdx @@ -79,6 +79,7 @@ formBuilderPlugin({ text: true, textarea: true, select: true, + radio: true, email: true, state: true, country: true, @@ -293,14 +294,46 @@ Maps to a `textarea` input on your front-end. Used to collect a multi-line strin Maps to a `select` input on your front-end. Used to display a list of options. -| Property | Type | Description | -| -------------- | -------- | -------------------------------------------------------- | -| `name` | string | The name of the field. | -| `label` | string | The label of the field. | -| `defaultValue` | string | The default value of the field. | -| `width` | string | The width of the field on the front-end. | -| `required` | checkbox | Whether or not the field is required when submitted. | -| `options` | array | An array of objects with `label` and `value` properties. | +| Property | Type | Description | +| -------------- | -------- | ------------------------------------------------------------------------------- | +| `name` | string | The name of the field. | +| `label` | string | The label of the field. | +| `defaultValue` | string | The default value of the field. | +| `placeholder` | string | The placeholder text for the field. | +| `width` | string | The width of the field on the front-end. | +| `required` | checkbox | Whether or not the field is required when submitted. | +| `options` | array | An array of objects that define the select options. See below for more details. | + +#### Select Options + +Each option in the `options` array defines a selectable choice for the select field. + +| Property | Type | Description | +| -------- | ------ | ----------------------------------- | +| `label` | string | The display text for the option. | +| `value` | string | The value submitted for the option. | + +### Radio + +Maps to radio button inputs on your front-end. Used to allow users to select a single option from a list of choices. + +| Property | Type | Description | +| -------------- | -------- | ------------------------------------------------------------------------------ | +| `name` | string | The name of the field. | +| `label` | string | The label of the field. | +| `defaultValue` | string | The default value of the field. | +| `width` | string | The width of the field on the front-end. | +| `required` | checkbox | Whether or not the field is required when submitted. | +| `options` | array | An array of objects that define the radio options. See below for more details. | + +#### Radio Options + +Each option in the `options` array defines a selectable choice for the radio field. + +| Property | Type | Description | +| -------- | ------ | ----------------------------------- | +| `label` | string | The display text for the option. | +| `value` | string | The value submitted for the option. | ### Email (field) From 9b109339ee901a31a3a0a845eaa765aac18ea061 Mon Sep 17 00:00:00 2001 From: German Jablonski <43938777+GermanJablo@users.noreply.github.com> Date: Tue, 2 Sep 2025 21:10:25 +0100 Subject: [PATCH 2/2] fix(ui): await for publish success to update the UI (#13673) Fixes #13664 Before: https://github.com/user-attachments/assets/083577f5-9006-4b35-9799-3df704ed84a8 After: https://github.com/user-attachments/assets/70a89a5b-bed4-447c-94f6-57bf3dbd2a70 --- - To see the specific tasks where the Asana app for GitHub is being used, see below: - https://app.asana.com/0/0/1211210023936582 --- .../ui/src/elements/PublishButton/index.tsx | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/packages/ui/src/elements/PublishButton/index.tsx b/packages/ui/src/elements/PublishButton/index.tsx index 26001be3d9..d48b701f29 100644 --- a/packages/ui/src/elements/PublishButton/index.tsx +++ b/packages/ui/src/elements/PublishButton/index.tsx @@ -139,20 +139,22 @@ export function PublishButton({ label: labelProp }: PublishButtonClientProps) { } }) - const publish = useCallback(() => { + const publish = useCallback(async () => { if (uploadStatus === 'uploading') { return } - void submit({ + const result = await submit({ overrides: { _status: 'published', }, }) - setUnpublishedVersionCount(0) - setMostRecentVersionIsAutosaved(false) - setHasPublishedDoc(true) + if (result) { + setUnpublishedVersionCount(0) + setMostRecentVersionIsAutosaved(false) + setHasPublishedDoc(true) + } }, [ setHasPublishedDoc, submit, @@ -162,7 +164,7 @@ export function PublishButton({ label: labelProp }: PublishButtonClientProps) { ]) const publishSpecificLocale = useCallback( - (locale) => { + async (locale) => { if (uploadStatus === 'uploading') { return } @@ -175,14 +177,16 @@ export function PublishButton({ label: labelProp }: PublishButtonClientProps) { globalSlug ? `/globals/${globalSlug}` : `/${collectionSlug}/${id ? `${'/' + id}` : ''}` }${params ? '?' + params : ''}` - void submit({ + const result = await submit({ action, overrides: { _status: 'published', }, }) - setHasPublishedDoc(true) + if (result) { + setHasPublishedDoc(true) + } }, [api, collectionSlug, globalSlug, id, serverURL, setHasPublishedDoc, submit, uploadStatus], )