Skip to content

Commit

Permalink
Merge branch 'master' into FIO-8414/5x_validation_on_required_datagrid
Browse files Browse the repository at this point in the history
  • Loading branch information
mikekotikov committed Aug 7, 2024
2 parents 1bff2e6 + 583d006 commit 3b52a7e
Show file tree
Hide file tree
Showing 24 changed files with 1,018 additions and 272 deletions.
50 changes: 50 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Mocha: current file",
"program": "${workspaceFolder}/node_modules/.bin/mocha",
"args": [
"-r",
"ts-node/register",
"-b",
"-t",
"0",
"-r",
"tsconfig-paths/register",
"-r",
"jsdom-global/register",
"-r",
"mock-local-storage",
"'${file}'"
],
"console": "integratedTerminal"
},
{
"type": "node",
"request": "launch",
"name": "Mocha Tests",
"program": "${workspaceFolder}/node_modules/.bin/mocha",
"args": [
"-r",
"ts-node/register",
"-b",
"-t",
"0",
"-r",
"tsconfig-paths/register",
"-r",
"mock-local-storage",
"-r",
"jsdom-global/register",
"'src/**/__tests__/*.test.ts'"
],
"console": "integratedTerminal"
}
]
}
6 changes: 5 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
## [Unreleased: 2.3.0-rc.1]
## [Unreleased: 2.3.0-rc.2]
### Changed
- Regression | Nested Form | Components in Nested forms should not validate hidden components without Validate When Hidden = true

## 2.3.0-rc.1
### Changed
- updated thresholds to current values
- FIO-8450: Fix custom error message for unique validation
Expand Down
4 changes: 4 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,7 @@ FormioCore.render(document.getElementById('data-table'), {
```

See https://formio.github.io/core for more examples of how to use this library.

### Debug

[Instructions on how to debug with API Server](https://formio.atlassian.net/wiki/spaces/SD/pages/184025089/Debugging+formio+core)
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"scripts": {
"test": "TEST=1 nyc --reporter=lcov --reporter=text --reporter=text-summary mocha -r ts-node/register -r tsconfig-paths/register -r mock-local-storage -r jsdom-global/register -t 0 'src/**/__tests__/*.test.ts'",
"lib": "tsc --project tsconfig.json && tsc-alias -p tsconfig.json",
"lib:watch": "tsc -w & tsc-alias -w",
"replace": "node -r tsconfig-paths/register -r ts-node/register ./lib/base/array/ArrayComponent.js",
"test:debug": "mocha -r ts-node/register -r tsconfig-paths/register -r mock-local-storage -r jsdom-global/register --debug-brk --inspect '**/*.spec.ts'",
"docs": "./node_modules/typedoc/bin/typedoc --exclude '*.spec.ts' src/*.ts src/**/*.ts src/**/**/*.ts",
Expand Down
156 changes: 156 additions & 0 deletions src/process/__tests__/fixtures/clearOnHideWithCustomCondition.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
{
"form": {
"display": "form",
"components": [
{
"title": "__information_on_the_appointee",
"theme": "primary",
"collapsible": false,
"key": "HeadingNestedFormCandidates",
"type": "panel",
"label": "Appointees",
"input": false,
"tableView": false,
"components": [
{
"label": "Appointees",
"hideLabel": true,
"tableView": false,

"addAnother": "__add_appointee",
"modal": true,
"saveRow": "Close",
"rowDrafts": true,
"key": "candidates",
"type": "editgrid",
"displayAsTable": false,
"input": true,
"components": [
{
"label": "Appointee",
"tableView": false,
"key": "candidate",
"type": "container",
"input": true,
"components": [
{
"label": "Data",
"tableView": false,
"key": "data",
"type": "container",
"input": true,
"components": [
{
"label": "Tabs",
"components": [
{
"label": "__6_time_commitment",
"key": "section6tab",
"components": [
{
"label": "Section 6",
"tableView": false,
"clearOnHide": true,
"validateWhenHidden": false,
"key": "section6",
"properties": {
"clearHiddenOnSave": "true"
},
"customConditional": "show = false;",
"type": "container",
"input": true,
"components": [
{
"title": "__6_dash_time_commitment",
"theme": "primary",
"collapsible": false,
"key": "heading6",
"type": "panel",
"label": "Time Commitment",
"input": false,
"tableView": false,
"components": [
{
"label": "__a_information_to_be_provided_by_the_supervised_entity_the",
"description": "__ul_li_see_the_report_on_declared_time_commitment_of",
"autoExpand": false,
"tableView": true,
"validate": {
"required": true
},
"key": "entityExpectedTimeCommit",
"type": "textarea",
"input": true
},
{
"label": "c",
"tableView": false,
"key": "c",
"type": "container",
"input": true,
"components": []
},
{
"label": "__d_list_of_executive_and_non_executive_directorships_and_other",
"description": "__for_each_directorship_or_other_activity_a_separate_row_needs",
"tableView": false,
"addAnother": "__add_another",
"validate": {
"required": true
},
"rowDrafts": false,
"key": "d",
"type": "editgrid",
"input": true,
"components": []
}
]
}
]
}
]
}
],
"key": "tabs1",
"type": "tabs",
"input": false,
"tableView": false
}
]
}
]
}
]
}
]
},
{
"label": "Submit",
"action": "saveState",
"showValidations": false,
"tableView": false,
"key": "submit",
"type": "button",
"input": true,
"state": "draft"
}
]
},
"submission": {
"data": {
"candidates": [
{
"candidate": {
"data": {
"section6": {
"c": {},
"d": []
}
}
}
}
],
"submit": true
}
}
}
158 changes: 158 additions & 0 deletions src/process/__tests__/fixtures/clearOnHideWithHiddenParent.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
{
"form": {
"display": "form",
"components": [
{
"title": "__information_on_the_appointee",
"theme": "primary",
"collapsible": false,
"key": "HeadingNestedFormCandidates",
"type": "panel",
"label": "Appointees",
"input": false,
"tableView": false,
"components": [
{
"label": "Appointees",
"hideLabel": true,
"tableView": false,

"addAnother": "__add_appointee",
"modal": true,
"saveRow": "Close",
"rowDrafts": true,
"key": "candidates",
"type": "editgrid",
"displayAsTable": false,
"input": true,
"components": [
{
"label": "Appointee",
"tableView": false,
"key": "candidate",
"type": "container",
"input": true,
"components": [
{
"label": "Data",
"tableView": false,
"key": "data",
"type": "container",
"input": true,
"components": [
{
"label": "Tabs",
"components": [
{
"label": "__6_time_commitment",
"key": "section6tab",
"components": [
{
"label": "Section 6",
"tableView": false,
"clearOnHide": false,
"validateWhenHidden": false,
"key": "section6",
"properties": {
"clearHiddenOnSave": "true"
},
"hidden": true,
"type": "container",
"input": true,
"components": [
{
"title": "__6_dash_time_commitment",
"theme": "primary",
"collapsible": false,
"key": "heading6",
"type": "panel",
"label": "Time Commitment",
"input": false,
"tableView": false,
"components": [
{
"label": "__a_information_to_be_provided_by_the_supervised_entity_the",
"description": "__ul_li_see_the_report_on_declared_time_commitment_of",
"autoExpand": false,
"tableView": true,
"validate": {
"required": true
},
"key": "entityExpectedTimeCommit",
"type": "textarea",
"input": true
},
{
"label": "c",
"tableView": false,
"key": "c",
"type": "container",
"input": true,
"components": [],
"clearOnHide": true
},
{
"label": "__d_list_of_executive_and_non_executive_directorships_and_other",
"description": "__for_each_directorship_or_other_activity_a_separate_row_needs",
"tableView": false,
"addAnother": "__add_another",
"validate": {
"required": true
},
"rowDrafts": false,
"key": "d",
"type": "editgrid",
"input": true,
"components": [],
"clearOnHide": true
}
]
}
]
}
]
}
],
"key": "tabs1",
"type": "tabs",
"input": false,
"tableView": false
}
]
}
]
}
]
}
]
},
{
"label": "Submit",
"action": "saveState",
"showValidations": false,
"tableView": false,
"key": "submit",
"type": "button",
"input": true,
"state": "draft"
}
]
},
"submission": {
"data": {
"candidates": [
{
"candidate": {
"data": {
"section6": {
"c": {},
"d": []
}
}
}
}
],
"submit": true
}
}
}
Loading

0 comments on commit 3b52a7e

Please sign in to comment.