Skip to content

Commit

Permalink
Merge pull request #39 from aws-samples/deps
Browse files Browse the repository at this point in the history
Upgrade dependencies
  • Loading branch information
matteofigus committed Oct 25, 2022
2 parents 7faf251 + 7d42798 commit 6da0cb0
Show file tree
Hide file tree
Showing 7 changed files with 35,997 additions and 19,183 deletions.
55,048 changes: 35,915 additions & 19,133 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
"workspaces": ["src/web-ui"],
"overrides": {
"nth-check": "2.0.1",
"autoprefixer": "10.4.5"
"autoprefixer": "10.4.5",
"[email protected]": {
"[email protected]": "3.0.5"
}
}
}
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
awscli==1.24.2
awscli==1.25.97
cfn_flip==1.3.0
cfn_lint==0.60.0
cfn_lint==0.68.1
2 changes: 1 addition & 1 deletion src/cfn/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Globals:
CREATE_CLOUDFRONT_DISTRIBUTION: !Ref CreateCloudFrontDistribution
REGION: !Ref AWS::Region
TO_BUCKET: !Ref WebUIBucket
VERSION: "1.5"
VERSION: "1.6"

Parameters:
AdminEmail:
Expand Down
12 changes: 6 additions & 6 deletions src/functions/setup/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/web-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@aws-amplify/ui-components": "^1.9.6",
"@aws-amplify/ui-react": "^2.3.0",
"aws-amplify": "^4.3.22",
"aws-amplify-react": "^2.5.4",
"react": "^17.0.2",
"react-bootstrap": "1.0.0",
"react-dom": "^17.0.2",
Expand Down
106 changes: 67 additions & 39 deletions src/web-ui/src/App.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { Authenticator, Greetings, SignUp } from "aws-amplify-react";
import React, { useState } from "react";
import {
AmplifyAuthenticator,
AmplifySignIn,
} from "@aws-amplify/ui-react/legacy";
import { onAuthUIStateChange } from "@aws-amplify/ui-components";
import React, { useState, useEffect } from "react";
import { Container } from "react-bootstrap";

import Header from "./components/Header";
Expand All @@ -13,9 +17,8 @@ import gateway from "./utils/gateway";
const App = () => {
const [authState, setAuthState] = useState(undefined);
const [currentPage, setCurrentPage] = useState("projects");
const [selectedProjectVersion, setSelectedProjectVersion] = useState(
undefined
);
const [selectedProjectVersion, setSelectedProjectVersion] =
useState(undefined);

const onHelp = () => setCurrentPage("help");
const loadProjectList = () => setCurrentPage("projects");
Expand All @@ -24,42 +27,67 @@ const App = () => {
setCurrentPage("image");
};

const classNames = ["App"];
if (authState !== "signedIn") classNames.push("amplify-auth");
useEffect(() => {
return onAuthUIStateChange((s) => setAuthState(s));
}, []);
console.log(authState)
const signedIn = authState === "signedin";

return (
<div className={classNames.join(" ")}>
<Authenticator
onStateChange={(s) => setAuthState(s)}
hide={[Greetings, SignUp]}
>
{authState === "signedIn" && (
<>
<Header
currentPage={currentPage}
onHelp={onHelp}
loadProjectList={loadProjectList}
/>
<Container>
<SettingsHelp show={!window.rekognitionSettings} />
{currentPage === "projects" && (
<ProjectsSummary
gateway={gateway}
onHelp={onHelp}
onVersionClick={loadProjectVersion}
/>
)}
{currentPage === "help" && <Help />}
{currentPage === "image" && (
<ImageMode
gateway={gateway}
projectVersionArn={selectedProjectVersion}
/>
)}
</Container>
</>
)}
</Authenticator>
<div className="App">
{signedIn ? (
<>
<Header
currentPage={currentPage}
onHelp={onHelp}
loadProjectList={loadProjectList}
/>
<Container>
<SettingsHelp show={!window.rekognitionSettings} />
{currentPage === "projects" && (
<ProjectsSummary
gateway={gateway}
onHelp={onHelp}
onVersionClick={loadProjectVersion}
/>
)}
{currentPage === "help" && <Help />}
{currentPage === "image" && (
<ImageMode
gateway={gateway}
projectVersionArn={selectedProjectVersion}
/>
)}
</Container>
</>
) : (
<div className="amplify-auth-container">
<AmplifyAuthenticator usernameAlias="email">
<AmplifySignIn
slot="sign-in"
usernameAlias="email"
formFields={[
{
type: "email",
label: "Username *",
placeholder: "Enter your username",
required: true,
inputProps: { autoComplete: "off" },
},
{
type: "password",
label: "Password *",
placeholder: "Enter your password",
required: true,
inputProps: { autoComplete: "off" },
},
]}
>
<div slot="secondary-footer-content"></div>
</AmplifySignIn>
</AmplifyAuthenticator>
</div>
)}
</div>
);
};
Expand Down

0 comments on commit 6da0cb0

Please sign in to comment.