From 56aa01235857d6ec16aab391b2d08230001f9699 Mon Sep 17 00:00:00 2001 From: Denys Mishunov Date: Tue, 28 Mar 2023 23:22:43 +0200 Subject: [PATCH] In-line editing MVC draft --- .../source_viewer/components/chunk_deprecated.vue | 5 +++++ .../components/source_viewer/components/chunk_line.vue | 8 ++++++++ .../components/source_viewer/source_viewer_deprecated.vue | 2 ++ app/assets/stylesheets/highlight/themes/dark.scss | 4 ++++ app/assets/stylesheets/highlight/themes/monokai.scss | 4 ++++ app/assets/stylesheets/highlight/themes/none.scss | 4 ++++ .../stylesheets/highlight/themes/solarized-dark.scss | 7 +++++++ .../stylesheets/highlight/themes/solarized-light.scss | 4 ++++ 8 files changed, 38 insertions(+) diff --git a/app/assets/javascripts/vue_shared/components/source_viewer/components/chunk_deprecated.vue b/app/assets/javascripts/vue_shared/components/source_viewer/components/chunk_deprecated.vue index 28a16cd846a2da..1071ed2ba0f3e5 100644 --- a/app/assets/javascripts/vue_shared/components/source_viewer/components/chunk_deprecated.vue +++ b/app/assets/javascripts/vue_shared/components/source_viewer/components/chunk_deprecated.vue @@ -63,6 +63,10 @@ export default { type: String, required: true, }, + editPath: { + type: String, + required: true, + }, }, data() { return { @@ -114,6 +118,7 @@ export default { :content="line" :language="language" :blame-path="blamePath" + :edit-path="editPath" />
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 1690e666d3c4c8..4f87e025963d8f 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 @@ -23,6 +23,10 @@ export default { type: String, required: true, }, + editPath: { + type: String, + required: true, + }, }, computed: { pageSearchString() { @@ -41,6 +45,10 @@ export default { class="gl-user-select-none gl-shadow-none! file-line-blame" :href="`${blamePath}${pageSearchString}#L${number}`" > + @@ -220,6 +221,7 @@ export default { :chunk-index="index" :language="chunk.language" :blame-path="blob.blamePath" + :edit-path="blob.editBlobPath" :total-chunks="totalChunks" @appear="highlightChunk" /> diff --git a/app/assets/stylesheets/highlight/themes/dark.scss b/app/assets/stylesheets/highlight/themes/dark.scss index 02469cf5165d37..74c33d968fb742 100644 --- a/app/assets/stylesheets/highlight/themes/dark.scss +++ b/app/assets/stylesheets/highlight/themes/dark.scss @@ -142,6 +142,10 @@ $dark-il: #de935f; @include line-link($white, 'git'); } + .file-line-edit { + @include line-link($white, 'pencil'); + } + .line-links { @include line-hover-bg($dark-main-bg); } diff --git a/app/assets/stylesheets/highlight/themes/monokai.scss b/app/assets/stylesheets/highlight/themes/monokai.scss index 30d04b4002eff5..a8d229ffca1edf 100644 --- a/app/assets/stylesheets/highlight/themes/monokai.scss +++ b/app/assets/stylesheets/highlight/themes/monokai.scss @@ -133,6 +133,10 @@ $monokai-gh: #75715e; @include line-link($white, 'git'); } + .file-line-edit { + @include line-link($white, 'pencil'); + } + .line-links { @include line-hover-bg($monokai-bg); } diff --git a/app/assets/stylesheets/highlight/themes/none.scss b/app/assets/stylesheets/highlight/themes/none.scss index 8339d7eff80a82..4221ee5546eded 100644 --- a/app/assets/stylesheets/highlight/themes/none.scss +++ b/app/assets/stylesheets/highlight/themes/none.scss @@ -32,6 +32,10 @@ @include line-link($black, 'git'); } + .file-line-edit { + @include line-link($black, 'pencil'); + } + .line-links { @include line-hover-bg; } diff --git a/app/assets/stylesheets/highlight/themes/solarized-dark.scss b/app/assets/stylesheets/highlight/themes/solarized-dark.scss index 075510e6e5f0f2..b291957ef4c4a3 100644 --- a/app/assets/stylesheets/highlight/themes/solarized-dark.scss +++ b/app/assets/stylesheets/highlight/themes/solarized-dark.scss @@ -127,6 +127,9 @@ $solarized-dark-il: #2aa198; @include hljs-override('title\\.function', $solarized-dark-nf); @include hljs-override('params', $solarized-dark-nb); + .file-line-action { + + } // Line numbers .file-line-num { @include line-link($white, 'link'); @@ -136,6 +139,10 @@ $solarized-dark-il: #2aa198; @include line-link($white, 'git'); } + .file-line-edit { + @include line-link($white, 'pencil'); + } + .line-links { @include line-hover-bg($solarized-dark-pre-bg); } diff --git a/app/assets/stylesheets/highlight/themes/solarized-light.scss b/app/assets/stylesheets/highlight/themes/solarized-light.scss index 4e244ed7420b3e..a94601cb78fa51 100644 --- a/app/assets/stylesheets/highlight/themes/solarized-light.scss +++ b/app/assets/stylesheets/highlight/themes/solarized-light.scss @@ -126,6 +126,10 @@ $solarized-light-il: #2aa198; @include line-link($black, 'git'); } + .file-line-edit { + @include line-link($black, 'pencil'); + } + .line-links { @include line-hover-bg($solarized-light-pre-bg); } -- GitLab