Skip to content

Commit 1d190d9

Browse files
committed
Boston tea party
1 parent 65829f8 commit 1d190d9

35 files changed

Lines changed: 333 additions & 157 deletions

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ Core tables:
114114
- `membership`: Membership types with Stripe price IDs, time ranges, and pricing
115115
- `member`: Links users to memberships with status tracking
116116

117-
Member statuses: `awaiting_payment`, `awaiting_approval`, `active`, `expired`, `cancelled`
117+
Member statuses: `awaiting_payment`, `awaiting_approval`, `active`, `expired`, `canceled`
118118

119119
Database configuration in `drizzle.config.ts` uses snake_case for column names.
120120

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { test, expect } from "./fixtures/auth";
22

3-
test.describe("App Customisation", () => {
3+
test.describe("App Customization", () => {
44
test("admin can update general branding", async ({ adminPage }) => {
5-
await adminPage.goto("/en/admin/customise");
5+
await adminPage.goto("/en/admin/customize");
66

77
// Update app name and accent color
88
const newAppName = "Test Registry " + Math.random().toString(36).slice(7);
@@ -11,7 +11,7 @@ test.describe("App Customisation", () => {
1111
await adminPage.fill('input[name="appNameEn"]', newAppName);
1212
await adminPage.fill('input[name="accentColor"]', newAccentColor);
1313

14-
await adminPage.getByTestId("save-customisations").click();
14+
await adminPage.getByTestId("save-customizations").click();
1515

1616
// Check for success toast - try both languages just in case, or use a more robust locator
1717
// We expect "Settings updated successfully" (EN) or "Asetukset tallennettu onnistuneesti" (FI)
@@ -38,7 +38,7 @@ test.describe("App Customisation", () => {
3838
});
3939

4040
test("admin can update organization details", async ({ adminPage }) => {
41-
await adminPage.goto("/en/admin/customise");
41+
await adminPage.goto("/en/admin/customize");
4242

4343
const newOrgName = "Test Organization " + Math.random().toString(36).slice(7);
4444
const newOrgShortName = "Test Short " + Math.random().toString(36).slice(7);
@@ -50,7 +50,7 @@ test.describe("App Customisation", () => {
5050
await adminPage.fill('input[name="businessId"]', newBusinessId);
5151
await adminPage.fill('input[name="overseerContact"]', newContact);
5252

53-
await adminPage.getByTestId("save-customisations").click();
53+
await adminPage.getByTestId("save-customizations").click();
5454
await expect(
5555
adminPage.locator("text=/Settings updated successfully|Asetukset tallennettu onnistuneesti/"),
5656
).toBeVisible();
@@ -63,16 +63,16 @@ test.describe("App Customisation", () => {
6363
await expect(adminPage.locator("footer")).toContainText(newContact);
6464
});
6565

66-
test("readonly admin cannot update customisations", async ({ readonlyAdminPage }) => {
67-
await readonlyAdminPage.goto("/en/admin/customise");
66+
test("readonly admin cannot update customizations", async ({ readonlyAdminPage }) => {
67+
await readonlyAdminPage.goto("/en/admin/customize");
6868

6969
// Check if a warning banner is present
7070
await expect(
7171
readonlyAdminPage.locator("text=/You have read-only access|Sinulla on vain lukuoikeus/"),
7272
).toBeVisible();
7373

7474
// Try to submit anyway (if button is not disabled)
75-
const saveButton = readonlyAdminPage.getByTestId("save-customisations");
75+
const saveButton = readonlyAdminPage.getByTestId("save-customizations");
7676

7777
const isDisabled = await saveButton.isDisabled();
7878

src/app.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ declare global {
66
user: import("$lib/server/auth/session").SessionValidationResult["user"];
77
session: import("$lib/server/auth/session").SessionValidationResult["session"];
88
locale: import("$lib/i18n/routing").Locale;
9-
customisations: import("$lib/server/db/schema").AppCustomisation;
9+
customizations: import("$lib/server/db/schema").AppCustomization;
1010
}
1111
}
1212
}

src/hooks.server.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import { dev } from "$app/environment";
88
import cron from "node-cron";
99
import { cleanupExpiredTokens, cleanupInactiveUsers, cleanupOldAuditLogs } from "$lib/server/db/cleanup";
1010
import { createInitialModeExpression } from "mode-watcher";
11-
import { getCustomisations } from "$lib/server/customisation/cache";
11+
import { getCustomizations } from "$lib/server/customization/cache";
1212

13-
const handleCustomisations: Handle = async ({ event, resolve }) => {
14-
event.locals.customisations = await getCustomisations();
13+
const handleCustomizations: Handle = async ({ event, resolve }) => {
14+
event.locals.customizations = await getCustomizations();
1515
return resolve(event);
1616
};
1717

@@ -121,7 +121,7 @@ const handleAdminAuthorization: Handle = async ({ event, resolve }) => {
121121
};
122122

123123
export const handle: Handle = sequence(
124-
handleCustomisations,
124+
handleCustomizations,
125125
handleAuth,
126126
handleLocaleRedirect,
127127
handleAdminAuthorization,
@@ -130,8 +130,8 @@ export const handle: Handle = sequence(
130130
);
131131

132132
export const init: ServerInit = () => {
133-
// Warm up customisation cache
134-
getCustomisations().catch((err) => console.error("[Init] Failed to warm Customisation cache:", err));
133+
// Warm up customization cache
134+
getCustomizations().catch((err) => console.error("[Init] Failed to warm Customization cache:", err));
135135

136136
// Schedule cleanup tasks
137137
// Run database cleanup daily at 3 AM (when traffic is typically lowest)

src/lib/ROUTES.ts

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib/components/PasskeyRegistrationBanner.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
if (error instanceof Error) {
7474
// Map WebAuthn error types to user-friendly messages
7575
if (error.name === "NotAllowedError") {
76-
errorMessage = $LL.auth.passkey.regCancelled();
76+
errorMessage = $LL.auth.passkey.regCanceled();
7777
} else if (error.name === "InvalidStateError") {
7878
errorMessage = $LL.auth.passkey.regAlreadyRegistered();
7979
} else {

src/lib/components/app-sidebar.svelte

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,25 +51,25 @@
5151
<Sidebar.SidebarMenuItem>
5252
<Sidebar.SidebarMenuButton
5353
size="lg"
54-
tooltipContent={page.data.customisations?.appName?.[$locale] ?? $LL.app.title()}
54+
tooltipContent={page.data.customizations?.appName?.[$locale] ?? $LL.app.title()}
5555
>
5656
{#snippet child({ props })}
5757
<a href={route("/[locale=locale]", { locale: $locale })} {...props}>
58-
{#if page.data.customisations?.logo || page.data.customisations?.logoDark}
58+
{#if page.data.customizations?.logo || page.data.customizations?.logoDark}
5959
<img
60-
src={page.data.customisations?.logo ? "/api/image/logo" : "/api/image/logoDark"}
60+
src={page.data.customizations?.logo ? "/api/image/logo" : "/api/image/logoDark"}
6161
alt="App logo"
6262
class="size-8 dark:hidden"
6363
/>
6464
<img
65-
src={page.data.customisations?.logoDark ? "/api/image/logoDark" : "/api/image/logo"}
65+
src={page.data.customizations?.logoDark ? "/api/image/logoDark" : "/api/image/logo"}
6666
alt="App logo"
6767
class="hidden size-8 dark:block"
6868
/>
6969
{/if}
7070
<div class="flex flex-col gap-0.5 leading-none">
7171
<span class="font-mono font-semibold"
72-
>{page.data.customisations?.appName?.[$locale] ?? $LL.app.title()}</span
72+
>{page.data.customizations?.appName?.[$locale] ?? $LL.app.title()}</span
7373
>
7474
</div>
7575
</a>

src/lib/components/footer.svelte

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
? "https://youtu.be/dQw4w9WgXcQ"
1313
: `https://github.com/Tietokilta/rekisteri/tree/${versionSha}`;
1414
15-
const customisations = $derived(page.data.customisations);
15+
const customizations = $derived(page.data.customizations);
1616
</script>
1717

1818
<footer class="mt-auto border-t border-border/40 bg-muted/50">
@@ -21,15 +21,15 @@
2121
<div class="flex flex-wrap items-start justify-between gap-4 text-xs text-muted-foreground">
2222
<div class="flex flex-wrap items-center gap-x-4 gap-y-1">
2323
<span class="font-medium text-foreground"
24-
>{customisations?.organizationName?.[$locale] ?? $LL.documents.footer.organization()}</span
24+
>{customizations?.organizationName?.[$locale] ?? $LL.documents.footer.organization()}</span
2525
>
26-
<span>{customisations?.businessId ?? $LL.documents.footer.businessId()}</span>
26+
<span>{customizations?.businessId ?? $LL.documents.footer.businessId()}</span>
2727
<a
28-
href="mailto:{customisations?.overseerContact ?? 'hallitus@tietokilta.fi'}"
28+
href="mailto:{customizations?.overseerContact ?? 'hallitus@tietokilta.fi'}"
2929
class="underline underline-offset-2 hover:text-foreground"
30-
>{customisations?.overseerContact ?? $LL.documents.footer.email()}</a
30+
>{customizations?.overseerContact ?? $LL.documents.footer.email()}</a
3131
>
32-
<span class="hidden sm:inline">{customisations?.overseerAddress ?? $LL.documents.footer.address()}</span>
32+
<span class="hidden sm:inline">{customizations?.overseerAddress ?? $LL.documents.footer.address()}</span>
3333
</div>
3434
<div class="flex items-center gap-4">
3535
<a
@@ -40,7 +40,7 @@
4040
</a>
4141
<span>
4242
&copy; {new Date().getFullYear()}
43-
{customisations?.organizationName?.[$locale] ?? "Tietokilta ry"}
43+
{customizations?.organizationName?.[$locale] ?? "Tietokilta ry"}
4444
{#if showVersionSha}
4545
|
4646
<a

src/lib/i18n/en/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const en = {
2222
membershipTypes: "Membership types",
2323
users: "Users",
2424
verifyQr: "Verify QR",
25-
customise: "Customise",
25+
customize: "Customize",
2626
},
2727
signOut: "Sign out",
2828
},
@@ -102,10 +102,10 @@ const en = {
102102
or: "or",
103103
authenticating: "Authenticating...",
104104
authFailed: "Authentication failed. Please try again or use email code.",
105-
authCancelled: "Authentication was cancelled",
105+
authCanceled: "Authentication was canceled",
106106
rateLimited: "Too many attempts. Please try again later or use email code.",
107107
regFailed: "Failed to register passkey. Please try again later.",
108-
regCancelled: "Registration was cancelled",
108+
regCanceled: "Registration was canceled",
109109
regAlreadyRegistered:
110110
"This device is already registered. If you want to re-register, please delete the old passkey first.",
111111
lastUsed: "last used",
@@ -402,8 +402,8 @@ Best regards,
402402
membershipTypeNotFound: "Membership type not found",
403403
},
404404

405-
customise: {
406-
title: "App Customisations",
405+
customize: {
406+
title: "App Customizations",
407407
description: "Manage the high-level application settings, colors, and branding details.",
408408
success: "Settings updated successfully",
409409
error: "Failed to update settings",
@@ -443,7 +443,7 @@ Best regards,
443443
faviconDark: "Favicon (Dark Mode)",
444444
current: "Current:",
445445
},
446-
save: "Save customisations",
446+
save: "Save customizations",
447447
},
448448

449449
members: {

src/lib/i18n/fi/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const fi = {
2222
membershipTypes: "Jäsenyystyypit",
2323
users: "Käyttäjät",
2424
verifyQr: "Tarkista QR",
25-
customise: "Muokkaa ulkoasua",
25+
customize: "Muokkaa ulkoasua",
2626
},
2727
signOut: "Kirjaudu ulos",
2828
},
@@ -102,10 +102,10 @@ const fi = {
102102
or: "tai",
103103
authenticating: "Tunnistaudutaan...",
104104
authFailed: "Tunnistautuminen epäonnistui. Yritä uudelleen tai käytä sähköpostikoodia.",
105-
authCancelled: "Tunnistautuminen peruttiin",
105+
authCanceled: "Tunnistautuminen peruttiin",
106106
rateLimited: "Liian monta yritystä. Yritä myöhemmin uudelleen tai käytä sähköpostikoodia.",
107107
regFailed: "Avainkoodin rekisteröinti epäonnistui. Yritä myöhemmin uudelleen.",
108-
regCancelled: "Rekisteröinti peruttiin",
108+
regCanceled: "Rekisteröinti peruttiin",
109109
regAlreadyRegistered:
110110
"Tämä laite on jo rekisteröity. Jos haluat rekisteröidä uudelleen, poista vanha avainkoodi ensin.",
111111
lastUsed: "viimeksi käytetty",
@@ -404,7 +404,7 @@ Terveisin,
404404
membershipTypeNotFound: "Jäsenyystyyppiä ei löytynyt",
405405
},
406406

407-
customise: {
407+
customize: {
408408
title: "Sovelluksen mukautus",
409409
description: "Hallitse sovelluksen yleisiä asetuksia ja ulkonäköä.",
410410
success: "Asetukset tallennettu onnistuneesti",

0 commit comments

Comments
 (0)