diff --git a/src/App.svelte b/src/App.svelte index ff087e81..c8964a12 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -27,12 +27,13 @@ storeName: "lfk_admin", description: "LfK! admin dashbaord", }); - window.onunhandledrejection = event => { - if(event.reason.toString() == "Error: Unauthorized"){ - console.log("Found 1") - localForage.clear(); - location.replace("/"); - }}; + window.onunhandledrejection = (event) => { + if (event.reason.toString() == "Error: Unauthorized") { + console.log("Found 1"); + localForage.clear(); + location.replace("/"); + } + }; // import Login from "./components/auth/Login.svelte"; import Dashboard from "./components/dashboard/Dashboard.svelte"; @@ -61,7 +62,8 @@ import ResetPassword from "./components/auth/ResetPassword.svelte"; import Contacts from "./components/contacts/Contacts.svelte"; import ContactDetail from "./components/contacts/ContactDetail.svelte"; -import Donors from "./components/donors/Donors.svelte"; + import Donors from "./components/donors/Donors.svelte"; + import DonorDetail from "./components/donors/DonorDetail.svelte"; store.init(); registerSW(); @@ -148,6 +150,9 @@ import Donors from "./components/donors/Donors.svelte"; + + + diff --git a/src/components/donors/DonorDetail.svelte b/src/components/donors/DonorDetail.svelte new file mode 100644 index 00000000..c617164c --- /dev/null +++ b/src/components/donors/DonorDetail.svelte @@ -0,0 +1,377 @@ + + + +{#await promise} + Loading donor details +{:then} +
+
+
+ +
+
+
+ {original_data.firstname} + {original_data.middlename || ''} + {original_data.lastname} + + {#if store.state.jwtinfo.userdetails.permissions.includes('DONOR:DELETE')} + {#if delete_triggered} + + + {/if} + {#if !delete_triggered} + + {/if} + {/if} + {#if !delete_triggered} + + {/if} + +
+ +
+ + + {#if !isFirstnameValid} + + {$_('first-name-is-required')} + + {/if} +
+
+ + +
+
+ + + {#if !isLastnameValid} + + {$_('last-name-is-required')} + + {/if} +
+
+ + + {#if !isEmailValid} + + {$_('valid-email-is-required')} + + {/if} +
+
+ + + {#if !isPhoneValidOrEmpty} + + {$_('valid-international-phone-number-is-required')} + + {/if} +
+
+
+ +
+
+ +
+
+ {#if editable.address_checked === true} +
+ + + {#if !isAddress1Valid} + + {$_('address-is-required')} + + {/if} +
+
+ + +
+
+ + + {#if !iszipcodevalid} + + {$_('valid-zipcode-postal-code-is-required')} + + {/if} +
+
+ + + {#if !iscityvalid} + + {$_('valid-city-is-required')} + + {/if} +
+ {/if} +
+{:catch error} + +{/await}