refactor(oas31): change License component to be smart (#8476)
Refs #8474
This commit is contained in:
@@ -6,11 +6,22 @@ import License from "./components/license"
|
||||
import Info from "./components/info"
|
||||
import LicenseWrapper from "./wrap-components/license"
|
||||
import InfoWrapper from "./wrap-components/info"
|
||||
import { isOAS31, webhooks } from "./spec-extensions/selectors"
|
||||
import { isOAS31, license, webhooks } from "./spec-extensions/selectors"
|
||||
import { isOAS3 } from "./spec-extensions/wrap-selectors"
|
||||
import {
|
||||
makeSelectLicenseUrl,
|
||||
selectLicenseIdentifierField,
|
||||
selectLicenseNameField,
|
||||
selectLicenseUrlField,
|
||||
} from "./selectors"
|
||||
|
||||
const OAS31Plugin = () => {
|
||||
return {
|
||||
afterLoad(system) {
|
||||
const oas31Selectors = this.statePlugins.oas31.selectors
|
||||
|
||||
oas31Selectors.selectLicenseUrl = makeSelectLicenseUrl(system)
|
||||
},
|
||||
components: {
|
||||
Webhooks,
|
||||
OAS31Info: Info,
|
||||
@@ -24,12 +35,20 @@ const OAS31Plugin = () => {
|
||||
spec: {
|
||||
selectors: {
|
||||
isOAS31,
|
||||
license,
|
||||
webhooks,
|
||||
},
|
||||
wrapSelectors: {
|
||||
isOAS3,
|
||||
},
|
||||
},
|
||||
oas31: {
|
||||
selectors: {
|
||||
selectLicenseNameField,
|
||||
selectLicenseUrlField,
|
||||
selectLicenseIdentifierField,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user