Selaa lähdekoodia

Merge branch 'master' into issue-1334

bubble
shockey 7 vuotta sitten
committed by GitHub
vanhempi
commit
346218f0ca
2 muutettua tiedostoa jossa 18 lisäystä ja 5 poistoa
  1. +6
    -3
      src/core/plugins/spec/selectors.js
  2. +12
    -2
      swagger-ui-dist-package/index.js

+ 6
- 3
src/core/plugins/spec/selectors.js Näytä tiedosto

@@ -1,6 +1,6 @@
import { createSelector } from "reselect"
import { sorters } from "core/utils"
import { fromJS, Set, Map, List } from "immutable"
import { fromJS, Set, Map, OrderedMap, List } from "immutable"

const DEFAULT_TAG = "default"

@@ -187,13 +187,16 @@ export const tagDetails = (state, tag) => {

export const operationsWithTags = createSelector(
operationsWithRootInherited,
operations => {
tags,
(operations, tags) => {
return operations.reduce( (taggedMap, op) => {
let tags = Set(op.getIn(["operation","tags"]))
if(tags.count() < 1)
return taggedMap.update(DEFAULT_TAG, List(), ar => ar.push(op))
return tags.reduce( (res, tag) => res.update(tag, List(), (ar) => ar.push(op)), taggedMap )
}, Map())
}, tags.reduce( (taggedMap, tag) => {
return taggedMap.set(tag.get("name"), List())
} , OrderedMap()))
}
)



+ 12
- 2
swagger-ui-dist-package/index.js Näytä tiedosto

@@ -1,3 +1,13 @@
module.exports.SwaggerUIBundle = require("./swagger-ui-bundle.js")
module.exports.SwaggerUIStandalonePreset = require("./swagger-ui-standalone-preset.js")
try {
module.exports.SwaggerUIBundle = require("./swagger-ui-bundle.js")
module.exports.SwaggerUIStandalonePreset = require("./swagger-ui-standalone-preset.js")
} catch(e) {
// swallow the error if there's a problem loading the assets.
// allows this module to support providing the assets for browserish contexts,
// without exploding in a Node context.
//
// see https://github.com/swagger-api/swagger-ui/issues/3291#issuecomment-311195388
// for more information.
}

module.exports.absolutePath = require("./absolute-path.js")

Ladataan…
Peruuta
Tallenna