Skip to content

Commit

Permalink
Remove unnecessary errors override
Browse files Browse the repository at this point in the history
  • Loading branch information
lotorvik committed Dec 5, 2024
1 parent 072b34b commit 5c1e9a9
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ class Activities extends BaseComponent {
return activitiesBuilder();
}

override get errors() {
return this.componentErrors;
}

override getError(): string | undefined {
const error = this.componentErrors[0];
if (error) return error.message;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,11 @@ class Address extends BaseComponent {
}

getReadOnly(): boolean {
return !!this.component?.prefillKey && this.isSubmissionDigital();
return this.hasPrefill() || super.getReadOnly();
}

showAddressTypeChoice(): boolean {
return this.hasPrefill() || super.getReadOnly();
return !!this.component?.prefillKey && this.isSubmissionPaper();
}

setValue(value: any) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ class MonthPicker extends BaseComponent {
this.rerender();
}

override get errors() {
return this.componentErrors;
}

override checkValidity(data?: SubmissionData, dirty?: boolean, row?: SubmissionData): boolean {
this.removeAllErrors();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ export default class AddressValidity extends BaseComponent {
return addressValidityBuilder();
}

get errors() {
return this.componentErrors;
}

checkValidity(data, dirty, row) {
this.removeAllErrors();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ export default class Identity extends BaseComponent {
return this.hasPrefill() || super.getReadOnly();
}

get errors() {
return this.componentErrors;
}

checkValidity(data, dirty, row) {
this.removeAllErrors();

Expand Down

0 comments on commit 5c1e9a9

Please sign in to comment.