summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG1
-rw-r--r--Gemfile2
-rw-r--r--Gemfile.lock12
-rw-r--r--app/assets/javascripts/awards_handler.coffee15
-rw-r--r--app/assets/javascripts/compare.js.coffee67
-rw-r--r--app/assets/javascripts/gl_dropdown.js.coffee41
-rw-r--r--app/assets/javascripts/merge_request_tabs.js.coffee3
-rw-r--r--app/assets/javascripts/subscription.js.coffee4
-rw-r--r--app/assets/stylesheets/framework/dropdowns.scss4
-rw-r--r--app/assets/stylesheets/pages/commits.scss5
-rw-r--r--app/assets/stylesheets/pages/labels.scss58
-rw-r--r--app/assets/stylesheets/pages/merge_requests.scss79
-rw-r--r--app/controllers/projects/merge_requests_controller.rb6
-rw-r--r--app/helpers/commits_helper.rb4
-rw-r--r--app/helpers/gitlab_markdown_helper.rb23
-rw-r--r--app/views/projects/_md_preview.html.haml6
-rw-r--r--app/views/projects/commits/_commit.html.haml9
-rw-r--r--app/views/projects/labels/_label.html.haml17
-rw-r--r--app/views/projects/merge_requests/_new_compare.html.haml111
-rw-r--r--app/views/projects/merge_requests/branch_from.html.haml1
-rw-r--r--app/views/projects/merge_requests/branch_from.js.haml3
-rw-r--r--app/views/projects/merge_requests/branch_to.html.haml1
-rw-r--r--app/views/projects/merge_requests/branch_to.js.haml3
-rw-r--r--app/views/projects/merge_requests/update_branches.html.haml5
-rw-r--r--app/views/projects/merge_requests/update_branches.js.haml9
-rw-r--r--app/views/shared/_label_row.html.haml3
-rw-r--r--app/views/shared/issuable/_form.html.haml14
-rw-r--r--app/views/votes/_votes_block.html.haml2
-rw-r--r--db/fixtures/development/07_milestones.rb2
-rw-r--r--db/migrate/20130315124931_user_color_scheme.rb4
-rw-r--r--db/migrate/20130403003950_add_last_activity_column_into_project.rb16
-rw-r--r--db/migrate/20131112220935_add_visibility_level_to_projects.rb6
-rw-r--r--db/migrate/20140313092127_migrate_already_imported_projects.rb8
-rw-r--r--db/migrate/20141007100818_add_visibility_level_to_snippet.rb14
-rw-r--r--doc/ci/build_artifacts/README.md13
-rw-r--r--doc/integration/README.md17
-rw-r--r--doc/project_services/project_services.md19
-rw-r--r--features/project/forked_merge_requests.feature1
-rw-r--r--features/project/merge_requests.feature1
-rw-r--r--features/steps/project/forked_merge_requests.rb22
-rw-r--r--features/steps/project/issues/labels.rb2
-rw-r--r--features/steps/project/merge_requests.rb8
-rw-r--r--features/steps/project/source/browse_files.rb7
-rw-r--r--spec/features/issues/award_emoji_spec.rb64
-rw-r--r--spec/features/merge_requests/create_new_mr_spec.rb11
-rw-r--r--spec/helpers/gitlab_markdown_helper_spec.rb7
46 files changed, 518 insertions, 212 deletions
diff --git a/CHANGELOG b/CHANGELOG
index b5dcc8bc8a7..3561c541df0 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -46,6 +46,7 @@ v 8.6.5
v 8.6.4
- Don't attempt to fetch any tags from a forked repo (Stan Hu)
+ - Redesign the Labels page
v 8.6.3
- Mentions on confidential issues doesn't create todos for non-members. !3374
diff --git a/Gemfile b/Gemfile
index 298cfd260ba..258b5612cd5 100644
--- a/Gemfile
+++ b/Gemfile
@@ -239,7 +239,7 @@ group :development do
gem "foreman"
gem 'brakeman', '~> 3.2.0', require: false
- gem "annotate", "~> 2.6.0"
+ gem "annotate", "~> 2.7.0"
gem "letter_opener", '~> 1.1.2'
gem 'quiet_assets', '~> 1.0.2'
gem 'rerun', '~> 0.11.0'
diff --git a/Gemfile.lock b/Gemfile.lock
index 28b71ac7bc8..9da44a46583 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -51,8 +51,8 @@ GEM
activerecord (>= 3.0)
akismet (2.0.0)
allocations (1.0.4)
- annotate (2.6.10)
- activerecord (>= 3.2, <= 4.3)
+ annotate (2.7.0)
+ activerecord (>= 3.2, < 6.0)
rake (~> 10.4)
arel (6.0.3)
asana (0.4.0)
@@ -145,7 +145,7 @@ GEM
crack (0.4.3)
safe_yaml (~> 1.0.0)
creole (0.5.0)
- css_parser (1.3.7)
+ css_parser (1.4.1)
addressable
d3_rails (3.5.11)
railties (>= 3.1.0)
@@ -559,8 +559,8 @@ GEM
premailer (1.8.6)
css_parser (>= 1.3.6)
htmlentities (>= 4.0.0)
- premailer-rails (1.9.0)
- actionmailer (>= 3, < 5)
+ premailer-rails (1.9.2)
+ actionmailer (>= 3, < 6)
premailer (~> 1.7, >= 1.7.9)
pry (0.10.3)
coderay (~> 1.1.0)
@@ -888,7 +888,7 @@ DEPENDENCIES
after_commit_queue
akismet (~> 2.0)
allocations (~> 1.0)
- annotate (~> 2.6.0)
+ annotate (~> 2.7.0)
asana (~> 0.4.0)
asciidoctor (~> 1.5.2)
attr_encrypted (~> 1.3.4)
diff --git a/app/assets/javascripts/awards_handler.coffee b/app/assets/javascripts/awards_handler.coffee
index 6a670d5e887..af4462ece38 100644
--- a/app/assets/javascripts/awards_handler.coffee
+++ b/app/assets/javascripts/awards_handler.coffee
@@ -22,8 +22,19 @@ class @AwardsHandler
emoji = $(this)
.find(".icon")
.data "emoji"
+
+ if emoji is "thumbsup" and awards_handler.didUserClickEmoji $(this), "thumbsdown"
+ awards_handler.addAward "thumbsdown"
+
+ else if emoji is "thumbsdown" and awards_handler.didUserClickEmoji $(this), "thumbsup"
+ awards_handler.addAward "thumbsup"
+
awards_handler.addAward emoji
+ didUserClickEmoji: (that, emoji) ->
+ if $(that).siblings("button:has([data-emoji=#{emoji}])").attr("data-original-title")
+ $(that).siblings("button:has([data-emoji=#{emoji}])").attr("data-original-title").indexOf('me') > -1
+
showEmojiMenu: ->
if $(".emoji-menu").length
if $(".emoji-menu").is ".is-visible"
@@ -105,7 +116,7 @@ class @AwardsHandler
if origTitle
authors = origTitle.split(', ')
authors.push("me")
- award_block.attr("title", authors.join(", "))
+ award_block.attr("data-original-title", authors.join(", "))
@resetTooltip(award_block)
resetTooltip: (award) ->
@@ -122,7 +133,7 @@ class @AwardsHandler
nodes = []
nodes.push(
- "<button class='btn award-control js-emoji-btn has-tooltip active' title='me'>",
+ "<button class='btn award-control js-emoji-btn has-tooltip active' data-original-title='me'>",
"<div class='icon emoji-icon #{emojiCssClass}' data-emoji='#{emoji}'></div>",
"<span class='award-control-text js-counter'>1</span>",
"</button>"
diff --git a/app/assets/javascripts/compare.js.coffee b/app/assets/javascripts/compare.js.coffee
new file mode 100644
index 00000000000..f20992ead3e
--- /dev/null
+++ b/app/assets/javascripts/compare.js.coffee
@@ -0,0 +1,67 @@
+class @Compare
+ constructor: (@opts) ->
+ @source_loading = $ ".js-source-loading"
+ @target_loading = $ ".js-target-loading"
+
+ $('.js-compare-dropdown').each (i, dropdown) =>
+ $dropdown = $(dropdown)
+
+ $dropdown.glDropdown(
+ selectable: true
+ fieldName: $dropdown.data 'field-name'
+ filterable: true
+ id: (obj, $el) ->
+ $el.data 'id'
+ toggleLabel: (obj, $el) ->
+ $el.text().trim()
+ clicked: (e, el) =>
+ if $dropdown.is '.js-target-branch'
+ @getTargetHtml()
+ else if $dropdown.is '.js-source-branch'
+ @getSourceHtml()
+ else if $dropdown.is '.js-target-project'
+ @getTargetProject()
+ )
+
+ @initialState()
+
+ initialState: ->
+ @getSourceHtml()
+ @getTargetHtml()
+
+ getTargetProject: ->
+ $.ajax(
+ url: @opts.targetProjectUrl
+ data:
+ target_project_id: $("input[name='merge_request[target_project_id]']").val()
+ beforeSend: ->
+ $('.mr_target_commit').empty()
+ success: (html) ->
+ $('.js-target-branch-dropdown .dropdown-content').html html
+ )
+
+ getSourceHtml: ->
+ @sendAjax(@opts.sourceBranchUrl, @source_loading, '.mr_source_commit',
+ ref: $("input[name='merge_request[source_branch]']").val()
+ )
+
+ getTargetHtml: ->
+ @sendAjax(@opts.targetBranchUrl, @target_loading, '.mr_target_commit',
+ target_project_id: $("input[name='merge_request[target_project_id]']").val()
+ ref: $("input[name='merge_request[target_branch]']").val()
+ )
+
+ sendAjax: (url, loading, target, data) ->
+ $target = $(target)
+
+ $.ajax(
+ url: url
+ data: data
+ beforeSend: ->
+ loading.show()
+ $target.empty()
+ success: (html) ->
+ loading.hide()
+ $target.html html
+ $('.js-timeago', $target).timeago()
+ )
diff --git a/app/assets/javascripts/gl_dropdown.js.coffee b/app/assets/javascripts/gl_dropdown.js.coffee
index e8d25591f63..ee1d0fad289 100644
--- a/app/assets/javascripts/gl_dropdown.js.coffee
+++ b/app/assets/javascripts/gl_dropdown.js.coffee
@@ -57,14 +57,30 @@ class GitLabDropdownFilter
filter: (search_text) ->
data = @options.data()
- results = data
- if search_text isnt ""
- results = fuzzaldrinPlus.filter(data, search_text,
- key: @options.keys
- )
+ if data?
+ results = data
- @options.callback results
+ if search_text isnt ''
+ results = fuzzaldrinPlus.filter(data, search_text,
+ key: @options.keys
+ )
+
+ @options.callback results
+ else
+ elements = @options.elements()
+
+ if search_text
+ elements.each ->
+ $el = $(@)
+ matches = fuzzaldrinPlus.match($el.text().trim(), search_text)
+
+ if matches.length
+ $el.show()
+ else
+ $el.hide()
+ else
+ elements.show()
class GitLabDropdownRemote
constructor: (@dataEndpoint, @options) ->
@@ -123,7 +139,7 @@ class GitLabDropdown
if _.isString(@filterInput)
@filterInput = @getElement(@filterInput)
- search_fields = if @options.search then @options.search.fields else [];
+ searchFields = if @options.search then @options.search.fields else [];
if @options.data
# If data is an array
@@ -147,7 +163,14 @@ class GitLabDropdown
filterInputBlur: @filterInputBlur
remote: @options.filterRemote
query: @options.data
- keys: @options.search.fields
+ keys: searchFields
+ elements: =>
+ selector = '.dropdown-content li:not(.divider)'
+
+ if @dropdown.find('.dropdown-toggle-page').length
+ selector = ".dropdown-page-one #{selector}"
+
+ return $(selector)
data: =>
return @fullData
callback: (data) =>
@@ -376,7 +399,7 @@ class GitLabDropdown
# Toggle the dropdown label
if @options.toggleLabel
- $(@el).find(".dropdown-toggle-text").text @options.toggleLabel(selectedObject)
+ $(@el).find(".dropdown-toggle-text").text @options.toggleLabel(selectedObject, el)
if value?
if !field.length and fieldName
# Create hidden input for form
diff --git a/app/assets/javascripts/merge_request_tabs.js.coffee b/app/assets/javascripts/merge_request_tabs.js.coffee
index 839e6ec2c08..9946249adbf 100644
--- a/app/assets/javascripts/merge_request_tabs.js.coffee
+++ b/app/assets/javascripts/merge_request_tabs.js.coffee
@@ -73,7 +73,8 @@ class @MergeRequestTabs
@expandView()
else if action == 'diffs'
@loadDiff($target.attr('href'))
- @shrinkView()
+ if bp? and bp.getBreakpointSize() isnt 'lg'
+ @shrinkView()
else if action == 'builds'
@loadBuilds($target.attr('href'))
@expandView()
diff --git a/app/assets/javascripts/subscription.js.coffee b/app/assets/javascripts/subscription.js.coffee
index 084f0e0dc65..e4b7a3172ec 100644
--- a/app/assets/javascripts/subscription.js.coffee
+++ b/app/assets/javascripts/subscription.js.coffee
@@ -10,10 +10,10 @@ class @Subscription
btn = $(event.currentTarget)
action = btn.find('span').text()
current_status = @subscription_status.attr('data-status')
- btn.prop('disabled', true)
+ btn.addClass('disabled')
$.post @url, =>
- btn.prop('disabled', false)
+ btn.removeClass('disabled')
status = if current_status == 'subscribed' then 'unsubscribed' else 'subscribed'
@subscription_status.attr('data-status', status)
action = if status == 'subscribed' then 'Unsubscribe' else 'Subscribe'
diff --git a/app/assets/stylesheets/framework/dropdowns.scss b/app/assets/stylesheets/framework/dropdowns.scss
index 82dc1acbd01..ba6c7930cdc 100644
--- a/app/assets/stylesheets/framework/dropdowns.scss
+++ b/app/assets/stylesheets/framework/dropdowns.scss
@@ -248,7 +248,7 @@
.dropdown-title {
position: relative;
- padding: 0 0 15px;
+ padding: 0 25px 15px;
margin: 0 10px 10px;
font-weight: 600;
line-height: 1;
@@ -275,7 +275,7 @@
}
.dropdown-menu-close {
- right: 7px;
+ right: 5px;
width: 20px;
height: 20px;
top: -1px;
diff --git a/app/assets/stylesheets/pages/commits.scss b/app/assets/stylesheets/pages/commits.scss
index 8272615768d..6453c91d955 100644
--- a/app/assets/stylesheets/pages/commits.scss
+++ b/app/assets/stylesheets/pages/commits.scss
@@ -47,6 +47,7 @@ li.commit {
.commit_short_id {
min-width: 65px;
+ color: $gl-dark-link-color;
font-family: $monospace_font;
}
@@ -88,6 +89,10 @@ li.commit {
padding: 0;
margin: 0;
}
+
+ a {
+ color: $gl-dark-link-color;
+ }
}
.commit-row-info {
diff --git a/app/assets/stylesheets/pages/labels.scss b/app/assets/stylesheets/pages/labels.scss
index 4e02ec4e891..3e0a3140be7 100644
--- a/app/assets/stylesheets/pages/labels.scss
+++ b/app/assets/stylesheets/pages/labels.scss
@@ -49,6 +49,15 @@
}
.label-row {
+ .label-name {
+ display: inline-block;
+ width: 200px;
+
+ @media (max-width: $screen-xs-min) {
+ display: block;
+ }
+ }
+
.label {
padding: 9px;
font-size: 14px;
@@ -69,3 +78,52 @@
background-color: $gl-danger;
color: $white-light;
}
+
+.manage-labels-list {
+
+ .prepend-left-10 {
+ display: inline-block;
+ width: 40%;
+ vertical-align: middle;
+
+ @media (max-width: $screen-xs-min) {
+ display: block;
+ width: 100%;
+ margin-left: 0;
+ padding: 10px 0;
+ }
+ }
+
+ .pull-info-right {
+ float: right;
+
+ @media (max-width: $screen-xs-min) {
+ float: none;
+ }
+
+ .action-buttons {
+ border-color: transparent;
+ padding: 6px;
+ color: $gl-text-color;
+
+ &.subscribe-button {
+ padding-left: 0;
+ }
+ }
+
+ i {
+ color: $gl-text-color;
+ }
+
+ .append-right-20 {
+ a {
+ color: $gl-text-color;
+ }
+
+ @media (max-width: $screen-xs-min) {
+ display: block;
+ margin-bottom: 10px;
+ }
+ }
+ }
+}
diff --git a/app/assets/stylesheets/pages/merge_requests.scss b/app/assets/stylesheets/pages/merge_requests.scss
index 1c6a4208974..b79335eab91 100644
--- a/app/assets/stylesheets/pages/merge_requests.scss
+++ b/app/assets/stylesheets/pages/merge_requests.scss
@@ -123,6 +123,8 @@
.mr_source_commit,
.mr_target_commit {
+ margin-bottom: 0;
+
.commit {
margin: 0;
padding: 2px 0;
@@ -174,10 +176,6 @@
display: none;
}
-.merge-request-form .select2-container {
- width: 250px !important;
-}
-
#modal_merge_info .modal-dialog {
width: 600px;
@@ -200,3 +198,76 @@
overflow-x: scroll;
}
}
+
+.panel-new-merge-request {
+ .panel-heading {
+ padding: 5px 10px;
+ font-weight: 600;
+ line-height: 25px;
+ }
+
+ .panel-body {
+ padding: 10px 5px;
+ }
+
+ .panel-footer {
+ padding: 5px 10px;
+ }
+
+ .commit {
+ .commit-row-title {
+ margin-bottom: 4px;
+ }
+
+ .avatar {
+ width: 20px;
+ height: 20px;
+ margin-right: 5px;
+ }
+
+ .commit-row-info {
+ line-height: 20px;
+ }
+ }
+
+ .btn-clipboard {
+ margin-right: 5px;
+ padding: 0;
+ background: transparent;
+ }
+
+ .ci-status-link {
+ margin-right: 5px;
+ }
+}
+
+.merge-request-select {
+ padding-left: 5px;
+ padding-right: 5px;
+ margin-bottom: 10px;
+
+ &:last-child {
+ margin-bottom: 0;
+ }
+
+ @media (min-width: $screen-sm-min) {
+ float: left;
+ width: 50%;
+ margin-bottom: 0;
+ }
+
+ .dropdown-menu-toggle {
+ width: 100%;
+ }
+
+ .dropdown-menu {
+ left: 5px;
+ right: 5px;
+ width: auto;
+ }
+}
+
+.issuable-form-select-holder {
+ display: inline-block;
+ width: 250px;
+}
diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb
index 49064f5d505..ae613f5e093 100644
--- a/app/controllers/projects/merge_requests_controller.rb
+++ b/app/controllers/projects/merge_requests_controller.rb
@@ -207,20 +207,20 @@ class Projects::MergeRequestsController < Projects::ApplicationController
#This is always source
@source_project = @merge_request.nil? ? @project : @merge_request.source_project
@commit = @repository.commit(params[:ref]) if params[:ref].present?
+ render layout: false
end
def branch_to
@target_project = selected_target_project
@commit = @target_project.commit(params[:ref]) if params[:ref].present?
+ render layout: false
end
def update_branches
@target_project = selected_target_project
@target_branches = @target_project.repository.branch_names
- respond_to do |format|
- format.js
- end
+ render layout: false
end
def ci_status
diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb
index de508036888..35ba543cef1 100644
--- a/app/helpers/commits_helper.rb
+++ b/app/helpers/commits_helper.rb
@@ -28,7 +28,7 @@ module CommitsHelper
def commit_to_html(commit, project, inline = true)
template = inline ? "inline_commit" : "commit"
- escape_javascript(render "projects/commits/#{template}", commit: commit, project: project) unless commit.nil?
+ render "projects/commits/#{template}", commit: commit, project: project unless commit.nil?
end
# Breadcrumb links for a Project and, if applicable, a tree path
@@ -117,7 +117,7 @@ module CommitsHelper
end
end
link_to(
- "Browse Files »",
+ "Browse Files",
namespace_project_tree_path(project.namespace, project, commit),
class: "pull-right"
)
diff --git a/app/helpers/gitlab_markdown_helper.rb b/app/helpers/gitlab_markdown_helper.rb
index 2f760af02fd..3a45205563e 100644
--- a/app/helpers/gitlab_markdown_helper.rb
+++ b/app/helpers/gitlab_markdown_helper.rb
@@ -116,29 +116,6 @@ module GitlabMarkdownHelper
end
end
- MARKDOWN_TIPS = [
- "End a line with two or more spaces for a line-break, or soft-return",
- "Inline code can be denoted by `surrounding it with backticks`",
- "Blocks of code can be denoted by three backticks ``` or four leading spaces",
- "Emoji can be added by :emoji_name:, for example :thumbsup:",
- "Notify other participants using @user_name",
- "Notify a specific group using @group_name",
- "Notify the entire team using @all",
- "Reference an issue using a hash, for example issue #123",
- "Reference a merge request using an exclamation point, for example MR !123",
- "Italicize words or phrases using *asterisks* or _underscores_",
- "Bold words or phrases using **double asterisks** or __double underscores__",
- "Strikethrough words or phrases using ~~two tildes~~",
- "Make a bulleted list using + pluses, - minuses, or * asterisks",
- "Denote blockquotes using > at the beginning of a line",
- "Make a horizontal line using three or more hyphens ---, asterisks ***, or underscores ___"
- ].freeze
-
- # Returns a random markdown tip for use as a textarea placeholder
- def random_markdown_tip
- MARKDOWN_TIPS.sample
- end
-
private
# Return +text+, truncated to +max_chars+ characters, excluding any HTML
diff --git a/app/views/projects/_md_preview.html.haml b/app/views/projects/_md_preview.html.haml
index 4920910fee1..7a78d61a611 100644
--- a/app/views/projects/_md_preview.html.haml
+++ b/app/views/projects/_md_preview.html.haml
@@ -2,13 +2,13 @@
.md-header
%ul.nav-links
%li.active
- %a.js-md-write-button{ href: "#md-write-holder" }
+ %a.js-md-write-button{ href: "#md-write-holder", tabindex: -1 }
Write
%li
- %a.js-md-preview-button{ href: "#md-preview-holder" }
+ %a.js-md-preview-button{ href: "#md-preview-holder", tabindex: -1 }
Preview
%li.pull-right
- %button.zen-cotrol.zen-control-full.js-zen-enter{ type: 'button' }
+ %button.zen-cotrol.zen-control-full.js-zen-enter{ type: 'button', tabindex: -1 }
Go full screen
.md-write-holder
diff --git a/app/views/projects/commits/_commit.html.haml b/app/views/projects/commits/_commit.html.haml
index 7f2903589a9..7da89231243 100644
--- a/app/views/projects/commits/_commit.html.haml
+++ b/app/views/projects/commits/_commit.html.haml
@@ -19,24 +19,17 @@
.pull-right
- if ci_commit
= render_ci_status(ci_commit)
- &nbsp;
= clipboard_button(clipboard_text: commit.id)
= link_to commit.short_id, namespace_project_commit_path(project.namespace, project, commit), class: "commit_short_id"
- .notes_count
- - if note_count > 0
- %span.light
- %i.fa.fa-comments
- = note_count
-
- if commit.description?
.commit-row-description.js-toggle-content
%pre
= preserve(markdown(escape_once(commit.description), pipeline: :single_line))
.commit-row-info
+ by
= commit_author_link(commit, avatar: true, size: 24)
- authored
.committed_ago
#{time_ago_with_tooltip(commit.committed_date, skip_js: true)} &nbsp;
= link_to_browse_code(project, commit)
diff --git a/app/views/projects/labels/_label.html.haml b/app/views/projects/labels/_label.html.haml
index 0612863296a..097a65969a6 100644
--- a/app/views/projects/labels/_label.html.haml
+++ b/app/views/projects/labels/_label.html.haml
@@ -1,24 +1,27 @@
%li{id: dom_id(label)}
= render "shared/label_row", label: label
- .pull-right
- %strong.append-right-20
+ .pull-info-right
+ %span.append-right-20
= link_to_label(label, type: :merge_request) do
- = pluralize label.open_merge_requests_count, 'open merge request'
+ = pluralize label.open_merge_requests_count, 'merge request'
- %strong.append-right-20
+ %span.append-right-20
= link_to_label(label) do
= pluralize label.open_issues_count(current_user), 'open issue'
- if current_user
.label-subscription{data: {url: toggle_subscription_namespace_project_label_path(@project.namespace, @project, label)}}
.subscription-status{data: {status: label_subscription_status(label)}}
- %button.btn.btn-sm.btn-info.subscribe-button
+
+ %a.subscribe-button.btn.action-buttons{data: {toggle: "tooltip"}}
%span= label_subscription_toggle_button_text(label)
- if can? current_user, :admin_label, @project
- = link_to 'Edit', edit_namespace_project_label_path(@project.namespace, @project, label), class: 'btn btn-sm'
- = link_to 'Delete', namespace_project_label_path(@project.namespace, @project, label), class: 'btn btn-sm btn-remove remove-row', method: :delete, remote: true, data: {confirm: "Remove this label? Are you sure?"}
+ = link_to edit_namespace_project_label_path(@project.namespace, @project, label), title: "Edit", class: 'btn action-buttons', data: {toggle: "tooltip"} do
+ %i.fa.fa-pencil-square-o
+ = link_to namespace_project_label_path(@project.namespace, @project, label), title: "Delete", class: 'btn action-buttons remove-row', method: :delete, remote: true, data: {confirm: "Remove this label? Are you sure?", toggle: "tooltip"} do
+ %i.fa.fa-trash-o
- if current_user
:javascript
diff --git a/app/views/projects/merge_requests/_new_compare.html.haml b/app/views/projects/merge_requests/_new_compare.html.haml
index 01dc7519bee..cae5d452317 100644
--- a/app/views/projects/merge_requests/_new_compare.html.haml
+++ b/app/views/projects/merge_requests/_new_compare.html.haml
@@ -5,27 +5,71 @@
.hide.alert.alert-danger.mr-compare-errors
.merge-request-branches.row
.col-md-6
- .panel.panel-default
+ .panel.panel-default.panel-new-merge-request
.panel-heading
- %strong Source branch
- .panel-body
- = f.select(:source_project_id, [[@merge_request.source_project_path,@merge_request.source_project.id]] , {}, { class: 'source_project select2 span3', disabled: @merge_request.persisted?, required: true })
- &nbsp;
- = f.select(:source_branch, @merge_request.source_branches, { include_blank: true }, { class: 'source_branch select2 span2', required: true, data: { placeholder: "Select source branch" } })
+ Source branch
+ .panel-body.clearfix
+ .merge-request-select.dropdown
+ = f.hidden_field :source_project_id
+ = dropdown_toggle @merge_request.source_project_path, { toggle: "dropdown", field_name: "#{f.object_name}[source_project_id]", disabled: @merge_request.persisted? }, { toggle_class: "js-compare-dropdown js-source-project" }
+ .dropdown-menu.dropdown-menu-selectable.dropdown-source-project
+ = dropdown_title("Select source project")
+ = dropdown_filter("Search projects")
+ = dropdown_content do
+ - is_active = f.object.source_project_id == @merge_request.source_project.id
+ %ul
+ %li
+ %a{ href: "#", class: "#{("is-active" if is_active)}", data: { id: @merge_request.source_project.id } }
+ = @merge_request.source_project_path
+ .merge-request-select.dropdown
+ = f.hidden_field :source_branch
+ = dropdown_toggle "Select source branch", { toggle: "dropdown", field_name: "#{f.object_name}[source_branch]" }, { toggle_class: "js-compare-dropdown js-source-branch" }
+ .dropdown-menu.dropdown-menu-selectable.dropdown-source-branch
+ = dropdown_title("Select source branch")
+ = dropdown_filter("Search branches")
+ = dropdown_content do
+ %ul
+ - @merge_request.source_branches.each do |branch|
+ %li
+ %a{ href: "#", class: "#{("is-active" if f.object.source_branch == branch)}", data: { id: branch } }
+ = branch
.panel-footer
- .mr_source_commit
+ = icon('spinner spin', class: 'js-source-loading')
+ %ul.list-unstyled.mr_source_commit
.col-md-6
- .panel.panel-default
+ .panel.panel-default.panel-new-merge-request
.panel-heading
- %strong Target branch
- .panel-body
+ Target branch
+ .panel-body.clearfix
- projects = @project.forked_from_project.nil? ? [@project] : [@project, @project.forked_from_project]
- = f.select(:target_project_id, options_from_collection_for_select(projects, 'id', 'path_with_namespace', f.object.target_project_id), {}, { class: 'target_project select2 span3', disabled: @merge_request.persisted?, required: true })
- &nbsp;
- = f.select(:target_branch, @merge_request.target_branches, { include_blank: true }, { class: 'target_branch select2 span2', required: true, data: { placeholder: "Select target branch" } })
+ .merge-request-select.dropdown
+ = f.hidden_field :target_project_id
+ = dropdown_toggle f.object.target_project.path_with_namespace, { toggle: "dropdown", field_name: "#{f.object_name}[target_project_id]", disabled: @merge_request.persisted? }, { toggle_class: "js-compare-dropdown js-target-project" }
+ .dropdown-menu.dropdown-menu-selectable.dropdown-target-project
+ = dropdown_title("Select target project")
+ = dropdown_filter("Search projects")
+ = dropdown_content do
+ %ul
+ - projects.each do |project|
+ %li
+ %a{ href: "#", class: "#{("is-active" if f.object.target_project_id == project.id)}", data: { id: project.id } }
+ = project.path_with_namespace
+ .merge-request-select.dropdown
+ = 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-menu.dropdown-menu-selectable.dropdown-target-branch.js-target-branch-dropdown
+ = dropdown_title("Select target branch")
+ = dropdown_filter("Search branches")
+ = dropdown_content do
+ %ul
+ - @merge_request.target_branches.each do |branch|
+ %li
+ %a{ href: "#", class: "#{("is-active" if f.object.target_branch == branch)}", data: { id: branch } }
+ = branch
.panel-footer
- .mr_target_commit
+ = icon('spinner spin', class: "js-target-loading")
+ %ul.list-unstyled.mr_target_commit
- if @merge_request.errors.any?
.alert.alert-danger
@@ -45,40 +89,11 @@
and
%span.label-branch #{@merge_request.target_branch}
are the same.
-
-
- .form-actions
- = f.submit 'Compare branches and continue', class: "btn btn-new mr-compare-btn"
-
-:javascript
- var source_branch = $("#merge_request_source_branch")
- , target_branch = $("#merge_request_target_branch")
- , target_project = $("#merge_request_target_project_id");
-
- $.get("#{branch_from_namespace_project_merge_requests_path(@source_project.namespace, @source_project)}", {ref: source_branch.val() });
- $.get("#{branch_to_namespace_project_merge_requests_path(@source_project.namespace, @source_project)}", {target_project_id: target_project.val(),ref: target_branch.val() });
-
- target_project.on("change", function() {
- $.get("#{update_branches_namespace_project_merge_requests_path(@source_project.namespace, @source_project)}", {target_project_id: $(this).val() });
- });
- source_branch.on("change", function() {
- $.get("#{branch_from_namespace_project_merge_requests_path(@source_project.namespace, @source_project)}", {ref: $(this).val() });
- $(".mr-compare-errors").fadeOut();
- $(".mr-compare-btn").enable();
- });
- target_branch.on("change", function() {
- $.get("#{branch_to_namespace_project_merge_requests_path(@source_project.namespace, @source_project)}", {target_project_id: target_project.val(),ref: $(this).val() });
- $(".mr-compare-errors").fadeOut();
- $(".mr-compare-btn").enable();
- });
-
+ = f.submit 'Compare branches and continue', class: "btn btn-new mr-compare-btn"
:javascript
- $(".merge-request-form").on('submit', function () {
- if ($("#merge_request_source_branch").val() === "" || $('#merge_request_target_branch').val() === "") {
- $(".mr-compare-errors").html("You must select source and target branch to proceed");
- $(".mr-compare-errors").fadeIn();
- event.preventDefault();
- return;
- }
+ new Compare({
+ targetProjectUrl: "#{update_branches_namespace_project_merge_requests_path(@source_project.namespace, @source_project)}",
+ sourceBranchUrl: "#{branch_from_namespace_project_merge_requests_path(@source_project.namespace, @source_project)}",
+ targetBranchUrl: "#{branch_to_namespace_project_merge_requests_path(@source_project.namespace, @source_project)}"
});
diff --git a/app/views/projects/merge_requests/branch_from.html.haml b/app/views/projects/merge_requests/branch_from.html.haml
new file mode 100644
index 00000000000..4f90dde6fa8
--- /dev/null
+++ b/app/views/projects/merge_requests/branch_from.html.haml
@@ -0,0 +1 @@
+= commit_to_html(@commit, @source_project, false)
diff --git a/app/views/projects/merge_requests/branch_from.js.haml b/app/views/projects/merge_requests/branch_from.js.haml
deleted file mode 100644
index 9210798f39c..00000000000
--- a/app/views/projects/merge_requests/branch_from.js.haml
+++ /dev/null
@@ -1,3 +0,0 @@
-:plain
- $(".mr_source_commit").html("#{commit_to_html(@commit, @source_project, false)}");
- $('.js-timeago').timeago()
diff --git a/app/views/projects/merge_requests/branch_to.html.haml b/app/views/projects/merge_requests/branch_to.html.haml
new file mode 100644
index 00000000000..67a7a6bcec9
--- /dev/null
+++ b/app/views/projects/merge_requests/branch_to.html.haml
@@ -0,0 +1 @@
+= commit_to_html(@commit, @target_project, false)
diff --git a/app/views/projects/merge_requests/branch_to.js.haml b/app/views/projects/merge_requests/branch_to.js.haml
deleted file mode 100644
index 32fe2d535f3..00000000000
--- a/app/views/projects/merge_requests/branch_to.js.haml
+++ /dev/null
@@ -1,3 +0,0 @@
-:plain
- $(".mr_target_commit").html("#{commit_to_html(@commit, @target_project, false)}");
- $('.js-timeago').timeago()
diff --git a/app/views/projects/merge_requests/update_branches.html.haml b/app/views/projects/merge_requests/update_branches.html.haml
new file mode 100644
index 00000000000..1b93188a10c
--- /dev/null
+++ b/app/views/projects/merge_requests/update_branches.html.haml
@@ -0,0 +1,5 @@
+%ul
+ - @target_branches.each do |branch|
+ %li
+ %a{ href: "#", class: "#{("is-active" if "a" == branch)}", data: { id: branch } }
+ = branch
diff --git a/app/views/projects/merge_requests/update_branches.js.haml b/app/views/projects/merge_requests/update_branches.js.haml
deleted file mode 100644
index ca21b3bc0de..00000000000
--- a/app/views/projects/merge_requests/update_branches.js.haml
+++ /dev/null
@@ -1,9 +0,0 @@
-:plain
- $(".target_branch").html("#{escape_javascript(options_for_select(@target_branches))}");
-
- $('select.target_branch').select2({
- width: 'resolve',
- dropdownAutoWidth: true
- });
-
- $(".mr_target_commit").html("");
diff --git a/app/views/shared/_label_row.html.haml b/app/views/shared/_label_row.html.haml
index 4b47b0291be..b38c5e18efb 100644
--- a/app/views/shared/_label_row.html.haml
+++ b/app/views/shared/_label_row.html.haml
@@ -1,4 +1,5 @@
%span.label-row
- = link_to_label(label, tooltip: false)
+ %span.label-name
+ = link_to_label(label, tooltip: false)
%span.prepend-left-10
= markdown(label.description, pipeline: :single_line)
diff --git a/app/views/shared/issuable/_form.html.haml b/app/views/shared/issuable/_form.html.haml
index e2a9e5bfb92..5244e7f6ccb 100644
--- a/app/views/shared/issuable/_form.html.haml
+++ b/app/views/shared/issuable/_form.html.haml
@@ -53,10 +53,11 @@
.issue-assignee
= f.label :assignee_id, "Assignee", class: 'control-label'
.col-sm-10
- = users_select_tag("#{issuable.class.model_name.param_key}[assignee_id]",
- placeholder: 'Select assignee', class: 'custom-form-control', null_user: true,
- selected: issuable.assignee_id, project: @target_project || @project,
- first_user: true, current_user: true, include_blank: true)
+ .issuable-form-select-holder
+ = users_select_tag("#{issuable.class.model_name.param_key}[assignee_id]",
+ placeholder: 'Select assignee', class: 'custom-form-control', null_user: true,
+ selected: issuable.assignee_id, project: @target_project || @project,
+ first_user: true, current_user: true, include_blank: true)
&nbsp;
= link_to 'Assign to me', '#', class: 'btn assign-to-me-link'
.form-group
@@ -64,8 +65,9 @@
= f.label :milestone_id, "Milestone", class: 'control-label'
.col-sm-10
- if milestone_options(issuable).present?
- = f.select(:milestone_id, milestone_options(issuable),
- { include_blank: true }, { class: 'select2', data: { placeholder: 'Select milestone' } })
+ .issuable-form-select-holder
+ = f.select(:milestone_id, milestone_options(issuable),
+ { include_blank: true }, { class: 'select2', data: { placeholder: 'Select milestone' } })
- else
.prepend-top-10
%span.light No open milestones available.
diff --git a/app/views/votes/_votes_block.html.haml b/app/views/votes/_votes_block.html.haml
index 49cfcd53d74..dc249155b92 100644
--- a/app/views/votes/_votes_block.html.haml
+++ b/app/views/votes/_votes_block.html.haml
@@ -1,6 +1,6 @@
.awards.votes-block
- awards_sort(votable.notes.awards.grouped_awards).each do |emoji, notes|
- %button.btn.award-control.js-emoji-btn.has-tooltip{class: (note_active_class(notes, current_user)), title: emoji_author_list(notes, current_user), data: {placement: "top"}}
+ %button.btn.award-control.js-emoji-btn.has-tooltip{class: (note_active_class(notes, current_user)), data: {placement: "top", original_title: emoji_author_list(notes, current_user)}}
= emoji_icon(emoji, sprite: false)
%span.award-control-text.js-counter
= notes.count
diff --git a/db/fixtures/development/07_milestones.rb b/db/fixtures/development/07_milestones.rb
index e028ac82ba3..540e4e68259 100644
--- a/db/fixtures/development/07_milestones.rb
+++ b/db/fixtures/development/07_milestones.rb
@@ -4,7 +4,7 @@ Gitlab::Seeder.quiet do
milestone_params = {
title: "v#{i}.0",
description: FFaker::Lorem.sentence,
- state: ['opened', 'closed'].sample,
+ state: [:active, :closed].sample,
}
milestone = Milestones::CreateService.new(
diff --git a/db/migrate/20130315124931_user_color_scheme.rb b/db/migrate/20130315124931_user_color_scheme.rb
index fe139e32ea7..56c9a31ee3c 100644
--- a/db/migrate/20130315124931_user_color_scheme.rb
+++ b/db/migrate/20130315124931_user_color_scheme.rb
@@ -1,7 +1,9 @@
class UserColorScheme < ActiveRecord::Migration
+ include Gitlab::Database
+
def up
add_column :users, :color_scheme_id, :integer, null: false, default: 1
- User.where(dark_scheme: true).update_all(color_scheme_id: 2)
+ execute("UPDATE users SET color_scheme_id = 2 WHERE dark_scheme = #{true_value}")
remove_column :users, :dark_scheme
end
diff --git a/db/migrate/20130403003950_add_last_activity_column_into_project.rb b/db/migrate/20130403003950_add_last_activity_column_into_project.rb
index 2a036bd9993..85e31608d79 100644
--- a/db/migrate/20130403003950_add_last_activity_column_into_project.rb
+++ b/db/migrate/20130403003950_add_last_activity_column_into_project.rb
@@ -3,14 +3,16 @@ class AddLastActivityColumnIntoProject < ActiveRecord::Migration
add_column :projects, :last_activity_at, :datetime
add_index :projects, :last_activity_at
- Project.find_each do |project|
- last_activity_date = if project.last_activity
- project.last_activity.created_at
- else
- project.updated_at
- end
+ select_all('SELECT id, updated_at FROM projects').each do |project|
+ project_id = project['id']
+ update_date = project['updated_at']
+ event = select_one("SELECT created_at FROM events WHERE project_id = #{project_id} ORDER BY created_at DESC LIMIT 1")
- project.update_attribute(:last_activity_at, last_activity_date)
+ if event && event['created_at']
+ update_date = event['created_at']
+ end
+
+ execute("UPDATE projects SET last_activity_at = '#{update_date}' WHERE id = #{project_id}")
end
end
diff --git a/db/migrate/20131112220935_add_visibility_level_to_projects.rb b/db/migrate/20131112220935_add_visibility_level_to_projects.rb
index cf1e9f912a0..89421cbedad 100644
--- a/db/migrate/20131112220935_add_visibility_level_to_projects.rb
+++ b/db/migrate/20131112220935_add_visibility_level_to_projects.rb
@@ -1,13 +1,15 @@
class AddVisibilityLevelToProjects < ActiveRecord::Migration
+ include Gitlab::Database
+
def self.up
add_column :projects, :visibility_level, :integer, :default => 0, :null => false
- Project.where(public: true).update_all(visibility_level: Gitlab::VisibilityLevel::PUBLIC)
+ execute("UPDATE projects SET visibility_level = #{Gitlab::VisibilityLevel::PUBLIC} WHERE public = #{true_value}")
remove_column :projects, :public
end
def self.down
add_column :projects, :public, :boolean, :default => false, :null => false
- Project.where(visibility_level: Gitlab::VisibilityLevel::PUBLIC).update_all(public: true)
+ execute("UPDATE projects SET public = #{true_value} WHERE visibility_level = #{Gitlab::VisibilityLevel::PUBLIC}")
remove_column :projects, :visibility_level
end
end
diff --git a/db/migrate/20140313092127_migrate_already_imported_projects.rb b/db/migrate/20140313092127_migrate_already_imported_projects.rb
index f4392c0f05e..0a9f73a5758 100644
--- a/db/migrate/20140313092127_migrate_already_imported_projects.rb
+++ b/db/migrate/20140313092127_migrate_already_imported_projects.rb
@@ -1,12 +1,14 @@
class MigrateAlreadyImportedProjects < ActiveRecord::Migration
+ include Gitlab::Database
+
def up
- Project.where(imported: true).update_all(import_status: "finished")
- Project.where(imported: false).update_all(import_status: "none")
+ execute("UPDATE projects SET import_status = 'finished' WHERE imported = #{true_value}")
+ execute("UPDATE projects SET import_status = 'none' WHERE imported = #{false_value}")
remove_column :projects, :imported
end
def down
add_column :projects, :imported, :boolean, default: false
- Project.where(import_status: 'finished').update_all(imported: true)
+ execute("UPDATE projects SET imported = #{true_value} WHERE import_status = 'finished'")
end
end
diff --git a/db/migrate/20141007100818_add_visibility_level_to_snippet.rb b/db/migrate/20141007100818_add_visibility_level_to_snippet.rb
index 7f125acb5d1..93826185e8b 100644
--- a/db/migrate/20141007100818_add_visibility_level_to_snippet.rb
+++ b/db/migrate/20141007100818_add_visibility_level_to_snippet.rb
@@ -1,9 +1,11 @@
class AddVisibilityLevelToSnippet < ActiveRecord::Migration
+ include Gitlab::Database
+
def up
add_column :snippets, :visibility_level, :integer, :default => 0, :null => false
- Snippet.where(private: true).update_all(visibility_level: Gitlab::VisibilityLevel::PRIVATE)
- Snippet.where(private: false).update_all(visibility_level: Gitlab::VisibilityLevel::INTERNAL)
+ execute("UPDATE snippets SET visibility_level = #{Gitlab::VisibilityLevel::PRIVATE} WHERE private = #{true_value}")
+ execute("UPDATE snippets SET visibility_level = #{Gitlab::VisibilityLevel::INTERNAL} WHERE private = #{false_value}")
add_index :snippets, :visibility_level
@@ -12,10 +14,10 @@ class AddVisibilityLevelToSnippet < ActiveRecord::Migration
def down
add_column :snippets, :private, :boolean, :default => false, :null => false
-
- Snippet.where(visibility_level: Gitlab::VisibilityLevel::INTERNAL).update_all(private: false)
- Snippet.where(visibility_level: Gitlab::VisibilityLevel::PRIVATE).update_all(private: true)
-
+
+ execute("UPDATE snippets SET private = #{false_value} WHERE visibility_level = #{Gitlab::VisibilityLevel::INTERNAL}")
+ execute("UPDATE snippets SET private = #{true_value} WHERE visibility_level = #{Gitlab::VisibilityLevel::PRIVATE}")
+
remove_column :snippets, :visibility_level
end
end
diff --git a/doc/ci/build_artifacts/README.md b/doc/ci/build_artifacts/README.md
index 71db5aa5dc8..9553bb11e9d 100644
--- a/doc/ci/build_artifacts/README.md
+++ b/doc/ci/build_artifacts/README.md
@@ -1,7 +1,10 @@
# Introduction to build artifacts
Artifacts is a list of files and directories which are attached to a build
-after it completes successfully.
+after it completes successfully. This feature is enabled by default in all GitLab installations.
+
+_If you are searching for ways to use artifacts, jump to
+[Defining artifacts in `.gitlab-ci.yml`](#defining-artifacts-in-gitlab-ciyml)._
Since GitLab 8.2 and [GitLab Runner] 0.7.0, build artifacts that are created by
GitLab Runner are uploaded to GitLab and are downloadable as a single archive
@@ -16,13 +19,9 @@ The artifacts browser will be available only for new artifacts that are sent
to GitLab using GitLab Runner version 1.0 and up. It will not be possible to
browse old artifacts already uploaded to GitLab.
-## Enabling build artifacts
-
-_If you are searching for ways to use artifacts, jump to
-[Defining artifacts in `.gitlab-ci.yml`](#defining-artifacts-in-gitlab-ciyml)._
+## Disabling build artifacts
-The artifacts feature is enabled by default in all GitLab installations.
-To disable it site-wide, follow the steps below.
+To disable artifacts site-wide, follow the steps below.
---
diff --git a/doc/integration/README.md b/doc/integration/README.md
index 7c8f785a61f..6fe04aa2a06 100644
--- a/doc/integration/README.md
+++ b/doc/integration/README.md
@@ -19,26 +19,15 @@ See the documentation below for details on how to configure these services.
GitLab Enterprise Edition contains [advanced Jenkins support][jenkins].
+[jenkins]: http://doc.gitlab.com/ee/integration/jenkins.html
+
+
## Project services
Integration with services such as Campfire, Flowdock, Gemnasium, HipChat,
Pivotal Tracker, and Slack are available in the form of a [Project Service][].
-You can find these within GitLab in the Services page under Project Settings if
-you are at least a master on the project.
-Project Services are a bit like plugins in that they allow a lot of freedom in
-adding functionality to GitLab. For example there is also a service that can
-send an email every time someone pushes new commits.
-Because GitLab is open source we can ship with the code and tests for all
-plugins. This allows the community to keep the plugins up to date so that they
-always work in newer GitLab versions.
-
-For an overview of what projects services are available without logging in,
-please see the [project_services directory][projects-code].
-
-[jenkins]: http://doc.gitlab.com/ee/integration/jenkins.html
[Project Service]: ../project_services/project_services.md
-[projects-code]: https://gitlab.com/gitlab-org/gitlab-ce/tree/master/app/models/project_services
## SSL certificate errors
diff --git a/doc/project_services/project_services.md b/doc/project_services/project_services.md
index 3fea2cff0b9..a5af620d9be 100644
--- a/doc/project_services/project_services.md
+++ b/doc/project_services/project_services.md
@@ -1,7 +1,24 @@
# Project Services
Project services allow you to integrate GitLab with other applications. Below
-is list of the currently supported ones. Click on the service links to see
+is list of the currently supported ones.
+
+You can find these within GitLab in the Services page under Project Settings if
+you are at least a master on the project.
+Project Services are a bit like plugins in that they allow a lot of freedom in
+adding functionality to GitLab. For example there is also a service that can
+send an email every time someone pushes new commits.
+
+Because GitLab is open source we can ship with the code and tests for all
+plugins. This allows the community to keep the plugins up to date so that they
+always work in newer GitLab versions.
+
+For an overview of what projects services are available without logging in,
+please see the [project_services directory][projects-code].
+
+[projects-code]: https://gitlab.com/gitlab-org/gitlab-ce/tree/master/app/models/project_services
+
+Click on the service links to see
further configuration instructions and details. Contributions are welcome.
## Services
diff --git a/features/project/forked_merge_requests.feature b/features/project/forked_merge_requests.feature
index 10bd6fec803..67f1e117f7f 100644
--- a/features/project/forked_merge_requests.feature
+++ b/features/project/forked_merge_requests.feature
@@ -4,6 +4,7 @@ Feature: Project Forked Merge Requests
And I am a member of project "Shop"
And I have a project forked off of "Shop" called "Forked Shop"
+ @javascript
Scenario: I submit new unassigned merge request to a forked project
Given I visit project "Forked Shop" merge requests page
And I click link "New Merge Request"
diff --git a/features/project/merge_requests.feature b/features/project/merge_requests.feature
index 823658b4f24..ecda4ea8240 100644
--- a/features/project/merge_requests.feature
+++ b/features/project/merge_requests.feature
@@ -70,6 +70,7 @@ Feature: Project Merge Requests
When I click link "Reopen"
Then I should see reopened merge request "Bug NS-04"
+ @javascript
Scenario: I submit new unassigned merge request
Given I click link "New Merge Request"
And I submit new merge request "Wiki Feature"
diff --git a/features/steps/project/forked_merge_requests.rb b/features/steps/project/forked_merge_requests.rb
index 7e4425ff662..612bb8fd8b1 100644
--- a/features/steps/project/forked_merge_requests.rb
+++ b/features/steps/project/forked_merge_requests.rb
@@ -34,10 +34,14 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps
end
step 'I fill out a "Merge Request On Forked Project" merge request' do
- select @forked_project.path_with_namespace, from: "merge_request_source_project_id"
- select @project.path_with_namespace, from: "merge_request_target_project_id"
- select "fix", from: "merge_request_source_branch"
- select "master", from: "merge_request_target_branch"
+ first('.js-source-project').click
+ first('.dropdown-source-project a', text: @forked_project.path_with_namespace)
+
+ first('.js-target-project').click
+ first('.dropdown-target-project a', text: @project.path_with_namespace)
+
+ first('.js-source-branch').click
+ first('.dropdown-source-branch .dropdown-content a', text: 'fix').click
click_button "Compare branches and continue"
@@ -115,10 +119,10 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps
end
step 'I fill out an invalid "Merge Request On Forked Project" merge request' do
- expect(find(:select, "merge_request_source_project_id", {}).value).to eq @forked_project.id.to_s
- expect(find(:select, "merge_request_target_project_id", {}).value).to eq @project.id.to_s
- expect(find(:select, "merge_request_source_branch", {}).value).to eq ""
- expect(find(:select, "merge_request_target_branch", {}).value).to eq "master"
+ expect(find_by_id("merge_request_source_project_id", visible: false).value).to eq @forked_project.id.to_s
+ expect(find_by_id("merge_request_target_project_id", visible: false).value).to eq @project.id.to_s
+ expect(find_by_id("merge_request_source_branch", visible: false).value).to eq nil
+ expect(find_by_id("merge_request_target_branch", visible: false).value).to eq "master"
click_button "Compare branches"
end
@@ -127,7 +131,7 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps
end
step 'the target repository should be the original repository' do
- expect(page).to have_select("merge_request_target_project_id", selected: @project.path_with_namespace)
+ expect(find_by_id("merge_request_target_project_id").value).to eq "#{@project.id}"
end
step 'I click "Assign to" dropdown"' do
diff --git a/features/steps/project/issues/labels.rb b/features/steps/project/issues/labels.rb
index 2ab8956867b..0ca2d6257c3 100644
--- a/features/steps/project/issues/labels.rb
+++ b/features/steps/project/issues/labels.rb
@@ -15,7 +15,7 @@ class Spinach::Features::ProjectIssuesLabels < Spinach::FeatureSteps
step 'I delete all labels' do
page.within '.labels' do
- page.all('.btn-remove').each do |remove|
+ page.all('.remove-row').each do |remove|
remove.click
sleep 0.05
end
diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb
index a4f02b590ea..f0af0d097fa 100644
--- a/features/steps/project/merge_requests.rb
+++ b/features/steps/project/merge_requests.rb
@@ -93,8 +93,12 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end
step 'I submit new merge request "Wiki Feature"' do
- select "fix", from: "merge_request_source_branch"
- select "feature", from: "merge_request_target_branch"
+ find('.js-source-branch').click
+ find('.dropdown-source-branch .dropdown-content a', text: 'fix').click
+
+ find('.js-target-branch').click
+ first('.dropdown-target-branch .dropdown-content a', text: 'feature').click
+
click_button "Compare branches"
fill_in "merge_request_title", with: "Wiki Feature"
click_button "Submit merge request"
diff --git a/features/steps/project/source/browse_files.rb b/features/steps/project/source/browse_files.rb
index 243469b8e7d..e072505e5d7 100644
--- a/features/steps/project/source/browse_files.rb
+++ b/features/steps/project/source/browse_files.rb
@@ -213,13 +213,12 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
end
step 'I see Browse file link' do
- expect(page).to have_link 'Browse File »'
- expect(page).not_to have_link 'Browse Files »'
+ expect(page).to have_link 'Browse File'
+ expect(page).not_to have_link 'Browse Files'
end
step 'I see Browse code link' do
- expect(page).to have_link 'Browse Files »'
- expect(page).not_to have_link 'Browse File »'
+ expect(page).to have_link 'Browse Files'
expect(page).not_to have_link 'Browse Directory »'
end
diff --git a/spec/features/issues/award_emoji_spec.rb b/spec/features/issues/award_emoji_spec.rb
new file mode 100644
index 00000000000..41af789aae2
--- /dev/null
+++ b/spec/features/issues/award_emoji_spec.rb
@@ -0,0 +1,64 @@
+require 'rails_helper'
+
+describe 'Awards Emoji', feature: true do
+ let!(:project) { create(:project) }
+ let!(:user) { create(:user) }
+
+ before do
+ project.team << [user, :master]
+ login_as(user)
+ end
+
+ describe 'Click award emoji from issue#show' do
+ let!(:issue) do
+ create(:issue,
+ author: @user,
+ assignee: @user,
+ project: project)
+ end
+
+ before do
+ visit namespace_project_issue_path(project.namespace, project, issue)
+ end
+
+ it 'should increment the thumbsdown emoji', js: true do
+ find('[data-emoji="thumbsdown"]').click
+ sleep 2
+ expect(thumbsdown_emoji).to have_text("1")
+ end
+
+ context 'click the thumbsup emoji' do
+
+ it 'should increment the thumbsup emoji', js: true do
+ find('[data-emoji="thumbsup"]').click
+ sleep 2
+ expect(thumbsup_emoji).to have_text("1")
+ end
+
+ it 'should decrement the thumbsdown emoji', js: true do
+ expect(thumbsdown_emoji).to have_text("0")
+ end
+ end
+
+ context 'click the thumbsdown emoji' do
+
+ it 'should increment the thumbsdown emoji', js: true do
+ find('[data-emoji="thumbsdown"]').click
+ sleep 2
+ expect(thumbsdown_emoji).to have_text("1")
+ end
+
+ it 'should decrement the thumbsup emoji', js: true do
+ expect(thumbsup_emoji).to have_text("0")
+ end
+ end
+ end
+
+ def thumbsup_emoji
+ page.all('span.js-counter').first
+ end
+
+ def thumbsdown_emoji
+ page.all('span.js-counter').last
+ end
+end
diff --git a/spec/features/merge_requests/create_new_mr_spec.rb b/spec/features/merge_requests/create_new_mr_spec.rb
index fd02d584848..00b60bd0e75 100644
--- a/spec/features/merge_requests/create_new_mr_spec.rb
+++ b/spec/features/merge_requests/create_new_mr_spec.rb
@@ -1,6 +1,6 @@
require 'spec_helper'
-feature 'Create New Merge Request', feature: true, js: false do
+feature 'Create New Merge Request', feature: true, js: true do
let(:user) { create(:user) }
let(:project) { create(:project, :public) }
@@ -13,9 +13,12 @@ feature 'Create New Merge Request', feature: true, js: false do
it 'generates a diff for an orphaned branch' do
click_link 'New Merge Request'
- select "orphaned-branch", from: "merge_request_source_branch"
- select "master", from: "merge_request_target_branch"
+
+ first('.js-source-branch').click
+ first('.dropdown-source-branch .dropdown-content a', text: 'orphaned-branch').click
+
click_button "Compare branches"
+ click_link "Changes"
expect(page).to have_content "README.md"
expect(page).to have_content "wm.png"
@@ -23,6 +26,8 @@ feature 'Create New Merge Request', feature: true, js: false do
fill_in "merge_request_title", with: "Orphaned MR test"
click_button "Submit merge request"
+ click_link "Check out branch"
+
expect(page).to have_content 'git checkout -b orphaned-branch origin/orphaned-branch'
end
end
diff --git a/spec/helpers/gitlab_markdown_helper_spec.rb b/spec/helpers/gitlab_markdown_helper_spec.rb
index 9adcd916ced..13de88e2f21 100644
--- a/spec/helpers/gitlab_markdown_helper_spec.rb
+++ b/spec/helpers/gitlab_markdown_helper_spec.rb
@@ -150,13 +150,6 @@ describe GitlabMarkdownHelper do
end
end
- describe 'random_markdown_tip' do
- it 'returns a random Markdown tip' do
- stub_const("#{described_class}::MARKDOWN_TIPS", ['Random tip'])
- expect(random_markdown_tip).to eq 'Random tip'
- end
- end
-
describe '#first_line_in_markdown' do
let(:text) { "@#{user.username}, can you look at this?\nHello world\n"}