Merge branch 'master' of github.com:swagger-api/swagger-ui into ft/3003-version-info

This commit is contained in:
Kyle Shockey
2017-04-28 10:29:06 -07:00
15 changed files with 74 additions and 61 deletions

View File

@@ -16,7 +16,7 @@ export class Container extends React.Component {
if(fullscreen)
return <section {...rest}/>
let containerClass = "container" + (full ? "-full" : "")
let containerClass = "swagger-container" + (full ? "-full" : "")
return (
<section {...rest} className={xclass(rest.className, containerClass)}/>
)

View File

@@ -122,6 +122,7 @@ export const authorizeRequest = ( data ) => ( { fn, authActions, errActions } )
let _headers = Object.assign({
"Accept":"application/json, text/plain, */*",
"Access-Control-Allow-Origin": "*",
"Content-Type": "application/x-www-form-urlencoded"
}, headers)
@@ -159,5 +160,12 @@ export const authorizeRequest = ( data ) => ( { fn, authActions, errActions } )
authActions.authorizeOauth2({ auth, token})
})
.catch(err => { errActions.newAuthErr( err ) })
.catch(e => {
let err = new Error(e)
errActions.newAuthErr( {
authId: name,
level: "error",
source: "auth",
message: err.message
} ) })
}

View File

@@ -2,7 +2,6 @@ import { createStore, applyMiddleware, bindActionCreators, compose } from "redux
import Im, { fromJS, Map } from "immutable"
import deepExtend from "deep-extend"
import { combineReducers } from "redux-immutable"
import assign from "object-assign"
import serializeError from "serialize-error"
import { NEW_THROWN_ERR } from "corePlugins/err/actions"
import win from "core/window"
@@ -74,7 +73,7 @@ export default class Store {
let dispatch = this.getStore().dispatch
let getState = this.getStore().getState
this.boundSystem = assign({},
this.boundSystem = Object.assign({},
this.getRootInjects(),
this.getWrappedAndBoundActions(dispatch),
this.getBoundSelectors(getState, this.getSystem),
@@ -92,7 +91,7 @@ export default class Store {
}
getRootInjects() {
return assign({
return Object.assign({
getSystem: this.getSystem,
getStore: this.getStore.bind(this),
getComponents: this.getComponents.bind(this),
@@ -251,7 +250,7 @@ export default class Store {
getMapStateToProps() {
return () => {
let obj = assign({}, this.getSystem())
let obj = Object.assign({}, this.getSystem())
return obj
}
}

View File

@@ -1,5 +1,4 @@
import Im from "immutable"
import assign from "object-assign"
import shallowEqual from "shallowequal"
import camelCase from "lodash/camelCase"
@@ -85,7 +84,7 @@ export function objReduce(obj, fn) {
return Object.keys(obj).reduce((newObj, key) => {
let res = fn(obj[key], key)
if(res && typeof res === "object")
assign(newObj, res)
Object.assign(newObj, res)
return newObj
}, {})
}