diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 12:16:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 12:16:11 +0300 |
commit | edaa33dee2ff2f7ea3fac488d41558eb5f86d68c (patch) | |
tree | 11f143effbfeba52329fb7afbd05e6e2a3790241 /doc/development/ee_features.md | |
parent | d8a5691316400a0f7ec4f83832698f1988eb27c1 (diff) |
Add latest changes from gitlab-org/gitlab@14-7-stable-eev14.7.0-rc42
Diffstat (limited to 'doc/development/ee_features.md')
-rw-r--r-- | doc/development/ee_features.md | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/doc/development/ee_features.md b/doc/development/ee_features.md index 70d7ea7c1a5..9f705f2c6f1 100644 --- a/doc/development/ee_features.md +++ b/doc/development/ee_features.md @@ -23,7 +23,33 @@ when no license is active. So EE features always should be guarded by `project.feature_available?` or `group.licensed_feature_available?` (or `License.feature_available?` if it is a system-wide feature). -Frontend features should be guarded by pushing a flag from the backend by [using `push_licensed_feature`](licensed_feature_availability.md#restricting-frontend-features), and checked using `this.glFeatures.someFeature` in the frontend. +Frontend features should be guarded by pushing a flag from the backend by [using `push_licensed_feature`](licensed_feature_availability.md#restricting-frontend-features), and checked using `this.glFeatures.someFeature` in the frontend. For example: + +```html +<script> +import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; + +export default { + mixins: [glFeatureFlagMixin()], + components: { + EEComponent: () => import('ee_component/components/test.vue'), + }, + computed: { + shouldRenderComponent() { + return this.glFeatures.myEEFeature; + } + }, +}; +</script> + +<template> + <div> + <ee-component v-if="shouldRenderComponent"/> + </div> +</template> +``` + +Look in `ee/app/models/license.rb` for the names of the licensed features. CE specs should remain untouched as much as possible and extra specs should be added for EE. Licensed features can be stubbed using the |