From 64837e3e2a59d8cda690183b77dfd6d3a875091f Mon Sep 17 00:00:00 2001 From: "Heather Logan (She/Her)" Date: Mon, 14 Aug 2023 12:59:35 +0100 Subject: [PATCH 1/4] Hide components when in phase 0 --- frontend/src/App.css | 2 +- frontend/src/App.tsx | 28 +++++++-------- .../src/components/ApiKeyBox/ApiKeyBox.tsx | 1 + .../src/components/AttackBox/AttackBox.tsx | 1 + .../src/components/DefenceBox/DefenceBox.tsx | 2 ++ frontend/src/components/EmailBox/EmailBox.tsx | 13 ++++--- .../ModelSelectionBox/ModelSelectionBox.tsx | 1 + .../PhaseSelectionBox/PhaseSelectionBox.tsx | 35 ++++++++++--------- 8 files changed, 45 insertions(+), 38 deletions(-) diff --git a/frontend/src/App.css b/frontend/src/App.css index 797a90135..815823c82 100644 --- a/frontend/src/App.css +++ b/frontend/src/App.css @@ -37,7 +37,7 @@ h1 { border-color: #ccc; border-width: 0 0 1px 0; border-style: solid; - margin: 40px; + margin: 15px; margin-bottom: 10px; padding-bottom: 20px; text-align: center; diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 0a4425439..62789a58e 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -66,20 +66,18 @@ function App() { return (
-
defence mechanisms
- - -
attack mechanisms
- -
openai api key
- -
model selection
- + {/* hide components when in phase 0 */} + {currentPhase !== 0 && ( + + )} + {currentPhase !== 0 && } + {currentPhase !== 0 && } + {currentPhase !== 0 && }
@@ -94,13 +92,11 @@ function App() { />
-
phases
-
sent emails
diff --git a/frontend/src/components/ApiKeyBox/ApiKeyBox.tsx b/frontend/src/components/ApiKeyBox/ApiKeyBox.tsx index 0bfea4518..0ca7180a8 100644 --- a/frontend/src/components/ApiKeyBox/ApiKeyBox.tsx +++ b/frontend/src/components/ApiKeyBox/ApiKeyBox.tsx @@ -57,6 +57,7 @@ function ApiKeyBox(this: any) { return (
+
openai api key
+
attack mechanisms
{ATTACKS.map((attack, index) => { return ; })} diff --git a/frontend/src/components/DefenceBox/DefenceBox.tsx b/frontend/src/components/DefenceBox/DefenceBox.tsx index fd3543f0e..d2e63e253 100644 --- a/frontend/src/components/DefenceBox/DefenceBox.tsx +++ b/frontend/src/components/DefenceBox/DefenceBox.tsx @@ -110,6 +110,8 @@ function DefenceBox({ return (
+
defence mechanisms
+ {defenceDetails.map((defenceDetail, index) => { return ( - {[...emails].reverse().map((email, index) => { - return ; - })} -
+ +
sent emails
+
+ {[...emails].reverse().map((email, index) => { + return ; + })} +
+
); } diff --git a/frontend/src/components/ModelSelectionBox/ModelSelectionBox.tsx b/frontend/src/components/ModelSelectionBox/ModelSelectionBox.tsx index 9fbbf6084..f273ef3d4 100644 --- a/frontend/src/components/ModelSelectionBox/ModelSelectionBox.tsx +++ b/frontend/src/components/ModelSelectionBox/ModelSelectionBox.tsx @@ -40,6 +40,7 @@ function ModelSelectionBox() { // return a drop down menu with the models return (
+
model selection

Select a model: