Merge branch 'master' into bug/3982-oas3-trace-method

This commit is contained in:
kyle
2017-12-07 14:03:11 -08:00
committed by GitHub
25 changed files with 998 additions and 231 deletions

View File

@@ -3,11 +3,12 @@ import deepExtend from "deep-extend"
import System from "core/system"
import win from "core/window"
import ApisPreset from "core/presets/apis"
import * as AllPlugins from "core/plugins/all"
import { parseSearch } from "core/utils"
if (process.env.NODE_ENV !== "production") {
window.Perf = require("react-addons-perf")
if (process.env.NODE_ENV !== "production" && typeof window !== "undefined") {
win.Perf = require("react-addons-perf")
}
// eslint-disable-next-line no-undef

View File

@@ -17,7 +17,7 @@ export const SET_MUTATED_REQUEST = "spec_set_mutated_request"
export const LOG_REQUEST = "spec_log_request"
export const CLEAR_RESPONSE = "spec_clear_response"
export const CLEAR_REQUEST = "spec_clear_request"
export const ClEAR_VALIDATE_PARAMS = "spec_clear_validate_param"
export const CLEAR_VALIDATE_PARAMS = "spec_clear_validate_param"
export const UPDATE_OPERATION_VALUE = "spec_update_operation_value"
export const UPDATE_RESOLVED = "spec_update_resolved"
export const SET_SCHEME = "set_scheme"
@@ -161,7 +161,7 @@ export const validateParams = ( payload, isOAS3 ) =>{
export function clearValidateParams( payload ){
return {
type: ClEAR_VALIDATE_PARAMS,
type: CLEAR_VALIDATE_PARAMS,
payload:{ pathMethod: payload }
}
}

View File

@@ -15,7 +15,7 @@ import {
UPDATE_OPERATION_VALUE,
CLEAR_RESPONSE,
CLEAR_REQUEST,
ClEAR_VALIDATE_PARAMS,
CLEAR_VALIDATE_PARAMS,
SET_SCHEME
} from "./actions"
@@ -64,7 +64,7 @@ export default {
})
})
},
[ClEAR_VALIDATE_PARAMS]: ( state, { payload: { pathMethod } } ) => {
[CLEAR_VALIDATE_PARAMS]: ( state, { payload: { pathMethod } } ) => {
return state.updateIn( [ "resolved", "paths", ...pathMethod, "parameters" ], fromJS([]), parameters => {
return parameters.withMutations( parameters => {
for ( let i = 0, len = parameters.count(); i < len; i++ ) {

View File

@@ -1,3 +1,4 @@
import React from "react"
import { createStore, applyMiddleware, bindActionCreators, compose } from "redux"
import Im, { fromJS, Map } from "immutable"
import deepExtend from "deep-extend"
@@ -97,7 +98,8 @@ export default class Store {
getComponents: this.getComponents.bind(this),
getState: this.getStore().getState,
getConfigs: this._getConfigs.bind(this),
Im
Im,
React
}, this.system.rootInjects || {})
}
@@ -264,8 +266,9 @@ export default class Store {
dispatch = dispatch || this.getStore().dispatch
const process = creator =>{
const actions = this.getActions()
const process = creator =>{
if( typeof( creator ) !== "function" ) {
return objMap(creator, prop => process(prop))
}
@@ -284,7 +287,7 @@ export default class Store {
}
}
return objMap(this.getActions(), actionCreator => bindActionCreators( process( actionCreator ), dispatch ) )
return objMap(actions, actionCreator => bindActionCreators( process( actionCreator ), dispatch ) )
}
getMapStateToProps() {
@@ -333,17 +336,22 @@ function systemExtend(dest={}, src={}) {
// Parses existing components in the system, and prepares them for wrapping via getComponents
if(src.wrapComponents) {
objMap(src.wrapComponents, (wrapperFn, key) => {
const ori = dest.components[key]
const ori = dest.components && dest.components[key]
if(ori && Array.isArray(ori)) {
dest.components[key] = ori.concat([wrapperFn])
delete src.wrapComponents[key]
} else if(ori) {
dest.components[key] = [ori, wrapperFn]
} else {
dest.components[key] = null
delete src.wrapComponents[key]
}
})
delete src.wrapComponents
if(!Object.keys(src.wrapComponents).length) {
// only delete wrapComponents if we've matched all of our wrappers to components
// this handles cases where the component to wrap may be out of our scope,
// but a higher recursive `combinePlugins` call will be able to handle it.
delete src.wrapComponents
}
}

View File

@@ -607,7 +607,10 @@ export const getSampleSchema = (schema, contentType="", config={}) => {
export const parseSearch = () => {
let map = {}
let search = window.location.search
let search = win.location.search
if(!search)
return {}
if ( search != "" ) {
let params = search.substr(1).split("&")