From 5da0ae68667e94fcadf0259f543cfea1c18cb84b Mon Sep 17 00:00:00 2001 From: Christoph Niehoff Date: Thu, 6 Jul 2023 17:22:11 +0200 Subject: [PATCH] Fix review findings --- src/client/components/board/board.jsx | 2 +- .../privacyEnhancedModel/privacyEnhancedModel.test.tsx | 6 +++--- .../privacyEnhancedModel/privacyEnhancedModel.tsx | 10 +++++----- src/client/components/threatmodal/threatmodal.jsx | 4 ++-- src/client/pages/create.tsx | 10 +++++----- src/client/styles/create.css | 2 +- src/game/gameState.ts | 2 +- src/game/setupData.ts | 2 +- src/game/utils.ts | 4 ++-- src/server/endpoints.js | 2 +- 10 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/client/components/board/board.jsx b/src/client/components/board/board.jsx index 948575d..05c9d61 100644 --- a/src/client/components/board/board.jsx +++ b/src/client/components/board/board.jsx @@ -122,7 +122,7 @@ class Board extends React.Component { /> )} {this.props.G.modelType === ModelType.PRIVACY_ENHANCED && ( - + )}
diff --git a/src/client/components/privacyEnhancedModel/privacyEnhancedModel.test.tsx b/src/client/components/privacyEnhancedModel/privacyEnhancedModel.test.tsx index 1233601..b5794aa 100644 --- a/src/client/components/privacyEnhancedModel/privacyEnhancedModel.test.tsx +++ b/src/client/components/privacyEnhancedModel/privacyEnhancedModel.test.tsx @@ -6,14 +6,14 @@ describe('privacy enhanced model', () => { it('should provide link to model', () => { const linkToModel = 'https://link/to/model'; - render(); + render(); screen.getByText(linkToModel); screen.getByRole('link'); }); - it('should not provide link to model if there is no modelRef', () => { - render(); + it('should not provide link to model if there is no modelReference', () => { + render(); expect(screen.queryByRole('link')).toBeNull(); }); diff --git a/src/client/components/privacyEnhancedModel/privacyEnhancedModel.tsx b/src/client/components/privacyEnhancedModel/privacyEnhancedModel.tsx index 150b475..6d2e7ae 100644 --- a/src/client/components/privacyEnhancedModel/privacyEnhancedModel.tsx +++ b/src/client/components/privacyEnhancedModel/privacyEnhancedModel.tsx @@ -2,22 +2,22 @@ import type React from 'react'; import './privacyEnhancedModel.css'; interface PrivacyEnhancedModelProps { - modelRef?: string; + modelReference?: string; } const PrivacyEnhancedModel: React.FC = ({ - modelRef, + modelReference, }) => { - if (modelRef) { + if (modelReference) { return (

Threat Modelling

- {modelRef && ( + {modelReference && ( <>

The model is hosted externally:  - {modelRef} + {modelReference} {/* Note: React takes care about sanitization of user input above to prevent XSS */}

diff --git a/src/client/components/threatmodal/threatmodal.jsx b/src/client/components/threatmodal/threatmodal.jsx index 227124a..9626934 100644 --- a/src/client/components/threatmodal/threatmodal.jsx +++ b/src/client/components/threatmodal/threatmodal.jsx @@ -201,12 +201,12 @@ class ThreatModal extends React.Component { return ( -