diff --git a/src/app/api/axios.jsx b/src/app/api/axios.jsx index fc9fc7da01..ef6c036313 100755 --- a/src/app/api/axios.jsx +++ b/src/app/api/axios.jsx @@ -76,7 +76,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(); } diff --git a/src/app/api/flag-wrapper.jsx b/src/app/api/flag-wrapper.jsx index 3e3f689ffc..a71388fe86 100755 --- a/src/app/api/flag-wrapper.jsx +++ b/src/app/api/flag-wrapper.jsx @@ -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'); @@ -34,6 +35,7 @@ function FlagWrapper({ children }) { isProduction, cmsDisabledIsOn, demographicChangeRequestIsOn, + hti5ErdIsOn, insightsConnectionIsOn, insightsDisplayIsOn, rwtAiIntegrationIsOn, diff --git a/src/app/components/listing/details/sed/sed.jsx b/src/app/components/listing/details/sed/sed.jsx index 5fa1abcf43..7c0c94b15f 100755 --- a/src/app/components/listing/details/sed/sed.jsx +++ b/src/app/components/listing/details/sed/sed.jsx @@ -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'; @@ -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); @@ -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(); @@ -79,113 +85,162 @@ function ChplSed({ listing }) { return ( - - - - - - - Full Usability Report: - - - { sedReportFileLocation - && ( - - )} - {!sedReportFileLocation && 'No report on file'} - - - - - Description of Intended Users: - - - {sedIntendedUserDescription ?? 'N/A'} - - - - - Date SED Testing was Completed: - - - {getDisplayDateFormat(sedTestingEndDay)} - - - - - - - - - - - - - Certification Criteria - UCD Process - UCD Process Details - - - - { sed.ucdProcesses - .sort(sortUcdProcesses) - .map((ucd) => ( - - - - {ucd.criteria - .sort(sortCriteria) - .map((criterion) => ( - - {criterion.removed && 'Removed | '} - {criterion.number} - - ))} - - - - {ucd.name} - - - {ucd.details} - - - ))} - -
-
-
-
- { (listing.edition === null || listing.edition.name === '2015') + { !hti5ErdIsOn && ( - + - - + + + + Full Usability Report: + + + { sedReportFileLocation + && ( + + )} + {!sedReportFileLocation && 'No report on file'} + + + + + Description of Intended Users: + + + {sedIntendedUserDescription ?? 'N/A'} + + + + + Date SED Testing was Completed: + + + {getDisplayDateFormat(sedTestingEndDay)} + + - { sed.testTasks - .sort(sortTestTasks) - .map((task) => ( - - ))} )} + { !hti5ErdIsOn + && ( + + + + + + + + Certification Criteria + UCD Process + UCD Process Details + + + + { sed.ucdProcesses + .sort(sortUcdProcesses) + .map((ucd) => ( + + + + {ucd.criteria + .sort(sortCriteria) + .map((criterion) => ( + + {criterion.removed && 'Removed | '} + {criterion.number} + + ))} + + + + {ucd.name} + + + {ucd.details} + + + ))} + +
+
+ { (listing.edition === null || listing.edition.name === '2015') && sed.testTasks + && ( + + + + + + + { sed.testTasks + .sort(sortTestTasks) + .map((task) => ( + + ))} + + + )} +
+
+ )} + { hti5ErdIsOn + && ( + + + + Certification Criteria + UCD Process + + + + { sed.ucdProcesses + .sort(sortUcdProcesses) + .map((ucd) => ( + + + + {ucd.criteria + .sort(sortCriteria) + .map((criterion) => ( + + {criterion.removed && 'Removed | '} + {criterion.number} + + ))} + + + + { `Name: ${ucd.name}` } + { ucd.details + && ( + <> +
+ Details: + {' '} + {ucd.details} + + )} +
+
+ ))} +
+
+ )}
); } diff --git a/src/app/pages/listing/history/listings.service.js b/src/app/pages/listing/history/listings.service.js index 1e2f162051..e7eaaae88a 100755 --- a/src/app/pages/listing/history/listings.service.js +++ b/src/app/pages/listing/history/listings.service.js @@ -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; diff --git a/src/app/shared/contexts/flag-context.js b/src/app/shared/contexts/flag-context.js index 6800d73a7e..5b76b34ef7 100755 --- a/src/app/shared/contexts/flag-context.js +++ b/src/app/shared/contexts/flag-context.js @@ -3,6 +3,7 @@ import { createContext } from 'react'; const FlagContext = createContext({ cmsDisabledIsOn: false, demographicChangeRequestIsOn: false, + hti5ErdIsOn: false, insightsConnectionIsOn: false, insightsDisplayIsOn: false, rwtAiIntegrationIsOn: false,