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 43dc7f8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
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: 8 additions & 0 deletions src/components/selectboxes/SelectBoxes.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,14 @@ export default class SelectBoxesComponent extends RadioComponent {
return defaultValue;
}

get selectMetadata() {
return super.selectData;
}

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

/**
* Only empty if the values are all false.
* @param {any} value - The value to check if empty.
Expand Down

0 comments on commit 43dc7f8

Please sign in to comment.