Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/app/api/flag-wrapper.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ function FlagWrapper({ children }) {

const cmsDisabledIsOn = isOn('cms-disabled');
const demographicChangeRequestIsOn = isOn('demographic-change-request');
const hti5ErdIsOn = isOn('hti-5-erd');
const insightsConnectionIsOn = isOn('insights-connection');
const insightsDisplayIsOn = isOn('insights-display');
const rwtAiIntegrationIsOn = isOn('rwt-ai-integration');
Expand All @@ -34,6 +35,7 @@ function FlagWrapper({ children }) {
isProduction,
cmsDisabledIsOn,
demographicChangeRequestIsOn,
hti5ErdIsOn,
insightsConnectionIsOn,
insightsDisplayIsOn,
rwtAiIntegrationIsOn,
Expand Down
201 changes: 121 additions & 80 deletions src/app/components/listing/details/sed/sed.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import ChplSedTaskView from './sed-task-view';
import { ChplLink } from 'components/util';
import { sortCriteria } from 'services/criteria.service';
import { getDisplayDateFormat } from 'services/date-util';
import { UserContext } from 'shared/contexts';
import { FlagContext, UserContext } from 'shared/contexts';
import { listing as listingType } from 'shared/prop-types/listing';
import { theme } from 'themes';

Expand Down Expand Up @@ -61,6 +61,7 @@ function ChplSed({ listing }) {
sedReportFileLocation,
sedTestingEndDay,
} = listing;
const { hti5ErdIsOn } = useContext(FlagContext);
const { user } = useContext(UserContext);
const [hasSed, setHasSed] = useState(false);
const classes = useStyles();
Expand All @@ -79,93 +80,133 @@ function ChplSed({ listing }) {

return (
<Box display="flex" gridGap={16} flexDirection="column">
<Card>
<CardHeader title="SED Summary" />
<CardContent>
<Box className={classes.dataContainer}>
<Box width="100%">
<Typography variant="subtitle1">
Full Usability Report:
</Typography>
<Typography>
{ sedReportFileLocation
&& (
<ChplLink
href={sedReportFileLocation}
analytics={{
event: 'Go to Full Usability Report',
category: 'Listing Details',
label: listing.chplProductNumber,
aggregationName: product.name,
group: user?.role,
}}
/>
)}
{!sedReportFileLocation && 'No report on file'}
</Typography>
</Box>
<Box className={classes.dataBox}>
<Typography variant="subtitle1">
Description of Intended Users:
</Typography>
<Typography>
{sedIntendedUserDescription ?? 'N/A'}
</Typography>
</Box>
<Box className={classes.dataBox}>
<Typography variant="subtitle1">
Date SED Testing was Completed:
</Typography>
<Typography>
{getDisplayDateFormat(sedTestingEndDay)}
</Typography>
</Box>
</Box>
</CardContent>
</Card>
{ !hti5ErdIsOn
&& (
<Card>
<CardHeader title="SED Summary" />
<CardContent>
<Box className={classes.dataContainer}>
<Box width="100%">
<Typography variant="subtitle1">
Full Usability Report:
</Typography>
<Typography>
{ sedReportFileLocation
&& (
<ChplLink
href={sedReportFileLocation}
analytics={{
event: 'Go to Full Usability Report',
category: 'Listing Details',
label: listing.chplProductNumber,
aggregationName: product.name,
group: user?.role,
}}
/>
)}
{!sedReportFileLocation && 'No report on file'}
</Typography>
</Box>
<Box className={classes.dataBox}>
<Typography variant="subtitle1">
Description of Intended Users:
</Typography>
<Typography>
{sedIntendedUserDescription ?? 'N/A'}
</Typography>
</Box>
<Box className={classes.dataBox}>
<Typography variant="subtitle1">
Date SED Testing was Completed:
</Typography>
<Typography>
{getDisplayDateFormat(sedTestingEndDay)}
</Typography>
</Box>
</Box>
</CardContent>
</Card>
)}
<Card>
<CardHeader title="SED Tested Certification Criteria &amp; Associated UCD Processes" />
<CardContent>
<Card className={classes.tableScrolling}>
<Table>
<TableHead>
<TableRow>
<TableCell>Certification Criteria</TableCell>
<TableCell>UCD Process</TableCell>
<TableCell>UCD Process Details</TableCell>
</TableRow>
</TableHead>
<TableBody>
{ sed.ucdProcesses
.sort(sortUcdProcesses)
.map((ucd) => (
<TableRow key={ucd.id}>
<TableCell>
<List>
{ucd.criteria
.sort(sortCriteria)
.map((criterion) => (
<ListItem key={criterion.id}>
{criterion.removed && 'Removed | '}
{criterion.number}
</ListItem>
))}
</List>
</TableCell>
<TableCell>
{ucd.name}
</TableCell>
<TableCell>
{ucd.details}
</TableCell>
{ !hti5ErdIsOn
&& (
<Table>
<TableHead>
<TableRow>
<TableCell>Certification Criteria</TableCell>
<TableCell>UCD Process</TableCell>
<TableCell>UCD Process Details</TableCell>
</TableRow>
</TableHead>
<TableBody>
{ sed.ucdProcesses
.sort(sortUcdProcesses)
.map((ucd) => (
<TableRow key={ucd.id}>
<TableCell>
<List>
{ucd.criteria
.sort(sortCriteria)
.map((criterion) => (
<ListItem key={criterion.id}>
{criterion.removed && 'Removed | '}
{criterion.number}
</ListItem>
))}
</List>
</TableCell>
<TableCell>
{ucd.name}
</TableCell>
<TableCell>
{ucd.details}
</TableCell>
</TableRow>
))}
</TableBody>
</Table>
)}
{ hti5ErdIsOn
&& (
<Table>
<TableHead>
<TableRow>
<TableCell>Certification Criteria</TableCell>
<TableCell>UCD Process</TableCell>
</TableRow>
))}
</TableBody>
</Table>
</TableHead>
<TableBody>
{ sed.ucdProcesses
.sort(sortUcdProcesses)
.map((ucd) => (
<TableRow key={ucd.id}>
<TableCell>
<List>
{ucd.criteria
.sort(sortCriteria)
.map((criterion) => (
<ListItem key={criterion.id}>
{criterion.removed && 'Removed | '}
{criterion.number}
</ListItem>
))}
</List>
</TableCell>
<TableCell>
{ucd.value}
</TableCell>
</TableRow>
))}
</TableBody>
</Table>
)}
</Card>
</CardContent>
</Card>
{ (listing.edition === null || listing.edition.name === '2015')
{ (listing.edition === null || listing.edition.name === '2015') && !hti5ErdIsOn
&& (
<Card>
<CardHeader title="SED Testing Tasks" />
Expand Down
8 changes: 6 additions & 2 deletions src/app/pages/listing/history/listings.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,12 @@ const compare = (before, after, key, title = 'unknown') => {
break;
case 'ucdProcesses':
options = {
sort: (p, c) => ((p.name ?? p.ucdProcessName) < (c.name ?? c.ucdProcessName) ? -1 : (p.name ?? p.ucdProcessName) > (c.name ?? c.ucdProcessName) ? 1 : 0),
write: (f) => `UCD Process "${f.name ?? f.ucdProcessName}"`,
sort: (p, c) => {
const pv = p.name ?? p.ucdProcessName ?? p.value;
const cv = c.name ?? c.ucdProcessName ?? c.value;
return pv < cv ? -1 : (pv > cv ? 1 : 0);
},
write: (f) => `UCD Process "${f.name ?? f.ucdProcessName ?? f.value}"`,
};
break;
default:
Expand Down
1 change: 1 addition & 0 deletions src/app/shared/contexts/flag-context.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { createContext } from 'react';
const FlagContext = createContext({
cmsDisabledIsOn: false,
demographicChangeRequestIsOn: false,
hti5ErdIsOn: false,
insightsConnectionIsOn: false,
insightsDisplayIsOn: false,
rwtAiIntegrationIsOn: false,
Expand Down
Loading