Complying with request for changes

This commit is contained in:
Raphaël MARQUES
2017-07-04 09:18:58 +02:00
2 changed files with 7 additions and 4 deletions

View File

@@ -144,7 +144,7 @@ parameterMacro | MUST be a function. Function to set default value to parameters
modelPropertyMacro | MUST be a function. Function to set default values to each property in model. Accepts one argument modelPropertyMacro(property), property is immutable modelPropertyMacro | MUST be a function. Function to set default values to each property in model. Accepts one argument modelPropertyMacro(property), property is immutable
docExpansion | Controls the default expansion setting for the operations and tags. It can be 'list' (expands only the tags), 'full' (expands the tags and operations) or 'none' (expands nothing). The default is 'list'. docExpansion | Controls the default expansion setting for the operations and tags. It can be 'list' (expands only the tags), 'full' (expands the tags and operations) or 'none' (expands nothing). The default is 'list'.
displayOperationId | Controls the display of operationId in operations list. The default is `false`. displayOperationId | Controls the display of operationId in operations list. The default is `false`.
displayRequestDuration | Controls the display of the request duration (in milliseconds) for `Try it out` requests. The default is `false`. displayRequestDuration | Controls the display of the request duration (in milliseconds) for `Try it out` requests. The default is `false`.
### Plugins ### Plugins

View File

@@ -1,6 +1,6 @@
import { createSelector } from "reselect" import { createSelector } from "reselect"
import { sorters } from "core/utils" import { sorters } from "core/utils"
import { fromJS, Set, Map, List } from "immutable" import { fromJS, Set, Map, OrderedMap, List } from "immutable"
const DEFAULT_TAG = "default" const DEFAULT_TAG = "default"
@@ -187,13 +187,16 @@ export const tagDetails = (state, tag) => {
export const operationsWithTags = createSelector( export const operationsWithTags = createSelector(
operationsWithRootInherited, operationsWithRootInherited,
operations => { tags,
(operations, tags) => {
return operations.reduce( (taggedMap, op) => { return operations.reduce( (taggedMap, op) => {
let tags = Set(op.getIn(["operation","tags"])) let tags = Set(op.getIn(["operation","tags"]))
if(tags.count() < 1) if(tags.count() < 1)
return taggedMap.update(DEFAULT_TAG, List(), ar => ar.push(op)) return taggedMap.update(DEFAULT_TAG, List(), ar => ar.push(op))
return tags.reduce( (res, tag) => res.update(tag, List(), (ar) => ar.push(op)), taggedMap ) 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()))
} }
) )