diff options
Diffstat (limited to 'app/assets/javascripts/pages/shared/wikis')
3 files changed, 10 insertions, 5 deletions
diff --git a/app/assets/javascripts/pages/shared/wikis/components/wiki_form.vue b/app/assets/javascripts/pages/shared/wikis/components/wiki_form.vue index 4f68c7984e8..5bc630c61cb 100644 --- a/app/assets/javascripts/pages/shared/wikis/components/wiki_form.vue +++ b/app/assets/javascripts/pages/shared/wikis/components/wiki_form.vue @@ -15,8 +15,8 @@ import { setUrlFragment } from '~/lib/utils/url_utility'; import { s__, sprintf } from '~/locale'; import Tracking from '~/tracking'; import MarkdownEditor from '~/vue_shared/components/markdown/markdown_editor.vue'; +import { trackSavedUsingEditor } from '~/vue_shared/components/markdown/tracking'; import { - SAVED_USING_CONTENT_EDITOR_ACTION, WIKI_CONTENT_EDITOR_TRACKING_LABEL, WIKI_FORMAT_LABEL, WIKI_FORMAT_UPDATED_ACTION, @@ -257,9 +257,8 @@ export default { }, trackFormSubmit() { - if (this.isContentEditorActive) { - this.track(SAVED_USING_CONTENT_EDITOR_ACTION); - } + // eslint-disable-next-line @gitlab/require-i18n-strings + trackSavedUsingEditor(this.isContentEditorActive, 'Wiki'); }, trackWikiFormat() { diff --git a/app/assets/javascripts/pages/shared/wikis/constants.js b/app/assets/javascripts/pages/shared/wikis/constants.js index 94d086158f1..3e685292971 100644 --- a/app/assets/javascripts/pages/shared/wikis/constants.js +++ b/app/assets/javascripts/pages/shared/wikis/constants.js @@ -1,5 +1,4 @@ export const CONTENT_EDITOR_LOADED_ACTION = 'content_editor_loaded'; -export const SAVED_USING_CONTENT_EDITOR_ACTION = 'saved_using_content_editor'; export const WIKI_CONTENT_EDITOR_TRACKING_LABEL = 'wiki_content_editor'; export const WIKI_FORMAT_LABEL = 'wiki_format'; export const WIKI_FORMAT_UPDATED_ACTION = 'wiki_format_updated'; diff --git a/app/assets/javascripts/pages/shared/wikis/edit.js b/app/assets/javascripts/pages/shared/wikis/edit.js index 0044575de62..a0a7cc0b07a 100644 --- a/app/assets/javascripts/pages/shared/wikis/edit.js +++ b/app/assets/javascripts/pages/shared/wikis/edit.js @@ -1,5 +1,7 @@ import $ from 'jquery'; import Vue from 'vue'; +import VueApollo from 'vue-apollo'; +import createApolloClient from '~/lib/graphql'; import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils'; import csrf from '~/lib/utils/csrf'; import Translate from '~/vue_shared/translate'; @@ -64,9 +66,14 @@ const createWikiFormApp = () => { if (el) { const { pageInfo, formatOptions } = el.dataset; + Vue.use(VueApollo); + + const apolloProvider = new VueApollo({ defaultClient: createApolloClient() }); + // eslint-disable-next-line no-new new Vue({ el, + apolloProvider, provide: { formatOptions: JSON.parse(formatOptions), pageInfo: convertObjectPropsToCamelCase(JSON.parse(pageInfo)), |