Skip to content

Commit 0fd9e4b

Browse files
authored
Merge branch 'production' into main
2 parents 44049b2 + 1b76ee4 commit 0fd9e4b

6 files changed

Lines changed: 53 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,6 @@ jobs:
5858
tag_name: v${{ steps.pkg.outputs.version }}
5959
name: v${{ steps.pkg.outputs.version }}
6060
generate_release_notes: true
61+
62+
ci:
63+
uses: ./.github/workflows/ci.yml

admin/src/components/DropZone.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,17 @@ import { CSS } from '@dnd-kit/utilities';
2020
import { Trash, Drag } from '@strapi/icons';
2121
import { FormField } from '../types';
2222

23+
/**
24+
* Renders a draggable, selectable row that represents a FormField with a delete action.
25+
*
26+
* The row highlights when `selected`. Clicking the row calls `onSelect`; interacting with the drag handle does not toggle selection; clicking the delete button calls `onDelete`.
27+
*
28+
* @param field - The form field to render (label and type are displayed).
29+
* @param selected - Whether this row is currently selected; controls visual highlight.
30+
* @param onSelect - Callback invoked when the row (outside the drag handle and delete button) is clicked.
31+
* @param onDelete - Callback invoked when the delete button is clicked.
32+
* @returns The rendered sortable field row element.
33+
*/
2334
function SortableFieldRow({
2435
field,
2536
selected,

admin/src/components/EmbedModal.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@ interface Props {
88
onClose: () => void;
99
}
1010

11+
/**
12+
* Renders a modal that displays an embeddable HTML snippet for a given form and provides a one-click copy action.
13+
*
14+
* The component returns `null` when `open` is `false`. When visible, it shows a preformatted snippet containing a container div
15+
* with `id="sfb-form-<formId>"` and a script tag that loads the embed script from the current origin with `data-form-id` set.
16+
*
17+
* @param formId - The form identifier inserted into the snippet's container id and `data-form-id` attribute
18+
* @param open - Controls whether the modal is visible
19+
* @param onClose - Callback invoked when the modal is closed
20+
* @returns The modal element when `open` is `true`, otherwise `null`
21+
*/
1122
export function EmbedModal({ formId, open, onClose }: Props) {
1223
const [copied, setCopied] = useState(false);
1324

admin/src/components/FieldSettingsPanel.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,17 @@ function LabeledInput({
4545
);
4646
}
4747

48+
/**
49+
* Render the settings panel UI for editing a single form field.
50+
*
51+
* Displays controls for label, name, placeholder, help text, required/width toggles,
52+
* type-specific inputs (heading, paragraph), option management (add/update/remove),
53+
* validation rule management (add/update/remove) with value/message editing, and CSS class.
54+
*
55+
* @param field - The current FormField to edit.
56+
* @param onChange - Callback invoked with the updated FormField whenever a change is made.
57+
* @returns A React element containing the field settings panel UI.
58+
*/
4859
export function FieldSettingsPanel({ field, onChange }: Props) {
4960
const update = (patch: Partial<FormField>) => onChange({ ...field, ...patch });
5061

admin/src/components/FormPreview.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,16 @@ interface Props {
283283
onClose: () => void;
284284
}
285285

286+
/**
287+
* Render a modal preview of a form using the provided title, fields, and settings.
288+
*
289+
* @param title - The preview title displayed in the modal header
290+
* @param fields - The array of form field definitions to render inside the preview
291+
* @param settings - Form-level settings (used for things like the submit button text)
292+
* @param open - Whether the preview modal is visible
293+
* @param onClose - Callback invoked when the preview modal is closed
294+
* @returns The modal element containing the form preview, or `null` when `open` is false
295+
*/
286296
export function FormPreview({ title, fields, settings, open, onClose }: Props) {
287297
if (!open) return null;
288298

admin/src/pages/SubmissionsPage.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ import { useFormsApi } from '../api';
2222
import { Form, FormField, FormSubmission } from '../types';
2323
import { PLUGIN_ID } from '../pluginId';
2424

25+
/**
26+
* Render the submissions management page for a specific form.
27+
*
28+
* Loads and displays form metadata, submission list, and statistics; provides controls to filter by status, view submission details, mark submissions as read, and delete submissions.
29+
*
30+
* @returns The React element for the Submissions page (table, filters, detail modal, and delete confirmation modal).
31+
*/
2532
export function SubmissionsPage() {
2633
const { formId } = useParams<{ formId: string }>();
2734
const navigate = useNavigate();

0 commit comments

Comments
 (0)