From 43a25d93ebdabea52f99b05e15b06250cd8f07d7 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 17 May 2023 16:05:49 +0000 Subject: Add latest changes from gitlab-org/gitlab@16-0-stable-ee --- .../components/commit/commit_form.vue | 2 +- .../components/commit/commit_section.vue | 9 ++ .../components/editor/ci_config_merged_preview.vue | 2 +- .../components/editor/ci_editor_header.vue | 26 ++++ .../components/editor/text_editor.vue | 11 ++ .../components/header/validation_segment.vue | 109 +++++++------ .../accordion_items/artifacts_and_cache_item.vue | 104 +++++++++++++ .../accordion_items/image_item.vue | 50 ++++++ .../accordion_items/job_setup_item.vue | 90 +++++++++++ .../accordion_items/rules_item.vue | 105 +++++++++++++ .../accordion_items/services_item.vue | 90 +++++++++++ .../components/job_assistant_drawer/constants.js | 113 +++++++++++++- .../job_assistant_drawer/job_assistant_drawer.vue | 168 ++++++++++++++++++++- .../components/job_assistant_drawer/utils.js | 53 +++++++ .../components/pipeline_editor_tabs.vue | 11 +- .../components/validate/ci_validate.vue | 8 +- .../javascripts/ci/pipeline_editor/constants.js | 18 +-- .../javascripts/ci/pipeline_editor/event_hub.js | 5 + .../graphql/queries/runner_tags.query.graphql | 8 + app/assets/javascripts/ci/pipeline_editor/index.js | 6 +- .../ci/pipeline_editor/pipeline_editor_app.vue | 4 +- .../ci/pipeline_editor/pipeline_editor_home.vue | 26 ++++ 22 files changed, 925 insertions(+), 93 deletions(-) create mode 100644 app/assets/javascripts/ci/pipeline_editor/components/job_assistant_drawer/accordion_items/artifacts_and_cache_item.vue create mode 100644 app/assets/javascripts/ci/pipeline_editor/components/job_assistant_drawer/accordion_items/image_item.vue create mode 100644 app/assets/javascripts/ci/pipeline_editor/components/job_assistant_drawer/accordion_items/job_setup_item.vue create mode 100644 app/assets/javascripts/ci/pipeline_editor/components/job_assistant_drawer/accordion_items/rules_item.vue create mode 100644 app/assets/javascripts/ci/pipeline_editor/components/job_assistant_drawer/accordion_items/services_item.vue create mode 100644 app/assets/javascripts/ci/pipeline_editor/components/job_assistant_drawer/utils.js create mode 100644 app/assets/javascripts/ci/pipeline_editor/event_hub.js create mode 100644 app/assets/javascripts/ci/pipeline_editor/graphql/queries/runner_tags.query.graphql (limited to 'app/assets/javascripts/ci/pipeline_editor') diff --git a/app/assets/javascripts/ci/pipeline_editor/components/commit/commit_form.vue b/app/assets/javascripts/ci/pipeline_editor/components/commit/commit_form.vue index 4775836fcc6..3fe9103c2b3 100644 --- a/app/assets/javascripts/ci/pipeline_editor/components/commit/commit_form.vue +++ b/app/assets/javascripts/ci/pipeline_editor/components/commit/commit_form.vue @@ -146,7 +146,7 @@ export default { -
+
import { __, s__, sprintf } from '~/locale'; +import Tracking from '~/tracking'; import { COMMIT_ACTION_CREATE, COMMIT_ACTION_UPDATE, COMMIT_FAILURE, COMMIT_SUCCESS, COMMIT_SUCCESS_WITH_REDIRECT, + pipelineEditorTrackingOptions, } from '../../constants'; import commitCIFile from '../../graphql/mutations/commit_ci_file.mutation.graphql'; import updateCurrentBranchMutation from '../../graphql/mutations/client/update_current_branch.mutation.graphql'; @@ -26,6 +28,7 @@ export default { components: { CommitForm, }, + mixins: [Tracking.mixin()], inject: ['projectFullPath', 'ciConfigPath'], props: { ciFileContent: { @@ -78,6 +81,8 @@ export default { async onCommitSubmit({ message, sourceBranch, openMergeRequest }) { this.isSaving = true; + this.trackCommitEvent(); + try { const { data: { @@ -131,6 +136,10 @@ export default { this.isSaving = false; } }, + trackCommitEvent() { + const { label, actions } = pipelineEditorTrackingOptions; + this.track(actions.commitCiConfig, { label, property: this.action }); + }, updateCurrentBranch(currentBranch) { this.$apollo.mutate({ mutation: updateCurrentBranchMutation, diff --git a/app/assets/javascripts/ci/pipeline_editor/components/editor/ci_config_merged_preview.vue b/app/assets/javascripts/ci/pipeline_editor/components/editor/ci_config_merged_preview.vue index 42e2d34fa3a..9179fe9d075 100644 --- a/app/assets/javascripts/ci/pipeline_editor/components/editor/ci_config_merged_preview.vue +++ b/app/assets/javascripts/ci/pipeline_editor/components/editor/ci_config_merged_preview.vue @@ -6,7 +6,7 @@ import SourceEditor from '~/vue_shared/components/source_editor.vue'; export default { i18n: { - viewOnlyMessage: s__('Pipelines|Merged YAML is view only'), + viewOnlyMessage: s__('Pipelines|Full configuration is view only'), }, components: { SourceEditor, 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 }} + + {{ $options.i18n.aiAssistant }} +
diff --git a/app/assets/javascripts/ci/pipeline_editor/components/editor/text_editor.vue b/app/assets/javascripts/ci/pipeline_editor/components/editor/text_editor.vue index 891c40482d3..1192f0bf418 100644 --- a/app/assets/javascripts/ci/pipeline_editor/components/editor/text_editor.vue +++ b/app/assets/javascripts/ci/pipeline_editor/components/editor/text_editor.vue @@ -2,6 +2,7 @@ import { EDITOR_READY_EVENT } from '~/editor/constants'; import { CiSchemaExtension } from '~/editor/extensions/source_editor_ci_schema_ext'; import SourceEditor from '~/vue_shared/components/source_editor.vue'; +import eventHub, { SCROLL_EDITOR_TO_BOTTOM } from '~/ci/pipeline_editor/event_hub'; import { SOURCE_EDITOR_DEBOUNCE } from '../../constants'; export default { @@ -16,6 +17,12 @@ export default { }, inject: ['ciConfigPath'], inheritAttrs: false, + created() { + eventHub.$on(SCROLL_EDITOR_TO_BOTTOM, this.scrollEditorToBottom); + }, + beforeDestroy() { + eventHub.$off(SCROLL_EDITOR_TO_BOTTOM, this.scrollEditorToBottom); + }, methods: { onCiConfigUpdate(content) { this.$emit('updateCiConfig', content); @@ -24,6 +31,10 @@ export default { instance.use({ definition: CiSchemaExtension }); instance.registerCiSchema(); }, + scrollEditorToBottom() { + const editor = this.$refs.editor.getEditor(); + editor.setScrollTop(editor.getScrollHeight()); + }, }, readyEvent: EDITOR_READY_EVENT, }; diff --git a/app/assets/javascripts/ci/pipeline_editor/components/header/validation_segment.vue b/app/assets/javascripts/ci/pipeline_editor/components/header/validation_segment.vue index 84c0eef441f..8553256f13a 100644 --- a/app/assets/javascripts/ci/pipeline_editor/components/header/validation_segment.vue +++ b/app/assets/javascripts/ci/pipeline_editor/components/header/validation_segment.vue @@ -1,8 +1,7 @@ + diff --git a/app/assets/javascripts/ci/pipeline_editor/components/job_assistant_drawer/accordion_items/image_item.vue b/app/assets/javascripts/ci/pipeline_editor/components/job_assistant_drawer/accordion_items/image_item.vue new file mode 100644 index 00000000000..b4b468987d8 --- /dev/null +++ b/app/assets/javascripts/ci/pipeline_editor/components/job_assistant_drawer/accordion_items/image_item.vue @@ -0,0 +1,50 @@ + + diff --git a/app/assets/javascripts/ci/pipeline_editor/components/job_assistant_drawer/accordion_items/job_setup_item.vue b/app/assets/javascripts/ci/pipeline_editor/components/job_assistant_drawer/accordion_items/job_setup_item.vue new file mode 100644 index 00000000000..511003d3ad4 --- /dev/null +++ b/app/assets/javascripts/ci/pipeline_editor/components/job_assistant_drawer/accordion_items/job_setup_item.vue @@ -0,0 +1,90 @@ + + diff --git a/app/assets/javascripts/ci/pipeline_editor/components/job_assistant_drawer/accordion_items/rules_item.vue b/app/assets/javascripts/ci/pipeline_editor/components/job_assistant_drawer/accordion_items/rules_item.vue new file mode 100644 index 00000000000..d068b370852 --- /dev/null +++ b/app/assets/javascripts/ci/pipeline_editor/components/job_assistant_drawer/accordion_items/rules_item.vue @@ -0,0 +1,105 @@ + + diff --git a/app/assets/javascripts/ci/pipeline_editor/components/job_assistant_drawer/accordion_items/services_item.vue b/app/assets/javascripts/ci/pipeline_editor/components/job_assistant_drawer/accordion_items/services_item.vue new file mode 100644 index 00000000000..9bada3ef110 --- /dev/null +++ b/app/assets/javascripts/ci/pipeline_editor/components/job_assistant_drawer/accordion_items/services_item.vue @@ -0,0 +1,90 @@ + + diff --git a/app/assets/javascripts/ci/pipeline_editor/components/job_assistant_drawer/constants.js b/app/assets/javascripts/ci/pipeline_editor/components/job_assistant_drawer/constants.js index 1c122fd5e38..e93a9e84302 100644 --- a/app/assets/javascripts/ci/pipeline_editor/components/job_assistant_drawer/constants.js +++ b/app/assets/javascripts/ci/pipeline_editor/components/job_assistant_drawer/constants.js @@ -1,7 +1,118 @@ -import { s__ } from '~/locale'; +import { __, s__ } from '~/locale'; export const DRAWER_CONTAINER_CLASS = '.content-wrapper'; +export const JOB_RULES_WHEN = { + onSuccess: { + value: 'on_success', + text: s__('JobAssistant|on_success'), + }, + onFailure: { + value: 'on_failure', + text: s__('JobAssistant|on_failure'), + }, + manual: { + value: 'manual', + text: s__('JobAssistant|manual'), + }, + always: { + value: 'always', + text: s__('JobAssistant|always'), + }, + delayed: { + value: 'delayed', + text: s__('JobAssistant|delayed'), + }, + never: { + value: 'never', + text: s__('JobAssistant|never'), + }, +}; + +export const JOB_RULES_START_IN = { + second: { + value: 'second', + text: s__('JobAssistant|second(s)'), + }, + minute: { + value: 'minute', + text: s__('JobAssistant|minute(s)'), + }, + day: { + value: 'day', + text: s__('JobAssistant|day(s)'), + }, + week: { + value: 'week', + text: s__('JobAssistant|week(s)'), + }, +}; + +export const SECONDS_MULTIPLE_MAP = { + second: 1, + minute: 60, + day: 3600 * 24, + week: 3600 * 24 * 7, +}; + +export const JOB_TEMPLATE = { + name: '', + stage: '', + script: '', + tags: [], + image: { + name: '', + entrypoint: [''], + }, + services: [ + { + name: '', + entrypoint: [''], + }, + ], + artifacts: { + paths: [''], + exclude: [''], + }, + cache: { + paths: [''], + key: '', + }, + rules: [ + { + allow_failure: false, + when: 'on_success', + start_in: '', + }, + ], +}; + export const i18n = { + ARRAY_FIELD_DESCRIPTION: s__('JobAssistant|Please separate array type fields with new lines'), + INPUT_FORMAT: s__('JobAssistant|Input format'), ADD_JOB: s__('JobAssistant|Add job'), + SCRIPT: s__('JobAssistant|Script'), + JOB_NAME: s__('JobAssistant|Job name'), + JOB_SETUP: s__('JobAssistant|Job Setup'), + STAGE: s__('JobAssistant|Stage (optional)'), + TAGS: s__('JobAssistant|Tags (optional)'), + IMAGE: s__('JobAssistant|Image'), + IMAGE_NAME: s__('JobAssistant|Image name (optional)'), + IMAGE_ENTRYPOINT: s__('JobAssistant|Image entrypoint (optional)'), + THIS_FIELD_IS_REQUIRED: __('This field is required'), + CACHE_PATHS: s__('JobAssistant|Cache paths (optional)'), + CACHE_KEY: s__('JobAssistant|Cache key (optional)'), + ARTIFACTS_EXCLUDE_PATHS: s__('JobAssistant|Artifacts exclude paths (optional)'), + ARTIFACTS_PATHS: s__('JobAssistant|Artifacts paths (optional)'), + ARTIFACTS_AND_CACHE: s__('JobAssistant|Artifacts and cache'), + ADD_PATH: s__('JobAssistant|Add path'), + RULES: s__('JobAssistant|Rules'), + WHEN: s__('JobAssistant|When'), + ALLOW_FAILURE: s__('JobAssistant|Allow failure'), + INVALID_START_IN: s__('JobAssistant|Error - Valid value is between 1 second and 1 week'), + ADD_SERVICE: s__('JobAssistant|Add service'), + SERVICE: s__('JobAssistant|Services'), + SERVICE_NAME: s__('JobAssistant|Service name (optional)'), + SERVICE_ENTRYPOINT: s__('JobAssistant|Service entrypoint (optional)'), + ENTRYPOINT_PLACEHOLDER_TEXT: s__('JobAssistant|Please enter the parameters.'), }; diff --git a/app/assets/javascripts/ci/pipeline_editor/components/job_assistant_drawer/job_assistant_drawer.vue b/app/assets/javascripts/ci/pipeline_editor/components/job_assistant_drawer/job_assistant_drawer.vue index 65c87df21cb..30746065732 100644 --- a/app/assets/javascripts/ci/pipeline_editor/components/job_assistant_drawer/job_assistant_drawer.vue +++ b/app/assets/javascripts/ci/pipeline_editor/components/job_assistant_drawer/job_assistant_drawer.vue @@ -1,13 +1,29 @@ @@ -44,6 +180,20 @@ export default { + + + + + + + diff --git a/app/assets/javascripts/ci/pipeline_editor/components/job_assistant_drawer/utils.js b/app/assets/javascripts/ci/pipeline_editor/components/job_assistant_drawer/utils.js new file mode 100644 index 00000000000..a604d79259d --- /dev/null +++ b/app/assets/javascripts/ci/pipeline_editor/components/job_assistant_drawer/utils.js @@ -0,0 +1,53 @@ +import { isEmpty, isObject, isArray, isString, reject, omitBy, mapValues, map, trim } from 'lodash'; +import { + JOB_RULES_WHEN, + SECONDS_MULTIPLE_MAP, +} from '~/ci/pipeline_editor/components/job_assistant_drawer/constants'; + +const isEmptyValue = (val) => (isObject(val) || isString(val)) && isEmpty(val); +const trimText = (val) => (isString(val) ? trim(val) : val); + +export const removeEmptyObj = (obj) => { + if (isArray(obj)) { + return reject(map(obj, removeEmptyObj), isEmptyValue); + } else if (isObject(obj)) { + return omitBy(mapValues(obj, removeEmptyObj), isEmptyValue); + } + return obj; +}; + +export const trimFields = (data) => { + if (isArray(data)) { + return data.map(trimFields); + } else if (isObject(data)) { + return mapValues(data, trimFields); + } + return trimText(data); +}; + +export const validateEmptyValue = (value) => { + return trim(value) !== ''; +}; + +export const validateStartIn = (when, startIn) => { + const hasNoValue = when !== JOB_RULES_WHEN.delayed.value; + if (hasNoValue) { + return true; + } + + let [startInNumber, startInUnit] = startIn.split(' '); + + startInNumber = Number(startInNumber); + if (!Number.isInteger(startInNumber)) { + return false; + } + + const isPlural = startInUnit.slice(-1) === 's'; + if (isPlural) { + startInUnit = startInUnit.slice(0, -1); + } + + const multiple = SECONDS_MULTIPLE_MAP[startInUnit]; + + return startInNumber * multiple >= 1 && startInNumber * multiple <= SECONDS_MULTIPLE_MAP.week; +}; diff --git a/app/assets/javascripts/ci/pipeline_editor/components/pipeline_editor_tabs.vue b/app/assets/javascripts/ci/pipeline_editor/components/pipeline_editor_tabs.vue index fd6547468d9..403793a255a 100644 --- a/app/assets/javascripts/ci/pipeline_editor/components/pipeline_editor_tabs.vue +++ b/app/assets/javascripts/ci/pipeline_editor/components/pipeline_editor_tabs.vue @@ -31,7 +31,7 @@ export default { tabEdit: s__('Pipelines|Edit'), tabGraph: s__('Pipelines|Visualize'), tabLint: s__('Pipelines|Lint'), - tabMergedYaml: s__('Pipelines|View merged YAML'), + tabMergedYaml: s__('Pipelines|Full configuration'), tabValidate: s__('Pipelines|Validate'), empty: { visualization: s__( @@ -41,12 +41,12 @@ export default { 'PipelineEditor|The CI/CD configuration is continuously validated. Errors and warnings are displayed when the CI/CD configuration file is not empty.', ), merge: s__( - 'PipelineEditor|The merged YAML view is displayed when the CI/CD configuration file has valid syntax.', + 'PipelineEditor|The full configuration view is displayed when the CI/CD configuration file has valid syntax.', ), }, }, errorTexts: { - loadMergedYaml: s__('Pipelines|Could not load merged YAML content'), + loadMergedYaml: s__('Pipelines|Could not load full configuration content'), }, query: { TAB_QUERY_PARAM, @@ -99,6 +99,10 @@ export default { type: Boolean, required: true, }, + showAiAssistantDrawer: { + type: Boolean, + required: true, + }, }, apollo: { appStatus: { @@ -194,6 +198,7 @@ export default { diff --git a/app/assets/javascripts/ci/pipeline_editor/components/validate/ci_validate.vue b/app/assets/javascripts/ci/pipeline_editor/components/validate/ci_validate.vue index 83fcab4b343..ba33888e2fb 100644 --- a/app/assets/javascripts/ci/pipeline_editor/components/validate/ci_validate.vue +++ b/app/assets/javascripts/ci/pipeline_editor/components/validate/ci_validate.vue @@ -2,7 +2,7 @@ import { GlAlert, GlButton, - GlDropdown, + GlDisclosureDropdown, GlIcon, GlLoadingIcon, GlLink, @@ -61,7 +61,7 @@ export default { CiLintResults, GlAlert, GlButton, - GlDropdown, + GlDisclosureDropdown, GlIcon, GlLoadingIcon, GlLink, @@ -195,11 +195,11 @@ export default {
- diff --git a/app/assets/javascripts/ci/pipeline_editor/constants.js b/app/assets/javascripts/ci/pipeline_editor/constants.js index dd25c4d433b..912e0fcbff9 100644 --- a/app/assets/javascripts/ci/pipeline_editor/constants.js +++ b/app/assets/javascripts/ci/pipeline_editor/constants.js @@ -67,6 +67,7 @@ export const pipelineEditorTrackingOptions = { actions: { browseTemplates: 'browse_templates', closeHelpDrawer: 'close_help_drawer', + commitCiConfig: 'commit_ci_config', helpDrawerLinks: { [CI_EXAMPLES_LINK]: 'visit_help_drawer_link_ci_examples', [CI_HELP_LINK]: 'visit_help_drawer_link_ci_help', @@ -86,25 +87,8 @@ export const VALIDATE_TAB_FEEDBACK_URL = 'https://gitlab.com/gitlab-org/gitlab/- export const COMMIT_SHA_POLL_INTERVAL = 1000; -export const RUNNERS_AVAILABILITY_SECTION_EXPERIMENT_NAME = 'runners_availability_section'; -export const RUNNERS_SETTINGS_LINK_CLICKED_EVENT = 'runners_settings_link_clicked'; -export const RUNNERS_DOCUMENTATION_LINK_CLICKED_EVENT = 'runners_documentation_link_clicked'; -export const RUNNERS_SETTINGS_BUTTON_CLICKED_EVENT = 'runners_settings_button_clicked'; export const I18N = { title: s__('Pipelines|Get started with GitLab CI/CD'), - runners: { - title: s__('Pipelines|Runners are available to run your jobs now'), - subtitle: s__( - 'Pipelines|GitLab Runner is an application that works with GitLab CI/CD to run jobs in a pipeline. There are active runners available to run your jobs right now. If you prefer, you can %{settingsLinkStart}configure your runners%{settingsLinkEnd} or %{docsLinkStart}learn more%{docsLinkEnd} about runners.', - ), - }, - noRunners: { - title: s__('Pipelines|No runners detected'), - subtitle: s__( - 'Pipelines|A GitLab Runner is an application that works with GitLab CI/CD to run jobs in a pipeline. Install GitLab Runner and register your own runners to get started with CI/CD.', - ), - cta: s__('Pipelines|Install GitLab Runner'), - }, learnBasics: { title: s__('Pipelines|Learn the basics of pipelines and .yml files'), subtitle: s__( diff --git a/app/assets/javascripts/ci/pipeline_editor/event_hub.js b/app/assets/javascripts/ci/pipeline_editor/event_hub.js new file mode 100644 index 00000000000..c64eaf5ef5c --- /dev/null +++ b/app/assets/javascripts/ci/pipeline_editor/event_hub.js @@ -0,0 +1,5 @@ +import createEventHub from '~/helpers/event_hub_factory'; + +export default createEventHub(); + +export const SCROLL_EDITOR_TO_BOTTOM = Symbol('scrollEditorToBottom'); diff --git a/app/assets/javascripts/ci/pipeline_editor/graphql/queries/runner_tags.query.graphql b/app/assets/javascripts/ci/pipeline_editor/graphql/queries/runner_tags.query.graphql new file mode 100644 index 00000000000..aab30257d13 --- /dev/null +++ b/app/assets/javascripts/ci/pipeline_editor/graphql/queries/runner_tags.query.graphql @@ -0,0 +1,8 @@ +query getRunnerTags { + runners { + nodes { + id + tagList + } + } +} diff --git a/app/assets/javascripts/ci/pipeline_editor/index.js b/app/assets/javascripts/ci/pipeline_editor/index.js index 6d91c339833..b8d6c27435d 100644 --- a/app/assets/javascripts/ci/pipeline_editor/index.js +++ b/app/assets/javascripts/ci/pipeline_editor/index.js @@ -29,12 +29,12 @@ export const initPipelineEditor = (selector = '#js-pipeline-editor') => { ciExamplesHelpPagePath, ciHelpPagePath, ciLintPath, + ciTroubleshootingPath, defaultBranch, emptyStateIllustrationPath, helpPaths, includesHelpPagePath, lintHelpPagePath, - lintUnavailableHelpPagePath, needsHelpPagePath, newMergeRequestPath, pipelinePagePath, @@ -46,6 +46,7 @@ export const initPipelineEditor = (selector = '#js-pipeline-editor') => { usesExternalConfig, validateTabIllustrationPath, ymlHelpPagePath, + aiChatAvailable, } = el.dataset; const configurationPaths = Object.fromEntries( @@ -115,10 +116,12 @@ export const initPipelineEditor = (selector = '#js-pipeline-editor') => { el, apolloProvider, provide: { + aiChatAvailable: parseBoolean(aiChatAvailable), ciConfigPath, ciExamplesHelpPagePath, ciHelpPagePath, ciLintPath, + ciTroubleshootingPath, configurationPaths, dataMethod: 'graphql', defaultBranch, @@ -126,7 +129,6 @@ export const initPipelineEditor = (selector = '#js-pipeline-editor') => { helpPaths, includesHelpPagePath, lintHelpPagePath, - lintUnavailableHelpPagePath, needsHelpPagePath, newMergeRequestPath, pipelinePagePath, diff --git a/app/assets/javascripts/ci/pipeline_editor/pipeline_editor_app.vue b/app/assets/javascripts/ci/pipeline_editor/pipeline_editor_app.vue index ff848a973e3..de8e5a1a284 100644 --- a/app/assets/javascripts/ci/pipeline_editor/pipeline_editor_app.vue +++ b/app/assets/javascripts/ci/pipeline_editor/pipeline_editor_app.vue @@ -1,7 +1,7 @@