Skip to content

Fix console error caused by missing mount element

📖 What does this MR do?

Fixes console error on "subgroup" -> "Settings" -> "General" page. The Allow access to the following IP addresses and Restrict membership by email domain fields are only shown on the root groups and are not shown on subgroups. There is currently no mount element check in app/assets/javascripts/groups/settings/access_restriction_field/index.js and therefore console errors are shown on subgroups because the mount element does not exist. This MR adds a check to ensure the mount element exists before trying to mount the Vue app.

💻 Local testing

  1. Create a group
  2. Create a subgroup within that group
  3. Open your dev tools
  4. Navigate to "subgroup" -> "Settings" -> "General"

📷 Screenshots

Fields that were causing issues for context:

Screen_Shot_2021-03-25_at_12.51.00_PM

Before After
Screen_Shot_2021-03-25_at_12.39.10_PM Screen_Shot_2021-03-25_at_12.45.38_PM

🚦 Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Peter Hegman

Merge request reports

Loading