Merge branch 'release/1.15.0'
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
# ToDo
|
# ToDo
|
||||||
* Popis lokacija:
|
* Public page with instructions
|
||||||
* omogućiti collapse za pojedine mjesece
|
|
||||||
|
|
||||||
# Authentication
|
# Authentication
|
||||||
Authentication consists of the following parts:
|
Authentication consists of the following parts:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { PlusCircleIcon } from "@heroicons/react/24/outline";
|
import { PlusCircleIcon, HomeIcon } from "@heroicons/react/24/outline";
|
||||||
import { YearMonth } from "../lib/db-types";
|
import { YearMonth } from "../lib/db-types";
|
||||||
import { formatYearMonth } from "../lib/format";
|
import { formatYearMonth } from "../lib/format";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
@@ -12,8 +12,9 @@ export interface AddLocationButtonProps {
|
|||||||
export const AddLocationButton:React.FC<AddLocationButtonProps> = ({yearMonth}) =>
|
export const AddLocationButton:React.FC<AddLocationButtonProps> = ({yearMonth}) =>
|
||||||
<div className="card card-compact card-bordered bg-base-100 shadow-s my-1">
|
<div className="card card-compact card-bordered bg-base-100 shadow-s my-1">
|
||||||
<Link href={`/location/${ formatYearMonth(yearMonth) }/add`} className="card-body tooltip self-center" data-tip="Add a new billing location">
|
<Link href={`/location/${ formatYearMonth(yearMonth) }/add`} className="card-body tooltip self-center" data-tip="Add a new billing location">
|
||||||
<span className='grid self-center' data-tip="Add a new billing location">
|
<span className='flex self-center' data-tip="Add a new billing location">
|
||||||
<PlusCircleIcon className="h-[1em] w-[1em] cursor-pointer text-4xl" />
|
<HomeIcon className="h-[1em] w-[1em] cursor-pointer text-4xl" />
|
||||||
|
<PlusCircleIcon className="h-[1em] w-[1em] cursor-pointer text-xl text-green-500 ml-[-.6em] mt-[-.4em]" />
|
||||||
</span>
|
</span>
|
||||||
</Link>
|
</Link>
|
||||||
</div>;
|
</div>;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { PlusCircleIcon } from "@heroicons/react/24/outline";
|
import { PlusCircleIcon, CalendarDaysIcon } from "@heroicons/react/24/outline";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { formatYearMonth } from "../lib/format";
|
import { formatYearMonth } from "../lib/format";
|
||||||
import { YearMonth } from "../lib/db-types";
|
import { YearMonth } from "../lib/db-types";
|
||||||
@@ -11,8 +11,9 @@ export interface AddMonthButtonProps {
|
|||||||
export const AddMonthButton:React.FC<AddMonthButtonProps> = ({ yearMonth }) =>
|
export const AddMonthButton:React.FC<AddMonthButtonProps> = ({ yearMonth }) =>
|
||||||
<div className="card card-compact shadow-s mb-4">
|
<div className="card card-compact shadow-s mb-4">
|
||||||
<Link href={`/year-month/${formatYearMonth(yearMonth)}/add`} className='grid self-center tooltip' data-tip="Dodaj novi mjesec">
|
<Link href={`/year-month/${formatYearMonth(yearMonth)}/add`} className='grid self-center tooltip' data-tip="Dodaj novi mjesec">
|
||||||
<span className='grid self-center'>
|
<span className='flex self-center'>
|
||||||
<PlusCircleIcon className="h-[1em] w-[1em] cursor-pointer text-4xl" />
|
<CalendarDaysIcon className="h-[1em] w-[1em] cursor-pointer text-4xl" />
|
||||||
|
<PlusCircleIcon className="h-[1em] w-[1em] cursor-pointer text-xl text-green-500 ml-[-.4em] mt-[-.4em]" />
|
||||||
</span>
|
</span>
|
||||||
</Link>
|
</Link>
|
||||||
</div>;
|
</div>;
|
||||||
|
|||||||
@@ -35,13 +35,17 @@ export const BillEditForm:FC<BillEditFormProps> = ({ location, bill }) => {
|
|||||||
|
|
||||||
const [ state, dispatch ] = useFormState(handleAction, initialState);
|
const [ state, dispatch ] = useFormState(handleAction, initialState);
|
||||||
const [ isPaid, setIsPaid ] = React.useState<boolean>(paid);
|
const [ isPaid, setIsPaid ] = React.useState<boolean>(paid);
|
||||||
const [ payedAmount, setPayedAmount ] = React.useState<number>(initialPayedAmount ?? 0);
|
const [ payedAmount, setPayedAmount ] = React.useState<string>(initialPayedAmount ? `${initialPayedAmount/100}` : "" );
|
||||||
const [ barcodeImage, setBarcodeImage ] = React.useState<string | undefined>(initialBarcodeImage);
|
const [ barcodeImage, setBarcodeImage ] = React.useState<string | undefined>(initialBarcodeImage);
|
||||||
|
|
||||||
const billPaid_handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
const billPaid_handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
setIsPaid(event.target.checked);
|
setIsPaid(event.target.checked);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const payedAmount_handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
setPayedAmount(event.target.value);
|
||||||
|
}
|
||||||
|
|
||||||
const billAttachment_handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
const billAttachment_handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
findDecodePdf417(event)
|
findDecodePdf417(event)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
@@ -51,7 +55,7 @@ export const BillEditForm:FC<BillEditFormProps> = ({ location, bill }) => {
|
|||||||
billInfo
|
billInfo
|
||||||
} = result;
|
} = result;
|
||||||
|
|
||||||
setPayedAmount(billInfo.amount);
|
setPayedAmount(`${billInfo.amount/100}`);
|
||||||
setBarcodeImage(barcodeImage);
|
setBarcodeImage(barcodeImage);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -98,34 +102,28 @@ export const BillEditForm:FC<BillEditFormProps> = ({ location, bill }) => {
|
|||||||
</p>
|
</p>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
<div className="flex">
|
||||||
<div className="form-control w-32 p-1">
|
<div className="form-control flex-row">
|
||||||
<label className="cursor-pointer label p-0">
|
<label className="cursor-pointer label align-middle">
|
||||||
<span className="label-text flex-none w-[6.4em]">Paid</span>
|
<span className="label-text mr-[1em]">Paid</span>
|
||||||
<span>
|
|
||||||
<input id="billPaid" name="billPaid" type="checkbox" className="toggle toggle-success" defaultChecked={paid} onChange={billPaid_handleChange} />
|
<input id="billPaid" name="billPaid" type="checkbox" className="toggle toggle-success" defaultChecked={paid} onChange={billPaid_handleChange} />
|
||||||
</span>
|
</label>
|
||||||
</label>
|
</div>
|
||||||
|
<div className="form-control">
|
||||||
|
<label className="cursor-pointer label">
|
||||||
|
<span className="label-text mx-[1em]">Amount</span>
|
||||||
|
<input type="text" id="payedAmount" name="payedAmount" className="input input-bordered text-right w-[9.2em]" placeholder="0.00" value={payedAmount} onFocus={e => e.target.select()} onChange={payedAmount_handleChange} />
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="status-error" aria-live="polite" aria-atomic="true">
|
||||||
|
{state.errors?.payedAmount &&
|
||||||
|
state.errors.payedAmount.map((error: string) => (
|
||||||
|
<p className="mt-2 text-sm text-red-500" key={error}>
|
||||||
|
{error}
|
||||||
|
</p>
|
||||||
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{
|
|
||||||
isPaid && <>
|
|
||||||
<div className="form-control p-1">
|
|
||||||
<label className="cursor-pointer label p-0 flex">
|
|
||||||
<span className="label-text flex-none w-[6.4em]">Amount</span>
|
|
||||||
<input type="text" id="payedAmount" name="payedAmount" className="input input-bordered text-right w-full" placeholder="0.00" defaultValue={payedAmount/100}/>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div id="status-error" aria-live="polite" aria-atomic="true">
|
|
||||||
{state.errors?.payedAmount &&
|
|
||||||
state.errors.payedAmount.map((error: string) => (
|
|
||||||
<p className="mt-2 text-sm text-red-500" key={error}>
|
|
||||||
{error}
|
|
||||||
</p>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
}
|
|
||||||
|
|
||||||
<input type="hidden" name="barcodeImage" value={barcodeImage} />
|
<input type="hidden" name="barcodeImage" value={barcodeImage} />
|
||||||
{
|
{
|
||||||
@@ -133,7 +131,7 @@ export const BillEditForm:FC<BillEditFormProps> = ({ location, bill }) => {
|
|||||||
<div className="form-control w-[325px] p-1">
|
<div className="form-control w-[325px] p-1">
|
||||||
<label className="cursor-pointer label p-0">
|
<label className="cursor-pointer label p-0">
|
||||||
<span>
|
<span>
|
||||||
<img src={barcodeImage} style={{ maxWidth:"325px" }} />
|
<img src={barcodeImage} className="max-w-[325px]" />
|
||||||
</span>
|
</span>
|
||||||
</label>
|
</label>
|
||||||
</div> : null
|
</div> : null
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ networks:
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
web-app:
|
web-app:
|
||||||
image: utility-bills-tracker:1.14.2
|
image: utility-bills-tracker:1.15.0
|
||||||
networks:
|
networks:
|
||||||
- traefik-network
|
- traefik-network
|
||||||
- mongo-network
|
- mongo-network
|
||||||
|
|||||||
Reference in New Issue
Block a user