Skip to content

Commit

Permalink
Merged in task/dspace-cris-2023_02_x/DSC-1823-fix (pull request DSpac…
Browse files Browse the repository at this point in the history
…e#2427)

[CST-15396] fix method for error reset in non mandatory groups

Approved-by: Giuseppe Digilio
  • Loading branch information
FrancescoMolinaro authored and atarix83 committed Oct 24, 2024
2 parents cfe57e2 + c6a4da7 commit b3c3c7e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -583,8 +583,9 @@ export class DsDynamicFormControlContainerComponent extends DynamicFormControlCo

isNotRequiredGroupAndEmpty(): boolean {
const parent = this.model.parent;

if (hasValue(parent) && parent.type === 'GROUP') {
// Check if the model is part of a group, the group needs to be an inner form and be in the submission form not in a nested form.
// The check hasValue(parent.parent) tells if the parent is in the submission or in a modal (nested cases)
if (hasValue(parent) && parent.type === 'GROUP' && this.model.isModelOfInnerForm && hasValue(parent.parent)) {

const groupHasSomeValue = parent.group.some(elem => !!elem.value);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
[attr.aria-labelledby]="'label_' + model.id"
[attr.tabindex]="item.index"
[checked]="item.value"
[class.is-invalid]="showErrorMessages"
[id]="model.id + item.id"
[formControlName]="item.id"
[name]="model.name"
Expand Down Expand Up @@ -46,6 +47,7 @@

<input type="radio" class="custom-control-input"
[checked]="item.value"
[class.is-invalid]="showErrorMessages"
[id]="model.id + item.id"
[name]="model.id"
[required]="model.required"
Expand Down

0 comments on commit b3c3c7e

Please sign in to comment.