Commit 32e46d35 authored by Steve Halasz's avatar Steve Halasz

Merge branch 'master' into 5905-duplicate-email-errors

Getting latest CHANGELOG so I can resolve merge conflict
parents 47bda4f0 85bd6296
/public/
/tmp/
/vendor/
{
"extends": "airbnb",
"globals": {
"$": false,
"_": false,
"beforeEach": false,
"d3": false,
"define": false,
"describe": false,
"document": false,
"expect": false,
"fixture": false,
"gl": false,
"it": false,
"jQuery": false,
"Mousetrap": false,
"spyOn": false,
"spyOnEvent": false,
"Turbolinks": false,
"window": false
}
}
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
/doc/code/* /doc/code/*
/dump.rdb /dump.rdb
/log/*.log* /log/*.log*
/node_modules/
/nohup.out /nohup.out
/public/assets/ /public/assets/
/public/uploads.* /public/uploads.*
......
...@@ -210,11 +210,12 @@ rake brakeman: *exec ...@@ -210,11 +210,12 @@ rake brakeman: *exec
rake flay: *exec rake flay: *exec
license_finder: *exec license_finder: *exec
rake downtime_check: *exec rake downtime_check: *exec
rake ce_to_ee_merge_check: rake ee_compat_check:
<<: *exec <<: *exec
only: only:
- branches - branches
except: except:
- master
- tags - tags
allow_failure: yes allow_failure: yes
...@@ -279,16 +280,20 @@ bundler:audit: ...@@ -279,16 +280,20 @@ bundler:audit:
migration paths: migration paths:
stage: test stage: test
<<: *use-db <<: *use-db
variables:
SETUP_DB: "false"
only: only:
- master@gitlab-org/gitlab-ce - master@gitlab-org/gitlab-ce
script: script:
- git checkout HEAD . - git checkout HEAD .
- git fetch --tags - git fetch --tags
- git checkout v8.5.9 - git checkout v8.5.9
- 'echo test: unix:/var/opt/gitlab/redis/redis.socket > config/resque.yml' - cp config/resque.yml.example config/resque.yml
- sed -i 's/localhost/redis/g' config/resque.yml
- bundle install --without postgres production --jobs $(nproc) "${FLAGS[@]}" --retry=3 - bundle install --without postgres production --jobs $(nproc) "${FLAGS[@]}" --retry=3
- rake db:drop db:create db:schema:load db:seed_fu - rake db:drop db:create db:schema:load db:seed_fu
- git checkout $CI_BUILD_REF - git checkout $CI_BUILD_REF
- source scripts/prepare_build.sh
- rake db:migrate - rake db:migrate
coverage: coverage:
...@@ -306,16 +311,29 @@ coverage: ...@@ -306,16 +311,29 @@ coverage:
- coverage/index.html - coverage/index.html
- coverage/assets/ - coverage/assets/
lint-javascript:
stage: test
image: "node:latest"
before_script:
- npm install
script:
- npm run eslint
# Trigger docs build # Trigger docs build
# https://gitlab.com/gitlab-com/doc-gitlab-com/blob/master/README.md#deployment-process
trigger_docs: trigger_docs:
stage: post-test stage: post-test
before_script: [] image: "alpine"
before_script:
- apk update && apk add curl
variables:
GIT_STRATEGY: none
cache: {} cache: {}
artifacts: {} artifacts: {}
script: script:
- "curl -X POST -F token=${DOCS_TRIGGER_TOKEN} -F ref=master https://gitlab.com/api/v3/projects/38069/trigger/builds" - "curl -X POST -F token=${DOCS_TRIGGER_TOKEN} -F ref=master -F variables[PROJECT]=ce https://gitlab.com/api/v3/projects/38069/trigger/builds"
only: only:
- master - master@gitlab-org/gitlab-ce
# Notify slack in the end # Notify slack in the end
......
...@@ -143,7 +143,7 @@ linters: ...@@ -143,7 +143,7 @@ linters:
# with two colons. Pseudo-classes, like :hover and :first-child, should # with two colons. Pseudo-classes, like :hover and :first-child, should
# be declared with one colon. # be declared with one colon.
PseudoElement: PseudoElement:
enabled: false enabled: true
# Avoid qualifying elements in selectors (also known as "tag-qualifying"). # Avoid qualifying elements in selectors (also known as "tag-qualifying").
QualifyingElement: QualifyingElement:
...@@ -172,7 +172,7 @@ linters: ...@@ -172,7 +172,7 @@ linters:
# Split selectors onto separate lines after each comma, and have each # Split selectors onto separate lines after each comma, and have each
# individual selector occupy a single line. # individual selector occupy a single line.
SingleLinePerSelector: SingleLinePerSelector:
enabled: false enabled: true
# Commas in lists should be followed by a space. # Commas in lists should be followed by a space.
SpaceAfterComma: SpaceAfterComma:
......
Please view this file on the master branch, on stable branches it's out of date. Please view this file on the master branch, on stable branches it's out of date.
## 8.14.0 (2016-11-22) ## 8.14.0 (2016-11-22)
- Backups do not fail anymore when using tar on annex and custom_hooks only. !5814
- Adds user project membership expired event to clarify why user was removed (Callum Dryden) - Adds user project membership expired event to clarify why user was removed (Callum Dryden)
- Trim leading and trailing whitespace on project_path (Linus Thiel) - Trim leading and trailing whitespace on project_path (Linus Thiel)
- Prevent award emoji via notes for issues/MRs authored by user (barthc) - Prevent award emoji via notes for issues/MRs authored by user (barthc)
- Adds an optional path parameter to the Commits API to filter commits by path (Luis HGO) - Adds an optional path parameter to the Commits API to filter commits by path (Luis HGO)
- Fix extra space on Build sidebar on Firefox !7060 - Fix extra space on Build sidebar on Firefox !7060
- Fix mobile layout issues in admin user overview page !7087
- Fix HipChat notifications rendering (airatshigapov, eisnerd) - Fix HipChat notifications rendering (airatshigapov, eisnerd)
- Add hover to trash icon in notes !7008 (blackst0ne) - Add hover to trash icon in notes !7008 (blackst0ne)
- Only show one error message for an invalid email !5905 (lycoperdon) - Only show one error message for an invalid email !5905 (lycoperdon)
- Fix sidekiq stats in admin area (blackst0ne)
- Removed delete branch tooltip !6954
- Escape ref and path for relative links !6050 (winniehell)
- Fixed link typo on /help/ui to Alerts section. !6915 (Sam Rose)
- Fix filtering of milestones with quotes in title (airatshigapov)
- Refactor less readable existance checking code from CoffeeScript !6289 (jlogandavison)
- Update mail_room and enable sentinel support to Reply By Email (!7101)
- Simpler arguments passed to named_route on toggle_award_url helper method - Simpler arguments passed to named_route on toggle_award_url helper method
- Fix typo in framework css class. !7086 (Daniel Voogsgerd)
- New issue board list dropdown stays open after adding a new list
- Fix: Backup restore doesn't clear cache - Fix: Backup restore doesn't clear cache
- API: Fix project deploy keys 400 and 500 errors when adding an existing key. !6784 (Joshua Welsh)
- Replace jquery.cookie plugin with js.cookie !7085
- Use MergeRequestsClosingIssues cache data on Issue#closed_by_merge_requests method - Use MergeRequestsClosingIssues cache data on Issue#closed_by_merge_requests method
- Fix Sign in page 'Forgot your password?' link overlaps on medium-large screens - Fix Sign in page 'Forgot your password?' link overlaps on medium-large screens
- Show full status link on MR & commit pipelines
- Fix documents and comments on Build API `scope` - Fix documents and comments on Build API `scope`
- Refactor email, use setter method instead AR callbacks for email attribute (Semyon Pupkov) - Refactor email, use setter method instead AR callbacks for email attribute (Semyon Pupkov)
## 8.13.1 (unreleased) ## 8.13.2
- Fix error in generating labels - Fix builds dropdown overlapping bug !7124
- Fix reply-by-email not working due to queue name mismatch
- Fixed hidden pipeline graph on commit and MR page !6895 ## 8.13.1 (2016-10-25)
- Expire and build repository cache after project import - Fix branch protection API. !6215
- Fix 404 for group pages when GitLab setup uses relative url - Fix hidden pipeline graph on commit and MR page. !6895
- Simpler arguments passed to named_route on toggle_award_url helper method - Fix Cycle analytics not showing correct data when filtering by date. !6906
- Better handle when no users were selected for adding to group or project. (Linus Thiel) - Ensure custom provider tab labels don't break layout. !6993
- Only show register tab if signup enabled. - Fix issue boards user link when in subdirectory. !7018
- Refactor and add new environment functionality to CI yaml reference. !7026
- Fix typo in project settings that prevents users from enabling container registry. !7037
- Fix events order in `users/:id/events` endpoint. !7039
- Remove extra line for empty issue description. !7045
- Don't append issue/MR templates to any existing text. !7050
- Fix error in generating labels. !7055
- Stop clearing the database cache on `rake cache:clear`. !7056
- Only show register tab if signup enabled. !7058
- Expire and build repository cache after project import. !7064
- Fix bug where labels would be assigned to issues that were moved. !7065
- Fix reply-by-email not working due to queue name mismatch. !7068
- Fix 404 for group pages when GitLab setup uses relative url. !7071
- Fix `User#to_reference`. !7088
- Reduce overhead of `LabelFinder` by avoiding `#presence` call. !7094
- Fix unauthorized users dragging on issue boards. !7096
- Only schedule `ProjectCacheWorker` jobs when needed. !7099
## 8.13.0 (2016-10-22) ## 8.13.0 (2016-10-22)
- Removes extra line for empty issue description. (!7045)
- Fix save button on project pipeline settings page. (!6955) - Fix save button on project pipeline settings page. (!6955)
- All Sidekiq workers now use their own queue - All Sidekiq workers now use their own queue
- Avoid race condition when asynchronously removing expired artifacts. (!6881) - Avoid race condition when asynchronously removing expired artifacts. (!6881)
...@@ -48,7 +77,6 @@ Please view this file on the master branch, on stable branches it's out of date. ...@@ -48,7 +77,6 @@ Please view this file on the master branch, on stable branches it's out of date.
- Update duration at the end of pipeline - Update duration at the end of pipeline
- ExpireBuildArtifactsWorker query builds table without ordering enqueuing one job per build to cleanup - ExpireBuildArtifactsWorker query builds table without ordering enqueuing one job per build to cleanup
- Add group level labels. (!6425) - Add group level labels. (!6425)
- Fix Cycle analytics not showing correct data when filtering by date. !6906
- Add an example for testing a phoenix application with Gitlab CI in the docs (Manthan Mallikarjun) - Add an example for testing a phoenix application with Gitlab CI in the docs (Manthan Mallikarjun)
- Cancelled pipelines could be retried. !6927 - Cancelled pipelines could be retried. !6927
- Updating verbiage on git basics to be more intuitive - Updating verbiage on git basics to be more intuitive
...@@ -56,7 +84,6 @@ Please view this file on the master branch, on stable branches it's out of date. ...@@ -56,7 +84,6 @@ Please view this file on the master branch, on stable branches it's out of date.
- Clarify documentation for Runners API (Gennady Trafimenkov) - Clarify documentation for Runners API (Gennady Trafimenkov)
- The instrumentation for Banzai::Renderer has been restored - The instrumentation for Banzai::Renderer has been restored
- Change user & group landing page routing from /u/:username to /:username - Change user & group landing page routing from /u/:username to /:username
- Fixed issue boards user link when in subdirectory
- Added documentation for .gitattributes files - Added documentation for .gitattributes files
- Move Pipeline Metrics to separate worker - Move Pipeline Metrics to separate worker
- AbstractReferenceFilter caches project_refs on RequestStore when active - AbstractReferenceFilter caches project_refs on RequestStore when active
...@@ -73,12 +100,14 @@ Please view this file on the master branch, on stable branches it's out of date. ...@@ -73,12 +100,14 @@ Please view this file on the master branch, on stable branches it's out of date.
- Don't include archived projects when creating group milestones. !4940 (Jeroen Jacobs) - Don't include archived projects when creating group milestones. !4940 (Jeroen Jacobs)
- Add tag shortcut from the Commit page. !6543 - Add tag shortcut from the Commit page. !6543
- Keep refs for each deployment - Keep refs for each deployment
- Close open tooltips on page navigation (Linus Thiel)
- Allow browsing branches that end with '.atom' - Allow browsing branches that end with '.atom'
- Log LDAP lookup errors and don't swallow unrelated exceptions. !6103 (Markus Koller) - Log LDAP lookup errors and don't swallow unrelated exceptions. !6103 (Markus Koller)
- Replace unique keyframes mixin with keyframe mixin with specific names (ClemMakesApps) - Replace unique keyframes mixin with keyframe mixin with specific names (ClemMakesApps)
- Add more tests for calendar contribution (ClemMakesApps) - Add more tests for calendar contribution (ClemMakesApps)
- Update Gitlab Shell to fix some problems with moving projects between storages - Update Gitlab Shell to fix some problems with moving projects between storages
- Cache rendered markdown in the database, rather than Redis - Cache rendered markdown in the database, rather than Redis
- Add todo toggle event (ClemMakesApps)
- Avoid database queries on Banzai::ReferenceParser::BaseParser for nodes without references - Avoid database queries on Banzai::ReferenceParser::BaseParser for nodes without references
- Simplify Mentionable concern instance methods - Simplify Mentionable concern instance methods
- API: Ability to retrieve version information (Robert Schilling) - API: Ability to retrieve version information (Robert Schilling)
...@@ -100,12 +129,14 @@ Please view this file on the master branch, on stable branches it's out of date. ...@@ -100,12 +129,14 @@ Please view this file on the master branch, on stable branches it's out of date.
- Add RTL support to markdown renderer (Ebrahim Byagowi) - Add RTL support to markdown renderer (Ebrahim Byagowi)
- Add word-wrap to issue title on issue and milestone boards (ClemMakesApps) - Add word-wrap to issue title on issue and milestone boards (ClemMakesApps)
- Fix todos page mobile viewport layout (ClemMakesApps) - Fix todos page mobile viewport layout (ClemMakesApps)
- Make issues search less finicky
- Fix inconsistent highlighting of already selected activity nav-links (ClemMakesApps) - Fix inconsistent highlighting of already selected activity nav-links (ClemMakesApps)
- Remove redundant mixins (ClemMakesApps) - Remove redundant mixins (ClemMakesApps)
- Added 'Download' button to the Snippets page (Justin DiPierro) - Added 'Download' button to the Snippets page (Justin DiPierro)
- Add visibility level to project repository - Add visibility level to project repository
- Fix robots.txt disallowing access to groups starting with "s" (Matt Harrison) - Fix robots.txt disallowing access to groups starting with "s" (Matt Harrison)
- Close open merge request without source project (Katarzyna Kobierska Ula Budziszewska) - Close open merge request without source project (Katarzyna Kobierska Ula Budziszewska)
- Fix showing commits from source project for merge request !6658
- Fix that manual jobs would no longer block jobs in the next stage. !6604 - Fix that manual jobs would no longer block jobs in the next stage. !6604
- Add configurable email subject suffix (Fu Xu) - Add configurable email subject suffix (Fu Xu)
- Use defined colour for a language when available !6748 (nilsding) - Use defined colour for a language when available !6748 (nilsding)
...@@ -400,7 +431,6 @@ Please view this file on the master branch, on stable branches it's out of date. ...@@ -400,7 +431,6 @@ Please view this file on the master branch, on stable branches it's out of date.
- Fix inconsistent checkbox alignment (ClemMakesApps) - Fix inconsistent checkbox alignment (ClemMakesApps)
- Use the default branch for displaying the project icon instead of master !5792 (Hannes Rosenögger) - Use the default branch for displaying the project icon instead of master !5792 (Hannes Rosenögger)
- Adds response mime type to transaction metric action when it's not HTML - Adds response mime type to transaction metric action when it's not HTML
- Fix branch protection API !6215
- Fix hover leading space bug in pipeline graph !5980 - Fix hover leading space bug in pipeline graph !5980
- Avoid conflict with admin labels when importing GitHub labels - Avoid conflict with admin labels when importing GitHub labels
- User can edit closed MR with deleted fork (Katarzyna Kobierska Ula Budziszewska) !5496 - User can edit closed MR with deleted fork (Katarzyna Kobierska Ula Budziszewska) !5496
......
...@@ -326,7 +326,7 @@ gem 'newrelic_rpm', '~> 3.16' ...@@ -326,7 +326,7 @@ gem 'newrelic_rpm', '~> 3.16'
gem 'octokit', '~> 4.3.0' gem 'octokit', '~> 4.3.0'
gem 'mail_room', '~> 0.8.1' gem 'mail_room', '~> 0.9.0'
gem 'email_reply_parser', '~> 0.5.8' gem 'email_reply_parser', '~> 0.5.8'
......
...@@ -402,7 +402,7 @@ GEM ...@@ -402,7 +402,7 @@ GEM
systemu (~> 2.6.2) systemu (~> 2.6.2)
mail (2.6.4) mail (2.6.4)
mime-types (>= 1.16, < 4) mime-types (>= 1.16, < 4)
mail_room (0.8.1) mail_room (0.9.0)
method_source (0.8.2) method_source (0.8.2)
mime-types (2.99.3) mime-types (2.99.3)
mimemagic (0.3.0) mimemagic (0.3.0)
...@@ -893,7 +893,7 @@ DEPENDENCIES ...@@ -893,7 +893,7 @@ DEPENDENCIES
license_finder (~> 2.1.0) license_finder (~> 2.1.0)
licensee (~> 8.0.0) licensee (~> 8.0.0)
loofah (~> 2.0.3) loofah (~> 2.0.3)
mail_room (~> 0.8.1) mail_room (~> 0.9.0)
method_source (~> 0.8) method_source (~> 0.8)
minitest (~> 5.7.0) minitest (~> 5.7.0)
mousetrap-rails (~> 1.4.6) mousetrap-rails (~> 1.4.6)
...@@ -994,4 +994,4 @@ DEPENDENCIES ...@@ -994,4 +994,4 @@ DEPENDENCIES
wikicloth (= 0.8.1) wikicloth (= 0.8.1)
BUNDLED WITH BUNDLED WITH
1.13.2 1.13.3
/* eslint-disable */
((global) => { ((global) => {
const MAX_MESSAGE_LENGTH = 500; const MAX_MESSAGE_LENGTH = 500;
const MESSAGE_CELL_SELECTOR = '.abuse-reports .message'; const MESSAGE_CELL_SELECTOR = '.abuse-reports .message';
......
/* eslint-disable */
(function() { (function() {
this.Activities = (function() { this.Activities = (function() {
function Activities() { function Activities() {
...@@ -24,9 +25,7 @@ ...@@ -24,9 +25,7 @@
var filter = sender.attr("id").split("_")[0]; var filter = sender.attr("id").split("_")[0];
$('.event-filter .active').removeClass("active"); $('.event-filter .active').removeClass("active");
$.cookie("event_filter", filter, { Cookies.set("event_filter", filter);
path: gon.relative_url_root || '/'
});
sender.closest('li').toggleClass("active"); sender.closest('li').toggleClass("active");
}; };
......
/* eslint-disable */
(function() { (function() {
this.Admin = (function() { this.Admin = (function() {
function Admin() { function Admin() {
......
/* eslint-disable */
(function() { (function() {
this.Api = { this.Api = {
groupsPath: "/api/:version/groups.json", groupsPath: "/api/:version/groups.json",
......
/* eslint-disable */
// This is a manifest file that'll be compiled into including all the files listed below. // This is a manifest file that'll be compiled into including all the files listed below.
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically // Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
// be included in the compiled file accessible from http://example.com/assets/application.js // be included in the compiled file accessible from http://example.com/assets/application.js
...@@ -11,13 +12,13 @@ ...@@ -11,13 +12,13 @@
/*= require jquery-ui/effect-highlight */ /*= require jquery-ui/effect-highlight */
/*= require jquery-ui/sortable */ /*= require jquery-ui/sortable */
/*= require jquery_ujs */ /*= require jquery_ujs */
/*= require jquery.cookie */
/*= require jquery.endless-scroll */ /*= require jquery.endless-scroll */
/*= require jquery.highlight */ /*= require jquery.highlight */
/*= require jquery.waitforimages */ /*= require jquery.waitforimages */
/*= require jquery.atwho */ /*= require jquery.atwho */
/*= require jquery.scrollTo */ /*= require jquery.scrollTo */
/*= require jquery.turbolinks */ /*= require jquery.turbolinks */
/*= require js.cookie */
/*= require turbolinks */ /*= require turbolinks */
/*= require autosave */ /*= require autosave */
/*= require bootstrap/affix */ /*= require bootstrap/affix */
...@@ -124,15 +125,11 @@ ...@@ -124,15 +125,11 @@
return str.replace(/<(?:.|\n)*?>/gm, ''); return str.replace(/<(?:.|\n)*?>/gm, '');
}; };
window.unbindEvents = function() {
return $(document).off('scroll');
};
window.shiftWindow = function() { window.shiftWindow = function() {
return scrollBy(0, -100); return scrollBy(0, -100);
}; };
document.addEventListener("page:fetch", unbindEvents); document.addEventListener("page:fetch", gl.utils.cleanupBeforeFetch);
window.addEventListener("hashchange", shiftWindow); window.addEventListener("hashchange", shiftWindow);
...@@ -149,6 +146,10 @@ ...@@ -149,6 +146,10 @@
$document = $(document); $document = $(document);
$window = $(window); $window = $(window);
$body = $('body'); $body = $('body');
// Set the default path for all cookies to GitLab's root directory
Cookies.defaults.path = gon.relative_url_root || '/';
gl.utils.preventDisabledButtons(); gl.utils.preventDisabledButtons();
bootstrapBreakpoint = bp.getBreakpointSize(); bootstrapBreakpoint = bp.getBreakpointSize();
$(".nav-sidebar").niceScroll({ $(".nav-sidebar").niceScroll({
......
/* eslint-disable */
(function() { (function() {
this.Aside = (function() { this.Aside = (function() {
function Aside() { function Aside() {
......
/* eslint-disable */
(function() { (function() {
this.Autosave = (function() { this.Autosave = (function() {
function Autosave(field, key) { function Autosave(field, key) {
......
/* eslint-disable */
(function() { (function() {
this.AwardsHandler = (function() { this.AwardsHandler = (function() {
const FROM_SENTENCE_REGEX = /(?:, and | and |, )/; //For separating lists produced by ruby's Array#toSentence const FROM_SENTENCE_REGEX = /(?:, and | and |, )/; //For separating lists produced by ruby's Array#toSentence
...@@ -91,7 +92,7 @@ ...@@ -91,7 +92,7 @@
css = { css = {
top: ($addBtn.offset().top + $addBtn.outerHeight()) + "px" top: ($addBtn.offset().top + $addBtn.outerHeight()) + "px"
}; };
if ((position != null) && position === 'right') { if (position === 'right') {
css.left = (($addBtn.offset().left - $menu.outerWidth()) + 20) + "px"; css.left = (($addBtn.offset().left - $menu.outerWidth()) + 20) + "px";
$menu.addClass('is-aligned-right'); $menu.addClass('is-aligned-right');
} else { } else {
...@@ -322,21 +323,18 @@ ...@@ -322,21 +323,18 @@
var frequentlyUsedEmojis; var frequentlyUsedEmojis;
frequentlyUsedEmojis = this.getFrequentlyUsedEmojis(); frequentlyUsedEmojis = this.getFrequentlyUsedEmojis();
frequentlyUsedEmojis.push(emoji); frequentlyUsedEmojis.push(emoji);
return $.cookie('frequently_used_emojis', frequentlyUsedEmojis.join(','), { Cookies.set('frequently_used_emojis', frequentlyUsedEmojis.join(','), { expires: 365 });
path: gon.relative_url_root || '/',
expires: 365
});
}; };
AwardsHandler.prototype.getFrequentlyUsedEmojis = function() { AwardsHandler.prototype.getFrequentlyUsedEmojis = function() {
var frequentlyUsedEmojis; var frequentlyUsedEmojis;
frequentlyUsedEmojis = ($.cookie('frequently_used_emojis') || '').split(','); frequentlyUsedEmojis = (Cookies.get('frequently_used_emojis') || '').split(',');
return _.compact(_.uniq(frequentlyUsedEmojis)); return _.compact(_.uniq(frequentlyUsedEmojis));
}; };
AwardsHandler.prototype.renderFrequentlyUsedBlock = function() { AwardsHandler.prototype.renderFrequentlyUsedBlock = function() {
var emoji, frequentlyUsedEmojis, i, len, ul; var emoji, frequentlyUsedEmojis, i, len, ul;
if ($.cookie('frequently_used_emojis')) { if (Cookies.get('frequently_used_emojis')) {
frequentlyUsedEmojis = this.getFrequentlyUsedEmojis(); frequentlyUsedEmojis = this.getFrequentlyUsedEmojis();
ul = $("<ul class='clearfix emoji-menu-list frequent-emojis'>"); ul = $("<ul class='clearfix emoji-menu-list frequent-emojis'>");
for (i = 0, len = frequentlyUsedEmojis.length; i < len; i++) { for (i = 0, len = frequentlyUsedEmojis.length; i < len; i++) {
......
/* eslint-disable */
/*= require jquery.ba-resize */ /*= require jquery.ba-resize */
/*= require autosize */ /*= require autosize */
......
/* eslint-disable */
(function() { (function() {
$(function() { $(function() {
$("body").on("click", ".js-details-target", function() { $("body").on("click", ".js-details-target", function() {
......
/* eslint-disable */
// Quick Submit behavior // Quick Submit behavior
// //
// When a child field of a form with a `js-quick-submit` class receives a // When a child field of a form with a `js-quick-submit` class receives a
......
/* eslint-disable */
// Requires Input behavior // Requires Input behavior
// //
// When called on a form with input fields with the `required` attribute, the // When called on a form with input fields with the `required` attribute, the
......
/* eslint-disable */
(function(w) { (function(w) {
$(function() { $(function() {
// Toggle button. Show/hide content inside parent container. // Toggle button. Show/hide content inside parent container.
......
/* eslint-disable */
/*= require blob/template_selector */ /*= require blob/template_selector */
((global) => { ((global) => {
......
/* eslint-disable */
(function() { (function() {
this.BlobFileDropzone = (function() { this.BlobFileDropzone = (function() {
function BlobFileDropzone(form, method) { function BlobFileDropzone(form, method) {
......
/* eslint-disable */
/*= require blob/template_selector */ /*= require blob/template_selector */
......
/* eslint-disable */
(function() { (function() {
this.BlobGitignoreSelectors = (function() { this.BlobGitignoreSelectors = (function() {
function BlobGitignoreSelectors(opts) { function BlobGitignoreSelectors(opts) {
......
/* eslint-disable */
/*= require blob/template_selector */ /*= require blob/template_selector */
......
/* eslint-disable */
((global) => { ((global) => {
class BlobLicenseSelectors { class BlobLicenseSelectors {
constructor({ $dropdowns, editor }) { constructor({ $dropdowns, editor }) {
......
/* eslint-disable */
((global) => { ((global) => {
class TemplateSelector { class TemplateSelector {
constructor({ dropdown, data, pattern, wrapper, editor, fileEndpoint, $input } = {}) { constructor({ dropdown, data, pattern, wrapper, editor, fileEndpoint, $input } = {}) {
...@@ -68,14 +69,10 @@ ...@@ -68,14 +69,10 @@
// To be implemented on the extending class // To be implemented on the extending class
// e.g. // e.g.
// Api.gitignoreText item.name, @requestFileSuccess.bind(@) // Api.gitignoreText item.name, @requestFileSuccess.bind(@)
requestFileSuccess(file, { skipFocus, append } = {}) { requestFileSuccess(file, { skipFocus } = {}) {
const oldValue = this.editor.getValue(); const oldValue = this.editor.getValue();
let newValue = file.content; let newValue = file.content;
if (append && oldValue.length && oldValue !== newValue) {
newValue = oldValue + '\n\n' + newValue;
}
this.editor.setValue(newValue, 1); this.editor.setValue(newValue, 1);
if (!skipFocus) this.editor.focus(); if (!skipFocus) this.editor.focus();
...@@ -99,4 +96,3 @@ ...@@ -99,4 +96,3 @@
global.TemplateSelector = TemplateSelector; global.TemplateSelector = TemplateSelector;
})(window.gl || ( window.gl = {})); })(window.gl || ( window.gl = {}));
/* eslint-disable */
/*= require_tree . */ /*= require_tree . */
(function() { (function() {
......
/* eslint-disable */
(function() { (function() {
var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
......
/* eslint-disable */
//= require vue //= require vue
//= require vue-resource //= require vue-resource
//= require Sortable //= require Sortable
...@@ -5,7 +6,9 @@ ...@@ -5,7 +6,9 @@
//= require_tree ./stores //= require_tree ./stores
//= require_tree ./services //= require_tree ./services
//= require_tree ./mixins //= require_tree ./mixins
//= require_tree ./filters
//= require ./components/board //= require ./components/board
//= require ./components/board_sidebar
//= require ./components/new_list_dropdown //= require ./components/new_list_dropdown
//= require ./vue_resource_interceptor //= require ./vue_resource_interceptor
...@@ -22,7 +25,8 @@ $(() => { ...@@ -22,7 +25,8 @@ $(() => {
gl.IssueBoardsApp = new Vue({ gl.IssueBoardsApp = new Vue({
el: $boardApp, el: $boardApp,
components: { components: {
'board': gl.issueBoards.Board 'board': gl.issueBoards.Board,
'board-sidebar': gl.issueBoards.BoardSidebar
}, },
data: { data: {
state: Store.state, state: Store.state,
...@@ -30,9 +34,15 @@ $(() => { ...@@ -30,9 +34,15 @@ $(() => {
endpoint: $boardApp.dataset.endpoint, endpoint: $boardApp.dataset.endpoint,
boardId: $boardApp.dataset.boardId, boardId: $boardApp.dataset.boardId,
disabled: $boardApp.dataset.disabled === 'true', disabled: $boardApp.dataset.disabled === 'true',
issueLinkBase: $boardApp.dataset.issueLinkBase issueLinkBase: $boardApp.dataset.issueLinkBase,
detailIssue: Store.detail
}, },
init: Store.create.bind(Store), init: Store.create.bind(Store),
computed: {
detailIssueVisible () {
return Object.keys(this.detailIssue.issue).length;
}
},
created () { created () {
gl.boardService = new BoardService(this.endpoint, this.boardId); gl.boardService = new BoardService(this.endpoint, this.boardId);
}, },
......
/* eslint-disable */
//= require ./board_blank_state //= require ./board_blank_state
//= require ./board_delete //= require ./board_delete
//= require ./board_list //= require ./board_list
...@@ -21,6 +22,7 @@ ...@@ -21,6 +22,7 @@
}, },
data () { data () {
return { return {
detailIssue: Store.detail,
filters: Store.state.filters, filters: Store.state.filters,
showIssueForm: false showIssueForm: false
}; };
...@@ -32,6 +34,26 @@ ...@@ -32,6 +34,26 @@
this.list.getIssues(true); this.list.getIssues(true);
}, },
deep: true deep: true
},
detailIssue: {
handler () {
if (!Object.keys(this.detailIssue.issue).length) return;
const issue = this.list.findIssue(this.detailIssue.issue.id);
if (issue) {
const boardsList = document.querySelectorAll('.boards-list')[0];
const right = (this.$el.offsetLeft + this.$el.offsetWidth) - boardsList.offsetWidth;
const left = boardsList.scrollLeft - this.$el.offsetLeft;
if (right - boardsList.scrollLeft > 0) {
boardsList.scrollLeft = right;
} else if (left > 0) {
boardsList.scrollLeft = this.$el.offsetLeft;
}
}
},
deep: true
} }
}, },
methods: { methods: {
......
/* eslint-disable */
(() => { (() => {
const Store = gl.issueBoards.BoardsStore; const Store = gl.issueBoards.BoardsStore;
......
/* eslint-disable */
(() => { (() => {
const Store = gl.issueBoards.BoardsStore; const Store = gl.issueBoards.BoardsStore;
...@@ -12,6 +13,17 @@ ...@@ -12,6 +13,17 @@
disabled: Boolean, disabled: Boolean,
index: Number index: Number
}, },
data () {
return {
showDetail: false,
detailIssue: Store.detail
};
},
computed: {
issueDetailVisible () {
return this.detailIssue.issue && this.detailIssue.issue.id === this.issue.id;
}
},
methods: { methods: {
filterByLabel (label, e) { filterByLabel (label, e) {
let labelToggleText = label.title; let labelToggleText = label.title;
...@@ -37,6 +49,29 @@ ...@@ -37,6 +49,29 @@
$('.labels-filter .dropdown-toggle-text').text(labelToggleText); $('.labels-filter .dropdown-toggle-text').text(labelToggleText);
Store.updateFiltersUrl(); Store.updateFiltersUrl();
},
mouseDown () {
this.showDetail = true;
},
mouseMove () {
if (this.showDetail) {
this.showDetail = false;
}
},
showIssue (e) {
const targetTagName = e.target.tagName.toLowerCase();
if (targetTagName === 'a' || targetTagName === 'button') return;
if (this.showDetail) {
this.showDetail = false;
if (Store.detail.issue && Store.detail.issue.id === this.issue.id) {
Store.detail.issue = {};
} else {
Store.detail.issue = this.issue;
}
}
} }
} }
}); });
......
/* eslint-disable */
(() => { (() => {
window.gl = window.gl || {}; window.gl = window.gl || {};
window.gl.issueBoards = window.gl.issueBoards || {}; window.gl.issueBoards = window.gl.issueBoards || {};
......
/* eslint-disable */
//= require ./board_card //= require ./board_card
//= require ./board_new_issue //= require ./board_new_issue
......
/* eslint-disable */
(() => { (() => {
const Store = gl.issueBoards.BoardsStore;
window.gl = window.gl || {}; window.gl = window.gl || {};
gl.issueBoards.BoardNewIssue = Vue.extend({ gl.issueBoards.BoardNewIssue = Vue.extend({
...@@ -27,13 +30,16 @@ ...@@ -27,13 +30,16 @@
const labels = this.list.label ? [this.list.label] : []; const labels = this.list.label ? [this.list.label] : [];
const issue = new ListIssue({ const issue = new ListIssue({
title: this.title, title: this.title,
labels labels,
subscribed: true
}); });
this.list.newIssue(issue) this.list.newIssue(issue)
.then((data) => { .then((data) => {
// Need this because our jQuery very kindly disables buttons on ALL form submissions // Need this because our jQuery very kindly disables buttons on ALL form submissions
$(this.$els.submitButton).enable(); $(this.$els.submitButton).enable();
Store.detail.issue = issue;
}) })
.catch(() => { .catch(() => {
// Need this because our jQuery very kindly disables buttons on ALL form submissions // Need this because our jQuery very kindly disables buttons on ALL form submissions
......
/* eslint-disable */
(() => {
const Store = gl.issueBoards.BoardsStore;
window.gl = window.gl || {};
window.gl.issueBoards = window.gl.issueBoards || {};
gl.issueBoards.BoardSidebar = Vue.extend({
props: {
currentUser: Object
},
data() {
return {
detail: Store.detail,
issue: {}
};
},
computed: {
showSidebar () {
return Object.keys(this.issue).length;
}
},
watch: {
detail: {
handler () {
this.issue = this.detail.issue;
},
deep: true
},
issue () {
if (this.showSidebar) {
this.$nextTick(() => {
$('.right-sidebar').getNiceScroll(0).doScrollTop(0, 0);
$('.right-sidebar').getNiceScroll().resize();
});
}
}
},
methods: {
closeSidebar () {
this.detail.issue = {};
}
},
ready () {
new IssuableContext(this.currentUser);
new MilestoneSelect();
new gl.DueDateSelectors();
new LabelsSelect();
new Sidebar();
new Subscription('.subscription');
}
});
})();
/* eslint-disable */
$(() => { $(() => {
const Store = gl.issueBoards.BoardsStore; const Store = gl.issueBoards.BoardsStore;
...@@ -32,6 +33,7 @@ $(() => { ...@@ -32,6 +33,7 @@ $(() => {
}, },
filterable: true, filterable: true,
selectable: true, selectable: true,
multiSelect: true,
clicked (label, $el, e) { clicked (label, $el, e) {
e.preventDefault(); e.preventDefault();
......
/* eslint-disable */
Vue.filter('due-date', (value) => {
const date = new Date(value);
return $.datepicker.formatDate('M d, yy', date);
});
/* eslint-disable */
((w) => { ((w) => {
window.gl = window.gl || {}; window.gl = window.gl || {};
window.gl.issueBoards = window.gl.issueBoards || {}; window.gl.issueBoards = window.gl.issueBoards || {};
...@@ -22,7 +23,7 @@ ...@@ -22,7 +23,7 @@
fallbackOnBody: true, fallbackOnBody: true,
ghostClass: 'is-ghost', ghostClass: 'is-ghost',
filter: '.has-tooltip, .btn', filter: '.has-tooltip, .btn',
delay: gl.issueBoards.touchEnabled ? 100 : 0, delay: gl.issueBoards.touchEnabled ? 100 : 50,
scrollSensitivity: gl.issueBoards.touchEnabled ? 60 : 100, scrollSensitivity: gl.issueBoards.touchEnabled ? 60 : 100,
scrollSpeed: 20, scrollSpeed: 20,
onStart: gl.issueBoards.onStart, onStart: gl.issueBoards.onStart,
......
/* eslint-disable */
class ListIssue { class ListIssue {
constructor (obj) { constructor (obj) {
this.id = obj.iid; this.id = obj.iid;
this.title = obj.title; this.title = obj.title;
this.confidential = obj.confidential; this.confidential = obj.confidential;
this.dueDate = obj.due_date;
this.subscribed = obj.subscribed;
this.labels = []; this.labels = [];
if (obj.assignee) { if (obj.assignee) {
this.assignee = new ListUser(obj.assignee); this.assignee = new ListUser(obj.assignee);
} }
if (obj.milestone) {
this.milestone = new ListMilestone(obj.milestone);
}
obj.labels.forEach((label) => { obj.labels.forEach((label) => {
this.labels.push(new ListLabel(label)); this.labels.push(new ListLabel(label));
}); });
...@@ -41,4 +48,21 @@ class ListIssue { ...@@ -41,4 +48,21 @@ class ListIssue {
getLists () { getLists () {
return gl.issueBoards.BoardsStore.state.lists.filter( list => list.findIssue(this.id) ); return gl.issueBoards.BoardsStore.state.lists.filter( list => list.findIssue(this.id) );
} }
update (url) {
const data = {
issue: {
milestone_id: this.milestone ? this.milestone.id : null,
due_date: this.dueDate,
assignee_id: this.assignee ? this.assignee.id : null,
label_ids: this.labels.map( (label) => label.id )
}
};
if (!data.issue.label_ids.length) {
data.issue.label_ids = [''];
}
return Vue.http.patch(url, data);
}
} }
/* eslint-disable */
class ListLabel { class ListLabel {
constructor (obj) { constructor (obj) {
this.id = obj.id; this.id = obj.id;
......
/* eslint-disable */
class List { class List {
constructor (obj) { constructor (obj) {
this.id = obj.id; this.id = obj.id;
......
/* eslint-disable */
class ListMilestone {
constructor (obj) {
this.id = obj.id;
this.title = obj.title;
}
}
/* eslint-disable */
class ListUser { class ListUser {
constructor (user) { constructor (user) {
this.id = user.id; this.id = user.id;
......
/* eslint-disable */
class BoardService { class BoardService {
constructor (root, boardId) { constructor (root, boardId) {
Vue.http.options.root = root;
this.lists = Vue.resource(`${root}/${boardId}/lists{/id}`, {}, { this.lists = Vue.resource(`${root}/${boardId}/lists{/id}`, {}, {
generate: { generate: {
method: 'POST', method: 'POST',
......
/* eslint-disable */
(() => { (() => {
window.gl = window.gl || {}; window.gl = window.gl || {};
window.gl.issueBoards = window.gl.issueBoards || {}; window.gl.issueBoards = window.gl.issueBoards || {};
...@@ -5,6 +6,9 @@ ...@@ -5,6 +6,9 @@
gl.issueBoards.BoardsStore = { gl.issueBoards.BoardsStore = {
disabled: false, disabled: false,
state: {}, state: {},
detail: {
issue: {}
},
moving: { moving: {
issue: {}, issue: {},
list: {} list: {}
...@@ -58,12 +62,12 @@ ...@@ -58,12 +62,12 @@
removeBlankState () { removeBlankState () {
this.removeList('blank'); this.removeList('blank');
$.cookie('issue_board_welcome_hidden', 'true', { Cookies.set('issue_board_welcome_hidden', 'true', {
expires: 365 * 10 expires: 365 * 10
}); });
}, },
welcomeIsHidden () { welcomeIsHidden () {
return $.cookie('issue_board_welcome_hidden') === 'true'; return Cookies.get('issue_board_welcome_hidden') === 'true';
}, },
removeList (id, type = 'blank') { removeList (id, type = 'blank') {
const list = this.findList('id', id, type); const list = this.findList('id', id, type);
......
/* eslint-disable */
(function () { (function () {
'use strict'; 'use strict';
......
/* eslint-disable */
Vue.http.interceptors.push((request, next) => { Vue.http.interceptors.push((request, next) => {
Vue.activeResources = Vue.activeResources ? Vue.activeResources + 1 : 1; Vue.activeResources = Vue.activeResources ? Vue.activeResources + 1 : 1;
......
/* eslint-disable */
(function() { (function() {
this.Breakpoints = (function() { this.Breakpoints = (function() {
var BreakpointInstance, instance; var BreakpointInstance, instance;
......
/* eslint-disable */
(function() { (function() {
$(function() { $(function() {
var previewPath; var previewPath;
......
/* eslint-disable */
(function() { (function() {
var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
......
/* eslint-disable */
(function() { (function() {
this.BuildArtifacts = (function() { this.BuildArtifacts = (function() {
function BuildArtifacts() { function BuildArtifacts() {
......
/* eslint-disable */
$(function(){ $(function(){
$('.reveal-variables').off('click').on('click',function(){ $('.reveal-variables').off('click').on('click',function(){
$('.js-build').toggle().niceScroll(); $('.js-build').toggle().niceScroll();
......
/* eslint-disable */
(function() { (function() {
this.Commit = (function() { this.Commit = (function() {
function Commit() { function Commit() {
......
/* eslint-disable */
(function() { (function() {
this.CommitFile = (function() { this.CommitFile = (function() {
function CommitFile(file) { function CommitFile(file) {
......
/* eslint-disable */
(function() { (function() {
this.ImageFile = (function() { this.ImageFile = (function() {
var prepareFrames; var prepareFrames;
......
/* eslint-disable */
(function() { (function() {
this.CommitsList = (function() { this.CommitsList = (function() {
function CommitsList() {} function CommitsList() {}
......
/* eslint-disable */
(function() { (function() {
this.Compare = (function() { this.Compare = (function() {
function Compare(opts) { function Compare(opts) {
......
/* eslint-disable */
(function() { (function() {
this.CompareAutocomplete = (function() { this.CompareAutocomplete = (function() {
function CompareAutocomplete() { function CompareAutocomplete() {
......
/* eslint-disable */
(function() { (function() {
this.ConfirmDangerModal = (function() { this.ConfirmDangerModal = (function() {
function ConfirmDangerModal(form, text) { function ConfirmDangerModal(form, text) {
......
/* eslint-disable */
/*= require clipboard */ /*= require clipboard */
......
/* eslint-disable */
(function (w) { (function (w) {
class CreateLabelDropdown { class CreateLabelDropdown {
constructor ($el, namespacePath, projectPath) { constructor ($el, namespacePath, projectPath) {
......
/* eslint-disable */
//= require vue //= require vue
((global) => { ((global) => {
...@@ -6,7 +7,7 @@ ...@@ -6,7 +7,7 @@
const store = gl.cycleAnalyticsStore = { const store = gl.cycleAnalyticsStore = {
isLoading: true, isLoading: true,
hasError: false, hasError: false,
isHelpDismissed: $.cookie(COOKIE_NAME), isHelpDismissed: Cookies.get(COOKIE_NAME),
analytics: {} analytics: {}
}; };
...@@ -75,9 +76,7 @@ ...@@ -75,9 +76,7 @@
dismissLanding() { dismissLanding() {
store.isHelpDismissed = true; store.isHelpDismissed = true;
$.cookie(COOKIE_NAME, true, { Cookies.set(COOKIE_NAME, true);
path: gon.relative_url_root || '/'
});
} }
initDropdown() { initDropdown() {
......
/* eslint-disable */
(function() { (function() {
this.Diff = (function() { this.Diff = (function() {
var UNFOLD_COUNT; var UNFOLD_COUNT;
......
/* eslint-disable */
((w) => { ((w) => {
w.CommentAndResolveBtn = Vue.extend({ w.CommentAndResolveBtn = Vue.extend({
props: { props: {
......
/* eslint-disable */
(() => { (() => {
JumpToDiscussion = Vue.extend({ JumpToDiscussion = Vue.extend({
mixins: [DiscussionMixins], mixins: [DiscussionMixins],
......
/* eslint-disable */
((w) => { ((w) => {
w.ResolveBtn = Vue.extend({ w.ResolveBtn = Vue.extend({
props: { props: {
......
/* eslint-disable */
((w) => { ((w) => {
w.ResolveCount = Vue.extend({ w.ResolveCount = Vue.extend({
mixins: [DiscussionMixins], mixins: [DiscussionMixins],
......
/* eslint-disable */
((w) => { ((w) => {
w.ResolveDiscussionBtn = Vue.extend({ w.ResolveDiscussionBtn = Vue.extend({
props: { props: {
......
/* eslint-disable */
//= require vue //= require vue
//= require vue-resource //= require vue-resource
//= require_directory ./models //= require_directory ./models
......
/* eslint-disable */
((w) => { ((w) => {
w.DiscussionMixins = { w.DiscussionMixins = {
computed: { computed: {
......
/* eslint-disable */
class DiscussionModel { class DiscussionModel {
constructor (discussionId) { constructor (discussionId) {
this.id = discussionId; this.id = discussionId;
......
/* eslint-disable */
class NoteModel { class NoteModel {
constructor (discussionId, noteId, canResolve, resolved, resolved_by) { constructor (discussionId, noteId, canResolve, resolved, resolved_by) {
this.discussionId = discussionId; this.discussionId = discussionId;
......
/* eslint-disable */
((w) => { ((w) => {
class ResolveServiceClass { class ResolveServiceClass {
constructor() { constructor() {
......
/* eslint-disable */
((w) => { ((w) => {
w.CommentsStore = { w.CommentsStore = {
state: {}, state: {},
......
/* eslint-disable */
(function() { (function() {
var Dispatcher; var Dispatcher;
......
/* eslint-disable */
/*= require preview_markdown */ /*= require preview_markdown */
......
/* eslint-disable */
(function(global) { (function(global) {
class DueDateSelect { class DueDateSelect {
constructor({ $dropdown, $loading } = {}) { constructor({ $dropdown, $loading } = {}) {
...@@ -41,7 +42,12 @@ ...@@ -41,7 +42,12 @@
defaultDate: $("input[name='" + this.fieldName + "']").val(), defaultDate: $("input[name='" + this.fieldName + "']").val(),
altField: "input[name='" + this.fieldName + "']", altField: "input[name='" + this.fieldName + "']",
onSelect: () => { onSelect: () => {
return this.saveDueDate(true); if (this.$dropdown.hasClass('js-issue-boards-due-date')) {
gl.issueBoards.BoardsStore.detail.issue.dueDate = $(`input[name='${this.fieldName}']`).val();
this.updateIssueBoardIssue();
} else {
return this.saveDueDate(true);
}
} }
}); });
} }
...@@ -49,8 +55,14 @@ ...@@ -49,8 +55,14 @@
initRemoveDueDate() { initRemoveDueDate() {
this.$block.on('click', '.js-remove-due-date', (e) => { this.$block.on('click', '.js-remove-due-date', (e) => {
e.preventDefault(); e.preventDefault();
$("input[name='" + this.fieldName + "']").val('');
return this.saveDueDate(false); if (this.$dropdown.hasClass('js-issue-boards-due-date')) {
gl.issueBoards.BoardsStore.detail.issue.dueDate = '';
this.updateIssueBoardIssue();
} else {
$("input[name='" + this.fieldName + "']").val('');
return this.saveDueDate(false);
}
}); });
} }
...@@ -83,6 +95,18 @@ ...@@ -83,6 +95,18 @@
this.datePayload = datePayload; this.datePayload = datePayload;
} }
updateIssueBoardIssue () {
this.$loading.fadeIn();
this.$dropdown.trigger('loading.gl.dropdown');
this.$selectbox.hide();
this.$value.css('display', '');
gl.issueBoards.BoardsStore.detail.issue.update(this.$dropdown.attr('data-issue-update'))
.then(() => {
this.$loading.fadeOut();
});
}
submitSelectedDate(isDropdown) { submitSelectedDate(isDropdown) {
return $.ajax({ return $.ajax({
type: 'PUT', type: 'PUT',
......
/* eslint-disable */
Array.prototype.first = function() { Array.prototype.first = function() {
return this[0]; return this[0];
} }
......
/* eslint-disable */
Element.prototype.matches = Element.prototype.matches || Element.prototype.msMatches;
Element.prototype.closest = function closest(selector, selectedElement = this) {
if (!selectedElement) return;
return selectedElement.matches(selector) ? selectedElement : Element.prototype.closest(selector, selectedElement.parentElement);
};
/* eslint-disable */
// Disable an element and add the 'disabled' Bootstrap class // Disable an element and add the 'disabled' Bootstrap class
(function() { (function() {
$.fn.extend({ $.fn.extend({
......
/* eslint-disable */
(function() { (function() {
var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
......
/* eslint-disable */
(function() { (function() {
this.Flash = (function() { this.Flash = (function() {
var hideFlash; var hideFlash;
......
/* eslint-disable */
// Creates the variables for setting up GFM auto-completion // Creates the variables for setting up GFM auto-completion
(function() { (function() {
if (window.GitLab == null) { if (window.GitLab == null) {
......
/* eslint-disable */
(function() { (function() {
var GitLabDropdown, GitLabDropdownFilter, GitLabDropdownRemote, var GitLabDropdown, GitLabDropdownFilter, GitLabDropdownRemote,
bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
...@@ -208,7 +209,7 @@ ...@@ -208,7 +209,7 @@
FILTER_INPUT = '.dropdown-input .dropdown-input-field'; FILTER_INPUT = '.dropdown-input .dropdown-input-field';
function GitLabDropdown(el1, options) { function GitLabDropdown(el1, options) {
var ref, ref1, ref2, ref3, searchFields, selector, self; var searchFields, selector, self;
this.el = el1; this.el = el1;
this.options = options; this.options = options;
this.updateLabel = bind(this.updateLabel, this); this.updateLabel = bind(this.updateLabel, this);
...@@ -219,7 +220,11 @@ ...@@ -219,7 +220,11 @@
selector = $(this.el).data("target"); selector = $(this.el).data("target");
this.dropdown = selector != null ? $(selector) : $(this.el).parent(); this.dropdown = selector != null ? $(selector) : $(this.el).parent();
// Set Defaults // Set Defaults
ref = this.options, this.filterInput = (ref1 = ref.filterInput) != null ? ref1 : this.getElement(FILTER_INPUT), this.highlight = (ref2 = ref.highlight) != null ? ref2 : false, this.filterInputBlur = (ref3 = ref.filterInputBlur) != null ? ref3 : true; this.filterInput = this.options.filterInput || this.getElement(FILTER_INPUT);
this.highlight = !!this.options.highlight
this.filterInputBlur = this.options.filterInputBlur != null
? this.options.filterInputBlur
: true;
// If no input is passed create a default one // If no input is passed create a default one
self = this; self = this;
// If selector was passed // If selector was passed
...@@ -418,7 +423,9 @@ ...@@ -418,7 +423,9 @@
var $target; var $target;
if (this.options.multiSelect) { if (this.options.multiSelect) {
$target = $(e.target); $target = $(e.target);
if ($target && !$target.hasClass('dropdown-menu-close') && !$target.hasClass('dropdown-menu-close-icon') && !$target.data('is-link')) { if ($target && !$target.hasClass('dropdown-menu-close') &&
!$target.hasClass('dropdown-menu-close-icon') &&
!$target.data('is-link')) {
e.stopPropagation(); e.stopPropagation();
return false; return false;
} else { } else {
...@@ -549,6 +556,8 @@ ...@@ -549,6 +556,8 @@
value = this.options.id ? this.options.id(data) : data.id; value = this.options.id ? this.options.id(data) : data.id;
fieldName = this.options.fieldName; fieldName = this.options.fieldName;
if (value) { value = value.toString().replace(/'/g, '\\\'') };
field = this.dropdown.parent().find("input[name='" + fieldName + "'][value='" + value + "']"); field = this.dropdown.parent().find("input[name='" + fieldName + "'][value='" + value + "']");
if (field.length) { if (field.length) {
selected = true; selected = true;
...@@ -620,8 +629,21 @@ ...@@ -620,8 +629,21 @@
selectedObject = this.renderedData[selectedIndex]; selectedObject = this.renderedData[selectedIndex];
} }
} }
if (this.options.vue) {
if (el.hasClass(ACTIVE_CLASS)) {
el.removeClass(ACTIVE_CLASS);
} else {
el.addClass(ACTIVE_CLASS);
}
return selectedObject;
}
field = []; field = [];
value = this.options.id ? this.options.id(selectedObject, el) : selectedObject.id; value = this.options.id
? this.options.id(selectedObject, el)
: selectedObject.id;
if (isInput) { if (isInput) {
field = $(this.el); field = $(this.el);
} else if(value) { } else if(value) {
......
/* eslint-disable */
((global) => { ((global) => {
/* /*
* This class overrides the browser's validation error bubbles, displaying custom * This class overrides the browser's validation error bubbles, displaying custom
...@@ -137,8 +138,11 @@ ...@@ -137,8 +138,11 @@
} }
initValidators () { initValidators () {
// select all non-hidden inputs in form // register selectors here as needed
this.state.inputs = this.form.find(':input:not([type=hidden])').toArray() const validateSelectors = [':text', ':password', '[type=email]']
.map((selector) => `input${selector}`).join(',');
this.state.inputs = this.form.find(validateSelectors).toArray()
.filter((input) => !input.classList.contains(customValidationFlag)) .filter((input) => !input.classList.contains(customValidationFlag))
.map((input) => new GlFieldError({ input, formErrors: this })); .map((input) => new GlFieldError({ input, formErrors: this }));
......
/* eslint-disable */
(function() { (function() {
this.GLForm = (function() { this.GLForm = (function() {
function GLForm(form) { function GLForm(form) {
......
/* eslint-disable */
// This is a manifest file that'll be compiled into including all the files listed below. // This is a manifest file that'll be compiled into including all the files listed below.
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically // Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
// be included in the compiled file accessible from http://example.com/assets/application.js // be included in the compiled file accessible from http://example.com/assets/application.js
......
/* eslint-disable */
(function() { (function() {
this.StatGraph = (function() { this.StatGraph = (function() {
function StatGraph() {} function StatGraph() {}
......
/* eslint-disable */
/*= require d3 */ /*= require d3 */
......
/* eslint-disable */
/*= require d3 */ /*= require d3 */
...@@ -29,8 +30,7 @@ ...@@ -29,8 +30,7 @@
ContributorsGraph.set_y_domain = function(data) { ContributorsGraph.set_y_domain = function(data) {
return ContributorsGraph.prototype.y_domain = [ return ContributorsGraph.prototype.y_domain = [
0, d3.max(data, function(d) { 0, d3.max(data, function(d) {
var ref, ref1; return d.commits = d.commits || d.additions || d.deletions;
return d.commits = (ref = (ref1 = d.commits) != null ? ref1 : d.additions) != null ? ref : d.deletions;
}) })
]; ];
}; };
...@@ -44,8 +44,7 @@ ...@@ -44,8 +44,7 @@
ContributorsGraph.init_y_domain = function(data) { ContributorsGraph.init_y_domain = function(data) {
return ContributorsGraph.prototype.y_domain = [ return ContributorsGraph.prototype.y_domain = [
0, d3.max(data, function(d) { 0, d3.max(data, function(d) {
var ref, ref1; return d.commits = d.commits || d.additions || d.deletions;
return d.commits = (ref = (ref1 = d.commits) != null ? ref1 : d.additions) != null ? ref : d.deletions;
}) })
]; ];
}; };
...@@ -147,9 +146,8 @@ ...@@ -147,9 +146,8 @@
return this.area = d3.svg.area().x(function(d) { return this.area = d3.svg.area().x(function(d) {
return x(d.date); return x(d.date);
}).y0(this.height).y1(function(d) { }).y0(this.height).y1(function(d) {
var ref, ref1, xa; d.commits = d.commits || d.additions || d.deletions;
xa = d.commits = (ref = (ref1 = d.commits) != null ? ref1 : d.additions) != null ? ref : d.deletions; return y(d.commits);
return y(xa);
}).interpolate("basis"); }).interpolate("basis");
}; };
......
/* eslint-disable */
(function() { (function() {
window.ContributorsStatGraphUtil = { window.ContributorsStatGraphUtil = {
parse_log: function(log) { parse_log: function(log) {
......
/* eslint-disable */
(function() { (function() {
this.GroupAvatar = (function() { this.GroupAvatar = (function() {
function GroupAvatar() { function GroupAvatar() {
......
/* eslint-disable */
(function() { (function() {
var slice = [].slice; var slice = [].slice;
......
/* eslint-disable */
(function() {
$(document).on('todo:toggle', function(e, count) {
var $todoPendingCount = $('.todos-pending-count');
$todoPendingCount.text(gl.text.addDelimiter(count));
$todoPendingCount.toggleClass('hidden', count === 0);
});
})();
/* eslint-disable */
(function() { (function() {
this.ImporterStatus = (function() { this.ImporterStatus = (function() {
function ImporterStatus(jobs_url, import_url) { function ImporterStatus(jobs_url, import_url) {
......
/* eslint-disable */
(function() { (function() {
var issuable_created; var issuable_created;
...@@ -15,16 +16,61 @@ ...@@ -15,16 +16,61 @@
return Issuable.labelRow = _.template('<% _.each(labels, function(label){ %> <span class="label-row btn-group" role="group" aria-label="<%- label.title %>" style="color: <%- label.text_color %>;"> <a href="#" class="btn btn-transparent has-tooltip" style="background-color: <%- label.color %>;" title="<%- label.description %>" data-container="body"> <%- label.title %> </a> <button type="button" class="btn btn-transparent label-remove js-label-filter-remove" style="background-color: <%- label.color %>;" data-label="<%- label.title %>"> <i class="fa fa-times"></i> </button> </span> <% }); %>'); return Issuable.labelRow = _.template('<% _.each(labels, function(label){ %> <span class="label-row btn-group" role="group" aria-label="<%- label.title %>" style="color: <%- label.text_color %>;"> <a href="#" class="btn btn-transparent has-tooltip" style="background-color: <%- label.color %>;" title="<%- label.description %>" data-container="body"> <%- label.title %> </a> <button type="button" class="btn btn-transparent label-remove js-label-filter-remove" style="background-color: <%- label.color %>;" data-label="<%- label.title %>"> <i class="fa fa-times"></i> </button> </span> <% }); %>');
}, },
initSearch: function() { initSearch: function() {
const $searchInput = $('#issuable_search');
Issuable.initSearchState($searchInput);
// `immediate` param set to false debounces on the `trailing` edge, lets user finish typing // `immediate` param set to false debounces on the `trailing` edge, lets user finish typing
const debouncedExecSearch = _.debounce(Issuable.executeSearch, 500, false); const debouncedExecSearch = _.debounce(Issuable.executeSearch, 1000, false);
$('#issuable_search').off('keyup').on('keyup', debouncedExecSearch); $searchInput.off('keyup').on('keyup', debouncedExecSearch);
// ensures existing filters are preserved when manually submitted // ensures existing filters are preserved when manually submitted
$('#issue_search_form').on('submit', (e) => { $('#issuable_search_form').on('submit', (e) => {
e.preventDefault(); e.preventDefault();
debouncedExecSearch(e); debouncedExecSearch(e);
}); });
},
initSearchState: function($searchInput) {
const currentSearchVal = $searchInput.val();
Issuable.searchState = {
elem: $searchInput,
current: currentSearchVal
};
Issuable.maybeFocusOnSearch();
},
accessSearchPristine: function(set) {
// store reference to previous value to prevent search on non-mutating keyup
const state = Issuable.searchState;
const currentSearchVal = state.elem.val();
if (set) {
state.current = currentSearchVal;
} else {
return state.current === currentSearchVal;
}
},
maybeFocusOnSearch: function() {
const currentSearchVal = Issuable.searchState.current;
if (currentSearchVal && currentSearchVal !== '') {
const queryLength = currentSearchVal.length;
const $searchInput = Issuable.searchState.elem;
/* The following ensures that the cursor is initially placed at
* the end of search input when focus is applied. It accounts
* for differences in browser implementations of `setSelectionRange`
* and cursor placement for elements in focus.
*/
$searchInput.focus();
if ($searchInput.setSelectionRange) {
$searchInput.setSelectionRange(queryLength, queryLength);
} else {
$searchInput.val(currentSearchVal);
}
}
}, },
executeSearch: function(e) { executeSearch: function(e) {
const $search = $('#issuable_search'); const $search = $('#issuable_search');
...@@ -32,6 +78,11 @@ ...@@ -32,6 +78,11 @@
const $searchValue = $search.val(); const $searchValue = $search.val();
const $filtersForm = $('.js-filter-form'); const $filtersForm = $('.js-filter-form');
const $input = $(`input[name='${$searchName}']`, $filtersForm); const $input = $(`input[name='${$searchName}']`, $filtersForm);
const isPristine = Issuable.accessSearchPristine();
if (isPristine) {
return;
}
if (!$input.length) { if (!$input.length) {
$filtersForm.append(`<input type='hidden' name='${$searchName}' value='${_.escape($searchValue)}'/>`); $filtersForm.append(`<input type='hidden' name='${$searchName}' value='${_.escape($searchValue)}'/>`);
......
/* eslint-disable */
(function() { (function() {
this.IssuableContext = (function() { this.IssuableContext = (function() {
function IssuableContext(currentUser) { function IssuableContext(currentUser) {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment