Skip to content

Commit

Permalink
Updated build.
Browse files Browse the repository at this point in the history
  • Loading branch information
travist committed Apr 15, 2024
2 parents 0c63de6 + d2de44f commit 6ec35a2
Show file tree
Hide file tree
Showing 6 changed files with 152 additions and 74 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ Formio.createForm(document.getElementById('formio'), 'https://examples.form.io/e
- FIO-8111: fixed saveDraft Trigger for nested forms
- FIO-8109: fixed save draft triggering for nested components
- FIO-8146 fixed saveDraft triggering for nested forms after submitting
- FIO-3703: Fixes an issue where NestedData components with modal view do not render values inside Layout components in modal preview table

## 5.0.0-rc.37
### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ export default class NestedArrayComponent extends NestedDataComponent {
}

getComponents(rowIndex) {
if (rowIndex !== undefined) {
if (rowIndex !== undefined && rowIndex !== null) {
if (!this.iteratableRows[rowIndex]) {
return [];
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/_classes/nesteddata/NestedDataComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export default class NestedDataComponent extends NestedComponent {

const htmlTagRegExp = new RegExp('<(.*?)>');

this.components.forEach((component) => {
this.everyComponent((component) => {
if (component.isInputComponent && component.visible && !component.skipInEmail) {
const componentValue = component.getView(component.dataValue, options);
result += (`
Expand Down
28 changes: 28 additions & 0 deletions src/components/_classes/nesteddata/NestedDataComponent.unit.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
'use strict';
import { Formio } from '../../../Formio';
import NestedDataComponent from './NestedDataComponent';
import Harness from '../../../../test/harness';
import assert from 'power-assert';
import nestedDataCompWithModalPreview from '../../../../test/forms/nestedDataWithModalViewAndLayoutComponents';

let component = null;
describe('NestedDataComponent class', () => {
Expand All @@ -25,4 +28,29 @@ describe('NestedDataComponent class', () => {
Harness.testElements(component, 'input[name="data[lastName]"]', 1);
});
});
it('Should show preview of the modal view component properly', (done) => {
Formio.createForm(document.createElement('div'), nestedDataCompWithModalPreview)
.then((form) => {
const openModalBtn = form.element.querySelector('.open-modal-button');
const openModalBtnRows = openModalBtn.querySelectorAll('tr');
assert.equal(openModalBtnRows.length, 1);

const dataGrid = form.getComponent(['dataGrid']);
dataGrid.setValue([
{
textField: 'test'
},
{
textField: 'test2'
}
]);

setTimeout(() => {
const modalPreviewValues = form.element.querySelectorAll('.open-modal-button tr td input');
assert.equal(modalPreviewValues.length, 2);
assert.deepEqual(Array.prototype.map.call(modalPreviewValues, (i) => i.value), ['test', 'test2']);
done();
}, 300);
}).catch(done);
});
});
54 changes: 54 additions & 0 deletions test/forms/nestedDataWithModalViewAndLayoutComponents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"name": "fio3703",
"path": "fio3703",
"type": "form",
"display": "form",
"components": [
{
"label": "Data Grid",
"reorder": false,
"addAnotherPosition": "bottom",
"layoutFixed": false,
"enableRowGroups": false,
"initEmpty": false,
"tableView": true,
"modalEdit": true,
"defaultValue": [
{
"textField": ""
}
],
"key": "dataGrid",
"type": "datagrid",
"input": true,
"components": [
{
"collapsible": false,
"key": "panel",
"type": "panel",
"label": "Panel",
"input": false,
"tableView": false,
"components": [
{
"label": "Text Field",
"applyMaskOn": "change",
"tableView": true,
"key": "textField",
"type": "textfield",
"input": true
}
]
}
]
},
{
"type": "button",
"label": "Submit",
"key": "submit",
"disableOnInvalid": true,
"input": true,
"tableView": false
}
]
}
139 changes: 67 additions & 72 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -551,15 +551,15 @@
"@types/node" "*"

"@typescript-eslint/eslint-plugin@^7.6.0":
version "7.6.0"
resolved "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.6.0.tgz#1f5df5cda490a0bcb6fbdd3382e19f1241024242"
integrity sha512-gKmTNwZnblUdnTIJu3e9kmeRRzV2j1a/LUO27KNNAnIC5zjy1aSvXSRp4rVNlmAoHlQ7HzX42NbKpcSr4jF80A==
version "7.7.0"
resolved "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.7.0.tgz#bf34a02f221811505b8bf2f31060c8560c1bb0a3"
integrity sha512-GJWR0YnfrKnsRoluVO3PRb9r5aMZriiMMM/RHj5nnTrBy1/wIgk76XCtCKcnXGjpZQJQRFtGV9/0JJ6n30uwpQ==
dependencies:
"@eslint-community/regexpp" "^4.10.0"
"@typescript-eslint/scope-manager" "7.6.0"
"@typescript-eslint/type-utils" "7.6.0"
"@typescript-eslint/utils" "7.6.0"
"@typescript-eslint/visitor-keys" "7.6.0"
"@typescript-eslint/scope-manager" "7.7.0"
"@typescript-eslint/type-utils" "7.7.0"
"@typescript-eslint/utils" "7.7.0"
"@typescript-eslint/visitor-keys" "7.7.0"
debug "^4.3.4"
graphemer "^1.4.0"
ignore "^5.3.1"
Expand All @@ -568,72 +568,72 @@
ts-api-utils "^1.3.0"

"@typescript-eslint/parser@^7.6.0":
version "7.6.0"
resolved "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.6.0.tgz#0aca5de3045d68b36e88903d15addaf13d040a95"
integrity sha512-usPMPHcwX3ZoPWnBnhhorc14NJw9J4HpSXQX4urF2TPKG0au0XhJoZyX62fmvdHONUkmyUe74Hzm1//XA+BoYg==
dependencies:
"@typescript-eslint/scope-manager" "7.6.0"
"@typescript-eslint/types" "7.6.0"
"@typescript-eslint/typescript-estree" "7.6.0"
"@typescript-eslint/visitor-keys" "7.6.0"
version "7.7.0"
resolved "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.7.0.tgz#6b1b3ce76c5de002c43af8ae933613b0f2b4bcc6"
integrity sha512-fNcDm3wSwVM8QYL4HKVBggdIPAy9Q41vcvC/GtDobw3c4ndVT3K6cqudUmjHPw8EAp4ufax0o58/xvWaP2FmTg==
dependencies:
"@typescript-eslint/scope-manager" "7.7.0"
"@typescript-eslint/types" "7.7.0"
"@typescript-eslint/typescript-estree" "7.7.0"
"@typescript-eslint/visitor-keys" "7.7.0"
debug "^4.3.4"

"@typescript-eslint/scope-manager@7.6.0":
version "7.6.0"
resolved "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.6.0.tgz#1e9972f654210bd7500b31feadb61a233f5b5e9d"
integrity sha512-ngttyfExA5PsHSx0rdFgnADMYQi+Zkeiv4/ZxGYUWd0nLs63Ha0ksmp8VMxAIC0wtCFxMos7Lt3PszJssG/E6w==
"@typescript-eslint/scope-manager@7.7.0":
version "7.7.0"
resolved "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.7.0.tgz#3f0db079b275bb8b0cb5be7613fb3130cfb5de77"
integrity sha512-/8INDn0YLInbe9Wt7dK4cXLDYp0fNHP5xKLHvZl3mOT5X17rK/YShXaiNmorl+/U4VKCVIjJnx4Ri5b0y+HClw==
dependencies:
"@typescript-eslint/types" "7.6.0"
"@typescript-eslint/visitor-keys" "7.6.0"
"@typescript-eslint/types" "7.7.0"
"@typescript-eslint/visitor-keys" "7.7.0"

"@typescript-eslint/type-utils@7.6.0":
version "7.6.0"
resolved "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.6.0.tgz#644f75075f379827d25fe0713e252ccd4e4a428c"
integrity sha512-NxAfqAPNLG6LTmy7uZgpK8KcuiS2NZD/HlThPXQRGwz6u7MDBWRVliEEl1Gj6U7++kVJTpehkhZzCJLMK66Scw==
"@typescript-eslint/type-utils@7.7.0":
version "7.7.0"
resolved "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.7.0.tgz#36792ff4209a781b058de61631a48df17bdefbc5"
integrity sha512-bOp3ejoRYrhAlnT/bozNQi3nio9tIgv3U5C0mVDdZC7cpcQEDZXvq8inrHYghLVwuNABRqrMW5tzAv88Vy77Sg==
dependencies:
"@typescript-eslint/typescript-estree" "7.6.0"
"@typescript-eslint/utils" "7.6.0"
"@typescript-eslint/typescript-estree" "7.7.0"
"@typescript-eslint/utils" "7.7.0"
debug "^4.3.4"
ts-api-utils "^1.3.0"

"@typescript-eslint/types@7.6.0":
version "7.6.0"
resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.6.0.tgz#53dba7c30c87e5f10a731054266dd905f1fbae38"
integrity sha512-h02rYQn8J+MureCvHVVzhl69/GAfQGPQZmOMjG1KfCl7o3HtMSlPaPUAPu6lLctXI5ySRGIYk94clD/AUMCUgQ==
"@typescript-eslint/types@7.7.0":
version "7.7.0"
resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.7.0.tgz#23af4d24bf9ce15d8d301236e3e3014143604f27"
integrity sha512-G01YPZ1Bd2hn+KPpIbrAhEWOn5lQBrjxkzHkWvP6NucMXFtfXoevK82hzQdpfuQYuhkvFDeQYbzXCjR1z9Z03w==

"@typescript-eslint/typescript-estree@7.6.0":
version "7.6.0"
resolved "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.6.0.tgz#112a3775563799fd3f011890ac8322f80830ac17"
integrity sha512-+7Y/GP9VuYibecrCQWSKgl3GvUM5cILRttpWtnAu8GNL9j11e4tbuGZmZjJ8ejnKYyBRb2ddGQ3rEFCq3QjMJw==
"@typescript-eslint/typescript-estree@7.7.0":
version "7.7.0"
resolved "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.7.0.tgz#b5dd6383b4c6a852d7b256a37af971e8982be97f"
integrity sha512-8p71HQPE6CbxIBy2kWHqM1KGrC07pk6RJn40n0DSc6bMOBBREZxSDJ+BmRzc8B5OdaMh1ty3mkuWRg4sCFiDQQ==
dependencies:
"@typescript-eslint/types" "7.6.0"
"@typescript-eslint/visitor-keys" "7.6.0"
"@typescript-eslint/types" "7.7.0"
"@typescript-eslint/visitor-keys" "7.7.0"
debug "^4.3.4"
globby "^11.1.0"
is-glob "^4.0.3"
minimatch "^9.0.4"
semver "^7.6.0"
ts-api-utils "^1.3.0"

"@typescript-eslint/utils@7.6.0":
version "7.6.0"
resolved "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.6.0.tgz#e400d782280b6f724c8a1204269d984c79202282"
integrity sha512-x54gaSsRRI+Nwz59TXpCsr6harB98qjXYzsRxGqvA5Ue3kQH+FxS7FYU81g/omn22ML2pZJkisy6Q+ElK8pBCA==
"@typescript-eslint/utils@7.7.0":
version "7.7.0"
resolved "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.7.0.tgz#3d2b6606a60ac34f3c625facfb3b3ab7e126f58d"
integrity sha512-LKGAXMPQs8U/zMRFXDZOzmMKgFv3COlxUQ+2NMPhbqgVm6R1w+nU1i4836Pmxu9jZAuIeyySNrN/6Rc657ggig==
dependencies:
"@eslint-community/eslint-utils" "^4.4.0"
"@types/json-schema" "^7.0.15"
"@types/semver" "^7.5.8"
"@typescript-eslint/scope-manager" "7.6.0"
"@typescript-eslint/types" "7.6.0"
"@typescript-eslint/typescript-estree" "7.6.0"
"@typescript-eslint/scope-manager" "7.7.0"
"@typescript-eslint/types" "7.7.0"
"@typescript-eslint/typescript-estree" "7.7.0"
semver "^7.6.0"

"@typescript-eslint/visitor-keys@7.6.0":
version "7.6.0"
resolved "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.6.0.tgz#d1ce13145844379021e1f9bd102c1d78946f4e76"
integrity sha512-4eLB7t+LlNUmXzfOu1VAIAdkjbu5xNSerURS9X/S5TUKWFRpXRQZbmtPqgKmYx8bj3J0irtQXSiWAOY82v+cgw==
"@typescript-eslint/visitor-keys@7.7.0":
version "7.7.0"
resolved "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.7.0.tgz#950148cf1ac11562a2d903fdf7acf76714a2dc9e"
integrity sha512-h0WHOj8MhdhY8YWkzIF30R379y0NqyOHExI9N9KCzvmu05EgG4FumeYa3ccfKUSphyWkWQE1ybVrgz/Pbam6YA==
dependencies:
"@typescript-eslint/types" "7.6.0"
"@typescript-eslint/types" "7.7.0"
eslint-visitor-keys "^3.4.3"

"@ungap/structured-clone@^1.2.0":
Expand Down Expand Up @@ -857,7 +857,7 @@ acorn-walk@^6.0.1:

acorn-walk@^8.0.0, acorn-walk@^8.1.1:
version "8.3.2"
resolved "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz#7703af9415f1b6db9315d6895503862e231d34aa"
resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.2.tgz#7703af9415f1b6db9315d6895503862e231d34aa"
integrity sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==

acorn@^2.1.0, acorn@^2.4.0:
Expand Down Expand Up @@ -2265,7 +2265,7 @@ decamelize@^4.0.0:

decimal.js@^10.4.3:
version "10.4.3"
resolved "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz#1044092884d245d1b7f65725fa4ad4c6f781cc23"
resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.4.3.tgz#1044092884d245d1b7f65725fa4ad4c6f781cc23"
integrity sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==

decode-uri-component@^0.2.0:
Expand Down Expand Up @@ -2517,12 +2517,7 @@ domhandler@^2.3.0:
dependencies:
domelementtype "1"

dompurify@^3.0.6:
version "3.0.11"
resolved "https://registry.npmjs.org/dompurify/-/dompurify-3.0.11.tgz#c163f5816eaac6aeef35dae2b77fca0504564efe"
integrity sha512-Fan4uMuyB26gFV3ovPoEoQbxRRPfTu3CvImyZnhGq5fsIEO+gEFLp45ISFt+kQBWsK5ulDdT0oV28jS1UrwQLg==

dompurify@^3.1.0:
dompurify@^3.0.6, dompurify@^3.1.0:
version "3.1.0"
resolved "https://registry.npmjs.org/dompurify/-/dompurify-3.1.0.tgz#8c6b9fe986969a33aa4686bd829cbe8e14dd9445"
integrity sha512-yoU4rhgPKCo+p5UrWWWNKiIq+ToGqmVVhk0PmMYBK4kRsR3/qhemNFL8f6CFmBd4gMwm3F4T7HBoydP5uY07fA==
Expand Down Expand Up @@ -5544,7 +5539,7 @@ minimatch@^5.0.1:

minimatch@^9.0.1, minimatch@^9.0.3:
version "9.0.3"
resolved "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz#a6e00c3de44c3a542bfaae70abfc22420a6da825"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.3.tgz#a6e00c3de44c3a542bfaae70abfc22420a6da825"
integrity sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==
dependencies:
brace-expansion "^2.0.1"
Expand Down Expand Up @@ -6007,10 +6002,10 @@ p-try@^2.0.0:
resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6"
integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==

[email protected].0:
version "3.0.0-rc.0"
resolved "https://registry.npmjs.org/parchment/-/parchment-3.0.0-rc.0.tgz#d193c530f15ba9a9ebcf637e19a810e995bb86d3"
integrity sha512-JyVx3qaAkFPOCrJpENNYnQkxBYRbo9oPEU2LMJX4g1czXmwtzLDWztFRe90BXrw/LBRLDfZpHcL8TvIGkS1vIA==
[email protected].1:
version "3.0.0-rc.1"
resolved "https://registry.npmjs.org/parchment/-/parchment-3.0.0-rc.1.tgz#7af30c2c146afce257040cae2061c7a73d9b30a8"
integrity sha512-UiXun/99vbUgfPgAIuyZzqRN1YARfMz3ktAoTOxDWnrK/OMQlshPh0TKrNhePxxDWCGz/xVsexMtsaEQy+fmXQ==

parent-module@^1.0.0:
version "1.0.1"
Expand Down Expand Up @@ -6074,7 +6069,7 @@ parse5@^3.0.1:

parse5@^7.1.2:
version "7.1.2"
resolved "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz#0736bebbfd77793823240a23b7fc5e010b7f8e32"
resolved "https://registry.yarnpkg.com/parse5/-/parse5-7.1.2.tgz#0736bebbfd77793823240a23b7fc5e010b7f8e32"
integrity sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==
dependencies:
entities "^4.4.0"
Expand Down Expand Up @@ -6511,13 +6506,13 @@ quill-delta@^5.1.0:
lodash.isequal "^4.5.0"

quill@^2.0.0-rc.4:
version "2.0.0-rc.4"
resolved "https://registry.npmjs.org/quill/-/quill-2.0.0-rc.4.tgz#f25ad27666a3eb62cf579ee91d7f4a1bd3af11f9"
integrity sha512-Fzz7JBH91zLK4sRMysAxXpZrredhFjCGjK4FWkcujQPOV+P8LSMUsuHcPg2g8ZU9Fu6dtRTrRTc/XBYBP9jWGg==
version "2.0.0-rc.5"
resolved "https://registry.npmjs.org/quill/-/quill-2.0.0-rc.5.tgz#c7112ae4b9b610d11a9c7bab220c88553b2df95d"
integrity sha512-3jpk3Jb+TETSZ+3owQqneMDVe30qWmp7vXEVkj9Z5b+qp443HKF/jVu86U+uSW1vB2dphFYgHXhh71c/oq4ohQ==
dependencies:
eventemitter3 "^5.0.1"
lodash-es "^4.17.21"
parchment "3.0.0-rc.0"
parchment "3.0.0-rc.1"
quill-delta "^5.1.0"

randomatic@^3.0.0:
Expand Down Expand Up @@ -6910,7 +6905,7 @@ rimraf@^3.0.0, rimraf@^3.0.2:

rrweb-cssom@^0.6.0:
version "0.6.0"
resolved "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz#ed298055b97cbddcdeb278f904857629dec5e0e1"
resolved "https://registry.yarnpkg.com/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz#ed298055b97cbddcdeb278f904857629dec5e0e1"
integrity sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==

run-async@^2.4.0:
Expand Down Expand Up @@ -6955,9 +6950,9 @@ safe-regex@^1.1.0:
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==

sass@^1.74.1:
version "1.74.1"
resolved "https://registry.npmjs.org/sass/-/sass-1.74.1.tgz#686fc227d3707dd25cb2925e1db8e4562be29319"
integrity sha512-w0Z9p/rWZWelb88ISOLyvqTWGmtmu2QJICqDBGyNnfG4OUnPX9BBjjYIXUpXCMOOg5MQWNpqzt876la1fsTvUA==
version "1.75.0"
resolved "https://registry.npmjs.org/sass/-/sass-1.75.0.tgz#91bbe87fb02dfcc34e052ddd6ab80f60d392be6c"
integrity sha512-ShMYi3WkrDWxExyxSZPst4/okE9ts46xZmJDSawJQrnte7M1V9fScVB+uNXOVKRBt0PggHOwoZcn8mYX4trnBw==
dependencies:
chokidar ">=3.0.0 <4.0.0"
immutable "^4.0.0"
Expand Down Expand Up @@ -8100,7 +8095,7 @@ value-or-function@^3.0.0:

vanilla-picker@^2.12.3:
version "2.12.3"
resolved "https://registry.npmjs.org/vanilla-picker/-/vanilla-picker-2.12.3.tgz#1cc47b641a2b9c9afc5ac3a9a02febace0f1b17a"
resolved "https://registry.yarnpkg.com/vanilla-picker/-/vanilla-picker-2.12.3.tgz#1cc47b641a2b9c9afc5ac3a9a02febace0f1b17a"
integrity sha512-qVkT1E7yMbUsB2mmJNFmaXMWE2hF8ffqzMMwe9zdAikd8u2VfnsVY2HQcOUi2F38bgbxzlJBEdS1UUhOXdF9GQ==
dependencies:
"@sphinxxxx/color-conversion" "^2.2.2"
Expand Down

0 comments on commit 6ec35a2

Please sign in to comment.