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 { ...@@ -81,7 +81,7 @@ export default {
</blob-filepath> </blob-filepath>
</div> </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" /> <viewer-switcher v-if="showViewerSwitcher" v-model="viewer" />
<slot name="actions"></slot> <slot name="actions"></slot>
......
...@@ -3,6 +3,7 @@ import { GlButton } from '@gitlab/ui'; ...@@ -3,6 +3,7 @@ import { GlButton } from '@gitlab/ui';
import { __ } from '~/locale'; import { __ } from '~/locale';
import createFlash from '~/flash'; import createFlash from '~/flash';
import getRefMixin from '~/repository/mixins/get_ref'; import getRefMixin from '~/repository/mixins/get_ref';
import initSourcegraph from '~/sourcegraph';
import { updateElementsVisibility } from '../utils/dom'; import { updateElementsVisibility } from '../utils/dom';
import blobControlsQuery from '../queries/blob_controls.query.graphql'; import blobControlsQuery from '../queries/blob_controls.query.graphql';
...@@ -76,6 +77,9 @@ export default { ...@@ -76,6 +77,9 @@ export default {
showBlobControls(shouldShow) { showBlobControls(shouldShow) {
updateElementsVisibility('.tree-controls', !shouldShow); updateElementsVisibility('.tree-controls', !shouldShow);
}, },
blobInfo() {
initSourcegraph();
},
}, },
}; };
</script> </script>
...@@ -97,6 +101,7 @@ export default { ...@@ -97,6 +101,7 @@ export default {
data-testid="permalink" data-testid="permalink"
:href="blobInfo.permalinkPath" :href="blobInfo.permalinkPath"
:class="$options.buttonClassList" :class="$options.buttonClassList"
class="js-data-file-blob-permalink-url"
> >
{{ $options.i18n.permalink }} {{ $options.i18n.permalink }}
</gl-button> </gl-button>
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
import { GlSafeHtmlDirective } from '@gitlab/ui'; import { GlSafeHtmlDirective } from '@gitlab/ui';
import LineNumbers from '~/vue_shared/components/line_numbers.vue'; import LineNumbers from '~/vue_shared/components/line_numbers.vue';
import { sanitize } from '~/lib/dompurify'; import { sanitize } from '~/lib/dompurify';
import '~/sourcegraph/load';
const LINE_SELECT_CLASS_NAME = 'hll'; const LINE_SELECT_CLASS_NAME = 'hll';
......
...@@ -6,6 +6,7 @@ class Projects::TreeController < Projects::ApplicationController ...@@ -6,6 +6,7 @@ class Projects::TreeController < Projects::ApplicationController
include CreatesCommit include CreatesCommit
include ActionView::Helpers::SanitizeHelper include ActionView::Helpers::SanitizeHelper
include RedirectsForMissingPathOnTree include RedirectsForMissingPathOnTree
include SourcegraphDecorator
around_action :allow_gitaly_ref_name_caching, only: [:show] around_action :allow_gitaly_ref_name_caching, only: [:show]
......
...@@ -10,6 +10,7 @@ class ProjectsController < Projects::ApplicationController ...@@ -10,6 +10,7 @@ class ProjectsController < Projects::ApplicationController
include ImportUrlParams include ImportUrlParams
include FiltersEvents include FiltersEvents
include WorkItemsHierarchy include WorkItemsHierarchy
include SourcegraphDecorator
prepend_before_action(only: [:show]) { authenticate_sessionless_user!(:rss) } prepend_before_action(only: [:show]) { authenticate_sessionless_user!(:rss) }
......
...@@ -17,7 +17,7 @@ exports[`Blob Header Default Actions rendering matches the snapshot 1`] = ` ...@@ -17,7 +17,7 @@ exports[`Blob Header Default Actions rendering matches the snapshot 1`] = `
</div> </div>
<div <div
class="gl-display-none gl-sm-display-flex" class="gl-display-none gl-sm-display-flex file-actions"
> >
<viewer-switcher-stub <viewer-switcher-stub
value="simple" 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