survey-library icon indicating copy to clipboard operation
survey-library copied to clipboard

Rename the hasErrors() method and containsErrors property

Open RomanTsukanov opened this issue 2 years ago • 1 comments

Method names usually start with a verb. We should rename the hasErrors() method to validate().

We have many properties that start with "has": hasDescription, hasTitle, hasOther, etc. The containsErrors property works similarly but named differerntly. We should rename this property to hasErrors.

RomanTsukanov avatar Sep 08 '22 08:09 RomanTsukanov

@RomanTsukanov containsErrors cannot be renamed to hasErrors because there's already the hasErrors method. There are also hasCurrentPageErrors() and hasPageErrors() methods. We need other names.

Thank you, Andrew

andrewtelnov avatar Sep 09 '22 13:09 andrewtelnov

@andrewtelnov Okay, we have no choice but to leave containsErrors as is then. Other renamings are as follows: hasErrors() -> validate() hasPageErrors(page) -> validatePage(page) hasCurrentPageErrors - remove, use validatePage(survey.currentPage) instead

RomanTsukanov avatar Nov 14 '22 10:11 RomanTsukanov

Would you mind throwing a rename of isCurrentPageHasErrors into this mix? This makes no grammatical sense and could easily be called hasErrorsOnCurrentPage or something like that (not to be confused with the hasCurrentPageErrors being deprecated here.)

metaturso avatar Dec 28 '22 00:12 metaturso