Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandraRamanenka committed Oct 18, 2024
1 parent aacffb4 commit 544083b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/_classes/list/ListComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default class ListComponent extends Field {

get selectData() {
const selectData = _.get(this.root, 'submission.metadata.selectData', {});
return _.get(selectData, this.path) || this.component.selectData;
return _.get(selectData, this.path);
}

get dataReady() {
Expand Down
8 changes: 8 additions & 0 deletions src/components/radio/Radio.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,14 @@ export default class RadioComponent extends ListComponent {
return _.get(listData, this.path);
}

get selectMetadata() {
return super.selectData;
}

get selectData() {
return this.selectMetadata || this.component.selectData;
}

init() {
super.init();
this.templateData = {};
Expand Down
8 changes: 4 additions & 4 deletions src/components/textarea/TextArea.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,10 +356,10 @@ export default class TextAreaComponent extends TextFieldComponent {
}

/**
* Normalize values coming into updateValue. For example, depending on the configuration, string value `"true"` will be normalized to boolean `true`.
* @param {*} value - The value to normalize
* @returns {*} - Returns the normalized value
*/
* Normalize values coming into updateValue. For example, depending on the configuration, string value `"true"` will be normalized to boolean `true`.
* @param {*} value - The value to normalize
* @returns {*} - Returns the normalized value
*/
normalizeValue(value) {
if (this.component.multiple && Array.isArray(value)) {
return value.map((singleValue) => this.normalizeSingleValue(singleValue));
Expand Down

0 comments on commit 544083b

Please sign in to comment.