Skip to content

Commit 3f2d160

Browse files
committed
[Release] Version 0.0.7
* [Fix] Pin GitHub CI runner image to ubuntu-20.04 (#285) * Update README (#284) * Fix time zone bug in requests header (#281) * [Fix] Fix time zone for requests and reports (#278) * [Chore] Add BSF contributors to employee database (#277) * [Chore] Create docker-compose.yml file for local PostgreSQL instance (#276) * [Docs] BSF CONTRIBUTING.md (#275)
1 parent 12983bc commit 3f2d160

File tree

10 files changed

+189
-9
lines changed

10 files changed

+189
-9
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
strategy:
1818
matrix:
19-
os: [ubuntu-latest]
19+
os: [ubuntu-20.04]
2020
node: [14.17.0]
2121

2222
steps:

CONTRIBUTING.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Contributions
2+
3+
## New Contributors
4+
5+
Thank you for taking the time to contribute to this repo! This project is actively in use with our
6+
clients and requires the help of volunteers like yourself to maintain and continue to foster this
7+
project’s growth. Every contribution helps and credit is always given!
8+
9+
To get started contributing to this project, please email <bpsf@gmail.com>. An exec on the team will
10+
send you a Slack invite and will onboard you onto our project.
11+
12+
# Roles
13+
14+
We have two roles on the maintenance team: Blueprint Software Foundation (BSF) executive and
15+
contributors.
16+
17+
## Blueprint Software Foundation executive member
18+
19+
BSF is an overarching organization responsible for the upkeep of projects shipped by UW Blueprint.
20+
As of writing, BSF is composed of 3 executives: 2 alumni and a UW Blueprint president.
21+
22+
Executives are responsible for maintaining communications with clients and with UW Blueprint
23+
regarding maintenance projects and onboarding new projects onto BSF. They are also responsible for
24+
coordinating work on tasks/issues and onboarding contributors.
25+
26+
## Contributors
27+
28+
Much of the fruitful maintenance and upkeep work on projects will be due to our wonderful
29+
contributors! Contributors will work with execs in prioritizing and planning maintenance work and
30+
shipping the work to our clients. As of writing, **contributors will be sourced from UW Blueprint
31+
alumni** but we are planning on opening up contributions to those not part of UW Blueprint.
32+
33+
# Contribution workflow
34+
35+
Please follow the following steps in order to productively contribute to this repository.
36+
37+
## Step 1: Fork the repo
38+
39+
On the repository’s main page, click ‘Fork Repo’ at the top of the page.
40+
41+
## Step 2: Configure your environment
42+
43+
Once you have Notion access, take a look at the README.md file,
44+
[development guidelines](https://www.notion.so/uwblueprintexecs/Development-processes-a0313f2bef9941fc8752c8e7b5be5e70)
45+
and
46+
[engineering best practices](https://www.notion.so/uwblueprintexecs/READ-Best-Practices-Engineering-3174edea363b4d4896af8dfc461cfd9c)
47+
to set up your environment.
48+
49+
## Step 3: Connect with people
50+
51+
As mentioned above, if you are not already on our Slack, please email <bpsf@gmail.com>. Once added,
52+
please talk to the execs on which issues or features are highest priority. This will be available as
53+
a Notion board as well.
54+
55+
Once an issue is chosen, discuss with fellow contributors and execs on Slack on how you plan on
56+
approaching the issues. We will subsequently assign you the issue and you can get cracking!
57+
58+
## Step 4: Prepare PR
59+
60+
Clone your fork locally and start to make your changes. Small changes are always greater than huge,
61+
breaking changes! Make sure that you test a variety of situations before you push your change to
62+
your fork!
63+
64+
## Step 5: Pass PR review
65+
66+
Once you feel confident that your change addresses the issue/feature spec, sync your fork with the
67+
main repository and open up a PR on the main repo from your fork. Please provide a detailed
68+
description of your change and ask for the reviews of an exec/designated contributor.
69+
70+
Please be cognizant of an executive’s relatively limited time. Reviews may take longer than you
71+
would expect! Use Slack wisely to ensure that you can get a review in a timely manner.
72+
73+
# Thank you!
74+
75+
We want to thank the following individuals for their tireless contributions:
76+
77+
- Oustan Ding
78+
- Carelynn Tsai
79+
- Vedant Patel
80+
- Angela Dietz
81+
- Anish Aggarwal
82+
- Christian Chan
83+
- Emilio Mena
84+
- Jihad Bunkheila
85+
- Bonnie Chin
86+
- Anthea Tawiah
87+
- Charmaine Wang
88+
- Jeffrey Zhang
89+
- Amanda Guo
90+
- Andy Lee
91+
- Jennifer Tsai

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,40 @@ applicant-facing application portal and an internal user/APP management portal.
5252

5353
## Run locally
5454

55+
1. Start database
56+
57+
```bash
58+
docker-compose up --build
59+
```
60+
61+
2. Run the application
62+
63+
```bash
64+
yarn install
65+
npx prisma generate
66+
yarn dev
67+
```
68+
69+
3. Deploy prisma schema
70+
71+
```bash
72+
npx prisma db push
73+
```
74+
75+
4. Seed database
76+
77+
```bash
78+
npx prisma db seed --preview-feature
79+
```
80+
81+
5. Verify database
82+
83+
```bash
84+
docker exec -it rcd_db /bin/bash -c "psql -U postgres -d rcd"
85+
```
86+
87+
## Run locally (Heroku)
88+
5589
Duplicate `.env.sample` to `.env` and configure environment variables.
5690

5791
To deploy your database schema, run:

components/admin/requests/Header.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import ShopifyBadge from '@components/admin/ShopifyBadge';
66
import PermitTypeBadge from '@components/admin/PermitTypeBadge';
77
import { ApplicationStatus, ApplicationType, PermitType } from '@lib/graphql/types';
88
import { titlecase } from '@tools/string';
9-
import { formatDateYYYYMMDD } from '@lib/utils/date';
9+
import { formatDateYYYYMMDD, formatDateYYYYMMDDLocal } from '@lib/utils/date';
1010
import { getPermanentPermitExpiryDate } from '@lib/utils/permit-expiry';
1111

1212
type RequestHeaderProps = {
@@ -85,7 +85,7 @@ export default function RequestHeader({
8585
</Flex>
8686
<HStack spacing={3} marginTop={3}>
8787
<Text textStyle="caption" as="p">
88-
Received on {formatDateYYYYMMDD(createdAt)} at{' '}
88+
Received on {formatDateYYYYMMDDLocal(createdAt)} at{' '}
8989
{createdAt.toLocaleTimeString('en-CA')}
9090
</Text>
9191
</HStack>

components/admin/requests/reason-for-replacement/Card.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Box, Text, SimpleGrid, Button } from '@chakra-ui/react'; // Chakra UI
33
import PermitHolderInfoCard from '@components/admin/LayoutCard'; // Custom Card Component
44
import EditReasonForReplacementModal from '@components/admin/requests/reason-for-replacement/EditModal'; // Edit modal
55
import { reasonForReplacementFormSchema } from '@lib/applications/validation';
6-
import { formatDateYYYYMMDD } from '@lib/utils/date';
6+
import { formatDateYYYYMMDDLocal } from '@lib/utils/date';
77
import {
88
GetReasonForReplacementRequest,
99
GetReasonForReplacementResponse,
@@ -97,7 +97,7 @@ export default function ReasonForReplacementCard(props: ReplacementProps) {
9797
<InfoSection title={`Cause`}>{titlecase(reason)}</InfoSection>
9898
{lostTimestamp && (
9999
<InfoSection title={`Event Timestamp`}>
100-
{formatDateYYYYMMDD(new Date(lostTimestamp), true)}
100+
{formatDateYYYYMMDDLocal(new Date(lostTimestamp), true)}
101101
</InfoSection>
102102
)}
103103
{lostLocation && <InfoSection title={`Location Lost`}>{lostLocation}</InfoSection>}

docker-compose.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
version: "3.7"
2+
3+
services:
4+
db:
5+
container_name: rcd_db
6+
image: postgres:12-alpine
7+
ports:
8+
- 5432:5432
9+
volumes:
10+
- postgres_data:/var/lib/postgresql/data/
11+
env_file:
12+
- ./.env
13+
healthcheck:
14+
test: ["CMD-SHELL", "pg_isready -U postgres"]
15+
interval: 5s
16+
timeout: 5s
17+
retries: 5
18+
19+
volumes:
20+
postgres_data:

lib/reports/resolvers.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ import {
1111
} from '@lib/graphql/types';
1212
import { SortOrder } from '@tools/types';
1313
import { formatFullName, formatPhoneNumber, formatPostalCode } from '@lib/utils/format'; // Formatting utils
14-
import { formatDateTimeYYYYMMDDHHMMSS, formatDateYYYYMMDD } from '@lib/utils/date'; // Formatting utils
14+
import {
15+
formatDateTimeYYYYMMDDHHMMSS,
16+
formatDateYYYYMMDD,
17+
formatDateYYYYMMDDLocal,
18+
} from '@lib/utils/date'; // Formatting utils
1519
import { APPLICATIONS_COLUMNS, PERMIT_HOLDERS_COLUMNS } from '@tools/admin/reports';
1620
import { Prisma } from '@prisma/client';
1721
import { getSignedUrlForS3, serverUploadToS3 } from '@lib/utils/s3-utils';
@@ -264,7 +268,7 @@ export const generateApplicationsReport: Resolver<
264268
...application,
265269
id: applicant?.id,
266270
dateOfBirth: dateOfBirth && formatDateYYYYMMDD(dateOfBirth),
267-
applicationDate: createdAt ? formatDateYYYYMMDD(createdAt, true) : null,
271+
applicationDate: createdAt ? formatDateYYYYMMDDLocal(createdAt, true) : null,
268272
applicantName: formatFullName(firstName, middleName, lastName),
269273
processingFee: `$${processingFee}`,
270274
donationAmount: `$${donationAmount}`,

lib/utils/date.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,17 @@ export const formatDateYYYYMMDD = (d: Date, withTime = false): string => {
2222
return moment.utc(d).format(formatString);
2323
};
2424

25+
/**
26+
* Format date to be in YYYY-MM-DD format and in local time zone
27+
* @param {Date} date date to be formatted
28+
* @param {boolean} withTime whether to include time in formatted date
29+
* @returns {string} formatted date
30+
*/
31+
export const formatDateYYYYMMDDLocal = (d: Date, withTime = false): string => {
32+
const formatString = withTime ? 'YYYY-MM-DD, hh:mm a' : 'YYYY-MM-DD';
33+
return moment(d).format(formatString);
34+
};
35+
2536
/**
2637
* Format date to be in written in the following format: Sep 11 2021, 03:07 pm not converting to the local timezone
2738
* @param {Date} date date to be formatted

pages/admin/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import { ApplicationStatus, ApplicationType, PermitType } from '@lib/graphql/typ
4242
import useDebounce from '@tools/hooks/useDebounce'; // Debounce hook
4343
import { Column } from 'react-table';
4444
import { formatFullName } from '@lib/utils/format'; // String formatter util
45-
import { formatDateYYYYMMDD } from '@lib/utils/date'; // Date Formatter Util
45+
import { formatDateYYYYMMDDLocal } from '@lib/utils/date'; // Date Formatter Util
4646
import GenerateReportModal from '@components/admin/requests/reports/GenerateModal'; // Generate report modal
4747
import EmptyMessage from '@components/EmptyMessage';
4848

@@ -82,7 +82,7 @@ const COLUMNS: Column<ApplicationRow>[] = [
8282
width: 240,
8383
sortDescFirst: true,
8484
Cell: ({ value }) => {
85-
return <Text>{formatDateYYYYMMDD(value, true)}</Text>;
85+
return <Text>{formatDateYYYYMMDDLocal(value, true)}</Text>;
8686
},
8787
},
8888
{

prisma/dev-seed-utils/employees.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,26 @@ const employees = [
5959
lastName: 'Tsai',
6060
email: 'carelynntsai+employee@uwblueprint.org',
6161
},
62+
{
63+
firstName: 'Leo',
64+
lastName: 'Huang',
65+
email: 'leohuang+employee@uwblueprint.org',
66+
},
67+
{
68+
firstName: 'Sherry',
69+
lastName: 'Li',
70+
email: 'sherryli+employee@uwblueprint.org',
71+
},
72+
{
73+
firstName: 'Chinemerem',
74+
lastName: 'Chigbo',
75+
email: 'chinemeremchigbo+employee@uwblueprint.org',
76+
},
77+
{
78+
firstName: 'Adil',
79+
lastName: 'Kapadia',
80+
email: 'adilkapadia+employee@uwblueprint.org',
81+
},
6282
];
6383

6484
/**

0 commit comments

Comments
 (0)