Skip to content

Commit

Permalink
only show info status for web connection results if not web-hosting
Browse files Browse the repository at this point in the history
  • Loading branch information
lcampbell2 committed Nov 13, 2024
1 parent a8df2e7 commit f1c5efb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
19 changes: 14 additions & 5 deletions frontend/src/guidance/WebConnectionResults.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import {
Flex,
Text,
} from '@chakra-ui/react'
import { object } from 'prop-types'
import { bool, object } from 'prop-types'
import { PlusSquareIcon } from '@chakra-ui/icons'
import { StatusIcon } from '../components/StatusIcon'
import { GuidanceTagList } from './GuidanceTagList'
import { t, Trans } from '@lingui/macro'
import { DetailTooltip } from './DetailTooltip'

export function WebConnectionResults({ connectionResults }) {
export function WebConnectionResults({ connectionResults, isWebHosting }) {
const {
httpLive,
httpsLive,
Expand Down Expand Up @@ -168,7 +168,7 @@ export function WebConnectionResults({ connectionResults }) {
<Box fontSize="lg" px="2">
<Flex {...columnInfoStyleProps}>
<DetailTooltip label={t`Shows if the HTTPS connection is live.`}>
<StatusIcon status={httpsLive ? 'PASS' : 'FAIL'} />
<StatusIcon status={!isWebHosting ? 'INFO' : httpsLive ? 'PASS' : 'FAIL'} />
<Text px="1">
<Trans>HTTPS Live</Trans>
</Text>
Expand All @@ -179,7 +179,15 @@ export function WebConnectionResults({ connectionResults }) {
<DetailTooltip
label={t`Shows if the HTTPS endpoint downgrades to unsecured HTTP immediately, eventually, or never.`}
>
<StatusIcon status={httpsImmediatelyDowngrades || httpsEventuallyDowngrades ? 'FAIL' : 'PASS'} />
<StatusIcon
status={
!isWebHosting
? 'INFO'
: httpsImmediatelyDowngrades || httpsEventuallyDowngrades
? 'FAIL'
: 'PASS'
}
/>
<Text px="1">
<Trans>HTTPS Downgrades</Trans>
</Text>
Expand All @@ -190,7 +198,7 @@ export function WebConnectionResults({ connectionResults }) {
</Flex>
<Flex {...columnInfoStyleProps}>
<DetailTooltip label={t`Shows if the HSTS (HTTP Strict Transport Security) header is present.`}>
<StatusIcon status={hstsParsed ? 'PASS' : 'FAIL'} />
<StatusIcon status={!isWebHosting ? 'INFO' : hstsParsed ? 'PASS' : 'FAIL'} />
<Text px="1">
<Trans>HSTS Parsed</Trans>
</Text>
Expand Down Expand Up @@ -241,4 +249,5 @@ export function WebConnectionResults({ connectionResults }) {

WebConnectionResults.propTypes = {
connectionResults: object,
isWebHosting: bool,
}
5 changes: 4 additions & 1 deletion frontend/src/guidance/WebGuidance.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,10 @@ export function WebGuidance({ webResults, timestamp }) {
)}
{currentEndpoint.results && (
<>
<WebConnectionResults connectionResults={currentEndpoint.results.connectionResults} />
<WebConnectionResults
isWebHosting={isWebHosting}
connectionResults={currentEndpoint.results.connectionResults}
/>
<WebTLSResults tlsResult={currentEndpoint.results.tlsResult} />
</>
)}
Expand Down

0 comments on commit f1c5efb

Please sign in to comment.