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

This commit is contained in:
Kyle Shockey
2017-06-08 21:15:10 -07:00
14 changed files with 74 additions and 30 deletions

View File

@@ -27,7 +27,7 @@ export default class Oauth2 extends React.Component {
let username = auth && auth.get("username") || ""
let clientId = auth && auth.get("clientId") || authConfigs.clientId || ""
let clientSecret = auth && auth.get("clientSecret") || authConfigs.clientSecret || ""
let passwordType = auth && auth.get("passwordType") || "basic"
let passwordType = auth && auth.get("passwordType") || "request-body"
this.state = {
appName: authConfigs.appName,
@@ -97,12 +97,13 @@ export default class Oauth2 extends React.Component {
let isAuthorized = !!authorizedAuth
let errors = errSelectors.allErrors().filter( err => err.get("authId") === name)
let isValid = !errors.filter( err => err.get("source") === "validation").size
let description = schema.get("description")
return (
<div>
<h4>OAuth2.0 <JumpToPath path={[ "securityDefinitions", name ]} /></h4>
{ !this.state.appName ? null : <h5>Application: { this.state.appName } </h5> }
<Markdown source={ schema.get("description") } />
{ description && <Markdown source={ schema.get("description") } /> }
{ isAuthorized && <h6>Authorized</h6> }

View File

@@ -6,13 +6,15 @@ export default class Models extends Component {
getComponent: PropTypes.func,
specSelectors: PropTypes.object,
layoutSelectors: PropTypes.object,
layoutActions: PropTypes.object
layoutActions: PropTypes.object,
getConfigs: PropTypes.func.isRequired
}
render(){
let { specSelectors, getComponent, layoutSelectors, layoutActions } = this.props
let { specSelectors, getComponent, layoutSelectors, layoutActions, getConfigs } = this.props
let definitions = specSelectors.definitions()
let showModels = layoutSelectors.isShown("models", true)
let { docExpansion } = getConfigs()
let showModels = layoutSelectors.isShown("models", docExpansion === "full" || docExpansion === "list" )
const Model = getComponent("model")
const Collapse = getComponent("Collapse")

View File

@@ -2,8 +2,15 @@ import React, { PropTypes } from "react"
import Remarkable from "react-remarkable"
import sanitize from "sanitize-html"
const sanitizeOptions = {
textFilter: function(text) {
return text
.replace(/&quot;/g, "\"")
}
}
function Markdown({ source }) {
const sanitized = sanitize(source)
const sanitized = sanitize(source, sanitizeOptions)
return <Remarkable
options={{html: true, typographer: true, linkify: true, linkTarget: "_blank"}}
source={sanitized}