Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
5e046fe6
Commit
5e046fe6
authored
Apr 07, 2021
by
Paul Gascou-Vaillancourt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move code snippet logic to a method
parent
9e7db23c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
app/assets/javascripts/pipeline_editor/pipeline_editor_app.vue
...ssets/javascripts/pipeline_editor/pipeline_editor_app.vue
+12
-9
No files found.
app/assets/javascripts/pipeline_editor/pipeline_editor_app.vue
View file @
5e046fe6
...
...
@@ -197,15 +197,7 @@ export default {
},
},
created
()
{
const
[
codeSnippetCopiedFrom
]
=
getParameterValues
(
CODE_SNIPPET_SOURCE_URL_PARAM
);
if
(
codeSnippetCopiedFrom
&&
CODE_SNIPPET_SOURCES
.
includes
(
codeSnippetCopiedFrom
))
{
this
.
codeSnippetCopiedFrom
=
codeSnippetCopiedFrom
;
window
.
history
.
replaceState
(
{},
document
.
title
,
removeParams
([
CODE_SNIPPET_SOURCE_URL_PARAM
]),
);
}
this
.
parseCodeSnippetSourceParam
();
},
methods
:
{
handleBlobContentError
(
error
=
{})
{
...
...
@@ -274,6 +266,17 @@ export default {
// if the user has made changes to the file that are unsaved.
this
.
lastCommittedContent
=
this
.
currentCiFileContent
;
},
parseCodeSnippetSourceParam
()
{
const
[
codeSnippetCopiedFrom
]
=
getParameterValues
(
CODE_SNIPPET_SOURCE_URL_PARAM
);
if
(
codeSnippetCopiedFrom
&&
CODE_SNIPPET_SOURCES
.
includes
(
codeSnippetCopiedFrom
))
{
this
.
codeSnippetCopiedFrom
=
codeSnippetCopiedFrom
;
window
.
history
.
replaceState
(
{},
document
.
title
,
removeParams
([
CODE_SNIPPET_SOURCE_URL_PARAM
]),
);
}
},
},
};
</
script
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment