Skip to content
Merged
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
25 changes: 1 addition & 24 deletions src/app/components/change-request/change-request.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,24 +141,11 @@ const getChangeRequestViewDetails = (cr) => {
<ChplChangeRequestDemographicsView />
</>
);
case 'RWT Plans URL Change Request':
return (
<>
<Divider />
<ChplChangeRequestListingRwtView
value="rwtPlansUrl"
title="Plans"
/>
</>
);
case 'RWT Results URL Change Request':
return (
<>
<Divider />
<ChplChangeRequestListingRwtView
value="rwtResultsUrl"
title="Results"
/>
<ChplChangeRequestListingRwtView />
</>
);
case 'Service Base URL List Change Request':
Expand Down Expand Up @@ -191,20 +178,10 @@ const getChangeRequestEditDetails = (cr, handleDispatch, isAccepting) => {
return (
<ChplChangeRequestDemographicsEdit />
);
case 'RWT Plans URL Change Request':
return (
<ChplChangeRequestListingRwtEdit
isAccepting={isAccepting}
title="Plans"
value="rwtPlansUrl"
/>
);
case 'RWT Results URL Change Request':
return (
<ChplChangeRequestListingRwtEdit
isAccepting={isAccepting}
title="Results"
value="rwtResultsUrl"
/>
);
case 'Service Base URL List Change Request':
Expand Down
14 changes: 6 additions & 8 deletions src/app/components/change-request/types/listing-rwt-edit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
Typography,
makeStyles,
} from '@material-ui/core';
import { bool, string } from 'prop-types';
import { bool } from 'prop-types';
import { useFormik } from 'formik';
import * as yup from 'yup';

Expand Down Expand Up @@ -42,7 +42,7 @@ const validationSchema = yup.object({
}),
});

function ChplChangeRequestListingRwtEdit({ isAccepting = false, title, value }) {
function ChplChangeRequestListingRwtEdit({ isAccepting = false }) {
const { analytics } = useAnalyticsContext();
const { changeRequest, setChangeRequest } = useContext(ChangeRequestContext);
const { hasAnyRole } = useContext(UserContext);
Expand All @@ -54,14 +54,14 @@ function ChplChangeRequestListingRwtEdit({ isAccepting = false, title, value })
}, [hasAnyRole, isAccepting]);

const getCurrent = () => {
if (changeRequest.details.listing[value]) {
if (changeRequest.details.listing.rwtResultsUrl) {
return (
<ChplLink
href={changeRequest.details.listing[value]}
href={changeRequest.details.listing.rwtResultsUrl}
analytics={{
...analytics,
event: `Navigate to Current RWT ${title} URL`,
label: changeRequest.details.listing[value],
event: 'Navigate to Current RWT Results URL',
label: changeRequest.details.listing.rwtResultsUrl,
}}
/>
);
Expand Down Expand Up @@ -152,6 +152,4 @@ export default ChplChangeRequestListingRwtEdit;

ChplChangeRequestListingRwtEdit.propTypes = {
isAccepting: bool,
title: string.isRequired,
value: string.isRequired,
};
Loading
Loading