Merge branch 'master' into lock-client-version
This commit is contained in:
6
dist/swagger-ui-bundle.js
vendored
6
dist/swagger-ui-bundle.js
vendored
File diff suppressed because one or more lines are too long
2
dist/swagger-ui-bundle.js.map
vendored
2
dist/swagger-ui-bundle.js.map
vendored
@@ -1 +1 @@
|
||||
{"version":3,"file":"swagger-ui-bundle.js","sources":["webpack:///swagger-ui-bundle.js"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;AAmqDA;AAorJA;AAiiCA;AAm1GA;AAiwHA;AAg9FA;AAm/EA;AAiuDA;AAq/CA;AAwkDA;AAk/CA;;;;;AA60EA;AA8zJA;;;;;;;;;;;;;;AAyoFA;AA+lIA;AA4oJA;AAqvHA;AAknGA;AA4iEA;AA43DA;AAgnDA;AA6eA;;;;;;AAsvGA;AA+1HA;AA0+DA;;;;;AAwiBA;AAgsFA;AA6kDA;AAq3CA;AA4wFA;AAk3CA;AA2iFA;;;;;;;;;AAwqEA;AA2zIA;AAu7FA;AAmrFA;AAi7EA;;;;;;AAiRA;AA+qHA;AAs7GA","sourceRoot":""}
|
||||
{"version":3,"file":"swagger-ui-bundle.js","sources":["webpack:///swagger-ui-bundle.js"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;AAmqDA;AAorJA;AAiiCA;AAm1GA;AAiwHA;AAg9FA;AAo/EA;AA+tDA;AAq/CA;AAwkDA;AAk/CA;;;;;AA60EA;AA8zJA;;;;;;;;;;;;;;AAyoFA;AA+lIA;AA4oJA;AAqvHA;AAknGA;AA4iEA;AA43DA;AAgnDA;AA6eA;;;;;;AAsvGA;AA+1HA;AA0+DA;;;;;AAwiBA;AAgsFA;AA6kDA;AAq3CA;AA4wFA;AAk3CA;AA2iFA;;;;;;;;;AAwqEA;AA2zIA;AAu7FA;AAmrFA;AAi7EA;;;;;;AAiRA;AA+qHA;AAs7GA","sourceRoot":""}
|
||||
6
dist/swagger-ui.js
vendored
6
dist/swagger-ui.js
vendored
File diff suppressed because one or more lines are too long
2
dist/swagger-ui.js.map
vendored
2
dist/swagger-ui.js.map
vendored
@@ -1 +1 @@
|
||||
{"version":3,"file":"swagger-ui.js","sources":["webpack:///swagger-ui.js"],"mappings":"AAAA;AAylFA;;;;;;AAg5CA;AA2pHA;AA8qIA;AAi+FA;AAyvDA;AAmzCA;AA+xCA","sourceRoot":""}
|
||||
{"version":3,"file":"swagger-ui.js","sources":["webpack:///swagger-ui.js"],"mappings":"AAAA;AAylFA;;;;;;AAg5CA;AA2pHA;AA6qIA;AAi+FA;AAyvDA;AAmzCA;AA+xCA","sourceRoot":""}
|
||||
@@ -11,6 +11,12 @@ const sanitizeOptions = {
|
||||
|
||||
function Markdown({ source }) {
|
||||
const sanitized = sanitize(source, sanitizeOptions)
|
||||
|
||||
// sometimes the sanitizer returns "undefined" as a string
|
||||
if(!source || !sanitized || sanitized === "undefined") {
|
||||
return null
|
||||
}
|
||||
|
||||
return <Remarkable
|
||||
options={{html: true, typographer: true, linkify: true, linkTarget: "_blank"}}
|
||||
source={sanitized}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { fromJS } from "immutable"
|
||||
import { fromJSOrdered, validateParam } from "core/utils"
|
||||
import win from "../../window"
|
||||
import findIndex from "lodash/findIndex"
|
||||
|
||||
import {
|
||||
UPDATE_SPEC,
|
||||
@@ -42,7 +41,7 @@ export default {
|
||||
[UPDATE_PARAM]: ( state, {payload} ) => {
|
||||
let { path, paramName, value, isXml } = payload
|
||||
return state.updateIn( [ "resolved", "paths", ...path, "parameters" ], fromJS([]), parameters => {
|
||||
const index = findIndex(parameters, p => p.get( "name" ) === paramName )
|
||||
const index = parameters.findIndex(p => p.get( "name" ) === paramName )
|
||||
if (!(value instanceof win.File)) {
|
||||
value = fromJSOrdered( value )
|
||||
}
|
||||
|
||||
37
test/bugs/3279-empty-markdown-source.js
Normal file
37
test/bugs/3279-empty-markdown-source.js
Normal file
@@ -0,0 +1,37 @@
|
||||
/* eslint-env mocha */
|
||||
import React from "react"
|
||||
import expect from "expect"
|
||||
import { render } from "enzyme"
|
||||
import Markdown from "components/providers/markdown"
|
||||
|
||||
describe("UI-3279: Empty Markdown inputs causing bare `undefined` in output", function(){
|
||||
it("should return no text for `null` as source input", function(){
|
||||
let props = {
|
||||
source: null
|
||||
}
|
||||
|
||||
let el = render(<Markdown {...props}/>)
|
||||
|
||||
expect(el.text()).toEqual("")
|
||||
})
|
||||
|
||||
it("should return no text for `undefined` as source input", function(){
|
||||
let props = {
|
||||
source: undefined
|
||||
}
|
||||
|
||||
let el = render(<Markdown {...props}/>)
|
||||
|
||||
expect(el.text()).toEqual("")
|
||||
})
|
||||
|
||||
it("should return no text for empty string as source input", function(){
|
||||
let props = {
|
||||
source: ""
|
||||
}
|
||||
|
||||
let el = render(<Markdown {...props}/>)
|
||||
|
||||
expect(el.text()).toEqual("")
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user