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

FIO-8690: Use @formio/core conditionals process for conditionals logic #5890

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Prev Previous commit
Next Next commit
FIO-8690: Add fix to selection
mikekotikov committed Oct 29, 2024
commit a8d7237479fa83ee2cce6b77cbd2ef6168d825a2
18 changes: 17 additions & 1 deletion src/components/select/Select.js
Original file line number Diff line number Diff line change
@@ -1487,8 +1487,24 @@ export default class SelectComponent extends ListComponent {
}
templateData[value] = this.templateData[value];
}
// if (this.path === 'dataGrid.select') {
// this.path = 'dataGrid[0].select'
// }

let newPath = '';

if (this.parent.type === 'datagrid') {
const splitedData = this.path.split(".");
const compIndexToCheck = splitedData.length -2
const lastComp = splitedData[compIndexToCheck];
const isPaths = lastComp.match(/\[[0-9]+\]/g);
if(!isPaths) {
splitedData[compIndexToCheck] = `${splitedData[compIndexToCheck]}[0]`
}
newPath = splitedData.join(".");
}

_.set(submission.metadata.selectData, this.path, templateData);
_.set(submission.metadata.selectData, newPath? newPath: this.path, templateData);
}
}