Compare commits
204 Commits
remove-ema
...
main
Author | SHA1 | Date | |
---|---|---|---|
|
2b550aa60c | ||
|
c691359356 | ||
|
4e5202bdba | ||
|
cdf688e8af | ||
|
46a686f578 | ||
5c2249621d | |||
501bb3a81a | |||
69f6fcbebe | |||
5d7c71b9ab | |||
0c05cf7661 | |||
f0e6ff9425 | |||
20bd7f5983 | |||
52902ff2ba | |||
c233cb60de | |||
|
44ba54db95 | ||
|
be4f9caec7 | ||
|
190118a0d1 | ||
|
862d1f85af | ||
|
42d2b7091b | ||
|
7024a9ca11 | ||
|
5951440efb | ||
|
2cdf8aca58 | ||
|
82ebaea275 | ||
|
ff406c35ec | ||
|
23901834bc | ||
f8a6f4d245 | |||
5dabecc9ed | |||
b3dc01bbb5 | |||
2ded8676f4 | |||
1db83a6004 | |||
1269a1a56f | |||
3e0fb208e2 | |||
0594bf9456 | |||
36c9acee51 | |||
|
b799a052a8 | ||
|
7a402d81b9 | ||
c540828463 | |||
a6b678c6ae | |||
6d35009593 | |||
dc735f1a2c | |||
c49acf8ab6 | |||
52fb808d45 | |||
d307ff6927 | |||
b7e2bbb46f | |||
3f38a9191f | |||
07476221c3 | |||
b1339e2ce9 | |||
ff73133e05 | |||
70b023acac | |||
|
42d02306eb | ||
|
632a2f9815 | ||
|
e536fd1cd1 | ||
|
6dcc87a2c2 | ||
|
96c45ee175 | ||
|
fac573c69d | ||
231be64e45 | |||
658b94a2dc | |||
96655bf62b | |||
|
5f9512991e | ||
ed7d51dee4 | |||
|
82dc0a3e35 | ||
|
35b42e2bb8 | ||
09a37675a9 | |||
9029d756e7 | |||
93662f5903 | |||
7dbfbb76b7 | |||
|
53811299c8 | ||
|
6731dcc874 | ||
c57bdec9fc | |||
6d5e57724c | |||
be73e7018a | |||
37360264ea | |||
c3e191982d | |||
2b0fab797e | |||
770f1854d1 | |||
537498cb85 | |||
17b324d338 | |||
05392bc747 | |||
fb1b7e7d0f | |||
7de37759ca | |||
79039572e7 | |||
283d90c707 | |||
066cab9da8 | |||
eddb1cab37 | |||
fba1b81b4c | |||
ad0b09c3df | |||
98d3afcd8e | |||
b4cfd91ff4 | |||
|
f68587419d | ||
db9a6a1b83 | |||
b6db72a5b7 | |||
f0bfa90140 | |||
809da23b91 | |||
054e1c6da0 | |||
4d576b07da | |||
d085a2ab19 | |||
|
12fe9b5b80 | ||
59b51885d3 | |||
0620516a05 | |||
9aab22ab39 | |||
d25622d764 | |||
154f1975f6 | |||
1908b76822 | |||
5d5d415904 | |||
437d4faddc | |||
dd6b84ec05 | |||
15ef451966 | |||
82f5dd6c64 | |||
0ef310fecd | |||
868f950559 | |||
7697148b7d | |||
989820e41b | |||
9b3443addf | |||
|
bb403fd512 | ||
15144b478e | |||
3385230353 | |||
54be5515e5 | |||
e12887e79f | |||
|
f88c14fefd | ||
|
7846dddb60 | ||
9f56663217 | |||
|
4f3446eb57 | ||
bf034cdf84 | |||
|
f30d0711e9 | ||
|
04b22efa36 | ||
|
4c0d3aedaf | ||
|
62662789e8 | ||
|
7134150a81 | ||
|
c8331f927e | ||
|
2b9d06c670 | ||
|
91484f081c | ||
5fe6031dc5 | |||
5d39d49e5c | |||
161a27160f | |||
827271efc2 | |||
6906b3cb6e | |||
f424ec6654 | |||
ec49fd01e7 | |||
2955155778 | |||
52caefc220 | |||
51f7f96ee8 | |||
6e598e537b | |||
318d203fed | |||
c1d199f08d | |||
1fdac88c75 | |||
01bce277a8 | |||
671bfce34f | |||
28abb23a77 | |||
92d929c8e1 | |||
53c4938e92 | |||
470366b8f6 | |||
c6d30a101f | |||
3cca58cfb0 | |||
71d9a91d18 | |||
7b62992a5f | |||
760bb016fb | |||
|
3231d5caa8 | ||
6fcf7d87a8 | |||
567ce207cf | |||
|
03f2d87b6e | ||
|
c08e95e3b7 | ||
|
aa68e19ba0 | ||
09fa6002d9 | |||
a7c59f3f0f | |||
be7aed8246 | |||
a4815c6f14 | |||
3b8e7c9286 | |||
321294c97d | |||
4cf7c7eef1 | |||
39907b0105 | |||
3e9775af99 | |||
a6c517f8a1 | |||
2985c8b73f | |||
|
a8d01bcf88 | ||
|
3b0a3b25cd | ||
fd77360ec4 | |||
2d565e405f | |||
615106b42a | |||
38ca2c3409 | |||
45a0da6b27 | |||
|
0588459618 | ||
7434167583 | |||
10f7af1963 | |||
7a0b03b67f | |||
638aca8301 | |||
2ea1fd2667 | |||
79b4e9ac82 | |||
1838889a0c | |||
|
f26e646a36 | ||
|
ea4ab9dc04 | ||
e09a7a07af | |||
|
f3862739c2 | ||
c86018a24b | |||
5d537c80aa | |||
88d85c4f2c | |||
6109c2ce71 | |||
919cd11915 | |||
15123351e1 | |||
a883b4b4bc | |||
2fc13fbfa3 | |||
0d1901fa44 | |||
3b49064cb7 | |||
10e925c54f | |||
883c56e0e2 |
13
.dockerignore
Normal file
13
.dockerignore
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
node_modules
|
||||||
|
npm-debug.log
|
||||||
|
Dockerfile*
|
||||||
|
docker-compose*
|
||||||
|
.dockerignore
|
||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
README.md
|
||||||
|
LICENSE
|
||||||
|
.vscode
|
||||||
|
.next
|
||||||
|
*.swp
|
||||||
|
/scripts
|
32
.github/workflows/build.yml
vendored
32
.github/workflows/build.yml
vendored
@ -1,14 +1,13 @@
|
|||||||
name: Build Nginx-based docker image
|
name: Build Nginx-based docker image
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.ref }}
|
group: ${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
jobs:
|
jobs:
|
||||||
build-static-assets:
|
build-static-assets:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 30
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
@ -24,12 +23,31 @@ jobs:
|
|||||||
username: ${{ secrets.PRIVATE_REGISTRY_USERNAME }}
|
username: ${{ secrets.PRIVATE_REGISTRY_USERNAME }}
|
||||||
password: ${{ secrets.PRIVATE_REGISTRY_TOKEN }}
|
password: ${{ secrets.PRIVATE_REGISTRY_TOKEN }}
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push intermediate stages (deps)
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
target: deps
|
||||||
tags: |
|
push: ${{ github.ref == 'refs/heads/main' }}
|
||||||
${{ secrets.PRIVATE_REGISTRY_HOST }}/${{ env.GITHUB_REPOSITORY }}:latest
|
tags: ${{ secrets.PRIVATE_REGISTRY_HOST }}/${{ env.GITHUB_REPOSITORY }}:deps
|
||||||
cache-from: type=registry,ref=user/app:latest
|
cache-from: type=registry,ref=${{ secrets.PRIVATE_REGISTRY_HOST }}/${{ env.GITHUB_REPOSITORY }}:deps
|
||||||
|
cache-to: type=inline
|
||||||
|
|
||||||
|
- name: Build and push intermediate stages (builder)
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
target: builder
|
||||||
|
push: ${{ github.ref == 'refs/heads/main' }}
|
||||||
|
tags: ${{ secrets.PRIVATE_REGISTRY_HOST }}/${{ env.GITHUB_REPOSITORY }}:builder
|
||||||
|
cache-from: type=registry,ref=${{ secrets.PRIVATE_REGISTRY_HOST }}/${{ env.GITHUB_REPOSITORY }}:builder
|
||||||
|
cache-to: type=inline
|
||||||
|
|
||||||
|
- name: Build and push (final)
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: ${{ github.ref == 'refs/heads/main' }}
|
||||||
|
tags: ${{ secrets.PRIVATE_REGISTRY_HOST }}/${{ env.GITHUB_REPOSITORY }}:latest
|
||||||
|
cache-from: type=registry,ref=${{ secrets.PRIVATE_REGISTRY_HOST }}/${{ env.GITHUB_REPOSITORY }}:latest
|
||||||
cache-to: type=inline
|
cache-to: type=inline
|
5
.github/workflows/copyright_notice.yml
vendored
5
.github/workflows/copyright_notice.yml
vendored
@ -3,6 +3,9 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
jobs:
|
jobs:
|
||||||
copyright_notice:
|
copyright_notice:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -13,7 +16,7 @@ jobs:
|
|||||||
ref: ${{ github.head_ref }}
|
ref: ${{ github.head_ref }}
|
||||||
- uses: VinnyBabuManjaly/copyright-action@v1.0.0
|
- uses: VinnyBabuManjaly/copyright-action@v1.0.0
|
||||||
with:
|
with:
|
||||||
CopyrightString: '/* Copyright (C) 2024 Manuel Bustillo*/\n\n'
|
CopyrightString: '/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/\n\n'
|
||||||
FileType: '.tsx, .jsx, .ts'
|
FileType: '.tsx, .jsx, .ts'
|
||||||
Path: 'app/, config/, db/'
|
Path: 'app/, config/, db/'
|
||||||
IgnorePath: 'testfolder1/a/, testfolder3'
|
IgnorePath: 'testfolder1/a/, testfolder3'
|
||||||
|
1
.github/workflows/playwright.yml
vendored
1
.github/workflows/playwright.yml
vendored
@ -9,6 +9,7 @@ concurrency:
|
|||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
|
if: false
|
||||||
timeout-minutes: 60
|
timeout-minutes: 60
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
|
28
Dockerfile.dev
Normal file
28
Dockerfile.dev
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
# Based on https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile
|
||||||
|
|
||||||
|
FROM node:23-alpine AS base
|
||||||
|
|
||||||
|
# Install dependencies only when needed
|
||||||
|
FROM base AS deps
|
||||||
|
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
|
||||||
|
RUN apk add --no-cache libc6-compat
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Install dependencies based on the preferred package manager
|
||||||
|
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./
|
||||||
|
RUN \
|
||||||
|
if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
|
||||||
|
elif [ -f package-lock.json ]; then npm ci; \
|
||||||
|
elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm i --frozen-lockfile; \
|
||||||
|
else echo "Lockfile not found." && exit 1; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
COPY . /app/
|
||||||
|
|
||||||
|
ENV NODE_ENV development
|
||||||
|
ENV NEXT_TELEMETRY_DISABLED 1
|
||||||
|
|
||||||
|
EXPOSE 3000
|
||||||
|
ENV PORT=3000
|
||||||
|
|
||||||
|
CMD HOSTNAME="0.0.0.0" pnpm run dev
|
45
app/[slug]/dashboard/expenses/page.tsx
Normal file
45
app/[slug]/dashboard/expenses/page.tsx
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
|
'use client'
|
||||||
|
|
||||||
|
import { AbstractApi } from '@/app/api/abstract-api';
|
||||||
|
import { Expense, ExpenseSerializer } from '@/app/lib/expense';
|
||||||
|
import { classNames } from '@/app/ui/components/button';
|
||||||
|
import ExpenseFormDialog from '@/app/ui/components/expense-form-dialog';
|
||||||
|
import ExpensesTable from '@/app/ui/expenses/table';
|
||||||
|
import SkeletonTable from '@/app/ui/guests/skeleton-row';
|
||||||
|
import { Suspense, useEffect, useState } from 'react';
|
||||||
|
|
||||||
|
export default function Page() {
|
||||||
|
const refreshExpenses = () => {
|
||||||
|
new AbstractApi<Expense>().getAll(new ExpenseSerializer(), (expenses: Expense[]) => {
|
||||||
|
setExpenses(expenses);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const [expenses, setExpenses] = useState<Expense[]>([]);
|
||||||
|
const [expenseBeingEdited, setExpenseBeingEdited] = useState<Expense | undefined>(undefined);
|
||||||
|
useEffect(() => { refreshExpenses() }, []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="w-full">
|
||||||
|
<div className="flex flex-col w-full items-center justify-between">
|
||||||
|
<button onClick={() => setExpenseBeingEdited({})} className={classNames('primary')}>Add new</button>
|
||||||
|
<ExpenseFormDialog
|
||||||
|
key={expenseBeingEdited?.id}
|
||||||
|
onCreate={() => { refreshExpenses(); setExpenseBeingEdited(undefined) }}
|
||||||
|
expense={expenseBeingEdited}
|
||||||
|
visible={expenseBeingEdited !== undefined}
|
||||||
|
onHide={() => { setExpenseBeingEdited(undefined) }}
|
||||||
|
/>
|
||||||
|
<Suspense fallback={<SkeletonTable />}>
|
||||||
|
<ExpensesTable
|
||||||
|
expenses={expenses}
|
||||||
|
onUpdate={refreshExpenses}
|
||||||
|
onEdit={(expense) => setExpenseBeingEdited(expense)}
|
||||||
|
/>
|
||||||
|
</Suspense>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
119
app/[slug]/dashboard/guests/page.tsx
Normal file
119
app/[slug]/dashboard/guests/page.tsx
Normal file
@ -0,0 +1,119 @@
|
|||||||
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
|
'use client';
|
||||||
|
|
||||||
|
import { AbstractApi, } from '@/app/api/abstract-api';
|
||||||
|
import { Group, GroupSerializer } from '@/app/lib/group';
|
||||||
|
import { Guest, GuestSerializer } from '@/app/lib/guest';
|
||||||
|
import { getCsrfToken, getSlug } from '@/app/lib/utils';
|
||||||
|
import AffinitiesFormDialog from '@/app/ui/components/affinities-form-dialog';
|
||||||
|
import { classNames } from '@/app/ui/components/button';
|
||||||
|
import GroupFormDialog from '@/app/ui/components/group-form-dialog';
|
||||||
|
import GuestFormDialog from '@/app/ui/components/guest-form-dialog';
|
||||||
|
import GroupsTable from '@/app/ui/groups/table';
|
||||||
|
import SkeletonTable from '@/app/ui/guests/skeleton-row';
|
||||||
|
import GuestsTable from '@/app/ui/guests/table';
|
||||||
|
import { TabPanel, TabView } from 'primereact/tabview';
|
||||||
|
import { Suspense, useState } from 'react';
|
||||||
|
|
||||||
|
|
||||||
|
export default function Page() {
|
||||||
|
function refreshGuests() {
|
||||||
|
new AbstractApi<Guest>().getAll(new GuestSerializer(), (objects: Guest[]) => {
|
||||||
|
setGuests(objects);
|
||||||
|
setGuestsLoaded(true);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function refreshGroups() {
|
||||||
|
new AbstractApi<Group>().getAll(new GroupSerializer(), (objects: Group[]) => {
|
||||||
|
setGroups(objects);
|
||||||
|
setGroupsLoaded(true);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function resetAffinities() {
|
||||||
|
fetch(`/api/${getSlug()}/groups/affinities/reset`, {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Accept': 'application/json',
|
||||||
|
'X-CSRF-TOKEN': getCsrfToken(),
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const [groupsLoaded, setGroupsLoaded] = useState(false);
|
||||||
|
const [groups, setGroups] = useState<Array<Group>>([]);
|
||||||
|
const [groupBeingEdited, setGroupBeingEdited] = useState<Group | undefined>(undefined);
|
||||||
|
|
||||||
|
const [groupAffinitiesBeingEditted, setGroupAffinitiesBeingEditted] = useState<Group | undefined>(undefined);
|
||||||
|
|
||||||
|
const [guestsLoaded, setGuestsLoaded] = useState(false);
|
||||||
|
const [guests, setGuests] = useState<Array<Guest>>([]);
|
||||||
|
const [guestBeingEdited, setGuestBeingEdited] = useState<Guest | undefined>(undefined);
|
||||||
|
|
||||||
|
!groupsLoaded && refreshGroups();
|
||||||
|
!guestsLoaded && refreshGuests();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="w-full">
|
||||||
|
<TabView>
|
||||||
|
<TabPanel header="Guests" leftIcon="pi pi-users mx-2">
|
||||||
|
<div className="flex flex-col w-full items-center justify-between">
|
||||||
|
<button onClick={() => setGuestBeingEdited({})} className={classNames('primary')}>Add new</button>
|
||||||
|
<GuestFormDialog
|
||||||
|
key={guestBeingEdited?.id}
|
||||||
|
groups={groups}
|
||||||
|
onCreate={() => { refreshGuests(); setGuestBeingEdited(undefined) }}
|
||||||
|
guest={guestBeingEdited}
|
||||||
|
visible={guestBeingEdited !== undefined}
|
||||||
|
onHide={() => { setGuestBeingEdited(undefined) }}
|
||||||
|
/>
|
||||||
|
<Suspense fallback={<SkeletonTable />}>
|
||||||
|
<GuestsTable
|
||||||
|
guests={guests}
|
||||||
|
onUpdate={refreshGuests}
|
||||||
|
onEdit={(guest) => setGuestBeingEdited(guest)}
|
||||||
|
/>
|
||||||
|
</Suspense>
|
||||||
|
</div>
|
||||||
|
</ TabPanel>
|
||||||
|
<TabPanel header="Groups" leftIcon="pi pi-sitemap mx-2">
|
||||||
|
<div className="flex flex-col w-full items-center justify-between">
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<button onClick={() => setGroupBeingEdited({})} className={classNames('primary')}>Add new</button>
|
||||||
|
<button onClick={resetAffinities} className={classNames('yellow')}>Reset affinities</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<GroupFormDialog
|
||||||
|
key={groupBeingEdited?.id}
|
||||||
|
groups={groups}
|
||||||
|
onCreate={() => { refreshGroups(); setGroupBeingEdited(undefined) }}
|
||||||
|
group={groupBeingEdited}
|
||||||
|
visible={groupBeingEdited !== undefined}
|
||||||
|
onHide={() => { setGroupBeingEdited(undefined) }}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<AffinitiesFormDialog
|
||||||
|
groups={groups}
|
||||||
|
group={groupAffinitiesBeingEditted}
|
||||||
|
visible={groupAffinitiesBeingEditted !== undefined}
|
||||||
|
onHide={() => { setGroupAffinitiesBeingEditted(undefined) }}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Suspense fallback={<SkeletonTable />}>
|
||||||
|
<GroupsTable
|
||||||
|
groups={groups}
|
||||||
|
onUpdate={refreshGroups}
|
||||||
|
onEdit={(group) => setGroupBeingEdited(group)}
|
||||||
|
onEditAffinities={(group) => setGroupAffinitiesBeingEditted(group)}
|
||||||
|
/>
|
||||||
|
</Suspense>
|
||||||
|
</div>
|
||||||
|
</ TabPanel>
|
||||||
|
</ TabView>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
);
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 2024 Manuel Bustillo*/
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
import SideNav from '@/app/ui/dashboard/sidenav';
|
import SideNav from '@/app/ui/dashboard/sidenav';
|
||||||
|
|
||||||
@ -8,7 +8,7 @@ export default function Layout({ children }: { children: React.ReactNode }) {
|
|||||||
<div className="w-full flex-none md:w-64">
|
<div className="w-full flex-none md:w-64">
|
||||||
<SideNav />
|
<SideNav />
|
||||||
</div>
|
</div>
|
||||||
<div className="flex-grow p-6 md:overflow-y-auto md:p-12">{children}</div>
|
<div data-testid="main-container" className="flex-grow p-6 md:overflow-y-auto md:p-12">{children}</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
26
app/[slug]/dashboard/page.tsx
Normal file
26
app/[slug]/dashboard/page.tsx
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
|
'use client'
|
||||||
|
|
||||||
|
import { GlobalSummary as Summary } from '@/app/lib/definitions';
|
||||||
|
import { getSlug } from '@/app/lib/utils';
|
||||||
|
import GlobalSummary from '@/app/ui/dashboard/global-summary';
|
||||||
|
import { useEffect, useState } from 'react';
|
||||||
|
|
||||||
|
export default function Page() {
|
||||||
|
const [globalSummary, setGlobalSummary] = useState<Summary | undefined>(undefined);
|
||||||
|
|
||||||
|
function refreshSummary() {
|
||||||
|
fetch(`/api/${getSlug()}/summary`)
|
||||||
|
.then((response) => response.json())
|
||||||
|
.then((data) => {
|
||||||
|
setGlobalSummary(data);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
useEffect(refreshSummary, []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
globalSummary && <GlobalSummary summary={globalSummary} />
|
||||||
|
);
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 2024 Manuel Bustillo*/
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
'use client';
|
'use client';
|
||||||
|
|
40
app/[slug]/page.tsx
Normal file
40
app/[slug]/page.tsx
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
|
'use client';
|
||||||
|
|
||||||
|
import LoginForm from '@/app/ui/components/login-form';
|
||||||
|
import RegistrationForm from '@/app/ui/components/registration-form';
|
||||||
|
import { useParams } from 'next/navigation'
|
||||||
|
import { useEffect } from 'react';
|
||||||
|
import { retrieveCSRFToken } from '../api/authentication';
|
||||||
|
import { getCsrfToken } from '../lib/utils';
|
||||||
|
|
||||||
|
export default async function Page() {
|
||||||
|
const params = useParams<{ slug: string }>()
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (getCsrfToken() == 'unknown') {
|
||||||
|
retrieveCSRFToken();
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
if (typeof window !== 'undefined') {
|
||||||
|
localStorage.setItem('slug', await params.slug);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<main className="flex min-h-screen flex-col p-6">
|
||||||
|
<div className="flex flex-row">
|
||||||
|
<div className="w-1/2">
|
||||||
|
Already have an account? Sign in
|
||||||
|
<LoginForm />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="w-1/2">
|
||||||
|
Don't have an account? Register now!
|
||||||
|
<RegistrationForm />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
);
|
||||||
|
}
|
76
app/api/abstract-api.tsx
Normal file
76
app/api/abstract-api.tsx
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
|
import { Entity } from '@/app/lib/definitions';
|
||||||
|
import { getCsrfToken, getSlug } from '@/app/lib/utils';
|
||||||
|
|
||||||
|
export interface Api<T extends Entity> {
|
||||||
|
getAll(serializable: Serializable<T> ,callback: (objets: T[]) => void): void;
|
||||||
|
get(serializable: Serializable<T>, id: string, callback: (object: T) => void): void;
|
||||||
|
create(serializable: Serializable<T>, object: T, callback: () => void): void;
|
||||||
|
update(serializable: Serializable<T>, object: T, callback: () => void): void;
|
||||||
|
destroy(serializable: Serializable<T>, object: T, callback: () => void): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Serializable<T> {
|
||||||
|
fromJson(json: any): T;
|
||||||
|
toJson(object: T): string;
|
||||||
|
apiPath(): string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class AbstractApi<T extends Entity> implements Api<T> {
|
||||||
|
getAll(serializable: Serializable<T>, callback: (objets: T[]) => void): void {
|
||||||
|
fetch(`/api/${getSlug()}/${serializable.apiPath()}`)
|
||||||
|
.then((response) => response.json())
|
||||||
|
.then((data) => {
|
||||||
|
callback(data.map((record: any) => {
|
||||||
|
return serializable.fromJson(record);
|
||||||
|
}));
|
||||||
|
}, (error) => {
|
||||||
|
return [];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
get(serializable: Serializable<T>, id: string, callback: (object: T) => void): void {
|
||||||
|
fetch(`/api/${getSlug()}/${serializable.apiPath()}/${id}`)
|
||||||
|
.then((response) => response.json())
|
||||||
|
.then((data) => {
|
||||||
|
callback(serializable.fromJson(data));
|
||||||
|
}, (error) => {
|
||||||
|
return [];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
update(serializable: Serializable<T>, object: T, callback: () => void): void {
|
||||||
|
fetch(`/api/${getSlug()}/${serializable.apiPath()}/${object.id}`, {
|
||||||
|
method: 'PUT',
|
||||||
|
body: serializable.toJson(object),
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'X-CSRF-TOKEN': getCsrfToken(),
|
||||||
|
}
|
||||||
|
}).then(callback)
|
||||||
|
.catch((error) => console.error(error));
|
||||||
|
}
|
||||||
|
|
||||||
|
create(serializable: Serializable<T>, object: T, callback: () => void): void {
|
||||||
|
fetch(`/api/${getSlug()}/${serializable.apiPath()}`, {
|
||||||
|
method: 'POST',
|
||||||
|
body: serializable.toJson(object),
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'X-CSRF-TOKEN': getCsrfToken(),
|
||||||
|
}
|
||||||
|
}).then(callback)
|
||||||
|
.catch((error) => console.error(error));
|
||||||
|
}
|
||||||
|
|
||||||
|
destroy(serializable: Serializable<T>, object: T, callback: () => void): void {
|
||||||
|
fetch(`/api/${getSlug()}/${serializable.apiPath()}/${object.id}`, {
|
||||||
|
method: 'DELETE',
|
||||||
|
headers: {
|
||||||
|
'X-CSRF-TOKEN': getCsrfToken(),
|
||||||
|
}
|
||||||
|
}).then(callback)
|
||||||
|
.catch((error) => console.error(error));
|
||||||
|
}
|
||||||
|
}
|
86
app/api/authentication.tsx
Normal file
86
app/api/authentication.tsx
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
|
import { asArray, getCsrfToken, getSlug } from '@/app/lib/utils';
|
||||||
|
import { Captcha, StructuredErrors, User } from '@/app/lib/definitions';
|
||||||
|
|
||||||
|
export function login({ email, password, onLogin }: { email: string, password: string, onLogin: (user: User) => void }) {
|
||||||
|
return fetch(`/api/${getSlug()}/users/sign_in`, {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify({ user: { email, password } }),
|
||||||
|
headers: {
|
||||||
|
'Accept': 'application/json',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'X-CSRF-TOKEN': getCsrfToken(),
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then((response) => response.json())
|
||||||
|
.then((data: any) => {
|
||||||
|
console.log(data);
|
||||||
|
onLogin({
|
||||||
|
id: data.id || '',
|
||||||
|
email: data.email || '',
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch((error) => console.error(error));
|
||||||
|
}
|
||||||
|
|
||||||
|
export function logout({ onLogout }: { onLogout: () => void }) {
|
||||||
|
fetch(`/api/${getSlug()}/users/sign_out`, {
|
||||||
|
method: 'DELETE',
|
||||||
|
headers: {
|
||||||
|
'X-CSRF-TOKEN': getCsrfToken(),
|
||||||
|
}
|
||||||
|
}).then(onLogout)
|
||||||
|
.catch((error) => console.error(error));
|
||||||
|
}
|
||||||
|
|
||||||
|
function flattenErrors(errors: StructuredErrors): string[] {
|
||||||
|
if (errors instanceof Array) {
|
||||||
|
return errors;
|
||||||
|
}
|
||||||
|
return Object.keys(errors).map((key) => {
|
||||||
|
return `${key}: ${asArray(errors[key]).join(', ')}`;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// At this moment we're making an initial request to get a valid CSRF token
|
||||||
|
export function retrieveCSRFToken() {
|
||||||
|
return fetch(`/api/token`, {
|
||||||
|
headers: {
|
||||||
|
'Accept': 'application/json',
|
||||||
|
}
|
||||||
|
}).then((response) => { return null });
|
||||||
|
}
|
||||||
|
|
||||||
|
export function register({ slug, email, password, passwordConfirmation, captcha, onRegister, onError }: {
|
||||||
|
slug: string,
|
||||||
|
email: string,
|
||||||
|
password: string,
|
||||||
|
passwordConfirmation: string,
|
||||||
|
captcha: Captcha,
|
||||||
|
onRegister: () => void,
|
||||||
|
onError: (errors: string[]) => void
|
||||||
|
}) {
|
||||||
|
fetch(`/api/${slug}/users`, {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(
|
||||||
|
{
|
||||||
|
user: { email, password, password_confirmation: passwordConfirmation },
|
||||||
|
captcha: { id: captcha.id, answer: captcha.answer }
|
||||||
|
}
|
||||||
|
),
|
||||||
|
headers: {
|
||||||
|
'Accept': 'application/json',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'X-CSRF-TOKEN': getCsrfToken(),
|
||||||
|
}
|
||||||
|
}).then((response) => {
|
||||||
|
if (response.ok) {
|
||||||
|
response.json().then(onRegister);
|
||||||
|
} else {
|
||||||
|
response.json().then((data: any) => {
|
||||||
|
onError(data.errors && flattenErrors(data.errors) || [data.error]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
19
app/api/captcha.tsx
Normal file
19
app/api/captcha.tsx
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
|
import { data } from "autoprefixer";
|
||||||
|
import { getCsrfToken } from "../lib/utils";
|
||||||
|
|
||||||
|
export function getCaptchaChallenge({onRetrieve}: {onRetrieve: (id: string, url: string) => void}){
|
||||||
|
return fetch('/api/captcha', {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Accept': 'application/json',
|
||||||
|
'X-CSRF-TOKEN': getCsrfToken(),
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then((response) => response.json())
|
||||||
|
.then((data: any) => {
|
||||||
|
onRetrieve(data.id, data.media_url)
|
||||||
|
})
|
||||||
|
.catch((error) => console.error(error));
|
||||||
|
}
|
7
app/api/health/route.ts
Normal file
7
app/api/health/route.ts
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
|
import { NextResponse } from "next/server";
|
||||||
|
|
||||||
|
export function GET() {
|
||||||
|
return NextResponse.json({});
|
||||||
|
}
|
20
app/api/tableSimulations.tsx
Normal file
20
app/api/tableSimulations.tsx
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
|
import { TableArrangement } from '@/app/lib/definitions';
|
||||||
|
import { getSlug } from '../lib/utils';
|
||||||
|
|
||||||
|
export function loadTableSimulations(onLoad?: (tableSimulations: TableArrangement[]) => void) {
|
||||||
|
fetch(`/api/${getSlug()}/tables_arrangements`)
|
||||||
|
.then((response) => response.json())
|
||||||
|
.then((data) => {
|
||||||
|
onLoad && onLoad(data.map((record: any) => {
|
||||||
|
return ({
|
||||||
|
id: record.id,
|
||||||
|
name: record.name,
|
||||||
|
discomfort: record.discomfort,
|
||||||
|
});
|
||||||
|
}));
|
||||||
|
}, (error) => {
|
||||||
|
return [];
|
||||||
|
});
|
||||||
|
}
|
@ -1,16 +0,0 @@
|
|||||||
/* Copyright (C) 2024 Manuel Bustillo*/
|
|
||||||
|
|
||||||
import { lusitana } from '@/app/ui/fonts';
|
|
||||||
import ExpenseSummary from '@/app/ui/expenses/summary';
|
|
||||||
|
|
||||||
export default function Page () {
|
|
||||||
return (
|
|
||||||
<div className="w-full">
|
|
||||||
<div className="w-full items-center justify-between">
|
|
||||||
<h1 className={`${lusitana.className} text-2xl`}>Expenses</h1>
|
|
||||||
<h2 className={`${lusitana.className} text-xl`}>Summary</h2>
|
|
||||||
<ExpenseSummary />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,24 +0,0 @@
|
|||||||
/* Copyright (C) 2024 Manuel Bustillo*/
|
|
||||||
|
|
||||||
import { lusitana } from '@/app/ui/fonts';
|
|
||||||
import AffinityGroupsTree from '@/app/ui/guests/affinity-groups-tree';
|
|
||||||
import GuestsTable from '@/app/ui/guests/table';
|
|
||||||
import React, { Suspense } from 'react';
|
|
||||||
import SkeletonTable from '@/app/ui/guests/skeleton-row';
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export default function Page() {
|
|
||||||
return (
|
|
||||||
<div className="w-full">
|
|
||||||
<AffinityGroupsTree />
|
|
||||||
|
|
||||||
<h1 className={`${lusitana.className} text-2xl py-4`}>Guests</h1>
|
|
||||||
<div className="flex w-full items-center justify-between">
|
|
||||||
<Suspense fallback={<SkeletonTable />}>
|
|
||||||
<GuestsTable />
|
|
||||||
</Suspense>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,5 +0,0 @@
|
|||||||
/* Copyright (C) 2024 Manuel Bustillo*/
|
|
||||||
|
|
||||||
export default function Page() {
|
|
||||||
return <p>Dashboard Page</p>;
|
|
||||||
}
|
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 2024 Manuel Bustillo*/
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
import '@/app/ui/global.css'
|
import '@/app/ui/global.css'
|
||||||
|
|
||||||
|
5
app/lib/affinities.tsx
Normal file
5
app/lib/affinities.tsx
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
|
export class Affinities {
|
||||||
|
[key:string]: number;
|
||||||
|
}
|
@ -1,28 +1,10 @@
|
|||||||
/* Copyright (C) 2024 Manuel Bustillo*/
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
// This file contains type definitions for your data.
|
import { AttendanceSummary } from "./group";
|
||||||
// It describes the shape of the data, and what data type each property should accept.
|
import { Guest } from "./guest";
|
||||||
// For simplicity of teaching, we're manually defining these types.
|
|
||||||
// However, these types are generated automatically if you're using an ORM such as Prisma.
|
|
||||||
export type User = {
|
|
||||||
id: string;
|
|
||||||
name: string;
|
|
||||||
email: string;
|
|
||||||
password: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type Customer = {
|
export interface Entity {
|
||||||
id: string;
|
id?: string;
|
||||||
name: string;
|
|
||||||
email: string;
|
|
||||||
image_url: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type Guest = {
|
|
||||||
id: string;
|
|
||||||
name: string;
|
|
||||||
group_name?: string;
|
|
||||||
status?: 'Considered' | 'Invited' | 'Confirmed' | 'Declined' | 'Tentative';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export type TableArrangement = {
|
export type TableArrangement = {
|
||||||
@ -33,81 +15,35 @@ export type TableArrangement = {
|
|||||||
discomfort?: number
|
discomfort?: number
|
||||||
}
|
}
|
||||||
|
|
||||||
export type Group = {
|
export type User = {
|
||||||
id: string;
|
id: string;
|
||||||
name: string;
|
|
||||||
guest_count: number;
|
|
||||||
icon: string;
|
|
||||||
children: Group[];
|
|
||||||
};
|
|
||||||
|
|
||||||
export type Invoice = {
|
|
||||||
id: string;
|
|
||||||
customer_id: string;
|
|
||||||
amount: number;
|
|
||||||
date: string;
|
|
||||||
// In TypeScript, this is called a string union type.
|
|
||||||
// It means that the "status" property can only be one of the two strings: 'pending' or 'paid'.
|
|
||||||
status: 'pending' | 'paid';
|
|
||||||
};
|
|
||||||
|
|
||||||
export type Revenue = {
|
|
||||||
month: string;
|
|
||||||
revenue: number;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type LatestInvoice = {
|
|
||||||
id: string;
|
|
||||||
name: string;
|
|
||||||
image_url: string;
|
|
||||||
email: string;
|
email: string;
|
||||||
amount: string;
|
}
|
||||||
};
|
|
||||||
|
|
||||||
// The database returns a number for amount, but we later format it to a string with the formatCurrency function
|
export type Captcha = {
|
||||||
export type LatestInvoiceRaw = Omit<LatestInvoice, 'amount'> & {
|
|
||||||
amount: number;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type guestsTable = {
|
|
||||||
id: string;
|
id: string;
|
||||||
customer_id: string;
|
answer: string;
|
||||||
name: string;
|
}
|
||||||
email: string;
|
|
||||||
image_url: string;
|
export type StructuredErrors = {
|
||||||
date: string;
|
[key: string]: string[] | string;
|
||||||
amount: number;
|
|
||||||
status: 'pending' | 'paid';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export type CustomersTableType = {
|
export type GlobalSummary = {
|
||||||
id: string;
|
expenses: ExpenseSummary;
|
||||||
name: string;
|
guests: AttendanceSummary
|
||||||
email: string;
|
}
|
||||||
image_url: string;
|
|
||||||
total_guests: number;
|
|
||||||
total_pending: number;
|
|
||||||
total_paid: number;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type FormattedCustomersTable = {
|
export type ExpenseSummary = {
|
||||||
id: string;
|
projected: ExpensePossibleSummary;
|
||||||
name: string;
|
confirmed: ExpensePossibleSummary;
|
||||||
email: string;
|
status: StatusSummary;
|
||||||
image_url: string;
|
}
|
||||||
total_guests: number;
|
|
||||||
total_pending: string;
|
|
||||||
total_paid: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type CustomerField = {
|
export type ExpensePossibleSummary = {
|
||||||
id: string;
|
total: number;
|
||||||
name: string;
|
guests: number;
|
||||||
};
|
}
|
||||||
|
export type StatusSummary = {
|
||||||
export type InvoiceForm = {
|
paid: number;
|
||||||
id: string;
|
}
|
||||||
customer_id: string;
|
|
||||||
amount: number;
|
|
||||||
status: 'pending' | 'paid';
|
|
||||||
};
|
|
41
app/lib/expense.tsx
Normal file
41
app/lib/expense.tsx
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
|
import { Serializable } from "../api/abstract-api";
|
||||||
|
import { Entity } from "./definitions";
|
||||||
|
|
||||||
|
export const pricingTypes = ['fixed', 'per_person'] as const;
|
||||||
|
export type PricingType = typeof pricingTypes[number];
|
||||||
|
|
||||||
|
export class Expense implements Entity {
|
||||||
|
id?: string;
|
||||||
|
name?: string;
|
||||||
|
amount?: number;
|
||||||
|
pricingType?: PricingType;
|
||||||
|
|
||||||
|
constructor(id?: string, name?: string, amount?: number, pricingType?: PricingType) {
|
||||||
|
this.id = id;
|
||||||
|
this.name = name || '';
|
||||||
|
this.amount = amount || 0;
|
||||||
|
this.pricingType = pricingType || 'fixed';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class ExpenseSerializer implements Serializable<Expense>{
|
||||||
|
fromJson(data: any): Expense {
|
||||||
|
return new Expense(data.id, data.name, data.amount, data.pricing_type);
|
||||||
|
}
|
||||||
|
|
||||||
|
toJson(expense: Expense): string {
|
||||||
|
return JSON.stringify({
|
||||||
|
expense: {
|
||||||
|
name: expense.name,
|
||||||
|
amount: expense.amount,
|
||||||
|
pricing_type: expense.pricingType
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
apiPath(): string {
|
||||||
|
return 'expenses';
|
||||||
|
}
|
||||||
|
}
|
64
app/lib/group.tsx
Normal file
64
app/lib/group.tsx
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
|
import { Entity } from "./definitions";
|
||||||
|
|
||||||
|
export type AttendanceSummary = {
|
||||||
|
considered: number;
|
||||||
|
invited: number;
|
||||||
|
confirmed: number;
|
||||||
|
declined: number;
|
||||||
|
tentative: number;
|
||||||
|
total: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Group implements Entity {
|
||||||
|
id?: string;
|
||||||
|
name?: string;
|
||||||
|
guest_count?: number;
|
||||||
|
icon?: string;
|
||||||
|
children?: Group[];
|
||||||
|
parentId?: string;
|
||||||
|
color?: string;
|
||||||
|
attendance?: AttendanceSummary
|
||||||
|
|
||||||
|
constructor(id?: string, name?: string, guest_count?: number, icon?: string, children?: Group[], parentId?: string, color?: string, attendance?: AttendanceSummary) {
|
||||||
|
this.id = id;
|
||||||
|
this.name = name;
|
||||||
|
this.guest_count = guest_count;
|
||||||
|
this.icon = icon;
|
||||||
|
this.children = children;
|
||||||
|
this.parentId = parentId;
|
||||||
|
this.color = color;
|
||||||
|
this.attendance = attendance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class GroupSerializer {
|
||||||
|
fromJson(data: any): Group {
|
||||||
|
return new Group(
|
||||||
|
data.id,
|
||||||
|
data.name,
|
||||||
|
data.guest_count,
|
||||||
|
data.icon,
|
||||||
|
data.children,
|
||||||
|
data.parent_id,
|
||||||
|
data.color,
|
||||||
|
data.attendance
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
toJson(group: Group): string {
|
||||||
|
return JSON.stringify({
|
||||||
|
group: {
|
||||||
|
name: group.name,
|
||||||
|
color: group.color,
|
||||||
|
icon: group.icon,
|
||||||
|
parent_id: group.parentId
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
apiPath(): string {
|
||||||
|
return 'groups';
|
||||||
|
}
|
||||||
|
}
|
42
app/lib/guest.tsx
Normal file
42
app/lib/guest.tsx
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
|
import { Serializable } from "../api/abstract-api";
|
||||||
|
import { Entity } from "./definitions";
|
||||||
|
|
||||||
|
export const guestStatuses = ['considered', 'invited', 'confirmed', 'declined', 'tentative'] as const;
|
||||||
|
export type GuestStatus = typeof guestStatuses[number];
|
||||||
|
|
||||||
|
export class Guest implements Entity {
|
||||||
|
id?: string;
|
||||||
|
name?: string;
|
||||||
|
group_name?: string;
|
||||||
|
groupId?: string;
|
||||||
|
color?: string;
|
||||||
|
status?: GuestStatus;
|
||||||
|
children?: Guest[];
|
||||||
|
|
||||||
|
constructor(id?: string, name?: string, group_name?: string, groupId?: string, color?: string, status?: GuestStatus, children?: Guest[]) {
|
||||||
|
this.id = id;
|
||||||
|
this.name = name;
|
||||||
|
this.group_name = group_name;
|
||||||
|
this.groupId = groupId;
|
||||||
|
this.color = color;
|
||||||
|
this.status = status;
|
||||||
|
this.children = children;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class GuestSerializer implements Serializable<Guest> {
|
||||||
|
fromJson(data: any): Guest {
|
||||||
|
return new Guest(data.id, data.name, data.group?.name, data.group?.id, data.color, data.status, data.children);
|
||||||
|
}
|
||||||
|
|
||||||
|
toJson(guest: Guest): string {
|
||||||
|
return JSON.stringify({ guest: { name: guest.name, status: guest.status, group_id: guest.groupId } });
|
||||||
|
}
|
||||||
|
|
||||||
|
apiPath(): string {
|
||||||
|
return 'guests';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,149 +0,0 @@
|
|||||||
/* Copyright (C) 2024 Manuel Bustillo*/
|
|
||||||
|
|
||||||
// This file contains placeholder data that you'll be replacing with real data in the Data Fetching chapter:
|
|
||||||
// https://nextjs.org/learn/dashboard-app/fetching-data
|
|
||||||
const users = [
|
|
||||||
{
|
|
||||||
id: '410544b2-4001-4271-9855-fec4b6a6442a',
|
|
||||||
name: 'User',
|
|
||||||
email: 'user@nextmail.com',
|
|
||||||
password: '123456',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
const customers = [
|
|
||||||
{
|
|
||||||
id: 'd6e15727-9fe1-4961-8c5b-ea44a9bd81aa',
|
|
||||||
name: 'Evil Rabbit',
|
|
||||||
email: 'evil@rabbit.com',
|
|
||||||
image_url: '/customers/evil-rabbit.png',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: '3958dc9e-712f-4377-85e9-fec4b6a6442a',
|
|
||||||
name: 'Delba de Oliveira',
|
|
||||||
email: 'delba@oliveira.com',
|
|
||||||
image_url: '/customers/delba-de-oliveira.png',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: '3958dc9e-742f-4377-85e9-fec4b6a6442a',
|
|
||||||
name: 'Lee Robinson',
|
|
||||||
email: 'lee@robinson.com',
|
|
||||||
image_url: '/customers/lee-robinson.png',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: '76d65c26-f784-44a2-ac19-586678f7c2f2',
|
|
||||||
name: 'Michael Novotny',
|
|
||||||
email: 'michael@novotny.com',
|
|
||||||
image_url: '/customers/michael-novotny.png',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'CC27C14A-0ACF-4F4A-A6C9-D45682C144B9',
|
|
||||||
name: 'Amy Burns',
|
|
||||||
email: 'amy@burns.com',
|
|
||||||
image_url: '/customers/amy-burns.png',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: '13D07535-C59E-4157-A011-F8D2EF4E0CBB',
|
|
||||||
name: 'Balazs Orban',
|
|
||||||
email: 'balazs@orban.com',
|
|
||||||
image_url: '/customers/balazs-orban.png',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
const guests = [
|
|
||||||
{
|
|
||||||
customer_id: customers[0].id,
|
|
||||||
amount: 15795,
|
|
||||||
status: 'pending',
|
|
||||||
date: '2022-12-06',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
customer_id: customers[1].id,
|
|
||||||
amount: 20348,
|
|
||||||
status: 'pending',
|
|
||||||
date: '2022-11-14',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
customer_id: customers[4].id,
|
|
||||||
amount: 3040,
|
|
||||||
status: 'paid',
|
|
||||||
date: '2022-10-29',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
customer_id: customers[3].id,
|
|
||||||
amount: 44800,
|
|
||||||
status: 'paid',
|
|
||||||
date: '2023-09-10',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
customer_id: customers[5].id,
|
|
||||||
amount: 34577,
|
|
||||||
status: 'pending',
|
|
||||||
date: '2023-08-05',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
customer_id: customers[2].id,
|
|
||||||
amount: 54246,
|
|
||||||
status: 'pending',
|
|
||||||
date: '2023-07-16',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
customer_id: customers[0].id,
|
|
||||||
amount: 666,
|
|
||||||
status: 'pending',
|
|
||||||
date: '2023-06-27',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
customer_id: customers[3].id,
|
|
||||||
amount: 32545,
|
|
||||||
status: 'paid',
|
|
||||||
date: '2023-06-09',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
customer_id: customers[4].id,
|
|
||||||
amount: 1250,
|
|
||||||
status: 'paid',
|
|
||||||
date: '2023-06-17',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
customer_id: customers[5].id,
|
|
||||||
amount: 8546,
|
|
||||||
status: 'paid',
|
|
||||||
date: '2023-06-07',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
customer_id: customers[1].id,
|
|
||||||
amount: 500,
|
|
||||||
status: 'paid',
|
|
||||||
date: '2023-08-19',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
customer_id: customers[5].id,
|
|
||||||
amount: 8945,
|
|
||||||
status: 'paid',
|
|
||||||
date: '2023-06-03',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
customer_id: customers[2].id,
|
|
||||||
amount: 1000,
|
|
||||||
status: 'paid',
|
|
||||||
date: '2022-06-05',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
const revenue = [
|
|
||||||
{ month: 'Jan', revenue: 2000 },
|
|
||||||
{ month: 'Feb', revenue: 1800 },
|
|
||||||
{ month: 'Mar', revenue: 2200 },
|
|
||||||
{ month: 'Apr', revenue: 2500 },
|
|
||||||
{ month: 'May', revenue: 2300 },
|
|
||||||
{ month: 'Jun', revenue: 3200 },
|
|
||||||
{ month: 'Jul', revenue: 3500 },
|
|
||||||
{ month: 'Aug', revenue: 3700 },
|
|
||||||
{ month: 'Sep', revenue: 2500 },
|
|
||||||
{ month: 'Oct', revenue: 2800 },
|
|
||||||
{ month: 'Nov', revenue: 3000 },
|
|
||||||
{ month: 'Dec', revenue: 4800 },
|
|
||||||
];
|
|
||||||
|
|
||||||
export { users, customers, guests, revenue };
|
|
71
app/lib/tableSimulation.tsx
Normal file
71
app/lib/tableSimulation.tsx
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
|
import { Serializable } from "../api/abstract-api";
|
||||||
|
import { Entity } from "./definitions";
|
||||||
|
import { Guest } from "./guest";
|
||||||
|
|
||||||
|
export type Discomfort = {
|
||||||
|
discomfort: number;
|
||||||
|
breakdown: {
|
||||||
|
tableSizePenalty: number;
|
||||||
|
cohesionPenalty: number;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export type Table = {
|
||||||
|
number: number;
|
||||||
|
guests: Guest[];
|
||||||
|
discomfort: Discomfort;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class TableSimulation implements Entity {
|
||||||
|
id: string;
|
||||||
|
tables: Table[];
|
||||||
|
|
||||||
|
constructor(id: string, tables: Table[]) {
|
||||||
|
this.id = id;
|
||||||
|
this.tables = tables;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class TableSimulationSerializer implements Serializable<TableSimulation> {
|
||||||
|
fromJson(data: any): TableSimulation {
|
||||||
|
return new TableSimulation(data.id, data.tables.map((table: any) => {
|
||||||
|
return {
|
||||||
|
number: table.number,
|
||||||
|
guests: table.guests.map((guest: any) => new Guest(guest.id, guest.name, guest.group?.name, guest.group?.id, guest.color)),
|
||||||
|
discomfort: {
|
||||||
|
discomfort: table.discomfort.discomfort,
|
||||||
|
breakdown: {
|
||||||
|
tableSizePenalty: table.discomfort.breakdown.table_size_penalty,
|
||||||
|
cohesionPenalty: table.discomfort.breakdown.cohesion_penalty,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
toJson(simulation: TableSimulation): string {
|
||||||
|
return JSON.stringify({ simulation: { tables: simulation.tables.map((table) => {
|
||||||
|
return {
|
||||||
|
number: table.number,
|
||||||
|
guests: table.guests.map((guest) => {
|
||||||
|
return {
|
||||||
|
id: guest.id,
|
||||||
|
name: guest.name,
|
||||||
|
group_id: guest.groupId,
|
||||||
|
color: guest.color,
|
||||||
|
status: guest.status,
|
||||||
|
children: guest.children,
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
discomfort: table.discomfort,
|
||||||
|
}
|
||||||
|
}) } });
|
||||||
|
}
|
||||||
|
|
||||||
|
apiPath(): string {
|
||||||
|
return 'tables_arrangements';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,13 +1,4 @@
|
|||||||
/* Copyright (C) 2024 Manuel Bustillo*/
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
import { Revenue } from './definitions';
|
|
||||||
|
|
||||||
export const formatCurrency = (amount: number) => {
|
|
||||||
return (amount / 100).toLocaleString('en-US', {
|
|
||||||
style: 'currency',
|
|
||||||
currency: 'USD',
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
export const getCsrfToken = () => {
|
export const getCsrfToken = () => {
|
||||||
return document.cookie
|
return document.cookie
|
||||||
@ -16,63 +7,14 @@ export const getCsrfToken = () => {
|
|||||||
?.split("=")[1] || 'unknown';
|
?.split("=")[1] || 'unknown';
|
||||||
}
|
}
|
||||||
|
|
||||||
export const formatDateToLocal = (
|
export const getSlug = () => localStorage.getItem('slug') || 'default';
|
||||||
dateStr: string,
|
|
||||||
locale: string = 'en-US',
|
|
||||||
) => {
|
|
||||||
const date = new Date(dateStr);
|
|
||||||
const options: Intl.DateTimeFormatOptions = {
|
|
||||||
day: 'numeric',
|
|
||||||
month: 'short',
|
|
||||||
year: 'numeric',
|
|
||||||
};
|
|
||||||
const formatter = new Intl.DateTimeFormat(locale, options);
|
|
||||||
return formatter.format(date);
|
|
||||||
};
|
|
||||||
|
|
||||||
export const generateYAxis = (revenue: Revenue[]) => {
|
// From https://stackoverflow.com/a/1026087/3607039
|
||||||
// Calculate what labels we need to display on the y-axis
|
export const capitalize = (val:string) => {
|
||||||
// based on highest record and in 1000s
|
return String(val).charAt(0).toUpperCase() + String(val).slice(1);
|
||||||
const yAxisLabels = [];
|
|
||||||
const highestRecord = Math.max(...revenue.map((month) => month.revenue));
|
|
||||||
const topLabel = Math.ceil(highestRecord / 1000) * 1000;
|
|
||||||
|
|
||||||
for (let i = topLabel; i >= 0; i -= 1000) {
|
|
||||||
yAxisLabels.push(`$${i / 1000}K`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return { yAxisLabels, topLabel };
|
// From https://stackoverflow.com/a/62118163/3607039
|
||||||
};
|
export function asArray<T>(value: T | T[]): T[] {
|
||||||
|
return ([] as T[]).concat(value)
|
||||||
export const generatePagination = (currentPage: number, totalPages: number) => {
|
|
||||||
// If the total number of pages is 7 or less,
|
|
||||||
// display all pages without any ellipsis.
|
|
||||||
if (totalPages <= 7) {
|
|
||||||
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the current page is among the first 3 pages,
|
|
||||||
// show the first 3, an ellipsis, and the last 2 pages.
|
|
||||||
if (currentPage <= 3) {
|
|
||||||
return [1, 2, 3, '...', totalPages - 1, totalPages];
|
|
||||||
}
|
|
||||||
|
|
||||||
// If the current page is among the last 3 pages,
|
|
||||||
// show the first 2, an ellipsis, and the last 3 pages.
|
|
||||||
if (currentPage >= totalPages - 2) {
|
|
||||||
return [1, 2, '...', totalPages - 2, totalPages - 1, totalPages];
|
|
||||||
}
|
|
||||||
|
|
||||||
// If the current page is somewhere in the middle,
|
|
||||||
// show the first page, an ellipsis, the current page and its neighbors,
|
|
||||||
// another ellipsis, and the last page.
|
|
||||||
return [
|
|
||||||
1,
|
|
||||||
'...',
|
|
||||||
currentPage - 1,
|
|
||||||
currentPage,
|
|
||||||
currentPage + 1,
|
|
||||||
'...',
|
|
||||||
totalPages,
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
12
app/page.tsx
12
app/page.tsx
@ -1,12 +0,0 @@
|
|||||||
/* Copyright (C) 2024 Manuel Bustillo*/
|
|
||||||
|
|
||||||
import Link from 'next/link';
|
|
||||||
import styles from '@/app/ui/home.module.css';
|
|
||||||
|
|
||||||
export default function Page() {
|
|
||||||
return (
|
|
||||||
<main className="flex min-h-screen flex-col p-6">
|
|
||||||
|
|
||||||
</main>
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,124 +0,0 @@
|
|||||||
/* Copyright (C) 2024 Manuel Bustillo*/
|
|
||||||
|
|
||||||
// import bcrypt from 'bcrypt';
|
|
||||||
// import { db } from '@vercel/postgres';
|
|
||||||
// import { guests, customers, revenue, users } from '../lib/placeholder-data';
|
|
||||||
|
|
||||||
// const client = await db.connect();
|
|
||||||
|
|
||||||
// async function seedUsers() {
|
|
||||||
// await client.sql`CREATE EXTENSION IF NOT EXISTS "uuid-ossp"`;
|
|
||||||
// await client.sql`
|
|
||||||
// CREATE TABLE IF NOT EXISTS users (
|
|
||||||
// id UUID DEFAULT uuid_generate_v4() PRIMARY KEY,
|
|
||||||
// name VARCHAR(255) NOT NULL,
|
|
||||||
// email TEXT NOT NULL UNIQUE,
|
|
||||||
// password TEXT NOT NULL
|
|
||||||
// );
|
|
||||||
// `;
|
|
||||||
|
|
||||||
// const insertedUsers = await Promise.all(
|
|
||||||
// users.map(async (user) => {
|
|
||||||
// const hashedPassword = await bcrypt.hash(user.password, 10);
|
|
||||||
// return client.sql`
|
|
||||||
// INSERT INTO users (id, name, email, password)
|
|
||||||
// VALUES (${user.id}, ${user.name}, ${user.email}, ${hashedPassword})
|
|
||||||
// ON CONFLICT (id) DO NOTHING;
|
|
||||||
// `;
|
|
||||||
// }),
|
|
||||||
// );
|
|
||||||
|
|
||||||
// return insertedUsers;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// async function seedguests() {
|
|
||||||
// await client.sql`CREATE EXTENSION IF NOT EXISTS "uuid-ossp"`;
|
|
||||||
|
|
||||||
// await client.sql`
|
|
||||||
// CREATE TABLE IF NOT EXISTS guests (
|
|
||||||
// id UUID DEFAULT uuid_generate_v4() PRIMARY KEY,
|
|
||||||
// customer_id UUID NOT NULL,
|
|
||||||
// amount INT NOT NULL,
|
|
||||||
// status VARCHAR(255) NOT NULL,
|
|
||||||
// date DATE NOT NULL
|
|
||||||
// );
|
|
||||||
// `;
|
|
||||||
|
|
||||||
// const insertedguests = await Promise.all(
|
|
||||||
// guests.map(
|
|
||||||
// (invoice) => client.sql`
|
|
||||||
// INSERT INTO guests (customer_id, amount, status, date)
|
|
||||||
// VALUES (${invoice.customer_id}, ${invoice.amount}, ${invoice.status}, ${invoice.date})
|
|
||||||
// ON CONFLICT (id) DO NOTHING;
|
|
||||||
// `,
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
|
|
||||||
// return insertedguests;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// async function seedCustomers() {
|
|
||||||
// await client.sql`CREATE EXTENSION IF NOT EXISTS "uuid-ossp"`;
|
|
||||||
|
|
||||||
// await client.sql`
|
|
||||||
// CREATE TABLE IF NOT EXISTS customers (
|
|
||||||
// id UUID DEFAULT uuid_generate_v4() PRIMARY KEY,
|
|
||||||
// name VARCHAR(255) NOT NULL,
|
|
||||||
// email VARCHAR(255) NOT NULL,
|
|
||||||
// image_url VARCHAR(255) NOT NULL
|
|
||||||
// );
|
|
||||||
// `;
|
|
||||||
|
|
||||||
// const insertedCustomers = await Promise.all(
|
|
||||||
// customers.map(
|
|
||||||
// (customer) => client.sql`
|
|
||||||
// INSERT INTO customers (id, name, email, image_url)
|
|
||||||
// VALUES (${customer.id}, ${customer.name}, ${customer.email}, ${customer.image_url})
|
|
||||||
// ON CONFLICT (id) DO NOTHING;
|
|
||||||
// `,
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
|
|
||||||
// return insertedCustomers;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// async function seedRevenue() {
|
|
||||||
// await client.sql`
|
|
||||||
// CREATE TABLE IF NOT EXISTS revenue (
|
|
||||||
// month VARCHAR(4) NOT NULL UNIQUE,
|
|
||||||
// revenue INT NOT NULL
|
|
||||||
// );
|
|
||||||
// `;
|
|
||||||
|
|
||||||
// const insertedRevenue = await Promise.all(
|
|
||||||
// revenue.map(
|
|
||||||
// (rev) => client.sql`
|
|
||||||
// INSERT INTO revenue (month, revenue)
|
|
||||||
// VALUES (${rev.month}, ${rev.revenue})
|
|
||||||
// ON CONFLICT (month) DO NOTHING;
|
|
||||||
// `,
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
|
|
||||||
// return insertedRevenue;
|
|
||||||
// }
|
|
||||||
|
|
||||||
export async function GET() {
|
|
||||||
return Response.json({
|
|
||||||
message:
|
|
||||||
'Uncomment this file and remove this line. You can delete this file when you are finished.',
|
|
||||||
});
|
|
||||||
// try {
|
|
||||||
// await client.sql`BEGIN`;
|
|
||||||
// await seedUsers();
|
|
||||||
// await seedCustomers();
|
|
||||||
// await seedguests();
|
|
||||||
// await seedRevenue();
|
|
||||||
// await client.sql`COMMIT`;
|
|
||||||
|
|
||||||
// return Response.json({ message: 'Database seeded successfully' });
|
|
||||||
// } catch (error) {
|
|
||||||
// await client.sql`ROLLBACK`;
|
|
||||||
// return Response.json({ error }, { status: 500 });
|
|
||||||
// }
|
|
||||||
}
|
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 2024 Manuel Bustillo*/
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
import * as HeroIcon from '@heroicons/react/24/outline'
|
import * as HeroIcon from '@heroicons/react/24/outline'
|
||||||
import { ComponentProps } from 'react'
|
import { ComponentProps } from 'react'
|
||||||
|
@ -1,40 +1,34 @@
|
|||||||
/* Copyright (C) 2024 Manuel Bustillo*/
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import React, { useState } from 'react';
|
import { AbstractApi } from '@/app/api/abstract-api';
|
||||||
import { TableArrangement, Guest } from '@/app/lib/definitions';
|
import { TableArrangement } from '@/app/lib/definitions';
|
||||||
import { lusitana } from '@/app/ui/fonts';
|
import { TableSimulation, TableSimulationSerializer } from '@/app/lib/tableSimulation';
|
||||||
|
import { getSlug } from '@/app/lib/utils';
|
||||||
import { Table } from '@/app/ui/components/table';
|
import { Table } from '@/app/ui/components/table';
|
||||||
|
import { lusitana } from '@/app/ui/fonts';
|
||||||
|
import { useState, useEffect } from 'react';
|
||||||
|
|
||||||
export default function Arrangement({ id }: { id: string }) {
|
export default function Arrangement({ id }: { id: string }) {
|
||||||
|
|
||||||
const [tables, setTables] = useState<Array<TableArrangement>>([]);
|
const [simulation, setSimulation] = useState<TableSimulation | undefined>(undefined);
|
||||||
|
|
||||||
function loadTables() {
|
function loadSimulation() {
|
||||||
fetch(`/api/tables_arrangements/${id}`)
|
new AbstractApi<TableSimulation>().get(new TableSimulationSerializer(), id, (object: TableSimulation) => {
|
||||||
.then((response) => response.json())
|
setSimulation(object);
|
||||||
.then((data) => {
|
|
||||||
setTables(data.map((record: any) => {
|
|
||||||
return ({
|
|
||||||
id: record.number,
|
|
||||||
guests: record.guests
|
|
||||||
});
|
|
||||||
}));
|
|
||||||
}, (error) => {
|
|
||||||
return [];
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
tables.length === 0 && loadTables();
|
useEffect(loadSimulation, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
<div className="w-full items-center justify-between">
|
<div className="w-full items-center justify-between">
|
||||||
<h1 className={`${lusitana.className} text-2xl my-5`}>Table distributions</h1>
|
<h1 className={`${lusitana.className} text-2xl my-5`}>Table distributions</h1>
|
||||||
<div className="flex flex-row flex-wrap justify-around">
|
<div className="flex flex-row flex-wrap justify-around">
|
||||||
{tables.map((table) => (
|
{simulation && simulation.tables.map((table) => (
|
||||||
<Table key={table.number} guests={table.guests || []} style="rounded" />
|
<Table key={table.number} table={table} style="rounded" />
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,27 +1,21 @@
|
|||||||
/* Copyright (C) 2024 Manuel Bustillo*/
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import React, { useState } from "react"
|
import React, { useState } from "react"
|
||||||
import { TableArrangement } from '@/app/lib/definitions';
|
import { TableArrangement } from '@/app/lib/definitions';
|
||||||
import { classNames } from "../components/button";
|
import { classNames } from "../components/button";
|
||||||
|
import TableOfContents from "../components/table-of-contents";
|
||||||
|
import { loadTableSimulations } from "@/app/api/tableSimulations";
|
||||||
|
|
||||||
export default function ArrangementsTable ({onArrangementSelected}: {onArrangementSelected: (arrangementId: string) => void}) {
|
export default function ArrangementsTable ({onArrangementSelected}: {onArrangementSelected: (arrangementId: string) => void}) {
|
||||||
const [arrangements, setArrangements] = useState<Array<TableArrangement>>([]);
|
const [arrangements, setArrangements] = useState<Array<TableArrangement>>([]);
|
||||||
|
const [arrangementsLoaded, setArrangementsLoaded] = useState(false);
|
||||||
|
|
||||||
function loadArrangements() {
|
function refreshSimulations() {
|
||||||
fetch("/api/tables_arrangements")
|
loadTableSimulations((arrangements) => {
|
||||||
.then((response) => response.json())
|
setArrangements(arrangements);
|
||||||
.then((data) => {
|
setArrangementsLoaded(true);
|
||||||
setArrangements(data.map((record: any) => {
|
|
||||||
return ({
|
|
||||||
id: record.id,
|
|
||||||
name: record.name,
|
|
||||||
discomfort: record.discomfort
|
|
||||||
});
|
|
||||||
}));
|
|
||||||
}, (error) => {
|
|
||||||
return [];
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -29,32 +23,14 @@ export default function ArrangementsTable ({onArrangementSelected}: {onArrangeme
|
|||||||
onArrangementSelected(e.currentTarget.getAttribute('data-arrangement-id') || '');
|
onArrangementSelected(e.currentTarget.getAttribute('data-arrangement-id') || '');
|
||||||
}
|
}
|
||||||
|
|
||||||
arrangements.length === 0 && loadArrangements();
|
!arrangementsLoaded && refreshSimulations();
|
||||||
|
|
||||||
return(
|
return(
|
||||||
<div className="w-full relative overflow-x-auto shadow-md sm:rounded-lg">
|
<TableOfContents
|
||||||
<table className="w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400">
|
headers={['Name', 'Discomfort', 'Actions']}
|
||||||
<caption className="p-5 text-lg font-semibold text-left rtl:text-right text-gray-900 bg-white dark:text-white dark:bg-gray-800">
|
caption='Simulations'
|
||||||
Simulations
|
elements={arrangements}
|
||||||
<p className="mt-1 text-sm font-normal text-gray-500 dark:text-gray-400">
|
rowRender={(arrangement) => (
|
||||||
There are {arrangements.length} simmulations in the list
|
|
||||||
</p>
|
|
||||||
</caption>
|
|
||||||
<thead className="text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400">
|
|
||||||
<tr>
|
|
||||||
<th scope="col" className="px-6 py-3">
|
|
||||||
Name
|
|
||||||
</th>
|
|
||||||
<th scope="col" className="px-6 py-3">
|
|
||||||
Discomfort
|
|
||||||
</th>
|
|
||||||
<th scope="col" className="px-6 py-3">
|
|
||||||
Actions
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{arrangements.map((arrangement) => (
|
|
||||||
<tr key={arrangement.id} className="bg-white border-b odd:bg-white odd:dark:bg-gray-900 even:bg-gray-50 even:dark:bg-gray-800">
|
<tr key={arrangement.id} className="bg-white border-b odd:bg-white odd:dark:bg-gray-900 even:bg-gray-50 even:dark:bg-gray-800">
|
||||||
<th scope="row" className="px-6 py-4 font-medium text-gray-900 whitespace-nowrap dark:text-white">
|
<th scope="row" className="px-6 py-4 font-medium text-gray-900 whitespace-nowrap dark:text-white">
|
||||||
{arrangement.name}
|
{arrangement.name}
|
||||||
@ -66,9 +42,7 @@ export default function ArrangementsTable ({onArrangementSelected}: {onArrangeme
|
|||||||
<button data-arrangement-id={arrangement.id} onClick={arrangementClicked} className={classNames('primary')}>Load</button>
|
<button data-arrangement-id={arrangement.id} onClick={arrangementClicked} className={classNames('primary')}>Load</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
))}
|
)}
|
||||||
</tbody>
|
/>
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 2024 Manuel Bustillo*/
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
|
|
||||||
|
82
app/ui/components/affinities-form-dialog.tsx
Normal file
82
app/ui/components/affinities-form-dialog.tsx
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
|
'use client';
|
||||||
|
|
||||||
|
import { Affinities } from '@/app/lib/affinities';
|
||||||
|
import { Group } from '@/app/lib/group';
|
||||||
|
import { getCsrfToken, getSlug } from '@/app/lib/utils';
|
||||||
|
import { classNames } from '@/app/ui/components/button';
|
||||||
|
import { Dialog } from 'primereact/dialog';
|
||||||
|
import { useEffect, useState } from 'react';
|
||||||
|
import AffinitySlider from './form/affinitySlider';
|
||||||
|
|
||||||
|
export default function AffinitiesFormDialog({ groups, group, visible, onHide }: {
|
||||||
|
groups: Group[],
|
||||||
|
group?: Group,
|
||||||
|
visible: boolean,
|
||||||
|
onHide: () => void,
|
||||||
|
}) {
|
||||||
|
const [affinities, setAffinities] = useState<Affinities>({});
|
||||||
|
const [isLoadingAffinities, setIsLoadingAffinities] = useState(true);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setIsLoadingAffinities(true);
|
||||||
|
if (group?.id === undefined) {
|
||||||
|
setAffinities({});
|
||||||
|
setIsLoadingAffinities(false)
|
||||||
|
} else {
|
||||||
|
fetch(`/api/${getSlug()}/groups/${group?.id}/affinities`)
|
||||||
|
.then((response) => response.json())
|
||||||
|
.then((data) => {
|
||||||
|
setAffinities(data);
|
||||||
|
setIsLoadingAffinities(false)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, [group]);
|
||||||
|
|
||||||
|
function submitAffinities() {
|
||||||
|
const formattedAffinities = Object.entries(affinities).map(([groupId, affinity]) => ({ group_id: groupId, affinity: affinity }));
|
||||||
|
fetch(`/api/${getSlug()}/groups/${group?.id}/affinities/bulk_update`, {
|
||||||
|
method: 'PUT',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'X-CSRF-TOKEN': getCsrfToken(),
|
||||||
|
},
|
||||||
|
body: JSON.stringify({ affinities: formattedAffinities })
|
||||||
|
}).then(() => {
|
||||||
|
onHide();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function resetAffinities() {
|
||||||
|
fetch(`/api/${getSlug()}/groups/${group?.id}/affinities/default`, {
|
||||||
|
method: 'GET',
|
||||||
|
headers: {
|
||||||
|
'Accept': 'application/json',
|
||||||
|
}
|
||||||
|
}).then((response) => response.json())
|
||||||
|
.then(setAffinities);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Dialog header="Update affinities" visible={visible} style={{ width: '60vw' }} onHide={onHide}>
|
||||||
|
{!isLoadingAffinities && <div className="card justify-evenly py-5 bg-gray-200 flex flex-col">
|
||||||
|
<span className="text-center p-4">Describe the affinity with the rest of the groups</span>
|
||||||
|
|
||||||
|
{
|
||||||
|
groups.filter((currentGroup) => currentGroup.id !== group?.id).map((group) =>
|
||||||
|
<div key={group.id} className="flex flex-row hover:bg-gray-300 px-3 py-2 items-center">
|
||||||
|
<span className="w-1/3 text-right px-4">{group.name}</span>
|
||||||
|
<AffinitySlider value={group.id && affinities[group.id] || 1} onChange={(value) => setAffinities({ ...affinities, [group.id || "default"]: value })} />
|
||||||
|
</div>)
|
||||||
|
}
|
||||||
|
|
||||||
|
<div className="flex justify-center">
|
||||||
|
<button className={classNames('gray')} onClick={resetAffinities} >Reset</button>
|
||||||
|
<button className={classNames('primary')} onClick={submitAffinities} >Update</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</Dialog>
|
||||||
|
);
|
||||||
|
}
|
@ -1,14 +1,15 @@
|
|||||||
/* Copyright (C) 2024 Manuel Bustillo*/
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
import clsx from "clsx";
|
import clsx from "clsx";
|
||||||
|
|
||||||
type ButtonColor = 'primary' | 'blue' | 'green' | 'red' | 'yellow';
|
type ButtonColor = 'primary' | 'blue' | 'green' | 'red' | 'yellow' | 'gray';
|
||||||
|
|
||||||
export function classNames(type: ButtonColor) {
|
export function classNames(type: ButtonColor) {
|
||||||
return(clsx("text-white py-1 px-2 mx-1 rounded", {
|
return (clsx("text-white py-1 px-2 mx-1 rounded disabled:opacity-50 disabled:cursor-not-allowed", {
|
||||||
'bg-blue-400 hover:bg-blue-600': type === 'primary' || type === 'blue',
|
'bg-blue-400 hover:bg-blue-600': type === 'primary' || type === 'blue',
|
||||||
'bg-green-500 hover:bg-green-600': type === 'green',
|
'bg-green-500 hover:bg-green-600': type === 'green',
|
||||||
'bg-red-500 hover:bg-red-600': type === 'red',
|
'bg-red-500 hover:bg-red-600': type === 'red',
|
||||||
'bg-yellow-500 hover:bg-yellow-700': type === 'yellow'
|
'bg-yellow-500 hover:bg-yellow-700': type === 'yellow',
|
||||||
|
'bg-gray-500 hover:bg-gray-700': type === 'gray'
|
||||||
}))
|
}))
|
||||||
}
|
}
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 2024 Manuel Bustillo*/
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
import clsx from "clsx"
|
import clsx from "clsx"
|
||||||
import { Icon } from "../../types";
|
import { Icon } from "../../types";
|
||||||
@ -21,7 +21,7 @@ const colorClasses = (style: Style) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function MainCard({ amount, title, subtitle, style, iconName }:
|
export function MainCard({ amount, title, subtitle, style, iconName }:
|
||||||
{
|
{
|
||||||
amount: string,
|
amount: string,
|
||||||
title: string,
|
title: string,
|
||||||
@ -42,7 +42,7 @@ export async function MainCard({ amount, title, subtitle, style, iconName }:
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function SecondaryCard({ amount, title, iconName, style }: { amount: string, title: string, iconName: keyof typeof HeroIcon, style: Style }) {
|
export function SecondaryCard({ amount, title, iconName, style }: { amount: string, title: string, iconName: keyof typeof HeroIcon, style: Style }) {
|
||||||
return (
|
return (
|
||||||
<div className={`h-12 w-80 m-1 p-2 text-white flex flex-row items-center ${colorClasses(style)}`}>
|
<div className={`h-12 w-80 m-1 p-2 text-white flex flex-row items-center ${colorClasses(style)}`}>
|
||||||
<Icon className="m-3 h-7 w-7" name={iconName} />
|
<Icon className="m-3 h-7 w-7" name={iconName} />
|
||||||
|
83
app/ui/components/expense-form-dialog.tsx
Normal file
83
app/ui/components/expense-form-dialog.tsx
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
|
'use client';
|
||||||
|
|
||||||
|
import { AbstractApi } from '@/app/api/abstract-api';
|
||||||
|
import { Expense, ExpenseSerializer, PricingType, pricingTypes } from '@/app/lib/expense';
|
||||||
|
import { capitalize } from '@/app/lib/utils';
|
||||||
|
import { classNames } from '@/app/ui/components/button';
|
||||||
|
import { Dialog } from 'primereact/dialog';
|
||||||
|
import { Dropdown } from 'primereact/dropdown';
|
||||||
|
import { FloatLabel } from 'primereact/floatlabel';
|
||||||
|
import { InputText } from 'primereact/inputtext';
|
||||||
|
import { useState } from 'react';
|
||||||
|
|
||||||
|
export default function ExpenseFormDialog({ onCreate, onHide, expense, visible }: {
|
||||||
|
onCreate?: () => void,
|
||||||
|
onHide: () => void,
|
||||||
|
expense?: Expense,
|
||||||
|
visible: boolean,
|
||||||
|
}) {
|
||||||
|
|
||||||
|
const [name, setName] = useState<string>(expense?.name || '');
|
||||||
|
const [amount, setAmount] = useState<number>(expense?.amount || 0);
|
||||||
|
const [pricingType, setPricingType] = useState<PricingType>(expense?.pricingType || 'fixed');
|
||||||
|
|
||||||
|
const api = new AbstractApi<Expense>();
|
||||||
|
const serializer = new ExpenseSerializer();
|
||||||
|
|
||||||
|
function resetForm() {
|
||||||
|
setName('');
|
||||||
|
setAmount(0);
|
||||||
|
setPricingType('fixed');
|
||||||
|
}
|
||||||
|
|
||||||
|
function submitGroup() {
|
||||||
|
if (expense?.id !== undefined) {
|
||||||
|
expense.name = name;
|
||||||
|
expense.amount = amount;
|
||||||
|
expense.pricingType = pricingType;
|
||||||
|
|
||||||
|
api.update(serializer, expense, () => {
|
||||||
|
resetForm();
|
||||||
|
onCreate && onCreate();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
|
||||||
|
api.create(serializer, new Expense(undefined, name, amount, pricingType), () => {
|
||||||
|
resetForm();
|
||||||
|
onCreate && onCreate();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
|
||||||
|
<Dialog header="Add/edit expense" visible={visible} style={{ width: '60vw' }} onHide={onHide}>
|
||||||
|
<div className="card flex justify-evenly py-5">
|
||||||
|
<FloatLabel>
|
||||||
|
<InputText id="name" className='rounded-sm' value={name} onChange={(e) => setName(e.target.value)} />
|
||||||
|
<label htmlFor="name">Name</label>
|
||||||
|
</FloatLabel>
|
||||||
|
<FloatLabel>
|
||||||
|
<InputText id="amount" className='rounded-sm' value={amount.toString()} onChange={(e) => setAmount(parseFloat(e.target.value))} />
|
||||||
|
<label htmlFor="amount">Amount</label>
|
||||||
|
</FloatLabel>
|
||||||
|
<FloatLabel>
|
||||||
|
<Dropdown id="pricingType" className='rounded-sm min-w-32' value={pricingType} onChange={(e) => setPricingType(e.target.value)} options={
|
||||||
|
pricingTypes.map((type) => {
|
||||||
|
return { label: capitalize(type), value: type };
|
||||||
|
})
|
||||||
|
} />
|
||||||
|
<label htmlFor="pricingType">Pricing type</label>
|
||||||
|
</FloatLabel>
|
||||||
|
|
||||||
|
<button className={classNames('primary')} onClick={submitGroup} disabled={!(name.length > 0)}>
|
||||||
|
{expense?.id !== undefined ? 'Update' : 'Create'}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</Dialog>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
40
app/ui/components/form/affinitySlider.tsx
Normal file
40
app/ui/components/form/affinitySlider.tsx
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
|
import { Slider } from 'primereact/slider';
|
||||||
|
|
||||||
|
export default function AffinitySlider({ value, onChange }: { value: number, onChange: (value: number) => void }) {
|
||||||
|
|
||||||
|
const toNumber = (value : number | [number, number]) => {
|
||||||
|
if(value instanceof Array) {
|
||||||
|
return value[0];
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
const label = (value: number) => {
|
||||||
|
if (value < 0.2) {
|
||||||
|
return 'Nemesis';
|
||||||
|
} else if (value < 0.5) {
|
||||||
|
return 'Enemies';
|
||||||
|
} else if (value < 0.9) {
|
||||||
|
return 'Bad vibes';
|
||||||
|
} else if (value < 1.1) {
|
||||||
|
return 'Neutral';
|
||||||
|
} else if (value < 1.5) {
|
||||||
|
return 'Good vibes';
|
||||||
|
} else if (value < 1.8) {
|
||||||
|
return 'Good friends';
|
||||||
|
} else {
|
||||||
|
return 'Besties';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Slider value={value} min={0} max={2} step={.1} onChange={(e) => onChange(toNumber(e.value))} className='w-80 bg-gray-400' />
|
||||||
|
<span className="px-4 w-1/5">
|
||||||
|
{label(value)}
|
||||||
|
</span>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
34
app/ui/components/form/inlineTextField.tsx
Normal file
34
app/ui/components/form/inlineTextField.tsx
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
|
import React, { useState } from 'react';
|
||||||
|
|
||||||
|
export default function InlineTextField({ initialValue, onChange }: { initialValue: string, onChange: (value: string) => void }) {
|
||||||
|
const [editing, setEditing] = useState(false);
|
||||||
|
const [value, setValue] = useState(initialValue);
|
||||||
|
|
||||||
|
const renderText = () => <span onClick={() => setEditing(true)}>{value}</span>
|
||||||
|
|
||||||
|
const onConfirm = () => {
|
||||||
|
onChange(value);
|
||||||
|
setEditing(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
function renderForm() {
|
||||||
|
return (
|
||||||
|
<div className="flex flex-row">
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
value={value}
|
||||||
|
className="px-2 py-0 h-5 max-w-48"
|
||||||
|
onChange={(e) => setValue(e.target.value)}
|
||||||
|
onBlur={onConfirm}
|
||||||
|
autoFocus
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
editing ? (renderForm()) : (renderText())
|
||||||
|
);
|
||||||
|
}
|
95
app/ui/components/group-form-dialog.tsx
Normal file
95
app/ui/components/group-form-dialog.tsx
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
|
'use client';
|
||||||
|
|
||||||
|
import { AbstractApi } from '@/app/api/abstract-api';
|
||||||
|
import { Group, GroupSerializer } from '@/app/lib/group';
|
||||||
|
import { classNames } from '@/app/ui/components/button';
|
||||||
|
import { ColorPicker } from 'primereact/colorpicker';
|
||||||
|
import { Dialog } from 'primereact/dialog';
|
||||||
|
import { Dropdown } from 'primereact/dropdown';
|
||||||
|
import { FloatLabel } from 'primereact/floatlabel';
|
||||||
|
import { InputText } from 'primereact/inputtext';
|
||||||
|
import { useState } from 'react';
|
||||||
|
|
||||||
|
export default function GroupFormDialog({ groups, onCreate, onHide, group, visible }: {
|
||||||
|
groups: Group[],
|
||||||
|
onCreate?: () => void,
|
||||||
|
onHide: () => void,
|
||||||
|
group?: Group,
|
||||||
|
visible: boolean,
|
||||||
|
}) {
|
||||||
|
|
||||||
|
const [name, setName] = useState(group?.name || '');
|
||||||
|
const [icon, setIcon] = useState(group?.icon || '');
|
||||||
|
const [color, setColor] = useState<string>(group?.color || '');
|
||||||
|
const [parentId, setParentId] = useState(group?.parentId || '');
|
||||||
|
|
||||||
|
const api = new AbstractApi<Group>();
|
||||||
|
const serializer = new GroupSerializer();
|
||||||
|
|
||||||
|
function resetForm() {
|
||||||
|
setName('');
|
||||||
|
setIcon('');
|
||||||
|
setColor('');
|
||||||
|
setParentId('');
|
||||||
|
}
|
||||||
|
|
||||||
|
function submitGroup() {
|
||||||
|
if (!(name)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (group?.id !== undefined) {
|
||||||
|
group.name = name;
|
||||||
|
group.icon = icon;
|
||||||
|
group.color = color;
|
||||||
|
group.parentId = parentId;
|
||||||
|
|
||||||
|
api.update(serializer, group, () => {
|
||||||
|
resetForm();
|
||||||
|
onCreate && onCreate();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
|
||||||
|
api.create(serializer, new Group(undefined, name, undefined, icon, undefined, parentId, color), () => {
|
||||||
|
resetForm();
|
||||||
|
onCreate && onCreate();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
|
||||||
|
<Dialog header="Add group" visible={visible} style={{ width: '60vw' }} onHide={onHide}>
|
||||||
|
<div className="card flex justify-evenly py-5">
|
||||||
|
<FloatLabel>
|
||||||
|
<InputText id="name" className='rounded-sm' value={name} onChange={(e) => setName(e.target.value)} />
|
||||||
|
<label htmlFor="name">Name</label>
|
||||||
|
</FloatLabel>
|
||||||
|
<FloatLabel>
|
||||||
|
<InputText id="icon" className='rounded-sm' value={icon} onChange={(e) => setIcon(e.target.value)} />
|
||||||
|
<label htmlFor="icon">Icon</label>
|
||||||
|
</FloatLabel>
|
||||||
|
<FloatLabel>
|
||||||
|
<ColorPicker value={color} format='hex' onChange={(e) => setColor(`#${e.value}`)} />
|
||||||
|
<label htmlFor="color" />
|
||||||
|
</FloatLabel>
|
||||||
|
<FloatLabel>
|
||||||
|
<Dropdown id="parentId" className='rounded-sm min-w-32' value={parentId} onChange={(e) => setParentId(e.target.value)} options={
|
||||||
|
groups.map((group) => {
|
||||||
|
return { label: group.name, value: group.id };
|
||||||
|
})
|
||||||
|
} />
|
||||||
|
<label htmlFor="parentId">Parent</label>
|
||||||
|
</FloatLabel>
|
||||||
|
|
||||||
|
<button className={classNames('primary')} onClick={submitGroup} disabled={!(name.length > 0)}>
|
||||||
|
{group?.id !== undefined ? 'Update' : 'Create'}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</Dialog>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
91
app/ui/components/guest-form-dialog.tsx
Normal file
91
app/ui/components/guest-form-dialog.tsx
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
|
'use client';
|
||||||
|
|
||||||
|
import { AbstractApi } from '@/app/api/abstract-api';
|
||||||
|
import { Group } from '@/app/lib/group';
|
||||||
|
import { Guest, GuestSerializer, GuestStatus, guestStatuses } from '@/app/lib/guest';
|
||||||
|
import { capitalize } from '@/app/lib/utils';
|
||||||
|
import { classNames } from '@/app/ui/components/button';
|
||||||
|
import { Dialog } from 'primereact/dialog';
|
||||||
|
import { Dropdown } from 'primereact/dropdown';
|
||||||
|
import { FloatLabel } from 'primereact/floatlabel';
|
||||||
|
import { InputText } from 'primereact/inputtext';
|
||||||
|
import { useState } from 'react';
|
||||||
|
|
||||||
|
export default function GuestFormDialog({ groups, onCreate, onHide, guest, visible }: {
|
||||||
|
groups: Group[],
|
||||||
|
onCreate?: () => void,
|
||||||
|
onHide: () => void,
|
||||||
|
guest?: Guest,
|
||||||
|
visible: boolean,
|
||||||
|
}) {
|
||||||
|
|
||||||
|
const [name, setName] = useState(guest?.name || '');
|
||||||
|
const [group, setGroup] = useState(guest?.groupId || null);
|
||||||
|
const [status, setStatus] = useState<GuestStatus | null>(guest?.status || null);
|
||||||
|
|
||||||
|
const api = new AbstractApi<Guest>();
|
||||||
|
const serializer = new GuestSerializer();
|
||||||
|
|
||||||
|
function resetForm() {
|
||||||
|
setName('');
|
||||||
|
setGroup(null);
|
||||||
|
setStatus(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
function submitGuest() {
|
||||||
|
if (!(name && group && status)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (guest?.id !== undefined) {
|
||||||
|
guest.name = name;
|
||||||
|
guest.groupId = group;
|
||||||
|
guest.status = status;
|
||||||
|
|
||||||
|
api.update(serializer, guest, () => {
|
||||||
|
resetForm();
|
||||||
|
onCreate && onCreate();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
api.create(serializer, new Guest(undefined, name, undefined, group, undefined, status), ()=> {
|
||||||
|
resetForm();
|
||||||
|
onCreate && onCreate();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
|
||||||
|
<Dialog header="Add guest" visible={visible} style={{ width: '60vw' }} onHide={onHide}>
|
||||||
|
<div className="card flex justify-evenly py-5">
|
||||||
|
<FloatLabel>
|
||||||
|
<InputText id="username" className='rounded-sm' value={name} onChange={(e) => setName(e.target.value)} />
|
||||||
|
<label htmlFor="username">Username</label>
|
||||||
|
</FloatLabel>
|
||||||
|
<FloatLabel>
|
||||||
|
<Dropdown id="group" className='rounded-sm min-w-32' value={group} onChange={(e) => setGroup(e.target.value)} options={
|
||||||
|
groups.map((group) => {
|
||||||
|
return { label: group.name, value: group.id };
|
||||||
|
})
|
||||||
|
} />
|
||||||
|
<label htmlFor="group">Group</label>
|
||||||
|
</FloatLabel>
|
||||||
|
<FloatLabel>
|
||||||
|
<Dropdown id="status" className='rounded-sm min-w-32' value={status} onChange={(e) => setStatus(e.target.value)} options={
|
||||||
|
guestStatuses.map((status) => {
|
||||||
|
return { label: capitalize(status), value: status };
|
||||||
|
})
|
||||||
|
} />
|
||||||
|
<label htmlFor="status">Status</label>
|
||||||
|
</FloatLabel>
|
||||||
|
<button className={classNames('primary')} onClick={submitGuest} disabled={!(name.length > 0 && group && status)}>
|
||||||
|
{guest?.id !== undefined ? 'Update' : 'Create'}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</Dialog>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
51
app/ui/components/login-form.tsx
Normal file
51
app/ui/components/login-form.tsx
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
|
'use client';
|
||||||
|
|
||||||
|
import { FloatLabel } from 'primereact/floatlabel';
|
||||||
|
import { InputText } from 'primereact/inputtext';
|
||||||
|
import { login } from '../../api/authentication';
|
||||||
|
import { useState, useEffect } from 'react';
|
||||||
|
import { classNames } from './button';
|
||||||
|
import { useRouter } from 'next/navigation'
|
||||||
|
import { User } from '../../lib/definitions';
|
||||||
|
import { getSlug } from '@/app/lib/utils';
|
||||||
|
|
||||||
|
export default function LoginForm() {
|
||||||
|
const [email, setEmail] = useState("");
|
||||||
|
const [password, setPassword] = useState("");
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
|
const [currentUser, setCurrentUser] = useState<User | null>(null);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
localStorage.setItem('currentUser', JSON.stringify(currentUser));
|
||||||
|
}, [currentUser]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="card flex justify-evenly py-5">
|
||||||
|
<FloatLabel>
|
||||||
|
<InputText id="email" type="email" className='rounded-sm' onChange={(e) => setEmail(e.target.value)} />
|
||||||
|
<label htmlFor="email">Email</label>
|
||||||
|
</FloatLabel>
|
||||||
|
<FloatLabel>
|
||||||
|
<InputText id="password" type="password" className='rounded-sm' onChange={(e) => setPassword(e.target.value)} />
|
||||||
|
<label htmlFor="password">Password</label>
|
||||||
|
</FloatLabel>
|
||||||
|
<button
|
||||||
|
className={classNames('primary')}
|
||||||
|
disabled={email.length == 0 || password.length == 0}
|
||||||
|
onClick={() => login({
|
||||||
|
email: email,
|
||||||
|
password: password,
|
||||||
|
onLogin: (user) => {
|
||||||
|
setCurrentUser(user);
|
||||||
|
router.push(`${getSlug()}/dashboard`)
|
||||||
|
}
|
||||||
|
})}>
|
||||||
|
Sign in
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
98
app/ui/components/registration-form.tsx
Normal file
98
app/ui/components/registration-form.tsx
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
|
'use client';
|
||||||
|
|
||||||
|
import { FloatLabel } from 'primereact/floatlabel';
|
||||||
|
import { InputText } from 'primereact/inputtext';
|
||||||
|
import { useState, useEffect } from 'react';
|
||||||
|
import { classNames } from './button';
|
||||||
|
import { getSlug } from '@/app/lib/utils';
|
||||||
|
import { register } from '@/app/api/authentication';
|
||||||
|
import { getCaptchaChallenge } from '@/app/api/captcha';
|
||||||
|
|
||||||
|
export default function RegistrationForm() {
|
||||||
|
const [submitted, setSubmitted] = useState<boolean>(false);
|
||||||
|
const [errors, setErrors] = useState<string[]>([]);
|
||||||
|
|
||||||
|
const [email, setEmail] = useState<string>("");
|
||||||
|
const [password, setPassword] = useState<string>("");
|
||||||
|
const [passwordConfirmation, setPasswordConfirmation] = useState<string>("");
|
||||||
|
const [slug, setSlug] = useState<string>(getSlug());
|
||||||
|
|
||||||
|
const [captchaId, setCaptchaId] = useState<string>("");
|
||||||
|
const [captchaUrl, setCaptchaUrl] = useState<string>("");
|
||||||
|
const [captchaAnswer, setCaptchaAnswer] = useState<string>("");
|
||||||
|
|
||||||
|
const refreshCaptcha = () => {
|
||||||
|
getCaptchaChallenge({
|
||||||
|
onRetrieve: (id, url) => {
|
||||||
|
console.log(id, url);
|
||||||
|
setCaptchaId(id);
|
||||||
|
setCaptchaUrl(url);
|
||||||
|
setCaptchaAnswer("");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
useEffect(refreshCaptcha, [])
|
||||||
|
|
||||||
|
return (
|
||||||
|
submitted ? (
|
||||||
|
<div className="card flex justify-evenly py-5 flex-col">
|
||||||
|
<div className="text-green-500">Registration successful. Check your email for a confirmation link.</div>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
|
||||||
|
<div className="card flex justify-evenly py-5 flex-col">
|
||||||
|
<FloatLabel className="my-4">
|
||||||
|
<InputText id="email" type="email" className='rounded-sm' onChange={(e) => setEmail(e.target.value)} />
|
||||||
|
<label htmlFor="email">Email</label>
|
||||||
|
</FloatLabel>
|
||||||
|
<FloatLabel className="my-4">
|
||||||
|
<InputText id="password" type="password" className='rounded-sm' onChange={(e) => setPassword(e.target.value)} />
|
||||||
|
<label htmlFor="password">Password</label>
|
||||||
|
</FloatLabel>
|
||||||
|
<FloatLabel className="my-4">
|
||||||
|
<InputText id="passwordConfirmation" type="password" className='rounded-sm' onChange={(e) => setPasswordConfirmation(e.target.value)} />
|
||||||
|
<label htmlFor="passwordConfirmation">Confirm Password</label>
|
||||||
|
</FloatLabel>
|
||||||
|
<FloatLabel className="my-4">
|
||||||
|
<InputText id="slug" type="text" className='rounded-sm' onChange={(e) => setSlug(e.target.value)} />
|
||||||
|
<label htmlFor="slug">Slug</label>
|
||||||
|
</FloatLabel>
|
||||||
|
<img className="w-96" src={captchaUrl} alt="captcha" />
|
||||||
|
<FloatLabel className="my-4">
|
||||||
|
<InputText id="captcha" type="text" className='rounded-sm' value={captchaAnswer} onChange={(e) => setCaptchaAnswer(e.target.value)} />
|
||||||
|
<label htmlFor="captcha">Captcha</label>
|
||||||
|
</FloatLabel>
|
||||||
|
|
||||||
|
{errors.map((error, index) => (
|
||||||
|
<div key={index} className="text-red-500">{error}</div>
|
||||||
|
))}
|
||||||
|
|
||||||
|
|
||||||
|
<button
|
||||||
|
className={classNames('primary')}
|
||||||
|
disabled={!(email && password && passwordConfirmation && slug && captchaAnswer)}
|
||||||
|
onClick={() => register(
|
||||||
|
{
|
||||||
|
slug: slug,
|
||||||
|
email: email,
|
||||||
|
password: password,
|
||||||
|
passwordConfirmation: passwordConfirmation,
|
||||||
|
captcha: {
|
||||||
|
id: captchaId,
|
||||||
|
answer: captchaAnswer
|
||||||
|
},
|
||||||
|
onRegister: () => { setErrors([]); setSubmitted(true) },
|
||||||
|
onError: (errors) => { refreshCaptcha(); setErrors(errors) }
|
||||||
|
}
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
Register
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
|
||||||
|
);
|
||||||
|
}
|
28
app/ui/components/table-of-contents.tsx
Normal file
28
app/ui/components/table-of-contents.tsx
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
|
export default function TableOfContents<Type>({ headers, caption, elements, rowRender }: { headers: string[], caption: string, elements: Type[], rowRender: (element: Type) => JSX.Element }) {
|
||||||
|
return (
|
||||||
|
<div className="w-full relative overflow-x-auto shadow-md sm:rounded-lg">
|
||||||
|
<table className="w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400">
|
||||||
|
<caption className="p-5 text-lg font-semibold text-left rtl:text-right text-gray-900 bg-white dark:text-white dark:bg-gray-800">
|
||||||
|
{caption}
|
||||||
|
<p className="mt-1 text-sm font-normal text-gray-500 dark:text-gray-400">
|
||||||
|
There are {elements.length} elements in the list
|
||||||
|
</p>
|
||||||
|
</caption>
|
||||||
|
<thead className="text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400">
|
||||||
|
<tr>
|
||||||
|
{headers.map((header) => (
|
||||||
|
<th scope="col" className="px-6 py-3">
|
||||||
|
{header}
|
||||||
|
</th>
|
||||||
|
))}
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{elements.map((element) => rowRender(element))}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
@ -1,17 +1,25 @@
|
|||||||
/* Copyright (C) 2024 Manuel Bustillo*/
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
|
import { Guest } from "@/app/lib/guest";
|
||||||
|
import { Table as TableType } from "@/app/lib/tableSimulation";
|
||||||
|
import { RectangleGroupIcon, UserGroupIcon } from "@heroicons/react/24/outline";
|
||||||
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
|
import { Tooltip } from "primereact/tooltip";
|
||||||
|
import clsx from "clsx";
|
||||||
|
|
||||||
import { Guest } from "@/app/lib/definitions";
|
|
||||||
|
|
||||||
function Dish({ guest, rotation }: { guest: Guest, rotation?: number }) {
|
function Dish({ guest, rotation }: { guest: Guest, rotation?: number }) {
|
||||||
rotation = rotation || 0
|
rotation = rotation || 0
|
||||||
return (
|
return (
|
||||||
<div className={`m-3 w-24 h-24 rounded-full bg-cyan-100 content-center text-center cursor-default`} style={{ rotate: `${360 - rotation}deg` }}>
|
<div className={`m-3 w-24 h-24 rounded-full content-center text-center cursor-default`} style={{
|
||||||
|
rotate: `${360 - rotation}deg`,
|
||||||
|
backgroundColor: guest.color,
|
||||||
|
}}>
|
||||||
{guest.name}
|
{guest.name}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function GuestRow({ guests }: { guests: Guest[] }) {
|
function GuestRow({ guests }: { guests: Guest[] }) {
|
||||||
return (
|
return (
|
||||||
<div className="justify-around flex flex-row">
|
<div className="justify-around flex flex-row">
|
||||||
@ -20,7 +28,8 @@ function GuestRow({ guests }: { guests: Guest[] }) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function RectangularTable({ guests }: { guests: Guest[] }) {
|
function RectangularTable({ table }: { table: TableType }) {
|
||||||
|
const guests = table.guests;
|
||||||
const halfwayThrough = Math.floor(guests.length / 2)
|
const halfwayThrough = Math.floor(guests.length / 2)
|
||||||
const arrayFirstHalf = guests.slice(0, halfwayThrough);
|
const arrayFirstHalf = guests.slice(0, halfwayThrough);
|
||||||
const arraySecondHalf = guests.slice(halfwayThrough, guests.length);
|
const arraySecondHalf = guests.slice(halfwayThrough, guests.length);
|
||||||
@ -33,11 +42,24 @@ function RectangularTable({ guests }: { guests: Guest[] }) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function RoundedTable({ guests }: { guests: Guest[] }) {
|
function RoundedTable({ table }: { table: TableType }) {
|
||||||
|
const guests = table.guests;
|
||||||
const size = 500
|
const size = 500
|
||||||
const rotation = 360 / guests.length
|
const rotation = 360 / guests.length
|
||||||
|
|
||||||
|
const className = (penalty: number) => {
|
||||||
|
return clsx("px-2 tooltip-cohesion", {
|
||||||
|
"hidden": penalty === 0,
|
||||||
|
"text-orange-300": penalty <= 5,
|
||||||
|
"text-orange-500": penalty > 5 && penalty <= 10,
|
||||||
|
"text-orange-700": penalty > 10,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`m-12 rounded-full bg-cyan-800 relative z-0`} style={{ width: `${size}px`, height: `${size}px` }}>
|
<div className={`m-12 rounded-full bg-cyan-800 relative z-0 grid flex items-center justify-items-center`} style={{ width: `${size}px`, height: `${size}px` }}>
|
||||||
|
|
||||||
{
|
{
|
||||||
guests.map((guest, index) => {
|
guests.map((guest, index) => {
|
||||||
return (
|
return (
|
||||||
@ -51,15 +73,35 @@ function RoundedTable({ guests }: { guests: Guest[] }) {
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<div className="bg-zinc-200 w-48 h-12 p-3 flex flex-row rounded z-10">
|
||||||
|
<div className="px-2 text-slate-800">{`Table #${table.number}`}</div>
|
||||||
|
|
||||||
|
|
||||||
|
<Tooltip target=".tooltip-cohesion" />
|
||||||
|
<Tooltip target=".tooltip-size" />
|
||||||
|
|
||||||
|
<RectangleGroupIcon
|
||||||
|
className={className(table.discomfort.breakdown.cohesionPenalty)}
|
||||||
|
data-pr-tooltip={`Cohesion penalty: ${Math.round(table.discomfort.breakdown.cohesionPenalty)}`}
|
||||||
|
data-pr-position="top"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<UserGroupIcon
|
||||||
|
className={className(table.discomfort.breakdown.tableSizePenalty)}
|
||||||
|
data-pr-tooltip={`Table size penalty: ${Math.round(table.discomfort.breakdown.tableSizePenalty)}`}
|
||||||
|
data-pr-position="top"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function Table({ guests, style }: { guests: Guest[], style: "rectangular" | "rounded" }) {
|
export function Table({ table, style }: { table: TableType, style: "rectangular" | "rounded" }) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{style === "rectangular" && <RectangularTable guests={guests} />}
|
{style === "rectangular" && <RectangularTable table={table} />}
|
||||||
{style === "rounded" && <RoundedTable guests={guests} />}
|
{style === "rounded" && <RoundedTable table={table} />}
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
@ -1,125 +0,0 @@
|
|||||||
/* Copyright (C) 2024 Manuel Bustillo*/
|
|
||||||
|
|
||||||
import Image from 'next/image';
|
|
||||||
import { lusitana } from '@/app/ui/fonts';
|
|
||||||
import Search from '@/app/ui/search';
|
|
||||||
import {
|
|
||||||
CustomersTableType,
|
|
||||||
FormattedCustomersTable,
|
|
||||||
} from '@/app/lib/definitions';
|
|
||||||
|
|
||||||
export default async function CustomersTable({
|
|
||||||
customers,
|
|
||||||
}: {
|
|
||||||
customers: FormattedCustomersTable[];
|
|
||||||
}) {
|
|
||||||
return (
|
|
||||||
<div className="w-full">
|
|
||||||
<h1 className={`${lusitana.className} mb-8 text-xl md:text-2xl`}>
|
|
||||||
Customers
|
|
||||||
</h1>
|
|
||||||
<Search placeholder="Search customers..." />
|
|
||||||
<div className="mt-6 flow-root">
|
|
||||||
<div className="overflow-x-auto">
|
|
||||||
<div className="inline-block min-w-full align-middle">
|
|
||||||
<div className="overflow-hidden rounded-md bg-gray-50 p-2 md:pt-0">
|
|
||||||
<div className="md:hidden">
|
|
||||||
{customers?.map((customer) => (
|
|
||||||
<div
|
|
||||||
key={customer.id}
|
|
||||||
className="mb-2 w-full rounded-md bg-white p-4"
|
|
||||||
>
|
|
||||||
<div className="flex items-center justify-between border-b pb-4">
|
|
||||||
<div>
|
|
||||||
<div className="mb-2 flex items-center">
|
|
||||||
<div className="flex items-center gap-3">
|
|
||||||
<Image
|
|
||||||
src={customer.image_url}
|
|
||||||
className="rounded-full"
|
|
||||||
alt={`${customer.name}'s profile picture`}
|
|
||||||
width={28}
|
|
||||||
height={28}
|
|
||||||
/>
|
|
||||||
<p>{customer.name}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<p className="text-sm text-gray-500">
|
|
||||||
{customer.email}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="flex w-full items-center justify-between border-b py-5">
|
|
||||||
<div className="flex w-1/2 flex-col">
|
|
||||||
<p className="text-xs">Pending</p>
|
|
||||||
<p className="font-medium">{customer.total_pending}</p>
|
|
||||||
</div>
|
|
||||||
<div className="flex w-1/2 flex-col">
|
|
||||||
<p className="text-xs">Paid</p>
|
|
||||||
<p className="font-medium">{customer.total_paid}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="pt-4 text-sm">
|
|
||||||
<p>{customer.total_guests} guests</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
<table className="hidden min-w-full rounded-md text-gray-900 md:table">
|
|
||||||
<thead className="rounded-md bg-gray-50 text-left text-sm font-normal">
|
|
||||||
<tr>
|
|
||||||
<th scope="col" className="px-4 py-5 font-medium sm:pl-6">
|
|
||||||
Name
|
|
||||||
</th>
|
|
||||||
<th scope="col" className="px-3 py-5 font-medium">
|
|
||||||
Email
|
|
||||||
</th>
|
|
||||||
<th scope="col" className="px-3 py-5 font-medium">
|
|
||||||
Total guests
|
|
||||||
</th>
|
|
||||||
<th scope="col" className="px-3 py-5 font-medium">
|
|
||||||
Total Pending
|
|
||||||
</th>
|
|
||||||
<th scope="col" className="px-4 py-5 font-medium">
|
|
||||||
Total Paid
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
|
|
||||||
<tbody className="divide-y divide-gray-200 text-gray-900">
|
|
||||||
{customers.map((customer) => (
|
|
||||||
<tr key={customer.id} className="group">
|
|
||||||
<td className="whitespace-nowrap bg-white py-5 pl-4 pr-3 text-sm text-black group-first-of-type:rounded-md group-last-of-type:rounded-md sm:pl-6">
|
|
||||||
<div className="flex items-center gap-3">
|
|
||||||
<Image
|
|
||||||
src={customer.image_url}
|
|
||||||
className="rounded-full"
|
|
||||||
alt={`${customer.name}'s profile picture`}
|
|
||||||
width={28}
|
|
||||||
height={28}
|
|
||||||
/>
|
|
||||||
<p>{customer.name}</p>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
<td className="whitespace-nowrap bg-white px-4 py-5 text-sm">
|
|
||||||
{customer.email}
|
|
||||||
</td>
|
|
||||||
<td className="whitespace-nowrap bg-white px-4 py-5 text-sm">
|
|
||||||
{customer.total_guests}
|
|
||||||
</td>
|
|
||||||
<td className="whitespace-nowrap bg-white px-4 py-5 text-sm">
|
|
||||||
{customer.total_pending}
|
|
||||||
</td>
|
|
||||||
<td className="whitespace-nowrap bg-white px-4 py-5 text-sm group-first-of-type:rounded-md group-last-of-type:rounded-md">
|
|
||||||
{customer.total_paid}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
))}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,60 +0,0 @@
|
|||||||
/* Copyright (C) 2024 Manuel Bustillo*/
|
|
||||||
|
|
||||||
import {
|
|
||||||
BanknotesIcon,
|
|
||||||
ClockIcon,
|
|
||||||
UserGroupIcon,
|
|
||||||
InboxIcon,
|
|
||||||
} from '@heroicons/react/24/outline';
|
|
||||||
import { lusitana } from '@/app/ui/fonts';
|
|
||||||
|
|
||||||
const iconMap = {
|
|
||||||
collected: BanknotesIcon,
|
|
||||||
customers: UserGroupIcon,
|
|
||||||
pending: ClockIcon,
|
|
||||||
guests: InboxIcon,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default async function CardWrapper() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
{/* NOTE: Uncomment this code in Chapter 9 */}
|
|
||||||
|
|
||||||
{/* <Card title="Collected" value={totalPaidguests} type="collected" />
|
|
||||||
<Card title="Pending" value={totalPendingguests} type="pending" />
|
|
||||||
<Card title="Total guests" value={numberOfguests} type="guests" />
|
|
||||||
<Card
|
|
||||||
title="Total Customers"
|
|
||||||
value={numberOfCustomers}
|
|
||||||
type="customers"
|
|
||||||
/> */}
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function Card({
|
|
||||||
title,
|
|
||||||
value,
|
|
||||||
type,
|
|
||||||
}: {
|
|
||||||
title: string;
|
|
||||||
value: number | string;
|
|
||||||
type: 'guests' | 'customers' | 'pending' | 'collected';
|
|
||||||
}) {
|
|
||||||
const Icon = iconMap[type];
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="rounded-xl bg-gray-50 p-2 shadow-sm">
|
|
||||||
<div className="flex p-4">
|
|
||||||
{Icon ? <Icon className="h-5 w-5 text-gray-700" /> : null}
|
|
||||||
<h3 className="ml-2 text-sm font-medium">{title}</h3>
|
|
||||||
</div>
|
|
||||||
<p
|
|
||||||
className={`${lusitana.className}
|
|
||||||
truncate rounded-xl bg-white px-4 py-8 text-center text-2xl`}
|
|
||||||
>
|
|
||||||
{value}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
41
app/ui/dashboard/global-summary.tsx
Normal file
41
app/ui/dashboard/global-summary.tsx
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
|
import { GlobalSummary as Summary} from '@/app/lib/definitions';
|
||||||
|
import { MainCard, SecondaryCard } from '../components/dashboard-cards';
|
||||||
|
|
||||||
|
export default function GlobalSummary({ summary }: { summary: Summary }) {
|
||||||
|
return (
|
||||||
|
<div className="my-4">
|
||||||
|
<div className="flex flex-row w-full my-2">
|
||||||
|
<div className="flex flex-col">
|
||||||
|
<MainCard amount={`${summary.expenses.projected.total}€`} title="Projected" subtitle={`${summary.expenses.projected.guests} guests`} style="blue" iconName="ArrowTrendingUpIcon" />
|
||||||
|
<MainCard amount={`${Math.round(summary.expenses.projected.total / summary.expenses.projected.guests)}€`} title="/ guest" iconName="UserIcon" style='blue' />
|
||||||
|
</div>
|
||||||
|
<div className="flex flex-col">
|
||||||
|
<MainCard amount={`${summary.expenses.confirmed.total}€`} title="Min." subtitle={`${summary.expenses.confirmed.guests} guests`} iconName="ChevronDoubleDownIcon" style="green" />
|
||||||
|
<MainCard amount={`${Math.round(summary.expenses.confirmed.total / summary.expenses.confirmed.guests)}€`} title="/ guest" iconName="UserIcon" style='green' />
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div className="flex flex-col">
|
||||||
|
<MainCard amount={`${summary.expenses.status.paid}€`} title="Paid already" subtitle={`${Math.round(summary.expenses.status.paid / summary.expenses.projected.total * 100)}% of projected`} iconName="CheckIcon" style='blue' />
|
||||||
|
<MainCard amount={`${summary.expenses.projected.total - summary.expenses.status.paid}€`} title="To pay" subtitle={`${100 - Math.round(summary.expenses.status.paid / summary.expenses.projected.total * 100)}% of projected`} iconName="BanknotesIcon" style="orange" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="flex flex-row w-full my-2">
|
||||||
|
<MainCard style="blue" amount={summary.guests.total.toString()} title="Invites sent" iconName="UsersIcon" />
|
||||||
|
|
||||||
|
<div className="flex flex-col">
|
||||||
|
<SecondaryCard amount={`${Math.round(summary.guests.confirmed / summary.guests.total * 100)}%`} title={`confirmed (${summary.guests.confirmed} guests)`} iconName="CheckIcon" style='green' />
|
||||||
|
<SecondaryCard amount={`${Math.round(summary.guests.declined / summary.guests.total * 100)}%`} title={`declined (${summary.guests.declined} guests)`} iconName="XMarkIcon" style='red' />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="flex flex-col">
|
||||||
|
<SecondaryCard amount={`${Math.round(summary.guests.tentative / summary.guests.total * 100)}%`} title={`tentative (${summary.guests.tentative} guests)`} iconName="QuestionMarkCircleIcon" style='orange' />
|
||||||
|
<SecondaryCard amount={`${Math.round(summary.guests.invited / summary.guests.total * 100)}%`} title={`awaiting (${summary.guests.invited} guests)`} iconName="EllipsisHorizontalIcon" style='gray' />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
@ -1,66 +0,0 @@
|
|||||||
/* Copyright (C) 2024 Manuel Bustillo*/
|
|
||||||
|
|
||||||
import { ArrowPathIcon } from '@heroicons/react/24/outline';
|
|
||||||
import clsx from 'clsx';
|
|
||||||
import Image from 'next/image';
|
|
||||||
import { lusitana } from '@/app/ui/fonts';
|
|
||||||
import { LatestInvoice } from '@/app/lib/definitions';
|
|
||||||
export default async function Latestguests({
|
|
||||||
latestguests,
|
|
||||||
}: {
|
|
||||||
latestguests: LatestInvoice[];
|
|
||||||
}) {
|
|
||||||
return (
|
|
||||||
<div className="flex w-full flex-col md:col-span-4">
|
|
||||||
<h2 className={`${lusitana.className} mb-4 text-xl md:text-2xl`}>
|
|
||||||
Latest guests
|
|
||||||
</h2>
|
|
||||||
<div className="flex grow flex-col justify-between rounded-xl bg-gray-50 p-4">
|
|
||||||
{/* NOTE: Uncomment this code in Chapter 7 */}
|
|
||||||
|
|
||||||
{/* <div className="bg-white px-6">
|
|
||||||
{latestguests.map((invoice, i) => {
|
|
||||||
return (
|
|
||||||
<div
|
|
||||||
key={invoice.id}
|
|
||||||
className={clsx(
|
|
||||||
'flex flex-row items-center justify-between py-4',
|
|
||||||
{
|
|
||||||
'border-t': i !== 0,
|
|
||||||
},
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<div className="flex items-center">
|
|
||||||
<Image
|
|
||||||
src={invoice.image_url}
|
|
||||||
alt={`${invoice.name}'s profile picture`}
|
|
||||||
className="mr-4 rounded-full"
|
|
||||||
width={32}
|
|
||||||
height={32}
|
|
||||||
/>
|
|
||||||
<div className="min-w-0">
|
|
||||||
<p className="truncate text-sm font-semibold md:text-base">
|
|
||||||
{invoice.name}
|
|
||||||
</p>
|
|
||||||
<p className="hidden text-sm text-gray-500 sm:block">
|
|
||||||
{invoice.email}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<p
|
|
||||||
className={`${lusitana.className} truncate text-sm font-medium md:text-base`}
|
|
||||||
>
|
|
||||||
{invoice.amount}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</div> */}
|
|
||||||
<div className="flex items-center pb-2 pt-6">
|
|
||||||
<ArrowPathIcon className="h-5 w-5 text-gray-500" />
|
|
||||||
<h3 className="ml-2 text-sm text-gray-500 ">Updated just now</h3>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 2024 Manuel Bustillo*/
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
export default function Loading() {
|
export default function Loading() {
|
||||||
return <div>Loading...</div>;
|
return <div>Loading...</div>;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 2024 Manuel Bustillo*/
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
@ -10,13 +10,14 @@ import {
|
|||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import { usePathname } from 'next/navigation';
|
import { usePathname } from 'next/navigation';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
|
import { getSlug } from '@/app/lib/utils';
|
||||||
|
|
||||||
// Map of links to display in the side navigation.
|
// Map of links to display in the side navigation.
|
||||||
// Depending on the size of the application, this would be stored in a database.
|
// Depending on the size of the application, this would be stored in a database.
|
||||||
const links = [
|
const links = [
|
||||||
{ name: 'Guests', href: '/dashboard/guests', icon: UserGroupIcon },
|
{ name: 'Guests', href: `/${getSlug()}/dashboard/guests`, icon: UserGroupIcon },
|
||||||
{ name: 'Expenses', href: '/dashboard/expenses', icon: BanknotesIcon },
|
{ name: 'Expenses', href: `/${getSlug()}/dashboard/expenses`, icon: BanknotesIcon },
|
||||||
{ name: 'Table distributions', href: '/dashboard/tables', icon: RectangleGroupIcon },
|
{ name: 'Table distributions', href: `/${getSlug()}/dashboard/tables`, icon: RectangleGroupIcon },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,67 +0,0 @@
|
|||||||
/* Copyright (C) 2024 Manuel Bustillo*/
|
|
||||||
|
|
||||||
import { generateYAxis } from '@/app/lib/utils';
|
|
||||||
import { CalendarIcon } from '@heroicons/react/24/outline';
|
|
||||||
import { lusitana } from '@/app/ui/fonts';
|
|
||||||
import { Revenue } from '@/app/lib/definitions';
|
|
||||||
|
|
||||||
// This component is representational only.
|
|
||||||
// For data visualization UI, check out:
|
|
||||||
// https://www.tremor.so/
|
|
||||||
// https://www.chartjs.org/
|
|
||||||
// https://airbnb.io/visx/
|
|
||||||
|
|
||||||
export default async function RevenueChart({
|
|
||||||
revenue,
|
|
||||||
}: {
|
|
||||||
revenue: Revenue[];
|
|
||||||
}) {
|
|
||||||
const chartHeight = 350;
|
|
||||||
// NOTE: Uncomment this code in Chapter 7
|
|
||||||
|
|
||||||
// const { yAxisLabels, topLabel } = generateYAxis(revenue);
|
|
||||||
|
|
||||||
// if (!revenue || revenue.length === 0) {
|
|
||||||
// return <p className="mt-4 text-gray-400">No data available.</p>;
|
|
||||||
// }
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="w-full md:col-span-4">
|
|
||||||
<h2 className={`${lusitana.className} mb-4 text-xl md:text-2xl`}>
|
|
||||||
Recent Revenue
|
|
||||||
</h2>
|
|
||||||
{/* NOTE: Uncomment this code in Chapter 7 */}
|
|
||||||
|
|
||||||
{/* <div className="rounded-xl bg-gray-50 p-4">
|
|
||||||
<div className="sm:grid-cols-13 mt-0 grid grid-cols-12 items-end gap-2 rounded-md bg-white p-4 md:gap-4">
|
|
||||||
<div
|
|
||||||
className="mb-6 hidden flex-col justify-between text-sm text-gray-400 sm:flex"
|
|
||||||
style={{ height: `${chartHeight}px` }}
|
|
||||||
>
|
|
||||||
{yAxisLabels.map((label) => (
|
|
||||||
<p key={label}>{label}</p>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{revenue.map((month) => (
|
|
||||||
<div key={month.month} className="flex flex-col items-center gap-2">
|
|
||||||
<div
|
|
||||||
className="w-full rounded-md bg-blue-300"
|
|
||||||
style={{
|
|
||||||
height: `${(chartHeight / topLabel) * month.revenue}px`,
|
|
||||||
}}
|
|
||||||
></div>
|
|
||||||
<p className="-rotate-90 text-sm text-gray-400 sm:rotate-0">
|
|
||||||
{month.month}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
<div className="flex items-center pb-2 pt-6">
|
|
||||||
<CalendarIcon className="h-5 w-5 text-gray-500" />
|
|
||||||
<h3 className="ml-2 text-sm text-gray-500 ">Last 12 months</h3>
|
|
||||||
</div>
|
|
||||||
</div> */}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,16 +1,23 @@
|
|||||||
/* Copyright (C) 2024 Manuel Bustillo*/
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
|
'use client';
|
||||||
|
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import NavLinks from '@/app/ui/dashboard/nav-links';
|
import NavLinks from '@/app/ui/dashboard/nav-links';
|
||||||
import { PowerIcon } from '@heroicons/react/24/outline';
|
import { PowerIcon } from '@heroicons/react/24/outline';
|
||||||
import { gloriaHallelujah } from '@/app/ui/fonts';
|
import { gloriaHallelujah } from '@/app/ui/fonts';
|
||||||
|
import { logout } from '@/app/api/authentication';
|
||||||
|
import { useRouter } from 'next/navigation';
|
||||||
|
import { getSlug } from '@/app/lib/utils';
|
||||||
|
|
||||||
export default function SideNav() {
|
export default function SideNav() {
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex h-full flex-col px-3 py-4 md:px-2">
|
<div className="flex h-full flex-col px-3 py-4 md:px-2">
|
||||||
<Link
|
<Link
|
||||||
className="mb-2 flex h-20 items-center justify-start rounded-md bg-blue-600 p-4 md:h-20"
|
className="mb-2 flex h-20 items-center justify-start rounded-md bg-blue-600 p-4 md:h-20"
|
||||||
href="/dashboard/guests"
|
href={`/${getSlug()}/dashboard`}
|
||||||
>
|
>
|
||||||
<div className={`${gloriaHallelujah.className} "w-32 text-white md:w-40 antialiased`}>
|
<div className={`${gloriaHallelujah.className} "w-32 text-white md:w-40 antialiased`}>
|
||||||
<h1>Wedding Planner</h1>
|
<h1>Wedding Planner</h1>
|
||||||
@ -19,12 +26,21 @@ export default function SideNav() {
|
|||||||
<div className="flex grow flex-row justify-between space-x-2 md:flex-col md:space-x-0 md:space-y-2">
|
<div className="flex grow flex-row justify-between space-x-2 md:flex-col md:space-x-0 md:space-y-2">
|
||||||
<NavLinks />
|
<NavLinks />
|
||||||
<div className="hidden h-auto w-full grow rounded-md bg-gray-50 md:block"></div>
|
<div className="hidden h-auto w-full grow rounded-md bg-gray-50 md:block"></div>
|
||||||
<form>
|
<span>Logged in as {JSON.parse(localStorage.getItem('currentUser') || '{}').email}</span>
|
||||||
<button className="flex h-[48px] w-full grow items-center justify-center gap-2 rounded-md bg-gray-50 p-3 text-sm font-medium hover:bg-sky-100 hover:text-blue-600 md:flex-none md:justify-start md:p-2 md:px-3">
|
<button
|
||||||
|
className="flex h-[48px] w-full grow items-center justify-center gap-2 rounded-md bg-gray-50 p-3 text-sm font-medium hover:bg-sky-100 hover:text-blue-600 md:flex-none md:justify-start md:p-2 md:px-3"
|
||||||
|
onClick={() => {
|
||||||
|
logout({
|
||||||
|
onLogout: () => {
|
||||||
|
localStorage.clear();
|
||||||
|
router.push(`/${getSlug()}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
>
|
||||||
<PowerIcon className="w-6" />
|
<PowerIcon className="w-6" />
|
||||||
<div className="hidden md:block">Sign Out</div>
|
<div className="hidden md:block">Sign Out</div>
|
||||||
</button>
|
</button>
|
||||||
</form>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -1,45 +0,0 @@
|
|||||||
/* Copyright (C) 2024 Manuel Bustillo*/
|
|
||||||
|
|
||||||
import { MainCard, SecondaryCard } from '../components/dashboard-cards';
|
|
||||||
|
|
||||||
export default async function ExpenseSummary() {
|
|
||||||
return (
|
|
||||||
<div className="my-4">
|
|
||||||
|
|
||||||
<div className="flex flex-row w-full my-2">
|
|
||||||
<MainCard style="green" amount="65000€" title="Projected" subtitle="150 guests" iconName="ArrowTrendingUpIcon" />
|
|
||||||
|
|
||||||
<div className="flex flex-col">
|
|
||||||
<MainCard amount="10000€" title="Paid already" iconName="Square3Stack3DIcon" style='blue' />
|
|
||||||
<MainCard amount="198€" title="/ guest" iconName="UserIcon" style='blue' />
|
|
||||||
</div>
|
|
||||||
<div className="flex flex-col">
|
|
||||||
<MainCard amount="78000€" title="Max." subtitle='200 guests' iconName="ChevronDoubleUpIcon" style="orange" />
|
|
||||||
<MainCard amount="45000€" title="Min." subtitle="125 guests" iconName="ChevronDoubleDownIcon" style="green" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="flex flex-row w-full my-2">
|
|
||||||
<MainCard style="blue" amount="150" title="Invites sent" iconName="UsersIcon" />
|
|
||||||
|
|
||||||
<div className="flex flex-col">
|
|
||||||
<SecondaryCard amount="31%" title="confirmed (27 guests)" iconName="CheckIcon" style='green' />
|
|
||||||
<SecondaryCard amount="5%" title="declined (8 guests)" iconName="XMarkIcon" style='red' />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="flex flex-col">
|
|
||||||
<SecondaryCard amount="17%" title="tentative (14 guests)" iconName="QuestionMarkCircleIcon" style='orange' />
|
|
||||||
<SecondaryCard amount="65%" title="awaiting (72 guests)" iconName="EllipsisHorizontalIcon" style='gray' />
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="flex flex-row w-full my-2">
|
|
||||||
<MainCard style="blue" amount="5" title="Table simulations" iconName="ServerStackIcon" />
|
|
||||||
<MainCard style="blue" amount="9" title="Bus simulations" iconName="TruckIcon" />
|
|
||||||
<MainCard style="blue" amount="98" title="QR codes" iconName="QrCodeIcon" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
46
app/ui/expenses/table.tsx
Normal file
46
app/ui/expenses/table.tsx
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
|
'use client'
|
||||||
|
|
||||||
|
import { AbstractApi } from '@/app/api/abstract-api';
|
||||||
|
import { Expense, ExpenseSerializer } from '@/app/lib/expense';
|
||||||
|
import { PencilIcon, TrashIcon } from '@heroicons/react/24/outline';
|
||||||
|
import TableOfContents from "../components/table-of-contents";
|
||||||
|
|
||||||
|
|
||||||
|
export default function ExpensesTable({ expenses, onUpdate, onEdit }: {
|
||||||
|
expenses: Expense[],
|
||||||
|
onUpdate: () => void,
|
||||||
|
onEdit: (expense: Expense) => void,
|
||||||
|
}) {
|
||||||
|
|
||||||
|
const api = new AbstractApi<Expense>();
|
||||||
|
const serializer = new ExpenseSerializer();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<TableOfContents
|
||||||
|
headers={['Name', 'Amount (€)', 'Pricing Type', 'Actions']}
|
||||||
|
caption='Expenses'
|
||||||
|
elements={expenses}
|
||||||
|
rowRender={(expense) => (
|
||||||
|
<tr key={expense.id} className="bg-white border-b odd:bg-white odd:dark:bg-gray-900 even:bg-gray-50 even:dark:bg-gray-800">
|
||||||
|
<th scope="row" className="px-6 py-4 font-medium text-gray-900 whitespace-nowrap dark:text-white">
|
||||||
|
{expense.name}
|
||||||
|
</th>
|
||||||
|
<td className="px-6 py-4">
|
||||||
|
{expense.amount}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{expense.pricingType}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div className="flex flex-row items-center">
|
||||||
|
<TrashIcon className='size-6 cursor-pointer' onClick={() => { api.destroy(serializer, expense, onUpdate) }} />
|
||||||
|
<PencilIcon className='size-6 cursor-pointer' onClick={() => onEdit(expense)} />
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 2024 Manuel Bustillo*/
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
import { Inter, Lusitana, Gloria_Hallelujah} from 'next/font/google';
|
import { Inter, Lusitana, Gloria_Hallelujah} from 'next/font/google';
|
||||||
|
|
||||||
|
105
app/ui/groups/table.tsx
Normal file
105
app/ui/groups/table.tsx
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
|
'use client';
|
||||||
|
|
||||||
|
import { AbstractApi } from '@/app/api/abstract-api';
|
||||||
|
import { Group, GroupSerializer } from '@/app/lib/group';
|
||||||
|
import { AdjustmentsHorizontalIcon, PencilIcon, TrashIcon } from '@heroicons/react/24/outline';
|
||||||
|
import { Column } from 'primereact/column';
|
||||||
|
import { TreeNode } from 'primereact/treenode';
|
||||||
|
import { TreeTable } from 'primereact/treetable';
|
||||||
|
|
||||||
|
export default function GroupsTable({ groups, onUpdate, onEdit, onEditAffinities }: {
|
||||||
|
groups: Group[],
|
||||||
|
onUpdate: () => void,
|
||||||
|
onEdit: (group: Group) => void,
|
||||||
|
onEditAffinities: (group: Group) => void,
|
||||||
|
}) {
|
||||||
|
|
||||||
|
const api = new AbstractApi<Group>();
|
||||||
|
const serializer = new GroupSerializer();
|
||||||
|
|
||||||
|
const actions = (group: Group) => (
|
||||||
|
<div className="flex flex-row items-center">
|
||||||
|
<TrashIcon className='size-6 cursor-pointer' onClick={() => { api.destroy(serializer, group, onUpdate) }} />
|
||||||
|
<PencilIcon className='size-6 cursor-pointer' onClick={() => onEdit(group)} />
|
||||||
|
<AdjustmentsHorizontalIcon className='size-6 cursor-pointer' onClick={() => onEditAffinities(group)} />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
|
||||||
|
const index = groups.reduce((acc, group) => {
|
||||||
|
if (group.id) {
|
||||||
|
acc.set(group.id, group)
|
||||||
|
}
|
||||||
|
|
||||||
|
return acc;
|
||||||
|
}, new Map());
|
||||||
|
|
||||||
|
groups.forEach(group => group.children = []);
|
||||||
|
groups.forEach(group => {
|
||||||
|
if (group.parentId) {
|
||||||
|
const parent = index.get(group.parentId);
|
||||||
|
if (parent) {
|
||||||
|
if (!parent.children) {
|
||||||
|
parent.children = [];
|
||||||
|
}
|
||||||
|
parent.children.push(group);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const renderTree = (group: Group): TreeNode => {
|
||||||
|
const childrenAttendance = (group.children || []).reduce((acc, child) => {
|
||||||
|
acc.confirmed += child.attendance?.confirmed || 0;
|
||||||
|
acc.tentative += child.attendance?.tentative || 0;
|
||||||
|
acc.invited += child.attendance?.invited || 0;
|
||||||
|
acc.declined += child.attendance?.declined || 0;
|
||||||
|
acc.considered += child.attendance?.considered || 0;
|
||||||
|
acc.total += child.attendance?.total || 0;
|
||||||
|
return acc;
|
||||||
|
}, { confirmed: 0, tentative: 0, invited: 0, declined: 0, considered: 0, total: 0 });
|
||||||
|
|
||||||
|
return {
|
||||||
|
id: group.id,
|
||||||
|
key: group.id,
|
||||||
|
label: group.name,
|
||||||
|
data: {
|
||||||
|
name: group.name,
|
||||||
|
color: <div className="w-8 h-8 rounded-full" style={{ backgroundColor: group.color }} />,
|
||||||
|
confirmed: childrenAttendance.confirmed + (group.attendance?.confirmed || 0),
|
||||||
|
tentative: childrenAttendance.tentative + (group.attendance?.tentative || 0),
|
||||||
|
pending: childrenAttendance.invited + (group.attendance?.invited || 0),
|
||||||
|
declined: childrenAttendance.declined + (group.attendance?.declined || 0),
|
||||||
|
considered: childrenAttendance.considered + (group.attendance?.considered || 0),
|
||||||
|
total: childrenAttendance.total + (group.attendance?.total || 0),
|
||||||
|
actions: actions(group),
|
||||||
|
},
|
||||||
|
children: group.children?.map(renderTree),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const nodes: TreeNode[] = groups
|
||||||
|
.filter(group => !group.parentId)
|
||||||
|
.map(renderTree)
|
||||||
|
|
||||||
|
const headers = ['Name', 'Color', 'Confirmed', 'Tentative', 'Pending', 'Declined', 'Considered', 'Total', 'Actions'];
|
||||||
|
const rowClassName = () => {
|
||||||
|
return { 'border-b odd:bg-white even:bg-gray-50 hover:bg-gray-100': true };
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<TreeTable value={nodes} rowClassName={rowClassName} className='py-4'>
|
||||||
|
<Column expander field="name" header="Name" className='w-2/5' />
|
||||||
|
<Column field="color" header="Color" bodyClassName="text-sm" />
|
||||||
|
<Column field="confirmed" header="Confirmed" bodyClassName="text-sm" />
|
||||||
|
<Column field="tentative" header="Tentative" bodyClassName="text-sm" />
|
||||||
|
<Column field="pending" header="Pending" bodyClassName="text-sm" />
|
||||||
|
<Column field="declined" header="Declined" bodyClassName="text-sm" />
|
||||||
|
<Column field="considered" header="Considered" bodyClassName="text-sm" />
|
||||||
|
<Column field="total" header="Total" bodyClassName="text-sm" />
|
||||||
|
<Column field="actions" header="Actions" />
|
||||||
|
</TreeTable>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
@ -1,65 +0,0 @@
|
|||||||
/* Copyright (C) 2024 Manuel Bustillo*/
|
|
||||||
|
|
||||||
'use client'
|
|
||||||
|
|
||||||
import React, { useState, useEffect, Suspense } from 'react';
|
|
||||||
import { Tree } from 'primereact/tree';
|
|
||||||
import { PrimeIcons } from 'primereact/api';
|
|
||||||
import { debug } from 'console';
|
|
||||||
import { Group } from '@/app/lib/definitions';
|
|
||||||
|
|
||||||
export default function AffinityGroupsTree() {
|
|
||||||
const [nodes, setNodes] = useState([]);
|
|
||||||
|
|
||||||
const groupToNode = (group: Group): any => {
|
|
||||||
return({
|
|
||||||
key: group.id,
|
|
||||||
label: `${group.name} (${group.guest_count})`,
|
|
||||||
icon: group.icon,
|
|
||||||
children: group.children.map((child) => groupToNode(child)),
|
|
||||||
className: "px-4",
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const parseNode = (record: any, included: any[]): Group => {
|
|
||||||
if (!record.attributes) {
|
|
||||||
record = included.find((a) => a.id === record.id);
|
|
||||||
}
|
|
||||||
|
|
||||||
const children: Group[] = (record?.relationships?.children?.data || []).map((child: any) => {
|
|
||||||
return (parseNode(child, included));
|
|
||||||
});
|
|
||||||
|
|
||||||
const children_guest_count: number = children.reduce((acc: number, child: Group) => acc + child.guest_count, 0);
|
|
||||||
|
|
||||||
return ({
|
|
||||||
id: record.id,
|
|
||||||
name: record.attributes.name,
|
|
||||||
guest_count: record.attributes.guest_count + children_guest_count,
|
|
||||||
icon: record.attributes.icon,
|
|
||||||
children: children,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (nodes.length > 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
fetch("/api/groups.json")
|
|
||||||
.then((response) => response.json())
|
|
||||||
.then((data) => {
|
|
||||||
setNodes(data.data.map((record: any) => {
|
|
||||||
return (groupToNode(parseNode(record, data.included)));
|
|
||||||
}))
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="card flex justify-content-center">
|
|
||||||
<Suspense>
|
|
||||||
<Tree value={nodes} dragdropScope="affinity-groups" onDragDrop={(e) => setNodes(e.value as any)} className="w-full md:w-30rem" />
|
|
||||||
</Suspense>
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
@ -1,38 +0,0 @@
|
|||||||
/* Copyright (C) 2024 Manuel Bustillo*/
|
|
||||||
|
|
||||||
import { clsx } from 'clsx';
|
|
||||||
import Link from 'next/link';
|
|
||||||
import { lusitana } from '@/app/ui/fonts';
|
|
||||||
|
|
||||||
interface Breadcrumb {
|
|
||||||
label: string;
|
|
||||||
href: string;
|
|
||||||
active?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function Breadcrumbs({
|
|
||||||
breadcrumbs,
|
|
||||||
}: {
|
|
||||||
breadcrumbs: Breadcrumb[];
|
|
||||||
}) {
|
|
||||||
return (
|
|
||||||
<nav aria-label="Breadcrumb" className="mb-6 block">
|
|
||||||
<ol className={clsx(lusitana.className, 'flex text-xl md:text-2xl')}>
|
|
||||||
{breadcrumbs.map((breadcrumb, index) => (
|
|
||||||
<li
|
|
||||||
key={breadcrumb.href}
|
|
||||||
aria-current={breadcrumb.active}
|
|
||||||
className={clsx(
|
|
||||||
breadcrumb.active ? 'text-gray-900' : 'text-gray-500',
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<Link href={breadcrumb.href}>{breadcrumb.label}</Link>
|
|
||||||
{index < breadcrumbs.length - 1 ? (
|
|
||||||
<span className="mx-3 inline-block">/</span>
|
|
||||||
) : null}
|
|
||||||
</li>
|
|
||||||
))}
|
|
||||||
</ol>
|
|
||||||
</nav>
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,38 +0,0 @@
|
|||||||
/* Copyright (C) 2024 Manuel Bustillo*/
|
|
||||||
|
|
||||||
import { PencilIcon, PlusIcon, TrashIcon } from '@heroicons/react/24/outline';
|
|
||||||
import Link from 'next/link';
|
|
||||||
|
|
||||||
export function CreateInvoice() {
|
|
||||||
return (
|
|
||||||
<Link
|
|
||||||
href="/dashboard/guests/create"
|
|
||||||
className="flex h-10 items-center rounded-lg bg-blue-600 px-4 text-sm font-medium text-white transition-colors hover:bg-blue-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-600"
|
|
||||||
>
|
|
||||||
<span className="hidden md:block">Create Invoice</span>{' '}
|
|
||||||
<PlusIcon className="h-5 md:ml-4" />
|
|
||||||
</Link>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function UpdateInvoice({ id }: { id: string }) {
|
|
||||||
return (
|
|
||||||
<Link
|
|
||||||
href="/dashboard/guests"
|
|
||||||
className="rounded-md border p-2 hover:bg-gray-100"
|
|
||||||
>
|
|
||||||
<PencilIcon className="w-5" />
|
|
||||||
</Link>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function DeleteInvoice({ id }: { id: string }) {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<button className="rounded-md border p-2 hover:bg-gray-100">
|
|
||||||
<span className="sr-only">Delete</span>
|
|
||||||
<TrashIcon className="w-5" />
|
|
||||||
</button>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,114 +0,0 @@
|
|||||||
/* Copyright (C) 2024 Manuel Bustillo*/
|
|
||||||
|
|
||||||
import { CustomerField } from '@/app/lib/definitions';
|
|
||||||
import Link from 'next/link';
|
|
||||||
import {
|
|
||||||
CheckIcon,
|
|
||||||
ClockIcon,
|
|
||||||
CurrencyDollarIcon,
|
|
||||||
UserCircleIcon,
|
|
||||||
} from '@heroicons/react/24/outline';
|
|
||||||
import { Button } from '@/app/ui/button';
|
|
||||||
|
|
||||||
export default function Form({ customers }: { customers: CustomerField[] }) {
|
|
||||||
return (
|
|
||||||
<form>
|
|
||||||
<div className="rounded-md bg-gray-50 p-4 md:p-6">
|
|
||||||
{/* Customer Name */}
|
|
||||||
<div className="mb-4">
|
|
||||||
<label htmlFor="customer" className="mb-2 block text-sm font-medium">
|
|
||||||
Choose customer
|
|
||||||
</label>
|
|
||||||
<div className="relative">
|
|
||||||
<select
|
|
||||||
id="customer"
|
|
||||||
name="customerId"
|
|
||||||
className="peer block w-full cursor-pointer rounded-md border border-gray-200 py-2 pl-10 text-sm outline-2 placeholder:text-gray-500"
|
|
||||||
defaultValue=""
|
|
||||||
>
|
|
||||||
<option value="" disabled>
|
|
||||||
Select a customer
|
|
||||||
</option>
|
|
||||||
{customers.map((customer) => (
|
|
||||||
<option key={customer.id} value={customer.id}>
|
|
||||||
{customer.name}
|
|
||||||
</option>
|
|
||||||
))}
|
|
||||||
</select>
|
|
||||||
<UserCircleIcon className="pointer-events-none absolute left-3 top-1/2 h-[18px] w-[18px] -translate-y-1/2 text-gray-500" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Invoice Amount */}
|
|
||||||
<div className="mb-4">
|
|
||||||
<label htmlFor="amount" className="mb-2 block text-sm font-medium">
|
|
||||||
Choose an amount
|
|
||||||
</label>
|
|
||||||
<div className="relative mt-2 rounded-md">
|
|
||||||
<div className="relative">
|
|
||||||
<input
|
|
||||||
id="amount"
|
|
||||||
name="amount"
|
|
||||||
type="number"
|
|
||||||
step="0.01"
|
|
||||||
placeholder="Enter USD amount"
|
|
||||||
className="peer block w-full rounded-md border border-gray-200 py-2 pl-10 text-sm outline-2 placeholder:text-gray-500"
|
|
||||||
/>
|
|
||||||
<CurrencyDollarIcon className="pointer-events-none absolute left-3 top-1/2 h-[18px] w-[18px] -translate-y-1/2 text-gray-500 peer-focus:text-gray-900" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Invoice Status */}
|
|
||||||
<fieldset>
|
|
||||||
<legend className="mb-2 block text-sm font-medium">
|
|
||||||
Set the invoice status
|
|
||||||
</legend>
|
|
||||||
<div className="rounded-md border border-gray-200 bg-white px-[14px] py-3">
|
|
||||||
<div className="flex gap-4">
|
|
||||||
<div className="flex items-center">
|
|
||||||
<input
|
|
||||||
id="pending"
|
|
||||||
name="status"
|
|
||||||
type="radio"
|
|
||||||
value="pending"
|
|
||||||
className="h-4 w-4 cursor-pointer border-gray-300 bg-gray-100 text-gray-600 focus:ring-2"
|
|
||||||
/>
|
|
||||||
<label
|
|
||||||
htmlFor="pending"
|
|
||||||
className="ml-2 flex cursor-pointer items-center gap-1.5 rounded-full bg-gray-100 px-3 py-1.5 text-xs font-medium text-gray-600"
|
|
||||||
>
|
|
||||||
Pending <ClockIcon className="h-4 w-4" />
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div className="flex items-center">
|
|
||||||
<input
|
|
||||||
id="paid"
|
|
||||||
name="status"
|
|
||||||
type="radio"
|
|
||||||
value="paid"
|
|
||||||
className="h-4 w-4 cursor-pointer border-gray-300 bg-gray-100 text-gray-600 focus:ring-2"
|
|
||||||
/>
|
|
||||||
<label
|
|
||||||
htmlFor="paid"
|
|
||||||
className="ml-2 flex cursor-pointer items-center gap-1.5 rounded-full bg-green-500 px-3 py-1.5 text-xs font-medium text-white"
|
|
||||||
>
|
|
||||||
Paid <CheckIcon className="h-4 w-4" />
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</fieldset>
|
|
||||||
</div>
|
|
||||||
<div className="mt-6 flex justify-end gap-4">
|
|
||||||
<Link
|
|
||||||
href="/dashboard/guests"
|
|
||||||
className="flex h-10 items-center rounded-lg bg-gray-100 px-4 text-sm font-medium text-gray-600 transition-colors hover:bg-gray-200"
|
|
||||||
>
|
|
||||||
Cancel
|
|
||||||
</Link>
|
|
||||||
<Button type="submit">Create Invoice</Button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,125 +0,0 @@
|
|||||||
/* Copyright (C) 2024 Manuel Bustillo*/
|
|
||||||
|
|
||||||
'use client';
|
|
||||||
|
|
||||||
import { CustomerField, InvoiceForm } from '@/app/lib/definitions';
|
|
||||||
import {
|
|
||||||
CheckIcon,
|
|
||||||
ClockIcon,
|
|
||||||
CurrencyDollarIcon,
|
|
||||||
UserCircleIcon,
|
|
||||||
} from '@heroicons/react/24/outline';
|
|
||||||
import Link from 'next/link';
|
|
||||||
import { Button } from '@/app/ui/button';
|
|
||||||
|
|
||||||
export default function EditInvoiceForm({
|
|
||||||
invoice,
|
|
||||||
customers,
|
|
||||||
}: {
|
|
||||||
invoice: InvoiceForm;
|
|
||||||
customers: CustomerField[];
|
|
||||||
}) {
|
|
||||||
return (
|
|
||||||
<form>
|
|
||||||
<div className="rounded-md bg-gray-50 p-4 md:p-6">
|
|
||||||
{/* Customer Name */}
|
|
||||||
<div className="mb-4">
|
|
||||||
<label htmlFor="customer" className="mb-2 block text-sm font-medium">
|
|
||||||
Choose customer
|
|
||||||
</label>
|
|
||||||
<div className="relative">
|
|
||||||
<select
|
|
||||||
id="customer"
|
|
||||||
name="customerId"
|
|
||||||
className="peer block w-full cursor-pointer rounded-md border border-gray-200 py-2 pl-10 text-sm outline-2 placeholder:text-gray-500"
|
|
||||||
defaultValue={invoice.customer_id}
|
|
||||||
>
|
|
||||||
<option value="" disabled>
|
|
||||||
Select a customer
|
|
||||||
</option>
|
|
||||||
{customers.map((customer) => (
|
|
||||||
<option key={customer.id} value={customer.id}>
|
|
||||||
{customer.name}
|
|
||||||
</option>
|
|
||||||
))}
|
|
||||||
</select>
|
|
||||||
<UserCircleIcon className="pointer-events-none absolute left-3 top-1/2 h-[18px] w-[18px] -translate-y-1/2 text-gray-500" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Invoice Amount */}
|
|
||||||
<div className="mb-4">
|
|
||||||
<label htmlFor="amount" className="mb-2 block text-sm font-medium">
|
|
||||||
Choose an amount
|
|
||||||
</label>
|
|
||||||
<div className="relative mt-2 rounded-md">
|
|
||||||
<div className="relative">
|
|
||||||
<input
|
|
||||||
id="amount"
|
|
||||||
name="amount"
|
|
||||||
type="number"
|
|
||||||
step="0.01"
|
|
||||||
defaultValue={invoice.amount}
|
|
||||||
placeholder="Enter USD amount"
|
|
||||||
className="peer block w-full rounded-md border border-gray-200 py-2 pl-10 text-sm outline-2 placeholder:text-gray-500"
|
|
||||||
/>
|
|
||||||
<CurrencyDollarIcon className="pointer-events-none absolute left-3 top-1/2 h-[18px] w-[18px] -translate-y-1/2 text-gray-500 peer-focus:text-gray-900" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Invoice Status */}
|
|
||||||
<fieldset>
|
|
||||||
<legend className="mb-2 block text-sm font-medium">
|
|
||||||
Set the invoice status
|
|
||||||
</legend>
|
|
||||||
<div className="rounded-md border border-gray-200 bg-white px-[14px] py-3">
|
|
||||||
<div className="flex gap-4">
|
|
||||||
<div className="flex items-center">
|
|
||||||
<input
|
|
||||||
id="pending"
|
|
||||||
name="status"
|
|
||||||
type="radio"
|
|
||||||
value="pending"
|
|
||||||
defaultChecked={invoice.status === 'pending'}
|
|
||||||
className="h-4 w-4 cursor-pointer border-gray-300 bg-gray-100 text-gray-600 focus:ring-2"
|
|
||||||
/>
|
|
||||||
<label
|
|
||||||
htmlFor="pending"
|
|
||||||
className="ml-2 flex cursor-pointer items-center gap-1.5 rounded-full bg-gray-100 px-3 py-1.5 text-xs font-medium text-gray-600"
|
|
||||||
>
|
|
||||||
Pending <ClockIcon className="h-4 w-4" />
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div className="flex items-center">
|
|
||||||
<input
|
|
||||||
id="paid"
|
|
||||||
name="status"
|
|
||||||
type="radio"
|
|
||||||
value="paid"
|
|
||||||
defaultChecked={invoice.status === 'paid'}
|
|
||||||
className="h-4 w-4 cursor-pointer border-gray-300 bg-gray-100 text-gray-600 focus:ring-2"
|
|
||||||
/>
|
|
||||||
<label
|
|
||||||
htmlFor="paid"
|
|
||||||
className="ml-2 flex cursor-pointer items-center gap-1.5 rounded-full bg-green-500 px-3 py-1.5 text-xs font-medium text-white"
|
|
||||||
>
|
|
||||||
Paid <CheckIcon className="h-4 w-4" />
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</fieldset>
|
|
||||||
</div>
|
|
||||||
<div className="mt-6 flex justify-end gap-4">
|
|
||||||
<Link
|
|
||||||
href="/dashboard/guests"
|
|
||||||
className="flex h-10 items-center rounded-lg bg-gray-100 px-4 text-sm font-medium text-gray-600 transition-colors hover:bg-gray-200"
|
|
||||||
>
|
|
||||||
Cancel
|
|
||||||
</Link>
|
|
||||||
<Button type="submit">Edit Invoice</Button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,121 +0,0 @@
|
|||||||
/* Copyright (C) 2024 Manuel Bustillo*/
|
|
||||||
|
|
||||||
'use client';
|
|
||||||
|
|
||||||
import { ArrowLeftIcon, ArrowRightIcon } from '@heroicons/react/24/outline';
|
|
||||||
import clsx from 'clsx';
|
|
||||||
import Link from 'next/link';
|
|
||||||
import { generatePagination } from '@/app/lib/utils';
|
|
||||||
|
|
||||||
export default function Pagination({ totalPages }: { totalPages: number }) {
|
|
||||||
// NOTE: Uncomment this code in Chapter 11
|
|
||||||
|
|
||||||
// const allPages = generatePagination(currentPage, totalPages);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
{/* NOTE: Uncomment this code in Chapter 11 */}
|
|
||||||
|
|
||||||
{/* <div className="inline-flex">
|
|
||||||
<PaginationArrow
|
|
||||||
direction="left"
|
|
||||||
href={createPageURL(currentPage - 1)}
|
|
||||||
isDisabled={currentPage <= 1}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div className="flex -space-x-px">
|
|
||||||
{allPages.map((page, index) => {
|
|
||||||
let position: 'first' | 'last' | 'single' | 'middle' | undefined;
|
|
||||||
|
|
||||||
if (index === 0) position = 'first';
|
|
||||||
if (index === allPages.length - 1) position = 'last';
|
|
||||||
if (allPages.length === 1) position = 'single';
|
|
||||||
if (page === '...') position = 'middle';
|
|
||||||
|
|
||||||
return (
|
|
||||||
<PaginationNumber
|
|
||||||
key={page}
|
|
||||||
href={createPageURL(page)}
|
|
||||||
page={page}
|
|
||||||
position={position}
|
|
||||||
isActive={currentPage === page}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<PaginationArrow
|
|
||||||
direction="right"
|
|
||||||
href={createPageURL(currentPage + 1)}
|
|
||||||
isDisabled={currentPage >= totalPages}
|
|
||||||
/>
|
|
||||||
</div> */}
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function PaginationNumber({
|
|
||||||
page,
|
|
||||||
href,
|
|
||||||
isActive,
|
|
||||||
position,
|
|
||||||
}: {
|
|
||||||
page: number | string;
|
|
||||||
href: string;
|
|
||||||
position?: 'first' | 'last' | 'middle' | 'single';
|
|
||||||
isActive: boolean;
|
|
||||||
}) {
|
|
||||||
const className = clsx(
|
|
||||||
'flex h-10 w-10 items-center justify-center text-sm border',
|
|
||||||
{
|
|
||||||
'rounded-l-md': position === 'first' || position === 'single',
|
|
||||||
'rounded-r-md': position === 'last' || position === 'single',
|
|
||||||
'z-10 bg-blue-600 border-blue-600 text-white': isActive,
|
|
||||||
'hover:bg-gray-100': !isActive && position !== 'middle',
|
|
||||||
'text-gray-300': position === 'middle',
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
return isActive || position === 'middle' ? (
|
|
||||||
<div className={className}>{page}</div>
|
|
||||||
) : (
|
|
||||||
<Link href={href} className={className}>
|
|
||||||
{page}
|
|
||||||
</Link>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function PaginationArrow({
|
|
||||||
href,
|
|
||||||
direction,
|
|
||||||
isDisabled,
|
|
||||||
}: {
|
|
||||||
href: string;
|
|
||||||
direction: 'left' | 'right';
|
|
||||||
isDisabled?: boolean;
|
|
||||||
}) {
|
|
||||||
const className = clsx(
|
|
||||||
'flex h-10 w-10 items-center justify-center rounded-md border',
|
|
||||||
{
|
|
||||||
'pointer-events-none text-gray-300': isDisabled,
|
|
||||||
'hover:bg-gray-100': !isDisabled,
|
|
||||||
'mr-2 md:mr-4': direction === 'left',
|
|
||||||
'ml-2 md:ml-4': direction === 'right',
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
const icon =
|
|
||||||
direction === 'left' ? (
|
|
||||||
<ArrowLeftIcon className="w-4" />
|
|
||||||
) : (
|
|
||||||
<ArrowRightIcon className="w-4" />
|
|
||||||
);
|
|
||||||
|
|
||||||
return isDisabled ? (
|
|
||||||
<div className={className}>{icon}</div>
|
|
||||||
) : (
|
|
||||||
<Link className={className} href={href}>
|
|
||||||
{icon}
|
|
||||||
</Link>
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 2024 Manuel Bustillo*/
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
import Skeleton from '@/app/ui/skeleton';
|
import Skeleton from '@/app/ui/skeleton';
|
||||||
|
|
||||||
|
@ -1,31 +0,0 @@
|
|||||||
/* Copyright (C) 2024 Manuel Bustillo*/
|
|
||||||
|
|
||||||
import { CheckIcon, ClockIcon } from '@heroicons/react/24/outline';
|
|
||||||
import clsx from 'clsx';
|
|
||||||
|
|
||||||
export default function gueststatus({ status }: { status: string }) {
|
|
||||||
return (
|
|
||||||
<span
|
|
||||||
className={clsx(
|
|
||||||
'inline-flex items-center rounded-full px-2 py-1 text-xs',
|
|
||||||
{
|
|
||||||
'bg-gray-100 text-gray-500': status === 'pending',
|
|
||||||
'bg-green-500 text-white': status === 'paid',
|
|
||||||
},
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
{status === 'pending' ? (
|
|
||||||
<>
|
|
||||||
Pending
|
|
||||||
<ClockIcon className="ml-1 w-4 text-gray-500" />
|
|
||||||
</>
|
|
||||||
) : null}
|
|
||||||
{status === 'paid' ? (
|
|
||||||
<>
|
|
||||||
Paid
|
|
||||||
<CheckIcon className="ml-1 w-4 text-white" />
|
|
||||||
</>
|
|
||||||
) : null}
|
|
||||||
</span>
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,83 +1,32 @@
|
|||||||
/* Copyright (C) 2024 Manuel Bustillo*/
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
|
import { AbstractApi } from '@/app/api/abstract-api';
|
||||||
|
import { Guest , GuestSerializer} from '@/app/lib/guest';
|
||||||
|
import { PencilIcon, TrashIcon } from '@heroicons/react/24/outline';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import React, { useState, useEffect } from 'react';
|
import TableOfContents from '../components/table-of-contents';
|
||||||
import { Guest } from '@/app/lib/definitions';
|
|
||||||
import { getCsrfToken } from '@/app/lib/utils';
|
|
||||||
import {classNames} from '@/app/ui/components/button';
|
|
||||||
|
|
||||||
export default function guestsTable() {
|
export default function guestsTable({ guests, onUpdate, onEdit }: {
|
||||||
const [guests, setGuests] = useState<Array<Guest>>([]);
|
guests: Guest[],
|
||||||
|
onUpdate: () => void,
|
||||||
|
onEdit: (guest: Guest) => void
|
||||||
|
}) {
|
||||||
|
|
||||||
function loadGuests() {
|
const api = new AbstractApi<Guest>();
|
||||||
fetch("/api/guests.json")
|
const serializer = new GuestSerializer();
|
||||||
.then((response) => response.json())
|
|
||||||
.then((data) => {
|
|
||||||
setGuests(data.data.map((record: any) => {
|
|
||||||
return ({
|
|
||||||
id: record.id,
|
|
||||||
name: record.attributes.name,
|
|
||||||
group_name: record.attributes.group_name,
|
|
||||||
status: record.attributes.status
|
|
||||||
});
|
|
||||||
}));
|
|
||||||
}, (error) => {
|
|
||||||
return [];
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleInviteGuest = (e: React.MouseEvent<HTMLElement>) => handleGuestChange(e, 'invited');
|
|
||||||
const handleConfirmGuest = (e: React.MouseEvent<HTMLElement>) => handleGuestChange(e, 'confirmed');
|
|
||||||
const handleDeclineGuest = (e: React.MouseEvent<HTMLElement>) => handleGuestChange(e, 'declined');
|
|
||||||
const handleTentativeGuest = (e: React.MouseEvent<HTMLElement>) => handleGuestChange(e, 'tentative');
|
|
||||||
|
|
||||||
const handleGuestChange = (e: React.MouseEvent<HTMLElement>, status:string) => {
|
|
||||||
fetch("/api/guests/bulk_update.json",
|
|
||||||
{
|
|
||||||
method: 'POST',
|
|
||||||
body: JSON.stringify({ properties: { status: status }, guest_ids: [e.currentTarget.getAttribute('data-guest-id')] }),
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
'X-CSRF-TOKEN': getCsrfToken(),
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.then(() => loadGuests())
|
|
||||||
.catch((error) => console.error(error));
|
|
||||||
}
|
|
||||||
|
|
||||||
guests.length === 0 && loadGuests();
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="w-full relative overflow-x-auto shadow-md sm:rounded-lg">
|
<TableOfContents
|
||||||
<table className="w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400">
|
headers={['Name', 'Group', 'Status', 'Actions']}
|
||||||
<caption className="p-5 text-lg font-semibold text-left rtl:text-right text-gray-900 bg-white dark:text-white dark:bg-gray-800">
|
caption='Guests'
|
||||||
Guests
|
elements={guests}
|
||||||
<p className="mt-1 text-sm font-normal text-gray-500 dark:text-gray-400">
|
rowRender={(guest) => (
|
||||||
There are {guests.length} guests in the list
|
|
||||||
</p>
|
|
||||||
</caption>
|
|
||||||
<thead className="text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400">
|
|
||||||
<tr>
|
|
||||||
<th scope="col" className="px-6 py-3">
|
|
||||||
Name
|
|
||||||
</th>
|
|
||||||
<th scope="col" className="px-6 py-3">
|
|
||||||
Group
|
|
||||||
</th>
|
|
||||||
<th scope="col" className="px-6 py-3">
|
|
||||||
Status
|
|
||||||
</th>
|
|
||||||
<th>Actions</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{guests.map((guest) => (
|
|
||||||
<tr key={guest.id} className="bg-white border-b odd:bg-white odd:dark:bg-gray-900 even:bg-gray-50 even:dark:bg-gray-800">
|
<tr key={guest.id} className="bg-white border-b odd:bg-white odd:dark:bg-gray-900 even:bg-gray-50 even:dark:bg-gray-800">
|
||||||
<th scope="row" className="px-6 py-4 font-medium text-gray-900 whitespace-nowrap dark:text-white">
|
<td scope="row" className="px-6 py-4 font-medium text-gray-900 whitespace-nowrap dark:text-white">
|
||||||
{guest.name}
|
{guest.name}
|
||||||
</th>
|
</td>
|
||||||
<td className="px-6 py-4">
|
<td className="px-6 py-4">
|
||||||
{guest.group_name}
|
{guest.group_name}
|
||||||
</td>
|
</td>
|
||||||
@ -86,11 +35,11 @@ export default function guestsTable() {
|
|||||||
<span className={clsx(
|
<span className={clsx(
|
||||||
'flex w-2.5 h-2.5 rounded-full me-1.5 flex-shrink-0',
|
'flex w-2.5 h-2.5 rounded-full me-1.5 flex-shrink-0',
|
||||||
{
|
{
|
||||||
'bg-gray-400': guest.status === 'Considered',
|
'bg-gray-400': guest.status === 'considered',
|
||||||
'bg-blue-400': guest.status === 'Invited',
|
'bg-blue-400': guest.status === 'invited',
|
||||||
'bg-green-600': guest.status === 'Confirmed',
|
'bg-green-600': guest.status === 'confirmed',
|
||||||
'bg-red-400': guest.status === 'Declined',
|
'bg-red-400': guest.status === 'declined',
|
||||||
'bg-yellow-400': guest.status === 'Tentative',
|
'bg-yellow-400': guest.status === 'tentative',
|
||||||
}
|
}
|
||||||
)}>
|
)}>
|
||||||
</span>
|
</span>
|
||||||
@ -98,21 +47,13 @@ export default function guestsTable() {
|
|||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{guest.status === 'Considered' && (<button data-guest-id={guest.id} onClick={handleInviteGuest} className={classNames('blue')}>
|
<div className="flex flex-row items-center">
|
||||||
Invite
|
<TrashIcon className='size-6 cursor-pointer' onClick={() => { api.destroy(serializer, guest, onUpdate)}} />
|
||||||
</button>)}
|
<PencilIcon className='size-6 cursor-pointer' onClick={() => onEdit(guest)} />
|
||||||
{(guest.status === 'Invited' || guest.status === 'Tentative') && (
|
</div>
|
||||||
<>
|
|
||||||
<button data-guest-id={guest.id} onClick={handleConfirmGuest} className={classNames('green')}>Confirm</button>
|
|
||||||
{guest.status != 'Tentative' && <button data-guest-id={guest.id} onClick={handleDeclineGuest} className={classNames('yellow')}>Tentative</button>}
|
|
||||||
<button data-guest-id={guest.id} onClick={handleDeclineGuest} className={classNames('red')}>Decline</button>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
))}
|
)}
|
||||||
</tbody>
|
/>
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,69 +0,0 @@
|
|||||||
/* Copyright (C) 2024 Manuel Bustillo*/
|
|
||||||
|
|
||||||
import { lusitana } from '@/app/ui/fonts';
|
|
||||||
import {
|
|
||||||
AtSymbolIcon,
|
|
||||||
KeyIcon,
|
|
||||||
ExclamationCircleIcon,
|
|
||||||
} from '@heroicons/react/24/outline';
|
|
||||||
import { ArrowRightIcon } from '@heroicons/react/20/solid';
|
|
||||||
import { Button } from './button';
|
|
||||||
|
|
||||||
export default function LoginForm() {
|
|
||||||
return (
|
|
||||||
<form className="space-y-3">
|
|
||||||
<div className="flex-1 rounded-lg bg-gray-50 px-6 pb-4 pt-8">
|
|
||||||
<h1 className={`${lusitana.className} mb-3 text-2xl`}>
|
|
||||||
Please log in to continue.
|
|
||||||
</h1>
|
|
||||||
<div className="w-full">
|
|
||||||
<div>
|
|
||||||
<label
|
|
||||||
className="mb-3 mt-5 block text-xs font-medium text-gray-900"
|
|
||||||
htmlFor="email"
|
|
||||||
>
|
|
||||||
Email
|
|
||||||
</label>
|
|
||||||
<div className="relative">
|
|
||||||
<input
|
|
||||||
className="peer block w-full rounded-md border border-gray-200 py-[9px] pl-10 text-sm outline-2 placeholder:text-gray-500"
|
|
||||||
id="email"
|
|
||||||
type="email"
|
|
||||||
name="email"
|
|
||||||
placeholder="Enter your email address"
|
|
||||||
required
|
|
||||||
/>
|
|
||||||
<AtSymbolIcon className="pointer-events-none absolute left-3 top-1/2 h-[18px] w-[18px] -translate-y-1/2 text-gray-500 peer-focus:text-gray-900" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="mt-4">
|
|
||||||
<label
|
|
||||||
className="mb-3 mt-5 block text-xs font-medium text-gray-900"
|
|
||||||
htmlFor="password"
|
|
||||||
>
|
|
||||||
Password
|
|
||||||
</label>
|
|
||||||
<div className="relative">
|
|
||||||
<input
|
|
||||||
className="peer block w-full rounded-md border border-gray-200 py-[9px] pl-10 text-sm outline-2 placeholder:text-gray-500"
|
|
||||||
id="password"
|
|
||||||
type="password"
|
|
||||||
name="password"
|
|
||||||
placeholder="Enter password"
|
|
||||||
required
|
|
||||||
minLength={6}
|
|
||||||
/>
|
|
||||||
<KeyIcon className="pointer-events-none absolute left-3 top-1/2 h-[18px] w-[18px] -translate-y-1/2 text-gray-500 peer-focus:text-gray-900" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<Button className="mt-4 w-full">
|
|
||||||
Log in <ArrowRightIcon className="ml-auto h-5 w-5 text-gray-50" />
|
|
||||||
</Button>
|
|
||||||
<div className="flex h-8 items-end space-x-1">
|
|
||||||
{/* Add form errors here */}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 2024 Manuel Bustillo*/
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 2024 Manuel Bustillo*/
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
||||||
|
|
||||||
export default function Skeleton({ className }: { className: string }) {
|
export default function Skeleton({ className }: { className: string }) {
|
||||||
return <div className={`bg-slate-200 motion-safe:animate-pulse rounded ${className}`} />;
|
return <div className={`bg-slate-200 motion-safe:animate-pulse rounded ${className}`} />;
|
||||||
|
18
package.json
18
package.json
@ -11,26 +11,28 @@
|
|||||||
"autoprefixer": "10.4.20",
|
"autoprefixer": "10.4.20",
|
||||||
"bcrypt": "^5.1.1",
|
"bcrypt": "^5.1.1",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
"next": "15.0.2",
|
"next": "15.1.4",
|
||||||
"next-auth": "5.0.0-beta.25",
|
"next-auth": "5.0.0-beta.25",
|
||||||
"postcss": "8.4.47",
|
"postcss": "8.5.1",
|
||||||
"primeicons": "^7.0.0",
|
"primeicons": "^7.0.0",
|
||||||
"primereact": "^10.8.2",
|
"primereact": "^10.8.2",
|
||||||
"react": "19.0.0-rc-f38c22b244-20240704",
|
"react": "19.0.0-rc-f38c22b244-20240704",
|
||||||
"react-dom": "19.0.0-rc-f38c22b244-20240704",
|
"react-dom": "19.0.0-rc-f38c22b244-20240704",
|
||||||
"tailwindcss": "3.4.14",
|
"tailwindcss": "3.4.17",
|
||||||
"typescript": "5.6.3",
|
"typescript": "5.7.3",
|
||||||
"use-debounce": "^10.0.1",
|
"use-debounce": "^10.0.1",
|
||||||
|
"uuid": "11.0.5",
|
||||||
"zod": "^3.23.8"
|
"zod": "^3.23.8"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@playwright/test": "^1.46.0",
|
"@playwright/test": "^1.46.0",
|
||||||
"@types/bcrypt": "^5.0.2",
|
"@types/bcrypt": "^5.0.2",
|
||||||
"@types/node": "22.8.6",
|
"@types/node": "22.10.7",
|
||||||
"@types/react": "18.3.12",
|
"@types/react": "18.3.18",
|
||||||
"@types/react-dom": "18.3.1"
|
"@types/react-dom": "18.3.5"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=23.0.0"
|
"node": ">=23.0.0"
|
||||||
}
|
},
|
||||||
|
"packageManager": "pnpm@9.15.4+sha512.b2dc20e2fc72b3e18848459b37359a32064663e5627a51e4c74b2c29dd8e8e0491483c3abb40789cfd578bf362fb6ba8261b05f0387d76792ed6e23ea3b1b6a0"
|
||||||
}
|
}
|
||||||
|
386
pnpm-lock.yaml
generated
386
pnpm-lock.yaml
generated
@ -10,13 +10,13 @@ importers:
|
|||||||
dependencies:
|
dependencies:
|
||||||
'@heroicons/react':
|
'@heroicons/react':
|
||||||
specifier: ^2.1.4
|
specifier: ^2.1.4
|
||||||
version: 2.1.5(react@19.0.0-rc-f38c22b244-20240704)
|
version: 2.2.0(react@19.0.0-rc-f38c22b244-20240704)
|
||||||
'@tailwindcss/forms':
|
'@tailwindcss/forms':
|
||||||
specifier: ^0.5.7
|
specifier: ^0.5.7
|
||||||
version: 0.5.9(tailwindcss@3.4.14)
|
version: 0.5.10(tailwindcss@3.4.17)
|
||||||
autoprefixer:
|
autoprefixer:
|
||||||
specifier: 10.4.20
|
specifier: 10.4.20
|
||||||
version: 10.4.20(postcss@8.4.47)
|
version: 10.4.20(postcss@8.5.1)
|
||||||
bcrypt:
|
bcrypt:
|
||||||
specifier: ^5.1.1
|
specifier: ^5.1.1
|
||||||
version: 5.1.1
|
version: 5.1.1
|
||||||
@ -24,20 +24,20 @@ importers:
|
|||||||
specifier: ^2.1.1
|
specifier: ^2.1.1
|
||||||
version: 2.1.1
|
version: 2.1.1
|
||||||
next:
|
next:
|
||||||
specifier: 15.0.2
|
specifier: 15.1.4
|
||||||
version: 15.0.2(@playwright/test@1.48.2)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704)
|
version: 15.1.4(@playwright/test@1.49.1)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704)
|
||||||
next-auth:
|
next-auth:
|
||||||
specifier: 5.0.0-beta.25
|
specifier: 5.0.0-beta.25
|
||||||
version: 5.0.0-beta.25(next@15.0.2(@playwright/test@1.48.2)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704)
|
version: 5.0.0-beta.25(next@15.1.4(@playwright/test@1.49.1)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704)
|
||||||
postcss:
|
postcss:
|
||||||
specifier: 8.4.47
|
specifier: 8.5.1
|
||||||
version: 8.4.47
|
version: 8.5.1
|
||||||
primeicons:
|
primeicons:
|
||||||
specifier: ^7.0.0
|
specifier: ^7.0.0
|
||||||
version: 7.0.0
|
version: 7.0.0
|
||||||
primereact:
|
primereact:
|
||||||
specifier: ^10.8.2
|
specifier: ^10.8.2
|
||||||
version: 10.8.4(@types/react@18.3.12)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704)
|
version: 10.9.1(@types/react@18.3.18)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704)
|
||||||
react:
|
react:
|
||||||
specifier: 19.0.0-rc-f38c22b244-20240704
|
specifier: 19.0.0-rc-f38c22b244-20240704
|
||||||
version: 19.0.0-rc-f38c22b244-20240704
|
version: 19.0.0-rc-f38c22b244-20240704
|
||||||
@ -45,33 +45,36 @@ importers:
|
|||||||
specifier: 19.0.0-rc-f38c22b244-20240704
|
specifier: 19.0.0-rc-f38c22b244-20240704
|
||||||
version: 19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704)
|
version: 19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704)
|
||||||
tailwindcss:
|
tailwindcss:
|
||||||
specifier: 3.4.14
|
specifier: 3.4.17
|
||||||
version: 3.4.14
|
version: 3.4.17
|
||||||
typescript:
|
typescript:
|
||||||
specifier: 5.6.3
|
specifier: 5.7.3
|
||||||
version: 5.6.3
|
version: 5.7.3
|
||||||
use-debounce:
|
use-debounce:
|
||||||
specifier: ^10.0.1
|
specifier: ^10.0.1
|
||||||
version: 10.0.4(react@19.0.0-rc-f38c22b244-20240704)
|
version: 10.0.4(react@19.0.0-rc-f38c22b244-20240704)
|
||||||
|
uuid:
|
||||||
|
specifier: 11.0.5
|
||||||
|
version: 11.0.5
|
||||||
zod:
|
zod:
|
||||||
specifier: ^3.23.8
|
specifier: ^3.23.8
|
||||||
version: 3.23.8
|
version: 3.24.1
|
||||||
devDependencies:
|
devDependencies:
|
||||||
'@playwright/test':
|
'@playwright/test':
|
||||||
specifier: ^1.46.0
|
specifier: ^1.46.0
|
||||||
version: 1.48.2
|
version: 1.49.1
|
||||||
'@types/bcrypt':
|
'@types/bcrypt':
|
||||||
specifier: ^5.0.2
|
specifier: ^5.0.2
|
||||||
version: 5.0.2
|
version: 5.0.2
|
||||||
'@types/node':
|
'@types/node':
|
||||||
specifier: 22.8.6
|
specifier: 22.10.7
|
||||||
version: 22.8.6
|
version: 22.10.7
|
||||||
'@types/react':
|
'@types/react':
|
||||||
specifier: 18.3.12
|
specifier: 18.3.18
|
||||||
version: 18.3.12
|
version: 18.3.18
|
||||||
'@types/react-dom':
|
'@types/react-dom':
|
||||||
specifier: 18.3.1
|
specifier: 18.3.5
|
||||||
version: 18.3.1
|
version: 18.3.5(@types/react@18.3.18)
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
|
|
||||||
@ -93,17 +96,17 @@ packages:
|
|||||||
nodemailer:
|
nodemailer:
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@babel/runtime@7.25.7':
|
'@babel/runtime@7.26.0':
|
||||||
resolution: {integrity: sha512-FjoyLe754PMiYsFaN5C94ttGiOmBNYTf6pLr4xXHAT5uctHb092PBszndLDR5XA/jghQvn4n7JMHl7dmTgbm9w==}
|
resolution: {integrity: sha512-FDSOghenHTiToteC/QRlv2q3DhPZ/oOXTBoirfWNx1Cx3TMVcGWQtMMmQcSvb/JjpNeGzx8Pq/b4fKEJuWm1sw==}
|
||||||
engines: {node: '>=6.9.0'}
|
engines: {node: '>=6.9.0'}
|
||||||
|
|
||||||
'@emnapi/runtime@1.2.0':
|
'@emnapi/runtime@1.2.0':
|
||||||
resolution: {integrity: sha512-bV21/9LQmcQeCPEg3BDFtvwL6cwiTMksYNWQQ4KOxCZikEGalWtenoZ0wCiukJINlGCIi2KXx01g4FoH/LxpzQ==}
|
resolution: {integrity: sha512-bV21/9LQmcQeCPEg3BDFtvwL6cwiTMksYNWQQ4KOxCZikEGalWtenoZ0wCiukJINlGCIi2KXx01g4FoH/LxpzQ==}
|
||||||
|
|
||||||
'@heroicons/react@2.1.5':
|
'@heroicons/react@2.2.0':
|
||||||
resolution: {integrity: sha512-FuzFN+BsHa+7OxbvAERtgBTNeZpUjgM/MIizfVkSCL2/edriN0Hx/DWRCR//aPYwO5QX/YlgLGXk+E3PcfZwjA==}
|
resolution: {integrity: sha512-LMcepvRaS9LYHJGsF0zzmgKCUim/X3N/DQKc4jepAXJ7l8QxJ1PmxJzqplF2Z3FE4PqBAIGyJAQ/w4B5dsqbtQ==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
react: '>= 16'
|
react: '>= 16 || ^19.0.0-rc'
|
||||||
|
|
||||||
'@img/sharp-darwin-arm64@0.33.5':
|
'@img/sharp-darwin-arm64@0.33.5':
|
||||||
resolution: {integrity: sha512-UT4p+iz/2H4twwAoLCqfA9UH5pI6DggwKEGuaPy7nCVQ8ZsiY5PIcrRvD1DzuY3qYL07NtIQcWnBSY/heikIFQ==}
|
resolution: {integrity: sha512-UT4p+iz/2H4twwAoLCqfA9UH5pI6DggwKEGuaPy7nCVQ8ZsiY5PIcrRvD1DzuY3qYL07NtIQcWnBSY/heikIFQ==}
|
||||||
@ -236,53 +239,53 @@ packages:
|
|||||||
resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==}
|
resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
||||||
'@next/env@15.0.2':
|
'@next/env@15.1.4':
|
||||||
resolution: {integrity: sha512-c0Zr0ModK5OX7D4ZV8Jt/wqoXtitLNPwUfG9zElCZztdaZyNVnN40rDXVZ/+FGuR4CcNV5AEfM6N8f+Ener7Dg==}
|
resolution: {integrity: sha512-2fZ5YZjedi5AGaeoaC0B20zGntEHRhi2SdWcu61i48BllODcAmmtj8n7YarSPt4DaTsJaBFdxQAVEVzgmx2Zpw==}
|
||||||
|
|
||||||
'@next/swc-darwin-arm64@15.0.2':
|
'@next/swc-darwin-arm64@15.1.4':
|
||||||
resolution: {integrity: sha512-GK+8w88z+AFlmt+ondytZo2xpwlfAR8U6CRwXancHImh6EdGfHMIrTSCcx5sOSBei00GyLVL0ioo1JLKTfprgg==}
|
resolution: {integrity: sha512-wBEMBs+np+R5ozN1F8Y8d/Dycns2COhRnkxRc+rvnbXke5uZBHkUGFgWxfTXn5rx7OLijuUhyfB+gC/ap58dDw==}
|
||||||
engines: {node: '>= 10'}
|
engines: {node: '>= 10'}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [darwin]
|
os: [darwin]
|
||||||
|
|
||||||
'@next/swc-darwin-x64@15.0.2':
|
'@next/swc-darwin-x64@15.1.4':
|
||||||
resolution: {integrity: sha512-KUpBVxIbjzFiUZhiLIpJiBoelqzQtVZbdNNsehhUn36e2YzKHphnK8eTUW1s/4aPy5kH/UTid8IuVbaOpedhpw==}
|
resolution: {integrity: sha512-7sgf5rM7Z81V9w48F02Zz6DgEJulavC0jadab4ZsJ+K2sxMNK0/BtF8J8J3CxnsJN3DGcIdC260wEKssKTukUw==}
|
||||||
engines: {node: '>= 10'}
|
engines: {node: '>= 10'}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [darwin]
|
os: [darwin]
|
||||||
|
|
||||||
'@next/swc-linux-arm64-gnu@15.0.2':
|
'@next/swc-linux-arm64-gnu@15.1.4':
|
||||||
resolution: {integrity: sha512-9J7TPEcHNAZvwxXRzOtiUvwtTD+fmuY0l7RErf8Yyc7kMpE47MIQakl+3jecmkhOoIyi/Rp+ddq7j4wG6JDskQ==}
|
resolution: {integrity: sha512-JaZlIMNaJenfd55kjaLWMfok+vWBlcRxqnRoZrhFQrhM1uAehP3R0+Aoe+bZOogqlZvAz53nY/k3ZyuKDtT2zQ==}
|
||||||
engines: {node: '>= 10'}
|
engines: {node: '>= 10'}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
|
||||||
'@next/swc-linux-arm64-musl@15.0.2':
|
'@next/swc-linux-arm64-musl@15.1.4':
|
||||||
resolution: {integrity: sha512-BjH4ZSzJIoTTZRh6rG+a/Ry4SW0HlizcPorqNBixBWc3wtQtj4Sn9FnRZe22QqrPnzoaW0ctvSz4FaH4eGKMww==}
|
resolution: {integrity: sha512-7EBBjNoyTO2ipMDgCiORpwwOf5tIueFntKjcN3NK+GAQD7OzFJe84p7a2eQUeWdpzZvhVXuAtIen8QcH71ZCOQ==}
|
||||||
engines: {node: '>= 10'}
|
engines: {node: '>= 10'}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
|
||||||
'@next/swc-linux-x64-gnu@15.0.2':
|
'@next/swc-linux-x64-gnu@15.1.4':
|
||||||
resolution: {integrity: sha512-i3U2TcHgo26sIhcwX/Rshz6avM6nizrZPvrDVDY1bXcLH1ndjbO8zuC7RoHp0NSK7wjJMPYzm7NYL1ksSKFreA==}
|
resolution: {integrity: sha512-9TGEgOycqZFuADyFqwmK/9g6S0FYZ3tphR4ebcmCwhL8Y12FW8pIBKJvSwV+UBjMkokstGNH+9F8F031JZKpHw==}
|
||||||
engines: {node: '>= 10'}
|
engines: {node: '>= 10'}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
|
||||||
'@next/swc-linux-x64-musl@15.0.2':
|
'@next/swc-linux-x64-musl@15.1.4':
|
||||||
resolution: {integrity: sha512-AMfZfSVOIR8fa+TXlAooByEF4OB00wqnms1sJ1v+iu8ivwvtPvnkwdzzFMpsK5jA2S9oNeeQ04egIWVb4QWmtQ==}
|
resolution: {integrity: sha512-0578bLRVDJOh+LdIoKvgNDz77+Bd85c5JrFgnlbI1SM3WmEQvsjxTA8ATu9Z9FCiIS/AliVAW2DV/BDwpXbtiQ==}
|
||||||
engines: {node: '>= 10'}
|
engines: {node: '>= 10'}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
|
||||||
'@next/swc-win32-arm64-msvc@15.0.2':
|
'@next/swc-win32-arm64-msvc@15.1.4':
|
||||||
resolution: {integrity: sha512-JkXysDT0/hEY47O+Hvs8PbZAeiCQVxKfGtr4GUpNAhlG2E0Mkjibuo8ryGD29Qb5a3IOnKYNoZlh/MyKd2Nbww==}
|
resolution: {integrity: sha512-JgFCiV4libQavwII+kncMCl30st0JVxpPOtzWcAI2jtum4HjYaclobKhj+JsRu5tFqMtA5CJIa0MvYyuu9xjjQ==}
|
||||||
engines: {node: '>= 10'}
|
engines: {node: '>= 10'}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [win32]
|
os: [win32]
|
||||||
|
|
||||||
'@next/swc-win32-x64-msvc@15.0.2':
|
'@next/swc-win32-x64-msvc@15.1.4':
|
||||||
resolution: {integrity: sha512-foaUL0NqJY/dX0Pi/UcZm5zsmSk5MtP/gxx3xOPyREkMFN+CTjctPfu3QaqrQHinaKdPnMWPJDKt4VjDfTBe/Q==}
|
resolution: {integrity: sha512-xxsJy9wzq7FR5SqPCUqdgSXiNXrMuidgckBa8nH9HtjjxsilgcN6VgXF6tZ3uEWuVEadotQJI8/9EQ6guTC4Yw==}
|
||||||
engines: {node: '>= 10'}
|
engines: {node: '>= 10'}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [win32]
|
os: [win32]
|
||||||
@ -306,21 +309,21 @@ packages:
|
|||||||
resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==}
|
resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==}
|
||||||
engines: {node: '>=14'}
|
engines: {node: '>=14'}
|
||||||
|
|
||||||
'@playwright/test@1.48.2':
|
'@playwright/test@1.49.1':
|
||||||
resolution: {integrity: sha512-54w1xCWfXuax7dz4W2M9uw0gDyh+ti/0K/MxcCUxChFh37kkdxPdfZDw5QBbuPUJHr1CiHJ1hXgSs+GgeQc5Zw==}
|
resolution: {integrity: sha512-Ky+BVzPz8pL6PQxHqNRW1k3mIyv933LML7HktS8uik0bUXNCdPhoS/kLihiO1tMf/egaJb4IutXd7UywvXEW+g==}
|
||||||
engines: {node: '>=18'}
|
engines: {node: '>=18'}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
||||||
'@swc/counter@0.1.3':
|
'@swc/counter@0.1.3':
|
||||||
resolution: {integrity: sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==}
|
resolution: {integrity: sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==}
|
||||||
|
|
||||||
'@swc/helpers@0.5.13':
|
'@swc/helpers@0.5.15':
|
||||||
resolution: {integrity: sha512-UoKGxQ3r5kYI9dALKJapMmuK+1zWM/H17Z1+iwnNmzcJRnfFuevZs375TA5rW31pu4BS4NoSy1fRsexDXfWn5w==}
|
resolution: {integrity: sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==}
|
||||||
|
|
||||||
'@tailwindcss/forms@0.5.9':
|
'@tailwindcss/forms@0.5.10':
|
||||||
resolution: {integrity: sha512-tM4XVr2+UVTxXJzey9Twx48c1gcxFStqn1pQz0tRsX8o3DvxhN5oY5pvyAbUx7VTaZxpej4Zzvc6h+1RJBzpIg==}
|
resolution: {integrity: sha512-utI1ONF6uf/pPNO68kmN1b8rEwNXv3czukalo8VtJH8ksIkZXr3Q3VYudZLkCsDd4Wku120uF02hYK25XGPorw==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
tailwindcss: '>=3.0.0 || >= 3.0.0-alpha.1 || >= 4.0.0-alpha.20'
|
tailwindcss: '>=3.0.0 || >= 3.0.0-alpha.1 || >= 4.0.0-alpha.20 || >= 4.0.0-beta.1'
|
||||||
|
|
||||||
'@types/bcrypt@5.0.2':
|
'@types/bcrypt@5.0.2':
|
||||||
resolution: {integrity: sha512-6atioO8Y75fNcbmj0G7UjI9lXN2pQ/IGJ2FWT4a/btd0Lk9lQalHLKhkgKVZ3r+spnmWUKfbMi1GEe9wyHQfNQ==}
|
resolution: {integrity: sha512-6atioO8Y75fNcbmj0G7UjI9lXN2pQ/IGJ2FWT4a/btd0Lk9lQalHLKhkgKVZ3r+spnmWUKfbMi1GEe9wyHQfNQ==}
|
||||||
@ -328,20 +331,24 @@ packages:
|
|||||||
'@types/cookie@0.6.0':
|
'@types/cookie@0.6.0':
|
||||||
resolution: {integrity: sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==}
|
resolution: {integrity: sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==}
|
||||||
|
|
||||||
'@types/node@22.8.6':
|
'@types/node@22.10.7':
|
||||||
resolution: {integrity: sha512-tosuJYKrIqjQIlVCM4PEGxOmyg3FCPa/fViuJChnGeEIhjA46oy8FMVoF9su1/v8PNs2a8Q0iFNyOx0uOF91nw==}
|
resolution: {integrity: sha512-V09KvXxFiutGp6B7XkpaDXlNadZxrzajcY50EuoLIpQ6WWYCSvf19lVIazzfIzQvhUN2HjX12spLojTnhuKlGg==}
|
||||||
|
|
||||||
'@types/prop-types@15.7.12':
|
'@types/prop-types@15.7.12':
|
||||||
resolution: {integrity: sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q==}
|
resolution: {integrity: sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q==}
|
||||||
|
|
||||||
'@types/react-dom@18.3.1':
|
'@types/react-dom@18.3.5':
|
||||||
resolution: {integrity: sha512-qW1Mfv8taImTthu4KoXgDfLuk4bydU6Q/TkADnDWWHwi4NX4BR+LWfTp2sVmTqRrsHvyDDTelgelxJ+SsejKKQ==}
|
resolution: {integrity: sha512-P4t6saawp+b/dFrUr2cvkVsfvPguwsxtH6dNIYRllMsefqFzkZk5UIjzyDOv5g1dXIPdG4Sp1yCR4Z6RCUsG/Q==}
|
||||||
|
peerDependencies:
|
||||||
|
'@types/react': ^18.0.0
|
||||||
|
|
||||||
'@types/react-transition-group@4.4.11':
|
'@types/react-transition-group@4.4.12':
|
||||||
resolution: {integrity: sha512-RM05tAniPZ5DZPzzNFP+DmrcOdD0efDUxMy3145oljWSl3x9ZV5vhme98gTxFrj2lhXvmGNnUiuDyJgY9IKkNA==}
|
resolution: {integrity: sha512-8TV6R3h2j7a91c+1DXdJi3Syo69zzIZbz7Lg5tORM5LEJG7X/E6a1V3drRyBRZq7/utz7A+c4OgYLiLcYGHG6w==}
|
||||||
|
peerDependencies:
|
||||||
|
'@types/react': '*'
|
||||||
|
|
||||||
'@types/react@18.3.12':
|
'@types/react@18.3.18':
|
||||||
resolution: {integrity: sha512-D2wOSq/d6Agt28q7rSI3jhU7G6aiuzljDGZ2hTZHIkrTLUI+AF3WMeKkEZ9nN2fkBAlcktT6vcZjDFiIhMYEQw==}
|
resolution: {integrity: sha512-t4yC+vtgnkYjNSKlFx1jkAhH8LgTo2N/7Qvi83kdEaUtMDiwpbLAktKDaAMlRcJ5eSxZkH74eEGt1ky31d7kfQ==}
|
||||||
|
|
||||||
abbrev@1.1.1:
|
abbrev@1.1.1:
|
||||||
resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==}
|
resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==}
|
||||||
@ -639,8 +646,8 @@ packages:
|
|||||||
resolution: {integrity: sha512-htOzIMPbpLid/Gq9/zaz9SfExABxqRe1sSCdxntlO/aMD6u0issZQiY25n2GKQUtJ02j7z5sfptlAOMpWWOmvw==}
|
resolution: {integrity: sha512-htOzIMPbpLid/Gq9/zaz9SfExABxqRe1sSCdxntlO/aMD6u0issZQiY25n2GKQUtJ02j7z5sfptlAOMpWWOmvw==}
|
||||||
engines: {node: '>=14'}
|
engines: {node: '>=14'}
|
||||||
|
|
||||||
jiti@1.21.0:
|
jiti@1.21.6:
|
||||||
resolution: {integrity: sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q==}
|
resolution: {integrity: sha512-2yTgeWTWzMWkHu6Jp9NKgePDaYHbntiwvYuuJLbbN9vl7DC9DvXKOB2BC3ZZ92D3cvV/aflH0osDfwpHepQ53w==}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
||||||
jose@5.9.6:
|
jose@5.9.6:
|
||||||
@ -649,12 +656,8 @@ packages:
|
|||||||
js-tokens@4.0.0:
|
js-tokens@4.0.0:
|
||||||
resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==}
|
resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==}
|
||||||
|
|
||||||
lilconfig@2.1.0:
|
lilconfig@3.1.3:
|
||||||
resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==}
|
resolution: {integrity: sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==}
|
||||||
engines: {node: '>=10'}
|
|
||||||
|
|
||||||
lilconfig@3.1.1:
|
|
||||||
resolution: {integrity: sha512-O18pf7nyvHTckunPWCV1XUNXU1piu01y2b7ATJ0ppkUkk8ocqVWBrYjJBCwHDjD/ZWcfyrA0P4gKhzWGi5EINQ==}
|
|
||||||
engines: {node: '>=14'}
|
engines: {node: '>=14'}
|
||||||
|
|
||||||
lines-and-columns@1.2.4:
|
lines-and-columns@1.2.4:
|
||||||
@ -676,8 +679,8 @@ packages:
|
|||||||
resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==}
|
resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==}
|
||||||
engines: {node: '>= 8'}
|
engines: {node: '>= 8'}
|
||||||
|
|
||||||
micromatch@4.0.7:
|
micromatch@4.0.8:
|
||||||
resolution: {integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==}
|
resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==}
|
||||||
engines: {node: '>=8.6'}
|
engines: {node: '>=8.6'}
|
||||||
|
|
||||||
mini-svg-data-uri@1.4.4:
|
mini-svg-data-uri@1.4.4:
|
||||||
@ -723,6 +726,11 @@ packages:
|
|||||||
engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
|
engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
||||||
|
nanoid@3.3.8:
|
||||||
|
resolution: {integrity: sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==}
|
||||||
|
engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
|
||||||
|
hasBin: true
|
||||||
|
|
||||||
next-auth@5.0.0-beta.25:
|
next-auth@5.0.0-beta.25:
|
||||||
resolution: {integrity: sha512-2dJJw1sHQl2qxCrRk+KTQbeH+izFbGFPuJj5eGgBZFYyiYYtvlrBeUw1E/OJJxTRjuxbSYGnCTkUIRsIIW0bog==}
|
resolution: {integrity: sha512-2dJJw1sHQl2qxCrRk+KTQbeH+izFbGFPuJj5eGgBZFYyiYYtvlrBeUw1E/OJJxTRjuxbSYGnCTkUIRsIIW0bog==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
@ -739,16 +747,16 @@ packages:
|
|||||||
nodemailer:
|
nodemailer:
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
next@15.0.2:
|
next@15.1.4:
|
||||||
resolution: {integrity: sha512-rxIWHcAu4gGSDmwsELXacqAPUk+j8dV/A9cDF5fsiCMpkBDYkO2AEaL1dfD+nNmDiU6QMCFN8Q30VEKapT9UHQ==}
|
resolution: {integrity: sha512-mTaq9dwaSuwwOrcu3ebjDYObekkxRnXpuVL21zotM8qE2W0HBOdVIdg2Li9QjMEZrj73LN96LcWcz62V19FjAg==}
|
||||||
engines: {node: '>=18.18.0'}
|
engines: {node: ^18.18.0 || ^19.8.0 || >= 20.0.0}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
'@opentelemetry/api': ^1.1.0
|
'@opentelemetry/api': ^1.1.0
|
||||||
'@playwright/test': ^1.41.2
|
'@playwright/test': ^1.41.2
|
||||||
babel-plugin-react-compiler: '*'
|
babel-plugin-react-compiler: '*'
|
||||||
react: ^18.2.0 || 19.0.0-rc-02c0e824-20241028
|
react: ^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0
|
||||||
react-dom: ^18.2.0 || 19.0.0-rc-02c0e824-20241028
|
react-dom: ^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0
|
||||||
sass: ^1.3.0
|
sass: ^1.3.0
|
||||||
peerDependenciesMeta:
|
peerDependenciesMeta:
|
||||||
'@opentelemetry/api':
|
'@opentelemetry/api':
|
||||||
@ -824,8 +832,8 @@ packages:
|
|||||||
picocolors@1.0.1:
|
picocolors@1.0.1:
|
||||||
resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==}
|
resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==}
|
||||||
|
|
||||||
picocolors@1.1.0:
|
picocolors@1.1.1:
|
||||||
resolution: {integrity: sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==}
|
resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==}
|
||||||
|
|
||||||
picomatch@2.3.1:
|
picomatch@2.3.1:
|
||||||
resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==}
|
resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==}
|
||||||
@ -839,13 +847,13 @@ packages:
|
|||||||
resolution: {integrity: sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==}
|
resolution: {integrity: sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==}
|
||||||
engines: {node: '>= 6'}
|
engines: {node: '>= 6'}
|
||||||
|
|
||||||
playwright-core@1.48.2:
|
playwright-core@1.49.1:
|
||||||
resolution: {integrity: sha512-sjjw+qrLFlriJo64du+EK0kJgZzoQPsabGF4lBvsid+3CNIZIYLgnMj9V6JY5VhM2Peh20DJWIVpVljLLnlawA==}
|
resolution: {integrity: sha512-BzmpVcs4kE2CH15rWfzpjzVGhWERJfmnXmniSyKeRZUs9Ws65m+RGIi7mjJK/euCegfn3i7jvqWeWyHe9y3Vgg==}
|
||||||
engines: {node: '>=18'}
|
engines: {node: '>=18'}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
||||||
playwright@1.48.2:
|
playwright@1.49.1:
|
||||||
resolution: {integrity: sha512-NjYvYgp4BPmiwfe31j4gHLa3J7bD2WiBz8Lk2RoSsmX38SVIARZ18VYjxLjAcDsAhA+F4iSEXTSGgjua0rrlgQ==}
|
resolution: {integrity: sha512-VYL8zLoNTBxVOrJBbDuRgDWa3i+mfQgDTrL8Ah9QXZ7ax4Dsj0MSq5bYgytRnDVVe+njoKnfsYkH3HzqVj5UZA==}
|
||||||
engines: {node: '>=18'}
|
engines: {node: '>=18'}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
||||||
@ -873,14 +881,14 @@ packages:
|
|||||||
ts-node:
|
ts-node:
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
postcss-nested@6.0.1:
|
postcss-nested@6.2.0:
|
||||||
resolution: {integrity: sha512-mEp4xPMi5bSWiMbsgoPfcP74lsWLHkQbZc3sY+jWYd65CUwXrUaTp0fmNpa01ZcETKlIgUdFN/MpS2xZtqL9dQ==}
|
resolution: {integrity: sha512-HQbt28KulC5AJzG+cZtj9kvKB93CFCdLvog1WFLf1D+xmMvPGlBstkpTEZfK5+AN9hfJocyBFCNiqyS48bpgzQ==}
|
||||||
engines: {node: '>=12.0'}
|
engines: {node: '>=12.0'}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
postcss: ^8.2.14
|
postcss: ^8.2.14
|
||||||
|
|
||||||
postcss-selector-parser@6.1.0:
|
postcss-selector-parser@6.1.2:
|
||||||
resolution: {integrity: sha512-UMz42UD0UY0EApS0ZL9o1XnLhSTtvvvLe5Dc2H2O56fvRZi+KulDyf5ctDhhtYJBGKStV2FL1fy6253cmLgqVQ==}
|
resolution: {integrity: sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==}
|
||||||
engines: {node: '>=4'}
|
engines: {node: '>=4'}
|
||||||
|
|
||||||
postcss-value-parser@4.2.0:
|
postcss-value-parser@4.2.0:
|
||||||
@ -890,8 +898,8 @@ packages:
|
|||||||
resolution: {integrity: sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==}
|
resolution: {integrity: sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==}
|
||||||
engines: {node: ^10 || ^12 || >=14}
|
engines: {node: ^10 || ^12 || >=14}
|
||||||
|
|
||||||
postcss@8.4.47:
|
postcss@8.5.1:
|
||||||
resolution: {integrity: sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ==}
|
resolution: {integrity: sha512-6oz2beyjc5VMn/KV1pPw8fliQkhBXrVn1Z3TVyqZxU8kZpzEKhBdmCFqI6ZbmGtamQvQGuU1sgPTk8ZrXDD7jQ==}
|
||||||
engines: {node: ^10 || ^12 || >=14}
|
engines: {node: ^10 || ^12 || >=14}
|
||||||
|
|
||||||
preact-render-to-string@5.2.3:
|
preact-render-to-string@5.2.3:
|
||||||
@ -908,8 +916,8 @@ packages:
|
|||||||
primeicons@7.0.0:
|
primeicons@7.0.0:
|
||||||
resolution: {integrity: sha512-jK3Et9UzwzTsd6tzl2RmwrVY/b8raJ3QZLzoDACj+oTJ0oX7L9Hy+XnVwgo4QVKlKpnP/Ur13SXV/pVh4LzaDw==}
|
resolution: {integrity: sha512-jK3Et9UzwzTsd6tzl2RmwrVY/b8raJ3QZLzoDACj+oTJ0oX7L9Hy+XnVwgo4QVKlKpnP/Ur13SXV/pVh4LzaDw==}
|
||||||
|
|
||||||
primereact@10.8.4:
|
primereact@10.9.1:
|
||||||
resolution: {integrity: sha512-jwkSzq6pOHayzEh+9dgk2M71gEZtoQakwPKVo3FUJO3eEX3SoAOchON+Xm1tGCNqtd66ca8RgOWQcpv3AQoMvg==}
|
resolution: {integrity: sha512-mq5Pr6/zySO913RlL5oUWD+n1ygTjJjhhxBoRWhLNKx7Na8pHpswh/QCesShFXlfYyCjDOVXFVT6J2sSDceF1g==}
|
||||||
engines: {node: '>=14.0.0'}
|
engines: {node: '>=14.0.0'}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
'@types/react': ^17.0.0 || ^18.0.0 || ^19.0.0
|
'@types/react': ^17.0.0 || ^18.0.0 || ^19.0.0
|
||||||
@ -1067,8 +1075,8 @@ packages:
|
|||||||
resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==}
|
resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==}
|
||||||
engines: {node: '>= 0.4'}
|
engines: {node: '>= 0.4'}
|
||||||
|
|
||||||
tailwindcss@3.4.14:
|
tailwindcss@3.4.17:
|
||||||
resolution: {integrity: sha512-IcSvOcTRcUtQQ7ILQL5quRDg7Xs93PdJEk1ZLbhhvJc7uj/OAhYOnruEiwnGgBvUtaUAJ8/mhSw1o8L2jCiENA==}
|
resolution: {integrity: sha512-w33E2aCvSDP0tW9RZuNXadXlkHXqFzSkQew/aIa2i/Sj8fThxwovwlXHSPXTbAHwEIhBFXAedUhP2tueAKP8Og==}
|
||||||
engines: {node: '>=14.0.0'}
|
engines: {node: '>=14.0.0'}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
||||||
@ -1093,16 +1101,16 @@ packages:
|
|||||||
ts-interface-checker@0.1.13:
|
ts-interface-checker@0.1.13:
|
||||||
resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==}
|
resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==}
|
||||||
|
|
||||||
tslib@2.6.3:
|
tslib@2.8.1:
|
||||||
resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==}
|
resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==}
|
||||||
|
|
||||||
typescript@5.6.3:
|
typescript@5.7.3:
|
||||||
resolution: {integrity: sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==}
|
resolution: {integrity: sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==}
|
||||||
engines: {node: '>=14.17'}
|
engines: {node: '>=14.17'}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
||||||
undici-types@6.19.8:
|
undici-types@6.20.0:
|
||||||
resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==}
|
resolution: {integrity: sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==}
|
||||||
|
|
||||||
update-browserslist-db@1.1.0:
|
update-browserslist-db@1.1.0:
|
||||||
resolution: {integrity: sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ==}
|
resolution: {integrity: sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ==}
|
||||||
@ -1119,6 +1127,10 @@ packages:
|
|||||||
util-deprecate@1.0.2:
|
util-deprecate@1.0.2:
|
||||||
resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
|
resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
|
||||||
|
|
||||||
|
uuid@11.0.5:
|
||||||
|
resolution: {integrity: sha512-508e6IcKLrhxKdBbcA2b4KQZlLVp2+J5UwQ6F7Drckkc5N9ZJwFa4TgWtsww9UG8fGHbm6gbV19TdM5pQ4GaIA==}
|
||||||
|
hasBin: true
|
||||||
|
|
||||||
webidl-conversions@3.0.1:
|
webidl-conversions@3.0.1:
|
||||||
resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==}
|
resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==}
|
||||||
|
|
||||||
@ -1152,8 +1164,8 @@ packages:
|
|||||||
engines: {node: '>= 14'}
|
engines: {node: '>= 14'}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
||||||
zod@3.23.8:
|
zod@3.24.1:
|
||||||
resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==}
|
resolution: {integrity: sha512-muH7gBL9sI1nciMZV67X5fTKKBLtwpZ5VBp1vsOQzj1MhrBZ4wlVCm3gedKZWLp0Oyel8sIGfeiz54Su+OVT+A==}
|
||||||
|
|
||||||
snapshots:
|
snapshots:
|
||||||
|
|
||||||
@ -1169,16 +1181,16 @@ snapshots:
|
|||||||
preact: 10.11.3
|
preact: 10.11.3
|
||||||
preact-render-to-string: 5.2.3(preact@10.11.3)
|
preact-render-to-string: 5.2.3(preact@10.11.3)
|
||||||
|
|
||||||
'@babel/runtime@7.25.7':
|
'@babel/runtime@7.26.0':
|
||||||
dependencies:
|
dependencies:
|
||||||
regenerator-runtime: 0.14.1
|
regenerator-runtime: 0.14.1
|
||||||
|
|
||||||
'@emnapi/runtime@1.2.0':
|
'@emnapi/runtime@1.2.0':
|
||||||
dependencies:
|
dependencies:
|
||||||
tslib: 2.6.3
|
tslib: 2.8.1
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@heroicons/react@2.1.5(react@19.0.0-rc-f38c22b244-20240704)':
|
'@heroicons/react@2.2.0(react@19.0.0-rc-f38c22b244-20240704)':
|
||||||
dependencies:
|
dependencies:
|
||||||
react: 19.0.0-rc-f38c22b244-20240704
|
react: 19.0.0-rc-f38c22b244-20240704
|
||||||
|
|
||||||
@ -1298,30 +1310,30 @@ snapshots:
|
|||||||
- encoding
|
- encoding
|
||||||
- supports-color
|
- supports-color
|
||||||
|
|
||||||
'@next/env@15.0.2': {}
|
'@next/env@15.1.4': {}
|
||||||
|
|
||||||
'@next/swc-darwin-arm64@15.0.2':
|
'@next/swc-darwin-arm64@15.1.4':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@next/swc-darwin-x64@15.0.2':
|
'@next/swc-darwin-x64@15.1.4':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@next/swc-linux-arm64-gnu@15.0.2':
|
'@next/swc-linux-arm64-gnu@15.1.4':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@next/swc-linux-arm64-musl@15.0.2':
|
'@next/swc-linux-arm64-musl@15.1.4':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@next/swc-linux-x64-gnu@15.0.2':
|
'@next/swc-linux-x64-gnu@15.1.4':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@next/swc-linux-x64-musl@15.0.2':
|
'@next/swc-linux-x64-musl@15.1.4':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@next/swc-win32-arm64-msvc@15.0.2':
|
'@next/swc-win32-arm64-msvc@15.1.4':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@next/swc-win32-x64-msvc@15.0.2':
|
'@next/swc-win32-x64-msvc@15.1.4':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@nodelib/fs.scandir@2.1.5':
|
'@nodelib/fs.scandir@2.1.5':
|
||||||
@ -1341,42 +1353,42 @@ snapshots:
|
|||||||
'@pkgjs/parseargs@0.11.0':
|
'@pkgjs/parseargs@0.11.0':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@playwright/test@1.48.2':
|
'@playwright/test@1.49.1':
|
||||||
dependencies:
|
dependencies:
|
||||||
playwright: 1.48.2
|
playwright: 1.49.1
|
||||||
|
|
||||||
'@swc/counter@0.1.3': {}
|
'@swc/counter@0.1.3': {}
|
||||||
|
|
||||||
'@swc/helpers@0.5.13':
|
'@swc/helpers@0.5.15':
|
||||||
dependencies:
|
dependencies:
|
||||||
tslib: 2.6.3
|
tslib: 2.8.1
|
||||||
|
|
||||||
'@tailwindcss/forms@0.5.9(tailwindcss@3.4.14)':
|
'@tailwindcss/forms@0.5.10(tailwindcss@3.4.17)':
|
||||||
dependencies:
|
dependencies:
|
||||||
mini-svg-data-uri: 1.4.4
|
mini-svg-data-uri: 1.4.4
|
||||||
tailwindcss: 3.4.14
|
tailwindcss: 3.4.17
|
||||||
|
|
||||||
'@types/bcrypt@5.0.2':
|
'@types/bcrypt@5.0.2':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/node': 22.8.6
|
'@types/node': 22.10.7
|
||||||
|
|
||||||
'@types/cookie@0.6.0': {}
|
'@types/cookie@0.6.0': {}
|
||||||
|
|
||||||
'@types/node@22.8.6':
|
'@types/node@22.10.7':
|
||||||
dependencies:
|
dependencies:
|
||||||
undici-types: 6.19.8
|
undici-types: 6.20.0
|
||||||
|
|
||||||
'@types/prop-types@15.7.12': {}
|
'@types/prop-types@15.7.12': {}
|
||||||
|
|
||||||
'@types/react-dom@18.3.1':
|
'@types/react-dom@18.3.5(@types/react@18.3.18)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/react': 18.3.12
|
'@types/react': 18.3.18
|
||||||
|
|
||||||
'@types/react-transition-group@4.4.11':
|
'@types/react-transition-group@4.4.12(@types/react@18.3.18)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/react': 18.3.12
|
'@types/react': 18.3.18
|
||||||
|
|
||||||
'@types/react@18.3.12':
|
'@types/react@18.3.18':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/prop-types': 15.7.12
|
'@types/prop-types': 15.7.12
|
||||||
csstype: 3.1.3
|
csstype: 3.1.3
|
||||||
@ -1415,14 +1427,14 @@ snapshots:
|
|||||||
|
|
||||||
arg@5.0.2: {}
|
arg@5.0.2: {}
|
||||||
|
|
||||||
autoprefixer@10.4.20(postcss@8.4.47):
|
autoprefixer@10.4.20(postcss@8.5.1):
|
||||||
dependencies:
|
dependencies:
|
||||||
browserslist: 4.23.3
|
browserslist: 4.23.3
|
||||||
caniuse-lite: 1.0.30001651
|
caniuse-lite: 1.0.30001651
|
||||||
fraction.js: 4.3.7
|
fraction.js: 4.3.7
|
||||||
normalize-range: 0.1.2
|
normalize-range: 0.1.2
|
||||||
picocolors: 1.0.1
|
picocolors: 1.0.1
|
||||||
postcss: 8.4.47
|
postcss: 8.5.1
|
||||||
postcss-value-parser: 4.2.0
|
postcss-value-parser: 4.2.0
|
||||||
|
|
||||||
balanced-match@1.0.2: {}
|
balanced-match@1.0.2: {}
|
||||||
@ -1535,7 +1547,7 @@ snapshots:
|
|||||||
|
|
||||||
dom-helpers@5.2.1:
|
dom-helpers@5.2.1:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@babel/runtime': 7.25.7
|
'@babel/runtime': 7.26.0
|
||||||
csstype: 3.1.3
|
csstype: 3.1.3
|
||||||
|
|
||||||
eastasianwidth@0.2.0: {}
|
eastasianwidth@0.2.0: {}
|
||||||
@ -1554,7 +1566,7 @@ snapshots:
|
|||||||
'@nodelib/fs.walk': 1.2.8
|
'@nodelib/fs.walk': 1.2.8
|
||||||
glob-parent: 5.1.2
|
glob-parent: 5.1.2
|
||||||
merge2: 1.4.1
|
merge2: 1.4.1
|
||||||
micromatch: 4.0.7
|
micromatch: 4.0.8
|
||||||
|
|
||||||
fastq@1.17.1:
|
fastq@1.17.1:
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -1671,15 +1683,13 @@ snapshots:
|
|||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
'@pkgjs/parseargs': 0.11.0
|
'@pkgjs/parseargs': 0.11.0
|
||||||
|
|
||||||
jiti@1.21.0: {}
|
jiti@1.21.6: {}
|
||||||
|
|
||||||
jose@5.9.6: {}
|
jose@5.9.6: {}
|
||||||
|
|
||||||
js-tokens@4.0.0: {}
|
js-tokens@4.0.0: {}
|
||||||
|
|
||||||
lilconfig@2.1.0: {}
|
lilconfig@3.1.3: {}
|
||||||
|
|
||||||
lilconfig@3.1.1: {}
|
|
||||||
|
|
||||||
lines-and-columns@1.2.4: {}
|
lines-and-columns@1.2.4: {}
|
||||||
|
|
||||||
@ -1695,7 +1705,7 @@ snapshots:
|
|||||||
|
|
||||||
merge2@1.4.1: {}
|
merge2@1.4.1: {}
|
||||||
|
|
||||||
micromatch@4.0.7:
|
micromatch@4.0.8:
|
||||||
dependencies:
|
dependencies:
|
||||||
braces: 3.0.3
|
braces: 3.0.3
|
||||||
picomatch: 2.3.1
|
picomatch: 2.3.1
|
||||||
@ -1735,17 +1745,19 @@ snapshots:
|
|||||||
|
|
||||||
nanoid@3.3.7: {}
|
nanoid@3.3.7: {}
|
||||||
|
|
||||||
next-auth@5.0.0-beta.25(next@15.0.2(@playwright/test@1.48.2)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704):
|
nanoid@3.3.8: {}
|
||||||
|
|
||||||
|
next-auth@5.0.0-beta.25(next@15.1.4(@playwright/test@1.49.1)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704):
|
||||||
dependencies:
|
dependencies:
|
||||||
'@auth/core': 0.37.2
|
'@auth/core': 0.37.2
|
||||||
next: 15.0.2(@playwright/test@1.48.2)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704)
|
next: 15.1.4(@playwright/test@1.49.1)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704)
|
||||||
react: 19.0.0-rc-f38c22b244-20240704
|
react: 19.0.0-rc-f38c22b244-20240704
|
||||||
|
|
||||||
next@15.0.2(@playwright/test@1.48.2)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704):
|
next@15.1.4(@playwright/test@1.49.1)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704):
|
||||||
dependencies:
|
dependencies:
|
||||||
'@next/env': 15.0.2
|
'@next/env': 15.1.4
|
||||||
'@swc/counter': 0.1.3
|
'@swc/counter': 0.1.3
|
||||||
'@swc/helpers': 0.5.13
|
'@swc/helpers': 0.5.15
|
||||||
busboy: 1.6.0
|
busboy: 1.6.0
|
||||||
caniuse-lite: 1.0.30001651
|
caniuse-lite: 1.0.30001651
|
||||||
postcss: 8.4.31
|
postcss: 8.4.31
|
||||||
@ -1753,15 +1765,15 @@ snapshots:
|
|||||||
react-dom: 19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704)
|
react-dom: 19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704)
|
||||||
styled-jsx: 5.1.6(react@19.0.0-rc-f38c22b244-20240704)
|
styled-jsx: 5.1.6(react@19.0.0-rc-f38c22b244-20240704)
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
'@next/swc-darwin-arm64': 15.0.2
|
'@next/swc-darwin-arm64': 15.1.4
|
||||||
'@next/swc-darwin-x64': 15.0.2
|
'@next/swc-darwin-x64': 15.1.4
|
||||||
'@next/swc-linux-arm64-gnu': 15.0.2
|
'@next/swc-linux-arm64-gnu': 15.1.4
|
||||||
'@next/swc-linux-arm64-musl': 15.0.2
|
'@next/swc-linux-arm64-musl': 15.1.4
|
||||||
'@next/swc-linux-x64-gnu': 15.0.2
|
'@next/swc-linux-x64-gnu': 15.1.4
|
||||||
'@next/swc-linux-x64-musl': 15.0.2
|
'@next/swc-linux-x64-musl': 15.1.4
|
||||||
'@next/swc-win32-arm64-msvc': 15.0.2
|
'@next/swc-win32-arm64-msvc': 15.1.4
|
||||||
'@next/swc-win32-x64-msvc': 15.0.2
|
'@next/swc-win32-x64-msvc': 15.1.4
|
||||||
'@playwright/test': 1.48.2
|
'@playwright/test': 1.49.1
|
||||||
sharp: 0.33.5
|
sharp: 0.33.5
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- '@babel/core'
|
- '@babel/core'
|
||||||
@ -1813,7 +1825,7 @@ snapshots:
|
|||||||
|
|
||||||
picocolors@1.0.1: {}
|
picocolors@1.0.1: {}
|
||||||
|
|
||||||
picocolors@1.1.0: {}
|
picocolors@1.1.1: {}
|
||||||
|
|
||||||
picomatch@2.3.1: {}
|
picomatch@2.3.1: {}
|
||||||
|
|
||||||
@ -1821,39 +1833,39 @@ snapshots:
|
|||||||
|
|
||||||
pirates@4.0.6: {}
|
pirates@4.0.6: {}
|
||||||
|
|
||||||
playwright-core@1.48.2: {}
|
playwright-core@1.49.1: {}
|
||||||
|
|
||||||
playwright@1.48.2:
|
playwright@1.49.1:
|
||||||
dependencies:
|
dependencies:
|
||||||
playwright-core: 1.48.2
|
playwright-core: 1.49.1
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
fsevents: 2.3.2
|
fsevents: 2.3.2
|
||||||
|
|
||||||
postcss-import@15.1.0(postcss@8.4.47):
|
postcss-import@15.1.0(postcss@8.5.1):
|
||||||
dependencies:
|
dependencies:
|
||||||
postcss: 8.4.47
|
postcss: 8.5.1
|
||||||
postcss-value-parser: 4.2.0
|
postcss-value-parser: 4.2.0
|
||||||
read-cache: 1.0.0
|
read-cache: 1.0.0
|
||||||
resolve: 1.22.8
|
resolve: 1.22.8
|
||||||
|
|
||||||
postcss-js@4.0.1(postcss@8.4.47):
|
postcss-js@4.0.1(postcss@8.5.1):
|
||||||
dependencies:
|
dependencies:
|
||||||
camelcase-css: 2.0.1
|
camelcase-css: 2.0.1
|
||||||
postcss: 8.4.47
|
postcss: 8.5.1
|
||||||
|
|
||||||
postcss-load-config@4.0.2(postcss@8.4.47):
|
postcss-load-config@4.0.2(postcss@8.5.1):
|
||||||
dependencies:
|
dependencies:
|
||||||
lilconfig: 3.1.1
|
lilconfig: 3.1.3
|
||||||
yaml: 2.4.3
|
yaml: 2.4.3
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
postcss: 8.4.47
|
postcss: 8.5.1
|
||||||
|
|
||||||
postcss-nested@6.0.1(postcss@8.4.47):
|
postcss-nested@6.2.0(postcss@8.5.1):
|
||||||
dependencies:
|
dependencies:
|
||||||
postcss: 8.4.47
|
postcss: 8.5.1
|
||||||
postcss-selector-parser: 6.1.0
|
postcss-selector-parser: 6.1.2
|
||||||
|
|
||||||
postcss-selector-parser@6.1.0:
|
postcss-selector-parser@6.1.2:
|
||||||
dependencies:
|
dependencies:
|
||||||
cssesc: 3.0.0
|
cssesc: 3.0.0
|
||||||
util-deprecate: 1.0.2
|
util-deprecate: 1.0.2
|
||||||
@ -1863,13 +1875,13 @@ snapshots:
|
|||||||
postcss@8.4.31:
|
postcss@8.4.31:
|
||||||
dependencies:
|
dependencies:
|
||||||
nanoid: 3.3.7
|
nanoid: 3.3.7
|
||||||
picocolors: 1.1.0
|
picocolors: 1.1.1
|
||||||
source-map-js: 1.2.1
|
source-map-js: 1.2.1
|
||||||
|
|
||||||
postcss@8.4.47:
|
postcss@8.5.1:
|
||||||
dependencies:
|
dependencies:
|
||||||
nanoid: 3.3.7
|
nanoid: 3.3.8
|
||||||
picocolors: 1.1.0
|
picocolors: 1.1.1
|
||||||
source-map-js: 1.2.1
|
source-map-js: 1.2.1
|
||||||
|
|
||||||
preact-render-to-string@5.2.3(preact@10.11.3):
|
preact-render-to-string@5.2.3(preact@10.11.3):
|
||||||
@ -1883,14 +1895,14 @@ snapshots:
|
|||||||
|
|
||||||
primeicons@7.0.0: {}
|
primeicons@7.0.0: {}
|
||||||
|
|
||||||
primereact@10.8.4(@types/react@18.3.12)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704):
|
primereact@10.9.1(@types/react@18.3.18)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704):
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/react-transition-group': 4.4.11
|
'@types/react-transition-group': 4.4.12(@types/react@18.3.18)
|
||||||
react: 19.0.0-rc-f38c22b244-20240704
|
react: 19.0.0-rc-f38c22b244-20240704
|
||||||
react-dom: 19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704)
|
react-dom: 19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704)
|
||||||
react-transition-group: 4.4.5(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704)
|
react-transition-group: 4.4.5(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704)
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
'@types/react': 18.3.12
|
'@types/react': 18.3.18
|
||||||
|
|
||||||
prop-types@15.8.1:
|
prop-types@15.8.1:
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -1909,7 +1921,7 @@ snapshots:
|
|||||||
|
|
||||||
react-transition-group@4.4.5(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704):
|
react-transition-group@4.4.5(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704):
|
||||||
dependencies:
|
dependencies:
|
||||||
'@babel/runtime': 7.25.7
|
'@babel/runtime': 7.26.0
|
||||||
dom-helpers: 5.2.1
|
dom-helpers: 5.2.1
|
||||||
loose-envify: 1.4.0
|
loose-envify: 1.4.0
|
||||||
prop-types: 15.8.1
|
prop-types: 15.8.1
|
||||||
@ -2050,7 +2062,7 @@ snapshots:
|
|||||||
|
|
||||||
supports-preserve-symlinks-flag@1.0.0: {}
|
supports-preserve-symlinks-flag@1.0.0: {}
|
||||||
|
|
||||||
tailwindcss@3.4.14:
|
tailwindcss@3.4.17:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@alloc/quick-lru': 5.2.0
|
'@alloc/quick-lru': 5.2.0
|
||||||
arg: 5.0.2
|
arg: 5.0.2
|
||||||
@ -2060,18 +2072,18 @@ snapshots:
|
|||||||
fast-glob: 3.3.2
|
fast-glob: 3.3.2
|
||||||
glob-parent: 6.0.2
|
glob-parent: 6.0.2
|
||||||
is-glob: 4.0.3
|
is-glob: 4.0.3
|
||||||
jiti: 1.21.0
|
jiti: 1.21.6
|
||||||
lilconfig: 2.1.0
|
lilconfig: 3.1.3
|
||||||
micromatch: 4.0.7
|
micromatch: 4.0.8
|
||||||
normalize-path: 3.0.0
|
normalize-path: 3.0.0
|
||||||
object-hash: 3.0.0
|
object-hash: 3.0.0
|
||||||
picocolors: 1.1.0
|
picocolors: 1.1.1
|
||||||
postcss: 8.4.47
|
postcss: 8.5.1
|
||||||
postcss-import: 15.1.0(postcss@8.4.47)
|
postcss-import: 15.1.0(postcss@8.5.1)
|
||||||
postcss-js: 4.0.1(postcss@8.4.47)
|
postcss-js: 4.0.1(postcss@8.5.1)
|
||||||
postcss-load-config: 4.0.2(postcss@8.4.47)
|
postcss-load-config: 4.0.2(postcss@8.5.1)
|
||||||
postcss-nested: 6.0.1(postcss@8.4.47)
|
postcss-nested: 6.2.0(postcss@8.5.1)
|
||||||
postcss-selector-parser: 6.1.0
|
postcss-selector-parser: 6.1.2
|
||||||
resolve: 1.22.8
|
resolve: 1.22.8
|
||||||
sucrase: 3.35.0
|
sucrase: 3.35.0
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
@ -2102,17 +2114,17 @@ snapshots:
|
|||||||
|
|
||||||
ts-interface-checker@0.1.13: {}
|
ts-interface-checker@0.1.13: {}
|
||||||
|
|
||||||
tslib@2.6.3: {}
|
tslib@2.8.1: {}
|
||||||
|
|
||||||
typescript@5.6.3: {}
|
typescript@5.7.3: {}
|
||||||
|
|
||||||
undici-types@6.19.8: {}
|
undici-types@6.20.0: {}
|
||||||
|
|
||||||
update-browserslist-db@1.1.0(browserslist@4.23.3):
|
update-browserslist-db@1.1.0(browserslist@4.23.3):
|
||||||
dependencies:
|
dependencies:
|
||||||
browserslist: 4.23.3
|
browserslist: 4.23.3
|
||||||
escalade: 3.1.2
|
escalade: 3.1.2
|
||||||
picocolors: 1.0.1
|
picocolors: 1.1.1
|
||||||
|
|
||||||
use-debounce@10.0.4(react@19.0.0-rc-f38c22b244-20240704):
|
use-debounce@10.0.4(react@19.0.0-rc-f38c22b244-20240704):
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -2120,6 +2132,8 @@ snapshots:
|
|||||||
|
|
||||||
util-deprecate@1.0.2: {}
|
util-deprecate@1.0.2: {}
|
||||||
|
|
||||||
|
uuid@11.0.5: {}
|
||||||
|
|
||||||
webidl-conversions@3.0.1: {}
|
webidl-conversions@3.0.1: {}
|
||||||
|
|
||||||
whatwg-url@5.0.0:
|
whatwg-url@5.0.0:
|
||||||
@ -2153,4 +2167,4 @@ snapshots:
|
|||||||
|
|
||||||
yaml@2.4.3: {}
|
yaml@2.4.3: {}
|
||||||
|
|
||||||
zod@3.23.8: {}
|
zod@3.24.1: {}
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 7.8 KiB |
Binary file not shown.
Before Width: | Height: | Size: 7.8 KiB |
Binary file not shown.
Before Width: | Height: | Size: 5.7 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1019 B |
Binary file not shown.
Before Width: | Height: | Size: 5.5 KiB |
Binary file not shown.
Before Width: | Height: | Size: 9.7 KiB |
@ -1,7 +1,100 @@
|
|||||||
import { test, expect } from '@playwright/test'
|
import { test, expect, Page } from '@playwright/test'
|
||||||
|
|
||||||
test('should navigate to the guests page', async ({ page }) => {
|
const mockGuestsAPI = ({ page }: { page: Page }) => {
|
||||||
await page.goto('/dashboard/guests')
|
page.route('*/**/api/default/guests', async route => {
|
||||||
|
const json = [
|
||||||
|
{
|
||||||
|
"id": "f4a09c28-40ea-4553-90a5-96935a59cac6",
|
||||||
|
"status": "tentative",
|
||||||
|
"name": "Kristofer Rohan DVM",
|
||||||
|
"group": {
|
||||||
|
"id": "2fcb8b22-6b07-4c34-92e3-a2535dbc5b14",
|
||||||
|
"name": "Childhood friends",
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "bd585c40-0937-4cde-960a-bb23acfd6f18",
|
||||||
|
"status": "invited",
|
||||||
|
"name": "Olevia Quigley Jr.",
|
||||||
|
"group": {
|
||||||
|
"id": "da8edf26-3e1e-4cbb-b985-450c49fffe01",
|
||||||
|
"name": "Work",
|
||||||
|
}
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
await expect(page.getByRole('heading', { name: 'Guests' })).toContainText('Guests')
|
await route.fulfill({ json })
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const mockGroupsAPI = ({ page }: { page: Page }) => {
|
||||||
|
page.route('*/**/api/default/groups', async route => {
|
||||||
|
const json = [
|
||||||
|
{
|
||||||
|
"id": "ee44ffb9-1147-4842-a378-9eaeb0f0871a",
|
||||||
|
"name": "Pam's family",
|
||||||
|
"icon": "pi pi-users",
|
||||||
|
"parent_id": "cd9645e1-02c6-4fb9-bba6-1a960754b01c",
|
||||||
|
"color": "#ff0000",
|
||||||
|
"total": 3,
|
||||||
|
"considered": 2,
|
||||||
|
"invited": 1,
|
||||||
|
"confirmed": 0,
|
||||||
|
"declined": 0,
|
||||||
|
"tentative": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "c8bda6ca-d8af-4bb8-b2bf-e6ec1c21b1e6",
|
||||||
|
"name": "Pam's work",
|
||||||
|
"icon": "pi pi-desktop",
|
||||||
|
"parent_id": "cd9645e1-02c6-4fb9-bba6-1a960754b01c",
|
||||||
|
"color": "#00ff00",
|
||||||
|
"total": 2,
|
||||||
|
"considered": 0,
|
||||||
|
"invited": 0,
|
||||||
|
"confirmed": 0,
|
||||||
|
"declined": 0,
|
||||||
|
"tentative": 2
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
await route.fulfill({ json })
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
test('should display the list of guests', async ({ page }) => {
|
||||||
|
await mockGuestsAPI({ page });
|
||||||
|
|
||||||
|
await page.goto('/default/dashboard/guests');
|
||||||
|
|
||||||
|
await expect(page.getByRole('tab', { name: 'Groups' })).toBeVisible();
|
||||||
|
await expect(page.getByRole('tab', { name: 'Guests' })).toBeVisible();
|
||||||
|
|
||||||
|
await expect(page.getByText('There are 2 elements in the list')).toBeVisible();
|
||||||
|
|
||||||
|
await expect(page.getByRole('row').nth(1).getByRole('cell', { name: 'Kristofer Rohan DVM' })).toBeVisible();
|
||||||
|
await expect(page.getByRole('row').nth(1).getByRole('cell', { name: 'Childhood friends' })).toBeVisible();
|
||||||
|
await expect(page.getByRole('row').nth(1).getByRole('cell', { name: 'Tentative' })).toBeVisible();
|
||||||
|
await expect(page.getByRole('row').nth(1).getByRole('button', { name: 'Confirm' })).toBeVisible();
|
||||||
|
await expect(page.getByRole('row').nth(1).getByRole('button', { name: 'Decline' })).toBeVisible();
|
||||||
|
|
||||||
|
|
||||||
|
await expect(page.getByRole('row').nth(2).getByRole('cell', { name: 'Olevia Quigley Jr.' })).toBeVisible();
|
||||||
|
await expect(page.getByRole('row').nth(2).getByRole('cell', { name: 'Work' })).toBeVisible();
|
||||||
|
await expect(page.getByRole('row').nth(2).getByRole('cell', { name: 'Invited' })).toBeVisible();
|
||||||
|
await expect(page.getByRole('row').nth(2).getByRole('button', { name: 'Confirm' })).toBeVisible();
|
||||||
|
await expect(page.getByRole('row').nth(2).getByRole('button', { name: 'Tentative' })).toBeVisible();
|
||||||
|
await expect(page.getByRole('row').nth(2).getByRole('button', { name: 'Decline' })).toBeVisible();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('should display the list of groups', async ({ page }) => {
|
||||||
|
await mockGroupsAPI({ page });
|
||||||
|
|
||||||
|
await page.goto('/default/dashboard/guests');
|
||||||
|
await page.getByRole('tab', { name: 'Groups' }).click();
|
||||||
|
|
||||||
|
await expect(page.getByText('There are 2 elements in the list')).toBeVisible();
|
||||||
|
|
||||||
|
await expect(page.getByRole('row').nth(1).getByRole('cell', { name: "Pam's family" })).toBeVisible();
|
||||||
|
await expect(page.getByRole('row').nth(2).getByRole('cell', { name: "Pam's work" })).toBeVisible();
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user