This repository has been archived by the owner on Sep 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
[SDPAP-7155] webform validation #77
Open
vincent-gao
wants to merge
7
commits into
develop
Choose a base branch
from
feature/SDPAP-7155-webform-validation
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vincent-gao
force-pushed
the
feature/SDPAP-7155-webform-validation
branch
from
April 10, 2023 23:17
3a21e60
to
4d2d699
Compare
vincent-gao
force-pushed
the
feature/SDPAP-7155-webform-validation
branch
5 times, most recently
from
April 14, 2023 07:03
c20eb1b
to
715ec9d
Compare
1. Adds a kernel test 2. Remove outdated verification steps from tide_webform.module
vincent-gao
force-pushed
the
feature/SDPAP-7155-webform-validation
branch
from
April 17, 2023 04:15
715ec9d
to
2df2e6b
Compare
vincent-gao
force-pushed
the
feature/SDPAP-7155-webform-validation
branch
2 times, most recently
from
June 5, 2023 04:25
82fc80a
to
ab21cb0
Compare
vincent-gao
force-pushed
the
feature/SDPAP-7155-webform-validation
branch
from
June 5, 2023 04:57
ab21cb0
to
10e0439
Compare
vincent-gao
requested review from
krakerag,
anthony-malkoun,
mayurngondhkar,
MdNadimHossain,
yeniatencio and
edyuenyw
June 5, 2023 05:20
@vincent-gao for my understanding, this means validation is only supported for the was this page helpful webform? There's not a more generic way to get it into all forms or we have to write code each time? |
hey @anthony-malkoun , it supports all webforms. please take a look into https://github.com/dpc-sdp/tide_webform/pull/77/files#diff-c3e4a54bf03798e28f32ae99b7aa80077275b1e6e1a45cb049ebef34d3918513R2 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Jira
https://digital-vic.atlassian.net/browse/SDPAP-7155
Motivation
default webform JSONAPI endpoints don't support any validations, and it also doesn't support HTTP Unprocessable Content response with details of why the data validation failed.
Drupal JSONAPI also limits us from modifying the response structure or adding custom validations.
so we need a custom endpoint to handle data validation and return a reasonable response.
Change
Content-Type: application/vnd.api+json
All form validations below will be reflected in JSONAPI webform endpoints, including
Required message
andPattern message
, but we don't supportunique
as we don't keep submissions in most cases.Response