Skip to content

Commit

Permalink
Move new summary views to a stream (#5888)
Browse files Browse the repository at this point in the history
* move landing page progress graph to A stream

* move org page progrerss graph and aggregated findings to A stream
  • Loading branch information
lcampbell2 authored Nov 14, 2024
1 parent 5ee09b2 commit 8bcb868
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 53 deletions.
31 changes: 13 additions & 18 deletions frontend/src/landing/LandingPageSummaries.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { TieredSummaries } from '../summaries/TieredSummaries'
import { Box } from '@chakra-ui/react'
import { HistoricalSummariesGraph } from '../summaries/HistoricalSummariesGraph'
import { ErrorBoundary } from 'react-error-boundary'
import { ABTestVariant, ABTestWrapper } from '../app/ABTestWrapper'
import useSearchParam from '../utilities/useSearchParam'

export function LandingPageSummaries() {
Expand Down Expand Up @@ -41,23 +40,19 @@ export function LandingPageSummaries() {
return (
<Box>
<TieredSummaries summaries={summaries} />
<ABTestWrapper insiderVariantName="B">
<ABTestVariant name="B">
{histSumLoading ? (
<LoadingMessage height={500} />
) : (
<ErrorBoundary FallbackComponent={ErrorFallbackMessage}>
<HistoricalSummariesGraph
data={historicalSummaries?.findChartSummaries}
setRange={setProgressChartRangeParam}
selectedRange={progressChartRangeParam}
width={1200}
height={500}
/>
</ErrorBoundary>
)}
</ABTestVariant>
</ABTestWrapper>
{histSumLoading ? (
<LoadingMessage height={500} />
) : (
<ErrorBoundary FallbackComponent={ErrorFallbackMessage}>
<HistoricalSummariesGraph
data={historicalSummaries?.findChartSummaries}
setRange={setProgressChartRangeParam}
selectedRange={progressChartRangeParam}
width={1200}
height={500}
/>
</ErrorBoundary>
)}
</Box>
)
}
45 changes: 20 additions & 25 deletions frontend/src/organizationDetails/OrganizationDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import { RadialBarChart } from '../summaries/RadialBarChart'
import { RequestOrgInviteModal } from '../organizations/RequestOrgInviteModal'
import { useUserVar } from '../utilities/userState'
import { HistoricalSummariesGraph } from '../summaries/HistoricalSummariesGraph'
import { ABTestVariant, ABTestWrapper } from '../app/ABTestWrapper'
import useSearchParam from '../utilities/useSearchParam'
import { AggregatedGuidanceSummary } from '../summaries/AggregatedGuidanceSummary'
import { bool } from 'prop-types'
Expand Down Expand Up @@ -160,30 +159,26 @@ export default function OrganizationDetails({ loginRequired }) {
<TieredSummaries summaries={data?.organization?.summaries} />
</ErrorBoundary>
<Divider />
<ABTestWrapper insiderVariantName="B">
<ABTestVariant name="B">
{orgSummariesLoading ? (
<LoadingMessage height={500} />
) : (
<ErrorBoundary FallbackComponent={ErrorFallbackMessage}>
<HistoricalSummariesGraph
data={orgSummariesData?.findOrganizationBySlug?.historicalSummaries}
setRange={setProgressChartRangeParam}
selectedRange={progressChartRangeParam}
width={1200}
height={500}
userHasPermission={data?.organization?.userHasPermission}
/>
</ErrorBoundary>
)}
<Divider />
{data?.organization?.userHasPermission && (
<ErrorBoundary FallbackComponent={ErrorFallbackMessage}>
<AggregatedGuidanceSummary orgSlug={orgSlug} mt="4" className="aggregated-guidance-summary" />
</ErrorBoundary>
)}
</ABTestVariant>
</ABTestWrapper>
{orgSummariesLoading ? (
<LoadingMessage height={500} />
) : (
<ErrorBoundary FallbackComponent={ErrorFallbackMessage}>
<HistoricalSummariesGraph
data={orgSummariesData?.findOrganizationBySlug?.historicalSummaries}
setRange={setProgressChartRangeParam}
selectedRange={progressChartRangeParam}
width={1200}
height={500}
userHasPermission={data?.organization?.userHasPermission}
/>
</ErrorBoundary>
)}
<Divider />
{data?.organization?.userHasPermission && (
<ErrorBoundary FallbackComponent={ErrorFallbackMessage}>
<AggregatedGuidanceSummary orgSlug={orgSlug} mt="4" className="aggregated-guidance-summary" />
</ErrorBoundary>
)}
</TabPanel>
<TabPanel>
<ErrorBoundary FallbackComponent={ErrorFallbackMessage}>
Expand Down
15 changes: 5 additions & 10 deletions frontend/src/summaries/HistoricalSummariesGraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import { Trans, t } from '@lingui/macro'
import { func } from 'prop-types'
import useSearchParam from '../utilities/useSearchParam'
import { useLocation } from 'react-router-dom'
import { ABTestVariant, ABTestWrapper } from '../app/ABTestWrapper'

const getDate = ({ date }) => new Date(date)

Expand Down Expand Up @@ -230,15 +229,11 @@ export function HistoricalSummariesGraph({
<option value="three">
<Trans>Tier 3: Compliance</Trans>
</option>
<ABTestWrapper insiderVariantName="B">
<ABTestVariant name="B">
{location.pathname.includes('/organizations/') && userHasPermission && (
<option value="four">
<Trans>Total Negative Findings</Trans>
</option>
)}
</ABTestVariant>
</ABTestWrapper>
{location.pathname.includes('/organizations/') && userHasPermission && (
<option value="four">
<Trans>Total Negative Findings</Trans>
</option>
)}
</Select>
</Flex>
<Box position="relative">
Expand Down

0 comments on commit 8bcb868

Please sign in to comment.