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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
1c529171
Commit
1c529171
authored
Dec 08, 2016
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace commit icon svg logic
parent
70cb2792
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
20 deletions
+8
-20
app/assets/javascripts/environments/components/environment_item.js.es6
...vascripts/environments/components/environment_item.js.es6
+2
-1
app/assets/javascripts/vue_common_component/commit.js.es6
app/assets/javascripts/vue_common_component/commit.js.es6
+6
-19
No files found.
app/assets/javascripts/environments/components/environment_item.js.es6
View file @
1c529171
...
...
@@ -465,7 +465,8 @@
:commit_url="commitUrl"
:short_sha="commitShortSha"
:title="commitTitle"
:author="commitAuthor">
:author="commitAuthor"
:commit-icon-svg="commitIconSvg">
</commit-component>
</div>
<p v-if="!isFolder && !hasLastDeploymentKey" class="commit-title">
...
...
app/assets/javascripts/vue_common_component/commit.js.es6
View file @
1c529171
...
...
@@ -68,6 +68,11 @@
required: false,
default: () => ({}),
},
commitIconSvg: {
type: String,
required: false,
},
},
computed: {
...
...
@@ -110,24 +115,6 @@
},
},
/**
* In order to reuse the svg instead of copy and paste in this template
* we need to render it outside this component using =custom_icon partial.
* Make sure it has this structure:
* .commit-icon-svg.hidden
* svg
*
* TODO: Find a better way to include SVG
*/
mounted() {
const commitIconContainer = this.$el.querySelector('.commit-icon-container');
const commitIcon = document.querySelector('.commit-icon-svg.hidden svg');
if (commitIconContainer && commitIcon) {
commitIconContainer.appendChild(commitIcon.cloneNode(true));
}
},
template: `
<div class="branch-commit">
...
...
@@ -142,7 +129,7 @@
{{commit_ref.name}}
</a>
<div
class="icon-container commit-icon commit-icon-container
"></div>
<div
v-html="commitIconSvg" class="commit-icon
"></div>
<a class="commit-id monospace"
:href="commit_url">
...
...
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