- );
- }
-}
-
-export default connect(mapStateToProps, null)(withRouter(DefaultLayout));
diff --git a/client/web/src/blueprints/DefaultLayout/index.js b/client/web/src/blueprints/DefaultLayout/index.js
deleted file mode 100644
index ba75ebb3..00000000
--- a/client/web/src/blueprints/DefaultLayout/index.js
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License").
- * You may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import DefaultLayout from "./DefaultLayout";
-
-export default DefaultLayout;
diff --git a/client/web/src/blueprints/LeftSidebar/index.js b/client/web/src/blueprints/LeftSidebar/index.js
deleted file mode 100644
index e1c2e9f5..00000000
--- a/client/web/src/blueprints/LeftSidebar/index.js
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License").
- * You may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import React from "react";
-
-import PropTypes from "prop-types";
-import { Navbar, Nav, Container } from "react-bootstrap";
-
-import Sidebar from "../../components/Layout/Sidebar";
-import CurrentUserContainer from "../../components/Auth/CurrentUserContainer";
-
-const LeftSidebar = (props) => {
- const { children } = props;
-
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
-};
-
-LeftSidebar.propTypes = {
- children: PropTypes.node,
-};
-
-export default LeftSidebar;
diff --git a/client/web/src/blueprints/MinimalLayout/index.js b/client/web/src/blueprints/MinimalLayout/index.js
deleted file mode 100644
index fbf84e47..00000000
--- a/client/web/src/blueprints/MinimalLayout/index.js
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License").
- * You may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import React, { Fragment } from "react";
-
-import PropTypes from "prop-types";
-
-const MinimalLayout = (props) => {
- const { children } = props;
-
- return {children};
-};
-
-MinimalLayout.propTypes = {
- children: PropTypes.node,
-};
-
-export default MinimalLayout;
diff --git a/client/web/src/blueprints/index.js b/client/web/src/blueprints/index.js
deleted file mode 100644
index b2fb06d0..00000000
--- a/client/web/src/blueprints/index.js
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License").
- * You may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-export { default as MinimalLayout } from "./MinimalLayout";
-export { default as LeftSidebar } from "./LeftSidebar";
diff --git a/client/web/src/components/Auth/CurrentUserComponent.js b/client/web/src/components/Auth/CurrentUserComponent.js
deleted file mode 100644
index 82d9b177..00000000
--- a/client/web/src/components/Auth/CurrentUserComponent.js
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License").
- * You may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import React, { Fragment } from "react";
-import { Button } from "react-bootstrap";
-
-export default function CurrentUserComponent(props) {
- const { username, handleSignOut } = props;
-
- console.log(username);
-
- return (
-
-
- Signed in as: {username}
-
-
-
- );
-}
diff --git a/client/web/src/components/Auth/CurrentUserContainer.js b/client/web/src/components/Auth/CurrentUserContainer.js
deleted file mode 100644
index ab5c1ab0..00000000
--- a/client/web/src/components/Auth/CurrentUserContainer.js
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License").
- * You may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import React from 'react'
-
-import SaasBoostSignOut from './SaasBoostSignOut'
-
-function CurrentUserContainer() {
- return
-}
-
-export default CurrentUserContainer
diff --git a/client/web/src/components/Auth/SaasBoostAuthComponent.js b/client/web/src/components/Auth/SaasBoostAuthComponent.js
deleted file mode 100644
index e0642454..00000000
--- a/client/web/src/components/Auth/SaasBoostAuthComponent.js
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License").
- * You may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-import { PropTypes } from 'prop-types'
-import React, { Component } from 'react'
-import { SBInput } from './SaasBoostSignIn'
-import { Alert } from 'reactstrap'
-import { Auth } from '@aws-amplify/auth'
-import { isEmpty } from '@aws-amplify/core'
-import { cilEnvelopeClosed, cilUser } from '@coreui/icons'
-
-const UsernameAttributes = {
- EMAIL: 'email',
- PHONE_NUMBER: 'phone_number',
- USERNAME: 'username',
-}
-
-export class SaasBoostAuthComponent extends Component {
- _validAuthStates = []
- constructor(props) {
- super(props)
- this.state = {}
-
- this._validAuthStates = []
- this.inputs = {}
- this.changeState = this.changeState.bind(this)
- this.error = this.error.bind(this)
- this.handleInputChange = this.handleInputChange.bind(this)
- this.renderUsernameField = this.renderUsernameField.bind(this)
- this.getUsernameFromInput = this.getUsernameFromInput.bind(this)
- this.dismiss = this.dismiss.bind(this)
- this.checkContact = this.checkContact.bind(this)
- }
-
- handleInputChange(e) {
- const { name, value, type, checked } = e.target
- const check_type = ['radio', 'checkbox'].includes(type)
- this.inputs[name] = check_type ? checked : value
- this.inputs['checkedValue'] = check_type ? value : null
- }
-
- triggerAuthEvent(event) {
- const state = this.props.authState
- if (this.props.onAuthEvent) {
- this.props.onAuthEvent(state, event, false)
- }
- }
-
- changeState(state, data) {
- if (this.props.onStateChange) {
- this.props.onStateChange(state, data)
- }
-
- this.triggerAuthEvent({
- type: 'stateChange',
- data: state,
- })
- }
- errorMessage(err) {
- if (typeof err === 'string') {
- return err
- }
- return err.message ? err.message : JSON.stringify(err)
- }
-
- error(err) {
- this.triggerAuthEvent({
- type: 'error',
- data: this.errorMessage(err),
- })
- }
-
- getUsernameFromInput() {
- const { usernameAttributes = 'username' } = this.props
- switch (usernameAttributes) {
- case UsernameAttributes.EMAIL:
- return this.inputs.email
- case UsernameAttributes.PHONE_NUMBER:
- return this.phone_number
- default:
- return this.inputs.username || this.state.username
- }
- }
- renderUsernameField() {
- const { usernameAttributes = [] } = this.props
- if (usernameAttributes === UsernameAttributes.EMAIL) {
- return (
-
- )
- } else if (usernameAttributes === UsernameAttributes.PHONE_NUMBER) {
- return
Phone Field
- } else {
- return (
-
- )
- }
- }
-
- showError() {
- const { error } = this.state
- return (
- !!error && (
-
- {error && error.message}
-
- )
- )
- }
-
- checkContact(user) {
- if (!Auth || typeof Auth.verifiedContact !== 'function') {
- throw new Error('No Auth module found, please ensure @aws-amplify/auth is imported')
- }
- Auth.verifiedContact(user).then((data) => {
- console.log(data)
- if (!isEmpty(data.verified)) {
- this.changeState('signedIn', user)
- } else {
- user = Object.assign(user, data)
- this.changeState('verifyContact', user)
- }
- })
- }
-
- dismiss() {
- this.setState({ error: null })
- }
-
- render() {
- if (!this._validAuthStates.includes(this.props.authState)) {
- return null
- }
- return this.showComponent()
- }
-}
-
-SaasBoostAuthComponent.propTypes = {
- authState: PropTypes.string,
- onAuthEvent: PropTypes.func,
- onStateChange: PropTypes.func,
- usernameAttributes: PropTypes.object,
-}
-
-export default SaasBoostAuthComponent
diff --git a/client/web/src/components/Auth/SaasBoostChangePassword1.js b/client/web/src/components/Auth/SaasBoostChangePassword1.js
deleted file mode 100644
index 90e7e6cf..00000000
--- a/client/web/src/components/Auth/SaasBoostChangePassword1.js
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License").
- * You may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-import PropTypes from 'prop-types'
-import React, { Component } from 'react'
-import { Formik, Form } from 'formik'
-import * as Yup from 'yup'
-import { Auth } from 'aws-amplify'
-
-import { Modal, ModalHeader, ModalBody, ModalFooter, Button, Alert, Row, Col } from 'reactstrap'
-import { SaasBoostInput } from '../FormComponents/SaasBoostInput'
-
-class SaasBoostChangePassword extends Component {
- constructor(props) {
- super(props)
- this.state = {
- isOpen: false,
- error: undefined,
- success: false,
- }
- this.handleCancel = this.handleCancel.bind(this)
- this.handleSubmit = this.handleSubmit.bind(this)
- this.showError = this.showError.bind(this)
- this.handleError = this.handleError.bind(this)
- }
-
- toggle() {}
-
- showError(error, handleError) {
- return (
- handleError()}>
-
- )
- }
-}
-
-export default SaasBoostForgotPassword
diff --git a/client/web/src/components/Auth/SaasBoostLoading.js b/client/web/src/components/Auth/SaasBoostLoading.js
deleted file mode 100644
index 549bc60d..00000000
--- a/client/web/src/components/Auth/SaasBoostLoading.js
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License").
- * You may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import React, { Fragment } from 'react'
-import { Loading } from 'aws-amplify-react'
-import { RingLoader } from 'react-spinners'
-
-export default class SaasBoostLoading extends Loading {
- showComponent() {
- return (
-
-
-
-
-
-
-
-
Authenticating...
-
-
- )
- }
-}
diff --git a/client/web/src/components/Auth/SaasBoostRequireNewPassword.js b/client/web/src/components/Auth/SaasBoostRequireNewPassword.js
deleted file mode 100644
index 7dbf1c9a..00000000
--- a/client/web/src/components/Auth/SaasBoostRequireNewPassword.js
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License").
- * You may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import React from 'react'
-import SaasBoostAuthComponent from './SaasBoostAuthComponent'
-import { Auth } from 'aws-amplify'
-import { Button, Card, CardBody, Col, Container, Row, CardFooter } from 'reactstrap'
-import { Formik, Form as FormikForm } from 'formik'
-
-import { SBInput } from './SaasBoostSignIn'
-import * as Yup from 'yup'
-
-export class SaasBoostRequireNewPassword extends SaasBoostAuthComponent {
- _initialState = {}
- constructor(props) {
- super(props)
- this._validAuthStates = ['requireNewPassword']
- this.state = this._initialState
- this.change = this.change.bind(this)
- }
-
- change(values, { resetForm }) {
- const user = this.props.authData
- const attrs = {}
- const { password } = values
-
- if (!Auth || typeof Auth.completeNewPassword !== 'function') {
- throw new Error('No Auth module found, please ensure @aws-amplify/auth is imported')
- }
- resetForm(values)
- Auth.completeNewPassword(user, password, attrs)
- .then((user) => {
- if (user.challengeName === 'SMS_MFA') {
- this.changeState('confirmSignIn', user)
- } else if (user.challengeName === 'MFA_SETUP') {
- this.changeState('TOTPSetup', user)
- } else {
- this.checkContact(user)
- }
- })
- .catch((err) => {
- this.setState({ error: err })
- this.error(err)
- })
- }
-
- showComponent() {
- const validationSchema = Yup.object({
- password: Yup.string()
- .required('Required')
- .min(6, 'Password must have a minimum of 6 characters'),
- confirmPassword: Yup.string()
- .min(6, 'Password must have a minimum of 6 characters')
- .equals([Yup.ref('password'), null], 'Password does not match')
- .required('Required'),
- })
-
- return (
-
-
- )
- }
-}
-
-export { SBInput }
diff --git a/client/web/src/components/Auth/SaasBoostSignOut.js b/client/web/src/components/Auth/SaasBoostSignOut.js
deleted file mode 100644
index fb5c0e48..00000000
--- a/client/web/src/components/Auth/SaasBoostSignOut.js
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License").
- * You may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import React from 'react'
-
-import { Auth } from 'aws-amplify'
-import { Button } from 'reactstrap'
-
-const SaasBoostSignOut = () => {
- const handleSignOut = async (e) => {
- await Auth.signOut()
- }
-
- return
-}
-
-export default SaasBoostSignOut
diff --git a/client/web/src/components/Auth/SaasBoostVerifyContact.js b/client/web/src/components/Auth/SaasBoostVerifyContact.js
deleted file mode 100644
index eda1f517..00000000
--- a/client/web/src/components/Auth/SaasBoostVerifyContact.js
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License").
- * You may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import React from 'react'
-import SaasBoostAuthComponent from './SaasBoostAuthComponent'
-import CIcon from '@coreui/icons-react'
-import { cilCheckAlt, cilX } from '@coreui/icons'
-import {
- Container,
- Row,
- Col,
- Card,
- CardBody,
- FormGroup,
- Input,
- Label,
- Button,
- CardFooter,
-} from 'reactstrap'
-import { Auth } from '@aws-amplify/auth'
-
-class SaasBoostVerifyContact extends SaasBoostAuthComponent {
- constructor(props) {
- super(props)
-
- this._validAuthStates = ['verifyContact']
- this.state = { verifyAttr: null }
- this.handleInputChange = this.handleInputChange.bind(this)
- this.verify = this.verify.bind(this)
- this.submit = this.submit.bind(this)
- }
-
- verify() {
- const { contact, checkedValue } = this.inputs
- if (!contact) {
- this.error('Neither Email nor Phone Number selected')
- return
- }
-
- if (!Auth || typeof Auth.verifyCurrentUserAttribute !== 'function') {
- throw new Error('No Auth module found, please ensure @aws-amplify/auth is imported')
- }
-
- Auth.verifyCurrentUserAttribute(checkedValue)
- .then((data) => {
- this.setState({ verifyAttr: checkedValue })
- })
- .catch((err) => this.error(err))
- }
-
- submit() {
- const attr = this.state.verifyAttr
- const { code } = this.inputs
- if (!Auth || typeof Auth.verifyCurrentUserAttributeSubmit !== 'function') {
- throw new Error('No Auth module found, please ensure @aws-amplify/auth is imported')
- }
- Auth.verifyCurrentUserAttributeSubmit(attr, code)
- .then((data) => {
- this.changeState('signedIn', this.props.authData)
- this.setState({ verifyAttr: null })
- })
- .catch((err) => this.error(err))
- }
- verifyView() {
- const user = this.props.authData
- if (!user) {
- console.error('No user to verify')
- return null
- }
- const { unverified } = user
- if (!unverified) {
- console.error('no unverified on user')
- return null
- }
- const { email } = unverified
-
- return (
-
- )
- }
-}
-
-export default SaasBoostVerifyContact
diff --git a/client/web/src/components/Layout/Sidebar/index.js b/client/web/src/components/Layout/Sidebar/index.js
deleted file mode 100644
index 7763b3fb..00000000
--- a/client/web/src/components/Layout/Sidebar/index.js
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License").
- * You may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import React, { Fragment, Component } from "react";
-
-import { Nav, Container, Row, Col } from "react-bootstrap";
-import { NavLink } from "react-router-dom";
-
-class Sidebar extends Component {
- render() {
- return (
-
-
-
-