apisSorter -> tagsSorter
"tags", not "tag", because it sorts the tags themselves, not the content of each tag.
This commit is contained in:
@@ -7,7 +7,7 @@ import * as AllPlugins from "core/plugins/all"
|
||||
import { parseSeach, filterConfigs } from "core/utils"
|
||||
|
||||
const CONFIGS = [ "url", "urls", "urls.primaryName", "spec", "validatorUrl", "onComplete", "onFailure", "authorizations", "docExpansion",
|
||||
"apisSorter", "operationsSorter", "supportedSubmitMethods", "dom_id", "defaultModelRendering", "oauth2RedirectUrl",
|
||||
"tagsSorter", "operationsSorter", "supportedSubmitMethods", "dom_id", "defaultModelRendering", "oauth2RedirectUrl",
|
||||
"showRequestHeaders", "custom", "modelPropertyMacro", "parameterMacro", "displayOperationId" , "displayRequestDuration"]
|
||||
|
||||
// eslint-disable-next-line no-undef
|
||||
|
||||
@@ -201,11 +201,11 @@ export const operationsWithTags = createSelector(
|
||||
)
|
||||
|
||||
export const taggedOperations = (state) => ({ getConfigs }) => {
|
||||
let { apisSorter, operationsSorter } = getConfigs()
|
||||
let { tagsSorter, operationsSorter } = getConfigs()
|
||||
|
||||
return operationsWithTags(state)
|
||||
.sort((operationA, operationB) => {
|
||||
let sortFn = (typeof apisSorter === "function" ? apisSorter : sorters.apisSorter[ apisSorter ])
|
||||
let sortFn = (typeof tagsSorter === "function" ? tagsSorter : sorters.tagsSorter[ tagsSorter ])
|
||||
return (!sortFn ? null : sortFn(operationA, operationB))
|
||||
})
|
||||
.map((ops, tag) => {
|
||||
|
||||
@@ -575,7 +575,7 @@ export const sorters = {
|
||||
alpha: (a, b) => a.get("path").localeCompare(b.get("path")),
|
||||
method: (a, b) => a.get("method").localeCompare(b.get("method"))
|
||||
},
|
||||
apisSorter: {
|
||||
tagsSorter: {
|
||||
alpha: (a, b) => a.getIn([0, "operation", "tags", 0]).localeCompare(b.getIn([0, "operation", "tags", 0]))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user