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: 1 addition & 1 deletion src/app/api/axios.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function AxiosProvider({ children }) {
return response;
},
(error) => {
if (error.response.data && error.response.data === 'Invalid authentication token.' && authService.hasAnyRole(['chpl-admin', 'chpl-onc', 'chpl-onc-acb', 'chpl-cms-staff', 'chpl-developer'])) {
if (error?.response?.data === 'Invalid authentication token.' && authService.hasAnyRole(['chpl-admin', 'chpl-onc', 'chpl-onc-acb', 'chpl-cms-staff', 'chpl-developer'])) {
setLoginWidgetState('SIGNIN');
authService.logout();
}
Expand Down
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
257 changes: 156 additions & 101 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 All @@ -46,6 +46,11 @@ const useStyles = makeStyles({
tableScrolling: {
overflowX: 'auto !important',
},
tableBody: {
'& tr:last-child td': {
borderBottom: 'none',
},
},
});

const sortTestTasks = (a, b) => (a.description < b.description ? -1 : 1);
Expand All @@ -61,6 +66,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,113 +85,162 @@ 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>
<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>
</TableRow>
))}
</TableBody>
</Table>
</Card>
</CardContent>
</Card>
{ (listing.edition === null || listing.edition.name === '2015')
{ !hti5ErdIsOn
&& (
<Card>
<CardHeader title="SED Testing Tasks" />
<CardHeader title="SED Summary" />
<CardContent>
<Box display="flex" justifyContent="flex-end" pb={4}>
<ChplSedDownload
listing={listing}
/>
<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>
{ sed.testTasks
.sort(sortTestTasks)
.map((task) => (
<ChplSedTaskView
key={task.friendlyId ?? task.id}
task={task}
/>
))}
</CardContent>
</Card>
)}
{ !hti5ErdIsOn
&& (
<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>
</TableRow>
))}
</TableBody>
</Table>
</Card>
{ (listing.edition === null || listing.edition.name === '2015') && sed.testTasks
&& (
<Card>
<CardHeader title="SED Testing Tasks" />
<CardContent>
<Box display="flex" justifyContent="flex-end" pb={4}>
<ChplSedDownload
listing={listing}
/>
</Box>
{ sed.testTasks
.sort(sortTestTasks)
.map((task) => (
<ChplSedTaskView
key={task.friendlyId ?? task.id}
task={task}
/>
))}
</CardContent>
</Card>
)}
</CardContent>
</Card>
)}
{ hti5ErdIsOn
&& (
<Table>
<TableHead>
<TableRow>
<TableCell>Certification Criteria</TableCell>
<TableCell>UCD Process</TableCell>
</TableRow>
</TableHead>
<TableBody className={classes.tableBody}>
{ sed.ucdProcesses
.sort(sortUcdProcesses)
.map((ucd) => (
<TableRow key={`${ucd.id} - ${ucd.name} - ${ucd.details}`}>
<TableCell>
<List>
{ucd.criteria
.sort(sortCriteria)
.map((criterion) => (
<ListItem key={criterion.id}>
{criterion.removed && 'Removed | '}
{criterion.number}
</ListItem>
))}
</List>
</TableCell>
<TableCell>
{ `Name: ${ucd.name}` }
{ ucd.details
&& (
<>
<br />
Details:
{' '}
{ucd.details}
</>
)}
</TableCell>
</TableRow>
))}
</TableBody>
</Table>
)}
</Box>
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/listing/history/listings.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ 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),
sort: (p, c) => ((p.name ?? p.ucdProcessName) < (c.name ?? c.ucdProcessName) ? -1 : (p.name ?? p.ucdProcessName) > (c.name ?? c.ucdProcessName) ? 1 : (p.details < c.details ? -1 : p.details > c.details ? 1 : 0)),
write: (f) => `UCD Process "${f.name ?? f.ucdProcessName}"`,
};
break;
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