diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-02 18:16:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-02 18:16:07 +0300 |
commit | f38683df1f619b2a1960e1415b9326354a4b5327 (patch) | |
tree | 23d469a81d3d1866a2ab71ba406aa84cd954f99a /app/assets/javascripts/repository | |
parent | 5bc7c18ad37cde0ffdf1aa4ba2cee27c92ec69f6 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/repository')
4 files changed, 16 insertions, 0 deletions
diff --git a/app/assets/javascripts/repository/components/blob_content_viewer.vue b/app/assets/javascripts/repository/components/blob_content_viewer.vue index 799c4affa52..3fdc45b4e3d 100644 --- a/app/assets/javascripts/repository/components/blob_content_viewer.vue +++ b/app/assets/javascripts/repository/components/blob_content_viewer.vue @@ -11,6 +11,7 @@ import { __ } from '~/locale'; import { redirectTo } from '~/lib/utils/url_utility'; import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; import WebIdeLink from '~/vue_shared/components/web_ide_link.vue'; +import CodeIntelligence from '~/code_navigation/components/app.vue'; import getRefMixin from '../mixins/get_ref'; import blobInfoQuery from '../queries/blob_info.query.graphql'; import { DEFAULT_BLOB_INFO, TEXT_FILE_TYPE, LFS_STORAGE } from '../constants'; @@ -30,6 +31,7 @@ export default { GlButton, ForkSuggestion, WebIdeLink, + CodeIntelligence, }, mixins: [getRefMixin, glFeatureFlagMixin()], inject: { @@ -274,6 +276,12 @@ export default { :loading="isLoadingLegacyViewer" /> <component :is="blobViewer" v-else :blob="blobInfo" class="blob-viewer" /> + <code-intelligence + v-if="blobViewer || legacyViewerLoaded" + :code-navigation-path="blobInfo.codeNavigationPath" + :blob-path="blobInfo.path" + :path-prefix="blobInfo.projectBlobPathRoot" + /> </div> </div> </template> diff --git a/app/assets/javascripts/repository/constants.js b/app/assets/javascripts/repository/constants.js index aa2f2fa8f11..d71f23c57dd 100644 --- a/app/assets/javascripts/repository/constants.js +++ b/app/assets/javascripts/repository/constants.js @@ -52,6 +52,8 @@ export const DEFAULT_BLOB_INFO = { ideEditPath: '', forkAndEditPath: '', ideForkAndEditPath: '', + codeNavigationPath: '', + projectBlobPathRoot: '', forkAndViewPath: '', storedExternally: false, externalStorage: '', diff --git a/app/assets/javascripts/repository/index.js b/app/assets/javascripts/repository/index.js index 120c32caefd..b38a1cfdc7b 100644 --- a/app/assets/javascripts/repository/index.js +++ b/app/assets/javascripts/repository/index.js @@ -1,10 +1,12 @@ import { GlButton } from '@gitlab/ui'; import Vue from 'vue'; +import Vuex from 'vuex'; import { parseBoolean } from '~/lib/utils/common_utils'; import { escapeFileUrl } from '~/lib/utils/url_utility'; import { __ } from '~/locale'; import initWebIdeLink from '~/pages/projects/shared/web_ide_link'; import PerformancePlugin from '~/performance/vue_performance_plugin'; +import createStore from '~/code_navigation/store'; import App from './components/app.vue'; import Breadcrumbs from './components/breadcrumbs.vue'; import DirectoryDownloadLinks from './components/directory_download_links.vue'; @@ -19,6 +21,7 @@ import createRouter from './router'; import { updateFormAction } from './utils/dom'; import { setTitle } from './utils/title'; +Vue.use(Vuex); Vue.use(PerformancePlugin, { components: ['SimpleViewer', 'BlobContent'], }); @@ -200,6 +203,7 @@ export default function setupVueRepositoryList() { // eslint-disable-next-line no-new new Vue({ el, + store: createStore(), router, apolloProvider, render(h) { diff --git a/app/assets/javascripts/repository/queries/blob_info.query.graphql b/app/assets/javascripts/repository/queries/blob_info.query.graphql index 14d7f903e75..389c3715586 100644 --- a/app/assets/javascripts/repository/queries/blob_info.query.graphql +++ b/app/assets/javascripts/repository/queries/blob_info.query.graphql @@ -31,6 +31,8 @@ query getBlobInfo( ideEditPath forkAndEditPath ideForkAndEditPath + codeNavigationPath + projectBlobPathRoot forkAndViewPath environmentFormattedExternalUrl environmentExternalUrlForRouteMap |