Skip to content

Commit

Permalink
Update documentation for editing ReCAPTCHA validation
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro committed May 15, 2024
1 parent cd0836c commit 57e4744
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/configuration/ViewerConfiguration.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ All settings are optional, with fallback to the default values as documented.
|`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).
|`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`. |
|`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. |
|`editServiceCaptchaSiteKey` | ReCAPTCHA public site key for public editing, see [ReCAPTCHA validation](../Topics/Editing.md#recaptcha).

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

Expand Down
8 changes: 8 additions & 0 deletions src/release_notes/QWC2UpgradeNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ This document describes incompatibilites and other aspects which QWC2 applicatio

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

Update to qwc2 submodule revision [3e1763a](https://github.com/qgis/qwc2/tree/3e1763a) (15.05.2024)
---------------------------------------------------------------------------------------------------

**Changes to default `EditingInterface` and `qwc-data-service`**

The `qwc-data-service` and the default `EditingInterface` client editing interface have been adapted to support ReCAPTCHA verification.
Consequently, if editing is used, the `qwc` submodule will need to be updated in parallel with the `qwc-data-service`.

Update to qwc2 submodule revision [c7610eb](https://github.com/qgis/qwc2/tree/c7610eb) (22.02.2024)
---------------------------------------------------------------------------------------------------

Expand Down
9 changes: 9 additions & 0 deletions src/topics/Editing.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,15 @@ In manually created Qt-Designer Ui forms, there are a number of special widgets
* *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>`.
* *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`.

## ReCAPTCHA validation<a name="recaptcha"></a>

You can enable ReCAPTCHA validation for public editable datasets as follows:

- Set the ReCAPTCHA site secret key in `recaptcha_site_secret_key` in the data service config.
- Set the ReCAPTCHA site public key in `editServiceCaptchaSiteKey` in the toplevel section of the [`config.json`](../configuration/ViewerConfiguration.md#load-time-config).
- Configure the desired datasets to be editable by `public`.

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.

## Logging mutations

Expand Down

0 comments on commit 57e4744

Please sign in to comment.