Commit d29a31bb authored by Paul Slaughter's avatar Paul Slaughter

Merge branch 'sstern-master-patch-13517' into 'master'

Update ee_features.md for developing on EE features for frontend

See merge request gitlab-org/gitlab!74030
parents b48e79a9 c0292b8b
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment