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KACC,2BACE,gBAACuB,EAAA,EAAa,CAACJ,KAAMG,G,6BACQD,GAE7B,2B,WACS,K,IAAU,MAAW,4B,IAAQ,WAAc,EAAG,G,MAGzD,gBAAC,EAAc,MAGpB,C","sources":["webpack://influxdb-ui/./src/onboarding/components/SigninForm.tsx","webpack://influxdb-ui/./src/onboarding/containers/OSSLoginPage.tsx","webpack://influxdb-ui/./src/shared/components/VersionInfoOSS.tsx","webpack://influxdb-ui/./src/shared/thunks/app.ts","webpack://influxdb-ui/./src/shared/components/VersionInfo.tsx"],"sourcesContent":["// Libraries\nimport React, {PureComponent, ChangeEvent} from 'react'\nimport {withRouter, RouteComponentProps} from 'react-router-dom'\nimport {connect, ConnectedProps} from 'react-redux'\nimport {get} from 'lodash'\n\n// Components\nimport {Form, Input, Button, Grid} from '@influxdata/clockface'\n\n// APIs\nimport {postSignin} from 'src/client'\n\n// Actions\nimport {notify as notifyAction} from 'src/shared/actions/notifications'\n\n// Constants\nimport * as copy from 'src/shared/copy/notifications'\n\n// Types\nimport {\n Columns,\n InputType,\n ButtonType,\n ComponentSize,\n ComponentColor,\n} from '@influxdata/clockface'\n\n// Decorators\nimport {ErrorHandling} from 'src/shared/decorators/errors'\n\nexport interface OwnProps {\n notify: typeof notifyAction\n}\n\ninterface State {\n username: string\n password: string\n}\n\ntype ReduxProps = ConnectedProps\ntype Props = OwnProps & RouteComponentProps & ReduxProps\n\n@ErrorHandling\nclass SigninForm extends PureComponent {\n public state: State = {\n username: '',\n password: '',\n }\n\n public render() {\n const {username, password} = this.state\n return (\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n )\n }\n\n private handleUsername = (e: ChangeEvent): void => {\n const username = e.target.value\n this.setState({username})\n }\n private handlePassword = (e: ChangeEvent): void => {\n const password = e.target.value\n this.setState({password})\n }\n\n private handleSignIn = async (): Promise => {\n const {notify} = this.props\n const {username, password} = this.state\n\n try {\n const resp = await postSignin({auth: {username, password}})\n\n if (resp.status !== 204) {\n throw new Error(resp.data.message)\n }\n\n this.handleRedirect()\n } catch (error) {\n const message = get(error, 'response.data.msg', '')\n const status = get(error, 'response.status', '')\n\n if (status === 401) {\n notify({\n ...copy.SigninError,\n message: 'Login failed: username or password is invalid',\n })\n return\n }\n\n if (!message) {\n notify(copy.SigninError)\n return\n }\n\n notify({...copy.SigninError, message})\n }\n }\n\n private handleRedirect() {\n const {history, location} = this.props\n const params = new URLSearchParams(location.search)\n const returnTo = params.get('returnTo')\n\n if (returnTo) {\n history.replace(returnTo)\n } else {\n history.push('/')\n }\n }\n}\n\nconst mdtp = {\n notify: notifyAction,\n}\n\nconst connector = connect(null, mdtp)\n\nexport default connector(withRouter(SigninForm))\n","// Libraries\nimport React, {PureComponent} from 'react'\nimport {withRouter, RouteComponentProps} from 'react-router-dom'\nimport {connect, ConnectedProps} from 'react-redux'\n\n// APIs\nimport {getSetup} from 'src/client'\n\n// Actions\nimport {dismissAllNotifications} from 'src/shared/actions/notifications'\n\n// Components\nimport {ErrorHandling} from 'src/shared/decorators/errors'\nimport SigninForm from 'src/onboarding/components/SigninForm'\nimport {\n SpinnerContainer,\n TechnoSpinner,\n Panel,\n AlignItems,\n InfluxDBCloudLogo,\n FunnelPage,\n AppWrapper,\n} from '@influxdata/clockface'\nimport {RemoteDataState} from 'src/types'\nimport VersionInfo from 'src/shared/components/VersionInfo'\nimport Notifications from 'src/shared/components/notifications/Notifications'\n\n// Constants\nimport {CLOUD, CLOUD_SIGNIN_PATHNAME} from 'src/shared/constants'\n\ninterface State {\n status: RemoteDataState\n}\n\ntype ReduxProps = ConnectedProps\ntype Props = RouteComponentProps & ReduxProps\n@ErrorHandling\nclass OSSLoginPage extends PureComponent {\n constructor(props) {\n super(props)\n\n this.state = {\n status: RemoteDataState.Loading,\n }\n }\n public async componentDidMount() {\n const resp = await getSetup({})\n\n if (resp.status !== 200) {\n throw new Error('There was an error onboarding')\n }\n\n const {allowed} = resp.data\n\n if (allowed) {\n this.props.history.push('/onboarding/0')\n } else if (CLOUD) {\n window.location.pathname = CLOUD_SIGNIN_PATHNAME\n return\n }\n\n this.setState({status: RemoteDataState.Done})\n }\n\n componentWillUnmount() {\n this.props.dismissAllNotifications()\n }\n\n public render() {\n return (\n }\n >\n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n )\n }\n}\n\nconst mdtp = {\n dismissAllNotifications,\n}\n\nconst connector = connect(null, mdtp)\n\nexport default connector(withRouter(OSSLoginPage))\n","// Libraries\nimport React, {FC, useEffect} from 'react'\nimport {useSelector, useDispatch} from 'react-redux'\n\n// Constants\nimport {GIT_SHA} from 'src/shared/constants'\n\n// Thunks\nimport {fetchVersionInfo} from 'src/shared/thunks/app'\n\n// Selectors\nimport {getVersionInfo} from 'src/shared/selectors/app'\n\nconst VersionInfoOSS: FC = () => {\n const dispatch = useDispatch()\n\n const versionInfo = useSelector(getVersionInfo)\n\n useEffect(() => {\n dispatch(fetchVersionInfo())\n }, [dispatch])\n\n return (\n <>\n InfluxDB {versionInfo.version}\n
\n Server:{' '}\n \n \n {versionInfo.commit && versionInfo.commit.slice(0, 7)}\n \n \n
\n Frontend:{' '}\n \n \n {GIT_SHA.slice(0, 7)}\n \n \n \n )\n}\n\nexport default VersionInfoOSS\n","import {Dispatch} from 'redux'\nimport {getAPIBasepath} from 'src/utils/basepath'\nimport {VersionInfo} from 'src/types'\nimport {Action, setVersionInfo} from 'src/shared/actions/app'\n\nexport const fetchVersionInfo =\n () =>\n async (dispatch: Dispatch): Promise => {\n try {\n const url = `${getAPIBasepath()}/health`\n // Have to use fetch here since the oats client doesn't work with the servers option in the oss swagger\n // Ex: https://github.com/influxdata/openapi/blob/35d734671d05ba9337dd6fbd8bb5c6085482011b/contracts/oss.yml#L5887\n // The \"/health\" endpoint is actually not prefixed by \"api/v2\", but the oats client has the prefix\n const response = await fetch(url)\n const info = await response.json()\n\n dispatch(\n setVersionInfo({\n version: info.version,\n commit: info.commit,\n })\n )\n\n return info\n } catch (err) {\n console.error(err)\n dispatch(\n setVersionInfo({\n version: 'n/a',\n commit: 'n/a',\n })\n )\n }\n }\n","// Libraries\nimport React, {FC} from 'react'\nimport {useSelector} from 'react-redux'\n\n// Components\nimport VersionInfoOSS from 'src/shared/components/VersionInfoOSS'\nimport {SafeBlankLink} from 'src/utils/SafeBlankLink'\n\n// Constants\nimport {VERSION, GIT_SHA, CLOUD} from 'src/shared/constants'\n\n// Utils\nimport {isOrgIOx} from 'src/organizations/selectors'\n\nconst VersionInfo: FC = () => {\n const engineName = useSelector(isOrgIOx) ? 'IOx' : 'TSM'\n const engineLink = useSelector(isOrgIOx)\n ? 'https://docs.influxdata.com/influxdb/cloud-iox/'\n : 'https://docs.influxdata.com/influxdb/latest/reference/internals/storage-engine/#time-structured-merge-tree-tsm'\n\n return (\n
\n {CLOUD ? (\n
\n \n InfluxDB Cloud powered by {engineName}\n \n
\n Version {VERSION} {GIT_SHA && ({GIT_SHA.slice(0, 7)})}\n
\n ) : (\n \n )}\n
\n )\n}\n\nexport default VersionInfo\n"],"names":["SigninForm","PureComponent","state","username","password","handleUsername","e","target","value","this","setState","handlePassword","handleSignIn","async","notify","props","resp","auth","status","Error","data","message","handleRedirect","error","get","render","Form","onSubmit","Grid","widthXS","Columns","label","Input","name","onChange","size","ComponentSize","autoFocus","testID","id","type","InputType","Button","color","ComponentColor","text","ButtonType","history","location","returnTo","URLSearchParams","search","replace","push","mdtp","OSSLoginPage","constructor","super","allowed","window","pathname","componentWillUnmount","dismissAllNotifications","SpinnerContainer","loading","spinnerComponent","TechnoSpinner","Notifications","AppWrapper","FunnelPage","className","Panel","alignItems","AlignItems","InfluxDBCloudLogo","cloud","VersionInfo","dispatch","versionInfo","useEffect","url","response","fetch","info","json","version","commit","err","console","href","slice","engineName","engineLink","SafeBlankLink"],"sourceRoot":""}