From 3be5d2cb938257b78ba5a4bbd5ff1b6cdbb46c4c Mon Sep 17 00:00:00 2001 From: Kyle Shockey Date: Tue, 21 Mar 2017 16:43:06 -0700 Subject: [PATCH] Remove plugin that's breaking Try It Out when host/basePath isn't defined --- src/core/plugins/allow-try-it-out-if-host.js | 36 -------------------- src/core/presets/apis.js | 3 +- 2 files changed, 1 insertion(+), 38 deletions(-) delete mode 100644 src/core/plugins/allow-try-it-out-if-host.js diff --git a/src/core/plugins/allow-try-it-out-if-host.js b/src/core/plugins/allow-try-it-out-if-host.js deleted file mode 100644 index a6608fb4..00000000 --- a/src/core/plugins/allow-try-it-out-if-host.js +++ /dev/null @@ -1,36 +0,0 @@ -import React, { PropTypes } from "react" - -export default function (system) { - return { - components: { - NoHostWarning, - }, - statePlugins: { - spec: { - selectors: { - allowTryItOutFor, - } - } - } - } -} - -// This is a quick style. How do we improve this? -const style = { - backgroundColor: "#e7f0f7", - padding: "1rem", - borderRadius: "3px", -} - -function NoHostWarning() { - return ( -
Note: The interactive forms are disabled, as no `host` property was found in the specification. Please see: OAI 2.0/#swagger-object
- ) -} - -// Only allow if, there is a host field -function allowTryItOutFor(state) { - return ({specSelectors}) => { - return specSelectors.hasHost(state) - } -} diff --git a/src/core/presets/apis.js b/src/core/presets/apis.js index b6de37ff..3d4b5961 100644 --- a/src/core/presets/apis.js +++ b/src/core/presets/apis.js @@ -1,11 +1,10 @@ import BasePreset from "./base" -import allowTryItOutIfHost from "core/plugins/allow-try-it-out-if-host" +// Just the base, for now. export default function PresetApis() { return [ BasePreset, - allowTryItOutIfHost, ] }