From bb729731bef96f0b3913fde52a89cabbb98f9bb1 Mon Sep 17 00:00:00 2001 From: FestiveKyle Date: Mon, 21 Oct 2024 12:58:00 -0300 Subject: [PATCH 1/5] Switch data proptype to array --- frontend/src/summaries/HistoricalSummariesGraph.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/summaries/HistoricalSummariesGraph.js b/frontend/src/summaries/HistoricalSummariesGraph.js index 44777b63f..2fa5a5834 100644 --- a/frontend/src/summaries/HistoricalSummariesGraph.js +++ b/frontend/src/summaries/HistoricalSummariesGraph.js @@ -1,6 +1,6 @@ import React, { useCallback, useState } from 'react' import { Box, Flex, Select, Text } from '@chakra-ui/react' -import { number, object } from 'prop-types' +import { array, number } from 'prop-types' import { extent, bisector } from 'd3-array' import theme from '../theme/canada' @@ -295,7 +295,7 @@ export function HistoricalSummariesGraph({ data, setRange, width = 1200, height } HistoricalSummariesGraph.propTypes = { - data: object.isRequired, + data: array.isRequired, setRange: func, width: number, height: number, From 883b031a6ac2f47fe8aff0121df087f02668cf53 Mon Sep 17 00:00:00 2001 From: FestiveKyle Date: Mon, 21 Oct 2024 12:59:47 -0300 Subject: [PATCH 2/5] Text fontsize -> fontSize --- frontend/src/guidance/EmailGuidance.js | 6 +++--- frontend/src/guidance/WebGuidance.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/guidance/EmailGuidance.js b/frontend/src/guidance/EmailGuidance.js index 8aafc2fe0..81ff6a6f2 100644 --- a/frontend/src/guidance/EmailGuidance.js +++ b/frontend/src/guidance/EmailGuidance.js @@ -152,7 +152,7 @@ export function EmailGuidance({ dnsResults, dmarcPhase, status, mxRecordDiff }) return ( - + Last Scanned: {formatTimestamp(timestamp)} @@ -370,7 +370,7 @@ export function EmailGuidance({ dnsResults, dmarcPhase, status, mxRecordDiff }) : warning return ( - + {idx + 1}. {warningTranslated} @@ -443,7 +443,7 @@ export function EmailGuidance({ dnsResults, dmarcPhase, status, mxRecordDiff }) {nsRecords.warnings.map((warning, idx) => { return ( - + {idx + 1}. {warning} diff --git a/frontend/src/guidance/WebGuidance.js b/frontend/src/guidance/WebGuidance.js index ad02588ec..08d7ce9f1 100644 --- a/frontend/src/guidance/WebGuidance.js +++ b/frontend/src/guidance/WebGuidance.js @@ -126,7 +126,7 @@ export function WebGuidance({ webResults, timestamp }) { return ( <> - + Last Scanned: {formatTimestamp(timestamp)} From 48c7b3a79d9fa5c6f1e56a3083dd3ea5d7235631 Mon Sep 17 00:00:00 2001 From: FestiveKyle Date: Mon, 21 Oct 2024 13:19:59 -0300 Subject: [PATCH 3/5] Add missing keys --- frontend/src/guidance/GuidancePage.js | 6 +++--- frontend/src/guidance/WebTLSResults.js | 28 +++++++++++--------------- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/frontend/src/guidance/GuidancePage.js b/frontend/src/guidance/GuidancePage.js index 97518745d..ff4f561e7 100644 --- a/frontend/src/guidance/GuidancePage.js +++ b/frontend/src/guidance/GuidancePage.js @@ -341,12 +341,12 @@ function GuidancePage() { {organizations.edges.map(({ node }, idx) => { return ( - <> - + + {node.name} ({node.acronym}) {idx !== organizations.edges.length - 1 && ,} - + ) })} diff --git a/frontend/src/guidance/WebTLSResults.js b/frontend/src/guidance/WebTLSResults.js index b05d54270..54f00c272 100644 --- a/frontend/src/guidance/WebTLSResults.js +++ b/frontend/src/guidance/WebTLSResults.js @@ -65,20 +65,16 @@ export function WebTLSResults({ tlsResult }) { The following ciphers are from known weak protocols and must be disabled: {weakProtocols?.map((protocol) => { - return ( - <> - {rest[protocol]?.map(({ name }, idx) => { - return ( - - - {name} - - {weakProtocolNames[protocol]} - - ) - })} - - ) + return rest[protocol]?.map(({ name }, idx) => { + return ( + + + {name} + + {weakProtocolNames[protocol]} + + ) + }) })} ) : ( @@ -497,10 +493,10 @@ export function WebTLSResults({ tlsResult }) { {sanList.map((san, idx) => { return ( - <> + {san} {idx < sanList.length - 1 && ', '} - + ) })} From 9a61ad97b81b2c30417a6348d912eb8928b4e5d8 Mon Sep 17 00:00:00 2001 From: FestiveKyle Date: Mon, 21 Oct 2024 13:21:30 -0300 Subject: [PATCH 4/5] Return empty array for ignoredCves when falsy --- api/src/domain/objects/domain.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/domain/objects/domain.js b/api/src/domain/objects/domain.js index 8f2300f40..1b72b1905 100644 --- a/api/src/domain/objects/domain.js +++ b/api/src/domain/objects/domain.js @@ -281,7 +281,7 @@ export const domainType = new GraphQLObjectType({ ignoredCves: { type: new GraphQLList(CveID), description: 'List of CVEs that have been ignored by the user.', - resolve: ({ ignoredCves }) => ignoredCves, + resolve: ({ ignoredCves }) => ignoredCves || [], }, dmarcSummaryByPeriod: { description: 'Summarized DMARC aggregate reports.', From b7bbc3ed450202fc41f0a475f96a96af887de267 Mon Sep 17 00:00:00 2001 From: FestiveKyle Date: Mon, 21 Oct 2024 13:25:42 -0300 Subject: [PATCH 5/5] Add missing key --- frontend/src/admin/AdminDomains.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/admin/AdminDomains.js b/frontend/src/admin/AdminDomains.js index 51cd141e7..d4df9bc43 100644 --- a/frontend/src/admin/AdminDomains.js +++ b/frontend/src/admin/AdminDomains.js @@ -320,9 +320,9 @@ export function AdminDomains({ orgSlug, orgId }) { )} > {({ id: domainId, domain, claimTags, archived, rcode, organizations, assetState }, index) => ( - <> + {index === 0 && } - + - + )}