Compare commits
	
		
			10 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| d6d88f5f60 | |||
| 2c208c4381 | |||
| 39bc6c4945 | |||
| b94e3b745f | |||
| 6f337aeee1 | |||
| 5d48060834 | |||
| c842c203e2 | |||
| 5bcfc8db75 | |||
| 27b4dde755 | |||
| 91ab199769 | 
							
								
								
									
										25
									
								
								CHANGELOG.md
									
									
									
									
									
								
							
							
						
						
									
										25
									
								
								CHANGELOG.md
									
									
									
									
									
								
							| @@ -2,9 +2,34 @@ | |||||||
|  |  | ||||||
| All notable changes to this project will be documented in this file. Dates are displayed in UTC. | 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) | #### [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) | - 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(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): 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) | - feat(donations): Donations reactive create and load into datatable [`02003ec`](https://git.odit.services/lfk/frontend/commit/02003ec80efc16aabd126710a6eeac18df43f841) | ||||||
|   | |||||||
| @@ -13,7 +13,7 @@ | |||||||
| </head> | </head> | ||||||
|  |  | ||||||
| <body> | <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> |   <noscript>You need to enable JavaScript to run this app.</noscript> | ||||||
|   <script src="/env.js"></script> |   <script src="/env.js"></script> | ||||||
|   <script type="module" src="/src/main.js"></script> |   <script type="module" src="/src/main.js"></script> | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| { | { | ||||||
| 	"name": "@odit/lfk-frontend", | 	"name": "@odit/lfk-frontend", | ||||||
| 	"version": "1.3.0", | 	"version": "1.3.3", | ||||||
| 	"type": "module", | 	"type": "module", | ||||||
| 	"scripts": { | 	"scripts": { | ||||||
| 		"i18n-order": "node order.js", | 		"i18n-order": "node order.js", | ||||||
| @@ -39,7 +39,7 @@ | |||||||
| 		} | 		} | ||||||
| 	}, | 	}, | ||||||
| 	"dependencies": { | 	"dependencies": { | ||||||
| 		"@odit/lfk-client-js": "1.1.0", | 		"@odit/lfk-client-js": "1.1.1", | ||||||
| 		"@paralleldrive/cuid2": "^2.2.0", | 		"@paralleldrive/cuid2": "^2.2.0", | ||||||
| 		"@tanstack/svelte-table": "^8.8.5", | 		"@tanstack/svelte-table": "^8.8.5", | ||||||
| 		"bwip-js": "^3.4.0", | 		"bwip-js": "^3.4.0", | ||||||
|   | |||||||
| @@ -23,6 +23,7 @@ | |||||||
|   import DonationStatus from "./DonationStatus.svelte"; |   import DonationStatus from "./DonationStatus.svelte"; | ||||||
|   import DonationTableAction from "./DonationTableAction.svelte"; |   import DonationTableAction from "./DonationTableAction.svelte"; | ||||||
|   import DeleteDonationModal from "./DeleteDonationModal.svelte"; |   import DeleteDonationModal from "./DeleteDonationModal.svelte"; | ||||||
|  |   import { donationDonorFilter, donationRunnerFilter } from "../shared/tablefilters"; | ||||||
|   $: searchvalue = ""; |   $: searchvalue = ""; | ||||||
|   $: active_deletes = []; |   $: active_deletes = []; | ||||||
|   $: active_edits = []; |   $: active_edits = []; | ||||||
| @@ -54,7 +55,7 @@ | |||||||
|       cell: (info) => { |       cell: (info) => { | ||||||
|         return renderComponent(DonationDonor, { donor: info.getValue() }); |         return renderComponent(DonationDonor, { donor: info.getValue() }); | ||||||
|       }, |       }, | ||||||
|       filterFn: `includesString`, |       filterFn: `donor`, | ||||||
|     }, |     }, | ||||||
|     { |     { | ||||||
|       accessorKey: "runner", |       accessorKey: "runner", | ||||||
| @@ -62,7 +63,7 @@ | |||||||
|       cell: (info) => { |       cell: (info) => { | ||||||
|         return renderComponent(DonationRunner, { runner: info.getValue() }); |         return renderComponent(DonationRunner, { runner: info.getValue() }); | ||||||
|       }, |       }, | ||||||
|       filterFn: `includesString`, |       filterFn: `runner`, | ||||||
|     }, |     }, | ||||||
|     { |     { | ||||||
|       accessorKey: "amountPerDistance", |       accessorKey: "amountPerDistance", | ||||||
| @@ -139,6 +140,10 @@ | |||||||
|         pageSize: 50, |         pageSize: 50, | ||||||
|       }, |       }, | ||||||
|     }, |     }, | ||||||
|  |     filterFns: { | ||||||
|  |       donor: donationDonorFilter, | ||||||
|  |       runner: donationRunnerFilter, | ||||||
|  |     }, | ||||||
|     enableRowSelection: true, |     enableRowSelection: true, | ||||||
|     getCoreRowModel: getCoreRowModel(), |     getCoreRowModel: getCoreRowModel(), | ||||||
|     getFilteredRowModel: getFilteredRowModel(), |     getFilteredRowModel: getFilteredRowModel(), | ||||||
|   | |||||||
| @@ -17,10 +17,10 @@ | |||||||
|       > |       > | ||||||
|     {:else} |     {:else} | ||||||
|       <a |       <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" |         class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-700 text-white mr-1" | ||||||
|         >{$_("fixed-donation")}: |         >{$_("fixed-donation")}: | ||||||
|         {(d.amount / 100) |         {(donation.amount / 100) | ||||||
|           .toFixed(2) |           .toFixed(2) | ||||||
|           .toLocaleString("de-DE", { valute: "EUR" })}€</a |           .toLocaleString("de-DE", { valute: "EUR" })}€</a | ||||||
|       > |       > | ||||||
|   | |||||||
| @@ -22,9 +22,9 @@ | |||||||
|   import TableActions from "../shared/TableActions.svelte"; |   import TableActions from "../shared/TableActions.svelte"; | ||||||
|   import DonorAddress from "./DonorAddress.svelte"; |   import DonorAddress from "./DonorAddress.svelte"; | ||||||
|   import DonorDonations from "./DonorDonations.svelte"; |   import DonorDonations from "./DonorDonations.svelte"; | ||||||
|  |   import { filterAddress, filterName } from "../shared/tablefilters"; | ||||||
|   $: searchvalue = ""; |   $: searchvalue = ""; | ||||||
|   $: active_deletes = []; |   $: active_deletes = []; | ||||||
|   $: current_donations = []; |  | ||||||
|   $: selectedDonors = |   $: selectedDonors = | ||||||
|     $table?.getSelectedRowModel().rows.map((row) => row.original) || []; |     $table?.getSelectedRowModel().rows.map((row) => row.original) || []; | ||||||
|   $: selected = |   $: selected = | ||||||
| @@ -32,8 +32,6 @@ | |||||||
|  |  | ||||||
|   $: dataLoaded = false; |   $: dataLoaded = false; | ||||||
|  |  | ||||||
|   let modal_open = false; |  | ||||||
|   let delete_donor = {}; |  | ||||||
|   export let current_donors = []; |   export let current_donors = []; | ||||||
|   export const addDonors = (donors) => { |   export const addDonors = (donors) => { | ||||||
|     current_donors = current_donors.concat(...donors); |     current_donors = current_donors.concat(...donors); | ||||||
| @@ -61,7 +59,7 @@ | |||||||
|           return `${d.firstname} ${d.lastname}`; |           return `${d.firstname} ${d.lastname}`; | ||||||
|         } |         } | ||||||
|       }, |       }, | ||||||
|       filterFn: `includesString`, |       filterFn: `name`, | ||||||
|     }, |     }, | ||||||
|     { |     { | ||||||
|       accessorKey: "address", |       accessorKey: "address", | ||||||
| @@ -69,16 +67,13 @@ | |||||||
|       cell: (info) => { |       cell: (info) => { | ||||||
|         return renderComponent(DonorAddress, { address: info.getValue() }); |         return renderComponent(DonorAddress, { address: info.getValue() }); | ||||||
|       }, |       }, | ||||||
|       filterFn: `includesString`, |       filterFn: `address`, | ||||||
|     }, |     }, | ||||||
|     { |     { | ||||||
|       accessorKey: "sponsorings", |       accessorKey: "donations", | ||||||
|       header: () => $_("sponsorings"), |       header: () => $_("sponsorings"), | ||||||
|       cell: (info) => { |       cell: (info) => { | ||||||
|         const donations = current_donations.filter( |         return renderComponent(DonorDonations, { donations: info.getValue() }); | ||||||
|           (d) => d?.donor?.id == info.row.original.id |  | ||||||
|         ); |  | ||||||
|         return renderComponent(DonorDonations, { donations }); |  | ||||||
|       }, |       }, | ||||||
|       enableColumnFilter: false, |       enableColumnFilter: false, | ||||||
|     }, |     }, | ||||||
| @@ -131,6 +126,10 @@ | |||||||
|         pageSize: 50, |         pageSize: 50, | ||||||
|       }, |       }, | ||||||
|     }, |     }, | ||||||
|  |     filterFns: { | ||||||
|  |       name: filterName, | ||||||
|  |       address: filterAddress, | ||||||
|  |     }, | ||||||
|     enableRowSelection: true, |     enableRowSelection: true, | ||||||
|     getCoreRowModel: getCoreRowModel(), |     getCoreRowModel: getCoreRowModel(), | ||||||
|     getFilteredRowModel: getFilteredRowModel(), |     getFilteredRowModel: getFilteredRowModel(), | ||||||
| @@ -150,16 +149,11 @@ | |||||||
|     let page = 0; |     let page = 0; | ||||||
|     while (page >= 0) { |     while (page >= 0) { | ||||||
|       const donors = await DonorService.donorControllerGetAll(page, 500); |       const donors = await DonorService.donorControllerGetAll(page, 500); | ||||||
|       const donations = await DonationService.donationControllerGetAll( |       if (donors.length == 0) { | ||||||
|         page, |  | ||||||
|         500 |  | ||||||
|       ); |  | ||||||
|       if (donors.length == 0 && donations.length == 0) { |  | ||||||
|         page = -2; |         page = -2; | ||||||
|       } |       } | ||||||
|  |  | ||||||
|       current_donors = current_donors.concat(...donors); |       current_donors = current_donors.concat(...donors); | ||||||
|       current_donations = current_donations.concat(...donors); |  | ||||||
|       options.update((options) => ({ |       options.update((options) => ({ | ||||||
|         ...options, |         ...options, | ||||||
|         data: current_donors, |         data: current_donors, | ||||||
| @@ -194,7 +188,6 @@ | |||||||
|   modal_open={active_deletes.length > 0} |   modal_open={active_deletes.length > 0} | ||||||
|   delete_donor={active_deletes[0]} |   delete_donor={active_deletes[0]} | ||||||
| /> | /> | ||||||
| {active_deletes.length} |  | ||||||
| {#if store.state.jwtinfo.userdetails.permissions.includes("DONOR:GET")} | {#if store.state.jwtinfo.userdetails.permissions.includes("DONOR:GET")} | ||||||
|   {#if !dataLoaded} |   {#if !dataLoaded} | ||||||
|     <div |     <div | ||||||
|   | |||||||
| @@ -15,17 +15,48 @@ export const groupFilter = (row, columnId, value) => { | |||||||
| }; | }; | ||||||
| export const runnerFilter = (row, columnId, value) => { | export const runnerFilter = (row, columnId, value) => { | ||||||
|     const runner = row.getValue(columnId); |     const runner = row.getValue(columnId); | ||||||
|     if(!runner && value == "blanko"){return true} |     return filterRunner(runner, value) | ||||||
|     if(!runner){return false} | }; | ||||||
|  |  | ||||||
|     if(value.startsWith("#")){ | export const donationRunnerFilter = (row, columnId, value) => { | ||||||
|         return runner.id == value.replace("#","") |     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.middlename} ${runner.lastname}`.toLowerCase().includes(value.toLowerCase()) | ||||||
|     } |     } | ||||||
|     return `${runner.firstname} ${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) => { | export const statusFilter = (row, columnId, value) => { | ||||||
|   | |||||||
| @@ -187,7 +187,7 @@ | |||||||
|     "donor": "Sponsor:in", |     "donor": "Sponsor:in", | ||||||
|     "donor-added": "Sponsor:in hinzugefügt", |     "donor-added": "Sponsor:in hinzugefügt", | ||||||
|     "donor-deleted": "Sponsor:in gelöscht", |     "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-added": "Sponsor:in wird hinzugefügt...", | ||||||
|     "donor-is-being-updated": "Sponsor:in wird aktualisiert", |     "donor-is-being-updated": "Sponsor:in wird aktualisiert", | ||||||
|     "donors": "Sponsor:innen", |     "donors": "Sponsor:innen", | ||||||
| @@ -442,7 +442,7 @@ | |||||||
|     "total-donation-count": "Gesamte Sponsorings", |     "total-donation-count": "Gesamte Sponsorings", | ||||||
|     "total-donations": "Spendensumme", |     "total-donations": "Spendensumme", | ||||||
|     "total-donors": "gesamte Sponsor:innen", |     "total-donors": "gesamte Sponsor:innen", | ||||||
|     "total-paid-amount": "Gezahlter Gesamtbetrag", |     "total-paid-amount": "Gezahlt", | ||||||
|     "total-scans": "gesamte Scans", |     "total-scans": "gesamte Scans", | ||||||
|     "total_donation_amount_in_eur": "Gesamtbetrag in €", |     "total_donation_amount_in_eur": "Gesamtbetrag in €", | ||||||
|     "track": "Track", |     "track": "Track", | ||||||
|   | |||||||
| @@ -187,7 +187,7 @@ | |||||||
|     "donor": "Donor", |     "donor": "Donor", | ||||||
|     "donor-added": "Donor added", |     "donor-added": "Donor added", | ||||||
|     "donor-deleted": "donor deleted", |     "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-added": "Donor is being added...", | ||||||
|     "donor-is-being-updated": "Donor is being updated", |     "donor-is-being-updated": "Donor is being updated", | ||||||
|     "donors": "Donors", |     "donors": "Donors", | ||||||
| @@ -442,7 +442,7 @@ | |||||||
|     "total-donation-count": "total donations (count)", |     "total-donation-count": "total donations (count)", | ||||||
|     "total-donations": "total donations", |     "total-donations": "total donations", | ||||||
|     "total-donors": "total donors", |     "total-donors": "total donors", | ||||||
|     "total-paid-amount": "Total paid amount", |     "total-paid-amount": "Paid", | ||||||
|     "total-scans": "total scans", |     "total-scans": "total scans", | ||||||
|     "total_donation_amount_in_eur": "Total donation amount in €", |     "total_donation_amount_in_eur": "Total donation amount in €", | ||||||
|     "track": "Track", |     "track": "Track", | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user