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:
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