Merge branch 'feature/query-optimization' into develop
This commit is contained in:
@@ -117,8 +117,22 @@ export const fetchAllLocations = withUser(async (user:AuthenticatedUser, year:nu
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
projection: {
|
projection: {
|
||||||
// don't include the attachment binary data in the response
|
"_id": 1,
|
||||||
"bills.attachment.fileContentsBase64": 0
|
// "userId": 0,
|
||||||
|
// "userEmail": 0,
|
||||||
|
"name": 1,
|
||||||
|
// "notes": 0,
|
||||||
|
// "yearMonth": 1,
|
||||||
|
"yearMonth.year": 1,
|
||||||
|
"yearMonth.month": 1,
|
||||||
|
// "bills": 1,
|
||||||
|
"bills._id": 1,
|
||||||
|
"bills.name": 1,
|
||||||
|
"bills.paid": 1,
|
||||||
|
"bills.payedAmount": 1,
|
||||||
|
// "bills.attachment": 0,
|
||||||
|
// "bills.notes": 0,
|
||||||
|
// "bills.barcodeImage": 1,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -8,16 +8,16 @@ import { defaultLocale } from '../i18n';
|
|||||||
export const myAuth = () => {
|
export const myAuth = () => {
|
||||||
|
|
||||||
// Ovo koristim u developmentu
|
// Ovo koristim u developmentu
|
||||||
//
|
|
||||||
// const session:Session = {
|
// const session:Session = {
|
||||||
// user: {
|
// user: {
|
||||||
// id: "123",
|
// id: "109754742613069927799",
|
||||||
// name: "Test User",
|
// name: "Nikola Derežić",
|
||||||
// },
|
// },
|
||||||
// expires: "123",
|
// expires: "123",
|
||||||
// };
|
// };
|
||||||
//
|
|
||||||
// return(Promise.resolve(session));
|
return(Promise.resolve(session));
|
||||||
|
|
||||||
return(auth());
|
return(auth());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import { Cog8ToothIcon, PlusCircleIcon, LinkIcon } from "@heroicons/react/24/outline";
|
import { Cog8ToothIcon, PlusCircleIcon, ShareIcon } from "@heroicons/react/24/outline";
|
||||||
import { FC } from "react";
|
import { FC } from "react";
|
||||||
import { BillBadge } from "./BillBadge";
|
import { BillBadge } from "./BillBadge";
|
||||||
import { BillingLocation } from "../lib/db-types";
|
import { BillingLocation } from "../lib/db-types";
|
||||||
@@ -54,7 +54,7 @@ export const LocationCard:FC<LocationCardProps> = ({location: { _id, name, yearM
|
|||||||
: null
|
: null
|
||||||
}
|
}
|
||||||
|
|
||||||
<LinkIcon className="h-[1em] w-[1em] cursor-pointer text-2xl inline-block hover:text-red-500" title="create sharable link" style={{ position: "absolute", bottom: ".5em", right: "1.2em" }} onClick={handleCopyLinkClick} />
|
<ShareIcon className="h-[1em] w-[1em] cursor-pointer text-2xl inline-block hover:text-red-500" title="create sharable link" style={{ position: "absolute", bottom: ".6em", right: "1.2em" }} onClick={handleCopyLinkClick} />
|
||||||
</div>
|
</div>
|
||||||
</div>);
|
</div>);
|
||||||
};
|
};
|
||||||
@@ -14,7 +14,7 @@ export const ViewBillBadge: FC<ViewBillBadgeProps> = ({ locationId, bill: { _id:
|
|||||||
const currentLocale = useLocale();
|
const currentLocale = useLocale();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Link href={`/${currentLocale}//share/bill/${locationId}-${billId}`} className={`badge badge-lg ${paid ? "badge-success" : " badge-outline"} ${!paid && !!attachment ? "btn-outline btn-success" : ""} cursor-pointer`}>
|
<Link href={`/${currentLocale}//share/bill/${locationId}-${billId}`} className={`badge badge-lg p-[1em] ${paid ? "badge-success" : " badge-outline"} ${!paid && !!attachment ? "btn-outline btn-success" : ""} cursor-pointer`}>
|
||||||
<TicketIcon className="h-[1em] w-[1em] inline-block mr-1" /> {name}
|
<TicketIcon className="h-[1em] w-[1em] inline-block mr-1" /> {name}
|
||||||
</Link>
|
</Link>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export const ViewLocationCard:FC<ViewLocationCardProps> = ({location: { _id, nam
|
|||||||
return(
|
return(
|
||||||
<div data-key={_id } className="card card-compact card-bordered max-w-[30em] min-w-[350px] bg-base-100 border-1 border-neutral my-1">
|
<div data-key={_id } className="card card-compact card-bordered max-w-[30em] min-w-[350px] bg-base-100 border-1 border-neutral my-1">
|
||||||
<div className="card-body">
|
<div className="card-body">
|
||||||
<h2 className="card-title mr-[2em] text-[1rem]">{formatYearMonth(yearMonth)} {name}</h2>
|
<h2 className="card-title mr-[2em] text-[1.3rem]">{formatYearMonth(yearMonth)} {name}</h2>
|
||||||
<div className="card-actions mt-[1em] mb-[1em]">
|
<div className="card-actions mt-[1em] mb-[1em]">
|
||||||
{
|
{
|
||||||
bills.map(bill => <ViewBillBadge key={`${_id}-${bill._id}`} locationId={_id} bill={bill} />)
|
bills.map(bill => <ViewBillBadge key={`${_id}-${bill._id}`} locationId={_id} bill={bill} />)
|
||||||
@@ -29,7 +29,7 @@ export const ViewLocationCard:FC<ViewLocationCardProps> = ({location: { _id, nam
|
|||||||
</div>
|
</div>
|
||||||
{
|
{
|
||||||
monthlyExpense > 0 ?
|
monthlyExpense > 0 ?
|
||||||
<p>
|
<p className="text-[1.2rem]">
|
||||||
{ t("payed-total-label") } <strong>${formatCurrency(monthlyExpense)}</strong>
|
{ t("payed-total-label") } <strong>${formatCurrency(monthlyExpense)}</strong>
|
||||||
</p>
|
</p>
|
||||||
: null
|
: null
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ version: "3.7"
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
mongo:
|
mongo:
|
||||||
image: mongo:6.0.12
|
image: mongo:4.4.27
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- 27017:27017
|
- 27017:27017
|
||||||
|
|||||||
Reference in New Issue
Block a user