Skip to content

Commit

Permalink
UI Text updates (#1922)
Browse files Browse the repository at this point in the history
* install and configure i18n library

* fix text

* remove commented out text

* Remove non tenant specific text

* fix code smells

* fix failing tests

* text changes

* text update

* Use mui link instead

* remove unused import
  • Loading branch information
jadmsaadaot authored Jul 31, 2023
1 parent 65921cb commit 273ab78
Show file tree
Hide file tree
Showing 10 changed files with 65 additions and 45 deletions.
2 changes: 1 addition & 1 deletion met-web/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const App = () => {
try {
const tenant = await getTenant(basename);

localStorage.setItem('tenantId', basename);
sessionStorage.setItem('tenantId', basename);
dispatch(
saveTenant({
name: tenant.name,
Expand Down
18 changes: 12 additions & 6 deletions met-web/src/components/comments/admin/review/CommentReview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ import {
Checkbox,
TextField,
FormHelperText,
Link,
} from '@mui/material';
import { getSubmission, reviewComments } from 'services/submissionService';
import { useAppDispatch } from 'hooks';
import { useAppDispatch, useAppTranslation } from 'hooks';
import { useParams, useNavigate } from 'react-router-dom';
import { openNotification } from 'services/notificationService/notificationSlice';
import {
Expand All @@ -24,6 +25,7 @@ import {
SecondaryButton,
MetHeader3,
MetHeader4,
MetSmallText,
} from 'components/common';
import { CommentStatus } from 'constants/commentStatus';
import { StaffNoteType } from 'constants/staffNoteType';
Expand Down Expand Up @@ -56,6 +58,7 @@ const CommentReview = () => {
const [survey, setSurvey] = useState<Survey>(createDefaultSurvey());
const dispatch = useAppDispatch();
const navigate = useNavigate();
const { t: translate } = useAppTranslation();
const { submissionId, surveyId } = useParams();
const reviewNotes = updatedStaffNote.filter((staffNote) => staffNote.note_type == StaffNoteType.Review);
const internalNotes = updatedStaffNote.filter((staffNote) => staffNote.note_type == StaffNoteType.Internal);
Expand Down Expand Up @@ -194,6 +197,7 @@ const CommentReview = () => {
};

const defaultVerdict = comment_status_id !== CommentStatus.Pending ? comment_status_id : CommentStatus.Approved;
const threatEmailContact = translate('comment.admin.review.threatContactEmail');
return (
<MetPageGridContainer>
<EmailPreviewModal
Expand Down Expand Up @@ -331,7 +335,9 @@ const CommentReview = () => {
}
/>
<FormControlLabel
label={<MetParagraph>Contains profanity or swear words</MetParagraph>}
label={
<MetParagraph>Contains profanity or inappropriate language</MetParagraph>
}
control={
<Checkbox
checked={hasProfanity}
Expand All @@ -348,10 +354,10 @@ const CommentReview = () => {
/>
}
/>
<MetParagraph color="#d32f2f" fontSize={'13px'} marginLeft={'3em'}>
If there is a threat/menace in the comments, select this checkbox and contact
{`<TBD>`}. No email will be sent.
</MetParagraph>
<MetSmallText bold color="#d32f2f" marginLeft={'3em'} mt={'-1em'}>
{translate('comment.admin.review.ifThreatContact')}{' '}
<Link href={`mailto:${threatEmailContact}`}>{threatEmailContact}</Link>
</MetSmallText>
<FormControlLabel
label={<MetParagraph sx={{ color: '#494949' }}>Other</MetParagraph>}
control={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ const EngagementForm = () => {
<Grid item xs={12}>
<MetLabel>Engagement Date </MetLabel>
<MetDescription>
This is the date the public engagement will be open to the public.
This is the date range of the public comment period, when the public may provide feedback.
</MetDescription>
</Grid>
<Grid item md={4} xs={12}>
Expand Down
43 changes: 18 additions & 25 deletions met-web/src/components/engagement/view/EmailPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
Stack,
useMediaQuery,
Theme,
Toolbar,
Link,
} from '@mui/material';
import { EmailPanelProps } from './types';
Expand Down Expand Up @@ -80,13 +79,17 @@ const EmailPanel = ({ email, checkEmail, handleClose, updateEmail, isSaving, isI
</Grid>

<Grid item xs={12}>
<MetBody>You will receive a link to access the survey at the email address you provide.</MetBody>
<MetBody>
You will receive a link to provide your feedback at the email address you provide.
</MetBody>
</Grid>

<Grid item xs={12}>
<MetBody>
<strong>Why are we collecting your email?</strong> Email verification helps us to know you are
not a robot, and ensures we have your consent to send you the survey link.
not a robot, and ensures we have your consent to collect your feedback. Your email address will
remain confidential, and will only be used to authenticate your participation in this public
comment period and (TBD).
</MetBody>
</Grid>
<Grid item xs={12}>
Expand Down Expand Up @@ -159,29 +162,19 @@ const EmailPanel = ({ email, checkEmail, handleClose, updateEmail, isSaving, isI
</MetDescription>
</Grid>
</When>

<Grid item container xs={12} direction="row" justifyContent="flex-end" spacing={1} sx={{ mt: '1em' }}>
<Stack direction={{ xs: 'column', sm: 'row' }} spacing={1} width="100%" justifyContent="flex-end">
{isSmallScreen ? (
<>
<PrimaryButton type="submit" variant={'contained'} loading={isSaving}>
Submit
</PrimaryButton>
<SecondaryButton onClick={handleClose} disabled={isSaving}>
Cancel
</SecondaryButton>
<Toolbar />
</>
) : (
<>
<SecondaryButton onClick={handleClose} disabled={isSaving}>
Cancel
</SecondaryButton>
<PrimaryButton type="submit" variant={'contained'} loading={isSaving}>
Submit
</PrimaryButton>
</>
)}
<Stack
direction={{ md: 'column-reverse', lg: 'row' }}
spacing={1}
width="100%"
justifyContent="flex-end"
>
<SecondaryButton onClick={handleClose} disabled={isSaving}>
Cancel
</SecondaryButton>
<PrimaryButton type="submit" variant={'contained'} loading={isSaving}>
Submit
</PrimaryButton>
</Stack>
</Grid>
</Grid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ const ScheduleModal = ({ reschedule, open, updateModal }: ScheduleModalProps) =>
<Grid container direction="row" item xs={12}>
<Grid item xs={12}>
<MetBody sx={{ mb: 1 }}>
(The Engagement page will be visible on the date selected but the survey won't be accessible
until the Engagement Date.)
The Engagement page will be visible on the date selected below but the public wont be able
to provide feedback until the public comment period opens.
</MetBody>
</Grid>
<Grid item xs={12}>
<MetBody sx={{ mb: 1, fontWeight: 'bold' }}>
Enter the date & time you want the Engagement to go live.
Enter the date & time you want the Engagement page to go live.
</MetBody>
</Grid>
<Grid
Expand Down
16 changes: 14 additions & 2 deletions met-web/src/components/engagement/view/SuccessPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,32 @@ const SuccessPanel = ({ email, handleClose }: SuccessPanelProps) => {
</Grid>
<Grid item xs={12}>
<MetBody id="modal-modal-header">
We sent a link to access the survey at the following email address:
We sent a link to provide your feedback at the following email address:
</MetBody>
<MetBody sx={{ mt: 1 }}>{email}</MetBody>
</Grid>
</Grid>
<Grid container direction="row" item xs={12}>
<Grid item xs={12}>
<MetBody sx={{ mb: 1, fontWeight: 'bold' }}>
Please click the link provided to access the survey.
If you don't see the email in your inbox within a few minutes, please check your junk/spam
folder, or your promotion folder (Gmail).
</MetBody>
</Grid>
<Grid item xs={12}>
<MetBody sx={{ mb: 1, fontWeight: 'bold' }}>
Please click the link provided to provide your feedback.
</MetBody>
</Grid>
<Grid item xs={12}>
<MetBody sx={{ mb: 1, fontWeight: 'bold' }}>The link will be valid for 24 hours.</MetBody>
</Grid>
<Grid item xs={12}>
<MetBody sx={{ mb: 1, fontWeight: 'bold', fontStyle: 'italic' }}>
If you are not able to provide feedback within 24 hours, you may request a new link. Refer to
the verification email for more information.
</MetBody>
</Grid>

<Grid
item
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const InfoArrow = () => {
}}
>
<MetSmallText color="white">
Engagement and consensus-seeking with participating Indigenous nations occur at each stage of the
Engagement and consensus-seeking with participating First Nations occur at each stage of the
process, supported by dispute resolution at certain stages if required.
</MetSmallText>
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const PhasesWidget = () => {
<MetPaper elevation={1} sx={{ padding: '2em', pt: '25px' }}>
<Grid container direction="row" justifyContent="flex-start" alignItems="flex-start">
<Grid item xs={12}>
<MetHeader3 bold>The EA Process</MetHeader3>
<MetHeader3 bold>The Environmental Assessment Process</MetHeader3>
</Grid>

<When condition={Boolean(currentPhaseId) && currentPhaseId !== EngagementPhases.Standalone}>
Expand All @@ -57,9 +57,10 @@ export const PhasesWidget = () => {
</When>
<Grid item xs={12}>
<MetBody>
Click on the sections below to expand them and learn more about each EA process phase. You
can also learn more about each engagement period by clicking the engagement icon.
{<ForumIcon fontSize="1.2em" sx={{ marginLeft: '0.5em' }} />}
Click ‘learn more’ on the sections below for more details about each phase in the
Environmental Assessment process. Click the speech bubble icon
{<ForumIcon fontSize="1.2em" sx={{ marginLeft: '0.5em' }} />} to learn more about each
unique public comment period.
</MetBody>
</Grid>
<Grid item xs={12} sx={{ maxWidth: '99%' }}>
Expand Down
2 changes: 1 addition & 1 deletion met-web/src/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector;

export const useAppTranslation = () => {
const translate = useTranslation();
const basename = localStorage.getItem('tenantId');
const basename = sessionStorage.getItem('tenantId');

const { t } = translate;

Expand Down
10 changes: 9 additions & 1 deletion met-web/src/locales/en/eao.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@
"landing": {
"banner": {
"header": "Environmental Assessment Office Public Engagement",
"description": "Description: Public participation in environmental assessments is critical, giving citizens input into decisions on whether or not major projects should proceed, and if they do, what safeguards should be in place."
"description": "Public participation in environmental assessments is critical, giving citizens input into decisions on whether or not major projects should proceed, and if they do, what safeguards should be in place."
}
},
"comment": {
"admin": {
"review": {
"ifThreatContact": "If there is a threat/menace in the comments, check the box below. No email will be sent. Contact Sarah Plank at",
"threatContactEmail": "[email protected]"
}
}
}
}

0 comments on commit 273ab78

Please sign in to comment.