* Use `parameterWithMeta` to get parameter data in <ParameterRow>

* Prefer specPath when fetching resolved subtrees in OperationContainer

* Add test for OAS3 callback rendering

* Remove debugger statement

* Pass base resolution URL directly to Swagger-Client subtree resolver

* Remove accidental comment

* Migrate additional options

* Don't default to empty Map when getting subtree

* fix(validateParam): check for ImList type before using count method

* Use `replaceState` to update `urls.primaryName`

This gives us the stateful URL we want, without:
(a) refreshing the page on update
(b) creating a long, useless history for the user
(c) implying that browser history is two-way bound
    to Swagger-UI (it isn't, we don't have a router)

* Add `fn.opsFilter` docs and internal API versioning note

* restrict `x-example` functionality to Swagger 2.0

* polish Authorize + Close buttons

* add tachyons; use it for padding the new Reset button

* v3.12.0

* rebuild dist
This commit is contained in:
kyle
2018-03-02 21:13:00 -08:00
committed by GitHub
parent ad43965d16
commit 83232dc2d8
18 changed files with 98 additions and 38 deletions

View File

@@ -81,11 +81,11 @@ export default class Auths extends React.Component {
}).toArray()
}
<div className="auth-btn-wrapper">
<Button className="btn modal-btn auth btn-done" onClick={ this.close }>Close</Button>
{
nonOauthDefinitions.size === authorizedAuth.size ? <Button className="btn modal-btn auth" onClick={ this.logoutClick }>Logout</Button>
: <Button type="submit" className="btn modal-btn auth authorize">Authorize</Button>
}
<Button className="btn modal-btn auth btn-done" onClick={ this.close }>Close</Button>
</div>
</form>
}

View File

@@ -29,7 +29,7 @@ export default class ParameterRow extends Component {
let value = parameter ? parameter.get("value") : ""
if( param.get("in") !== "body" ) {
if ( xExampleValue !== undefined && value === undefined ) {
if ( xExampleValue !== undefined && value === undefined && specSelectors.isSwagger2() ) {
this.onChangeWrapper(xExampleValue)
} else if ( defaultValue !== undefined && value === undefined ) {
this.onChangeWrapper(defaultValue)

View File

@@ -121,7 +121,7 @@ export default class RequestBodyEditor extends PureComponent {
}
{ userDidModify &&
<Button className="btn" onClick={() => { this.resetValueToSample(mediaType) }}>Reset</Button>
<Button className="btn ml3" onClick={() => { this.resetValueToSample(mediaType) }}>Reset</Button>
}
</div>
</div>

View File

@@ -350,7 +350,7 @@ export function extractFileNameFromContentDispositionHeader(value){
if (responseFilename !== null && responseFilename.length > 1) {
return responseFilename[1]
}
return null
return null
}
// PascalCase, aka UpperCamelCase
@@ -559,7 +559,7 @@ export const validateParam = (param, isXml, isOAS3 = false) => {
} else if ( type === "array" ) {
let itemType
if ( !value.count() ) { return errors }
if ( !listCheck || !value.count() ) { return errors }
itemType = paramDetails.getIn(["items", "type"])

View File

@@ -45,7 +45,10 @@ export default class Topbar extends React.Component {
setSearch = (spec) => {
let search = parseSearch()
search["urls.primaryName"] = spec.name
window.location.search = serializeSearch(search)
const newUrl = `${window.location.protocol}//${window.location.host}${window.location.pathname}`
if(window && window.history && window.history.pushState) {
window.history.replaceState(null, "", `${newUrl}?${serializeSearch(search)}`)
}
}
setSelectedUrl = (selectedUrl) => {

View File

@@ -21,6 +21,7 @@
.authorize
{
padding-right: 20px;
margin-right: 10px;
}
}

View File

@@ -1,5 +1,6 @@
.swagger-ui
{
@import '~tachyons-sass/tachyons.scss';
@import 'mixins';
@import 'variables';
@import 'colors';