From adab8b775eec561f267809de16b12e4d56c6ec93 Mon Sep 17 00:00:00 2001 From: Marco Zille Date: Tue, 5 Jul 2022 14:54:17 +0200 Subject: [PATCH 1/7] Added support for links to markdown file code lines Changelog: added --- .../repository/components/blob_content_viewer.vue | 11 ++++++++++- .../source_viewer/components/chunk_line.vue | 11 ++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/repository/components/blob_content_viewer.vue b/app/assets/javascripts/repository/components/blob_content_viewer.vue index f6d370fb45035a..3976e395f213f8 100644 --- a/app/assets/javascripts/repository/components/blob_content_viewer.vue +++ b/app/assets/javascripts/repository/components/blob_content_viewer.vue @@ -63,7 +63,9 @@ export default { }; }, result() { - this.switchViewer(this.hasRichViewer ? RICH_BLOB_VIEWER : SIMPLE_BLOB_VIEWER); + if (this.$route?.query?.plain !== '1') { + this.switchViewer(this.hasRichViewer ? RICH_BLOB_VIEWER : SIMPLE_BLOB_VIEWER); + } }, error() { this.displayError(); @@ -222,6 +224,13 @@ export default { if (!this.blobViewer) { this.loadLegacyViewer(); } + + if (this.$router && this.$route?.path) { + this.$router.push({ + path: this.$route.path, + query: { plain: this.activeViewerType === SIMPLE_BLOB_VIEWER ? '1' : '0' }, + }); + } }, editBlob(target) { if (this.showForkSuggestion) { diff --git a/app/assets/javascripts/vue_shared/components/source_viewer/components/chunk_line.vue b/app/assets/javascripts/vue_shared/components/source_viewer/components/chunk_line.vue index 7b62f0cdb7dcd3..f296bb967796c6 100644 --- a/app/assets/javascripts/vue_shared/components/source_viewer/components/chunk_line.vue +++ b/app/assets/javascripts/vue_shared/components/source_viewer/components/chunk_line.vue @@ -1,12 +1,9 @@