MCPcopy Index your code
hub / github.com/dataease/SQLBot / ParameterRow

Class ParameterRow

frontend/public/swagger-ui-bundle.js:61630–61950  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61628 )
61629 }
61630 }
61631 class ParameterRow extends Re.Component {
61632 constructor(s, o) {
61633 ;(super(s, o), this.setDefaultValue())
61634 }
61635 UNSAFE_componentWillReceiveProps(s) {
61636 let o,
61637 { specSelectors: i, pathMethod: a, rawParam: u } = s,
61638 _ = i.isOAS3(),
61639 w = i.parameterWithMetaByIdentity(a, u) || new ze.Map()
61640 if (((w = w.isEmpty() ? u : w), _)) {
61641 let { schema: s } = getParameterSchema(w, { isOAS3: _ })
61642 o = s ? s.get('enum') : void 0
61643 } else o = w ? w.get('enum') : void 0
61644 let x,
61645 C = w ? w.get('value') : void 0
61646 ;(void 0 !== C ? (x = C) : u.get('required') && o && o.size && (x = o.first()),
61647 void 0 !== x &&
61648 x !== C &&
61649 this.onChangeWrapper(
61650 (function numberToString(s) {
61651 return 'number' == typeof s ? s.toString() : s
61652 })(x)
61653 ),
61654 this.setDefaultValue())
61655 }
61656 onChangeWrapper = (s, o = !1) => {
61657 let i,
61658 { onChange: a, rawParam: u } = this.props
61659 return ((i = '' === s || (s && 0 === s.size) ? null : s), a(u, i, o))
61660 }
61661 _onExampleSelect = (s) => {
61662 this.props.oas3Actions.setActiveExamplesMember({
61663 name: s,
61664 pathMethod: this.props.pathMethod,
61665 contextType: 'parameters',
61666 contextName: this.getParamKey(),
61667 })
61668 }
61669 onChangeIncludeEmpty = (s) => {
61670 let { specActions: o, param: i, pathMethod: a } = this.props
61671 const u = i.get('name'),
61672 _ = i.get('in')
61673 return o.updateEmptyParamInclusion(a, u, _, s)
61674 }
61675 setDefaultValue = () => {
61676 let {
61677 specSelectors: s,
61678 pathMethod: o,
61679 rawParam: i,
61680 oas3Selectors: a,
61681 fn: u,
61682 } = this.props
61683 const _ = s.parameterWithMetaByIdentity(o, i) || (0, ze.Map)()
61684 let { schema: w } = getParameterSchema(_, { isOAS3: s.isOAS3() })
61685 const x = _.get('content', (0, ze.Map)())
61686 .keySeq()
61687 .first(),

Callers

nothing calls this directly

Calls 8

getParamKeyMethod · 0.95
composeJsonSchemaMethod · 0.95
getParameterSchemaFunction · 0.85
stringifyFunction · 0.85
aFunction · 0.70
getMethod · 0.65
firstMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected