Address usage of deprecated GlFieldErrors in relation to Vue code
As part of !191062 (merged) we discovered that the usage of GlFieldErrors is problematic in relation to Vue code:
-
GlFieldErrorshas been written to add Field Error handling for HAML-rendered elements -
GlFieldErrorshas no ways to unregister event handlers, e.g. onunmountedif used in relation to Vue code -
GlFieldErrorsis unable to deal with input fields being added/removed/re-rendered, e.g. byv-ifstatements.
We should look into it's usage with relation to Vue code:
$rg gl-show-field-errors {ee/,}app --glob="*.{vue}" -l
app/assets/javascripts/error_tracking_settings/components/project_dropdown.vue
app/assets/javascripts/error_tracking_settings/components/error_tracking_form.vue
ee/app/assets/javascripts/related_items_tree/components/related_items_tree_app.vue
ee/app/assets/javascripts/registrations/components/company_form.vue
app/assets/javascripts/integrations/edit/components/integration_form.vue
and also in these places:
app/assets/javascripts/authentication/password/index.js
51: return new GlFieldErrors(form);
ee/app/assets/javascripts/registrations/company/new/index.js
43: return new GlFieldErrors(document.querySelectorAll('.gl-show-field-errors'));
ee/app/assets/javascripts/registrations/groups/new/index.js
77: return new GlFieldErrors(document.querySelectorAll('.gl-show-field-errors'));
ee/app/assets/javascripts/trials/components/trial_create_lead_form.vue
43: new GlFieldErrors(this.$el);
It's unclear how to address this exactly (e.g. by using GlFormFields) or by making the GlFieldErrors more interopable with Vue.
See these discussions for more details: