Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extensible validation support in Volto forms #6181

Merged
merged 55 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from 49 commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
d02a64b
Add foundations for extensible validation in forms
sneridagh Jul 10, 2024
d4a6d70
Fix tests
sneridagh Jul 10, 2024
bc7b779
fix build-deps precedence
sneridagh Jul 10, 2024
ad3a0d6
Fix more
sneridagh Jul 10, 2024
1fa71ed
Fix generator tests
sneridagh Jul 10, 2024
f6bba96
Fix react-share package
sneridagh Jul 10, 2024
3a4b000
fix test for social sharing
sneridagh Jul 10, 2024
709ed59
Add custom validation field property
sneridagh Jul 10, 2024
84bc5bf
Merge branch 'main' into extensible-validation
sneridagh Jul 11, 2024
26c82f9
Fix uniqueValidator
sneridagh Jul 12, 2024
3378ade
Add documentation
sneridagh Jul 12, 2024
0101fca
Changelog
sneridagh Jul 12, 2024
7f2cfaa
Changelog
sneridagh Jul 12, 2024
7963197
Checkpoint
sneridagh Jul 12, 2024
b135545
Validation for blocks too :)
sneridagh Jul 12, 2024
3d6ef22
locales
sneridagh Jul 15, 2024
80d7462
Refactor validation in Form
sneridagh Jul 15, 2024
9ad0eea
Changelog
sneridagh Jul 15, 2024
6234d48
Separate type-widget validators. Add behavior-fieldId validator types.
sneridagh Jul 15, 2024
30db8cd
Block-fieldId validators
sneridagh Jul 15, 2024
bef6a77
Changelog
sneridagh Jul 16, 2024
41da3fb
Typos correction for validation.md
ichim-david Jul 16, 2024
2a32edc
Complete default explanation
sneridagh Jul 16, 2024
34490f9
Add more down to earth examples
sneridagh Jul 16, 2024
3152854
Apply suggestions from code review
sneridagh Jul 18, 2024
b89d0ce
Refactor and re-document for clarity and simplicity
sneridagh Jul 22, 2024
11c24c7
locales
sneridagh Jul 22, 2024
e11e9d5
Remove cruft
sneridagh Jul 22, 2024
8094fa4
Bring back correct typing
sneridagh Jul 22, 2024
0b4f253
carry over suggestions from #6161 to index.md
stevepiercy Jul 22, 2024
ca2bdd2
Steve's review and edits of validation.md
stevepiercy Jul 22, 2024
641ce69
Apply suggestions from code review
sneridagh Jul 23, 2024
2a61300
Unify validator names, ending in `Validator`
sneridagh Jul 23, 2024
091711a
Fix start-end date validator i18n msg, add tests
sneridagh Jul 23, 2024
79b9a0f
Add pattern validator
sneridagh Jul 23, 2024
6cb3f2b
Implemented default `maxItems`/`minItems`
sneridagh Jul 23, 2024
0999019
Update docs/source/configuration/validation.md
sneridagh Jul 24, 2024
e787a8a
Apply suggestions from code review
sneridagh Jul 24, 2024
44001cb
Added missing docs for utilities in types
sneridagh Jul 24, 2024
aff0010
Add initial sort for keys when hashing them into the depsString
sneridagh Jul 24, 2024
443f9c7
Fix out of date registry changelog
sneridagh Jul 24, 2024
01a14cf
Include in the documentation all the default validators in Volto
sneridagh Jul 24, 2024
f8b7287
Change the name of the dependency key from `widgetName` to `widget`
sneridagh Jul 24, 2024
f7dee7e
Remove granularity from the paragraph
sneridagh Jul 24, 2024
2578cf5
locales
sneridagh Jul 24, 2024
a2afa51
Add an example of how to build an invariant
sneridagh Jul 24, 2024
0b2c26e
Move the default validators section to the top
sneridagh Jul 24, 2024
3140a42
Merge branch 'main' into extensible-validation-format
sneridagh Jul 24, 2024
2e2df93
Merge branch 'main' into extensible-validation-format
sneridagh Jul 24, 2024
c01bb39
Apply suggestions from code review
sneridagh Jul 26, 2024
f619cd8
Pass `blocksErrors` as a separate prop, aside from the whole errors o…
sneridagh Jul 29, 2024
461b188
Add new `blocksErrors` prop to all stock blocks
sneridagh Jul 29, 2024
5f32593
Remove the optional from Validator type, since the engine always push…
sneridagh Jul 29, 2024
0eaf1ee
Merge branch 'main' into extensible-validation-format
sneridagh Jul 30, 2024
d50cda0
Cypress Test for Validation of Field Types in CoreSandBox (#6217)
Tishasoumya-02 Jul 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/node_env_setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ runs:

- name: Install Volto dependencies
shell: bash
run: pnpm i
run: make install

- name: Install Cypress if not in cache
if: steps.cache-cypress-binary.outputs.cache-hit != 'true'
Expand Down
38 changes: 2 additions & 36 deletions .github/workflows/acceptance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -497,45 +497,11 @@ jobs:
steps:
- uses: actions/checkout@v4

# node setup
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
- name: Set up Node.js environment
uses: ./.github/actions/node_env_setup
with:
node-version: ${{ matrix.node-version }}

- name: Enable corepack
run: corepack enable

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Cache Cypress Binary
id: cache-cypress-binary
uses: actions/cache@v4
with:
path: ~/.cache/Cypress
key: binary-${{ matrix.node-version }}-${{ hashFiles('pnpm-lock.yaml') }}

- run: pnpm i

- name: Build dependencies
run: pnpm build:deps

- name: Install Cypress if not in cache
if: steps.cache-cypress-binary.outputs.cache-hit != 'true'
working-directory: packages/volto
run: make cypress-install

# Generator own tests
- name: Generator tests
run: pnpm test
Expand Down
23 changes: 2 additions & 21 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,11 @@ jobs:
steps:
- uses: actions/checkout@v4

# node setup
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
- name: Set up Node.js environment
uses: ./.github/actions/node_env_setup
with:
node-version: ${{ matrix.node-version }}

- name: Enable corepack
run: corepack enable

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- run: pnpm i

# Locales in place are needed for the tests to pass
- run: pnpm --filter @plone/volto i18n

Expand Down
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,11 @@ clean: ## Clean development environment
find ./packages -name node_modules -exec rm -rf {} \;

.PHONY: install
install: build-deps ## Set up development environment
install: ## Set up development environment
# Setup ESlint for VSCode
node packages/scripts/vscodesettings.js
pnpm i
node packages/scripts/vscodesettings.js
make build-deps

##### Documentation

Expand Down Expand Up @@ -137,10 +138,10 @@ docs-test: docs-clean docs-linkcheckbroken docs-vale ## Clean docs build, then
cypress-install: ## Install Cypress for acceptance tests
$(NODEBIN)/cypress install

packages/registry/dist: packages/registry/src
packages/registry/dist: $(shell find packages/registry/src -type f)
pnpm build:registry

packages/components/dist: packages/components/src
packages/components/dist: $(shell find packages/components/src -type f)
pnpm build:components

.PHONY: build-deps
Expand Down
1 change: 1 addition & 0 deletions docs/source/configuration/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ environmentvariables
expanders
locking
slots
validation
```
Loading
Loading