Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calendar refactor #77

Merged
merged 40 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
3fba2b7
refactor calendar page
Feb 13, 2024
6db1f19
fix imports
jho44 Feb 13, 2024
7a9e98e
fix row editor toggle
jho44 Feb 13, 2024
9a2117a
wip refactor db
jho44 Feb 13, 2024
816ea23
refactor db continued
jho44 Feb 14, 2024
0b557c9
db POST refactor done
Feb 15, 2024
00270e8
fix notifier formatting
jho44 Feb 15, 2024
9c33453
revert row if req fails
jho44 Feb 15, 2024
d4a2c88
fix markRowAsBusy func
jho44 Feb 15, 2024
dfe3986
update notifier after mark busy
jho44 Feb 15, 2024
ca1fd44
mark as available works
jho44 Feb 15, 2024
02e1a09
schedDiffs updates after mark row
jho44 Feb 16, 2024
ef66d9e
mark row as available updates ui properly
jho44 Feb 16, 2024
a9cb470
upsertUnspecifiedDatesAsBusy prisma change
Feb 16, 2024
1c71948
prisma change + repository update
jho44 Feb 16, 2024
80dfb7b
no drift b/t schema + migrations
jho44 Feb 17, 2024
2c31156
date year migration + refactor dashboard
Feb 18, 2024
bb0a1fb
fix tests
jho44 Feb 18, 2024
633f3ca
fix imports
jho44 Feb 18, 2024
cdeec99
fix mark unspecified as busy
jho44 Feb 19, 2024
7e60ec4
fix dashboard
jho44 Feb 19, 2024
ffa373d
mark available - empty emoticons
jho44 Feb 20, 2024
1cf6087
create household before kid
jho44 Feb 20, 2024
0c89052
refactored tests
Feb 24, 2024
6a4c4ba
SeedUtils
jho44 Feb 24, 2024
f4dd39d
profile test
Feb 25, 2024
9db9500
create house connections after user creations
Feb 25, 2024
3727434
fix profile test
jho44 Feb 25, 2024
b0fcae8
tsx instead of ts-node
jho44 Feb 25, 2024
b9be628
add checkpoints to test
jho44 Feb 25, 2024
35ca350
add public env
jho44 Feb 25, 2024
38edc5a
do all tests
jho44 Feb 25, 2024
28e525a
fix db tests
Feb 27, 2024
e24fd1c
prismaclient fixture
jho44 Feb 27, 2024
6a02dbf
test seeds isolated from each other
jho44 Feb 27, 2024
cb8501a
rm page and context closes
jho44 Feb 27, 2024
9cef396
simple calendar tests
jho44 Feb 28, 2024
01f90d9
try to fix tests
jho44 Feb 28, 2024
5168bdc
fix showing notifs
jho44 Feb 28, 2024
ae17876
add logging to profile test
jho44 Feb 28, 2024
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
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ env:
TWILIO_ACCOUNT_SID: ${{ secrets.TWILIO_ACCOUNT_SID }}
TWILIO_API_SECRET: ${{ secrets.TWILIO_API_SECRET }}
TWILIO_AUTH_TOKEN: ${{ secrets.TWILIO_AUTH_TOKEN }}
PUBLIC_ENV: test
jobs:
build:
runs-on: ubuntu-latest
Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
"node": ">=18"
},
"prisma": {
"seed": "ts-node --transpile-only prisma/seed.ts"
"seed": "tsx prisma/seed.ts"
},
"scripts": {
"dev": "vite dev",
"build": "vite build",
"nodebuild": "NODE_MODE_ADAPTER=1 vite build",
"preview": "vite preview",
"test": "playwright test",
"test": "rm -f screenshot.png && playwright test",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"test:unit": "vitest",
Expand Down Expand Up @@ -49,17 +49,18 @@
"postcss": "^8.4.31",
"prettier": "^2.8.8",
"prettier-plugin-svelte": "^2.10.1",
"prisma": "^4.15.0",
"svelte": "^3.59.1",
"prisma": "^5.9.1",
"svelte": "^4.2.10",
"svelte-check": "^3.4.3",
"tailwindcss": "^3.3.2",
"tslib": "^2.5.2",
"tsx": "^4.7.1",
"typescript": "^5.0.4",
"vite": "^4.3.9",
"vitest": "^0.31.3"
},
"dependencies": {
"@prisma/client": "^4.15.0",
"@prisma/client": "^5.9.1",
"jsonwebtoken": "^9.0.0",
"luxon": "^3.3.0",
"marked": "^5.1.0",
Expand Down
11 changes: 9 additions & 2 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { PlaywrightTestConfig } from '@playwright/test';

export const TIMEZONE = 'America/Los_Angeles';
const config: PlaywrightTestConfig = {
webServer: [
{
Expand All @@ -16,8 +17,14 @@ const config: PlaywrightTestConfig = {
expect: {
timeout: 3000
},
timeout: 5000,
testDir: 'tests'
// timeout: 10000,
testDir: 'tests',
testMatch: '*spec.ts',
use: {
locale: 'en-US',
timezoneId: TIMEZONE,
baseURL: 'http://localhost:5173'
}
};

export default config;
3 changes: 3 additions & 0 deletions prisma/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const USERS_WITH_NOTHING = [1, 2, 7];
export const USERS_WITH_EMPTY_HOUSEHOLD = [3, 4];
export const USERS_WITH_ACTIVE_SESSION = [2, 4, 6, 7];
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- CreateIndex
CREATE UNIQUE INDEX if not exists "AvailabilityDate_householdId_date_key" ON "AvailabilityDate"("householdId", "date");
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
UPDATE "AvailabilityDate"
SET
"date" = "date" + INTERVAL '23 years'
WHERE
EXTRACT(MONTH FROM "date") >= 8 AND EXTRACT(YEAR FROM "date") = 2001;

UPDATE "AvailabilityDate"
SET
"date" = "date" + INTERVAL '24 years'
WHERE
EXTRACT(MONTH FROM "date") < 8 AND EXTRACT(YEAR FROM "date") = 2001;

-- cases
-- if month >= 8, then year should be set to 2023
-- if month < 8, then year should be set to 2024
32 changes: 15 additions & 17 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,7 @@ generator client {

datasource db {
provider = "postgresql"
url = env("DATABASE_PRISMA_URL") // uses connection pooling
// directUrl = env("DATABASE_URL_NON_POOLING") // uses a direct connection
// shadowDatabaseUrl = env("DATABASE_URL_NON_POOLING") // used for migrations
}

enum Pronoun {
FAE_FAER_FAERS
EEY_EM_EIRS
HE_HIM_HIS
PER_PER_PERS
SHE_HER_HERS
THEY_THEM_THEIRS
VE_VER_VIS
XE_XEM_XYRS
ZEZIE_HIR_HIRS
url = env("DATABASE_PRISMA_URL")
}

model Household {
Expand All @@ -31,8 +17,8 @@ model Household {
AvailabilityDate AvailabilityDate[]
FriendRequest FriendRequest[]
children HouseholdChild[]
connectionsAsHouseholdA HouseholdConnection[] @relation("HouseholdAConnection")
connectionsAsHouseholdB HouseholdConnection[] @relation("HouseholdBConnection")
connectionsAsHouseholdA HouseholdConnection[] @relation("HouseholdAConnection")
JoinHouseholdRequest JoinHouseholdRequest[]
parents User[]
}
Expand Down Expand Up @@ -153,12 +139,24 @@ model HouseholdConnection {
householdId Int
friendHouseholdId Int
createdAt DateTime @default(now())
household Household @relation("HouseholdAConnection", fields: [householdId], references: [id])
friendHousehold Household @relation("HouseholdBConnection", fields: [friendHouseholdId], references: [id])
household Household @relation("HouseholdAConnection", fields: [householdId], references: [id])

@@unique([householdId, friendHouseholdId])
}

enum Pronoun {
FAE_FAER_FAERS
EEY_EM_EIRS
HE_HIM_HIS
PER_PER_PERS
SHE_HER_HERS
THEY_THEM_THEIRS
VE_VER_VIS
XE_XEM_XYRS
ZEZIE_HIR_HIRS
}

enum AvailabilityStatus {
UNSPECIFIED
BUSY
Expand Down
Loading
Loading