Commit 04eff5fd authored by Mike Greiling's avatar Mike Greiling

resolve all x-spacing and no-spaced-x eslint violations

parent 96931b17
/* eslint-disable func-names, space-before-function-paren, quotes, object-shorthand, camelcase, no-var, comma-dangle, prefer-arrow-callback, object-curly-spacing, quote-props, no-param-reassign, max-len */ /* eslint-disable func-names, space-before-function-paren, quotes, object-shorthand, camelcase, no-var, comma-dangle, prefer-arrow-callback, quote-props, no-param-reassign, max-len */
(function() { (function() {
var Api = { var Api = {
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
return $.ajax({ return $.ajax({
url: url, url: url,
type: "POST", type: "POST",
data: {'label': data}, data: { 'label': data },
dataType: "json" dataType: "json"
}).done(function(label) { }).done(function(label) {
return callback(label); return callback(label);
......
/* eslint-disable func-names, space-before-function-paren, wrap-iife, max-len, no-var, spaced-comment, prefer-arrow-callback, consistent-return, one-var, one-var-declaration-per-line, no-unused-vars, no-else-return, prefer-template, quotes, comma-dangle, no-param-reassign, no-void, radix, keyword-spacing, space-before-blocks, brace-style, no-underscore-dangle, no-return-assign, camelcase */ /* eslint-disable func-names, space-before-function-paren, wrap-iife, max-len, no-var, prefer-arrow-callback, consistent-return, one-var, one-var-declaration-per-line, no-unused-vars, no-else-return, prefer-template, quotes, comma-dangle, no-param-reassign, no-void, radix, brace-style, no-underscore-dangle, no-return-assign, camelcase */
/* global Cookies */ /* global Cookies */
(function() { (function() {
this.AwardsHandler = (function() { this.AwardsHandler = (function() {
var FROM_SENTENCE_REGEX = /(?:, and | and |, )/; //For separating lists produced by ruby's Array#toSentence var FROM_SENTENCE_REGEX = /(?:, and | and |, )/; // For separating lists produced by ruby's Array#toSentence
function AwardsHandler() { function AwardsHandler() {
this.aliases = gl.emojiAliases(); this.aliases = gl.emojiAliases();
$(document).off('click', '.js-add-award').on('click', '.js-add-award', (function(_this) { $(document).off('click', '.js-add-award').on('click', '.js-add-award', (function(_this) {
...@@ -211,10 +211,10 @@ ...@@ -211,10 +211,10 @@
}; };
AwardsHandler.prototype.toSentence = function(list) { AwardsHandler.prototype.toSentence = function(list) {
if(list.length <= 2){ if (list.length <= 2) {
return list.join(' and '); return list.join(' and ');
} }
else{ else {
return list.slice(0, -1).join(', ') + ', and ' + list[list.length - 1]; return list.slice(0, -1).join(', ') + ', and ' + list[list.length - 1];
} }
}; };
......
/* eslint-disable func-names, space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, camelcase, no-param-reassign, quotes, prefer-template, no-new, comma-dangle, one-var, one-var-declaration-per-line, prefer-arrow-callback, no-else-return, no-unused-vars, max-len */ /* eslint-disable func-names, space-before-function-paren, no-var, prefer-rest-params, wrap-iife, camelcase, no-param-reassign, quotes, prefer-template, no-new, comma-dangle, one-var, one-var-declaration-per-line, prefer-arrow-callback, no-else-return, no-unused-vars, max-len */
/* global ace */ /* global ace */
/* global BlobGitignoreSelectors */ /* global BlobGitignoreSelectors */
(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); }; };
this.EditBlob = (function() { this.EditBlob = (function() {
function EditBlob(assets_path, ace_mode) { function EditBlob(assets_path, ace_mode) {
......
/* eslint-disable wrap-iife, func-names, strict, no-var, vars-on-top, no-param-reassign, object-shorthand, no-shadow, comma-dangle, prefer-template, consistent-return, no-mixed-operators, no-unused-vars, object-curly-spacing, no-unused-expressions, prefer-arrow-callback, max-len */ /* eslint-disable wrap-iife, func-names, strict, no-var, vars-on-top, no-param-reassign, object-shorthand, no-shadow, comma-dangle, prefer-template, consistent-return, no-mixed-operators, no-unused-vars, no-unused-expressions, prefer-arrow-callback, max-len */
(function () { (function () {
'use strict'; 'use strict';
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
var startTime = new Date().getTime(); var startTime = new Date().getTime();
var duration = options.duration || 1000; var duration = options.duration || 1000;
simulateEvent(fromEl, 'mousedown', {button: 0}); simulateEvent(fromEl, 'mousedown', { button: 0 });
options.ontap && options.ontap(); options.ontap && options.ontap();
window.SIMULATE_DRAG_ACTIVE = 1; window.SIMULATE_DRAG_ACTIVE = 1;
......
/* eslint-disable func-names, space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, no-use-before-define, no-param-reassign, quotes, yoda, no-else-return, consistent-return, comma-dangle, object-shorthand, prefer-template, one-var, one-var-declaration-per-line, no-unused-vars, max-len, vars-on-top */ /* eslint-disable func-names, space-before-function-paren, no-var, prefer-rest-params, wrap-iife, no-use-before-define, no-param-reassign, quotes, yoda, no-else-return, consistent-return, comma-dangle, object-shorthand, prefer-template, one-var, one-var-declaration-per-line, no-unused-vars, max-len, vars-on-top */
/* global Breakpoints */ /* global Breakpoints */
/* global Turbolinks */ /* global Turbolinks */
(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); }; };
var AUTO_SCROLL_OFFSET = 75; var AUTO_SCROLL_OFFSET = 75;
var DOWN_BUILD_TRACE = '#down-build-trace'; var DOWN_BUILD_TRACE = '#down-build-trace';
......
/* eslint-disable func-names, prefer-arrow-callback, space-before-blocks, space-before-function-paren, comma-spacing, max-len */ /* eslint-disable func-names, prefer-arrow-callback, space-before-function-paren */
$(function(){ $(function() {
$('.reveal-variables').off('click').on('click',function(){ $('.reveal-variables').off('click').on('click', function() {
$('.js-build').toggle().niceScroll(); $('.js-build').toggle().niceScroll();
$(this).hide(); $(this).hide();
}); });
......
/* eslint-disable func-names, space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, max-len, one-var, one-var-declaration-per-line, quotes, prefer-template, newline-per-chained-call, comma-dangle, new-cap, no-else-return, consistent-return */ /* eslint-disable func-names, space-before-function-paren, no-var, prefer-rest-params, wrap-iife, max-len, one-var, one-var-declaration-per-line, quotes, prefer-template, newline-per-chained-call, comma-dangle, new-cap, no-else-return, consistent-return */
/* global FilesCommentButton */ /* global FilesCommentButton */
(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); }; };
this.FilesCommentButton = (function() { this.FilesCommentButton = (function() {
var COMMENT_BUTTON_CLASS, COMMENT_BUTTON_TEMPLATE, DEBOUNCE_TIMEOUT_DURATION, EMPTY_CELL_CLASS, LINE_COLUMN_CLASSES, LINE_CONTENT_CLASS, LINE_HOLDER_CLASS, LINE_NUMBER_CLASS, OLD_LINE_CLASS, TEXT_FILE_SELECTOR, UNFOLDABLE_LINE_CLASS; var COMMENT_BUTTON_CLASS, COMMENT_BUTTON_TEMPLATE, DEBOUNCE_TIMEOUT_DURATION, EMPTY_CELL_CLASS, LINE_COLUMN_CLASSES, LINE_CONTENT_CLASS, LINE_HOLDER_CLASS, LINE_NUMBER_CLASS, OLD_LINE_CLASS, TEXT_FILE_SELECTOR, UNFOLDABLE_LINE_CLASS;
......
/* eslint-disable func-names, space-before-function-paren, no-template-curly-in-string, comma-dangle, object-shorthand, quotes, dot-notation, no-else-return, one-var, no-var, no-underscore-dangle, one-var-declaration-per-line, no-param-reassign, no-useless-escape, prefer-template, consistent-return, wrap-iife, prefer-arrow-callback, camelcase, no-unused-vars, no-useless-return, vars-on-top, no-multi-spaces, max-len */ /* eslint-disable func-names, space-before-function-paren, no-template-curly-in-string, comma-dangle, object-shorthand, quotes, dot-notation, no-else-return, one-var, no-var, no-underscore-dangle, one-var-declaration-per-line, no-param-reassign, no-useless-escape, prefer-template, consistent-return, wrap-iife, prefer-arrow-callback, camelcase, no-unused-vars, no-useless-return, vars-on-top, max-len */
// Creates the variables for setting up GFM auto-completion // Creates the variables for setting up GFM auto-completion
(function() { (function() {
......
/* eslint-disable func-names, space-before-function-paren, no-var, one-var, one-var-declaration-per-line, space-before-blocks, prefer-rest-params, max-len, vars-on-top, wrap-iife, no-unused-vars, quotes, no-shadow, no-cond-assign, prefer-arrow-callback, no-return-assign, no-else-return, camelcase, comma-dangle, no-lonely-if, guard-for-in, no-restricted-syntax, consistent-return, prefer-template, no-param-reassign, no-loop-func, keyword-spacing, no-mixed-operators */ /* eslint-disable func-names, space-before-function-paren, no-var, one-var, one-var-declaration-per-line, prefer-rest-params, max-len, vars-on-top, wrap-iife, no-unused-vars, quotes, no-shadow, no-cond-assign, prefer-arrow-callback, no-return-assign, no-else-return, camelcase, comma-dangle, no-lonely-if, guard-for-in, no-restricted-syntax, consistent-return, prefer-template, no-param-reassign, no-loop-func, no-mixed-operators */
/* global fuzzaldrinPlus */ /* global fuzzaldrinPlus */
/* global Turbolinks */ /* global Turbolinks */
(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); }; },
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i += 1) { if (i in this && this[i] === item) return i; } return -1; }; indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i += 1) { if (i in this && this[i] === item) return i; } return -1; };
GitLabDropdownFilter = (function() { GitLabDropdownFilter = (function() {
...@@ -639,7 +639,7 @@ ...@@ -639,7 +639,7 @@
: selectedObject.id; : selectedObject.id;
if (isInput) { if (isInput) {
field = $(this.el); field = $(this.el);
} else if(value) { } else if (value) {
field = this.dropdown.parent().find("input[name='" + fieldName + "'][value='" + value.toString().replace(/'/g, '\\\'') + "']"); field = this.dropdown.parent().find("input[name='" + fieldName + "'][value='" + value.toString().replace(/'/g, '\\\'') + "']");
} }
......
/* eslint-disable func-names, space-before-function-paren, one-var, no-var, space-before-blocks, prefer-rest-params, max-len, no-restricted-syntax, vars-on-top, no-use-before-define, no-param-reassign, new-cap, no-underscore-dangle, wrap-iife, comma-dangle, no-return-assign, prefer-arrow-callback, quotes, prefer-template, newline-per-chained-call, no-else-return */ /* eslint-disable func-names, space-before-function-paren, one-var, no-var, prefer-rest-params, max-len, no-restricted-syntax, vars-on-top, no-use-before-define, no-param-reassign, new-cap, no-underscore-dangle, wrap-iife, comma-dangle, no-return-assign, prefer-arrow-callback, quotes, prefer-template, newline-per-chained-call, no-else-return */
/* global d3 */ /* global d3 */
/* global ContributorsGraph */ /* global ContributorsGraph */
/*= require d3 */ /*= require d3 */
(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); }; },
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty; hasProp = {}.hasOwnProperty;
......
/* eslint-disable func-names, space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, no-use-before-define, no-useless-escape, no-new, quotes, object-shorthand, no-unused-vars, comma-dangle, radix, no-alert, consistent-return, no-else-return, prefer-template, one-var, one-var-declaration-per-line, curly, max-len */ /* eslint-disable func-names, space-before-function-paren, no-var, prefer-rest-params, wrap-iife, no-use-before-define, no-useless-escape, no-new, quotes, object-shorthand, no-unused-vars, comma-dangle, radix, no-alert, consistent-return, no-else-return, prefer-template, one-var, one-var-declaration-per-line, curly, max-len */
/* global GitLab */ /* global GitLab */
/* global UsersSelect */ /* global UsersSelect */
/* global ZenMode */ /* global ZenMode */
/* global Autosave */ /* global Autosave */
(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); }; };
this.IssuableForm = (function() { this.IssuableForm = (function() {
IssuableForm.prototype.issueMoveConfirmMsg = 'Are you sure you want to move this issue to another project?'; IssuableForm.prototype.issueMoveConfirmMsg = 'Are you sure you want to move this issue to another project?';
......
/* eslint-disable func-names, space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, one-var, no-underscore-dangle, one-var-declaration-per-line, object-shorthand, no-unused-vars, no-new, comma-dangle, consistent-return, quotes, dot-notation, quote-props, prefer-arrow-callback, max-len */ /* eslint-disable func-names, space-before-function-paren, no-var, prefer-rest-params, wrap-iife, one-var, no-underscore-dangle, one-var-declaration-per-line, object-shorthand, no-unused-vars, no-new, comma-dangle, consistent-return, quotes, dot-notation, quote-props, prefer-arrow-callback, max-len */
/* global Flash */ /* global Flash */
/*= require flash */ /*= require flash */
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
/*= require task_list */ /*= require task_list */
(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); }; };
this.Issue = (function() { this.Issue = (function() {
function Issue() { function Issue() {
......
/* eslint-disable func-names, space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, vars-on-top, no-unused-vars, max-len */ /* eslint-disable func-names, space-before-function-paren, no-var, prefer-rest-params, wrap-iife, vars-on-top, no-unused-vars, max-len */
(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); }; };
this.Labels = (function() { this.Labels = (function() {
function Labels() { function Labels() {
......
/* eslint-disable func-names, space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, no-use-before-define, no-underscore-dangle, no-param-reassign, prefer-template, quotes, comma-dangle, prefer-arrow-callback, consistent-return, one-var, one-var-declaration-per-line, spaced-comment, radix, no-else-return, max-len */ /* eslint-disable func-names, space-before-function-paren, no-var, prefer-rest-params, wrap-iife, no-use-before-define, no-underscore-dangle, no-param-reassign, prefer-template, quotes, comma-dangle, prefer-arrow-callback, consistent-return, one-var, one-var-declaration-per-line, radix, no-else-return, max-len */
// LineHighlighter // LineHighlighter
// //
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
// </div> // </div>
// //
(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); }; };
this.LineHighlighter = (function() { this.LineHighlighter = (function() {
// CSS class applied to highlighted lines // CSS class applied to highlighted lines
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
// Returns an Array // Returns an Array
LineHighlighter.prototype.hashToRange = function(hash) { LineHighlighter.prototype.hashToRange = function(hash) {
var first, last, matches; var first, last, matches;
//?L(\d+)(?:-(\d+))?$/) // ?L(\d+)(?:-(\d+))?$/)
matches = hash.match(/^#?L(\d+)(?:-(\d+))?$/); matches = hash.match(/^#?L(\d+)(?:-(\d+))?$/);
if (matches && matches.length) { if (matches && matches.length) {
first = parseInt(matches[1]); first = parseInt(matches[1]);
......
/* eslint-disable comma-dangle, object-shorthand, no-dupe-keys, no-param-reassign, camelcase, prefer-const, no-nested-ternary, no-continue, func-call-spacing, no-spaced-func, max-len */ /* eslint-disable comma-dangle, object-shorthand, no-dupe-keys, no-param-reassign, camelcase, prefer-const, no-nested-ternary, no-continue, max-len */
/* global Cookies */ /* global Cookies */
/* global Vue */ /* global Vue */
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
} else { } else {
const lineType = type || 'context'; const lineType = type || 'context';
linesObj.left.push (this.getLineForParallelView(line, id, lineType)); linesObj.left.push(this.getLineForParallelView(line, id, lineType));
linesObj.right.push(this.getLineForParallelView(line, id, lineType, true)); linesObj.right.push(this.getLineForParallelView(line, id, lineType, true));
} }
}); });
......
/* eslint-disable func-names, space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, quotes, no-underscore-dangle, one-var, one-var-declaration-per-line, consistent-return, dot-notation, quote-props, comma-dangle, object-shorthand, max-len, prefer-arrow-callback */ /* eslint-disable func-names, space-before-function-paren, no-var, prefer-rest-params, wrap-iife, quotes, no-underscore-dangle, one-var, one-var-declaration-per-line, consistent-return, dot-notation, quote-props, comma-dangle, object-shorthand, max-len, prefer-arrow-callback */
/* global MergeRequestTabs */ /* global MergeRequestTabs */
/*= require jquery.waitforimages */ /*= require jquery.waitforimages */
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
/*= require merge_request_tabs */ /*= require merge_request_tabs */
(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); }; };
this.MergeRequest = (function() { this.MergeRequest = (function() {
function MergeRequest(opts) { function MergeRequest(opts) {
......
/* eslint-disable max-len, no-var, func-names, space-before-function-paren, vars-on-top, comma-dangle, no-return-assign, consistent-return, no-param-reassign, one-var, one-var-declaration-per-line, quotes, prefer-template, no-else-return, prefer-arrow-callback, no-unused-vars, no-underscore-dangle, no-shadow, no-mixed-operators, template-curly-spacing, camelcase, default-case, wrap-iife */ /* eslint-disable max-len, no-var, func-names, space-before-function-paren, vars-on-top, comma-dangle, no-return-assign, consistent-return, no-param-reassign, one-var, one-var-declaration-per-line, quotes, prefer-template, no-else-return, prefer-arrow-callback, no-unused-vars, no-underscore-dangle, no-shadow, no-mixed-operators, camelcase, default-case, wrap-iife */
/* global notify */ /* global notify */
/* global notifyPermissions */ /* global notifyPermissions */
/* global merge_request_widget */ /* global merge_request_widget */
...@@ -189,7 +189,7 @@ ...@@ -189,7 +189,7 @@
MergeRequestWidget.prototype.renderEnvironments = function(environments) { MergeRequestWidget.prototype.renderEnvironments = function(environments) {
for (let i = 0; i < environments.length; i += 1) { for (let i = 0; i < environments.length; i += 1) {
const environment = environments[i]; const environment = environments[i];
if ($(`.mr-state-widget #${ environment.id }`).length) return; if ($(`.mr-state-widget #${environment.id}`).length) return;
const $template = $(DEPLOYMENT_TEMPLATE); const $template = $(DEPLOYMENT_TEMPLATE);
if (!environment.external_url || !environment.external_url_formatted) $('.js-environment-link', $template).remove(); if (!environment.external_url || !environment.external_url_formatted) $('.js-environment-link', $template).remove();
......
/* eslint-disable func-names, space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, max-len */ /* eslint-disable func-names, space-before-function-paren, no-var, prefer-rest-params, wrap-iife, max-len */
(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); }; };
this.MergedButtons = (function() { this.MergedButtons = (function() {
function MergedButtons() { function MergedButtons() {
......
/* eslint-disable func-names, space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, one-var, vars-on-top, one-var-declaration-per-line, comma-dangle, object-shorthand, no-else-return, prefer-template, quotes, prefer-arrow-callback, no-param-reassign, no-cond-assign, max-len */ /* eslint-disable func-names, space-before-function-paren, no-var, prefer-rest-params, wrap-iife, one-var, vars-on-top, one-var-declaration-per-line, comma-dangle, object-shorthand, no-else-return, prefer-template, quotes, prefer-arrow-callback, no-param-reassign, no-cond-assign, max-len */
/* global Api */ /* global Api */
(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); }; };
window.NamespaceSelect = (function() { window.NamespaceSelect = (function() {
function NamespaceSelect(opts) { function NamespaceSelect(opts) {
......
/* eslint-disable func-names, space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, quotes, comma-dangle, one-var, one-var-declaration-per-line, no-mixed-operators, new-cap, no-loop-func, no-floating-decimal, consistent-return, no-unused-vars, prefer-template, prefer-arrow-callback, camelcase, max-len */ /* eslint-disable func-names, space-before-function-paren, no-var, prefer-rest-params, wrap-iife, quotes, comma-dangle, one-var, one-var-declaration-per-line, no-mixed-operators, new-cap, no-loop-func, no-floating-decimal, consistent-return, no-unused-vars, prefer-template, prefer-arrow-callback, camelcase, max-len */
/* global Raphael */ /* global Raphael */
(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); }; };
this.BranchGraph = (function() { this.BranchGraph = (function() {
function BranchGraph(element1, options1) { function BranchGraph(element1, options1) {
......
/* eslint-disable func-names, space-before-function-paren, no-var, one-var, space-before-blocks, prefer-rest-params, max-len, vars-on-top, wrap-iife, consistent-return, comma-dangle, one-var-declaration-per-line, quotes, no-return-assign, prefer-arrow-callback, prefer-template, no-shadow, no-else-return, max-len */ /* eslint-disable func-names, space-before-function-paren, no-var, one-var, prefer-rest-params, max-len, vars-on-top, wrap-iife, consistent-return, comma-dangle, one-var-declaration-per-line, quotes, no-return-assign, prefer-arrow-callback, prefer-template, no-shadow, no-else-return, max-len */
(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); }; },
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i += 1) { if (i in this && this[i] === item) return i; } return -1; }; indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i += 1) { if (i in this && this[i] === item) return i; } return -1; };
this.NewBranchForm = (function() { this.NewBranchForm = (function() {
......
/* eslint-disable func-names, space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, no-return-assign, max-len */ /* eslint-disable func-names, space-before-function-paren, no-var, prefer-rest-params, wrap-iife, no-return-assign, max-len */
(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); }; };
this.NewCommitForm = (function() { this.NewCommitForm = (function() {
function NewCommitForm(form) { function NewCommitForm(form) {
......
/* eslint-disable no-restricted-properties, func-names, space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, no-use-before-define, camelcase, no-unused-expressions, quotes, max-len, one-var, one-var-declaration-per-line, default-case, prefer-template, consistent-return, no-alert, no-return-assign, no-param-reassign, prefer-arrow-callback, no-else-return, comma-dangle, no-new, brace-style, no-lonely-if, vars-on-top, no-unused-vars, no-sequences, no-shadow, newline-per-chained-call, no-useless-escape, radix */ /* eslint-disable no-restricted-properties, func-names, space-before-function-paren, no-var, prefer-rest-params, wrap-iife, no-use-before-define, camelcase, no-unused-expressions, quotes, max-len, one-var, one-var-declaration-per-line, default-case, prefer-template, consistent-return, no-alert, no-return-assign, no-param-reassign, prefer-arrow-callback, no-else-return, comma-dangle, no-new, brace-style, no-lonely-if, vars-on-top, no-unused-vars, no-sequences, no-shadow, newline-per-chained-call, no-useless-escape, radix */
/* global Flash */ /* global Flash */
/* global GLForm */ /* global GLForm */
/* global Autosave */ /* global Autosave */
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
/*= require task_list */ /*= require task_list */
(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); }; };
this.Notes = (function() { this.Notes = (function() {
const MAX_VISIBLE_COMMIT_LIST_COUNT = 3; const MAX_VISIBLE_COMMIT_LIST_COUNT = 3;
......
/* eslint-disable func-names, space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, one-var, one-var-declaration-per-line, newline-per-chained-call, comma-dangle, consistent-return, prefer-arrow-callback, max-len */ /* eslint-disable func-names, space-before-function-paren, no-var, prefer-rest-params, wrap-iife, one-var, one-var-declaration-per-line, newline-per-chained-call, comma-dangle, consistent-return, prefer-arrow-callback, max-len */
(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); }; };
this.NotificationsForm = (function() { this.NotificationsForm = (function() {
function NotificationsForm() { function NotificationsForm() {
......
/* eslint-disable func-names, space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, quotes, consistent-return, one-var, one-var-declaration-per-line, no-cond-assign, max-len, object-shorthand, no-param-reassign, comma-dangle, prefer-template, no-unused-vars, no-return-assign */ /* eslint-disable func-names, space-before-function-paren, no-var, prefer-rest-params, wrap-iife, quotes, consistent-return, one-var, one-var-declaration-per-line, no-cond-assign, max-len, object-shorthand, no-param-reassign, comma-dangle, prefer-template, no-unused-vars, no-return-assign */
/* global fuzzaldrinPlus */ /* global fuzzaldrinPlus */
(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); }; };
this.ProjectFindFile = (function() { this.ProjectFindFile = (function() {
var highlighter; var highlighter;
......
/* eslint-disable func-names, space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, no-unused-vars, one-var, no-underscore-dangle, prefer-template, no-else-return, prefer-arrow-callback, radix, max-len */ /* eslint-disable func-names, space-before-function-paren, no-var, prefer-rest-params, wrap-iife, no-unused-vars, one-var, no-underscore-dangle, prefer-template, no-else-return, prefer-arrow-callback, radix, max-len */
(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); }; };
this.ProjectNew = (function() { this.ProjectNew = (function() {
function ProjectNew() { function ProjectNew() {
......
/* eslint-disable func-names, space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, no-unused-vars, consistent-return, one-var, one-var-declaration-per-line, quotes, prefer-template, object-shorthand, comma-dangle, no-else-return, no-param-reassign, max-len */ /* eslint-disable func-names, space-before-function-paren, no-var, prefer-rest-params, wrap-iife, no-unused-vars, consistent-return, one-var, one-var-declaration-per-line, quotes, prefer-template, object-shorthand, comma-dangle, no-else-return, no-param-reassign, max-len */
/* global Cookies */ /* global Cookies */
(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); }; };
this.Sidebar = (function() { this.Sidebar = (function() {
function Sidebar(currentUser) { function Sidebar(currentUser) {
......
/* eslint-disable func-names, space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, quotes, prefer-arrow-callback, consistent-return, object-shorthand, no-unused-vars, one-var, one-var-declaration-per-line, no-else-return, comma-dangle, max-len */ /* eslint-disable func-names, space-before-function-paren, no-var, prefer-rest-params, wrap-iife, quotes, prefer-arrow-callback, consistent-return, object-shorthand, no-unused-vars, one-var, one-var-declaration-per-line, no-else-return, comma-dangle, max-len */
/* global Mousetrap */ /* global Mousetrap */
/* global Turbolinks */ /* global Turbolinks */
/* global findFileURL */ /* global findFileURL */
(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); }; };
this.Shortcuts = (function() { this.Shortcuts = (function() {
function Shortcuts(skipResetBindings) { function Shortcuts(skipResetBindings) {
......
/* eslint-disable func-names, prefer-arrow-callback, space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, one-var, one-var-declaration-per-line, consistent-return, no-param-reassign, max-len */ /* eslint-disable func-names, prefer-arrow-callback, space-before-function-paren, no-var, prefer-rest-params, wrap-iife, one-var, one-var-declaration-per-line, consistent-return, no-param-reassign, max-len */
(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); }; };
window.SingleFileDiff = (function() { window.SingleFileDiff = (function() {
var COLLAPSED_HTML, ERROR_HTML, LOADING_HTML, WRAPPER; var COLLAPSED_HTML, ERROR_HTML, LOADING_HTML, WRAPPER;
......
/* eslint-disable prefer-const, comma-dangle, max-len, no-useless-return, object-curly-spacing, no-param-reassign, max-len */ /* eslint-disable prefer-const, comma-dangle, max-len, no-useless-return, no-param-reassign, max-len */
/* global Api */ /* global Api */
/*= require ../blob/template_selector */ /*= require ../blob/template_selector */
...@@ -47,10 +47,10 @@ ...@@ -47,10 +47,10 @@
// If the title has not yet been set, focus the title input and // If the title has not yet been set, focus the title input and
// skip focusing the description input by setting `true` as the // skip focusing the description input by setting `true` as the
// `skipFocus` option to `requestFileSuccess`. // `skipFocus` option to `requestFileSuccess`.
this.requestFileSuccess(this.currentTemplate, {skipFocus: true}); this.requestFileSuccess(this.currentTemplate, { skipFocus: true });
this.titleInput.focus(); this.titleInput.focus();
} else { } else {
this.requestFileSuccess(this.currentTemplate, {skipFocus: false}); this.requestFileSuccess(this.currentTemplate, { skipFocus: false });
} }
return; return;
} }
......
/* eslint-disable func-names, space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, prefer-arrow-callback, no-else-return, quotes, quote-props, comma-dangle, one-var, one-var-declaration-per-line, max-len */ /* eslint-disable func-names, space-before-function-paren, no-var, prefer-rest-params, wrap-iife, prefer-arrow-callback, no-else-return, quotes, quote-props, comma-dangle, one-var, one-var-declaration-per-line, max-len */
/* global u2f */ /* global u2f */
/* global U2FError */ /* global U2FError */
/* global U2FUtil */ /* global U2FUtil */
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
(function() { (function() {
const global = window.gl || (window.gl = {}); const global = window.gl || (window.gl = {});
var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; var bind = function(fn, me) { return function() { return fn.apply(me, arguments); }; };
global.U2FAuthenticate = (function() { global.U2FAuthenticate = (function() {
function U2FAuthenticate(container, form, u2fParams, fallbackButton, fallbackUI) { function U2FAuthenticate(container, form, u2fParams, fallbackButton, fallbackUI) {
......
/* eslint-disable func-names, space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, no-console, quotes, prefer-template, max-len */ /* eslint-disable func-names, space-before-function-paren, no-var, prefer-rest-params, wrap-iife, no-console, quotes, prefer-template, max-len */
/* global u2f */ /* global u2f */
(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); }; };
this.U2FError = (function() { this.U2FError = (function() {
function U2FError(errorCode) { function U2FError(errorCode) {
......
/* eslint-disable func-names, space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, no-else-return, quotes, quote-props, comma-dangle, one-var, one-var-declaration-per-line, max-len */ /* eslint-disable func-names, space-before-function-paren, no-var, prefer-rest-params, wrap-iife, no-else-return, quotes, quote-props, comma-dangle, one-var, one-var-declaration-per-line, max-len */
/* global u2f */ /* global u2f */
/* global U2FError */ /* global U2FError */
/* global U2FUtil */ /* global U2FUtil */
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
// State Flow #1: setup -> in_progress -> registered -> POST to server // State Flow #1: setup -> in_progress -> registered -> POST to server
// State Flow #2: setup -> in_progress -> error -> setup // State Flow #2: setup -> in_progress -> error -> setup
(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); }; };
this.U2FRegister = (function() { this.U2FRegister = (function() {
function U2FRegister(container, u2fParams) { function U2FRegister(container, u2fParams) {
......
/* eslint-disable max-len, space-before-function-paren, no-underscore-dangle, array-bracket-spacing, consistent-return, comma-dangle, no-unused-vars, dot-notation, no-new, no-return-assign, camelcase, no-param-reassign */ /* eslint-disable max-len, space-before-function-paren, no-underscore-dangle, consistent-return, comma-dangle, no-unused-vars, dot-notation, no-new, no-return-assign, camelcase, no-param-reassign */
/* /*
UserTabs UserTabs
...@@ -107,7 +107,7 @@ content on the Users#show page. ...@@ -107,7 +107,7 @@ content on the Users#show page.
this.loadActivities(source); this.loadActivities(source);
} }
const loadableActions = [ 'groups', 'contributed', 'projects', 'snippets' ]; const loadableActions = ['groups', 'contributed', 'projects', 'snippets'];
if (loadableActions.indexOf(action) > -1) { if (loadableActions.indexOf(action) > -1) {
return this.loadTab(source, action); return this.loadTab(source, action);
} }
......
/* eslint-disable func-names, space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, camelcase, vars-on-top, keyword-spacing, object-shorthand, comma-dangle, eqeqeq, no-mixed-operators, no-return-assign, newline-per-chained-call, prefer-arrow-callback, consistent-return, one-var, one-var-declaration-per-line, prefer-template, quotes, no-unused-vars, no-else-return, max-len */ /* eslint-disable func-names, space-before-function-paren, no-var, prefer-rest-params, wrap-iife, camelcase, vars-on-top, object-shorthand, comma-dangle, eqeqeq, no-mixed-operators, no-return-assign, newline-per-chained-call, prefer-arrow-callback, consistent-return, one-var, one-var-declaration-per-line, prefer-template, quotes, no-unused-vars, no-else-return, max-len */
/* global d3 */ /* global d3 */
/* global dateFormat */ /* global dateFormat */
(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); }; };
this.Calendar = (function() { this.Calendar = (function() {
function Calendar(timestamps, calendar_activities_path) { function Calendar(timestamps, calendar_activities_path) {
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
var days = gl.utils.getDayDifference(oneYearAgo, today); var days = gl.utils.getDayDifference(oneYearAgo, today);
for(var i = 0; i <= days; i += 1) { for (var i = 0; i <= days; i += 1) {
var date = new Date(oneYearAgo); var date = new Date(oneYearAgo);
date.setDate(date.getDate() + i); date.setDate(date.getDate() + i);
......
/* eslint-disable func-names, space-before-function-paren, one-var, no-var, space-before-blocks, prefer-rest-params, wrap-iife, quotes, max-len, one-var-declaration-per-line, vars-on-top, prefer-arrow-callback, consistent-return, comma-dangle, object-shorthand, no-shadow, no-unused-vars, no-else-return, no-self-compare, prefer-template, no-unused-expressions, no-lonely-if, yoda, prefer-spread, no-void, camelcase, keyword-spacing, no-param-reassign */ /* eslint-disable func-names, space-before-function-paren, one-var, no-var, prefer-rest-params, wrap-iife, quotes, max-len, one-var-declaration-per-line, vars-on-top, prefer-arrow-callback, consistent-return, comma-dangle, object-shorthand, no-shadow, no-unused-vars, no-else-return, no-self-compare, prefer-template, no-unused-expressions, no-lonely-if, yoda, prefer-spread, no-void, camelcase, no-param-reassign */
/* global Vue */ /* global Vue */
/* global Issuable */ /* global Issuable */
/* global ListUser */ /* global ListUser */
(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); }; },
slice = [].slice; slice = [].slice;
this.UsersSelect = (function() { this.UsersSelect = (function() {
...@@ -371,7 +371,7 @@ ...@@ -371,7 +371,7 @@
}; };
UsersSelect.prototype.user = function(user_id, callback) { UsersSelect.prototype.user = function(user_id, callback) {
if(!/^\d+$/.test(user_id)) { if (!/^\d+$/.test(user_id)) {
return false; return false;
} }
......
/* eslint-disable no-unused-expressions, comma-spacing, prefer-const, no-prototype-builtins, no-new, keyword-spacing, no-shadow, max-len */ /* eslint-disable no-unused-expressions, prefer-const, no-prototype-builtins, no-new, no-shadow, max-len */
/*= require js.cookie.js */ /*= require js.cookie.js */
/*= require jquery.endless-scroll.js */ /*= require jquery.endless-scroll.js */
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
name: 'merge events', name: 'merge events',
}, { }, {
id: 'comments', id: 'comments',
},{ }, {
id: 'team', id: 'team',
}]; }];
...@@ -39,14 +39,14 @@ ...@@ -39,14 +39,14 @@
new gl.Activities(); new gl.Activities();
}); });
for(let i = 0; i < filters.length; i += 1) { for (let i = 0; i < filters.length; i += 1) {
((i) => { ((i) => {
describe(`when selecting ${getEventName(i)}`, () => { describe(`when selecting ${getEventName(i)}`, () => {
beforeEach(() => { beforeEach(() => {
$(getSelector(i)).click(); $(getSelector(i)).click();
}); });
for(let x = 0; x < filters.length; x += 1) { for (let x = 0; x < filters.length; x += 1) {
((x) => { ((x) => {
let shouldHighlight = i === x; let shouldHighlight = i === x;
let testName = shouldHighlight ? 'should highlight' : 'should not highlight'; let testName = shouldHighlight ? 'should highlight' : 'should not highlight';
......
/* eslint-disable comma-dangle, prefer-const, no-param-reassign, no-unused-expressions, arrow-spacing, max-len */ /* eslint-disable comma-dangle, prefer-const, no-param-reassign, no-unused-expressions, max-len */
/* global Turbolinks */ /* global Turbolinks */
/*= require jquery */ /*= require jquery */
...@@ -140,18 +140,18 @@ ...@@ -140,18 +140,18 @@
this.dropdownButtonElement.click(); this.dropdownButtonElement.click();
}); });
it('should not focus search input while remote task is not complete', ()=> { it('should not focus search input while remote task is not complete', () => {
expect($(document.activeElement)).not.toEqual($(SEARCH_INPUT_SELECTOR)); expect($(document.activeElement)).not.toEqual($(SEARCH_INPUT_SELECTOR));
remoteCallback(); remoteCallback();
expect($(document.activeElement)).toEqual($(SEARCH_INPUT_SELECTOR)); expect($(document.activeElement)).toEqual($(SEARCH_INPUT_SELECTOR));
}); });
it('should focus search input after remote task is complete', ()=> { it('should focus search input after remote task is complete', () => {
remoteCallback(); remoteCallback();
expect($(document.activeElement)).toEqual($(SEARCH_INPUT_SELECTOR)); expect($(document.activeElement)).toEqual($(SEARCH_INPUT_SELECTOR));
}); });
it('should focus on input when opening for the second time', ()=> { it('should focus on input when opening for the second time', () => {
remoteCallback(); remoteCallback();
this.dropdownContainerElement.trigger({ this.dropdownContainerElement.trigger({
type: 'keyup', type: 'keyup',
...@@ -164,7 +164,7 @@ ...@@ -164,7 +164,7 @@
}); });
describe('input focus with array data', () => { describe('input focus with array data', () => {
it('should focus input when passing array data to drop down', ()=> { it('should focus input when passing array data to drop down', () => {
initDropDown.call(this, false, true); initDropDown.call(this, false, true);
this.dropdownButtonElement.click(); this.dropdownButtonElement.click();
expect($(document.activeElement)).toEqual($(SEARCH_INPUT_SELECTOR)); expect($(document.activeElement)).toEqual($(SEARCH_INPUT_SELECTOR));
......
/* eslint-disable quotes, object-curly-spacing, jasmine/no-suite-dupes, vars-on-top, no-var, spaced-comment, max-len */ /* eslint-disable quotes, jasmine/no-suite-dupes, vars-on-top, no-var, max-len */
/* global d3 */ /* global d3 */
/* global ContributorsGraph */ /* global ContributorsGraph */
/* global ContributorsMasterGraph */ /* global ContributorsMasterGraph */
...@@ -15,21 +15,21 @@ describe("ContributorsGraph", function () { ...@@ -15,21 +15,21 @@ describe("ContributorsGraph", function () {
describe("#set_y_domain", function () { describe("#set_y_domain", function () {
it("sets the y_domain", function () { it("sets the y_domain", function () {
ContributorsGraph.set_y_domain([{commits: 30}]); ContributorsGraph.set_y_domain([{ commits: 30 }]);
expect(ContributorsGraph.prototype.y_domain).toEqual([0, 30]); expect(ContributorsGraph.prototype.y_domain).toEqual([0, 30]);
}); });
}); });
describe("#init_x_domain", function () { describe("#init_x_domain", function () {
it("sets the initial x_domain", function () { it("sets the initial x_domain", function () {
ContributorsGraph.init_x_domain([{date: "2013-01-31"}, {date: "2012-01-31"}]); ContributorsGraph.init_x_domain([{ date: "2013-01-31" }, { date: "2012-01-31" }]);
expect(ContributorsGraph.prototype.x_domain).toEqual(["2012-01-31", "2013-01-31"]); expect(ContributorsGraph.prototype.x_domain).toEqual(["2012-01-31", "2013-01-31"]);
}); });
}); });
describe("#init_y_domain", function () { describe("#init_y_domain", function () {
it("sets the initial y_domain", function () { it("sets the initial y_domain", function () {
ContributorsGraph.init_y_domain([{commits: 30}]); ContributorsGraph.init_y_domain([{ commits: 30 }]);
expect(ContributorsGraph.prototype.y_domain).toEqual([0, 30]); expect(ContributorsGraph.prototype.y_domain).toEqual([0, 30]);
}); });
}); });
...@@ -95,24 +95,24 @@ describe("ContributorsGraph", function () { ...@@ -95,24 +95,24 @@ describe("ContributorsGraph", function () {
describe("ContributorsMasterGraph", function () { describe("ContributorsMasterGraph", function () {
// TODO: fix or remove // TODO: fix or remove
//describe("#process_dates", function () { // describe("#process_dates", function () {
//it("gets and parses dates", function () { // it("gets and parses dates", function () {
//var graph = new ContributorsMasterGraph(); // var graph = new ContributorsMasterGraph();
//var data = 'random data here'; // var data = 'random data here';
//spyOn(graph, 'parse_dates'); // spyOn(graph, 'parse_dates');
//spyOn(graph, 'get_dates').andReturn("get"); // spyOn(graph, 'get_dates').andReturn("get");
//spyOn(ContributorsGraph,'set_dates').andCallThrough(); // spyOn(ContributorsGraph,'set_dates').andCallThrough();
//graph.process_dates(data); // graph.process_dates(data);
//expect(graph.parse_dates).toHaveBeenCalledWith(data); // expect(graph.parse_dates).toHaveBeenCalledWith(data);
//expect(graph.get_dates).toHaveBeenCalledWith(data); // expect(graph.get_dates).toHaveBeenCalledWith(data);
//expect(ContributorsGraph.set_dates).toHaveBeenCalledWith("get"); // expect(ContributorsGraph.set_dates).toHaveBeenCalledWith("get");
//}); // });
//}); // });
describe("#get_dates", function () { describe("#get_dates", function () {
it("plucks the date field from data collection", function () { it("plucks the date field from data collection", function () {
var graph = new ContributorsMasterGraph(); var graph = new ContributorsMasterGraph();
var data = [{date: "2013-01-01"}, {date: "2012-12-15"}]; var data = [{ date: "2013-01-01" }, { date: "2012-12-15" }];
expect(graph.get_dates(data)).toEqual(["2013-01-01", "2012-12-15"]); expect(graph.get_dates(data)).toEqual(["2013-01-01", "2012-12-15"]);
}); });
}); });
...@@ -121,8 +121,8 @@ describe("ContributorsMasterGraph", function () { ...@@ -121,8 +121,8 @@ describe("ContributorsMasterGraph", function () {
it("parses the dates", function () { it("parses the dates", function () {
var graph = new ContributorsMasterGraph(); var graph = new ContributorsMasterGraph();
var parseDate = d3.time.format("%Y-%m-%d").parse; var parseDate = d3.time.format("%Y-%m-%d").parse;
var data = [{date: "2013-01-01"}, {date: "2012-12-15"}]; var data = [{ date: "2013-01-01" }, { date: "2012-12-15" }];
var correct = [{date: parseDate(data[0].date)}, {date: parseDate(data[1].date)}]; var correct = [{ date: parseDate(data[0].date) }, { date: parseDate(data[1].date) }];
graph.parse_dates(data); graph.parse_dates(data);
expect(data).toEqual(correct); expect(data).toEqual(correct);
}); });
......
/* eslint-disable no-new, object-curly-spacing, prefer-const */ /* eslint-disable no-new, prefer-const */
/* global IssuableContext */ /* global IssuableContext */
/* global LabelsSelect */ /* global LabelsSelect */
...@@ -30,14 +30,14 @@ ...@@ -30,14 +30,14 @@
if (req.url === '/root/test/labels.json') { if (req.url === '/root/test/labels.json') {
for (let i = 0; i < 10; i += 1) { for (let i = 0; i < 10; i += 1) {
LABELS_DATA.push({id: i, title: `test ${i}`, color: '#5CB85C'}); LABELS_DATA.push({ id: i, title: `test ${i}`, color: '#5CB85C' });
} }
} else if (req.url === '/root/test/issues/2.json') { } else if (req.url === '/root/test/issues/2.json') {
let tmp = []; let tmp = [];
for (let i = 0; i < saveLabelCount; i += 1) { for (let i = 0; i < saveLabelCount; i += 1) {
tmp.push({id: i, title: `test ${i}`, color: '#5CB85C'}); tmp.push({ id: i, title: `test ${i}`, color: '#5CB85C' });
} }
LABELS_DATA = {labels: tmp}; LABELS_DATA = { labels: tmp };
} }
d.resolve(LABELS_DATA); d.resolve(LABELS_DATA);
......
/* eslint-disable space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, no-unused-expressions, no-return-assign, no-param-reassign, max-len */ /* eslint-disable space-before-function-paren, no-var, prefer-rest-params, wrap-iife, no-unused-expressions, no-return-assign, no-param-reassign, max-len */
(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); }; };
this.MockU2FDevice = (function() { this.MockU2FDevice = (function() {
function MockU2FDevice() { function MockU2FDevice() {
......
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