Commit 272d482f authored by Fatih Acet's avatar Fatih Acet

Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into sidebar-expand-collapse

parents 0378c5b8 adc64e45
Please view this file on the master branch, on stable branches it's out of date. Please view this file on the master branch, on stable branches it's out of date.
v 8.9.0 (unreleased) v 8.9.0 (unreleased)
- Allow forking projects with restricted visibility level
- Redesign navigation for project pages - Redesign navigation for project pages
- Fix groups API to list only user's accessible projects
- Redesign account and email confirmation emails
- Use gitlab-shell v3.0.0 - Use gitlab-shell v3.0.0
- Add rake task 'gitlab:db:configure' for conditionally seeding or migrating the database - Add rake task 'gitlab:db:configure' for conditionally seeding or migrating the database
- Changed the Slack build message to use the singular duration if necessary (Aran Koning) - Changed the Slack build message to use the singular duration if necessary (Aran Koning)
...@@ -38,6 +41,7 @@ v 8.8.0 ...@@ -38,6 +41,7 @@ v 8.8.0
- Added inline diff styling for `change_title` system notes. (Adam Butler) - Added inline diff styling for `change_title` system notes. (Adam Butler)
- Project#open_branches has been cleaned up and no longer loads entire records into memory. - Project#open_branches has been cleaned up and no longer loads entire records into memory.
- Escape HTML in commit titles in system note messages - Escape HTML in commit titles in system note messages
- Improve design of Pipeline View
- Fix scope used when accessing container registry - Fix scope used when accessing container registry
- Fix creation of Ci::Commit object which can lead to pending, failed in some scenarios - Fix creation of Ci::Commit object which can lead to pending, failed in some scenarios
- Improve multiple branch push performance by memoizing permission checking - Improve multiple branch push performance by memoizing permission checking
...@@ -99,6 +103,9 @@ v 8.8.0 ...@@ -99,6 +103,9 @@ v 8.8.0
- Allows MR authors to have the source branch removed when merging the MR. !2801 (Jeroen Jacobs) - Allows MR authors to have the source branch removed when merging the MR. !2801 (Jeroen Jacobs)
- When creating a .gitignore file a dropdown with templates will be provided - When creating a .gitignore file a dropdown with templates will be provided
v 8.7.7
- Fix import by `Any Git URL` broken if the URL contains a space
v 8.7.6 v 8.7.6
- Fix links on wiki pages for relative url setups. !4131 (Artem Sidorenko) - Fix links on wiki pages for relative url setups. !4131 (Artem Sidorenko)
- Fix import from GitLab.com to a private instance failure. !4181 - Fix import from GitLab.com to a private instance failure. !4181
......
...@@ -121,7 +121,7 @@ group :unicorn do ...@@ -121,7 +121,7 @@ group :unicorn do
end end
# State machine # State machine
gem "state_machines-activerecord", '~> 0.3.0' gem "state_machines-activerecord", '~> 0.4.0'
# Run events after state machine commits # Run events after state machine commits
gem 'after_commit_queue' gem 'after_commit_queue'
...@@ -178,9 +178,6 @@ gem 'ruby-fogbugz', '~> 0.2.1' ...@@ -178,9 +178,6 @@ gem 'ruby-fogbugz', '~> 0.2.1'
# d3 # d3
gem 'd3_rails', '~> 3.5.0' gem 'd3_rails', '~> 3.5.0'
#cal-heatmap
gem 'cal-heatmap-rails', '~> 3.6.0'
# underscore-rails # underscore-rails
gem "underscore-rails", "~> 1.8.0" gem "underscore-rails", "~> 1.8.0"
......
...@@ -102,7 +102,6 @@ GEM ...@@ -102,7 +102,6 @@ GEM
bundler (~> 1.2) bundler (~> 1.2)
thor (~> 0.18) thor (~> 0.18)
byebug (8.2.1) byebug (8.2.1)
cal-heatmap-rails (3.6.0)
capybara (2.6.2) capybara (2.6.2)
addressable addressable
mime-types (>= 1.16) mime-types (>= 1.16)
...@@ -790,11 +789,11 @@ GEM ...@@ -790,11 +789,11 @@ GEM
activesupport (>= 4.0) activesupport (>= 4.0)
sprockets (>= 3.0.0) sprockets (>= 3.0.0)
state_machines (0.4.0) state_machines (0.4.0)
state_machines-activemodel (0.3.0) state_machines-activemodel (0.4.0)
activemodel (~> 4.1) activemodel (>= 4.1, < 5.1)
state_machines (>= 0.4.0) state_machines (>= 0.4.0)
state_machines-activerecord (0.3.0) state_machines-activerecord (0.4.0)
activerecord (~> 4.1) activerecord (>= 4.1, < 5.1)
state_machines-activemodel (>= 0.3.0) state_machines-activemodel (>= 0.3.0)
stringex (2.5.2) stringex (2.5.2)
systemu (2.6.5) systemu (2.6.5)
...@@ -908,7 +907,6 @@ DEPENDENCIES ...@@ -908,7 +907,6 @@ DEPENDENCIES
bullet bullet
bundler-audit bundler-audit
byebug byebug
cal-heatmap-rails (~> 3.6.0)
capybara (~> 2.6.2) capybara (~> 2.6.2)
capybara-screenshot (~> 1.0.0) capybara-screenshot (~> 1.0.0)
carrierwave (~> 0.10.0) carrierwave (~> 0.10.0)
...@@ -1043,7 +1041,7 @@ DEPENDENCIES ...@@ -1043,7 +1041,7 @@ DEPENDENCIES
spring-commands-spinach (~> 1.1.0) spring-commands-spinach (~> 1.1.0)
spring-commands-teaspoon (~> 0.0.2) spring-commands-teaspoon (~> 0.0.2)
sprockets (~> 3.6.0) sprockets (~> 3.6.0)
state_machines-activerecord (~> 0.3.0) state_machines-activerecord (~> 0.4.0)
task_list (~> 1.0.2) task_list (~> 1.0.2)
teaspoon (~> 1.1.0) teaspoon (~> 1.1.0)
teaspoon-jasmine (~> 2.2.0) teaspoon-jasmine (~> 2.2.0)
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
#= require jquery.scrollTo #= require jquery.scrollTo
#= require jquery.turbolinks #= require jquery.turbolinks
#= require d3 #= require d3
#= require cal-heatmap
#= require turbolinks #= require turbolinks
#= require autosave #= require autosave
#= require bootstrap/affix #= require bootstrap/affix
......
class @Calendar class @Calendar
constructor: (timestamps, starting_year, starting_month, calendar_activities_path) -> constructor: (timestamps, @calendar_activities_path) ->
cal = new CalHeatMap() @currentSelectedDate = ''
cal.init @daySpace = 1
itemName: ["contribution"] @daySize = 15
data: timestamps @daySizeWithSpace = @daySize + (@daySpace * 2)
start: new Date(starting_year, starting_month) @monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
domainLabelFormat: "%b" @months = []
id: "cal-heatmap" @highestValue = 0
domain: "month"
subDomain: "day" # Get the highest value from the timestampes
range: 12 _.each timestamps, (count) =>
tooltip: true if count > @highestValue
label: @highestValue = count
position: "top"
legend: [ # Loop through the timestamps to create a group of objects
0 # The group of objects will be grouped based on the day of the week they are
10 @timestampsTmp = []
20 i = 0
30 group = 0
] _.each timestamps, (count, date) =>
legendCellPadding: 3 newDate = new Date parseInt(date) * 1000
cellSize: $('.user-calendar').width() / 73 day = newDate.getDay()
onClick: (date, count) ->
formated_date = date.getFullYear() + "-" + (date.getMonth()+1) + "-" + date.getDate() # Create a new group array if this is the first day of the week
# or if is first object
if (day is 0 and i isnt 0) or i is 0
@timestampsTmp.push []
group++
innerArray = @timestampsTmp[group-1]
# Push to the inner array the values that will be used to render map
innerArray.push
count: count
date: newDate
day: day
i++
# Init color functions
@color = @initColor()
@colorKey = @initColorKey()
# Init the svg element
@renderSvg(group)
@renderDays()
@renderMonths()
@renderDayTitles()
@renderKey()
@initTooltips()
renderSvg: (group) ->
@svg = d3.select '.js-contrib-calendar'
.append 'svg'
.attr 'width', (group + 1) * @daySizeWithSpace
.attr 'height', 167
.attr 'class', 'contrib-calendar'
renderDays: ->
@svg.selectAll 'g'
.data @timestampsTmp
.enter()
.append 'g'
.attr 'transform', (group, i) =>
_.each group, (stamp, a) =>
if a is 0 and stamp.day is 0
month = stamp.date.getMonth()
x = (@daySizeWithSpace * i + 1) + @daySizeWithSpace
lastMonth = _.last(@months)
if lastMonth?
lastMonthX = lastMonth.x
if !lastMonth?
@months.push
month: month
x: x
else if month isnt lastMonth.month and x - @daySizeWithSpace isnt lastMonthX
@months.push
month: month
x: x
"translate(#{(@daySizeWithSpace * i + 1) + @daySizeWithSpace}, 18)"
.selectAll 'rect'
.data (stamp) ->
stamp
.enter()
.append 'rect'
.attr 'x', '0'
.attr 'y', (stamp, i) =>
(@daySizeWithSpace * stamp.day)
.attr 'width', @daySize
.attr 'height', @daySize
.attr 'title', (stamp) =>
contribText = 'No contributions'
if stamp.count > 0
contribText = "#{stamp.count} contribution#{if stamp.count > 1 then 's' else ''}"
date = dateFormat(stamp.date, 'mmm d, yyyy')
"#{contribText}<br />#{date}"
.attr 'class', 'user-contrib-cell js-tooltip'
.attr 'fill', (stamp) =>
if stamp.count isnt 0
@color(stamp.count)
else
'#ededed'
.attr 'data-container', 'body'
.on 'click', @clickDay
renderDayTitles: ->
days = [{
text: 'M'
y: 29 + (@daySizeWithSpace * 1)
}, {
text: 'W'
y: 29 + (@daySizeWithSpace * 3)
}, {
text: 'F'
y: 29 + (@daySizeWithSpace * 5)
}]
@svg.append 'g'
.selectAll 'text'
.data days
.enter()
.append 'text'
.attr 'text-anchor', 'middle'
.attr 'x', 8
.attr 'y', (day) ->
day.y
.text (day) ->
day.text
.attr 'class', 'user-contrib-text'
renderMonths: ->
@svg.append 'g'
.selectAll 'text'
.data @months
.enter()
.append 'text'
.attr 'x', (date) ->
date.x
.attr 'y', 10
.attr 'class', 'user-contrib-text'
.text (date) =>
@monthNames[date.month]
renderKey: ->
keyColors = ['#ededed', @colorKey(0), @colorKey(1), @colorKey(2), @colorKey(3)]
@svg.append 'g'
.attr 'transform', "translate(18, #{@daySizeWithSpace * 8 + 16})"
.selectAll 'rect'
.data keyColors
.enter()
.append 'rect'
.attr 'width', @daySize
.attr 'height', @daySize
.attr 'x', (color, i) =>
@daySizeWithSpace * i
.attr 'y', 0
.attr 'fill', (color) ->
color
initColor: ->
d3.scale
.linear()
.range(['#acd5f2', '#254e77'])
.domain([0, @highestValue])
initColorKey: ->
d3.scale
.linear()
.range(['#acd5f2', '#254e77'])
.domain([0, 3])
clickDay: (stamp) ->
if @currentSelectedDate isnt stamp.date
@currentSelectedDate = stamp.date
formatted_date = @currentSelectedDate.getFullYear() + "-" + (@currentSelectedDate.getMonth()+1) + "-" + @currentSelectedDate.getDate()
$.ajax $.ajax
url: calendar_activities_path url: @calendar_activities_path
data: data:
date: formated_date date: formatted_date
cache: false cache: false
dataType: "html" dataType: 'html'
beforeSend: ->
$('.user-calendar-activities').html '<div class="text-center"><i class="fa fa-spinner fa-spin user-calendar-activities-loading"></i></div>'
success: (data) -> success: (data) ->
$(".user-calendar-activities").html data $('.user-calendar-activities').html data
else
$('.user-calendar-activities').html ''
initTooltips: ->
$('.js-contrib-calendar .js-tooltip').tooltip
html: true
class @LayoutNav
$ ->
$('.fade-left').addClass('end-scroll')
$('.scrolling-tabs').on 'scroll', (event) ->
$this = $(this)
$el = $(event.target)
currentPosition = $this.scrollLeft()
size = bp.getBreakpointSize()
controlBtnWidth = $('.controls').width()
maxPosition = $this.get(0).scrollWidth - $this.parent().width()
maxPosition += controlBtnWidth if size isnt 'xs' and $('.nav-control').length
$el.find('.fade-left').toggleClass('end-scroll', currentPosition is 0)
$el.find('.fade-right').toggleClass('end-scroll', currentPosition is maxPosition)
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
*= require select2 *= require select2
*= require_self *= require_self
*= require dropzone/basic *= require dropzone/basic
*= require cal-heatmap
*= require cropper.css *= require cropper.css
*/ */
......
.calender-block { .calender-block {
padding-left: 0;
padding-right: 0;
@media (min-width: $screen-sm-min) and (max-width: $screen-lg-min) { @media (min-width: $screen-sm-min) and (max-width: $screen-lg-min) {
overflow-x: scroll; overflow-x: scroll;
} }
} }
.user-calendar-activities { .user-calendar-activities {
.calendar_onclick_hr {
padding: 0;
margin: 10px 0;
}
.str-truncated { .str-truncated {
max-width: 70%; max-width: 70%;
} }
.text-expander { .user-calendar-activities-loading {
background: #eee; font-size: 24px;
color: #555;
padding: 0 5px;
cursor: pointer;
margin-left: 4px;
&:hover {
background-color: #ddd;
}
} }
} }
/** .user-calendar {
* This overwrites the default values of the cal-heatmap gem text-align: center;
*/
.calendar {
.qi {
fill: #fff;
}
.q1 {
fill: #ededed !important;
}
.q2 {
fill: #acd5f2 !important;
}
.q3 {
fill: #7fa8d1 !important;
}
.q4 {
fill: #49729b !important;
}
.q5 { .calendar {
fill: #254e77 !important; display: inline-block;
} }
}
.future { .user-contrib-cell {
visibility: hidden; &:hover {
cursor: pointer;
stroke: #000;
} }
}
.domain-background { .user-contrib-text {
fill: none; font-size: 12px;
shape-rendering: crispedges; fill: #959494;
} }
.ch-tooltip { .calendar-hint {
padding: 3px; margin-top: -23px;
font-weight: 550; float: right;
} font-size: 12px;
} }
@mixin fade($gradient-direction, $rgba, $gradient-color) {
visibility: visible;
opacity: 1;
position: absolute;
bottom: 12px;
width: 43px;
height: 30px;
transition-duration: .3s;
-webkit-transform: translateZ(0);
background: -webkit-linear-gradient($gradient-direction, $rgba, $gradient-color 45%);
background: -o-linear-gradient($gradient-direction, $rgba, $gradient-color 45%);
background: -moz-linear-gradient($gradient-direction, $rgba, $gradient-color 45%);
background: linear-gradient($gradient-direction, $rgba, $gradient-color 45%);
&.end-scroll {
visibility: hidden;
opacity: 0;
transition-duration: .3s;
}
}
@mixin scrolling-links() {
white-space: nowrap;
overflow-x: auto;
overflow-y: hidden;
-webkit-overflow-scrolling: touch;
&::-webkit-scrollbar {
display: none;
}
}
.nav-links { .nav-links {
padding: 0; padding: 0;
margin: 0; margin: 0;
...@@ -209,13 +240,8 @@ ...@@ -209,13 +240,8 @@
float: right; float: right;
padding: 7px 0 0; padding: 7px 0 0;
@media (max-width: $screen-xs-min) { @media (max-width: $screen-xs-max) {
float: none; display: none;
padding: 0 9px;
.dropdown-new {
width: 100%;
}
} }
i { i {
...@@ -246,14 +272,18 @@ ...@@ -246,14 +272,18 @@
} }
.nav-links { .nav-links {
@include scrolling-links();
border-bottom: none; border-bottom: none;
height: 51px; height: 51px;
white-space: nowrap;
overflow-x: auto; .fade-right {
overflow-y: hidden; @include fade(left, rgba(250, 250, 250, 0.4), $background-color);
-webkit-overflow-scrolling: touch; right: 0;
&::-webkit-scrollbar { }
display: none;
.fade-left {
@include fade(right, rgba(250, 250, 250, 0.4), $background-color);
left: 0;
} }
li { li {
...@@ -278,16 +308,39 @@ ...@@ -278,16 +308,39 @@
} }
} }
.nav-control {
.fade-right {
@media (min-width: $screen-xs-max) {
right: 67px;
}
@media (max-width: $screen-xs-min) {
right: 0;
}
}
}
} }
.page-with-layout-nav { .nav-block {
margin-top: 50px; position: relative;
&.controls-dropdown-visible { .nav-links {
@media (max-width: $screen-xs-min) { @include scrolling-links();
margin-top: 96px;
.fade-right {
@include fade(left, rgba(255, 255, 255, 0.4), $white-light);
right: 0;
}
.fade-left {
@include fade(right, rgba(255, 255, 255, 0.4), $white-light);
left: 0;
} }
} }
}
.page-with-layout-nav {
margin-top: $header-height + 2;
.right-sidebar { .right-sidebar {
top: ($header-height * 2) + 2; top: ($header-height * 2) + 2;
......
...@@ -324,7 +324,7 @@ ...@@ -324,7 +324,7 @@
.layout-nav { .layout-nav {
@media (max-width: $screen-xs-min) { @media (max-width: $screen-xs-min) {
padding-right: 0;; padding-right: 0;
} }
@media (min-width: $screen-xs-min) and (max-width: $screen-md-min) { @media (min-width: $screen-xs-min) and (max-width: $screen-md-min) {
......
// NOTE: This stylesheet is for the exclusive use of the `devise_mailer` layout
// used for Devise email templates, and _should not_ be included in any
// application stylesheets.
//
// Styles defined here are embedded directly into the resulting email HTML via
// the `premailer` gem.
$body-background-color: #363636;
$message-background-color: #fafafa;
$header-color: #6b4fbb;
$body-color: #444;
$cta-color: #e14329;
$footer-link-color: #7e7e7e;
$font-family: Helvetica, Arial, sans-serif;
body {
background-color: $body-background-color;
font-family: $font-family;
margin: 0;
padding: 0;
}
table {
-premailer-cellpadding: 0;
-premailer-cellspacing: 0;
border: 0;
border-collapse: separate;
&#wrapper {
background-color: $body-background-color;
width: 100%;
}
&#header {
margin: 0 auto;
text-align: left;
width: 600px;
}
&#body {
background-color: $message-background-color;
border: 1px solid #000;
border-radius: 4px;
margin: 0 auto;
width: 600px;
}
&#footer {
color: $footer-link-color;
font-size: 14px;
text-align: center;
width: 100%;
}
td {
&#body-container {
padding: 20px 40px;
}
}
}
.center {
text-align: center;
}
#logo {
border: none;
outline: none;
min-height: 88px;
width: 134px;
}
#content {
h2 {
color: $header-color;
font-size: 30px;
font-weight: 400;
line-height: 34px;
margin-top: 0;
}
p {
color: $body-color;
font-size: 17px;
line-height: 24px;
margin-bottom: 0;
}
}
#cta {
border: 1px solid $cta-color;
border-radius: 3px;
display: inline-block;
margin: 20px 0;
padding: 12px 24px;
a {
background-color: $message-background-color;
color: $cta-color;
display: inline-block;
text-decoration: none;
}
}
#tanuki {
padding: 40px 0 0;
img {
border: none;
outline: none;
width: 37px;
min-height: 36px;
}
}
#tagline {
font-size: 22px;
font-weight: 100;
padding: 4px 0 40px;
}
#social {
padding: 0 10px 20px;
width: 600px;
word-spacing: 20px;
a {
color: $footer-link-color;
text-decoration: none;
}
}
...@@ -280,11 +280,5 @@ ...@@ -280,11 +280,5 @@
background-color: $white-light; background-color: $white-light;
color: $gl-placeholder-color; color: $gl-placeholder-color;
} }
th,
td {
padding: 16px;
}
} }
} }
.pipeline-stage { .pipelines {
.stage {
max-width: 100px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap;
}
.duration, .finished_at {
margin: 4px 0;
}
.commit-title {
margin: 0;
}
.controls {
white-space: nowrap;
}
.btn {
margin: 4px;
}
} }
...@@ -66,12 +66,6 @@ ...@@ -66,12 +66,6 @@
} }
} }
.calendar-hint {
margin-top: -12px;
float: right;
font-size: 12px;
}
.profile-link-holder { .profile-link-holder {
display: inline; display: inline;
......
...@@ -74,8 +74,6 @@ class UsersController < ApplicationController ...@@ -74,8 +74,6 @@ class UsersController < ApplicationController
def calendar def calendar
calendar = contributions_calendar calendar = contributions_calendar
@timestamps = calendar.timestamps @timestamps = calendar.timestamps
@starting_year = calendar.starting_year
@starting_month = calendar.starting_month
render 'calendar', layout: false render 'calendar', layout: false
end end
......
...@@ -18,7 +18,7 @@ class GroupProjectsFinder < UnionFinder ...@@ -18,7 +18,7 @@ class GroupProjectsFinder < UnionFinder
projects = [] projects = []
if current_user if current_user
if @group.users.include?(current_user) if @group.users.include?(current_user) || current_user.admin?
projects << @group.projects unless only_shared projects << @group.projects unless only_shared
projects << @group.shared_projects unless only_owned projects << @group.shared_projects unless only_owned
else else
......
...@@ -159,28 +159,6 @@ module EventsHelper ...@@ -159,28 +159,6 @@ module EventsHelper
"--broken encoding" "--broken encoding"
end end
def event_to_atom(xml, event)
if event.visible_to_user?(current_user)
xml.entry do
event_link = event_feed_url(event)
event_title = event_feed_title(event)
event_summary = event_feed_summary(event)
xml.id "tag:#{request.host},#{event.created_at.strftime("%Y-%m-%d")}:#{event.id}"
xml.link href: event_link
xml.title truncate(event_title, length: 80)
xml.updated event.created_at.xmlschema
xml.media :thumbnail, width: "40", height: "40", url: image_url(avatar_icon(event.author_email))
xml.author do |author|
xml.name event.author_name
xml.email event.author_email
end
xml.summary(type: "xhtml") { |x| x << event_summary unless event_summary.nil? }
end
end
end
def event_row_class(event) def event_row_class(event)
if event.body? if event.body?
"event-block" "event-block"
......
...@@ -105,23 +105,6 @@ module IssuesHelper ...@@ -105,23 +105,6 @@ module IssuesHelper
return 'hidden' if issue.closed? == closed return 'hidden' if issue.closed? == closed
end end
def issue_to_atom(xml, issue)
xml.entry do
xml.id namespace_project_issue_url(issue.project.namespace,
issue.project, issue)
xml.link href: namespace_project_issue_url(issue.project.namespace,
issue.project, issue)
xml.title truncate(issue.title, length: 80)
xml.updated issue.created_at.xmlschema
xml.media :thumbnail, width: "40", height: "40", url: image_url(avatar_icon(issue.author_email))
xml.author do |author|
xml.name issue.author_name
xml.email issue.author_email
end
xml.summary issue.title
end
end
def merge_requests_sentence(merge_requests) def merge_requests_sentence(merge_requests)
# Sorting based on the `!123` or `group/project!123` reference will sort # Sorting based on the `!123` or `group/project!123` reference will sort
# local merge requests first. # local merge requests first.
......
...@@ -48,7 +48,7 @@ module NavHelper ...@@ -48,7 +48,7 @@ module NavHelper
"page-with-layout-nav" if defined?(nav) && nav "page-with-layout-nav" if defined?(nav) && nav
end end
def layout_dropdown_class def nav_control_class
"controls-dropdown-visible" if current_user "nav-control" if current_user
end end
end end
class DeviseMailer < Devise::Mailer class DeviseMailer < Devise::Mailer
default from: "#{Gitlab.config.gitlab.email_display_name} <#{Gitlab.config.gitlab.email_from}>" default from: "#{Gitlab.config.gitlab.email_display_name} <#{Gitlab.config.gitlab.email_from}>"
default reply_to: Gitlab.config.gitlab.email_reply_to default reply_to: Gitlab.config.gitlab.email_reply_to
layout 'devise_mailer'
end end
...@@ -3,7 +3,7 @@ module Projects ...@@ -3,7 +3,7 @@ module Projects
def execute def execute
new_params = { new_params = {
forked_from_project_id: @project.id, forked_from_project_id: @project.id,
visibility_level: @project.visibility_level, visibility_level: allowed_visibility_level,
description: @project.description, description: @project.description,
name: @project.name, name: @project.name,
path: @project.path, path: @project.path,
...@@ -19,5 +19,17 @@ module Projects ...@@ -19,5 +19,17 @@ module Projects
new_project = CreateService.new(current_user, new_params).execute new_project = CreateService.new(current_user, new_params).execute
new_project new_project
end end
private
def allowed_visibility_level
project_level = @project.visibility_level
if Gitlab::VisibilityLevel.non_restricted_level?(project_level)
project_level
else
Gitlab::VisibilityLevel.highest_allowed_level
end
end
end end
end end
...@@ -47,4 +47,3 @@ ...@@ -47,4 +47,3 @@
= render "admin/builds/build", build: build = render "admin/builds/build", build: build
= paginate @builds, theme: 'gitlab' = paginate @builds, theme: 'gitlab'
...@@ -6,8 +6,5 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear ...@@ -6,8 +6,5 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear
xml.id issues_dashboard_url xml.id issues_dashboard_url
xml.updated @issues.first.created_at.xmlschema if @issues.any? xml.updated @issues.first.created_at.xmlschema if @issues.any?
@issues.each do |issue| xml << render(partial: 'issues/issue', collection: @issues) if @issues.any?
issue_to_atom(xml, issue)
end
end end
...@@ -6,7 +6,5 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear ...@@ -6,7 +6,5 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear
xml.id dashboard_projects_url xml.id dashboard_projects_url
xml.updated @events[0].updated_at.xmlschema if @events[0] xml.updated @events[0].updated_at.xmlschema if @events[0]
@events.each do |event| xml << render(partial: 'events/event', collection: @events) if @events.any?
event_to_atom(xml, event)
end
end end
<p>Welcome <%= @resource.name %>!</p>
<% if @resource.unconfirmed_email.present? %>
<p>You can confirm your email (<%= @resource.unconfirmed_email %>) through the link below:</p>
<% else %>
<p>You can confirm your account through the link below:</p>
<% end %>
<p><%= link_to 'Confirm your account', confirmation_url(@resource, confirmation_token: @token) %></p>
.center
- if @resource.unconfirmed_email.present?
#content
%h2= @resource.unconfirmed_email
%p Click the link below to confirm your email address.
#cta
= link_to 'Confirm your email address', confirmation_url(@resource, confirmation_token: @token)
- else
#content
- if Gitlab.com?
%h2 Thanks for signing up to GitLab!
- else
%h2 Welcome, #{@resource.name}!
%p To get started, click the link below to confirm your account.
#cta
= link_to 'Confirm your account', confirmation_url(@resource, confirmation_token: @token)
Welcome, <%= @resource.name %>!
<% if @resource.unconfirmed_email.present? %>
You can confirm your email (<%= @resource.unconfirmed_email %>) through the link below:
<% else %>
You can confirm your account through the link below:
<% end %>
<%= confirmation_url(@resource, confirmation_token: @token) %>
return unless event.visible_to_user?(current_user)
xml.entry do
xml.id "tag:#{request.host},#{event.created_at.strftime("%Y-%m-%d")}:#{event.id}"
xml.link href: event_feed_url(event)
xml.title truncate(event_feed_title(event), length: 80)
xml.updated event.created_at.xmlschema
xml.media :thumbnail, width: "40", height: "40", url: image_url(avatar_icon(event.author_email))
xml.author do
xml.name event.author_name
xml.email event.author_email
end
xml.summary(type: "xhtml") do |summary|
event_summary = event_feed_summary(event)
summary << event_summary unless event_summary.nil?
end
end
...@@ -6,8 +6,5 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear ...@@ -6,8 +6,5 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear
xml.id issues_group_url xml.id issues_group_url
xml.updated @issues.first.created_at.xmlschema if @issues.any? xml.updated @issues.first.created_at.xmlschema if @issues.any?
@issues.each do |issue| xml << render(partial: 'issues/issue', collection: @issues) if @issues.any?
issue_to_atom(xml, issue)
end
end end
...@@ -6,7 +6,5 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear ...@@ -6,7 +6,5 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear
xml.id group_url(@group) xml.id group_url(@group)
xml.updated @events[0].updated_at.xmlschema if @events[0] xml.updated @events[0].updated_at.xmlschema if @events[0]
@events.each do |event| xml << render(@events) if @events.any?
event_to_atom(xml, event)
end
end end
xml.entry do
xml.id namespace_project_issue_url(issue.project.namespace, issue.project, issue)
xml.link href: namespace_project_issue_url(issue.project.namespace, issue.project, issue)
xml.title truncate(issue.title, length: 80)
xml.updated issue.created_at.xmlschema
xml.media :thumbnail, width: "40", height: "40", url: image_url(avatar_icon(issue.author_email))
xml.author do |author|
xml.name issue.author_name
xml.email issue.author_email
end
xml.summary issue.title
end
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
.layout-nav .layout-nav
.container-fluid .container-fluid
= render "layouts/nav/#{nav}" = render "layouts/nav/#{nav}"
.content-wrapper{ class: "#{layout_nav_class} #{layout_dropdown_class}" } .content-wrapper{ class: "#{layout_nav_class}" }
= render "layouts/broadcast" = render "layouts/broadcast"
= render "layouts/flash" = render "layouts/flash"
= yield :flash_message = yield :flash_message
......
!!! 5
%html
%head
%meta(content='text/html; charset=UTF-8' http-equiv='Content-Type')
= stylesheet_link_tag 'mailers/devise'
%body
%table#wrapper
%tr
%td
%table#header
%td{valign: "top"}
= image_tag('mailers/gitlab_header_logo.png', id: 'logo', alt: 'GitLab Wordmark')
%table#body
%tr
%td#body-container
= yield
- if Gitlab.com?
%table#footer
%tr
%td#tanuki
= image_tag('mailers/gitlab_tanuki_2x.png', alt: 'GitLab Logo')
%tr
%td#tagline
Everyone can contribute
%tr
%td#social
= link_to 'Blog', 'https://about.gitlab.com/blog/'
= link_to 'Twitter', 'https://twitter.com/gitlab'
= link_to 'Facebook', 'https://www.facebook.com/gitlab/'
= link_to 'YouTube', 'https://www.youtube.com/channel/UCnMGQ8QHMAnVIsI3xJrihhg'
= link_to 'LinkedIn', 'https://www.linkedin.com/company/gitlab-com'
= render 'layouts/nav/group_settings' %div{ class: nav_control_class }
= render 'layouts/nav/group_settings'
%ul.nav-links %ul.nav-links.scrolling-tabs
.fade-left
= nav_link(path: 'groups#show', html_options: {class: 'home'}) do = nav_link(path: 'groups#show', html_options: {class: 'home'}) do
= link_to group_path(@group), title: 'Home' do = link_to group_path(@group), title: 'Home' do
= icon('group fw') = icon('group fw')
...@@ -35,3 +37,4 @@ ...@@ -35,3 +37,4 @@
= icon('users fw') = icon('users fw')
%span %span
Members Members
.fade-right
%ul.nav-links %ul.nav-links.scrolling-tabs
.fade-left
= nav_link(path: 'profiles#show', html_options: {class: 'home'}) do = nav_link(path: 'profiles#show', html_options: {class: 'home'}) do
= link_to profile_path, title: 'Profile Settings' do = link_to profile_path, title: 'Profile Settings' do
= icon('user fw') = icon('user fw')
...@@ -47,3 +48,4 @@ ...@@ -47,3 +48,4 @@
= icon('history fw') = icon('history fw')
%span %span
Audit Log Audit Log
.fade-right
...@@ -19,7 +19,9 @@ ...@@ -19,7 +19,9 @@
data: { confirm: leave_project_message(@project) }, method: :delete, title: 'Leave project' do data: { confirm: leave_project_message(@project) }, method: :delete, title: 'Leave project' do
Leave Project Leave Project
%ul.nav-links %div{ class: nav_control_class }
%ul.nav-links.scrolling-tabs
.fade-left
= nav_link(path: 'projects#show', html_options: {class: 'home'}) do = nav_link(path: 'projects#show', html_options: {class: 'home'}) do
= link_to project_path(@project), title: 'Project', class: 'shortcuts-project' do = link_to project_path(@project), title: 'Project', class: 'shortcuts-project' do
= icon('bookmark fw') = icon('bookmark fw')
...@@ -129,3 +131,5 @@ ...@@ -129,3 +131,5 @@
%li.hidden %li.hidden
= link_to new_namespace_project_issue_path(@project.namespace, @project), class: 'shortcuts-new-issue' do = link_to new_namespace_project_issue_path(@project.namespace, @project), class: 'shortcuts-new-issue' do
Create a new issue Create a new issue
.fade-right
...@@ -35,9 +35,6 @@ ...@@ -35,9 +35,6 @@
= icon('wrench') = icon('wrench')
%span CI Lint %span CI Lint
.row-content-block
#{(@scope || 'all').capitalize} builds from this project
%ul.content-list %ul.content-list
- if @builds.blank? - if @builds.blank?
%li %li
......
...@@ -57,14 +57,10 @@ ...@@ -57,14 +57,10 @@
%td.duration %td.duration
- if build.duration - if build.duration
= icon("clock-o")
&nbsp;
#{duration_in_words(build.finished_at, build.started_at)} #{duration_in_words(build.finished_at, build.started_at)}
%td.timestamp %td.timestamp
- if build.finished_at - if build.finished_at
= icon("calendar")
&nbsp;
%span #{time_ago_with_tooltip(build.finished_at)} %span #{time_ago_with_tooltip(build.finished_at)}
- if defined?(coverage) && coverage - if defined?(coverage) && coverage
......
...@@ -12,10 +12,10 @@ ...@@ -12,10 +12,10 @@
&middot; &middot;
= link_to commit.short_sha, namespace_project_commit_path(@project.namespace, @project, commit.sha), class: "commit-id monospace" = link_to commit.short_sha, namespace_project_commit_path(@project.namespace, @project, commit.sha), class: "commit-id monospace"
&nbsp; &nbsp;
- if commit.latest?
%span.label.label-success latest
- if commit.tag? - if commit.tag?
%span.label.label-primary tag %span.label.label-primary tag
- elsif commit.latest?
%span.label.label-success.has-tooltip{ title: 'Latest build for this branch' } latest
- if commit.triggered? - if commit.triggered?
%span.label.label-primary triggered %span.label.label-primary triggered
- if commit.yaml_errors.present? - if commit.yaml_errors.present?
...@@ -23,10 +23,9 @@ ...@@ -23,10 +23,9 @@
- if commit.builds.any?(&:stuck?) - if commit.builds.any?(&:stuck?)
%span.label.label-warning stuck %span.label.label-warning stuck
%p %p.commit-title
%span
- if commit_data = commit.commit_data - if commit_data = commit.commit_data
= link_to_gfm commit_data.title, namespace_project_commit_path(@project.namespace, @project, commit_data.id), class: "commit-row-message" = link_to_gfm truncate(commit_data.title, length: 60), namespace_project_commit_path(@project.namespace, @project, commit_data.id), class: "commit-row-message"
- else - else
Cant find HEAD commit for this branch Cant find HEAD commit for this branch
...@@ -34,22 +33,19 @@ ...@@ -34,22 +33,19 @@
- stages_status = commit.statuses.stages_status - stages_status = commit.statuses.stages_status
- stages.each do |stage| - stages.each do |stage|
%td %td
- if status = stages_status[stage] - status = stages_status[stage]
- tooltip = "#{stage.titleize}: #{status}" - tooltip = "#{stage.titleize}: #{status || 'not found'}"
%span.has-tooltip{ title: "#{tooltip}", class: "ci-status-icon-#{status}" } - if status
= link_to namespace_project_pipeline_path(@project.namespace, @project, commit.id, anchor: stage), class: "has-tooltip ci-status-icon-#{status}", title: tooltip do
= ci_icon_for_status(status) = ci_icon_for_status(status)
- else
.light.has-tooltip{ title: tooltip }
\-
%td %td
- if commit.started_at && commit.finished_at - if commit.started_at && commit.finished_at
%p %p.duration
= icon("clock-o")
&nbsp;
#{duration_in_words(commit.finished_at, commit.started_at)} #{duration_in_words(commit.finished_at, commit.started_at)}
- if commit.finished_at
%p
= icon("calendar")
&nbsp;
#{time_ago_with_tooltip(commit.finished_at)}
%td %td
.controls.hidden-xs.pull-right .controls.hidden-xs.pull-right
...@@ -67,11 +63,9 @@ ...@@ -67,11 +63,9 @@
%span #{build.name} %span #{build.name}
- if can?(current_user, :update_pipeline, @project) - if can?(current_user, :update_pipeline, @project)
&nbsp;
- if commit.retryable? && commit.builds.failed.any? - if commit.retryable? && commit.builds.failed.any?
= link_to retry_namespace_project_pipeline_path(@project.namespace, @project, commit.id), class: 'btn has-tooltip', title: "Retry", method: :post do = link_to retry_namespace_project_pipeline_path(@project.namespace, @project, commit.id), class: 'btn has-tooltip', title: "Retry", method: :post do
= icon("repeat") = icon("repeat")
&nbsp;
- if commit.active? - if commit.active?
= link_to cancel_namespace_project_pipeline_path(@project.namespace, @project, commit.id), class: 'btn btn-remove has-tooltip', title: "Cancel", method: :post do = link_to cancel_namespace_project_pipeline_path(@project.namespace, @project, commit.id), class: 'btn btn-remove has-tooltip', title: "Cancel", method: :post do
= icon("remove") = icon("remove")
%tr %tr
%th{colspan: 10} %th{colspan: 10}
%strong %strong
%a{name: stage}
- status = statuses.latest.status - status = statuses.latest.status
%span{class: "ci-status-link ci-status-icon-#{status}"} %span{class: "ci-status-link ci-status-icon-#{status}"}
= ci_icon_for_status(status) = ci_icon_for_status(status)
......
xml.entry do
xml.id namespace_project_commit_url(@project.namespace, @project, id: commit.id)
xml.link href: namespace_project_commit_url(@project.namespace, @project, id: commit.id)
xml.title truncate(commit.title, length: 80)
xml.updated commit.committed_date.xmlschema
xml.media :thumbnail, width: "40", height: "40", url: image_url(avatar_icon(commit.author_email))
xml.author do |author|
xml.name commit.author_name
xml.email commit.author_email
end
xml.summary markdown(commit.description, pipeline: :single_line)
end
...@@ -6,18 +6,5 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear ...@@ -6,18 +6,5 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear
xml.id namespace_project_commits_url(@project.namespace, @project, @ref) xml.id namespace_project_commits_url(@project.namespace, @project, @ref)
xml.updated @commits.first.committed_date.xmlschema if @commits.any? xml.updated @commits.first.committed_date.xmlschema if @commits.any?
@commits.each do |commit| xml << render(@commits) if @commits.any?
xml.entry do
xml.id namespace_project_commit_url(@project.namespace, @project, id: commit.id)
xml.link href: namespace_project_commit_url(@project.namespace, @project, id: commit.id)
xml.title truncate(commit.title, length: 80)
xml.updated commit.committed_date.xmlschema
xml.media :thumbnail, width: "40", height: "40", url: image_url(avatar_icon(commit.author_email))
xml.author do |author|
xml.name commit.author_name
xml.email commit.author_email
end
xml.summary markdown(commit.description, pipeline: :single_line)
end
end
end end
...@@ -50,14 +50,10 @@ ...@@ -50,14 +50,10 @@
%td.duration %td.duration
- if generic_commit_status.duration - if generic_commit_status.duration
= icon("clock-o")
&nbsp;
#{duration_in_words(generic_commit_status.finished_at, generic_commit_status.started_at)} #{duration_in_words(generic_commit_status.finished_at, generic_commit_status.started_at)}
%td.timestamp %td.timestamp
- if generic_commit_status.finished_at - if generic_commit_status.finished_at
= icon("calendar")
&nbsp;
%span #{time_ago_with_tooltip(generic_commit_status.finished_at)} %span #{time_ago_with_tooltip(generic_commit_status.finished_at)}
- if defined?(coverage) && coverage - if defined?(coverage) && coverage
......
...@@ -6,7 +6,5 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear ...@@ -6,7 +6,5 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear
xml.id namespace_project_issues_url(@project.namespace, @project) xml.id namespace_project_issues_url(@project.namespace, @project)
xml.updated @issues.first.created_at.xmlschema if @issues.any? xml.updated @issues.first.created_at.xmlschema if @issues.any?
@issues.each do |issue| xml << render(partial: 'issues/issue', collection: @issues) if @issues.any?
issue_to_atom(xml, issue)
end
end end
...@@ -36,15 +36,7 @@ ...@@ -36,15 +36,7 @@
= icon('wrench') = icon('wrench')
%span CI Lint %span CI Lint
.row-content-block %ul.content-list.pipelines
- if @scope == 'running'
Running pipelines for this project
- elsif @scope.nil?
Pipelines for this project
- else
#{@scope.titleize} for this project
%ul.content-list
- stages = @pipelines.stages - stages = @pipelines.stages
- if @pipelines.blank? - if @pipelines.blank?
%li %li
...@@ -56,10 +48,10 @@ ...@@ -56,10 +48,10 @@
%th ID %th ID
%th Commit %th Commit
- stages.each do |stage| - stages.each do |stage|
%th %th.stage
%span.pipeline-stage.has-tooltip{ title: "#{stage.titleize}" } %span.has-tooltip{ title: "#{stage.titleize}" }
= stage.titleize.pluralize = stage.titleize.pluralize
%th %th Duration
%th %th
= render @pipelines, commit_sha: true, stage: true, allow_retry: true, stages: stages = render @pipelines, commit_sha: true, stage: true, allow_retry: true, stages: stages
......
...@@ -6,7 +6,5 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear ...@@ -6,7 +6,5 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear
xml.id namespace_project_url(@project.namespace, @project) xml.id namespace_project_url(@project.namespace, @project)
xml.updated @events[0].updated_at.xmlschema if @events[0] xml.updated @events[0].updated_at.xmlschema if @events[0]
@events.each do |event| xml << render(@events) if @events.any?
event_to_atom(xml, event)
end
end end
%ul.nav-links.event-filter %ul.nav-links.event-filter.scrolling-tabs
.fade-left
= event_filter_link EventFilter.push, 'Push events' = event_filter_link EventFilter.push, 'Push events'
= event_filter_link EventFilter.merged, 'Merge events' = event_filter_link EventFilter.merged, 'Merge events'
= event_filter_link EventFilter.comments, 'Comments' = event_filter_link EventFilter.comments, 'Comments'
= event_filter_link EventFilter.team, 'Team' = event_filter_link EventFilter.team, 'Team'
.fade-right
#cal-heatmap.calendar .clearfix.calendar
:javascript .js-contrib-calendar
.calendar-hint
Summary of issues, merge requests, and push events
:javascript
new Calendar( new Calendar(
#{@timestamps.to_json}, #{@timestamps.to_json},
#{@starting_year},
#{@starting_month},
'#{user_calendar_activities_path}' '#{user_calendar_activities_path}'
); );
.calendar-hint Summary of issues, merge requests, and push events
%h4.prepend-top-20 %h4.prepend-top-20
%span.light Contributions for Contributions for
%strong #{@calendar_date.to_s(:short)} %strong #{@calendar_date.to_s(:short)}
%ul.bordered-list - if @events.any?
%ul.bordered-list
- @events.sort_by(&:created_at).each do |event| - @events.sort_by(&:created_at).each do |event|
%li %li
%span.light %span.light
...@@ -21,3 +22,6 @@ ...@@ -21,3 +22,6 @@
= link_to_project event.project = link_to_project event.project
- else - else
= event.project_name = event.project_name
- else
%p
No contributions found for #{@calendar_date.to_s(:short)}
...@@ -6,7 +6,5 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear ...@@ -6,7 +6,5 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear
xml.id user_url(@user) xml.id user_url(@user)
xml.updated @events[0].updated_at.xmlschema if @events[0] xml.updated @events[0].updated_at.xmlschema if @events[0]
@events.each do |event| xml << render(@events) if @events.any?
event_to_atom(xml, event)
end
end end
...@@ -89,7 +89,6 @@ ...@@ -89,7 +89,6 @@
.tab-content .tab-content
#activity.tab-pane #activity.tab-pane
.row-content-block.calender-block.white.second-block.hidden-xs .row-content-block.calender-block.white.second-block.hidden-xs
%div{ class: container_class }
.user-calendar{data: {href: user_calendar_path}} .user-calendar{data: {href: user_calendar_path}}
%h4.center.light %h4.center.light
%i.fa.fa-spinner.fa-spin %i.fa.fa-spinner.fa-spin
......
...@@ -80,7 +80,7 @@ module Gitlab ...@@ -80,7 +80,7 @@ module Gitlab
config.assets.precompile << "*.png" config.assets.precompile << "*.png"
config.assets.precompile << "print.css" config.assets.precompile << "print.css"
config.assets.precompile << "notify.css" config.assets.precompile << "notify.css"
config.assets.precompile << "mailers/repository_push_email.css" config.assets.precompile << "mailers/*.css"
# Version of your assets, change this if you want to expire all your assets # Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0' config.assets.version = '1.0'
......
...@@ -39,6 +39,7 @@ Rails.application.configure do ...@@ -39,6 +39,7 @@ Rails.application.configure do
config.action_mailer.delivery_method = :letter_opener_web config.action_mailer.delivery_method = :letter_opener_web
# Don't make a mess when bootstrapping a development environment # Don't make a mess when bootstrapping a development environment
config.action_mailer.perform_deliveries = (ENV['BOOTSTRAP'] != '1') config.action_mailer.perform_deliveries = (ENV['BOOTSTRAP'] != '1')
config.action_mailer.preview_path = 'spec/mailers/previews'
config.eager_load = false config.eager_load = false
end end
...@@ -3,6 +3,6 @@ Premailer::Rails.config.merge!( ...@@ -3,6 +3,6 @@ Premailer::Rails.config.merge!(
generate_text_part: false, generate_text_part: false,
preserve_styles: true, preserve_styles: true,
remove_comments: true, remove_comments: true,
remove_ids: true, remove_ids: false,
remove_scripts: false remove_scripts: false
) )
...@@ -19,6 +19,8 @@ Components/Servers Required: ...@@ -19,6 +19,8 @@ Components/Servers Required:
- 2 servers/virtual machines (one active/one passive) - 2 servers/virtual machines (one active/one passive)
![Active/Passive HA Diagram](../img/high_availability/active-passive-diagram.png)
### Active/Active ### Active/Active
This architecture scales easily because all application servers handle This architecture scales easily because all application servers handle
...@@ -26,6 +28,8 @@ user requests simultaneously. The database, Redis, and GitLab application are ...@@ -26,6 +28,8 @@ user requests simultaneously. The database, Redis, and GitLab application are
all deployed on separate servers. The configuration is **only** highly-available all deployed on separate servers. The configuration is **only** highly-available
if the database, Redis and storage are also configured as such. if the database, Redis and storage are also configured as such.
![Active/Active HA Diagram](../img/high_availability/active-active-diagram.png)
**Steps to configure active/active:** **Steps to configure active/active:**
1. [Configure the database](database.md) 1. [Configure the database](database.md)
......
...@@ -34,7 +34,7 @@ class Spinach::Features::User < Spinach::FeatureSteps ...@@ -34,7 +34,7 @@ class Spinach::Features::User < Spinach::FeatureSteps
end end
step 'I should see contributions calendar' do step 'I should see contributions calendar' do
expect(page).to have_css('.cal-heatmap-container') expect(page).to have_css('.js-contrib-calendar')
end end
def contributed_project def contributed_project
......
...@@ -95,8 +95,7 @@ module API ...@@ -95,8 +95,7 @@ module API
# GET /groups/:id/projects # GET /groups/:id/projects
get ":id/projects" do get ":id/projects" do
group = find_group(params[:id]) group = find_group(params[:id])
projects = group.projects projects = GroupProjectsFinder.new(group).execute(current_user)
projects = filter_projects(projects)
projects = paginate projects projects = paginate projects
present projects, with: Entities::Project present projects, with: Entities::Project
end end
......
...@@ -19,7 +19,7 @@ module Gitlab ...@@ -19,7 +19,7 @@ module Gitlab
select('date(created_at) as date, count(id) as total_amount'). select('date(created_at) as date, count(id) as total_amount').
map(&:attributes) map(&:attributes)
dates = (1.year.ago.to_date..(Date.today + 1.day)).to_a dates = (1.year.ago.to_date..Date.today).to_a
dates.each do |date| dates.each do |date|
date_id = date.to_time.to_i.to_s date_id = date.to_time.to_i.to_s
......
...@@ -7,7 +7,7 @@ module Gitlab ...@@ -7,7 +7,7 @@ module Gitlab
end end
def initialize(url, credentials: nil) def initialize(url, credentials: nil)
@url = Addressable::URI.parse(URI.encode(url)) @url = Addressable::URI.parse(url)
@credentials = credentials @credentials = credentials
end end
......
...@@ -32,6 +32,13 @@ module Gitlab ...@@ -32,6 +32,13 @@ module Gitlab
} }
end end
def highest_allowed_level
restricted_levels = current_application_settings.restricted_visibility_levels
allowed_levels = self.values - restricted_levels
allowed_levels.max || PRIVATE
end
def allowed_for?(user, level) def allowed_for?(user, level)
user.is_admin? || allowed_level?(level.to_i) user.is_admin? || allowed_level?(level.to_i)
end end
......
...@@ -43,7 +43,6 @@ describe "Builds" do ...@@ -43,7 +43,6 @@ describe "Builds" do
end end
it { expect(page).to have_selector('.nav-links li.active', text: 'All') } it { expect(page).to have_selector('.nav-links li.active', text: 'All') }
it { expect(page).to have_selector('.row-content-block', text: 'All builds from this project') }
it { expect(page).to have_content @build.short_sha } it { expect(page).to have_content @build.short_sha }
it { expect(page).to have_content @build.ref } it { expect(page).to have_content @build.ref }
it { expect(page).to have_content @build.name } it { expect(page).to have_content @build.name }
......
...@@ -186,7 +186,7 @@ describe 'Filter issues', feature: true do ...@@ -186,7 +186,7 @@ describe 'Filter issues', feature: true do
fill_in 'issue_search', with: 'testing' fill_in 'issue_search', with: 'testing'
page.within '.issues-list' do page.within '.issues-list' do
expect(page).to_not have_selector('.issue') expect(page).not_to have_selector('.issue')
end end
end end
end end
......
class DeviseMailerPreview < ActionMailer::Preview
def confirmation_instructions_for_signup
user = User.new(name: 'Jane Doe', email: 'signup@example.com')
DeviseMailer.confirmation_instructions(user, 'faketoken', {})
end
def confirmation_instructions_for_new_email
user = User.last
DeviseMailer.confirmation_instructions(user, 'faketoken', {})
end
end
...@@ -12,6 +12,7 @@ describe API::API, api: true do ...@@ -12,6 +12,7 @@ describe API::API, api: true do
let!(:group2) { create(:group, :private) } let!(:group2) { create(:group, :private) }
let!(:project1) { create(:project, namespace: group1) } let!(:project1) { create(:project, namespace: group1) }
let!(:project2) { create(:project, namespace: group2) } let!(:project2) { create(:project, namespace: group2) }
let!(:project3) { create(:project, namespace: group1, path: 'test', visibility_level: Gitlab::VisibilityLevel::PRIVATE) }
before do before do
group1.add_owner(user1) group1.add_owner(user1)
...@@ -147,9 +148,11 @@ describe API::API, api: true do ...@@ -147,9 +148,11 @@ describe API::API, api: true do
context "when authenticated as user" do context "when authenticated as user" do
it "should return the group's projects" do it "should return the group's projects" do
get api("/groups/#{group1.id}/projects", user1) get api("/groups/#{group1.id}/projects", user1)
expect(response.status).to eq(200) expect(response.status).to eq(200)
expect(json_response.length).to eq(1) expect(json_response.length).to eq(2)
expect(json_response.first['name']).to eq(project1.name) project_names = json_response.map { |proj| proj['name' ] }
expect(project_names).to match_array([project1.name, project3.name])
end end
it "should not return a non existing group" do it "should not return a non existing group" do
...@@ -162,6 +165,16 @@ describe API::API, api: true do ...@@ -162,6 +165,16 @@ describe API::API, api: true do
expect(response.status).to eq(404) expect(response.status).to eq(404)
end end
it "should only return projects to which user has access" do
project3.team << [user3, :developer]
get api("/groups/#{group1.id}/projects", user3)
expect(response.status).to eq(200)
expect(json_response.length).to eq(1)
expect(json_response.first['name']).to eq(project3.name)
end
end end
context "when authenticated as admin" do context "when authenticated as admin" do
...@@ -181,8 +194,10 @@ describe API::API, api: true do ...@@ -181,8 +194,10 @@ describe API::API, api: true do
context 'when using group path in URL' do context 'when using group path in URL' do
it 'should return any existing group' do it 'should return any existing group' do
get api("/groups/#{group1.path}/projects", admin) get api("/groups/#{group1.path}/projects", admin)
expect(response.status).to eq(200) expect(response.status).to eq(200)
expect(json_response.first['name']).to eq(project1.name) project_names = json_response.map { |proj| proj['name' ] }
expect(project_names).to match_array([project1.name, project3.name])
end end
it 'should not return a non existing group' do it 'should not return a non existing group' do
......
...@@ -42,6 +42,33 @@ describe Projects::ForkService, services: true do ...@@ -42,6 +42,33 @@ describe Projects::ForkService, services: true do
expect(@to_project.builds_enabled?).to be_truthy expect(@to_project.builds_enabled?).to be_truthy
end end
end end
context "when project has restricted visibility level" do
context "and only one visibility level is restricted" do
before do
@from_project.update_attributes(visibility_level: Gitlab::VisibilityLevel::INTERNAL)
stub_application_setting(restricted_visibility_levels: [Gitlab::VisibilityLevel::INTERNAL])
end
it "creates fork with highest allowed level" do
forked_project = fork_project(@from_project, @to_user)
expect(forked_project.visibility_level).to eq(Gitlab::VisibilityLevel::PUBLIC)
end
end
context "and all visibility levels are restricted" do
before do
stub_application_setting(restricted_visibility_levels: [Gitlab::VisibilityLevel::PUBLIC, Gitlab::VisibilityLevel::INTERNAL, Gitlab::VisibilityLevel::PRIVATE])
end
it "creates fork with private visibility levels" do
forked_project = fork_project(@from_project, @to_user)
expect(forked_project.visibility_level).to eq(Gitlab::VisibilityLevel::PRIVATE)
end
end
end
end end
describe :fork_to_namespace do describe :fork_to_namespace do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment