-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIO-8730: Fix submission has hidden fields when 'Clear value when hid…
…den' is checked (#123) * FIO-8730: Fix submission has hidden fields when 'Clear value when hidden' is checked * FIO-8730: Fix clearHidden process logic has unset extra values * FIO-8730: Add test and refactor some already existing for similar cases * FIO-8730: Add vs code tests debug config and watch script for typescript compilation * FIO-8730: Add clearOnHide true to test components * added check for component.input --------- Co-authored-by: John Teague <[email protected]>
- Loading branch information
1 parent
7cf9884
commit 7b6e28b
Showing
9 changed files
with
510 additions
and
376 deletions.
There are no files selected for viewing
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
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" | ||
} | ||
] | ||
} |
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
156 changes: 156 additions & 0 deletions
156
src/process/__tests__/fixtures/clearOnHideWithCustomCondition.json
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
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
158
src/process/__tests__/fixtures/clearOnHideWithHiddenParent.json
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
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 | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import clearOnHideWithCustomCondition from './clearOnHideWithCustomCondition.json'; | ||
import clearOnHideWithHiddenParent from './clearOnHideWithHiddenParent.json'; | ||
import data1a from './data1a.json'; | ||
import form1 from './form1.json'; | ||
import subs from './subs.json'; | ||
|
||
export { clearOnHideWithCustomCondition, clearOnHideWithHiddenParent, data1a, form1, subs }; |
Oops, something went wrong.