Skip to content

Commit 97031f4

Browse files
lezamamatticbot
authored andcommitted
Forms/update responses management (#41602)
Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/13769137906 Upstream-Ref: Automattic/jetpack@0e45bba
1 parent 8ed6303 commit 97031f4

19 files changed

+448
-612
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ This is an alpha version! The changes listed here are not final.
1212
### Added
1313
- Forms: Added Akismet panel to form block.
1414

15+
### Changed
16+
- Forms: Update responses management with DataViews
17+
1518
## [0.40.0] - 2025-03-03
1619
### Added
1720
- Forms: Add min/max options to number field. [#41783]

README.md

-84
Original file line numberDiff line numberDiff line change
@@ -12,96 +12,12 @@ All things forms. This package currently contains the implementation for Jetpack
1212
│ ├── dashboard/ - Implementation for the new forms dashboard.
1313
│ ├── service/ - Helpers for 3rd-party service integrations.
1414
│ ├── class-jetpack-forms.php - Package entrypoint.
15-
│ └── class-wpcom-rest-api-v2-endpoint-forms.php - WP.com REST API endpoints definition.
1615
1716
└── tools/ - Webpack configuration for all bundles in the package.
1817
```
1918

2019
See the individual subdirectories for more information.
2120

22-
## API Endpoints
23-
24-
This package adds the following WP.com REST API endpoints:
25-
26-
### `GET /forms/responses`
27-
28-
Returns a list of contact form responses.
29-
30-
Supported params:
31-
32-
- `parent_id`: (int) Filter responses by parent post ID.
33-
- `limit`: (int) Limit the number of returned responses.
34-
- `month`: (string) Filter responses by month. Format: `YYYYMM`
35-
- `offset`: (int) Offset the returned responses.
36-
- `search`: (string) Search for responses where any field includes the given string.
37-
- `status`: (string) Filter responses by status. Supported values: `inbox`, `spam`, `trash`.
38-
39-
Response:
40-
41-
```json
42-
{
43-
"filters_available": {
44-
"month": [
45-
{ "month": 1, "year": 2023 },
46-
{ "month": 3, "year": 2023 },
47-
],
48-
"source": [
49-
{
50-
"id": 55,
51-
"title": "Contact Page",
52-
"url": "https://jetpackme.wordpress.com/contact-support",
53-
}
54-
],
55-
},
56-
"responses": [
57-
{
58-
"id": 123,
59-
"entry_permalink": "https://jetpackme.wordpress.com/contact-support",
60-
"entry_title": "Contact Page",
61-
"ip": "127.0.0.1",
62-
"date": "2023-01-05T00:00:00",
63-
"fields": {
64-
"1_Name": "John Smith",
65-
"2_Email": "[email protected]",
66-
"3_Message": "Help!",
67-
},
68-
},
69-
{
70-
"id": 213,
71-
"entry_permalink": "https://jetpackme.wordpress.com/contact-support",
72-
"entry_title": "Contact Page",
73-
"ip": "127.0.0.1",
74-
"date": "2023-03-20T05:23:00",
75-
"fields": {
76-
"1_Name": "John Smith",
77-
"2_Email": "[email protected]",
78-
"3_Message": "Lorem Ipsum",
79-
},
80-
},
81-
],
82-
"totals": {
83-
"inbox": 2,
84-
"spam": 0,
85-
"trash": 1,
86-
},
87-
}
88-
```
89-
90-
### `POST /forms/responses/bulk_actions`
91-
92-
Performs bulk actions on a list of response IDs.
93-
94-
Supported params:
95-
96-
- `action`: (string) The action to perform. Supported values: `mark_as_spam`, `mark_as_not_spam`, `trash`, `untrash`, `delete` (permamently removes the response).
97-
- `post_ids`: (int[]) The list of response IDs to perform the action on.
98-
99-
Response:
100-
101-
```json
102-
{}
103-
```
104-
10521
## Using this package in your WordPress plugin
10622

10723
If you plan on using this package in your WordPress plugin, we would recommend that you use [Jetpack Autoloader](https://packagist.org/packages/automattic/jetpack-autoloader) as your autoloader. This will allow for maximum interoperability with other plugins that use this package as well.
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php return array('dependencies' => array('jetpack-connection', 'jetpack-script-data', 'lodash', 'react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '2984c0036d74fc5ec9a1');
1+
<?php return array('dependencies' => array('jetpack-connection', 'jetpack-script-data', 'lodash', 'react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '3dec0940e23e6ef39631');

dist/dashboard/jetpack-forms-dashboard.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/dashboard/jetpack-forms-dashboard.js

+22-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/dashboard/jetpack-forms-dashboard.js.LICENSE.txt

+26
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/*!
2+
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
3+
*
4+
* Copyright (c) 2014-2017, Jon Schlinkert.
5+
* Released under the MIT License.
6+
*/
7+
8+
/**
9+
* @license React
10+
* use-sync-external-store-shim.production.js
11+
*
12+
* Copyright (c) Meta Platforms, Inc. and affiliates.
13+
*
14+
* This source code is licensed under the MIT license found in the
15+
* LICENSE file in the root directory of this source tree.
16+
*/
17+
118
/**
219
* @remix-run/router v1.21.0
320
*
@@ -30,3 +47,12 @@
3047
*
3148
* @license MIT
3249
*/
50+
51+
/** @license React v16.13.1
52+
* react-is.production.min.js
53+
*
54+
* Copyright (c) Facebook, Inc. and its affiliates.
55+
*
56+
* This source code is licensed under the MIT license found in the
57+
* LICENSE file in the root directory of this source tree.
58+
*/

dist/dashboard/jetpack-forms-dashboard.rtl.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/dashboard/jetpack-forms-dashboard.wpcom.asset.php

-1
This file was deleted.

dist/dashboard/jetpack-forms-dashboard.wpcom.css

-1
This file was deleted.

dist/dashboard/jetpack-forms-dashboard.wpcom.js

Whitespace-only changes.

0 commit comments

Comments
 (0)