feature: swagger-ui-react module (via #5207)
* swagger-ui-react alpha.0 * alpha.1 * alpha.2 * alpha.3 * begin updating README * alpha.4 * WIP: `displayOperationId` support * move loading error readouts to BaseLayout * add `url` prop * export React component as default * add interceptor support * modify docs markup * add `onComplete` prop * add `spec` prop * Update README.md * alpha.6 * remove independent manifest; build releasable exclusively from template * ensure dist is present; drop config field in manifest * drop alpha field this script is now able to release to npm! * remove unused selector references * Update README.md
This commit is contained in:
@@ -16,49 +16,22 @@ export default class StandaloneLayout extends React.Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
let { getComponent, specSelectors, errSelectors } = this.props
|
||||
let { getComponent } = this.props
|
||||
|
||||
let Container = getComponent("Container")
|
||||
let Row = getComponent("Row")
|
||||
let Col = getComponent("Col")
|
||||
let Errors = getComponent("errors", true)
|
||||
|
||||
const Topbar = getComponent("Topbar", true)
|
||||
const BaseLayout = getComponent("BaseLayout", true)
|
||||
const OnlineValidatorBadge = getComponent("onlineValidatorBadge", true)
|
||||
|
||||
const loadingStatus = specSelectors.loadingStatus()
|
||||
const lastErr = errSelectors.lastError()
|
||||
const lastErrMsg = lastErr ? lastErr.get("message") : ""
|
||||
|
||||
return (
|
||||
|
||||
<Container className='swagger-ui'>
|
||||
{ Topbar ? <Topbar /> : null }
|
||||
{ loadingStatus === "loading" &&
|
||||
<div className="info">
|
||||
<div className="loading-container">
|
||||
<div className="loading"></div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
{ loadingStatus === "failed" &&
|
||||
<div className="info">
|
||||
<div className="loading-container">
|
||||
<h4 className="title">Failed to load API definition.</h4>
|
||||
<Errors/>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
{ loadingStatus === "failedConfig" &&
|
||||
<div className="info" style={{ maxWidth: "880px", marginLeft: "auto", marginRight: "auto", textAlign: "center" }}>
|
||||
<div className="loading-container">
|
||||
<h4 className="title">Failed to load remote configuration.</h4>
|
||||
<p>{lastErrMsg}</p>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
{ !loadingStatus || loadingStatus === "success" && <BaseLayout /> }
|
||||
{Topbar ? <Topbar /> : null}
|
||||
<BaseLayout />
|
||||
<Row>
|
||||
<Col>
|
||||
<OnlineValidatorBadge />
|
||||
|
||||
Reference in New Issue
Block a user