#2796 disable validator (with badge) by removing it from config

This commit is contained in:
Anna Bodnia
2017-03-29 12:36:38 +03:00
parent 374b3613d0
commit ded299d891
6 changed files with 59 additions and 60 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
{"version":3,"file":"swagger-ui-bundle.js","sources":["webpack:///swagger-ui-bundle.js"],"mappings":"AAAA;AAu/FA;AA6+FA;;;;;;;;;;;;;;;;;;;;;;;;;;AAsdA;AAkoJA;AAyiCA;;;;;AAskCA;AAq7IA;AAo7FA;AA0wGA;AAgmEA;AA+9CA;AA0gDA;AA0rCA;AAm6DA;AAm4IA;;;;;;;;;;;;;;AAmtFA;AAyoIA;AAiuJA;AAglHA;AA+mGA;AAmkEA;AA42DA;AAwxDA;AA69BA;;;;;;AAixEA;AAo2FA;;;;;AA23CA;AA2qFA;AAo2CA;AAihCA;AAomDA;AAiuEA;AAkjGA;;;;;;;;;AAkpBA;AA2zIA;AAg4DA;AAywDA;;;;;;AAyzBA;AA8iHA;AAipGA","sourceRoot":""} {"version":3,"file":"swagger-ui-bundle.js","sources":["webpack:///swagger-ui-bundle.js"],"mappings":"AAAA;AAu/FA;AA6+FA;;;;;;;;;;;;;;;;;;;;;;;;;;AAsdA;;;;;;AAoIA;AAk7FA;AAmtCA;;;;;AA0uIA;AAq7IA;AAo7FA;AA0wGA;AAglFA;AA0jFA;AAq9CA;AA6jDA;AAgrCA;AAgtEA;AAgkIA;;;;;;;;;;;;;;AAw4GA;AAyoIA;AAiuJA;AA8kHA;AA8mGA;AAokEA;AAi3DA;AA4xDA;AAy9BA;;;;;;AA6sEA;AAwzFA;;;;;AA+1CA;AA2qFA;AAo2CA;AAihCA;AA4lDA;AAuuEA;AA+iGA;;;;;;;;;AAupBA;AA2zIA;AAg4DA;AAywDA","sourceRoot":""}

16
dist/swagger-ui.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
{"version":3,"file":"swagger-ui.js","sources":["webpack:///swagger-ui.js"],"mappings":"AAAA;AAsoGA;AAy4HA;AA67FA;AA4mCA;AAs+BA;AAsiCA;AAm5BA","sourceRoot":""} {"version":3,"file":"swagger-ui.js","sources":["webpack:///swagger-ui.js"],"mappings":"AAAA;AAsoGA;AAy4HA;AA67FA;AA4mCA;AAk+BA;AAyiCA;AAo5BA","sourceRoot":""}

View File

@@ -13,7 +13,7 @@ export default class OnlineValidatorBadge extends React.Component {
let { validatorUrl } = getConfigs() let { validatorUrl } = getConfigs()
this.state = { this.state = {
url: specSelectors.url(), url: specSelectors.url(),
validatorUrl: validatorUrl || "https://online.swagger.io/validator" validatorUrl: validatorUrl === undefined ? "https://online.swagger.io/validator" : null
} }
} }
@@ -23,7 +23,7 @@ export default class OnlineValidatorBadge extends React.Component {
this.setState({ this.setState({
url: specSelectors.url(), url: specSelectors.url(),
validatorUrl: validatorUrl || "https://online.swagger.io/validator" validatorUrl: validatorUrl === undefined ? "https://online.swagger.io/validator" : null
}) })
} }
@@ -33,7 +33,7 @@ export default class OnlineValidatorBadge extends React.Component {
if ( typeof spec === "object" && Object.keys(spec).length) return null if ( typeof spec === "object" && Object.keys(spec).length) return null
if (!this.state.url) { if (!this.state.url || !this.state.validatorUrl) {
return null return null
} }

View File

@@ -14,8 +14,8 @@ module.exports = function SwaggerUI(opts) {
spec: {}, spec: {},
url: "", url: "",
layout: "Layout", layout: "Layout",
validatorUrl: "https://online.swagger.io/validator",
configs: { configs: {
validatorUrl: "https://online.swagger.io/validator"
}, },
// Initial set of plugins ( TODO rename this, or refactor - we don't need presets _and_ plugins. Its just there for performance. // Initial set of plugins ( TODO rename this, or refactor - we don't need presets _and_ plugins. Its just there for performance.