Commit ebb81c6f authored by Jacques's avatar Jacques

Fix sourcegraph integration

Add missing decorator + selectors to fix sourcegraoh ingtegration
parent 4f1e3e52
......@@ -81,7 +81,7 @@ export default {
</blob-filepath>
</div>
<div class="gl-display-none gl-sm-display-flex">
<div class="gl-display-none gl-sm-display-flex file-actions">
<viewer-switcher v-if="showViewerSwitcher" v-model="viewer" />
<slot name="actions"></slot>
......
......@@ -3,6 +3,7 @@ import { GlButton } from '@gitlab/ui';
import { __ } from '~/locale';
import createFlash from '~/flash';
import getRefMixin from '~/repository/mixins/get_ref';
import initSourcegraph from '~/sourcegraph';
import { updateElementsVisibility } from '../utils/dom';
import blobControlsQuery from '../queries/blob_controls.query.graphql';
......@@ -76,6 +77,9 @@ export default {
showBlobControls(shouldShow) {
updateElementsVisibility('.tree-controls', !shouldShow);
},
blobInfo() {
initSourcegraph();
},
},
};
</script>
......@@ -97,6 +101,7 @@ export default {
data-testid="permalink"
:href="blobInfo.permalinkPath"
:class="$options.buttonClassList"
class="js-data-file-blob-permalink-url"
>
{{ $options.i18n.permalink }}
</gl-button>
......
......@@ -2,7 +2,6 @@
import { GlSafeHtmlDirective } from '@gitlab/ui';
import LineNumbers from '~/vue_shared/components/line_numbers.vue';
import { sanitize } from '~/lib/dompurify';
import '~/sourcegraph/load';
const LINE_SELECT_CLASS_NAME = 'hll';
......
......@@ -6,6 +6,7 @@ class Projects::TreeController < Projects::ApplicationController
include CreatesCommit
include ActionView::Helpers::SanitizeHelper
include RedirectsForMissingPathOnTree
include SourcegraphDecorator
around_action :allow_gitaly_ref_name_caching, only: [:show]
......
......@@ -10,6 +10,7 @@ class ProjectsController < Projects::ApplicationController
include ImportUrlParams
include FiltersEvents
include WorkItemsHierarchy
include SourcegraphDecorator
prepend_before_action(only: [:show]) { authenticate_sessionless_user!(:rss) }
......
......@@ -17,7 +17,7 @@ exports[`Blob Header Default Actions rendering matches the snapshot 1`] = `
</div>
<div
class="gl-display-none gl-sm-display-flex"
class="gl-display-none gl-sm-display-flex file-actions"
>
<viewer-switcher-stub
value="simple"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment