Merge branch 'master' into ft/deeplinking-link-component
This commit is contained in:
@@ -61,7 +61,18 @@ export default class BaseLayout extends React.Component {
|
||||
const isSpecEmpty = !specSelectors.specStr()
|
||||
|
||||
if(isSpecEmpty) {
|
||||
return <h4>No spec provided.</h4>
|
||||
let loadingMessage
|
||||
if(isLoading) {
|
||||
loadingMessage = <div className="loading"></div>
|
||||
} else {
|
||||
loadingMessage = <h4>No API definition provided.</h4>
|
||||
}
|
||||
|
||||
return <div className="swagger-ui">
|
||||
<div className="loading-container">
|
||||
{loadingMessage}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
|
||||
|
||||
import React from "react"
|
||||
import PropTypes from "prop-types"
|
||||
|
||||
@@ -32,17 +34,21 @@ export default class StandaloneLayout extends React.Component {
|
||||
{ Topbar ? <Topbar /> : null }
|
||||
{ loadingStatus === "loading" &&
|
||||
<div className="info">
|
||||
<h4 className="title">Loading...</h4>
|
||||
<div className="loading-container">
|
||||
<div className="loading"></div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
{ loadingStatus === "failed" &&
|
||||
<div className="info">
|
||||
<h4 className="title">Failed to load spec.</h4>
|
||||
<div className="loading-container">
|
||||
<h4 className="title">Failed to load API definition.</h4>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
{ loadingStatus === "failedConfig" &&
|
||||
<div className="info" style={{ maxWidth: "880px", marginLeft: "auto", marginRight: "auto", textAlign: "center" }}>
|
||||
<h4 className="title">Failed to load config.</h4>
|
||||
<h4 className="title">Failed to load remote configuration.</h4>
|
||||
</div>
|
||||
}
|
||||
{ !loadingStatus || loadingStatus === "success" && <BaseLayout /> }
|
||||
|
||||
@@ -653,6 +653,11 @@
|
||||
.loading-container
|
||||
{
|
||||
padding: 40px 0 60px;
|
||||
margin-top: 1em;
|
||||
min-height: 1px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
||||
.loading
|
||||
{
|
||||
position: relative;
|
||||
|
||||
Reference in New Issue
Block a user