Merge branch 'release/1.22.0'

This commit is contained in:
2024-02-15 15:53:37 +01:00
5 changed files with 27 additions and 19 deletions

View File

@@ -3,6 +3,7 @@ import { fetchLocationById } from '@/app/lib/actions/locationActions';
import { LocationDeleteForm } from '@/app/ui/LocationDeleteForm'; import { LocationDeleteForm } from '@/app/ui/LocationDeleteForm';
import { BillDeleteForm } from '@/app/ui/BillDeleteForm'; import { BillDeleteForm } from '@/app/ui/BillDeleteForm';
import { fetchBillById } from '@/app/lib/actions/billActions'; import { fetchBillById } from '@/app/lib/actions/billActions';
import { Main } from '@/app/ui/Main';
export default async function Page({ params:{ id } }: { params: { id:string } }) { export default async function Page({ params:{ id } }: { params: { id:string } }) {
const [locationID, billID] = id.split('-'); const [locationID, billID] = id.split('-');
@@ -13,5 +14,9 @@ export default async function Page({ params:{ id } }: { params: { id:string } })
return(notFound()); return(notFound());
} }
return (<BillDeleteForm location={location} bill={bill} />); return (
<Main>
<BillDeleteForm location={location} bill={bill} />
</Main>
);
} }

View File

@@ -1,6 +1,7 @@
import { notFound } from 'next/navigation'; import { notFound } from 'next/navigation';
import { fetchLocationById } from '@/app/lib/actions/locationActions'; import { fetchLocationById } from '@/app/lib/actions/locationActions';
import { LocationDeleteForm } from '@/app/ui/LocationDeleteForm'; import { LocationDeleteForm } from '@/app/ui/LocationDeleteForm';
import { Main } from '@/app/ui/Main';
export default async function Page({ params:{ id } }: { params: { id:string } }) { export default async function Page({ params:{ id } }: { params: { id:string } }) {
@@ -10,5 +11,9 @@ export default async function Page({ params:{ id } }: { params: { id:string } })
return(notFound()); return(notFound());
} }
return (<LocationDeleteForm location={location} />); return (
<Main>
<LocationDeleteForm location={location} />
</Main>
);
} }

View File

@@ -20,20 +20,18 @@ export const BillDeleteForm:FC<BillDeleteFormProps> = ({ bill, location }) => {
return( return(
<Main> <div className="card card-compact card-bordered min-w-[20em] max-w-[90em] bg-base-100 shadow-s my-1">
<div className="card card-compact card-bordered min-w-[20em] max-w-[90em] bg-base-100 shadow-s my-1"> <div className="card-body">
<div className="card-body"> <form action={dispatch}>
<form action={dispatch}> <p className="py-6 px-6">
<p className="py-6 px-6"> Please confirm deletion of bill <strong>{bill.name}</strong> at <strong>{location.name}</strong>.
Please confirm deletion of bill <strong>{bill.name}</strong> at <strong>{location.name}</strong>. </p>
</p> <div className="pt-4 text-center">
<div className="pt-4 text-center"> <button className="btn btn-primary">Confim</button>
<button className="btn btn-primary">Confim</button> <Link className="btn btn-neutral ml-3" href={`/bill/${location._id}-${bill._id}/edit/`}>Cancel</Link>
<Link className="btn btn-neutral ml-3" href={`/bill/${location._id}-${bill._id}/edit/`}>Cancel</Link> </div>
</div> </form>
</form>
</div>
</div> </div>
</Main> </div>
) )
} }

View File

@@ -37,7 +37,7 @@ export const LocationEditForm:FC<LocationEditFormProps> = ({ location, yearMonth
<TrashIcon className="h-[1em] w-[1em] text-error text-2xl" /> <TrashIcon className="h-[1em] w-[1em] text-error text-2xl" />
</Link> </Link>
} }
<input id="locationName" name="locationName" type="text" placeholder="Naziv lokacije" className="input input-bordered w-full" defaultValue={location?.name ?? ""} /> <input id="locationName" name="locationName" type="text" placeholder="Realestate name" className="input input-bordered w-full" defaultValue={location?.name ?? ""} />
<div id="status-error" aria-live="polite" aria-atomic="true"> <div id="status-error" aria-live="polite" aria-atomic="true">
{state.errors?.locationName && {state.errors?.locationName &&
state.errors.locationName.map((error: string) => ( state.errors.locationName.map((error: string) => (
@@ -47,7 +47,7 @@ export const LocationEditForm:FC<LocationEditFormProps> = ({ location, yearMonth
))} ))}
</div> </div>
<textarea id="locationNotes" name="locationNotes" className="textarea textarea-bordered my-1 w-full block h-[8em]" placeholder="Opis" defaultValue={location?.notes ?? ""}></textarea> <textarea id="locationNotes" name="locationNotes" className="textarea textarea-bordered my-1 w-full block h-[8em]" placeholder="Description" defaultValue={location?.notes ?? ""}></textarea>
<div id="status-error" aria-live="polite" aria-atomic="true"> <div id="status-error" aria-live="polite" aria-atomic="true">
{state.errors?.locationNotes && {state.errors?.locationNotes &&
state.errors.locationNotes.map((error: string) => ( state.errors.locationNotes.map((error: string) => (

View File

@@ -9,7 +9,7 @@ networks:
services: services:
web-app: web-app:
image: utility-bills-tracker:1.21.1 image: utility-bills-tracker:1.22.0
networks: networks:
- traefik-network - traefik-network
- mongo-network - mongo-network