-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Form/action refactoring and other updates #2666
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2666 +/- ##
==========================================
+ Coverage 65.81% 66.15% +0.34%
==========================================
Files 1167 1199 +32
Lines 32528 33303 +775
Branches 5929 6128 +199
==========================================
+ Hits 21409 22033 +624
- Misses 11005 11138 +133
- Partials 114 132 +18
... and 2 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Since Javascript doesn't really have a concept of package-private, this linting rule should help accomplish something close
Doing this on every render was causing a React error to be logged.
bcb0ed0
to
19dd662
Compare
- Properly display form validation errors - Replaced "Parameter types" with Parameter classes - Form dependencies - Dynamic properties - Move update logic into layout components - Support action data loading - New parameters and form controls
19dd662
to
9b62d70
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some opportunities for refactoring in the future, but this is great!
} | ||
|
||
private _validate(): ValidationStatus { | ||
if (this.value != null && Array.isArray(this.value)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems that if value is not null nor an array, it should raise an error, no?
if (errorCount === 1 && lastErrorMsg) { | ||
errorMsg = lastErrorMsg; | ||
} else { | ||
errorMsg = `${errorCount} ${ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might want to generalize this a bit for localization (because "X errors found" might not be grammatically correct in other languages): errorCount === 1 ? `1 error found` : `${errorCount} errors found`
.
warningMsg = lastWarningMsg; | ||
} else { | ||
warningMsg = `${warningCount} ${ | ||
warningCount === 1 ? "warning" : "warnings" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above
* Creates a standalone parameter with a backing form. Useful for using | ||
* form controls outside the context of an entire form | ||
*/ | ||
export function createParam< |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking about this more: Why not just put use the constructor (e.g., put the logic in AbstractParameter
's constructor)?
No description provided.