Compare commits
	
		
			46 Commits
		
	
	
		
			0.16.3
			...
			feature/17
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| ee91748b3c | |||
| e5241d619b | |||
| d79608edbb | |||
| 4cbd26580e | |||
| fe62ad5539 | |||
| eb13f038a1 | |||
| 9505c2b030 | |||
| 008835c24f | |||
| 7083b3d8d2 | |||
| 754931b2f6 | |||
| 2dc8ffba32 | |||
| d0fe6a2e85 | |||
| 85705b6e68 | |||
| 3ea7a015a9 | |||
| 44329413ed | |||
| 46db68ab22 | |||
| dc9d7f22a2 | |||
| f917018fd9 | |||
| 7b420c430d | |||
| 00359d25c1 | |||
| d8a3063735 | |||
| 6491af19e3 | |||
| 61328d20ed | |||
| 0a6d92a1f3 | |||
| 3a576d1073 | |||
| b30b98b521 | |||
| 43d82a2af0 | |||
| 6a4495b813 | |||
| e8a0ad6647 | |||
| 92b89cc4d8 | |||
| 268b1b1d98 | |||
| 75bc89ca30 | |||
| 0625937068 | |||
| 32a9074963 | |||
| b869b5fd2a | |||
| 3a3e2f7157 | |||
| bea57aa03a | |||
| 30991d5364 | |||
| 5cc8b0811c | |||
| 2c73b9862d | |||
| 732b2f061e | |||
| 3680533eef | |||
| 1307d72c9d | |||
| 405dfa0c34 | |||
| 5c2d154ad1 | |||
| f2bf8d9bac | 
| @@ -1 +1,2 @@ | |||||||
| public/env.sample.js | public/env.sample.js | ||||||
|  | .pnpm-store | ||||||
							
								
								
									
										29
									
								
								.drone.yml
									
									
									
									
									
								
							
							
						
						
									
										29
									
								
								.drone.yml
									
									
									
									
									
								
							| @@ -19,6 +19,13 @@ get: | |||||||
|   path: odit-git-bot |   path: odit-git-bot | ||||||
|   name: sshkey |   name: sshkey | ||||||
|  |  | ||||||
|  | --- | ||||||
|  | kind: secret | ||||||
|  | name: npm_url | ||||||
|  | get: | ||||||
|  |   path: odit-npm-cache | ||||||
|  |   name: url | ||||||
|  |  | ||||||
| --- | --- | ||||||
| kind: pipeline | kind: pipeline | ||||||
| type: kubernetes | type: kubernetes | ||||||
| @@ -27,10 +34,14 @@ name: build:dev | |||||||
| steps: | steps: | ||||||
|   - name: run full license export |   - name: run full license export | ||||||
|     depends_on: ["clone"] |     depends_on: ["clone"] | ||||||
|     image: registry.odit.services/hub/library/node:alpine |     image: registry.odit.services/hub/library/node:19.7.0-alpine3.16 | ||||||
|     commands: |     commands: | ||||||
|       - yarn |       - npm config set registry $NPM_REGISTRY_URL && npm i -g pnpm@8 | ||||||
|       - yarn licenses:export |       - pnpm i | ||||||
|  |       - pnpm licenses:export | ||||||
|  |     environment: | ||||||
|  |       NPM_REGISTRY_URL: | ||||||
|  |         from_secret: npm_url | ||||||
|   - name: push new licenses file to repo |   - name: push new licenses file to repo | ||||||
|     depends_on: ["run full license export"] |     depends_on: ["run full license export"] | ||||||
|     image: appleboy/drone-git-push |     image: appleboy/drone-git-push | ||||||
| @@ -51,10 +62,8 @@ steps: | |||||||
|       password: |       password: | ||||||
|         from_secret: docker_password |         from_secret: docker_password | ||||||
|       build_args: |       build_args: | ||||||
|         - NPM_REGISTRY_DOMAIN: |         - NPM_REGISTRY_URL: | ||||||
|           from_secret: npmjs_domain |           from_secret: npm_url | ||||||
|         - NPM_REGISTRY_TOKEN: |  | ||||||
|           from_secret: npmjs_token |  | ||||||
|       repo: lfk/frontend |       repo: lfk/frontend | ||||||
|       tags: |       tags: | ||||||
|         - dev |         - dev | ||||||
| @@ -80,10 +89,8 @@ steps: | |||||||
|       password: |       password: | ||||||
|         from_secret: docker_password |         from_secret: docker_password | ||||||
|       build_args: |       build_args: | ||||||
|         - NPM_REGISTRY_DOMAIN: |         - NPM_REGISTRY_URL: | ||||||
|           from_secret: npmjs_domain |           from_secret: npm_url | ||||||
|         - NPM_REGISTRY_TOKEN: |  | ||||||
|           from_secret: npmjs_token |  | ||||||
|       repo: lfk/frontend |       repo: lfk/frontend | ||||||
|       tags: |       tags: | ||||||
|         - "${DRONE_TAG}" |         - "${DRONE_TAG}" | ||||||
|   | |||||||
							
								
								
									
										7
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										7
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -1,11 +1,6 @@ | |||||||
| node_modules | node_modules | ||||||
| package-lock.json |  | ||||||
| yarn.lock |  | ||||||
| *.map | *.map | ||||||
| public/env.js | public/env.js | ||||||
| public/index.html | public/index.html | ||||||
| /dist | /dist | ||||||
| .yarn | .pnpm-store | ||||||
| .pnp.js |  | ||||||
| .yarnrc.yml |  | ||||||
| pnpm-lock.yaml |  | ||||||
							
								
								
									
										62
									
								
								CHANGELOG.md
									
									
									
									
									
								
							
							
						
						
									
										62
									
								
								CHANGELOG.md
									
									
									
									
									
								
							| @@ -2,8 +2,70 @@ | |||||||
|  |  | ||||||
| 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. | ||||||
|  |  | ||||||
|  | #### [0.17.3](https://git.odit.services/lfk/frontend/compare/0.17.2...0.17.3) | ||||||
|  |  | ||||||
|  | - dependency fixes [`3ea7a01`](https://git.odit.services/lfk/frontend/commit/3ea7a015a9beba3c2e4d3eb966f24ff6d4ac786e) | ||||||
|  | - set pnpm to @7 [`4432941`](https://git.odit.services/lfk/frontend/commit/44329413ed2ca23f74e86db041b2c25b2b1c2a2b) | ||||||
|  |  | ||||||
|  | #### [0.17.2](https://git.odit.services/lfk/frontend/compare/0.17.1...0.17.2) | ||||||
|  |  | ||||||
|  | > 15 March 2023 | ||||||
|  |  | ||||||
|  | - new license file version [CI SKIP] [`00359d2`](https://git.odit.services/lfk/frontend/commit/00359d25c1bd3efdd6365bf284b3c07634049399) | ||||||
|  | - 🚀RELEASE v0.17.2 [`46db68a`](https://git.odit.services/lfk/frontend/commit/46db68ab229dc740dfff8835ef916f2c2e629b27) | ||||||
|  | - improved ThFilterGroup style [`f917018`](https://git.odit.services/lfk/frontend/commit/f917018fd92a8a5b034f735ac8b6e41995044317) | ||||||
|  |  | ||||||
|  | #### [0.17.1](https://git.odit.services/lfk/frontend/compare/0.17.0...0.17.1) | ||||||
|  |  | ||||||
|  | > 15 March 2023 | ||||||
|  |  | ||||||
|  | - Revert "package dependency fixes, bumps, lockfile update" [`d8a3063`](https://git.odit.services/lfk/frontend/commit/d8a30637351e164599e07a6473d9a1d2b08d245d) | ||||||
|  | - 🚀RELEASE v0.17.1 [`7b420c4`](https://git.odit.services/lfk/frontend/commit/7b420c430d27bf0fc85a4297780164a593fc1be3) | ||||||
|  |  | ||||||
|  | #### [0.17.0](https://git.odit.services/lfk/frontend/compare/0.16.5...0.17.0) | ||||||
|  |  | ||||||
|  | > 15 March 2023 | ||||||
|  |  | ||||||
|  | - new license file version [CI SKIP] [`61328d2`](https://git.odit.services/lfk/frontend/commit/61328d20ed2cfd1df7d3c32767f9c64154879d6d) | ||||||
|  | - wip: pnpm + node version [`732b2f0`](https://git.odit.services/lfk/frontend/commit/732b2f061e465bd08cf34c58d8cd6b021ba25dce) | ||||||
|  | - package dependency fixes, bumps, lockfile update [`2c73b98`](https://git.odit.services/lfk/frontend/commit/2c73b9862d401dac15021eed3f7847d46132a8ed) | ||||||
|  | - Fixed runners not showing up [`75bc89c`](https://git.odit.services/lfk/frontend/commit/75bc89ca3020c48f490c7602374616bd9461e78f) | ||||||
|  | - add ThFilterRunner [`3a3e2f7`](https://git.odit.services/lfk/frontend/commit/3a3e2f71575d3a0e39a5e13b05cff932b8683ac9) | ||||||
|  | - fix styling for table filters th border [`bea57aa`](https://git.odit.services/lfk/frontend/commit/bea57aa03acaaaa4b1860b30228dd5d1298317f8) | ||||||
|  | - You can now create cards from runners by searching via #runnerid [`e8a0ad6`](https://git.odit.services/lfk/frontend/commit/e8a0ad6647ab39252865f62b755f27c34ac2d243) | ||||||
|  | - remodelled for early return [`b869b5f`](https://git.odit.services/lfk/frontend/commit/b869b5fd2a01955fb21f936fa38eb5a9648e7de3) | ||||||
|  | - 🚀RELEASE v0.17.0 [`6491af1`](https://git.odit.services/lfk/frontend/commit/6491af19e375cbeba7ddd94e463b4dfe308a70a8) | ||||||
|  | - Wow this api is fun [`32a9074`](https://git.odit.services/lfk/frontend/commit/32a9074963cce3328f14b1f981ddd5ee49df0008) | ||||||
|  | - Fixed double space in label [`92b89cc`](https://git.odit.services/lfk/frontend/commit/92b89cc4d88c9d5625c2ddf7c81c98494f7f5271) | ||||||
|  | - UsersOverview: drop pfp [`30991d5`](https://git.odit.services/lfk/frontend/commit/30991d5364a09d517b2115a7e9ea3fbf1fe2e57d) | ||||||
|  | - Switched license generation to cache registry and pnpm [`0a6d92a`](https://git.odit.services/lfk/frontend/commit/0a6d92a1f3c5562f11562c433b3a04e3eaae3da4) | ||||||
|  | - Pinned pnpm in dockerfile, thx @philipp [`3a576d1`](https://git.odit.services/lfk/frontend/commit/3a576d1073ee503b68100e01054a1756bab62805) | ||||||
|  | - Pinned ci node version [`b30b98b`](https://git.odit.services/lfk/frontend/commit/b30b98b521eda2bc7fc055097546f716e90d92ef) | ||||||
|  | - Fixed pnpm being called without being installed [`43d82a2`](https://git.odit.services/lfk/frontend/commit/43d82a2af04af49c2169f78a0d0f27ef7e4d7558) | ||||||
|  | - Merge pull request 'bugfix/162-create_card_modal' (#163) from bugfix/162-create_card_modal into dev [`6a4495b`](https://git.odit.services/lfk/frontend/commit/6a4495b8131a31cd48a608c2275e80494d0a0fb4) | ||||||
|  | - Removed unused log [`268b1b1`](https://git.odit.services/lfk/frontend/commit/268b1b1d9830de196d1d95345d7a2467bbf19eb6) | ||||||
|  | - Merge pull request 'filter by runner full names + "#<ID>"' (#160) from feature/159-cardsoverview-filter-for-runner-full-names-and-id into dev [`0625937`](https://git.odit.services/lfk/frontend/commit/0625937068f0786078ffd29b9c8bb54949350b6c) | ||||||
|  | - UsersOverview: change profilepic scaling [`5cc8b08`](https://git.odit.services/lfk/frontend/commit/5cc8b0811cf290f97a4399b23c5ea4d961a5a91c) | ||||||
|  |  | ||||||
|  | #### [0.16.5](https://git.odit.services/lfk/frontend/compare/0.16.4...0.16.5) | ||||||
|  |  | ||||||
|  | > 14 March 2023 | ||||||
|  |  | ||||||
|  | - 🚀RELEASE v0.16.5 [`3680533`](https://git.odit.services/lfk/frontend/commit/3680533eefef042fc77246dd3d374aafe10c428f) | ||||||
|  | - new license file version [CI SKIP] [`405dfa0`](https://git.odit.services/lfk/frontend/commit/405dfa0c34ba87fc450c22e0e9974f92c4cdeffe) | ||||||
|  |  | ||||||
|  | #### [0.16.4](https://git.odit.services/lfk/frontend/compare/0.16.3...0.16.4) | ||||||
|  |  | ||||||
|  | > 14 March 2023 | ||||||
|  |  | ||||||
|  | - fix: OrgDetail: clicking on address will toggle selfservice [`#158`](https://git.odit.services/lfk/frontend/issues/158) | ||||||
|  | - 🚀RELEASE v0.16.4 [`5c2d154`](https://git.odit.services/lfk/frontend/commit/5c2d154ad180ce7916605871c63e2f5ac4428250) | ||||||
|  |  | ||||||
| #### [0.16.3](https://git.odit.services/lfk/frontend/compare/0.16.2...0.16.3) | #### [0.16.3](https://git.odit.services/lfk/frontend/compare/0.16.2...0.16.3) | ||||||
|  |  | ||||||
|  | > 23 February 2023 | ||||||
|  |  | ||||||
|  | - 🚀RELEASE v0.16.3 [`f9cfd6b`](https://git.odit.services/lfk/frontend/commit/f9cfd6bd063b01a584774854d8fb5eab96f99528) | ||||||
| - Bumped vite build targets [`5fe4763`](https://git.odit.services/lfk/frontend/commit/5fe47634e8980e77b65c05f213c475cf49273609) | - Bumped vite build targets [`5fe4763`](https://git.odit.services/lfk/frontend/commit/5fe47634e8980e77b65c05f213c475cf49273609) | ||||||
| - new license file version [CI SKIP] [`a659091`](https://git.odit.services/lfk/frontend/commit/a6590910cfdc5e91fba91c1bc9237e407ef15fd2) | - new license file version [CI SKIP] [`a659091`](https://git.odit.services/lfk/frontend/commit/a6590910cfdc5e91fba91c1bc9237e407ef15fd2) | ||||||
| - Merge pull request 'feature/156-pdf_names' (#157) from feature/156-pdf_names into dev [`ad454c3`](https://git.odit.services/lfk/frontend/commit/ad454c386cbf11abc59d41d269d1a0ef7442c9ed) | - Merge pull request 'feature/156-pdf_names' (#157) from feature/156-pdf_names into dev [`ad454c3`](https://git.odit.services/lfk/frontend/commit/ad454c386cbf11abc59d41d269d1a0ef7442c9ed) | ||||||
|   | |||||||
							
								
								
									
										13
									
								
								Dockerfile
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								Dockerfile
									
									
									
									
									
								
							| @@ -1,11 +1,14 @@ | |||||||
| FROM registry.odit.services/hub/library/node:19.5.0-alpine3.16 as build | FROM registry.odit.services/hub/library/node:19.7.0-alpine3.16 as build | ||||||
|  | ARG NPM_REGISTRY_URL=https://registry.npmjs.org | ||||||
| WORKDIR /app | WORKDIR /app | ||||||
| COPY package.json ./ |  | ||||||
| RUN npx pnpm i | COPY package.json pnpm-lock.yaml *.config.js *.config.cjs index.html ./ | ||||||
| COPY package.json *.config.js postcss.config.cjs tailwind.config.js vite.config.js index.html ./ | RUN npm config set registry $NPM_REGISTRY_URL && npm i -g pnpm@8 && pnpm i | ||||||
|  |  | ||||||
| COPY src ./src | COPY src ./src | ||||||
| COPY public ./public | COPY public ./public | ||||||
| RUN yarn build | RUN pnpm build | ||||||
|  |  | ||||||
| # final image | # final image | ||||||
| FROM registry.odit.services/library/nginx-brotli:3.15 as final | FROM registry.odit.services/library/nginx-brotli:3.15 as final | ||||||
| COPY --from=build /app/dist /usr/share/nginx/html | COPY --from=build /app/dist /usr/share/nginx/html | ||||||
|   | |||||||
| @@ -13,7 +13,7 @@ | |||||||
| </head> | </head> | ||||||
|  |  | ||||||
| <body> | <body> | ||||||
|   <span style="display: none;visibility: hidden;" id="buildinfo">RELEASE_INFO-0.16.3-RELEASE_INFO</span> |   <span style="display: none;visibility: hidden;" id="buildinfo">RELEASE_INFO-0.17.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> | ||||||
|   | |||||||
							
								
								
									
										45
									
								
								package.json
									
									
									
									
									
								
							
							
						
						
									
										45
									
								
								package.json
									
									
									
									
									
								
							| @@ -1,6 +1,6 @@ | |||||||
| { | { | ||||||
| 	"name": "@odit/lfk-frontend", | 	"name": "@odit/lfk-frontend", | ||||||
| 	"version": "0.16.3", | 	"version": "0.17.3", | ||||||
| 	"scripts": { | 	"scripts": { | ||||||
| 		"i18n-order": "node order.js", | 		"i18n-order": "node order.js", | ||||||
| 		"dev": "vite", | 		"dev": "vite", | ||||||
| @@ -10,32 +10,18 @@ | |||||||
| 	}, | 	}, | ||||||
| 	"license": "CC-BY-NC-SA-4.0", | 	"license": "CC-BY-NC-SA-4.0", | ||||||
| 	"devDependencies": { | 	"devDependencies": { | ||||||
| 		"@odit/lfk-client-js": "0.13.1", |  | ||||||
| 		"@odit/license-exporter": "0.0.11", |  | ||||||
| 		"@sveltejs/vite-plugin-svelte": "1.0.0-next.6", | 		"@sveltejs/vite-plugin-svelte": "1.0.0-next.6", | ||||||
| 		"@types/html-minifier": "4.0.0", | 		"@odit/license-exporter": "0.0.12", | ||||||
| 		"@vincjo/datatables": "^1.1.0", | 		"@types/html-minifier": "4.0.2", | ||||||
| 		"auto-changelog": "2.2.1", | 		"auto-changelog": "2.4.0", | ||||||
| 		"autoprefixer": "10.2.5", | 		"autoprefixer": "10.4.14", | ||||||
| 		"check-password-strength": "2.0.2", |  | ||||||
| 		"csvtojson": "2.0.10", |  | ||||||
| 		"gridjs": "3.4.0", |  | ||||||
| 		"html-minifier": "4.0.0", | 		"html-minifier": "4.0.0", | ||||||
| 		"localforage": "1.9.0", | 		"postcss": "8.4.21", | ||||||
| 		"marked": "2.0.3", |  | ||||||
| 		"postcss": "8.2.10", |  | ||||||
| 		"release-it": "14.6.1", | 		"release-it": "14.6.1", | ||||||
| 		"svelte": "3.37.0", |  | ||||||
| 		"svelte-focus-trap": "1.2.0", |  | ||||||
| 		"svelte-i18n": "3.3.9", |  | ||||||
| 		"svelte-preprocess": "4.7.0", | 		"svelte-preprocess": "4.7.0", | ||||||
| 		"svelte-select": "3.17.0", | 		"svelte-select": "3.17.0", | ||||||
| 		"tailwindcss": "3.2.7", | 		"tailwindcss": "3.2.7", | ||||||
| 		"tinro": "0.6.1", | 		"vite": "2.1.5" | ||||||
| 		"toastify-js": "1.10.0", |  | ||||||
| 		"validator": "13.5.2", |  | ||||||
| 		"vite": "2.1.5", |  | ||||||
| 		"xlsx": "0.16.9" |  | ||||||
| 	}, | 	}, | ||||||
| 	"release-it": { | 	"release-it": { | ||||||
| 		"git": { | 		"git": { | ||||||
| @@ -55,6 +41,23 @@ | |||||||
| 		} | 		} | ||||||
| 	}, | 	}, | ||||||
| 	"dependencies": { | 	"dependencies": { | ||||||
|  | 		"tinro": "0.6.12", | ||||||
|  | 		"toastify-js": "1.12.0", | ||||||
|  | 		"validator": "13.9.0", | ||||||
|  | 		"xlsx": "0.16.9", | ||||||
|  | 		"@odit/lfk-client-js": "0.14.0", | ||||||
|  | 		"@vincjo/datatables": "^1.4.0", | ||||||
|  | 		"check-password-strength": "2.0.7", | ||||||
|  | 		"csvtojson": "2.0.10", | ||||||
|  | 		"gridjs": "3.4.0", | ||||||
|  | 		"localforage": "1.10.0", | ||||||
|  | 		"marked": "2.0.3", | ||||||
|  | 		"svelte": "3.37.0", | ||||||
|  | 		"svelte-focus-trap": "1.2.0", | ||||||
|  | 		"svelte-i18n": "3.3.9", | ||||||
| 		"@paralleldrive/cuid2": "^2.2.0" | 		"@paralleldrive/cuid2": "^2.2.0" | ||||||
|  | 	}, | ||||||
|  | 	"volta": { | ||||||
|  | 		"node": "19.7.0" | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|   | |||||||
							
								
								
									
										2996
									
								
								pnpm-lock.yaml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										2996
									
								
								pnpm-lock.yaml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @@ -11,22 +11,37 @@ | |||||||
|   import Toastify from "toastify-js"; |   import Toastify from "toastify-js"; | ||||||
|   export let modal_open; |   export let modal_open; | ||||||
|   export let current_cards; |   export let current_cards; | ||||||
|   const getRunnerLabel = (option) => |  | ||||||
|     option.firstname + " " + (option.middlename || "") + " " + option.lastname; |   const getRunnerLabel = (option) => { | ||||||
|   const filterRunners = (label, filterText, option) => |     if (option.middlename) { | ||||||
|  |       return option.firstname + " " + option.middlename + " " + option.lastname; | ||||||
|  |     } | ||||||
|  |     return option.firstname + " " + option.lastname; | ||||||
|  |   }; | ||||||
|  |  | ||||||
|  |   const filterRunners = (label, filterText, option) => { | ||||||
|  |     if (filterText.startsWith("#")) { | ||||||
|  |       return option.value.id == parseInt(filterText.replace("#","")) | ||||||
|  |     } | ||||||
|  |     return ( | ||||||
|       label.toLowerCase().includes(filterText.toLowerCase()) || |       label.toLowerCase().includes(filterText.toLowerCase()) || | ||||||
|     option.value.toString().startsWith(filterText.toLowerCase()); |       option.value.toString().startsWith(filterText.toLowerCase()) | ||||||
|  |     ); | ||||||
|  |   }; | ||||||
|   function focus(el) { |   function focus(el) { | ||||||
|     el.focus(); |     el.focus(); | ||||||
|   } |   } | ||||||
|   $: runner = 0; |   $: runner = 0; | ||||||
|   $: runners = []; |  | ||||||
|   $: enabled = true; |   $: enabled = true; | ||||||
|   $: processed_last_submit = true; |   $: processed_last_submit = true; | ||||||
|  |  | ||||||
|  |   let loading = true; | ||||||
|  |   let runners = []; | ||||||
|   RunnerService.runnerControllerGetAll().then((val) => { |   RunnerService.runnerControllerGetAll().then((val) => { | ||||||
|     runners = val.map((r) => { |     runners = val.map((r) => { | ||||||
|       return { label: getRunnerLabel(r), value: r }; |       return { label: getRunnerLabel(r), value: r }; | ||||||
|     }); |     }); | ||||||
|  |     loading = false; | ||||||
|   }); |   }); | ||||||
|   $: createbtnenabled = true; |   $: createbtnenabled = true; | ||||||
|   (() => { |   (() => { | ||||||
| @@ -86,61 +101,78 @@ | |||||||
|     use:clickOutside |     use:clickOutside | ||||||
|     on:click_outside={() => { |     on:click_outside={() => { | ||||||
|       modal_open = false; |       modal_open = false; | ||||||
|     }}> |     }} | ||||||
|  |   > | ||||||
|     <div |     <div | ||||||
|       class="flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0"> |       class="flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0" | ||||||
|  |     > | ||||||
|       <div class="fixed inset-0 transition-opacity" aria-hidden="true"> |       <div class="fixed inset-0 transition-opacity" aria-hidden="true"> | ||||||
|         <div |         <div | ||||||
|           class="absolute inset-0 bg-gray-500 opacity-75" |           class="absolute inset-0 bg-gray-500 opacity-75" | ||||||
|           data-id="modal_backdrop" /> |           data-id="modal_backdrop" | ||||||
|  |         /> | ||||||
|       </div> |       </div> | ||||||
|       <span |       <span | ||||||
|         class="hidden sm:inline-block sm:align-middle sm:h-screen" |         class="hidden sm:inline-block sm:align-middle sm:h-screen" | ||||||
|         aria-hidden="true">​</span> |         aria-hidden="true">​</span | ||||||
|  |       > | ||||||
|       <div |       <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-lg sm:w-full" | ||||||
|         role="dialog" |         role="dialog" | ||||||
|         aria-modal="true" |         aria-modal="true" | ||||||
|         aria-labelledby="modal-headline"> |         aria-labelledby="modal-headline" | ||||||
|  |       > | ||||||
|         <div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4"> |         <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="sm:flex sm:items-start"> | ||||||
|             <div |             <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-12 rounded-full bg-blue-100 sm:mx-0 sm:h-10 sm:w-10" | ||||||
|  |             > | ||||||
|               <svg |               <svg | ||||||
|                 class="h-6 w-6 text-blue-600" |                 class="h-6 w-6 text-blue-600" | ||||||
|                 fill="currentColor" |                 fill="currentColor" | ||||||
|                 xmlns="http://www.w3.org/2000/svg" |                 xmlns="http://www.w3.org/2000/svg" | ||||||
|                 viewBox="0 0 24 24" |                 viewBox="0 0 24 24" | ||||||
|                 width="24" |                 width="24" | ||||||
|                 height="24"><path fill="none" d="M0 0h24v24H0z" /> |                 height="24" | ||||||
|  |                 ><path fill="none" d="M0 0h24v24H0z" /> | ||||||
|                 <path |                 <path | ||||||
|                   fill="currentColor" |                   fill="currentColor" | ||||||
|                   d="M22 10v10a1 1 0 01-1 1H3a1 1 0 01-1-1V10h20zm0-2H2V4a1 1 0 011-1h18a1 1 0 011 1v4zm-7 8v2h4v-2h-4z" /></svg> |                   d="M22 10v10a1 1 0 01-1 1H3a1 1 0 01-1-1V10h20zm0-2H2V4a1 1 0 011-1h18a1 1 0 011 1v4zm-7 8v2h4v-2h-4z" | ||||||
|  |                 /></svg | ||||||
|  |               > | ||||||
|             </div> |             </div> | ||||||
|             <div class="mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"> |             <div class="mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"> | ||||||
|               <h3 class="text-lg leading-6 font-medium text-gray-900"> |               <h3 class="text-lg leading-6 font-medium text-gray-900"> | ||||||
|                 {$_('create-a-new-card')} |                 {$_("create-a-new-card")} | ||||||
|               </h3> |               </h3> | ||||||
|               <div class="mt-2 mb-6"> |               <div class="mt-2 mb-6"> | ||||||
|                 <p class="text-sm text-gray-500"> |                 <p class="text-sm text-gray-500"> | ||||||
|                   {$_('you-can-provide-a-runner-but-you-dont-have-to')} |                   {$_("you-can-provide-a-runner-but-you-dont-have-to")} | ||||||
|                   {$_('if-you-want-to-create-multiple-blanco-cards-try-the-add-bulk-button')} |                   {$_( | ||||||
|  |                     "if-you-want-to-create-multiple-blanco-cards-try-the-add-bulk-button" | ||||||
|  |                   )} | ||||||
|                 </p> |                 </p> | ||||||
|               </div> |               </div> | ||||||
|               <div class="grid grid-cols-6 gap-6"> |               <div class="grid grid-cols-6 gap-6"> | ||||||
|                 <div class="col-span-6"> |                 <div class="col-span-6"> | ||||||
|                   <label |                   <label | ||||||
|                     for="donor" |                     for="donor" | ||||||
|                     class="block text-sm font-medium text-gray-700">{$_('runner')}</label> |                     class="block text-sm font-medium text-gray-700" | ||||||
|  |                     >{$_("runner")}</label | ||||||
|  |                   > | ||||||
|                   <Select |                   <Select | ||||||
|                     containerClasses="rounded-l-md 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" |                     containerClasses="rounded-l-md 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" | ||||||
|                     itemFilter={(label, filterText, option) => filterRunners(label, filterText, option)} |                     itemFilter={(label, filterText, option) => | ||||||
|  |                       filterRunners(label, filterText, option)} | ||||||
|                     items={runners} |                     items={runners} | ||||||
|                     showChevron={true} |                     bind:loading | ||||||
|                     placeholder={$_('search-for-runner-by-name-or-id')} |                     showChevron={!loading} | ||||||
|                     noOptionsMessage={$_('no-runners-found')} |                     placeholder={$_("search-for-runner-by-name-or-id")} | ||||||
|                     on:select={(selectedValue) => (runner = selectedValue.detail.value.id)} |                     noOptionsMessage={$_("no-runners-found")} | ||||||
|                     on:clear={() => (runner = null)} /> |                     on:select={(selectedValue) => | ||||||
|  |                       (runner = selectedValue.detail.value.id)} | ||||||
|  |                     on:clear={() => (runner = null)} | ||||||
|  |                   /> | ||||||
|                 </div> |                 </div> | ||||||
|               </div> |               </div> | ||||||
|             </div> |             </div> | ||||||
| @@ -152,16 +184,18 @@ | |||||||
|             class:opacity-50={!createbtnenabled} |             class:opacity-50={!createbtnenabled} | ||||||
|             on:click={submit} |             on:click={submit} | ||||||
|             type="button" |             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"> |             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")} | ||||||
|           </button> |           </button> | ||||||
|           <button |           <button | ||||||
|             on:click={() => { |             on:click={() => { | ||||||
|               modal_open = false; |               modal_open = false; | ||||||
|             }} |             }} | ||||||
|             type="button" |             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="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')} |           > | ||||||
|  |             {$_("cancel")} | ||||||
|           </button> |           </button> | ||||||
|         </div> |         </div> | ||||||
|       </div> |       </div> | ||||||
|   | |||||||
| @@ -8,6 +8,7 @@ | |||||||
|   import CardDetailModal from "./CardDetailModal.svelte"; |   import CardDetailModal from "./CardDetailModal.svelte"; | ||||||
|   import GenerateRunnerCards from "../pdf_generation/GenerateRunnerCards.svelte"; |   import GenerateRunnerCards from "../pdf_generation/GenerateRunnerCards.svelte"; | ||||||
|   import ThFilterStatus from "./ThFilterStatus.svelte"; |   import ThFilterStatus from "./ThFilterStatus.svelte"; | ||||||
|  |   import ThFilterRunner from "./ThFilterRunner.svelte"; | ||||||
|   export let edit_modal_open = false; |   export let edit_modal_open = false; | ||||||
|   export let runner = {}; |   export let runner = {}; | ||||||
|   export let editable = {}; |   export let editable = {}; | ||||||
| @@ -54,7 +55,7 @@ | |||||||
|     bind:runner |     bind:runner | ||||||
|     bind:editable |     bind:editable | ||||||
|     bind:original_data |     bind:original_data | ||||||
|     on:dataUpdated={(handler.setRows(current_cards))} |     on:dataUpdated={handler.setRows(current_cards)} | ||||||
|   /> |   /> | ||||||
| {/if} | {/if} | ||||||
|  |  | ||||||
| @@ -78,7 +79,7 @@ | |||||||
|         <table> |         <table> | ||||||
|           <thead> |           <thead> | ||||||
|             <tr> |             <tr> | ||||||
|               <th> |               <th style="border-bottom: 1px solid #ddd;"> | ||||||
|                 <input |                 <input | ||||||
|                   type="checkbox" |                   type="checkbox" | ||||||
|                   class="focus:ring-indigo-500 h-4 w-4 text-indigo-600 border-gray-300 rounded" |                   class="focus:ring-indigo-500 h-4 w-4 text-indigo-600 border-gray-300 rounded" | ||||||
| @@ -95,14 +96,14 @@ | |||||||
|               <Th {handler} orderBy="code">{$_("code")}</Th> |               <Th {handler} orderBy="code">{$_("code")}</Th> | ||||||
|               <Th {handler} orderBy="runner">{$_("runner")}</Th> |               <Th {handler} orderBy="runner">{$_("runner")}</Th> | ||||||
|               <Th {handler} orderBy="status">{$_("status")}</Th> |               <Th {handler} orderBy="status">{$_("status")}</Th> | ||||||
|               <th>{$_("action")}</th> |               <th style="border-bottom: 1px solid #ddd;">{$_("action")}</th> | ||||||
|             </tr> |             </tr> | ||||||
|             <tr> |             <tr> | ||||||
|               <th /> |               <th style="border-bottom: 1px solid #ddd;" /> | ||||||
|               <ThFilter {handler} filterBy="code" /> |               <ThFilter {handler} filterBy="code" /> | ||||||
|               <ThFilter {handler} filterBy="runner" /> |               <ThFilterRunner {handler} /> | ||||||
|               <ThFilterStatus {handler} /> |               <ThFilterStatus {handler} /> | ||||||
|               <th /> |               <th style="border-bottom: 1px solid #ddd;" /> | ||||||
|             </tr> |             </tr> | ||||||
|           </thead> |           </thead> | ||||||
|           <tbody> |           <tbody> | ||||||
|   | |||||||
							
								
								
									
										57
									
								
								src/components/cards/ThFilterRunner.svelte
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										57
									
								
								src/components/cards/ThFilterRunner.svelte
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,57 @@ | |||||||
|  | <script> | ||||||
|  |   export let handler; | ||||||
|  |   let filterValue = ""; | ||||||
|  | </script> | ||||||
|  |  | ||||||
|  | <th> | ||||||
|  |   <input | ||||||
|  |     on:input={() => { | ||||||
|  |       setTimeout(() => { | ||||||
|  |         const v = filterValue.toLowerCase(); | ||||||
|  |         handler.filter(v, (c) => { | ||||||
|  |           // if (v === "") { | ||||||
|  |           //   return c; | ||||||
|  |           // } | ||||||
|  |  | ||||||
|  |           if (!c.runner && v === "blanko") { | ||||||
|  |             return "blanko"; | ||||||
|  |           } | ||||||
|  |  | ||||||
|  |           if (v.startsWith("#")) { | ||||||
|  |             return `#${c.runner?.id}`; | ||||||
|  |           } | ||||||
|  |           if (c.runner) { | ||||||
|  |             let runnerName = `${c.runner.firstname} ${c.runner.lastname}`; | ||||||
|  |             if (c.runner.middlename) { | ||||||
|  |               runnerName = `${c.runner.firstname} ${c.runner.middlename} ${c.runner.lastname}`; | ||||||
|  |             } | ||||||
|  |             runnerName = runnerName.toLowerCase(); | ||||||
|  |             return runnerName; | ||||||
|  |           } | ||||||
|  |           return ""; | ||||||
|  |         }); | ||||||
|  |       }, 150); | ||||||
|  |     }} | ||||||
|  |     bind:value={filterValue} | ||||||
|  |     type="text" | ||||||
|  |     name="runnerfilter" | ||||||
|  |     id="runnerfilter" | ||||||
|  |   /> | ||||||
|  | </th> | ||||||
|  |  | ||||||
|  | <style> | ||||||
|  |   th { | ||||||
|  |     border-bottom: 1px solid #e0e0e0; | ||||||
|  |   } | ||||||
|  |   input { | ||||||
|  |     margin: -1px 0 0 0; | ||||||
|  |     padding: 0; | ||||||
|  |     width: 100%; | ||||||
|  |     height: 24px; | ||||||
|  |     border: none; | ||||||
|  |     text-align: left; | ||||||
|  |     background: inherit; | ||||||
|  |     outline: 0; | ||||||
|  |     font-size: 14px; | ||||||
|  |   } | ||||||
|  | </style> | ||||||
| @@ -9,11 +9,10 @@ | |||||||
|     on:input={() => { |     on:input={() => { | ||||||
|       setTimeout(() => { |       setTimeout(() => { | ||||||
|         if (`${selected}`.trim()) { |         if (`${selected}`.trim()) { | ||||||
|           if(selected==="all"){ |           if (selected === "all") { | ||||||
|            handler.filter('', 'enabled')  |             handler.filter("", "enabled"); | ||||||
|           } |           } else { | ||||||
|           else{ |             handler.filter(selected, "enabled"); | ||||||
|             handler.filter(selected, 'enabled') |  | ||||||
|           } |           } | ||||||
|         } |         } | ||||||
|       }, 50); |       }, 50); | ||||||
| @@ -22,8 +21,25 @@ | |||||||
|     name="statusfilter" |     name="statusfilter" | ||||||
|     id="statusfilter" |     id="statusfilter" | ||||||
|   > |   > | ||||||
|     <option value="all">{$_('all')}</option> |     <option value="all">{$_("all")}</option> | ||||||
|     <option value="true">{$_("enabled")}</option> |     <option value="true">{$_("enabled")}</option> | ||||||
|     <option value="false">{$_("disabled")}</option> |     <option value="false">{$_("disabled")}</option> | ||||||
|   </select> |   </select> | ||||||
| </th> | </th> | ||||||
|  |  | ||||||
|  | <style> | ||||||
|  |   th { | ||||||
|  |     border-bottom: 1px solid #e0e0e0; | ||||||
|  |   } | ||||||
|  |   select { | ||||||
|  |     margin: -1px 0 0 0; | ||||||
|  |     padding: 0; | ||||||
|  |     width: 100%; | ||||||
|  |     height: 24px; | ||||||
|  |     border: none; | ||||||
|  |     text-align: left; | ||||||
|  |     background: inherit; | ||||||
|  |     outline: 0; | ||||||
|  |     font-size: 14px; | ||||||
|  |   } | ||||||
|  | </style> | ||||||
|   | |||||||
| @@ -326,14 +326,14 @@ | |||||||
|         <div class="flex items-center h-5"> |         <div class="flex items-center h-5"> | ||||||
|           <input |           <input | ||||||
|             bind:checked={editable.registrationEnabled} |             bind:checked={editable.registrationEnabled} | ||||||
|             id="comments" |             id="toggle_selfservice_feature" | ||||||
|             name="comments" |             name="toggle_selfservice_feature" | ||||||
|             type="checkbox" |             type="checkbox" | ||||||
|             class="focus:ring-indigo-500 h-4 w-4 text-indigo-600 border-gray-300 rounded" /> |             class="focus:ring-indigo-500 h-4 w-4 text-indigo-600 border-gray-300 rounded" /> | ||||||
|         </div> |         </div> | ||||||
|         <div class="ml-3 text-sm"> |         <div class="ml-3 text-sm"> | ||||||
|           <label |           <label | ||||||
|             for="comments" |             for="toggle_selfservice_feature" | ||||||
|             class="font-medium text-gray-700">{$_('selfservice-registration')}</label> |             class="font-medium text-gray-700">{$_('selfservice-registration')}</label> | ||||||
|         </div> |         </div> | ||||||
|       </div> |       </div> | ||||||
| @@ -375,14 +375,14 @@ | |||||||
|             <div class="flex items-center h-5"> |             <div class="flex items-center h-5"> | ||||||
|               <input |               <input | ||||||
|                 bind:checked={editable.address_checked} |                 bind:checked={editable.address_checked} | ||||||
|                 id="comments" |                 id="toggle_address_checkbox" | ||||||
|                 name="comments" |                 name="toggle_address_checkbox" | ||||||
|                 type="checkbox" |                 type="checkbox" | ||||||
|                 class="focus:ring-indigo-500 h-4 w-4 text-indigo-600 border-gray-300 rounded" /> |                 class="focus:ring-indigo-500 h-4 w-4 text-indigo-600 border-gray-300 rounded" /> | ||||||
|             </div> |             </div> | ||||||
|             <div class="ml-3 text-sm"> |             <div class="ml-3 text-sm"> | ||||||
|               <label |               <label | ||||||
|                 for="comments" |                 for="toggle_address_checkbox" | ||||||
|                 class="font-medium text-gray-700">{$_('address')}</label> |                 class="font-medium text-gray-700">{$_('address')}</label> | ||||||
|             </div> |             </div> | ||||||
|           </div> |           </div> | ||||||
|   | |||||||
| @@ -73,7 +73,7 @@ | |||||||
|       <table> |       <table> | ||||||
|         <thead> |         <thead> | ||||||
|           <tr> |           <tr> | ||||||
|             <th> |             <th style="border-bottom: 1px solid #ddd;"> | ||||||
|               <input |               <input | ||||||
|                 type="checkbox" |                 type="checkbox" | ||||||
|                 class="focus:ring-indigo-500 h-4 w-4 text-indigo-600 border-gray-300 rounded" |                 class="focus:ring-indigo-500 h-4 w-4 text-indigo-600 border-gray-300 rounded" | ||||||
| @@ -91,19 +91,19 @@ | |||||||
|             <Th {handler} orderBy="firstname">First Name</Th> |             <Th {handler} orderBy="firstname">First Name</Th> | ||||||
|             <Th {handler} orderBy="middlename">Middle Name</Th> |             <Th {handler} orderBy="middlename">Middle Name</Th> | ||||||
|             <Th {handler} orderBy="lastname">Last Name</Th> |             <Th {handler} orderBy="lastname">Last Name</Th> | ||||||
|             <th>Gruppe</th> |             <th style="border-bottom: 1px solid #ddd;">Gruppe</th> | ||||||
|             <Th {handler} orderBy="distance">Distanz</Th> |             <Th {handler} orderBy="distance">Distanz</Th> | ||||||
|             <th>{$_("action")}</th> |             <th style="border-bottom: 1px solid #ddd;">{$_("action")}</th> | ||||||
|           </tr> |           </tr> | ||||||
|           <tr> |           <tr> | ||||||
|             <th /> |             <th style="border-bottom: 1px solid #ddd;" /> | ||||||
|             <ThFilter {handler} filterBy="id" /> |             <ThFilter {handler} filterBy="id" /> | ||||||
|             <ThFilter {handler} filterBy="firstname" /> |             <ThFilter {handler} filterBy="firstname" /> | ||||||
|             <ThFilter {handler} filterBy="middlename" /> |             <ThFilter {handler} filterBy="middlename" /> | ||||||
|             <ThFilter {handler} filterBy="lastname" /> |             <ThFilter {handler} filterBy="lastname" /> | ||||||
|             <ThFilterGroup groups={selectgroups} {handler} /> |             <ThFilterGroup groups={selectgroups} {handler} /> | ||||||
|             <th /> |             <th style="border-bottom: 1px solid #ddd;" /> | ||||||
|             <th /> |             <th style="border-bottom: 1px solid #ddd;" /> | ||||||
|           </tr> |           </tr> | ||||||
|         </thead> |         </thead> | ||||||
|         <tbody> |         <tbody> | ||||||
|   | |||||||
| @@ -5,7 +5,7 @@ | |||||||
|   let selected = "all"; |   let selected = "all"; | ||||||
| </script> | </script> | ||||||
|  |  | ||||||
| <th> | <th style="border-bottom: 1px solid #ddd;"> | ||||||
|   <select |   <select | ||||||
|     on:input={() => { |     on:input={() => { | ||||||
|       setTimeout(() => { |       setTimeout(() => { | ||||||
|   | |||||||
| @@ -1,125 +1,147 @@ | |||||||
| <script> | <script> | ||||||
|   import { getLocaleFromNavigator, _ } from "svelte-i18n"; |   import { _ } from "svelte-i18n"; | ||||||
|   import { |   import { DataHandler, Datatable, Th, ThFilter } from "@vincjo/datatables"; | ||||||
|     ScanService, |   import { ScanService, TrackService } from "@odit/lfk-client-js"; | ||||||
|   } from "@odit/lfk-client-js"; |  | ||||||
|   import store from "../../store"; |   import store from "../../store"; | ||||||
|   import Toastify from "toastify-js"; |   import Toastify from "toastify-js"; | ||||||
|   import ScansEmptyState from "./ScansEmptyState.svelte"; |   import ScansEmptyState from "./ScansEmptyState.svelte"; | ||||||
|   $: searchvalue = ""; |   import ThFilterRunner from "./ThFilterRunner.svelte"; | ||||||
|  |   import ThFilterTrack from "./ThFilterTrack.svelte"; | ||||||
|   $: active_deletes = []; |   $: active_deletes = []; | ||||||
|   export let current_scans = []; |   export let current_scans = []; | ||||||
|  |   const handler = new DataHandler(current_scans, { rowsPerPage: 20 }); | ||||||
|  |   const rows = handler.getRows(); | ||||||
|   const scans_promise = ScanService.scanControllerGetAll().then((val) => { |   const scans_promise = ScanService.scanControllerGetAll().then((val) => { | ||||||
|     current_scans = val; |     current_scans = val; | ||||||
|  |     handler.setRows(val); | ||||||
|   }); |   }); | ||||||
|   function should_display_based_on_id(id) { |   $: allTracks = []; | ||||||
|     if (searchvalue.toString().slice(-1) === "*") { |   TrackService.trackControllerGetAll().then((val) => { | ||||||
|       return id.toString().startsWith(searchvalue.replace("*", "")); |     allTracks = val; | ||||||
|  |   }); | ||||||
|  |   function format_laptime(laptime) { | ||||||
|  |     if (laptime == 0 || laptime == null) { | ||||||
|  |       return $_("first-scan-of-the-day"); | ||||||
|     } |     } | ||||||
|     return id.toString() === searchvalue; |     if (laptime < 60) { | ||||||
|  |       return `${laptime}s`; | ||||||
|     } |     } | ||||||
|   function format_laptime(laptime){ |     if (laptime < 3600) { | ||||||
|     if(laptime == 0 || laptime == null){return $_('first-scan-of-the-day')} |       return `${Math.floor(laptime / 60)}min ${ | ||||||
|     if(laptime < 60){return `${laptime}s`} |         laptime - Math.floor(laptime / 60) * 60 | ||||||
|     if(laptime < 3600){return `${Math.floor(laptime / 60)}min ${laptime - (Math.floor(laptime / 60)*60)}s`} |       }s`; | ||||||
|     return `${Math.floor(laptime / 3600)}h ${laptime - (Math.floor(laptime / 3600)*3600)}min ${laptime - (Math.floor(laptime / 3600)*3600) - (Math.floor(laptime / 60)*60)}` |     } | ||||||
|  |     return `${Math.floor(laptime / 3600)}h ${ | ||||||
|  |       laptime - Math.floor(laptime / 3600) * 3600 | ||||||
|  |     }min ${ | ||||||
|  |       laptime - | ||||||
|  |       Math.floor(laptime / 3600) * 3600 - | ||||||
|  |       Math.floor(laptime / 60) * 60 | ||||||
|  |     }`; | ||||||
|   } |   } | ||||||
| </script> | </script> | ||||||
|  |  | ||||||
| {#if store.state.jwtinfo.userdetails.permissions.includes('SCAN:GET')} | {#if store.state.jwtinfo.userdetails.permissions.includes("SCAN:GET")} | ||||||
|   {#await scans_promise} |   {#await scans_promise} | ||||||
|     <div |     <div | ||||||
|       class="bg-teal-lightest border-t-4 border-teal rounded-b text-teal-darkest px-4 py-3 shadow-md my-2" |       class="bg-teal-lightest border-t-4 border-teal rounded-b text-teal-darkest px-4 py-3 shadow-md my-2" | ||||||
|       role="alert"> |       role="alert" | ||||||
|       <p class="font-bold">{$_('scans-are-being-loaded')}</p> |     > | ||||||
|       <p class="text-sm">{$_('this-might-take-a-moment')}</p> |       <p class="font-bold">{$_("scans-are-being-loaded")}</p> | ||||||
|  |       <p class="text-sm">{$_("this-might-take-a-moment")}</p> | ||||||
|     </div> |     </div> | ||||||
|   {:then} |   {:then} | ||||||
|     {#if current_scans.length === 0} |     {#if current_scans.length === 0} | ||||||
|       <ScansEmptyState /> |       <ScansEmptyState /> | ||||||
|     {:else} |     {:else} | ||||||
|       <input |  | ||||||
|         type="search" |  | ||||||
|         bind:value={searchvalue} |  | ||||||
|         placeholder={$_('datatable.search')} |  | ||||||
|         aria-label={$_('datatable.search')} |  | ||||||
|         class="gridjs-input gridjs-search-input mb-4" /> |  | ||||||
|       <div |       <div | ||||||
|         class="shadow border-b border-gray-200 sm:rounded-lg overflow-x-scroll"> |         class="shadow border-b border-gray-200 sm:rounded-lg overflow-x-scroll" | ||||||
|  |       > | ||||||
|  |         <Datatable {handler}> | ||||||
|           <table class="divide-y divide-gray-200 w-full"> |           <table class="divide-y divide-gray-200 w-full"> | ||||||
|             <thead class="bg-gray-50"> |             <thead class="bg-gray-50"> | ||||||
|               <tr> |               <tr> | ||||||
|  |                 <Th {handler} orderBy="id">ID</Th> | ||||||
|  |                 <Th {handler}> | ||||||
|  |                   {$_("runner")} | ||||||
|  |                 </Th> | ||||||
|  |                 <Th {handler}> | ||||||
|  |                   {$_("distance")} | ||||||
|  |                 </Th> | ||||||
|  |                 <Th {handler}> | ||||||
|  |                   {$_("track")} | ||||||
|  |                 </Th> | ||||||
|  |                 <Th {handler}> | ||||||
|  |                   {$_("laptime")} | ||||||
|  |                 </Th> | ||||||
|  |                 <Th {handler}> | ||||||
|  |                   {$_("status")} | ||||||
|  |                 </Th> | ||||||
|                 <th |                 <th | ||||||
|                   scope="col" |                   scope="col" | ||||||
|                 class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"> |                   class="relative px-6 py-3" | ||||||
|                 {$_('runner')} |                   style="border-bottom: 1px solid #ddd;" | ||||||
|               </th> |                 > | ||||||
|               <th |                   {$_("action")} | ||||||
|                 scope="col" |  | ||||||
|                 class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"> |  | ||||||
|                 {$_('distance-track')} |  | ||||||
|               </th> |  | ||||||
|               <th |  | ||||||
|                 scope="col" |  | ||||||
|                 class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"> |  | ||||||
|                 {$_('laptime')} |  | ||||||
|               </th> |  | ||||||
|               <th |  | ||||||
|                 scope="col" |  | ||||||
|                 class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"> |  | ||||||
|                 {$_('status')} |  | ||||||
|               </th> |  | ||||||
|               <th scope="col" class="relative px-6 py-3"> |  | ||||||
|                 <span class="sr-only">{$_('action')}</span> |  | ||||||
|                 </th> |                 </th> | ||||||
|               </tr> |               </tr> | ||||||
|  |               <tr> | ||||||
|  |                 <ThFilter {handler} filterBy="id" /> | ||||||
|  |                 <ThFilterRunner {handler} /> | ||||||
|  |                 <th style="border-bottom: 1px solid #ddd;" /> | ||||||
|  |                 <ThFilterTrack tracks={allTracks} {handler} /> | ||||||
|  |                 <!-- <th style="border-bottom: 1px solid #ddd;" /> --> | ||||||
|  |                 <th style="border-bottom: 1px solid #ddd;" /> | ||||||
|  |                 <th style="border-bottom: 1px solid #ddd;" /> | ||||||
|  |                 <!-- TODO: filter status --> | ||||||
|  |                 <th style="border-bottom: 1px solid #ddd;" /> | ||||||
|  |               </tr> | ||||||
|             </thead> |             </thead> | ||||||
|             <tbody class="divide-y divide-gray-200"> |             <tbody class="divide-y divide-gray-200"> | ||||||
|             {#each current_scans as scan} |               {#each $rows as scan} | ||||||
|               {#if scan.track?.name |  | ||||||
|                 .toLowerCase() |  | ||||||
|                 .includes( |  | ||||||
|                   searchvalue.toLowerCase() |  | ||||||
|                 ) || scan.runner?.firstname |  | ||||||
|                   .toLowerCase() |  | ||||||
|                   .includes( |  | ||||||
|                     searchvalue.toLowerCase() |  | ||||||
|                   ) || scan.runner?.lastname |  | ||||||
|                   .toLowerCase() |  | ||||||
|                   .includes( |  | ||||||
|                     searchvalue.toLowerCase() |  | ||||||
|                   ) || should_display_based_on_id(scan.id)} |  | ||||||
|                 <tr data-rowid="scan_{scan.id}"> |                 <tr data-rowid="scan_{scan.id}"> | ||||||
|  |                   <td class="px-6 py-4 whitespace-nowrap text-left"> | ||||||
|  |                     <div class="text-sm font-medium text-gray-900"> | ||||||
|  |                       {scan.id} | ||||||
|  |                     </div> | ||||||
|  |                   </td> | ||||||
|                   <td class="px-6 py-4 whitespace-nowrap"> |                   <td class="px-6 py-4 whitespace-nowrap"> | ||||||
|                     <div class="flex items-center"> |                     <div class="flex items-center"> | ||||||
|                       <a |                       <a | ||||||
|                         href="../runners/{scan.runner.id}" |                         href="../runners/{scan.runner.id}" | ||||||
|                         class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-gray-100 text-gray-800">{scan.runner.firstname} |                         class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-gray-100 text-gray-800" | ||||||
|                         {scan.runner.middlename || ''} |                         >{scan.runner.firstname} | ||||||
|                         {scan.runner.lastname}</a> |                         {scan.runner.middlename || ""} | ||||||
|  |                         {scan.runner.lastname}</a | ||||||
|  |                       > | ||||||
|                     </div> |                     </div> | ||||||
|                   </td> |                   </td> | ||||||
|                   <td class="px-6 py-4 whitespace-nowrap"> |                   <td class="px-6 py-4 whitespace-nowrap text-left"> | ||||||
|                     <div class="text-sm font-medium text-gray-900"> |                     <div class="text-sm font-medium text-gray-900"> | ||||||
|                       {#if scan.distance < 1000} |                       {#if scan.distance < 1000} | ||||||
|                         {scan.distance}m |                         {scan.distance}m | ||||||
|                       {:else}{scan.distance / 1000}km{/if} |                       {:else}{scan.distance / 1000}km{/if} | ||||||
|  |                     </div> | ||||||
|  |                   </td> | ||||||
|  |                   <td class="px-6 py-4 whitespace-nowrap text-left"> | ||||||
|  |                     <div class="text-sm font-medium text-gray-900"> | ||||||
|                       {#if scan.track} |                       {#if scan.track} | ||||||
|                         <a |                         <a | ||||||
|                           href="../tracks" |                           href="../tracks" | ||||||
|                           class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-gray-100 text-gray-800">{scan.track.name} |                           class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-gray-100 text-gray-800" | ||||||
|  |                           >{scan.track.name} | ||||||
|                         </a> |                         </a> | ||||||
|                       {/if} |                       {/if} | ||||||
|                     </div> |                     </div> | ||||||
|                   </td> |                   </td> | ||||||
|                   <td class="px-6 py-4 whitespace-nowrap"> |                   <td class="px-6 py-4 whitespace-nowrap text-left"> | ||||||
|                     {#if scan.responseType === "TRACKSCAN"} |                     {#if scan.responseType === "TRACKSCAN"} | ||||||
|                       <div class="text-sm font-medium text-gray-900"> |                       <div class="text-sm font-medium text-gray-900"> | ||||||
|                         {format_laptime(scan.lapTime)} |                         {format_laptime(scan.lapTime)} | ||||||
|                       </div> |                       </div> | ||||||
|                     {:else} |                     {:else} | ||||||
|                       <div class="text-sm font-medium text-gray-900"> |                       <div class="text-sm font-medium text-gray-900"> | ||||||
|                         {$_('scan-with-fixed-distance')} |                         {$_("scan-with-fixed-distance")} | ||||||
|                       </div> |                       </div> | ||||||
|                     {/if} |                     {/if} | ||||||
|                   </td> |                   </td> | ||||||
| @@ -127,23 +149,30 @@ | |||||||
|                     <div class="flex items-center"> |                     <div class="flex items-center"> | ||||||
|                       {#if scan.valid} |                       {#if scan.valid} | ||||||
|                         <span |                         <span | ||||||
|                           class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">{$_('valid')}</span> |                           class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800" | ||||||
|  |                           >{$_("valid")}</span | ||||||
|  |                         > | ||||||
|                       {:else} |                       {:else} | ||||||
|                         <span |                         <span | ||||||
|                           class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-red-100 text-red-800">{$_('invalid')}</span> |                           class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-red-100 text-red-800" | ||||||
|  |                           >{$_("invalid")}</span | ||||||
|  |                         > | ||||||
|                       {/if} |                       {/if} | ||||||
|                     </div> |                     </div> | ||||||
|                   </td> |                   </td> | ||||||
|  |  | ||||||
|                   {#if active_deletes[scan.id] === true} |                   {#if active_deletes[scan.id] === true} | ||||||
|                     <td |                     <td | ||||||
|                       class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium"> |                       class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium" | ||||||
|  |                     > | ||||||
|                       <button |                       <button | ||||||
|                         on:click={() => { |                         on:click={() => { | ||||||
|                           active_deletes[scan.id] = false; |                           active_deletes[scan.id] = false; | ||||||
|                         }} |                         }} | ||||||
|                         tabindex="0" |                         tabindex="0" | ||||||
|                         class="ml-4 text-indigo-600 hover:text-indigo-900 cursor-pointer">{$_('cancel-delete')}</button> |                         class="ml-4 text-indigo-600 hover:text-indigo-900 cursor-pointer" | ||||||
|  |                         >{$_("cancel-delete")}</button | ||||||
|  |                       > | ||||||
|                       <button |                       <button | ||||||
|                         on:click={() => { |                         on:click={() => { | ||||||
|                           ScanService.scanControllerRemove(scan.id, false).then( |                           ScanService.scanControllerRemove(scan.id, false).then( | ||||||
| @@ -152,44 +181,51 @@ | |||||||
|                                 (obj) => obj.id !== scan.id |                                 (obj) => obj.id !== scan.id | ||||||
|                               ); |                               ); | ||||||
|                               Toastify({ |                               Toastify({ | ||||||
|                                 text: 'Scan deleted', |                                 text: "Scan deleted", | ||||||
|                                 duration: 500, |                                 duration: 500, | ||||||
|                                 backgroundColor: |                                 backgroundColor: | ||||||
|                                   'linear-gradient(to right, #00b09b, #96c93d)', |                                   "linear-gradient(to right, #00b09b, #96c93d)", | ||||||
|                               }).showToast(); |                               }).showToast(); | ||||||
|                             } |                             } | ||||||
|                           ); |                           ); | ||||||
|                         }} |                         }} | ||||||
|                         tabindex="0" |                         tabindex="0" | ||||||
|                         class="ml-4 text-red-600 hover:text-red-900 cursor-pointer">{$_('confirm-delete')}</button> |                         class="ml-4 text-red-600 hover:text-red-900 cursor-pointer" | ||||||
|  |                         >{$_("confirm-delete")}</button | ||||||
|  |                       > | ||||||
|                     </td> |                     </td> | ||||||
|                   {:else} |                   {:else} | ||||||
|                     <td |                     <td | ||||||
|                       class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium"> |                       class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium" | ||||||
|  |                     > | ||||||
|                       <a |                       <a | ||||||
|                         href="./{scan.id}" |                         href="./{scan.id}" | ||||||
|                         class="text-indigo-600 hover:text-indigo-900">{$_('details')}</a> |                         class="text-indigo-600 hover:text-indigo-900" | ||||||
|                       {#if store.state.jwtinfo.userdetails.permissions.includes('SCAN:DELETE')} |                         >{$_("details")}</a | ||||||
|  |                       > | ||||||
|  |                       {#if store.state.jwtinfo.userdetails.permissions.includes("SCAN:DELETE")} | ||||||
|                         <button |                         <button | ||||||
|                           on:click={() => { |                           on:click={() => { | ||||||
|                             active_deletes[scan.id] = true; |                             active_deletes[scan.id] = true; | ||||||
|                           }} |                           }} | ||||||
|                           tabindex="0" |                           tabindex="0" | ||||||
|                           class="ml-4 text-red-600 hover:text-red-900 cursor-pointer">{$_('delete')}</button> |                           class="ml-4 text-red-600 hover:text-red-900 cursor-pointer" | ||||||
|  |                           >{$_("delete")}</button | ||||||
|  |                         > | ||||||
|                       {/if} |                       {/if} | ||||||
|                     </td> |                     </td> | ||||||
|                   {/if} |                   {/if} | ||||||
|                 </tr> |                 </tr> | ||||||
|               {/if} |  | ||||||
|               {/each} |               {/each} | ||||||
|             </tbody> |             </tbody> | ||||||
|           </table> |           </table> | ||||||
|  |         </Datatable> | ||||||
|       </div> |       </div> | ||||||
|     {/if} |     {/if} | ||||||
|   {:catch error} |   {:catch error} | ||||||
|     <div class="text-white px-6 py-4 border-0 rounded relative mb-4 bg-red-500"> |     <div class="text-white px-6 py-4 border-0 rounded relative mb-4 bg-red-500"> | ||||||
|       <span class="inline-block align-middle mr-8"> |       <span class="inline-block align-middle mr-8"> | ||||||
|         <b class="capitalize">{$_('general_promise_error')}</b> |         <b class="capitalize">{$_("general_promise_error")}</b> | ||||||
|         {error} |         {error} | ||||||
|       </span> |       </span> | ||||||
|     </div> |     </div> | ||||||
|   | |||||||
							
								
								
									
										50
									
								
								src/components/scans/ThFilterRunner.svelte
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										50
									
								
								src/components/scans/ThFilterRunner.svelte
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,50 @@ | |||||||
|  | <script> | ||||||
|  |   export let handler; | ||||||
|  |   let filterValue = ""; | ||||||
|  | </script> | ||||||
|  |  | ||||||
|  | <th> | ||||||
|  |   <input | ||||||
|  |     on:input={() => { | ||||||
|  |       setTimeout(() => { | ||||||
|  |         const v = filterValue.toLowerCase(); | ||||||
|  |         handler.filter(v, (c) => { | ||||||
|  |           if (v.startsWith("#")) { | ||||||
|  |             return `#${c.runner?.id}`; | ||||||
|  |           } | ||||||
|  |           if (c.runner) { | ||||||
|  |             let runnerName = `${c.runner.firstname} ${c.runner.lastname}`; | ||||||
|  |             if (c.runner.middlename) { | ||||||
|  |               runnerName = `${c.runner.firstname} ${c.runner.middlename} ${c.runner.lastname}`; | ||||||
|  |             } | ||||||
|  |             runnerName = runnerName.toLowerCase(); | ||||||
|  |             return runnerName; | ||||||
|  |           } | ||||||
|  |           return ""; | ||||||
|  |         }); | ||||||
|  |       }, 150); | ||||||
|  |     }} | ||||||
|  |     placeholder="Filter" | ||||||
|  |     bind:value={filterValue} | ||||||
|  |     type="text" | ||||||
|  |     name="runnerfilter" | ||||||
|  |     id="runnerfilter" | ||||||
|  |   /> | ||||||
|  | </th> | ||||||
|  |  | ||||||
|  | <style> | ||||||
|  |   th { | ||||||
|  |     border-bottom: 1px solid #e0e0e0; | ||||||
|  |   } | ||||||
|  |   input { | ||||||
|  |     margin: -1px 0 0 0; | ||||||
|  |     padding: 0; | ||||||
|  |     width: 100%; | ||||||
|  |     height: 24px; | ||||||
|  |     border: none; | ||||||
|  |     text-align: left; | ||||||
|  |     background: inherit; | ||||||
|  |     outline: 0; | ||||||
|  |     font-size: 14px; | ||||||
|  |   } | ||||||
|  | </style> | ||||||
							
								
								
									
										31
									
								
								src/components/scans/ThFilterTrack.svelte
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								src/components/scans/ThFilterTrack.svelte
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,31 @@ | |||||||
|  | <script> | ||||||
|  |   import { _ } from "svelte-i18n"; | ||||||
|  |   export let tracks; | ||||||
|  |   export let handler; | ||||||
|  |   let selected = "all"; | ||||||
|  | </script> | ||||||
|  |  | ||||||
|  | <th style="border-bottom: 1px solid #ddd;"> | ||||||
|  |   <select | ||||||
|  |     on:input={() => { | ||||||
|  |       setTimeout(() => { | ||||||
|  |         if (`${selected}`.trim()) { | ||||||
|  |           const value = selected; | ||||||
|  |           handler.filter(value, (scan) => { | ||||||
|  |             // TODO: fix filter | ||||||
|  |             if (scan.track.id === value || value === "all") return scan.track.id; | ||||||
|  |             return ""; | ||||||
|  |           }); | ||||||
|  |         } | ||||||
|  |       }, 50); | ||||||
|  |     }} | ||||||
|  |     bind:value={selected} | ||||||
|  |     name="trackfilter" | ||||||
|  |     id="trackfilter" | ||||||
|  |   > | ||||||
|  |     <option value="all">{$_("all")}</option> | ||||||
|  |     {#each tracks as track} | ||||||
|  |       <option value={track.id}>{track.name}</option> | ||||||
|  |     {/each} | ||||||
|  |   </select> | ||||||
|  | </th> | ||||||
| @@ -82,14 +82,6 @@ | |||||||
|                 <tr data-rowid="user_{u.id}"> |                 <tr data-rowid="user_{u.id}"> | ||||||
|                   <td class="px-6 py-4 whitespace-nowrap"> |                   <td class="px-6 py-4 whitespace-nowrap"> | ||||||
|                     <div class="flex items-center"> |                     <div class="flex items-center"> | ||||||
|                       {#if u.profilePic} |  | ||||||
|                         <div class="flex-shrink-0 h-10 w-10"> |  | ||||||
|                           <img |  | ||||||
|                             class="h-10 w-10 rounded-full" |  | ||||||
|                             src={u.profilePic} |  | ||||||
|                             alt="" /> |  | ||||||
|                         </div> |  | ||||||
|                       {/if} |  | ||||||
|                       <div class="ml-4"> |                       <div class="ml-4"> | ||||||
|                         <div class="text-sm font-medium text-gray-900"> |                         <div class="text-sm font-medium text-gray-900"> | ||||||
|                           {u.firstname} |                           {u.firstname} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user