From 0b4cef3ca858746fb48954f3aea2a3e8dbc9a03e Mon Sep 17 00:00:00 2001 From: Alexander Kogan Date: Sun, 2 Jul 2017 19:57:39 +0300 Subject: [PATCH 1/2] fixing tag order to be in the same order as definition file --- src/core/plugins/spec/selectors.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/core/plugins/spec/selectors.js b/src/core/plugins/spec/selectors.js index d8487e89..a4f94349 100644 --- a/src/core/plugins/spec/selectors.js +++ b/src/core/plugins/spec/selectors.js @@ -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())) } ) From 4bfb392e4994064288a6d3b85fb22c319d0e2c6e Mon Sep 17 00:00:00 2001 From: Kyle Shockey Date: Mon, 3 Jul 2017 16:41:10 -0700 Subject: [PATCH 2/2] Undo changed defaults --- README.md | 7 ++----- dev-helpers/index.html | 5 +---- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index a62a18ab..c7f02194 100644 --- a/README.md +++ b/README.md @@ -91,10 +91,7 @@ To use swagger-ui's bundles, you should take a look at the [source of swagger-ui plugins: [ SwaggerUIBundle.plugins.DownloadUrl ], - layout: "StandaloneLayout", - docExpansion: "none", - apisSorter: "alpha", - operationsSorter: "method" + layout: "StandaloneLayout" }) ``` @@ -147,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 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`. -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 diff --git a/dev-helpers/index.html b/dev-helpers/index.html index 31c1610f..b23ec6f8 100644 --- a/dev-helpers/index.html +++ b/dev-helpers/index.html @@ -84,10 +84,7 @@ plugins: [ SwaggerUIBundle.plugins.DownloadUrl ], - layout: "StandaloneLayout", - docExpansion: "none", - apisSorter: "alpha", - operationsSorter: "method" + layout: "StandaloneLayout" }); ui.initOAuth({