Skip to content

Commit 57e4744

Browse files
committed
Update documentation for editing ReCAPTCHA validation
1 parent cd0836c commit 57e4744

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

src/configuration/ViewerConfiguration.md

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ All settings are optional, with fallback to the default values as documented.
4545
|`storeAllLayersInPermalink` | Whether to store the full layertree in the permalink data, rather than only local (i.e. redlining) layers. If `false`, remote layers are re-queried from the respective services, if `true`, they are statically reloaded (meaning restored layers may be outdated compared to current service capabilities).
4646
|`urlRegEx` | A [JSON-escaped](https://www.freeformatter.com/json-escape.html) regular expression used to match URLs in feature attribute values. Default: see `qwc2/utils/MiscUtils.js`. |
4747
|`trustWmsCapabilityURLs` | Whether to trust the GetMap etc. URLs reported in WMS service capabilities. If not `true`, the protocol, host and pathname portion of the URLs are inherited from the called capabilities URL. |
48+
|`editServiceCaptchaSiteKey` | ReCAPTCHA public site key for public editing, see [ReCAPTCHA validation](../Topics/Editing.md#recaptcha).
4849

4950
### Global settings, overridable per theme<a name="theme-overridable-settings"></a>
5051

src/release_notes/QWC2UpgradeNotes.md

+8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ This document describes incompatibilites and other aspects which QWC2 applicatio
44

55
When updating the `qwc2` submodule, run `yarn install` to ensure the dependencies are up to date!
66

7+
Update to qwc2 submodule revision [3e1763a](https://github.com/qgis/qwc2/tree/3e1763a) (15.05.2024)
8+
---------------------------------------------------------------------------------------------------
9+
10+
**Changes to default `EditingInterface` and `qwc-data-service`**
11+
12+
The `qwc-data-service` and the default `EditingInterface` client editing interface have been adapted to support ReCAPTCHA verification.
13+
Consequently, if editing is used, the `qwc` submodule will need to be updated in parallel with the `qwc-data-service`.
14+
715
Update to qwc2 submodule revision [c7610eb](https://github.com/qgis/qwc2/tree/c7610eb) (22.02.2024)
816
---------------------------------------------------------------------------------------------------
917

src/topics/Editing.md

+9
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,15 @@ In manually created Qt-Designer Ui forms, there are a number of special widgets
9797
* *External fields*: Some times it is useful to display information from an external source in the edit form. This can be accomplished by creating a `QWidget` with name `ext__<fieldname>` and using a form preprocessor hook (see `registerFormPreprocessor` in [`QtDesignerForm.jsx`](https://github.com/qgis/qwc2/blob/master/components/QtDesignerForm.jsx) to populate the field by assigning a React fragment to `formData.externalFields.<fieldname>`.
9898
* *Buttons*: To add a button with a custom action, add a `QPushButton` with name `btn__<buttonname>`, and use a form preprocessor hook to set the custom function to `formData.buttons.buttonname.onClick`.
9999

100+
## ReCAPTCHA validation<a name="recaptcha"></a>
101+
102+
You can enable ReCAPTCHA validation for public editable datasets as follows:
103+
104+
- Set the ReCAPTCHA site secret key in `recaptcha_site_secret_key` in the data service config.
105+
- Set the ReCAPTCHA site public key in `editServiceCaptchaSiteKey` in the toplevel section of the [`config.json`](../configuration/ViewerConfiguration.md#load-time-config).
106+
- Configure the desired datasets to be editable by `public`.
107+
108+
If `editServiceCaptchaSiteKey` is set, a ReCAPTCHA validation widget will be displayed in the edit form as well as the attribute table when creating/updating/deleting features. Currently, the ReCAPTCHA validation will only be enabled for `public` users, and will automatically be bypassed for authenticated users.
100109

101110
## Logging mutations
102111

0 commit comments

Comments
 (0)