Commit 8afd76e7 authored by GitLab Bot's avatar GitLab Bot

Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-07-19

parents 01851e66 91fcb311
# frozen_string_literal: true
module Prometheus
class AdapterService
def initialize(project, deployment_platform = nil)
......
# frozen_string_literal: true
module ProtectedBranches
class AccessLevelParams
prepend EE::ProtectedBranches::AccessLevelParams
......
# frozen_string_literal: true
module ProtectedBranches
class ApiService < BaseService
prepend EE::ProtectedBranches::ApiService
......
# frozen_string_literal: true
module ProtectedBranches
class CreateService < BaseService
def execute(skip_authorization: false)
......
# frozen_string_literal: true
module ProtectedBranches
class DestroyService < BaseService
def execute(protected_branch)
......
# frozen_string_literal: true
# The branches#protect API still uses the `developers_can_push` and `developers_can_merge`
# flags for backward compatibility, and so performs translation between that format and the
# internal data model (separate access levels). The translation code is non-trivial, and so
......
# frozen_string_literal: true
# The branches#protect API still uses the `developers_can_push` and `developers_can_merge`
# flags for backward compatibility, and so performs translation between that format and the
# internal data model (separate access levels). The translation code is non-trivial, and so
......
# frozen_string_literal: true
module ProtectedBranches
class UpdateService < BaseService
def execute(protected_branch)
......
# frozen_string_literal: true
module ProtectedTags
class CreateService < BaseService
attr_reader :protected_tag
......
# frozen_string_literal: true
module ProtectedTags
class DestroyService < BaseService
def execute(protected_tag)
......
# frozen_string_literal: true
module ProtectedTags
class UpdateService < BaseService
def execute(protected_tag)
......
# frozen_string_literal: true
module QuickActions
class InterpretService < BaseService
include Gitlab::QuickActions::Dsl
......
# frozen_string_literal: true
module Search
class GlobalService
attr_accessor :current_user, :params
......
# frozen_string_literal: true
module Search
class GroupService < Search::GlobalService
attr_accessor :group
......
# frozen_string_literal: true
module Search
class ProjectService
attr_accessor :project, :current_user, :params
......
# frozen_string_literal: true
module Search
class SnippetService
attr_accessor :current_user, :params
......
# frozen_string_literal: true
module Tags
class CreateService < BaseService
def execute(tag_name, target, message, release_description = nil)
......
# frozen_string_literal: true
module Tags
class DestroyService < BaseService
def execute(tag_name)
......
# frozen_string_literal: true
module TestHooks
class BaseService
attr_accessor :hook, :current_user, :trigger
......
# frozen_string_literal: true
module TestHooks
class ProjectService < TestHooks::BaseService
attr_writer :project
......
# frozen_string_literal: true
module TestHooks
class SystemService < TestHooks::BaseService
private
......
# frozen_string_literal: true
module Users
class ActivityService
LEASE_TIMEOUT = 1.minute.to_i
......
# frozen_string_literal: true
module Users
class BuildService < BaseService
prepend ::EE::Users::BuildService
......
# frozen_string_literal: true
module Users
class CreateService < BaseService
include NewUserNotifier
......
# frozen_string_literal: true
module Users
class DestroyService
prepend ::EE::Users::DestroyService
......
# frozen_string_literal: true
module Users
# Service class for caching and retrieving the last push event of a user.
class LastPushEventService
......
# frozen_string_literal: true
# When a user is destroyed, some of their associated records are
# moved to a "Ghost User", to prevent these associated records from
# being destroyed.
......
# frozen_string_literal: true
module Users
# Service for refreshing the authorized projects of a user.
#
......
# frozen_string_literal: true
module Users
class RespondToTermsService
def initialize(user, term)
......
# frozen_string_literal: true
module Users
class UpdateService < BaseService
include NewUserNotifier
......
# frozen_string_literal: true
module WikiPages
class BaseService < ::BaseService
prepend EE::WikiPages::BaseService
......
# frozen_string_literal: true
module WikiPages
class CreateService < WikiPages::BaseService
def execute
......
# frozen_string_literal: true
module WikiPages
class DestroyService < WikiPages::BaseService
def execute(page)
......
# frozen_string_literal: true
module WikiPages
class UpdateService < WikiPages::BaseService
def execute(page)
......
---
title: Enable even more frozen string in app/services/**/*.rb
merge_request: 20702
author: gfyoung
type: performance
......@@ -84,14 +84,12 @@ export default (
done();
};
return new Promise((resolve, reject) => {
try {
const result = action({ commit, state, dispatch, rootState: state }, payload);
resolve(result);
} catch (e) {
reject(e);
}
const result = action({ commit, state, dispatch, rootState: state }, payload);
return new Promise(resolve => {
setImmediate(resolve);
})
.then(() => result)
.catch(error => {
validateResults();
throw error;
......
......@@ -138,4 +138,29 @@ describe('VueX test helper (testAction)', () => {
});
});
});
it('should work with async actions not returning promises', done => {
const data = { FOO: 'BAR' };
const promiseAction = ({ commit, dispatch }) => {
dispatch('ACTION');
axios
.get(TEST_HOST)
.then(() => {
commit('SUCCESS');
return data;
})
.catch(error => {
commit('ERROR');
throw error;
});
};
mock.onGet(TEST_HOST).replyOnce(200, 42);
assertion = { mutations: [{ type: 'SUCCESS' }], actions: [{ type: 'ACTION' }] };
testAction(promiseAction, null, {}, assertion.mutations, assertion.actions, done);
});
});
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