Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-01-12 09:11:00 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-01-12 09:11:00 +0300
commit563d0d3bc956f6d6a9805720dade3b72bd488043 (patch)
tree1e246cd120ba4ee6b03028ad9d257579f7ca8493 /doc/development/ee_features.md
parent415a70d59c85bb52dee8338e0c69d50fd1d38454 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/development/ee_features.md')
-rw-r--r--doc/development/ee_features.md28
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