Skip to content

Commit 7479b5f

Browse files
authored
Merge pull request #110 from pitzzahh/patch/issues
fix: some known issues
2 parents 12b3ffb + 241f69f commit 7479b5f

20 files changed

+332
-275
lines changed

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"dotenv": "^17.3.1",
4141
"gsap": "^3.14.2",
4242
"mode-watcher": "^1.1.0",
43-
"pg": "^8.18.0",
43+
"pg": "^8.19.0",
4444
"runed": "^0.37.1",
4545
"svelte-toolbelt": "^0.10.6",
4646
"valibot": "^1.2.0"
@@ -52,10 +52,10 @@
5252
"@svelte-put/qr": "^2.1.1",
5353
"@sveltejs/adapter-node": "^5.5.3",
5454
"@sveltejs/enhanced-img": "^0.10.3",
55-
"@sveltejs/kit": "^2.53.0",
55+
"@sveltejs/kit": "^2.53.2",
5656
"@sveltejs/vite-plugin-svelte": "^6.2.4",
5757
"@tailwindcss/typography": "^0.5.19",
58-
"@tailwindcss/vite": "^4.2.0",
58+
"@tailwindcss/vite": "^4.2.1",
5959
"@tanstack/table-core": "^8.21.3",
6060
"@types/d3-scale": "^4.0.9",
6161
"@types/d3-shape": "^3.1.8",
@@ -72,14 +72,14 @@
7272
"prettier": "^3.8.1",
7373
"prettier-plugin-svelte": "^3.5.0",
7474
"prettier-plugin-tailwindcss": "^0.7.2",
75-
"svelte": "^5.53.3",
75+
"svelte": "^5.53.5",
7676
"svelte-check": "^4.4.3",
7777
"svelte-render-scan": "^1.1.0",
7878
"svelte-sonner": "^1.0.7",
7979
"sveltekit-sse": "^0.14.3",
8080
"tailwind-merge": "^3.5.0",
8181
"tailwind-variants": "^3.2.2",
82-
"tailwindcss": "^4.2.0",
82+
"tailwindcss": "^4.2.1",
8383
"tsx": "^4.21.0",
8484
"tw-animate-css": "^1.4.0",
8585
"typescript": "^5.9.3",

pnpm-lock.yaml

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

src/lib/api/auth.remote.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ export const requireAuth = query(() => requireAuthServer());
6262
export const signout = form(async () => {
6363
const event = getRequestEvent();
6464
if (event.locals.session === null) {
65-
return redirect(303, "/");
65+
return redirect(303, "/auth?act=login");
6666
}
6767
invalidateSession(event.locals.session.id);
6868
deleteSessionTokenCookie(event);
69-
redirect(303, "/");
69+
redirect(303, "/auth?act=login");
7070
});
7171

7272
export const login = form(loginSchema, async (user, issues) => {

src/lib/assets/icons.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,4 @@ export { default as Shield } from "phosphor-svelte/lib/ShieldIcon";
7474
export { default as ShieldCheck } from "phosphor-svelte/lib/ShieldCheckIcon";
7575
export { default as ShieldOff } from "phosphor-svelte/lib/ShieldSlashIcon";
7676
export { default as Copy } from "phosphor-svelte/lib/CopyIcon";
77+
export { default as InvoiceIcon } from "phosphor-svelte/lib/InvoiceIcon";

src/lib/components/data-table/data-table-view-options.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
column.toggleVisibility(!!value);
5959
}}
6060
>
61-
{column.id}
61+
{column.id.replace("Formatted", "")}
6262
</DropdownMenu.CheckboxItem>
6363
{/each}
6464
</DropdownMenu.Content>

src/lib/site.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ export const site = {
44
url: "https://powertrackr.up.railway.app",
55
ogImage: "https://powertrackr.vercel.app/og.avif",
66
description: "Track and reconcile electricity usage and payments.",
7+
fullDescription:
8+
"Record, organize, and reconcile electricity usage and payments across an account and its sub-meters.",
79
keywords: `svelte, monitoring-tool, energy-monitoring, sveltekit, bill-monitoring, payment-reconciliation`,
810
};
911
export type SiteConfig = typeof site;

src/lib/types/billing-info.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,10 @@ export type BillingInfoTableView = Omit<BillingInfo, "date" | "createdAt" | "upd
3333
updatedAt: string;
3434
};
3535

36-
export type ExtendedBillingInfoTableView = Omit<
37-
ExtendedBillingInfo,
38-
"date" | "createdAt" | "updatedAt"
39-
> & {
40-
date: string;
41-
createdAt: string;
42-
updatedAt: string;
36+
export type ExtendedBillingInfoTableView = ExtendedBillingInfo & {
37+
dateFormatted: string;
38+
createdAtFormatted: string;
39+
updatedAtFormatted: string;
4340
};
4441

4542
export type ExtendedBillingInfo = BillingInfo & {

src/lib/types/stats.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,22 @@ export interface Stats {
1313
formatted: string;
1414
};
1515
}
16+
17+
/* Types for the stats payload. Keep these narrow and explicit so the cache is portable. */
18+
export type EnergyUsed = {
19+
total: number;
20+
formatted: string;
21+
energyUnit: string;
22+
};
23+
24+
export type PaymentsAmount = {
25+
total: number;
26+
formatted: string;
27+
};
28+
29+
export type StatsPayload = {
30+
userCount: number;
31+
energyUsed: EnergyUsed;
32+
billingCount: number;
33+
paymentsAmount: PaymentsAmount;
34+
};

src/lib/utils/mapper/billing-info.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ import type {
55
ExtendedBillingInfo,
66
ExtendedBillingInfoTableView,
77
} from "$/types/billing-info";
8-
import { formatDate, DateFormat, parseCalendarDate } from "$/utils/format";
8+
import { formatDate, DateFormat } from "$/utils/format";
99

1010
export function billingInfoToDto(
1111
original: ExtendedBillingInfoTableView
1212
): BillingInfoDTOWithSubMeters {
1313
return {
1414
id: original.id,
1515
userId: original.userId,
16-
date: parseCalendarDate(original.date),
16+
date: original.date,
1717
totalkWh: original.totalkWh,
1818
balance: original.balance,
1919
payPerkWh: original.payPerkWh,
@@ -43,11 +43,11 @@ export function extendedBillingInfoToTableView(
4343
): ExtendedBillingInfoTableView {
4444
return {
4545
...original,
46-
date: formatDate(original.date),
47-
createdAt: formatDate(new Date(original.createdAt), {
46+
dateFormatted: formatDate(original.date),
47+
createdAtFormatted: formatDate(new Date(original.createdAt), {
4848
format: DateFormat.DateTime,
4949
}),
50-
updatedAt: formatDate(new Date(original.updatedAt), {
50+
updatedAtFormatted: formatDate(new Date(original.updatedAt), {
5151
format: DateFormat.DateTime,
5252
}),
5353
};

src/routes/(components)/account-settings.svelte

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -578,8 +578,7 @@
578578
<Button
579579
type="submit"
580580
variant="destructive"
581-
disabled={(disable2FA.fields.code.value() &&
582-
disable2FA.fields.code.value().length !== 6) ||
581+
disabled={disable2FA.fields?.code?.value()?.length !== 6 ||
583582
securityAsyncState === "processing"}
584583
>
585584
{#if securityAsyncState === "processing"}

0 commit comments

Comments
 (0)