From 08f14ef4488517bd7408eb69ec07f5e1a350d8fa Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Thu, 7 Jul 2016 12:18:33 +0100 Subject: Fixed GFM autocomplete not loading on wiki pages Closes #19580 --- CHANGELOG | 1 + app/views/layouts/_init_auto_complete.html.haml | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index bc9bb7747a4..93586ca7a7b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -14,6 +14,7 @@ v 8.10.0 (unreleased) - Let Workhorse serve format-patch diffs - Make images fit to the size of the viewport !4810 - Fix check for New Branch button on Issue page !4630 (winniehell) + - Fix GFM autocomplete not working on wiki pages - Fix MR-auto-close text added to description. !4836 - Fix issue, preventing users w/o push access to sort tags !5105 (redetection) - Add Spring EmojiOne updates. diff --git a/app/views/layouts/_init_auto_complete.html.haml b/app/views/layouts/_init_auto_complete.html.haml index 12e7ed0e792..79483d629d0 100644 --- a/app/views/layouts/_init_auto_complete.html.haml +++ b/app/views/layouts/_init_auto_complete.html.haml @@ -1,7 +1,7 @@ - project = @target_project || @project +- noteable_class = @noteable.nil? ? nil : @noteable.class -- if @noteable - :javascript - GitLab.GfmAutoComplete.dataSource = "#{autocomplete_sources_namespace_project_path(project.namespace, project, type: @noteable.class, type_id: params[:id])}" - GitLab.GfmAutoComplete.cachedData = undefined; - GitLab.GfmAutoComplete.setup(); +:javascript + GitLab.GfmAutoComplete.dataSource = "#{autocomplete_sources_namespace_project_path(project.namespace, project, type: noteable_class, type_id: params[:id])}" + GitLab.GfmAutoComplete.cachedData = undefined; + GitLab.GfmAutoComplete.setup(); -- cgit v1.2.1 From de6ca8ef3a8ae6f783dc1b0684e7ad65be388564 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Thu, 14 Jul 2016 08:44:22 +0100 Subject: Chnaged noteable class check --- app/views/layouts/_init_auto_complete.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/_init_auto_complete.html.haml b/app/views/layouts/_init_auto_complete.html.haml index 79483d629d0..351100f3523 100644 --- a/app/views/layouts/_init_auto_complete.html.haml +++ b/app/views/layouts/_init_auto_complete.html.haml @@ -1,5 +1,5 @@ - project = @target_project || @project -- noteable_class = @noteable.nil? ? nil : @noteable.class +- noteable_class = @noteable.class if @noteable.present? :javascript GitLab.GfmAutoComplete.dataSource = "#{autocomplete_sources_namespace_project_path(project.namespace, project, type: noteable_class, type_id: params[:id])}" -- cgit v1.2.1 From 5aea280fa7017cc4eac814c31eb45e024ba84a1e Mon Sep 17 00:00:00 2001 From: Annabel Dunstone Date: Thu, 14 Jul 2016 10:48:01 -0500 Subject: Add new fork svg icon --- app/assets/stylesheets/framework/buttons.scss | 20 ++++++++++++++++++++ app/views/projects/forks/index.html.haml | 4 ++-- app/views/shared/icons/_icon_fork.svg | 1 + 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 app/views/shared/icons/_icon_fork.svg diff --git a/app/assets/stylesheets/framework/buttons.scss b/app/assets/stylesheets/framework/buttons.scss index 590b8f54363..c6fe614f503 100644 --- a/app/assets/stylesheets/framework/buttons.scss +++ b/app/assets/stylesheets/framework/buttons.scss @@ -49,6 +49,20 @@ border-color: $border-dark; color: $color; } + + svg { + vertical-align: top; + position: relative; + top: 2px; + + path { + fill: $white-light; + } + + use { + stroke: $white-light; + } + } } @mixin btn-green { @@ -173,6 +187,12 @@ .caret { margin-left: 5px; } + + svg { + width: 16px; + height: auto; + vertical-align: middle; + } } .btn-lg { diff --git a/app/views/projects/forks/index.html.haml b/app/views/projects/forks/index.html.haml index dbe9ddfde2f..a1d79bdabda 100644 --- a/app/views/projects/forks/index.html.haml +++ b/app/views/projects/forks/index.html.haml @@ -31,11 +31,11 @@ - if current_user && can?(current_user, :fork_project, @project) - if current_user.already_forked?(@project) && current_user.manageable_namespaces.size < 2 = link_to namespace_project_path(current_user, current_user.fork_of(@project)), title: 'Go to your fork', class: 'btn btn-new' do - = icon('code-fork fw') + = custom_icon('icon_fork') Fork - else = link_to new_namespace_project_fork_path(@project.namespace, @project), title: "Fork project", class: 'btn btn-new' do - = icon('code-fork fw') + = custom_icon('icon_fork') Fork diff --git a/app/views/shared/icons/_icon_fork.svg b/app/views/shared/icons/_icon_fork.svg new file mode 100644 index 00000000000..420ffe3a55b --- /dev/null +++ b/app/views/shared/icons/_icon_fork.svg @@ -0,0 +1 @@ + \ No newline at end of file -- cgit v1.2.1 From 13c62cdbfad1cc7f140d59f018b6004f92e6d3b5 Mon Sep 17 00:00:00 2001 From: Annabel Dunstone Date: Fri, 15 Jul 2016 09:23:41 -0500 Subject: Add svg icon color to btn-color mixin --- app/assets/stylesheets/framework/buttons.scss | 14 ++++++-------- app/assets/stylesheets/pages/projects.scss | 11 +++++++++++ app/views/projects/buttons/_fork.html.haml | 4 ++-- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/app/assets/stylesheets/framework/buttons.scss b/app/assets/stylesheets/framework/buttons.scss index c6fe614f503..f87b8a2ad1c 100644 --- a/app/assets/stylesheets/framework/buttons.scss +++ b/app/assets/stylesheets/framework/buttons.scss @@ -51,16 +51,13 @@ } svg { - vertical-align: top; - position: relative; - top: 2px; path { - fill: $white-light; + fill: $color; } use { - stroke: $white-light; + stroke: $color; } } } @@ -189,9 +186,10 @@ } svg { - width: 16px; - height: auto; - vertical-align: middle; + height: 15px; + width: auto; + position: relative; + top: 2px; } } diff --git a/app/assets/stylesheets/pages/projects.scss b/app/assets/stylesheets/pages/projects.scss index ea9f7cf0540..7c36ce85fb1 100644 --- a/app/assets/stylesheets/pages/projects.scss +++ b/app/assets/stylesheets/pages/projects.scss @@ -129,6 +129,17 @@ color: $layout-link-gray; } + svg { + + path { + fill: $layout-link-gray; + } + + use { + stroke: $layout-link-gray; + } + } + .fa-caret-down { margin-left: 3px; } diff --git a/app/views/projects/buttons/_fork.html.haml b/app/views/projects/buttons/_fork.html.haml index a9eaed4c5f6..a098a082854 100644 --- a/app/views/projects/buttons/_fork.html.haml +++ b/app/views/projects/buttons/_fork.html.haml @@ -2,7 +2,7 @@ - if current_user && can?(current_user, :fork_project, @project) - if current_user.already_forked?(@project) && current_user.manageable_namespaces.size < 2 = link_to namespace_project_path(current_user, current_user.fork_of(@project)), title: 'Go to your fork', class: 'btn has-tooltip' do - = icon('code-fork fw') + = custom_icon('icon_fork') Fork %div.count-with-arrow %span.arrow @@ -10,7 +10,7 @@ = @project.forks_count - else = link_to new_namespace_project_fork_path(@project.namespace, @project), title: "Fork project", class: 'btn has-tooltip' do - = icon('code-fork fw') + = custom_icon('icon_fork') Fork %div.count-with-arrow %span.arrow -- cgit v1.2.1 From dd4f50b1874ac066c7e47be223e98d8a9b317fc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Mon, 18 Jul 2016 16:44:10 +0200 Subject: Fix build duration when build is not finished yet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- app/helpers/time_helper.rb | 26 +++++++++++----------- app/views/projects/builds/_sidebar.html.haml | 2 +- .../_generic_commit_status.html.haml | 2 +- spec/helpers/time_helper_spec.rb | 25 +++++++++------------ 4 files changed, 26 insertions(+), 29 deletions(-) diff --git a/app/helpers/time_helper.rb b/app/helpers/time_helper.rb index 8cb82c2d5cc..1926f03af07 100644 --- a/app/helpers/time_helper.rb +++ b/app/helpers/time_helper.rb @@ -1,14 +1,4 @@ module TimeHelper - def duration_in_words(finished_at, started_at) - if finished_at && started_at - interval_in_seconds = finished_at.to_i - started_at.to_i - elsif started_at - interval_in_seconds = Time.now.to_i - started_at.to_i - end - - time_interval_in_words(interval_in_seconds) - end - def time_interval_in_words(interval_in_seconds) minutes = interval_in_seconds / 60 seconds = interval_in_seconds - minutes * 60 @@ -25,9 +15,19 @@ module TimeHelper end def duration_in_numbers(finished_at, started_at) - diff_in_seconds = finished_at.to_i - started_at.to_i - time_format = diff_in_seconds < 1.hour ? "%M:%S" : "%H:%M:%S" + interval = interval_in_seconds(started_at, finished_at) + time_format = interval < 1.hour ? "%M:%S" : "%H:%M:%S" - Time.at(diff_in_seconds).utc.strftime(time_format) + Time.at(interval).utc.strftime(time_format) + end + + private + + def interval_in_seconds(started_at, finished_at = nil) + if started_at && finished_at + finished_at.to_i - started_at.to_i + elsif started_at + Time.now.to_i - started_at.to_i + end end end diff --git a/app/views/projects/builds/_sidebar.html.haml b/app/views/projects/builds/_sidebar.html.haml index cab21f0cf19..960d43039f4 100644 --- a/app/views/projects/builds/_sidebar.html.haml +++ b/app/views/projects/builds/_sidebar.html.haml @@ -49,7 +49,7 @@ - if @build.duration %p.build-detail-row %span.build-light-text Duration: - #{duration_in_words(@build.finished_at, @build.started_at)} + = time_interval_in_words(@build.duration) - if @build.finished_at %p.build-detail-row %span.build-light-text Finished: diff --git a/app/views/projects/generic_commit_statuses/_generic_commit_status.html.haml b/app/views/projects/generic_commit_statuses/_generic_commit_status.html.haml index 542827b2f15..331dc1fcc29 100644 --- a/app/views/projects/generic_commit_statuses/_generic_commit_status.html.haml +++ b/app/views/projects/generic_commit_statuses/_generic_commit_status.html.haml @@ -51,7 +51,7 @@ %td.duration - if generic_commit_status.duration = icon("clock-o") - #{duration_in_words(generic_commit_status.finished_at, generic_commit_status.started_at)} + = time_interval_in_words(generic_commit_status.duration) %td.timestamp - if generic_commit_status.finished_at diff --git a/spec/helpers/time_helper_spec.rb b/spec/helpers/time_helper_spec.rb index 3f62527c5bb..413ead944b9 100644 --- a/spec/helpers/time_helper_spec.rb +++ b/spec/helpers/time_helper_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe TimeHelper do - describe "#duration_in_words" do + describe "#time_interval_in_words" do it "returns minutes and seconds" do intervals_in_words = { 100 => "1 minute 40 seconds", @@ -11,26 +11,23 @@ describe TimeHelper do } intervals_in_words.each do |interval, expectation| - expect(duration_in_words(Time.now + interval, Time.now)).to eq(expectation) + expect(time_interval_in_words(interval)).to eq(expectation) end end - - it "calculates interval from now if there is no finished_at" do - expect(duration_in_words(nil, Time.now - 5)).to eq("5 seconds") - end end - describe "#time_interval_in_words" do + describe "#duration_in_numbers" do it "returns minutes and seconds" do - intervals_in_words = { - 100 => "1 minute 40 seconds", - 121 => "2 minutes 1 second", - 3721 => "62 minutes 1 second", - 0 => "0 seconds" + duration_in_numbers = { + [100, 0] => "01:40", + [121, 0] => "02:01", + [3721, 0] => "01:02:01", + [0, 0] => "00:00", + [nil, Time.now.to_i - 42] => "00:42" } - intervals_in_words.each do |interval, expectation| - expect(time_interval_in_words(interval)).to eq(expectation) + duration_in_numbers.each do |interval, expectation| + expect(duration_in_numbers(*interval)).to eq(expectation) end end end -- cgit v1.2.1 From 967b75ba92937deefc6da1d139825ac52cdbcc68 Mon Sep 17 00:00:00 2001 From: Annabel Dunstone Date: Mon, 18 Jul 2016 14:48:26 -0500 Subject: Remove white background on clipboard button; position icon --- app/assets/stylesheets/framework/sidebar.scss | 4 ++++ app/assets/stylesheets/pages/issuable.scss | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/framework/sidebar.scss b/app/assets/stylesheets/framework/sidebar.scss index d52e8f00172..3fa4a22258d 100644 --- a/app/assets/stylesheets/framework/sidebar.scss +++ b/app/assets/stylesheets/framework/sidebar.scss @@ -198,6 +198,10 @@ header.header-pinned-nav { .sidebar-collapsed-icon { cursor: pointer; + + .btn { + background-color: $gray-light; + } } } diff --git a/app/assets/stylesheets/pages/issuable.scss b/app/assets/stylesheets/pages/issuable.scss index 542fa244689..ded437625ee 100644 --- a/app/assets/stylesheets/pages/issuable.scss +++ b/app/assets/stylesheets/pages/issuable.scss @@ -122,7 +122,8 @@ button { float: right; - padding: 3px 5px; + padding: 1px 5px; + background-color: $gray-light; } } -- cgit v1.2.1 From b81171a8500f2585fceb17da7914300a2c5e0cef Mon Sep 17 00:00:00 2001 From: Annabel Dunstone Date: Mon, 18 Jul 2016 15:08:58 -0500 Subject: Fix styling of tag page --- app/assets/stylesheets/pages/tags.scss | 7 ++++ app/views/projects/tags/show.html.haml | 67 ++++++++++++++++++---------------- 2 files changed, 42 insertions(+), 32 deletions(-) create mode 100644 app/assets/stylesheets/pages/tags.scss diff --git a/app/assets/stylesheets/pages/tags.scss b/app/assets/stylesheets/pages/tags.scss new file mode 100644 index 00000000000..24ebd3e7cfa --- /dev/null +++ b/app/assets/stylesheets/pages/tags.scss @@ -0,0 +1,7 @@ +.tag-buttons { + line-height: 40px; + + .btn:not(.dropdown-toggle) { + margin-left: 10px; + } +} diff --git a/app/views/projects/tags/show.html.haml b/app/views/projects/tags/show.html.haml index b7d7d5c5382..395d7af6cbb 100644 --- a/app/views/projects/tags/show.html.haml +++ b/app/views/projects/tags/show.html.haml @@ -1,36 +1,39 @@ +- @no_container = true - page_title @tag.name, "Tags" = render "projects/commits/head" -.row-content-block - .pull-right - - if can?(current_user, :push_code, @project) - = link_to edit_namespace_project_tag_release_path(@project.namespace, @project, @tag.name), class: 'btn-grouped btn has-tooltip', title: 'Edit release notes' do - = icon("pencil") - = link_to namespace_project_tree_path(@project.namespace, @project, @tag.name), class: 'btn btn-grouped has-tooltip', title: 'Browse files' do - = icon('files-o') - = link_to namespace_project_commits_path(@project.namespace, @project, @tag.name), class: 'btn btn-grouped has-tooltip', title: 'Browse commits' do - = icon('history') - - if can? current_user, :download_code, @project - = render 'projects/tags/download', ref: @tag.name, project: @project - - if can?(current_user, :admin_project, @project) - .pull-right - = link_to namespace_project_tag_path(@project.namespace, @project, @tag.name), class: 'btn btn-remove remove-row grouped has-tooltip', title: "Delete tag", method: :delete, data: { confirm: "Deleting the '#{@tag.name}' tag cannot be undone. Are you sure?" } do - %i.fa.fa-trash-o - .title - %span.item-title= @tag.name - - if @commit - = render 'projects/branches/commit', commit: @commit, project: @project - - else - Cant find HEAD commit for this tag - - if @tag.message.present? - %pre.body - = strip_gpg_signature(@tag.message) +%div{ class: container_class } + .sub-header-block + .pull-right.tag-buttons + - if can?(current_user, :push_code, @project) + = link_to edit_namespace_project_tag_release_path(@project.namespace, @project, @tag.name), class: 'btn has-tooltip', title: 'Edit release notes' do + = icon("pencil") + = link_to namespace_project_tree_path(@project.namespace, @project, @tag.name), class: 'btn has-tooltip', title: 'Browse files' do + = icon('files-o') + = link_to namespace_project_commits_path(@project.namespace, @project, @tag.name), class: 'btn has-tooltip', title: 'Browse commits' do + = icon('history') + - if can? current_user, :download_code, @project + = render 'projects/tags/download', ref: @tag.name, project: @project + - if can?(current_user, :admin_project, @project) + .pull-right + = link_to namespace_project_tag_path(@project.namespace, @project, @tag.name), class: 'btn btn-remove remove-row grouped has-tooltip', title: "Delete tag", method: :delete, data: { confirm: "Deleting the '#{@tag.name}' tag cannot be undone. Are you sure?" } do + %i.fa.fa-trash-o + .tag-info.append-bottom-10 + .title + %span.item-title= @tag.name + - if @commit + = render 'projects/branches/commit', commit: @commit, project: @project + - else + Cant find HEAD commit for this tag + - if @tag.message.present? + %pre.body + = strip_gpg_signature(@tag.message) -.append-bottom-default.prepend-top-default - - if @release.description.present? - .description - .wiki - = preserve do - = markdown @release.description - - else - This tag has no release notes. + .append-bottom-default.prepend-top-default + - if @release.description.present? + .description + .wiki + = preserve do + = markdown @release.description + - else + This tag has no release notes. -- cgit v1.2.1 From da55496b6fc3ef1c65c4369cabb89b874dbc79e6 Mon Sep 17 00:00:00 2001 From: Annabel Dunstone Date: Fri, 15 Jul 2016 10:26:15 -0500 Subject: Add new running icon; add a bunch of styles to get svg to match existing fa icons --- app/assets/stylesheets/pages/pipelines.scss | 9 +++++++++ app/assets/stylesheets/pages/projects.scss | 7 +++++++ app/assets/stylesheets/pages/status.scss | 8 ++++++++ app/helpers/ci_status_helper.rb | 4 ++-- app/views/projects/ci/pipelines/_pipeline.html.haml | 2 +- app/views/shared/icons/_icon_running.svg | 12 ++++++++++++ app/views/shared/icons/_icon_status_cancel.svg | 12 ++++++++++++ app/views/shared/icons/_icon_status_failed.svg | 12 ++++++++++++ app/views/shared/icons/_icon_status_passed.svg | 15 +++++++++++++++ app/views/shared/icons/_icon_status_pending.svg | 13 +++++++++++++ app/views/shared/icons/_icon_status_warning.svg | 15 +++++++++++++++ 11 files changed, 106 insertions(+), 3 deletions(-) create mode 100644 app/views/shared/icons/_icon_running.svg create mode 100644 app/views/shared/icons/_icon_status_cancel.svg create mode 100644 app/views/shared/icons/_icon_status_failed.svg create mode 100644 app/views/shared/icons/_icon_status_passed.svg create mode 100644 app/views/shared/icons/_icon_status_pending.svg create mode 100644 app/views/shared/icons/_icon_status_warning.svg diff --git a/app/assets/stylesheets/pages/pipelines.scss b/app/assets/stylesheets/pages/pipelines.scss index a3b72ec9574..8d411bd658b 100644 --- a/app/assets/stylesheets/pages/pipelines.scss +++ b/app/assets/stylesheets/pages/pipelines.scss @@ -123,6 +123,15 @@ right: 1px; } } + + .stage-cell { + + svg { + height: 13px; + width: 13px; + margin-left: 3px; + } + } .duration, .finished-at { diff --git a/app/assets/stylesheets/pages/projects.scss b/app/assets/stylesheets/pages/projects.scss index ea9f7cf0540..5572999d19c 100644 --- a/app/assets/stylesheets/pages/projects.scss +++ b/app/assets/stylesheets/pages/projects.scss @@ -536,6 +536,13 @@ pre.light-well { .ci-status { margin-right: $gl-padding; + + &.ci-running { + + svg { + margin-right: 3px; + } + } } .commit-row-message { diff --git a/app/assets/stylesheets/pages/status.scss b/app/assets/stylesheets/pages/status.scss index c6b053150be..8f3d9362a0a 100644 --- a/app/assets/stylesheets/pages/status.scss +++ b/app/assets/stylesheets/pages/status.scss @@ -41,6 +41,14 @@ color: $blue-normal; border-color: $blue-normal; } + + svg { + width: 13px; + height: 13px; + position: relative; + top: 1px; + margin-left: 3px; + } } .ci-status-icon-success { diff --git a/app/helpers/ci_status_helper.rb b/app/helpers/ci_status_helper.rb index e6c99c9959e..5219a0ff47b 100644 --- a/app/helpers/ci_status_helper.rb +++ b/app/helpers/ci_status_helper.rb @@ -32,12 +32,12 @@ module CiStatusHelper when 'pending' 'clock-o' when 'running' - 'spinner' + 'icon_running' else 'circle' end - icon(icon_name + ' fw') + status == 'running' ? custom_icon(icon_name) : icon(icon_name + ' fw') end def render_commit_status(commit, tooltip_placement: 'auto left', cssclass: '') diff --git a/app/views/projects/ci/pipelines/_pipeline.html.haml b/app/views/projects/ci/pipelines/_pipeline.html.haml index 7ae699832f6..26c4ffd2bd4 100644 --- a/app/views/projects/ci/pipelines/_pipeline.html.haml +++ b/app/views/projects/ci/pipelines/_pipeline.html.haml @@ -35,7 +35,7 @@ - stages_status = pipeline.statuses.latest.stages_status - stages.each do |stage| - %td + %td.stage-cell - status = stages_status[stage] - tooltip = "#{stage.titleize}: #{status || 'not found'}" - if status diff --git a/app/views/shared/icons/_icon_running.svg b/app/views/shared/icons/_icon_running.svg new file mode 100644 index 00000000000..1b6a29958e6 --- /dev/null +++ b/app/views/shared/icons/_icon_running.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/app/views/shared/icons/_icon_status_cancel.svg b/app/views/shared/icons/_icon_status_cancel.svg new file mode 100644 index 00000000000..6a0bc1490c4 --- /dev/null +++ b/app/views/shared/icons/_icon_status_cancel.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/app/views/shared/icons/_icon_status_failed.svg b/app/views/shared/icons/_icon_status_failed.svg new file mode 100644 index 00000000000..c41ca18cae7 --- /dev/null +++ b/app/views/shared/icons/_icon_status_failed.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/app/views/shared/icons/_icon_status_passed.svg b/app/views/shared/icons/_icon_status_passed.svg new file mode 100644 index 00000000000..260eab013a3 --- /dev/null +++ b/app/views/shared/icons/_icon_status_passed.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/app/views/shared/icons/_icon_status_pending.svg b/app/views/shared/icons/_icon_status_pending.svg new file mode 100644 index 00000000000..035cd8b4ccc --- /dev/null +++ b/app/views/shared/icons/_icon_status_pending.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/app/views/shared/icons/_icon_status_warning.svg b/app/views/shared/icons/_icon_status_warning.svg new file mode 100644 index 00000000000..d47e7a1c93f --- /dev/null +++ b/app/views/shared/icons/_icon_status_warning.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + -- cgit v1.2.1 From 068f2f4f161c40310687198dbcec243b1361264f Mon Sep 17 00:00:00 2001 From: Annabel Dunstone Date: Fri, 15 Jul 2016 10:39:27 -0500 Subject: Align running icon in merge request --- app/assets/stylesheets/pages/merge_requests.scss | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/assets/stylesheets/pages/merge_requests.scss b/app/assets/stylesheets/pages/merge_requests.scss index fbff0c97355..ed45ac87f54 100644 --- a/app/assets/stylesheets/pages/merge_requests.scss +++ b/app/assets/stylesheets/pages/merge_requests.scss @@ -196,6 +196,16 @@ .merge-request-title { margin-bottom: 2px; + + .ci-status-link { + + svg { + height: 13px; + width: 13px; + position: relative; + top: 2px; + } + } } } -- cgit v1.2.1 From 5b5cafe024c4437a17a219708c9ec00376e98ece Mon Sep 17 00:00:00 2001 From: Annabel Dunstone Date: Fri, 15 Jul 2016 11:05:06 -0500 Subject: Add global style for running icon --- app/assets/stylesheets/pages/merge_requests.scss | 10 ---------- app/assets/stylesheets/pages/pipelines.scss | 10 +++++++++- app/assets/stylesheets/pages/projects.scss | 7 ------- app/assets/stylesheets/pages/status.scss | 23 ++++++++++++++-------- .../projects/ci/pipelines/_pipeline.html.haml | 2 +- 5 files changed, 25 insertions(+), 27 deletions(-) diff --git a/app/assets/stylesheets/pages/merge_requests.scss b/app/assets/stylesheets/pages/merge_requests.scss index ed45ac87f54..fbff0c97355 100644 --- a/app/assets/stylesheets/pages/merge_requests.scss +++ b/app/assets/stylesheets/pages/merge_requests.scss @@ -196,16 +196,6 @@ .merge-request-title { margin-bottom: 2px; - - .ci-status-link { - - svg { - height: 13px; - width: 13px; - position: relative; - top: 2px; - } - } } } diff --git a/app/assets/stylesheets/pages/pipelines.scss b/app/assets/stylesheets/pages/pipelines.scss index 8d411bd658b..9cfd8d49318 100644 --- a/app/assets/stylesheets/pages/pipelines.scss +++ b/app/assets/stylesheets/pages/pipelines.scss @@ -49,6 +49,14 @@ .commit-link { + .ci-running { + + svg { + top: 1px; + margin-right: 0; + } + } + a:hover { text-decoration: none; } @@ -123,7 +131,7 @@ right: 1px; } } - + .stage-cell { svg { diff --git a/app/assets/stylesheets/pages/projects.scss b/app/assets/stylesheets/pages/projects.scss index 5572999d19c..ea9f7cf0540 100644 --- a/app/assets/stylesheets/pages/projects.scss +++ b/app/assets/stylesheets/pages/projects.scss @@ -536,13 +536,6 @@ pre.light-well { .ci-status { margin-right: $gl-padding; - - &.ci-running { - - svg { - margin-right: 3px; - } - } } .commit-row-message { diff --git a/app/assets/stylesheets/pages/status.scss b/app/assets/stylesheets/pages/status.scss index 8f3d9362a0a..a0e008c98e5 100644 --- a/app/assets/stylesheets/pages/status.scss +++ b/app/assets/stylesheets/pages/status.scss @@ -41,14 +41,6 @@ color: $blue-normal; border-color: $blue-normal; } - - svg { - width: 13px; - height: 13px; - position: relative; - top: 1px; - margin-left: 3px; - } } .ci-status-icon-success { @@ -70,3 +62,18 @@ color: $gl-gray; } } + +.ci-running, +.ci-status-icon-running { + svg { + height: 13px; + width: 13px; + position: relative; + top: 2px; + margin: 0 3px; + } + + &:hover { + text-decoration: none; + } +} diff --git a/app/views/projects/ci/pipelines/_pipeline.html.haml b/app/views/projects/ci/pipelines/_pipeline.html.haml index 26c4ffd2bd4..7ae699832f6 100644 --- a/app/views/projects/ci/pipelines/_pipeline.html.haml +++ b/app/views/projects/ci/pipelines/_pipeline.html.haml @@ -35,7 +35,7 @@ - stages_status = pipeline.statuses.latest.stages_status - stages.each do |stage| - %td.stage-cell + %td - status = stages_status[stage] - tooltip = "#{stage.titleize}: #{status || 'not found'}" - if status -- cgit v1.2.1 From 0301fa8d9c67623c3311eab64d174123bba4b943 Mon Sep 17 00:00:00 2001 From: Annabel Dunstone Date: Tue, 19 Jul 2016 06:47:26 -0700 Subject: Add new icons for every CI status --- app/assets/stylesheets/pages/issues.scss | 8 ++++++++ app/assets/stylesheets/pages/merge_requests.scss | 14 ++++++++++++- app/assets/stylesheets/pages/pipelines.scss | 7 +++---- app/assets/stylesheets/pages/status.scss | 23 ++++++++-------------- app/helpers/ci_status_helper.rb | 14 +++++++------ .../projects/ci/pipelines/_pipeline.html.haml | 2 +- app/views/shared/icons/_icon_running.svg | 12 ----------- app/views/shared/icons/_icon_status_passed.svg | 15 -------------- app/views/shared/icons/_icon_status_running.svg | 12 +++++++++++ app/views/shared/icons/_icon_status_success.svg | 15 ++++++++++++++ 10 files changed, 68 insertions(+), 54 deletions(-) delete mode 100644 app/views/shared/icons/_icon_running.svg delete mode 100644 app/views/shared/icons/_icon_status_passed.svg create mode 100644 app/views/shared/icons/_icon_status_running.svg create mode 100644 app/views/shared/icons/_icon_status_success.svg diff --git a/app/assets/stylesheets/pages/issues.scss b/app/assets/stylesheets/pages/issues.scss index 9807c5a808d..ee3b2d2b801 100644 --- a/app/assets/stylesheets/pages/issues.scss +++ b/app/assets/stylesheets/pages/issues.scss @@ -78,6 +78,14 @@ form.edit-issue { } } +.merge-request-ci-status { + svg { + margin-right: 4px; + position: relative; + top: 1px; + } +} + @media (max-width: $screen-xs-max) { .issue-btn-group { width: 100%; diff --git a/app/assets/stylesheets/pages/merge_requests.scss b/app/assets/stylesheets/pages/merge_requests.scss index fbff0c97355..5254faf723d 100644 --- a/app/assets/stylesheets/pages/merge_requests.scss +++ b/app/assets/stylesheets/pages/merge_requests.scss @@ -60,8 +60,10 @@ .ci_widget { border-bottom: 1px solid #eef0f2; - i { + svg { margin-right: 4px; + position: relative; + top: 1px; } &.ci-success { @@ -196,6 +198,16 @@ .merge-request-title { margin-bottom: 2px; + + .ci-status-link { + + svg { + height: 16px; + width: 16px; + position: relative; + top: 3px; + } + } } } diff --git a/app/assets/stylesheets/pages/pipelines.scss b/app/assets/stylesheets/pages/pipelines.scss index 9cfd8d49318..1ff9b90c85e 100644 --- a/app/assets/stylesheets/pages/pipelines.scss +++ b/app/assets/stylesheets/pages/pipelines.scss @@ -49,7 +49,7 @@ .commit-link { - .ci-running { + .ci-status { svg { top: 1px; @@ -135,9 +135,8 @@ .stage-cell { svg { - height: 13px; - width: 13px; - margin-left: 3px; + height: 18px; + width: 18px; } } diff --git a/app/assets/stylesheets/pages/status.scss b/app/assets/stylesheets/pages/status.scss index a0e008c98e5..a22d4b6f6be 100644 --- a/app/assets/stylesheets/pages/status.scss +++ b/app/assets/stylesheets/pages/status.scss @@ -41,6 +41,14 @@ color: $blue-normal; border-color: $blue-normal; } + + svg { + height: 13px; + width: 13px; + position: relative; + top: 1px; + margin: 0 3px; + } } .ci-status-icon-success { @@ -62,18 +70,3 @@ color: $gl-gray; } } - -.ci-running, -.ci-status-icon-running { - svg { - height: 13px; - width: 13px; - position: relative; - top: 2px; - margin: 0 3px; - } - - &:hover { - text-decoration: none; - } -} diff --git a/app/helpers/ci_status_helper.rb b/app/helpers/ci_status_helper.rb index 5219a0ff47b..59a8365d60b 100644 --- a/app/helpers/ci_status_helper.rb +++ b/app/helpers/ci_status_helper.rb @@ -26,18 +26,20 @@ module CiStatusHelper icon_name = case status when 'success' - 'check' + 'icon_status_success' + when 'success_with_warnings' + 'icon_status_warning' when 'failed' - 'close' + 'icon_status_failed' when 'pending' - 'clock-o' + 'icon_status_pending' when 'running' - 'icon_running' + 'icon_status_running' else - 'circle' + 'icon_status_cancel' end - status == 'running' ? custom_icon(icon_name) : icon(icon_name + ' fw') + custom_icon(icon_name) end def render_commit_status(commit, tooltip_placement: 'auto left', cssclass: '') diff --git a/app/views/projects/ci/pipelines/_pipeline.html.haml b/app/views/projects/ci/pipelines/_pipeline.html.haml index 7ae699832f6..26c4ffd2bd4 100644 --- a/app/views/projects/ci/pipelines/_pipeline.html.haml +++ b/app/views/projects/ci/pipelines/_pipeline.html.haml @@ -35,7 +35,7 @@ - stages_status = pipeline.statuses.latest.stages_status - stages.each do |stage| - %td + %td.stage-cell - status = stages_status[stage] - tooltip = "#{stage.titleize}: #{status || 'not found'}" - if status diff --git a/app/views/shared/icons/_icon_running.svg b/app/views/shared/icons/_icon_running.svg deleted file mode 100644 index 1b6a29958e6..00000000000 --- a/app/views/shared/icons/_icon_running.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/app/views/shared/icons/_icon_status_passed.svg b/app/views/shared/icons/_icon_status_passed.svg deleted file mode 100644 index 260eab013a3..00000000000 --- a/app/views/shared/icons/_icon_status_passed.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/app/views/shared/icons/_icon_status_running.svg b/app/views/shared/icons/_icon_status_running.svg new file mode 100644 index 00000000000..a48b3a25099 --- /dev/null +++ b/app/views/shared/icons/_icon_status_running.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/app/views/shared/icons/_icon_status_success.svg b/app/views/shared/icons/_icon_status_success.svg new file mode 100644 index 00000000000..260eab013a3 --- /dev/null +++ b/app/views/shared/icons/_icon_status_success.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + -- cgit v1.2.1 From 293d31ca87f07a75a8402931b8116dc8666da55d Mon Sep 17 00:00:00 2001 From: Annabel Dunstone Date: Tue, 19 Jul 2016 06:52:06 -0700 Subject: Vertically align status icon within table --- app/assets/stylesheets/pages/pipelines.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/app/assets/stylesheets/pages/pipelines.scss b/app/assets/stylesheets/pages/pipelines.scss index 1ff9b90c85e..a404f108dc4 100644 --- a/app/assets/stylesheets/pages/pipelines.scss +++ b/app/assets/stylesheets/pages/pipelines.scss @@ -137,6 +137,7 @@ svg { height: 18px; width: 18px; + vertical-align: middle; } } -- cgit v1.2.1 From 764924b6a96ad1079dfb0e78fa71f8a90efc3752 Mon Sep 17 00:00:00 2001 From: "http://jneen.net/" Date: Tue, 19 Jul 2016 10:28:48 -0700 Subject: upgrade rouge to 2.0.4 --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 4bb7a8d0604..ef35410d4ab 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -578,7 +578,7 @@ GEM railties (>= 4.2.0, < 5.1) rinku (2.0.0) rotp (2.1.2) - rouge (2.0.3) + rouge (2.0.4) rqrcode (0.7.0) chunky_png rqrcode-rails3 (0.1.7) -- cgit v1.2.1 From 5b124fc328e5981e36a60b7e0f0ab17c0ddd037b Mon Sep 17 00:00:00 2001 From: "http://jneen.net/" Date: Tue, 19 Jul 2016 10:37:55 -0700 Subject: use 2.0.5, actually (2.0.4 was a bad release) --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index ef35410d4ab..363904a4baa 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -578,7 +578,7 @@ GEM railties (>= 4.2.0, < 5.1) rinku (2.0.0) rotp (2.1.2) - rouge (2.0.4) + rouge (2.0.5) rqrcode (0.7.0) chunky_png rqrcode-rails3 (0.1.7) -- cgit v1.2.1 From 21096189a5712de4ae63818c5cdfaa751a7cbd3c Mon Sep 17 00:00:00 2001 From: Annabel Dunstone Date: Tue, 19 Jul 2016 11:11:52 -0700 Subject: Fix ci_status_helper_spec to look for new SVGs --- spec/helpers/ci_status_helper_spec.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/spec/helpers/ci_status_helper_spec.rb b/spec/helpers/ci_status_helper_spec.rb index 45199d0f09d..637b02d9388 100644 --- a/spec/helpers/ci_status_helper_spec.rb +++ b/spec/helpers/ci_status_helper_spec.rb @@ -7,7 +7,13 @@ describe CiStatusHelper do let(:failed_commit) { double("Ci::Pipeline", status: 'failed') } describe 'ci_icon_for_status' do - it { expect(helper.ci_icon_for_status(success_commit.status)).to include('fa-check') } - it { expect(helper.ci_icon_for_status(failed_commit.status)).to include('fa-close') } + it 'renders to correct svg on success' do + expect(helper).to receive(:render).with('shared/icons/icon_status_success.svg', anything) + helper.ci_icon_for_status(success_commit.status) + end + it 'renders the correct svg on failure' do + expect(helper).to receive(:render).with('shared/icons/icon_status_failed.svg', anything) + helper.ci_icon_for_status(failed_commit.status) + end end end -- cgit v1.2.1 From 2a092da35c612fa34762bc955ab7c6cdb8df8316 Mon Sep 17 00:00:00 2001 From: Annabel Dunstone Date: Tue, 19 Jul 2016 11:14:23 -0700 Subject: Fix alignment of icons on project page --- app/assets/stylesheets/pages/projects.scss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/assets/stylesheets/pages/projects.scss b/app/assets/stylesheets/pages/projects.scss index ea9f7cf0540..1fb15d337c4 100644 --- a/app/assets/stylesheets/pages/projects.scss +++ b/app/assets/stylesheets/pages/projects.scss @@ -486,6 +486,11 @@ pre.light-well { > span { margin-left: 10px; } + + svg { + position: relative; + top: 2px; + } } } -- cgit v1.2.1 From 17bac49154a399d34e7b884551d2fb78dff3cea3 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Tue, 19 Jul 2016 13:19:04 -0600 Subject: Ensure Owners are included in the scope for authorized_projects Prior, when providing a `min_access_level` parameter to this method, we called `Gitlab::Access.values` instead of `all_values`, mistakenly omitting the `OWNER` level. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/19878 --- app/models/user.rb | 2 +- spec/models/user_spec.rb | 23 ++++++++++++++++------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 3d0a033785c..975e935fa20 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -854,7 +854,7 @@ class User < ActiveRecord::Base groups.joins(:shared_projects).select(:project_id)] if min_access_level - scope = { access_level: Gitlab::Access.values.select { |access| access >= min_access_level } } + scope = { access_level: Gitlab::Access.all_values.select { |access| access >= min_access_level } } relations = [relations.shift] + relations.map { |relation| relation.where(members: scope) } end diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index fc74488ac0e..3bf82cf2668 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -887,16 +887,25 @@ describe User, models: true do end describe '#authorized_projects' do - let!(:user) { create(:user) } - let!(:private_project) { create(:project, :private) } + context 'with a minimum access level' do + it 'includes projects for which the user is an owner' do + user = create(:user) + project = create(:empty_project, :private, namespace: user.namespace) - before do - private_project.team << [user, Gitlab::Access::MASTER] - end + expect(user.authorized_projects(Gitlab::Access::REPORTER)) + .to contain_exactly(project) + end - subject { user.authorized_projects } + it 'includes projects for which the user is a master' do + user = create(:user) + project = create(:empty_project, :private) + + project.team << [user, Gitlab::Access::MASTER] - it { is_expected.to eq([private_project]) } + expect(user.authorized_projects(Gitlab::Access::REPORTER)) + .to contain_exactly(project) + end + end end describe '#ci_authorized_runners' do -- cgit v1.2.1 From 41b25e5a0d64d33d2d23aaaf3effa79a717f890e Mon Sep 17 00:00:00 2001 From: Ahmad Sherif Date: Tue, 19 Jul 2016 21:01:30 +0200 Subject: Limit git rev-list output count to one in forced push check --- CHANGELOG | 1 + lib/gitlab/checks/force_push.rb | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index a5d26db7626..d60d25d9ac4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ Please view this file on the master branch, on stable branches it's out of date. v 8.11.0 (unreleased) - Fix of 'Commits being passed to custom hooks are already reachable when using the UI' + - Limit git rev-list output count to one in forced push check v 8.10.0 (unreleased) - Fix profile activity heatmap to show correct day name (eanplatter) diff --git a/lib/gitlab/checks/force_push.rb b/lib/gitlab/checks/force_push.rb index dfa83a0eab3..5fe86553bd0 100644 --- a/lib/gitlab/checks/force_push.rb +++ b/lib/gitlab/checks/force_push.rb @@ -8,8 +8,8 @@ module Gitlab if Gitlab::Git.blank_ref?(oldrev) || Gitlab::Git.blank_ref?(newrev) false else - missed_refs, _ = Gitlab::Popen.popen(%W(#{Gitlab.config.git.bin_path} --git-dir=#{project.repository.path_to_repo} rev-list #{oldrev} ^#{newrev})) - missed_refs.split("\n").size > 0 + missed_ref, _ = Gitlab::Popen.popen(%W(#{Gitlab.config.git.bin_path} --git-dir=#{project.repository.path_to_repo} rev-list --max-count=1 #{oldrev} ^#{newrev})) + missed_ref.present? end end end -- cgit v1.2.1 From 38577d6825e36cb144db5d505834cad0b00d27f7 Mon Sep 17 00:00:00 2001 From: Connor Shea Date: Tue, 19 Jul 2016 22:24:27 -0600 Subject: Fix the Sentry spam from CSP violations by disabling it. --- config/initializers/secure_headers.rb | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/config/initializers/secure_headers.rb b/config/initializers/secure_headers.rb index 9fd24a667cc..253e3cf7410 100644 --- a/config/initializers/secure_headers.rb +++ b/config/initializers/secure_headers.rb @@ -4,14 +4,7 @@ require 'gitlab/current_settings' include Gitlab::CurrentSettings -# If Sentry is enabled and the Rails app is running in production mode, -# this will construct the Report URI for Sentry. -if Rails.env.production? && current_application_settings.sentry_enabled - uri = URI.parse(current_application_settings.sentry_dsn) - CSP_REPORT_URI = "#{uri.scheme}://#{uri.host}/api#{uri.path}/csp-report/?sentry_key=#{uri.user}" -else - CSP_REPORT_URI = '' -end +CSP_REPORT_URI = '' # Content Security Policy Headers # For more information on CSP see: @@ -71,10 +64,7 @@ SecureHeaders::Configuration.default do |config| upgrade_insecure_requests: true } - # Reports are sent to Sentry if it's enabled. - if current_application_settings.sentry_enabled - config.csp[:report_uri] = %W(#{CSP_REPORT_URI}) - end + config.csp[:report_uri] = %W(#{CSP_REPORT_URI}) # Allow Bootstrap Linter in development mode. if Rails.env.development? -- cgit v1.2.1