Compare commits

...

10 Commits
1.3.0 ... 1.3.3

Author SHA1 Message Date
d6d88f5f60 🚀RELEASE v1.3.3
Some checks failed
continuous-integration/drone/push Build is failing
2023-04-19 18:18:44 +02:00
2c208c4381 bumped lfk-client-js 2023-04-19 18:18:26 +02:00
39bc6c4945 🚀RELEASE v1.3.2
Some checks failed
continuous-integration/drone/push Build is failing
2023-04-19 18:17:18 +02:00
b94e3b745f fix(donors): Shortened texts 2023-04-19 18:16:50 +02:00
6f337aeee1 feat(donations): Resolve donations via donor 2023-04-19 18:15:15 +02:00
5d48060834 fix(donors): Removed debug infos 2023-04-19 18:12:24 +02:00
c842c203e2 🚀RELEASE v1.3.1
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-19 18:00:58 +02:00
5bcfc8db75 More filtering 2023-04-19 18:00:41 +02:00
27b4dde755 feat(donors): Added name and address filtering 2023-04-19 18:00:16 +02:00
91ab199769 feat(donations): Donation table filtering 2023-04-19 17:53:24 +02:00
9 changed files with 87 additions and 33 deletions

View File

@@ -2,9 +2,34 @@
All notable changes to this project will be documented in this file. Dates are displayed in UTC.
#### [1.3.3](https://git.odit.services/lfk/frontend/compare/1.3.2...1.3.3)
- bumped lfk-client-js [`2c208c4`](https://git.odit.services/lfk/frontend/commit/2c208c438185892270a0ebd37deb6a7c9ac08fc0)
#### [1.3.2](https://git.odit.services/lfk/frontend/compare/1.3.1...1.3.2)
> 19 April 2023
- 🚀RELEASE v1.3.2 [`39bc6c4`](https://git.odit.services/lfk/frontend/commit/39bc6c49450964510f996369d014f92c569188ae)
- fix(donors): Shortened texts [`b94e3b7`](https://git.odit.services/lfk/frontend/commit/b94e3b745f2febbe91e16a7a26f96b47d347ab92)
- feat(donations): Resolve donations via donor [`6f337ae`](https://git.odit.services/lfk/frontend/commit/6f337aeee16267d1e67e3d3855b63b6f2e57979f)
- fix(donors): Removed debug infos [`5d48060`](https://git.odit.services/lfk/frontend/commit/5d48060834717b2244172a0914e2690f8fe634d9)
#### [1.3.1](https://git.odit.services/lfk/frontend/compare/1.3.0...1.3.1)
> 19 April 2023
- feat(donations): Donation table filtering [`91ab199`](https://git.odit.services/lfk/frontend/commit/91ab199769c9f4f8051c74ad43a701db321f3995)
- feat(donors): Added name and address filtering [`27b4dde`](https://git.odit.services/lfk/frontend/commit/27b4dde7551995c9d7e8ca33a9bd97d429a35801)
- 🚀RELEASE v1.3.1 [`c842c20`](https://git.odit.services/lfk/frontend/commit/c842c203e2fbf0a201297d475db9047c0691bd52)
- More filtering [`5bcfc8d`](https://git.odit.services/lfk/frontend/commit/5bcfc8db752fce96e9f523d14cefff1a4f675661)
#### [1.3.0](https://git.odit.services/lfk/frontend/compare/1.2.0...1.3.0)
> 19 April 2023
- feat(donations): Implemented donation deletion via confirm modal [`505fb8c`](https://git.odit.services/lfk/frontend/commit/505fb8cb08b81a7dcb08561bdda0f6464f140d3e)
- 🚀RELEASE v1.3.0 [`e75be49`](https://git.odit.services/lfk/frontend/commit/e75be49be42c3d5581e2204bfa064bfa3778c1b6)
- feat(donationsoverview): Switched donations overview to datatable [`133470b`](https://git.odit.services/lfk/frontend/commit/133470b6f2a63ec087f27c98ef260648a8672e5f)
- feat(donations): Implemented add donation payment via datatable refresh [`e5c9265`](https://git.odit.services/lfk/frontend/commit/e5c92655886ad9a6fcd7565fadd7955c477c3595)
- feat(donations): Donations reactive create and load into datatable [`02003ec`](https://git.odit.services/lfk/frontend/commit/02003ec80efc16aabd126710a6eeac18df43f841)

View File

@@ -13,7 +13,7 @@
</head>
<body>
<span style="display: none;visibility: hidden;" id="buildinfo">RELEASE_INFO-1.3.0-RELEASE_INFO</span>
<span style="display: none;visibility: hidden;" id="buildinfo">RELEASE_INFO-1.3.3-RELEASE_INFO</span>
<noscript>You need to enable JavaScript to run this app.</noscript>
<script src="/env.js"></script>
<script type="module" src="/src/main.js"></script>

View File

@@ -1,6 +1,6 @@
{
"name": "@odit/lfk-frontend",
"version": "1.3.0",
"version": "1.3.3",
"type": "module",
"scripts": {
"i18n-order": "node order.js",
@@ -39,7 +39,7 @@
}
},
"dependencies": {
"@odit/lfk-client-js": "1.1.0",
"@odit/lfk-client-js": "1.1.1",
"@paralleldrive/cuid2": "^2.2.0",
"@tanstack/svelte-table": "^8.8.5",
"bwip-js": "^3.4.0",

View File

@@ -23,6 +23,7 @@
import DonationStatus from "./DonationStatus.svelte";
import DonationTableAction from "./DonationTableAction.svelte";
import DeleteDonationModal from "./DeleteDonationModal.svelte";
import { donationDonorFilter, donationRunnerFilter } from "../shared/tablefilters";
$: searchvalue = "";
$: active_deletes = [];
$: active_edits = [];
@@ -54,7 +55,7 @@
cell: (info) => {
return renderComponent(DonationDonor, { donor: info.getValue() });
},
filterFn: `includesString`,
filterFn: `donor`,
},
{
accessorKey: "runner",
@@ -62,7 +63,7 @@
cell: (info) => {
return renderComponent(DonationRunner, { runner: info.getValue() });
},
filterFn: `includesString`,
filterFn: `runner`,
},
{
accessorKey: "amountPerDistance",
@@ -139,6 +140,10 @@
pageSize: 50,
},
},
filterFns: {
donor: donationDonorFilter,
runner: donationRunnerFilter,
},
enableRowSelection: true,
getCoreRowModel: getCoreRowModel(),
getFilteredRowModel: getFilteredRowModel(),

View File

@@ -17,10 +17,10 @@
>
{:else}
<a
href="../donations/{d.id}"
href="../donations/{donation.id}"
class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-700 text-white mr-1"
>{$_("fixed-donation")}:
{(d.amount / 100)
{(donation.amount / 100)
.toFixed(2)
.toLocaleString("de-DE", { valute: "EUR" })}</a
>

View File

@@ -22,9 +22,9 @@
import TableActions from "../shared/TableActions.svelte";
import DonorAddress from "./DonorAddress.svelte";
import DonorDonations from "./DonorDonations.svelte";
import { filterAddress, filterName } from "../shared/tablefilters";
$: searchvalue = "";
$: active_deletes = [];
$: current_donations = [];
$: selectedDonors =
$table?.getSelectedRowModel().rows.map((row) => row.original) || [];
$: selected =
@@ -32,8 +32,6 @@
$: dataLoaded = false;
let modal_open = false;
let delete_donor = {};
export let current_donors = [];
export const addDonors = (donors) => {
current_donors = current_donors.concat(...donors);
@@ -61,7 +59,7 @@
return `${d.firstname} ${d.lastname}`;
}
},
filterFn: `includesString`,
filterFn: `name`,
},
{
accessorKey: "address",
@@ -69,16 +67,13 @@
cell: (info) => {
return renderComponent(DonorAddress, { address: info.getValue() });
},
filterFn: `includesString`,
filterFn: `address`,
},
{
accessorKey: "sponsorings",
accessorKey: "donations",
header: () => $_("sponsorings"),
cell: (info) => {
const donations = current_donations.filter(
(d) => d?.donor?.id == info.row.original.id
);
return renderComponent(DonorDonations, { donations });
return renderComponent(DonorDonations, { donations: info.getValue() });
},
enableColumnFilter: false,
},
@@ -131,6 +126,10 @@
pageSize: 50,
},
},
filterFns: {
name: filterName,
address: filterAddress,
},
enableRowSelection: true,
getCoreRowModel: getCoreRowModel(),
getFilteredRowModel: getFilteredRowModel(),
@@ -150,16 +149,11 @@
let page = 0;
while (page >= 0) {
const donors = await DonorService.donorControllerGetAll(page, 500);
const donations = await DonationService.donationControllerGetAll(
page,
500
);
if (donors.length == 0 && donations.length == 0) {
if (donors.length == 0) {
page = -2;
}
current_donors = current_donors.concat(...donors);
current_donations = current_donations.concat(...donors);
options.update((options) => ({
...options,
data: current_donors,
@@ -194,7 +188,6 @@
modal_open={active_deletes.length > 0}
delete_donor={active_deletes[0]}
/>
{active_deletes.length}
{#if store.state.jwtinfo.userdetails.permissions.includes("DONOR:GET")}
{#if !dataLoaded}
<div

View File

@@ -15,17 +15,48 @@ export const groupFilter = (row, columnId, value) => {
};
export const runnerFilter = (row, columnId, value) => {
const runner = row.getValue(columnId);
if(!runner && value == "blanko"){return true}
if(!runner){return false}
return filterRunner(runner, value)
};
if(value.startsWith("#")){
return runner.id == value.replace("#","")
export const donationRunnerFilter = (row, columnId, value) => {
const runner = row.getValue(columnId);
if (!runner) { return false; }
return filterRunner(runner, value)
};
export const donationDonorFilter = (row, columnId, value) => {
const runner = row.getValue(columnId);
return filterRunner(runner, value)
};
function filterRunner(runner, value) {
if (!runner && value == "blanko") { return true }
if (!runner) { return false }
if (value.startsWith("#")) {
return runner.id == value.replace("#", "")
}
if(runner.middlename){
if (runner.middlename) {
return `${runner.firstname} ${runner.middlename} ${runner.lastname}`.toLowerCase().includes(value.toLowerCase())
}
return `${runner.firstname} ${runner.lastname}`.toLowerCase().includes(value.toLowerCase())
}
export const filterName = (row, columnId, value) => {
const obj = row.original;
if (obj.middlename) {
return `${obj.firstname} ${obj.middlename} ${obj.lastname}`.toLowerCase().includes(value.toLowerCase())
}
return `${obj.firstname} ${obj.lastname}`.toLowerCase().includes(value.toLowerCase())
};
export const filterAddress = (row, columnId, value) => {
const obj = row.original.address;
if (obj.address2) {s
return `${obj.address1} ${obj.address2} ${obj.postalcode} ${obj.city} ${obj.country}`.toLowerCase().includes(value.toLowerCase())
}
return `${obj.address1} ${obj.postalcode} ${obj.city} ${obj.country}`.toLowerCase().includes(value.toLowerCase())
};
export const statusFilter = (row, columnId, value) => {

View File

@@ -187,7 +187,7 @@
"donor": "Sponsor:in",
"donor-added": "Sponsor:in hinzugefügt",
"donor-deleted": "Sponsor:in gelöscht",
"donor-has-no-associated-donations": "Zur Sponsor:in gibt es noch keine Sponsorings",
"donor-has-no-associated-donations": "Keine Sponsorings",
"donor-is-being-added": "Sponsor:in wird hinzugefügt...",
"donor-is-being-updated": "Sponsor:in wird aktualisiert",
"donors": "Sponsor:innen",
@@ -442,7 +442,7 @@
"total-donation-count": "Gesamte Sponsorings",
"total-donations": "Spendensumme",
"total-donors": "gesamte Sponsor:innen",
"total-paid-amount": "Gezahlter Gesamtbetrag",
"total-paid-amount": "Gezahlt",
"total-scans": "gesamte Scans",
"total_donation_amount_in_eur": "Gesamtbetrag in €",
"track": "Track",

View File

@@ -187,7 +187,7 @@
"donor": "Donor",
"donor-added": "Donor added",
"donor-deleted": "donor deleted",
"donor-has-no-associated-donations": "Donor has no associated donations.",
"donor-has-no-associated-donations": "No donations",
"donor-is-being-added": "Donor is being added...",
"donor-is-being-updated": "Donor is being updated",
"donors": "Donors",
@@ -442,7 +442,7 @@
"total-donation-count": "total donations (count)",
"total-donations": "total donations",
"total-donors": "total donors",
"total-paid-amount": "Total paid amount",
"total-paid-amount": "Paid",
"total-scans": "total scans",
"total_donation_amount_in_eur": "Total donation amount in €",
"track": "Track",