Skip to content

Commit

Permalink
add restrictions for non-state sites (#41)
Browse files Browse the repository at this point in the history
* Update docs to make PRs to develop

* update develop again (#32)

* Improve HTML semantics of a couple key elements

* Tweaks to elements

* Add eligibility accordion

* Remove extraneous prettierrc and prettify README.md

* Link to mass.gov/covidvaccine gave a security warning becuase the state didn't redirect properly. Link changed to a non-redirecting link.

* Update eligibility for feb 18, small refactor

* link to senior housing details

Co-authored-by: Matthew Cardarelli <mattrc7@gmx.com>
Co-authored-by: Jake Rogers <jake@dataplusmath.com>
Co-authored-by: Rob Harris <rob@harcod.com>
Co-authored-by: John Hawkinson <jhawk@alum.mit.edu>

* Update docs to make PRs to develop

* adding restrictions for non-state sites

Co-authored-by: Matthew Cardarelli <mattrc7@gmx.com>
Co-authored-by: Jake Rogers <jake@dataplusmath.com>
Co-authored-by: Rob Harris <rob@harcod.com>
Co-authored-by: John Hawkinson <jhawk@alum.mit.edu>
  • Loading branch information
5 people authored Feb 18, 2021
1 parent f8e0fbd commit 7ebccee
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 22 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ If you find a bug or think of an improvement or fix, please open a [new issue](h

### Working on an issue

**MA COVID Vaccines** uses the [GitHub flow](https://guides.github.com/introduction/flow/index.html). All project changes are made through pull requests.
**MA COVID Vaccines** uses the [GitHub flow](https://guides.github.com/introduction/flow/index.html). All project changes are made through pull requests. Please make a pull request to `develop`, not `master`.

If you see an issue that you would like to work on, be sure to leave a quick comment asking if the issue is free to be worked on.

Expand Down
58 changes: 37 additions & 21 deletions src/CovidAppointmentTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export function transformData(data) {
appointmentData: entry.availability || null,
signUpLink: entry.signUpLink || null,
extraData: entry.extraData || null,
restrictions: entry.restrictions || null,
};
});
}
Expand Down Expand Up @@ -58,9 +59,11 @@ const useStyles = makeStyles((theme) => ({
display: "flex",
alignItems: "center",
flexWrap: "wrap",
cursor: "pointer",
color: theme.palette.text.primary,
},
restrictionNoticeTooltip: {
cursor: "pointer",
},
restrictionIcon: {
color: theme.palette.warning.dark,
"padding-right": theme.spacing(1),
Expand Down Expand Up @@ -151,8 +154,10 @@ export default function CovidAppointmentTable() {
function RestrictionNotifier({ entry }) {
let hasRestriction = false;
let restrictionText = null;
let definitiveRestriction = false;

if (entry.restrictions) {
definitiveRestriction = true;
hasRestriction = true;
restrictionText = entry.restrictions;
} else if (entry.extraData && entry.extraData["Additional Information"]) {
Expand All @@ -169,26 +174,37 @@ function RestrictionNotifier({ entry }) {
}

const classes = useStyles();
return hasRestriction ? (
<HelpDialog
className={classes.restrictionNotice}
icon={ErrorOutlineIcon}
iconProps={{ className: classes.restrictionIcon }}
title="This site may be restricted"
text={
<>
<p>
We have flagged this site as restricted based on the
following information (located under "MORE
INFORMATION"):
</p>
<p>"{restrictionText}"</p>
</>
}
>
<Typography>May be restricted</Typography>
</HelpDialog>
) : null;
if (!hasRestriction) {
return null;
} else if (definitiveRestriction) {
return (
<span className={classes.restrictionNotice}>
<ErrorOutlineIcon className={classes.restrictionIcon} />
<Typography>{restrictionText}</Typography>
</span>
);
} else {
return (
<HelpDialog
className={`${classes.restrictionNotice} ${classes.restrictionNoticeTooltip}`}
icon={ErrorOutlineIcon}
iconProps={{ className: classes.restrictionIcon }}
title="This site may be restricted"
text={
<>
<p>
We have flagged this site as restricted based on the
following information (located under "MORE
INFORMATION"):
</p>
<p>"{restrictionText}"</p>
</>
}
>
<Typography>May be restricted</Typography>
</HelpDialog>
);
}
}

function LocationCard({ entry, className }) {
Expand Down
5 changes: 5 additions & 0 deletions src/components/MoreInformation.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ export default function MoreInformation({ entry }) {
<b>Address:</b> {entry.streetAddress}, {entry.city}, MA{" "}
{entry.zip}
</div>
{entry.restrictions && (
<div className={classes.extraData}>
<b>Restrictions:</b> {entry.restrictions}
</div>
)}
<ExtraData data={entry.extraData} />
</AccordionDetails>
</Accordion>
Expand Down

0 comments on commit 7ebccee

Please sign in to comment.