Skip to content

Fix error with initializiation of protected environments feature

Olena Horal-Koretska requested to merge 344897-fix-access-dropdown-issue into master

Protected environments is a Premium feature. We did not have the check that the element on which the access dropdown is mounted actually exists and the component tried to add the listener on the non-existent element. It resulted in the runtime error.

Screenshot_2022-05-04_at_16.11.47

By adding the check that the element on which the dropdown is rendered is in the DOM, protected environments are initialized only when it is available. To check that issue is fixed, go to Project =>Settings=> CI/CD with the license under Premium (e.g. Starter). You should not see any console errors. Alternatively, you can remove the protected_environments from PREMIUM_FEATURES (line 141 in ee/app/models/gitlab_subscriptions/features.rb)

Related to #344897 (closed)

Edited by Olena Horal-Koretska

Merge request reports