Commit e90a5557 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Merge remote-tracking branch 'upstream/master' into pipeline-notifications

* upstream/master: (73 commits)
  Stop unauthized users dragging on issue boards
  Capitalize Git
  Add docker-compose environment initialization command
  Improve readability and add specs for label filtering
  Improve label filtering implementation
  Allow the use of params[:name] when filtering labels
  Fix Rubocop offenses in issue move specs
  Add spec in Issues::MoveService to fix label assignment regression
  Fix bug where labels would be assigned to issues that were moved
  Fix `User#to_reference`
  Fix rubocop build error
  Remove redundant class_name and foreign_key overrides
  Enable SingleLinePerSelector in scss-lint
  Escape ref and path for relative links (!6050)
  Add failing test for #21420
  Enable SpaceAfterVariableColon in scss-lint
  Enable SpaceAroundOperator in scss-lint
  Enable trailingWhitespace in scss-lint
  Disable Rails/Output cop since it makes no sense here
  Use File.write instead of File.open + File#write
  ...
parents 02b62474 3b93574a
......@@ -210,7 +210,7 @@ rake brakeman: *exec
rake flay: *exec
license_finder: *exec
rake downtime_check: *exec
rake ce_to_ee_merge_check:
rake ee_compat_check:
<<: *exec
only:
- branches
......
......@@ -172,7 +172,7 @@ linters:
# Split selectors onto separate lines after each comma, and have each
# individual selector occupy a single line.
SingleLinePerSelector:
enabled: false
enabled: true
# Commas in lists should be followed by a space.
SpaceAfterComma:
......@@ -191,7 +191,7 @@ linters:
# Variables should be formatted with a single space separating the colon
# from the variable's value.
SpaceAfterVariableColon:
enabled: false
enabled: true
# Variables should be formatted with no space between the name and the
# colon.
......@@ -201,7 +201,7 @@ linters:
# Operators should be formatted with a single space on both sides of an
# infix operator.
SpaceAroundOperator:
enabled: false
enabled: true
# Opening braces should be preceded by a single space.
SpaceBeforeBrace:
......@@ -223,7 +223,7 @@ linters:
# Reports lines containing trailing whitespace.
TrailingWhitespace:
enabled: false
enabled: true
# Don't write trailing zeros for numeric values with a decimal point.
TrailingZero:
......
......@@ -4,16 +4,30 @@ Please view this file on the master branch, on stable branches it's out of date.
- Adds user project membership expired event to clarify why user was removed (Callum Dryden)
- Add CI notifications. Who triggered a pipeline would receive an email after the pipeline is succeeded or failed. Users could also update notification settings accordingly. !6342
- Trim leading and trailing whitespace on project_path (Linus Thiel)
- Prevent award emoji via notes for issues/MRs authored by user (barthc)
- Adds an optional path parameter to the Commits API to filter commits by path (Luis HGO)
- Fix extra space on Build sidebar on Firefox !7060
- Fix HipChat notifications rendering (airatshigapov, eisnerd)
- Add hover to trash icon in notes !7008 (blackst0ne)
- Escape ref and path for relative links !6050 (winniehell)
- Simpler arguments passed to named_route on toggle_award_url helper method
- Fix: Backup restore doesn't clear cache
- Use MergeRequestsClosingIssues cache data on Issue#closed_by_merge_requests method
- Fix Sign in page 'Forgot your password?' link overlaps on medium-large screens
- Fix documents and comments on Build API `scope`
- Refactor email, use setter method instead AR callbacks for email attribute (Semyon Pupkov)
## 8.13.1 (unreleased)
- Fix bug where labels would be assigned to issues that were moved
- Fix error in generating labels
- Fix reply-by-email not working due to queue name mismatch
- Fixed hidden pipeline graph on commit and MR page !6895
- Expire and build repository cache after project import
- Fix 404 for group pages when GitLab setup uses relative url
- Simpler arguments passed to named_route on toggle_award_url helper method
- Fix unauthorized users dragging on issue boards
- Better handle when no users were selected for adding to group or project. (Linus Thiel)
- Only show register tab if signup enabled.
## 8.13.0 (2016-10-22)
- Removes extra line for empty issue description. (!7045)
......@@ -45,6 +59,7 @@ Please view this file on the master branch, on stable branches it's out of date.
- Clarify documentation for Runners API (Gennady Trafimenkov)
- The instrumentation for Banzai::Renderer has been restored
- Change user & group landing page routing from /u/:username to /:username
- Fixed issue boards user link when in subdirectory
- Added documentation for .gitattributes files
- Move Pipeline Metrics to separate worker
- AbstractReferenceFilter caches project_refs on RequestStore when active
......@@ -94,6 +109,7 @@ Please view this file on the master branch, on stable branches it's out of date.
- Add visibility level to project repository
- Fix robots.txt disallowing access to groups starting with "s" (Matt Harrison)
- Close open merge request without source project (Katarzyna Kobierska Ula Budziszewska)
- Fix showing commits from source project for merge request !6658
- Fix that manual jobs would no longer block jobs in the next stage. !6604
- Add configurable email subject suffix (Fu Xu)
- Use defined colour for a language when available !6748 (nilsding)
......@@ -388,6 +404,7 @@ Please view this file on the master branch, on stable branches it's out of date.
- Fix inconsistent checkbox alignment (ClemMakesApps)
- Use the default branch for displaying the project icon instead of master !5792 (Hannes Rosenögger)
- Adds response mime type to transaction metric action when it's not HTML
- Fix branch protection API !6215
- Fix hover leading space bug in pipeline graph !5980
- Avoid conflict with admin labels when importing GitHub labels
- User can edit closed MR with deleted fork (Katarzyna Kobierska Ula Budziszewska) !5496
......
......@@ -83,14 +83,15 @@
};
// Disable button if text field is empty
window.disableButtonIfEmptyField = function(field_selector, button_selector) {
window.disableButtonIfEmptyField = function(field_selector, button_selector, event_name) {
event_name = event_name || 'input';
var closest_submit, field;
field = $(field_selector);
closest_submit = field.closest('form').find(button_selector);
if (rstrip(field.val()) === "") {
closest_submit.disable();
}
return field.on('input', function() {
return field.on(event_name, function() {
if (rstrip($(this).val()) === "") {
return closest_submit.disable();
} else {
......
......@@ -148,7 +148,7 @@
};
Build.prototype.translateSidebar = function(e) {
var newPosition = this.sidebarTranslationLimits.max - document.body.scrollTop;
var newPosition = this.sidebarTranslationLimits.max - (document.body.scrollTop || document.documentElement.scrollTop);
if (newPosition < this.sidebarTranslationLimits.min) newPosition = this.sidebarTranslationLimits.min;
this.$sidebar.css({
top: newPosition
......
......@@ -117,6 +117,9 @@
new ZenMode();
shortcut_handler = new ShortcutsNavigation();
break;
case 'projects:commit:builds':
new gl.Pipelines();
break;
case 'projects:commits:show':
case 'projects:activity':
shortcut_handler = new ShortcutsNavigation();
......
......@@ -137,8 +137,11 @@
}
initValidators () {
// select all non-hidden inputs in form
this.state.inputs = this.form.find(':input:not([type=hidden])').toArray()
// register selectors here as needed
const validateSelectors = [':text', ':password', '[type=email]']
.map((selector) => `input${selector}`).join(',');
this.state.inputs = this.form.find(validateSelectors).toArray()
.filter((input) => !input.classList.contains(customValidationFlag))
.map((input) => new GlFieldError({ input, formErrors: this }));
......
......@@ -10,6 +10,7 @@
$('.project_member, .group_member').off('ajax:success').on('ajax:success', this.removeRow);
$('.js-member-update-control').off('change').on('change', this.formSubmit);
$('.js-edit-member-form').off('ajax:success').on('ajax:success', this.formSuccess);
disableButtonIfEmptyField('#user_ids', 'input[name=commit]', 'change');
}
removeRow(e) {
......
......@@ -282,6 +282,7 @@
document.querySelector("div#builds").innerHTML = data.html;
gl.utils.localTimeAgo($('.js-timeago', 'div#builds'));
_this.buildsLoaded = true;
if (!this.pipelines) this.pipelines = new gl.Pipelines();
return _this.scrollToElement("#builds");
};
})(this)
......
// This file is based off animate.css 3.5.1, available here:
// https://github.com/daneden/animate.css/blob/3.5.1/animate.css
//
//
// animate.css - http://daneden.me/animate
// Version - 3.5.1
// Licensed under the MIT license - http://opensource.org/licenses/MIT
//
//
// Copyright (c) 2016 Daniel Eden
.animated {
......@@ -37,7 +37,8 @@
}
@include keyframes(pulse) {
from, to {
from,
to {
@include webkit-prefix(transform, scale3d(1, 1, 1));
}
......
......@@ -128,7 +128,8 @@
position: relative;
.avatar-holder {
.avatar, .identicon {
.avatar,
.identicon {
margin: 0 auto;
float: none;
}
......
......@@ -213,7 +213,8 @@
top: 2px;
}
svg, .fa {
svg,
.fa {
&:not(:last-child) {
margin-right: 3px;
}
......
......@@ -143,7 +143,8 @@ li.note {
}
}
.wiki_content code, .readme code {
.wiki_content code,
.readme code {
background-color: inherit;
}
......@@ -350,7 +351,8 @@ table {
margin-right: 10px;
}
.alert, .progress {
.alert,
.progress {
margin-bottom: $gl-padding;
}
......
......@@ -275,7 +275,8 @@
a {
padding-left: 25px;
&.is-indeterminate, &.is-active {
&.is-indeterminate,
&.is-active {
&::before {
position: absolute;
left: 5px;
......@@ -373,7 +374,8 @@
}
}
.dropdown-input-field, .default-dropdown-input {
.dropdown-input-field,
.default-dropdown-input {
width: 100%;
min-height: 30px;
padding: 0 7px;
......@@ -402,7 +404,7 @@
.dropdown-content {
max-height: 215px;
overflow-y: scroll;
overflow-y: auto;
}
.dropdown-footer {
......
......@@ -18,7 +18,8 @@
margin: 0;
}
.flash-notice, .flash-alert {
.flash-notice,
.flash-alert {
border-radius: $border-radius-default;
.container-fluid,
......@@ -30,7 +31,8 @@
&.flash-container-page {
margin-bottom: 0;
.flash-notice, .flash-alert {
.flash-notice,
.flash-alert {
border-radius: 0;
}
}
......
......@@ -25,7 +25,9 @@
a {
color: $color-light;
&:hover, &:focus, &:active {
&:hover,
&:focus,
&:active {
background: $color-dark;
}
......
......@@ -15,7 +15,8 @@ header {
margin: 8px 0;
text-align: center;
.tanuki-logo, img {
.tanuki-logo,
img {
height: 36px;
}
}
......@@ -54,7 +55,9 @@ header {
line-height: 28px;
text-align: center;
&:hover, &:focus, &:active {
&:hover,
&:focus,
&:active {
background-color: $background-color;
}
......@@ -125,7 +128,8 @@ header {
left: -50%;
}
svg, img {
svg,
img {
height: 36px;
}
......@@ -222,7 +226,8 @@ header {
margin: 0;
float: none !important;
.visible-xs, .visable-sm {
.visible-xs,
.visable-sm {
display: table-cell !important;
}
}
......
......@@ -76,14 +76,16 @@
/** light list with border-bottom between li **/
ul.bordered-list, ul.unstyled-list {
ul.bordered-list,
ul.unstyled-list {
@include basic-list;
&.top-list {
li:first-child {
padding-top: 0;
h4, h5 {
h4,
h5 {
margin-top: 0;
}
}
......
......@@ -61,7 +61,7 @@
10%, 80% {
fill: $tanuki-red;
}
20%, 90% {
fill: lighten($tanuki-red, 25%);
}
......
......@@ -79,7 +79,8 @@
padding-left: 15px !important;
}
.nav-links, .nav-links {
.nav-links,
.nav-links {
li a {
font-size: 14px;
padding: 19px 10px;
......@@ -99,18 +100,21 @@
@media (max-width: $screen-sm-max) {
.issues-filters {
.milestone-filter, .labels-filter {
.milestone-filter,
.labels-filter {
display: none;
}
}
.page-title {
.note-created-ago, .new-issue-link {
.note-created-ago,
.new-issue-link {
display: none;
}
}
.issue_edited_ago, .note_edited_ago {
.issue_edited_ago,
.note_edited_ago {
display: none;
}
......
......@@ -3,7 +3,7 @@
padding: 15px;
.form-actions {
margin: -$gl-padding+1;
margin: -$gl-padding + 1;
margin-top: 15px;
}
......
......@@ -54,7 +54,9 @@
color: #959494;
border-bottom: 2px solid transparent;
&:hover, &:active, &:focus {
&:hover,
&:active,
&:focus {
text-decoration: none;
outline: none;
}
......@@ -211,7 +213,11 @@
padding-bottom: 0;
width: 100%;
.btn, form, .dropdown, .dropdown-menu-toggle, .form-control {
.btn,
form,
.dropdown,
.dropdown-menu-toggle,
.form-control {
margin: 0 0 10px;
display: block;
width: 100%;
......@@ -245,7 +251,8 @@
}
&.adjust {
.nav-text, .nav-controls {
.nav-text,
.nav-controls {
width: auto;
}
}
......@@ -309,13 +316,15 @@
padding-top: 10px;
}
a, i {
a,
i {
color: $layout-link-gray;
}
&.active {
a, i {
a,
i {
color: $black;
}
......@@ -328,7 +337,8 @@
}
&:hover {
a, i {
a,
i {
color: $black;
}
}
......
......@@ -3,7 +3,8 @@
width: 100% !important;
}
.select2-container, .select2-container.select2-drop-above {
.select2-container,
.select2-container.select2-drop-above {
.select2-choice {
background: #fff;
border-color: $input-border;
......@@ -71,7 +72,8 @@
}
.select2-container-active {
.select2-choice, .select2-choices {
.select2-choice,
.select2-choices {
box-shadow: none;
}
}
......
......@@ -23,7 +23,8 @@ table {
}
tr {
td, th {
td,
th {
padding: 10px $gl-padding;
line-height: 20px;
vertical-align: middle;
......
......@@ -126,7 +126,8 @@
box-shadow: none;
.panel-body {
form, pre {
form,
pre {
margin: 0;
}
......
......@@ -16,21 +16,21 @@
// $gray-light: lighten($gray-base, 46.7%) // #777
// $gray-lighter: lighten($gray-base, 93.5%) // #eee
$brand-primary: $gl-primary;
$brand-success: $gl-success;
$brand-info: $gl-info;
$brand-warning: $gl-warning;
$brand-danger: $gl-danger;
$brand-primary: $gl-primary;
$brand-success: $gl-success;
$brand-info: $gl-info;
$brand-warning: $gl-warning;
$brand-danger: $gl-danger;
$border-radius-base: 3px !default;
$border-radius-large: 3px !default;
$border-radius-small: 3px !default;
$border-radius-base: 3px !default;
$border-radius-large: 3px !default;
$border-radius-small: 3px !default;
//== Scaffolding
//
$text-color: $gl-text-color;
$link-color: $gl-link-color;
$text-color: $gl-text-color;
$link-color: $gl-link-color;
//== Typography
......@@ -38,112 +38,112 @@ $link-color: $gl-link-color;
//## Font, line-height, and color for body text, headings, and more.
$font-family-sans-serif: $regular_font;
$font-family-monospace: $monospace_font;
$font-size-base: $gl-font-size;
$font-family-monospace: $monospace_font;
$font-size-base: $gl-font-size;
//== Components
//
//## Define common padding and border radius sizes and more. Values based on 14px text and 1.428 line-height (~20px to start).
$padding-base-vertical: $gl-vert-padding;
$padding-base-horizontal: $gl-padding;
$component-active-color: #fff;
$component-active-bg: $brand-info;
$padding-base-vertical: $gl-vert-padding;
$padding-base-horizontal: $gl-padding;
$component-active-color: #fff;
$component-active-bg: $brand-info;
//== Forms
//
//##
$input-color: $text-color;
$input-border: $border-color;
$input-border-focus: $focus-border-color;
$legend-color: $text-color;
$input-color: $text-color;
$input-border: $border-color;
$input-border-focus: $focus-border-color;
$legend-color: $text-color;
//== Pagination
//
//##
$pagination-color: $gl-gray;
$pagination-bg: #fff;
$pagination-border: $border-color;
$pagination-color: $gl-gray;
$pagination-bg: #fff;
$pagination-border: $border-color;
$pagination-hover-color: $gl-gray;
$pagination-hover-bg: $row-hover;
$pagination-hover-border: $border-color;
$pagination-hover-color: $gl-gray;
$pagination-hover-bg: $row-hover;
$pagination-hover-border: $border-color;
$pagination-active-color: $blue-dark;
$pagination-active-bg: #fff;
$pagination-active-border: $border-color;
$pagination-active-color: $blue-dark;
$pagination-active-bg: #fff;
$pagination-active-border: $border-color;
$pagination-disabled-color: #cdcdcd;
$pagination-disabled-bg: $background-color;
$pagination-disabled-border: $border-color;
$pagination-disabled-color: #cdcdcd;
$pagination-disabled-bg: $background-color;
$pagination-disabled-border: $border-color;
//== Form states and alerts
//
//## Define colors for form feedback states and, by default, alerts.
$state-success-text: #fff;
$state-success-bg: $brand-success;
$state-success-border: $brand-success;
$state-success-text: #fff;
$state-success-bg: $brand-success;
$state-success-border: $brand-success;
$state-info-text: #fff;
$state-info-bg: $brand-info;
$state-info-border: $brand-info;
$state-info-text: #fff;
$state-info-bg: $brand-info;
$state-info-border: $brand-info;
$state-warning-text: #fff;
$state-warning-bg: $brand-warning;
$state-warning-border: $brand-warning;
$state-warning-text: #fff;
$state-warning-bg: $brand-warning;
$state-warning-border: $brand-warning;
$state-danger-text: #fff;
$state-danger-bg: $brand-danger;
$state-danger-border: $brand-danger;
$state-danger-text: #fff;
$state-danger-bg: $brand-danger;
$state-danger-border: $brand-danger;
//== Alerts
//
//## Define alert colors, border radius, and padding.
$alert-border-radius: 0;
$alert-border-radius: 0;
//== Panels
//
//##
$panel-border-radius: 2px;
$panel-default-text: $text-color;
$panel-default-border: $border-color;
$panel-border-radius: 2px;
$panel-default-text: $text-color;
$panel-default-border: $border-color;
$panel-default-heading-bg: $background-color;
$panel-footer-bg: $background-color;
$panel-inner-border: $border-color;
$panel-footer-bg: $background-color;
$panel-inner-border: $border-color;
//== Wells
//
//##
$well-bg: $gray-light;
$well-border: #eee;
$well-bg: $gray-light;
$well-border: #eee;
//== Code
//
//##
$code-color: #c7254e;
$code-bg: #f9f2f4;
$code-color: #c7254e;
$code-bg: #f9f2f4;
$kbd-color: #fff;
$kbd-bg: #333;
$kbd-color: #fff;
$kbd-bg: #333;
//== Buttons
//
//##
$btn-default-color: $gl-text-color;
$btn-default-bg: #fff;
$btn-default-border: #e7e9ed;
$btn-default-color: $gl-text-color;
$btn-default-bg: #fff;
$btn-default-border: #e7e9ed;
//== Nav
//
......@@ -153,8 +153,8 @@ $nav-link-padding: 13px $gl-padding;
//== Code
//
//##
$pre-bg: $background-color !default;
$pre-color: $gl-gray !default;
$pre-bg: $background-color !default;
$pre-color: $gl-gray !default;
$pre-border-color: $border-color;
$table-bg-accent: $background-color;
......@@ -131,12 +131,14 @@
font-weight: inherit;
}
ul, ol {
ul,
ol {
padding: 0;
margin: 3px 0 3px 28px !important;
}
ul:dir(rtl), ol:dir(rtl) {
ul:dir(rtl),
ol:dir(rtl) {
margin: 3px 28px 3px 0 !important;
}
......@@ -144,7 +146,8 @@
line-height: 1.6em;
}
a[href*="/uploads/"], a[href*="storage.googleapis.com/google-code-attachments/"] {
a[href*="/uploads/"],
a[href*="storage.googleapis.com/google-code-attachments/"] {
&:before {
margin-right: 4px;
......@@ -167,7 +170,12 @@
}
/* Link to current header. */
h1, h2, h3, h4, h5, h6 {
h1,
h2,
h3,
h4,
h5,
h6 {
position: relative;
a.anchor {
......@@ -215,7 +223,12 @@ body {
margin: 12px 7px;
}
h1, h2, h3, h4, h5, h6 {
h1,
h2,
h3,
h4,
h5,
h6 {
color: $gl-title-color;
font-weight: 600;
}
......@@ -273,7 +286,10 @@ a > code {
text-decoration: line-through;
}
h1, h2, h3, h4 {
h1,
h2,
h3,
h4 {
small {
color: $gl-gray;
}
......
......@@ -84,39 +84,39 @@ $warning-message-border: #f0e2bb;
/*
* UI elements
*/
$border-color: #e5e5e5;
$focus-border-color: #3aabf0;
$table-border-color: #f0f0f0;
$background-color: $gray-light;
$border-color: #e5e5e5;
$focus-border-color: #3aabf0;
$table-border-color: #f0f0f0;
$background-color: $gray-light;
$dark-background-color: #f5f5f5;
$table-text-gray: #8f8f8f;
$table-text-gray: #8f8f8f;
/*
* Text
*/
$gl-font-size: 15px;
$gl-title-color: #333;
$gl-text-color: #5c5c5c;
$gl-text-color-light: #8c8c8c;
$gl-text-green: #4a2;
$gl-text-red: #d12f19;
$gl-text-orange: #d90;
$gl-link-color: #3084bb;
$gl-dark-link-color: #333;
$gl-font-size: 15px;
$gl-title-color: #333;
$gl-text-color: #5c5c5c;
$gl-text-color-light: #8c8c8c;
$gl-text-green: #4a2;
$gl-text-red: #d12f19;
$gl-text-orange: #d90;
$gl-link-color: #3084bb;
$gl-dark-link-color: #333;
$gl-placeholder-color: #8f8f8f;
$gl-icon-color: $gl-placeholder-color;
$gl-grayish-blue: #7f8fa4;
$gl-gray: $gl-text-color;
$gl-gray-dark: #313236;
$gl-gray-light: $gl-placeholder-color;
$gl-header-color: #4c4e54;
$gl-icon-color: $gl-placeholder-color;
$gl-grayish-blue: #7f8fa4;
$gl-gray: $gl-text-color;
$gl-gray-dark: #313236;
$gl-gray-light: $gl-placeholder-color;
$gl-header-color: #4c4e54;
/*
* Lists
*/
$list-font-size: $gl-font-size;
$list-font-size: $gl-font-size;
$list-title-color: $gl-title-color;
$list-text-color: $gl-text-color;
$list-text-color: $gl-text-color;
$list-text-height: 42px;
/*
......
/* https://github.com/MozMorris/tomorrow-pygments */
.code.dark {
// Line numbers
.line-numbers, .diff-line-num {
.line-numbers,
.diff-line-num {
background-color: #1d1f21;
}
.diff-line-num, .diff-line-num a {
.diff-line-num,
.diff-line-num a {
color: rgba(255, 255, 255, 0.3);
}
// Code itself
pre.code, .diff-line-num {
pre.code,
.diff-line-num {
border-color: #666;
}
&, pre.code, .line_holder .line_content {
&,
pre.code,
.line_holder .line_content {
background-color: #1d1f21;
color: #c5c8c6;
}
......@@ -31,11 +36,13 @@
border-color: darken(#557, 15%);
}
.diff-line-num.new, .line_content.new {
.diff-line-num.new,
.line_content.new {
@include diff_background(rgba(51, 255, 51, 0.1), rgba(51, 255, 51, 0.2), #808080);
}
.diff-line-num.old, .line_content.old {
.diff-line-num.old,
.line_content.old {
@include diff_background(rgba(255, 51, 51, 0.2), rgba(255, 51, 51, 0.25), #808080);
}
......
/* https://github.com/richleland/pygments-css/blob/master/monokai.css */
.code.monokai {
// Line numbers
.line-numbers, .diff-line-num {
.line-numbers,
.diff-line-num {
background-color: #272822;
}
.diff-line-num, .diff-line-num a {
.diff-line-num,
.diff-line-num a {
color: rgba(255, 255, 255, 0.3);
}
// Code itself
pre.code, .diff-line-num {
pre.code,
.diff-line-num {
border-color: #555;
}
&, pre.code, .line_holder .line_content {
&,
pre.code,
.line_holder .line_content {
background-color: #272822;
color: #f8f8f2;
}
......@@ -31,11 +36,13 @@
border-color: darken(#49483e, 15%);
}
.diff-line-num.new, .line_content.new {
.diff-line-num.new,
.line_content.new {
@include diff_background(rgba(166, 226, 46, 0.1), rgba(166, 226, 46, 0.15), #808080);
}
.diff-line-num.old, .line_content.old {
.diff-line-num.old,
.line_content.old {
@include diff_background(rgba(254, 147, 140, 0.15), rgba(254, 147, 140, 0.2), #808080);
}
......
/* https://gist.github.com/qguv/7936275 */
.code.solarized-dark {
// Line numbers
.line-numbers, .diff-line-num {
.line-numbers,
.diff-line-num {
background-color: #002b36;
}
.diff-line-num, .diff-line-num a {
.diff-line-num,
.diff-line-num a {
color: rgba(255, 255, 255, 0.3);
}
// Code itself
pre.code, .diff-line-num {
pre.code,
.diff-line-num {
border-color: #113b46;
}
&, pre.code, .line_holder .line_content {
&,
pre.code,
.line_holder .line_content {
background-color: #002b36;
color: #93a1a1;
}
......@@ -31,11 +36,13 @@
border-color: darken(#174652, 15%);
}
.diff-line-num.new, .line_content.new {
.diff-line-num.new,
.line_content.new {
@include diff_background(rgba(133, 153, 0, 0.15), rgba(133, 153, 0, 0.25), #113b46);
}
.diff-line-num.old, .line_content.old {
.diff-line-num.old,
.line_content.old {
@include diff_background(rgba(220, 50, 47, 0.3), rgba(220, 50, 47, 0.25), #113b46);
}
......
......@@ -7,20 +7,25 @@
.code.solarized-light {
// Line numbers
.line-numbers, .diff-line-num {
.line-numbers,
.diff-line-num {
background-color: #fdf6e3;
}
.diff-line-num, .diff-line-num a {
.diff-line-num,
.diff-line-num a {
color: $black-transparent;
}
// Code itself
pre.code, .diff-line-num {
pre.code,
.diff-line-num {
border-color: #c5d0d4;
}
&, pre.code, .line_holder .line_content {
&,
pre.code,
.line_holder .line_content {
background-color: #fdf6e3;
color: #586e75;
}
......@@ -37,11 +42,13 @@
border-color: darken(#ddd8c5, 15%);
}
.diff-line-num.new, .line_content.new {
.diff-line-num.new,
.line_content.new {
@include diff_background(rgba(133, 153, 0, 0.2), rgba(133, 153, 0, 0.25), #c5d0d4);
}
.diff-line-num.old, .line_content.old {
.diff-line-num.old,
.line_content.old {
@include diff_background(rgba(220, 50, 47, 0.2), rgba(220, 50, 47, 0.25), #c5d0d4);
}
......
......@@ -7,20 +7,25 @@
.code.white {
// Line numbers
.line-numbers, .diff-line-num {
.line-numbers,
.diff-line-num {
background-color: $background-color;
}
.diff-line-num, .diff-line-num a {
.diff-line-num,
.diff-line-num a {
color: $black-transparent;
}
// Code itself
pre.code, .diff-line-num {
pre.code,
.diff-line-num {
border-color: $table-border-gray;
}
&, pre.code, .line_holder .line_content {
&,
pre.code,
.line_holder .line_content {
background-color: #fff;
color: #333;
}
......
......@@ -5,13 +5,13 @@
// Styles defined here are embedded directly into the resulting email HTML via
// the `premailer` gem.
$body-background-color: #363636;
$body-background-color: #363636;
$message-background-color: #fafafa;
$header-color: #6b4fbb;
$body-color: #444;
$cta-color: #e14329;
$footer-link-color: #7e7e7e;
$header-color: #6b4fbb;
$body-color: #444;
$cta-color: #e14329;
$footer-link-color: #7e7e7e;
$font-family: Helvetica, Arial, sans-serif;
......
......@@ -56,7 +56,8 @@
padding: 10px;
text-align: center;
> div, p {
> div,
p {
display: inline;
margin: 0;
......
......@@ -12,7 +12,8 @@
border-color: $border-color;
}
th, td {
th,
td {
padding: 10px $gl-padding;
}
......
......@@ -2,14 +2,16 @@
display: block;
}
.commit-author, .commit-committer {
.commit-author,
.commit-committer {
display: block;
color: #999;
font-weight: normal;
font-style: italic;
}
.commit-author strong, .commit-committer strong {
.commit-author strong,
.commit-committer strong {
font-weight: bold;
font-style: normal;
}
......
......@@ -63,7 +63,8 @@
display: inline-block;
}
.btn-clipboard, .btn-transparent {
.btn-clipboard,
.btn-transparent {
padding-left: 0;
padding-right: 0;
}
......@@ -162,7 +163,8 @@
.branch-commit {
color: $gl-gray;
.commit-id, .commit-row-message {
.commit-id,
.commit-row-message {
color: $gl-gray;
}
}
......
......@@ -2,7 +2,12 @@
margin-bottom: 20px;
border-bottom: 1px solid #eee;
> h1, h2, h3, h4, h5, h6 {
> h1,
h2,
h3,
h4,
h5,
h6 {
font-weight: 400;
}
......@@ -10,7 +15,8 @@
margin-bottom: 20px;
}
ul, ol {
ul,
ol {
padding-left: 0;
}
......
......@@ -9,15 +9,15 @@
padding: 24px 0;
border-bottom: none;
position: relative;
@media (max-width: $screen-sm-min) {
padding: 6px 0 24px;
}
}
}
.column {
text-align: center;
@media (max-width: $screen-sm-min) {
padding: 15px 0;
}
......@@ -36,7 +36,7 @@
&:last-child {
text-align: right;
@media (max-width: $screen-sm-min) {
text-align: center;
}
......@@ -51,7 +51,7 @@
.bordered-box {
border: 1px solid $border-color;
border-radius: $border-radius-default;
}
.content-list {
......@@ -73,10 +73,10 @@
font-weight: 600;
color: $gl-title-color;
}
&.text {
color: $layout-link-gray;
&.value-col {
color: $gl-title-color;
}
......@@ -108,13 +108,13 @@
.svg-container {
text-align: center;
svg {
width: 136px;
height: 136px;
}
}
.inner-content {
@media (max-width: $screen-sm-min) {
padding: 0 28px;
......
......@@ -13,7 +13,8 @@
color: #5c5d5e;
}
.issue_created_ago, .author_link {
.issue_created_ago,
.author_link {
white-space: nowrap;
}
}
......
......@@ -124,7 +124,8 @@
}
}
.old_line, .new_line {
.old_line,
.new_line {
margin: 0;
padding: 0;
border: none;
......@@ -222,12 +223,12 @@
top: 13px;
right: 7px;
}
.frame {
top: 0;
right: 0;
position: absolute;
&.deleted {
margin: 0;
display: block;
......@@ -281,7 +282,8 @@
position: relative;
}
.frame.added, .frame.deleted {
.frame.added,
.frame.deleted {
position: absolute;
display: block;
top: 0;
......@@ -347,7 +349,8 @@
text-align: center;
background: #eee;
ul, li {
ul,
li {
list-style: none;
margin: 0;
padding: 0;
......
......@@ -91,7 +91,9 @@
}
}
.gitignore-selector, .license-selector, .gitlab-ci-yml-selector {
.gitignore-selector,
.license-selector,
.gitlab-ci-yml-selector {
.dropdown {
line-height: 21px;
}
......
......@@ -37,10 +37,10 @@
.branch-name {
color: $gl-dark-link-color;
}
.stop-env-link {
color: $table-text-gray;
.stop-env-icon {
font-size: 14px;
}
......@@ -48,11 +48,11 @@
.deployment {
.build-column {
.build-link {
color: $gl-dark-link-color;
}
.avatar {
float: none;
}
......
......@@ -2,7 +2,9 @@
max-width: 400px;
margin: 0 auto;
h1, h2, h3 {
h1,
h2,
h3 {
text-align: center;
}
......
......@@ -142,7 +142,7 @@
.event-last-push {
overflow: auto;
width: 100%;
.event-last-push-text {
@include str-truncated(100%);
padding: 4px 0;
......
......@@ -43,7 +43,8 @@ ul.related-merge-requests > li {
}
}
.merge-requests-title, .related-branches-title {
.merge-requests-title,
.related-branches-title {
font-size: 16px;
font-weight: 600;
}
......
......@@ -41,7 +41,8 @@
font-size: 13px;
}
.login-box, .omniauth-container {
.login-box,
.omniauth-container {
box-shadow: 0 0 0 1px $border-color;
border-bottom-right-radius: 2px;
border-bottom-left-radius: 2px;
......@@ -198,7 +199,8 @@
.form-control {
&:active, &:focus {
&:active,
&:focus {
background-color: #fff;
}
}
......@@ -261,7 +263,8 @@
position: relative;
}
.footer-container, hr.footer-fixed {
.footer-container,
hr.footer-fixed {
position: absolute;
bottom: 0;
left: 0;
......@@ -286,6 +289,13 @@
.new_user {
position: relative;
padding-bottom: 35px;
@media (min-width: $screen-sm-min) and (max-width: $screen-sm-max) {
.forgot-password {
float: none !important;
margin-top: 5px;
}
}
}
.move-submit-down {
......
......@@ -101,7 +101,8 @@ $colors: (
@mixin color-scheme($color) {
.header.line_content, .diff-line-num {
.header.line_content,
.diff-line-num {
&.origin {
background-color: map-get($colors, #{$color}_header_origin_neutral);
border-color: map-get($colors, #{$color}_header_origin_neutral);
......@@ -254,7 +255,7 @@ $colors: (
border-top: solid 2px $border-green-extra-light;
}
}
.editor {
pre {
height: 350px;
......
......@@ -50,7 +50,8 @@
}
}
.issues-sortable-list, .merge_requests-sortable-list {
.issues-sortable-list,
.merge_requests-sortable-list {
.issuable-detail {
display: block;
margin-top: 7px;
......
......@@ -8,7 +8,7 @@
.diff-file .diff-content {
tr.line_holder:hover > td .line_note_link {
opacity: 1.0;
filter: alpha(opacity=100);
filter: alpha(opacity = 100);
}
}
......@@ -24,7 +24,8 @@
display: none;
}
.new-note, .note-edit-form {
.new-note,
.note-edit-form {
.note-form-actions {
margin-top: $gl-padding;
}
......
......@@ -28,7 +28,8 @@ ul.notes {
}
}
.note-created-ago, .note-updated-at {
.note-created-ago,
.note-updated-at {
white-space: nowrap;
}
......@@ -458,7 +459,7 @@ ul.notes {
.discussion-next-btn {
svg {
margin: 0;
path {
fill: $gray-darkest;
}
......
......@@ -248,7 +248,8 @@
font-size: 14px;
}
svg, .fa {
svg,
.fa {
margin-right: 0;
}
}
......@@ -529,7 +530,8 @@
// Connect each build (except for first) with curved lines
&:not(:first-child) {
&::after, &::before {
&::after,
&::before {
content: '';
top: -49px;
position: absolute;
......@@ -555,7 +557,8 @@
// Connect second build to first build with smaller curved line
&:nth-child(2) {
&::after, &::before {
&::after,
&::before {
height: 29px;
top: -9px;
}
......@@ -570,7 +573,8 @@
.build {
// Remove right connecting horizontal line from first build in last stage
&:first-child {
&::after, &::before {
&::after,
&::before {
border: none;
}
}
......
......@@ -253,7 +253,8 @@
}
table.u2f-registrations {
th:not(:last-child), td:not(:last-child) {
th:not(:last-child),
td:not(:last-child) {
border-right: solid 1px transparent;
}
}
\ No newline at end of file
......@@ -6,7 +6,8 @@
}
}
.no-ssh-key-message, .project-limit-message {
.no-ssh-key-message,
.project-limit-message {
background-color: #f28d35;
margin-bottom: 0;
}
......@@ -385,7 +386,8 @@ a.deploy-project-label {
text-align: center;
width: 169px;
&:hover, &.forked {
&:hover,
&.forked {
background-color: $row-hover;
border-color: $row-hover-border;
}
......@@ -734,7 +736,8 @@ pre.light-well {
.table-bordered {
border-radius: 1px;
th:not(:last-child), td:not(:last-child) {
th:not(:last-child),
td:not(:last-child) {
border-right: solid 1px transparent;
}
}
......@@ -757,7 +760,8 @@ pre.light-well {
}
}
.project-refs-form .dropdown-menu, .dropdown-menu-projects {
.project-refs-form .dropdown-menu,
.dropdown-menu-projects {
width: 300px;
@media (min-width: $screen-sm-min) {
......
......@@ -65,7 +65,8 @@
.search-input-wrap {
width: 100%;
.search-icon, .clear-icon {
.search-icon,
.clear-icon {
position: absolute;
right: 5px;
top: 0;
......@@ -185,7 +186,8 @@
padding-right: $gl-padding + 15px;
}
.btn-search, .btn-new {
.btn-search,
.btn-new {
width: 100%;
margin-top: 5px;
......
......@@ -74,7 +74,7 @@
.ci-status-icon-success_with_warning {
color: $gl-warning;
}
.ci-status-icon-running {
color: $blue-normal;
}
......
......@@ -23,17 +23,18 @@
border-bottom: 1px solid $table-border-gray;
border-top: 1px solid $table-border-gray;
td, th {
td,
th {
line-height: 21px;
}
.last-commit {
@include str-truncated(506px);
@media (min-width: $screen-sm-max) and (max-width: $screen-md-max) {
@include str-truncated(450px);
}
}
.commit-history-link-spacer {
......@@ -74,7 +75,8 @@
max-width: 320px;
vertical-align: middle;
i, a {
i,
a {
color: $gl-dark-link-color;
}
......
.wiki h1, .wiki h2, .wiki h3, .wiki h4, .wiki h5, .wiki h6 {margin-top: 17px; }
.wiki h1 {font-size: 30px;}
.wiki h2 {font-size: 22px;}
.wiki h3 {font-size: 18px; font-weight: bold; }
.wiki h1,
.wiki h2,
.wiki h3,
.wiki h4,
.wiki h5,
.wiki h6 {
margin-top: 17px;
}
.wiki h1 {
font-size: 30px;
}
.wiki h2 {
font-size: 22px;
}
.wiki h3 {
font-size: 18px;
font-weight: bold;
}
header,
nav,
......
......@@ -21,6 +21,10 @@ class Groups::GroupMembersController < Groups::ApplicationController
end
def create
if params[:user_ids].blank?
return redirect_to(group_group_members_path(@group), alert: 'No users specified.')
end
@group.add_users(
params[:user_ids].split(','),
params[:access_level],
......
......@@ -2,8 +2,8 @@ class Import::GitlabProjectsController < Import::BaseController
before_action :verify_gitlab_project_import_enabled
def new
@namespace_id = project_params[:namespace_id]
@namespace_name = Namespace.find(project_params[:namespace_id]).name
@namespace = Namespace.find(project_params[:namespace_id])
return render_404 unless current_user.can?(:create_projects, @namespace)
@path = project_params[:path]
end
......
......@@ -25,6 +25,10 @@ class Projects::ProjectMembersController < Projects::ApplicationController
end
def create
if params[:user_ids].blank?
return redirect_to(namespace_project_project_members_path(@project.namespace, @project), alert: 'No users or groups specified.')
end
@project.team.add_users(
params[:user_ids].split(','),
params[:access_level],
......@@ -32,7 +36,7 @@ class Projects::ProjectMembersController < Projects::ApplicationController
current_user: current_user
)
redirect_to namespace_project_project_members_path(@project.namespace, @project)
redirect_to namespace_project_project_members_path(@project.namespace, @project), notice: 'Users were successfully added.'
end
def update
......
......@@ -35,8 +35,10 @@ class LabelsFinder < UnionFinder
end
def with_title(items)
items = items.where(title: title) if title
items
return items if title.nil?
return items.none if title.blank?
items.where(title: title)
end
def group_id
......@@ -52,7 +54,7 @@ class LabelsFinder < UnionFinder
end
def title
params[:title].presence || params[:name].presence
params[:title] || params[:name]
end
def project
......
......@@ -5,7 +5,7 @@ module BoardsHelper
{
endpoint: namespace_project_boards_path(@project.namespace, @project),
board_id: board.id,
disabled: !can?(current_user, :admin_list, @project),
disabled: "#{!can?(current_user, :admin_list, @project)}",
issue_link_base: namespace_project_issues_path(@project.namespace, @project)
}
end
......
......@@ -3,8 +3,8 @@ module Ci
include TokenAuthenticatable
include AfterCommitQueue
belongs_to :runner, class_name: 'Ci::Runner'
belongs_to :trigger_request, class_name: 'Ci::TriggerRequest'
belongs_to :runner
belongs_to :trigger_request
belongs_to :erased_by, class_name: 'User'
serialize :options
......
......@@ -7,12 +7,12 @@ module Ci
self.table_name = 'ci_commits'
belongs_to :project, class_name: '::Project', foreign_key: :gl_project_id
belongs_to :project, foreign_key: :gl_project_id
belongs_to :user
has_many :statuses, class_name: 'CommitStatus', foreign_key: :commit_id
has_many :builds, class_name: 'Ci::Build', foreign_key: :commit_id
has_many :trigger_requests, dependent: :destroy, class_name: 'Ci::TriggerRequest', foreign_key: :commit_id
has_many :builds, foreign_key: :commit_id
has_many :trigger_requests, dependent: :destroy, foreign_key: :commit_id
validates_presence_of :sha, unless: :importing?
validates_presence_of :ref, unless: :importing?
......
......@@ -6,9 +6,9 @@ module Ci
AVAILABLE_SCOPES = %w[specific shared active paused online]
FORM_EDITABLE = %i[description tag_list active run_untagged locked]
has_many :builds, class_name: 'Ci::Build'
has_many :runner_projects, dependent: :destroy, class_name: 'Ci::RunnerProject'
has_many :projects, through: :runner_projects, class_name: '::Project', foreign_key: :gl_project_id
has_many :builds
has_many :runner_projects, dependent: :destroy
has_many :projects, through: :runner_projects, foreign_key: :gl_project_id
has_one :last_build, ->() { order('id DESC') }, class_name: 'Ci::Build'
......
......@@ -2,8 +2,8 @@ module Ci
class RunnerProject < ActiveRecord::Base
extend Ci::Model
belongs_to :runner, class_name: 'Ci::Runner'
belongs_to :project, class_name: '::Project', foreign_key: :gl_project_id
belongs_to :runner
belongs_to :project, foreign_key: :gl_project_id
validates_uniqueness_of :runner_id, scope: :gl_project_id
end
......
......@@ -4,8 +4,8 @@ module Ci
acts_as_paranoid
belongs_to :project, class_name: '::Project', foreign_key: :gl_project_id
has_many :trigger_requests, dependent: :destroy, class_name: 'Ci::TriggerRequest'
belongs_to :project, foreign_key: :gl_project_id
has_many :trigger_requests, dependent: :destroy
validates_presence_of :token
validates_uniqueness_of :token
......
......@@ -2,9 +2,9 @@ module Ci
class TriggerRequest < ActiveRecord::Base
extend Ci::Model
belongs_to :trigger, class_name: 'Ci::Trigger'
belongs_to :pipeline, class_name: 'Ci::Pipeline', foreign_key: :commit_id
has_many :builds, class_name: 'Ci::Build'
belongs_to :trigger
belongs_to :pipeline, foreign_key: :commit_id
has_many :builds
serialize :variables
......
......@@ -2,7 +2,7 @@ module Ci
class Variable < ActiveRecord::Base
extend Ci::Model
belongs_to :project, class_name: '::Project', foreign_key: :gl_project_id
belongs_to :project, foreign_key: :gl_project_id
validates_uniqueness_of :key, scope: :gl_project_id
validates :key,
......
......@@ -5,7 +5,7 @@ class CommitStatus < ActiveRecord::Base
self.table_name = 'ci_builds'
belongs_to :project, class_name: '::Project', foreign_key: :gl_project_id
belongs_to :project, foreign_key: :gl_project_id
belongs_to :pipeline, class_name: 'Ci::Pipeline', foreign_key: :commit_id
belongs_to :user
......
module ProtectedBranchAccess
extend ActiveSupport::Concern
included do
scope :master, -> { where(access_level: Gitlab::Access::MASTER) }
scope :developer, -> { where(access_level: Gitlab::Access::DEVELOPER) }
end
def humanize
self.class.human_access_levels[self.access_level]
end
......
......@@ -7,10 +7,8 @@ class Email < ActiveRecord::Base
validates :email, presence: true, uniqueness: true, email: true
validate :unique_email, if: ->(email) { email.email_changed? }
before_validation :cleanup_email
def cleanup_email
self.email = self.email.downcase.strip
def email=(value)
write_attribute(:email, value.downcase.strip)
end
def unique_email
......
......@@ -6,7 +6,7 @@ class Group < Namespace
include AccessRequestable
include Referable
has_many :group_members, -> { where(requested_at: nil) }, dependent: :destroy, as: :source, class_name: 'GroupMember'
has_many :group_members, -> { where(requested_at: nil) }, dependent: :destroy, as: :source
alias_method :members, :group_members
has_many :users, through: :group_members
has_many :owners,
......@@ -68,7 +68,7 @@ class Group < Namespace
end
def web_url
Gitlab::Routing.url_helpers.group_canonical_url(self)
Gitlab::Routing.url_helpers.group_url(self)
end
def human_name
......
class GroupMember < Member
SOURCE_TYPE = 'Namespace'
belongs_to :group, class_name: 'Group', foreign_key: 'source_id'
belongs_to :group, foreign_key: 'source_id'
# Make sure group member points only to group as it source
default_value_for :source_type, SOURCE_TYPE
......
......@@ -3,7 +3,7 @@ class ProjectMember < Member
include Gitlab::ShellAdapter
belongs_to :project, class_name: 'Project', foreign_key: 'source_id'
belongs_to :project, foreign_key: 'source_id'
# Make sure project member points only to project as it source
default_value_for :source_type, SOURCE_TYPE
......
......@@ -6,8 +6,8 @@ class MergeRequest < ActiveRecord::Base
include Taskable
include Importable
belongs_to :target_project, foreign_key: :target_project_id, class_name: "Project"
belongs_to :source_project, foreign_key: :source_project_id, class_name: "Project"
belongs_to :target_project, class_name: "Project"
belongs_to :source_project, class_name: "Project"
belongs_to :merge_user, class_name: "User"
has_many :merge_request_diffs, dependent: :destroy
......
......@@ -299,8 +299,10 @@ class MergeRequestDiff < ActiveRecord::Base
end
def keep_around_commits
repository.keep_around(start_commit_sha)
repository.keep_around(head_commit_sha)
repository.keep_around(base_commit_sha)
[repository, merge_request.source_project.repository].each do |repo|
repo.keep_around(start_commit_sha)
repo.keep_around(head_commit_sha)
repo.keep_around(base_commit_sha)
end
end
end
......@@ -63,11 +63,11 @@ class Project < ActiveRecord::Base
alias_attribute :title, :name
# Relations
belongs_to :creator, foreign_key: 'creator_id', class_name: 'User'
belongs_to :creator, class_name: 'User'
belongs_to :group, -> { where(type: 'Group') }, foreign_key: 'namespace_id'
belongs_to :namespace
has_one :last_event, -> {order 'events.created_at DESC'}, class_name: 'Event', foreign_key: 'project_id'
has_one :last_event, -> {order 'events.created_at DESC'}, class_name: 'Event'
has_many :boards, before_add: :validate_board_limit, dependent: :destroy
# Project services
......@@ -116,7 +116,7 @@ class Project < ActiveRecord::Base
has_many :hooks, dependent: :destroy, class_name: 'ProjectHook'
has_many :protected_branches, dependent: :destroy
has_many :project_members, -> { where(requested_at: nil) }, dependent: :destroy, as: :source, class_name: 'ProjectMember'
has_many :project_members, -> { where(requested_at: nil) }, dependent: :destroy, as: :source
alias_method :members, :project_members
has_many :users, through: :project_members
......@@ -137,7 +137,7 @@ class Project < ActiveRecord::Base
has_one :import_data, dependent: :destroy, class_name: "ProjectImportData"
has_one :project_feature, dependent: :destroy
has_many :commit_statuses, dependent: :destroy, class_name: 'CommitStatus', foreign_key: :gl_project_id
has_many :commit_statuses, dependent: :destroy, foreign_key: :gl_project_id
has_many :pipelines, dependent: :destroy, class_name: 'Ci::Pipeline', foreign_key: :gl_project_id
has_many :builds, class_name: 'Ci::Build', foreign_key: :gl_project_id # the builds are created from the commit_statuses
has_many :runner_projects, dependent: :destroy, class_name: 'Ci::RunnerProject', foreign_key: :gl_project_id
......
......@@ -419,6 +419,17 @@ class Repository
@exists = nil
end
# expire cache that doesn't depend on repository data (when expiring)
def expire_content_cache
expire_tags_cache
expire_tag_count_cache
expire_branches_cache
expire_branch_count_cache
expire_root_ref_cache
expire_emptiness_caches
expire_exists_cache
end
# Runs code after a repository has been created.
def after_create
expire_exists_cache
......@@ -434,14 +445,7 @@ class Repository
expire_cache if exists?
# expire cache that don't depend on repository data (when expiring)
expire_tags_cache
expire_tag_count_cache
expire_branches_cache
expire_branch_count_cache
expire_root_ref_cache
expire_emptiness_caches
expire_exists_cache
expire_content_cache
repository_event(:remove_repository)
end
......@@ -473,14 +477,13 @@ class Repository
end
def before_import
expire_emptiness_caches
expire_exists_cache
expire_content_cache
end
# Runs code after a repository has been forked/imported.
def after_import
expire_emptiness_caches
expire_exists_cache
expire_content_cache
build_cache
end
# Runs code after a new commit has been pushed.
......
......@@ -47,7 +47,7 @@ class User < ActiveRecord::Base
#
# Namespace for personal projects
has_one :namespace, -> { where type: nil }, dependent: :destroy, foreign_key: :owner_id, class_name: "Namespace"
has_one :namespace, -> { where type: nil }, dependent: :destroy, foreign_key: :owner_id
# Profile
has_many :keys, dependent: :destroy
......@@ -66,17 +66,17 @@ class User < ActiveRecord::Base
# Projects
has_many :groups_projects, through: :groups, source: :projects
has_many :personal_projects, through: :namespace, source: :projects
has_many :project_members, -> { where(requested_at: nil) }, dependent: :destroy, class_name: 'ProjectMember'
has_many :project_members, -> { where(requested_at: nil) }, dependent: :destroy
has_many :projects, through: :project_members
has_many :created_projects, foreign_key: :creator_id, class_name: 'Project'
has_many :users_star_projects, dependent: :destroy
has_many :starred_projects, through: :users_star_projects, source: :project
has_many :snippets, dependent: :destroy, foreign_key: :author_id, class_name: "Snippet"
has_many :snippets, dependent: :destroy, foreign_key: :author_id
has_many :issues, dependent: :destroy, foreign_key: :author_id
has_many :notes, dependent: :destroy, foreign_key: :author_id
has_many :merge_requests, dependent: :destroy, foreign_key: :author_id
has_many :events, dependent: :destroy, foreign_key: :author_id, class_name: "Event"
has_many :events, dependent: :destroy, foreign_key: :author_id
has_many :subscriptions, dependent: :destroy
has_many :recent_events, -> { order "id DESC" }, foreign_key: :author_id, class_name: "Event"
has_many :assigned_issues, dependent: :destroy, foreign_key: :assignee_id, class_name: "Issue"
......@@ -309,7 +309,7 @@ class User < ActiveRecord::Base
username
end
def to_reference(_from_project = nil)
def to_reference(_from_project = nil, _target_project = nil)
"#{self.class.reference_prefix}#{username}"
end
......
......@@ -7,8 +7,10 @@ module Notes
if note.award_emoji?
noteable = note.noteable
todo_service.new_award_emoji(noteable, current_user)
return noteable.create_award_emoji(note.award_emoji_name, current_user)
if noteable.user_can_award?(current_user, note.award_emoji_name)
todo_service.new_award_emoji(noteable, current_user)
return noteable.create_award_emoji(note.award_emoji_name, current_user)
end
end
# We execute commands (extracted from `params[:note]`) on the noteable
......
# The protected branches API still uses the `developers_can_push` and `developers_can_merge`
# flags for backward compatibility, and so performs translation between that format and the
# internal data model (separate access levels). The translation code is non-trivial, and so
# lives in this service.
module ProtectedBranches
class ApiCreateService < BaseService
def execute
push_access_level =
if params.delete(:developers_can_push)
Gitlab::Access::DEVELOPER
else
Gitlab::Access::MASTER
end
merge_access_level =
if params.delete(:developers_can_merge)
Gitlab::Access::DEVELOPER
else
Gitlab::Access::MASTER
end
@params.merge!(push_access_levels_attributes: [{ access_level: push_access_level }],
merge_access_levels_attributes: [{ access_level: merge_access_level }])
service = ProtectedBranches::CreateService.new(@project, @current_user, @params)
service.execute
end
end
end
# The protected branches API still uses the `developers_can_push` and `developers_can_merge`
# flags for backward compatibility, and so performs translation between that format and the
# internal data model (separate access levels). The translation code is non-trivial, and so
# lives in this service.
module ProtectedBranches
class ApiUpdateService < BaseService
def execute(protected_branch)
@developers_can_push = params.delete(:developers_can_push)
@developers_can_merge = params.delete(:developers_can_merge)
@protected_branch = protected_branch
protected_branch.transaction do
delete_redundant_access_levels
case @developers_can_push
when true
params.merge!(push_access_levels_attributes: [{ access_level: Gitlab::Access::DEVELOPER }])
when false
params.merge!(push_access_levels_attributes: [{ access_level: Gitlab::Access::MASTER }])
end
case @developers_can_merge
when true
params.merge!(merge_access_levels_attributes: [{ access_level: Gitlab::Access::DEVELOPER }])
when false
params.merge!(merge_access_levels_attributes: [{ access_level: Gitlab::Access::MASTER }])
end
service = ProtectedBranches::UpdateService.new(@project, @current_user, @params)
service.execute(protected_branch)
end
end
private
def delete_redundant_access_levels
unless @developers_can_merge.nil?
@protected_branch.merge_access_levels.destroy_all
end
unless @developers_can_push.nil?
@protected_branch.push_access_levels.destroy_all
end
end
end
end
......@@ -12,5 +12,5 @@
%label{for: "user_remember_me"}
= f.check_box :remember_me
%span Remember me
.pull-right
.pull-right.forgot-password
= link_to "Forgot your password?", new_password_path(resource_name)
%ul.nav-links.new-session-tabs.nav-tabs{ role: 'tablist'}
%li.active{ role: 'presentation' }
%a{ href: '#login-pane', data: { toggle: 'tab' }, role: 'tab'} Sign in
%li{ role: 'presentation'}
%a{ href: '#register-pane', data: { toggle: 'tab' }, role: 'tab'} Register
- if signin_enabled? && signup_enabled?
%li{ role: 'presentation'}
%a{ href: '#register-pane', data: { toggle: 'tab' }, role: 'tab'} Register
......@@ -9,12 +9,12 @@
%p
Project will be imported as
%strong
#{@namespace_name}/#{@path}
#{@namespace.name}/#{@path}
%p
To move or copy an entire GitLab project from another GitLab installation to this one, navigate to the original project's settings page, generate an export file, and upload it here.
.form-group
= hidden_field_tag :namespace_id, @namespace_id
= hidden_field_tag :namespace_id, @namespace.id
= hidden_field_tag :path, @path
= label_tag :file, class: 'control-label' do
%span GitLab project export
......
......@@ -26,7 +26,7 @@
":title" => "label.description",
data: { container: 'body' } }
{{ label.title }}
%a.has-tooltip{ ":href" => "'/' + issue.assignee.username",
%a.has-tooltip{ ":href" => "'#{root_path}' + issue.assignee.username",
":title" => "'Assigned to ' + issue.assignee.name",
"v-if" => "issue.assignee",
data: { container: 'body' } }
......
......@@ -101,7 +101,7 @@
Git Large File Storage
= link_to icon('question-circle'), help_page_path('workflow/lfs/manage_large_binaries_with_git_lfs')
- if Gitlab.config.lfs.enabled && current_user.admin?
- if Gitlab.config.registry.enabled
.form-group
.checkbox
= f.label :container_registry_enabled do
......
......@@ -3,4 +3,4 @@
Most recent commits displayed first
%ol#commits-list.list-unstyled
= render "projects/commits/commits", project: @merge_request.project
= render "projects/commits/commits", project: @merge_request.source_project
......@@ -25,7 +25,7 @@
:delivery_options:
:redis_url: <%= config[:redis_url].to_json %>
:namespace: <%= Gitlab::Redis::SIDEKIQ_NAMESPACE %>
:queue: incoming_email
:queue: email_receiver
:worker: EmailReceiverWorker
:arbitration_method: redis
......
......@@ -12,26 +12,23 @@ constraints(GroupUrlConstrainer.new) do
end
end
scope constraints: { id: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ } do
resources :groups, except: [:show] do
member do
get :issues
get :merge_requests
get :projects
get :activity
end
resources :groups, constraints: { id: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ } do
member do
get :issues
get :merge_requests
get :projects
get :activity
end
scope module: :groups do
resources :group_members, only: [:index, :create, :update, :destroy], concerns: :access_requestable do
post :resend_invite, on: :member
delete :leave, on: :collection
end
scope module: :groups do
resources :group_members, only: [:index, :create, :update, :destroy], concerns: :access_requestable do
post :resend_invite, on: :member
delete :leave, on: :collection
end
resource :avatar, only: [:destroy]
resources :milestones, constraints: { id: /[^\/]+/ }, only: [:index, :show, :update, :new, :create]
resource :avatar, only: [:destroy]
resources :milestones, constraints: { id: /[^\/]+/ }, only: [:index, :show, :update, :new, :create]
resources :labels, except: [:show], constraints: { id: /\d+/ }
end
resources :labels, except: [:show], constraints: { id: /\d+/ }
end
get 'groups/:id' => 'groups#show', as: :group_canonical
end
require 'json'
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class MigrateMailroomQueueFromDefault < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = true
DOWNTIME_REASON = <<-EOF
Moving Sidekiq jobs from queues requires Sidekiq to be stopped. Not stopping
Sidekiq will result in the loss of jobs that are scheduled after this
migration completes.
EOF
disable_ddl_transaction!
# Jobs for which the queue names have been changed (e.g. multiple workers
# using the same non-default queue).
#
# The keys are the old queue names, the values the jobs to move and their new
# queue names.
RENAMED_QUEUES = {
incoming_email: {
'EmailReceiverWorker' => :email_receiver
}
}
def up
Sidekiq.redis do |redis|
RENAMED_QUEUES.each do |queue, jobs|
migrate_from_queue(redis, queue, jobs)
end
end
end
def down
Sidekiq.redis do |redis|
RENAMED_QUEUES.each do |dest_queue, jobs|
jobs.each do |worker, from_queue|
migrate_from_queue(redis, from_queue, worker => dest_queue)
end
end
end
end
def migrate_from_queue(redis, queue, job_mapping)
while job = redis.lpop("queue:#{queue}")
payload = JSON.load(job)
new_queue = job_mapping[payload['class']]
# If we have no target queue to migrate to we're probably dealing with
# some ancient job for which the worker no longer exists. In that case
# there's no sane option we can take, other than just dropping the job.
next unless new_queue
payload['queue'] = new_queue
redis.lpush("queue:#{new_queue}", JSON.dump(payload))
end
end
end
......@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20161019213545) do
ActiveRecord::Schema.define(version: 20161024042317) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
......
......@@ -61,6 +61,7 @@ executing commands in the following snippet.
```bash
git clone https://github.com/koding/koding.git
cd koding
docker-compose -f docker-compose-init.yml run init
docker-compose up
```
......
......@@ -37,7 +37,7 @@ graphs/dashboards.
GitLab provides built-in tools to aid the process of improving performance:
* [Sherlock](profiling.md#sherlock)
* [GitLab Performance Monitoring](../monitoring/performance/monitoring.md)
* [GitLab Performance Monitoring](../administration/monitoring/performance/monitoring.md)
* [Request Profiling](../administration/monitoring/performance/request_profiling.md)
GitLab employees can use GitLab.com's performance monitoring systems located at
......
This document was moved to [administration/monitoring/performance/gitlab_configuration](../administration/monitoring/performance/gitlab_configuration.md).
This document was moved to [administration/monitoring/performance/gitlab_configuration](../../administration/monitoring/performance/gitlab_configuration.md).
This document was moved to [administration/monitoring/performance/influxdb_configuration](../administration/monitoring/performance/influxdb_configuration.md).
This document was moved to [administration/monitoring/performance/influxdb_configuration](../../administration/monitoring/performance/influxdb_configuration.md).
This document was moved to [administration/monitoring/performance/influxdb_schema](../administration/monitoring/performance/influxdb_schema.md).
This document was moved to [administration/monitoring/performance/influxdb_schema](../../administration/monitoring/performance/influxdb_schema.md).
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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