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

Class Auths

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

Source from the content-addressed store, hash-verified

58735 )
58736 }
58737 }
58738 class Auths extends Re.Component {
58739 constructor(s, o) {
58740 ;(super(s, o), (this.state = {}))
58741 }
58742 onAuthChange = (s) => {
58743 let { name: o } = s
58744 this.setState({ [o]: s })
58745 }
58746 submitAuth = (s) => {
58747 s.preventDefault()
58748 let { authActions: o } = this.props
58749 o.authorizeWithPersistOption(this.state)
58750 }
58751 logoutClick = (s) => {
58752 s.preventDefault()
58753 let { authActions: o, definitions: i } = this.props,
58754 a = i.map((s, o) => o).toArray()
58755 ;(this.setState(a.reduce((s, o) => ((s[o] = ''), s), {})), o.logoutWithPersistOption(a))
58756 }
58757 close = (s) => {
58758 s.preventDefault()
58759 let { authActions: o } = this.props
58760 o.showDefinitions(!1)
58761 }
58762 render() {
58763 let { definitions: s, getComponent: o, authSelectors: i, errSelectors: a } = this.props
58764 const u = o('AuthItem'),
58765 _ = o('oauth2', !0),
58766 w = o('Button')
58767 let x = i.authorized(),
58768 C = s.filter((s, o) => !!x.get(o)),
58769 j = s.filter((s) => 'oauth2' !== s.get('type')),
58770 L = s.filter((s) => 'oauth2' === s.get('type'))
58771 return Re.createElement(
58772 'div',
58773 { className: 'auth-container' },
58774 !!j.size &&
58775 Re.createElement(
58776 'form',
58777 { onSubmit: this.submitAuth },
58778 j
58779 .map((s, _) =>
58780 Re.createElement(u, {
58781 key: _,
58782 schema: s,
58783 name: _,
58784 getComponent: o,
58785 onAuthChange: this.onAuthChange,
58786 authorized: x,
58787 errSelectors: a,
58788 authSelectors: i,
58789 })
58790 )
58791 .toArray(),
58792 Re.createElement(
58793 'div',
58794 { className: 'auth-btn-wrapper' },

Callers

nothing calls this directly

Calls 3

toArrayMethod · 0.45
mapMethod · 0.45
reduceMethod · 0.45

Tested by

no test coverage detected