Compare commits
	
		
			33 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 87370d24be | |||
| 8f8b9988ad | |||
| f8ccf4f5d8 | |||
| 25d8b86efd | |||
| 89bb9c215e | |||
| 2d18686ce7 | |||
| 1d999d4910 | |||
| 7dfaa7579a | |||
| 08cb079e97 | |||
| 450aa83592 | |||
| 0614c76e92 | |||
| 97e338f9d4 | |||
| 636f018daa | |||
| c8d639024a | |||
| f7fc1967a5 | |||
| aedb8a765b | |||
| cf58bd15c3 | |||
| 34f4f68524 | |||
| 09b8144080 | |||
| f1e6fb4ce7 | |||
| 4167819e7a | |||
| 5bd3a463f0 | |||
| 79c447b4c6 | |||
| 540304f947 | |||
| 75d8f7331b | |||
| b2509e9e53 | |||
| 7862f44653 | |||
| 962dd0c1bb | |||
| 5d5f7c7f5c | |||
| 6aaf838451 | |||
| ad3bd312e9 | |||
| 5fa9939696 | |||
| 4956bb0e9c | 
							
								
								
									
										39
									
								
								CHANGELOG.md
									
									
									
									
									
								
							
							
						
						
									
										39
									
								
								CHANGELOG.md
									
									
									
									
									
								
							| @@ -2,8 +2,47 @@ | ||||
|  | ||||
| All notable changes to this project will be documented in this file. Dates are displayed in UTC. | ||||
|  | ||||
| #### [0.11.0](https://git.odit.services/lfk/frontend/compare/0.10.0...0.11.0) | ||||
|  | ||||
| - Merge pull request 'Generate and print bulk blank cards feature/116-download_blanc_cards' (#117) from feature/116-download_blanc_cards into dev [`25d8b86`](https://git.odit.services/lfk/frontend/commit/25d8b86efd89c442d1bf308a8743134820acfd1f) | ||||
| - Added button (including translations [`0614c76`](https://git.odit.services/lfk/frontend/commit/0614c76e924b18b512bab59933a26fec07cf483d) | ||||
| - Added button (including translations [`97e338f`](https://git.odit.services/lfk/frontend/commit/97e338f9d4f388596d550990457254c7fa1a3492) | ||||
| - Sorted translations [`89bb9c2`](https://git.odit.services/lfk/frontend/commit/89bb9c215e356e0940678f5cabd9e38bc203040e) | ||||
| - Added function for generating cards with pdf [`c8d6390`](https://git.odit.services/lfk/frontend/commit/c8d639024a5f2f72d6e30d2ce990b08bd71a5471) | ||||
| - Fixed button styling [`08cb079`](https://git.odit.services/lfk/frontend/commit/08cb079e9798392e26515d559af2637e74deea97) | ||||
| - Now returning cards on creation with pdf [`1d999d4`](https://git.odit.services/lfk/frontend/commit/1d999d4910acb5efa21b3f9922cdb359babff404) | ||||
| - Added comment [`636f018`](https://git.odit.services/lfk/frontend/commit/636f018daa33b99468a257bfc33477e1e644d081) | ||||
| - Bumped lfk client js version [`2d18686`](https://git.odit.services/lfk/frontend/commit/2d18686ce782a434ca7bd34c07c36a35b9497273) | ||||
| - Bumped lfk-client-js [`7dfaa75`](https://git.odit.services/lfk/frontend/commit/7dfaa7579a22b13194fcdd1c02b4437958261472) | ||||
|  | ||||
| #### [0.10.0](https://git.odit.services/lfk/frontend/compare/0.9.1...0.10.0) | ||||
|  | ||||
| > 26 March 2021 | ||||
|  | ||||
| - Added translations [`79c447b`](https://git.odit.services/lfk/frontend/commit/79c447b4c65e55ebb5af71fb0b09174c36e2cecf) | ||||
| - Sorted translations 🌍 [`5bd3a46`](https://git.odit.services/lfk/frontend/commit/5bd3a463f00abaf2c98ab554f88e5542d01f364a) | ||||
| - Reset can now only be triggered if pw is strong enoug [`75d8f73`](https://git.odit.services/lfk/frontend/commit/75d8f7331b6ae78f3979bb62148188a16f83cb8d) | ||||
| - Module now exports functions that check if a password is strong enough and equal to a potential confirmation field [`b2509e9`](https://git.odit.services/lfk/frontend/commit/b2509e9e53ab6b51dfd55e26712e8928160cd64b) | ||||
| - 🚀RELEASE v0.10.0 [`f7fc196`](https://git.odit.services/lfk/frontend/commit/f7fc1967a50f302af1d8b668628be2f4ab2975a3) | ||||
| - Added more cirteria to the password strength component [`5fa9939`](https://git.odit.services/lfk/frontend/commit/5fa9939696a35d60d762feb0cebef61d31869218) | ||||
| - Now using pw strength component [`6aaf838`](https://git.odit.services/lfk/frontend/commit/6aaf8384512185a3a319ce6b3e2505e910468e64) | ||||
| - Added a password strength verification [`ad3bd31`](https://git.odit.services/lfk/frontend/commit/ad3bd312e9a5785f81029ea2b7e302ea1addd988) | ||||
| - Implemented a custom password strength component [`4956bb0`](https://git.odit.services/lfk/frontend/commit/4956bb0e9c3c1d22d60e849aea5664e35330f897) | ||||
| - User creation can now only be triggered if pw is strong enoug [`540304f`](https://git.odit.services/lfk/frontend/commit/540304f947f60a7072c592ca8088996ce7e95cb4) | ||||
| - Now using pw strength component for user creation [`7862f44`](https://git.odit.services/lfk/frontend/commit/7862f446532903f1a2eac7b21d5c80c3245785e5) | ||||
| - Added missing exports [`962dd0c`](https://git.odit.services/lfk/frontend/commit/962dd0c1bbc0df7f20bcec5b4247188c8935c87e) | ||||
| - new license file version [CI SKIP] [`aedb8a7`](https://git.odit.services/lfk/frontend/commit/aedb8a765ba053545adbba9eb014b3bb0e5aac8c) | ||||
| - Bumped lfk-client version 🔝 [`cf58bd1`](https://git.odit.services/lfk/frontend/commit/cf58bd15c3541c417ab2be83d96135e931a2b6f6) | ||||
| - new license file version [CI SKIP] [`34f4f68`](https://git.odit.services/lfk/frontend/commit/34f4f68524918fd3d1963966a1e259d5b60efaca) | ||||
| - Merge pull request 'Implemented password strength test feature/106-password_strength' (#115) from feature/106-password_strength into dev [`09b8144`](https://git.odit.services/lfk/frontend/commit/09b81440804cf98303fcb723a9717d6d0f432da8) | ||||
| - Formatting🛠 [`4167819`](https://git.odit.services/lfk/frontend/commit/4167819e7a864d3b1dd95ba48ab1525a454f7f30) | ||||
| - Now using pw strength component for reset [`5d5f7c7`](https://git.odit.services/lfk/frontend/commit/5d5f7c7f5c6a69146f41996f4facfeff95791be0) | ||||
|  | ||||
| #### [0.9.1](https://git.odit.services/lfk/frontend/compare/0.9.0...0.9.1) | ||||
|  | ||||
| > 26 March 2021 | ||||
|  | ||||
| - 🚀RELEASE v0.9.1 [`2ca63fd`](https://git.odit.services/lfk/frontend/commit/2ca63fd1f675f0da2b18ba43095074dd4823991d) | ||||
| - Merge pull request 'Org selfservice Link feature/112-org_registration_links' (#114) from feature/112-org_registration_links into dev [`a5d25e7`](https://git.odit.services/lfk/frontend/commit/a5d25e7d92c7c37e90dbb4ba74b787873f920c6b) | ||||
| - Added checkbox to enable registration [`f9fe793`](https://git.odit.services/lfk/frontend/commit/f9fe79357317653b46c09eb95b0db13845cddcf9) | ||||
| - Sorted translations [`c074c12`](https://git.odit.services/lfk/frontend/commit/c074c12be75f285612f7a732c106404d9fb4538a) | ||||
|   | ||||
| @@ -14,7 +14,7 @@ | ||||
| </head> | ||||
|  | ||||
| <body> | ||||
|   <span style="display: none;visibility: hidden;" id="buildinfo">RELEASE_INFO-0.9.1-RELEASE_INFO</span> | ||||
|   <span style="display: none;visibility: hidden;" id="buildinfo">RELEASE_INFO-0.11.0-RELEASE_INFO</span> | ||||
|   <noscript>You need to enable JavaScript to run this app.</noscript> | ||||
|   <script src="/env.js"></script> | ||||
|   <script defer type="module" src="/_dist_/index.js"></script> | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| { | ||||
| 	"name": "@odit/lfk-frontend", | ||||
| 	"version": "0.9.1", | ||||
| 	"version": "0.11.0", | ||||
| 	"scripts": { | ||||
| 		"i18n-order": "node order.js", | ||||
| 		"dev:all": "yarn prebuild && snowpack dev", | ||||
| @@ -13,7 +13,8 @@ | ||||
| 	}, | ||||
| 	"license": "CC-BY-NC-SA-4.0", | ||||
| 	"dependencies": { | ||||
| 		"@odit/lfk-client-js": "0.7.0", | ||||
| 		"@odit/lfk-client-js": "0.9.2", | ||||
| 		"check-password-strength": "^2.0.2", | ||||
| 		"csvtojson": "^2.0.10", | ||||
| 		"gridjs": "3.3.0", | ||||
| 		"localforage": "1.9.0", | ||||
|   | ||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										52
									
								
								src/components/auth/PasswordStrength.svelte
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										52
									
								
								src/components/auth/PasswordStrength.svelte
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,52 @@ | ||||
| <script context="module"> | ||||
|     import { passwordStrength } from "check-password-strength"; | ||||
|     export function password_strong_enough(password_change) { | ||||
|         let strength = passwordStrength(password_change); | ||||
|         return ( | ||||
|             strength?.contains.includes("lowercase") && | ||||
|             strength?.contains.includes("uppercase") && | ||||
|             strength?.contains.includes("number") && | ||||
|             strength?.length > 9 | ||||
|         ); | ||||
|     } | ||||
|     export function password_strong_enough_and_equal( | ||||
|         password_change, | ||||
|         password_confirm | ||||
|     ) { | ||||
|         return ( | ||||
|             password_strong_enough(password_change) && | ||||
|             password_change === password_confirm | ||||
|         ); | ||||
|     } | ||||
| </script> | ||||
|  | ||||
| <script> | ||||
|     import { getLocaleFromNavigator, _ } from "svelte-i18n"; | ||||
|     import { passwordStrength as Strength } from "check-password-strength"; | ||||
|     export let password_change; | ||||
|     export let password_confirm; | ||||
|  | ||||
|     $: strength = Strength(password_change); | ||||
|     $: passwords_match = | ||||
|         !password_confirm || password_confirm === password_change; | ||||
| </script> | ||||
|  | ||||
| <div class="ml-4"> | ||||
|     <ul class="list-disc font-medium tracking-wide text-red-500 text-xs"> | ||||
|         {#if !strength.contains.includes('lowercase')} | ||||
|             <li>{$_('must-contain-a-lowercase-letter')}</li> | ||||
|         {/if} | ||||
|         {#if !strength.contains.includes('uppercase')} | ||||
|             <li>{$_('must-contain-a-uppercase-letter')}</li> | ||||
|         {/if} | ||||
|         {#if !strength.contains.includes('number')} | ||||
|             <li>{$_('must-contain-a-number')}</li> | ||||
|         {/if} | ||||
|         {#if !(strength.length > 9)} | ||||
|             <li>{$_('must-be-at-least-10-characters-long')}</li> | ||||
|         {/if} | ||||
|         {#if !(passwords_match == true)} | ||||
|             <li>{$_('passwords-dont-match')}</li> | ||||
|         {/if} | ||||
|     </ul> | ||||
| </div> | ||||
| @@ -1,38 +1,43 @@ | ||||
| <script> | ||||
|   import {  AuthService } from "@odit/lfk-client-js"; | ||||
|   import { AuthService } from "@odit/lfk-client-js"; | ||||
|   import { _ } from "svelte-i18n"; | ||||
|   import Toastify from "toastify-js"; | ||||
|   import "toastify-js/src/toastify.css"; | ||||
|   import PasswordStrength, { | ||||
|     password_strong_enough, | ||||
|   } from "../auth/PasswordStrength.svelte"; | ||||
|   let state = "reset_in_progress"; | ||||
|   let password = ""; | ||||
|   export let params; | ||||
|   function set_new_password() { | ||||
|       if(password.trim() !== ""){ | ||||
|         Toastify({ | ||||
|           text: $_('password-reset-in-progress'), | ||||
|           duration: 3500, | ||||
|         }).showToast(); | ||||
|         AuthService.authControllerResetPassword(atob(params.resetkey),{ password }) | ||||
|     if (password.trim() !== "") { | ||||
|       Toastify({ | ||||
|         text: $_("password-reset-in-progress"), | ||||
|         duration: 3500, | ||||
|       }).showToast(); | ||||
|       AuthService.authControllerResetPassword(atob(params.resetkey), { | ||||
|         password, | ||||
|       }) | ||||
|         .then((resp) => { | ||||
|           Toastify({ | ||||
|             text: $_('password-reset-successful'), | ||||
|             text: $_("password-reset-successful"), | ||||
|             duration: 3500, | ||||
|           }).showToast(); | ||||
|           state="reset_success"; | ||||
|           state = "reset_success"; | ||||
|         }) | ||||
|         .catch((err) => { | ||||
|           state="reset_error"; | ||||
|           state = "reset_error"; | ||||
|         }); | ||||
|       } else { | ||||
|     } else { | ||||
|       Toastify({ | ||||
|         text: $_('please-provide-a-password'), | ||||
|         text: $_("please-provide-a-password"), | ||||
|         duration: 3500, | ||||
|       }).showToast(); | ||||
|     } | ||||
|   } | ||||
| </script> | ||||
|  | ||||
| {#if state==="reset_success"} | ||||
| {#if state === 'reset_success'} | ||||
|   <div class="min-h-screen flex items-center justify-center bg-gray-100"> | ||||
|     <div class="max-w-md w-full py-12 px-6"> | ||||
|       <img style="height:10rem;" class="mx-auto" src="/lfk-logo.png" alt="" /> | ||||
| @@ -56,31 +61,31 @@ | ||||
|       </div> | ||||
|     </div> | ||||
|   </div> | ||||
| {:else if state==="reset_error"} | ||||
| <div class="min-h-screen flex items-center justify-center bg-gray-100"> | ||||
|   <div class="max-w-md w-full py-12 px-6"> | ||||
|     <img style="height:10rem;" class="mx-auto" src="/lfk-logo.png" alt="" /> | ||||
|     <p class="mt-6 text-lg text-center font-bold text-gray-900"> | ||||
|       {$_('application_name')} | ||||
|     </p> | ||||
|     <p class="mt-2 mb-2 text-sm text-center text-gray-900 font-bold"> | ||||
|       {$_('password-reset-failed')} | ||||
|     </p> | ||||
|     <p class="mt-2 mb-2 text-sm text-center text-gray-900"> | ||||
|       {$_('please-request-a-new-reset-mail')} | ||||
|     </p> | ||||
|     <div class="mt-6"> | ||||
| {:else if state === 'reset_error'} | ||||
|   <div class="min-h-screen flex items-center justify-center bg-gray-100"> | ||||
|     <div class="max-w-md w-full py-12 px-6"> | ||||
|       <img style="height:10rem;" class="mx-auto" src="/lfk-logo.png" alt="" /> | ||||
|       <p class="mt-6 text-lg text-center font-bold text-gray-900"> | ||||
|         {$_('application_name')} | ||||
|       </p> | ||||
|       <p class="mt-2 mb-2 text-sm text-center text-gray-900 font-bold"> | ||||
|         {$_('password-reset-failed')} | ||||
|       </p> | ||||
|       <p class="mt-2 mb-2 text-sm text-center text-gray-900"> | ||||
|         {$_('please-request-a-new-reset-mail')} | ||||
|       </p> | ||||
|       <div class="mt-6"> | ||||
|         <a | ||||
|           href="/forgot_password/" | ||||
|           class="text-center relative block w-full py-2 px-3 border border-transparent rounded-md text-white font-semibold bg-gray-800 hover:bg-gray-700 focus:bg-gray-900 focus:outline-none focus:shadow-outline sm:text-sm"> | ||||
|           {$_('request-a-new-reset-mail')} | ||||
|         </a> | ||||
|         <div class="mt-6"> | ||||
|           <a | ||||
|             href="/forgot_password/" | ||||
|             class="text-center relative block w-full py-2 px-3 border border-transparent rounded-md text-white font-semibold bg-gray-800 hover:bg-gray-700 focus:bg-gray-900 focus:outline-none focus:shadow-outline sm:text-sm"> | ||||
|             {$_('request-a-new-reset-mail')} | ||||
|           </a> | ||||
|         </div> | ||||
|       </div> | ||||
|     </div> | ||||
|   </div> | ||||
| </div> | ||||
| {:else if state==="reset_in_progress"} | ||||
| {:else if state === 'reset_in_progress'} | ||||
|   <div class="min-h-screen flex items-center justify-center bg-gray-100"> | ||||
|     <div class="max-w-md w-full py-12 px-6"> | ||||
|       <img style="height:10rem;" class="mx-auto" src="/lfk-logo.png" alt="" /> | ||||
| @@ -102,11 +107,14 @@ | ||||
|               placeholder={$_('new-password')} | ||||
|               bind:value={password} /> | ||||
|           </div> | ||||
|           <PasswordStrength bind:password_change={password} /> | ||||
|         </div> | ||||
|  | ||||
|         <div class="mt-5"> | ||||
|           <button | ||||
|             on:click={set_new_password} | ||||
|             disabled={!password_strong_enough(password)} | ||||
|             class:opacity-50={!password_strong_enough(password)} | ||||
|             type="submit" | ||||
|             class="relative block w-full py-2 px-3 border border-transparent rounded-md text-white font-semibold bg-gray-800 hover:bg-gray-700 focus:bg-gray-900 focus:outline-none focus:shadow-outline sm:text-sm"> | ||||
|             <span class="absolute left-0 inset-y pl-3"> | ||||
|   | ||||
| @@ -22,19 +22,19 @@ | ||||
|       if (e.keyCode === 13) { | ||||
|         if (createbtnenabled === true) { | ||||
|           createbtnenabled = false; | ||||
|           submit(); | ||||
|           submit_with_print(); | ||||
|         } | ||||
|       } | ||||
|     }; | ||||
|   })(); | ||||
|   function submit() { | ||||
|   function submit_without_print() { | ||||
|     if (processed_last_submit === true) { | ||||
|       processed_last_submit = false; | ||||
|       const toast = Toastify({ | ||||
|         text: $_("creating-blanco-cards"), | ||||
|         duration: -1, | ||||
|       }).showToast(); | ||||
|       RunnerCardService.runnerCardControllerPostBlancoBulk(card_count) | ||||
|       RunnerCardService.runnerCardControllerPostBlancoBulk(card_count, false) | ||||
|         .then((result) => { | ||||
|           bulk_modal_open = false; | ||||
|           // | ||||
| @@ -54,6 +54,80 @@ | ||||
|         }); | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   function submit_with_print() { | ||||
|     if (processed_last_submit === true) { | ||||
|       processed_last_submit = false; | ||||
|       const toast = Toastify({ | ||||
|         text: $_("creating-blanco-cards"), | ||||
|         duration: -1, | ||||
|       }).showToast(); | ||||
|       RunnerCardService.runnerCardControllerPostBlancoBulk(card_count, true) | ||||
|         .then((result) => { | ||||
|           bulk_modal_open = false; | ||||
|           // | ||||
|           Toastify({ | ||||
|             text: $_("created-blanco-cards"), | ||||
|             duration: 500, | ||||
|             backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)", | ||||
|           }).showToast(); | ||||
|           current_cards = current_cards.concat(result); | ||||
|           const toast = Toastify({ | ||||
|             text: $_("generating-pdf"), | ||||
|             duration: -1, | ||||
|           }).showToast(); | ||||
|           fetch( | ||||
|             `${config.baseurl}/documents/cards?&download=true&key=${config.documentserver_key}`, | ||||
|             { | ||||
|               method: "POST", | ||||
|               headers: { | ||||
|                 "Content-Type": "application/json", | ||||
|               }, | ||||
|               body: JSON.stringify(result), | ||||
|             } | ||||
|           ) | ||||
|             .then((response) => { | ||||
|               if (response.status != "200") { | ||||
|                 toast.hideToast(); | ||||
|                 Toastify({ | ||||
|                   text: $_("pdf-generation-failed"), | ||||
|                   duration: 3500, | ||||
|                   backgroundColor: | ||||
|                     "linear-gradient(90deg, hsla(281, 37%, 45%, 1) 0%, hsla(1, 62%, 48%, 1) 100%)", | ||||
|                 }).showToast(); | ||||
|               } else { | ||||
|                 return response.blob(); | ||||
|               } | ||||
|             }) | ||||
|             .then((blob) => { | ||||
|               const url = window.URL.createObjectURL(blob); | ||||
|               let a = document.createElement("a"); | ||||
|               a.href = url; | ||||
|               a.download = "Bulkcards.pdf"; | ||||
|               document.body.appendChild(a); | ||||
|               a.click(); | ||||
|               a.remove(); | ||||
|               toast.hideToast(); | ||||
|               Toastify({ | ||||
|                 text: $_("pdf-successfully-generated"), | ||||
|                 duration: 3500, | ||||
|                 backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)", | ||||
|               }).showToast(); | ||||
|             }) | ||||
|             .catch((err) => { | ||||
|               console.error(err); | ||||
|             }); | ||||
|         }) | ||||
|         .catch((err) => { | ||||
|           // | ||||
|         }) | ||||
|         .finally(() => { | ||||
|           processed_last_submit = true; | ||||
|           // | ||||
|           toast.hideToast(); | ||||
|         }); | ||||
|     } | ||||
|   } | ||||
| </script> | ||||
|  | ||||
| {#if bulk_modal_open} | ||||
| @@ -75,14 +149,14 @@ | ||||
|         class="hidden sm:inline-block sm:align-middle sm:h-screen" | ||||
|         aria-hidden="true">​</span> | ||||
|       <div | ||||
|         class="inline-block align-bottom bg-white rounded-lg text-left shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full" | ||||
|         class="inline-block align-bottom bg-white rounded-lg text-left shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-2xl sm:w-full" | ||||
|         role="dialog" | ||||
|         aria-modal="true" | ||||
|         aria-labelledby="modal-headline"> | ||||
|         <div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4"> | ||||
|           <div class="sm:flex sm:items-start"> | ||||
|             <div | ||||
|               class="mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-100 sm:mx-0 sm:h-10 sm:w-10"> | ||||
|               class="mx-auto flex-shrink-0 flex items-center justify-center h-12 w- rounded-full bg-blue-100 sm:mx-0 sm:h-10 sm:w-10"> | ||||
|               <svg | ||||
|                 class="h-6 w-6 text-blue-600" | ||||
|                 fill="currentColor" | ||||
| @@ -138,17 +212,25 @@ | ||||
|           <button | ||||
|             disabled={!createbtnenabled} | ||||
|             class:opacity-50={!createbtnenabled} | ||||
|             on:click={submit} | ||||
|             on:click={submit_with_print} | ||||
|             type="button" | ||||
|             class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 sm:ml-3 sm:w-auto sm:text-sm"> | ||||
|             {$_('create')} | ||||
|             {$_('create-and-generate-pdf')} | ||||
|           </button> | ||||
|           <button | ||||
|             disabled={!createbtnenabled} | ||||
|             class:opacity-50={!createbtnenabled} | ||||
|             on:click={submit_without_print} | ||||
|             type="button" | ||||
|             class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-gray-400 text-base font-medium text-white hover:bg-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 sm:ml-3 sm:w-auto sm:text-sm"> | ||||
|             {$_('create-without-pdf')} | ||||
|           </button> | ||||
|           <button | ||||
|             on:click={() => { | ||||
|               bulk_modal_open = false; | ||||
|             }} | ||||
|             type="button" | ||||
|             class="mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"> | ||||
|             class="mr-auto mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"> | ||||
|             {$_('cancel')} | ||||
|           </button> | ||||
|         </div> | ||||
|   | ||||
| @@ -1,6 +1,9 @@ | ||||
| <script> | ||||
|     import { getLocaleFromNavigator, _ } from "svelte-i18n"; | ||||
|     import { RunnerOrganizationService, RunnerTeamService } from "@odit/lfk-client-js"; | ||||
|     import { | ||||
|         RunnerOrganizationService, | ||||
|         RunnerTeamService, | ||||
|     } from "@odit/lfk-client-js"; | ||||
|     import Toastify from "toastify-js"; | ||||
|     export let sponsoring_contracts_show = false; | ||||
|     export let generate_runners = []; | ||||
|   | ||||
| @@ -4,6 +4,9 @@ | ||||
|   import { MeService } from "@odit/lfk-client-js"; | ||||
|   import Toastify from "toastify-js"; | ||||
|   import ConfirmProfileDeletion from "./ConfirmProfileDeletion.svelte"; | ||||
|   import PasswordStrength, { | ||||
|     password_strong_enough_and_equal, | ||||
|   } from "../auth/PasswordStrength.svelte"; | ||||
|   $: data_loaded = false; | ||||
|   $: delete_triggered = false; | ||||
|   $: original_data = {}; | ||||
| @@ -15,8 +18,10 @@ | ||||
|     JSON.stringify(editable) === JSON.stringify(original_data) | ||||
|   ); | ||||
|   $: save_enabled = changes_performed && isEmail(editable.email); | ||||
|   $: update_password_enabled = | ||||
|     password_change.length > 0 && password_change === password_confirm; | ||||
|   $: update_password_enabled = password_strong_enough_and_equal( | ||||
|     password_change, | ||||
|     password_confirm | ||||
|   ); | ||||
|   const user_promise = MeService.meControllerGet().then((data) => { | ||||
|     data_loaded = true; | ||||
|     data.groups = data.groups.map((g) => g.id); | ||||
| @@ -45,7 +50,7 @@ | ||||
|   function changePassword() { | ||||
|     if (data_loaded === true && update_password_enabled) { | ||||
|       Toastify({ | ||||
|         text: $_('changing-your-password'), | ||||
|         text: $_("changing-your-password"), | ||||
|         duration: 2500, | ||||
|       }).showToast(); | ||||
|       let postdata = Object.assign({}, original_data); | ||||
| @@ -56,7 +61,7 @@ | ||||
|           password_change = ""; | ||||
|           postdata = {}; | ||||
|           Toastify({ | ||||
|             text: $_('password-changed'), | ||||
|             text: $_("password-changed"), | ||||
|             duration: 2500, | ||||
|             backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)", | ||||
|           }).showToast(); | ||||
| @@ -242,10 +247,7 @@ | ||||
|                     class="border-gray-300 placeholder-gray-500 appearance-none rounded-md relative block w-full px-3 py-2 border focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-sm" | ||||
|                     placeholder={$_('password')} /> | ||||
|                 </div> | ||||
|                 {#if password_change != password_confirm && password_change.length > 0} | ||||
|                   <span | ||||
|                     class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">{$_('passwords-dont-match')}</span> | ||||
|                 {/if} | ||||
|                 <PasswordStrength bind:password_change bind:password_confirm /> | ||||
|               </div> | ||||
|               <div class="px-4 py-3 bg-gray-50 text-right sm:px-6"> | ||||
|                 <button | ||||
| @@ -257,9 +259,9 @@ | ||||
|                   {$_('update-password')} | ||||
|                 </button> | ||||
|                 {#if update_password_enabled} | ||||
|                 <p> | ||||
|                   {$_('after-the-update-youll-get-logged-out-please-login-with-your-new-password-after-that')} | ||||
|                 </p> | ||||
|                   <p> | ||||
|                     {$_('after-the-update-youll-get-logged-out-please-login-with-your-new-password-after-that')} | ||||
|                   </p> | ||||
|                 {/if} | ||||
|               </div> | ||||
|             </div> | ||||
|   | ||||
| @@ -5,6 +5,9 @@ | ||||
|   import { UserService } from "@odit/lfk-client-js"; | ||||
|   import isEmail from "validator/es/lib/isEmail"; | ||||
|   import Toastify from "toastify-js"; | ||||
|   import PasswordStrength, { | ||||
|     password_strong_enough, | ||||
|   } from "../auth/PasswordStrength.svelte"; | ||||
|   export let modal_open; | ||||
|   export let current_users; | ||||
|   let firstname_input; | ||||
| @@ -28,7 +31,10 @@ | ||||
|   $: isLastnameValid = lastname_input_value.trim().length !== 0; | ||||
|   $: isFirstnameValid = firstname_input_value.trim().length !== 0; | ||||
|   $: createbtnenabled = | ||||
|     isFirstnameValid && isLastnameValid && isPasswordValid && isEmailValid; | ||||
|     isFirstnameValid && | ||||
|     isLastnameValid && | ||||
|     password_strong_enough(password_input_value) && | ||||
|     isEmailValid; | ||||
|   (function () { | ||||
|     document.onkeydown = function (e) { | ||||
|       e = e || window.event; | ||||
| @@ -203,12 +209,8 @@ | ||||
|                     type="password" | ||||
|                     name="password" | ||||
|                     class="mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm rounded-l-md sm:text-sm border-gray-300 border bg-gray-50 text-gray-500 rounded-md p-2" /> | ||||
|                   {#if !isPasswordValid} | ||||
|                     <span | ||||
|                       class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1"> | ||||
|                       {$_('password-is-required')} | ||||
|                     </span> | ||||
|                   {/if} | ||||
|                   <PasswordStrength | ||||
|                     bind:password_change={password_input_value} /> | ||||
|                 </div> | ||||
|                 <div class="col-span-6"> | ||||
|                   <label | ||||
|   | ||||
| @@ -92,12 +92,14 @@ | ||||
|     "create-a-new-track": "Neuen Track erstellen", | ||||
|     "create-a-new-user": "Neue Benutzer:in anlegen", | ||||
|     "create-a-new-user-group": "Erstelle eine neue Gruppe", | ||||
|     "create-and-generate-pdf": "Erstellen und PDF herunterladen", | ||||
|     "create-bulk-blanco-cards": "Blankokarten erstellen", | ||||
|     "create-bulk-cards": "Blankokarten erstellen", | ||||
|     "create-organization": "Organisation erstellen", | ||||
|     "create-team": "Team erstellen", | ||||
|     "create-track": "Track erstellen", | ||||
|     "create-user": "Benutzer anlegen", | ||||
|     "create-without-pdf": "Ohne PDF erstellen", | ||||
|     "created-blanco-cards": "Blankokarten wurden erstellt", | ||||
|     "creating-blanco-cards": "Erstelle Blankokarten", | ||||
|     "credits": "Credits", | ||||
| @@ -245,6 +247,10 @@ | ||||
|     "middle-name": "Mittelname", | ||||
|     "minimum-lap-time-in-s": "Minimale Rundenzeit (in Sekunden)", | ||||
|     "minimum-lap-time-must-be-a-positive-number-or-0": "Die minimale Rundenzeit muss eine positive Zahl oder 0 sein", | ||||
|     "must-be-at-least-10-characters-long": "Passwort muss mindestens 10 Zeichen lang sein!", | ||||
|     "must-contain-a-lowercase-letter": "Passwort muss einen Großbuchstaben enthalten!", | ||||
|     "must-contain-a-number": "Passwort muss eine Zahl enthalten!", | ||||
|     "must-contain-a-uppercase-letter": "Passwort muss einen Kleinbuchstaben enthalten!", | ||||
|     "name": "Name", | ||||
|     "name-is-required": "Der Gruppenname muss angegeben werden", | ||||
|     "new-password": "Neues Passwort", | ||||
| @@ -276,7 +282,7 @@ | ||||
|     "password-reset-in-progress": "Passwort wird zurückgesetzt...", | ||||
|     "password-reset-mail-sent": "Passwort-Reset Mail wurde an \"{usersEmail}\" geschickt.", | ||||
|     "password-reset-successful": "Passwort erfolgreich zurückgesetzt!", | ||||
|     "passwords-dont-match": "Die Passwörter stimmen nicht überein.", | ||||
|     "passwords-dont-match": "Die Passwörter stimmen nicht überein!", | ||||
|     "pdf-generation-failed": "PDF Generierung fehlgeschlagen!", | ||||
|     "pdf-successfully-generated": "PDF wurde erfolgreich generiert!", | ||||
|     "pdfs-successfully-generated": "Alle PDFs wurden generiert!", | ||||
|   | ||||
| @@ -92,12 +92,14 @@ | ||||
|     "create-a-new-track": "Create a new Track", | ||||
|     "create-a-new-user": "Create a new User", | ||||
|     "create-a-new-user-group": "Create a new user group", | ||||
|     "create-and-generate-pdf": "Create and generate PDF", | ||||
|     "create-bulk-blanco-cards": "Create bulk blanco cards", | ||||
|     "create-bulk-cards": "Add blanco cards", | ||||
|     "create-organization": "Create Organization", | ||||
|     "create-team": "Create Team", | ||||
|     "create-track": "Create Track", | ||||
|     "create-user": "Create User", | ||||
|     "create-without-pdf": "Create without PDF", | ||||
|     "created-blanco-cards": "Created blanco cards", | ||||
|     "creating-blanco-cards": "Creating blanco cards", | ||||
|     "credits": "Credits", | ||||
| @@ -245,6 +247,10 @@ | ||||
|     "middle-name": "Middle name", | ||||
|     "minimum-lap-time-in-s": "minimum lap time in s", | ||||
|     "minimum-lap-time-must-be-a-positive-number-or-0": "minimum lap time must be a positive number or 0", | ||||
|     "must-be-at-least-10-characters-long": "Must be at least 10 characters long!", | ||||
|     "must-contain-a-lowercase-letter": "Must contain a lowercase letter!", | ||||
|     "must-contain-a-number": "Must contain a number!", | ||||
|     "must-contain-a-uppercase-letter": "Must contain a uppercase letter!", | ||||
|     "name": "Name", | ||||
|     "name-is-required": "Name is required", | ||||
|     "new-password": "New password", | ||||
| @@ -276,7 +282,7 @@ | ||||
|     "password-reset-in-progress": "Password Reset in Progress...", | ||||
|     "password-reset-mail-sent": "Password reset mail was sent to \"{usersEmail}\".", | ||||
|     "password-reset-successful": "Password Reset successful!", | ||||
|     "passwords-dont-match": "Passwords don't match", | ||||
|     "passwords-dont-match": "Passwords don't match!", | ||||
|     "pdf-generation-failed": "PDF generation failed!", | ||||
|     "pdf-successfully-generated": "PDF successfully generated!", | ||||
|     "pdfs-successfully-generated": "PDFs successfully generated!", | ||||
|   | ||||
		Reference in New Issue
	
	Block a user