Skip to content

Commit

Permalink
feat: add new support email as a variable; use temporarily for reports
Browse files Browse the repository at this point in the history
  • Loading branch information
kriscooke authored and matthieu-foucault committed Feb 2, 2021
1 parent 434449a commit a4f2fe6
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 28 deletions.
6 changes: 3 additions & 3 deletions app/components/Dashboard/reportAProblem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import React from 'react';
import {Card} from 'react-bootstrap';

interface Props {
serviceUrl: string;
supportUrl: string;
}

const ReportAProblem: React.FunctionComponent<Props> = ({serviceUrl}) => {
const ReportAProblem: React.FunctionComponent<Props> = ({supportUrl}) => {
return (
<Card className="admin-control-card">
<Card.Body
Expand All @@ -22,7 +22,7 @@ const ReportAProblem: React.FunctionComponent<Props> = ({serviceUrl}) => {
</span>{' '}
Something wrong?
<br />
<a href={serviceUrl}>Report a problem</a> to the development team.
<a href={supportUrl}>Report a problem</a> to the development team.
</p>
</Card.Body>
<style jsx>{`
Expand Down
5 changes: 3 additions & 2 deletions app/components/Layout/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import Link from 'next/link';
import getConfig from 'next/config';

const Footer = () => {
const feedbackUrl = getConfig()?.publicRuntimeConfig.FEEDBACK_SITE_URL;
const supportEmail = getConfig()?.publicRuntimeConfig.SUPPORT_EMAIL;
const mailtoLink = `mailto:${supportEmail}?subject=Feedback: CIIP Website`;
return (
<footer className="footer">
<div className="container">
Expand Down Expand Up @@ -32,7 +33,7 @@ const Footer = () => {
<li>
<Link href="/resources/contact">Contact Us</Link>
</li>
<li>{feedbackUrl && <a href={feedbackUrl}>Feedback</a>}</li>
<li>{supportEmail && <a href={mailtoLink}>Feedback</a>}</li>
</ul>
</div>
<style jsx>
Expand Down
13 changes: 6 additions & 7 deletions app/lib/error-boundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,18 @@ class ErrorBoundary extends Component {

render() {
if (this.state.hasError) {
const feedbackUrl = getConfig()?.publicRuntimeConfig.FEEDBACK_SITE_URL;
const supportEmail = getConfig()?.publicRuntimeConfig.SUPPORT_EMAIL;
const mailtoLink = `mailto:${supportEmail}?subject=Support Request: CIIP Website Server Error`;
// You can render any custom fallback UI
return (
<DefaultLayoutComponent session={null}>
<Alert variant="danger">
<Alert.Heading>An unexpected error has occured</Alert.Heading>
<p>
Please consider reporting this error on our{' '}
<Alert.Link href={feedbackUrl}>feedback site</Alert.Link>, by
either creating a new post or commenting on an existing post if
this error was already reported. Copying the error details below
when submitting a bug report will help us understand what
happened.
Please consider reporting this error to our development team at{' '}
<Alert.Link href={mailtoLink}>{supportEmail}</Alert.Link>. Copying
the error details below when submitting a bug report will help us
understand what happened.
</p>
</Alert>

Expand Down
2 changes: 1 addition & 1 deletion app/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = {
},
publicRuntimeConfig: {
NO_MATHJAX: process.env.NO_MATHJAX,
FEEDBACK_SITE_URL: process.env.FEEDBACK_SITE_URL,
SUPPORT_EMAIL: process.env.SUPPORT_EMAIL,
ENABLE_ANALYTICS: process.env.ENABLE_ANALYTICS,
SITEWIDE_NOTICE: process.env.SITEWIDE_NOTICE,
ENABLE_DB_MOCKS: process.env.ENABLE_DB_MOCKS
Expand Down
9 changes: 4 additions & 5 deletions app/pages/403.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import Link from 'next/link';
import getConfig from 'next/config';

export default () => {
const feedbackUrl = getConfig()?.publicRuntimeConfig.FEEDBACK_SITE_URL;
const supportEmail = getConfig()?.publicRuntimeConfig.SUPPORT_EMAIL;
const mailtoLink = `mailto:${supportEmail}?subject=Support Request`;

return (
<>
Expand All @@ -22,10 +23,8 @@ export default () => {
log in with the credentials you entered in the registration form.
</p>
<p>
For all other issues, please consider reporting this error at{' '}
<a href={feedbackUrl}>{feedbackUrl}</a>, by either creating a new
post or commenting on an existing post if this error was already
reported.
For all other issues, please consider reporting this error to our
development team at <a href={mailtoLink}>{supportEmail}</a>.
</p>
<p>
<Link href="/">
Expand Down
8 changes: 6 additions & 2 deletions app/pages/admin/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,19 @@ class Admin extends Component<Props> {
const {
query: {session}
} = this.props;
const feedbackUrl = getConfig()?.publicRuntimeConfig.FEEDBACK_SITE_URL;
const supportUrl = getConfig()?.publicRuntimeConfig.SUPPORT_EMAIL;
return (
<DefaultLayout session={session} title="Administrator Dashboard">
<div>
<Row>
<ProgramAdministration />
<ReportingOperations />
<UserManagement />
<ReportAProblem serviceUrl={feedbackUrl || '#'} />
<ReportAProblem
supportUrl={
`mailto:${supportUrl}?subject=Internal Support Request` || '#'
}
/>
</Row>

<style global jsx>
Expand Down
8 changes: 6 additions & 2 deletions app/pages/analyst/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,18 @@ class Analyst extends Component<Props> {
const {
query: {session}
} = this.props;
const feedbackUrl = getConfig()?.publicRuntimeConfig.FEEDBACK_SITE_URL;
const supportUrl = getConfig()?.publicRuntimeConfig.SUPPORT_EMAIL;
return (
<DefaultLayout session={session} title="Analyst Dashboard">
<div>
<Row>
<ProgramAdministration viewOnly />
<ReportingOperations />
<ReportAProblem serviceUrl={feedbackUrl || '#'} />
<ReportAProblem
supportUrl={
`mailto:${supportUrl}?subject=Internal Support Request` || '#'
}
/>
</Row>

<style global jsx>
Expand Down
2 changes: 1 addition & 1 deletion docs/all-views-inventory.md
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ Temporary page to handle a specific issue with newly registered users sometimes

### Unknown Error page, _aka._ ErrorBoundary `(any URL)`

Displays an error message directing users to report the error on the [fider feedback site](https://ciip-feedback.pathfinder.gov.bc.ca/). Some error details are provided, which the user can copy into their bug report.
Displays an error message directing users to report the error to the development team at **ggircs@gov.bc.ca**. Some error details are provided, which the user can copy into their bug report.

Unlike the other error pages which handle HTTP error status codes (network-level errors), this handles errors that may have originated on either client or server. It's not truly a page, but rather a component that may be displayed on any other page when an error that breaks the client-side code is triggered.

Expand Down
4 changes: 2 additions & 2 deletions helm/cas-ciip-portal/templates/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ spec:
value: {{ .Values.env.senderEmail }}
- name: ADMIN_EMAIL
value: {{ .Values.env.adminEmail }}
- name: FEEDBACK_SITE_URL
value: {{ .Values.fider.host }}
- name: SUPPORT_EMAIL
value: {{ .Values.env.supportEmail }}
- name: ENABLE_ANALYTICS
value: {{ .Values.analytics.enable | quote }}
- name: SITEWIDE_NOTICE
Expand Down
4 changes: 1 addition & 3 deletions helm/cas-ciip-portal/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ env:
smtpConnectionString: smtp://apps.smtp.gov.bc.ca/?port=25&ignoreTLS=true&secure=false
senderEmail: BCCAS <no-reply.cas@gov.bc.ca>
adminEmail: GHG Regulator <GHGRegulator@gov.bc.ca>
supportEmail: ggircs@gov.bc.ca
enableDbMocks: false

# NOTE: To be displayed properly, content must be an HTML Bootstrap alert, ie: <div class="alert alert-info">Message</div>
Expand All @@ -68,9 +69,6 @@ sitewide_notice:
analytics:
enable: false

fider:
host: # TODO move fider template in this repo

restoreFromProd:
enable: false

Expand Down

0 comments on commit a4f2fe6

Please sign in to comment.