-
Notifications
You must be signed in to change notification settings - Fork 14
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
feat: form for creating drs object #344
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Pratiksha Sankhe <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Reviewer's Guide by SourceryThis pull request introduces a new form component for creating DRS objects. The component is implemented using LitElement and includes form fields, submission logic, and error handling. Additionally, a React wrapper for the component is provided, along with demo HTML files to showcase its usage. File-Level Changes
Tips
|
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.
Hey @psankhe28 - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider modularizing the
create-object.ts
file further. The form field definitions could be moved to a separate configuration file to improve readability and maintainability. - Add unit tests for the new component to ensure its functionality and make future maintenance easier.
- Please update the user-facing documentation to describe the new component and its usage, as indicated in the unchecked item in your PR checklist.
Here's what I looked at during the review
- 🟡 General issues: 2 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.
} | ||
|
||
// form submit method | ||
private async _submitForm(form: any) { |
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.
suggestion: Consider breaking down the _submitForm method into smaller functions
The _submitForm method is quite long and handles multiple responsibilities. Consider breaking it down into smaller, more focused functions to improve readability and maintainability.
private async _submitForm(form: any) {
const formData = this._extractFormData(form);
const validatedData = this._validateFormData(formData);
await this._processAndSendData(validatedData);
}
private _extractFormData(form: any): any {
// Extract form data logic
}
private _validateFormData(data: any): any {
// Validate form data logic
}
private async _processAndSendData(data: any): Promise<void> {
// Process and send data logic
}
} | ||
|
||
// Process alias data | ||
private _processAlias = (value: Array<{ alias: string }>) => |
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.
suggestion: Consider using Array.map for a more declarative approach
The _processAlias method could be simplified using Array.map for a more declarative and idiomatic approach. For example: private _processAlias = (value: Array<{ alias: string }>) => value.map(({alias}) => alias);
private _processAlias = (value: Array<{ alias: string }>) => | |
private _processAlias = (value: Array<{ alias: string }>) => value.map(({alias}) => alias); |
1845262
to
1395942
Compare
Description
It adds a form for creating drs object
Fixes #(issue)
#336
Checklist
Comments