Commit 77eda528 authored by Filipa Lacerda's avatar Filipa Lacerda

Merge branch 'resolve-global-vue' into 'master'

Remove Vue from the global space

See merge request !10056
parents 9ba5f10f 0d885e48
/* eslint-disable one-var, quote-props, comma-dangle, space-before-function-paren */
/* global Vue */
/* global BoardService */
import Vue from 'vue';
import VueResource from 'vue-resource';
import FilteredSearchBoards from './filtered_search_boards';
import eventHub from './eventhub';
window.Vue = require('vue');
window.Vue.use(require('vue-resource'));
require('./models/issue');
require('./models/label');
require('./models/list');
......@@ -24,6 +23,8 @@ require('./components/new_list_dropdown');
require('./components/modal/index');
require('../vue_shared/vue_resource_interceptor');
Vue.use(VueResource);
$(() => {
const $boardApp = document.getElementById('board-app');
const Store = gl.issueBoards.BoardsStore;
......
/* eslint-disable comma-dangle, space-before-function-paren, one-var */
/* global Vue */
/* global Sortable */
import Vue from 'vue';
import boardBlankState from './board_blank_state';
require('./board_delete');
......
/* global Vue */
require('./issue_card_inner');
const Store = gl.issueBoards.BoardsStore;
......
/* eslint-disable comma-dangle, space-before-function-paren, no-alert */
/* global Vue */
import Vue from 'vue';
(() => {
window.gl = window.gl || {};
......
/* eslint-disable comma-dangle, space-before-function-paren, max-len */
/* global Vue */
/* global Sortable */
import Vue from 'vue';
import boardNewIssue from './board_new_issue';
import boardCard from './board_card';
......
/* eslint-disable comma-dangle, space-before-function-paren, no-new */
/* global Vue */
/* global IssuableContext */
/* global MilestoneSelect */
/* global LabelsSelect */
/* global Sidebar */
import Vue from 'vue';
require('./sidebar/remove_issue');
(() => {
......
/* global Vue */
import Vue from 'vue';
import eventHub from '../eventhub';
(() => {
......
/* global Vue */
import Vue from 'vue';
(() => {
const ModalStore = gl.issueBoards.ModalStore;
......
/* eslint-disable no-new */
/* global Vue */
/* global Flash */
import Vue from 'vue';
require('./lists_dropdown');
(() => {
......
/* global Vue */
/* global ListIssue */
import Vue from 'vue';
import queryData from '../../utils/query_data';
require('./header');
......
/* global Vue */
/* global ListIssue */
/* global bp */
import Vue from 'vue';
(() => {
const ModalStore = gl.issueBoards.ModalStore;
......
/* global Vue */
import Vue from 'vue';
(() => {
const ModalStore = gl.issueBoards.ModalStore;
......
/* global Vue */
import Vue from 'vue';
(() => {
const ModalStore = gl.issueBoards.ModalStore;
......
/* eslint-disable no-new */
/* global Vue */
/* global Flash */
import Vue from 'vue';
(() => {
const Store = gl.issueBoards.BoardsStore;
......
/* global Vue */
/* global dateFormat */
import Vue from 'vue';
Vue.filter('due-date', (value) => {
const date = new Date(value);
return dateFormat(date, 'mmm d, yyyy', true);
......
/* eslint-disable no-unused-vars, space-before-function-paren, arrow-body-style, arrow-parens, comma-dangle, max-len */
/* global Vue */
/* global ListLabel */
/* global ListMilestone */
/* global ListUser */
import Vue from 'vue';
class ListIssue {
constructor (obj) {
this.globalId = obj.id;
......
/* eslint-disable space-before-function-paren, comma-dangle, no-param-reassign, camelcase, max-len, no-unused-vars */
/* global Vue */
import Vue from 'vue';
class BoardService {
constructor (root, bulkUpdatePath, boardId) {
......
/* eslint-disable no-param-reassign */
import Vue from 'vue';
import VueResource from 'vue-resource';
import CommitPipelinesTable from './pipelines_table';
window.Vue = require('vue');
window.Vue.use(require('vue-resource'));
Vue.use(VueResource);
/**
* Commits View > Pipelines Tab > Pipelines Table.
......
/* eslint-disable no-param-reassign */
/* global Vue */
import Vue from 'vue';
((global) => {
global.cycleAnalytics = global.cycleAnalytics || {};
......
/* eslint-disable no-param-reassign */
/* global Vue */
import Vue from 'vue';
((global) => {
global.cycleAnalytics = global.cycleAnalytics || {};
......
/* eslint-disable no-param-reassign */
/* global Vue */
import Vue from 'vue';
((global) => {
global.cycleAnalytics = global.cycleAnalytics || {};
......
/* eslint-disable no-param-reassign */
/* global Vue */
import Vue from 'vue';
((global) => {
global.cycleAnalytics = global.cycleAnalytics || {};
......
/* eslint-disable no-param-reassign */
/* global Vue */
import Vue from 'vue';
((global) => {
global.cycleAnalytics = global.cycleAnalytics || {};
......
/* global Vue */
/* global Cookies */
/* global Flash */
window.Vue = require('vue');
import Vue from 'vue';
window.Cookies = require('js-cookie');
require('./components/stage_code_component');
require('./components/stage_issue_component');
......
/* eslint-disable comma-dangle, object-shorthand, func-names, no-else-return, quotes, no-lonely-if, max-len */
/* global CommentsStore */
const Vue = require('vue');
import Vue from 'vue';
(() => {
const CommentAndResolveBtn = Vue.extend({
......
/* eslint-disable comma-dangle, object-shorthand, func-names, no-else-return, guard-for-in, no-restricted-syntax, one-var, space-before-function-paren, no-lonely-if, no-continue, brace-style, max-len, quotes */
/* global DiscussionMixins */
/* global CommentsStore */
const Vue = require('vue');
import Vue from 'vue';
(() => {
const JumpToDiscussion = Vue.extend({
......
/* global Vue */
/* global CommentsStore */
import Vue from 'vue';
(() => {
const NewIssueForDiscussion = Vue.extend({
props: {
......
......@@ -2,7 +2,8 @@
/* global CommentsStore */
/* global ResolveService */
/* global Flash */
const Vue = require('vue');
import Vue from 'vue';
(() => {
const ResolveBtn = Vue.extend({
......
/* eslint-disable comma-dangle, object-shorthand, func-names, no-param-reassign */
/* global DiscussionMixins */
/* global CommentsStore */
const Vue = require('vue');
import Vue from 'vue';
((w) => {
w.ResolveCount = Vue.extend({
......
......@@ -2,7 +2,7 @@
/* global CommentsStore */
/* global ResolveService */
const Vue = require('vue');
import Vue from 'vue';
(() => {
const ResolveDiscussionBtn = Vue.extend({
......
/* eslint-disable func-names, comma-dangle, new-cap, no-new, max-len */
/* global Vue */
/* global ResolveCount */
const Vue = require('vue');
import Vue from 'vue';
require('./models/discussion');
require('./models/note');
require('./stores/comments');
......
/* eslint-disable space-before-function-paren, camelcase, guard-for-in, no-restricted-syntax, no-unused-vars, max-len */
/* global Vue */
/* global NoteModel */
import Vue from 'vue';
class DiscussionModel {
constructor (discussionId) {
this.id = discussionId;
......
......@@ -2,10 +2,13 @@
/* global Flash */
/* global CommentsStore */
const Vue = window.Vue = require('vue');
window.Vue.use(require('vue-resource'));
import Vue from 'vue';
import VueResource from 'vue-resource';
require('../../vue_shared/vue_resource_interceptor');
Vue.use(VueResource);
(() => {
window.gl = window.gl || {};
......
/* eslint-disable object-shorthand, func-names, camelcase, no-restricted-syntax, guard-for-in, comma-dangle, max-len, no-param-reassign */
/* global Vue */
/* global DiscussionModel */
import Vue from 'vue';
((w) => {
w.CommentsStore = {
state: {},
......
/* global Vue */
import Vue from 'vue';
import stopwatchSvg from 'icons/_icon_stopwatch.svg';
require('../../../lib/utils/pretty_time');
......
/* global Vue */
import Vue from 'vue';
require('../../../lib/utils/pretty_time');
(() => {
......
/* global Vue */
import Vue from 'vue';
(() => {
Vue.component('time-tracking-estimate-only-pane', {
name: 'time-tracking-estimate-only-pane',
......
/* global Vue */
import Vue from 'vue';
(() => {
Vue.component('time-tracking-help-state', {
name: 'time-tracking-help-state',
......
/* global Vue */
import Vue from 'vue';
(() => {
Vue.component('time-tracking-no-tracking-pane', {
name: 'time-tracking-no-tracking-pane',
......
/* global Vue */
import Vue from 'vue';
(() => {
Vue.component('time-tracking-spent-only-pane', {
name: 'time-tracking-spent-only-pane',
......
/* global Vue */
import Vue from 'vue';
require('./help_state');
require('./collapsed_state');
......
/* global Vue */
import Vue from 'vue';
import VueResource from 'vue-resource';
window.Vue = require('vue');
window.Vue.use(require('vue-resource'));
require('./components/time_tracker');
require('../../smart_interval');
require('../../subbable_resource');
Vue.use(VueResource);
(() => {
/* This Vue instance represents what will become the parent instance for the
* sidebar. It will be responsible for managing `issuable` state and propagating
......
/* eslint-disable comma-dangle, quote-props, no-useless-computed-key, object-shorthand, no-new, no-param-reassign, max-len */
/* global Vue */
/* global ace */
/* global Flash */
import Vue from 'vue';
((global) => {
global.mergeConflicts = global.mergeConflicts || {};
......
/* eslint-disable no-param-reassign, comma-dangle */
/* global Vue */
import Vue from 'vue';
((global) => {
global.mergeConflicts = global.mergeConflicts || {};
......
/* eslint-disable no-param-reassign, comma-dangle */
/* global Vue */
import Vue from 'vue';
((global) => {
global.mergeConflicts = global.mergeConflicts || {};
......
/* eslint-disable comma-dangle, object-shorthand, no-param-reassign, camelcase, no-nested-ternary, no-continue, max-len */
/* global Cookies */
/* global Vue */
import Vue from 'vue';
((global) => {
global.mergeConflicts = global.mergeConflicts || {};
......
/* eslint-disable new-cap, comma-dangle, no-new */
/* global Vue */
/* global Flash */
window.Vue = require('vue');
import Vue from 'vue';
require('./merge_conflict_store');
require('./merge_conflict_service');
require('./mixins/line_conflict_utils');
......
/* eslint-disable func-names, space-before-function-paren, wrap-iife, no-var, no-underscore-dangle, prefer-arrow-callback, max-len, one-var, one-var-declaration-per-line, no-unused-vars, object-shorthand, comma-dangle, no-else-return, no-self-compare, consistent-return, no-param-reassign, no-shadow */
/* global Vue */
/* global Issuable */
/* global ListMilestone */
import Vue from 'vue';
(function() {
this.MilestoneSelect = (function() {
function MilestoneSelect(currentProject, els) {
......
/* eslint-disable func-names, space-before-function-paren, consistent-return, no-var, no-undef, no-else-return, prefer-arrow-callback, max-len */
/* eslint-disable func-names, space-before-function-paren, consistent-return, no-var, no-else-return, prefer-arrow-callback, max-len */
// Render Gitlab flavoured Markdown
//
// Delegates to syntax highlight and render math
......
/* eslint-disable func-names, space-before-function-paren, consistent-return, no-var, no-undef, no-else-return, prefer-arrow-callback, max-len, no-console */
/* eslint-disable func-names, space-before-function-paren, consistent-return, no-var, no-else-return, prefer-arrow-callback, max-len, no-console */
/* global katex */
// Renders math using KaTeX in any element with the
// `js-render-math` class
//
......
/* global Vue */
import Vue from 'vue';
(() => {
class Subscription {
......
/* 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 Issuable */
/* global ListUser */
import Vue from 'vue';
(function() {
var bind = function(fn, me) { return function() { return fn.apply(me, arguments); }; },
slice = [].slice;
......
import Vue from 'vue';
import PipelinesStore from './stores/pipelines_store';
import PipelinesComponent from './pipelines';
import '../vue_shared/vue_resource_interceptor';
const Vue = window.Vue = require('vue');
window.Vue.use(require('vue-resource'));
$(() => new Vue({
el: document.querySelector('.vue-pipelines-index'),
......
/* eslint-disable no-param-reassign, no-plusplus */
import Vue from 'vue';
import VueResource from 'vue-resource';
Vue.use(VueResource);
// Maintain a global counter for active requests
// see: spec/support/wait_for_vue_resource.rb
Vue.http.interceptors.push((request, next) => {
Vue.activeResources = Vue.activeResources ? Vue.activeResources + 1 : 1;
window.activeVueResources = window.activeVueResources || 0;
window.activeVueResources += 1;
next(() => {
Vue.activeResources--;
window.activeVueResources -= 1;
});
});
// Inject CSRF token so we don't break any tests.
Vue.http.interceptors.push((request, next) => {
// needed in order to not break the tests.
if ($.rails) {
// eslint-disable-next-line no-param-reassign
request.headers['X-CSRF-Token'] = $.rails.csrfToken();
}
next();
......
/* global Vue */
/* global List */
/* global ListLabel */
/* global listObj */
/* global boardsMockInterceptor */
/* global BoardService */
import Vue from 'vue';
require('~/boards/models/list');
require('~/boards/models/label');
require('~/boards/stores/boards_store');
......
/* eslint-disable comma-dangle, one-var, no-unused-vars */
/* global Vue */
/* global BoardService */
/* global boardsMockInterceptor */
/* global Cookies */
......@@ -7,6 +6,8 @@
/* global listObjDuplicate */
/* global ListIssue */
import Vue from 'vue';
require('~/lib/utils/url_utility');
require('~/boards/models/issue');
require('~/boards/models/label');
......
/* global Vue */
/* global ListUser */
/* global ListLabel */
/* global listObj */
/* global ListIssue */
import Vue from 'vue';
require('~/boards/models/issue');
require('~/boards/models/label');
require('~/boards/models/list');
......
/* eslint-disable comma-dangle */
/* global Vue */
/* global boardsMockInterceptor */
/* global BoardService */
/* global List */
......@@ -7,6 +6,8 @@
/* global listObj */
/* global listObjDuplicate */
import Vue from 'vue';
require('~/lib/utils/url_utility');
require('~/boards/models/issue');
require('~/boards/models/label');
......
/* global Vue */
/* global ListIssue */
require('~/boards/models/issue');
......
/* eslint-disable */
/* eslint-disable no-unused-vars, space-before-function-paren, func-call-spacing, no-spaced-func, semi, max-len, quotes, space-infix-ops, padded-blocks */
import Vue from 'vue';
require('jquery');
require('vue');
require('~/issuable/time_tracking/components/time_tracker');
function initTimeTrackingComponent(opts) {
......
......@@ -9,8 +9,6 @@ require('~/commons/index.js');
window.$ = window.jQuery = require('jquery');
window._ = require('underscore');
window.Cookies = require('js-cookie');
window.Vue = require('vue');
window.Vue.use(require('vue-resource'));
// stub expected globals
window.gl = window.gl || {};
......
module WaitForVueResource
def wait_for_vue_resource(spinner: true)
Timeout.timeout(Capybara.default_max_wait_time) do
loop until page.evaluate_script('Vue.activeResources').zero?
loop until page.evaluate_script('window.activeVueResources').zero?
end
end
end
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