Commit 9b0309db authored by Sean McGivern's avatar Sean McGivern

Merge branch 'dm-consistent-commit-sha-style' into 'master'

Consistently use monospace font for commit SHAs and branch and tag names

See merge request !11276
parents c23bc263 ff82acf3
...@@ -33,7 +33,7 @@ global.cycleAnalytics.StagePlanComponent = Vue.extend({ ...@@ -33,7 +33,7 @@ global.cycleAnalytics.StagePlanComponent = Vue.extend({
<span> <span>
{{ __('FirstPushedBy|First') }} {{ __('FirstPushedBy|First') }}
<span class="commit-icon">${iconCommit}</span> <span class="commit-icon">${iconCommit}</span>
<a :href="commit.commitUrl" class="commit-hash-link monospace">{{ commit.shortSha }}</a> <a :href="commit.commitUrl" class="commit-hash-link commit-sha">{{ commit.shortSha }}</a>
{{ __('FirstPushedBy|pushed by') }} {{ __('FirstPushedBy|pushed by') }}
<a :href="commit.author.webUrl" class="commit-author-link"> <a :href="commit.author.webUrl" class="commit-author-link">
{{ commit.author.name }} {{ commit.author.name }}
......
...@@ -26,9 +26,9 @@ global.cycleAnalytics.StageStagingComponent = Vue.extend({ ...@@ -26,9 +26,9 @@ global.cycleAnalytics.StageStagingComponent = Vue.extend({
<h5 class="item-title"> <h5 class="item-title">
<a :href="build.url" class="pipeline-id">#{{ build.id }}</a> <a :href="build.url" class="pipeline-id">#{{ build.id }}</a>
<i class="fa fa-code-fork"></i> <i class="fa fa-code-fork"></i>
<a :href="build.branch.url" class="branch-name monospace">{{ build.branch.name }}</a> <a :href="build.branch.url" class="ref-name">{{ build.branch.name }}</a>
<span class="icon-branch">${iconBranch}</span> <span class="icon-branch">${iconBranch}</span>
<a :href="build.commitUrl" class="short-sha monospace">{{ build.shortSha }}</a> <a :href="build.commitUrl" class="commit-sha">{{ build.shortSha }}</a>
</h5> </h5>
<span> <span>
<a :href="build.url" class="build-date">{{ build.date }}</a> <a :href="build.url" class="build-date">{{ build.date }}</a>
......
...@@ -29,9 +29,9 @@ global.cycleAnalytics.StageTestComponent = Vue.extend({ ...@@ -29,9 +29,9 @@ global.cycleAnalytics.StageTestComponent = Vue.extend({
&middot; &middot;
<a :href="build.url" class="pipeline-id">#{{ build.id }}</a> <a :href="build.url" class="pipeline-id">#{{ build.id }}</a>
<i class="fa fa-code-fork"></i> <i class="fa fa-code-fork"></i>
<a :href="build.branch.url" class="branch-name monospace">{{ build.branch.name }}</a> <a :href="build.branch.url" class="ref-name">{{ build.branch.name }}</a>
<span class="icon-branch">${iconBranch}</span> <span class="icon-branch">${iconBranch}</span>
<a :href="build.commitUrl" class="short-sha monospace">{{ build.shortSha }}</a> <a :href="build.commitUrl" class="commit-sha">{{ build.shortSha }}</a>
</h5> </h5>
<span> <span>
<a :href="build.url" class="issue-date"> <a :href="build.url" class="issue-date">
......
...@@ -29,7 +29,7 @@ export default { ...@@ -29,7 +29,7 @@ export default {
</a> </a>
<span <span
v-if="!user" v-if="!user"
class="js-pipeline-url-api api monospace"> class="js-pipeline-url-api api">
API API
</span> </span>
<span <span
......
...@@ -61,7 +61,8 @@ export default { ...@@ -61,7 +61,8 @@ export default {
</span> </span>
</div> </div>
<div class="normal"> <div class="normal">
<b>Request to merge</b> <strong>
Request to merge
<span <span
class="label-branch" class="label-branch"
:class="{'label-truncated has-tooltip': isBranchTitleLong(mr.sourceBranch)}" :class="{'label-truncated has-tooltip': isBranchTitleLong(mr.sourceBranch)}"
...@@ -76,7 +77,7 @@ export default { ...@@ -76,7 +77,7 @@ export default {
aria-hidden="true" aria-hidden="true"
class="fa fa-clipboard"></i> class="fa fa-clipboard"></i>
</button> </button>
<b>into</b> into
<span <span
class="label-branch" class="label-branch"
:class="{'label-truncated has-tooltip': isBranchTitleLong(mr.targetBranch)}" :class="{'label-truncated has-tooltip': isBranchTitleLong(mr.targetBranch)}"
...@@ -87,6 +88,7 @@ export default { ...@@ -87,6 +88,7 @@ export default {
{{mr.targetBranch}} {{mr.targetBranch}}
</a> </a>
</span> </span>
</strong>
<span <span
v-if="shouldShowCommitsBehindText" v-if="shouldShowCommitsBehindText"
class="diverged-commits-count"> class="diverged-commits-count">
......
...@@ -54,6 +54,9 @@ export default { ...@@ -54,6 +54,9 @@ export default {
:href="mr.pipeline.path" :href="mr.pipeline.path"
class="pipeline-id">#{{mr.pipeline.id}}</a> class="pipeline-id">#{{mr.pipeline.id}}</a>
{{mr.pipeline.details.status.label}} {{mr.pipeline.details.status.label}}
</span>
<span
v-if="mr.pipeline.details.stages.length > 0">
with {{stageText}} with {{stageText}}
</span> </span>
<div class="mr-widget-pipeline-graph"> <div class="mr-widget-pipeline-graph">
...@@ -70,7 +73,7 @@ export default { ...@@ -70,7 +73,7 @@ export default {
for for
<a <a
:href="mr.pipeline.commit.commit_path" :href="mr.pipeline.commit.commit_path"
class="monospace js-commit-link"> class="commit-sha js-commit-link">
{{mr.pipeline.commit.short_id}}</a>. {{mr.pipeline.commit.short_id}}</a>.
</span> </span>
<span <span
......
...@@ -119,14 +119,14 @@ export default { ...@@ -119,14 +119,14 @@ export default {
</div> </div>
<a v-if="hasCommitRef" <a v-if="hasCommitRef"
class="monospace branch-name" class="ref-name"
:href="commitRef.ref_url"> :href="commitRef.ref_url">
{{commitRef.name}} {{commitRef.name}}
</a> </a>
<div v-html="commitIconSvg" class="commit-icon js-commit-icon"></div> <div v-html="commitIconSvg" class="commit-icon js-commit-icon"></div>
<a class="commit-id monospace" <a class="commit-sha"
:href="commitUrl"> :href="commitUrl">
{{shortSha}} {{shortSha}}
</a> </a>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* Styles that apply to all GFM related forms. * Styles that apply to all GFM related forms.
*/ */
.gfm-commit,
.gfm-commit_range { .gfm-commit_range {
font-family: $monospace_font; @extend .commit-sha;
font-size: 90%;
} }
...@@ -289,11 +289,6 @@ pre { ...@@ -289,11 +289,6 @@ pre {
} }
} }
.monospace {
font-family: $monospace_font;
font-size: 90%;
}
code { code {
&.key-fingerprint { &.key-fingerprint {
background: $body-bg; background: $body-bg;
...@@ -305,6 +300,24 @@ a > code { ...@@ -305,6 +300,24 @@ a > code {
color: $link-color; color: $link-color;
} }
.monospace {
font-family: $monospace_font;
}
.commit-sha,
.ref-name {
@extend .monospace;
font-size: 95%;
}
.git-revision-dropdown-toggle {
@extend .monospace;
}
.git-revision-dropdown .dropdown-content ul li a {
@extend .ref-name;
}
/** /**
* Apply Markdown typography * Apply Markdown typography
* *
......
...@@ -12,10 +12,14 @@ ...@@ -12,10 +12,14 @@
} }
&.branch-info { &.branch-info {
.monospace, .commit-sha,
.commit-info { .commit-info {
margin-left: 4px; margin-left: 4px;
} }
.ref-name {
font-size: 12px;
}
} }
} }
......
...@@ -206,11 +206,11 @@ ...@@ -206,11 +206,11 @@
margin-left: $gl-padding; margin-left: $gl-padding;
} }
} }
}
.commit-short-id { .commit-sha {
font-family: $monospace_font; font-size: 14px;
font-weight: 600; font-weight: 600;
}
} }
.commit, .commit,
...@@ -271,7 +271,7 @@ ...@@ -271,7 +271,7 @@
} }
} }
.commit-id { .commit-sha {
color: $gl-link-color; color: $gl-link-color;
} }
......
...@@ -387,7 +387,7 @@ ...@@ -387,7 +387,7 @@
padding: 0 3px 0 0; padding: 0 3px 0 0;
} }
.branch-name { .ref-name {
color: $black; color: $black;
display: inline-block; display: inline-block;
max-width: 180px; max-width: 180px;
...@@ -398,7 +398,7 @@ ...@@ -398,7 +398,7 @@
vertical-align: top; vertical-align: top;
} }
.short-sha { .commit-sha {
color: $gl-link-color; color: $gl-link-color;
line-height: 1.3; line-height: 1.3;
vertical-align: top; vertical-align: top;
......
...@@ -2,11 +2,6 @@ ...@@ -2,11 +2,6 @@
.diff-file { .diff-file {
margin-bottom: $gl-padding; margin-bottom: $gl-padding;
.commit-short-id {
font-family: $regular_font;
font-weight: 400;
}
.file-title, .file-title,
.file-title-flex-parent { .file-title-flex-parent {
cursor: pointer; cursor: pointer;
......
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
} }
.build-link, .build-link,
.branch-name { .ref-name {
color: $gl-text-color; color: $gl-text-color;
} }
...@@ -135,7 +135,7 @@ ...@@ -135,7 +135,7 @@
} }
.branch-commit { .branch-commit {
.commit-id { .commit-sha {
margin-right: 0; margin-right: 0;
} }
} }
......
...@@ -156,6 +156,34 @@ ...@@ -156,6 +156,34 @@
text-transform: capitalize; text-transform: capitalize;
} }
.label-branch {
@extend .ref-name;
color: $gl-text-color;
font-weight: bold;
overflow: hidden;
margin: 0 3px;
word-break: break-all;
&.label-truncated {
position: relative;
display: inline-block;
width: 250px;
margin-bottom: -3px;
white-space: nowrap;
text-overflow: clip;
line-height: 14px;
&::after {
position: absolute;
content: '...';
right: 0;
font-family: $regular_font;
background-color: $gray-light;
}
}
}
.js-deployment-link { .js-deployment-link {
display: inline-block; display: inline-block;
} }
...@@ -355,34 +383,6 @@ ...@@ -355,34 +383,6 @@
} }
} }
.label-branch {
color: $gl-text-color;
font-family: $monospace_font;
font-weight: bold;
overflow: hidden;
font-size: 90%;
margin: 0 3px;
word-break: break-all;
&.label-truncated {
position: relative;
display: inline-block;
width: 250px;
margin-bottom: -3px;
white-space: nowrap;
text-overflow: clip;
line-height: 14px;
&::after {
position: absolute;
content: '...';
right: 0;
font-family: $regular_font;
background-color: $gray-light;
}
}
}
.commits-empty { .commits-empty {
text-align: center; text-align: center;
......
...@@ -238,11 +238,6 @@ ul.notes { ...@@ -238,11 +238,6 @@ ul.notes {
ul { ul {
margin: 3px 0 3px 16px !important; margin: 3px 0 3px 16px !important;
.gfm-commit {
font-family: $monospace_font;
font-size: 12px;
}
} }
p:first-child { p:first-child {
......
...@@ -158,9 +158,13 @@ ...@@ -158,9 +158,13 @@
float: none; float: none;
} }
.api {
@extend .monospace;
}
.branch-commit { .branch-commit {
.branch-name { .ref-name {
font-weight: bold; font-weight: bold;
max-width: 120px; max-width: 120px;
overflow: hidden; overflow: hidden;
...@@ -182,7 +186,7 @@ ...@@ -182,7 +186,7 @@
color: $gl-text-color; color: $gl-text-color;
} }
.commit-id { .commit-sha {
color: $gl-link-color; color: $gl-link-color;
} }
......
...@@ -657,9 +657,8 @@ pre.light-well { ...@@ -657,9 +657,8 @@ pre.light-well {
color: $gl-text-color; color: $gl-text-color;
} }
.commit_short_id { .commit-sha {
margin-right: 5px; margin-right: 5px;
color: $gl-link-color;
font-weight: 600; font-weight: 600;
} }
...@@ -825,7 +824,8 @@ pre.light-well { ...@@ -825,7 +824,8 @@ pre.light-well {
} }
.compare-form-group { .compare-form-group {
.dropdown-menu { .dropdown-menu,
.inline-input-group {
width: 100%; width: 100%;
@media (min-width: $screen-sm-min) { @media (min-width: $screen-sm-min) {
...@@ -844,14 +844,6 @@ pre.light-well { ...@@ -844,14 +844,6 @@ pre.light-well {
width: auto; width: auto;
} }
} }
.inline-input-group {
width: 100%;
@media (min-width: $screen-sm-min) {
width: 250px;
}
}
} }
.clearable-input { .clearable-input {
......
...@@ -74,12 +74,8 @@ module CommitsHelper ...@@ -74,12 +74,8 @@ module CommitsHelper
# Returns the sorted alphabetically links to branches, separated by a comma # Returns the sorted alphabetically links to branches, separated by a comma
def commit_branches_links(project, branches) def commit_branches_links(project, branches)
branches.sort.map do |branch| branches.sort.map do |branch|
link_to( link_to(project_ref_path(project, branch), class: "label label-gray ref-name") do
namespace_project_tree_path(project.namespace, project, branch) icon('code-fork') + " #{branch}"
) do
content_tag :span, class: 'label label-gray' do
icon('code-fork') + ' ' + branch
end
end end
end.join(" ").html_safe end.join(" ").html_safe
end end
...@@ -88,13 +84,8 @@ module CommitsHelper ...@@ -88,13 +84,8 @@ module CommitsHelper
def commit_tags_links(project, tags) def commit_tags_links(project, tags)
sorted = VersionSorter.rsort(tags) sorted = VersionSorter.rsort(tags)
sorted.map do |tag| sorted.map do |tag|
link_to( link_to(project_ref_path(project, tag), class: "label label-gray ref-name") do
namespace_project_commits_path(project.namespace, project, icon('tag') + " #{tag}"
project.repository.find_tag(tag).name)
) do
content_tag :span, class: 'label label-gray' do
icon('tag') + ' ' + tag
end
end end
end.join(" ").html_safe end.join(" ").html_safe
end end
...@@ -198,8 +189,8 @@ module CommitsHelper ...@@ -198,8 +189,8 @@ module CommitsHelper
tree_join(commit_sha, diff_new_path)), tree_join(commit_sha, diff_new_path)),
class: 'btn view-file js-view-file' class: 'btn view-file js-view-file'
) do ) do
raw('View file @') + content_tag(:span, commit_sha[0..6], raw('View file @ ') + content_tag(:span, Commit.truncate_sha(commit_sha),
class: 'commit-short-id') class: 'commit-sha')
end end
end end
......
...@@ -98,7 +98,7 @@ module DiffHelper ...@@ -98,7 +98,7 @@ module DiffHelper
[ [
content_tag(:span, link_to(truncate(blob.name, length: 40), tree)), content_tag(:span, link_to(truncate(blob.name, length: 40), tree)),
'@', '@',
content_tag(:span, commit_id, class: 'monospace') content_tag(:span, commit_id, class: 'commit-sha')
].join(' ').html_safe ].join(' ').html_safe
end end
......
...@@ -164,9 +164,14 @@ module EventsHelper ...@@ -164,9 +164,14 @@ module EventsHelper
def event_note_title_html(event) def event_note_title_html(event)
if event.note_target if event.note_target
link_to(event_note_target_path(event), title: event.target_title, class: 'has-tooltip') do text = raw("#{event.note_target_type} ") +
"#{event.note_target_type} #{event.note_target_reference}" if event.commit_note?
content_tag(:span, event.note_target_reference, class: 'commit-sha')
else
event.note_target_reference
end end
link_to(text, event_note_target_path(event), title: event.target_title, class: 'has-tooltip')
else else
content_tag(:strong, '(deleted)') content_tag(:strong, '(deleted)')
end end
......
...@@ -54,6 +54,10 @@ module GitlabRoutingHelper ...@@ -54,6 +54,10 @@ module GitlabRoutingHelper
namespace_project_builds_path(project.namespace, project, *args) namespace_project_builds_path(project.namespace, project, *args)
end end
def project_ref_path(project, ref_name, *args)
namespace_project_commits_path(project.namespace, project, ref_name, *args)
end
def project_container_registry_path(project, *args) def project_container_registry_path(project, *args)
namespace_project_container_registry_index_path(project.namespace, project, *args) namespace_project_container_registry_index_path(project.namespace, project, *args)
end end
......
...@@ -24,10 +24,13 @@ module TodosHelper ...@@ -24,10 +24,13 @@ module TodosHelper
end end
def todo_target_link(todo) def todo_target_link(todo)
target = todo.target_type.titleize.downcase text = raw("#{todo.target_type.titleize.downcase} ") +
link_to "#{target} #{todo.target_reference}", todo_target_path(todo), if todo.for_commit?
class: 'has-tooltip', content_tag(:span, todo.target_reference, class: 'commit-sha')
title: todo.target.title else
todo.target_reference
end
link_to text, todo_target_path(todo), class: 'has-tooltip', title: todo.target.title
end end
def todo_target_path(todo) def todo_target_path(todo)
......
...@@ -35,7 +35,7 @@ module ChatMessage ...@@ -35,7 +35,7 @@ module ChatMessage
def activity def activity
{ {
title: "Pipeline #{pipeline_link} of #{branch_link} #{ref_type} by #{user_name} #{humanized_status}", title: "Pipeline #{pipeline_link} of #{ref_type} #{branch_link} by #{user_name} #{humanized_status}",
subtitle: "in #{project_link}", subtitle: "in #{project_link}",
text: "in #{pretty_duration(duration)}", text: "in #{pretty_duration(duration)}",
image: user_avatar || '' image: user_avatar || ''
...@@ -45,7 +45,7 @@ module ChatMessage ...@@ -45,7 +45,7 @@ module ChatMessage
private private
def message def message
"#{project_link}: Pipeline #{pipeline_link} of #{branch_link} #{ref_type} by #{user_name} #{humanized_status} in #{pretty_duration(duration)}" "#{project_link}: Pipeline #{pipeline_link} of #{ref_type} #{branch_link} by #{user_name} #{humanized_status} in #{pretty_duration(duration)}"
end end
def humanized_status def humanized_status
...@@ -70,7 +70,7 @@ module ChatMessage ...@@ -70,7 +70,7 @@ module ChatMessage
end end
def branch_link def branch_link
"[#{ref}](#{branch_url})" "`[#{ref}](#{branch_url})`"
end end
def project_link def project_link
......
...@@ -61,7 +61,7 @@ module ChatMessage ...@@ -61,7 +61,7 @@ module ChatMessage
end end
def removed_branch_message def removed_branch_message
"#{user_name} removed #{ref_type} #{ref} from #{project_link}" "#{user_name} removed #{ref_type} `#{ref}` from #{project_link}"
end end
def push_message def push_message
...@@ -102,7 +102,7 @@ module ChatMessage ...@@ -102,7 +102,7 @@ module ChatMessage
end end
def branch_link def branch_link
"[#{ref}](#{branch_url})" "`[#{ref}](#{branch_url})`"
end end
def project_link def project_link
......
...@@ -38,10 +38,7 @@ class PipelineEntity < Grape::Entity ...@@ -38,10 +38,7 @@ class PipelineEntity < Grape::Entity
expose :path do |pipeline| expose :path do |pipeline|
if pipeline.ref if pipeline.ref
namespace_project_tree_path( project_ref_path(pipeline.project, pipeline.ref)
pipeline.project.namespace,
pipeline.project,
id: pipeline.ref)
end end
end end
......
...@@ -3,6 +3,7 @@ module RequestAwareEntity ...@@ -3,6 +3,7 @@ module RequestAwareEntity
included do included do
include Gitlab::Routing include Gitlab::Routing
include GitlabRoutingHelper
include Gitlab::Allowable include Gitlab::Allowable
end end
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
- commit = discussion.noteable - commit = discussion.noteable
- if commit - if commit
commit commit
= link_to commit.short_id, url, class: 'monospace' = link_to commit.short_id, url, class: 'commit-sha'
- else - else
a deleted commit a deleted commit
- elsif discussion.diff_discussion? - elsif discussion.diff_discussion?
......
%li.commit %li.commit
.commit-row-title .commit-row-title
= link_to truncate_sha(commit[:id]), namespace_project_commit_path(project.namespace, project, commit[:id]), class: "commit_short_id", alt: '', title: truncate_sha(commit[:id]) = link_to truncate_sha(commit[:id]), namespace_project_commit_path(project.namespace, project, commit[:id]), class: "commit-sha", alt: '', title: truncate_sha(commit[:id])
&middot; &middot;
= markdown event_commit_title(commit[:message]), project: project, pipeline: :single_line, author: event.author = markdown event_commit_title(commit[:message]), project: project, pipeline: :single_line, author: event.author
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
= ci_icon_for_status(status) = ci_icon_for_status(status)
= ci_text_for_status(status) = ci_text_for_status(status)
= link_to commit.short_id, namespace_project_commit_path(project.namespace, project, commit), class: "commit_short_id" = link_to commit.short_id, namespace_project_commit_path(project.namespace, project, commit), class: "commit-sha"
= link_to_gfm commit.title, namespace_project_commit_path(project.namespace, project, commit), class: "commit-row-message" = link_to_gfm commit.title, namespace_project_commit_path(project.namespace, project, commit), class: "commit-row-message"
&middot; &middot;
#{time_ago_with_tooltip(commit.committed_date)} by #{time_ago_with_tooltip(commit.committed_date)} by
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
.event-last-push .event-last-push
.event-last-push-text .event-last-push-text
%span You pushed to %span You pushed to
= link_to namespace_project_commits_path(event.project.namespace, event.project, event.ref_name) do = link_to namespace_project_commits_path(event.project.namespace, event.project, event.ref_name, class: 'commit-sha') do
%strong= event.ref_name %strong= event.ref_name
- if @project && event.project != @project - if @project && event.project != @project
%span at %span at
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
%strong %strong
= link_to_gfm truncate(commit.title, length: 35), namespace_project_commit_path(@project.namespace, @project, commit.id), class: "cdark" = link_to_gfm truncate(commit.title, length: 35), namespace_project_commit_path(@project.namespace, @project, commit.id), class: "cdark"
.pull-right .pull-right
= link_to commit.short_id, namespace_project_commit_path(@project.namespace, @project, commit), class: "monospace" = link_to commit.short_id, namespace_project_commit_path(@project.namespace, @project, commit), class: "commit-sha"
&nbsp; &nbsp;
.light .light
= commit_author_link(commit, avatar: false) = commit_author_link(commit, avatar: false)
......
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
- merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project)) - merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project))
%li{ class: "js-branch-#{branch.name}" } %li{ class: "js-branch-#{branch.name}" }
%div %div
= link_to namespace_project_tree_path(@project.namespace, @project, branch.name), class: 'item-title str-truncated' do = link_to namespace_project_tree_path(@project.namespace, @project, branch.name), class: 'item-title str-truncated ref-name' do
= icon('code-fork')
= branch.name = branch.name
&nbsp; &nbsp;
- if branch.name == @repository.root_ref - if branch.name == @repository.root_ref
......
.branch-commit .branch-commit
.icon-container.commit-icon .icon-container.commit-icon
= custom_icon("icon_commit") = custom_icon("icon_commit")
= link_to commit.short_id, namespace_project_commit_path(project.namespace, project, commit.id), class: "commit-id monospace" = link_to commit.short_id, namespace_project_commit_path(project.namespace, project, commit.id), class: "commit-sha"
&middot; &middot;
%span.str-truncated %span.str-truncated
= link_to_gfm commit.title, namespace_project_commit_path(project.namespace, project, commit.id), class: "commit-row-message" = link_to_gfm commit.title, namespace_project_commit_path(project.namespace, project, commit.id), class: "commit-row-message"
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
.col-sm-10.create-from .col-sm-10.create-from
.dropdown .dropdown
= hidden_field_tag :ref, default_ref = hidden_field_tag :ref, default_ref
= button_tag type: 'button', title: default_ref, class: 'dropdown-menu-toggle wide form-control js-branch-select', required: true, data: { toggle: 'dropdown', selected: default_ref, field_name: 'ref' } do = button_tag type: 'button', title: default_ref, class: 'dropdown-menu-toggle wide form-control js-branch-select git-revision-dropdown-toggle', required: true, data: { toggle: 'dropdown', selected: default_ref, field_name: 'ref' } do
.text-left.dropdown-toggle-text= default_ref .text-left.dropdown-toggle-text= default_ref
= icon('chevron-down') = icon('chevron-down')
= render 'shared/ref_dropdown', dropdown_class: 'wide' = render 'shared/ref_dropdown', dropdown_class: 'wide'
......
...@@ -6,18 +6,16 @@ ...@@ -6,18 +6,16 @@
= render 'ci/status/badge', status: @build.detailed_status(current_user), link: false, title: @build.status_title = render 'ci/status/badge', status: @build.detailed_status(current_user), link: false, title: @build.status_title
%strong %strong
Job Job
= link_to namespace_project_build_path(@project.namespace, @project, @build), class: 'js-build-id' do = link_to "##{@build.id}", namespace_project_build_path(@project.namespace, @project, @build), class: 'js-build-id'
\##{@build.id}
in pipeline in pipeline
= link_to pipeline_path(pipeline) do %strong
%strong ##{pipeline.id} = link_to "##{pipeline.id}", pipeline_path(pipeline)
for commit for
= link_to namespace_project_commit_path(@project.namespace, @project, pipeline.sha) do %strong
%strong= pipeline.short_sha = link_to pipeline.short_sha, namespace_project_commit_path(@project.namespace, @project, pipeline.sha), class: 'commit-sha'
from from
= link_to namespace_project_commits_path(@project.namespace, @project, @build.ref) do %strong
%code = link_to @build.ref, project_ref_path(@project, @build.ref), class: 'ref-name'
= @build.ref
= render "projects/builds/user" if @build.user = render "projects/builds/user" if @build.user
......
...@@ -23,14 +23,14 @@ ...@@ -23,14 +23,14 @@
- if job.ref - if job.ref
.icon-container .icon-container
= job.tag? ? icon('tag') : icon('code-fork') = job.tag? ? icon('tag') : icon('code-fork')
= link_to job.ref, namespace_project_commits_path(job.project.namespace, job.project, job.ref), class: "monospace branch-name" = link_to job.ref, project_ref_path(job.project, job.ref), class: "ref-name"
- else - else
.light none .light none
.icon-container.commit-icon .icon-container.commit-icon
= custom_icon("icon_commit") = custom_icon("icon_commit")
- if commit_sha - if commit_sha
= link_to job.short_sha, namespace_project_commit_path(job.project.namespace, job.project, job.sha), class: "commit-id monospace" = link_to job.short_sha, namespace_project_commit_path(job.project.namespace, job.project, job.sha), class: "commit-sha"
- if job.stuck? - if job.stuck?
= icon('warning', class: 'text-warning has-tooltip', title: 'Job is stuck. Check runners.') = icon('warning', class: 'text-warning has-tooltip', title: 'Job is stuck. Check runners.')
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
- if pipeline.user - if pipeline.user
= user_avatar(user: pipeline.user, size: 20) = user_avatar(user: pipeline.user, size: 20)
- else - else
%span.monospace API %span.api API
- if admin - if admin
%td %td
......
.page-content-header .page-content-header
.header-main-content .header-main-content
%strong Commit #{@commit.short_id} %strong
Commit
%span.commit-sha= @commit.short_id
= clipboard_button(text: @commit.id, title: "Copy commit SHA to clipboard") = clipboard_button(text: @commit.id, title: "Copy commit SHA to clipboard")
%span.hidden-xs authored %span.hidden-xs authored
#{time_ago_with_tooltip(@commit.authored_date)} #{time_ago_with_tooltip(@commit.authored_date)}
...@@ -57,7 +59,7 @@ ...@@ -57,7 +59,7 @@
= custom_icon("icon_commit") = custom_icon("icon_commit")
%span.cgray= pluralize(@commit.parents.count, "parent") %span.cgray= pluralize(@commit.parents.count, "parent")
- @commit.parents.each do |parent| - @commit.parents.each do |parent|
= link_to parent.short_id, namespace_project_commit_path(@project.namespace, @project, parent), class: "monospace" = link_to parent.short_id, namespace_project_commit_path(@project.namespace, @project, parent), class: "commit-sha"
%span.commit-info.branches %span.commit-info.branches
%i.fa.fa-spinner.fa-spin %i.fa.fa-spinner.fa-spin
...@@ -68,9 +70,10 @@ ...@@ -68,9 +70,10 @@
= link_to namespace_project_pipeline_path(@project.namespace, @project, last_pipeline.id) do = link_to namespace_project_pipeline_path(@project.namespace, @project, last_pipeline.id) do
= ci_icon_for_status(last_pipeline.status) = ci_icon_for_status(last_pipeline.status)
Pipeline Pipeline
= link_to "##{last_pipeline.id}", namespace_project_pipeline_path(@project.namespace, @project, last_pipeline.id), class: "monospace" = link_to "##{last_pipeline.id}", namespace_project_pipeline_path(@project.namespace, @project, last_pipeline.id)
= ci_label_for_status(last_pipeline.status) = ci_label_for_status(last_pipeline.status)
- if last_pipeline.stages.any? - if last_pipeline.stages.any?
with #{"stage".pluralize(last_pipeline.stages.count)}
.mr-widget-pipeline-graph .mr-widget-pipeline-graph
= render 'shared/mini_pipeline_graph', pipeline: last_pipeline, klass: 'js-commit-pipeline-graph' = render 'shared/mini_pipeline_graph', pipeline: last_pipeline, klass: 'js-commit-pipeline-graph'
in in
......
.pipeline-graph-container
.row-content-block.build-content.middle-block.pipeline-actions
.pull-right
- if can?(current_user, :update_pipeline, pipeline.project)
- if pipeline.builds.latest.failed.any?(&:retryable?)
= link_to "Retry", retry_namespace_project_pipeline_path(pipeline.project.namespace, pipeline.project, pipeline.id), class: 'js-retry-button btn btn-grouped btn-primary', method: :post
- if pipeline.builds.running_or_pending.any?
= link_to "Cancel running", cancel_namespace_project_pipeline_path(pipeline.project.namespace, pipeline.project, pipeline.id), data: { confirm: 'Are you sure?' }, class: 'btn btn-grouped btn-danger', method: :post
.oneline.clearfix
- if defined?(pipeline_details) && pipeline_details
Pipeline
= link_to "##{pipeline.id}", namespace_project_pipeline_path(pipeline.project.namespace, pipeline.project, pipeline.id), class: "monospace"
with
= pluralize pipeline.statuses.count(:id), "job"
- if pipeline.ref
for
= link_to pipeline.ref, namespace_project_commits_path(pipeline.project.namespace, pipeline.project, pipeline.ref), class: "monospace"
- if defined?(link_to_commit) && link_to_commit
for commit
= link_to pipeline.short_sha, namespace_project_commit_path(pipeline.project.namespace, pipeline.project, pipeline.sha), class: "monospace"
- if pipeline.duration
in
= time_interval_in_words pipeline.duration
.row-content-block.build-content.middle-block.js-pipeline-graph.hidden
= render "projects/pipelines/graph", pipeline: pipeline
- if pipeline.yaml_errors.present?
.bs-callout.bs-callout-danger
%h4 Found errors in your .gitlab-ci.yml:
%ul
- pipeline.yaml_errors.split(",").each do |error|
%li= error
You can also test your .gitlab-ci.yml in the #{link_to "Lint", ci_lint_path}
- if pipeline.project.builds_enabled? && !pipeline.ci_yaml_file
.bs-callout.bs-callout-warning
\.gitlab-ci.yml not found in this commit
.table-holder.pipeline-holder
%table.table.ci-table.pipeline
%thead
%tr
%th Status
%th Job ID
%th Name
%th
%th Coverage
%th
= render partial: "projects/stage/stage", collection: pipeline.stages, as: :stage
- if @branches.any? - if @branches.any? || @tags.any?
%span
- branch = commit_default_branch(@project, @branches) - branch = commit_default_branch(@project, @branches)
= link_to(namespace_project_tree_path(@project.namespace, @project, branch)) do = link_to(project_ref_path(@project, branch), class: "label label-gray ref-name") do
%span.label.label-gray = icon('code-fork')
= branch = branch
-# `commit_default_branch` deletes the default branch from `@branches`,
-# so only render this if we have more branches left
- if @branches.any? || @tags.any? - if @branches.any? || @tags.any?
= link_to("#", class: "js-details-expand") do %span
%span.label.label-gray = link_to "…", "#", class: "js-details-expand label label-gray"
\...
%span.js-details-content.hide %span.js-details-content.hide
- if @branches.any? = commit_branches_links(@project, @branches) if @branches.any?
= commit_branches_links(@project, @branches) = commit_tags_links(@project, @tags) if @tags.any?
- if @tags.any?
= commit_tags_links(@project, @tags)
...@@ -37,6 +37,6 @@ ...@@ -37,6 +37,6 @@
.commit-actions.flex-row.hidden-xs .commit-actions.flex-row.hidden-xs
- if commit.status(ref) - if commit.status(ref)
= render_commit_status(commit, ref: ref) = render_commit_status(commit, ref: ref)
= link_to commit.short_id, namespace_project_commit_path(project.namespace, project, commit), class: "commit-short-id btn btn-transparent" = link_to commit.short_id, namespace_project_commit_path(project.namespace, project, commit), class: "commit-sha btn btn-transparent"
= clipboard_button(text: commit.id, title: "Copy commit SHA to clipboard") = clipboard_button(text: commit.id, title: "Copy commit SHA to clipboard")
= link_to_browse_code(project, commit) = link_to_browse_code(project, commit)
%li.commit.inline-commit %li.commit.inline-commit
.commit-row-title .commit-row-title
= link_to commit.short_id, namespace_project_commit_path(project.namespace, project, commit), class: "commit_short_id" = link_to commit.short_id, namespace_project_commit_path(project.namespace, project, commit), class: "commit-sha"
&nbsp; &nbsp;
%span.str-truncated %span.str-truncated
= link_to_gfm commit.title, namespace_project_commit_path(project.namespace, project, commit.id), class: "commit-row-message" = link_to_gfm commit.title, namespace_project_commit_path(project.namespace, project, commit.id), class: "commit-row-message"
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
.input-group.inline-input-group .input-group.inline-input-group
%span.input-group-addon from %span.input-group-addon from
= hidden_field_tag :from, params[:from] = hidden_field_tag :from, params[:from]
= button_tag type: 'button', title: params[:from], class: "form-control compare-dropdown-toggle js-compare-dropdown has-tooltip", required: true, data: { refs_url: refs_namespace_project_path(@project.namespace, @project), toggle: "dropdown", target: ".js-compare-from-dropdown", selected: params[:from], field_name: :from } do = button_tag type: 'button', title: params[:from], class: "form-control compare-dropdown-toggle js-compare-dropdown has-tooltip git-revision-dropdown-toggle", required: true, data: { refs_url: refs_namespace_project_path(@project.namespace, @project), toggle: "dropdown", target: ".js-compare-from-dropdown", selected: params[:from], field_name: :from } do
.dropdown-toggle-text.str-truncated= params[:from] || 'Select branch/tag' .dropdown-toggle-text.str-truncated= params[:from] || 'Select branch/tag'
= render 'shared/ref_dropdown' = render 'shared/ref_dropdown'
.compare-ellipsis.inline ... .compare-ellipsis.inline ...
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
.input-group.inline-input-group .input-group.inline-input-group
%span.input-group-addon to %span.input-group-addon to
= hidden_field_tag :to, params[:to] = hidden_field_tag :to, params[:to]
= button_tag type: 'button', title: params[:to], class: "form-control compare-dropdown-toggle js-compare-dropdown has-tooltip", required: true, data: { refs_url: refs_namespace_project_path(@project.namespace, @project), toggle: "dropdown", target: ".js-compare-to-dropdown", selected: params[:to], field_name: :to } do = button_tag type: 'button', title: params[:to], class: "form-control compare-dropdown-toggle js-compare-dropdown has-tooltip git-revision-dropdown-toggle", required: true, data: { refs_url: refs_namespace_project_path(@project.namespace, @project), toggle: "dropdown", target: ".js-compare-to-dropdown", selected: params[:to], field_name: :to } do
.dropdown-toggle-text.str-truncated= params[:to] || 'Select branch/tag' .dropdown-toggle-text.str-truncated= params[:to] || 'Select branch/tag'
= render 'shared/ref_dropdown' = render 'shared/ref_dropdown'
&nbsp; &nbsp;
......
...@@ -6,10 +6,10 @@ ...@@ -6,10 +6,10 @@
.sub-header-block .sub-header-block
Compare Git revisions. Compare Git revisions.
%br %br
Fill input field with commit id like Fill input field with commit SHA like
%code.label-branch 4eedf23 %code.ref-name 4eedf23
or branch/tag name like or branch/tag name like
%code.label-branch master %code.ref-name master
and press compare button for the commits list and a code diff. and press compare button for the commits list and a code diff.
%br %br
Changes are shown <b>from</b> the version in the first field <b>to</b> the version in the second field. Changes are shown <b>from</b> the version in the first field <b>to</b> the version in the second field.
......
...@@ -16,9 +16,9 @@ ...@@ -16,9 +16,9 @@
There isn't anything to compare. There isn't anything to compare.
%p.slead %p.slead
- if params[:to] == params[:from] - if params[:to] == params[:from]
%span.label-branch= params[:from] %span.ref-name= params[:from]
and and
%span.label-branch= params[:to] %span.ref-name= params[:to]
are the same. are the same.
- else - else
You'll need to use different branch names to get a valid comparison. You'll need to use different branch names to get a valid comparison.
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
- if deployment.ref - if deployment.ref
.icon-container .icon-container
= deployment.tag? ? icon('tag') : icon('code-fork') = deployment.tag? ? icon('tag') : icon('code-fork')
= link_to deployment.ref, namespace_project_commits_path(@project.namespace, @project, deployment.ref), class: "monospace branch-name" = link_to deployment.ref, project_ref_path(@project, deployment.ref), class: "ref-name"
.icon-container.commit-icon .icon-container.commit-icon
= custom_icon("icon_commit") = custom_icon("icon_commit")
= link_to deployment.short_sha, namespace_project_commit_path(@project.namespace, @project, deployment.sha), class: "commit-id monospace" = link_to deployment.short_sha, namespace_project_commit_path(@project.namespace, @project, deployment.sha), class: "commit-sha"
%p.commit-title %p.commit-title
%span %span
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
= custom_icon("icon_commit") = custom_icon("icon_commit")
- if commit_sha - if commit_sha
= link_to generic_commit_status.short_sha, namespace_project_commit_path(generic_commit_status.project.namespace, generic_commit_status.project, generic_commit_status.sha), class: "commit-id monospace" = link_to generic_commit_status.short_sha, namespace_project_commit_path(generic_commit_status.project.namespace, generic_commit_status.project, generic_commit_status.sha), class: "commit-sha"
- if retried - if retried
= icon('warning', class: 'text-warning has-tooltip', title: 'Status was retried.') = icon('warning', class: 'text-warning has-tooltip', title: 'Status was retried.')
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
- if generic_commit_status.pipeline.user - if generic_commit_status.pipeline.user
= user_avatar(user: generic_commit_status.pipeline.user, size: 20) = user_avatar(user: generic_commit_status.pipeline.user, size: 20)
- else - else
%span.monospace API %span.api API
- if admin - if admin
%td %td
......
...@@ -11,5 +11,4 @@ ...@@ -11,5 +11,4 @@
= render_pipeline_status(pipeline) = render_pipeline_status(pipeline)
%span.related-branch-info %span.related-branch-info
%strong %strong
= link_to namespace_project_compare_path(@project.namespace, @project, from: @project.default_branch, to: branch), class: "label-branch" do = link_to branch, namespace_project_compare_path(@project.namespace, @project, from: @project.default_branch, to: branch), class: "ref-name"
= branch
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
by #{link_to_member(@project, merge_request.author, avatar: false)} by #{link_to_member(@project, merge_request.author, avatar: false)}
- if merge_request.target_project.default_branch != merge_request.target_branch - if merge_request.target_project.default_branch != merge_request.target_branch
&nbsp; &nbsp;
= link_to namespace_project_commits_path(merge_request.project.namespace, merge_request.project, merge_request.target_branch) do = link_to project_ref_path(merge_request.project, merge_request.target_branch), class: 'ref-name' do
= icon('code-fork') = icon('code-fork')
= merge_request.target_branch = merge_request.target_branch
......
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
selected: f.object.source_project_id selected: f.object.source_project_id
.merge-request-select.dropdown .merge-request-select.dropdown
= f.hidden_field :source_branch = f.hidden_field :source_branch
= dropdown_toggle f.object.source_branch || "Select source branch", { toggle: "dropdown", field_name: "#{f.object_name}[source_branch]" }, { toggle_class: "js-compare-dropdown js-source-branch" } = dropdown_toggle f.object.source_branch || "Select source branch", { toggle: "dropdown", field_name: "#{f.object_name}[source_branch]" }, { toggle_class: "js-compare-dropdown js-source-branch git-revision-dropdown-toggle" }
.dropdown-menu.dropdown-menu-selectable.dropdown-source-branch .dropdown-menu.dropdown-menu-selectable.dropdown-source-branch.git-revision-dropdown
= dropdown_title("Select source branch") = dropdown_title("Select source branch")
= dropdown_filter("Search branches") = dropdown_filter("Search branches")
= dropdown_content do = dropdown_content do
...@@ -51,8 +51,8 @@ ...@@ -51,8 +51,8 @@
selected: f.object.target_project_id selected: f.object.target_project_id
.merge-request-select.dropdown .merge-request-select.dropdown
= f.hidden_field :target_branch = f.hidden_field :target_branch
= dropdown_toggle f.object.target_branch, { toggle: "dropdown", field_name: "#{f.object_name}[target_branch]" }, { toggle_class: "js-compare-dropdown js-target-branch" } = dropdown_toggle f.object.target_branch, { toggle: "dropdown", field_name: "#{f.object_name}[target_branch]" }, { toggle_class: "js-compare-dropdown js-target-branch git-revision-dropdown-toggle" }
.dropdown-menu.dropdown-menu-selectable.dropdown-target-branch.js-target-branch-dropdown .dropdown-menu.dropdown-menu-selectable.dropdown-target-branch.js-target-branch-dropdown.git-revision-dropdown
= dropdown_title("Select target branch") = dropdown_title("Select target branch")
= dropdown_filter("Search branches") = dropdown_filter("Search branches")
= dropdown_content do = dropdown_content do
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
%p.slead %p.slead
- source_title, target_title = format_mr_branch_names(@merge_request) - source_title, target_title = format_mr_branch_names(@merge_request)
From From
%strong.label-branch= source_title %strong.ref-name= source_title
%span into %span into
%strong.label-branch= target_title %strong.ref-name= target_title
%span.pull-right %span.pull-right
= link_to 'Change branches', mr_change_branches_path(@merge_request) = link_to 'Change branches', mr_change_branches_path(@merge_request)
......
...@@ -20,12 +20,15 @@ ...@@ -20,12 +20,15 @@
- @merge_request_diffs.each do |merge_request_diff| - @merge_request_diffs.each do |merge_request_diff|
%li %li
= link_to merge_request_version_path(@project, @merge_request, merge_request_diff, @start_sha), class: ('is-active' if merge_request_diff == @merge_request_diff) do = link_to merge_request_version_path(@project, @merge_request, merge_request_diff, @start_sha), class: ('is-active' if merge_request_diff == @merge_request_diff) do
%div
%strong %strong
- if merge_request_diff.latest? - if merge_request_diff.latest?
latest version latest version
- else - else
version #{version_index(merge_request_diff)} version #{version_index(merge_request_diff)}
.monospace= short_sha(merge_request_diff.head_commit_sha) %div
%small.commit-sha= short_sha(merge_request_diff.head_commit_sha)
%div
%small %small
#{number_with_delimiter(merge_request_diff.commits_count)} #{'commit'.pluralize(merge_request_diff.commits_count)}, #{number_with_delimiter(merge_request_diff.commits_count)} #{'commit'.pluralize(merge_request_diff.commits_count)},
= time_ago_with_tooltip(merge_request_diff.created_at) = time_ago_with_tooltip(merge_request_diff.created_at)
...@@ -34,11 +37,10 @@ ...@@ -34,11 +37,10 @@
and and
%span.dropdown.inline.mr-version-compare-dropdown %span.dropdown.inline.mr-version-compare-dropdown
%a.btn.btn-default.dropdown-toggle{ data: {toggle: :dropdown} } %a.btn.btn-default.dropdown-toggle{ data: {toggle: :dropdown} }
%span
- if @start_version - if @start_version
version #{version_index(@start_version)} version #{version_index(@start_version)}
- else - else
#{@merge_request.target_branch} %span.ref-name= @merge_request.target_branch
= icon('caret-down') = icon('caret-down')
.dropdown-menu.dropdown-select.dropdown-menu-selectable .dropdown-menu.dropdown-select.dropdown-menu-selectable
.dropdown-title .dropdown-title
...@@ -50,19 +52,25 @@ ...@@ -50,19 +52,25 @@
- @comparable_diffs.each do |merge_request_diff| - @comparable_diffs.each do |merge_request_diff|
%li %li
= link_to merge_request_version_path(@project, @merge_request, @merge_request_diff, merge_request_diff.head_commit_sha), class: ('is-active' if merge_request_diff == @start_version) do = link_to merge_request_version_path(@project, @merge_request, @merge_request_diff, merge_request_diff.head_commit_sha), class: ('is-active' if merge_request_diff == @start_version) do
%div
%strong %strong
- if merge_request_diff.latest? - if merge_request_diff.latest?
latest version latest version
- else - else
version #{version_index(merge_request_diff)} version #{version_index(merge_request_diff)}
.monospace= short_sha(merge_request_diff.head_commit_sha) %div
%small.commit-sha= short_sha(merge_request_diff.head_commit_sha)
%div
%small %small
= time_ago_with_tooltip(merge_request_diff.created_at) = time_ago_with_tooltip(merge_request_diff.created_at)
%li %li
= link_to merge_request_version_path(@project, @merge_request, @merge_request_diff), class: ('is-active' unless @start_version) do = link_to merge_request_version_path(@project, @merge_request, @merge_request_diff), class: ('is-active' unless @start_version) do
%div
%strong %strong
#{@merge_request.target_branch} (base) %span.ref-name= @merge_request.target_branch
.monospace= short_sha(@merge_request_diff.base_commit_sha) (base)
%div
%strong.commit-sha= short_sha(@merge_request_diff.base_commit_sha)
- if different_base?(@start_version, @merge_request_diff) - if different_base?(@start_version, @merge_request_diff)
.content-block .content-block
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
.form-group .form-group
.col-md-6 .col-md-6
= f.label :ref, 'Target Branch', class: 'label-light' = f.label :ref, 'Target Branch', class: 'label-light'
= dropdown_tag("Select target branch", options: { toggle_class: 'btn js-target-branch-dropdown', title: "Select target branch", filter: true, placeholder: "Filter", data: { data: @project.repository.branch_names } } ) = dropdown_tag("Select target branch", options: { toggle_class: 'btn js-target-branch-dropdown git-revision-dropdown-toggle', dropdown_class: 'git-revision-dropdown', title: "Select target branch", filter: true, placeholder: "Filter", data: { data: @project.repository.branch_names } } )
= f.text_field :ref, value: @schedule.ref, id: 'schedule_ref', class: 'hidden', name: 'schedule[ref]', required: true = f.text_field :ref, value: @schedule.ref, id: 'schedule_ref', class: 'hidden', name: 'schedule[ref]', required: true
.form-group .form-group
.col-md-6 .col-md-6
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
= pipeline_schedule.description = pipeline_schedule.description
%td.branch-name-cell %td.branch-name-cell
= icon('code-fork') = icon('code-fork')
= link_to pipeline_schedule.ref, namespace_project_commits_path(@project.namespace, @project, pipeline_schedule.ref), class: "branch-name" = link_to pipeline_schedule.ref, project_ref_path(@project, pipeline_schedule.ref), class: "ref-name"
%td %td
- if pipeline_schedule.last_pipeline - if pipeline_schedule.last_pipeline
.status-icon-container{ class: "ci-status-icon-#{pipeline_schedule.last_pipeline.status}" } .status-icon-container{ class: "ci-status-icon-#{pipeline_schedule.last_pipeline.status}" }
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
= pluralize @pipeline.statuses.count(:id), "job" = pluralize @pipeline.statuses.count(:id), "job"
- if @pipeline.ref - if @pipeline.ref
from from
= link_to @pipeline.ref, namespace_project_commits_path(@project.namespace, @project, @pipeline.ref), class: "monospace" = link_to @pipeline.ref, project_ref_path(@project, @pipeline.ref), class: "ref-name"
- if @pipeline.duration - if @pipeline.duration
in in
= time_interval_in_words(@pipeline.duration) = time_interval_in_words(@pipeline.duration)
...@@ -40,10 +40,10 @@ ...@@ -40,10 +40,10 @@
.well-segment.branch-info .well-segment.branch-info
.icon-container.commit-icon .icon-container.commit-icon
= custom_icon("icon_commit") = custom_icon("icon_commit")
= link_to @commit.short_id, namespace_project_commit_path(@project.namespace, @project, @pipeline.sha), class: "monospace js-details-short" = link_to @commit.short_id, namespace_project_commit_path(@project.namespace, @project, @pipeline.sha), class: "commit-sha js-details-short"
= link_to("#", class: "js-details-expand hidden-xs hidden-sm") do = link_to("#", class: "js-details-expand hidden-xs hidden-sm") do
%span.text-expander %span.text-expander
\... \...
%span.js-details-content.hide %span.js-details-content.hide
= link_to @pipeline.sha, namespace_project_commit_path(@project.namespace, @project, @pipeline.sha), class: "monospace commit-hash-full" = link_to @pipeline.sha, namespace_project_commit_path(@project.namespace, @project, @pipeline.sha), class: "commit-sha commit-hash-full"
= clipboard_button(text: @pipeline.sha, title: "Copy commit SHA to clipboard") = clipboard_button(text: @pipeline.sha, title: "Copy commit SHA to clipboard")
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
.col-sm-10 .col-sm-10
= hidden_field_tag 'pipeline[ref]', params[:ref] || @project.default_branch = hidden_field_tag 'pipeline[ref]', params[:ref] || @project.default_branch
= dropdown_tag(params[:ref] || @project.default_branch, = dropdown_tag(params[:ref] || @project.default_branch,
options: { toggle_class: 'js-branch-select wide', options: { toggle_class: 'js-branch-select wide git-revision-dropdown-toggle',
filter: true, dropdown_class: "dropdown-menu-selectable", placeholder: "Search branches", filter: true, dropdown_class: "dropdown-menu-selectable git-revision-dropdown", placeholder: "Search branches",
data: { selected: params[:ref] || @project.default_branch, field_name: 'pipeline[ref]' } }) data: { selected: params[:ref] || @project.default_branch, field_name: 'pipeline[ref]' } })
.help-block Existing branch name, tag .help-block Existing branch name, tag
.form-actions .form-actions
......
= f.hidden_field(:name) = f.hidden_field(:name)
= dropdown_tag('Select branch or create wildcard', = dropdown_tag('Select branch or create wildcard',
options: { toggle_class: 'js-protected-branch-select js-filter-submit wide', options: { toggle_class: 'js-protected-branch-select js-filter-submit wide git-revision-dropdown-toggle',
filter: true, dropdown_class: "dropdown-menu-selectable", placeholder: "Search protected branches", filter: true, dropdown_class: "dropdown-menu-selectable git-revision-dropdown", placeholder: "Search protected branches",
footer_content: true, footer_content: true,
data: { show_no: true, show_any: true, show_upcoming: true, data: { show_no: true, show_any: true, show_upcoming: true,
selected: params[:protected_branch_name], selected: params[:protected_branch_name],
......
%tr %tr
%td %td
= link_to matching_branch.name, namespace_project_tree_path(@project.namespace, @project, matching_branch.name) = link_to matching_branch.name, project_ref_path(@project, matching_branch.name), class: 'ref-name'
- if @project.root_ref?(matching_branch.name) - if @project.root_ref?(matching_branch.name)
%span.label.label-info.prepend-left-5 default %span.label.label-info.prepend-left-5 default
%td %td
- commit = @project.commit(matching_branch.name) - commit = @project.commit(matching_branch.name)
= link_to(commit.short_id, namespace_project_commit_path(@project.namespace, @project, commit.id), class: 'commit_short_id') = link_to(commit.short_id, namespace_project_commit_path(@project.namespace, @project, commit.id), class: 'commit-sha')
= time_ago_with_tooltip(commit.committed_date) = time_ago_with_tooltip(commit.committed_date)
%tr.js-protected-branch-edit-form{ data: { url: namespace_project_protected_branch_path(@project.namespace, @project, protected_branch) } } %tr.js-protected-branch-edit-form{ data: { url: namespace_project_protected_branch_path(@project.namespace, @project, protected_branch) } }
%td %td
= protected_branch.name %span.ref-name= protected_branch.name
- if @project.root_ref?(protected_branch.name) - if @project.root_ref?(protected_branch.name)
%span.label.label-info.prepend-left-5 default %span.label.label-info.prepend-left-5 default
%td %td
...@@ -9,7 +10,7 @@ ...@@ -9,7 +10,7 @@
= link_to pluralize(matching_branches.count, "matching branch"), namespace_project_protected_branch_path(@project.namespace, @project, protected_branch) = link_to pluralize(matching_branches.count, "matching branch"), namespace_project_protected_branch_path(@project.namespace, @project, protected_branch)
- else - else
- if commit = protected_branch.commit - if commit = protected_branch.commit
= link_to(commit.short_id, namespace_project_commit_path(@project.namespace, @project, commit.id), class: 'commit_short_id') = link_to(commit.short_id, namespace_project_commit_path(@project.namespace, @project, commit.id), class: 'commit-sha')
= time_ago_with_tooltip(commit.committed_date) = time_ago_with_tooltip(commit.committed_date)
- else - else
(branch was removed from repository) (branch was removed from repository)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
.row.prepend-top-default.append-bottom-default .row.prepend-top-default.append-bottom-default
.col-lg-3 .col-lg-3
%h4.prepend-top-0 %h4.prepend-top-0.ref-name
= @protected_ref.name = @protected_ref.name
.col-lg-9 .col-lg-9
......
= f.hidden_field(:name) = f.hidden_field(:name)
= dropdown_tag('Select tag or create wildcard', = dropdown_tag('Select tag or create wildcard',
options: { toggle_class: 'js-protected-tag-select js-filter-submit wide', options: { toggle_class: 'js-protected-tag-select js-filter-submit wide git-revision-dropdown-toggle',
filter: true, dropdown_class: "dropdown-menu-selectable capitalize-header", placeholder: "Search protected tag", filter: true, dropdown_class: "dropdown-menu-selectable capitalize-header git-revision-dropdown", placeholder: "Search protected tag",
footer_content: true, footer_content: true,
data: { show_no: true, show_any: true, show_upcoming: true, data: { show_no: true, show_any: true, show_upcoming: true,
selected: params[:protected_tag_name], selected: params[:protected_tag_name],
......
%tr %tr
%td %td
= link_to matching_tag.name, namespace_project_tree_path(@project.namespace, @project, matching_tag.name) = link_to matching_tag.name, project_ref_path(@project, matching_tag.name), class: 'ref-name'
- if @project.root_ref?(matching_tag.name) - if @project.root_ref?(matching_tag.name)
%span.label.label-info.prepend-left-5 default %span.label.label-info.prepend-left-5 default
%td %td
- commit = @project.commit(matching_tag.name) - commit = @project.commit(matching_tag.name)
= link_to(commit.short_id, namespace_project_commit_path(@project.namespace, @project, commit.id), class: 'commit_short_id') = link_to(commit.short_id, namespace_project_commit_path(@project.namespace, @project, commit.id), class: 'commit-sha')
= time_ago_with_tooltip(commit.committed_date) = time_ago_with_tooltip(commit.committed_date)
%tr.js-protected-tag-edit-form{ data: { url: namespace_project_protected_tag_path(@project.namespace, @project, protected_tag) } } %tr.js-protected-tag-edit-form{ data: { url: namespace_project_protected_tag_path(@project.namespace, @project, protected_tag) } }
%td %td
= protected_tag.name %span.ref-name= protected_tag.name
- if @project.root_ref?(protected_tag.name) - if @project.root_ref?(protected_tag.name)
%span.label.label-info.prepend-left-5 default %span.label.label-info.prepend-left-5 default
%td %td
...@@ -9,7 +10,7 @@ ...@@ -9,7 +10,7 @@
= link_to pluralize(matching_tags.count, "matching tag"), namespace_project_protected_tag_path(@project.namespace, @project, protected_tag) = link_to pluralize(matching_tags.count, "matching tag"), namespace_project_protected_tag_path(@project.namespace, @project, protected_tag)
- else - else
- if commit = protected_tag.commit - if commit = protected_tag.commit
= link_to(commit.short_id, namespace_project_commit_path(@project.namespace, @project, commit.id), class: 'commit_short_id') = link_to(commit.short_id, namespace_project_commit_path(@project.namespace, @project, commit.id), class: 'commit-sha')
= time_ago_with_tooltip(commit.committed_date) = time_ago_with_tooltip(commit.committed_date)
- else - else
(tag was removed from repository) (tag was removed from repository)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
.row.prepend-top-default.append-bottom-default .row.prepend-top-default.append-bottom-default
.col-lg-3 .col-lg-3
%h4.prepend-top-0 %h4.prepend-top-0.ref-name
= @protected_ref.name = @protected_ref.name
.col-lg-9 .col-lg-9
......
%li.runner{ id: dom_id(runner) } %li.runner{ id: dom_id(runner) }
%h4 %h4
= runner_status_icon(runner) = runner_status_icon(runner)
%span.monospace
- if @project_runners.include?(runner) - if @project_runners.include?(runner)
= link_to runner.short_sha, runner_path(runner) = link_to runner.short_sha, runner_path(runner), class: 'commit-sha'
- if runner.locked? - if runner.locked?
= icon('lock', class: 'has-tooltip', title: 'Locked to current projects') = icon('lock', class: 'has-tooltip', title: 'Locked to current projects')
%small %small
= link_to edit_namespace_project_runner_path(@project.namespace, @project, runner) do = link_to edit_namespace_project_runner_path(@project.namespace, @project, runner) do
%i.fa.fa-edit.btn %i.fa.fa-edit.btn
- else - else
%span.commit-sha
= runner.short_sha = runner.short_sha
.pull-right .pull-right
......
...@@ -2,8 +2,7 @@ ...@@ -2,8 +2,7 @@
- release = @releases.find { |release| release.tag == tag.name } - release = @releases.find { |release| release.tag == tag.name }
%li.flex-row %li.flex-row
.row-main-content.str-truncated .row-main-content.str-truncated
= link_to namespace_project_tag_path(@project.namespace, @project, tag.name) do = link_to namespace_project_tag_path(@project.namespace, @project, tag.name), class: 'item-title ref-name' do
%span.item-title
= icon('tag') = icon('tag')
= tag.name = tag.name
......
...@@ -6,7 +6,9 @@ ...@@ -6,7 +6,9 @@
.top-area.multi-line .top-area.multi-line
.nav-text .nav-text
.title .title
%span.item-title= @tag.name %span.item-title.ref-name
= icon('tag')
= @tag.name
- if protected_tag?(@project, @tag) - if protected_tag?(@project, @tag)
%span.label.label-success %span.label.label-success
protected protected
......
- dropdown_class = local_assigns.fetch(:dropdown_class, '') - dropdown_class = local_assigns.fetch(:dropdown_class, '')
.dropdown-menu.dropdown-menu-selectable{ class: dropdown_class } .dropdown-menu.dropdown-menu-selectable.git-revision-dropdown{ class: dropdown_class }
= dropdown_title "Select Git revision" = dropdown_title "Select Git revision"
= dropdown_filter "Filter by Git revision" = dropdown_filter "Filter by Git revision"
= dropdown_content = dropdown_content
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
- @options && @options.each do |key, value| - @options && @options.each do |key, value|
= hidden_field_tag key, value, id: nil = hidden_field_tag key, value, id: nil
.dropdown .dropdown
= dropdown_toggle dropdown_toggle_text, { toggle: "dropdown", selected: dropdown_toggle_text, ref: @ref, refs_url: refs_namespace_project_path(@project.namespace, @project), field_name: 'ref', submit_form_on_click: true }, { toggle_class: "js-project-refs-dropdown" } = dropdown_toggle dropdown_toggle_text, { toggle: "dropdown", selected: dropdown_toggle_text, ref: @ref, refs_url: refs_namespace_project_path(@project.namespace, @project), field_name: 'ref', submit_form_on_click: true }, { toggle_class: "js-project-refs-dropdown git-revision-dropdown-toggle" }
.dropdown-menu.dropdown-menu-selectable{ class: ("dropdown-menu-align-right" if local_assigns[:align_right]) } .dropdown-menu.dropdown-menu-selectable.git-revision-dropdown{ class: ("dropdown-menu-align-right" if local_assigns[:align_right]) }
= dropdown_title "Switch branch/tag" = dropdown_title "Switch branch/tag"
= dropdown_filter "Search branches and tags" = dropdown_filter "Search branches and tags"
= dropdown_content = dropdown_content
......
...@@ -10,14 +10,14 @@ ...@@ -10,14 +10,14 @@
= form.label :source_branch, class: 'control-label' = form.label :source_branch, class: 'control-label'
.col-sm-10 .col-sm-10
.issuable-form-select-holder .issuable-form-select-holder
= form.select(:source_branch, [issuable.source_branch], {}, { class: 'source_branch select2', disabled: true }) = form.select(:source_branch, [issuable.source_branch], {}, { class: 'source_branch select2 ref-name', disabled: true })
.form-group .form-group
= form.label :target_branch, class: 'control-label' = form.label :target_branch, class: 'control-label'
.col-sm-10.target-branch-select-dropdown-container .col-sm-10.target-branch-select-dropdown-container
.issuable-form-select-holder .issuable-form-select-holder
= form.select(:target_branch, issuable.target_branches, = form.select(:target_branch, issuable.target_branches,
{ include_blank: true }, { include_blank: true },
{ class: 'target_branch js-target-branch-select', { class: 'target_branch js-target-branch-select ref-name',
disabled: issuable.new_record?, disabled: issuable.new_record?,
data: { placeholder: "Select branch" }}) data: { placeholder: "Select branch" }})
- if issuable.new_record? - if issuable.new_record?
......
---
title: Consistently use monospace font for commit SHAs and branch and tag names
merge_request:
author:
...@@ -25,7 +25,7 @@ class Spinach::Features::ProjectBuildsArtifacts < Spinach::FeatureSteps ...@@ -25,7 +25,7 @@ class Spinach::Features::ProjectBuildsArtifacts < Spinach::FeatureSteps
step 'I should see the build header' do step 'I should see the build header' do
page.within('.build-header') do page.within('.build-header') do
expect(page).to have_content "Job ##{@build.id} in pipeline ##{@pipeline.id} for commit #{@pipeline.short_sha}" expect(page).to have_content "Job ##{@build.id} in pipeline ##{@pipeline.id} for #{@pipeline.short_sha}"
end end
end end
......
...@@ -5,6 +5,7 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps ...@@ -5,6 +5,7 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps
include SharedPaths include SharedPaths
include Select2Helper include Select2Helper
include WaitForVueResource include WaitForVueResource
include WaitForAjax
step 'I am a member of project "Shop"' do step 'I am a member of project "Shop"' do
@project = ::Project.find_by(name: "Shop") @project = ::Project.find_by(name: "Shop")
...@@ -47,6 +48,7 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps ...@@ -47,6 +48,7 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps
first('.dropdown-target-project a', text: @project.path_with_namespace) first('.dropdown-target-project a', text: @project.path_with_namespace)
first('.js-source-branch').click first('.js-source-branch').click
wait_for_ajax
first('.dropdown-source-branch .dropdown-content a', text: 'fix').click first('.dropdown-source-branch .dropdown-content a', text: 'fix').click
click_button "Compare branches and continue" click_button "Compare branches and continue"
...@@ -62,31 +64,6 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps ...@@ -62,31 +64,6 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps
click_button "Submit merge request" click_button "Submit merge request"
end end
step 'I follow the target commit link' do
commit = @project.repository.commit
click_link commit.short_id(8)
end
step 'I should see the commit under the forked from project' do
commit = @project.repository.commit
expect(page).to have_content(commit.message)
end
step 'I click "Create Merge Request on fork" link' do
click_link "Create Merge Request on fork"
end
step 'I see prefilled new Merge Request page for the forked project' do
expect(current_path).to eq new_namespace_project_merge_request_path(@forked_project.namespace, @forked_project)
expect(find("#merge_request_source_project_id").value).to eq @forked_project.id.to_s
expect(find("#merge_request_target_project_id").value).to eq @project.id.to_s
expect(find("#merge_request_source_branch").value).to have_content "new_design"
expect(find("#merge_request_target_branch").value).to have_content "master"
expect(find("#merge_request_title").value).to eq "New Design"
verify_commit_link(".mr_target_commit", @project)
verify_commit_link(".mr_source_commit", @forked_project)
end
step 'I update the merge request title' do step 'I update the merge request title' do
fill_in "merge_request_title", with: "An Edited Forked Merge Request" fill_in "merge_request_title", with: "An Edited Forked Merge Request"
end end
...@@ -155,10 +132,4 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps ...@@ -155,10 +132,4 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps
expect(page).to have_content @project.users.first.name expect(page).to have_content @project.users.first.name
end end
end end
# Verify a link is generated against the correct project
def verify_commit_link(container_div, container_project)
# This should force a wait for the javascript to execute
expect(find(:div, container_div).find(".commit_short_id")['href']).to have_content "#{container_project.path_with_namespace}/commit"
end
end end
...@@ -61,16 +61,16 @@ describe('Commit component', () => { ...@@ -61,16 +61,16 @@ describe('Commit component', () => {
}); });
it('should render a link to the ref url', () => { it('should render a link to the ref url', () => {
expect(component.$el.querySelector('.branch-name').getAttribute('href')).toEqual(props.commitRef.ref_url); expect(component.$el.querySelector('.ref-name').getAttribute('href')).toEqual(props.commitRef.ref_url);
}); });
it('should render the ref name', () => { it('should render the ref name', () => {
expect(component.$el.querySelector('.branch-name').textContent).toContain(props.commitRef.name); expect(component.$el.querySelector('.ref-name').textContent).toContain(props.commitRef.name);
}); });
it('should render the commit short sha with a link to the commit url', () => { it('should render the commit short sha with a link to the commit url', () => {
expect(component.$el.querySelector('.commit-id').getAttribute('href')).toEqual(props.commitUrl); expect(component.$el.querySelector('.commit-sha').getAttribute('href')).toEqual(props.commitUrl);
expect(component.$el.querySelector('.commit-id').textContent).toContain(props.shortSha); expect(component.$el.querySelector('.commit-sha').textContent).toContain(props.shortSha);
}); });
it('should render the given commitIconSvg', () => { it('should render the given commitIconSvg', () => {
......
...@@ -89,7 +89,7 @@ describe('Pipelines Table Row', () => { ...@@ -89,7 +89,7 @@ describe('Pipelines Table Row', () => {
it('should render link to commit', () => { it('should render link to commit', () => {
component = buildComponent(pipeline); component = buildComponent(pipeline);
const commitLink = component.$el.querySelector('.branch-commit .commit-id'); const commitLink = component.$el.querySelector('.branch-commit .commit-sha');
expect(commitLink.getAttribute('href')).toEqual(pipeline.commit.commit_path); expect(commitLink.getAttribute('href')).toEqual(pipeline.commit.commit_path);
}); });
......
...@@ -62,7 +62,7 @@ describe ChatMessage::PipelineMessage do ...@@ -62,7 +62,7 @@ describe ChatMessage::PipelineMessage do
def build_message(status_text = status, name = user[:name]) def build_message(status_text = status, name = user[:name])
"<http://example.gitlab.com|project_name>:" \ "<http://example.gitlab.com|project_name>:" \
" Pipeline <http://example.gitlab.com/pipelines/123|#123>" \ " Pipeline <http://example.gitlab.com/pipelines/123|#123>" \
" of <http://example.gitlab.com/commits/develop|develop> branch" \ " of branch `<http://example.gitlab.com/commits/develop|develop>`" \
" by #{name} #{status_text} in 02:00:10" " by #{name} #{status_text} in 02:00:10"
end end
end end
...@@ -81,7 +81,7 @@ describe ChatMessage::PipelineMessage do ...@@ -81,7 +81,7 @@ describe ChatMessage::PipelineMessage do
expect(subject.pretext).to be_empty expect(subject.pretext).to be_empty
expect(subject.attachments).to eq(message) expect(subject.attachments).to eq(message)
expect(subject.activity).to eq({ expect(subject.activity).to eq({
title: 'Pipeline [#123](http://example.gitlab.com/pipelines/123) of [develop](http://example.gitlab.com/commits/develop) branch by hacker passed', title: 'Pipeline [#123](http://example.gitlab.com/pipelines/123) of branch `[develop](http://example.gitlab.com/commits/develop)` by hacker passed',
subtitle: 'in [project_name](http://example.gitlab.com)', subtitle: 'in [project_name](http://example.gitlab.com)',
text: 'in 02:00:10', text: 'in 02:00:10',
image: '' image: ''
...@@ -98,7 +98,7 @@ describe ChatMessage::PipelineMessage do ...@@ -98,7 +98,7 @@ describe ChatMessage::PipelineMessage do
expect(subject.pretext).to be_empty expect(subject.pretext).to be_empty
expect(subject.attachments).to eq(message) expect(subject.attachments).to eq(message)
expect(subject.activity).to eq({ expect(subject.activity).to eq({
title: 'Pipeline [#123](http://example.gitlab.com/pipelines/123) of [develop](http://example.gitlab.com/commits/develop) branch by hacker failed', title: 'Pipeline [#123](http://example.gitlab.com/pipelines/123) of branch `[develop](http://example.gitlab.com/commits/develop)` by hacker failed',
subtitle: 'in [project_name](http://example.gitlab.com)', subtitle: 'in [project_name](http://example.gitlab.com)',
text: 'in 02:00:10', text: 'in 02:00:10',
image: '' image: ''
...@@ -113,7 +113,7 @@ describe ChatMessage::PipelineMessage do ...@@ -113,7 +113,7 @@ describe ChatMessage::PipelineMessage do
expect(subject.pretext).to be_empty expect(subject.pretext).to be_empty
expect(subject.attachments).to eq(message) expect(subject.attachments).to eq(message)
expect(subject.activity).to eq({ expect(subject.activity).to eq({
title: 'Pipeline [#123](http://example.gitlab.com/pipelines/123) of [develop](http://example.gitlab.com/commits/develop) branch by API failed', title: 'Pipeline [#123](http://example.gitlab.com/pipelines/123) of branch `[develop](http://example.gitlab.com/commits/develop)` by API failed',
subtitle: 'in [project_name](http://example.gitlab.com)', subtitle: 'in [project_name](http://example.gitlab.com)',
text: 'in 02:00:10', text: 'in 02:00:10',
image: '' image: ''
...@@ -125,8 +125,8 @@ describe ChatMessage::PipelineMessage do ...@@ -125,8 +125,8 @@ describe ChatMessage::PipelineMessage do
def build_markdown_message(status_text = status, name = user[:name]) def build_markdown_message(status_text = status, name = user[:name])
"[project_name](http://example.gitlab.com):" \ "[project_name](http://example.gitlab.com):" \
" Pipeline [#123](http://example.gitlab.com/pipelines/123)" \ " Pipeline [#123](http://example.gitlab.com/pipelines/123)" \
" of [develop](http://example.gitlab.com/commits/develop)" \ " of branch `[develop](http://example.gitlab.com/commits/develop)`" \
" branch by #{name} #{status_text} in 02:00:10" " by #{name} #{status_text} in 02:00:10"
end end
end end
end end
...@@ -28,7 +28,7 @@ describe ChatMessage::PushMessage, models: true do ...@@ -28,7 +28,7 @@ describe ChatMessage::PushMessage, models: true do
context 'without markdown' do context 'without markdown' do
it 'returns a message regarding pushes' do it 'returns a message regarding pushes' do
expect(subject.pretext).to eq( expect(subject.pretext).to eq(
'test.user pushed to branch <http://url.com/commits/master|master> of '\ 'test.user pushed to branch `<http://url.com/commits/master|master>` of '\
'<http://url.com|project_name> (<http://url.com/compare/before...after|Compare changes>)') '<http://url.com|project_name> (<http://url.com/compare/before...after|Compare changes>)')
expect(subject.attachments).to eq([{ expect(subject.attachments).to eq([{
text: "<http://url1.com|abcdefgh>: message1 - author1\n\n"\ text: "<http://url1.com|abcdefgh>: message1 - author1\n\n"\
...@@ -45,7 +45,7 @@ describe ChatMessage::PushMessage, models: true do ...@@ -45,7 +45,7 @@ describe ChatMessage::PushMessage, models: true do
it 'returns a message regarding pushes' do it 'returns a message regarding pushes' do
expect(subject.pretext).to eq( expect(subject.pretext).to eq(
'test.user pushed to branch [master](http://url.com/commits/master) of [project_name](http://url.com) ([Compare changes](http://url.com/compare/before...after))') 'test.user pushed to branch `[master](http://url.com/commits/master)` of [project_name](http://url.com) ([Compare changes](http://url.com/compare/before...after))')
expect(subject.attachments).to eq( expect(subject.attachments).to eq(
"[abcdefgh](http://url1.com): message1 - author1\n\n[12345678](http://url2.com): message2 - author2") "[abcdefgh](http://url1.com): message1 - author1\n\n[12345678](http://url2.com): message2 - author2")
expect(subject.activity).to eq({ expect(subject.activity).to eq({
...@@ -74,7 +74,7 @@ describe ChatMessage::PushMessage, models: true do ...@@ -74,7 +74,7 @@ describe ChatMessage::PushMessage, models: true do
context 'without markdown' do context 'without markdown' do
it 'returns a message regarding pushes' do it 'returns a message regarding pushes' do
expect(subject.pretext).to eq('test.user pushed new tag ' \ expect(subject.pretext).to eq('test.user pushed new tag ' \
'<http://url.com/commits/new_tag|new_tag> to ' \ '`<http://url.com/commits/new_tag|new_tag>` to ' \
'<http://url.com|project_name>') '<http://url.com|project_name>')
expect(subject.attachments).to be_empty expect(subject.attachments).to be_empty
end end
...@@ -87,7 +87,7 @@ describe ChatMessage::PushMessage, models: true do ...@@ -87,7 +87,7 @@ describe ChatMessage::PushMessage, models: true do
it 'returns a message regarding pushes' do it 'returns a message regarding pushes' do
expect(subject.pretext).to eq( expect(subject.pretext).to eq(
'test.user pushed new tag [new_tag](http://url.com/commits/new_tag) to [project_name](http://url.com)') 'test.user pushed new tag `[new_tag](http://url.com/commits/new_tag)` to [project_name](http://url.com)')
expect(subject.attachments).to be_empty expect(subject.attachments).to be_empty
expect(subject.activity).to eq({ expect(subject.activity).to eq({
title: 'test.user created tag', title: 'test.user created tag',
...@@ -107,7 +107,7 @@ describe ChatMessage::PushMessage, models: true do ...@@ -107,7 +107,7 @@ describe ChatMessage::PushMessage, models: true do
context 'without markdown' do context 'without markdown' do
it 'returns a message regarding a new branch' do it 'returns a message regarding a new branch' do
expect(subject.pretext).to eq( expect(subject.pretext).to eq(
'test.user pushed new branch <http://url.com/commits/master|master> to '\ 'test.user pushed new branch `<http://url.com/commits/master|master>` to '\
'<http://url.com|project_name>') '<http://url.com|project_name>')
expect(subject.attachments).to be_empty expect(subject.attachments).to be_empty
end end
...@@ -120,7 +120,7 @@ describe ChatMessage::PushMessage, models: true do ...@@ -120,7 +120,7 @@ describe ChatMessage::PushMessage, models: true do
it 'returns a message regarding a new branch' do it 'returns a message regarding a new branch' do
expect(subject.pretext).to eq( expect(subject.pretext).to eq(
'test.user pushed new branch [master](http://url.com/commits/master) to [project_name](http://url.com)') 'test.user pushed new branch `[master](http://url.com/commits/master)` to [project_name](http://url.com)')
expect(subject.attachments).to be_empty expect(subject.attachments).to be_empty
expect(subject.activity).to eq({ expect(subject.activity).to eq({
title: 'test.user created branch', title: 'test.user created branch',
...@@ -140,7 +140,7 @@ describe ChatMessage::PushMessage, models: true do ...@@ -140,7 +140,7 @@ describe ChatMessage::PushMessage, models: true do
context 'without markdown' do context 'without markdown' do
it 'returns a message regarding a removed branch' do it 'returns a message regarding a removed branch' do
expect(subject.pretext).to eq( expect(subject.pretext).to eq(
'test.user removed branch master from <http://url.com|project_name>') 'test.user removed branch `master` from <http://url.com|project_name>')
expect(subject.attachments).to be_empty expect(subject.attachments).to be_empty
end end
end end
...@@ -152,7 +152,7 @@ describe ChatMessage::PushMessage, models: true do ...@@ -152,7 +152,7 @@ describe ChatMessage::PushMessage, models: true do
it 'returns a message regarding a removed branch' do it 'returns a message regarding a removed branch' do
expect(subject.pretext).to eq( expect(subject.pretext).to eq(
'test.user removed branch master from [project_name](http://url.com)') 'test.user removed branch `master` from [project_name](http://url.com)')
expect(subject.attachments).to be_empty expect(subject.attachments).to be_empty
expect(subject.activity).to eq({ expect(subject.activity).to eq({
title: 'test.user removed branch', title: 'test.user removed branch',
......
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