-
Notifications
You must be signed in to change notification settings - Fork 124
perf: Optimize cloud account update error reporting to prompt on the corresponding field #4966
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
Conversation
…corresponding field
field.attrs.error = errors | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
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.
The changes in the code you provided seem to be minimal but important for certain functionalities.
Here is a list of what seems likely changed compared to a typical form submission event:
- Added an extra argument
btn
before calling.validate()
in some cases. - The validation handling now correctly sets loading on button when it validates successfully and unloads after successful submission (
this.submitType = submitType;
) - A minor addition here that could benefit from more explanation:
- It looks like there is added functionality around
setAttrsFieldError
. This function seems to check if field attributes ('attrs'
) exist on a component object (priSubmitForm.content
), checks those objects for fields matching a specific property ('id'), then adds its corresponding attribute'error'
to this field's parent element under the'errors'
prop. If not found, it simply returns no issue. Could add more detail about how these operations work?
- It looks like there is added functionality around
Note: Without additional context, it was hard to identify every single change without going through the whole code snippet again. Also since I'm working with 2021 information, things may have evolved significantly since then in Web development practices or libraries used in production environments.
However, I hope the above analysis provides valuable insights into what has been done and where modifications were made!
@@ -244,6 +244,7 @@ export default { | |||
this.$refs.form.setFieldError(key, err) | |||
} | |||
} | |||
this.$emit('performError', data) | |||
} | |||
}, | |||
hasSaveContinue: { |
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.
There is no need for an answer. The provided code seems to be valid according to my knowledge cutoff of September 20th, 2021. It's important to consult current coding standards like ESLint or Prettier when working on projects that require continuous updates beyond this point.
The use-case here appears to be handling error states in form submissions with this
referencing elements correctly and emitting changes accordingly via $emit
. While not providing direct feedback on readability or efficiency improvements per se (as those depend largely on personal style), the structure seems solid with well-known components properly utilized within its context. There should be little irregularity outside known errors such as incorrect usage of variables or improper logic decisions made at this level. Always review against project-specific guidelines and maintain flexibility based on changing client needs if more recent tools/standards emerge during development.
|
perf: Optimize cloud account update error reporting to prompt on the corresponding field