Merge remote-tracking branch 'origin/master' into docker-registry
This commit is contained in:
commit
71da2e0b56
|
@ -953,10 +953,9 @@ Performance/DoubleStartEndWith:
|
|||
Performance/EndWith:
|
||||
Enabled: false
|
||||
|
||||
# TODO: Enable LstripRstrip Cop.
|
||||
# Use `strip` instead of `lstrip.rstrip`.
|
||||
Performance/LstripRstrip:
|
||||
Enabled: false
|
||||
Enabled: true
|
||||
|
||||
# TODO: Enable RangeInclude Cop.
|
||||
# Use `Range#cover?` instead of `Range#include?`.
|
||||
|
|
86
CHANGELOG
86
CHANGELOG
|
@ -1,22 +1,48 @@
|
|||
Please view this file on the master branch, on stable branches it's out of date.
|
||||
|
||||
v 8.8.0 (unreleased)
|
||||
- Assign labels and milestone to target project when moving issue. !3934 (Long Nguyen)
|
||||
- Project#open_branches has been cleaned up and no longer loads entire records into memory.
|
||||
- Log to application.log when an admin starts and stops impersonating a user
|
||||
- Updated gitlab_git to 10.1.0
|
||||
- GitAccess#protected_tag? no longer loads all tags just to check if a single one exists
|
||||
- Reduce delay in destroying a project from 1-minute to immediately
|
||||
- Make build status canceled if any of the jobs was canceled and none failed
|
||||
- Upgrade Sidekiq to 4.1.2
|
||||
- Sanitize repo paths in new project error message
|
||||
- Bump mail_room to 0.7.0 to fix stuck IDLE connections
|
||||
- Remove future dates from contribution calendar graph.
|
||||
- Support e-mail notifications for comments on project snippets
|
||||
- Use ActionDispatch Remote IP for Akismet checking
|
||||
- Fix error when visiting commit builds page before build was updated
|
||||
- Add 'l' shortcut to open Label dropdown on issuables and 'i' to create new issue on a project
|
||||
- Update SVG sanitizer to conform to SVG 1.1
|
||||
- Updated search UI
|
||||
- Display informative message when new milestone is created
|
||||
- Replace Devise Async with Devise ActiveJob integration. !3902 (Connor Shea)
|
||||
- Allow "NEWS" and "CHANGES" as alternative names for CHANGELOG. !3768 (Connor Shea)
|
||||
- Added button to toggle whitespaces changes on diff view
|
||||
- Backport GitLab Enterprise support from EE
|
||||
- Backport GitHub Enterprise import support from EE
|
||||
- Create tags using Rugged for performance reasons. !3745
|
||||
- Files over 5MB can only be viewed in their raw form, files over 1MB without highlighting !3718
|
||||
- Add support for supressing text diffs using .gitattributes on the default branch (Matt Oakes)
|
||||
- Added multiple colors for labels in dropdowns when dups happen.
|
||||
- Improve description for the Two-factor Authentication sign-in screen. (Connor Shea)
|
||||
- API support for the 'since' and 'until' operators on commit requests (Paco Guzman)
|
||||
- Fix Gravatar hint in user profile when Gravatar is disabled. !3988 (Artem Sidorenko)
|
||||
- Expire repository exists? and has_visible_content? caches after a push if necessary
|
||||
- Fix unintentional filtering bug in issues sorted by milestone due (Takuya Noguchi)
|
||||
|
||||
v 8.7.3
|
||||
- Emails, Gitlab::Email::Message, Gitlab::Diff, and Premailer::Adapter::Nokogiri are now instrumented
|
||||
- Merge request widget displays TeamCity build state and code coverage correctly again.
|
||||
- Fix the line code when importing PR review comments from GitHub. !4010
|
||||
- Wikis are now initialized on legacy projects when checking repositories
|
||||
|
||||
v 8.7.2
|
||||
- The "New Branch" button is now loaded asynchronously
|
||||
- Fix error 500 when trying to create a wiki page
|
||||
- Updated spacing between notification label and button
|
||||
- Label titles in filters are now escaped properly
|
||||
|
||||
v 8.7.1
|
||||
- Throttle the update of `project.last_activity_at` to 1 minute. !3848
|
||||
|
@ -138,13 +164,25 @@ v 8.7.0
|
|||
- Import GitHub labels
|
||||
- Add option to filter by "Owned projects" on dashboard page
|
||||
- Import GitHub milestones
|
||||
- Fix emoji catgories in the emoji picker
|
||||
- Execute system web hooks on push to the project
|
||||
- Allow enable/disable push events for system hooks
|
||||
- Fix GitHub project's link in the import page when provider has a custom URL
|
||||
- Add RAW build trace output and button on build page
|
||||
- Add incremental build trace update into CI API
|
||||
|
||||
v 8.6.8
|
||||
- Prevent privilege escalation via "impersonate" feature
|
||||
- Prevent privilege escalation via notes API
|
||||
- Prevent privilege escalation via project webhook API
|
||||
- Prevent XSS via Git branch and tag names
|
||||
- Prevent XSS via custom issue tracker URL
|
||||
- Prevent XSS via `window.opener`
|
||||
- Prevent XSS via label drop-down
|
||||
- Prevent information disclosure via milestone API
|
||||
- Prevent information disclosure via snippet API
|
||||
- Prevent information disclosure via project labels
|
||||
- Prevent information disclosure via new merge request page
|
||||
|
||||
v 8.6.7
|
||||
- Fix persistent XSS vulnerability in `commit_person_link` helper
|
||||
- Fix persistent XSS vulnerability in Label and Milestone dropdowns
|
||||
|
@ -286,6 +324,17 @@ v 8.6.0
|
|||
- Trigger a todo for mentions on commits page
|
||||
- Let project owners and admins soft delete issues and merge requests
|
||||
|
||||
v 8.5.12
|
||||
- Prevent privilege escalation via "impersonate" feature
|
||||
- Prevent privilege escalation via notes API
|
||||
- Prevent privilege escalation via project webhook API
|
||||
- Prevent XSS via Git branch and tag names
|
||||
- Prevent XSS via custom issue tracker URL
|
||||
- Prevent XSS via `window.opener`
|
||||
- Prevent information disclosure via snippet API
|
||||
- Prevent information disclosure via project labels
|
||||
- Prevent information disclosure via new merge request page
|
||||
|
||||
v 8.5.11
|
||||
- Fix persistent XSS vulnerability in `commit_person_link` helper
|
||||
|
||||
|
@ -436,6 +485,17 @@ v 8.5.0
|
|||
- Show label row when filtering issues or merge requests by label (Nuttanart Pornprasitsakul)
|
||||
- Add Todos
|
||||
|
||||
v 8.4.10
|
||||
- Prevent privilege escalation via "impersonate" feature
|
||||
- Prevent privilege escalation via notes API
|
||||
- Prevent privilege escalation via project webhook API
|
||||
- Prevent XSS via Git branch and tag names
|
||||
- Prevent XSS via custom issue tracker URL
|
||||
- Prevent XSS via `window.opener`
|
||||
- Prevent information disclosure via snippet API
|
||||
- Prevent information disclosure via project labels
|
||||
- Prevent information disclosure via new merge request page
|
||||
|
||||
v 8.4.9
|
||||
- Fix persistent XSS vulnerability in `commit_person_link` helper
|
||||
|
||||
|
@ -561,6 +621,15 @@ v 8.4.0
|
|||
- Add IP check against DNSBLs at account sign-up
|
||||
- Added cache:key to .gitlab-ci.yml allowing to fine tune the caching
|
||||
|
||||
v 8.3.9
|
||||
- Prevent privilege escalation via "impersonate" feature
|
||||
- Prevent privilege escalation via notes API
|
||||
- Prevent privilege escalation via project webhook API
|
||||
- Prevent XSS via custom issue tracker URL
|
||||
- Prevent XSS via `window.opener`
|
||||
- Prevent information disclosure via project labels
|
||||
- Prevent information disclosure via new merge request page
|
||||
|
||||
v 8.3.8
|
||||
- Fix persistent XSS vulnerability in `commit_person_link` helper
|
||||
|
||||
|
@ -670,6 +739,17 @@ v 8.3.0
|
|||
- Expose Git's version in the admin area
|
||||
- Show "New Merge Request" buttons on canonical repos when you have a fork (Josh Frye)
|
||||
|
||||
v 8.2.5
|
||||
- Prevent privilege escalation via "impersonate" feature
|
||||
- Prevent privilege escalation via notes API
|
||||
- Prevent privilege escalation via project webhook API
|
||||
- Prevent XSS via `window.opener`
|
||||
- Prevent information disclosure via project labels
|
||||
- Prevent information disclosure via new merge request page
|
||||
|
||||
v 8.2.4
|
||||
- Bump Git version requirement to 2.7.4
|
||||
|
||||
v 8.2.3
|
||||
- Fix application settings cache not expiring after changes (Stan Hu)
|
||||
- Fix Error 500s when creating global milestones with Unicode characters (Stan Hu)
|
||||
|
|
|
@ -142,6 +142,16 @@ code snippet right after your description in a new line: `~"feature proposal"`.
|
|||
Please keep feature proposals as small and simple as possible, complex ones
|
||||
might be edited to make them small and simple.
|
||||
|
||||
You are encouraged to use the template below for feature proposals.
|
||||
|
||||
```
|
||||
## Description including problem, use cases, benefits, and/or goals
|
||||
|
||||
## Proposal
|
||||
|
||||
## Links / references
|
||||
```
|
||||
|
||||
For changes in the interface, it can be helpful to create a mockup first.
|
||||
If you want to create something yourself, consider opening an issue first to
|
||||
discuss whether it is interesting to include this in GitLab.
|
||||
|
@ -349,7 +359,7 @@ on your merge request feel free to mention one of the Merge Marshalls in the
|
|||
Please ensure that your merge request meets the contribution acceptance criteria.
|
||||
|
||||
When having your code reviewed and when reviewing merge requests please take the
|
||||
[Thoughtbot code review guide] into account.
|
||||
[code review guidelines](doc/development/code_review.md) into account.
|
||||
|
||||
### Merge request description format
|
||||
|
||||
|
@ -523,4 +533,3 @@ available at [http://contributor-covenant.org/version/1/1/0/](http://contributor
|
|||
[gitlab-design]: https://gitlab.com/gitlab-org/gitlab-design
|
||||
[free Antetype viewer (Mac OSX only)]: https://itunes.apple.com/us/app/antetype-viewer/id824152298?mt=12
|
||||
[`gitlab1.atype` file]: https://gitlab.com/gitlab-org/gitlab-design/tree/master/gitlab1.atype/
|
||||
[Thoughtbot code review guide]: https://github.com/thoughtbot/guides/tree/master/code-review
|
||||
|
|
7
Gemfile
7
Gemfile
|
@ -19,7 +19,8 @@ gem "pg", '~> 0.18.2', group: :postgres
|
|||
|
||||
# Authentication libraries
|
||||
gem 'devise', '~> 3.5.4'
|
||||
gem 'doorkeeper', '~> 2.2.0'
|
||||
gem 'doorkeeper', '~> 3.1'
|
||||
gem 'devise-async', '~> 0.9.0'
|
||||
gem 'omniauth', '~> 1.3.1'
|
||||
gem 'omniauth-auth0', '~> 1.4.1'
|
||||
gem 'omniauth-azure-oauth2', '~> 0.0.6'
|
||||
|
@ -271,7 +272,7 @@ group :development, :test do
|
|||
|
||||
gem 'database_cleaner', '~> 1.4.0'
|
||||
gem 'factory_girl_rails', '~> 4.6.0'
|
||||
gem 'rspec-rails', '~> 3.3.0'
|
||||
gem 'rspec-rails', '~> 3.4.0'
|
||||
gem 'rspec-retry'
|
||||
gem 'spinach-rails', '~> 0.2.1'
|
||||
gem 'spinach-rerun-reporter', '~> 0.0.2'
|
||||
|
@ -321,7 +322,7 @@ gem "newrelic_rpm", '~> 3.14'
|
|||
|
||||
gem 'octokit', '~> 4.3.0'
|
||||
|
||||
gem "mail_room", "~> 0.6.1"
|
||||
gem "mail_room", "~> 0.7"
|
||||
|
||||
gem 'email_reply_parser', '~> 0.5.8'
|
||||
|
||||
|
|
53
Gemfile.lock
53
Gemfile.lock
|
@ -135,7 +135,7 @@ GEM
|
|||
execjs
|
||||
coffee-script-source (1.10.0)
|
||||
colorize (0.7.7)
|
||||
concurrent-ruby (1.0.1)
|
||||
concurrent-ruby (1.0.2)
|
||||
connection_pool (2.2.0)
|
||||
coveralls (0.8.13)
|
||||
json (~> 1.8)
|
||||
|
@ -165,6 +165,8 @@ GEM
|
|||
responders
|
||||
thread_safe (~> 0.1)
|
||||
warden (~> 1.2.3)
|
||||
devise-async (0.9.0)
|
||||
devise (~> 3.2)
|
||||
devise-two-factor (2.0.1)
|
||||
activesupport
|
||||
attr_encrypted (~> 1.3.2)
|
||||
|
@ -174,7 +176,7 @@ GEM
|
|||
diff-lcs (1.2.5)
|
||||
diffy (3.0.7)
|
||||
docile (1.1.5)
|
||||
doorkeeper (2.2.2)
|
||||
doorkeeper (3.1.0)
|
||||
railties (>= 3.2)
|
||||
dropzonejs-rails (0.7.2)
|
||||
rails (> 3.1)
|
||||
|
@ -352,7 +354,7 @@ GEM
|
|||
posix-spawn (~> 0.3)
|
||||
gitlab_emoji (0.3.1)
|
||||
gemojione (~> 2.2, >= 2.2.1)
|
||||
gitlab_git (10.0.1)
|
||||
gitlab_git (10.1.0)
|
||||
activesupport (~> 4.0)
|
||||
charlock_holmes (~> 0.7.3)
|
||||
github-linguist (~> 4.7.0)
|
||||
|
@ -466,7 +468,7 @@ GEM
|
|||
systemu (~> 2.6.2)
|
||||
mail (2.6.4)
|
||||
mime-types (>= 1.16, < 4)
|
||||
mail_room (0.6.1)
|
||||
mail_room (0.7.0)
|
||||
method_source (0.8.2)
|
||||
mime-types (2.99.1)
|
||||
mimemagic (0.3.0)
|
||||
|
@ -663,29 +665,29 @@ GEM
|
|||
chunky_png
|
||||
rqrcode-rails3 (0.1.7)
|
||||
rqrcode (>= 0.4.2)
|
||||
rspec (3.3.0)
|
||||
rspec-core (~> 3.3.0)
|
||||
rspec-expectations (~> 3.3.0)
|
||||
rspec-mocks (~> 3.3.0)
|
||||
rspec-core (3.3.2)
|
||||
rspec-support (~> 3.3.0)
|
||||
rspec-expectations (3.3.1)
|
||||
rspec (3.4.0)
|
||||
rspec-core (~> 3.4.0)
|
||||
rspec-expectations (~> 3.4.0)
|
||||
rspec-mocks (~> 3.4.0)
|
||||
rspec-core (3.4.4)
|
||||
rspec-support (~> 3.4.0)
|
||||
rspec-expectations (3.4.0)
|
||||
diff-lcs (>= 1.2.0, < 2.0)
|
||||
rspec-support (~> 3.3.0)
|
||||
rspec-mocks (3.3.2)
|
||||
rspec-support (~> 3.4.0)
|
||||
rspec-mocks (3.4.1)
|
||||
diff-lcs (>= 1.2.0, < 2.0)
|
||||
rspec-support (~> 3.3.0)
|
||||
rspec-rails (3.3.3)
|
||||
rspec-support (~> 3.4.0)
|
||||
rspec-rails (3.4.2)
|
||||
actionpack (>= 3.0, < 4.3)
|
||||
activesupport (>= 3.0, < 4.3)
|
||||
railties (>= 3.0, < 4.3)
|
||||
rspec-core (~> 3.3.0)
|
||||
rspec-expectations (~> 3.3.0)
|
||||
rspec-mocks (~> 3.3.0)
|
||||
rspec-support (~> 3.3.0)
|
||||
rspec-core (~> 3.4.0)
|
||||
rspec-expectations (~> 3.4.0)
|
||||
rspec-mocks (~> 3.4.0)
|
||||
rspec-support (~> 3.4.0)
|
||||
rspec-retry (0.4.5)
|
||||
rspec-core
|
||||
rspec-support (3.3.0)
|
||||
rspec-support (3.4.1)
|
||||
rubocop (0.38.0)
|
||||
parser (>= 2.3.0.6, < 3.0)
|
||||
powerpack (~> 0.1)
|
||||
|
@ -739,7 +741,7 @@ GEM
|
|||
rack
|
||||
shoulda-matchers (2.8.0)
|
||||
activesupport (>= 3.0.0)
|
||||
sidekiq (4.1.1)
|
||||
sidekiq (4.1.2)
|
||||
concurrent-ruby (~> 1.0)
|
||||
connection_pool (~> 2.2, >= 2.2.0)
|
||||
redis (~> 3.2, >= 3.2.1)
|
||||
|
@ -922,9 +924,10 @@ DEPENDENCIES
|
|||
database_cleaner (~> 1.4.0)
|
||||
default_value_for (~> 3.0.0)
|
||||
devise (~> 3.5.4)
|
||||
devise-async (~> 0.9.0)
|
||||
devise-two-factor (~> 2.0.0)
|
||||
diffy (~> 3.0.3)
|
||||
doorkeeper (~> 2.2.0)
|
||||
doorkeeper (~> 3.1)
|
||||
dropzonejs-rails (~> 0.7.1)
|
||||
email_reply_parser (~> 0.5.8)
|
||||
email_spec (~> 1.6.0)
|
||||
|
@ -964,7 +967,7 @@ DEPENDENCIES
|
|||
letter_opener_web (~> 1.3.0)
|
||||
licensee (~> 8.0.0)
|
||||
loofah (~> 2.0.3)
|
||||
mail_room (~> 0.6.1)
|
||||
mail_room (~> 0.7)
|
||||
method_source (~> 0.8)
|
||||
minitest (~> 5.7.0)
|
||||
mousetrap-rails (~> 1.4.6)
|
||||
|
@ -1014,7 +1017,7 @@ DEPENDENCIES
|
|||
responders (~> 2.0)
|
||||
rouge (~> 1.10.1)
|
||||
rqrcode-rails3 (~> 0.1.7)
|
||||
rspec-rails (~> 3.3.0)
|
||||
rspec-rails (~> 3.4.0)
|
||||
rspec-retry
|
||||
rubocop (~> 0.38.0)
|
||||
ruby-fogbugz (~> 0.2.1)
|
||||
|
@ -1061,4 +1064,4 @@ DEPENDENCIES
|
|||
wikicloth (= 0.8.1)
|
||||
|
||||
BUNDLED WITH
|
||||
1.11.2
|
||||
1.12.1
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# GitLab
|
||||
|
||||
[![build status](https://ci.gitlab.com/projects/1/status.svg?ref=master)](https://ci.gitlab.com/projects/1?ref=master)
|
||||
[![build status](https://gitlab.com/gitlab-org/gitlab-ce/badges/master/build.svg)](https://gitlab.com/gitlab-org/gitlab-ce/commits/master)
|
||||
[![Build Status](https://semaphoreci.com/api/v1/projects/2f1a5809-418b-4cc2-a1f4-819607579fe7/400484/shields_badge.svg)](https://semaphoreci.com/gitlabhq/gitlabhq)
|
||||
[![Code Climate](https://codeclimate.com/github/gitlabhq/gitlabhq.svg)](https://codeclimate.com/github/gitlabhq/gitlabhq)
|
||||
[![Coverage Status](https://coveralls.io/repos/gitlabhq/gitlabhq/badge.svg?branch=master)](https://coveralls.io/r/gitlabhq/gitlabhq?branch=master)
|
||||
|
@ -20,6 +20,10 @@ To see how GitLab looks please see the [features page on our website](https://ab
|
|||
- Completely free and open source (MIT Expat license)
|
||||
- Powered by [Ruby on Rails](https://github.com/rails/rails)
|
||||
|
||||
## Hiring
|
||||
|
||||
We're hiring developers, support people, and production engineers all the time, please see our [jobs page](https://about.gitlab.com/jobs/).
|
||||
|
||||
## Editions
|
||||
|
||||
There are two editions of GitLab:
|
||||
|
@ -80,7 +84,7 @@ There are a lot of [third-party applications integrating with GitLab](https://ab
|
|||
|
||||
## GitLab release cycle
|
||||
|
||||
For more information about the release process see the [release documentation](http://doc.gitlab.com/ce/release/).
|
||||
For more information about the release process see the [release documentation](https://gitlab.com/gitlab-org/release-tools/blob/master/README.md).
|
||||
|
||||
## Upgrading
|
||||
|
||||
|
|
|
@ -1,58 +1,58 @@
|
|||
class @AwardsHandler
|
||||
constructor: (@get_emojis_url, @post_emoji_url, @noteable_type, @noteable_id, @unicodes) ->
|
||||
$(".js-add-award").on "click", (event) =>
|
||||
constructor: (@getEmojisUrl, @postEmojiUrl, @noteableType, @noteableId, @unicodes) ->
|
||||
$('.js-add-award').on 'click', (event) =>
|
||||
event.stopPropagation()
|
||||
event.preventDefault()
|
||||
|
||||
@showEmojiMenu()
|
||||
|
||||
$("html").on 'click', (event) ->
|
||||
if !$(event.target).closest(".emoji-menu").length
|
||||
if $(".emoji-menu").is(":visible")
|
||||
$(".emoji-menu").removeClass "is-visible"
|
||||
$('html').on 'click', (event) ->
|
||||
if !$(event.target).closest('.emoji-menu').length
|
||||
if $('.emoji-menu').is(':visible')
|
||||
$('.emoji-menu').removeClass 'is-visible'
|
||||
|
||||
$(".awards")
|
||||
.off "click"
|
||||
.on "click", ".js-emoji-btn", @handleClick
|
||||
$('.awards')
|
||||
.off 'click'
|
||||
.on 'click', '.js-emoji-btn', @handleClick
|
||||
|
||||
@renderFrequentlyUsedBlock()
|
||||
|
||||
handleClick: (e) ->
|
||||
e.preventDefault()
|
||||
emoji = $(this)
|
||||
.find(".icon")
|
||||
.data "emoji"
|
||||
.find('.icon')
|
||||
.data 'emoji'
|
||||
|
||||
if emoji is "thumbsup" and awards_handler.didUserClickEmoji $(this), "thumbsdown"
|
||||
awards_handler.addAward "thumbsdown"
|
||||
if emoji is 'thumbsup' and awardsHandler.didUserClickEmoji $(this), 'thumbsdown'
|
||||
awardsHandler.addAward 'thumbsdown'
|
||||
|
||||
else if emoji is "thumbsdown" and awards_handler.didUserClickEmoji $(this), "thumbsup"
|
||||
awards_handler.addAward "thumbsup"
|
||||
else if emoji is 'thumbsdown' and awardsHandler.didUserClickEmoji $(this), 'thumbsup'
|
||||
awardsHandler.addAward 'thumbsup'
|
||||
|
||||
awards_handler.addAward emoji
|
||||
awardsHandler.addAward emoji
|
||||
|
||||
$(this).trigger 'blur'
|
||||
|
||||
didUserClickEmoji: (that, emoji) ->
|
||||
if $(that).siblings("button:has([data-emoji=#{emoji}])").attr("data-original-title")
|
||||
$(that).siblings("button:has([data-emoji=#{emoji}])").attr("data-original-title").indexOf('me') > -1
|
||||
if $(that).siblings("button:has([data-emoji=#{emoji}])").attr('data-original-title')
|
||||
$(that).siblings("button:has([data-emoji=#{emoji}])").attr('data-original-title').indexOf('me') > -1
|
||||
|
||||
showEmojiMenu: ->
|
||||
if $(".emoji-menu").length
|
||||
if $(".emoji-menu").is ".is-visible"
|
||||
$(".emoji-menu").removeClass "is-visible"
|
||||
$("#emoji_search").blur()
|
||||
if $('.emoji-menu').length
|
||||
if $('.emoji-menu').is '.is-visible'
|
||||
$('.emoji-menu').removeClass 'is-visible'
|
||||
$('#emoji_search').blur()
|
||||
else
|
||||
$(".emoji-menu").addClass "is-visible"
|
||||
$("#emoji_search").focus()
|
||||
$('.emoji-menu').addClass 'is-visible'
|
||||
$('#emoji_search').focus()
|
||||
else
|
||||
$('.js-add-award').addClass "is-loading"
|
||||
$.get @get_emojis_url, (response) =>
|
||||
$('.js-add-award').removeClass "is-loading"
|
||||
$(".js-award-holder").append response
|
||||
$('.js-add-award').addClass 'is-loading'
|
||||
$.get @getEmojisUrl, (response) =>
|
||||
$('.js-add-award').removeClass 'is-loading'
|
||||
$('.js-award-holder').append response
|
||||
setTimeout =>
|
||||
$(".emoji-menu").addClass "is-visible"
|
||||
$("#emoji_search").focus()
|
||||
$('.emoji-menu').addClass 'is-visible'
|
||||
$('#emoji_search').focus()
|
||||
@setupSearch()
|
||||
, 200
|
||||
|
||||
|
@ -60,7 +60,7 @@ class @AwardsHandler
|
|||
@postEmoji emoji, =>
|
||||
@addAwardToEmojiBar(emoji)
|
||||
|
||||
$(".emoji-menu").removeClass "is-visible"
|
||||
$('.emoji-menu').removeClass 'is-visible'
|
||||
|
||||
addAwardToEmojiBar: (emoji) ->
|
||||
@addEmojiToFrequentlyUsedList(emoji)
|
||||
|
@ -69,9 +69,9 @@ class @AwardsHandler
|
|||
if @isActive(emoji)
|
||||
@decrementCounter(emoji)
|
||||
else
|
||||
counter = @findEmojiIcon(emoji).siblings(".js-counter")
|
||||
counter = @findEmojiIcon(emoji).siblings('.js-counter')
|
||||
counter.text(parseInt(counter.text()) + 1)
|
||||
counter.parent().addClass("active")
|
||||
counter.parent().addClass('active')
|
||||
@addMeToAuthorList(emoji)
|
||||
else
|
||||
@createEmoji(emoji)
|
||||
|
@ -80,47 +80,47 @@ class @AwardsHandler
|
|||
@findEmojiIcon(emoji).length > 0
|
||||
|
||||
isActive: (emoji) ->
|
||||
@findEmojiIcon(emoji).parent().hasClass("active")
|
||||
@findEmojiIcon(emoji).parent().hasClass('active')
|
||||
|
||||
decrementCounter: (emoji) ->
|
||||
counter = @findEmojiIcon(emoji).siblings(".js-counter")
|
||||
counter = @findEmojiIcon(emoji).siblings('.js-counter')
|
||||
emojiIcon = counter.parent()
|
||||
if parseInt(counter.text()) > 1
|
||||
counter.text(parseInt(counter.text()) - 1)
|
||||
emojiIcon.removeClass("active")
|
||||
emojiIcon.removeClass('active')
|
||||
@removeMeFromAuthorList(emoji)
|
||||
else if emoji == "thumbsup" || emoji == "thumbsdown"
|
||||
emojiIcon.tooltip("destroy")
|
||||
else if emoji == 'thumbsup' || emoji == 'thumbsdown'
|
||||
emojiIcon.tooltip('destroy')
|
||||
counter.text(0)
|
||||
emojiIcon.removeClass("active")
|
||||
emojiIcon.removeClass('active')
|
||||
@removeMeFromAuthorList(emoji)
|
||||
else
|
||||
emojiIcon.tooltip("destroy")
|
||||
emojiIcon.tooltip('destroy')
|
||||
emojiIcon.remove()
|
||||
|
||||
removeMeFromAuthorList: (emoji) ->
|
||||
award_block = @findEmojiIcon(emoji).parent()
|
||||
authors = award_block
|
||||
.attr("data-original-title")
|
||||
.split(", ")
|
||||
authors.splice(authors.indexOf("me"),1)
|
||||
award_block
|
||||
.closest(".js-emoji-btn")
|
||||
.attr("data-original-title", authors.join(", "))
|
||||
@resetTooltip(award_block)
|
||||
awardBlock = @findEmojiIcon(emoji).parent()
|
||||
authors = awardBlock
|
||||
.attr('data-original-title')
|
||||
.split(', ')
|
||||
authors.splice(authors.indexOf('me'),1)
|
||||
awardBlock
|
||||
.closest('.js-emoji-btn')
|
||||
.attr('data-original-title', authors.join(', '))
|
||||
@resetTooltip(awardBlock)
|
||||
|
||||
addMeToAuthorList: (emoji) ->
|
||||
award_block = @findEmojiIcon(emoji).parent()
|
||||
origTitle = award_block.attr("data-original-title").trim()
|
||||
awardBlock = @findEmojiIcon(emoji).parent()
|
||||
origTitle = awardBlock.attr('data-original-title').trim()
|
||||
authors = []
|
||||
if origTitle
|
||||
authors = origTitle.split(', ')
|
||||
authors.push("me")
|
||||
award_block.attr("data-original-title", authors.join(", "))
|
||||
@resetTooltip(award_block)
|
||||
authors.push('me')
|
||||
awardBlock.attr('data-original-title', authors.join(', '))
|
||||
@resetTooltip(awardBlock)
|
||||
|
||||
resetTooltip: (award) ->
|
||||
award.tooltip("destroy")
|
||||
award.tooltip('destroy')
|
||||
|
||||
# "destroy" call is asynchronous and there is no appropriate callback on it, this is why we need to set timeout.
|
||||
setTimeout (->
|
||||
|
@ -139,20 +139,28 @@ class @AwardsHandler
|
|||
"</button>"
|
||||
)
|
||||
|
||||
emoji_node = $(nodes.join("\n"))
|
||||
.insertBefore(".js-award-holder")
|
||||
.find(".emoji-icon")
|
||||
.data("emoji", emoji)
|
||||
$(nodes.join("\n"))
|
||||
.insertBefore('.js-award-holder')
|
||||
.find('.emoji-icon')
|
||||
.data('emoji', emoji)
|
||||
$('.award-control').tooltip()
|
||||
|
||||
resolveNameToCssClass: (emoji) ->
|
||||
"emoji-#{@unicodes[emoji]}"
|
||||
emojiIcon = $(".emoji-menu-content [data-emoji='#{emoji}']")
|
||||
|
||||
if emojiIcon.length > 0
|
||||
unicodeName = emojiIcon.data('unicode-name')
|
||||
else
|
||||
# Find by alias
|
||||
unicodeName = $(".emoji-menu-content [data-aliases*=':#{emoji}:']").data('unicode-name')
|
||||
|
||||
"emoji-#{unicodeName}"
|
||||
|
||||
postEmoji: (emoji, callback) ->
|
||||
$.post @post_emoji_url, { note: {
|
||||
$.post @postEmojiUrl, { note: {
|
||||
note: ":#{emoji}:"
|
||||
noteable_type: @noteable_type
|
||||
noteable_id: @noteable_id
|
||||
noteable_type: @noteableType
|
||||
noteable_id: @noteableId
|
||||
}},(data) ->
|
||||
if data.ok
|
||||
callback.call()
|
||||
|
@ -166,42 +174,42 @@ class @AwardsHandler
|
|||
}, 200)
|
||||
|
||||
addEmojiToFrequentlyUsedList: (emoji) ->
|
||||
frequently_used_emojis = @getFrequentlyUsedEmojis()
|
||||
frequently_used_emojis.push(emoji)
|
||||
$.cookie('frequently_used_emojis', frequently_used_emojis.join(","), { expires: 365 })
|
||||
frequentlyUsedEmojis = @getFrequentlyUsedEmojis()
|
||||
frequentlyUsedEmojis.push(emoji)
|
||||
$.cookie('frequently_used_emojis', frequentlyUsedEmojis.join(','), { expires: 365 })
|
||||
|
||||
getFrequentlyUsedEmojis: ->
|
||||
frequently_used_emojis = ($.cookie('frequently_used_emojis') || "").split(",")
|
||||
_.compact(_.uniq(frequently_used_emojis))
|
||||
frequentlyUsedEmojis = ($.cookie('frequently_used_emojis') || '').split(',')
|
||||
_.compact(_.uniq(frequentlyUsedEmojis))
|
||||
|
||||
renderFrequentlyUsedBlock: ->
|
||||
if $.cookie('frequently_used_emojis')
|
||||
frequently_used_emojis = @getFrequentlyUsedEmojis()
|
||||
frequentlyUsedEmojis = @getFrequentlyUsedEmojis()
|
||||
|
||||
ul = $("<ul>")
|
||||
ul = $('<ul>')
|
||||
|
||||
for emoji in frequently_used_emojis
|
||||
for emoji in frequentlyUsedEmojis
|
||||
do (emoji) ->
|
||||
$(".emoji-menu-content [data-emoji='#{emoji}']").closest("li").clone().appendTo(ul)
|
||||
$(".emoji-menu-content [data-emoji='#{emoji}']").closest('li').clone().appendTo(ul)
|
||||
|
||||
$("input.emoji-search").after(ul).after($("<h5>").text("Frequently used"))
|
||||
$('input.emoji-search').after(ul).after($('<h5>').text('Frequently used'))
|
||||
|
||||
setupSearch: ->
|
||||
$("input.emoji-search").keyup (ev) =>
|
||||
$('input.emoji-search').keyup (ev) =>
|
||||
term = $(ev.target).val()
|
||||
|
||||
# Clean previous search results
|
||||
$("ul.emoji-menu-search, h5.emoji-search").remove()
|
||||
$('ul.emoji-menu-search, h5.emoji-search').remove()
|
||||
|
||||
if term
|
||||
# Generate a search result block
|
||||
h5 = $("<h5>").text("Search results").addClass("emoji-search")
|
||||
found_emojis = @searchEmojis(term).show()
|
||||
ul = $("<ul>").addClass("emoji-menu-list emoji-menu-search").append(found_emojis)
|
||||
$(".emoji-menu-content ul, .emoji-menu-content h5").hide()
|
||||
$(".emoji-menu-content").append(h5).append(ul)
|
||||
h5 = $('<h5>').text('Search results').addClass('emoji-search')
|
||||
foundEmojis = @searchEmojis(term).show()
|
||||
ul = $('<ul>').addClass('emoji-menu-list emoji-menu-search').append(foundEmojis)
|
||||
$('.emoji-menu-content ul, .emoji-menu-content h5').hide()
|
||||
$('.emoji-menu-content').append(h5).append(ul)
|
||||
else
|
||||
$(".emoji-menu-content").children().show()
|
||||
$('.emoji-menu-content').children().show()
|
||||
|
||||
searchEmojis: (term)->
|
||||
$(".emoji-menu-content [data-emoji*='#{term}']").closest("li").clone()
|
||||
|
|
|
@ -163,6 +163,21 @@ class @LabelsSelect
|
|||
$.ajax(
|
||||
url: labelUrl
|
||||
).done (data) ->
|
||||
data = _.chain data
|
||||
.groupBy (label) ->
|
||||
label.title
|
||||
.map (label) ->
|
||||
color = _.map label, (dup) ->
|
||||
dup.color
|
||||
|
||||
return {
|
||||
id: label[0].id
|
||||
title: label[0].title
|
||||
color: color
|
||||
duplicate: color.length > 1
|
||||
}
|
||||
.value()
|
||||
|
||||
if $dropdown.hasClass 'js-extra-options'
|
||||
if showNo
|
||||
data.unshift(
|
||||
|
@ -178,6 +193,7 @@ class @LabelsSelect
|
|||
|
||||
if data.length > 2
|
||||
data.splice 2, 0, 'divider'
|
||||
|
||||
callback data
|
||||
|
||||
renderRow: (label) ->
|
||||
|
@ -192,11 +208,31 @@ class @LabelsSelect
|
|||
if $dropdown.hasClass('js-multiselect') and removesAll
|
||||
selectedClass.push 'dropdown-clear-active'
|
||||
|
||||
color = if label.color? then "<span class='dropdown-label-box' style='background-color: #{label.color}'></span>" else ""
|
||||
if label.duplicate
|
||||
spacing = 100 / label.color.length
|
||||
|
||||
# Reduce the colors to 4
|
||||
label.color = label.color.filter (color, i) ->
|
||||
i < 4
|
||||
|
||||
color = _.map(label.color, (color, i) ->
|
||||
percentFirst = Math.floor(spacing * i)
|
||||
percentSecond = Math.floor(spacing * (i + 1))
|
||||
"#{color} #{percentFirst}%,#{color} #{percentSecond}% "
|
||||
).join(',')
|
||||
color = "linear-gradient(#{color})"
|
||||
else
|
||||
if label.color?
|
||||
color = label.color[0]
|
||||
|
||||
if color
|
||||
colorEl = "<span class='dropdown-label-box' style='background: #{color}'></span>"
|
||||
else
|
||||
colorEl = ''
|
||||
|
||||
"<li>
|
||||
<a href='#' class='#{selectedClass.join(' ')}'>
|
||||
#{color}
|
||||
#{colorEl}
|
||||
#{_.escape(label.title)}
|
||||
</a>
|
||||
</li>"
|
||||
|
|
|
@ -68,20 +68,18 @@ class @MergeRequestWidget
|
|||
$.getJSON @opts.ci_status_url, (data) =>
|
||||
@readyForCICheck = true
|
||||
|
||||
if @firstCICheck
|
||||
@firstCICheck = false
|
||||
@opts.ci_status = data.status
|
||||
|
||||
if @opts.ci_status is ''
|
||||
@opts.ci_status = data.status
|
||||
if data.status is ''
|
||||
return
|
||||
|
||||
if data.status isnt @opts.ci_status and data.status?
|
||||
if @firstCiCheck || data.status isnt @opts.ci_status and data.status?
|
||||
@opts.ci_status = data.status
|
||||
@showCIStatus data.status
|
||||
if data.coverage
|
||||
@showCICoverage data.coverage
|
||||
|
||||
if showNotification
|
||||
# The first check should only update the UI, a notification
|
||||
# should only be displayed on status changes
|
||||
if showNotification and not @firstCiCheck
|
||||
status = @ciLabelForStatus(data.status)
|
||||
|
||||
if status is "preparing"
|
||||
|
@ -104,8 +102,7 @@ class @MergeRequestWidget
|
|||
@close()
|
||||
Turbolinks.visit _this.opts.builds_path
|
||||
)
|
||||
|
||||
@opts.ci_status = data.status
|
||||
@firstCiCheck = false
|
||||
|
||||
showCIStatus: (state) ->
|
||||
$('.ci_widget').hide()
|
||||
|
|
|
@ -167,8 +167,8 @@ class @Notes
|
|||
return
|
||||
|
||||
if note.award
|
||||
awards_handler.addAwardToEmojiBar(note.note)
|
||||
awards_handler.scrollToAwards()
|
||||
awardsHandler.addAwardToEmojiBar(note.note)
|
||||
awardsHandler.scrollToAwards()
|
||||
|
||||
# render note if it not present in loaded list
|
||||
# or skip if rendered
|
||||
|
@ -373,11 +373,11 @@ class @Notes
|
|||
|
||||
new GLForm form
|
||||
if scrollTo? and myLastNote?
|
||||
# scroll to the bottom
|
||||
# scroll to the bottom
|
||||
# so the open of the last element doesn't make a jump
|
||||
$('html, body').scrollTop($(document).height());
|
||||
$('html, body').animate({
|
||||
scrollTop: myLastNote.offset().top - 150
|
||||
scrollTop: myLastNote.offset().top - 150
|
||||
}, 500, ->
|
||||
$noteText = form.find(".js-note-text")
|
||||
$noteText.focus()
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
@import "framework/lists.scss";
|
||||
@import "framework/markdown_area.scss";
|
||||
@import "framework/mobile.scss";
|
||||
@import "framework/modal.scss";
|
||||
@import "framework/nav.scss";
|
||||
@import "framework/pagination.scss";
|
||||
@import "framework/progress.scss";
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
&.s46 { width: 46px; height: 46px; margin-right: 15px; }
|
||||
&.s48 { width: 48px; height: 48px; margin-right: 10px; }
|
||||
&.s60 { width: 60px; height: 60px; margin-right: 12px; }
|
||||
&.s70 { width: 70px; height: 70px; margin-right: 14px; }
|
||||
&.s90 { width: 90px; height: 90px; margin-right: 15px; }
|
||||
&.s110 { width: 110px; height: 110px; margin-right: 15px; }
|
||||
&.s140 { width: 140px; height: 140px; margin-right: 20px; }
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
line-height: 36px;
|
||||
}
|
||||
|
||||
.gray-content-block {
|
||||
.row-content-block {
|
||||
margin-top: 0;
|
||||
margin-bottom: -$gl-padding;
|
||||
background-color: $background-color;
|
||||
|
@ -81,6 +81,11 @@
|
|||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
&.build-content {
|
||||
background-color: $white-light;
|
||||
border-top: none;
|
||||
}
|
||||
}
|
||||
|
||||
.cover-block {
|
||||
|
@ -113,7 +118,7 @@
|
|||
line-height: 1.1;
|
||||
|
||||
h1 {
|
||||
color: #313236;
|
||||
color: $gl-gray-dark;
|
||||
margin-bottom: 6px;
|
||||
font-size: 23px;
|
||||
}
|
||||
|
@ -150,6 +155,41 @@
|
|||
right: auto;
|
||||
}
|
||||
}
|
||||
|
||||
&.groups-cover-block {
|
||||
background: $white-light;
|
||||
border-bottom: 1px solid $border-color;
|
||||
text-align: left;
|
||||
padding: 24px 0;
|
||||
|
||||
.group-info {
|
||||
.cover-title {
|
||||
margin-top: 9px;
|
||||
}
|
||||
|
||||
p {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: $screen-xs-max) {
|
||||
text-align: center;
|
||||
|
||||
.avatar {
|
||||
float: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.group-info {
|
||||
|
||||
h1 {
|
||||
display: inline;
|
||||
font-weight: normal;
|
||||
font-size: 24px;
|
||||
color: $gl-title-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.block-connector {
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
}
|
||||
|
||||
@mixin btn-gray {
|
||||
@include btn-color($gray-light, $border-gray-light, $gray-normal, $border-gray-light, $gray-dark, $border-gray-dark, #313236);
|
||||
@include btn-color($gray-light, $border-gray-light, $gray-normal, $border-gray-light, $gray-dark, $border-gray-dark, $gl-gray-dark);
|
||||
}
|
||||
|
||||
@mixin btn-white {
|
||||
|
@ -251,3 +251,10 @@
|
|||
.btn-file-option {
|
||||
background: linear-gradient(180deg, $white-light 25%, $gray-light 100%);
|
||||
}
|
||||
|
||||
.btn-build {
|
||||
margin-left: 10px;
|
||||
i {
|
||||
color: $gl-icon-color;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,6 +30,10 @@ header {
|
|||
border: none;
|
||||
border-bottom: 1px solid $border-color;
|
||||
|
||||
&.with-horizontal-nav {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.container-fluid {
|
||||
width: 100% !important;
|
||||
filter: none;
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
}
|
||||
|
||||
.rss-btn {
|
||||
display: none !important;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.project-home-links {
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
.modal-body {
|
||||
position: relative;
|
||||
overflow-y: auto;
|
||||
padding: 15px;
|
||||
|
||||
.form-actions {
|
||||
margin: -$gl-padding+1;
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
.text-danger {
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
body.modal-open {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.modal .modal-dialog {
|
||||
width: 860px;
|
||||
}
|
|
@ -26,8 +26,8 @@
|
|||
}
|
||||
|
||||
&.active a {
|
||||
color: #000;
|
||||
border-bottom: 2px solid #4688f1;
|
||||
border-bottom: 2px solid $link-underline-blue;
|
||||
color: $black;
|
||||
}
|
||||
|
||||
.badge {
|
||||
|
@ -140,6 +140,12 @@
|
|||
}
|
||||
}
|
||||
|
||||
.project-filter-form {
|
||||
input {
|
||||
background-color: $background-color;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: $screen-xs-max) {
|
||||
padding-bottom: 0;
|
||||
|
||||
|
@ -187,13 +193,31 @@
|
|||
}
|
||||
|
||||
.layout-nav {
|
||||
position: fixed;
|
||||
top: $header-height;
|
||||
width: 100%;
|
||||
z-index: 1;
|
||||
background: $background-color;
|
||||
border-bottom: 1px solid $border-color;
|
||||
transition-duration: .3s;
|
||||
|
||||
.controls {
|
||||
float: right;
|
||||
position: relative;
|
||||
top: 10px;
|
||||
padding: 7px 5px 0 0;
|
||||
|
||||
i {
|
||||
color: $layout-link-gray;
|
||||
}
|
||||
|
||||
.fa-rss,
|
||||
.fa-cog {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.fa-caret-down {
|
||||
margin-left: 5px;
|
||||
color: $gl-icon-color;
|
||||
}
|
||||
|
||||
.dropdown {
|
||||
margin-left: 7px;
|
||||
|
@ -202,5 +226,34 @@
|
|||
|
||||
.nav-links {
|
||||
border-bottom: none;
|
||||
height: 51px;
|
||||
white-space: nowrap;
|
||||
overflow-x: auto;
|
||||
|
||||
li {
|
||||
|
||||
a {
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
a, i {
|
||||
color: $layout-link-gray;
|
||||
}
|
||||
|
||||
&.active {
|
||||
a, i {
|
||||
color: $black;
|
||||
}
|
||||
}
|
||||
|
||||
.badge {
|
||||
color: $gl-icon-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.page-with-layout-nav {
|
||||
margin-top: 50px;
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
position: absolute;
|
||||
width: 58px;
|
||||
cursor: pointer;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.page-with-sidebar {
|
||||
|
@ -62,7 +63,7 @@
|
|||
float: left;
|
||||
height: $header-height;
|
||||
width: 100%;
|
||||
padding: 11px 0 11px 22px;
|
||||
padding-left: 22px;
|
||||
overflow: hidden;
|
||||
outline: none;
|
||||
transition-duration: .3s;
|
||||
|
@ -85,7 +86,7 @@
|
|||
margin: 0;
|
||||
margin-left: 50px;
|
||||
font-size: 19px;
|
||||
line-height: 41px;
|
||||
line-height: 50px;
|
||||
font-weight: normal;
|
||||
}
|
||||
}
|
||||
|
@ -254,6 +255,10 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.layout-nav {
|
||||
padding-right: $sidebar_collapsed_width;
|
||||
}
|
||||
}
|
||||
|
||||
.page-sidebar-expanded {
|
||||
|
@ -280,6 +285,10 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.layout-nav {
|
||||
padding-right: $sidebar_width;
|
||||
}
|
||||
}
|
||||
|
||||
.right-sidebar-collapsed {
|
||||
|
|
|
@ -32,13 +32,11 @@ table {
|
|||
th {
|
||||
background-color: $background-color;
|
||||
font-weight: normal;
|
||||
font-size: 15px;
|
||||
border-bottom: 1px solid $border-color;
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
td {
|
||||
border-color: $table-border-color;
|
||||
border-bottom: 1px solid $border-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@
|
|||
|
||||
// Labels
|
||||
.label {
|
||||
padding: 2px 4px;
|
||||
padding: 4px 5px;
|
||||
font-size: 13px;
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
|
|
|
@ -42,14 +42,14 @@
|
|||
margin: 24px 0 12px;
|
||||
padding: 0 0 10px;
|
||||
border-bottom: 1px solid #e7e9ed;
|
||||
color: #313236;
|
||||
color: $gl-gray-dark;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 1.2em;
|
||||
font-weight: 600;
|
||||
margin: 24px 0 12px;
|
||||
color: #313236;
|
||||
color: $gl-gray-dark;
|
||||
}
|
||||
|
||||
h3 {
|
||||
|
|
|
@ -12,7 +12,7 @@ $gutter_inner_width: 258px;
|
|||
*/
|
||||
$border-color: #e5e5e5;
|
||||
$focus-border-color: #3aabf0;
|
||||
$table-border-color: #eef0f2;
|
||||
$table-border-color: #ececec;
|
||||
$background-color: #fafafa;
|
||||
|
||||
/*
|
||||
|
@ -20,7 +20,7 @@ $background-color: #fafafa;
|
|||
*/
|
||||
$gl-font-size: 15px;
|
||||
$gl-title-color: #333;
|
||||
$gl-text-color: #555;
|
||||
$gl-text-color: #5c5c5c;
|
||||
$gl-text-green: #4a2;
|
||||
$gl-text-red: #d12f19;
|
||||
$gl-text-orange: #d90;
|
||||
|
@ -30,6 +30,7 @@ $gl-placeholder-color: #8f8f8f;
|
|||
$gl-icon-color: $gl-placeholder-color;
|
||||
$gl-grayish-blue: #7f8fa4;
|
||||
$gl-gray: $gl-text-color;
|
||||
$gl-gray-dark: #313236;
|
||||
$gl-header-color: $gl-title-color;
|
||||
|
||||
/*
|
||||
|
@ -65,7 +66,7 @@ $gl-padding-top: 10px;
|
|||
$row-hover: #f4f8fe;
|
||||
$progress-color: #c0392b;
|
||||
$avatar_radius: 50%;
|
||||
$header-height: 58px;
|
||||
$header-height: 50px;
|
||||
$fixed-layout-width: 1280px;
|
||||
$gl-avatar-size: 40px;
|
||||
$error-exclamation-point: #e62958;
|
||||
|
@ -74,6 +75,9 @@ $btn-transparent-color: #8f8f8f;
|
|||
$settings-icon-size: 18px;
|
||||
$provider-btn-group-border: #e5e5e5;
|
||||
$provider-btn-not-active-color: #4688f1;
|
||||
$link-underline-blue: #4a8bee;
|
||||
$layout-link-gray: #7e7c7c;
|
||||
$todo-alert-blue: #428bca;
|
||||
|
||||
/*
|
||||
* Color schema
|
||||
|
@ -108,6 +112,7 @@ $red-light: #e52c5a;
|
|||
$red-normal: #d22852;
|
||||
$red-dark: darken($red-normal, 5%);
|
||||
|
||||
$black: #000;
|
||||
$black-transparent: rgba(0, 0, 0, 0.3);
|
||||
|
||||
$border-white-light: #f1f2f4;
|
||||
|
|
|
@ -83,3 +83,12 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
table.builds {
|
||||
|
||||
.build-link {
|
||||
a {
|
||||
color: $gl-dark-link-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,9 +31,23 @@
|
|||
}
|
||||
.commit-committer-link,
|
||||
.commit-author-link {
|
||||
color: #444;
|
||||
color: $gl-gray;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.time_ago {
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
.fa-clipboard {
|
||||
color: $dropdown-title-btn-color;
|
||||
}
|
||||
|
||||
.commit-info {
|
||||
&.branches {
|
||||
margin-left: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.commit-box {
|
||||
|
@ -42,7 +56,7 @@
|
|||
.commit-title {
|
||||
margin: 0;
|
||||
font-size: 23px;
|
||||
color: #313236;
|
||||
color: $gl-gray-dark;
|
||||
}
|
||||
|
||||
.commit-description {
|
||||
|
@ -83,6 +97,14 @@
|
|||
}
|
||||
}
|
||||
|
||||
.commit-action-buttons {
|
||||
i {
|
||||
color: $gl-icon-color;
|
||||
font-size: 13px;
|
||||
margin-right: 3px;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Commit message textarea for web editor and
|
||||
* custom merge request message
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
.title {
|
||||
margin: 0;
|
||||
font-size: 23px;
|
||||
color: #313236;
|
||||
color: $gl-gray-dark;
|
||||
}
|
||||
|
||||
.description {
|
||||
|
|
|
@ -55,25 +55,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
.modal-body {
|
||||
position: relative;
|
||||
overflow-y: auto;
|
||||
padding: 15px;
|
||||
|
||||
.form-actions {
|
||||
margin: -$gl-padding+1;
|
||||
margin-top: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
body.modal-open {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.modal .modal-dialog {
|
||||
width: 860px;
|
||||
}
|
||||
|
||||
.documentation {
|
||||
padding: 7px;
|
||||
}
|
||||
|
|
|
@ -104,7 +104,7 @@
|
|||
font-weight: 600;
|
||||
font-size: 17px;
|
||||
margin: 5px 0;
|
||||
color: #313236;
|
||||
color: $gl-gray-dark;
|
||||
}
|
||||
|
||||
p:last-child {
|
||||
|
@ -136,7 +136,7 @@
|
|||
}
|
||||
|
||||
.label-branch {
|
||||
color: #313236;
|
||||
color: $gl-gray-dark;
|
||||
font-family: $monospace_font;
|
||||
font-weight: bold;
|
||||
overflow: hidden;
|
||||
|
@ -272,3 +272,19 @@
|
|||
display: inline-block;
|
||||
width: 250px;
|
||||
}
|
||||
|
||||
.table-holder {
|
||||
.builds {
|
||||
|
||||
th {
|
||||
background-color: $white-light;
|
||||
color: $gl-placeholder-color;
|
||||
}
|
||||
|
||||
th,
|
||||
td {
|
||||
padding: 16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ li.milestone {
|
|||
|
||||
// Issue title
|
||||
span a {
|
||||
color: rgba(0,0,0,0.64);
|
||||
color: $gl-text-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ li.milestone {
|
|||
margin-top: 7px;
|
||||
|
||||
.issuable-number {
|
||||
color: rgba(0,0,0,0.44);
|
||||
color: $gl-placeholder-color;
|
||||
margin-right: 5px;
|
||||
}
|
||||
.avatar {
|
||||
|
|
|
@ -114,10 +114,6 @@ ul.notes {
|
|||
word-break: keep-all;
|
||||
}
|
||||
}
|
||||
|
||||
a {
|
||||
word-break: break-all;
|
||||
}
|
||||
}
|
||||
|
||||
.note-header {
|
||||
|
@ -172,6 +168,11 @@ ul.notes {
|
|||
.notes {
|
||||
background-color: $white-light;
|
||||
}
|
||||
|
||||
a code {
|
||||
top: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -205,3 +205,21 @@
|
|||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.user-profile {
|
||||
@media (max-width: $screen-xs-max) {
|
||||
.cover-block {
|
||||
padding-top: 20px;
|
||||
}
|
||||
|
||||
.cover-controls {
|
||||
position: static;
|
||||
margin-bottom: 20px;
|
||||
|
||||
.btn {
|
||||
display: inline-block;
|
||||
width: 48%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -178,7 +178,7 @@
|
|||
.option-title {
|
||||
font-weight: normal;
|
||||
display: inline-block;
|
||||
color: #313236;
|
||||
color: $gl-gray-dark;
|
||||
}
|
||||
|
||||
.option-descr {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.container-fluid {
|
||||
.ci-status {
|
||||
padding: 2px 7px;
|
||||
margin-right: 5px;
|
||||
margin-right: 10px;
|
||||
border: 1px solid #eee;
|
||||
white-space: nowrap;
|
||||
@include border-radius(4px);
|
||||
|
|
|
@ -6,9 +6,16 @@
|
|||
.navbar-nav {
|
||||
li {
|
||||
.badge.todos-pending-count {
|
||||
background-color: $gl-icon-color;
|
||||
margin-top: -5px;
|
||||
font-weight: normal;
|
||||
background: $todo-alert-blue;
|
||||
margin-left: -17px;
|
||||
font-size: 11px;
|
||||
color: white;
|
||||
padding: 3px;
|
||||
padding-top: 1px;
|
||||
padding-bottom: 1px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
tr {
|
||||
> td, > th {
|
||||
line-height: 26px;
|
||||
line-height: 23px;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
|
|
|
@ -6,12 +6,6 @@ class Admin::ApplicationController < ApplicationController
|
|||
layout 'admin'
|
||||
|
||||
def authenticate_admin!
|
||||
return render_404 unless current_user.is_admin?
|
||||
end
|
||||
|
||||
def authorize_impersonator!
|
||||
if session[:impersonator_id]
|
||||
User.find_by!(username: session[:impersonator_id]).admin?
|
||||
end
|
||||
render_404 unless current_user.is_admin?
|
||||
end
|
||||
end
|
||||
|
|
|
@ -39,6 +39,12 @@ class Admin::HooksController < Admin::ApplicationController
|
|||
end
|
||||
|
||||
def hook_params
|
||||
params.require(:hook).permit(:url, :enable_ssl_verification, :push_events, :tag_push_events)
|
||||
params.require(:hook).permit(
|
||||
:enable_ssl_verification,
|
||||
:push_events,
|
||||
:tag_push_events,
|
||||
:token,
|
||||
:url
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
class Admin::ImpersonationController < Admin::ApplicationController
|
||||
skip_before_action :authenticate_admin!, only: :destroy
|
||||
|
||||
before_action :user
|
||||
before_action :authorize_impersonator!
|
||||
|
||||
def create
|
||||
if @user.blocked?
|
||||
flash[:alert] = "You cannot impersonate a blocked user"
|
||||
|
||||
redirect_to admin_user_path(@user)
|
||||
else
|
||||
session[:impersonator_id] = current_user.username
|
||||
session[:impersonator_return_to] = admin_user_path(@user)
|
||||
|
||||
warden.set_user(user, scope: 'user')
|
||||
|
||||
flash[:alert] = "You are impersonating #{user.username}."
|
||||
|
||||
redirect_to root_path
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
redirect = session[:impersonator_return_to]
|
||||
|
||||
warden.set_user(user, scope: 'user')
|
||||
|
||||
session[:impersonator_return_to] = nil
|
||||
session[:impersonator_id] = nil
|
||||
|
||||
redirect_to redirect || root_path
|
||||
end
|
||||
|
||||
def user
|
||||
@user ||= User.find_by!(username: params[:id] || session[:impersonator_id])
|
||||
end
|
||||
end
|
|
@ -0,0 +1,26 @@
|
|||
class Admin::ImpersonationsController < Admin::ApplicationController
|
||||
skip_before_action :authenticate_admin!
|
||||
before_action :authenticate_impersonator!
|
||||
|
||||
def destroy
|
||||
original_user = current_user
|
||||
|
||||
warden.set_user(impersonator, scope: :user)
|
||||
|
||||
Gitlab::AppLogger.info("User #{original_user.username} has stopped impersonating #{impersonator.username}")
|
||||
|
||||
session[:impersonator_id] = nil
|
||||
|
||||
redirect_to admin_user_path(original_user)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def impersonator
|
||||
@impersonator ||= User.find(session[:impersonator_id]) if session[:impersonator_id]
|
||||
end
|
||||
|
||||
def authenticate_impersonator!
|
||||
render_404 unless impersonator && impersonator.is_admin? && !impersonator.blocked?
|
||||
end
|
||||
end
|
|
@ -31,6 +31,24 @@ class Admin::UsersController < Admin::ApplicationController
|
|||
user
|
||||
end
|
||||
|
||||
def impersonate
|
||||
if user.blocked?
|
||||
flash[:alert] = "You cannot impersonate a blocked user"
|
||||
|
||||
redirect_to admin_user_path(user)
|
||||
else
|
||||
session[:impersonator_id] = current_user.id
|
||||
|
||||
warden.set_user(user, scope: :user)
|
||||
|
||||
Gitlab::AppLogger.info("User #{current_user.username} has started impersonating #{user.username}")
|
||||
|
||||
flash[:alert] = "You are now impersonating #{user.username}"
|
||||
|
||||
redirect_to root_path
|
||||
end
|
||||
end
|
||||
|
||||
def block
|
||||
if user.block
|
||||
redirect_back_or_admin_user(notice: "Successfully blocked")
|
||||
|
|
|
@ -117,7 +117,7 @@ class ApplicationController < ActionController::Base
|
|||
end
|
||||
|
||||
def after_sign_out_path_for(resource)
|
||||
current_application_settings.after_sign_out_path || new_user_session_path
|
||||
current_application_settings.after_sign_out_path.presence || new_user_session_path
|
||||
end
|
||||
|
||||
def abilities
|
||||
|
|
|
@ -15,7 +15,7 @@ class Projects::CommitsController < Projects::ApplicationController
|
|||
if search.present?
|
||||
@repository.find_commits_by_message(search, @ref, @path, @limit, @offset).compact
|
||||
else
|
||||
@repository.commits(@ref, @path, @limit, @offset)
|
||||
@repository.commits(@ref, path: @path, limit: @limit, offset: @offset)
|
||||
end
|
||||
|
||||
@note_counts = project.notes.where(commit_id: @commits.map(&:id)).
|
||||
|
|
|
@ -17,7 +17,7 @@ class Projects::GraphsController < Projects::ApplicationController
|
|||
end
|
||||
|
||||
def commits
|
||||
@commits = @project.repository.commits(@ref, nil, 2000, 0, true)
|
||||
@commits = @project.repository.commits(@ref, limit: 2000, skip_merges: true)
|
||||
@commits_graph = Gitlab::Graphs::Commits.new(@commits)
|
||||
@commits_per_week_days = @commits_graph.commits_per_week_days
|
||||
@commits_per_time = @commits_graph.commits_per_time
|
||||
|
@ -55,7 +55,7 @@ class Projects::GraphsController < Projects::ApplicationController
|
|||
private
|
||||
|
||||
def fetch_graph
|
||||
@commits = @project.repository.commits(@ref, nil, 6000, 0, true)
|
||||
@commits = @project.repository.commits(@ref, limit: 6000, skip_merges: true)
|
||||
@log = []
|
||||
|
||||
@commits.each do |commit|
|
||||
|
|
|
@ -52,8 +52,16 @@ class Projects::HooksController < Projects::ApplicationController
|
|||
end
|
||||
|
||||
def hook_params
|
||||
params.require(:hook).permit(:url, :push_events, :issues_events,
|
||||
:merge_requests_events, :tag_push_events, :note_events,
|
||||
:build_events, :enable_ssl_verification)
|
||||
params.require(:hook).permit(
|
||||
:build_events,
|
||||
:enable_ssl_verification,
|
||||
:issues_events,
|
||||
:merge_requests_events,
|
||||
:note_events,
|
||||
:push_events,
|
||||
:tag_push_events,
|
||||
:token,
|
||||
:url
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -96,6 +96,8 @@ class Projects::IssuesController < Projects::ApplicationController
|
|||
|
||||
if params[:move_to_project_id].to_i > 0
|
||||
new_project = Project.find(params[:move_to_project_id])
|
||||
return render_404 unless issue.can_move?(current_user, new_project)
|
||||
|
||||
move_service = Issues::MoveService.new(project, current_user)
|
||||
@issue = move_service.execute(@issue, new_project)
|
||||
end
|
||||
|
|
|
@ -40,10 +40,10 @@ class Projects::WikisController < Projects::ApplicationController
|
|||
end
|
||||
|
||||
def update
|
||||
@page = @project_wiki.find_page(params[:id])
|
||||
|
||||
return render('empty') unless can?(current_user, :create_wiki, @project)
|
||||
|
||||
@page = @project_wiki.find_page(params[:id])
|
||||
|
||||
if @page = WikiPages::UpdateService.new(@project, current_user, wiki_params).execute(@page)
|
||||
redirect_to(
|
||||
namespace_project_wiki_path(@project.namespace, @project, @page),
|
||||
|
|
|
@ -8,6 +8,13 @@ class RegistrationsController < Devise::RegistrationsController
|
|||
|
||||
def create
|
||||
if !Gitlab::Recaptcha.load_configurations! || verify_recaptcha
|
||||
# To avoid duplicate form fields on the login page, the registration form
|
||||
# names fields using `new_user`, but Devise still wants the params in
|
||||
# `user`.
|
||||
if params["new_#{resource_name}"].present? && params[resource_name].blank?
|
||||
params[resource_name] = params.delete(:"new_#{resource_name}")
|
||||
end
|
||||
|
||||
super
|
||||
else
|
||||
flash[:alert] = "There was an error with the reCAPTCHA code below. Please re-enter the code."
|
||||
|
|
|
@ -51,7 +51,7 @@ class SnippetsFinder
|
|||
snippets = project.snippets.fresh
|
||||
|
||||
if current_user
|
||||
if project.team.member?(current_user.id)
|
||||
if project.team.member?(current_user.id) || current_user.admin?
|
||||
snippets
|
||||
else
|
||||
snippets.public_and_internal
|
||||
|
|
|
@ -131,7 +131,7 @@ module BlobHelper
|
|||
# elements and attributes. Note that this whitelist is by no means complete
|
||||
# and may omit some elements.
|
||||
def sanitize_svg(blob)
|
||||
blob.data = Loofah.scrub_fragment(blob.data, :strip).to_xml
|
||||
blob.data = Gitlab::Sanitizers::SVG.clean(blob.data)
|
||||
blob
|
||||
end
|
||||
|
||||
|
|
|
@ -16,31 +16,49 @@ module IssuesHelper
|
|||
def url_for_project_issues(project = @project, options = {})
|
||||
return '' if project.nil?
|
||||
|
||||
if options[:only_path]
|
||||
project.issues_tracker.project_path
|
||||
else
|
||||
project.issues_tracker.project_url
|
||||
end
|
||||
url =
|
||||
if options[:only_path]
|
||||
project.issues_tracker.project_path
|
||||
else
|
||||
project.issues_tracker.project_url
|
||||
end
|
||||
|
||||
# Ensure we return a valid URL to prevent possible XSS.
|
||||
URI.parse(url).to_s
|
||||
rescue URI::InvalidURIError
|
||||
''
|
||||
end
|
||||
|
||||
def url_for_new_issue(project = @project, options = {})
|
||||
return '' if project.nil?
|
||||
|
||||
if options[:only_path]
|
||||
project.issues_tracker.new_issue_path
|
||||
else
|
||||
project.issues_tracker.new_issue_url
|
||||
end
|
||||
url =
|
||||
if options[:only_path]
|
||||
project.issues_tracker.new_issue_path
|
||||
else
|
||||
project.issues_tracker.new_issue_url
|
||||
end
|
||||
|
||||
# Ensure we return a valid URL to prevent possible XSS.
|
||||
URI.parse(url).to_s
|
||||
rescue URI::InvalidURIError
|
||||
''
|
||||
end
|
||||
|
||||
def url_for_issue(issue_iid, project = @project, options = {})
|
||||
return '' if project.nil?
|
||||
|
||||
if options[:only_path]
|
||||
project.issues_tracker.issue_path(issue_iid)
|
||||
else
|
||||
project.issues_tracker.issue_url(issue_iid)
|
||||
end
|
||||
url =
|
||||
if options[:only_path]
|
||||
project.issues_tracker.issue_path(issue_iid)
|
||||
else
|
||||
project.issues_tracker.issue_url(issue_iid)
|
||||
end
|
||||
|
||||
# Ensure we return a valid URL to prevent possible XSS.
|
||||
URI.parse(url).to_s
|
||||
rescue URI::InvalidURIError
|
||||
''
|
||||
end
|
||||
|
||||
def bulk_update_milestone_options
|
||||
|
|
|
@ -34,10 +34,13 @@ module NavHelper
|
|||
end
|
||||
|
||||
def nav_header_class
|
||||
if nav_menu_collapsed?
|
||||
"header-collapsed"
|
||||
else
|
||||
"header-expanded"
|
||||
end
|
||||
class_name =
|
||||
if nav_menu_collapsed?
|
||||
"header-collapsed"
|
||||
else
|
||||
"header-expanded"
|
||||
end
|
||||
class_name += " with-horizontal-nav" if defined?(nav) && nav
|
||||
class_name
|
||||
end
|
||||
end
|
||||
|
|
|
@ -200,12 +200,8 @@ module ProjectsHelper
|
|||
end
|
||||
|
||||
def repository_size(project = @project)
|
||||
"#{project.repository_size} MB"
|
||||
rescue
|
||||
# In order to prevent 500 error
|
||||
# when application cannot allocate memory
|
||||
# to calculate repo size - just show 'Unknown'
|
||||
'unknown'
|
||||
size_in_bytes = project.repository_size * 1.megabyte
|
||||
number_to_human_size(size_in_bytes, delimiter: ',', precision: 2)
|
||||
end
|
||||
|
||||
def default_url_to_repo(project = @project)
|
||||
|
@ -341,4 +337,10 @@ module ProjectsHelper
|
|||
)
|
||||
end
|
||||
end
|
||||
|
||||
def sanitize_repo_path(message)
|
||||
return '' unless message.present?
|
||||
|
||||
message.strip.gsub(Gitlab.config.gitlab_shell.repos_path.chomp('/'), "[REPOS PATH]")
|
||||
end
|
||||
end
|
||||
|
|
|
@ -28,6 +28,14 @@ module Emails
|
|||
mail_answer_thread(@merge_request, note_thread_options(recipient_id))
|
||||
end
|
||||
|
||||
def note_snippet_email(recipient_id, note_id)
|
||||
setup_note_mail(note_id, recipient_id)
|
||||
|
||||
@snippet = @note.noteable
|
||||
@target_url = namespace_project_snippet_url(*note_target_url_options)
|
||||
mail_answer_thread(@snippet, note_thread_options(recipient_id))
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def note_target_url_options
|
||||
|
|
|
@ -1,3 +1,16 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: appearances
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# title :string
|
||||
# description :text
|
||||
# header_logo :string
|
||||
# logo :string
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
#
|
||||
|
||||
class Appearance < ActiveRecord::Base
|
||||
validates :title, presence: true
|
||||
validates :description, presence: true
|
||||
|
|
|
@ -10,21 +10,20 @@
|
|||
# sign_in_text :text
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# home_page_url :string(255)
|
||||
# home_page_url :string
|
||||
# default_branch_protection :integer default(2)
|
||||
# restricted_visibility_levels :text
|
||||
# version_check_enabled :boolean default(TRUE)
|
||||
# max_attachment_size :integer default(10), not null
|
||||
# default_project_visibility :integer
|
||||
# default_snippet_visibility :integer
|
||||
# default_group_visibility :integer
|
||||
# restricted_signup_domains :text
|
||||
# user_oauth_applications :boolean default(TRUE)
|
||||
# after_sign_out_path :string(255)
|
||||
# after_sign_out_path :string
|
||||
# session_expire_delay :integer default(10080), not null
|
||||
# import_sources :text
|
||||
# help_page_text :text
|
||||
# admin_notification_email :string(255)
|
||||
# admin_notification_email :string
|
||||
# shared_runners_enabled :boolean default(TRUE), not null
|
||||
# max_artifacts_size :integer default(100), not null
|
||||
# runners_registration_token :string
|
||||
|
@ -32,8 +31,6 @@
|
|||
# two_factor_grace_period :integer default(48)
|
||||
# metrics_enabled :boolean default(FALSE)
|
||||
# metrics_host :string default("localhost")
|
||||
# metrics_username :string
|
||||
# metrics_password :string
|
||||
# metrics_pool_size :integer default(16)
|
||||
# metrics_timeout :integer default(10)
|
||||
# metrics_method_call_threshold :integer default(10)
|
||||
|
@ -41,9 +38,16 @@
|
|||
# recaptcha_site_key :string
|
||||
# recaptcha_private_key :string
|
||||
# metrics_port :integer default(8089)
|
||||
# metrics_sample_interval :integer default(15)
|
||||
# sentry_enabled :boolean default(FALSE)
|
||||
# sentry_dsn :string
|
||||
# akismet_enabled :boolean default(FALSE)
|
||||
# akismet_api_key :string
|
||||
# email_author_in_body :boolean default(FALSE)
|
||||
# default_group_visibility :integer
|
||||
# repository_checks_enabled :boolean default(FALSE)
|
||||
# metrics_packet_size :integer default(1)
|
||||
# shared_runners_text :text
|
||||
#
|
||||
|
||||
class ApplicationSetting < ActiveRecord::Base
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
#
|
||||
# id :integer not null, primary key
|
||||
# author_id :integer not null
|
||||
# type :string(255) not null
|
||||
# type :string not null
|
||||
# entity_id :integer not null
|
||||
# entity_type :string(255) not null
|
||||
# entity_type :string not null
|
||||
# details :text
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
# ends_at :datetime
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# color :string(255)
|
||||
# font :string(255)
|
||||
# color :string
|
||||
# font :string
|
||||
#
|
||||
|
||||
class BroadcastMessage < ActiveRecord::Base
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#
|
||||
# id :integer not null, primary key
|
||||
# project_id :integer
|
||||
# status :string(255)
|
||||
# status :string
|
||||
# finished_at :datetime
|
||||
# trace :text
|
||||
# created_at :datetime
|
||||
|
@ -15,19 +15,19 @@
|
|||
# commit_id :integer
|
||||
# commands :text
|
||||
# job_id :integer
|
||||
# name :string(255)
|
||||
# name :string
|
||||
# deploy :boolean default(FALSE)
|
||||
# options :text
|
||||
# allow_failure :boolean default(FALSE), not null
|
||||
# stage :string(255)
|
||||
# stage :string
|
||||
# trigger_request_id :integer
|
||||
# stage_idx :integer
|
||||
# tag :boolean
|
||||
# ref :string(255)
|
||||
# ref :string
|
||||
# user_id :integer
|
||||
# type :string(255)
|
||||
# target_url :string(255)
|
||||
# description :string(255)
|
||||
# type :string
|
||||
# target_url :string
|
||||
# description :string
|
||||
# artifacts_file :text
|
||||
# gl_project_id :integer
|
||||
# artifacts_metadata :text
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
#
|
||||
# id :integer not null, primary key
|
||||
# project_id :integer
|
||||
# ref :string(255)
|
||||
# sha :string(255)
|
||||
# before_sha :string(255)
|
||||
# ref :string
|
||||
# sha :string
|
||||
# before_sha :string
|
||||
# push_data :text
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
|
@ -14,6 +14,10 @@
|
|||
# yaml_errors :text
|
||||
# committed_at :datetime
|
||||
# gl_project_id :integer
|
||||
# status :string
|
||||
# started_at :datetime
|
||||
# finished_at :datetime
|
||||
# duration :integer
|
||||
#
|
||||
|
||||
module Ci
|
||||
|
|
|
@ -3,18 +3,18 @@
|
|||
# Table name: ci_runners
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# token :string(255)
|
||||
# token :string
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# description :string(255)
|
||||
# description :string
|
||||
# contacted_at :datetime
|
||||
# active :boolean default(TRUE), not null
|
||||
# is_shared :boolean default(FALSE)
|
||||
# name :string(255)
|
||||
# version :string(255)
|
||||
# revision :string(255)
|
||||
# platform :string(255)
|
||||
# architecture :string(255)
|
||||
# name :string
|
||||
# version :string
|
||||
# revision :string
|
||||
# platform :string
|
||||
# architecture :string
|
||||
#
|
||||
|
||||
module Ci
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# Table name: ci_triggers
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# token :string(255)
|
||||
# token :string
|
||||
# project_id :integer
|
||||
# deleted_at :datetime
|
||||
# created_at :datetime
|
||||
|
|
|
@ -4,11 +4,11 @@
|
|||
#
|
||||
# id :integer not null, primary key
|
||||
# project_id :integer
|
||||
# key :string(255)
|
||||
# key :string
|
||||
# value :text
|
||||
# encrypted_value :text
|
||||
# encrypted_value_salt :string(255)
|
||||
# encrypted_value_iv :string(255)
|
||||
# encrypted_value_salt :string
|
||||
# encrypted_value_iv :string
|
||||
# gl_project_id :integer
|
||||
#
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#
|
||||
# id :integer not null, primary key
|
||||
# project_id :integer
|
||||
# status :string(255)
|
||||
# status :string
|
||||
# finished_at :datetime
|
||||
# trace :text
|
||||
# created_at :datetime
|
||||
|
@ -15,21 +15,24 @@
|
|||
# commit_id :integer
|
||||
# commands :text
|
||||
# job_id :integer
|
||||
# name :string(255)
|
||||
# name :string
|
||||
# deploy :boolean default(FALSE)
|
||||
# options :text
|
||||
# allow_failure :boolean default(FALSE), not null
|
||||
# stage :string(255)
|
||||
# stage :string
|
||||
# trigger_request_id :integer
|
||||
# stage_idx :integer
|
||||
# tag :boolean
|
||||
# ref :string(255)
|
||||
# ref :string
|
||||
# user_id :integer
|
||||
# type :string(255)
|
||||
# target_url :string(255)
|
||||
# description :string(255)
|
||||
# type :string
|
||||
# target_url :string
|
||||
# description :string
|
||||
# artifacts_file :text
|
||||
# gl_project_id :integer
|
||||
# artifacts_metadata :text
|
||||
# erased_by_id :integer
|
||||
# erased_at :datetime
|
||||
#
|
||||
|
||||
class CommitStatus < ActiveRecord::Base
|
||||
|
|
|
@ -35,13 +35,14 @@ module Issuable
|
|||
scope :only_opened, -> { with_state(:opened) }
|
||||
scope :only_reopened, -> { with_state(:reopened) }
|
||||
scope :closed, -> { with_state(:closed) }
|
||||
scope :order_milestone_due_desc, -> { joins(:milestone).reorder('milestones.due_date DESC, milestones.id DESC') }
|
||||
scope :order_milestone_due_asc, -> { joins(:milestone).reorder('milestones.due_date ASC, milestones.id ASC') }
|
||||
scope :order_milestone_due_desc, -> { outer_join_milestone.reorder('milestones.due_date IS NULL ASC, milestones.due_date DESC, milestones.id DESC') }
|
||||
scope :order_milestone_due_asc, -> { outer_join_milestone.reorder('milestones.due_date IS NULL ASC, milestones.due_date ASC, milestones.id ASC') }
|
||||
scope :without_label, -> { joins("LEFT OUTER JOIN label_links ON label_links.target_type = '#{name}' AND label_links.target_id = #{table_name}.id").where(label_links: { id: nil }) }
|
||||
|
||||
scope :join_project, -> { joins(:project) }
|
||||
scope :references_project, -> { references(:project) }
|
||||
scope :non_archived, -> { join_project.where(projects: { archived: false }) }
|
||||
scope :outer_join_milestone, -> { joins("LEFT OUTER JOIN milestones ON milestones.id = #{table_name}.milestone_id") }
|
||||
|
||||
delegate :name,
|
||||
:email,
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# key :text
|
||||
# title :string(255)
|
||||
# type :string(255)
|
||||
# fingerprint :string(255)
|
||||
# title :string
|
||||
# type :string
|
||||
# fingerprint :string
|
||||
# public :boolean default(FALSE), not null
|
||||
#
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#
|
||||
# id :integer not null, primary key
|
||||
# user_id :integer not null
|
||||
# email :string(255) not null
|
||||
# email :string not null
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
#
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
# Table name: events
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# target_type :string(255)
|
||||
# target_type :string
|
||||
# target_id :integer
|
||||
# title :string(255)
|
||||
# title :string
|
||||
# data :text
|
||||
# project_id :integer
|
||||
# created_at :datetime
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#
|
||||
# id :integer not null, primary key
|
||||
# project_id :integer
|
||||
# status :string(255)
|
||||
# status :string
|
||||
# finished_at :datetime
|
||||
# trace :text
|
||||
# created_at :datetime
|
||||
|
@ -15,21 +15,24 @@
|
|||
# commit_id :integer
|
||||
# commands :text
|
||||
# job_id :integer
|
||||
# name :string(255)
|
||||
# name :string
|
||||
# deploy :boolean default(FALSE)
|
||||
# options :text
|
||||
# allow_failure :boolean default(FALSE), not null
|
||||
# stage :string(255)
|
||||
# stage :string
|
||||
# trigger_request_id :integer
|
||||
# stage_idx :integer
|
||||
# tag :boolean
|
||||
# ref :string(255)
|
||||
# ref :string
|
||||
# user_id :integer
|
||||
# type :string(255)
|
||||
# target_url :string(255)
|
||||
# description :string(255)
|
||||
# type :string
|
||||
# target_url :string
|
||||
# description :string
|
||||
# artifacts_file :text
|
||||
# gl_project_id :integer
|
||||
# artifacts_metadata :text
|
||||
# erased_by_id :integer
|
||||
# erased_at :datetime
|
||||
#
|
||||
|
||||
class GenericCommitStatus < CommitStatus
|
||||
|
|
|
@ -2,16 +2,17 @@
|
|||
#
|
||||
# Table name: namespaces
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# name :string(255) not null
|
||||
# path :string(255) not null
|
||||
# owner_id :integer
|
||||
# visibility_level :integer default(20), not null
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# type :string(255)
|
||||
# description :string(255) default(""), not null
|
||||
# avatar :string(255)
|
||||
# id :integer not null, primary key
|
||||
# name :string not null
|
||||
# path :string not null
|
||||
# owner_id :integer
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# type :string
|
||||
# description :string default(""), not null
|
||||
# avatar :string
|
||||
# share_with_group_lock :boolean default(FALSE)
|
||||
# visibility_level :integer default(20), not null
|
||||
#
|
||||
|
||||
require 'carrierwave/orm/activerecord'
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
# note_events :boolean default(FALSE), not null
|
||||
# enable_ssl_verification :boolean default(TRUE)
|
||||
# build_events :boolean default(FALSE), not null
|
||||
# wiki_page_events :boolean default(FALSE), not null
|
||||
# token :string
|
||||
#
|
||||
|
||||
class ProjectHook < WebHook
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
# note_events :boolean default(FALSE), not null
|
||||
# enable_ssl_verification :boolean default(TRUE)
|
||||
# build_events :boolean default(FALSE), not null
|
||||
# wiki_page_events :boolean default(FALSE), not null
|
||||
# token :string
|
||||
#
|
||||
|
||||
class ServiceHook < WebHook
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
# note_events :boolean default(FALSE), not null
|
||||
# enable_ssl_verification :boolean default(TRUE)
|
||||
# build_events :boolean default(FALSE), not null
|
||||
# wiki_page_events :boolean default(FALSE), not null
|
||||
# token :string
|
||||
#
|
||||
|
||||
class SystemHook < WebHook
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
# note_events :boolean default(FALSE), not null
|
||||
# enable_ssl_verification :boolean default(TRUE)
|
||||
# build_events :boolean default(FALSE), not null
|
||||
# wiki_page_events :boolean default(FALSE), not null
|
||||
# token :string
|
||||
#
|
||||
|
||||
class WebHook < ActiveRecord::Base
|
||||
|
@ -43,23 +45,17 @@ class WebHook < ActiveRecord::Base
|
|||
if parsed_url.userinfo.blank?
|
||||
response = WebHook.post(url,
|
||||
body: data.to_json,
|
||||
headers: {
|
||||
"Content-Type" => "application/json",
|
||||
"X-Gitlab-Event" => hook_name.singularize.titleize
|
||||
},
|
||||
headers: build_headers(hook_name),
|
||||
verify: enable_ssl_verification)
|
||||
else
|
||||
post_url = url.gsub("#{parsed_url.userinfo}@", "")
|
||||
post_url = url.gsub("#{parsed_url.userinfo}@", '')
|
||||
auth = {
|
||||
username: CGI.unescape(parsed_url.user),
|
||||
password: CGI.unescape(parsed_url.password),
|
||||
}
|
||||
response = WebHook.post(post_url,
|
||||
body: data.to_json,
|
||||
headers: {
|
||||
"Content-Type" => "application/json",
|
||||
"X-Gitlab-Event" => hook_name.singularize.titleize
|
||||
},
|
||||
headers: build_headers(hook_name),
|
||||
verify: enable_ssl_verification,
|
||||
basic_auth: auth)
|
||||
end
|
||||
|
@ -73,4 +69,15 @@ class WebHook < ActiveRecord::Base
|
|||
def async_execute(data, hook_name)
|
||||
Sidekiq::Client.enqueue(ProjectWebHookWorker, id, data, hook_name)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def build_headers(hook_name)
|
||||
headers = {
|
||||
'Content-Type' => 'application/json',
|
||||
'X-Gitlab-Event' => hook_name.singularize.titleize
|
||||
}
|
||||
headers['X-Gitlab-Token'] = token if token.present?
|
||||
headers
|
||||
end
|
||||
end
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
# Table name: identities
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# extern_uid :string(255)
|
||||
# provider :string(255)
|
||||
# extern_uid :string
|
||||
# provider :string
|
||||
# user_id :integer
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
|
|
|
@ -3,20 +3,23 @@
|
|||
# Table name: issues
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# title :string(255)
|
||||
# title :string
|
||||
# assignee_id :integer
|
||||
# author_id :integer
|
||||
# project_id :integer
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# position :integer default(0)
|
||||
# branch_name :string(255)
|
||||
# branch_name :string
|
||||
# description :text
|
||||
# milestone_id :integer
|
||||
# state :string(255)
|
||||
# state :string
|
||||
# iid :integer
|
||||
# updated_by_id :integer
|
||||
# moved_to_id :integer
|
||||
# confidential :boolean default(FALSE)
|
||||
# deleted_at :datetime
|
||||
# due_date :date
|
||||
#
|
||||
|
||||
require 'carrierwave/orm/activerecord'
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# key :text
|
||||
# title :string(255)
|
||||
# type :string(255)
|
||||
# fingerprint :string(255)
|
||||
# title :string
|
||||
# type :string
|
||||
# fingerprint :string
|
||||
# public :boolean default(FALSE), not null
|
||||
#
|
||||
|
||||
|
|
|
@ -2,14 +2,14 @@
|
|||
#
|
||||
# Table name: labels
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# title :string(255)
|
||||
# color :string(255)
|
||||
# project_id :integer
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# template :boolean default(FALSE)
|
||||
# description :string(255)
|
||||
# id :integer not null, primary key
|
||||
# title :string
|
||||
# color :string
|
||||
# project_id :integer
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# template :boolean default(FALSE)
|
||||
# description :string
|
||||
#
|
||||
|
||||
class Label < ActiveRecord::Base
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
# id :integer not null, primary key
|
||||
# label_id :integer
|
||||
# target_id :integer
|
||||
# target_type :string(255)
|
||||
# target_type :string
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
#
|
||||
|
|
|
@ -3,11 +3,11 @@
|
|||
# Table name: lfs_objects
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# oid :string(255) not null
|
||||
# oid :string not null
|
||||
# size :integer not null
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# file :string(255)
|
||||
# file :string
|
||||
#
|
||||
|
||||
class LfsObject < ActiveRecord::Base
|
||||
|
|
|
@ -5,15 +5,15 @@
|
|||
# id :integer not null, primary key
|
||||
# access_level :integer not null
|
||||
# source_id :integer not null
|
||||
# source_type :string(255) not null
|
||||
# source_type :string not null
|
||||
# user_id :integer
|
||||
# notification_level :integer not null
|
||||
# type :string(255)
|
||||
# type :string
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# created_by_id :integer
|
||||
# invite_email :string(255)
|
||||
# invite_token :string(255)
|
||||
# invite_email :string
|
||||
# invite_token :string
|
||||
# invite_accepted_at :datetime
|
||||
#
|
||||
|
||||
|
|
|
@ -5,15 +5,15 @@
|
|||
# id :integer not null, primary key
|
||||
# access_level :integer not null
|
||||
# source_id :integer not null
|
||||
# source_type :string(255) not null
|
||||
# source_type :string not null
|
||||
# user_id :integer
|
||||
# notification_level :integer not null
|
||||
# type :string(255)
|
||||
# type :string
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# created_by_id :integer
|
||||
# invite_email :string(255)
|
||||
# invite_token :string(255)
|
||||
# invite_email :string
|
||||
# invite_token :string
|
||||
# invite_accepted_at :datetime
|
||||
#
|
||||
|
||||
|
|
|
@ -5,15 +5,15 @@
|
|||
# id :integer not null, primary key
|
||||
# access_level :integer not null
|
||||
# source_id :integer not null
|
||||
# source_type :string(255) not null
|
||||
# source_type :string not null
|
||||
# user_id :integer
|
||||
# notification_level :integer not null
|
||||
# type :string(255)
|
||||
# type :string
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# created_by_id :integer
|
||||
# invite_email :string(255)
|
||||
# invite_token :string(255)
|
||||
# invite_email :string
|
||||
# invite_token :string
|
||||
# invite_accepted_at :datetime
|
||||
#
|
||||
|
||||
|
|
|
@ -3,28 +3,29 @@
|
|||
# Table name: merge_requests
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# target_branch :string(255) not null
|
||||
# source_branch :string(255) not null
|
||||
# target_branch :string not null
|
||||
# source_branch :string not null
|
||||
# source_project_id :integer not null
|
||||
# author_id :integer
|
||||
# assignee_id :integer
|
||||
# title :string(255)
|
||||
# title :string
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# milestone_id :integer
|
||||
# state :string(255)
|
||||
# merge_status :string(255)
|
||||
# state :string
|
||||
# merge_status :string
|
||||
# target_project_id :integer not null
|
||||
# iid :integer
|
||||
# description :text
|
||||
# position :integer default(0)
|
||||
# locked_at :datetime
|
||||
# updated_by_id :integer
|
||||
# merge_error :string(255)
|
||||
# merge_error :string
|
||||
# merge_params :text
|
||||
# merge_when_build_succeeds :boolean default(FALSE), not null
|
||||
# merge_user_id :integer
|
||||
# merge_commit_sha :string
|
||||
# deleted_at :datetime
|
||||
#
|
||||
|
||||
class MergeRequest < ActiveRecord::Base
|
||||
|
|
|
@ -3,12 +3,14 @@
|
|||
# Table name: merge_request_diffs
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# state :string(255)
|
||||
# state :string
|
||||
# st_commits :text
|
||||
# st_diffs :text
|
||||
# merge_request_id :integer not null
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# base_commit_sha :string
|
||||
# real_size :string
|
||||
#
|
||||
|
||||
class MergeRequestDiff < ActiveRecord::Base
|
||||
|
|
|
@ -3,13 +3,13 @@
|
|||
# Table name: milestones
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# title :string(255) not null
|
||||
# title :string not null
|
||||
# project_id :integer not null
|
||||
# description :text
|
||||
# due_date :date
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# state :string(255)
|
||||
# state :string
|
||||
# iid :integer
|
||||
#
|
||||
|
||||
|
|
|
@ -2,15 +2,17 @@
|
|||
#
|
||||
# Table name: namespaces
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# name :string(255) not null
|
||||
# path :string(255) not null
|
||||
# owner_id :integer
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# type :string(255)
|
||||
# description :string(255) default(""), not null
|
||||
# avatar :string(255)
|
||||
# id :integer not null, primary key
|
||||
# name :string not null
|
||||
# path :string not null
|
||||
# owner_id :integer
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# type :string
|
||||
# description :string default(""), not null
|
||||
# avatar :string
|
||||
# share_with_group_lock :boolean default(FALSE)
|
||||
# visibility_level :integer default(20), not null
|
||||
#
|
||||
|
||||
class Namespace < ActiveRecord::Base
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
#
|
||||
# id :integer not null, primary key
|
||||
# note :text
|
||||
# noteable_type :string(255)
|
||||
# noteable_type :string
|
||||
# author_id :integer
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# project_id :integer
|
||||
# attachment :string(255)
|
||||
# line_code :string(255)
|
||||
# commit_id :string(255)
|
||||
# attachment :string
|
||||
# line_code :string
|
||||
# commit_id :string
|
||||
# noteable_id :integer
|
||||
# system :boolean default(FALSE), not null
|
||||
# st_diff :text
|
||||
|
|
|
@ -1,3 +1,16 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: notification_settings
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# user_id :integer not null
|
||||
# source_id :integer not null
|
||||
# source_type :string not null
|
||||
# level :integer default(0), not null
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
#
|
||||
|
||||
class NotificationSetting < ActiveRecord::Base
|
||||
enum level: { disabled: 0, participating: 1, watch: 2, global: 3, mention: 4 }
|
||||
|
||||
|
|
|
@ -3,14 +3,14 @@
|
|||
# Table name: snippets
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# title :string(255)
|
||||
# title :string
|
||||
# content :text
|
||||
# author_id :integer not null
|
||||
# project_id :integer
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# file_name :string(255)
|
||||
# type :string(255)
|
||||
# file_name :string
|
||||
# type :string
|
||||
# visibility_level :integer default(0), not null
|
||||
#
|
||||
|
||||
|
|
|
@ -2,41 +2,46 @@
|
|||
#
|
||||
# Table name: projects
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# name :string(255)
|
||||
# path :string(255)
|
||||
# description :text
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# creator_id :integer
|
||||
# issues_enabled :boolean default(TRUE), not null
|
||||
# wall_enabled :boolean default(TRUE), not null
|
||||
# merge_requests_enabled :boolean default(TRUE), not null
|
||||
# wiki_enabled :boolean default(TRUE), not null
|
||||
# namespace_id :integer
|
||||
# issues_tracker :string(255) default("gitlab"), not null
|
||||
# issues_tracker_id :string(255)
|
||||
# snippets_enabled :boolean default(TRUE), not null
|
||||
# last_activity_at :datetime
|
||||
# import_url :string(255)
|
||||
# visibility_level :integer default(0), not null
|
||||
# archived :boolean default(FALSE), not null
|
||||
# avatar :string(255)
|
||||
# import_status :string(255)
|
||||
# repository_size :float default(0.0)
|
||||
# star_count :integer default(0), not null
|
||||
# import_type :string(255)
|
||||
# import_source :string(255)
|
||||
# commit_count :integer default(0)
|
||||
# import_error :text
|
||||
# ci_id :integer
|
||||
# builds_enabled :boolean default(TRUE), not null
|
||||
# shared_runners_enabled :boolean default(TRUE), not null
|
||||
# runners_token :string
|
||||
# build_coverage_regex :string
|
||||
# build_allow_git_fetch :boolean default(TRUE), not null
|
||||
# build_timeout :integer default(3600), not null
|
||||
# pending_delete :boolean
|
||||
# id :integer not null, primary key
|
||||
# name :string
|
||||
# path :string
|
||||
# description :text
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# creator_id :integer
|
||||
# issues_enabled :boolean default(TRUE), not null
|
||||
# wall_enabled :boolean default(TRUE), not null
|
||||
# merge_requests_enabled :boolean default(TRUE), not null
|
||||
# wiki_enabled :boolean default(TRUE), not null
|
||||
# namespace_id :integer
|
||||
# issues_tracker :string default("gitlab"), not null
|
||||
# issues_tracker_id :string
|
||||
# snippets_enabled :boolean default(TRUE), not null
|
||||
# last_activity_at :datetime
|
||||
# import_url :string
|
||||
# visibility_level :integer default(0), not null
|
||||
# archived :boolean default(FALSE), not null
|
||||
# avatar :string
|
||||
# import_status :string
|
||||
# repository_size :float default(0.0)
|
||||
# star_count :integer default(0), not null
|
||||
# import_type :string
|
||||
# import_source :string
|
||||
# commit_count :integer default(0)
|
||||
# import_error :text
|
||||
# ci_id :integer
|
||||
# builds_enabled :boolean default(TRUE), not null
|
||||
# shared_runners_enabled :boolean default(TRUE), not null
|
||||
# runners_token :string
|
||||
# build_coverage_regex :string
|
||||
# build_allow_git_fetch :boolean default(TRUE), not null
|
||||
# build_timeout :integer default(3600), not null
|
||||
# pending_delete :boolean default(FALSE)
|
||||
# public_builds :boolean default(TRUE), not null
|
||||
# main_language :string
|
||||
# pushes_since_gc :integer default(0)
|
||||
# last_repository_check_failed :boolean
|
||||
# last_repository_check_at :datetime
|
||||
#
|
||||
|
||||
require 'carrierwave/orm/activerecord'
|
||||
|
@ -740,19 +745,17 @@ class Project < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def open_branches
|
||||
all_branches = repository.branches
|
||||
# We're using a Set here as checking values in a large Set is faster than
|
||||
# checking values in a large Array.
|
||||
protected_set = Set.new(protected_branch_names)
|
||||
|
||||
if protected_branches.present?
|
||||
all_branches.reject! do |branch|
|
||||
protected_branches_names.include?(branch.name)
|
||||
end
|
||||
repository.branches.reject do |branch|
|
||||
protected_set.include?(branch.name)
|
||||
end
|
||||
|
||||
all_branches
|
||||
end
|
||||
|
||||
def protected_branches_names
|
||||
@protected_branches_names ||= protected_branches.map(&:name)
|
||||
def protected_branch_names
|
||||
@protected_branch_names ||= protected_branches.pluck(:name)
|
||||
end
|
||||
|
||||
def root_ref?(branch)
|
||||
|
@ -769,7 +772,7 @@ class Project < ActiveRecord::Base
|
|||
|
||||
# Check if current branch name is marked as protected in the system
|
||||
def protected_branch?(branch_name)
|
||||
protected_branches_names.include?(branch_name)
|
||||
protected_branches.where(name: branch_name).any?
|
||||
end
|
||||
|
||||
def developers_can_push_to_protected_branch?(branch_name)
|
||||
|
@ -1041,4 +1044,11 @@ class Project < ActiveRecord::Base
|
|||
def wiki
|
||||
@wiki ||= ProjectWiki.new(self, self.owner)
|
||||
end
|
||||
|
||||
def schedule_delete!(user_id, params)
|
||||
# Queue this task for after the commit, so once we mark pending_delete it will run
|
||||
run_after_commit { ProjectDestroyWorker.perform_async(id, user_id, params) }
|
||||
|
||||
update_attribute(:pending_delete, true)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,3 +1,15 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: project_group_links
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# project_id :integer not null
|
||||
# group_id :integer not null
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# group_access :integer default(30), not null
|
||||
#
|
||||
|
||||
class ProjectGroupLink < ActiveRecord::Base
|
||||
GUEST = 10
|
||||
REPORTER = 20
|
||||
|
|
|
@ -2,9 +2,12 @@
|
|||
#
|
||||
# Table name: project_import_data
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# project_id :integer
|
||||
# data :text
|
||||
# id :integer not null, primary key
|
||||
# project_id :integer
|
||||
# data :text
|
||||
# encrypted_credentials :text
|
||||
# encrypted_credentials_iv :string
|
||||
# encrypted_credentials_salt :string
|
||||
#
|
||||
|
||||
require 'carrierwave/orm/activerecord'
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
# Table name: services
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# type :string(255)
|
||||
# title :string(255)
|
||||
# type :string
|
||||
# title :string
|
||||
# project_id :integer
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# active :boolean default(FALSE), not null
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# active :boolean not null
|
||||
# properties :text
|
||||
# template :boolean default(FALSE)
|
||||
# push_events :boolean default(TRUE)
|
||||
|
@ -17,6 +17,9 @@
|
|||
# tag_push_events :boolean default(TRUE)
|
||||
# note_events :boolean default(TRUE), not null
|
||||
# build_events :boolean default(FALSE), not null
|
||||
# category :string default("common"), not null
|
||||
# default :boolean default(FALSE)
|
||||
# wiki_page_events :boolean default(TRUE)
|
||||
#
|
||||
|
||||
require 'asana'
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
# Table name: services
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# type :string(255)
|
||||
# title :string(255)
|
||||
# type :string
|
||||
# title :string
|
||||
# project_id :integer
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# active :boolean default(FALSE), not null
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# active :boolean not null
|
||||
# properties :text
|
||||
# template :boolean default(FALSE)
|
||||
# push_events :boolean default(TRUE)
|
||||
|
@ -17,6 +17,9 @@
|
|||
# tag_push_events :boolean default(TRUE)
|
||||
# note_events :boolean default(TRUE), not null
|
||||
# build_events :boolean default(FALSE), not null
|
||||
# category :string default("common"), not null
|
||||
# default :boolean default(FALSE)
|
||||
# wiki_page_events :boolean default(TRUE)
|
||||
#
|
||||
|
||||
class AssemblaService < Service
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
# Table name: services
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# type :string(255)
|
||||
# title :string(255)
|
||||
# type :string
|
||||
# title :string
|
||||
# project_id :integer
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# active :boolean default(FALSE), not null
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# active :boolean not null
|
||||
# properties :text
|
||||
# template :boolean default(FALSE)
|
||||
# push_events :boolean default(TRUE)
|
||||
|
@ -17,6 +17,9 @@
|
|||
# tag_push_events :boolean default(TRUE)
|
||||
# note_events :boolean default(TRUE), not null
|
||||
# build_events :boolean default(FALSE), not null
|
||||
# category :string default("common"), not null
|
||||
# default :boolean default(FALSE)
|
||||
# wiki_page_events :boolean default(TRUE)
|
||||
#
|
||||
|
||||
class BambooService < CiService
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
# Table name: services
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# type :string(255)
|
||||
# title :string(255)
|
||||
# type :string
|
||||
# title :string
|
||||
# project_id :integer
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# active :boolean default(FALSE), not null
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# active :boolean not null
|
||||
# properties :text
|
||||
# template :boolean default(FALSE)
|
||||
# push_events :boolean default(TRUE)
|
||||
|
@ -17,6 +17,9 @@
|
|||
# tag_push_events :boolean default(TRUE)
|
||||
# note_events :boolean default(TRUE), not null
|
||||
# build_events :boolean default(FALSE), not null
|
||||
# category :string default("common"), not null
|
||||
# default :boolean default(FALSE)
|
||||
# wiki_page_events :boolean default(TRUE)
|
||||
#
|
||||
|
||||
require "addressable/uri"
|
||||
|
@ -26,7 +29,7 @@ class BuildkiteService < CiService
|
|||
|
||||
prop_accessor :project_url, :token, :enable_ssl_verification
|
||||
|
||||
validates :project_url, presence: true, if: :activated?
|
||||
validates :project_url, presence: true, url: true, if: :activated?
|
||||
validates :token, presence: true, if: :activated?
|
||||
|
||||
after_save :compose_service_hook, if: :activated?
|
||||
|
@ -91,7 +94,7 @@ class BuildkiteService < CiService
|
|||
{ type: 'text',
|
||||
name: 'project_url',
|
||||
placeholder: "#{ENDPOINT}/example/project" },
|
||||
|
||||
|
||||
{ type: 'checkbox',
|
||||
name: 'enable_ssl_verification',
|
||||
title: "Enable SSL verification" }
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
# Table name: services
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# type :string(255)
|
||||
# title :string(255)
|
||||
# type :string
|
||||
# title :string
|
||||
# project_id :integer
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# active :boolean default(FALSE), not null
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# active :boolean not null
|
||||
# properties :text
|
||||
# template :boolean default(FALSE)
|
||||
# push_events :boolean default(TRUE)
|
||||
|
@ -17,6 +17,9 @@
|
|||
# tag_push_events :boolean default(TRUE)
|
||||
# note_events :boolean default(TRUE), not null
|
||||
# build_events :boolean default(FALSE), not null
|
||||
# category :string default("common"), not null
|
||||
# default :boolean default(FALSE)
|
||||
# wiki_page_events :boolean default(TRUE)
|
||||
#
|
||||
|
||||
class BuildsEmailService < Service
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
# Table name: services
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# type :string(255)
|
||||
# title :string(255)
|
||||
# type :string
|
||||
# title :string
|
||||
# project_id :integer
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# active :boolean default(FALSE), not null
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# active :boolean not null
|
||||
# properties :text
|
||||
# template :boolean default(FALSE)
|
||||
# push_events :boolean default(TRUE)
|
||||
|
@ -17,6 +17,9 @@
|
|||
# tag_push_events :boolean default(TRUE)
|
||||
# note_events :boolean default(TRUE), not null
|
||||
# build_events :boolean default(FALSE), not null
|
||||
# category :string default("common"), not null
|
||||
# default :boolean default(FALSE)
|
||||
# wiki_page_events :boolean default(TRUE)
|
||||
#
|
||||
|
||||
class CampfireService < Service
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
# Table name: services
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# type :string(255)
|
||||
# title :string(255)
|
||||
# type :string
|
||||
# title :string
|
||||
# project_id :integer
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# active :boolean default(FALSE), not null
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# active :boolean not null
|
||||
# properties :text
|
||||
# template :boolean default(FALSE)
|
||||
# push_events :boolean default(TRUE)
|
||||
|
@ -17,6 +17,9 @@
|
|||
# tag_push_events :boolean default(TRUE)
|
||||
# note_events :boolean default(TRUE), not null
|
||||
# build_events :boolean default(FALSE), not null
|
||||
# category :string default("common"), not null
|
||||
# default :boolean default(FALSE)
|
||||
# wiki_page_events :boolean default(TRUE)
|
||||
#
|
||||
|
||||
# Base class for CI services
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
# Table name: services
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# type :string(255)
|
||||
# title :string(255)
|
||||
# type :string
|
||||
# title :string
|
||||
# project_id :integer
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# active :boolean default(FALSE), not null
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# active :boolean not null
|
||||
# properties :text
|
||||
# template :boolean default(FALSE)
|
||||
# push_events :boolean default(TRUE)
|
||||
|
@ -17,6 +17,9 @@
|
|||
# tag_push_events :boolean default(TRUE)
|
||||
# note_events :boolean default(TRUE), not null
|
||||
# build_events :boolean default(FALSE), not null
|
||||
# category :string default("common"), not null
|
||||
# default :boolean default(FALSE)
|
||||
# wiki_page_events :boolean default(TRUE)
|
||||
#
|
||||
|
||||
class CustomIssueTrackerService < IssueTrackerService
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue