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 | 26 |
1 files changed, 26 insertions, 0 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 b78224e93b0..eabf4749e9c 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 @@ -10,12 +10,14 @@ export default { browseTemplates: __('Browse templates'), help: __('Help'), jobAssistant: s__('JobAssistant|Job assistant'), + aiAssistant: s__('PipelinesAiAssistant|Ai assistant'), }, TEMPLATE_REPOSITORY_URL, components: { GlButton, }, mixins: [glFeatureFlagMixin(), Tracking.mixin()], + inject: ['aiChatAvailable'], props: { showDrawer: { type: Boolean, @@ -25,6 +27,15 @@ export default { type: Boolean, required: true, }, + showAiAssistantDrawer: { + type: Boolean, + required: true, + }, + }, + computed: { + isAiConfigChatAvailable() { + return this.glFeatures.aiCiConfigGenerator && this.aiChatAvailable; + }, }, methods: { toggleDrawer() { @@ -40,6 +51,11 @@ export default { this.showJobAssistantDrawer ? 'close-job-assistant-drawer' : 'open-job-assistant-drawer', ); }, + toggleAiAssistantDrawer() { + this.$emit( + this.showAiAssistantDrawer ? 'close-ai-assistant-drawer' : 'open-ai-assistant-drawer', + ); + }, trackHelpDrawerClick() { const { label, actions } = pipelineEditorTrackingOptions; this.track(actions.openHelpDrawer, { label }); @@ -85,5 +101,15 @@ export default { > {{ $options.i18n.jobAssistant }} </gl-button> + <gl-button + v-if="isAiConfigChatAvailable" + icon="bulb" + size="small" + data-testid="ai-assistant-drawer-toggle" + data-qa-selector="ai_assistant_drawer_toggle" + @click="toggleAiAssistantDrawer" + > + {{ $options.i18n.aiAssistant }} + </gl-button> </div> </template> |