diff options
Diffstat (limited to 'app/assets/javascripts/ci/pipeline_editor/components/editor/ci_editor_header.vue')
-rw-r--r-- | app/assets/javascripts/ci/pipeline_editor/components/editor/ci_editor_header.vue | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/app/assets/javascripts/ci/pipeline_editor/components/editor/ci_editor_header.vue b/app/assets/javascripts/ci/pipeline_editor/components/editor/ci_editor_header.vue index 201fba837e2..b78224e93b0 100644 --- a/app/assets/javascripts/ci/pipeline_editor/components/editor/ci_editor_header.vue +++ b/app/assets/javascripts/ci/pipeline_editor/components/editor/ci_editor_header.vue @@ -1,24 +1,30 @@ <script> import { GlButton } from '@gitlab/ui'; -import { __ } from '~/locale'; +import { __, s__ } from '~/locale'; import Tracking from '~/tracking'; +import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; import { pipelineEditorTrackingOptions, TEMPLATE_REPOSITORY_URL } from '../../constants'; export default { i18n: { browseTemplates: __('Browse templates'), help: __('Help'), + jobAssistant: s__('JobAssistant|Job assistant'), }, TEMPLATE_REPOSITORY_URL, components: { GlButton, }, - mixins: [Tracking.mixin()], + mixins: [glFeatureFlagMixin(), Tracking.mixin()], props: { showDrawer: { type: Boolean, required: true, }, + showJobAssistantDrawer: { + type: Boolean, + required: true, + }, }, methods: { toggleDrawer() { @@ -29,6 +35,11 @@ export default { this.trackHelpDrawerClick(); } }, + toggleJobAssistantDrawer() { + this.$emit( + this.showJobAssistantDrawer ? 'close-job-assistant-drawer' : 'open-job-assistant-drawer', + ); + }, trackHelpDrawerClick() { const { label, actions } = pipelineEditorTrackingOptions; this.track(actions.openHelpDrawer, { label }); @@ -64,5 +75,15 @@ export default { > {{ $options.i18n.help }} </gl-button> + <gl-button + v-if="glFeatures.ciJobAssistantDrawer" + icon="bulb" + size="small" + data-testid="job-assistant-drawer-toggle" + data-qa-selector="job_assistant_drawer_toggle" + @click="toggleJobAssistantDrawer" + > + {{ $options.i18n.jobAssistant }} + </gl-button> </div> </template> |