Compare commits
716 Commits
0.3.1
...
834ff8fa63
Author | SHA1 | Date | |
---|---|---|---|
834ff8fa63 | |||
1f428a535e | |||
0c40966970 | |||
9da071fe9b | |||
892a04f289 | |||
27cc9727f1 | |||
f0738d451b | |||
9e6a8daf2c | |||
bfacfec765 | |||
0bae5bf32b | |||
22b09d16d0 | |||
9c867e106e | |||
304f28a3c1 | |||
d65d3793de | |||
3638d87bd2 | |||
b97a92860d | |||
7c86a5eeb3 | |||
d23dbaaf69 | |||
e6ffc371e1 | |||
3177c6eaa3 | |||
acd2f0519d | |||
18ec100c33 | |||
fa55fce76e | |||
f47d5e347d | |||
7488a8b597 | |||
2e3ac154be | |||
2472640755 | |||
7b685d6cad | |||
17f6f4e616 | |||
48cfc15cfb | |||
bb9b779cee | |||
af63ce67ae | |||
5cc4871ec4 | |||
c8cfe669b8 | |||
8b74d6d759 | |||
a9227768de | |||
d966e1d4de | |||
ceb2146c1b | |||
8d006d8c74 | |||
777304f259 | |||
12433f7c23 | |||
44b53da345 | |||
ab45fc144e | |||
e99e9e0708 | |||
467404bfc8 | |||
ce50fa2a62 | |||
10a011d842 | |||
5352410d0c | |||
c5d155396a | |||
93187099d3 | |||
aa24b1dce5 | |||
eb3ede9593 | |||
d7fecfbd0b | |||
b065b4ff21 | |||
87370d24be | |||
8f8b9988ad | |||
f8ccf4f5d8 | |||
25d8b86efd | |||
0cd3e937d8 | |||
89bb9c215e | |||
2d18686ce7 | |||
1d999d4910 | |||
7dfaa7579a | |||
08cb079e97 | |||
450aa83592 | |||
0614c76e92 | |||
97e338f9d4 | |||
636f018daa | |||
c8d639024a | |||
6be2ee626a | |||
f7fc1967a5 | |||
aedb8a765b | |||
cf58bd15c3 | |||
34f4f68524 | |||
09b8144080 | |||
f1e6fb4ce7 | |||
2ca63fd1f6 | |||
a5d25e7d92 | |||
4167819e7a | |||
5bd3a463f0 | |||
79c447b4c6 | |||
540304f947 | |||
75d8f7331b | |||
b2509e9e53 | |||
7862f44653 | |||
962dd0c1bb | |||
5d5f7c7f5c | |||
6aaf838451 | |||
ad3bd312e9 | |||
5fa9939696 | |||
4956bb0e9c | |||
c074c12be7 | |||
ddbc293e9c | |||
a3921b45c7 | |||
38e1c8c5a1 | |||
c2d29ff233 | |||
2316baa898 | |||
f185d559c0 | |||
73d95bc004 | |||
fcd55f89d7 | |||
f9fe793573 | |||
bc36411993 | |||
48506236bf | |||
ded9b589fe | |||
67c3732fad | |||
2932f4591e | |||
df53c07450 | |||
40899e9d80 | |||
f794af0950 | |||
1665a1a093 | |||
4a36fb6d95 | |||
acf78a8822 | |||
f5c1ec9939 | |||
4b3d38b05b | |||
23e0b53107 | |||
c907486c4d | |||
6b5945add8 | |||
55693de934 | |||
d467475b6d | |||
44bc14820f | |||
ec447e2e36 | |||
0af2647965 | |||
08442154f4 | |||
9f7d2234fb | |||
ddd82a71a7 | |||
014ba3bf67 | |||
c87321f804 | |||
8b451b3c67 | |||
0cfc87fbe6 | |||
ae9673070c | |||
008027db0e | |||
aec5e3473e | |||
95c8fde72f | |||
0f32968fae | |||
ae79e9fea1 | |||
1a52aaf8d1 | |||
d6c315ab8e | |||
983ce56048 | |||
de2fe0e9f1 | |||
c3c95bf291 | |||
d2050b5948 | |||
6b92405bae | |||
49e87ccb15 | |||
50fffef13b | |||
82b1811971 | |||
aeadef60bb | |||
a1ab65a0e9 | |||
17e0805fe6 | |||
ddd9c396b6 | |||
ef49e507c1 | |||
fbe74a5d80 | |||
076893981f | |||
fac059f02c | |||
0313f8cc49 | |||
7ad6b73574 | |||
3cd0468b19 | |||
f46ccb610e | |||
8a32569a3b | |||
535b23ae91 | |||
4715978f81 | |||
a516aa7775 | |||
77e9c205f9 | |||
e852305400 | |||
c6a15264b3 | |||
2d0beaaaad | |||
5c5ef95d2b | |||
e838e6f321 | |||
ca983c72d4 | |||
91dd5256e9 | |||
3d4dc2d72b | |||
ba3471068a | |||
5a7b2cf886 | |||
cc926e84fb | |||
fff16e6650 | |||
d6f6d10cb6 | |||
1249904582 | |||
8e0437728b | |||
fb0c0718e4 | |||
aa8196db3a | |||
b2223b5110 | |||
3837c5673a | |||
910a0860a0 | |||
009431fb98 | |||
579ece6256 | |||
822e97d3c3 | |||
e0ae2ec42b | |||
859f6e2567 | |||
120d3c9dc8 | |||
342a95ddbe | |||
0b6134dd80 | |||
e76854c23b | |||
24b98983cf | |||
3945f3cf38 | |||
5d7eb690e4 | |||
bef180f4ba | |||
e76e5abcf8 | |||
418f9c2662 | |||
716b72880a | |||
5de0fd792f | |||
13b557aba8 | |||
34dfc9add6 | |||
3a4575f251 | |||
178c2579d5 | |||
50be992b72 | |||
d00f46eee1 | |||
44d6cba403 | |||
37bc5ff17b | |||
e459bb04cc | |||
01eba88adf | |||
016fba5279 | |||
da5d62ae03 | |||
eb46c5eea6 | |||
100094e803 | |||
e723cbf3b3 | |||
00d16ef59f | |||
5204ba5e24 | |||
629aabd3a3 | |||
1b9b9ed372 | |||
b4e7f9046c | |||
f09224d5c0 | |||
5f6ee33e2b | |||
635e2ba0e0 | |||
6109996ade | |||
e4b80c9ab3 | |||
7521ad8bbb | |||
b994065e18 | |||
5b1b84caff | |||
d28a0e1dbb | |||
94d52df322 | |||
0ae3d36f0c | |||
a7fb2b8a1a | |||
16d0dbab5b | |||
99c3050411 | |||
937265e828 | |||
60cd52a959 | |||
b009501a53 | |||
ee49e78dcd | |||
60aa919b14 | |||
8252a35771 | |||
fc668c6880 | |||
bb7f2a611a | |||
c575c73764 | |||
bd3ea721c3 | |||
82423ec467 | |||
64311e9652 | |||
77662b9c19 | |||
b1031e3115 | |||
64c96f25d4 | |||
5ad42d6ca7 | |||
0386d4e88a | |||
cda4512822 | |||
eb6af4b4f0 | |||
4e51b128e6 | |||
0277263f98 | |||
99fb420d58 | |||
a45c5da0a7 | |||
ff1bc8a44a | |||
284bdc6e33 | |||
107360cd93 | |||
abf9aa475b | |||
6156e04eb3 | |||
b541c93797 | |||
6fd6413d6f | |||
dfa38d3421 | |||
6e04b71c1a | |||
5afa541b30 | |||
9e5a093a3a | |||
2cf8e0291a | |||
53aa3bc3ae | |||
1ada5d9c2c | |||
eb0910be57 | |||
e9d5527482 | |||
e6df764562 | |||
915bbbbde0 | |||
f67e089ff3 | |||
b841cc8b95 | |||
5f4b4baadb | |||
94b5a54655 | |||
95eb8b6ae4 | |||
8acbfa8967 | |||
1a115a8423 | |||
5a2172bb9b | |||
6b590671bc | |||
cee1ab1347 | |||
9d0c6b9ef4 | |||
0e682bf630 | |||
8b95b300e2 | |||
e1bd364278 | |||
7edc3427e1 | |||
d3a3de2eac | |||
bc2a8caf3e | |||
d00446dc7b | |||
40ada1c31e | |||
f24b2b9b4c | |||
2a644d7070 | |||
ee0c1496e6 | |||
1da15783d5 | |||
6a925cb27f | |||
88ad64f113 | |||
1bc840430f | |||
76be8d5a87 | |||
8c4a54eb07 | |||
dab5bee3c0 | |||
bc8548fa1e | |||
476f919121 | |||
1c330d0301 | |||
47f0cd0b58 | |||
f97be4e729 | |||
48b8dfe973 | |||
64b6c4d5f7 | |||
fe16c66cf2 | |||
8d8695ba13 | |||
e296256332 | |||
65111e87c1 | |||
95b1490f84 | |||
27a1f57ed3 | |||
c6db6c5535 | |||
bd22d3be36 | |||
ba9d4587cb | |||
74c042a86b | |||
95fcd1dcc4 | |||
2de861d4c1 | |||
e6d80c8ccb | |||
1aa2b3b065 | |||
88566719ec | |||
870e772da2 | |||
e8e3ddceff | |||
a5d1b76891 | |||
e93f4e99f9 | |||
50aa891709 | |||
4b47e70b13 | |||
c4acf774ec | |||
7ff1d50079 | |||
258b3cea66 | |||
a3daa2d24f | |||
9f754ef0e9 | |||
773fbfc579 | |||
85fa9d942e | |||
83e782c7c5 | |||
9ee768551f | |||
e45f8fa9ef | |||
891ea2da12 | |||
5e417f0714 | |||
c53b579fca | |||
ca9c390bb2 | |||
7d654f4a20 | |||
b810bb01db | |||
c2bd696bfe | |||
9fec315910 | |||
9a8a978e49 | |||
e24b84e709 | |||
305b18ef57 | |||
22e9f53c42 | |||
6870e31a81 | |||
e07d1e42e2 | |||
c89caf7855 | |||
3b7c25b106 | |||
6079e1fa90 | |||
434466b306 | |||
e1ac35f848 | |||
5994b22464 | |||
bfc93158f5 | |||
29f99f0b20 | |||
e4872131c8 | |||
16e1434f2a | |||
842badfa69 | |||
8ebc88aebb | |||
c111ec9d91 | |||
e85cdaf324 | |||
599d340a72 | |||
89b7fb8072 | |||
dcaca2ecbd | |||
b8725c96cd | |||
36930259d2 | |||
4397566f1e | |||
7c324869a4 | |||
7e80608066 | |||
af7e44cf7c | |||
05099d066b | |||
937486a66b | |||
e8de1f6d9c | |||
cd9a5469fd | |||
1124f25ea3 | |||
a79a87de4c | |||
d2193bf428 | |||
d9eab9f254 | |||
7d08ea8466 | |||
ba1eb2fa73 | |||
4dbca6096f | |||
03be2d0492 | |||
b0aca9de13 | |||
019a0297a9 | |||
0f93febd86 | |||
d6c96b781f | |||
918bb94644 | |||
a8774fa524 | |||
e4b908ecde | |||
247ba40309 | |||
fcf01ba677 | |||
fb5a64c251 | |||
3d51ba0dc2 | |||
07636f51c4 | |||
eff2050959 | |||
c96a21cf99 | |||
d4d847059a | |||
880d722912 | |||
1ef1053d3f | |||
fa522a85d6 | |||
f09e58c69c | |||
63e02492e8 | |||
fd406eb3e6 | |||
88ade26ef7 | |||
3aea259e41 | |||
0f64767437 | |||
d2430badbe | |||
a880ed2b18 | |||
e0f0fa9a2a | |||
5d2025aa43 | |||
8b7f5a765b | |||
9cd94004fc | |||
8042bca7cc | |||
8d89d158d1 | |||
ccacdf274b | |||
f1ceef05fc | |||
c5697242ee | |||
d0a48ab94b | |||
2b037d41ac | |||
b7d38dd849 | |||
02d24139e9 | |||
ad638e8bc8 | |||
76cb20debe | |||
3e9383e6d9 | |||
aec8bf56a2 | |||
18335e3325 | |||
bca9605d4a | |||
0321f0e979 | |||
f97c2a36f6 | |||
5d945f5bc5 | |||
1c4975589f | |||
fffe5c2c4b | |||
3a57e1c766 | |||
8b70882fec | |||
7fb7ba0d2b | |||
78514c6572 | |||
19393006ef | |||
cb704c4551 | |||
04a09c3ce5 | |||
ca8f978667 | |||
0cc91ac037 | |||
1b6f86669c | |||
264868bb6a | |||
02087a541e | |||
dee0e37a85 | |||
ea7a4a560b | |||
f63e17775c | |||
c4240d36f7 | |||
ed13a0d14b | |||
8fa0be7633 | |||
a99c022608 | |||
12bcbd28f3 | |||
4ece21cdf2 | |||
a7642c2da4 | |||
32024cf2c5 | |||
ef373caba7 | |||
396bd22199 | |||
4bff50a088 | |||
dbc0ab76af | |||
289a8c14d3 | |||
44ed633cbf | |||
0a55d73146 | |||
40dda1150c | |||
09b61ec684 | |||
e53467da22 | |||
09d27c0b05 | |||
3b18be5874 | |||
ff15308c03 | |||
fa3dc870d3 | |||
5e6ada140c | |||
e8f7c1c832 | |||
266a11f64f | |||
e442b92a5f | |||
b337873ca2 | |||
896fff04aa | |||
6d0bca6d67 | |||
d53c1ae2bd | |||
afd73d53be | |||
652e55e80e | |||
9aa8e7edff | |||
d67dfdf2e7 | |||
51f2d96ad6 | |||
30867b4ba1 | |||
ec8d946a41 | |||
1eea935207 | |||
616990b930 | |||
e5c31c9dd4 | |||
4f3f7d1edb | |||
86f13003b5 | |||
6d2431b683 | |||
57e17f2864 | |||
bcc7d7770e | |||
89ea40d7f3 | |||
56b5008278 | |||
555778fca4 | |||
ec1a6226a9 | |||
3c541ada89 | |||
5f677e71e9 | |||
5b3e66c4f6 | |||
9b0252fb75 | |||
2e3750c87c | |||
377d691053 | |||
e90fe73aa2 | |||
3baa681c2b | |||
a588bc4631 | |||
b195c707b0 | |||
25ac84e5fd | |||
5e9df32bfa | |||
722feac8bd | |||
4be87a64b9 | |||
505ca6a58e | |||
5f1c8f3627 | |||
3834079481 | |||
9faa93e292 | |||
27609dc5e0 | |||
2b57d49e4e | |||
dc0c738471 | |||
ca41f4d4f2 | |||
e1427f3ecb | |||
e2fb9a66ad | |||
7278648642 | |||
a4c955ce85 | |||
f086027910 | |||
543b3bd937 | |||
c0534a3b06 | |||
0c9785af36 | |||
482149139a | |||
c89038f337 | |||
696d3ffabf | |||
14e5d0e740 | |||
e4ae1dd475 | |||
46cd262fab | |||
3f5418083f | |||
1586c2f9e6 | |||
e64b318a42 | |||
2033572c83 | |||
ce678c1b76 | |||
83495b101c | |||
6c2a5f904d | |||
c1251d3332 | |||
4ef1b7abe8 | |||
d822e4ab3f | |||
b01fe050d2 | |||
1a4cf211eb | |||
4541304fa8 | |||
894160f3f7 | |||
6a91bd53e2 | |||
0f013304ef | |||
6f4f4ccb16 | |||
7138ca1f5f | |||
45e7f6a0d1 | |||
a7098df9cf | |||
054c7faaac | |||
c3a4c659c0 | |||
087c85e586 | |||
43df188df1 | |||
1d40c6d068 | |||
6614242df6 | |||
b25dc623cf | |||
9d3bb4e4e3 | |||
5dc11c285d | |||
575b4ce970 | |||
e23821a7cb | |||
e415258787 | |||
eddfeb10a5 | |||
0361f8ad69 | |||
1451991d03 | |||
92fee08dc4 | |||
7b7e484091 | |||
e7291a31f3 | |||
2dc31912cc | |||
428a8a10ff | |||
8b2f1965e2 | |||
b18a99e4df | |||
1fac0c8640 | |||
f0be73c2cd | |||
42bd632539 | |||
f8014c6213 | |||
65f49489ad | |||
e9e24d5f2d | |||
369b09972c | |||
e4e2bdac72 | |||
ec0db39184 | |||
a02be78df5 | |||
3490abe9a7 | |||
b5013426e6 | |||
7dd0881d29 | |||
acf0562851 | |||
80c3a90d6f | |||
c6985087a8 | |||
ef50e2d5ce | |||
ed1dc6e8d5 | |||
c2d7a319a0 | |||
0e04298b7c | |||
3a5a73b02c | |||
901c7c1241 | |||
4e82369b16 | |||
945963db32 | |||
5741cbe756 | |||
6401aeb3a8 | |||
6a0c129d39 | |||
bbec9ffcdf | |||
541f1fa2e3 | |||
7897820632 | |||
0dd9de2abc | |||
7131ba99b6 | |||
c69026aa5b | |||
16ac96c64e | |||
1bb79b1c98 | |||
eeee272f03 | |||
2563e9d1d6 | |||
24bec66390 | |||
3d30734dc2 | |||
cbc1d53cc2 | |||
9a1f7a13f8 | |||
d48b9b7f91 | |||
358865dc6a | |||
e750c37473 | |||
71a589c10c | |||
3281239ff5 | |||
3e2cdddd5a | |||
1d4c3e51c7 | |||
1694c71528 | |||
169ffc1b0b | |||
89eb3259d4 | |||
ffd88ffc66 | |||
6c2d13bd17 | |||
8d92a75ef0 | |||
acb86ae266 | |||
473cf978b4 | |||
4debab2636 | |||
e91e197873 | |||
b30b6734a1 | |||
dadb80608a | |||
16c9969fb9 | |||
dc1644ed25 | |||
2cc9b3e1ed | |||
415f340a68 | |||
2d4869128d | |||
ae8bc01d9b | |||
e2552d9442 | |||
5d1b5d80b6 | |||
366804aa29 | |||
9240e0c903 | |||
7baaf2cff3 | |||
9fbc1ba031 | |||
6704c07db0 | |||
a87165148a | |||
ec4bcd093b | |||
5552055b98 | |||
03aa67034d | |||
fc21427685 | |||
819b02a204 | |||
de0bd5fd57 | |||
8aa1d94a1a | |||
f8a59133a2 | |||
c382f770dc | |||
cde4ec13ef | |||
ecad1ea839 | |||
6b91b22713 | |||
e34c91b2cc | |||
822759a688 | |||
b606037890 | |||
74d9b94119 | |||
b1e9f955b0 | |||
e0356fa360 | |||
fbc67eeb98 | |||
09fd73b130 | |||
259a76f46b | |||
c6504c2eaf | |||
7d104a1514 | |||
b3bd61c89e | |||
e49dca0275 | |||
03125b3a2d | |||
a523379b3a | |||
aa6348a29a | |||
b9f0f1a69a | |||
a284806d3c | |||
7e10c1db65 | |||
11790638d6 | |||
0583cbe266 | |||
2e6874c822 | |||
2ce41990bf | |||
c8aeba38ba | |||
5e02502a5c | |||
382cc3d844 | |||
dd74d9ee89 | |||
383f82807f | |||
d4579a9a41 | |||
66a07c6a51 | |||
66ffd8e936 | |||
44f07ca231 | |||
ff14f024af | |||
dccf7c6c8d | |||
10d7955f99 | |||
959b32de1c | |||
9c6dc5b424 | |||
aaab95d414 | |||
7d4e93912c | |||
d65b463547 | |||
6e5a4bcb39 | |||
1a799dc30a | |||
e3d2676858 | |||
65b36f8e69 | |||
87387a54f2 | |||
b34e3aeed0 | |||
86c54e04a8 | |||
ef9fc596f5 |
6
.devcontainer/Dockerfile
Normal file
6
.devcontainer/Dockerfile
Normal file
@@ -0,0 +1,6 @@
|
||||
FROM mcr.microsoft.com/vscode/devcontainers/base:alpine-3.12
|
||||
RUN apk update
|
||||
RUN apk add --upgrade nodejs-current npm
|
||||
RUN npm i -g yarn rimraf
|
||||
RUN rimraf node_modules
|
||||
RUN yarn set version berry
|
20
.devcontainer/devcontainer.json
Normal file
20
.devcontainer/devcontainer.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "Node.js",
|
||||
"build": {
|
||||
"dockerfile": "Dockerfile"
|
||||
},
|
||||
"settings": {
|
||||
"terminal.integrated.shell.linux": "/bin/sh"
|
||||
},
|
||||
"extensions": [
|
||||
"dbaeumer.vscode-eslint",
|
||||
"2gua.rainbow-brackets",
|
||||
"christian-kohler.npm-intellisense",
|
||||
"remimarsal.prettier-now",
|
||||
"svelte.svelte-vscode",
|
||||
"lokalise.i18n-ally",
|
||||
"fivethree.vscode-svelte-snippets",
|
||||
"voorjaar.windicss-intellisense"
|
||||
],
|
||||
"postCreateCommand": "yarn && yarn dev --open"
|
||||
}
|
@@ -1,3 +1 @@
|
||||
public/env.sample.js
|
||||
public/workbox-*.js
|
||||
public/workbox-*.js.map
|
||||
public/env.sample.js
|
55
.drone.yml
55
.drone.yml
@@ -1,6 +1,27 @@
|
||||
---
|
||||
kind: secret
|
||||
name: docker_username
|
||||
get:
|
||||
path: odit-registry-builder
|
||||
name: username
|
||||
|
||||
---
|
||||
kind: secret
|
||||
name: docker_password
|
||||
get:
|
||||
path: odit-registry-builder
|
||||
name: password
|
||||
|
||||
---
|
||||
kind: secret
|
||||
name: git_ssh
|
||||
get:
|
||||
path: odit-git-bot
|
||||
name: sshkey
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
type: kubernetes
|
||||
name: build:dev
|
||||
|
||||
steps:
|
||||
@@ -20,22 +41,44 @@ steps:
|
||||
author_email: bot@odit.services
|
||||
remote: git@git.odit.services:lfk/frontend.git
|
||||
ssh_key:
|
||||
from_secret: GITLAB_SSHKEY
|
||||
from_secret: git_ssh
|
||||
- name: build dev
|
||||
image: plugins/docker
|
||||
depends_on: [clone]
|
||||
settings:
|
||||
username:
|
||||
from_secret: DOCKER_REGISTRY_USER
|
||||
from_secret: docker_username
|
||||
password:
|
||||
from_secret: DOCKER_REGISTRY_PASSWORD
|
||||
from_secret: docker_password
|
||||
repo: registry.odit.services/lfk/frontend
|
||||
tags:
|
||||
- dev
|
||||
registry: registry.odit.services
|
||||
|
||||
mtu: 1000
|
||||
trigger:
|
||||
branch:
|
||||
- dev
|
||||
event:
|
||||
- push
|
||||
- push
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: kubernetes
|
||||
name: build:tags
|
||||
steps:
|
||||
- name: build $DRONE_TAG
|
||||
image: plugins/docker
|
||||
depends_on: [clone]
|
||||
settings:
|
||||
username:
|
||||
from_secret: docker_username
|
||||
password:
|
||||
from_secret: docker_password
|
||||
repo: registry.odit.services/lfk/frontend
|
||||
tags:
|
||||
- '${DRONE_TAG}'
|
||||
registry: registry.odit.services
|
||||
mtu: 1000
|
||||
trigger:
|
||||
event:
|
||||
- tag
|
14
.gitignore
vendored
14
.gitignore
vendored
@@ -1,10 +1,10 @@
|
||||
.vscode
|
||||
.idea
|
||||
node_modules
|
||||
dist
|
||||
dist-ssr
|
||||
public/env.js
|
||||
/build
|
||||
yarn.lock
|
||||
package-lock.json
|
||||
yarn.lock
|
||||
*.map
|
||||
public/env.js
|
||||
public/index.html
|
||||
/dist
|
||||
.yarn
|
||||
.pnp.js
|
||||
.yarnrc.yml
|
||||
|
14
.vscode/extensions.json
vendored
Normal file
14
.vscode/extensions.json
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"2gua.rainbow-brackets",
|
||||
"christian-kohler.npm-intellisense",
|
||||
"remimarsal.prettier-now",
|
||||
"svelte.svelte-vscode",
|
||||
"lokalise.i18n-ally",
|
||||
"fivethree.vscode-svelte-snippets",
|
||||
"voorjaar.windicss-intellisense"
|
||||
],
|
||||
"unwantedRecommendations": [
|
||||
"antfu.i18n-ally"
|
||||
]
|
||||
}
|
7
.vscode/i18n-ally-custom-framework.yml
vendored
Normal file
7
.vscode/i18n-ally-custom-framework.yml
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
languageIds:
|
||||
- javascript
|
||||
- svelte
|
||||
- html
|
||||
monopoly: false
|
||||
refactorTemplates:
|
||||
- "{$_('$1')}"
|
5
.vscode/settings.json
vendored
Normal file
5
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"i18n-ally.localesPaths": "src/locales",
|
||||
"i18n-ally.keystyle": "nested",
|
||||
"windicss.enableCodeFolding": false,
|
||||
}
|
757
CHANGELOG.md
757
CHANGELOG.md
@@ -2,8 +2,756 @@
|
||||
|
||||
All notable changes to this project will be documented in this file. Dates are displayed in UTC.
|
||||
|
||||
#### [0.12.1](https://git.odit.services/lfk/frontend/compare/0.12.0...0.12.1)
|
||||
|
||||
- Merge pull request 'ImportRunnerModal Cancel Button feature/122-import_cancel' (#123) from feature/112-import_cancel into dev [`1f428a5`](https://git.odit.services/lfk/frontend/commit/1f428a535e3ae619cbf8db51d04255aac8dd8614)
|
||||
- Added cancel button for the first stage of runner import [`0c40966`](https://git.odit.services/lfk/frontend/commit/0c409669700d3a8096cc04716154b0fdca458fe5)
|
||||
- Escape now triggers foll modal close (including reset) instead of just hiding th modal [`9da071f`](https://git.odit.services/lfk/frontend/commit/9da071fe9ba067160334682bf00163e3630fe919)
|
||||
|
||||
#### [0.12.0](https://git.odit.services/lfk/frontend/compare/0.11.0...0.12.0)
|
||||
|
||||
> 5 April 2021
|
||||
|
||||
- Merge pull request 'feature/108_vite_migration' (#118) from feature/108_vite_migration into dev [`#108`](https://git.odit.services/lfk/frontend/issues/108)
|
||||
- 🚀RELEASE v0.12.0 [`892a04f`](https://git.odit.services/lfk/frontend/commit/892a04f28930481715eb486b1ef4efeb98a6e999)
|
||||
- Fixed package version [`27cc972`](https://git.odit.services/lfk/frontend/commit/27cc9727f1d02d186c3ccadb06e5b4b1b1d6202d)
|
||||
- Merge pull request 'Implmented certificate generation feature/119-Certificate_generation' (#120) from feature/119-Certificate_generation into dev [`f0738d4`](https://git.odit.services/lfk/frontend/commit/f0738d451b02e4a298b5f9cb8ab0be16aed10a38)
|
||||
- The PFS Prefixes now get translated via i18n [`bfacfec`](https://git.odit.services/lfk/frontend/commit/bfacfec76511cae3015f52698fdcbd80a7a15981)
|
||||
- Sorted translations 🌍 [`9e6a8da`](https://git.odit.services/lfk/frontend/commit/9e6a8daf2c394cf17da532382ec7d049a0f89577)
|
||||
- added missing/ wrong translations + formatting! [`7c86a5e`](https://git.odit.services/lfk/frontend/commit/7c86a5eeb370a43451d180a09a501066b023b9a0)
|
||||
- Added i18n [`17f6f4e`](https://git.odit.services/lfk/frontend/commit/17f6f4e616bf57424ee12ad53b939429c02a0171)
|
||||
- Added basic certificate generation component [`af63ce6`](https://git.odit.services/lfk/frontend/commit/af63ce67ae7d8f8a70706c3bd6755197908996ff)
|
||||
- basic ViteJS migration [`ae79e9f`](https://git.odit.services/lfk/frontend/commit/ae79e9fea1963e977ef468e8e56f87d68916fadd)
|
||||
- Implemented generation for orgs [`2e3ac15`](https://git.odit.services/lfk/frontend/commit/2e3ac154be0bf0776cd00f7d510f41ec676ae690)
|
||||
- Implemented generation for teams [`2472640`](https://git.odit.services/lfk/frontend/commit/2472640755e3e41259a44127a875d00517a25842)
|
||||
- updated default entrypoint [`95c8fde`](https://git.odit.services/lfk/frontend/commit/95c8fde72fca5cd5a644d51a33dc88e0b59fce92)
|
||||
- ⏫📍 version bump + pin [`b065b4f`](https://git.odit.services/lfk/frontend/commit/b065b4ff218d07952fa45989e6e2ee7df13e07c1)
|
||||
- 🧹 reorder + fix package [`12433f7`](https://git.odit.services/lfk/frontend/commit/12433f7c236906fe2b29848a0acaa6be1724da56)
|
||||
- 🔨 re-added VS Code devcontainer config [`9318709`](https://git.odit.services/lfk/frontend/commit/93187099d32c506329b1437642aae985f2850689)
|
||||
- 🐳 new Dockerfiles [`0f32968`](https://git.odit.services/lfk/frontend/commit/0f32968fae8b55a13d387918211983d0e61f85ab)
|
||||
- 📃 added readme [`aa24b1d`](https://git.odit.services/lfk/frontend/commit/aa24b1dce5d6d73c8f42fc57f81b692350bf9665)
|
||||
- Copy-paste fix [`f47d5e3`](https://git.odit.services/lfk/frontend/commit/f47d5e347d97ee127fa0380620138a9672665cd5)
|
||||
- 🔨🔥 alpine based devcontainer with working yarn PnP [`777304f`](https://git.odit.services/lfk/frontend/commit/777304f2593df36f4e89d2ba7680add183ff062f)
|
||||
- Copy-paste fix [`7488a8b`](https://git.odit.services/lfk/frontend/commit/7488a8b597a148c309e1b4499d277fed7f3bf9f4)
|
||||
- You can now generate certificates from the runner overview [`bb9b779`](https://git.odit.services/lfk/frontend/commit/bb9b779cee909ab85ef52f13be0a917f1c0a9e62)
|
||||
- Cleaned up generation strings and added the schem for single runner generations for cards [`9c867e1`](https://git.odit.services/lfk/frontend/commit/9c867e106edd68784e6d19743519c1952a0f0bc7)
|
||||
- Changed the basic nameing generation for runenr certificate files [`d65d379`](https://git.odit.services/lfk/frontend/commit/d65d3793de869bcd6733a1bbdac378d0bc1128b3)
|
||||
- ⏫ version bumps [`d7fecfb`](https://git.odit.services/lfk/frontend/commit/d7fecfbd0bc01f1cd44dea3c3837e0cc44afab12)
|
||||
- Cleaned up generation strings and added the schem for single runner generations for sponsoring contracts [`22b09d1`](https://git.odit.services/lfk/frontend/commit/22b09d16d0acc2883e3448dad95ed0f4ea7c6aeb)
|
||||
- Certificate generation from org overview [`3177c6e`](https://git.odit.services/lfk/frontend/commit/3177c6eaa31636ed4546f4797775a0f0a930f5d1)
|
||||
- certificate pdf names now include their locale [`304f28a`](https://git.odit.services/lfk/frontend/commit/304f28a3c10bc4745aa5b7c80d7ba0e651540706)
|
||||
- Runnercard pdfs now include their locale [`3638d87`](https://git.odit.services/lfk/frontend/commit/3638d87bd2ff83618eefda5af18ba19e38e3c2eb)
|
||||
- 🐞 fix await for esNext [`a922776`](https://git.odit.services/lfk/frontend/commit/a9227768de29305b51d10c8a6e4fa1d39b7d998f)
|
||||
- Certificate generation from team overview [`18ec100`](https://git.odit.services/lfk/frontend/commit/18ec100c33a1fbab526187e769dbae54d9db0867)
|
||||
- Added certificate generation from runner overview and detail [`7b685d6`](https://git.odit.services/lfk/frontend/commit/7b685d6cad97d2f7f48c4b19bfc128e1355b70c4)
|
||||
- package cleanup [`6be2ee6`](https://git.odit.services/lfk/frontend/commit/6be2ee626addaf5113b4b4821bd99a276bf4f329)
|
||||
- sponsoring pdf names now include their locale [`0bae5bf`](https://git.odit.services/lfk/frontend/commit/0bae5bf32b8687057dca50cde21022ea8c3abee8)
|
||||
- ✨ update licenses.json [`e99e9e0`](https://git.odit.services/lfk/frontend/commit/e99e9e07089520d5a48021e10d2af7739656641a)
|
||||
- added windicss settings for VSCode [`008027d`](https://git.odit.services/lfk/frontend/commit/008027db0e2736a9bb9defd67178ab3fe580de04)
|
||||
- Certificate generation from team detail [`acd2f05`](https://git.odit.services/lfk/frontend/commit/acd2f0519d62e55dad8e9c3c41e77b6967212502)
|
||||
- ⚡💾 prevent env.js from being cached [`c5d1553`](https://git.odit.services/lfk/frontend/commit/c5d155396a92dfee6d592fb24a936ab521215f6d)
|
||||
- for await fix - ViteJS [`aec5e34`](https://git.odit.services/lfk/frontend/commit/aec5e3473e687415fbfd69c550d9b012e1b1be43)
|
||||
- Certificate generation from org detail [`e6ffc37`](https://git.odit.services/lfk/frontend/commit/e6ffc371e1ca2d4451e7dd4a3ca3c05564edb5fb)
|
||||
- 🧹 drop unused dependencies [`ce50fa2`](https://git.odit.services/lfk/frontend/commit/ce50fa2a62f8ff98e8be9c66432caeebb3952019)
|
||||
- 🐞 fix NGINX config [`5352410`](https://git.odit.services/lfk/frontend/commit/5352410d0c76fd14575d7beafc6a83f028062efe)
|
||||
- Fixed wrong permissiong getting checked [`b97a928`](https://git.odit.services/lfk/frontend/commit/b97a92860d71eb0384170e245a67fa3ea3fd8e85)
|
||||
- new license file version [CI SKIP] [`5cc4871`](https://git.odit.services/lfk/frontend/commit/5cc4871ec4be9f0af07738f6e3d44bdbe31cd25a)
|
||||
- ⏫ bump @odit/lfk-client-js@0.10.1 [`8b74d6d`](https://git.odit.services/lfk/frontend/commit/8b74d6d759c8481f012c201e2ea0d12b29ddef90)
|
||||
- 🔨 dev container open ⚡ [`ceb2146`](https://git.odit.services/lfk/frontend/commit/ceb2146c1b08bbe9250e4db7846e06bd89526c21)
|
||||
- ⏫ version bump: vite-plugin-windicss@0.12.2 [`8d006d8`](https://git.odit.services/lfk/frontend/commit/8d006d8c74d71c43a9031d58f5a8c7fc55ed95fc)
|
||||
- 🚚 move @svitejs/vite-plugin-svelte to @sveltejs/vite-plugin-svelte [`44b53da`](https://git.odit.services/lfk/frontend/commit/44b53da34516b00671b3e5060ba831e409ac3dd5)
|
||||
- ⏫ upgrade vite-plugin-windicss@0.12.1 [`ab45fc1`](https://git.odit.services/lfk/frontend/commit/ab45fc144eaf14f63d86ee53c1db4eefd88f9c7f)
|
||||
- 🐞 fix main.js linking [`467404b`](https://git.odit.services/lfk/frontend/commit/467404bfc87f3c08c5e227f194d71eea7cc48921)
|
||||
- 🐞 fix vite config for production system [`10a011d`](https://git.odit.services/lfk/frontend/commit/10a011d8426e475105ff5d2d5cf4adca2ef7625c)
|
||||
- fix dev script [`eb3ede9`](https://git.odit.services/lfk/frontend/commit/eb3ede9593e2e527df3e3a2f81c8e179bb555f51)
|
||||
- ⏫ bump vite to 2.1.3 [`0cd3e93`](https://git.odit.services/lfk/frontend/commit/0cd3e937d852eeabe43eb6298bfabe20834240b2)
|
||||
- Removed useless console.log [`d23dbaa`](https://git.odit.services/lfk/frontend/commit/d23dbaaf695a60fe5ebbc9945646a16b5fc45a16)
|
||||
- Removed useless console log [`48cfc15`](https://git.odit.services/lfk/frontend/commit/48cfc15cfb09096db1bd5ddbe9138b1a604d581f)
|
||||
|
||||
#### [0.11.0](https://git.odit.services/lfk/frontend/compare/0.10.0...0.11.0)
|
||||
|
||||
> 30 March 2021
|
||||
|
||||
- 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)
|
||||
- 🚀RELEASE v0.11.0 [`f8ccf4f`](https://git.odit.services/lfk/frontend/commit/f8ccf4f5d8f68ecee31430029889b8ab1ecec682)
|
||||
- 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)
|
||||
- new license file version [CI SKIP] [`8f8b998`](https://git.odit.services/lfk/frontend/commit/8f8b9988ad94ee9f3729a3fe6fdb4c558828d892)
|
||||
- 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 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)
|
||||
- You can now copy the selfservice links to your clipboard [`fcd55f8`](https://git.odit.services/lfk/frontend/commit/fcd55f89d72e6ceb9bb2bdd194cc3420145d6d0d)
|
||||
- Formatting [`f185d55`](https://git.odit.services/lfk/frontend/commit/f185d559c0d6476f2f2b9ea74aaad3297411801d)
|
||||
- Copy now 100% worX [`a3921b4`](https://git.odit.services/lfk/frontend/commit/a3921b45c70b410293db593a75d2fdd34c131733)
|
||||
- Fixed changes in wrong file [`73d95bc`](https://git.odit.services/lfk/frontend/commit/73d95bc0042f8f586ba2f2345342e25da1d280c2)
|
||||
- Added check if key exists [`c2d29ff`](https://git.odit.services/lfk/frontend/commit/c2d29ff233f6b3e9dd2555b7e0b845592da2ba35)
|
||||
- Added check if key exists [`2316baa`](https://git.odit.services/lfk/frontend/commit/2316baa8984832382be9f3b4549ca62cf9ccb5a3)
|
||||
- Added translations [`ddbc293`](https://git.odit.services/lfk/frontend/commit/ddbc293e9ca0525910bf3d995de970ee2c35c56a)
|
||||
- new license file version [CI SKIP] [`ded9b58`](https://git.odit.services/lfk/frontend/commit/ded9b589fe087915176c5b54f3c55e412541bc8f)
|
||||
- Merge pull request 'first merge to main 🚀' (#71) from dev into main [`9aa8e7e`](https://git.odit.services/lfk/frontend/commit/9aa8e7edffa7e51b00a5ab7a8f16828b7a469181)
|
||||
|
||||
#### [0.9.0](https://git.odit.services/lfk/frontend/compare/0.8.7...0.9.0)
|
||||
|
||||
> 26 March 2021
|
||||
|
||||
- 🚀RELEASE v0.9.0 [`67c3732`](https://git.odit.services/lfk/frontend/commit/67c3732fad5a7c64ae11dcbebaaa095e1a2b387c)
|
||||
- Merge pull request 'Runner cards feature/94-runnercard_mgnt' (#111) from feature/94-runnercard_mgnt into dev [`2932f45`](https://git.odit.services/lfk/frontend/commit/2932f4591e62187a4903511051d110e9679c0993)
|
||||
- Sorted translations 🌍 [`1665a1a`](https://git.odit.services/lfk/frontend/commit/1665a1a093862a13be78ec65dcdf64eb7d855593)
|
||||
- Added translations [`6b5945a`](https://git.odit.services/lfk/frontend/commit/6b5945add86a77630c500872545bb91724b2047f)
|
||||
- Sorted translations 🌍 [`d6c315a`](https://git.odit.services/lfk/frontend/commit/d6c315ab8e020bc65b967e2c3f4cd921392d66d5)
|
||||
- Sorted translations [`de2fe0e`](https://git.odit.services/lfk/frontend/commit/de2fe0e9f171efb3deeea8cfe638f60e3ca90423)
|
||||
- Added basic cards page [`5c5ef95`](https://git.odit.services/lfk/frontend/commit/5c5ef95d2be65c0e951dcd472113c8ce0593c9e0)
|
||||
- Moved contract generation to it's own component [`0cfc87f`](https://git.odit.services/lfk/frontend/commit/0cfc87fbe6adfacab5c2fab732866aead3231fbf)
|
||||
- Teams now use the new sponsoring contracts module [`014ba3b`](https://git.odit.services/lfk/frontend/commit/014ba3bf6718ff28f35c67c8f732b53aae50723c)
|
||||
- Basic card generation worX 🎉🎉 [`d467475`](https://git.odit.services/lfk/frontend/commit/d467475b6d61d50bec3a043ea8792533e8593df6)
|
||||
- Orgs now use the new sponsoring contracts module [`8b451b3`](https://git.odit.services/lfk/frontend/commit/8b451b3c6794e7df09898a687533ce8fadd56192)
|
||||
- Added runnercard detail/edit modal [`0313f8c`](https://git.odit.services/lfk/frontend/commit/0313f8cc495088df1237d00e6b9ed1a94f019644)
|
||||
- Implemented Add card modal [`535b23a`](https://git.odit.services/lfk/frontend/commit/535b23ae917de154e08962f5d486c50d6e091fe0)
|
||||
- Added bulk card creation modal [`8a32569`](https://git.odit.services/lfk/frontend/commit/8a32569a3be1ad26ba163f4e2b67a368cfeeb422)
|
||||
- Added basic card overview [`c6a1526`](https://git.odit.services/lfk/frontend/commit/c6a15264b3d13d516f3d97ea4b891ed1c328cead)
|
||||
- Fixed org generation not hiding the generation toast [`c87321f`](https://git.odit.services/lfk/frontend/commit/c87321f804858f84fcccd85a15b9c3fb003c18be)
|
||||
- Working runner runnercard generation [`c907486`](https://git.odit.services/lfk/frontend/commit/c907486c4d1c64114124deb3cd0d0cf11d38a6b1)
|
||||
- Implemented bulk creation [`7ad6b73`](https://git.odit.services/lfk/frontend/commit/7ad6b73574174f24f2d6f23b3caf4823881a85e7)
|
||||
- Now w/ working dialog🎉🎉🎉 [`ae96730`](https://git.odit.services/lfk/frontend/commit/ae9673070c3959ff6190a37123f3fc609b182c5a)
|
||||
- Now w/working editing [`fac059f`](https://git.odit.services/lfk/frontend/commit/fac059f02cae84261443ee95448ec8db06dd755a)
|
||||
- Added runnercard generation for teams [`23e0b53`](https://git.odit.services/lfk/frontend/commit/23e0b53107623c505d07a99a51ce836c9324acce)
|
||||
- Added bulk creation modal to cards view [`f46ccb6`](https://git.odit.services/lfk/frontend/commit/f46ccb610e01654a4ee5e47d78ab500045dd494b)
|
||||
- Added a new runenrcard logo [`acf78a8`](https://git.odit.services/lfk/frontend/commit/acf78a88221d0988f6501ae341e028a4113b578d)
|
||||
- Moved modal import to overview for simplification [`1a52aaf`](https://git.odit.services/lfk/frontend/commit/1a52aaf8d1ad19b03d355aec0e1c48182db024f9)
|
||||
- Added CardsEmptyState + Emtystate graphic [`2d0beaa`](https://git.odit.services/lfk/frontend/commit/2d0beaaaad4efefd036bbef09f10c8c22bdb2760)
|
||||
- Added message for missing runner/blanco card) [`4715978`](https://git.odit.services/lfk/frontend/commit/4715978f810bbb283876f06d147b1ec86d373786)
|
||||
- Fixed counting bug [`f5c1ec9`](https://git.odit.services/lfk/frontend/commit/f5c1ec9939d856804c9ec3ead4b3ed869fc2ea63)
|
||||
- Added card generation/printing from detail [`4a36fb6`](https://git.odit.services/lfk/frontend/commit/4a36fb6d952d9fe4d5edbe1ed0779c7fbcd50ef0)
|
||||
- Formatting [`a516aa7`](https://git.odit.services/lfk/frontend/commit/a516aa7775faa2244862bb2e3c4de623c6405e5b)
|
||||
- Moved the pdf generation related componenets to their own folder [`ddd82a7`](https://git.odit.services/lfk/frontend/commit/ddd82a71a7b67ead892626addfd56ba4cc632750)
|
||||
- Now routing the cards page [`e852305`](https://git.odit.services/lfk/frontend/commit/e852305400a139f8169350077c30012aed556828)
|
||||
- Fuggin snowpack bs [`44bc148`](https://git.odit.services/lfk/frontend/commit/44bc14820fed26d5e0d8b12ecd6b46ca0608ae7b)
|
||||
- Formatting [`9f7d223`](https://git.odit.services/lfk/frontend/commit/9f7d2234fb9603a7391ec9a64253724c2c25c333)
|
||||
- Now with working org runenrcard generation [`4b3d38b`](https://git.odit.services/lfk/frontend/commit/4b3d38b05b3ed74fc3c0d77e00fa2ed245e6325c)
|
||||
- Now importing runner overview [`77e9c20`](https://git.odit.services/lfk/frontend/commit/77e9c205f94cf56c2e3584444899adb1e8bdf3c6)
|
||||
- CardsOverview - move to 'enabled' language key [`df53c07`](https://git.odit.services/lfk/frontend/commit/df53c0745035a220d4c07fdce1b5a5e4d763411d)
|
||||
- ✒ typo - "Geb" -> "Gebe" [`f794af0`](https://git.odit.services/lfk/frontend/commit/f794af0950de59a7a7b468c30abdcb5c145f65fb)
|
||||
- Bumped lfk client lib version [`3cd0468`](https://git.odit.services/lfk/frontend/commit/3cd0468b1921824b131178cb02677540b079f9b0)
|
||||
- drop console log - CardDetailModal [`40899e9`](https://git.odit.services/lfk/frontend/commit/40899e9d80ba07a3fbbcac72782db53d98dc318e)
|
||||
- Removed debug info [`55693de`](https://git.odit.services/lfk/frontend/commit/55693de93420c2d76af296fcacc6bcad644a3cbf)
|
||||
|
||||
#### [0.8.7](https://git.odit.services/lfk/frontend/compare/0.8.6...0.8.7)
|
||||
|
||||
> 25 March 2021
|
||||
|
||||
- 🚀RELEASE v0.8.7 [`0af2647`](https://git.odit.services/lfk/frontend/commit/0af26479656393b0baea88f6f83c778740a67e62)
|
||||
- Fixed listen on wrong permission🐞 [`0844215`](https://git.odit.services/lfk/frontend/commit/08442154f4bf94fc1101808b4585dc1f95afe8b2)
|
||||
|
||||
#### [0.8.6](https://git.odit.services/lfk/frontend/compare/0.8.5...0.8.6)
|
||||
|
||||
> 25 March 2021
|
||||
|
||||
- 🚀RELEASE v0.8.6 [`c3c95bf`](https://git.odit.services/lfk/frontend/commit/c3c95bf2916618efe6764a33d9a42d35764d15be)
|
||||
- Merge pull request 'Know Production Bugs 🐞' (#109) from bugfix/107-prod_issues into dev [`d2050b5`](https://git.odit.services/lfk/frontend/commit/d2050b5948890a6077cbb41d82d1a6a1d1106652)
|
||||
- Errors now toast errors❌ [`17e0805`](https://git.odit.services/lfk/frontend/commit/17e0805fe64f6d181f55b81afa502ee6443ebabe)
|
||||
- Sorted translations 👀 [`82b1811`](https://git.odit.services/lfk/frontend/commit/82b1811971b974b686e7618b8a381e1589c168f6)
|
||||
- Fixed missing translations for scanstations🌍 [`aeadef6`](https://git.odit.services/lfk/frontend/commit/aeadef60bbe71da09bb569d20ca7377645beba7f)
|
||||
- Sorted translations🌍 [`a1ab65a`](https://git.odit.services/lfk/frontend/commit/a1ab65a0e975c02c01c603bf6d95a79ada1caa0b)
|
||||
- Fixed runner import getting triggered with invalid information [`ddd9c39`](https://git.odit.services/lfk/frontend/commit/ddd9c396b6bfd39a7b1627d4975151943b367ebf)
|
||||
- Removed middlename search from all files that had it [`6b92405`](https://git.odit.services/lfk/frontend/commit/6b92405bae21e78d694601cbc0b33eed56ef4533)
|
||||
- Fixed mail login bug🐞📧 [`0768939`](https://git.odit.services/lfk/frontend/commit/076893981ff4f7f17330746c561acc570339adac)
|
||||
- Now disabled search by middlename as a quick workaround 🐞 [`49e87cc`](https://git.odit.services/lfk/frontend/commit/49e87ccb15a7ed5edea22a3c3e235f7bee07d3f4)
|
||||
- Fixed conflicting css [`50fffef`](https://git.odit.services/lfk/frontend/commit/50fffef13b8fce885964d8ac277b4ca24d944b2b)
|
||||
- Commented out the buggy runner search to prevent bad UX [`fbe74a5`](https://git.odit.services/lfk/frontend/commit/fbe74a5d8090553a35576a17c97019939cf4f386)
|
||||
- Fixed outsideclick not clearing import modal🛠 [`ef49e50`](https://git.odit.services/lfk/frontend/commit/ef49e507c175510eeb466d33f222755fac8a2a0b)
|
||||
|
||||
#### [0.8.5](https://git.odit.services/lfk/frontend/compare/0.8.4...0.8.5)
|
||||
|
||||
> 20 March 2021
|
||||
|
||||
- 🚀RELEASE v0.8.5 [`e838e6f`](https://git.odit.services/lfk/frontend/commit/e838e6f321bef1565a7e4316890a3c600b242e5a)
|
||||
- Fixed dupliacate mutation 🐞 [`91dd525`](https://git.odit.services/lfk/frontend/commit/91dd5256e9545f62e4342ae5477c36262d6e3401)
|
||||
|
||||
#### [0.8.4](https://git.odit.services/lfk/frontend/compare/0.8.3...0.8.4)
|
||||
|
||||
> 20 March 2021
|
||||
|
||||
- CONFIG: default_username + default_password [`cc926e8`](https://git.odit.services/lfk/frontend/commit/cc926e84fb8bd9d6c9fd37349e25eb802e1bb324)
|
||||
- 🚀RELEASE v0.8.4 [`3d4dc2d`](https://git.odit.services/lfk/frontend/commit/3d4dc2d72b129f0134ae9f230810c3301dbd5caa)
|
||||
- CONFIG: add 'demo' as default username/password [`ba34710`](https://git.odit.services/lfk/frontend/commit/ba3471068ab00e2d5dbe21d6d763094e662f8347)
|
||||
|
||||
#### [0.8.3](https://git.odit.services/lfk/frontend/compare/0.8.2...0.8.3)
|
||||
|
||||
> 20 March 2021
|
||||
|
||||
- Sorted translation 🌍 [`d6f6d10`](https://git.odit.services/lfk/frontend/commit/d6f6d10cb6b639a1f988e0da4811355750b0f027)
|
||||
- Smaller bugfixes [`8e04377`](https://git.odit.services/lfk/frontend/commit/8e0437728bd04223a23cdf1879c6c739ca8ebef7)
|
||||
- More small fixes [`1249904`](https://git.odit.services/lfk/frontend/commit/12499045824c13a3ee35c6cc8c3c3a3130dbec12)
|
||||
- 🚀RELEASE v0.8.3 [`fff16e6`](https://git.odit.services/lfk/frontend/commit/fff16e6650cce1231a8d0db43531bf8e3e01f84a)
|
||||
|
||||
#### [0.8.2](https://git.odit.services/lfk/frontend/compare/0.8.1...0.8.2)
|
||||
|
||||
> 20 March 2021
|
||||
|
||||
- Now using env base url [`aa8196d`](https://git.odit.services/lfk/frontend/commit/aa8196db3a9ff1bcd2b5f0ce655957bfa4e310ab)
|
||||
- 🚀RELEASE v0.8.2 [`fb0c071`](https://git.odit.services/lfk/frontend/commit/fb0c0718e405312f239bc3829b3d9c203d246458)
|
||||
|
||||
#### [0.8.1](https://git.odit.services/lfk/frontend/compare/0.8.0...0.8.1)
|
||||
|
||||
> 20 March 2021
|
||||
|
||||
- ⚡ CI - add build:tags pipeline [`910a086`](https://git.odit.services/lfk/frontend/commit/910a0860a0bd240c5ff9d23dc33923f941b1e10b)
|
||||
- 🚀RELEASE v0.8.1 [`b2223b5`](https://git.odit.services/lfk/frontend/commit/b2223b5110cc31740e69de66c74ab3f83a046308)
|
||||
|
||||
#### [0.8.0](https://git.odit.services/lfk/frontend/compare/0.7.0...0.8.0)
|
||||
|
||||
> 20 March 2021
|
||||
|
||||
- 🚀RELEASE v0.8.0 [`009431f`](https://git.odit.services/lfk/frontend/commit/009431fb98bc84c71590644a5d3606805d432202)
|
||||
- new license file version [CI SKIP] [`579ece6`](https://git.odit.services/lfk/frontend/commit/579ece625651c8bf37b5704e82264a8833811f68)
|
||||
- Merge pull request 'User settings feature/103-settings_page' (#104) from feature/103-settings_page into dev [`822e97d`](https://git.odit.services/lfk/frontend/commit/822e97d3c35be57ecf9ed6bd6af474fd89e7d8d8)
|
||||
- Sorted translations🌍 [`120d3c9`](https://git.odit.services/lfk/frontend/commit/120d3c9dc81a0878d0dd64b66caadc6201651bda)
|
||||
- Translated headers [`01eba88`](https://git.odit.services/lfk/frontend/commit/01eba88adfd7cced75e828427494cb99fdf01d70)
|
||||
- Implemented change detection [`37bc5ff`](https://git.odit.services/lfk/frontend/commit/37bc5ff17b8f97dfc76962435f9cb64156848c82)
|
||||
- Added new profile deletion modal [`13b557a`](https://git.odit.services/lfk/frontend/commit/13b557aba89378af40e2f9feb5f90a1c582aea91)
|
||||
- Implemented the password change logic [`24b9898`](https://git.odit.services/lfk/frontend/commit/24b98983cf964fe2b5594e20b22c63e97ada3166)
|
||||
- The settings page now boasts your profile picture [`e459bb0`](https://git.odit.services/lfk/frontend/commit/e459bb04cc3fcdc5d176e53b764ad3e995d66762)
|
||||
- Added inputs for password update [`5d7eb69`](https://git.odit.services/lfk/frontend/commit/5d7eb690e4f2be0d389c785abe73c137cf25c29c)
|
||||
- Added delete Profile button [`418f9c2`](https://git.odit.services/lfk/frontend/commit/418f9c2662531b997699e8db05e21da394025688)
|
||||
- Implemented profile updates [`3a4575f`](https://git.odit.services/lfk/frontend/commit/3a4575f25148c74878c978e5cf9885ad12101f00)
|
||||
- Added translations 🌍 [`3945f3c`](https://git.odit.services/lfk/frontend/commit/3945f3cf3862369ff179379d76090b1e2d78b417)
|
||||
- Its translation time 🌍 [`5de0fd7`](https://git.odit.services/lfk/frontend/commit/5de0fd792f15241a4a49eda575bc8f23ba6c6974)
|
||||
- Fixed delete_triggered not getting reset [`e76e5ab`](https://git.odit.services/lfk/frontend/commit/e76e5abcf87883602002fb5687a3fd7b95f24793)
|
||||
- Added deletion confirmation modal [`716b728`](https://git.odit.services/lfk/frontend/commit/716b72880ad7468694affaf5549b2d34186294b6)
|
||||
- Added translations [`e76854c`](https://git.odit.services/lfk/frontend/commit/e76854c23be9d909c35a61f8f8e65f743ccf3ec4)
|
||||
- Added translations🌍 [`34dfc9a`](https://git.odit.services/lfk/frontend/commit/34dfc9add670040e2308964ed8c81d3a99f11f0d)
|
||||
- Added hint to the logout after password update [`0b6134d`](https://git.odit.services/lfk/frontend/commit/0b6134dd8093427ec15e55d805dae3b18dc55c6d)
|
||||
- Added missing translation [`44d6cba`](https://git.odit.services/lfk/frontend/commit/44d6cba403c117b1b76ecad32fbc4c2bd02a8cc3)
|
||||
- Updated old endpoints [`178c257`](https://git.odit.services/lfk/frontend/commit/178c2579d56c3e78e947e658a5c3afe367c3e8ce)
|
||||
- Settings - rouded corners on password change [`e0ae2ec`](https://git.odit.services/lfk/frontend/commit/e0ae2ec42b89271282e3e96e41de38afd08aa229)
|
||||
- Now force reloading to log out [`342a95d`](https://git.odit.services/lfk/frontend/commit/342a95ddbeceac2cf3547462a9b1996ecd7dba61)
|
||||
- Removed useless debug info 🐞 [`bef180f`](https://git.odit.services/lfk/frontend/commit/bef180f4ba7aaf252d87efc789eb53fb75abbdf1)
|
||||
- Bumped lfk client js version [`50be992`](https://git.odit.services/lfk/frontend/commit/50be992b72dd71eb2c756b1bf6f2d606344fe7ca)
|
||||
- Now showing logo as default profile pic [`d00f46e`](https://git.odit.services/lfk/frontend/commit/d00f46eee1fd28095064f50620c15ac648f331b9)
|
||||
- Moved settings to their own folder [`016fba5`](https://git.odit.services/lfk/frontend/commit/016fba527910b95eb2690207bbede91004d2f2d9)
|
||||
- Now also resetting postdata (prevent against password leaks) [`859f6e2`](https://git.odit.services/lfk/frontend/commit/859f6e25675362ee2ef5553255e3dc9e3040672c)
|
||||
|
||||
#### [0.7.0](https://git.odit.services/lfk/frontend/compare/0.6.0...0.7.0)
|
||||
|
||||
> 19 March 2021
|
||||
|
||||
- Merge pull request 'feature/62-contract-generation' (#76) from feature/62-contract-generation into dev [`#62`](https://git.odit.services/lfk/frontend/issues/62)
|
||||
- Merge pull request 'Small bugfixes - feature/64-dialog_clearing_bug' (#75) from feature/64-dialog_clearing_bug into dev [`#64`](https://git.odit.services/lfk/frontend/issues/64)
|
||||
- Fixed non-automatic logout [`#38`](https://git.odit.services/lfk/frontend/issues/38)
|
||||
- Merge pull request 'feature/69-translation-keys' (#74) from feature/69-translation-keys into dev [`#69`](https://git.odit.services/lfk/frontend/issues/69)
|
||||
- Merge pull request 'feature/50-contact-management' (#67) from feature/50-contact-management into dev [`#50`](https://git.odit.services/lfk/frontend/issues/50)
|
||||
- 🚀RELEASE v0.7.0 [`da5d62a`](https://git.odit.services/lfk/frontend/commit/da5d62ae03bbd057f52473ec047e09067e3715a3)
|
||||
- Ordered locales [`0f93feb`](https://git.odit.services/lfk/frontend/commit/0f93febd866b0117d7bdf6149c2e8b94f801b1b5)
|
||||
- Added missing translation [`918bb94`](https://git.odit.services/lfk/frontend/commit/918bb946446608ecebf3e388607068f7aa48e105)
|
||||
- Sorted translations [`eff2050`](https://git.odit.services/lfk/frontend/commit/eff205095915e3f9bf9dd2f746e5245015740ca5)
|
||||
- Sorted translations 🌎🌍 [`5f6ee33`](https://git.odit.services/lfk/frontend/commit/5f6ee33e2bcabc007bba340ef51bc28f707aa58d)
|
||||
- Added language keys🌎 [`60aa919`](https://git.odit.services/lfk/frontend/commit/60aa919b141d26853300db28ab20a6fe41c3f0b6)
|
||||
- Sorted translations 🌎 [`16d0dba`](https://git.odit.services/lfk/frontend/commit/16d0dbab5bb587cb859c30e04321fb5758455f80)
|
||||
- Translated missing german stuff 🌍 [`e4b80c9`](https://git.odit.services/lfk/frontend/commit/e4b80c9ab34d31ec31df55904eacfac2c8728b10)
|
||||
- Added translation keys [`880d722`](https://git.odit.services/lfk/frontend/commit/880d722912fbb8aa7b383f3a7f4e04b639287c3f)
|
||||
- Added german translations [`d4d8470`](https://git.odit.services/lfk/frontend/commit/d4d847059af0a02a67e1759812b420f92609f517)
|
||||
- Working add fixed/normal switch [`5d2025a`](https://git.odit.services/lfk/frontend/commit/5d2025aa43f6c4bc4c8f792be22fcec07edd37b9)
|
||||
- Added basic donation detail [`88ade26`](https://git.odit.services/lfk/frontend/commit/88ade26ef7b112a777af2c7efc10088f79b8f04e)
|
||||
- Added basic overview with emptystate [`f1ceef0`](https://git.odit.services/lfk/frontend/commit/f1ceef05fca603f76480df47623941a4ec6a18d1)
|
||||
- Finished group creation modal [`d2193bf`](https://git.odit.services/lfk/frontend/commit/d2193bf428d021328f407e6be1e661b582fd2a1d)
|
||||
- Added basic donation overview [`8d89d15`](https://git.odit.services/lfk/frontend/commit/8d89d158d11874369265ba668967762d4ee20dd8)
|
||||
- Donors now get their donations linked in the donor detail [`3aea259`](https://git.odit.services/lfk/frontend/commit/3aea259e415e21f99602bc4e4bfc8cb633d68ab9)
|
||||
- Fixed text size mismatch [`3d51ba0`](https://git.odit.services/lfk/frontend/commit/3d51ba0dc2da65e826bdbb29a6da11ba07078139)
|
||||
- Applied the select fix to all things runner 🏃♀️🏃♂️ [`0386d4e`](https://git.odit.services/lfk/frontend/commit/0386d4e88ab57457fa981399627b2b61f38bb1ae)
|
||||
- Now the saveing button even worx :O [`63e0249`](https://git.odit.services/lfk/frontend/commit/63e02492e81e3ee02386d3e4363d3ae20125aa8b)
|
||||
- Switched import modal over to svelte select [`bd3ea72`](https://git.odit.services/lfk/frontend/commit/bd3ea721c301bf6ef67ef4e1e27ca73e799e1a35)
|
||||
- Switched the scanstation detail over to svelte select👀👀 [`b1031e3`](https://git.odit.services/lfk/frontend/commit/b1031e3115ce03ee68e10f3240f8e829f3f7cfde)
|
||||
- Switched the scanstation modal over to svelte select👀👀 [`64c96f2`](https://git.odit.services/lfk/frontend/commit/64c96f25d4a9277df431011f4660b59a2eb0a9da)
|
||||
- Fixed select bug for sponsoring detail 🛠 [`64311e9`](https://git.odit.services/lfk/frontend/commit/64311e96528e0b023892170b5541652cc22f176b)
|
||||
- Added missing translation keys [`c96a21c`](https://git.odit.services/lfk/frontend/commit/c96a21cf9990a80ec2571366a40116a9d5d64549)
|
||||
- Fixed runner group update recognition being weired [`b009501`](https://git.odit.services/lfk/frontend/commit/b009501a533e6ebfa79dde4c48554c99ee53c9c2)
|
||||
- Fixed runner group update recognition being weired [`ee49e78`](https://git.odit.services/lfk/frontend/commit/ee49e78dcd34b0d22c3e3c16ed8e0eb8805ea4c8)
|
||||
- Donors now get their donations linked in the donor overview [`0f64767`](https://git.odit.services/lfk/frontend/commit/0f64767437626e90adaa931cb15c491e5bfa76c9)
|
||||
- Fixed load order bug [`c575c73`](https://git.odit.services/lfk/frontend/commit/c575c7376499be07980cb4dbdb7a177e0a18e29c)
|
||||
- Fixed select bug for sponsoring modal 🐞 [`77662b9`](https://git.odit.services/lfk/frontend/commit/77662b9c19bbef57c49471d9326b48656aebf1ff)
|
||||
- Fixed select bug for org detail 🏠 [`82423ec`](https://git.odit.services/lfk/frontend/commit/82423ec46798a354e6f3208b67eac3723f874a4d)
|
||||
- Added new icon for donations [`fa522a8`](https://git.odit.services/lfk/frontend/commit/fa522a85d6215d3f6dd9af05f18dd75fbfb5e0c4)
|
||||
- Formatting [`f09e58c`](https://git.odit.services/lfk/frontend/commit/f09e58c69c4d279f825f756c789db08980be9435)
|
||||
- Bumped non-svelte dev dependencies🔝 [`629aabd`](https://git.odit.services/lfk/frontend/commit/629aabd3a35766b181bebe28a31d531362c0a400)
|
||||
- Added missing language keys [`6109996`](https://git.odit.services/lfk/frontend/commit/6109996adeec808847a72691a9cc3f174285612e)
|
||||
- Added groupoverview to router [`d9eab9f`](https://git.odit.services/lfk/frontend/commit/d9eab9f2547744ae018f6bd20c730ffd289db4c0)
|
||||
- Added the new, shiny badges to donor overview [`b0aca9d`](https://git.odit.services/lfk/frontend/commit/b0aca9de13b5dcfc082a0bd27bfec4a2ef4402cf)
|
||||
- Fixed missing inversion [`a8774fa`](https://git.odit.services/lfk/frontend/commit/a8774fa5242a64783c7fcce476c99e7e82a3d158)
|
||||
- New folder structure [`4dbca60`](https://git.odit.services/lfk/frontend/commit/4dbca6096fa6e0aa6ff3f1a310280cf4e56163b1)
|
||||
- Fixed missing middlename action [`d6c96b7`](https://git.odit.services/lfk/frontend/commit/d6c96b781f33600fd61057e3ddb0cb0b6313a6ee)
|
||||
- Formatting [`a79a87d`](https://git.odit.services/lfk/frontend/commit/a79a87de4c04f685d1209a38cab0a590274c6ded)
|
||||
- Fixed donation badges now show their amount [`fb5a64c`](https://git.odit.services/lfk/frontend/commit/fb5a64c25188cd577196a80613c7aa4851d74bd5)
|
||||
- Added donation route [`ccacdf2`](https://git.odit.services/lfk/frontend/commit/ccacdf274bcd55c3333e56e83081a4957b8f27db)
|
||||
- Formatting [`cd9a546`](https://git.odit.services/lfk/frontend/commit/cd9a5469fd085b1204e9a513bc7e22c6f54532b8)
|
||||
- Enabled add modal [`8042bca`](https://git.odit.services/lfk/frontend/commit/8042bca7ccbfe0782bf875c8dd730d0c8653ff66)
|
||||
- Added custom i18n ally insert format [`1ef1053`](https://git.odit.services/lfk/frontend/commit/1ef1053d3f96a3b2cd584d27781575e329925613)
|
||||
- Now routing stuff to the donation detail [`fd406eb`](https://git.odit.services/lfk/frontend/commit/fd406eb3e6ac6ee41884f7f902895756367bd3b9)
|
||||
- Adjusted togle label font size [`a880ed2`](https://git.odit.services/lfk/frontend/commit/a880ed2b18a1a6ff71f9a95dc1d06242fa4bd613)
|
||||
- DonorDetail accessibility improvements 👀 [`019a029`](https://git.odit.services/lfk/frontend/commit/019a0297a90695fcf1887c4bbf0310d2a81114bd)
|
||||
- Updated donor badege styleing [`247ba40`](https://git.odit.services/lfk/frontend/commit/247ba4030928bcf49e15ee2e7383026c019751e9)
|
||||
- Updated donor badege styleing [`fcf01ba`](https://git.odit.services/lfk/frontend/commit/fcf01ba6772340a82d7f2a703a4e66111e9f13e8)
|
||||
- Removed useless style [`07636f5`](https://git.odit.services/lfk/frontend/commit/07636f51c426121d56ef27309b5f069b39843393)
|
||||
- Renamed button [`1124f25`](https://git.odit.services/lfk/frontend/commit/1124f25ea3b1a2c052e2bd9c4c3480d579a8fc74)
|
||||
- Amount now also self-resetts [`d2430ba`](https://git.odit.services/lfk/frontend/commit/d2430badbe8e07dc0ae0998c9595784be5d1d79e)
|
||||
- Renamed folder [`7d08ea8`](https://git.odit.services/lfk/frontend/commit/7d08ea84660e735031a0511a2862429bb5222b3a)
|
||||
- Merge pull request 'Donation management feature/79-donation_management' (#87) from feature/79-donation_management into dev [`03be2d0`](https://git.odit.services/lfk/frontend/commit/03be2d04923970ecb5b05f5de645a446afe3a245)
|
||||
- Merge pull request 'i18n fix run no.1 feature/69-i18n_fixes' (#85) from feature/69-i18n_fixes into dev [`8b7f5a7`](https://git.odit.services/lfk/frontend/commit/8b7f5a765bcd91207957754747221f05ffdaff4b)
|
||||
- Merge pull request 'Fixed refresh page reload bug' (#86) from feature/82-auth_refresh_bug into dev [`9cd9400`](https://git.odit.services/lfk/frontend/commit/9cd94004fce1847d8adb028bef36b6fb49ff144d)
|
||||
- Sorted translations [`8b70882`](https://git.odit.services/lfk/frontend/commit/8b70882fecd2a0830176074dec504e417923fa50)
|
||||
- Implmented donor deletion confirmation [`264868b`](https://git.odit.services/lfk/frontend/commit/264868bb6afe2066417f9a98091230cadb54ee63)
|
||||
- Error message on pdf generation fail ❌ [`12bcbd2`](https://git.odit.services/lfk/frontend/commit/12bcbd28f3e5672dfb1d34d6eacfd2cc144dd4d1)
|
||||
- i18n translation spree 🌍 [`7fb7ba0`](https://git.odit.services/lfk/frontend/commit/7fb7ba0d2b78065d3d6f1c407b91a0bb9fb832cd)
|
||||
- Added missing translations 🌍 [`a99c022`](https://git.odit.services/lfk/frontend/commit/a99c0226084ceaea1da7a110edf2ab546b797c71)
|
||||
- Implemented donor creation modal [`1b6f866`](https://git.odit.services/lfk/frontend/commit/1b6f86669c01f556e720ab5ba42b57e67a5a963d)
|
||||
- Added donor detail [`cb704c4`](https://git.odit.services/lfk/frontend/commit/cb704c4551bdb46685859ec7901041900acf4c52)
|
||||
- Implemented donor overview and deletion [`02087a5`](https://git.odit.services/lfk/frontend/commit/02087a541e938bfb5286290e12c5557b6b173460)
|
||||
- Some i18n 🌍 [`ca8f978`](https://git.odit.services/lfk/frontend/commit/ca8f9786675952af47f663ac4593f33d35924a1a)
|
||||
- Updated sponsoring logo [`3a57e1c`](https://git.odit.services/lfk/frontend/commit/3a57e1c76624c8ee41757771714970d91db0dddc)
|
||||
- ✨ PDF download from TeamDetail + TeamsOverview [`dbc0ab7`](https://git.odit.services/lfk/frontend/commit/dbc0ab76af0934d3603509e218465378b99cdf63)
|
||||
- basic progress toasts [`a7642c2`](https://git.odit.services/lfk/frontend/commit/a7642c2da410caf662e788951149169af2668afd)
|
||||
- i18n run [`1939300`](https://git.odit.services/lfk/frontend/commit/19393006efd841220295ae588a5dbb67408261ee)
|
||||
- ✨ PDF generation from OrgDetail [`0a55d73`](https://git.odit.services/lfk/frontend/commit/0a55d7314636c1041b63c5a065a69d115890b4b9)
|
||||
- Now the toast hides the generation toast [`ed13a0d`](https://git.odit.services/lfk/frontend/commit/ed13a0d14b42de646e2b9e2c1566ac9c256cc1d3)
|
||||
- Now using translations in org/add/address [`b7d38dd`](https://git.odit.services/lfk/frontend/commit/b7d38dd8493833322f6f1e6634ea2f08a5666fd2)
|
||||
- Now the toast hides the generation toast [`8fa0be7`](https://git.odit.services/lfk/frontend/commit/8fa0be7633f41974e7e2c5e0927449717b88007a)
|
||||
- Added donors to sidebar [`0cc91ac`](https://git.odit.services/lfk/frontend/commit/0cc91ac0373ec1ff1229408a6a0beb43df07244e)
|
||||
- More missing translations 🌍 [`d0a48ab`](https://git.odit.services/lfk/frontend/commit/d0a48ab94b5c281692a7bd935a4eaf11d3b32eb5)
|
||||
- Added missing translations [`2b037d4`](https://git.odit.services/lfk/frontend/commit/2b037d41ac0b972190c9b2c853b42c41f4148c60)
|
||||
- ✨ progress toast in RunnersOverview [`4ece21c`](https://git.odit.services/lfk/frontend/commit/4ece21cdf240f203b710410b3ce9fb716ad12fef)
|
||||
- Fixed missing icon [`bca9605`](https://git.odit.services/lfk/frontend/commit/bca9605d4a0ba56468d91cc4165fe15171e90c9b)
|
||||
- Updated icons [`0321f0e`](https://git.odit.services/lfk/frontend/commit/0321f0e979af8336ab26563f662357e62812a4c7)
|
||||
- ✒ change "Edit" table actions to "Detail" [`289a8c1`](https://git.odit.services/lfk/frontend/commit/289a8c14d335a3cb3c4333725c14c497dc6944a9)
|
||||
- Fixed orgs/teams not being marked as selected on initial modal opening [`44ed633`](https://git.odit.services/lfk/frontend/commit/44ed633cbfee880b0bf7056388d04ede5f50fa47)
|
||||
- Mitigated null error [`396bd22`](https://git.odit.services/lfk/frontend/commit/396bd221996bd21acafddbf1ab87fbf9b378e306)
|
||||
- Fixed known translation mishaps [`02d2413`](https://git.odit.services/lfk/frontend/commit/02d24139e9974f4a8a8a62fd906efac9cabb2459)
|
||||
- Added total dontaion amount to donor detail [`5d945f5`](https://git.odit.services/lfk/frontend/commit/5d945f5bc5bc5c4426da71a18c88a82ce4083f30)
|
||||
- Fixed refresh page reload bug [`c569724`](https://git.odit.services/lfk/frontend/commit/c5697242ee7cef2cb9d2949a10d4efc533684401)
|
||||
- Merge pull request 'Donor management feature/78-donor_mgnt' (#80) from feature/78-donor_mgnt into dev [`ad638e8`](https://git.odit.services/lfk/frontend/commit/ad638e8bc8b3f2179526d6fbd6cdf18ee2524054)
|
||||
- 🖼 new donor empty image [`aec8bf5`](https://git.odit.services/lfk/frontend/commit/aec8bf56a2c03364a353e64a640bae3e8d4540a0)
|
||||
- Formatting [`3e9383e`](https://git.odit.services/lfk/frontend/commit/3e9383e6d9afab2ea06cd8feaff6d52f53e161b9)
|
||||
- Normalized svg [`18335e3`](https://git.odit.services/lfk/frontend/commit/18335e3325ab41caa54f1ff53bfd09bd0f590c2e)
|
||||
- Fixed deletion in detail bug [`f97c2a3`](https://git.odit.services/lfk/frontend/commit/f97c2a36f69d431293ed21d20ff2e8e0782bd53d)
|
||||
- Implemented currency formatting [`1c49755`](https://git.odit.services/lfk/frontend/commit/1c4975589f8ac1c5cd13b7935fb5663adde52615)
|
||||
- Updated donot empty logo [`fffe5c2`](https://git.odit.services/lfk/frontend/commit/fffe5c2c4b384e3626b140a6c807b505b3dd4ae2)
|
||||
- Converted total donation amount to € [`04a09c3`](https://git.odit.services/lfk/frontend/commit/04a09c3ce5e990a50e77ba235dce830983e0ff2d)
|
||||
- Fixed typo [`f63e177`](https://git.odit.services/lfk/frontend/commit/f63e17775c261c994f289f9d0797be3a2c3a6a3e)
|
||||
- Implemented receipt needed [`78514c6`](https://git.odit.services/lfk/frontend/commit/78514c6572793422bfaed0d9b9ee4516a30f7fe7)
|
||||
- Merge pull request 'Mitigated null error' (#77) from feature/64-dialog_clearing_bug into dev [`32024cf`](https://git.odit.services/lfk/frontend/commit/32024cf2c5ade31ec0edd8150ab10e801a70dc44)
|
||||
- 🐞 fixed translation keys [`d67dfdf`](https://git.odit.services/lfk/frontend/commit/d67dfdf2e7ca8f88113377690f794f440d07dd14)
|
||||
- Removed key duplicate from last merge [`5b3e66c`](https://git.odit.services/lfk/frontend/commit/5b3e66c4f6f30d5ea92ac7281cd2c3a17081c9fa)
|
||||
- ✨ translation keys [`a588bc4`](https://git.odit.services/lfk/frontend/commit/a588bc46319a387690a284a2dccca718f194b80b)
|
||||
- ✨ basic select boxes in table [`e8f7c1c`](https://git.odit.services/lfk/frontend/commit/e8f7c1c832037af251d2e3c41600b7c7109fdaa2)
|
||||
- First part of org detail address edit [`e5c31c9`](https://git.odit.services/lfk/frontend/commit/e5c31c9dd43c36d81205e100ded030309296fb5d)
|
||||
- Added address to org creation dialog (styleing only) [`6d2431b`](https://git.odit.services/lfk/frontend/commit/6d2431b683b36a2595a259e69339b8b9fd0c9bdc)
|
||||
- 🐞 fixed bug in OrgDetail address reactivity [`616990b`](https://git.odit.services/lfk/frontend/commit/616990b930cafe4eac57cf771b8b5d722b281218)
|
||||
- Removed unused locales [`722feac`](https://git.odit.services/lfk/frontend/commit/722feac8bd0a4be5214268c0bdb321243a4d602d)
|
||||
- ✨ OrgOverview - multiple pdf download [`40dda11`](https://git.odit.services/lfk/frontend/commit/40dda1150ca8ddc17b1bb64649becab3440bdfad)
|
||||
- Removed unused locales [`4be87a6`](https://git.odit.services/lfk/frontend/commit/4be87a64b9df5a722b3a03893eff64f140f2dc28)
|
||||
- Translated all missing translations 🌍 [`2e3750c`](https://git.odit.services/lfk/frontend/commit/2e3750c87c882c562822cee1615e74b6e84857d9)
|
||||
- ✨ PDF from RunnerDetail [`3b18be5`](https://git.odit.services/lfk/frontend/commit/3b18be58747f204908e0d1065abe66e78d156da6)
|
||||
- 🇩🇪 more german translations [`377d691`](https://git.odit.services/lfk/frontend/commit/377d691053966410da6dfdeb1bf2cb10009a0c0a)
|
||||
- 🐞 fixed bug in Tracks datatable translation keys [`30867b4`](https://git.odit.services/lfk/frontend/commit/30867b4ba1328a405aa3ea20c1043d066f774ee0)
|
||||
- 📃 pdf generation in RunnersOverview [`fa3dc87`](https://git.odit.services/lfk/frontend/commit/fa3dc870d3e114ddca472197d30e1f4178030568)
|
||||
- some more translation keys [`9b0252f`](https://git.odit.services/lfk/frontend/commit/9b0252fb754cceb2c2dd374c0e4f465d6ea67f92)
|
||||
- drop filepond keys [`e90fe73`](https://git.odit.services/lfk/frontend/commit/e90fe73aa25cdc077bed4446a088583126b5bd20)
|
||||
- Implemented detail address add fix [`ec8d946`](https://git.odit.services/lfk/frontend/commit/ec8d946a41c8196bce8556179fa93f0ec47a7507)
|
||||
- reactive button for checkboxes in table [`5e6ada1`](https://git.odit.services/lfk/frontend/commit/5e6ada140ce2722bc67f4c7c10fe95138d7d27f0)
|
||||
- Genered soem runner related keys [`3c541ad`](https://git.odit.services/lfk/frontend/commit/3c541ada89aa9acee805ab0d31f7a68078bc2a69)
|
||||
- Added address to org overview [`bcc7d77`](https://git.odit.services/lfk/frontend/commit/bcc7d7770ebcee95cbc6cfa69841ac15d12bc1a6)
|
||||
- Runner Contact information column npow features address [`57e17f2`](https://git.odit.services/lfk/frontend/commit/57e17f2864765c13ab6cce84ede92a3be8e524fc)
|
||||
- 🌎 i18n [`ff15308`](https://git.odit.services/lfk/frontend/commit/ff15308c037e6800c1bbd43d01617554e98bf2d1)
|
||||
- Fixed privacy/imprint fallback bug [`b195c70`](https://git.odit.services/lfk/frontend/commit/b195c707b05ffa415b50afdf4a532e03340e1ebf)
|
||||
- Formatting [`25ac84e`](https://git.odit.services/lfk/frontend/commit/25ac84e5fddd0927dc4283836a36e0f15615609f)
|
||||
- Fixed clear on import bug [`e53467d`](https://git.odit.services/lfk/frontend/commit/e53467da22dee965f753500c4807fd54b02ec4be)
|
||||
- Fixed clear on import bug [`09d27c0`](https://git.odit.services/lfk/frontend/commit/09d27c0b05634e7e8eefd79fa048c2cb53082abf)
|
||||
- Merge commit 'b337873ca214682487844973104772539956c09a' into feature/48-usergroup-management [`266a11f`](https://git.odit.services/lfk/frontend/commit/266a11f64f073b917ebc7a0c1496d0a48a657e8a)
|
||||
- Merge commit '6d0bca6d6783d3f7bbff5d413b158c6b60720bd8' into feature/48-usergroup-management [`e442b92`](https://git.odit.services/lfk/frontend/commit/e442b92a5f31d2222184aaea55de17d96ccfecbf)
|
||||
- new license file version [CI SKIP] [`afd73d5`](https://git.odit.services/lfk/frontend/commit/afd73d53bee7eb2fd3244caaeb1a9867bff68721)
|
||||
- Merge pull request 'Addresses for orgs and a bunch of bugfixes feature/72-adddress_for_everyone' (#73) from feature/72-adddress_for_everyone into dev [`652e55e`](https://git.odit.services/lfk/frontend/commit/652e55e80e9e7a6c14e7dbeb0ccf6259f11f9368)
|
||||
- Implemented org address creation modal logic [`86f1300`](https://git.odit.services/lfk/frontend/commit/86f13003b5400ba5ea14bcc6bb9b7e7a9301c212)
|
||||
- ✨ ForgotPassword demo for translation with interpolation [`505ca6a`](https://git.odit.services/lfk/frontend/commit/505ca6a58effae334f35ae99de798d85bd8fa1a2)
|
||||
- 🐞 fixed address removal bug ContactDetail [`1eea935`](https://git.odit.services/lfk/frontend/commit/1eea93520749ac4fb4054004fc7ae01a02a05f68)
|
||||
- Fixed wrong relation getting targeted [`4f3f7d1`](https://git.odit.services/lfk/frontend/commit/4f3f7d1edb3c4f06dcda75461f87fe3688cf20fb)
|
||||
- Replaced untranslated key with already existant key [`56b5008`](https://git.odit.services/lfk/frontend/commit/56b50082782b3d62f7fe5854d0d37da3a8dd7759)
|
||||
- Replaced untranslated key with already existant key [`555778f`](https://git.odit.services/lfk/frontend/commit/555778fca43fd4546968205fc41617a10d4c7727)
|
||||
- Unified key translation style [`ec1a622`](https://git.odit.services/lfk/frontend/commit/ec1a6226a9f3d512404a5af7119b0508b21e03d6)
|
||||
- Merge commit '9faa93e29239182871b82bca211531fb95d37b7f' into feature/69-translation-keys [`5f1c8f3`](https://git.odit.services/lfk/frontend/commit/5f1c8f3627b5603063821c1a32774d4a000606ac)
|
||||
- new license file version [CI SKIP] [`3834079`](https://git.odit.services/lfk/frontend/commit/3834079481d36a38fbb6d61a56c56320c075d59d)
|
||||
- Merge pull request 'component/ structure cleanup feature/68-component-cleanup' (#70) from feature/68-component-cleanup into dev [`9faa93e`](https://git.odit.services/lfk/frontend/commit/9faa93e29239182871b82bca211531fb95d37b7f)
|
||||
- ✨ basic Contact components [`054c7fa`](https://git.odit.services/lfk/frontend/commit/054c7faaacfca30ab15f6fcb4241949aef4c87eb)
|
||||
- Sorted locales [`e64b318`](https://git.odit.services/lfk/frontend/commit/e64b318a42741812900feaa7a825b384687bf7d2)
|
||||
- ✨ basic UserGroup components [`0361f8a`](https://git.odit.services/lfk/frontend/commit/0361f8ad6991e04bc621c3201bd14d6ace9adc76)
|
||||
- 🌎 Contacts i18n [`c1251d3`](https://git.odit.services/lfk/frontend/commit/c1251d333298326e25ef7573e14ed24124f621de)
|
||||
- Now w/ 100% german translation 🌍 [`6c2a5f9`](https://git.odit.services/lfk/frontend/commit/6c2a5f904d6d0ab709a503130efc9e20784b9fc3)
|
||||
- Added license to package [`dc0c738`](https://git.odit.services/lfk/frontend/commit/dc0c7384710985524e8caceebde06918b878ec6c)
|
||||
- ✨ UserGroupsEmptyState, UserGroupsOverview, basic GroupDetail [`eddfeb1`](https://git.odit.services/lfk/frontend/commit/eddfeb10a55cbf276f29e406ad262d46ac3d1786)
|
||||
- ✨ ContactDetail route [`6f4f4cc`](https://git.odit.services/lfk/frontend/commit/6f4f4ccb16d91c9ab11f65bc9c01faafa6004f5c)
|
||||
- AddContactModal - allow optional address [`7138ca1`](https://git.odit.services/lfk/frontend/commit/7138ca1f5f03a6f5dc54e9d91bc1d432e354b77c)
|
||||
- Initial component sort/cleanup [`c0534a3`](https://git.odit.services/lfk/frontend/commit/c0534a3b06a6f818c94adb70bca2a898ec70c2ab)
|
||||
- ContactDetail - added checkbox for optional address [`894160f`](https://git.odit.services/lfk/frontend/commit/894160f3f771fa8c3566566626cfe60858fc3ab1)
|
||||
- 🚧 WIP on ContactDetail [`4541304`](https://git.odit.services/lfk/frontend/commit/4541304fa8033cfc875a08faca85bab86691a1c5)
|
||||
- renamed folder and removed useless files [`e1427f3`](https://git.odit.services/lfk/frontend/commit/e1427f3ecbf1e6d6dbb0b3e8c7c9514cb68c2c08)
|
||||
- 🐞 fixed null addresses in ContactsOverview [`6a91bd5`](https://git.odit.services/lfk/frontend/commit/6a91bd53e2f26d72a407a266b660cbfae0902a20)
|
||||
- ✨ OrgDetail - edit contact [`1586c2f`](https://git.odit.services/lfk/frontend/commit/1586c2f9e625a5eaa116251e5ebd83fcebd3bee5)
|
||||
- ✨ ContactsEmptyState [`a7098df`](https://git.odit.services/lfk/frontend/commit/a7098df9cfe6ba4dffe2ed121b1e9ae69f40e89d)
|
||||
- ✨ TeamDetail - edit contact [`2033572`](https://git.odit.services/lfk/frontend/commit/2033572c83654bc51ece17ef60e29c425001fe1c)
|
||||
- Fixed org deletion dialog [`a4c955c`](https://git.odit.services/lfk/frontend/commit/a4c955ce8530238bcd1eb91db2cee7dae6a9fe8c)
|
||||
- 🧹 ContactOverview refinement [`0f01330`](https://git.odit.services/lfk/frontend/commit/0f013304ef34d848652351a69e5374f61166db10)
|
||||
- 🔗 link to ContactDetail from OrgOverview [`1a4cf21`](https://git.odit.services/lfk/frontend/commit/1a4cf211eb5d5278e8d7cf375ba534b1c24a1315)
|
||||
- German spell check [`83495b1`](https://git.odit.services/lfk/frontend/commit/83495b101c851590473c769121d7a10299bcbcce)
|
||||
- 🎉 working AddContactModal [`45e7f6a`](https://git.odit.services/lfk/frontend/commit/45e7f6a0d1315db8779111545f317ba746680a28)
|
||||
- Removed usless console logs [`7278648`](https://git.odit.services/lfk/frontend/commit/72786486421e2161144c04c354e46eb07e00c502)
|
||||
- 🎉 ContactDetail + ContactOverview [`4ef1b7a`](https://git.odit.services/lfk/frontend/commit/4ef1b7abe8458903ba91ea8aad7566205c8776c4)
|
||||
- Gendered some stuff [`ce678c1`](https://git.odit.services/lfk/frontend/commit/ce678c1b769db7ab59a003752329e7598f7d86d5)
|
||||
- Fixed contact update detection bug [`696d3ff`](https://git.odit.services/lfk/frontend/commit/696d3ffabf8a254480344aa5bfb1b5a4360da528)
|
||||
- 🔗 link to ContactDetail from TeamsOverview [`b01fe05`](https://git.odit.services/lfk/frontend/commit/b01fe050d2a5db5f736e25859c44f8106d1eb526)
|
||||
- Fixed store destrucuured import [`f086027`](https://git.odit.services/lfk/frontend/commit/f08602791040da3820b8d2317339dd0d3baa260c)
|
||||
- Fixed group posting issue [`e4ae1dd`](https://git.odit.services/lfk/frontend/commit/e4ae1dd475e5c3a826eecd6af934e9c30b9a722a)
|
||||
- Fixed modal multiselect [`46cd262`](https://git.odit.services/lfk/frontend/commit/46cd262fabc5d89a80283d9c8510c2a8d476a6c5)
|
||||
- new license file version [CI SKIP] [`eb46c5e`](https://git.odit.services/lfk/frontend/commit/eb46c5eea65e24e1470a79b3ba9d380b4ce31a6f)
|
||||
- Merge pull request 'i18n fixed + dependency bumps bugfix/99-i18n_run' (#102) from bugfix/99-i18n_run into dev [`100094e`](https://git.odit.services/lfk/frontend/commit/100094e803fdbb2bc79e2b58d9eb9a9f1b4346ae)
|
||||
- Added select workaround for all things team🏠 [`5ad42d6`](https://git.odit.services/lfk/frontend/commit/5ad42d6ca7a3823a265e54d9dc7835e4a3e2e89c)
|
||||
- Implemented svelt select bug workaround for scan detail🔥🔥🔥 [`cda4512`](https://git.odit.services/lfk/frontend/commit/cda45128223ccc47456e2548b048e371d80bb7c2)
|
||||
- Fix for bug discovered by @philipp [`d28a0e1`](https://git.odit.services/lfk/frontend/commit/d28a0e1dbb877b3e369b106a103a3bfc52dd1e6a)
|
||||
- Added german translations for the new keys [`635e2ba`](https://git.odit.services/lfk/frontend/commit/635e2ba0e07c04ef0e3b35438193521e2ed2368b)
|
||||
- Fix for bug discovered by @philipp [`94d52df`](https://git.odit.services/lfk/frontend/commit/94d52df322fca1790776300b2d4be6a3996cd57f)
|
||||
- Svelte select is now 100% keyboard useable (or at least in one modal it is....) [`eb6af4b`](https://git.odit.services/lfk/frontend/commit/eb6af4b4f0b561653fe57ec41c272cb1cb127ecc)
|
||||
- Added patime to track scan detail [`937265e`](https://git.odit.services/lfk/frontend/commit/937265e82890c26046ccf321a3a4d6b9258674a9)
|
||||
- sorted translations 🌍 [`e723cbf`](https://git.odit.services/lfk/frontend/commit/e723cbf3b301ecb0de6426345def3fe53618a29c)
|
||||
- Removed lodash as a dependency 🗑 [`f09224d`](https://git.odit.services/lfk/frontend/commit/f09224d5c02a2c2d2f1ac221314d2c22758143ba)
|
||||
- Added translation keys [`99c3050`](https://git.odit.services/lfk/frontend/commit/99c30504115b068b65a48c651091252371b180ae)
|
||||
- Found a hiddeen missing key👀👀 [`00d16ef`](https://git.odit.services/lfk/frontend/commit/00d16ef59f2af3a540708cd61c195ea0ead86995)
|
||||
- Bumped svelte-* dependencies (non-dev)🔝 [`b4e7f90`](https://git.odit.services/lfk/frontend/commit/b4e7f9046c29aa45661f175f7b8cdca5d6a1a9a0)
|
||||
- Bumped svelte-related dev dependencies🔥 [`5204ba5`](https://git.odit.services/lfk/frontend/commit/5204ba5e24ca6e8ab0c5ad0255c54eede15a3baf)
|
||||
- Bumped router [`1b9b9ed`](https://git.odit.services/lfk/frontend/commit/1b9b9ed3723b0c12ab3b65eb0d94ec8c2c16ef42)
|
||||
- new license file version [CI SKIP] [`7521ad8`](https://git.odit.services/lfk/frontend/commit/7521ad8bbbb094bbe9ba723d03b3e9eb7f6a3243)
|
||||
- Merge pull request 'Scan management feature/92-scan_mgnt' (#101) from feature/92-scan_mgnt into dev [`b994065`](https://git.odit.services/lfk/frontend/commit/b994065e1810c44f4f9373b71baf632cccb34967)
|
||||
- Merge pull request 'Svelte select dropdown fix bugfix/98-dropdowns' (#100) from bugfix/98-dropdowns into dev [`a7fb2b8`](https://git.odit.services/lfk/frontend/commit/a7fb2b8a1a1e36a420ecbfce0ae41f685d6e24f8)
|
||||
- Sorted translations [`95eb8b6`](https://git.odit.services/lfk/frontend/commit/95eb8b6ae4d427c3ed7c64ac2d43b27545a64e3d)
|
||||
- Basic scan detail [`107360c`](https://git.odit.services/lfk/frontend/commit/107360cd93f00beb73bf0e3a50ca45fbfed63dfc)
|
||||
- Fixed emptystate 🛠 [`e9d5527`](https://git.odit.services/lfk/frontend/commit/e9d5527482b2dd2c61b83642051c4f808906139b)
|
||||
- Implemented basic scan creation [`1ada5d9`](https://git.odit.services/lfk/frontend/commit/1ada5d9c2c4d78868ca87b5cb05c0b6d770c7e9c)
|
||||
- Bugfix for download button dropdown outsideclick [`6a925cb`](https://git.odit.services/lfk/frontend/commit/6a925cb27f06101a7292aae7e77223a0cd204dfa)
|
||||
- Added basic scan overview [`eb0910b`](https://git.odit.services/lfk/frontend/commit/eb0910be575f4d83ab4f81a75a76cdfac46db19b)
|
||||
- Advanced Scan detail [`284bdc6`](https://git.odit.services/lfk/frontend/commit/284bdc6e33508fe4e277ea5fd312bea84881c882)
|
||||
- Added contact selection via svelte select [`7edc342`](https://git.odit.services/lfk/frontend/commit/7edc3427e10166d2a5e1b911cc459b26b37f984b)
|
||||
- Runner detail now uses svelte select🔥🔥 [`cee1ab1`](https://git.odit.services/lfk/frontend/commit/cee1ab1347beb80f7e391f41117b25ecef212032)
|
||||
- Added formatted laptime [`5afa541`](https://git.odit.services/lfk/frontend/commit/5afa541b303d9a650b5fd5a46cd4dd7b839d6085)
|
||||
- Added scans to sidebar (including a new icon) [`2cf8e02`](https://git.odit.services/lfk/frontend/commit/2cf8e0291ada3a9f70a8172ec95ed98be86ad7d0)
|
||||
- Adjusted filter [`53aa3bc`](https://git.odit.services/lfk/frontend/commit/53aa3bc3ae111399b22a122ad8912d78a12b8d79)
|
||||
- Org detail now uses svelte select [`6b59067`](https://git.odit.services/lfk/frontend/commit/6b590671bcb95c8c223860137ffbf2c82d05a144)
|
||||
- Add runner now uses svelte-select [`0e682bf`](https://git.odit.services/lfk/frontend/commit/0e682bf6302aea388ecfe6c92ad571db04d1c496)
|
||||
- Added basic files for scans [`f67e089`](https://git.odit.services/lfk/frontend/commit/f67e089ff39aa885983c063b82b60ba0ea432b69)
|
||||
- Added new scan icon to add scan modal [`9e5a093`](https://git.odit.services/lfk/frontend/commit/9e5a093a3a472ad06c7f0f0faee3b3ad318c8c44)
|
||||
- Now using svelte-select [`2a644d7`](https://git.odit.services/lfk/frontend/commit/2a644d70704cd3ffc5f0d7dd7894b2389ab90b1f)
|
||||
- MAde detail editable through the more reacctive process [`8b95b30`](https://git.odit.services/lfk/frontend/commit/8b95b300e283b25a9e25acbd6ffd5c003e30e59c)
|
||||
- Add Team now uses the new select [`1da1578`](https://git.odit.services/lfk/frontend/commit/1da15783d56ff4a998f872ce6842e83707b274ff)
|
||||
- Formatting [`e1bd364`](https://git.odit.services/lfk/frontend/commit/e1bd364278e590b8081c10fae3f642b91936c69b)
|
||||
- Fixed broken change detection [`a45c5da`](https://git.odit.services/lfk/frontend/commit/a45c5da0a7b9ef8f3a60b2b50cb8d1bd68d6ede8)
|
||||
- Fixed bugs with stuff not being displayed🛠 [`ff1bc8a`](https://git.odit.services/lfk/frontend/commit/ff1bc8a44a0d020d57aaba5a3eb255a22d65bb3d)
|
||||
- Now routing scans "start" page [`915bbbb`](https://git.odit.services/lfk/frontend/commit/915bbbbde023c34feb4595629d59546970ba8c94)
|
||||
- Added translations 🌎 [`8acbfa8`](https://git.odit.services/lfk/frontend/commit/8acbfa89674130667da11bca00879a30163b3523)
|
||||
- Now checking selectables for not being null [`5a2172b`](https://git.odit.services/lfk/frontend/commit/5a2172bb9b878c77c4f09e65237ce1a179c95b8c)
|
||||
- formatting [`9d0c6b9`](https://git.odit.services/lfk/frontend/commit/9d0c6b9ef44846bf59a521b71b2c4d9e91189ed5)
|
||||
- Fixed initial select value [`d3a3de2`](https://git.odit.services/lfk/frontend/commit/d3a3de2eac40503a5c626e59f9b5036e482b7399)
|
||||
- Small bugfixes [`dfa38d3`](https://git.odit.services/lfk/frontend/commit/dfa38d34215921a10619de71c7a7cf390be3b722)
|
||||
- Added clear event [`ee0c149`](https://git.odit.services/lfk/frontend/commit/ee0c1496e67316a7473fdcccecad67cb1d10cdf9)
|
||||
- Now routing scan detail [`abf9aa4`](https://git.odit.services/lfk/frontend/commit/abf9aa475b62ead1bfa185c39f8934fba508f9d8)
|
||||
- Small bugfixes [`6e04b71`](https://git.odit.services/lfk/frontend/commit/6e04b71c1aaed142152f1ef045c69f02ee116a3f)
|
||||
- Reset array [`8252a35`](https://git.odit.services/lfk/frontend/commit/8252a35771bbde82cfcf4f049be8536193df9a17)
|
||||
- Removed useless console.logs [`fc668c6`](https://git.odit.services/lfk/frontend/commit/fc668c68806bc0b132d818d64ee2c833ce3ace06)
|
||||
- Bumped lfk lib version [`bb7f2a6`](https://git.odit.services/lfk/frontend/commit/bb7f2a611a199f59932f61be36464ed654d76a06)
|
||||
- Fixed visual bug (overflow) [`4e51b12`](https://git.odit.services/lfk/frontend/commit/4e51b128e6d13d222b196175ddc5fbc5c1f9597e)
|
||||
- Bumped svelte select version [`0277263`](https://git.odit.services/lfk/frontend/commit/0277263f9825e78812e0518d0a849535c0fe99a4)
|
||||
- Removed depreciated information [`99fb420`](https://git.odit.services/lfk/frontend/commit/99fb420d5804c6061d806f518d8d3e742b20eacb)
|
||||
- Merge pull request 'Make dropdowns (selects) searchable feature/91-searchable_dropdowns' (#97) from feature/91-searchable_dropdowns into dev [`b541c93`](https://git.odit.services/lfk/frontend/commit/b541c93797b1a0317fee8c934e9803a9f2f7677d)
|
||||
- Fixed typo✏ [`e6df764`](https://git.odit.services/lfk/frontend/commit/e6df76456204282c7724f62ada6a902c771ec451)
|
||||
- Reapplied change from dev [`b841cc8`](https://git.odit.services/lfk/frontend/commit/b841cc8b959546d04daa0bacc04265a95573cd12)
|
||||
- Removed console log 🤫 [`bc2a8ca`](https://git.odit.services/lfk/frontend/commit/bc2a8caf3e3f87de11a7402c433d95d1851b4e4c)
|
||||
- Applied Docker MTU fix 🛠 [`f24b2b9`](https://git.odit.services/lfk/frontend/commit/f24b2b9b4cdb5e00eacea35be3199a38352d8a55)
|
||||
- Small bugfix 🛠 [`1a115a8`](https://git.odit.services/lfk/frontend/commit/1a115a842350da0b0ece58a9b5176a90897db9b7)
|
||||
- Merge pull request 'Scan station management feature/93-scan_stations' (#95) from feature/93-scan_stations into dev [`d00446d`](https://git.odit.services/lfk/frontend/commit/d00446dc7b27d67589a7eb7f251b6b8d60dedd43)
|
||||
- Fixed case sensitivity [`c6db6c5`](https://git.odit.services/lfk/frontend/commit/c6db6c553588c7cfb33fd3105122b63ecf6c12fb)
|
||||
- Sorted translations [`74c042a`](https://git.odit.services/lfk/frontend/commit/74c042a86b7e98ee0dd7f28981836ca33d1d6576)
|
||||
- Sorted translations 👀 [`a5d1b76`](https://git.odit.services/lfk/frontend/commit/a5d1b7689161ac491ab6aa68aad3625e5207bdb6)
|
||||
- Added translations for runner searching [`8c4a54e`](https://git.odit.services/lfk/frontend/commit/8c4a54eb07c8c6cc9ee4ea1b5c620a12bdabc0e3)
|
||||
- Sorted translations [`476f919`](https://git.odit.services/lfk/frontend/commit/476f9191211c473244f2e05a1d840eabada8190a)
|
||||
- Added search languagke keys [`47f0cd0`](https://git.odit.services/lfk/frontend/commit/47f0cd0b589729ea0d60e12c3f3ead7a2538e9ff)
|
||||
- i18n run: Added keys 🌍 [`50aa891`](https://git.odit.services/lfk/frontend/commit/50aa8917090af743fa99e9da79327496640a0014)
|
||||
- Added new translation keys 🌍 [`1aa2b3b`](https://git.odit.services/lfk/frontend/commit/1aa2b3b065816f82c85b5320261a10b9c4d1879c)
|
||||
- Added german translations 🇩🇪 [`e6d80c8`](https://git.odit.services/lfk/frontend/commit/e6d80c8ccb1e15cbac421b883da07be370c89456)
|
||||
- Added german translations [`e93f4e9`](https://git.odit.services/lfk/frontend/commit/e93f4e99f9f768b7e2b81088c3d47c3363197ab2)
|
||||
- Basic scanstation creation [`9ee7685`](https://git.odit.services/lfk/frontend/commit/9ee768551f0d617257452f7a89992f25927de02a)
|
||||
- Added scanstation detail [`258b3ce`](https://git.odit.services/lfk/frontend/commit/258b3cea66148a1a2beb14dd7aba5c785ff30c83)
|
||||
- Added station token copy modal [`8856671`](https://git.odit.services/lfk/frontend/commit/88566719ec4eab243369f9f26151e9f6377ddfa6)
|
||||
- Added station deletion confirmation dialog [`9f754ef`](https://git.odit.services/lfk/frontend/commit/9f754ef0e98ab78548391796db96e69b15fcd20e)
|
||||
- New fancy selects for donation details [`76be8d5`](https://git.odit.services/lfk/frontend/commit/76be8d5a8766c55e59e34dab2bfa0d24734b7886)
|
||||
- Spelling+Formatting [`7ff1d50`](https://git.odit.services/lfk/frontend/commit/7ff1d5007935946423d49eb559cb9e15f7dbb023)
|
||||
- Finished scanstationmodal (without i18n) [`83e782c`](https://git.odit.services/lfk/frontend/commit/83e782c7c567d3747eb4e0a4313f6e7de6f2355f)
|
||||
- Now with custom label generation functions [`48b8dfe`](https://git.odit.services/lfk/frontend/commit/48b8dfe973c880f4bad5884cd49769f14ba0f78d)
|
||||
- Updated ci secrets and type [`65111e8`](https://git.odit.services/lfk/frontend/commit/65111e87c1dc5a397f47b94282a18c0eb9888794)
|
||||
- New select [`fe16c66`](https://git.odit.services/lfk/frontend/commit/fe16c66cf2d9ee2a950b0865b43fe7797b9540b2)
|
||||
- Added custom placeholders [`1c330d0`](https://git.odit.services/lfk/frontend/commit/1c330d0301d5f3167a49161974eb09ff2324ba16)
|
||||
- Added new select for runners [`dab5bee`](https://git.odit.services/lfk/frontend/commit/dab5bee3c0ed48f0e7562b2d829a25cb8b80f2c6)
|
||||
- Added scanstations to sidebar [`4b47e70`](https://git.odit.services/lfk/frontend/commit/4b47e70b13507034dc321a80e4e61fd387749571)
|
||||
- Added fancier active states [`95b1490`](https://git.odit.services/lfk/frontend/commit/95b1490f8493168a07e3db167ee8c9ac81730429)
|
||||
- Finished scanstations base view [`85fa9d9`](https://git.odit.services/lfk/frontend/commit/85fa9d942ea8e8d636509bf0db79b56f4c1a20b8)
|
||||
- Added missing clear [`1bc8404`](https://git.odit.services/lfk/frontend/commit/1bc840430f6c6e886d38c50a1c5b31ae2204a615)
|
||||
- Added icon 🖼 [`e8e3ddc`](https://git.odit.services/lfk/frontend/commit/e8e3ddceff08e9b3b024da8e6b534a86b35f6f39)
|
||||
- Added translation strings [`88ad64f`](https://git.odit.services/lfk/frontend/commit/88ad64f113878784dfc0808ffdc83c8aca85588f)
|
||||
- Added custom filter/search [`f97be4e`](https://git.odit.services/lfk/frontend/commit/f97be4e7291f45f9240a3491603b9c0982b37a68)
|
||||
- Merge pull request 'Well that was less work than expected ....' (#96) from feature/90-translations into dev [`64b6c4d`](https://git.odit.services/lfk/frontend/commit/64b6c4d5f7a6f56370336828f05a56520976135d)
|
||||
- And with working i18n 🌍 [`e07d1e4`](https://git.odit.services/lfk/frontend/commit/e07d1e42e2ed4e21d053aef85432c9dbb9f103f4)
|
||||
- Sorted translations [`6870e31`](https://git.odit.services/lfk/frontend/commit/6870e31a8143187d98e39f1964139a0f57328779)
|
||||
- Sorted translations [`e487213`](https://git.odit.services/lfk/frontend/commit/e4872131c84d5021a0b02a944550fbcd99fb5c1a)
|
||||
- Added translation keyz [`3693025`](https://git.odit.services/lfk/frontend/commit/36930259d2bd250af8453ac3ed9349503c5f109d)
|
||||
- Translated stuff 🌍 [`dcaca2e`](https://git.odit.services/lfk/frontend/commit/dcaca2ecbded329b3240a30e8b2d51fc392483eb)
|
||||
- Moved pdf generation to function instead of onclick for all components [`22e9f53`](https://git.odit.services/lfk/frontend/commit/22e9f53c42d27177bd101d3724ff7e640850f5f6)
|
||||
- New download buttons for everyone (that can generate sponsoring contracts) [`e24b84e`](https://git.odit.services/lfk/frontend/commit/e24b84e7095fc929d1c160646dfaa01a260f229b)
|
||||
- Now routing to gorup permissions [`af7e44c`](https://git.odit.services/lfk/frontend/commit/af7e44cf7cb168eb9d017951c5e9cf4e0ead4673)
|
||||
- Now routing scan statins overview [`ca9c390`](https://git.odit.services/lfk/frontend/commit/ca9c390bb265e5c1b1f8752e118c5f3c560ddc82)
|
||||
- Implemented rough outside click handler for the dropdown [`c2bd696`](https://git.odit.services/lfk/frontend/commit/c2bd696bfedcfdaf0b13eb165d800691d58ca010)
|
||||
- Working button onklicks [`3b7c25b`](https://git.odit.services/lfk/frontend/commit/3b7c25b106b5369e622fabb844302463a55971b5)
|
||||
- Added basic table for scanstations [`c53b579`](https://git.odit.services/lfk/frontend/commit/c53b579fca6f65b8d34ab63a8ec8321100e563bd)
|
||||
- Added permissions list to usergroup detail [`05099d0`](https://git.odit.services/lfk/frontend/commit/05099d066bb383b4883b4fae59da35e419935827)
|
||||
- Working suergroup permissions overview [`7c32486`](https://git.odit.services/lfk/frontend/commit/7c324869a463d07af8c8f43b1853544c4a0d3440)
|
||||
- Switched the icon style [`305b18e`](https://git.odit.services/lfk/frontend/commit/305b18ef57c885d7cd1295557f8651f546b7934a)
|
||||
- Basic sponsoring language dropdown for runners [`6079e1f`](https://git.odit.services/lfk/frontend/commit/6079e1fa90249cfc94ed210fb40bd6fcf7e9ec11)
|
||||
- Updated users icon [`8ebc88a`](https://git.odit.services/lfk/frontend/commit/8ebc88aebb5af1fc6361582745d57d37ea6905e1)
|
||||
- You can now delete a station from it's detail [`c4acf77`](https://git.odit.services/lfk/frontend/commit/c4acf774ec6ab59eb24da437548667a5d26d624b)
|
||||
- Updated users icon [`c111ec9`](https://git.odit.services/lfk/frontend/commit/c111ec9d9113adac7f19fc5f0b527e0755cafd0e)
|
||||
- More i18n 🌍 [`e85cdaf`](https://git.odit.services/lfk/frontend/commit/e85cdaf3240abc78f9bf6353e911f157a06f11ca)
|
||||
- Added group detail routing [`937486a`](https://git.odit.services/lfk/frontend/commit/937486a66bd0c8bacbb867c469e7a69c30be2a5e)
|
||||
- Changed row order [`773fbfc`](https://git.odit.services/lfk/frontend/commit/773fbfc579014dcf67c87b43ab0a0d9d11ea23d6)
|
||||
- Added missing translations 🌍 [`599d340`](https://git.odit.services/lfk/frontend/commit/599d340a72a9577a28fd652648558fee1ccd6bf1)
|
||||
- Added missing translations 🌍 [`89b7fb8`](https://git.odit.services/lfk/frontend/commit/89b7fb8072bdc463cd9ac2926fef7f92c9b7130c)
|
||||
- Now with dropdown aiutoclose [`c89caf7`](https://git.odit.services/lfk/frontend/commit/c89caf78558d379ad587b37375280d5319c51cd2)
|
||||
- Now routing scan station detail [`a3daa2d`](https://git.odit.services/lfk/frontend/commit/a3daa2d24f5ed76fbde5d073360b2ca0a98fa9ac)
|
||||
- You can now add scanstations [`e45f8fa`](https://git.odit.services/lfk/frontend/commit/e45f8fa9efabcb18f69577a368235ee568dc16cb)
|
||||
- Clicking on a dropdown option now closes it everywhere [`9fec315`](https://git.odit.services/lfk/frontend/commit/9fec31591007253ced7a9c8d29552980138a5971)
|
||||
- Removed locale overrides [`9a8a978`](https://git.odit.services/lfk/frontend/commit/9a8a978e4959b36c5d6beccdcec6c313e1529e65)
|
||||
- Udergroup permission reactivity fix [`bfc9315`](https://git.odit.services/lfk/frontend/commit/bfc93158f50bfa78a26340b609dffcc6b164f90c)
|
||||
- Added "tooltip" [`2de861d`](https://git.odit.services/lfk/frontend/commit/2de861d4c13da8327b2bd9ec34f17c71e83105fc)
|
||||
- Fixed nameing [`5e417f0`](https://git.odit.services/lfk/frontend/commit/5e417f0714c3aa0189d9a7148d81d48ca922802b)
|
||||
- Changed group icon [`16e1434`](https://git.odit.services/lfk/frontend/commit/16e1434f2a53270d237a9345d55748f9b3d0460b)
|
||||
- New image for emptystate [`e8de1f6`](https://git.odit.services/lfk/frontend/commit/e8de1f6d9c120636f51f7e916692690050060719)
|
||||
- Added german translation 🇩🇪 [`95fcd1d`](https://git.odit.services/lfk/frontend/commit/95fcd1dcc49247a620e030084674c23c871472b6)
|
||||
- Fixed routing [`891ea2d`](https://git.odit.services/lfk/frontend/commit/891ea2da12679049c018e87b8474af91978d9f56)
|
||||
- Well that was less work than expected .... [`8d8695b`](https://git.odit.services/lfk/frontend/commit/8d8695ba13b0183b5f1535bd48c162bb809b01f0)
|
||||
- Added cursor-pointer [`27a1f57`](https://git.odit.services/lfk/frontend/commit/27a1f57ed34577f0c6865161559081763d29c6dc)
|
||||
- Spelling [`bd22d3b`](https://git.odit.services/lfk/frontend/commit/bd22d3be3626429fb3d82c881dfe58c41fdcd00b)
|
||||
- Switched pipeline type to kubernetes [`ba9d458`](https://git.odit.services/lfk/frontend/commit/ba9d4587cb5ff203b5ad67681c333834ac3213a9)
|
||||
- Fixed emptystate svg [`870e772`](https://git.odit.services/lfk/frontend/commit/870e772da27d1ee2bf59b4d110cd3161bc52a865)
|
||||
- new license file version [CI SKIP] [`7d654f4`](https://git.odit.services/lfk/frontend/commit/7d654f4a208b42e43899d770137b6dc90a2a2aa4)
|
||||
- Merge pull request 'Spnonsoring contract language selector feature/84-sponsoringcontract_language_selector' (#89) from feature/84-sponsoringcontract_language_selector into dev [`b810bb0`](https://git.odit.services/lfk/frontend/commit/b810bb01dbbe3d506af3852fcda8e1365a570c70)
|
||||
- Merge pull request 'Usergroup management in the UI feature/48-usergroup-management' (#88) from feature/48-usergroup-management into dev [`434466b`](https://git.odit.services/lfk/frontend/commit/434466b306ec11ad46e5ee99bec22bdcd01872b6)
|
||||
- Fixed root breadcrumb linking [`e1ac35f`](https://git.odit.services/lfk/frontend/commit/e1ac35f848e810191b98b2dc2b9f6ec7e4975f6f)
|
||||
- Added missing translations 🌍 [`29f99f0`](https://git.odit.services/lfk/frontend/commit/29f99f0b2047686327fe8c6f6ae68427c6db724b)
|
||||
- Formatting [`b8725c9`](https://git.odit.services/lfk/frontend/commit/b8725c96cdf8057498503728d8c8a7934983d14c)
|
||||
- Fixed Back linking [`4397566`](https://git.odit.services/lfk/frontend/commit/4397566f1e9ce8f0f1e5a6ba7c3c500dddb64bd0)
|
||||
- Fix for user permission availdable [`7e80608`](https://git.odit.services/lfk/frontend/commit/7e80608066d158221a36cb251d2ba4dd2a27c785)
|
||||
- Dependency bump 👊 [`2b57d49`](https://git.odit.services/lfk/frontend/commit/2b57d49e4e703ca15dc151ab69614dd893e8a0a5)
|
||||
- Removed filepond [`ca41f4d`](https://git.odit.services/lfk/frontend/commit/ca41f4d4f26871b2768a1cc1d438cd99f21956b9)
|
||||
- Reimported simple.css [`e2fb9a6`](https://git.odit.services/lfk/frontend/commit/e2fb9a66adbc2ecb12b3705a24fd6469d0f3af38)
|
||||
- Fixed store not being found [`543b3bd`](https://git.odit.services/lfk/frontend/commit/543b3bd937bdb8e0ac1fabee3c996be5d7874348)
|
||||
- new license file version [CI SKIP] [`0c9785a`](https://git.odit.services/lfk/frontend/commit/0c9785af36807608970ff3c91549c7b694a9d5c4)
|
||||
- Fixed address update bug [`14e5d0e`](https://git.odit.services/lfk/frontend/commit/14e5d0e7405f010e0d55aa31b0f3fd5f050d4f57)
|
||||
- Removed debug output [`27609dc`](https://git.odit.services/lfk/frontend/commit/27609dc5e0bf9a78ef37f0b3b74cc2ca25bfddbf)
|
||||
- Merge pull request 'Translated everything feature/65-translations' (#66) from feature/65-translations into dev [`3f54180`](https://git.odit.services/lfk/frontend/commit/3f5418083ff1a3ce883563610c8e4c67244df64f)
|
||||
- Fixed import modal width [`d822e4a`](https://git.odit.services/lfk/frontend/commit/d822e4ab3f61a019c9bdea3e56acdea8711f1b8f)
|
||||
- User permission update reactivity fix [`5994b22`](https://git.odit.services/lfk/frontend/commit/5994b22464e38fcde6f1073da073782d00dfbdc8)
|
||||
|
||||
#### [0.6.0](https://git.odit.services/lfk/frontend/compare/0.5.0...0.6.0)
|
||||
|
||||
> 12 February 2021
|
||||
|
||||
- Merge pull request 'feature/52-runner-filters' (#63) from feature/52-runner-filters into dev [`#52`](https://git.odit.services/lfk/frontend/issues/52)
|
||||
- Merge pull request 'feature/43-password-reset' (#61) from feature/43-password-reset into dev [`#43`](https://git.odit.services/lfk/frontend/issues/43)
|
||||
- Merge pull request 'feature/51-teamoverview-badge-org' (#59) from feature/51-teamoverview-badge-org into dev [`#51`](https://git.odit.services/lfk/frontend/issues/51)
|
||||
- Merge pull request 'feature/47-sidebar-responsiveness' (#60) from feature/47-sidebar-responsiveness into dev [`#47`](https://git.odit.services/lfk/frontend/issues/47)
|
||||
- Merge pull request 'feature/15-runner-import' (#58) from feature/15-runner-import into dev [`#15`](https://git.odit.services/lfk/frontend/issues/15)
|
||||
- Merge pull request 'feature/56-footer-version-loading' (#57) from feature/56-footer-version-loading into dev [`#56`](https://git.odit.services/lfk/frontend/issues/56)
|
||||
- Merge pull request 'feature/46-imprint-privacy' (#55) from feature/46-imprint-privacy into dev [`#46`](https://git.odit.services/lfk/frontend/issues/46)
|
||||
- Merge pull request 'feature/44-require-mail-addresses' (#54) from feature/44-require-mail-addresses into dev [`#44`](https://git.odit.services/lfk/frontend/issues/44)
|
||||
- Merge pull request 'feature/45-component-drop' (#53) from feature/45-component-drop into dev [`#45`](https://git.odit.services/lfk/frontend/issues/45)
|
||||
- 🧹 drop old + unused components Dash + LoginAlt [`eeee272`](https://git.odit.services/lfk/frontend/commit/eeee272f0353cd543dca0efbdf23f5972a771f6c)
|
||||
- ✨ added basic UI for ResetPassword [`b18a99e`](https://git.odit.services/lfk/frontend/commit/b18a99e4df6111e137a8081c3e6619da6f5af30c)
|
||||
- 🧹 remove placeholder options from Dashboard sidebar [`16ac96c`](https://git.odit.services/lfk/frontend/commit/16ac96c64e86a6f97e179d70b586f20869ffe663)
|
||||
- 👀 ResetPassword - success and error states [`8b2f196`](https://git.odit.services/lfk/frontend/commit/8b2f1965e2a754da6e40a3051e8ae3e771d70336)
|
||||
- added Privacy page [`5741cbe`](https://git.odit.services/lfk/frontend/commit/5741cbe7562542ba2b81a9a6d6be7fb0f5145801)
|
||||
- ImportRunnerModal - differenciate between team and org import [`acf0562`](https://git.odit.services/lfk/frontend/commit/acf0562851a77b9122473ffb1753a94b4272e53b)
|
||||
- 🚀RELEASE v0.6.0 [`087c85e`](https://git.odit.services/lfk/frontend/commit/087c85e58674e317cbe11bd135d3f051defa7911)
|
||||
- ✨ RunnersOverview - basic working filter [`575b4ce`](https://git.odit.services/lfk/frontend/commit/575b4ce9708625fbec23c49101f44825c6a75bce)
|
||||
- basic select filtering in RunnersOverview [`e415258`](https://git.odit.services/lfk/frontend/commit/e415258787c776d4a5291632f47c2fcceba9a040)
|
||||
- WIP on filter [`e23821a`](https://git.odit.services/lfk/frontend/commit/e23821a7cbe73fda420e4bcaaa2dbf5a89b56cc9)
|
||||
- ✨ layout for Import from RunnerOverview [`c698508`](https://git.odit.services/lfk/frontend/commit/c6985087a8b51d6e1d8fb71b1eb8a659b8ed34e6)
|
||||
- ✨ working Imprint page [`6401aeb`](https://git.odit.services/lfk/frontend/commit/6401aeb3a850b1dd9ec4eca5c181ebcf3ed8b7e9)
|
||||
- 🌍 i18n for ResetPassword [`428a8a1`](https://git.odit.services/lfk/frontend/commit/428a8a10ffa96ae2f04c718d678439d36e6cb857)
|
||||
- ⏫ dependency bump [`6614242`](https://git.odit.services/lfk/frontend/commit/6614242df6a9679f60bc3996c0317d0870a81ac4)
|
||||
- added Imprint route /imprint [`bbec9ff`](https://git.odit.services/lfk/frontend/commit/bbec9ffcdf0be2cf37501a355c5678ed9cd46a1d)
|
||||
- ⏫ general dependency bump [`369b099`](https://git.odit.services/lfk/frontend/commit/369b09972c786e5381d7bae667def6a15e21a45b)
|
||||
- AddUserModal - enforce email input [`7131ba9`](https://git.odit.services/lfk/frontend/commit/7131ba99b6917dc0fb99f93ab40495b9702024ab)
|
||||
- Org badge in TeamsOverview [`3490abe`](https://git.odit.services/lfk/frontend/commit/3490abe9a70ca3bd1725ae005c4031f25996f2a7)
|
||||
- RunnersOverview - support should_display_based_on_id search [`5dc11c2`](https://git.odit.services/lfk/frontend/commit/5dc11c285d4e2155a3945bc44cbfcf61fe02c5f3)
|
||||
- RunnersOverview badge to team/org [`a02be78`](https://git.odit.services/lfk/frontend/commit/a02be78df52f944d5842f8d0e9bbf62ba95e9ef0)
|
||||
- working import binding [`7dd0881`](https://git.odit.services/lfk/frontend/commit/7dd0881d293a7c46133cccd947e668178058ddd8)
|
||||
- Footer linking [`945963d`](https://git.odit.services/lfk/frontend/commit/945963db326e937456103f0092bbc684b0d0ec45)
|
||||
- UserDetail - invalid email UI feedback [`7897820`](https://git.odit.services/lfk/frontend/commit/7897820632c7b9e1e00fbf3f86a1eb7e01794fa5)
|
||||
- reactivity in import table [`b501342`](https://git.odit.services/lfk/frontend/commit/b5013426e6d4b92f56a8b7a42f4f13411c2cf61c)
|
||||
- 😬 use actual team id for RunnersOverview badge [`1fac0c8`](https://git.odit.services/lfk/frontend/commit/1fac0c8640460278bf6e2460e685e192e8a984f3)
|
||||
- 🐞 re-add sidebar component [`f8014c6`](https://git.odit.services/lfk/frontend/commit/f8014c62132eaafaa5edb486f3839b9502f3287f)
|
||||
- ⚡ load version on DOMContentLoaded [`901c7c1`](https://git.odit.services/lfk/frontend/commit/901c7c12418f09a29235afe8df5982f964fc61db)
|
||||
- UserDetail - enforce email input [`0dd9de2`](https://git.odit.services/lfk/frontend/commit/0dd9de2abc68ce10c4c763382945b92c0cd4e404)
|
||||
- use onMount event instead of DOMready [`c2d7a31`](https://git.odit.services/lfk/frontend/commit/c2d7a319a0761a77597fe365083b12c4c045a7ba)
|
||||
- new license file version [CI SKIP] [`43df188`](https://git.odit.services/lfk/frontend/commit/43df188df149401c966b8d7bb6e28fbbe39a83f1)
|
||||
- new license file version [CI SKIP] [`b25dc62`](https://git.odit.services/lfk/frontend/commit/b25dc623cf12aba88576cd8784a20b0fefc5466e)
|
||||
- ⏮decode base64 reset key [`92fee08`](https://git.odit.services/lfk/frontend/commit/92fee08dc40cf04fa1dc6d6e4aaf19f0b752031f)
|
||||
- 🧹 formatting [`7b7e484`](https://git.odit.services/lfk/frontend/commit/7b7e4840918b21951fa9e267044d623e9de7b0f5)
|
||||
- Merge commit '65f49489ad2e0cff30560e4c326ca7294d7f6190' into feature/51-teamoverview-badge-org [`f0be73c`](https://git.odit.services/lfk/frontend/commit/f0be73c2cd6c930273515a8773a2affd4068c92c)
|
||||
- 👀 only display navbar on sm devices / hide on md and up [`42bd632`](https://git.odit.services/lfk/frontend/commit/42bd63253916ab339a62f64762802750dc315b4c)
|
||||
- new license file version [CI SKIP] [`65f4948`](https://git.odit.services/lfk/frontend/commit/65f49489ad2e0cff30560e4c326ca7294d7f6190)
|
||||
- new license file version [CI SKIP] [`e4e2bda`](https://git.odit.services/lfk/frontend/commit/e4e2bdac724f40584bf1526fa59b0f380ba8cba0)
|
||||
- ⏫ client library bump [`80c3a90`](https://git.odit.services/lfk/frontend/commit/80c3a90d6fd14f1946b1e4ecd5e19314ca952c2d)
|
||||
- new license file version [CI SKIP] [`0e04298`](https://git.odit.services/lfk/frontend/commit/0e04298b7c53e2dfd447f51b75c7c32f0b730eea)
|
||||
- text selection color [`4e82369`](https://git.odit.services/lfk/frontend/commit/4e82369b160da3eaa5a32cf104aacc6250e7e31e)
|
||||
- added basic styling to Imprint component [`6a0c129`](https://git.odit.services/lfk/frontend/commit/6a0c129d39f5e659411c2358f30d425720229f16)
|
||||
- 🧹 remove ComponentDump from MainDashContent [`1bb79b1`](https://git.odit.services/lfk/frontend/commit/1bb79b1c98d166523b638a06ea9a354434ec1e08)
|
||||
|
||||
#### [0.5.0](https://git.odit.services/lfk/frontend/compare/0.4.0...0.5.0)
|
||||
|
||||
> 26 January 2021
|
||||
|
||||
- Merge pull request 'feature/12-user-management' (#39) from feature/12-user-management into dev [`#12`](https://git.odit.services/lfk/frontend/issues/12)
|
||||
- Merge pull request 'feature/13-runner-management' (#42) from feature/13-runner-management into dev [`#13`](https://git.odit.services/lfk/frontend/issues/13)
|
||||
- Merge pull request 'added permissions to dashboard sidebar' (#41) from feature/40-dynamic-sidebar-options into dev [`#41`](https://git.odit.services/lfk/frontend/issues/41)
|
||||
- basic UserPermissions view [`9c6dc5b`](https://git.odit.services/lfk/frontend/commit/9c6dc5b4247e76be63a92294556be1e4a9154256)
|
||||
- ✨ basic RunnerDetail [`03aa670`](https://git.odit.services/lfk/frontend/commit/03aa67034d5fc4ec64d5646a6583666301bb538e)
|
||||
- 👀 ImportRunnerModal - layout cleanup [`2cc9b3e`](https://git.odit.services/lfk/frontend/commit/2cc9b3e1ede47bb1a4b598afc260d0bc06ed0902)
|
||||
- ✨ basic ImportRunnerModal with CSV input [`b1e9f95`](https://git.odit.services/lfk/frontend/commit/b1e9f955b054cd17cb83f8364b6bc2b22159142f)
|
||||
- ✨ basic xlsx + csv parsing [`74d9b94`](https://git.odit.services/lfk/frontend/commit/74d9b94119b49a77ff3e787a84f76c1e2e13d9e4)
|
||||
- 🧹 darkmode classes cleanup [`259a76f`](https://git.odit.services/lfk/frontend/commit/259a76f46b9ac01b177100dfce0db367b517b3a0)
|
||||
- UserDetail - basic permission badges [`7d4e939`](https://git.odit.services/lfk/frontend/commit/7d4e93912c4e1fd8a875f42a0f11b906f1ca0091)
|
||||
- added permissions to dashboard sidebar [`acb86ae`](https://git.odit.services/lfk/frontend/commit/acb86ae2666ec3c336973184ec5cb1e2ffba9ebe)
|
||||
- UserPermissions - working edit [`10d7955`](https://git.odit.services/lfk/frontend/commit/10d7955f99b1a640eb1ac83764c114a25cfcc07b)
|
||||
- 🐞 ImportRunnerModal - table overflow fix [`dc1644e`](https://git.odit.services/lfk/frontend/commit/dc1644ed25b82afe6a51fbe0e1de69ddf54ef81d)
|
||||
- 🧹 general runner cleanup [`9240e0c`](https://git.odit.services/lfk/frontend/commit/9240e0c90380fc6b44a3dde480bd2d29476b2a0f)
|
||||
- 🚀RELEASE v0.5.0 [`2563e9d`](https://git.odit.services/lfk/frontend/commit/2563e9d1d6fe55544b04de8edd8c24cc1d3c9735)
|
||||
- ✨ formatting [`6e5a4bc`](https://git.odit.services/lfk/frontend/commit/6e5a4bcb39259fc376262c16ad95555fd9cf7a0b)
|
||||
- ✨ ImportRunnerModal usage in TeamDetail [`de0bd5f`](https://git.odit.services/lfk/frontend/commit/de0bd5fd57edba75faaa2ba097a2c7fb2f621f9a)
|
||||
- 💣 process breaking changes for lib v0.3.0 [`dadb806`](https://git.odit.services/lfk/frontend/commit/dadb80608a55980f7b647d41c91061055287a250)
|
||||
- 👀 basic ui interaction for ImportRunnerModal [`c382f77`](https://git.odit.services/lfk/frontend/commit/c382f770dc05f57a471389d3d4d012fd8439c014)
|
||||
- 🐞 [bugfix] RunnerDetail update [`ec4bcd0`](https://git.odit.services/lfk/frontend/commit/ec4bcd093b6c94f2e3597de6de98db5ca47c5876)
|
||||
- 🏃♂️ support for runner group edit [`8d92a75`](https://git.odit.services/lfk/frontend/commit/8d92a75ef03854397a7c01ed9ea22967b994f9f2)
|
||||
- AddRunnerModal - improved team select [`1694c71`](https://git.odit.services/lfk/frontend/commit/1694c71528f9114622daae1bd16aaed9f94fc4ee)
|
||||
- 🙋♂️🔒 UserDetail - permission layout ui [`65b36f8`](https://git.odit.services/lfk/frontend/commit/65b36f8e695479809566213ebcb64d51a7c6a52e)
|
||||
- 🌎 added locale based csv/xlsx header parsing [`b606037`](https://git.odit.services/lfk/frontend/commit/b606037890856c1115315bb61d8469ff66dc4289)
|
||||
- AddUserModal - username/email validation [`ff14f02`](https://git.odit.services/lfk/frontend/commit/ff14f024afda77e6f5f9e95a8f34e50cc8509790)
|
||||
- UserDetail - link to permission page [`aaab95d`](https://git.odit.services/lfk/frontend/commit/aaab95d41400629683d89ee16013b6b4328c582c)
|
||||
- UserDetail - add permission layout [`d65b463`](https://git.odit.services/lfk/frontend/commit/d65b463547a5cb4fb6f6de0f95795a66ebe92e31)
|
||||
- RunnerDetail - button text fixes [`5552055`](https://git.odit.services/lfk/frontend/commit/5552055b989313e8999e424b6ad26c4398e8c6fa)
|
||||
- 🧹 RunnerDetail cleanup + i18n 🌎 [`a871651`](https://git.odit.services/lfk/frontend/commit/a87165148a3ccdb4c4e10f2c6545d5fea9e78b30)
|
||||
- ↙ added default fallback parsing to ImportRunnerModal [`ecad1ea`](https://git.odit.services/lfk/frontend/commit/ecad1ea839dbcea396217cb18fe335694406cdb1)
|
||||
- 🌎 i18n [`366804a`](https://git.odit.services/lfk/frontend/commit/366804aa29eb0231e40017d1e5c3419486070174)
|
||||
- ✨ ImportRunnerModal - compatibility for multi-component access [`f8a5913`](https://git.odit.services/lfk/frontend/commit/f8a59133a2534efdc9e13104eb64157a9724e746)
|
||||
- ✨ use ImportRunnerModal in OrgDetail + Orgs [`8aa1d94`](https://git.odit.services/lfk/frontend/commit/8aa1d94a1aa976cc6cb4f7d3cc798822861676ad)
|
||||
- ✨ ImportRunnerModal - hide team when loading from TeamDetail [`819b02a`](https://git.odit.services/lfk/frontend/commit/819b02a204cd43baaaf85d82cf0209a38028e6ce)
|
||||
- 🚀 ImportRunnerModal - working demo [`6b91b22`](https://git.odit.services/lfk/frontend/commit/6b91b227136580180d5300b2614a6148995c4640)
|
||||
- 🌎 i18n [`ae8bc01`](https://git.odit.services/lfk/frontend/commit/ae8bc01d9bab994aad6407102f3a6ef0167d008b)
|
||||
- 🐞 fixed merge conflict errors [`cbc1d53`](https://git.odit.services/lfk/frontend/commit/cbc1d53cc257cbf60172dd4356831e43671ec626)
|
||||
- ✨ basic cancel event dispatch from ImportRunnerModal [`cde4ec1`](https://git.odit.services/lfk/frontend/commit/cde4ec13efef8423464ebe90a4f0212a3be6cf77)
|
||||
- 🧹 AddUserModal cleanup [`44f07ca`](https://git.odit.services/lfk/frontend/commit/44f07ca231307ebdbe38b822408c3965077053ef)
|
||||
- 🙋♂️ UserDetail - active/inactive user state edit [`86c54e0`](https://git.odit.services/lfk/frontend/commit/86c54e04a84917383d3726b324c416ca1bd74627)
|
||||
- UserDetail - update permission badges on change save [`358865d`](https://git.odit.services/lfk/frontend/commit/358865dc6a8e5a084078696048df99a67564a9e1)
|
||||
- i18n 🌍 [`415f340`](https://git.odit.services/lfk/frontend/commit/415f340a68078e86fcf28d24b069ca030e28fc82)
|
||||
- 👀 UsersOverview - disable advanced search [`b34e3ae`](https://git.odit.services/lfk/frontend/commit/b34e3aeed0f026308288fb568542cc0ba587b576)
|
||||
- 🙋♂️ UserDetail - disable profile picture edit [`ef9fc59`](https://git.odit.services/lfk/frontend/commit/ef9fc596f57d63c1bf9c26614d746bf37394f832)
|
||||
- 🌎 i18n [`2d48691`](https://git.odit.services/lfk/frontend/commit/2d4869128d2af5e7fa5e4bcf1d6b687fca6761e9)
|
||||
- 🌎 i18n in ImportRunnerModal headers [`e34c91b`](https://git.odit.services/lfk/frontend/commit/e34c91b2cc64221cd553e80974a14448e3afc340)
|
||||
- 🌎 last i18n keys [`6c2d13b`](https://git.odit.services/lfk/frontend/commit/6c2d13bd1721918f1ef847563cfad61284c40487)
|
||||
- Fixed User group update [`1a799dc`](https://git.odit.services/lfk/frontend/commit/1a799dc30a4f051305e5279bb3325e64ab08f323)
|
||||
- 🌎 UserDetail - more i18n keys [`e750c37`](https://git.odit.services/lfk/frontend/commit/e750c374739104c6aaac1abace9e9632b40342da)
|
||||
- ⏫ general dependency bump [`b30b673`](https://git.odit.services/lfk/frontend/commit/b30b6734a1f4cc384f06147dfc657f2a1a05b3c0)
|
||||
- 💻 updated VSCode recommended extensions [`fc21427`](https://git.odit.services/lfk/frontend/commit/fc214276859189c6e9b6fdc91eb440cf4afda7c0)
|
||||
- 🐞 improved version builder from template [`09fd73b`](https://git.odit.services/lfk/frontend/commit/09fd73b13086025a31b4c1363331230e1c91e593)
|
||||
- ⏫ general dependency bump [`9a1f7a1`](https://git.odit.services/lfk/frontend/commit/9a1f7a13f8669b690fb3f9533df7fdfa2f1bc093)
|
||||
- 🌎 added more i18n keys [`169ffc1`](https://git.odit.services/lfk/frontend/commit/169ffc1b0b76c74350060c97218643789e0ea4f7)
|
||||
- 😦 added missing dependencies [`822759a`](https://git.odit.services/lfk/frontend/commit/822759a6884eab81f62d96bd7e6f038fa8bc1926)
|
||||
- fixed runner permissions [`e0356fa`](https://git.odit.services/lfk/frontend/commit/e0356fa360b74f91b38dc09351930c8c0778f845)
|
||||
- Added friles to ignore [`9fbc1ba`](https://git.odit.services/lfk/frontend/commit/9fbc1ba0315fc0a2b7f3d95339cb17fc74e57903)
|
||||
- ✨ new UsersEmptyState [`959b32d`](https://git.odit.services/lfk/frontend/commit/959b32de1c6fc74bec585630b3025babc1a8edc4)
|
||||
- 🐞 fix package release for index template compatibility [`24bec66`](https://git.odit.services/lfk/frontend/commit/24bec66390bfddd57c0cd1d35de94a79bdbf477c)
|
||||
- new license file version [CI SKIP] [`3d30734`](https://git.odit.services/lfk/frontend/commit/3d30734dc2716a88d823fe7a7650f17d14a8f18d)
|
||||
- new license file version [CI SKIP] [`3281239`](https://git.odit.services/lfk/frontend/commit/3281239ff5b4968fb1dc8547e7c16f0789ec2b8c)
|
||||
- 🐞 alphabetically sort permission targets in UserDetail [`ffd88ff`](https://git.odit.services/lfk/frontend/commit/ffd88ffc666d9d3add43dfa4ec4b6e01ca7084b5)
|
||||
- new license file version [CI SKIP] [`e91e197`](https://git.odit.services/lfk/frontend/commit/e91e197873e524b93b2cf79286c66c8b776fbae2)
|
||||
- Deleted files to ignore [`6704c07`](https://git.odit.services/lfk/frontend/commit/6704c07db0a00b17327a4b693b3f74ed41a1a41d)
|
||||
- new license file version [CI SKIP] [`c6504c2`](https://git.odit.services/lfk/frontend/commit/c6504c2eaf1d0c5fb14a4035ccbf347d851068d9)
|
||||
|
||||
#### [0.4.0](https://git.odit.services/lfk/frontend/compare/0.3.1...0.4.0)
|
||||
|
||||
> 17 January 2021
|
||||
|
||||
- Merge commit 'a284806d3cb769030a4e28d0403190b746f8fc61' into dev [`#37`](https://git.odit.services/lfk/frontend/issues/37)
|
||||
- ✨ AddRunnerModal [`66ffd8e`](https://git.odit.services/lfk/frontend/commit/66ffd8e936010960766e7f9021319d549e1d3e6b)
|
||||
- ✨ RunnersOverview [`66a07c6`](https://git.odit.services/lfk/frontend/commit/66a07c6a51674a92d5e8459f250de2ab5ff6d902)
|
||||
- ⚡ improved dev scripts for speed starts [`383f828`](https://git.odit.services/lfk/frontend/commit/383f82807f4090bdd2c3dcdc695b75093b854031)
|
||||
- 🚀RELEASE v0.4.0 [`7d104a1`](https://git.odit.services/lfk/frontend/commit/7d104a151422a7c8306ef4d9f0ab25d26f8eb78b)
|
||||
- ✨ dynamic contact info in AddRunnerModal [`d4579a9`](https://git.odit.services/lfk/frontend/commit/d4579a9a410a27676e0ed0285bd124696153aae4)
|
||||
- 🐞 fix cross-env logic for faster dev starts ⚡ [`2ce4199`](https://git.odit.services/lfk/frontend/commit/2ce41990bf9911db11eb556ce4c9aa3b3e5ca16c)
|
||||
- 👩💻 developer configs/ recommendations for VSCode [`5e02502`](https://git.odit.services/lfk/frontend/commit/5e02502a5c2b8ebf798cbc21856b4425f8510041)
|
||||
- ⚡ re-enable PWA functionality via serviceworker [`a284806`](https://git.odit.services/lfk/frontend/commit/a284806d3cb769030a4e28d0403190b746f8fc61)
|
||||
- 🔨 cleaned up build process + Dockerfile [`7e10c1d`](https://git.odit.services/lfk/frontend/commit/7e10c1db659c21cd737b5d1e10bf3e61c4e0de94)
|
||||
- 🔨 cleaned up build process + Dockerfile [`1179063`](https://git.odit.services/lfk/frontend/commit/11790638d68e8c43f91448bd0c35f910a3d9e446)
|
||||
- ⚡ improved serviceworker + PWA logic [`0583cbe`](https://git.odit.services/lfk/frontend/commit/0583cbe2664f8832c5eaa7fb155b3e6deccb2ed3)
|
||||
- apply new gitignore config [`2e6874c`](https://git.odit.services/lfk/frontend/commit/2e6874c822f2f8e9a8a7b74b4765631ba08f0255)
|
||||
- ⚡ PWA optimizations [`dccf7c6`](https://git.odit.services/lfk/frontend/commit/dccf7c6c8de0da0f25ad77e20822fb4fbf68a61a)
|
||||
- ⏫ general dependency bumps [`03125b3`](https://git.odit.services/lfk/frontend/commit/03125b3a2d0ad4b12cffdec98f27da14f3f45f77)
|
||||
- 🐞 gitignore fix [`e49dca0`](https://git.odit.services/lfk/frontend/commit/e49dca02754aa57cbe464066f11505db4a9b5ca9)
|
||||
- gitignore fix [`a523379`](https://git.odit.services/lfk/frontend/commit/a523379b3a5f7f3cffecca82c0c066167da046ca)
|
||||
- fix package:dev script [`aa6348a`](https://git.odit.services/lfk/frontend/commit/aa6348a29a6e9ecb9789681b7195527c4eef19e4)
|
||||
- new license file version [CI SKIP] [`382cc3d`](https://git.odit.services/lfk/frontend/commit/382cc3d844bf0af7c46492907f8a9a78fadc25d0)
|
||||
- 🧹 gitignore changes in public/index.html & svelte.config.js [`dd74d9e`](https://git.odit.services/lfk/frontend/commit/dd74d9ee89b80c46ce3d3347a3c7cbe34373019c)
|
||||
|
||||
#### [0.3.1](https://git.odit.services/lfk/frontend/compare/0.3.0...0.3.1)
|
||||
|
||||
> 16 January 2021
|
||||
|
||||
- Merge pull request 'feature/16-org-management' (#35) from feature/16-org-management into dev [`#16`](https://git.odit.services/lfk/frontend/issues/16)
|
||||
- 🏃♂️🏃♂️🏃♂️ basic UI components for team management [`d87b879`](https://git.odit.services/lfk/frontend/commit/d87b879cc3d6c771a8a9932409e39068e1b2acdb)
|
||||
- ✨ TeamDetail with edit,delete [`ccf09f9`](https://git.odit.services/lfk/frontend/commit/ccf09f97d5fb476113f24a9559a48bccd75fd0a5)
|
||||
@@ -11,14 +759,15 @@ All notable changes to this project will be documented in this file. Dates are d
|
||||
- 🔒 ConfirmOrgDeletion in OrgDetail [`d890112`](https://git.odit.services/lfk/frontend/commit/d8901126d0cc91cabe3b94a30a83f36e6288126d)
|
||||
- ✨ basic TeamsOverview [`597e9e1`](https://git.odit.services/lfk/frontend/commit/597e9e1ea9da7c73bdcb8ef1ae1a13dfa68ff5a3)
|
||||
- ✨ UX - ConfirmOrgDeletion cancel event reflection in datatable [`84a9cf0`](https://git.odit.services/lfk/frontend/commit/84a9cf069a4aa0940eaacc87ea67e745deabe939)
|
||||
- 🧹 Dashboard - drop header bar [`f1833f1`](https://git.odit.services/lfk/frontend/commit/f1833f13d57595c23abf29bce1a2795cbb05a116)
|
||||
- 🤝 attribution/ credits for icons and illustrations [`eb0dd3f`](https://git.odit.services/lfk/frontend/commit/eb0dd3f781f739c6511588a8e153c14a39096025)
|
||||
- ✨ added new empty states [`66e6cd8`](https://git.odit.services/lfk/frontend/commit/66e6cd80d39ef18a29fd8ac80fbac929bd0c4f8c)
|
||||
- Merge pull request 'feature/14-team-management' (#36) from feature/14-team-management into dev [`4285168`](https://git.odit.services/lfk/frontend/commit/42851686caae69e6672f48cd7df77ee4c2e49092)
|
||||
- 🐞 fix Dashboard sidebar responsiveness [`6a81e36`](https://git.odit.services/lfk/frontend/commit/6a81e369fa20f0bb2846365a45f96e91e95fe2e7)
|
||||
- 🧹 Dashboard - drop header bar [`f1833f1`](https://git.odit.services/lfk/frontend/commit/f1833f13d57595c23abf29bce1a2795cbb05a116)
|
||||
- ✨ AddTeamModal working [`9bb027e`](https://git.odit.services/lfk/frontend/commit/9bb027ec4c73483907d396180f739dc3a11b2404)
|
||||
- 🧹 TeamDetail cleanup [`7654b79`](https://git.odit.services/lfk/frontend/commit/7654b795c756ca198bad77068823032714408535)
|
||||
- 🚀RELEASE v0.3.1 [`64ade90`](https://git.odit.services/lfk/frontend/commit/64ade901ded75fa738c713446343a209eca89ce6)
|
||||
- 🤝 attribution/ credits for icons and illustrations [`eb0dd3f`](https://git.odit.services/lfk/frontend/commit/eb0dd3f781f739c6511588a8e153c14a39096025)
|
||||
- 🔒 re-enable confirmation in OrgOverview [`ce6002a`](https://git.odit.services/lfk/frontend/commit/ce6002a631dd3c140f3892c750d052e89c135653)
|
||||
- ✨ added new empty states [`66e6cd8`](https://git.odit.services/lfk/frontend/commit/66e6cd80d39ef18a29fd8ac80fbac929bd0c4f8c)
|
||||
- Merge pull request 'feature/14-team-management' (#36) from feature/14-team-management into dev [`4285168`](https://git.odit.services/lfk/frontend/commit/42851686caae69e6672f48cd7df77ee4c2e49092)
|
||||
- 🧹 TeamsOverview - formatting [`6870a7f`](https://git.odit.services/lfk/frontend/commit/6870a7f9b1fce2f06182dafa502f6dc4bb818bd3)
|
||||
- 🔒 ConfirmOrgDeletion in OrgOverview [`83f19a7`](https://git.odit.services/lfk/frontend/commit/83f19a7572255b5c095c68d688a963dbe3cf4a75)
|
||||
- 🧹 Team cleanups [`07f2e65`](https://git.odit.services/lfk/frontend/commit/07f2e65fc722c0328ee5a8dc4d01fc89c906fa86)
|
||||
|
14
Dockerfile
14
Dockerfile
@@ -1,20 +1,14 @@
|
||||
FROM node:15.5.1-alpine3.12
|
||||
WORKDIR /app
|
||||
RUN npm i -g pnpm
|
||||
COPY package.json ./
|
||||
RUN pnpm i
|
||||
COPY package.json *.config.js workbox-config.js ./
|
||||
RUN yarn
|
||||
COPY package.json *.config.js index.html ./
|
||||
COPY src ./src
|
||||
COPY public ./public
|
||||
RUN pnpm run build:sw
|
||||
RUN pnpm run build
|
||||
RUN yarn build
|
||||
# final image
|
||||
FROM alpine
|
||||
COPY --from=0 /app/build /app
|
||||
RUN rm -rf build/sw.js.map build/workbox-*.js.map
|
||||
RUN rm -rf /app/build/_dist_/components
|
||||
RUN rm -rf /app/build/_dist_/locales
|
||||
RUN rm -rf /app/build-manifest.json
|
||||
COPY --from=0 /app/dist /app
|
||||
FROM fholzer/nginx-brotli:v1.19.1
|
||||
COPY --from=1 /app /usr/share/nginx/html
|
||||
COPY ./nginx.conf /etc/nginx/nginx.conf
|
362
LICENSE
Normal file
362
LICENSE
Normal file
@@ -0,0 +1,362 @@
|
||||
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Creative
|
||||
Commons Corporation ("Creative Commons") is not a law firm and does not provide
|
||||
legal services or legal advice. Distribution of Creative Commons public licenses
|
||||
does not create a lawyer-client or other relationship. Creative Commons makes
|
||||
its licenses and related information available on an "as-is" basis. Creative
|
||||
Commons gives no warranties regarding its licenses, any material licensed
|
||||
under their terms and conditions, or any related information. Creative Commons
|
||||
disclaims all liability for damages resulting from their use to the fullest
|
||||
extent possible.
|
||||
|
||||
Using Creative Commons Public Licenses
|
||||
|
||||
Creative Commons public licenses provide a standard set of terms and conditions
|
||||
that creators and other rights holders may use to share original works of
|
||||
authorship and other material subject to copyright and certain other rights
|
||||
specified in the public license below. The following considerations are for
|
||||
informational purposes only, are not exhaustive, and do not form part of our
|
||||
licenses.
|
||||
|
||||
Considerations for licensors: Our public licenses are intended for use by
|
||||
those authorized to give the public permission to use material in ways otherwise
|
||||
restricted by copyright and certain other rights. Our licenses are irrevocable.
|
||||
Licensors should read and understand the terms and conditions of the license
|
||||
they choose before applying it. Licensors should also secure all rights necessary
|
||||
before applying our licenses so that the public can reuse the material as
|
||||
expected. Licensors should clearly mark any material not subject to the license.
|
||||
This includes other CC-licensed material, or material used under an exception
|
||||
or limitation to copyright. More considerations for licensors : wiki.creativecommons.org/Considerations_for_licensors
|
||||
|
||||
Considerations for the public: By using one of our public licenses, a licensor
|
||||
grants the public permission to use the licensed material under specified
|
||||
terms and conditions. If the licensor's permission is not necessary for any
|
||||
reason–for example, because of any applicable exception or limitation to copyright–then
|
||||
that use is not regulated by the license. Our licenses grant only permissions
|
||||
under copyright and certain other rights that a licensor has authority to
|
||||
grant. Use of the licensed material may still be restricted for other reasons,
|
||||
including because others have copyright or other rights in the material. A
|
||||
licensor may make special requests, such as asking that all changes be marked
|
||||
or described. Although not required by our licenses, you are encouraged to
|
||||
respect those requests where reasonable. More considerations for the public
|
||||
: wiki.creativecommons.org/Considerations_for_licensees
|
||||
|
||||
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public
|
||||
License
|
||||
|
||||
By exercising the Licensed Rights (defined below), You accept and agree to
|
||||
be bound by the terms and conditions of this Creative Commons Attribution-NonCommercial-ShareAlike
|
||||
4.0 International Public License ("Public License"). To the extent this Public
|
||||
License may be interpreted as a contract, You are granted the Licensed Rights
|
||||
in consideration of Your acceptance of these terms and conditions, and the
|
||||
Licensor grants You such rights in consideration of benefits the Licensor
|
||||
receives from making the Licensed Material available under these terms and
|
||||
conditions.
|
||||
|
||||
Section 1 – Definitions.
|
||||
|
||||
a. Adapted Material means material subject to Copyright and Similar Rights
|
||||
that is derived from or based upon the Licensed Material and in which the
|
||||
Licensed Material is translated, altered, arranged, transformed, or otherwise
|
||||
modified in a manner requiring permission under the Copyright and Similar
|
||||
Rights held by the Licensor. For purposes of this Public License, where the
|
||||
Licensed Material is a musical work, performance, or sound recording, Adapted
|
||||
Material is always produced where the Licensed Material is synched in timed
|
||||
relation with a moving image.
|
||||
|
||||
b. Adapter's License means the license You apply to Your Copyright and Similar
|
||||
Rights in Your contributions to Adapted Material in accordance with the terms
|
||||
and conditions of this Public License.
|
||||
|
||||
c. BY-NC-SA Compatible License means a license listed at creativecommons.org/compatiblelicenses,
|
||||
approved by Creative Commons as essentially the equivalent of this Public
|
||||
License.
|
||||
|
||||
d. Copyright and Similar Rights means copyright and/or similar rights closely
|
||||
related to copyright including, without limitation, performance, broadcast,
|
||||
sound recording, and Sui Generis Database Rights, without regard to how the
|
||||
rights are labeled or categorized. For purposes of this Public License, the
|
||||
rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights.
|
||||
|
||||
e. Effective Technological Measures means those measures that, in the absence
|
||||
of proper authority, may not be circumvented under laws fulfilling obligations
|
||||
under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996,
|
||||
and/or similar international agreements.
|
||||
|
||||
f. Exceptions and Limitations means fair use, fair dealing, and/or any other
|
||||
exception or limitation to Copyright and Similar Rights that applies to Your
|
||||
use of the Licensed Material.
|
||||
|
||||
g. License Elements means the license attributes listed in the name of a Creative
|
||||
Commons Public License. The License Elements of this Public License are Attribution,
|
||||
NonCommercial, and ShareAlike.
|
||||
|
||||
h. Licensed Material means the artistic or literary work, database, or other
|
||||
material to which the Licensor applied this Public License.
|
||||
|
||||
i. Licensed Rights means the rights granted to You subject to the terms and
|
||||
conditions of this Public License, which are limited to all Copyright and
|
||||
Similar Rights that apply to Your use of the Licensed Material and that the
|
||||
Licensor has authority to license.
|
||||
|
||||
j. Licensor means the individual(s) or entity(ies) granting rights under this
|
||||
Public License.
|
||||
|
||||
k. NonCommercial means not primarily intended for or directed towards commercial
|
||||
advantage or monetary compensation. For purposes of this Public License, the
|
||||
exchange of the Licensed Material for other material subject to Copyright
|
||||
and Similar Rights by digital file-sharing or similar means is NonCommercial
|
||||
provided there is no payment of monetary compensation in connection with the
|
||||
exchange.
|
||||
|
||||
l. Share means to provide material to the public by any means or process that
|
||||
requires permission under the Licensed Rights, such as reproduction, public
|
||||
display, public performance, distribution, dissemination, communication, or
|
||||
importation, and to make material available to the public including in ways
|
||||
that members of the public may access the material from a place and at a time
|
||||
individually chosen by them.
|
||||
|
||||
m. Sui Generis Database Rights means rights other than copyright resulting
|
||||
from Directive 96/9/EC of the European Parliament and of the Council of 11
|
||||
March 1996 on the legal protection of databases, as amended and/or succeeded,
|
||||
as well as other essentially equivalent rights anywhere in the world.
|
||||
|
||||
n. You means the individual or entity exercising the Licensed Rights under
|
||||
this Public License. Your has a corresponding meaning.
|
||||
|
||||
Section 2 – Scope.
|
||||
|
||||
a. License grant.
|
||||
|
||||
1. Subject to the terms and conditions of this Public License, the Licensor
|
||||
hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive,
|
||||
irrevocable license to exercise the Licensed Rights in the Licensed Material
|
||||
to:
|
||||
|
||||
A. reproduce and Share the Licensed Material, in whole or in part, for NonCommercial
|
||||
purposes only; and
|
||||
|
||||
B. produce, reproduce, and Share Adapted Material for NonCommercial purposes
|
||||
only.
|
||||
|
||||
2. Exceptions and Limitations. For the avoidance of doubt, where Exceptions
|
||||
and Limitations apply to Your use, this Public License does not apply, and
|
||||
You do not need to comply with its terms and conditions.
|
||||
|
||||
3. Term. The term of this Public License is specified in Section 6(a).
|
||||
|
||||
4. Media and formats; technical modifications allowed. The Licensor authorizes
|
||||
You to exercise the Licensed Rights in all media and formats whether now known
|
||||
or hereafter created, and to make technical modifications necessary to do
|
||||
so. The Licensor waives and/or agrees not to assert any right or authority
|
||||
to forbid You from making technical modifications necessary to exercise the
|
||||
Licensed Rights, including technical modifications necessary to circumvent
|
||||
Effective Technological Measures. For purposes of this Public License, simply
|
||||
making modifications authorized by this Section 2(a)(4) never produces Adapted
|
||||
Material.
|
||||
|
||||
5. Downstream recipients.
|
||||
|
||||
A. Offer from the Licensor – Licensed Material. Every recipient of the Licensed
|
||||
Material automatically receives an offer from the Licensor to exercise the
|
||||
Licensed Rights under the terms and conditions of this Public License.
|
||||
|
||||
B. Additional offer from the Licensor – Adapted Material. Every recipient
|
||||
of Adapted Material from You automatically receives an offer from the Licensor
|
||||
to exercise the Licensed Rights in the Adapted Material under the conditions
|
||||
of the Adapter's License You apply.
|
||||
|
||||
C. No downstream restrictions. You may not offer or impose any additional
|
||||
or different terms or conditions on, or apply any Effective Technological
|
||||
Measures to, the Licensed Material if doing so restricts exercise of the Licensed
|
||||
Rights by any recipient of the Licensed Material.
|
||||
|
||||
6. No endorsement. Nothing in this Public License constitutes or may be construed
|
||||
as permission to assert or imply that You are, or that Your use of the Licensed
|
||||
Material is, connected with, or sponsored, endorsed, or granted official status
|
||||
by, the Licensor or others designated to receive attribution as provided in
|
||||
Section 3(a)(1)(A)(i).
|
||||
|
||||
b. Other rights.
|
||||
|
||||
1. Moral rights, such as the right of integrity, are not licensed under this
|
||||
Public License, nor are publicity, privacy, and/or other similar personality
|
||||
rights; however, to the extent possible, the Licensor waives and/or agrees
|
||||
not to assert any such rights held by the Licensor to the limited extent necessary
|
||||
to allow You to exercise the Licensed Rights, but not otherwise.
|
||||
|
||||
2. Patent and trademark rights are not licensed under this Public License.
|
||||
|
||||
3. To the extent possible, the Licensor waives any right to collect royalties
|
||||
from You for the exercise of the Licensed Rights, whether directly or through
|
||||
a collecting society under any voluntary or waivable statutory or compulsory
|
||||
licensing scheme. In all other cases the Licensor expressly reserves any right
|
||||
to collect such royalties, including when the Licensed Material is used other
|
||||
than for NonCommercial purposes.
|
||||
|
||||
Section 3 – License Conditions.
|
||||
|
||||
Your exercise of the Licensed Rights is expressly made subject to the following
|
||||
conditions.
|
||||
|
||||
a. Attribution.
|
||||
|
||||
1. If You Share the Licensed Material (including in modified form), You must:
|
||||
|
||||
A. retain the following if it is supplied by the Licensor with the Licensed
|
||||
Material:
|
||||
|
||||
i. identification of the creator(s) of the Licensed Material and any others
|
||||
designated to receive attribution, in any reasonable manner requested by the
|
||||
Licensor (including by pseudonym if designated);
|
||||
|
||||
ii. a copyright notice;
|
||||
|
||||
iii. a notice that refers to this Public License;
|
||||
|
||||
iv. a notice that refers to the disclaimer of warranties;
|
||||
|
||||
|
||||
|
||||
v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable;
|
||||
|
||||
B. indicate if You modified the Licensed Material and retain an indication
|
||||
of any previous modifications; and
|
||||
|
||||
C. indicate the Licensed Material is licensed under this Public License, and
|
||||
include the text of, or the URI or hyperlink to, this Public License.
|
||||
|
||||
2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner
|
||||
based on the medium, means, and context in which You Share the Licensed Material.
|
||||
For example, it may be reasonable to satisfy the conditions by providing a
|
||||
URI or hyperlink to a resource that includes the required information.
|
||||
|
||||
3. If requested by the Licensor, You must remove any of the information required
|
||||
by Section 3(a)(1)(A) to the extent reasonably practicable.
|
||||
|
||||
b. ShareAlike.In addition to the conditions in Section 3(a), if You Share
|
||||
Adapted Material You produce, the following conditions also apply.
|
||||
|
||||
1. The Adapter's License You apply must be a Creative Commons license with
|
||||
the same License Elements, this version or later, or a BY-NC-SA Compatible
|
||||
License.
|
||||
|
||||
2. You must include the text of, or the URI or hyperlink to, the Adapter's
|
||||
License You apply. You may satisfy this condition in any reasonable manner
|
||||
based on the medium, means, and context in which You Share Adapted Material.
|
||||
|
||||
3. You may not offer or impose any additional or different terms or conditions
|
||||
on, or apply any Effective Technological Measures to, Adapted Material that
|
||||
restrict exercise of the rights granted under the Adapter's License You apply.
|
||||
|
||||
Section 4 – Sui Generis Database Rights.
|
||||
|
||||
Where the Licensed Rights include Sui Generis Database Rights that apply to
|
||||
Your use of the Licensed Material:
|
||||
|
||||
a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract,
|
||||
reuse, reproduce, and Share all or a substantial portion of the contents of
|
||||
the database for NonCommercial purposes only;
|
||||
|
||||
b. if You include all or a substantial portion of the database contents in
|
||||
a database in which You have Sui Generis Database Rights, then the database
|
||||
in which You have Sui Generis Database Rights (but not its individual contents)
|
||||
is Adapted Material, including for purposes of Section 3(b); and
|
||||
|
||||
c. You must comply with the conditions in Section 3(a) if You Share all or
|
||||
a substantial portion of the contents of the database.
|
||||
|
||||
For the avoidance of doubt, this Section 4 supplements and does not replace
|
||||
Your obligations under this Public License where the Licensed Rights include
|
||||
other Copyright and Similar Rights.
|
||||
|
||||
Section 5 – Disclaimer of Warranties and Limitation of Liability.
|
||||
|
||||
a. Unless otherwise separately undertaken by the Licensor, to the extent possible,
|
||||
the Licensor offers the Licensed Material as-is and as-available, and makes
|
||||
no representations or warranties of any kind concerning the Licensed Material,
|
||||
whether express, implied, statutory, or other. This includes, without limitation,
|
||||
warranties of title, merchantability, fitness for a particular purpose, non-infringement,
|
||||
absence of latent or other defects, accuracy, or the presence or absence of
|
||||
errors, whether or not known or discoverable. Where disclaimers of warranties
|
||||
are not allowed in full or in part, this disclaimer may not apply to You.
|
||||
|
||||
b. To the extent possible, in no event will the Licensor be liable to You
|
||||
on any legal theory (including, without limitation, negligence) or otherwise
|
||||
for any direct, special, indirect, incidental, consequential, punitive, exemplary,
|
||||
or other losses, costs, expenses, or damages arising out of this Public License
|
||||
or use of the Licensed Material, even if the Licensor has been advised of
|
||||
the possibility of such losses, costs, expenses, or damages. Where a limitation
|
||||
of liability is not allowed in full or in part, this limitation may not apply
|
||||
to You.
|
||||
|
||||
c. The disclaimer of warranties and limitation of liability provided above
|
||||
shall be interpreted in a manner that, to the extent possible, most closely
|
||||
approximates an absolute disclaimer and waiver of all liability.
|
||||
|
||||
Section 6 – Term and Termination.
|
||||
|
||||
a. This Public License applies for the term of the Copyright and Similar Rights
|
||||
licensed here. However, if You fail to comply with this Public License, then
|
||||
Your rights under this Public License terminate automatically.
|
||||
|
||||
b. Where Your right to use the Licensed Material has terminated under Section
|
||||
6(a), it reinstates:
|
||||
|
||||
1. automatically as of the date the violation is cured, provided it is cured
|
||||
within 30 days of Your discovery of the violation; or
|
||||
|
||||
2. upon express reinstatement by the Licensor.
|
||||
|
||||
For the avoidance of doubt, this Section 6(b) does not affect any right the
|
||||
Licensor may have to seek remedies for Your violations of this Public License.
|
||||
|
||||
c. For the avoidance of doubt, the Licensor may also offer the Licensed Material
|
||||
under separate terms or conditions or stop distributing the Licensed Material
|
||||
at any time; however, doing so will not terminate this Public License.
|
||||
|
||||
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public License.
|
||||
|
||||
Section 7 – Other Terms and Conditions.
|
||||
|
||||
a. The Licensor shall not be bound by any additional or different terms or
|
||||
conditions communicated by You unless expressly agreed.
|
||||
|
||||
b. Any arrangements, understandings, or agreements regarding the Licensed
|
||||
Material not stated herein are separate from and independent of the terms
|
||||
and conditions of this Public License.
|
||||
|
||||
Section 8 – Interpretation.
|
||||
|
||||
a. For the avoidance of doubt, this Public License does not, and shall not
|
||||
be interpreted to, reduce, limit, restrict, or impose conditions on any use
|
||||
of the Licensed Material that could lawfully be made without permission under
|
||||
this Public License.
|
||||
|
||||
b. To the extent possible, if any provision of this Public License is deemed
|
||||
unenforceable, it shall be automatically reformed to the minimum extent necessary
|
||||
to make it enforceable. If the provision cannot be reformed, it shall be severed
|
||||
from this Public License without affecting the enforceability of the remaining
|
||||
terms and conditions.
|
||||
|
||||
c. No term or condition of this Public License will be waived and no failure
|
||||
to comply consented to unless expressly agreed to by the Licensor.
|
||||
|
||||
d. Nothing in this Public License constitutes or may be interpreted as a limitation
|
||||
upon, or waiver of, any privileges and immunities that apply to the Licensor
|
||||
or You, including from the legal processes of any jurisdiction or authority.
|
||||
|
||||
Creative Commons is not a party to its public licenses. Notwithstanding, Creative
|
||||
Commons may elect to apply one of its public licenses to material it publishes
|
||||
and in those instances will be considered the "Licensor." The text of the
|
||||
Creative Commons public licenses is dedicated to the public domain under the
|
||||
CC0 Public Domain Dedication. Except for the limited purpose of indicating
|
||||
that material is shared under a Creative Commons public license or as otherwise
|
||||
permitted by the Creative Commons policies published at creativecommons.org/policies,
|
||||
Creative Commons does not authorize the use of the trademark "Creative Commons"
|
||||
or any other trademark or logo of Creative Commons without its prior written
|
||||
consent including, without limitation, in connection with any unauthorized
|
||||
modifications to any of its public licenses or any other arrangements, understandings,
|
||||
or agreements concerning use of licensed material. For the avoidance of doubt,
|
||||
this paragraph does not form part of the public licenses.
|
||||
|
||||
Creative Commons may be contacted at creativecommons.org.
|
22
README.md
Normal file
22
README.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# @odit/lfk-frontend
|
||||
|
||||
## ✒️ Overview
|
||||
This is an API client for [https://git.odit.services/lfk/backend](@lfk/backend)
|
||||
- WebApp built with [Svelte](https://svelte.dev), [WindiCSS](https://windicss.org/) (to compile [TailwindCSS](https://tailwindcss.com/)) and [Vite](https://vitejs.dev).
|
||||
|
||||
This application is intended for use by admin users/ members only.
|
||||
|
||||
## 🚀 Getting Started
|
||||
```
|
||||
yarn
|
||||
```
|
||||
## Development
|
||||
```
|
||||
yarn dev
|
||||
/
|
||||
yarn dev --open
|
||||
```
|
||||
## Build
|
||||
```
|
||||
yarn build
|
||||
```
|
@@ -1,6 +0,0 @@
|
||||
const config = {
|
||||
baseurl: 'https://dev.lauf-fuer-kaya.de',
|
||||
fallback_username: 'admin',
|
||||
fallback_password: '72fpTzsev4xUu78QPs2FCbwZ3',
|
||||
prefersHashRouting: true
|
||||
};
|
@@ -1,22 +1,22 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" href="/favicon.png" />
|
||||
<link rel="manifest" href="/manifest.webmanifest">
|
||||
<link rel="apple-touch-icon" href="/lfk-logo.png">
|
||||
<meta name="theme-color" content="#FFFFFF">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="description" content="Lauf Für Kaya! - Admin" />
|
||||
<title>Lauf für Kaya! - Admin</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<span style="display: none;visibility: hidden;" id="buildinfo">RELEASE_INFO-0.3.1-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>
|
||||
</body>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" href="/favicon.png" />
|
||||
<link rel="manifest" href="/manifest.webmanifest">
|
||||
<link rel="apple-touch-icon" href="/lfk-logo.png">
|
||||
<meta name="theme-color" content="#FFFFFF">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="description" content="Lauf Für Kaya! - Admin" />
|
||||
<title>Lauf für Kaya! - Admin</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<span style="display: none;visibility: hidden;" id="buildinfo">RELEASE_INFO-0.12.1-RELEASE_INFO</span>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
<script src="/env.js"></script>
|
||||
<script type="module" src="/src/main.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
@@ -6,6 +6,15 @@ http {
|
||||
server {
|
||||
error_page 404 /index.html;
|
||||
root /usr/share/nginx/html;
|
||||
location = /index.html {
|
||||
add_header Cache-Control 'no-store';
|
||||
}
|
||||
location = / {
|
||||
add_header Cache-Control 'no-store';
|
||||
}
|
||||
location = /env.js {
|
||||
add_header Cache-Control 'no-store';
|
||||
}
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
112
package.json
112
package.json
@@ -1,56 +1,56 @@
|
||||
{
|
||||
"name": "@odit/lfk-frontend",
|
||||
"version": "0.3.1",
|
||||
"scripts": {
|
||||
"i18n-order": "node order.js",
|
||||
"dev": "snowpack dev",
|
||||
"build": "snowpack build",
|
||||
"build:sw": "workbox generateSW workbox-config.js",
|
||||
"release": "release-it",
|
||||
"licenses:export": "license-exporter --json -o public"
|
||||
},
|
||||
"dependencies": {
|
||||
"@odit/lfk-client-js": "0.0.12",
|
||||
"filepond": "4.25.1",
|
||||
"gridjs": "3.2.2",
|
||||
"localforage": "1.9.0",
|
||||
"lodash.isequal": "^4.5.0",
|
||||
"svelte-filepond": "0.0.1",
|
||||
"svelte-focus-trap": "1.0.1",
|
||||
"svelte-i18n": "3.3.0",
|
||||
"tailwindcss": "2.0.2",
|
||||
"tinro": "0.5.6",
|
||||
"toastify-js": "1.9.3",
|
||||
"validator": "13.5.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@odit/license-exporter": "0.0.9",
|
||||
"@snowpack/plugin-svelte": "3.5.1",
|
||||
"auto-changelog": "^2.2.1",
|
||||
"autoprefixer": "10.2.1",
|
||||
"postcss": "8.2.4",
|
||||
"postcss-load-config": "3.0.0",
|
||||
"release-it": "^14.2.2",
|
||||
"snowpack": "3.0.10",
|
||||
"svelte": "3.31.2",
|
||||
"svelte-preprocess": "4.6.1",
|
||||
"workbox-cli": "6.0.2"
|
||||
},
|
||||
"release-it": {
|
||||
"git": {
|
||||
"commit": true,
|
||||
"requireCleanWorkingDir": false,
|
||||
"commitMessage": "🚀RELEASE v${version}",
|
||||
"push": false,
|
||||
"tag": true,
|
||||
"tagName": null,
|
||||
"tagAnnotation": "v${version}"
|
||||
},
|
||||
"npm": {
|
||||
"publish": false
|
||||
},
|
||||
"hooks": {
|
||||
"after:bump": "npx auto-changelog --commit-limit false -p -u --hide-credit && git add CHANGELOG.md && node versionbuilder.js && git add public/index.html && node order.js && git add src/locales"
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
"name": "@odit/lfk-frontend",
|
||||
"version": "0.12.1",
|
||||
"scripts": {
|
||||
"i18n-order": "node order.js",
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"release": "release-it",
|
||||
"licenses:export": "license-exporter --json -o public"
|
||||
},
|
||||
"license": "CC-BY-NC-SA-4.0",
|
||||
"devDependencies": {
|
||||
"check-password-strength": "2.0.2",
|
||||
"@odit/lfk-client-js": "0.10.1",
|
||||
"@odit/license-exporter": "0.0.11",
|
||||
"@sveltejs/vite-plugin-svelte": "1.0.0-next.5",
|
||||
"@types/html-minifier": "4.0.0",
|
||||
"auto-changelog": "2.2.1",
|
||||
"autoprefixer": "10.2.5",
|
||||
"csvtojson": "2.0.10",
|
||||
"gridjs": "3.4.0",
|
||||
"html-minifier": "4.0.0",
|
||||
"localforage": "1.9.0",
|
||||
"marked": "2.0.1",
|
||||
"release-it": "14.5.1",
|
||||
"svelte": "3.37.0",
|
||||
"svelte-focus-trap": "1.2.0",
|
||||
"svelte-i18n": "3.3.9",
|
||||
"svelte-preprocess": "4.7.0",
|
||||
"svelte-select": "3.17.0",
|
||||
"tailwindcss": "2.0.4",
|
||||
"tinro": "0.6.1",
|
||||
"toastify-js": "1.10.0",
|
||||
"validator": "13.5.2",
|
||||
"vite": "2.1.5",
|
||||
"vite-plugin-windicss": "0.12.2",
|
||||
"xlsx": "0.16.9"
|
||||
},
|
||||
"release-it": {
|
||||
"git": {
|
||||
"commit": true,
|
||||
"requireCleanWorkingDir": false,
|
||||
"commitMessage": "🚀RELEASE v${version}",
|
||||
"push": false,
|
||||
"tag": true,
|
||||
"tagName": null,
|
||||
"tagAnnotation": "v${version}"
|
||||
},
|
||||
"npm": {
|
||||
"publish": false
|
||||
},
|
||||
"hooks": {
|
||||
"after:bump": "npx auto-changelog --commit-limit false -p -u --hide-credit && git add CHANGELOG.md && node versionbuilder.js && git add index.html && node order.js && git add src/locales"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,5 +1,8 @@
|
||||
const config = {
|
||||
baseurl: 'http://localhost:4010',
|
||||
documentserver_key: 'NqZSYTy5AFQ7MppbLW5moqpTk7u7YrNUHKYhKYuThnnya2WpCOIU694hIZT1FzYe',
|
||||
// optional
|
||||
default_username: 'demo',
|
||||
default_password: 'demo',
|
||||
prefersHashRouting: true
|
||||
};
|
||||
|
File diff suppressed because one or more lines are too long
@@ -1,11 +1,18 @@
|
||||
{
|
||||
"name": "Lauf für Kaya! - Admin",
|
||||
"short_name": "LfK!Admin",
|
||||
"start_url": ".",
|
||||
"start_url": "/?utm_source=pwa",
|
||||
"orientation": "portrait-primary",
|
||||
"display": "standalone",
|
||||
"background_color": "#fff",
|
||||
"theme_color": "#fff",
|
||||
"description": "Lauf für Kaya! - Admin",
|
||||
"shortcuts": [
|
||||
{
|
||||
"name": "Users",
|
||||
"url": "/users/?utm_source=pwa"
|
||||
}
|
||||
],
|
||||
"icons": [
|
||||
{
|
||||
"src": "/favicon.png",
|
||||
|
1
public/privacy_en.md
Normal file
1
public/privacy_en.md
Normal file
@@ -0,0 +1 @@
|
||||
Nostrud tempor dolor aute ea excepteur aute mollit elit eiusmod exercitation. Magna laborum pariatur adipisicing pariatur cupidatat exercitation duis aliquip pariatur sint exercitation deserunt labore. Consectetur id laboris dolore nostrud do velit ipsum. Eu laboris velit do commodo ad ea sint ex cillum. Cillum ipsum qui eiusmod laborum mollit sunt dolore incididunt. Cillum sunt culpa veniam voluptate et qui ut magna anim occaecat ut mollit dolor. Duis irure proident eu incididunt dolore sunt nisi aute dolore amet eu fugiat laboris quis.
|
@@ -1,2 +0,0 @@
|
||||
if(!self.define){const e=e=>{"require"!==e&&(e+=".js");let r=Promise.resolve();return i[e]||(r=new Promise((async r=>{if("document"in self){const i=document.createElement("script");i.src=e,document.head.appendChild(i),i.onload=r}else importScripts(e),r()}))),r.then((()=>{if(!i[e])throw new Error(`Module ${e} didn’t register its module`);return i[e]}))},r=(r,i)=>{Promise.all(r.map(e)).then((e=>i(1===e.length?e[0]:e)))},i={require:Promise.resolve(r)};self.define=(r,s,o)=>{i[r]||(i[r]=Promise.resolve().then((()=>{let i={};const c={uri:location.origin+r.slice(1)};return Promise.all(s.map((r=>{switch(r){case"exports":return i;case"module":return c;default:return e(r)}}))).then((e=>{const r=o(...e);return i.default||(i.default=r),i}))})))}}define("./sw.js",["./workbox-c8ead010"],(function(e){"use strict";self.addEventListener("message",(e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()})),e.precacheAndRoute([{url:"favicon.ico",revision:"ba44f340afba5bb1a07f14decc15dd04"},{url:"favicon.png",revision:"07a9941cec62319578fa2a1734db9959"},{url:"favicon.svg",revision:"689d6c6fda51e359c0e5725d9e905064"},{url:"index.html",revision:"931c34f3675364dcc09411aa0f223776"},{url:"logo.svg",revision:"4c9e31a1f4268d7e36e22cda7656e561"},{url:"manifest.webmanifest",revision:"75c93eb352c4877216e77b1d7f73445f"},{url:"robots.txt",revision:"61c27d2cd39a713f7829422c3d9edcc7"}],{})}));
|
||||
//# sourceMappingURL=sw.js.map
|
File diff suppressed because one or more lines are too long
@@ -1,26 +0,0 @@
|
||||
/** @type {import("snowpack").SnowpackUserConfig } */
|
||||
module.exports = {
|
||||
mount: {
|
||||
public: '/',
|
||||
src: '/_dist_'
|
||||
},
|
||||
plugins: [ '@snowpack/plugin-svelte' ],
|
||||
routes: [
|
||||
/* Enable an SPA Fallback in development: */
|
||||
{ match: 'routes', src: '.*', dest: '/index.html' }
|
||||
],
|
||||
packageOptions: {
|
||||
/* ... */
|
||||
sourceMap: false
|
||||
},
|
||||
devOptions: {
|
||||
/* ... */
|
||||
},
|
||||
buildOptions: {
|
||||
/* ... */
|
||||
},
|
||||
alias: {
|
||||
/* ... */
|
||||
},
|
||||
optimize: { bundle: true, minify: true }
|
||||
};
|
156
src/App.svelte
156
src/App.svelte
@@ -1,5 +1,4 @@
|
||||
<script>
|
||||
import "./TailwindStyles.svelte";
|
||||
import "toastify-js/src/toastify.css";
|
||||
import "gridjs/dist/theme/mermaid.css";
|
||||
import { Route, router } from "tinro";
|
||||
@@ -27,31 +26,53 @@
|
||||
storeName: "lfk_admin",
|
||||
description: "LfK! admin dashbaord",
|
||||
});
|
||||
window.onunhandledrejection = (event) => {
|
||||
if (event.reason.toString() == "Error: Unauthorized") {
|
||||
console.log("Found 1");
|
||||
localForage.clear();
|
||||
location.replace("/");
|
||||
}
|
||||
};
|
||||
//
|
||||
import Login from "./components/Login.svelte";
|
||||
import Dashboard from "./components/Dashboard.svelte";
|
||||
import Login from "./components/auth/Login.svelte";
|
||||
import Dashboard from "./components/dashboard/Dashboard.svelte";
|
||||
import store from "./store.js";
|
||||
import NotFound from "./components/NotFound.svelte";
|
||||
import ForgotPassword from "./components/ForgotPassword.svelte";
|
||||
import MainDashContent from "./components/MainDashContent.svelte";
|
||||
import Users from "./components/Users.svelte";
|
||||
import About from "./components/About.svelte";
|
||||
import Settings from "./components/Settings.svelte";
|
||||
import Transition from "./components/Transition.svelte";
|
||||
import Orgs from "./components/Orgs.svelte";
|
||||
import Runners from "./components/Runners.svelte";
|
||||
import Footer from "./components/Footer.svelte";
|
||||
import Tracks from "./components/Tracks.svelte";
|
||||
import TracksOverview from "./components/TracksOverview.svelte";
|
||||
import OrgDetail from "./components/OrgDetail.svelte";
|
||||
import Teams from "./components/Teams.svelte";
|
||||
import { OpenAPI, AuthService } from "@odit/lfk-client-js";
|
||||
import UserDetail from "./components/UserDetail.svelte";
|
||||
import ForgotPassword from "./components/auth/ForgotPassword.svelte";
|
||||
import MainDashContent from "./components/dashboard/MainDashContent.svelte";
|
||||
import Users from "./components/users/Users.svelte";
|
||||
import About from "./components/general/About.svelte";
|
||||
import Settings from "./components/settings/Settings.svelte";
|
||||
import Transition from "./components/base/Transition.svelte";
|
||||
import Orgs from "./components/orgs/Orgs.svelte";
|
||||
import Runners from "./components/runners/Runners.svelte";
|
||||
import Footer from "./components/general/Footer.svelte";
|
||||
import TracksOverview from "./components/tracks/TracksOverview.svelte";
|
||||
import OrgDetail from "./components/orgs/OrgDetail.svelte";
|
||||
import Teams from "./components/teams/Teams.svelte";
|
||||
import { OpenAPI } from "@odit/lfk-client-js";
|
||||
import UserDetail from "./components/users/UserDetail.svelte";
|
||||
OpenAPI.BASE = config.baseurl;
|
||||
import { register as registerSW } from "./swmodule";
|
||||
import TeamDetail from "./components/TeamDetail.svelte";
|
||||
import TeamDetail from "./components/teams/TeamDetail.svelte";
|
||||
import UserPermissions from "./components/users/UserPermissions.svelte";
|
||||
import GroupPermissions from "./components/groups/GroupPermissions.svelte";
|
||||
import RunnerDetail from "./components/runners/RunnerDetail.svelte";
|
||||
import Imprint from "./components/general/Imprint.svelte";
|
||||
import Privacy from "./components/general/Privacy.svelte";
|
||||
import ResetPassword from "./components/auth/ResetPassword.svelte";
|
||||
import Contacts from "./components/contacts/Contacts.svelte";
|
||||
import ContactDetail from "./components/contacts/ContactDetail.svelte";
|
||||
import Donors from "./components/donors/Donors.svelte";
|
||||
import Groups from "./components/groups/Groups.svelte";
|
||||
import DonorDetail from "./components/donors/DonorDetail.svelte";
|
||||
import Donations from "./components/donations/Donations.svelte";
|
||||
import DonationDetail from "./components/donations/DonationDetail.svelte";
|
||||
import GroupDetail from "./components/groups/GroupDetail.svelte";
|
||||
import ScanStations from "./components/scanstations/ScanStations.svelte";
|
||||
import ScanStationDetail from "./components/scanstations/ScanStationDetail.svelte";
|
||||
import Scans from "./components/scans/Scans.svelte";
|
||||
import ScanDetail from "./components/scans/ScanDetail.svelte";
|
||||
import Cards from "./components/cards/Cards.svelte";
|
||||
store.init();
|
||||
// registerSW();
|
||||
</script>
|
||||
|
||||
<Route>
|
||||
@@ -59,10 +80,22 @@
|
||||
<Route path="/forgot_password">
|
||||
<ForgotPassword />
|
||||
</Route>
|
||||
{:else if $router.path.includes('/reset')}
|
||||
<Route path="/reset/:resetkey" let:params>
|
||||
<ResetPassword {params} />
|
||||
</Route>
|
||||
{:else if $router.path === '/about'}
|
||||
<Route path="/about">
|
||||
<About />
|
||||
</Route>
|
||||
{:else if $router.path === '/imprint'}
|
||||
<Route path="/imprint">
|
||||
<Imprint />
|
||||
</Route>
|
||||
{:else if $router.path === '/privacy'}
|
||||
<Route path="/privacy">
|
||||
<Privacy />
|
||||
</Route>
|
||||
{:else if $store.isLoggedIn}
|
||||
<Dashboard>
|
||||
<Transition>
|
||||
@@ -73,8 +106,26 @@
|
||||
<Route path="/">
|
||||
<Users />
|
||||
</Route>
|
||||
<Route path="/:userid" let:params>
|
||||
<UserDetail {params} />
|
||||
<Route path="/:userid/*" let:params>
|
||||
<Route path="/">
|
||||
<UserDetail {params} />
|
||||
</Route>
|
||||
<Route path="/permissions/">
|
||||
<UserPermissions {params} />
|
||||
</Route>
|
||||
</Route>
|
||||
</Route>
|
||||
<Route path="/groups/*">
|
||||
<Route path="/">
|
||||
<Groups />
|
||||
</Route>
|
||||
<Route path="/:groupid/*" let:params>
|
||||
<Route path="/">
|
||||
<GroupDetail {params} />
|
||||
</Route>
|
||||
<Route path="/permissions/">
|
||||
<GroupPermissions {params} />
|
||||
</Route>
|
||||
</Route>
|
||||
</Route>
|
||||
<Route path="/tracks/*">
|
||||
@@ -83,8 +134,13 @@
|
||||
</Route>
|
||||
<Route path="/:trackid" let:params />
|
||||
</Route>
|
||||
<Route path="/runners">
|
||||
<Runners />
|
||||
<Route path="/runners/*">
|
||||
<Route path="/">
|
||||
<Runners />
|
||||
</Route>
|
||||
<Route path="/:runnerid" let:params>
|
||||
<RunnerDetail {params} />
|
||||
</Route>
|
||||
</Route>
|
||||
<Route path="/teams/*">
|
||||
<Route path="/">
|
||||
@@ -94,6 +150,14 @@
|
||||
<TeamDetail {params} />
|
||||
</Route>
|
||||
</Route>
|
||||
<Route path="/contacts/*">
|
||||
<Route path="/">
|
||||
<Contacts />
|
||||
</Route>
|
||||
<Route path="/:contact" let:params>
|
||||
<ContactDetail {params} />
|
||||
</Route>
|
||||
</Route>
|
||||
<Route path="/orgs/*">
|
||||
<Route path="/">
|
||||
<Orgs />
|
||||
@@ -102,6 +166,46 @@
|
||||
<OrgDetail {params} />
|
||||
</Route>
|
||||
</Route>
|
||||
<Route path="/donors/*">
|
||||
<Route path="/">
|
||||
<Donors />
|
||||
</Route>
|
||||
<Route path="/:donorid" let:params>
|
||||
<DonorDetail {params} />
|
||||
</Route>
|
||||
</Route>
|
||||
<Route path="/donations/*">
|
||||
<Route path="/">
|
||||
<Donations />
|
||||
</Route>
|
||||
<Route path="/:donationid" let:params>
|
||||
<DonationDetail {params} />
|
||||
</Route>
|
||||
</Route>
|
||||
<Route path="/cards/*">
|
||||
<Route path="/">
|
||||
<Cards />
|
||||
</Route>
|
||||
<!-- <Route path="/:scanid" let:params>
|
||||
<ScanDetail {params} />
|
||||
</Route> -->
|
||||
</Route>
|
||||
<Route path="/scans/*">
|
||||
<Route path="/">
|
||||
<Scans />
|
||||
</Route>
|
||||
<Route path="/:scanid" let:params>
|
||||
<ScanDetail {params} />
|
||||
</Route>
|
||||
</Route>
|
||||
<Route path="/scanstations/*">
|
||||
<Route path="/">
|
||||
<ScanStations />
|
||||
</Route>
|
||||
<Route path="/:stationid" let:params>
|
||||
<ScanStationDetail {params} />
|
||||
</Route>
|
||||
</Route>
|
||||
<Route path="/about">
|
||||
<About />
|
||||
</Route>
|
||||
|
@@ -1,6 +0,0 @@
|
||||
<style global>
|
||||
/*! @import */
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
</style>
|
File diff suppressed because it is too large
Load Diff
@@ -1,271 +0,0 @@
|
||||
<script>
|
||||
import { _ } from "svelte-i18n";
|
||||
import localForage from "localforage";
|
||||
import { router } from "tinro";
|
||||
import NoComponentLoaded from "./NoComponentLoaded.svelte";
|
||||
import { AuthService } from "@odit/lfk-client-js";
|
||||
let dropdown1 = false;
|
||||
$: navOpen = false;
|
||||
function logout() {
|
||||
localForage.clear();
|
||||
location.replace("/");
|
||||
}
|
||||
</script>
|
||||
|
||||
<section class="min-h-screen bg-gray-50">
|
||||
<nav
|
||||
class:-translate-x-full={!navOpen}
|
||||
class:translate-x-0={navOpen}
|
||||
class="select-none fixed top-0 left-0 z-20 h-full pb-10 overflow-x-hidden overflow-y-auto transition origin-left transform border-r w-60 md:translate-x-0 bg-gray-50">
|
||||
<a href="/" class="flex items-center px-4 py-5">
|
||||
<img src="/lfk-logo.png" alt="Logo" class="h-10" />
|
||||
<h3 class="text-lg">Lauf für Kaya! Admin</h3>
|
||||
</a>
|
||||
<nav class="text-sm font-medium text-gray-600" aria-label="Main Navigation">
|
||||
<a
|
||||
class:bg-gray-100={$router.path === '/'}
|
||||
class="flex items-center px-4 py-3 transition cursor-pointer group hover:bg-gray-100 hover:text-gray-900"
|
||||
href="/">
|
||||
<svg
|
||||
class="flex-shrink-0 w-5 h-5 mr-2 text-gray-400 transition group-hover:text-gray-600"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 20 20"
|
||||
fill="currentColor">
|
||||
<path
|
||||
d="M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z" />
|
||||
</svg>
|
||||
<span>{$_('dashboard-title')}</span>
|
||||
</a>
|
||||
<a
|
||||
class:bg-gray-100={$router.path.includes('/orgs/')}
|
||||
class="flex items-center px-4 py-3 transition cursor-pointer group hover:bg-gray-100 hover:text-gray-900"
|
||||
href="/orgs/">
|
||||
<svg
|
||||
class="flex-shrink-0 w-5 h-5 mr-2 text-gray-400 transition group-hover:text-gray-600"
|
||||
fill="currentColor"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
width="24"
|
||||
height="24"><path fill="none" d="M0 0h24v24H0z" />
|
||||
<path
|
||||
d="M17 19h2v-8h-6v8h2v-6h2v6zM3 19V4a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v5h2v10h1v2H2v-2h1zm4-8v2h2v-2H7zm0 4v2h2v-2H7zm0-8v2h2V7H7z" /></svg>
|
||||
<span>{$_('orgs')}</span>
|
||||
</a>
|
||||
<a
|
||||
class:bg-gray-100={$router.path === '/users/'}
|
||||
class="flex items-center px-4 py-3 transition cursor-pointer group hover:bg-gray-100 hover:text-gray-900"
|
||||
href="/users/">
|
||||
<svg
|
||||
class="flex-shrink-0 w-5 h-5 mr-2 text-gray-400 transition group-hover:text-gray-600"
|
||||
fill="currentColor"
|
||||
width="24"
|
||||
height="24"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 640 512"><path
|
||||
fill="currentColor"
|
||||
d="M610.5 341.3c2.6-14.1 2.6-28.5 0-42.6l25.8-14.9c3-1.7 4.3-5.2 3.3-8.5-6.7-21.6-18.2-41.2-33.2-57.4-2.3-2.5-6-3.1-9-1.4l-25.8 14.9c-10.9-9.3-23.4-16.5-36.9-21.3v-29.8c0-3.4-2.4-6.4-5.7-7.1-22.3-5-45-4.8-66.2 0-3.3.7-5.7 3.7-5.7 7.1v29.8c-13.5 4.8-26 12-36.9 21.3l-25.8-14.9c-2.9-1.7-6.7-1.1-9 1.4-15 16.2-26.5 35.8-33.2 57.4-1 3.3.4 6.8 3.3 8.5l25.8 14.9c-2.6 14.1-2.6 28.5 0 42.6l-25.8 14.9c-3 1.7-4.3 5.2-3.3 8.5 6.7 21.6 18.2 41.1 33.2 57.4 2.3 2.5 6 3.1 9 1.4l25.8-14.9c10.9 9.3 23.4 16.5 36.9 21.3v29.8c0 3.4 2.4 6.4 5.7 7.1 22.3 5 45 4.8 66.2 0 3.3-.7 5.7-3.7 5.7-7.1v-29.8c13.5-4.8 26-12 36.9-21.3l25.8 14.9c2.9 1.7 6.7 1.1 9-1.4 15-16.2 26.5-35.8 33.2-57.4 1-3.3-.4-6.8-3.3-8.5l-25.8-14.9zM496 368.5c-26.8 0-48.5-21.8-48.5-48.5s21.8-48.5 48.5-48.5 48.5 21.8 48.5 48.5-21.7 48.5-48.5 48.5zM96 224c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm224 32c1.9 0 3.7-.5 5.6-.6 8.3-21.7 20.5-42.1 36.3-59.2 7.4-8 17.9-12.6 28.9-12.6 6.9 0 13.7 1.8 19.6 5.3l7.9 4.6c.8-.5 1.6-.9 2.4-1.4 7-14.6 11.2-30.8 11.2-48 0-61.9-50.1-112-112-112S208 82.1 208 144c0 61.9 50.1 112 112 112zm105.2 194.5c-2.3-1.2-4.6-2.6-6.8-3.9-8.2 4.8-15.3 9.8-27.5 9.8-10.9 0-21.4-4.6-28.9-12.6-18.3-19.8-32.3-43.9-40.2-69.6-10.7-34.5 24.9-49.7 25.8-50.3-.1-2.6-.1-5.2 0-7.8l-7.9-4.6c-3.8-2.2-7-5-9.8-8.1-3.3.2-6.5.6-9.8.6-24.6 0-47.6-6-68.5-16h-8.3C179.6 288 128 339.6 128 403.2V432c0 26.5 21.5 48 48 48h255.4c-3.7-6-6.2-12.8-6.2-20.3v-9.2zM173.1 274.6C161.5 263.1 145.6 256 128 256H64c-35.3 0-64 28.7-64 64v32c0 17.7 14.3 32 32 32h65.9c6.3-47.4 34.9-87.3 75.2-109.4z" /></svg>
|
||||
<span>{$_('users')}</span>
|
||||
</a>
|
||||
<a
|
||||
class:bg-gray-100={$router.path === '/runners/'}
|
||||
class="flex items-center px-4 py-3 transition cursor-pointer group hover:bg-gray-100 hover:text-gray-900"
|
||||
href="/runners/">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
class="flex-shrink-0 w-5 h-5 mr-2 text-gray-400 transition group-hover:text-gray-600"
|
||||
fill="currentColor"
|
||||
width="24"
|
||||
height="24"><path fill="none" d="M0 0h24v24H0z" />
|
||||
<path
|
||||
d="M9.83 8.79L8 9.456V13H6V8.05h.015l5.268-1.918c.244-.093.51-.14.782-.131a2.616 2.616 0 0 1 2.427 1.82c.186.583.356.977.51 1.182A4.992 4.992 0 0 0 19 11v2a6.986 6.986 0 0 1-5.402-2.547l-.581 3.297L15 15.67V23h-2v-5.986l-2.05-1.987-.947 4.298-6.894-1.215.348-1.97 4.924.868L9.83 8.79zM13.5 5.5a2 2 0 1 1 0-4 2 2 0 0 1 0 4z" /></svg>
|
||||
<span>{$_('runners')}</span>
|
||||
</a>
|
||||
<a
|
||||
class:bg-gray-100={$router.path === '/teams/'}
|
||||
class="flex items-center px-4 py-3 transition cursor-pointer group hover:bg-gray-100 hover:text-gray-900"
|
||||
href="/teams/">
|
||||
<svg
|
||||
class="flex-shrink-0 w-5 h-5 mr-2 text-gray-400 transition group-hover:text-gray-600"
|
||||
fill="currentColor"
|
||||
width="24"
|
||||
height="24"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 640 512"><path
|
||||
fill="currentColor"
|
||||
d="M96 224c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm448 0c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm32 32h-64c-17.6 0-33.5 7.1-45.1 18.6 40.3 22.1 68.9 62 75.1 109.4h66c17.7 0 32-14.3 32-32v-32c0-35.3-28.7-64-64-64zm-256 0c61.9 0 112-50.1 112-112S381.9 32 320 32 208 82.1 208 144s50.1 112 112 112zm76.8 32h-8.3c-20.8 10-43.9 16-68.5 16s-47.6-6-68.5-16h-8.3C179.6 288 128 339.6 128 403.2V432c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48v-28.8c0-63.6-51.6-115.2-115.2-115.2zm-223.7-13.4C161.5 263.1 145.6 256 128 256H64c-35.3 0-64 28.7-64 64v32c0 17.7 14.3 32 32 32h65.9c6.3-47.4 34.9-87.3 75.2-109.4z" /></svg>
|
||||
<span>{$_('teams')}</span>
|
||||
</a>
|
||||
<a
|
||||
class:bg-gray-100={$router.path === '/tracks/'}
|
||||
class="flex items-center px-4 py-3 transition cursor-pointer group hover:bg-gray-100 hover:text-gray-900"
|
||||
href="/tracks/">
|
||||
<svg
|
||||
class="flex-shrink-0 w-5 h-5 mr-2 text-gray-400 transition group-hover:text-gray-600"
|
||||
fill="currentColor"
|
||||
width="24"
|
||||
height="24"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 640 512"><path
|
||||
fill="currentColor"
|
||||
d="M635.7 167.2L556.1 31.7c-8.8-15-28.3-20.1-43.5-11.5l-69 39.1L503.3 161c2.2 3.8.9 8.5-2.9 10.7l-13.8 7.8c-3.8 2.2-8.7.9-10.9-2.9L416 75l-55.2 31.3 27.9 47.4c2.2 3.8.9 8.5-2.9 10.7l-13.8 7.8c-3.8 2.2-8.7.9-10.9-2.9L333.2 122 278 153.3 337.8 255c2.2 3.7.9 8.5-2.9 10.7l-13.8 7.8c-3.8 2.2-8.7.9-10.9-2.9l-59.7-101.7-55.2 31.3 27.9 47.4c2.2 3.8.9 8.5-2.9 10.7l-13.8 7.8c-3.8 2.2-8.7.9-10.9-2.9l-27.9-47.5-55.2 31.3 59.7 101.7c2.2 3.7.9 8.5-2.9 10.7l-13.8 7.8c-3.8 2.2-8.7.9-10.9-2.9L84.9 262.9l-69 39.1C.7 310.7-4.6 329.8 4.2 344.8l79.6 135.6c8.8 15 28.3 20.1 43.5 11.5L624.1 210c15.2-8.6 20.4-27.8 11.6-42.8z" /></svg>
|
||||
<span>{$_('tracks')}</span>
|
||||
</a>
|
||||
<a
|
||||
class:bg-gray-100={false}
|
||||
class="flex items-center px-4 py-3 transition cursor-pointer group hover:bg-gray-100 hover:text-gray-900"
|
||||
href="#">
|
||||
<svg
|
||||
class="flex-shrink-0 w-5 h-5 mr-2 text-gray-400 transition group-hover:text-gray-600"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 20 20"
|
||||
fill="currentColor">
|
||||
<path d="M9 2a1 1 0 000 2h2a1 1 0 100-2H9z" />
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
d="M4 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v11a2 2 0 01-2 2H6a2 2 0 01-2-2V5zm9.707 5.707a1 1 0 00-1.414-1.414L9 12.586l-1.293-1.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z"
|
||||
clip-rule="evenodd" />
|
||||
</svg>
|
||||
<span>Checklists</span>
|
||||
</a>
|
||||
<div>
|
||||
<div
|
||||
tabindex="0"
|
||||
class:bg-gray-100={false}
|
||||
class="flex items-center justify-between px-4 py-3 transition cursor-pointer group hover:bg-gray-100 hover:text-gray-900"
|
||||
role="button"
|
||||
on:click={() => {
|
||||
dropdown1 = !dropdown1;
|
||||
}}>
|
||||
<div class="flex items-center">
|
||||
<svg
|
||||
class="flex-shrink-0 w-5 h-5 mr-2 text-gray-400 transition group-hover:text-gray-600"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 20 20"
|
||||
fill="currentColor">
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
d="M12.316 3.051a1 1 0 01.633 1.265l-4 12a1 1 0 11-1.898-.632l4-12a1 1 0 011.265-.633zM5.707 6.293a1 1 0 010 1.414L3.414 10l2.293 2.293a1 1 0 11-1.414 1.414l-3-3a1 1 0 010-1.414l3-3a1 1 0 011.414 0zm8.586 0a1 1 0 011.414 0l3 3a1 1 0 010 1.414l-3 3a1 1 0 11-1.414-1.414L16.586 10l-2.293-2.293a1 1 0 010-1.414z"
|
||||
clip-rule="evenodd" />
|
||||
</svg>
|
||||
<span>Integrations</span>
|
||||
</div>
|
||||
{#if dropdown1}
|
||||
<svg
|
||||
class="flex-shrink-0 w-4 h-4 ml-2 transition transform"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
style="transform:rotate(90deg)"
|
||||
viewBox="0 0 20 20"
|
||||
fill="currentColor">
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"
|
||||
clip-rule="evenodd" />
|
||||
</svg>
|
||||
{:else}
|
||||
<svg
|
||||
class="flex-shrink-0 w-4 h-4 ml-2 transition transform"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 20 20"
|
||||
fill="currentColor">
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"
|
||||
clip-rule="evenodd" />
|
||||
</svg>
|
||||
{/if}
|
||||
</div>
|
||||
{#if dropdown1}
|
||||
<div class="mb-4">
|
||||
<a
|
||||
class="flex items-center py-2 pl-12 pr-4 transition cursor-pointer hover:bg-gray-100 hover:text-gray-900"
|
||||
href="#">Shopify</a>
|
||||
<a
|
||||
class="flex items-center py-2 pl-12 pr-4 transition cursor-pointer hover:bg-gray-100 hover:text-gray-900"
|
||||
href="#">Slack</a>
|
||||
<a
|
||||
class="flex items-center py-2 pl-12 pr-4 transition cursor-pointer hover:bg-gray-100 hover:text-gray-900"
|
||||
href="#">Zapier</a>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<a
|
||||
class="flex items-center px-4 py-3 transition cursor-pointer group hover:bg-gray-100 hover:text-gray-900"
|
||||
href="#">
|
||||
<svg
|
||||
class="flex-shrink-0 w-5 h-5 mr-2 text-gray-400 transition group-hover:text-gray-600"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 20 20"
|
||||
fill="currentColor">
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
d="M5 5a3 3 0 015-2.236A3 3 0 0114.83 6H16a2 2 0 110 4h-5V9a1 1 0 10-2 0v1H4a2 2 0 110-4h1.17C5.06 5.687 5 5.35 5 5zm4 1V5a1 1 0 10-1 1h1zm3 0a1 1 0 10-1-1v1h1z"
|
||||
clip-rule="evenodd" />
|
||||
<path d="M9 11H3v5a2 2 0 002 2h4v-7zM11 18h4a2 2 0 002-2v-5h-6v7z" />
|
||||
</svg>
|
||||
<span>{$_('changelog')}</span>
|
||||
</a>
|
||||
<a
|
||||
class:bg-gray-100={$router.path === '/settings/'}
|
||||
class="flex items-center px-4 py-3 transition cursor-pointer group hover:bg-gray-100 hover:text-gray-900"
|
||||
href="/settings/">
|
||||
<svg
|
||||
class="flex-shrink-0 w-5 h-5 mr-2 text-gray-400 transition group-hover:text-gray-600"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 20 20"
|
||||
fill="currentColor">
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
d="M11.49 3.17c-.38-1.56-2.6-1.56-2.98 0a1.532 1.532 0 01-2.286.948c-1.372-.836-2.942.734-2.106 2.106.54.886.061 2.042-.947 2.287-1.561.379-1.561 2.6 0 2.978a1.532 1.532 0 01.947 2.287c-.836 1.372.734 2.942 2.106 2.106a1.532 1.532 0 012.287.947c.379 1.561 2.6 1.561 2.978 0a1.533 1.533 0 012.287-.947c1.372.836 2.942-.734 2.106-2.106a1.533 1.533 0 01.947-2.287c1.561-.379 1.561-2.6 0-2.978a1.532 1.532 0 01-.947-2.287c.836-1.372-.734-2.942-2.106-2.106a1.532 1.532 0 01-2.287-.947zM10 13a3 3 0 100-6 3 3 0 000 6z"
|
||||
clip-rule="evenodd" />
|
||||
</svg>
|
||||
<span>{$_('settings')}</span>
|
||||
</a>
|
||||
<a
|
||||
class:bg-gray-100={$router.path === '/about/'}
|
||||
class="flex items-center px-4 py-3 transition cursor-pointer group hover:bg-gray-100 hover:text-gray-900"
|
||||
href="/about/">
|
||||
<svg
|
||||
class="flex-shrink-0 w-5 h-5 mr-2 text-gray-400 transition group-hover:text-gray-600"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
viewBox="0 0 24 24"><circle cx="12" cy="12" r="10" />
|
||||
<path d="M12 16v-4M12 8h.01" /></svg>
|
||||
<span>{$_('about')}</span>
|
||||
</a>
|
||||
<span
|
||||
tabindex="0"
|
||||
class="flex items-center px-4 py-3 transition cursor-pointer group hover:bg-gray-100 hover:text-gray-900"
|
||||
on:click={() => {
|
||||
AuthService.authControllerLogout();
|
||||
logout();
|
||||
}}>
|
||||
<svg
|
||||
class="flex-shrink-0 w-5 h-5 mr-2 text-gray-400 transition group-hover:text-gray-600"
|
||||
fill="currentColor"
|
||||
width="24"
|
||||
height="24"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z" />
|
||||
<path
|
||||
d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2a9.985 9.985 0 0 1 8 4h-2.71a8 8 0 1 0 .001 12h2.71A9.985 9.985 0 0 1 12 22zm7-6v-3h-8v-2h8V8l5 4-5 4z" /></svg>
|
||||
<span>{$_('logout')}</span>
|
||||
</span>
|
||||
</nav>
|
||||
</nav>
|
||||
<div class="ml-0 transition md:ml-60">
|
||||
<slot>
|
||||
<NoComponentLoaded />
|
||||
</slot>
|
||||
</div>
|
||||
<div
|
||||
on:click={() => {
|
||||
navOpen = false;
|
||||
}}
|
||||
class:hidden={!navOpen}
|
||||
class="fixed inset-0 z-10 w-screen h-screen bg-black bg-opacity-25 md:hidden" />
|
||||
</section>
|
@@ -1,74 +0,0 @@
|
||||
<script>
|
||||
import "filepond/dist/filepond.css";
|
||||
import FilePond from "svelte-filepond";
|
||||
import { _ } from "svelte-i18n";
|
||||
let pond;
|
||||
// pond.getFiles() will return the active files
|
||||
// the name to use for the internal file input
|
||||
let name = "filepond";
|
||||
function handleInit() {
|
||||
// console.log("FilePond has initialised");
|
||||
}
|
||||
function handleAddFile(err, fileItem) {
|
||||
// console.log("A file has been added", fileItem);
|
||||
}
|
||||
const labelInvalidField = $_("filepond__field-contains-invalid-files");
|
||||
const labelFileWaitingForSize = $_("filepond__waiting-for-size");
|
||||
const labelFileSizeNotAvailable = $_("filepond__size-not-available");
|
||||
const labelFileLoading = $_("filepond__loading");
|
||||
const labelFileLoadError = $_("filepond__error-during-load");
|
||||
const labelFileProcessing = $_("filepond__uploading");
|
||||
const labelFileProcessingComplete = $_("filepond__upload-complete");
|
||||
const labelFileProcessingAborted = $_("filepond__upload-cancelled");
|
||||
const labelFileProcessingError = $_("filepond__error-during-upload");
|
||||
const labelFileProcessingRevertError = $_("filepond__error-during-revert");
|
||||
const labelFileRemoveError = $_("filepond__error-during-remove");
|
||||
const labelTapToCancel = $_("filepond__tap-to-cancel");
|
||||
const labelTapToRetry = $_("filepond__tap-to-retry");
|
||||
const labelTapToUndo = $_("filepond__tap-to-undo");
|
||||
const labelButtonRemoveItem = $_("filepond__remove");
|
||||
const labelButtonAbortItemLoad = $_("filepond__abort");
|
||||
const labelButtonRetryItemLoad = $_("filepond__retry");
|
||||
const labelButtonAbortItemProcessing = $_("filepond__cancel");
|
||||
const labelButtonUndoItemProcessing = $_("filepond__undo");
|
||||
const labelButtonRetryItemProcessing = $_("filepond__retry");
|
||||
const labelButtonProcessItem = $_("filepond__upload");
|
||||
const labelIdle =
|
||||
$_("drag-and-drop-your-files-or") +
|
||||
` <span class="filepond--label-action"> ` +
|
||||
$_("browse") +
|
||||
` </span>`;
|
||||
</script>
|
||||
|
||||
<div class="app">
|
||||
<FilePond
|
||||
bind:this={pond}
|
||||
{name}
|
||||
{labelFileWaitingForSize}
|
||||
{labelFileSizeNotAvailable}
|
||||
{labelFileLoading}
|
||||
{labelFileLoadError}
|
||||
{labelFileProcessing}
|
||||
{labelFileProcessingComplete}
|
||||
{labelFileProcessingAborted}
|
||||
{labelFileProcessingError}
|
||||
{labelFileProcessingRevertError}
|
||||
{labelFileRemoveError}
|
||||
{labelTapToCancel}
|
||||
{labelTapToRetry}
|
||||
{labelTapToUndo}
|
||||
{labelButtonRemoveItem}
|
||||
{labelButtonAbortItemLoad}
|
||||
{labelButtonRetryItemLoad}
|
||||
{labelButtonAbortItemProcessing}
|
||||
{labelButtonUndoItemProcessing}
|
||||
{labelButtonRetryItemProcessing}
|
||||
{labelButtonProcessItem}
|
||||
{labelIdle}
|
||||
{labelInvalidField}
|
||||
server="/api"
|
||||
allowMultiple={false}
|
||||
credits={false}
|
||||
oninit={handleInit}
|
||||
onaddfile={handleAddFile} />
|
||||
</div>
|
@@ -1,97 +0,0 @@
|
||||
<script>
|
||||
import store from "../store.js";
|
||||
store.init();
|
||||
const login = () => {
|
||||
store.login();
|
||||
};
|
||||
</script>
|
||||
|
||||
<div
|
||||
class="min-h-screen flex items-center justify-center bg-gray-50 py-12 px-4 sm:px-6 lg:px-8">
|
||||
<div class="max-w-md w-full space-y-8">
|
||||
<div>
|
||||
<img
|
||||
class="mx-auto h-12 w-auto"
|
||||
src="/lfk-logo.png"
|
||||
alt="" />
|
||||
<h2 class="mt-6 text-center text-3xl font-extrabold text-gray-900">
|
||||
Sign in to your account
|
||||
</h2>
|
||||
<p class="mt-2 text-center text-sm text-gray-600">
|
||||
Or
|
||||
<a href="#" class="font-medium text-indigo-600 hover:text-indigo-500">
|
||||
start your 14-day free trial
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<input type="hidden" name="remember" value="true" />
|
||||
<div class="rounded-md shadow-sm -space-y-px">
|
||||
<div>
|
||||
<label for="email-address" class="sr-only">Email address</label>
|
||||
<input
|
||||
id="email-address"
|
||||
name="email"
|
||||
type="email"
|
||||
autocomplete="email"
|
||||
required
|
||||
class="appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-t-md focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 focus:z-10 sm:text-sm"
|
||||
placeholder="Email address" />
|
||||
</div>
|
||||
<div>
|
||||
<label for="password" class="sr-only">Password</label>
|
||||
<input
|
||||
id="password"
|
||||
name="password"
|
||||
type="password"
|
||||
autocomplete="current-password"
|
||||
required
|
||||
class="appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 focus:z-10 sm:text-sm"
|
||||
placeholder="Password" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="flex items-center">
|
||||
<input
|
||||
id="remember_me"
|
||||
name="remember_me"
|
||||
type="checkbox"
|
||||
class="h-4 w-4 text-indigo-600 focus:ring-indigo-500 border-gray-300 rounded" />
|
||||
<label for="remember_me" class="ml-2 block text-sm text-gray-900">
|
||||
Remember me
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="text-sm">
|
||||
<a href="#" class="font-medium text-indigo-600 hover:text-indigo-500">
|
||||
Forgot your password?
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button
|
||||
on:click="{login}"
|
||||
type="submit"
|
||||
class="group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
|
||||
<span class="absolute left-0 inset-y-0 flex items-center pl-3">
|
||||
<!-- Heroicon name: lock-closed -->
|
||||
<svg
|
||||
class="h-5 w-5 text-indigo-500 group-hover:text-indigo-400"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 20 20"
|
||||
fill="currentColor"
|
||||
aria-hidden="true">
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
d="M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z"
|
||||
clip-rule="evenodd" />
|
||||
</svg>
|
||||
</span>
|
||||
Sign in
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@@ -1,217 +0,0 @@
|
||||
<script>
|
||||
import { RunnerOrganisationService } from "@odit/lfk-client-js";
|
||||
import { _ } from "svelte-i18n";
|
||||
import Toastify from "toastify-js";
|
||||
import store from "../store";
|
||||
import ConfirmOrgDeletion from "./ConfirmOrgDeletion.svelte";
|
||||
import PromiseError from "./PromiseError.svelte";
|
||||
$: delete_triggered = false;
|
||||
$: save_enabled = !data_changed;
|
||||
export let params;
|
||||
let orgdata = {};
|
||||
let original = {};
|
||||
$: data_loaded = false;
|
||||
$: data_changed = JSON.stringify(orgdata) === JSON.stringify(original);
|
||||
const promise = RunnerOrganisationService.runnerOrganisationControllerGetOne(
|
||||
params.orgid
|
||||
).then((value) => {
|
||||
data_loaded = true;
|
||||
orgdata = Object.assign(orgdata, value);
|
||||
original = Object.assign(original, value);
|
||||
});
|
||||
let modal_open = false;
|
||||
let delete_org = {};
|
||||
function deleteOrganisation() {
|
||||
// RunnerOrganisationService.runnerOrganisationControllerRemove(
|
||||
// original.id,
|
||||
// false
|
||||
// )
|
||||
// .then((resp) => {
|
||||
// Toastify({
|
||||
// text: "Organization deleted",
|
||||
// duration: 500,
|
||||
// backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
|
||||
// }).showToast();
|
||||
// location.replace("./");
|
||||
// })
|
||||
// .catch((err) => {
|
||||
modal_open = true;
|
||||
delete_org = original;
|
||||
// });
|
||||
}
|
||||
function submit() {
|
||||
if (data_loaded === true && save_enabled) {
|
||||
Toastify({
|
||||
text: "updating organization",
|
||||
duration: 2500,
|
||||
}).showToast();
|
||||
RunnerOrganisationService.runnerOrganisationControllerPut(
|
||||
original.id,
|
||||
orgdata
|
||||
)
|
||||
.then((resp) => {
|
||||
Object.assign(original, orgdata);
|
||||
original = orgdata;
|
||||
Object.assign(original, orgdata);
|
||||
//
|
||||
Toastify({
|
||||
text: "updated organization",
|
||||
duration: 2500,
|
||||
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
|
||||
}).showToast();
|
||||
})
|
||||
.catch((err) => {});
|
||||
} else {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<ConfirmOrgDeletion bind:modal_open bind:delete_org />
|
||||
{#if data_loaded}
|
||||
<section class="container p-5">
|
||||
<div class="mb-8 text-3xl font-extrabold leading-tight">
|
||||
{original.name}
|
||||
<span data-id="org_actions_${orgdata.id}">
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('USER:DELETE')}
|
||||
{#if delete_triggered}
|
||||
<button
|
||||
on:click={deleteOrganisation}
|
||||
class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm">{$_('confirm-delete')}</button>
|
||||
<button
|
||||
on:click={() => {
|
||||
delete_triggered = !delete_triggered;
|
||||
}}
|
||||
class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-400 text-base font-medium text-white sm:w-auto sm:text-sm">{$_('cancel')}</button>
|
||||
{/if}
|
||||
{#if !delete_triggered}
|
||||
<button
|
||||
on:click={() => {
|
||||
delete_triggered = true;
|
||||
}}
|
||||
type="button"
|
||||
class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm">{$_('delete-organization')}</button>
|
||||
{/if}
|
||||
{/if}
|
||||
{#if !delete_triggered}
|
||||
<button
|
||||
on:click={submit}
|
||||
disabled={!save_enabled}
|
||||
class:opacity-50={!save_enabled}
|
||||
type="button"
|
||||
class="w-full 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">{$_('save-changes')}</button>
|
||||
{/if}
|
||||
</span>
|
||||
</div>
|
||||
<div class="flex flex-row mb-4">
|
||||
<div class="w-full">
|
||||
<nav class="w-full flex">
|
||||
<ol class="list-none flex flex-row items-center justify-start">
|
||||
<li class="mr-2 flex items-center">
|
||||
<svg
|
||||
stroke="currentColor"
|
||||
fill="none"
|
||||
stroke-width="2"
|
||||
viewBox="0 0 24 24"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
class="h-3 w-3 stroke-current"
|
||||
height="1em"
|
||||
width="1em"
|
||||
xmlns="http://www.w3.org/2000/svg"><path
|
||||
d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" />
|
||||
<polyline points="9 22 9 12 15 12 15 22" /></svg>
|
||||
</li>
|
||||
<li class="flex items-center">
|
||||
<a class="mr-2" href="/">Home</a><svg
|
||||
stroke="currentColor"
|
||||
fill="none"
|
||||
stroke-width="2"
|
||||
viewBox="0 0 24 24"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
class="h-3 w-3 mr-2 stroke-current"
|
||||
height="1em"
|
||||
width="1em"
|
||||
xmlns="http://www.w3.org/2000/svg"><line
|
||||
x1="5"
|
||||
y1="12"
|
||||
x2="19"
|
||||
y2="12" />
|
||||
<polyline points="12 5 19 12 12 19" /></svg>
|
||||
</li>
|
||||
<li class="mr-2 flex items-center">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
width="24"
|
||||
height="24"><path fill="none" d="M0 0h24v24H0z" />
|
||||
<path
|
||||
d="M21 20h2v2H1v-2h2V3a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v17zm-2 0V4H5v16h14zM8 11h3v2H8v-2zm0-4h3v2H8V7zm0 8h3v2H8v-2zm5 0h3v2h-3v-2zm0-4h3v2h-3v-2zm0-4h3v2h-3V7z" /></svg>
|
||||
</li>
|
||||
<li class="flex items-center">
|
||||
<a class="mr-2" href="./">Orgs</a><svg
|
||||
stroke="currentColor"
|
||||
fill="none"
|
||||
stroke-width="2"
|
||||
viewBox="0 0 24 24"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
class="h-3 w-3 mr-2 stroke-current"
|
||||
height="1em"
|
||||
width="1em"
|
||||
xmlns="http://www.w3.org/2000/svg"><line
|
||||
x1="5"
|
||||
y1="12"
|
||||
x2="19"
|
||||
y2="12" />
|
||||
<polyline points="12 5 19 12 12 19" /></svg>
|
||||
</li>
|
||||
<li class="flex items-center">
|
||||
<span class="mr-2">Org-Details #{params.orgid}</span>
|
||||
</li>
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-sm w-full">
|
||||
<label for="name" class="font-medium text-gray-700">Name</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Name"
|
||||
type="text"
|
||||
bind:value={orgdata.name}
|
||||
name="name"
|
||||
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 dark:bg-gray-900 dark:text-gray-100 rounded-md p-2" />
|
||||
</div>
|
||||
<div class="text-sm w-full">
|
||||
<label
|
||||
for="contact"
|
||||
class="font-medium text-gray-700">{$_('contact')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder={$_('contact')}
|
||||
type="text"
|
||||
bind:value={orgdata.contact}
|
||||
name="contact"
|
||||
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 dark:bg-gray-900 dark:text-gray-100 rounded-md p-2" />
|
||||
</div>
|
||||
<div class="text-sm w-full">
|
||||
<label
|
||||
for="address"
|
||||
class="font-medium text-gray-700">{$_('address')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder={$_('address')}
|
||||
type="text"
|
||||
bind:value={orgdata.address}
|
||||
name="address"
|
||||
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 dark:bg-gray-900 dark:text-gray-100 rounded-md p-2" />
|
||||
</div>
|
||||
</section>
|
||||
{:else}
|
||||
{#await promise}
|
||||
organization detail is being loaded...
|
||||
{:catch error}
|
||||
<PromiseError />
|
||||
{/await}
|
||||
{/if}
|
@@ -1,12 +0,0 @@
|
||||
<script>
|
||||
import { _ } from "svelte-i18n";
|
||||
import RunnersEmptyState from "./RunnersEmptyState.svelte";
|
||||
</script>
|
||||
|
||||
<section class="container p-5">
|
||||
<span class="mb-1 text-3xl font-extrabold leading-tight">
|
||||
{$_('runners')}
|
||||
</span>
|
||||
<p class="mb-8 text-lg text-gray-500">läuft bei ihnen</p>
|
||||
</section>
|
||||
<RunnersEmptyState />
|
@@ -1,35 +0,0 @@
|
||||
<script>
|
||||
import { _ } from "svelte-i18n";
|
||||
import FormLayout from "./FormLayout.svelte";
|
||||
</script>
|
||||
|
||||
<div class="pt-12 px-4 sm:px-6 lg:px-8 lg:pt-20 bg-gray-900 pb-12">
|
||||
<div class="text-center mb-8">
|
||||
<h1
|
||||
class="mt-9 font-display text-4xl leading-none font-semibold text-white sm:text-5xl lg:text-6xl">
|
||||
🔨<br />{$_('settings')}
|
||||
</h1>
|
||||
<p
|
||||
class="mt-2 max-w-xl mx-auto text-xl lg:max-w-3xl lg:text-2xl text-gray-300">
|
||||
<span class="text-lg">configure your profile however you want</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pt-0 pb-16 bg-gray-50 overflow-hidden lg:pt-12 lg:py-24">
|
||||
<div class="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8">
|
||||
<!-- <h2 class="text-4xl font-display font-semibold text-gray-900 md:text-5xl">
|
||||
General
|
||||
</h2> -->
|
||||
<div
|
||||
class="max-w-3xl mx-auto text-xl leading-8 font-medium text-gray-900 mb-16">
|
||||
<p class="text-center">
|
||||
Lorem ipsum dolor sit amet consectetur, adipisicing elit. Temporibus et
|
||||
amet voluptate nulla accusantium vero blanditiis nobis facere veritatis.
|
||||
Impedit deserunt saepe aliquid unde consequuntur officia consequatur
|
||||
fugit iusto dolorem?
|
||||
</p>
|
||||
</div>
|
||||
<FormLayout />
|
||||
</div>
|
||||
</div>
|
@@ -1,5 +0,0 @@
|
||||
<script>
|
||||
import { _, locale } from "svelte-i18n";
|
||||
</script>
|
||||
|
||||
<div>$locale $_('hallo')</div>
|
@@ -9,20 +9,15 @@
|
||||
let usersEmail = "";
|
||||
function reset() {
|
||||
if (isEmail(usersEmail)) {
|
||||
AuthService.authControllerGetResetToken({ email: usersEmail })
|
||||
AuthService.authControllerGetResetToken("de", { email: usersEmail })
|
||||
.then((resp) => {
|
||||
console.log(resp);
|
||||
console.log(resp.resetToken);
|
||||
Toastify({
|
||||
text: $_("mail-validation-in-progress"),
|
||||
duration: 3500,
|
||||
}).showToast();
|
||||
reset_mail_sent = true;
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err.body.name);
|
||||
console.log(err.body.message);
|
||||
});
|
||||
.catch((err) => {});
|
||||
} else {
|
||||
Toastify({
|
||||
text: $_("invalid-mail-reset"),
|
||||
@@ -40,9 +35,7 @@
|
||||
{$_('application_name')}
|
||||
</p>
|
||||
<p class="mt-2 mb-2 text-sm text-center text-gray-900">
|
||||
Passwort-Reset Mail wurde an
|
||||
{usersEmail}
|
||||
geschickt
|
||||
{$_('password-reset-mail-sent', { values: { usersEmail: usersEmail } })}
|
||||
</p>
|
||||
<div class="mt-6">
|
||||
<div class="mt-6">
|
||||
@@ -63,7 +56,7 @@
|
||||
{$_('application_name')}
|
||||
</p>
|
||||
<p class="mt-6 text-sm text-center text-gray-900">
|
||||
{$_('forgot_password?')}
|
||||
{$_('forgot_password')}
|
||||
</p>
|
||||
<p class="mt-2 mb-2 text-sm text-center text-gray-900">
|
||||
{$_('dont-panic-were-resetting-it')}
|
@@ -1,14 +1,15 @@
|
||||
<script>
|
||||
import store from "../store.js";
|
||||
import store from "../../store.js";
|
||||
import localForage from "localforage";
|
||||
import { _ } from "svelte-i18n";
|
||||
store.init();
|
||||
import { OpenAPI, AuthService } from "@odit/lfk-client-js";
|
||||
import Footer from "./Footer.svelte";
|
||||
import Footer from "../general/Footer.svelte";
|
||||
import isEmail from "validator/es/lib/isEmail";
|
||||
import Toastify from "toastify-js";
|
||||
// ------
|
||||
let username = "demo";
|
||||
let password = "demo";
|
||||
let username = config.default_username || "";
|
||||
let password = config.default_password || "";
|
||||
let is_blocked_by_autologin = false;
|
||||
let last_loginclick_processed = true;
|
||||
|
||||
@@ -36,10 +37,19 @@
|
||||
text: $_("login_is_checked"),
|
||||
duration: 500,
|
||||
}).showToast();
|
||||
AuthService.authControllerLogin({
|
||||
username,
|
||||
password,
|
||||
})
|
||||
let postdata = {};
|
||||
if (isEmail(username)) {
|
||||
postdata = {
|
||||
email: username,
|
||||
password,
|
||||
};
|
||||
} else {
|
||||
postdata = {
|
||||
username,
|
||||
password,
|
||||
};
|
||||
}
|
||||
AuthService.authControllerLogin(postdata)
|
||||
.then(async (result) => {
|
||||
await localForage.setItem("logindata", result);
|
||||
OpenAPI.TOKEN = result.access_token;
|
||||
@@ -136,7 +146,7 @@
|
||||
<a
|
||||
href="/forgot_password"
|
||||
class="block w-full text-center py-2 px-3 border border-gray-300 rounded-md font-medium hover:border-gray-400 focus:outline-none focus:border-gray-400 sm:text-sm">
|
||||
{$_('forgot_password?')}
|
||||
{$_('forgot_password')}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
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>
|
137
src/components/auth/ResetPassword.svelte
Normal file
137
src/components/auth/ResetPassword.svelte
Normal file
@@ -0,0 +1,137 @@
|
||||
<script>
|
||||
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,
|
||||
})
|
||||
.then((resp) => {
|
||||
Toastify({
|
||||
text: $_("password-reset-successful"),
|
||||
duration: 3500,
|
||||
}).showToast();
|
||||
state = "reset_success";
|
||||
})
|
||||
.catch((err) => {
|
||||
state = "reset_error";
|
||||
});
|
||||
} else {
|
||||
Toastify({
|
||||
text: $_("please-provide-a-password"),
|
||||
duration: 3500,
|
||||
}).showToast();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
{#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="" />
|
||||
<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">
|
||||
{$_('successful-password-reset')}
|
||||
</p>
|
||||
<p class="mt-2 mb-2 text-sm text-center text-gray-900">
|
||||
{$_('you-can-now-use-your-new-password-to-log-in-to-your-account')}
|
||||
</p>
|
||||
<div class="mt-6">
|
||||
<div class="mt-6">
|
||||
<a
|
||||
href="/login/"
|
||||
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">
|
||||
{$_('go-to-login')}
|
||||
</a>
|
||||
</div>
|
||||
</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">
|
||||
<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>
|
||||
{: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="" />
|
||||
<p class="mt-6 text-lg text-center font-bold text-gray-900">
|
||||
{$_('application_name')}
|
||||
</p>
|
||||
<p class="mt-2 mb-4 text-md text-center text-gray-900">
|
||||
{$_('reset-password')}
|
||||
</p>
|
||||
<div>
|
||||
<div class="rounded-md shadow-sm">
|
||||
<div>
|
||||
<input
|
||||
aria-label={$_('new-password')}
|
||||
name="password"
|
||||
type="password"
|
||||
required=""
|
||||
class="border-gray-300 placeholder-gray-500 appearance-none rounded-md relative block w-full px-3 py-2 border text-gray-900 focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-sm"
|
||||
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">
|
||||
<svg
|
||||
class="h-5 w-5 text-gray-500"
|
||||
fill="currentColor"
|
||||
viewBox="0 0 20 20">
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
d="M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z"
|
||||
clip-rule="evenodd" />
|
||||
</svg>
|
||||
</span>
|
||||
{$_('reset-my-password')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
@@ -7,12 +7,12 @@
|
||||
<div class="w-full bg-white flex items-center justify-center ">
|
||||
<div class="max-w-sm m-8">
|
||||
<div class="text-black text-5xl md:text-15xl font-black">
|
||||
Internal Error
|
||||
{$_('internal-error')}
|
||||
</div>
|
||||
<div class="w-16 h-1 bg-purple-light my-3 md:my-6" />
|
||||
<p
|
||||
class="text-grey-darker text-2xl md:text-3xl font-light mb-8 leading-normal">
|
||||
Something went wrong in the UI logic
|
||||
{$_('generic-ui-logic-error')}
|
||||
</p>
|
||||
<a
|
||||
href="/"
|
1
src/components/base/simple.css
Normal file
1
src/components/base/simple.css
Normal file
File diff suppressed because one or more lines are too long
240
src/components/cards/AddCardBulkModal.svelte
Normal file
240
src/components/cards/AddCardBulkModal.svelte
Normal file
@@ -0,0 +1,240 @@
|
||||
<script>
|
||||
import { _ } from "svelte-i18n";
|
||||
import { clickOutside } from "../base/outsideclick";
|
||||
import { focusTrap } from "svelte-focus-trap";
|
||||
import { RunnerCardService } from "@odit/lfk-client-js";
|
||||
import Toastify from "toastify-js";
|
||||
export let bulk_modal_open;
|
||||
export let current_cards;
|
||||
function focus(el) {
|
||||
el.focus();
|
||||
}
|
||||
$: card_count = 0;
|
||||
$: is_card_count_valid = card_count > 0;
|
||||
$: processed_last_submit = true;
|
||||
$: createbtnenabled = is_card_count_valid;
|
||||
(() => {
|
||||
document.onkeydown = (e) => {
|
||||
e = e || window.event;
|
||||
if (e.key === "Escape") {
|
||||
bulk_modal_open = false;
|
||||
}
|
||||
if (e.keyCode === 13) {
|
||||
if (createbtnenabled === true) {
|
||||
createbtnenabled = false;
|
||||
submit_with_print();
|
||||
}
|
||||
}
|
||||
};
|
||||
})();
|
||||
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, false)
|
||||
.then((result) => {
|
||||
bulk_modal_open = false;
|
||||
//
|
||||
Toastify({
|
||||
text: $_("created-blanco-cards"),
|
||||
duration: 500,
|
||||
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
|
||||
}).showToast();
|
||||
})
|
||||
.catch((err) => {
|
||||
//
|
||||
})
|
||||
.finally(() => {
|
||||
processed_last_submit = true;
|
||||
//
|
||||
toast.hideToast();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
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}
|
||||
<div
|
||||
class="fixed z-10 inset-0 overflow-y-auto"
|
||||
use:focusTrap
|
||||
use:clickOutside
|
||||
on:click_outside={() => {
|
||||
bulk_modal_open = false;
|
||||
}}>
|
||||
<div
|
||||
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="absolute inset-0 bg-gray-500 opacity-75"
|
||||
data-id="modal_backdrop" />
|
||||
</div>
|
||||
<span
|
||||
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-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- 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"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
width="24"
|
||||
height="24"><path fill="none" d="M0 0h24v24H0z" />
|
||||
<path
|
||||
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>
|
||||
</div>
|
||||
<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">
|
||||
{$_('create-bulk-blanco-cards')}
|
||||
</h3>
|
||||
<div class="mt-2 mb-6">
|
||||
<p class="text-sm text-gray-500">
|
||||
{$_('just-enter-how-many-you-want-and-the-system-will-create-them')}
|
||||
</p>
|
||||
</div>
|
||||
<div class="grid grid-cols-6 gap-6">
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="amount"
|
||||
class="block text-sm font-medium text-gray-700">{$_('amount')}</label>
|
||||
<div class="mt-1 flex rounded-md shadow-sm">
|
||||
<input
|
||||
autocomplete="off"
|
||||
class:border-red-500={!is_card_count_valid}
|
||||
class:focus:border-red-500={!is_card_count_valid}
|
||||
class:focus:ring-red-500={!is_card_count_valid}
|
||||
bind:value={card_count}
|
||||
type="number"
|
||||
step="1"
|
||||
name="amount"
|
||||
class="focus:ring-indigo-500 focus:border-indigo-500 flex-1 block w-full rounded-none rounded-l-md sm:text-sm border-gray-300 border bg-gray-50 text-gray-500 p-2"
|
||||
placeholder="400" />
|
||||
<span
|
||||
class="inline-flex items-center px-3 rounded-r-md border border-gray-300 bg-gray-50 text-gray-500 text-sm">{$_('cards')}</span>
|
||||
</div>
|
||||
{#if !is_card_count_valid}
|
||||
<span
|
||||
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
|
||||
{$_('you-must-create-at-least-one-card-or-cancel')}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse">
|
||||
<button
|
||||
disabled={!createbtnenabled}
|
||||
class:opacity-50={!createbtnenabled}
|
||||
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-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="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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
@@ -1,162 +1,170 @@
|
||||
<script>
|
||||
import { _ } from "svelte-i18n";
|
||||
import { clickOutside } from "./outsideclick";
|
||||
import { focusTrap } from "svelte-focus-trap";
|
||||
import { RunnerOrganisationService } from "@odit/lfk-client-js";
|
||||
import Toastify from "toastify-js";
|
||||
export let modal_open;
|
||||
export let current_organizations;
|
||||
let name_input_dom;
|
||||
function focus(el) {
|
||||
el.focus();
|
||||
}
|
||||
$: name = "";
|
||||
$: processed_last_submit = true;
|
||||
$: isOrgnameValid = name.trim().length !== 0;
|
||||
$: createbtnenabled = isOrgnameValid;
|
||||
(() => {
|
||||
document.onkeydown = (e) => {
|
||||
e = e || window.event;
|
||||
if (e.key === "Escape") {
|
||||
modal_open = false;
|
||||
}
|
||||
if (e.keyCode === 13) {
|
||||
if (createbtnenabled === true) {
|
||||
createbtnenabled = false;
|
||||
submit();
|
||||
}
|
||||
}
|
||||
};
|
||||
})();
|
||||
function submit() {
|
||||
if (processed_last_submit === true) {
|
||||
processed_last_submit = false;
|
||||
const toast = Toastify({
|
||||
text: "Organization is being added...",
|
||||
duration: -1,
|
||||
}).showToast();
|
||||
RunnerOrganisationService.runnerOrganisationControllerPost({
|
||||
name,
|
||||
address: undefined,
|
||||
contact: undefined,
|
||||
})
|
||||
.then((result) => {
|
||||
console.log(result);
|
||||
name = "";
|
||||
modal_open = false;
|
||||
//
|
||||
Toastify({
|
||||
text: "Organization added",
|
||||
duration: 500,
|
||||
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
|
||||
}).showToast();
|
||||
current_organizations = current_organizations.concat([result]);
|
||||
})
|
||||
.catch((err) => {
|
||||
//
|
||||
})
|
||||
.finally(() => {
|
||||
processed_last_submit = true;
|
||||
//
|
||||
toast.hideToast();
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if modal_open}
|
||||
<div
|
||||
class="fixed z-10 inset-0 overflow-y-auto"
|
||||
use:focusTrap
|
||||
use:clickOutside
|
||||
on:click_outside={() => {
|
||||
modal_open = false;
|
||||
}}>
|
||||
<div
|
||||
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="absolute inset-0 bg-gray-500 opacity-75"
|
||||
data-id="modal_backdrop" />
|
||||
</div>
|
||||
<span
|
||||
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 overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg 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">
|
||||
<svg
|
||||
class="h-6 w-6 text-blue-600"
|
||||
fill="currentColor"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
width="24"
|
||||
height="24"><path
|
||||
d="M17 19h2v-8h-6v8h2v-6h2v6zM3 19V4a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v5h2v10h1v2H2v-2h1zm4-8v2h2v-2H7zm0 4v2h2v-2H7zm0-8v2h2V7H7z" /></svg>
|
||||
</div>
|
||||
<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">
|
||||
Create a new Organization
|
||||
</h3>
|
||||
<div class="mt-2 mb-6">
|
||||
<p class="text-sm text-gray-500">
|
||||
Please provide the required information to add a new
|
||||
organization.
|
||||
</p>
|
||||
</div>
|
||||
<div class="grid grid-cols-6 gap-6">
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="firstname"
|
||||
class="block text-sm font-medium text-gray-700">Name</label>
|
||||
<input
|
||||
use:focus
|
||||
autocomplete="off"
|
||||
placeholder="Name"
|
||||
class:border-red-500={!isOrgnameValid}
|
||||
class:focus:border-red-500={!isOrgnameValid}
|
||||
class:focus:ring-red-500={!isOrgnameValid}
|
||||
bind:value={name}
|
||||
bind:this={name_input_dom}
|
||||
type="text"
|
||||
name="firstname"
|
||||
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 !isOrgnameValid}
|
||||
<span
|
||||
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
|
||||
Organization name is required
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse">
|
||||
<button
|
||||
disabled={!createbtnenabled}
|
||||
class:opacity-50={!createbtnenabled}
|
||||
on:click={submit}
|
||||
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')}
|
||||
</button>
|
||||
<button
|
||||
on:click={() => {
|
||||
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">
|
||||
{$_('cancel')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
<script>
|
||||
import { _ } from "svelte-i18n";
|
||||
import { clickOutside } from "../base/outsideclick";
|
||||
import { focusTrap } from "svelte-focus-trap";
|
||||
import {
|
||||
RunnerCardService,
|
||||
RunnerService,
|
||||
ScanService,
|
||||
} from "@odit/lfk-client-js";
|
||||
import Select from "svelte-select";
|
||||
import Toastify from "toastify-js";
|
||||
export let modal_open;
|
||||
export let current_cards;
|
||||
const getRunnerLabel = (option) =>
|
||||
option.firstname + " " + (option.middlename || "") + " " + option.lastname;
|
||||
const filterRunners = (label, filterText, option) =>
|
||||
label.toLowerCase().includes(filterText.toLowerCase()) ||
|
||||
option.value.toString().startsWith(filterText.toLowerCase());
|
||||
function focus(el) {
|
||||
el.focus();
|
||||
}
|
||||
$: runner = 0;
|
||||
$: runners = [];
|
||||
$: enabled = true;
|
||||
$: processed_last_submit = true;
|
||||
RunnerService.runnerControllerGetAll().then((val) => {
|
||||
runners = val.map((r) => {
|
||||
return { label: getRunnerLabel(r), value: r };
|
||||
});
|
||||
});
|
||||
$: createbtnenabled = true;
|
||||
(() => {
|
||||
document.onkeydown = (e) => {
|
||||
e = e || window.event;
|
||||
if (e.key === "Escape") {
|
||||
modal_open = false;
|
||||
}
|
||||
if (e.keyCode === 13) {
|
||||
if (createbtnenabled === true) {
|
||||
createbtnenabled = false;
|
||||
submit();
|
||||
}
|
||||
}
|
||||
};
|
||||
})();
|
||||
function submit() {
|
||||
if (processed_last_submit === true) {
|
||||
processed_last_submit = false;
|
||||
const toast = Toastify({
|
||||
text: $_("adding-card"),
|
||||
duration: -1,
|
||||
}).showToast();
|
||||
let postdata = {
|
||||
runner,
|
||||
enabled,
|
||||
};
|
||||
RunnerCardService.runnerCardControllerPost(postdata)
|
||||
.then((result) => {
|
||||
runner = 0;
|
||||
modal_open = false;
|
||||
//
|
||||
Toastify({
|
||||
text: $_("card-added"),
|
||||
duration: 500,
|
||||
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
|
||||
}).showToast();
|
||||
current_cards.push(result);
|
||||
current_cards = current_cards;
|
||||
})
|
||||
.catch((err) => {
|
||||
//
|
||||
})
|
||||
.finally(() => {
|
||||
processed_last_submit = true;
|
||||
//
|
||||
toast.hideToast();
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if modal_open}
|
||||
<div
|
||||
class="fixed z-10 inset-0 overflow-y-auto"
|
||||
use:focusTrap
|
||||
use:clickOutside
|
||||
on:click_outside={() => {
|
||||
modal_open = false;
|
||||
}}>
|
||||
<div
|
||||
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="absolute inset-0 bg-gray-500 opacity-75"
|
||||
data-id="modal_backdrop" />
|
||||
</div>
|
||||
<span
|
||||
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"
|
||||
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">
|
||||
<svg
|
||||
class="h-6 w-6 text-blue-600"
|
||||
fill="currentColor"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
width="24"
|
||||
height="24"><path fill="none" d="M0 0h24v24H0z" />
|
||||
<path
|
||||
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>
|
||||
</div>
|
||||
<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">
|
||||
{$_('create-a-new-card')}
|
||||
</h3>
|
||||
<div class="mt-2 mb-6">
|
||||
<p class="text-sm text-gray-500">
|
||||
{$_('you-can-provide-a-runner-but-you-dont-have-to')}
|
||||
{$_('if-you-want-to-create-multiple-blanco-cards-try-the-add-bulk-button')}
|
||||
</p>
|
||||
</div>
|
||||
<div class="grid grid-cols-6 gap-6">
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="donor"
|
||||
class="block text-sm font-medium text-gray-700">{$_('runner')}</label>
|
||||
<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"
|
||||
itemFilter={(label, filterText, option) => filterRunners(label, filterText, option)}
|
||||
items={runners}
|
||||
showChevron={true}
|
||||
placeholder={$_('search-for-runner-by-name-or-id')}
|
||||
noOptionsMessage={$_('no-runners-found')}
|
||||
on:select={(selectedValue) => (runner = selectedValue.detail.value.id)}
|
||||
on:clear={() => (runner = null)} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse">
|
||||
<button
|
||||
disabled={!createbtnenabled}
|
||||
class:opacity-50={!createbtnenabled}
|
||||
on:click={submit}
|
||||
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')}
|
||||
</button>
|
||||
<button
|
||||
on:click={() => {
|
||||
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">
|
||||
{$_('cancel')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
186
src/components/cards/CardDetailModal.svelte
Normal file
186
src/components/cards/CardDetailModal.svelte
Normal file
@@ -0,0 +1,186 @@
|
||||
<script>
|
||||
import { _ } from "svelte-i18n";
|
||||
import { clickOutside } from "../base/outsideclick";
|
||||
import { focusTrap } from "svelte-focus-trap";
|
||||
import { RunnerCardService, RunnerService } from "@odit/lfk-client-js";
|
||||
import Select from "svelte-select";
|
||||
import Toastify from "toastify-js";
|
||||
export let edit_modal_open;
|
||||
export let current_cards;
|
||||
export let runner = {};
|
||||
export let editable = {};
|
||||
export let original_data = {};
|
||||
const getRunnerLabel = (option) =>
|
||||
option.firstname + " " + (option.middlename || "") + " " + option.lastname;
|
||||
const filterRunners = (label, filterText, option) =>
|
||||
label.toLowerCase().includes(filterText.toLowerCase()) ||
|
||||
option.value.toString().startsWith(filterText.toLowerCase());
|
||||
function focus(el) {
|
||||
el.focus();
|
||||
}
|
||||
$: runners = [];
|
||||
$: enabled = true;
|
||||
$: processed_last_submit = true;
|
||||
RunnerService.runnerControllerGetAll().then((val) => {
|
||||
runners = val.map((r) => {
|
||||
return { label: getRunnerLabel(r), value: r };
|
||||
});
|
||||
});
|
||||
$: createbtnenabled = !(
|
||||
JSON.stringify(editable) === JSON.stringify(original_data)
|
||||
);
|
||||
(() => {
|
||||
document.onkeydown = (e) => {
|
||||
e = e || window.event;
|
||||
if (e.key === "Escape") {
|
||||
edit_modal_open = false;
|
||||
}
|
||||
if (e.keyCode === 13) {
|
||||
if (createbtnenabled === true) {
|
||||
createbtnenabled = false;
|
||||
submit();
|
||||
}
|
||||
}
|
||||
};
|
||||
})();
|
||||
function submit() {
|
||||
if (processed_last_submit === true) {
|
||||
processed_last_submit = false;
|
||||
const toast = Toastify({
|
||||
text: $_("updating-card"),
|
||||
duration: -1,
|
||||
}).showToast();
|
||||
RunnerCardService.runnerCardControllerPut(original_data.id, editable)
|
||||
.then((result) => {
|
||||
let id = original_data.id;
|
||||
runner = {};
|
||||
editable = {};
|
||||
original_data = {};
|
||||
edit_modal_open = false;
|
||||
//
|
||||
Toastify({
|
||||
text: $_("card-updated"),
|
||||
duration: 500,
|
||||
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
|
||||
}).showToast();
|
||||
current_cards[current_cards.findIndex((c) => c.id === id)] = result;
|
||||
current_cards = current_cards;
|
||||
})
|
||||
.catch((err) => {
|
||||
//
|
||||
})
|
||||
.finally(() => {
|
||||
processed_last_submit = true;
|
||||
//
|
||||
toast.hideToast();
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if edit_modal_open}
|
||||
<div
|
||||
class="fixed z-10 inset-0 overflow-y-auto"
|
||||
use:focusTrap
|
||||
use:clickOutside
|
||||
on:click_outside={() => {
|
||||
edit_modal_open = false;
|
||||
}}>
|
||||
<div
|
||||
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="absolute inset-0 bg-gray-500 opacity-75"
|
||||
data-id="modal_backdrop" />
|
||||
</div>
|
||||
<span
|
||||
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"
|
||||
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">
|
||||
<svg
|
||||
class="h-6 w-6 text-blue-600"
|
||||
fill="currentColor"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
width="24"
|
||||
height="24"><path fill="none" d="M0 0h24v24H0z" />
|
||||
<path
|
||||
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>
|
||||
</div>
|
||||
<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">
|
||||
{$_('edit-a-card')}
|
||||
</h3>
|
||||
<div class="mt-2 mb-6">
|
||||
<p class="text-sm text-gray-500">
|
||||
{$_('you-can-provide-a-runner-but-you-dont-have-to')}
|
||||
</p>
|
||||
</div>
|
||||
<div class="grid grid-cols-6 gap-6">
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="runner"
|
||||
class="block text-sm font-medium text-gray-700">{$_('runner')}</label>
|
||||
<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"
|
||||
itemFilter={(label, filterText, option) => filterRunners(label, filterText, option)}
|
||||
items={runners}
|
||||
showChevron={true}
|
||||
placeholder={$_('search-for-runner-by-name-or-id')}
|
||||
noOptionsMessage={$_('no-runners-found')}
|
||||
bind:selectedValue={runner}
|
||||
on:select={(selectedValue) => (editable.runner = selectedValue.detail.value.id)}
|
||||
on:clear={() => (editable.runner = null)} />
|
||||
</div>
|
||||
<div class="col-span-6">
|
||||
<p class="text-gray-500">
|
||||
<input
|
||||
id="enabled"
|
||||
on:change={() => {
|
||||
editable.enabled = !editable.enabled;
|
||||
}}
|
||||
name="enabled"
|
||||
type="checkbox"
|
||||
checked={editable.enabled}
|
||||
class="focus:ring-indigo-500 h-4 w-4 text-indigo-600 border-gray-300 rounded" />
|
||||
{$_('this-card-is')}
|
||||
{#if editable.enabled}
|
||||
{$_('enabled')}
|
||||
{:else}{$_('disabled')}{/if}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse">
|
||||
<button
|
||||
disabled={!createbtnenabled}
|
||||
class:opacity-50={!createbtnenabled}
|
||||
on:click={submit}
|
||||
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">
|
||||
{$_('save-changes')}
|
||||
</button>
|
||||
<button
|
||||
on:click={() => {
|
||||
edit_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">
|
||||
{$_('cancel')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
40
src/components/cards/Cards.svelte
Normal file
40
src/components/cards/Cards.svelte
Normal file
@@ -0,0 +1,40 @@
|
||||
<script>
|
||||
import { _ } from "svelte-i18n";
|
||||
import store from "../../store";
|
||||
import AddCardBulkModal from "./AddCardBulkModal.svelte";
|
||||
import AddCardModal from "./AddCardModal.svelte";
|
||||
import CardsOverview from "./CardsOverview.svelte";
|
||||
$: current_cards = [];
|
||||
export let modal_open = false;
|
||||
export let bulk_modal_open = false;
|
||||
</script>
|
||||
|
||||
<section class="container p-5">
|
||||
<span class="mb-1 text-3xl font-extrabold leading-tight">
|
||||
{$_('cards')}
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('CARD:CREATE')}
|
||||
<button
|
||||
on:click={() => {
|
||||
modal_open = true;
|
||||
}}
|
||||
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">
|
||||
{$_('add-card')}
|
||||
</button>
|
||||
<button
|
||||
on:click={() => {
|
||||
bulk_modal_open = true;
|
||||
}}
|
||||
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-bulk-cards')}
|
||||
</button>
|
||||
{/if}
|
||||
</span>
|
||||
<CardsOverview bind:current_cards />
|
||||
</section>
|
||||
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('CARD:CREATE')}
|
||||
<AddCardModal bind:current_cards bind:modal_open />
|
||||
<AddCardBulkModal bind:current_cards bind:bulk_modal_open />
|
||||
{/if}
|
12
src/components/cards/CardsEmptyState.svelte
Normal file
12
src/components/cards/CardsEmptyState.svelte
Normal file
@@ -0,0 +1,12 @@
|
||||
<script>
|
||||
import { _ } from "svelte-i18n";
|
||||
import cards_empty from "./cards.svg";
|
||||
</script>
|
||||
|
||||
<div class="text-center items-center justify-center">
|
||||
<p class="mb-16 text-lg text-gray-500">
|
||||
<img class="m-auto" style="height:15rem" src={cards_empty} alt="" />
|
||||
<span class="font-bold">{$_('there-are-no-cards-yet')}</span><br />
|
||||
<span>{$_('add-your-first-card')}</span>
|
||||
</p>
|
||||
</div>
|
237
src/components/cards/CardsOverview.svelte
Normal file
237
src/components/cards/CardsOverview.svelte
Normal file
@@ -0,0 +1,237 @@
|
||||
<script>
|
||||
import { getLocaleFromNavigator, json, _ } from "svelte-i18n";
|
||||
import { RunnerCardService } from "@odit/lfk-client-js";
|
||||
import store from "../../store";
|
||||
import Toastify from "toastify-js";
|
||||
import CardsEmptyState from "./CardsEmptyState.svelte";
|
||||
import CardDetailModal from "./CardDetailModal.svelte";
|
||||
import GenerateRunnerCards from "../pdf_generation/GenerateRunnerCards.svelte";
|
||||
export let edit_modal_open = false;
|
||||
export let runner = {};
|
||||
export let editable = {};
|
||||
export let original_data = {};
|
||||
export let current_cards = [];
|
||||
$: searchvalue = "";
|
||||
$: active_deletes = [];
|
||||
$: cards_show = current_cards.some(
|
||||
(r) => r.is_selected === true
|
||||
);
|
||||
$: generate_cards = current_cards.filter((r) => r.is_selected === true);
|
||||
const cards_promise = RunnerCardService.runnerCardControllerGetAll().then(
|
||||
(val) => {
|
||||
current_cards = val;
|
||||
}
|
||||
);
|
||||
function should_display_based_on_id(id) {
|
||||
if (searchvalue.toString().slice(-1) === "*") {
|
||||
return id.toString().startsWith(searchvalue.replace("*", ""));
|
||||
}
|
||||
return id.toString() === searchvalue;
|
||||
}
|
||||
const getRunnerLabel = (option) =>
|
||||
option?.firstname + " " + (option?.middlename || "") + " " + (option?.lastname || "{$_('non-blanko')}");
|
||||
function open_edit_modal(card) {
|
||||
if(card.runner?.id){
|
||||
runner = Object.assign(
|
||||
{ runner },
|
||||
{ label: getRunnerLabel(card.runner), value: card.runner }
|
||||
);
|
||||
card.runner = card.runner.id;
|
||||
}
|
||||
else{
|
||||
card.runner=null;
|
||||
runner = null
|
||||
}
|
||||
editable = Object.assign(editable, card);
|
||||
original_data = Object.assign(original_data, card);
|
||||
edit_modal_open = true;
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('CARD:UPDATE')}
|
||||
<CardDetailModal
|
||||
bind:current_cards
|
||||
bind:edit_modal_open
|
||||
bind:runner
|
||||
bind:editable
|
||||
bind:original_data />
|
||||
{/if}
|
||||
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('CARD:GET')}
|
||||
{#await cards_promise}
|
||||
<div
|
||||
class="bg-teal-lightest border-t-4 border-teal rounded-b text-teal-darkest px-4 py-3 shadow-md my-2"
|
||||
role="alert">
|
||||
<p class="font-bold">{$_('loading-cards')}</p>
|
||||
<p class="text-sm">{$_('this-might-take-a-moment')}</p>
|
||||
</div>
|
||||
{:then}
|
||||
{#if current_cards.length === 0}
|
||||
<CardsEmptyState />
|
||||
{:else}
|
||||
<input
|
||||
type="search"
|
||||
bind:value={searchvalue}
|
||||
placeholder={$_('datatable.search')}
|
||||
aria-label={$_('datatable.search')}
|
||||
class="gridjs-input gridjs-search-input mb-4" />
|
||||
<div class="h-12">
|
||||
<GenerateRunnerCards
|
||||
bind:cards_show
|
||||
bind:generate_cards />
|
||||
</div>
|
||||
<div
|
||||
class="shadow border-b border-gray-200 sm:rounded-lg overflow-x-scroll">
|
||||
<table class="divide-y divide-gray-200 w-full">
|
||||
<thead class="bg-gray-50">
|
||||
<tr>
|
||||
<th
|
||||
scope="col"
|
||||
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
||||
<span
|
||||
on:click={() => {
|
||||
const newstate = !current_cards.some((r) => r.is_selected === true);
|
||||
current_cards = current_cards.map((r) => {
|
||||
r.is_selected = newstate;
|
||||
return r;
|
||||
});
|
||||
}}
|
||||
class="underline cursor-pointer select-none">{#if current_cards.some((r) => r.is_selected === true)}
|
||||
{$_('deselect-all')}
|
||||
{:else}{$_('select-all')}{/if}
|
||||
</span>
|
||||
</th>
|
||||
<th
|
||||
scope="col"
|
||||
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
||||
{$_('code')}
|
||||
</th>
|
||||
<th
|
||||
scope="col"
|
||||
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
||||
{$_('runner')}
|
||||
</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>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-200">
|
||||
{#each current_cards as card}
|
||||
{#if card.code
|
||||
.toLowerCase()
|
||||
.includes(
|
||||
searchvalue.toLowerCase()
|
||||
) || card.runner?.firstname
|
||||
.toLowerCase()
|
||||
.includes(
|
||||
searchvalue.toLowerCase()
|
||||
) || card.runner?.middlename
|
||||
.toLowerCase()
|
||||
.includes(
|
||||
searchvalue.toLowerCase()
|
||||
) || card.runner?.lastname
|
||||
.toLowerCase()
|
||||
.includes(
|
||||
searchvalue.toLowerCase()
|
||||
) || should_display_based_on_id(card.id)}
|
||||
<tr data-rowid="card_{card.id}">
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
<input
|
||||
bind:checked={card.is_selected}
|
||||
type="checkbox"
|
||||
class="focus:ring-indigo-500 h-4 w-4 text-indigo-600 border-gray-300 rounded" />
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
<div class="flex items-center">{card.code}</div>
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
<div class="flex items-center">
|
||||
{#if card.runner}
|
||||
<a
|
||||
href="../runners/{card.runner.id}"
|
||||
class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-gray-100 text-gray-800">{card.runner.firstname}
|
||||
{card.runner.middlename || ''}
|
||||
{card.runner.lastname}</a>
|
||||
{:else}{$_('non-blanko')}{/if}
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
<div class="flex items-center">
|
||||
{#if card.enabled}
|
||||
<span
|
||||
class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">{$_('enabled')}</span>
|
||||
{:else}
|
||||
<span
|
||||
class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-red-100 text-red-800">{$_('disabled')}</span>
|
||||
{/if}
|
||||
</div>
|
||||
</td>
|
||||
|
||||
{#if active_deletes[card.id] === true}
|
||||
<td
|
||||
class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
|
||||
<button
|
||||
on:click={() => {
|
||||
active_deletes[card.id] = false;
|
||||
}}
|
||||
tabindex="0"
|
||||
class="ml-4 text-indigo-600 hover:text-indigo-900 cursor-pointer">{$_('cancel-delete')}</button>
|
||||
<button
|
||||
on:click={() => {
|
||||
RunnerCardService.runnerCardControllerRemove(card.id, false).then(
|
||||
(resp) => {
|
||||
current_cards = current_cards.filter(
|
||||
(obj) => obj.id !== card.id
|
||||
);
|
||||
Toastify({
|
||||
text: $_('card-deleted'),
|
||||
duration: 500,
|
||||
backgroundColor:
|
||||
'linear-gradient(to right, #00b09b, #96c93d)',
|
||||
}).showToast();
|
||||
}
|
||||
);
|
||||
}}
|
||||
tabindex="0"
|
||||
class="ml-4 text-red-600 hover:text-red-900 cursor-pointer">{$_('confirm-delete')}</button>
|
||||
</td>
|
||||
{:else}
|
||||
<td
|
||||
class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
|
||||
<button
|
||||
on:click={() => {
|
||||
open_edit_modal(card);
|
||||
}}
|
||||
class="text-indigo-600 hover:text-indigo-900">{$_('details')}</button>
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('CARD:DELETE')}
|
||||
<button
|
||||
on:click={() => {
|
||||
active_deletes[card.id] = true;
|
||||
}}
|
||||
tabindex="0"
|
||||
class="ml-4 text-red-600 hover:text-red-900 cursor-pointer">{$_('delete')}</button>
|
||||
{/if}
|
||||
</td>
|
||||
{/if}
|
||||
</tr>
|
||||
{/if}
|
||||
{/each}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{/if}
|
||||
{:catch error}
|
||||
<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">
|
||||
<b class="capitalize">{$_('general_promise_error')}</b>
|
||||
{error}
|
||||
</span>
|
||||
</div>
|
||||
{/await}
|
||||
{/if}
|
1
src/components/cards/cards.svg
Normal file
1
src/components/cards/cards.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 653.9 247.6"><path d="M272 211l-53 12s-11-2-1-17l4-4 27-14v-2l-6-41-2-16 17-17 4-3 44 41v1l-19 33z" fill="#ffb7b7"/><path d="M253 198l-54 13a6 6 0 01-5-7 16 16 0 012-5 48 48 0 016-9l28-14-4-24-1-12-2-8-2-16 21-19 22 21 22 20-3 5-3 7-17 30-3 6z" fill="#ffb7b7"/><path d="M346 190s-20-1-28-15a24 24 0 01-3-14l-8-17-11-23-30-4-2 1-21 19-7 6-10 9-49 44a37 37 0 01-7 9 50 50 0 01-9 7c-10 5-24 9-44 7L10 248 0 176l89-29 131-86 89 23 41 58z" fill="#ffb7b7"/><path d="M648 0H275a5 5 0 00-5 5v221a5 5 0 005 6h373a5 5 0 006-6V5a5 5 0 00-6-5z" fill="#fff"/><path d="M648 0H275a5 5 0 00-5 5v221a5 5 0 005 6h373a5 5 0 006-6V5a5 5 0 00-6-5zm4 226a4 4 0 01-4 4H275a4 4 0 01-3-4V5a4 4 0 013-3h373a4 4 0 014 3z" fill="#3f3d56"/><path d="M312 30a9 9 0 119-9 9 9 0 01-9 9zm0-17a8 8 0 107 8 8 8 0 00-7-8z" fill="#6c63ff"/><path d="M297 21a8 8 0 016-8 8 8 0 100 16 8 8 0 01-6-8zM349 130a7 7 0 01-7-7v-20a7 7 0 0114 0v20a7 7 0 01-7 7zM368 130a7 7 0 01-7-7v-20a7 7 0 0114 0v20a7 7 0 01-7 7zM386 130a7 7 0 01-7-7v-20a7 7 0 0114 0v20a7 7 0 01-7 7zM415 130a7 7 0 01-7-7v-20a7 7 0 0114 0v20a7 7 0 01-7 7zM434 130a7 7 0 01-7-7v-20a7 7 0 0113 0v20a7 7 0 01-6 7zM452 130a7 7 0 01-7-7v-20a7 7 0 0114 0v20a7 7 0 01-7 7zM481 130a7 7 0 01-7-7v-20a7 7 0 0114 0v20a7 7 0 01-7 7zM499 130a7 7 0 01-7-7v-20a7 7 0 0114 0v20a7 7 0 01-7 7zM518 130a7 7 0 01-7-7v-20a7 7 0 0114 0v20a7 7 0 01-7 7zM546 130a7 7 0 01-7-7v-20a7 7 0 0114 0v20a7 7 0 01-7 7zM565 130a7 7 0 01-7-7v-20a7 7 0 0114 0v20a7 7 0 01-7 7zM583 130a7 7 0 01-7-7v-20a7 7 0 0114 0v20a7 7 0 01-7 7z" fill="#6c63ff"/><path d="M396 208h-99a5 5 0 110-10h99a5 5 0 010 10zM364 188h-35a5 5 0 110-10h35a5 5 0 110 10z" fill="#e6e6e6"/><path fill="#3f3d56" d="M271 46h381v2H271z"/><path opacity=".1" d="M228 203l-1-2 33-15 8-27-12-10 1-1 13 10-8 30-34 15zM196 199l-9 4-17 2a50 50 0 01-9 7l-16-1-26-1 88-74 18 4-29 59z"/><path d="M318 175l-8 1-47 4-29 1-38 18-9 4-70 8 95-81 11 2 20 5 22 5 18 1 24 1 20 1a13 13 0 0112 13c0 7-5 14-21 17z" fill="#ffb7b7"/><path d="M325 170s-7-2-9-9c-2-4-1-9 3-15l1 1c-3 6-4 10-3 14 2 5 9 7 9 7zM197 197l34-16v2l-33 16zM218 135l48-19v2l-41 16 35 6v2l-42-7z" opacity=".1"/></svg>
|
After Width: | Height: | Size: 2.1 KiB |
436
src/components/contacts/AddContactModal.svelte
Normal file
436
src/components/contacts/AddContactModal.svelte
Normal file
@@ -0,0 +1,436 @@
|
||||
<script>
|
||||
import { _ } from "svelte-i18n";
|
||||
import { clickOutside } from "../base/outsideclick";
|
||||
import { focusTrap } from "svelte-focus-trap";
|
||||
import {
|
||||
GroupContactService,
|
||||
RunnerTeamService,
|
||||
RunnerOrganizationService,
|
||||
} from "@odit/lfk-client-js";
|
||||
import isEmail from "validator/es/lib/isEmail";
|
||||
import isMobilePhone from "validator/es/lib/isMobilePhone";
|
||||
import Toastify from "toastify-js";
|
||||
export let modal_open;
|
||||
export let current_contacts;
|
||||
$: selected_team = [];
|
||||
let firstname_input;
|
||||
let lastname_input;
|
||||
let middlename_input;
|
||||
let phone_input;
|
||||
let email_input;
|
||||
let address_input1;
|
||||
let address_input2;
|
||||
let address_zipcode;
|
||||
let address_city;
|
||||
let teams = [];
|
||||
let orgs = [];
|
||||
RunnerTeamService.runnerTeamControllerGetAll().then((val) => {
|
||||
teams = val;
|
||||
});
|
||||
RunnerOrganizationService.runnerOrganizationControllerGetAll().then((val) => {
|
||||
orgs = val;
|
||||
});
|
||||
function focus(el) {
|
||||
el.focus();
|
||||
}
|
||||
$: middlename_input_value = "";
|
||||
$: phone_input_value = "";
|
||||
$: email_input_value = "";
|
||||
$: lastname_input_value = "";
|
||||
$: firstname_input_value = "";
|
||||
$: address_input1_value = "";
|
||||
$: address_input2_value = "";
|
||||
$: address_zipcode_value = "";
|
||||
$: address_city_value = "";
|
||||
$: processed_last_submit = true;
|
||||
$: address_checked = true;
|
||||
$: isPhoneValidOrEmpty =
|
||||
(phone_input_value.includes("+") &&
|
||||
isMobilePhone(
|
||||
phone_input_value
|
||||
.replaceAll("(", "")
|
||||
.replaceAll(")", "")
|
||||
.replaceAll("-", "")
|
||||
.replaceAll(" ", "")
|
||||
)) ||
|
||||
phone_input_value === "";
|
||||
$: isEmailValidOrEmpty =
|
||||
isEmail(email_input_value) || email_input_value === "";
|
||||
$: isLastnameValid = lastname_input_value.trim().length !== 0;
|
||||
$: isFirstnameValid = firstname_input_value.trim().length !== 0;
|
||||
$: isAddress1Valid = address_input1_value.trim().length !== 0;
|
||||
$: iszipcodevalid = address_zipcode_value.trim().length !== 0;
|
||||
$: iscityvalid = address_city_value.trim().length !== 0;
|
||||
$: createbtnenabled =
|
||||
isFirstnameValid &&
|
||||
isLastnameValid &&
|
||||
isEmailValidOrEmpty &&
|
||||
isPhoneValidOrEmpty &&
|
||||
((isAddress1Valid && iszipcodevalid && iscityvalid) ||
|
||||
address_checked === false);
|
||||
(() => {
|
||||
document.onkeydown = (e) => {
|
||||
e = e || window.event;
|
||||
if (e.key === "Escape") {
|
||||
modal_open = false;
|
||||
}
|
||||
if (e.keyCode === 13) {
|
||||
if (createbtnenabled === true) {
|
||||
createbtnenabled = false;
|
||||
submit();
|
||||
}
|
||||
}
|
||||
};
|
||||
})();
|
||||
function submit() {
|
||||
if (processed_last_submit === true) {
|
||||
processed_last_submit = false;
|
||||
const toast = Toastify({
|
||||
text: "Contact is being added...",
|
||||
duration: -1,
|
||||
}).showToast();
|
||||
let address = {};
|
||||
if (address_checked === true) {
|
||||
address = {
|
||||
address1: address_input1_value,
|
||||
address2: address_input2_value || "",
|
||||
postalcode: address_zipcode_value,
|
||||
city: address_city_value,
|
||||
country: "DE",
|
||||
};
|
||||
}
|
||||
let postdata = {
|
||||
groups: selected_team,
|
||||
firstname: firstname_input_value,
|
||||
lastname: lastname_input_value,
|
||||
address,
|
||||
};
|
||||
if (middlename_input_value) {
|
||||
postdata.middlename = middlename_input_value;
|
||||
}
|
||||
if (phone_input_value) {
|
||||
postdata.phone = phone_input_value;
|
||||
}
|
||||
if (email_input_value) {
|
||||
postdata.email = email_input_value;
|
||||
}
|
||||
GroupContactService.groupContactControllerPost(postdata)
|
||||
.then((result) => {
|
||||
firstname_input_value = "";
|
||||
lastname_input_value = "";
|
||||
middlename_input_value = "";
|
||||
email_input_value = "";
|
||||
modal_open = false;
|
||||
//
|
||||
Toastify({
|
||||
text: "Contact added",
|
||||
duration: 500,
|
||||
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
|
||||
}).showToast();
|
||||
current_contacts.push(result);
|
||||
current_contacts = current_contacts;
|
||||
})
|
||||
.catch((err) => {
|
||||
//
|
||||
})
|
||||
.finally(() => {
|
||||
processed_last_submit = true;
|
||||
//
|
||||
toast.hideToast();
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if modal_open}
|
||||
<div
|
||||
class="fixed z-10 inset-0 overflow-y-auto"
|
||||
use:focusTrap
|
||||
use:clickOutside
|
||||
on:click_outside={() => {
|
||||
modal_open = false;
|
||||
}}>
|
||||
<div
|
||||
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="absolute inset-0 bg-gray-500 opacity-75"
|
||||
data-id="modal_backdrop" />
|
||||
</div>
|
||||
<span
|
||||
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 overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg 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">
|
||||
<svg
|
||||
class="h-6 w-6 text-blue-600"
|
||||
fill="currentColor"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
width="24"
|
||||
height="24"><path fill="none" d="M0 0h24v24H0z" />
|
||||
<path
|
||||
d="M2 22a8 8 0 1 1 16 0H2zm8-9c-3.315 0-6-2.685-6-6s2.685-6 6-6 6 2.685 6 6-2.685 6-6 6zm10 4h4v2h-4v-2zm-3-5h7v2h-7v-2zm2-5h5v2h-5V7z" /></svg>
|
||||
</div>
|
||||
<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">
|
||||
{$_('create-a-new-contact')}
|
||||
</h3>
|
||||
<div class="mt-2 mb-6">
|
||||
<p class="text-sm text-gray-500">
|
||||
{$_('please-provide-the-required-information-to-add-a-new-contact')}
|
||||
</p>
|
||||
</div>
|
||||
<div class="grid grid-cols-6 gap-6">
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="firstname"
|
||||
class="block text-sm font-medium text-gray-700">{$_('first-name')}</label>
|
||||
<input
|
||||
use:focus
|
||||
autocomplete="off"
|
||||
placeholder={$_('first-name')}
|
||||
class:border-red-500={!isFirstnameValid}
|
||||
class:focus:border-red-500={!isFirstnameValid}
|
||||
class:focus:ring-red-500={!isFirstnameValid}
|
||||
bind:value={firstname_input_value}
|
||||
bind:this={firstname_input}
|
||||
type="text"
|
||||
name="firstname"
|
||||
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 !isFirstnameValid}
|
||||
<span
|
||||
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
|
||||
{$_('first-name-is-required')}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="trackname"
|
||||
class="block text-sm font-medium text-gray-700">{$_('middle-name')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder={$_('middle-name')}
|
||||
bind:value={middlename_input_value}
|
||||
bind:this={middlename_input}
|
||||
type="text"
|
||||
name="trackname"
|
||||
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" />
|
||||
</div>
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="lastname"
|
||||
class="block text-sm font-medium text-gray-700">{$_('last-name')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="{$_('last-name')}"
|
||||
class:border-red-500={!isLastnameValid}
|
||||
class:focus:border-red-500={!isLastnameValid}
|
||||
class:focus:ring-red-500={!isLastnameValid}
|
||||
bind:value={lastname_input_value}
|
||||
bind:this={lastname_input}
|
||||
type="text"
|
||||
name="lastname"
|
||||
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 !isLastnameValid}
|
||||
<span
|
||||
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
|
||||
{$_('last-name-is-required')}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="team"
|
||||
class="block text-sm font-medium text-gray-700">{$_('teams')}</label>
|
||||
<select
|
||||
name="team"
|
||||
multiple
|
||||
bind:value={selected_team}
|
||||
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">
|
||||
{#each teams as team}
|
||||
<option value={team.id}>
|
||||
{team.parentGroup.name}
|
||||
>
|
||||
{team.name}
|
||||
</option>
|
||||
{/each}
|
||||
{#each orgs as org}
|
||||
<option value={org.id}>{org.name}</option>
|
||||
{/each}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="phone"
|
||||
class="block text-sm font-medium text-gray-700">{$_('phone')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder={$_('phone')}
|
||||
class:border-red-500={!isPhoneValidOrEmpty}
|
||||
class:focus:border-red-500={!isPhoneValidOrEmpty}
|
||||
class:focus:ring-red-500={!isPhoneValidOrEmpty}
|
||||
bind:value={phone_input_value}
|
||||
bind:this={phone_input}
|
||||
type="tel"
|
||||
name="phone"
|
||||
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 !isPhoneValidOrEmpty}
|
||||
<span
|
||||
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
|
||||
{@html $_('the-provided-phone-number-is-invalid-less-than-br-greater-than-please-enter-a-valid-international-number')}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="email"
|
||||
class="block text-sm font-medium text-gray-700">{$_('e-mail-adress')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder={$_('e-mail-adress')}
|
||||
class:border-red-500={!isEmailValidOrEmpty}
|
||||
class:focus:border-red-500={!isEmailValidOrEmpty}
|
||||
class:focus:ring-red-500={!isEmailValidOrEmpty}
|
||||
bind:value={email_input_value}
|
||||
bind:this={email_input}
|
||||
type="email"
|
||||
name="email"
|
||||
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 !isEmailValidOrEmpty}
|
||||
<span
|
||||
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
|
||||
{$_('valid-email-is-required')}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="flex items-start">
|
||||
<div class="flex items-center h-5">
|
||||
<input
|
||||
bind:checked={address_checked}
|
||||
id="comments"
|
||||
name="comments"
|
||||
type="checkbox"
|
||||
class="focus:ring-indigo-500 h-4 w-4 text-indigo-600 border-gray-300 rounded" />
|
||||
</div>
|
||||
<div class="ml-3 text-sm">
|
||||
<label
|
||||
for="comments"
|
||||
class="font-medium text-gray-700">{$_('address')}</label>
|
||||
</div>
|
||||
</div>
|
||||
{#if address_checked === true}
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="address1"
|
||||
class="block text-sm font-medium text-gray-700">{$_('address')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="{$_('address')}"
|
||||
class:border-red-500={!isAddress1Valid}
|
||||
class:focus:border-red-500={!isAddress1Valid}
|
||||
class:focus:ring-red-500={!isAddress1Valid}
|
||||
bind:value={address_input1_value}
|
||||
bind:this={address_input1}
|
||||
type="text"
|
||||
name="address1"
|
||||
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 !isAddress1Valid}
|
||||
<span
|
||||
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
|
||||
{$_('address-is-required')}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="address2"
|
||||
class="block text-sm font-medium text-gray-700">{$_('apartment-suite-etc')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder={$_('apartment-suite-etc')}
|
||||
bind:value={address_input2_value}
|
||||
bind:this={address_input2}
|
||||
type="text"
|
||||
name="address2"
|
||||
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" />
|
||||
</div>
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="zipcode"
|
||||
class="block text-sm font-medium text-gray-700">{$_('zip-postal-code')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder={$_('zip-postal-code')}
|
||||
class:border-red-500={!iszipcodevalid}
|
||||
class:focus:border-red-500={!iszipcodevalid}
|
||||
class:focus:ring-red-500={!iszipcodevalid}
|
||||
bind:value={address_zipcode_value}
|
||||
bind:this={address_zipcode}
|
||||
type="text"
|
||||
name="zipcode"
|
||||
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 !iszipcodevalid}
|
||||
<span
|
||||
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
|
||||
{$_('valid-zipcode-postal-code-is-required')}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="city"
|
||||
class="block text-sm font-medium text-gray-700">{$_('city')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="{$_('city')}"
|
||||
class:border-red-500={!iscityvalid}
|
||||
class:focus:border-red-500={!iscityvalid}
|
||||
class:focus:ring-red-500={!iscityvalid}
|
||||
bind:value={address_city_value}
|
||||
bind:this={address_city}
|
||||
type="text"
|
||||
name="city"
|
||||
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 !iscityvalid}
|
||||
<span
|
||||
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
|
||||
{$_('valid-city-is-required')}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse">
|
||||
<button
|
||||
disabled={!createbtnenabled}
|
||||
class:opacity-50={!createbtnenabled}
|
||||
on:click={submit}
|
||||
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')}
|
||||
</button>
|
||||
<button
|
||||
on:click={() => {
|
||||
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">
|
||||
{$_('cancel')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
394
src/components/contacts/ContactDetail.svelte
Normal file
394
src/components/contacts/ContactDetail.svelte
Normal file
@@ -0,0 +1,394 @@
|
||||
<script>
|
||||
import { _ } from "svelte-i18n";
|
||||
import store from "../../store";
|
||||
import {
|
||||
GroupContactService,
|
||||
RunnerTeamService,
|
||||
RunnerOrganizationService,
|
||||
} from "@odit/lfk-client-js";
|
||||
import Toastify from "toastify-js";
|
||||
import PromiseError from "../base/PromiseError.svelte";
|
||||
import isEmail from "validator/es/lib/isEmail";
|
||||
let data_loaded = false;
|
||||
let orgs = [];
|
||||
let teams = [];
|
||||
export let params;
|
||||
$: delete_triggered = false;
|
||||
$: original_data = {};
|
||||
$: editable = {};
|
||||
$: changes_performed = !(
|
||||
JSON.stringify(original_data) === JSON.stringify(editable)
|
||||
);
|
||||
$: isEmailValid =
|
||||
(editable.email || "") === "" ||
|
||||
(editable.email && isEmail(editable.email || ""));
|
||||
$: isFirstnameValid = editable.firstname !== "";
|
||||
$: isLastnameValid = editable.lastname !== "";
|
||||
$: save_enabled =
|
||||
changes_performed &&
|
||||
isFirstnameValid &&
|
||||
isLastnameValid &&
|
||||
isEmailValid &&
|
||||
isPhoneValidOrEmpty &&
|
||||
((isAddress1Valid && iszipcodevalid && iscityvalid) ||
|
||||
editable.address_checked === false);
|
||||
const promise = GroupContactService.groupContactControllerGetOne(
|
||||
params.contact
|
||||
).then((data) => {
|
||||
data_loaded = true;
|
||||
original_data = Object.assign(original_data, data);
|
||||
editable = Object.assign(editable, original_data);
|
||||
editable.groups = editable.groups.map((g) => g.id);
|
||||
original_data.groups = original_data.groups.map((g) => g.id);
|
||||
editable.address_checked = editable.address.address1 !== null;
|
||||
original_data.address_checked = editable.address.address1 !== null;
|
||||
if(editable.address_checked===false){
|
||||
editable.address = {
|
||||
address1: "",
|
||||
address2: "",
|
||||
city: "",
|
||||
postalcode: "",
|
||||
country: ""
|
||||
}
|
||||
}
|
||||
});
|
||||
RunnerOrganizationService.runnerOrganizationControllerGetAll().then((val) => {
|
||||
orgs = val;
|
||||
});
|
||||
RunnerTeamService.runnerTeamControllerGetAll().then((val) => {
|
||||
teams = val;
|
||||
});
|
||||
$: isPhoneValidOrEmpty =
|
||||
editable.phone?.includes("+") ||
|
||||
editable.phone === "" ||
|
||||
editable.phone === null;
|
||||
$: isAddress1Valid = editable.address?.address1?.trim().length !== 0;
|
||||
$: iszipcodevalid = editable.address?.postalcode?.trim().length !== 0;
|
||||
$: iscityvalid = editable.address?.city?.trim().length !== 0;
|
||||
function submit() {
|
||||
if (data_loaded === true && save_enabled) {
|
||||
Toastify({
|
||||
text: $_("contact-is-being-updated"),
|
||||
duration: 2500,
|
||||
}).showToast();
|
||||
editable.address.country = "DE";
|
||||
if (editable.address_checked === false) {
|
||||
editable.address = null;
|
||||
}
|
||||
if (editable.email) editable.email = editable.email;
|
||||
if (editable.phone) editable.phone = editable.phone;
|
||||
if (editable.middlename) editable.middlename = editable.middlename;
|
||||
GroupContactService.groupContactControllerPut(original_data.id, editable)
|
||||
.then((resp) => {
|
||||
Object.assign(original_data, editable);
|
||||
original_data=original_data;
|
||||
Toastify({
|
||||
text: $_("updated-contact"),
|
||||
duration: 2500,
|
||||
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
|
||||
}).showToast();
|
||||
})
|
||||
.catch((err) => {});
|
||||
} else {
|
||||
}
|
||||
}
|
||||
function deleteContact() {
|
||||
GroupContactService.groupContactControllerRemove(original_data.id, true)
|
||||
.then((resp) => {
|
||||
location.replace("./");
|
||||
})
|
||||
.catch((err) => {});
|
||||
}
|
||||
</script>
|
||||
|
||||
{#await promise}
|
||||
{$_('loading-contact-details')}
|
||||
{:then}
|
||||
<section class="container p-5 select-none">
|
||||
<div class="flex flex-row mb-4">
|
||||
<div class="w-full">
|
||||
<nav class="w-full flex">
|
||||
<ol class="list-none flex flex-row items-center justify-start">
|
||||
<li class="flex items-center">
|
||||
<svg
|
||||
fill="currentColor"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
width="24"
|
||||
height="24"><path fill="none" d="M0 0h24v24H0z" />
|
||||
<path
|
||||
d="M2 22a8 8 0 1 1 16 0H2zm8-9c-3.315 0-6-2.685-6-6s2.685-6 6-6 6 2.685 6 6-2.685 6-6 6zm10 4h4v2h-4v-2zm-3-5h7v2h-7v-2zm2-5h5v2h-5V7z" /></svg>
|
||||
</li>
|
||||
<li class="flex items-center ml-2">
|
||||
<a class="mr-2" href="./">{$_('contacts')}</a><svg
|
||||
stroke="currentColor"
|
||||
fill="none"
|
||||
stroke-width="2"
|
||||
viewBox="0 0 24 24"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
class="h-3 w-3 mr-2 stroke-current"
|
||||
height="1em"
|
||||
width="1em"
|
||||
xmlns="http://www.w3.org/2000/svg"><line
|
||||
x1="5"
|
||||
y1="12"
|
||||
x2="19"
|
||||
y2="12" />
|
||||
<polyline points="12 5 19 12 12 19" /></svg>
|
||||
</li>
|
||||
<li class="flex items-center">
|
||||
<span class="mr-2">{original_data.firstname}
|
||||
{original_data.middlename || ''}
|
||||
{original_data.lastname}</span>
|
||||
</li>
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-8 text-3xl font-extrabold leading-tight">
|
||||
{original_data.firstname}
|
||||
{original_data.middlename || ''}
|
||||
{original_data.lastname}
|
||||
<span data-id="contact_actions_${editable.id}">
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('CONTACT:DELETE')}
|
||||
{#if delete_triggered}
|
||||
<button
|
||||
on:click={deleteContact}
|
||||
class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm">{$_('confirm-deletion')}</button>
|
||||
<button
|
||||
on:click={() => {
|
||||
delete_triggered = !delete_triggered;
|
||||
}}
|
||||
class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-400 text-base font-medium text-white sm:w-auto sm:text-sm">{$_('cancel')}</button>
|
||||
{/if}
|
||||
{#if !delete_triggered}
|
||||
<button
|
||||
on:click={() => {
|
||||
delete_triggered = true;
|
||||
}}
|
||||
type="button"
|
||||
class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm">{$_('delete-contact')}</button>
|
||||
{/if}
|
||||
{/if}
|
||||
{#if !delete_triggered}
|
||||
<button
|
||||
disabled={!save_enabled}
|
||||
class:opacity-50={!save_enabled}
|
||||
type="button"
|
||||
on:click={submit}
|
||||
class="w-full 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">{$_('save-changes')}</button>
|
||||
{/if}
|
||||
</span>
|
||||
</div>
|
||||
<!-- -->
|
||||
<div class="text-sm w-full">
|
||||
<label
|
||||
for="firstname"
|
||||
class="font-medium text-gray-700">{$_('first-name')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder={$_('first-name')}
|
||||
type="text"
|
||||
class:border-red-500={!isFirstnameValid}
|
||||
class:focus:border-red-500={!isFirstnameValid}
|
||||
class:focus:ring-red-500={!isFirstnameValid}
|
||||
bind:value={editable.firstname}
|
||||
name="firstname"
|
||||
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 !isFirstnameValid}
|
||||
<span
|
||||
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
|
||||
{$_('first-name-is-required')}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="text-sm w-full">
|
||||
<label
|
||||
for="middlename"
|
||||
class="font-medium text-gray-700">{$_('middle-name')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder={$_('middle-name')}
|
||||
type="text"
|
||||
bind:value={editable.middlename}
|
||||
name="middlename"
|
||||
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" />
|
||||
</div>
|
||||
<div class="text-sm w-full">
|
||||
<label
|
||||
for="lastname"
|
||||
class="font-medium text-gray-700">{$_('last-name')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder={$_('last-name')}
|
||||
type="text"
|
||||
bind:value={editable.lastname}
|
||||
class:border-red-500={!isLastnameValid}
|
||||
class:focus:border-red-500={!isLastnameValid}
|
||||
class:focus:ring-red-500={!isLastnameValid}
|
||||
name="lastname"
|
||||
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 !isLastnameValid}
|
||||
<span
|
||||
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
|
||||
{$_('last-name-is-required')}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="text-sm w-full">
|
||||
<label
|
||||
for="email"
|
||||
class="font-medium text-gray-700">{$_('e-mail-adress')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder={$_('e-mail-adress')}
|
||||
type="email"
|
||||
bind:value={editable.email}
|
||||
class:border-red-500={!isEmailValid}
|
||||
class:focus:border-red-500={!isEmailValid}
|
||||
class:focus:ring-red-500={!isEmailValid}
|
||||
name="email"
|
||||
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 !isEmailValid}
|
||||
<span
|
||||
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
|
||||
{$_('valid-email-is-required')}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="text-sm w-full">
|
||||
<label for="phone" class="font-medium text-gray-700">{$_('phone')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder={$_('phone')}
|
||||
type="tel"
|
||||
class:border-red-500={!isPhoneValidOrEmpty}
|
||||
class:focus:border-red-500={!isPhoneValidOrEmpty}
|
||||
class:focus:ring-red-500={!isPhoneValidOrEmpty}
|
||||
bind:value={editable.phone}
|
||||
name="phone"
|
||||
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 !isPhoneValidOrEmpty}
|
||||
<span
|
||||
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
|
||||
{$_('valid-international-phone-number-is-required')}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="text-sm w-full">
|
||||
<span class="font-medium text-gray-700">{$_('groups')}</span>
|
||||
<select
|
||||
bind:value={editable.groups}
|
||||
name="team"
|
||||
multiple
|
||||
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">
|
||||
{#each teams as team}
|
||||
<option value={team.id}>
|
||||
{team.parentGroup.name}
|
||||
>
|
||||
{team.name}
|
||||
</option>
|
||||
{/each}
|
||||
{#each orgs as org}
|
||||
<option value={org.id}>{org.name}</option>
|
||||
{/each}
|
||||
</select>
|
||||
</div>
|
||||
<!-- -->
|
||||
<div class="flex items-start mt-2">
|
||||
<div class="flex items-center h-5">
|
||||
<input
|
||||
bind:checked={editable.address_checked}
|
||||
id="comments"
|
||||
name="comments"
|
||||
type="checkbox"
|
||||
class="focus:ring-indigo-500 h-4 w-4 text-indigo-600 border-gray-300 rounded" />
|
||||
</div>
|
||||
<div class="ml-3 text-sm">
|
||||
<label
|
||||
for="comments"
|
||||
class="font-medium text-gray-700">{$_('address')}</label>
|
||||
</div>
|
||||
</div>
|
||||
{#if editable.address_checked === true}
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="address1"
|
||||
class="block text-sm font-medium text-gray-700">{$_('address')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Address"
|
||||
class:border-red-500={!isAddress1Valid}
|
||||
class:focus:border-red-500={!isAddress1Valid}
|
||||
class:focus:ring-red-500={!isAddress1Valid}
|
||||
bind:value={editable.address.address1}
|
||||
type="text"
|
||||
name="address1"
|
||||
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 !isAddress1Valid}
|
||||
<span
|
||||
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
|
||||
{$_('address-is-required')}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="address2"
|
||||
class="block text-sm font-medium text-gray-700">{$_('apartment-suite-etc')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder={$_('apartment-suite-etc')}
|
||||
bind:value={editable.address.address2}
|
||||
type="text"
|
||||
name="address2"
|
||||
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" />
|
||||
</div>
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="zipcode"
|
||||
class="block text-sm font-medium text-gray-700">{$_('zip-postal-code')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder={$_('zip-postal-code')}
|
||||
class:border-red-500={!iszipcodevalid}
|
||||
class:focus:border-red-500={!iszipcodevalid}
|
||||
class:focus:ring-red-500={!iszipcodevalid}
|
||||
bind:value={editable.address.postalcode}
|
||||
type="text"
|
||||
name="zipcode"
|
||||
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 !iszipcodevalid}
|
||||
<span
|
||||
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
|
||||
{$_('valid-zipcode-postal-code-is-required')}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="city"
|
||||
class="block text-sm font-medium text-gray-700">{$_('city')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder={$_('city')}
|
||||
class:border-red-500={!iscityvalid}
|
||||
class:focus:border-red-500={!iscityvalid}
|
||||
class:focus:ring-red-500={!iscityvalid}
|
||||
bind:value={editable.address.city}
|
||||
type="text"
|
||||
name="city"
|
||||
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 !iscityvalid}
|
||||
<span
|
||||
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
|
||||
{$_('valid-city-is-required')}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
</section>
|
||||
{:catch error}
|
||||
<PromiseError {error} />
|
||||
{/await}
|
29
src/components/contacts/Contacts.svelte
Normal file
29
src/components/contacts/Contacts.svelte
Normal file
@@ -0,0 +1,29 @@
|
||||
<script>
|
||||
import { _ } from "svelte-i18n";
|
||||
import store from "../../store";
|
||||
import AddContactModal from "./AddContactModal.svelte";
|
||||
import ContactsOverview from "./ContactsOverview.svelte";
|
||||
export let modal_open = false;
|
||||
let current_contacts = [];
|
||||
</script>
|
||||
|
||||
<section class="container p-5">
|
||||
<span class="mb-1 text-3xl font-extrabold leading-tight">
|
||||
{$_('contacts')}
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('CONTACT:CREATE')}
|
||||
<button
|
||||
on:click={() => {
|
||||
modal_open = true;
|
||||
}}
|
||||
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-a-new-contact')}
|
||||
</button>
|
||||
{/if}
|
||||
</span>
|
||||
<ContactsOverview bind:current_contacts />
|
||||
</section>
|
||||
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('CONTACT:CREATE')}
|
||||
<AddContactModal bind:current_contacts bind:modal_open />
|
||||
{/if}
|
17
src/components/contacts/ContactsEmptyState.svelte
Normal file
17
src/components/contacts/ContactsEmptyState.svelte
Normal file
@@ -0,0 +1,17 @@
|
||||
<script>
|
||||
import { _ } from "svelte-i18n";
|
||||
import AddContactModal from "./AddContactModal.svelte";
|
||||
import team_empty from "../teams/team_empty.svg";
|
||||
let modal_open = false;
|
||||
let current_contacts = [];
|
||||
</script>
|
||||
|
||||
<div class="text-center items-center justify-center">
|
||||
<p class="mb-16 text-lg text-gray-500">
|
||||
<img class="w-full h-44" src={team_empty} alt="" />
|
||||
<span class="font-bold">{$_('there-are-no-contacts-added-yet')}</span><br />
|
||||
<span>{$_('add-your-first-contact')}</span>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<AddContactModal bind:modal_open bind:current_contacts />
|
177
src/components/contacts/ContactsOverview.svelte
Normal file
177
src/components/contacts/ContactsOverview.svelte
Normal file
@@ -0,0 +1,177 @@
|
||||
<script>
|
||||
import { _ } from "svelte-i18n";
|
||||
import Toastify from "toastify-js";
|
||||
import { GroupContactService } from "@odit/lfk-client-js";
|
||||
const promise = GroupContactService.groupContactControllerGetAll().then(
|
||||
(result) => {
|
||||
current_contacts = result;
|
||||
}
|
||||
);
|
||||
import store from "../../store";
|
||||
import ContactsEmptyState from "./ContactsEmptyState.svelte";
|
||||
$: searchvalue = "";
|
||||
$: active_deletes = [];
|
||||
export let current_contacts = [];
|
||||
</script>
|
||||
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('TEAM:GET')}
|
||||
{#await promise}
|
||||
<div
|
||||
class="bg-teal-lightest border-t-4 border-teal rounded-b text-teal-darkest px-4 py-3 shadow-md my-2"
|
||||
role="alert">
|
||||
<p class="font-bold">{$_('contacts-are-being-loaded')}</p>
|
||||
<p class="text-sm">{$_('this-might-take-a-moment')}</p>
|
||||
</div>
|
||||
{:then}
|
||||
{#if current_contacts.length === 0}
|
||||
<ContactsEmptyState />
|
||||
{:else}
|
||||
<input
|
||||
type="search"
|
||||
bind:value={searchvalue}
|
||||
placeholder={$_('datatable.search')}
|
||||
aria-label={$_('datatable.search')}
|
||||
class="gridjs-input gridjs-search-input mb-4" />
|
||||
<div
|
||||
class="shadow border-b border-gray-200 sm:rounded-lg overflow-x-scroll">
|
||||
<table class="divide-y divide-gray-200 w-full">
|
||||
<thead class="bg-gray-50">
|
||||
<tr>
|
||||
<th
|
||||
scope="col"
|
||||
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
||||
{$_('name')}
|
||||
</th>
|
||||
<th
|
||||
scope="col"
|
||||
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
||||
{$_('groups')}
|
||||
</th>
|
||||
<th
|
||||
scope="col"
|
||||
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
||||
{$_('address')}
|
||||
</th>
|
||||
<th scope="col" class="relative px-6 py-3">
|
||||
<span class="sr-only">{$_('action')}</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-200">
|
||||
{#each current_contacts as t}
|
||||
{#if Object.values(t)
|
||||
.toString()
|
||||
.toLowerCase()
|
||||
.includes(searchvalue)}
|
||||
<tr data-rowid="team_{t.id}">
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
<div class="flex items-center">
|
||||
<div class="ml-4">
|
||||
<div class="text-sm font-medium text-gray-900">
|
||||
{t.firstname}
|
||||
{t.middlename || ''}
|
||||
{t.lastname}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
<div class="flex items-center">
|
||||
<div class="ml-4">
|
||||
<div class="text-sm font-medium text-gray-900">
|
||||
{#if t.groups.length > 0}
|
||||
{#each t.groups as g}
|
||||
{#if g.responseType === 'RUNNERORGANIZATION'}
|
||||
<a
|
||||
href="../orgs/{g.id}"
|
||||
class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-gray-100 text-gray-800">{g.name}</a>
|
||||
{:else}
|
||||
<a
|
||||
href="../teams/{g.id}"
|
||||
class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-gray-100 text-gray-800">{g.parentGroup.name}
|
||||
>
|
||||
{g.name}</a>
|
||||
{/if}
|
||||
{/each}
|
||||
{:else}
|
||||
{$_('contact-is-not-a-member-in-any-group')}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
<div class="flex items-center">
|
||||
<div class="ml-4">
|
||||
<div class="text-sm font-medium text-gray-900">
|
||||
{#if t.address.address1 !== null}
|
||||
{t.address.address1}<br />
|
||||
{t.address.address2 || ''}<br />
|
||||
{t.address.postalcode}
|
||||
{t.address.city}
|
||||
{t.address.country}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
{#if active_deletes[t.id] === true}
|
||||
<td
|
||||
class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
|
||||
<button
|
||||
on:click={() => {
|
||||
active_deletes[t.id] = false;
|
||||
}}
|
||||
tabindex="0"
|
||||
class="ml-4 text-indigo-600 hover:text-indigo-900 cursor-pointer">{$_('cancel-delete')}</button>
|
||||
<button
|
||||
on:click={() => {
|
||||
GroupContactService.groupContactControllerRemove(t.id, false).then(
|
||||
(resp) => {
|
||||
current_contacts = current_contacts.filter(
|
||||
(obj) => obj.id !== t.id
|
||||
);
|
||||
Toastify({
|
||||
text: $_('contact-deleted'),
|
||||
duration: 500,
|
||||
backgroundColor:
|
||||
'linear-gradient(to right, #00b09b, #96c93d)',
|
||||
}).showToast();
|
||||
}
|
||||
);
|
||||
}}
|
||||
tabindex="0"
|
||||
class="ml-4 text-red-600 hover:text-red-900 cursor-pointer">{$_('confirm-delete')}</button>
|
||||
</td>
|
||||
{:else}
|
||||
<td
|
||||
class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
|
||||
<a
|
||||
href="./{t.id}"
|
||||
class="text-indigo-600 hover:text-indigo-900">{$_('details')}</a>
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('TEAM:DELETE')}
|
||||
<button
|
||||
on:click={() => {
|
||||
active_deletes[t.id] = true;
|
||||
}}
|
||||
tabindex="0"
|
||||
class="ml-4 text-red-600 hover:text-red-900 cursor-pointer">{$_('delete')}</button>
|
||||
{/if}
|
||||
</td>
|
||||
{/if}
|
||||
</tr>
|
||||
{/if}
|
||||
{/each}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{/if}
|
||||
{:catch error}
|
||||
<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">
|
||||
<b class="capitalize">{$_('general_promise_error')}</b>
|
||||
{error}
|
||||
</span>
|
||||
</div>
|
||||
{/await}
|
||||
{/if}
|
327
src/components/dashboard/Dashboard.svelte
Normal file
327
src/components/dashboard/Dashboard.svelte
Normal file
@@ -0,0 +1,327 @@
|
||||
<script>
|
||||
import { _ } from "svelte-i18n";
|
||||
import localForage from "localforage";
|
||||
import store from "../../store";
|
||||
import { router } from "tinro";
|
||||
import NoComponentLoaded from "../base/NoComponentLoaded.svelte";
|
||||
import { AuthService } from "@odit/lfk-client-js";
|
||||
$: navOpen = false;
|
||||
function logout() {
|
||||
localForage.clear();
|
||||
location.replace("/");
|
||||
}
|
||||
</script>
|
||||
|
||||
<section class="min-h-screen bg-gray-50">
|
||||
<nav
|
||||
class:-translate-x-full={!navOpen}
|
||||
class:translate-x-0={navOpen}
|
||||
class="select-none fixed top-0 left-0 z-20 h-full pb-10 overflow-x-hidden overflow-y-auto transition origin-left transform border-r w-60 md:translate-x-0 bg-gray-50">
|
||||
<a href="/" class="flex items-center px-4 py-5">
|
||||
<img src="/lfk-logo.png" alt="Logo" class="h-10" />
|
||||
<h3 class="text-lg">Lauf für Kaya! Admin</h3>
|
||||
</a>
|
||||
<nav class="text-sm font-medium text-gray-600" aria-label="Main Navigation">
|
||||
<a
|
||||
class:bg-gray-100={$router.path === '/'}
|
||||
class="flex items-center px-4 py-3 transition cursor-pointer group hover:bg-gray-100 hover:text-gray-900"
|
||||
href="/">
|
||||
<svg
|
||||
class="flex-shrink-0 w-5 h-5 mr-2 text-gray-400 transition group-hover:text-gray-600"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 20 20"
|
||||
fill="currentColor">
|
||||
<path
|
||||
d="M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z" />
|
||||
</svg>
|
||||
<span>{$_('dashboard-title')}</span>
|
||||
</a>
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('ORGANIZATION:GET')}
|
||||
<a
|
||||
class:bg-gray-100={$router.path.includes('/orgs/')}
|
||||
class="flex items-center px-4 py-3 transition cursor-pointer group hover:bg-gray-100 hover:text-gray-900"
|
||||
href="/orgs/">
|
||||
<svg
|
||||
class="flex-shrink-0 w-5 h-5 mr-2 text-gray-400 transition group-hover:text-gray-600"
|
||||
fill="currentColor"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
width="24"
|
||||
height="24"><path fill="none" d="M0 0h24v24H0z" />
|
||||
<path
|
||||
d="M17 19h2v-8h-6v8h2v-6h2v6zM3 19V4a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v5h2v10h1v2H2v-2h1zm4-8v2h2v-2H7zm0 4v2h2v-2H7zm0-8v2h2V7H7z" /></svg>
|
||||
<span>{$_('orgs')}</span>
|
||||
</a>
|
||||
{/if}
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('USER:GET')}
|
||||
<a
|
||||
class:bg-gray-100={$router.path === '/users/'}
|
||||
class="flex items-center px-4 py-3 transition cursor-pointer group hover:bg-gray-100 hover:text-gray-900"
|
||||
href="/users/">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
class="flex-shrink-0 w-5 h-5 mr-2 text-gray-400 transition group-hover:text-gray-600"
|
||||
fill="currentColor"
|
||||
viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z" />
|
||||
<path
|
||||
d="M12 14v8H4a8 8 0 018-8zm0-1a6 6 0 110-12 6 6 0 010 12zm2.6 5.81a3.51 3.51 0 010-1.62l-1-.57 1-1.74 1 .58a3.5 3.5 0 011.4-.82V13.5h2v1.15a3.5 3.5 0 011.4.8l1-.57 1 1.74-1 .57a3.51 3.51 0 010 1.62l1 .57-1 1.74-1-.58a3.5 3.5 0 01-1.4.82v1.14h-2v-1.15a3.5 3.5 0 01-1.4-.8l-1 .57-1-1.74 1-.57zM18 17a1 1 0 100 2 1 1 0 000-2z" /></svg>
|
||||
<span>{$_('users')}</span>
|
||||
</a>
|
||||
{/if}
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('USERGROUP:GET')}
|
||||
<a
|
||||
class:bg-gray-100={$router.path === '/groups/'}
|
||||
class="flex items-center px-4 py-3 transition cursor-pointer group hover:bg-gray-100 hover:text-gray-900"
|
||||
href="/groups/">
|
||||
<svg
|
||||
class="flex-shrink-0 w-5 h-5 mr-2 text-gray-400 transition group-hover:text-gray-600"
|
||||
fill="currentColor"
|
||||
width="24"
|
||||
height="24"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 640 512"><path
|
||||
fill="currentColor"
|
||||
d="M610.5 341.3c2.6-14.1 2.6-28.5 0-42.6l25.8-14.9c3-1.7 4.3-5.2 3.3-8.5-6.7-21.6-18.2-41.2-33.2-57.4-2.3-2.5-6-3.1-9-1.4l-25.8 14.9c-10.9-9.3-23.4-16.5-36.9-21.3v-29.8c0-3.4-2.4-6.4-5.7-7.1-22.3-5-45-4.8-66.2 0-3.3.7-5.7 3.7-5.7 7.1v29.8c-13.5 4.8-26 12-36.9 21.3l-25.8-14.9c-2.9-1.7-6.7-1.1-9 1.4-15 16.2-26.5 35.8-33.2 57.4-1 3.3.4 6.8 3.3 8.5l25.8 14.9c-2.6 14.1-2.6 28.5 0 42.6l-25.8 14.9c-3 1.7-4.3 5.2-3.3 8.5 6.7 21.6 18.2 41.1 33.2 57.4 2.3 2.5 6 3.1 9 1.4l25.8-14.9c10.9 9.3 23.4 16.5 36.9 21.3v29.8c0 3.4 2.4 6.4 5.7 7.1 22.3 5 45 4.8 66.2 0 3.3-.7 5.7-3.7 5.7-7.1v-29.8c13.5-4.8 26-12 36.9-21.3l25.8 14.9c2.9 1.7 6.7 1.1 9-1.4 15-16.2 26.5-35.8 33.2-57.4 1-3.3-.4-6.8-3.3-8.5l-25.8-14.9zM496 368.5c-26.8 0-48.5-21.8-48.5-48.5s21.8-48.5 48.5-48.5 48.5 21.8 48.5 48.5-21.7 48.5-48.5 48.5zM96 224c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm224 32c1.9 0 3.7-.5 5.6-.6 8.3-21.7 20.5-42.1 36.3-59.2 7.4-8 17.9-12.6 28.9-12.6 6.9 0 13.7 1.8 19.6 5.3l7.9 4.6c.8-.5 1.6-.9 2.4-1.4 7-14.6 11.2-30.8 11.2-48 0-61.9-50.1-112-112-112S208 82.1 208 144c0 61.9 50.1 112 112 112zm105.2 194.5c-2.3-1.2-4.6-2.6-6.8-3.9-8.2 4.8-15.3 9.8-27.5 9.8-10.9 0-21.4-4.6-28.9-12.6-18.3-19.8-32.3-43.9-40.2-69.6-10.7-34.5 24.9-49.7 25.8-50.3-.1-2.6-.1-5.2 0-7.8l-7.9-4.6c-3.8-2.2-7-5-9.8-8.1-3.3.2-6.5.6-9.8.6-24.6 0-47.6-6-68.5-16h-8.3C179.6 288 128 339.6 128 403.2V432c0 26.5 21.5 48 48 48h255.4c-3.7-6-6.2-12.8-6.2-20.3v-9.2zM173.1 274.6C161.5 263.1 145.6 256 128 256H64c-35.3 0-64 28.7-64 64v32c0 17.7 14.3 32 32 32h65.9c6.3-47.4 34.9-87.3 75.2-109.4z" /></svg>
|
||||
<span>{$_('user-groups')}</span>
|
||||
</a>
|
||||
{/if}
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('RUNNER:GET')}
|
||||
<a
|
||||
class:bg-gray-100={$router.path === '/runners/'}
|
||||
class="flex items-center px-4 py-3 transition cursor-pointer group hover:bg-gray-100 hover:text-gray-900"
|
||||
href="/runners/">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
class="flex-shrink-0 w-5 h-5 mr-2 text-gray-400 transition group-hover:text-gray-600"
|
||||
fill="currentColor"
|
||||
width="24"
|
||||
height="24"><path fill="none" d="M0 0h24v24H0z" />
|
||||
<path
|
||||
d="M9.83 8.79L8 9.456V13H6V8.05h.015l5.268-1.918c.244-.093.51-.14.782-.131a2.616 2.616 0 0 1 2.427 1.82c.186.583.356.977.51 1.182A4.992 4.992 0 0 0 19 11v2a6.986 6.986 0 0 1-5.402-2.547l-.581 3.297L15 15.67V23h-2v-5.986l-2.05-1.987-.947 4.298-6.894-1.215.348-1.97 4.924.868L9.83 8.79zM13.5 5.5a2 2 0 1 1 0-4 2 2 0 0 1 0 4z" /></svg>
|
||||
<span>{$_('runners')}</span>
|
||||
</a>
|
||||
{/if}
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('TEAM:GET')}
|
||||
<a
|
||||
class:bg-gray-100={$router.path === '/teams/'}
|
||||
class="flex items-center px-4 py-3 transition cursor-pointer group hover:bg-gray-100 hover:text-gray-900"
|
||||
href="/teams/">
|
||||
<svg
|
||||
class="flex-shrink-0 w-5 h-5 mr-2 text-gray-400 transition group-hover:text-gray-600"
|
||||
fill="currentColor"
|
||||
width="24"
|
||||
height="24"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 640 512"><path
|
||||
fill="currentColor"
|
||||
d="M96 224c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm448 0c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm32 32h-64c-17.6 0-33.5 7.1-45.1 18.6 40.3 22.1 68.9 62 75.1 109.4h66c17.7 0 32-14.3 32-32v-32c0-35.3-28.7-64-64-64zm-256 0c61.9 0 112-50.1 112-112S381.9 32 320 32 208 82.1 208 144s50.1 112 112 112zm76.8 32h-8.3c-20.8 10-43.9 16-68.5 16s-47.6-6-68.5-16h-8.3C179.6 288 128 339.6 128 403.2V432c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48v-28.8c0-63.6-51.6-115.2-115.2-115.2zm-223.7-13.4C161.5 263.1 145.6 256 128 256H64c-35.3 0-64 28.7-64 64v32c0 17.7 14.3 32 32 32h65.9c6.3-47.4 34.9-87.3 75.2-109.4z" /></svg>
|
||||
<span>{$_('teams')}</span>
|
||||
</a>
|
||||
{/if}
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('DONOR:GET')}
|
||||
<a
|
||||
class:bg-gray-100={$router.path.includes('/donors/')}
|
||||
class="flex items-center px-4 py-3 transition cursor-pointer group hover:bg-gray-100 hover:text-gray-900"
|
||||
href="/donors/">
|
||||
<svg
|
||||
class="flex-shrink-0 w-5 h-5 mr-2 text-gray-400 transition group-hover:text-gray-600"
|
||||
fill="currentColor"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
width="24"
|
||||
height="24"><path fill="none" d="M0 0h24v24H0z" />
|
||||
<path
|
||||
d="M9.33 11.5h2.17A4.5 4.5 0 0 1 16 16H8.999L9 17h8v-1a5.578 5.578 0 0 0-.886-3H19a5 5 0 0 1 4.516 2.851C21.151 18.972 17.322 21 13 21c-2.761 0-5.1-.59-7-1.625L6 10.071A6.967 6.967 0 0 1 9.33 11.5zM5 19a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v9zM18 5a3 3 0 1 1 0 6 3 3 0 0 1 0-6zm-7-3a3 3 0 1 1 0 6 3 3 0 0 1 0-6z" /></svg>
|
||||
<span>{$_('donors')}</span>
|
||||
</a>
|
||||
{/if}
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('DONATION:GET')}
|
||||
<a
|
||||
class:bg-gray-100={$router.path.includes('/donations/')}
|
||||
class="flex items-center px-4 py-3 transition cursor-pointer group hover:bg-gray-100 hover:text-gray-900"
|
||||
href="/donations/">
|
||||
<svg
|
||||
class="flex-shrink-0 w-5 h-5 mr-2 text-gray-400 transition group-hover:text-gray-600"
|
||||
fill="currentColor"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
width="24"
|
||||
height="24"><path fill="none" d="M0 0h24v24H0z" />
|
||||
<path
|
||||
d="M14 2a8 8 0 013.3 15.3A8 8 0 116.7 6.7 8 8 0 0114 2zm-3 7H9v1a2.5 2.5 0 00-.16 5h2.25a.5.5 0 010 1H7v2h2v1h2v-1a2.5 2.5 0 00.16-5H8.91a.5.5 0 010-1H13v-2h-2V9zm3-5a5.99 5.99 0 00-4.48 2.01 8 8 0 018.47 8.47A6 6 0 0014 4z" /></svg>
|
||||
<span>{$_('donations')}</span>
|
||||
</a>
|
||||
{/if}
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('TRACK:GET')}
|
||||
<a
|
||||
class:bg-gray-100={$router.path === '/tracks/'}
|
||||
class="flex items-center px-4 py-3 transition cursor-pointer group hover:bg-gray-100 hover:text-gray-900"
|
||||
href="/tracks/">
|
||||
<svg
|
||||
class="flex-shrink-0 w-5 h-5 mr-2 text-gray-400 transition group-hover:text-gray-600"
|
||||
fill="currentColor"
|
||||
width="24"
|
||||
height="24"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 640 512"><path
|
||||
fill="currentColor"
|
||||
d="M635.7 167.2L556.1 31.7c-8.8-15-28.3-20.1-43.5-11.5l-69 39.1L503.3 161c2.2 3.8.9 8.5-2.9 10.7l-13.8 7.8c-3.8 2.2-8.7.9-10.9-2.9L416 75l-55.2 31.3 27.9 47.4c2.2 3.8.9 8.5-2.9 10.7l-13.8 7.8c-3.8 2.2-8.7.9-10.9-2.9L333.2 122 278 153.3 337.8 255c2.2 3.7.9 8.5-2.9 10.7l-13.8 7.8c-3.8 2.2-8.7.9-10.9-2.9l-59.7-101.7-55.2 31.3 27.9 47.4c2.2 3.8.9 8.5-2.9 10.7l-13.8 7.8c-3.8 2.2-8.7.9-10.9-2.9l-27.9-47.5-55.2 31.3 59.7 101.7c2.2 3.7.9 8.5-2.9 10.7l-13.8 7.8c-3.8 2.2-8.7.9-10.9-2.9L84.9 262.9l-69 39.1C.7 310.7-4.6 329.8 4.2 344.8l79.6 135.6c8.8 15 28.3 20.1 43.5 11.5L624.1 210c15.2-8.6 20.4-27.8 11.6-42.8z" /></svg>
|
||||
<span>{$_('tracks')}</span>
|
||||
</a>
|
||||
{/if}
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('CARD:GET')}
|
||||
<a
|
||||
class:bg-gray-100={$router.path === '/cards/'}
|
||||
class="flex items-center px-4 py-3 transition cursor-pointer group hover:bg-gray-100 hover:text-gray-900"
|
||||
href="/cards/">
|
||||
<svg
|
||||
class="flex-shrink-0 w-5 h-5 mr-2 text-gray-400 transition group-hover:text-gray-600"
|
||||
fill="currentColor"
|
||||
width="24"
|
||||
height="24"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24">
|
||||
<path fill="none" d="M0 0h24v24H0z" />
|
||||
<path
|
||||
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>
|
||||
<span>{$_('cards')}</span>
|
||||
</a>
|
||||
{/if}
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('SCAN:GET')}
|
||||
<a
|
||||
class:bg-gray-100={$router.path === '/scans/'}
|
||||
class="flex items-center px-4 py-3 transition cursor-pointer group hover:bg-gray-100 hover:text-gray-900"
|
||||
href="/scans/">
|
||||
<svg
|
||||
class="flex-shrink-0 w-5 h-5 mr-2 text-gray-400 transition group-hover:text-gray-600"
|
||||
fill="currentColor"
|
||||
width="24"
|
||||
height="24"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z" />
|
||||
<path
|
||||
fill="currentColor"
|
||||
d="M2 4h2v16H2V4zm4 0h1v16H6V4zm2 0h2v16H8V4zm3 0h2v16h-2V4zm3 0h2v16h-2V4zm3 0h1v16h-1V4zm2 0h3v16h-3V4z" /></svg>
|
||||
<span>Scans</span>
|
||||
</a>
|
||||
{/if}
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('CONTACT:GET')}
|
||||
<a
|
||||
class:bg-gray-100={$router.path === '/contacts/'}
|
||||
class="flex items-center px-4 py-3 transition cursor-pointer group hover:bg-gray-100 hover:text-gray-900"
|
||||
href="/contacts/">
|
||||
<svg
|
||||
fill="currentColor"
|
||||
class="flex-shrink-0 w-5 h-5 mr-2 text-gray-400 transition group-hover:text-gray-600"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
width="24"
|
||||
height="24"><path fill="none" d="M0 0h24v24H0z" />
|
||||
<path
|
||||
d="M2 22a8 8 0 1 1 16 0H2zm8-9c-3.315 0-6-2.685-6-6s2.685-6 6-6 6 2.685 6 6-2.685 6-6 6zm10 4h4v2h-4v-2zm-3-5h7v2h-7v-2zm2-5h5v2h-5V7z" /></svg>
|
||||
<span>{$_('contacts')}</span>
|
||||
</a>
|
||||
{/if}
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('STATION:GET')}
|
||||
<a
|
||||
class:bg-gray-100={$router.path === '/scanstations/'}
|
||||
class="flex items-center px-4 py-3 transition cursor-pointer group hover:bg-gray-100 hover:text-gray-900"
|
||||
href="/scanstations/">
|
||||
<svg
|
||||
class="flex-shrink-0 w-5 h-5 mr-2 text-gray-400 transition group-hover:text-gray-600"
|
||||
fill="currentColor"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg"><path
|
||||
fill="none"
|
||||
d="M0 0h24v24H0z" />
|
||||
<path
|
||||
fill="currentColor"
|
||||
d="M4 5v11h16V5H4zM2 4a1 1 0 011-1h18a1 1 0 011 1v14H2V4zM1 19h22v2H1v-2z" /></svg>
|
||||
<span>{$_('scanstations')}</span>
|
||||
</a>
|
||||
{/if}
|
||||
<a
|
||||
class:bg-gray-100={$router.path === '/settings/'}
|
||||
class="flex items-center px-4 py-3 transition cursor-pointer group hover:bg-gray-100 hover:text-gray-900"
|
||||
href="/settings/">
|
||||
<svg
|
||||
class="flex-shrink-0 w-5 h-5 mr-2 text-gray-400 transition group-hover:text-gray-600"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 20 20"
|
||||
fill="currentColor">
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
d="M11.49 3.17c-.38-1.56-2.6-1.56-2.98 0a1.532 1.532 0 01-2.286.948c-1.372-.836-2.942.734-2.106 2.106.54.886.061 2.042-.947 2.287-1.561.379-1.561 2.6 0 2.978a1.532 1.532 0 01.947 2.287c-.836 1.372.734 2.942 2.106 2.106a1.532 1.532 0 012.287.947c.379 1.561 2.6 1.561 2.978 0a1.533 1.533 0 012.287-.947c1.372.836 2.942-.734 2.106-2.106a1.533 1.533 0 01.947-2.287c1.561-.379 1.561-2.6 0-2.978a1.532 1.532 0 01-.947-2.287c.836-1.372-.734-2.942-2.106-2.106a1.532 1.532 0 01-2.287-.947zM10 13a3 3 0 100-6 3 3 0 000 6z"
|
||||
clip-rule="evenodd" />
|
||||
</svg>
|
||||
<span>{$_('settings')}</span>
|
||||
</a>
|
||||
<a
|
||||
class:bg-gray-100={$router.path === '/about/'}
|
||||
class="flex items-center px-4 py-3 transition cursor-pointer group hover:bg-gray-100 hover:text-gray-900"
|
||||
href="/about/">
|
||||
<svg
|
||||
class="flex-shrink-0 w-5 h-5 mr-2 text-gray-400 transition group-hover:text-gray-600"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
viewBox="0 0 24 24"><circle cx="12" cy="12" r="10" />
|
||||
<path d="M12 16v-4M12 8h.01" /></svg>
|
||||
<span>{$_('about')}</span>
|
||||
</a>
|
||||
<span
|
||||
tabindex="0"
|
||||
class="flex items-center px-4 py-3 transition cursor-pointer group hover:bg-gray-100 hover:text-gray-900"
|
||||
on:click={() => {
|
||||
AuthService.authControllerLogout();
|
||||
logout();
|
||||
}}>
|
||||
<svg
|
||||
class="flex-shrink-0 w-5 h-5 mr-2 text-gray-400 transition group-hover:text-gray-600"
|
||||
fill="currentColor"
|
||||
width="24"
|
||||
height="24"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z" />
|
||||
<path
|
||||
d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2a9.985 9.985 0 0 1 8 4h-2.71a8 8 0 1 0 .001 12h2.71A9.985 9.985 0 0 1 12 22zm7-6v-3h-8v-2h8V8l5 4-5 4z" /></svg>
|
||||
<span>{$_('logout')}</span>
|
||||
</span>
|
||||
</nav>
|
||||
</nav>
|
||||
<div class="ml-0 transition md:ml-60">
|
||||
<header
|
||||
on:click={() => {
|
||||
navOpen = true;
|
||||
}}
|
||||
class="flex items-center justify-between w-full px-4 bg-white border-b h-14 md:hidden">
|
||||
<button class="block btn btn-light md:hidden">
|
||||
<span class="sr-only">Menu</span><svg
|
||||
class="w-4 h-4"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 20 20"
|
||||
fill="currentcolor"><path
|
||||
fill-rule="evenodd"
|
||||
d="M3 5a1 1 0 011-1h12a1 1 0 110 2H4A1 1 0 013 5zm0 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm0 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z"
|
||||
clip-rule="evenodd" /></svg></button>
|
||||
</header>
|
||||
<slot>
|
||||
<NoComponentLoaded />
|
||||
</slot>
|
||||
</div>
|
||||
<div
|
||||
on:click={() => {
|
||||
navOpen = false;
|
||||
}}
|
||||
class:hidden={!navOpen}
|
||||
class="fixed inset-0 z-10 w-screen h-screen bg-black bg-opacity-25 md:hidden" />
|
||||
</section>
|
@@ -1,8 +1,7 @@
|
||||
<script>
|
||||
import { _ } from "svelte-i18n";
|
||||
import StatCards from "./StatCards.svelte";
|
||||
import store from "../store";
|
||||
import ComponentDump from "./ComponentDump.svelte";
|
||||
import store from "../../store";
|
||||
let navOpen = false;
|
||||
</script>
|
||||
|
||||
@@ -11,15 +10,13 @@
|
||||
on:click={() => {
|
||||
navOpen = false;
|
||||
}}>
|
||||
<!-- <div class="border-4 border-dashed rounded h-96" /> -->
|
||||
<h1 class="text-3xl leading-tight">
|
||||
<span class="font-extrabold">{$_('dashboard-title')}</span> <span>
|
||||
<span class="font-extrabold">{$_('dashboard-title')}</span>
|
||||
<span>
|
||||
-
|
||||
{$_('dashboard-greeting')},
|
||||
<span
|
||||
class="text-blue-500">{store.state.jwtinfo.userdetails.firstname}</span>
|
||||
👋</span>
|
||||
class="text-blue-500">{store.state.jwtinfo.userdetails.firstname} {store.state.jwtinfo.userdetails.lastname}</span></span>
|
||||
</h1>
|
||||
<StatCards />
|
||||
<ComponentDump />
|
||||
</div>
|
@@ -18,7 +18,7 @@
|
||||
class="flex flex-col lg:flex-row w-full lg:space-x-2 space-y-2 lg:space-y-0 mb-2 lg:mb-4">
|
||||
<a href="/runners/" class="w-full lg:w-1/4">
|
||||
<div
|
||||
class="widget w-full p-4 rounded-lg bg-white border border-grey-100 dark:bg-grey-895 dark:border-grey-890 dark:bg-gray-900 dark:text-white">
|
||||
class="widget w-full p-4 rounded-lg bg-white border border-grey-100">
|
||||
<div class="flex flex-row items-center justify-between">
|
||||
<div class="flex flex-col">
|
||||
<div class="text-xs uppercase font-light text-grey-500">
|
||||
@@ -39,7 +39,7 @@
|
||||
</a>
|
||||
<div class="w-full lg:w-1/4">
|
||||
<div
|
||||
class="widget w-full p-4 rounded-lg bg-white border border-grey-100 dark:bg-grey-895 dark:border-grey-890 dark:bg-gray-900 dark:text-white">
|
||||
class="widget w-full p-4 rounded-lg bg-white border border-grey-100">
|
||||
<div class="flex flex-row items-center justify-between">
|
||||
<div class="flex flex-col">
|
||||
<div class="text-xs uppercase font-light text-grey-500">
|
||||
@@ -64,7 +64,7 @@
|
||||
</div>
|
||||
<div class="w-full lg:w-1/4">
|
||||
<div
|
||||
class="widget w-full p-4 rounded-lg bg-white border border-grey-100 dark:bg-grey-895 dark:border-grey-890 dark:bg-gray-900 dark:text-white">
|
||||
class="widget w-full p-4 rounded-lg bg-white border border-grey-100">
|
||||
<div class="flex flex-row items-center justify-between">
|
||||
<div class="flex flex-col">
|
||||
<div class="text-xs uppercase font-light text-grey-500">
|
||||
@@ -83,7 +83,7 @@
|
||||
</div>
|
||||
<div class="w-full lg:w-1/4">
|
||||
<div
|
||||
class="widget w-full p-4 rounded-lg bg-white border border-grey-100 dark:bg-grey-895 dark:border-grey-890 dark:bg-gray-900 dark:text-white">
|
||||
class="widget w-full p-4 rounded-lg bg-white border border-grey-100">
|
||||
<div class="flex flex-row items-center justify-between">
|
||||
<div class="flex flex-col">
|
||||
<div class="text-xs uppercase font-light text-grey-500">
|
||||
@@ -106,7 +106,7 @@
|
||||
</div>
|
||||
<a href="/teams/" class="w-full lg:w-1/4">
|
||||
<div
|
||||
class="widget w-full p-4 rounded-lg bg-white border border-grey-100 dark:bg-grey-895 dark:border-grey-890 dark:bg-gray-900 dark:text-white">
|
||||
class="widget w-full p-4 rounded-lg bg-white border border-grey-100">
|
||||
<div class="flex flex-row items-center justify-between">
|
||||
<div class="flex flex-col">
|
||||
<div class="text-xs uppercase font-light text-grey-500">
|
||||
@@ -135,7 +135,7 @@
|
||||
</a>
|
||||
<a href="/orgs/" class="w-full lg:w-1/4">
|
||||
<div
|
||||
class="widget w-full p-4 rounded-lg bg-white border border-grey-100 dark:bg-grey-895 dark:border-grey-890 dark:bg-gray-900 dark:text-white">
|
||||
class="widget w-full p-4 rounded-lg bg-white border border-grey-100">
|
||||
<div class="flex flex-row items-center justify-between">
|
||||
<div class="flex flex-col">
|
||||
<div class="text-xs uppercase font-light text-grey-500">
|
295
src/components/donations/AddDonationModal.svelte
Normal file
295
src/components/donations/AddDonationModal.svelte
Normal file
@@ -0,0 +1,295 @@
|
||||
<script>
|
||||
import { _ } from "svelte-i18n";
|
||||
import { clickOutside } from "../base/outsideclick";
|
||||
import { focusTrap } from "svelte-focus-trap";
|
||||
import {
|
||||
DonationService,
|
||||
DonorService,
|
||||
RunnerService,
|
||||
} from "@odit/lfk-client-js";
|
||||
import Select from "svelte-select";
|
||||
import Toastify from "toastify-js";
|
||||
export let modal_open;
|
||||
export let current_donations;
|
||||
const getDonorLabel = (option) =>
|
||||
option.firstname + " " + (option.middlename || "") + " " + option.lastname;
|
||||
const filterDonors = (label, filterText, option) =>
|
||||
label.toLowerCase().includes(filterText.toLowerCase()) ||
|
||||
option.value.id.toString().startsWith(filterText.toLowerCase());
|
||||
function focus(el) {
|
||||
el.focus();
|
||||
}
|
||||
$: donor = 0;
|
||||
$: runner = 0;
|
||||
$: donors = [];
|
||||
$: runners = [];
|
||||
$: is_fixed = false;
|
||||
DonorService.donorControllerGetAll().then((val) => {
|
||||
donors = val.map((r) => {
|
||||
return { label: getDonorLabel(r), value: r };
|
||||
});
|
||||
});
|
||||
RunnerService.runnerControllerGetAll().then((val) => {
|
||||
runners = val.map((r) => {
|
||||
return { label: getDonorLabel(r), value: r };
|
||||
});
|
||||
});
|
||||
$: amount_input = 0;
|
||||
$: processed_last_submit = true;
|
||||
$: is_amount_valid = amount_input > 0;
|
||||
$: createbtnenabled = is_amount_valid;
|
||||
(() => {
|
||||
document.onkeydown = (e) => {
|
||||
e = e || window.event;
|
||||
if (e.key === "Escape") {
|
||||
modal_open = false;
|
||||
}
|
||||
if (e.keyCode === 13) {
|
||||
if (createbtnenabled === true) {
|
||||
createbtnenabled = false;
|
||||
submit();
|
||||
}
|
||||
}
|
||||
};
|
||||
})();
|
||||
function submit() {
|
||||
if (processed_last_submit === true) {
|
||||
let amount_cent = Math.floor(amount_input * 100);
|
||||
processed_last_submit = false;
|
||||
const toast = Toastify({
|
||||
text: "adding donation",
|
||||
duration: -1,
|
||||
}).showToast();
|
||||
if (is_fixed) {
|
||||
let postdata = {
|
||||
donor,
|
||||
amount: amount_cent,
|
||||
};
|
||||
DonationService.donationControllerPostFixed(postdata)
|
||||
.then((result) => {
|
||||
donor = donors[0].id || 0;
|
||||
runner = runners[0].id || 0;
|
||||
amount_input = 0;
|
||||
modal_open = false;
|
||||
//
|
||||
Toastify({
|
||||
text: "donation_added",
|
||||
duration: 500,
|
||||
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
|
||||
}).showToast();
|
||||
current_donations.push(result);
|
||||
current_donations = current_donations;
|
||||
})
|
||||
.catch((err) => {
|
||||
//
|
||||
})
|
||||
.finally(() => {
|
||||
processed_last_submit = true;
|
||||
//
|
||||
toast.hideToast();
|
||||
});
|
||||
} else {
|
||||
let postdata = {
|
||||
donor,
|
||||
runner,
|
||||
amountPerDistance: amount_cent,
|
||||
};
|
||||
DonationService.donationControllerPostDistance(postdata)
|
||||
.then((result) => {
|
||||
donor = donors[0].id || 0;
|
||||
runner = runners[0].id || 0;
|
||||
amount_input = 0;
|
||||
modal_open = false;
|
||||
//
|
||||
Toastify({
|
||||
text: "donation_added",
|
||||
duration: 500,
|
||||
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
|
||||
}).showToast();
|
||||
current_donations.push(result);
|
||||
current_donations = current_donations;
|
||||
})
|
||||
.catch((err) => {
|
||||
//
|
||||
})
|
||||
.finally(() => {
|
||||
processed_last_submit = true;
|
||||
//
|
||||
toast.hideToast();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
input:before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
width: 1.25rem;
|
||||
height: 1.25rem;
|
||||
border-radius: 50%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
transform: scale(1.1);
|
||||
box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.2);
|
||||
background-color: white;
|
||||
transition: 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
input:checked {
|
||||
/* @apply: bg-indigo-400; */
|
||||
background-color: #7f9cf5;
|
||||
}
|
||||
|
||||
input:checked:before {
|
||||
left: 1.25rem;
|
||||
}
|
||||
</style>
|
||||
|
||||
{#if modal_open}
|
||||
<div
|
||||
class="fixed z-10 inset-0 overflow-y-auto"
|
||||
use:focusTrap
|
||||
use:clickOutside
|
||||
on:click_outside={() => {
|
||||
modal_open = false;
|
||||
}}>
|
||||
<div
|
||||
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="absolute inset-0 bg-gray-500 opacity-75"
|
||||
data-id="modal_backdrop" />
|
||||
</div>
|
||||
<span
|
||||
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"
|
||||
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">
|
||||
<svg
|
||||
class="h-6 w-6 text-blue-600"
|
||||
fill="currentColor"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
width="24"
|
||||
height="24"><path fill="none" d="M0 0h24v24H0z" />
|
||||
<path
|
||||
d="M14 2a8 8 0 013.3 15.3A8 8 0 116.7 6.7 8 8 0 0114 2zm-3 7H9v1a2.5 2.5 0 00-.16 5h2.25a.5.5 0 010 1H7v2h2v1h2v-1a2.5 2.5 0 00.16-5H8.91a.5.5 0 010-1H13v-2h-2V9zm3-5a5.99 5.99 0 00-4.48 2.01 8 8 0 018.47 8.47A6 6 0 0014 4z" /></svg>
|
||||
</div>
|
||||
<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">
|
||||
{#if is_fixed}
|
||||
{$_('create-a-new-fixed-donation')}
|
||||
{:else}{$_('create-a-new-distance-donation')}{/if}
|
||||
</h3>
|
||||
<label class="content-center align-middle object-center">
|
||||
<span
|
||||
class="ml-2 text-base"
|
||||
class:text-gray-300={is_fixed}>{$_('distance-donation')}</span>
|
||||
<input
|
||||
class="relative w-10 h-5 transition-all duration-200 ease-in-out bg-gray-400 rounded-full shadow-inner outline-none appearance-none align-middle"
|
||||
type="checkbox"
|
||||
bind:checked={is_fixed} />
|
||||
<span
|
||||
class="ml-2 text-base "
|
||||
class:text-gray-300={!is_fixed}>{$_('fixed-donation')}</span>
|
||||
</label>
|
||||
<div class="mt-2 mb-6">
|
||||
<p class="text-sm text-gray-500">
|
||||
{$_('please-provide-the-nessecary-information-to-create-a-new-donation')}
|
||||
</p>
|
||||
</div>
|
||||
<div class="grid grid-cols-6 gap-6">
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="donor"
|
||||
class="block text-sm font-medium text-gray-700">{$_('donor')}</label>
|
||||
<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"
|
||||
itemFilter={(label, filterText, option) => filterDonors(label, filterText, option)}
|
||||
items={donors}
|
||||
showChevron={true}
|
||||
placeholder={$_('search-for-donor-name-or-id')}
|
||||
noOptionsMessage={$_('no-donors-found')}
|
||||
on:select={(selectedValue) => (donor = selectedValue.detail.value.id)}
|
||||
on:clear={() => (donors = null)} />
|
||||
</div>
|
||||
{#if !is_fixed}
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="donor"
|
||||
class="block text-sm font-medium text-gray-700">{$_('runner')}</label>
|
||||
<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"
|
||||
itemFilter={(label, filterText, option) => filterDonors(label, filterText, option)}
|
||||
items={runners}
|
||||
showChevron={true}
|
||||
placeholder={$_('search-for-runner-by-name-or-id')}
|
||||
noOptionsMessage={$_('no-runners-found')}
|
||||
on:select={(selectedValue) => (runner = selectedValue.detail.value.id)}
|
||||
on:clear={() => (runner = null)} />
|
||||
</div>
|
||||
{/if}
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="donation_amount_eur"
|
||||
class="block text-sm font-medium text-gray-700">
|
||||
{#if !is_fixed}
|
||||
{$_('amount-per-kilometer')}
|
||||
{:else}{$_('donation-amount')}{/if}</label>
|
||||
<div class="mt-1 flex rounded-md shadow-sm">
|
||||
<input
|
||||
autocomplete="off"
|
||||
class:border-red-500={!is_amount_valid}
|
||||
class:focus:border-red-500={!is_amount_valid}
|
||||
class:focus:ring-red-500={!is_amount_valid}
|
||||
bind:value={amount_input}
|
||||
type="number"
|
||||
step="0.01"
|
||||
name="donation_amount_eur"
|
||||
class="focus:ring-indigo-500 focus:border-indigo-500 flex-1 block w-full rounded-none rounded-l-md sm:text-sm border-gray-300 border bg-gray-50 text-gray-500 p-2"
|
||||
placeholder="2.00" />
|
||||
<span
|
||||
class="inline-flex items-center px-3 rounded-r-md border border-gray-300 bg-gray-50 text-gray-500 text-sm">€</span>
|
||||
</div>
|
||||
{#if !is_amount_valid}
|
||||
<span
|
||||
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
|
||||
{$_('donation-amount-must-be-greater-that-0-00eur')}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse">
|
||||
<button
|
||||
disabled={!createbtnenabled}
|
||||
class:opacity-50={!createbtnenabled}
|
||||
on:click={submit}
|
||||
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')}
|
||||
</button>
|
||||
<button
|
||||
on:click={() => {
|
||||
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">
|
||||
{$_('cancel')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
286
src/components/donations/DonationDetail.svelte
Normal file
286
src/components/donations/DonationDetail.svelte
Normal file
@@ -0,0 +1,286 @@
|
||||
<script>
|
||||
import { _ } from "svelte-i18n";
|
||||
import store from "../../store";
|
||||
import {
|
||||
DonationService,
|
||||
DonorService,
|
||||
RunnerService,
|
||||
} from "@odit/lfk-client-js";
|
||||
import Toastify from "toastify-js";
|
||||
import PromiseError from "../base/PromiseError.svelte";
|
||||
import Select from "svelte-select";
|
||||
let data_loaded = false;
|
||||
export let params;
|
||||
$: delete_triggered = false;
|
||||
$: original_data = {};
|
||||
$: editable = {};
|
||||
$: donor = {};
|
||||
$: runner = {};
|
||||
$: current_donors = [];
|
||||
$: current_runners = [];
|
||||
$: amount_input = 0;
|
||||
$: is_amount_valid = amount_input > 0;
|
||||
$: is_everything_set =
|
||||
editable.donor != null &&
|
||||
((original_data.responseType == "DISTANCEDONATION" &&
|
||||
editable?.runner != null) ||
|
||||
original_data.responseType !== "DISTANCEDONATION");
|
||||
$: changes_performed =
|
||||
!(JSON.stringify(original_data) === JSON.stringify(editable)) ||
|
||||
(original_data.responseType == "DISTANCEDONATION" &&
|
||||
!(Math.floor(amount_input * 100) === original_data.amountPerDistance)) ||
|
||||
(original_data.responseType !== "DISTANCEDONATION" &&
|
||||
!(Math.floor(amount_input * 100) === original_data.amount));
|
||||
$: save_enabled = changes_performed && is_amount_valid && is_everything_set;
|
||||
|
||||
const promise = DonationService.donationControllerGetOne(
|
||||
params.donationid
|
||||
).then((data) => {
|
||||
data_loaded = true;
|
||||
original_data = Object.assign(original_data, data);
|
||||
editable = Object.assign(editable, original_data);
|
||||
if (data.responseType == "DISTANCEDONATION") {
|
||||
amount_input = data.amountPerDistance / 100;
|
||||
RunnerService.runnerControllerGetAll().then((val) => {
|
||||
current_runners = val.map((r) => {
|
||||
return { label: getDonorLabel(r), value: r };
|
||||
});
|
||||
runner = current_runners.find((g) => g.value.id == editable.runner.id);
|
||||
});
|
||||
} else {
|
||||
amount_input = data.amount / 100;
|
||||
}
|
||||
DonorService.donorControllerGetAll().then((val) => {
|
||||
current_donors = val.map((r) => {
|
||||
return { label: getDonorLabel(r), value: r };
|
||||
});
|
||||
donor = current_donors.find((g) => g.value.id == editable.donor.id);
|
||||
});
|
||||
});
|
||||
const getDonorLabel = (option) =>
|
||||
option.firstname + " " + (option.middlename || "") + " " + option.lastname;
|
||||
const filterDonors = (label, filterText, option) =>
|
||||
label.toLowerCase().includes(filterText.toLowerCase()) ||
|
||||
option.value.id.toString().startsWith(filterText.toLowerCase());
|
||||
|
||||
function submit() {
|
||||
if (data_loaded === true && save_enabled) {
|
||||
Toastify({
|
||||
text: "Donation is being updated",
|
||||
duration: 2500,
|
||||
}).showToast();
|
||||
let postdata = {};
|
||||
if (original_data.responseType === "DISTANCEDONATION") {
|
||||
editable.amountPerDistance = Math.floor(amount_input * 100);
|
||||
postdata = Object.assign(postdata, editable);
|
||||
postdata.runner = postdata.runner.id;
|
||||
postdata.donor = postdata.donor.id;
|
||||
DonationService.donationControllerPutDistance(
|
||||
original_data.id,
|
||||
postdata
|
||||
)
|
||||
.then((resp) => {
|
||||
Object.assign(original_data, editable);
|
||||
original_data = original_data;
|
||||
Toastify({
|
||||
text: "updated donation",
|
||||
duration: 2500,
|
||||
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
|
||||
}).showToast();
|
||||
})
|
||||
.catch((err) => {});
|
||||
} else {
|
||||
editable.amount = Math.floor(amount_input * 100);
|
||||
postdata = Object.assign(postdata, editable);
|
||||
postdata.donor = postdata.donor.id;
|
||||
DonationService.donationControllerPutFixed(original_data.id, postdata)
|
||||
.then((resp) => {
|
||||
Object.assign(original_data, editable);
|
||||
original_data = original_data;
|
||||
Toastify({
|
||||
text: "updated donation",
|
||||
duration: 2500,
|
||||
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
|
||||
}).showToast();
|
||||
})
|
||||
.catch((err) => {});
|
||||
}
|
||||
} else {
|
||||
}
|
||||
}
|
||||
function deleteDonation() {
|
||||
DonationService.donationControllerRemove(original_data.id, false)
|
||||
.then((resp) => {
|
||||
Toastify({
|
||||
text: "Donation delete",
|
||||
duration: 500,
|
||||
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
|
||||
}).showToast();
|
||||
location.replace("./");
|
||||
})
|
||||
.catch((err) => {
|
||||
modal_open = true;
|
||||
delete_donor = original_data;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
{#await promise}
|
||||
{$_('loading-donation-details')}
|
||||
{:then}
|
||||
<section class="container p-5 select-none">
|
||||
<div class="flex flex-row mb-4">
|
||||
<div class="w-full">
|
||||
<nav class="w-full flex">
|
||||
<ol class="list-none flex flex-row items-center justify-start">
|
||||
<li class="flex items-center">
|
||||
<svg
|
||||
fill="currentColor"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
width="24"
|
||||
height="24"><path fill="none" d="M0 0h24v24H0z" />
|
||||
<path
|
||||
d="M14 2a8 8 0 013.3 15.3A8 8 0 116.7 6.7 8 8 0 0114 2zm-3 7H9v1a2.5 2.5 0 00-.16 5h2.25a.5.5 0 010 1H7v2h2v1h2v-1a2.5 2.5 0 00.16-5H8.91a.5.5 0 010-1H13v-2h-2V9zm3-5a5.99 5.99 0 00-4.48 2.01 8 8 0 018.47 8.47A6 6 0 0014 4z" /></svg>
|
||||
</li>
|
||||
<li class="flex items-center ml-2">
|
||||
<a class="mr-2" href="./">{$_('donations')}</a><svg
|
||||
stroke="currentColor"
|
||||
fill="none"
|
||||
stroke-width="2"
|
||||
viewBox="0 0 24 24"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
class="h-3 w-3 mr-2 stroke-current"
|
||||
height="1em"
|
||||
width="1em"
|
||||
xmlns="http://www.w3.org/2000/svg"><line
|
||||
x1="5"
|
||||
y1="12"
|
||||
x2="19"
|
||||
y2="12" />
|
||||
<polyline points="12 5 19 12 12 19" /></svg>
|
||||
</li>
|
||||
<li class="flex items-center">
|
||||
<span class="mr-2">{original_data.id}</span>
|
||||
</li>
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-8 text-3xl font-extrabold leading-tight">
|
||||
{original_data.donor.firstname}
|
||||
{original_data.donor.middlename || ''}
|
||||
{original_data.donor.lastname}
|
||||
>
|
||||
{#if original_data.responseType == 'DISTANCEDONATION'}
|
||||
{original_data.runner.firstname}
|
||||
{original_data.runner.middlename || ''}
|
||||
{original_data.runner.lastname}
|
||||
{:else}
|
||||
{$_('fixed-donation')}:
|
||||
{amount_input.toFixed(2).toLocaleString('de-DE', { valute: 'EUR' })}€
|
||||
{/if}
|
||||
<span data-id="donation_actions_${original_data.id}">
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('DONATION:DELETE')}
|
||||
{#if delete_triggered}
|
||||
<button
|
||||
on:click={deleteDonation}
|
||||
class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:">{$_('confirm-deletion')}</button>
|
||||
<button
|
||||
on:click={() => {
|
||||
delete_triggered = !delete_triggered;
|
||||
}}
|
||||
class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-400 text-base font-medium text-white sm:w-auto sm:">{$_('cancel')}</button>
|
||||
{/if}
|
||||
{#if !delete_triggered}
|
||||
<button
|
||||
on:click={() => {
|
||||
delete_triggered = true;
|
||||
}}
|
||||
type="button"
|
||||
class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:">{$_('delete-donation')}</button>
|
||||
{/if}
|
||||
{/if}
|
||||
{#if !delete_triggered}
|
||||
<button
|
||||
disabled={!save_enabled}
|
||||
class:opacity-50={!save_enabled}
|
||||
type="button"
|
||||
on:click={submit}
|
||||
class="w-full 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:">{$_('save-changes')}</button>
|
||||
{/if}
|
||||
</span>
|
||||
</div>
|
||||
<!-- -->
|
||||
<div>
|
||||
<span
|
||||
class="font-medium text-gray-700">{$_('total-donation-amount')}:</span>
|
||||
<span>{(editable.amount / 100)
|
||||
.toFixed(2)
|
||||
.toLocaleString('de-DE', { valute: 'EUR' })}€</span>
|
||||
</div>
|
||||
<div class=" w-full">
|
||||
<label
|
||||
for="donor"
|
||||
class="block font-medium text-gray-700">{$_('donor')}</label>
|
||||
<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"
|
||||
itemFilter={(label, filterText, option) => filterDonors(label, filterText, option)}
|
||||
items={current_donors}
|
||||
showChevron={true}
|
||||
placeholder={$_('search-for-donor-name-or-id')}
|
||||
noOptionsMessage={$_('no-donors-found')}
|
||||
bind:selectedValue={donor}
|
||||
on:select={(selectedValue) => (editable.donor = selectedValue.detail.value)}
|
||||
on:clear={() => (editable.donor = null)} />
|
||||
</div>
|
||||
{#if original_data.responseType == 'DISTANCEDONATION'}
|
||||
<div class=" w-full">
|
||||
<label
|
||||
for="donor"
|
||||
class="block font-medium text-gray-700">{$_('runner')}</label>
|
||||
<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"
|
||||
itemFilter={(label, filterText, option) => filterDonors(label, filterText, option)}
|
||||
items={current_runners}
|
||||
showChevron={true}
|
||||
placeholder={$_('search-for-runner-by-name-or-id')}
|
||||
noOptionsMessage={$_('no-runners-found')}
|
||||
bind:selectedValue={runner}
|
||||
on:select={(selectedValue) => (editable.runner = selectedValue.detail.value)}
|
||||
on:clear={() => (editable.runner = null)} />
|
||||
</div>
|
||||
{/if}
|
||||
<div class=" w-full">
|
||||
<label for="lastname" class="font-medium text-gray-700">
|
||||
{#if original_data.responseType == 'DISTANCEDONATION'}
|
||||
{$_('amount-per-kilometer')}
|
||||
{:else}{$_('donation-amount')}{/if}
|
||||
</label>
|
||||
<div class="mt-1 flex rounded-md shadow-sm">
|
||||
<input
|
||||
autocomplete="off"
|
||||
class:border-red-500={!is_amount_valid}
|
||||
class:focus:border-red-500={!is_amount_valid}
|
||||
class:focus:ring-red-500={!is_amount_valid}
|
||||
bind:value={amount_input}
|
||||
type="number"
|
||||
step="0.01"
|
||||
name="donation_amount_eur"
|
||||
class="focus:ring-indigo-500 focus:border-indigo-500 flex-1 block w-full rounded-none rounded-l-md sm: border-gray-300 border bg-gray-50 text-gray-500 p-2"
|
||||
placeholder="2.00" />
|
||||
<span
|
||||
class="inline-flex items-center px-3 rounded-r-md border border-gray-300 bg-gray-50 text-gray-500 ">€</span>
|
||||
</div>
|
||||
{#if !is_amount_valid}
|
||||
<span
|
||||
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
|
||||
{$_('donation-amount-must-be-greater-that-0-00eur')}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
</section>
|
||||
{:catch error}
|
||||
<PromiseError {error} />
|
||||
{/await}
|
29
src/components/donations/Donations.svelte
Normal file
29
src/components/donations/Donations.svelte
Normal file
@@ -0,0 +1,29 @@
|
||||
<script>
|
||||
import { _ } from "svelte-i18n";
|
||||
import store from "../../store";
|
||||
import AddDonationModal from "./AddDonationModal.svelte";
|
||||
import DonationsOverview from "./DonationsOverview.svelte";
|
||||
$: current_donations = [];
|
||||
export let modal_open = false;
|
||||
</script>
|
||||
|
||||
<section class="container p-5">
|
||||
<span class="mb-1 text-3xl font-extrabold leading-tight">
|
||||
{$_('donations')}
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('DONATION:CREATE')}
|
||||
<button
|
||||
on:click={() => {
|
||||
modal_open = true;
|
||||
}}
|
||||
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">
|
||||
{$_('add-donation')}
|
||||
</button>
|
||||
{/if}
|
||||
</span>
|
||||
<DonationsOverview bind:current_donations />
|
||||
</section>
|
||||
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('DONATION:CREATE')}
|
||||
<AddDonationModal bind:current_donations bind:modal_open />
|
||||
{/if}
|
12
src/components/donations/DonationsEmptyState.svelte
Normal file
12
src/components/donations/DonationsEmptyState.svelte
Normal file
@@ -0,0 +1,12 @@
|
||||
<script>
|
||||
import { _ } from "svelte-i18n";
|
||||
import donations_empty from "./donations.svg";
|
||||
</script>
|
||||
|
||||
<div class="text-center items-center justify-center">
|
||||
<p class="mb-16 text-lg text-gray-500">
|
||||
<img class="m-auto" style="height:15rem" src={donations_empty} alt="" />
|
||||
<span class="font-bold">{$_('there-are-no-donations-yet')}</span><br />
|
||||
<span>{$_('add-your-fist-donation')}</span>
|
||||
</p>
|
||||
</div>
|
194
src/components/donations/DonationsOverview.svelte
Normal file
194
src/components/donations/DonationsOverview.svelte
Normal file
@@ -0,0 +1,194 @@
|
||||
<script>
|
||||
import { getLocaleFromNavigator, _ } from "svelte-i18n";
|
||||
import { DonationService, DonorService } from "@odit/lfk-client-js";
|
||||
import store from "../../store";
|
||||
import Toastify from "toastify-js";
|
||||
import DonationsEmptyState from "./DonationsEmptyState.svelte";
|
||||
$: searchvalue = "";
|
||||
$: active_deletes = [];
|
||||
export let current_donations = [];
|
||||
const donations_promise = DonationService.donationControllerGetAll().then(
|
||||
(val) => {
|
||||
current_donations = val;
|
||||
}
|
||||
);
|
||||
function should_display_based_on_id(id) {
|
||||
if (searchvalue.toString().slice(-1) === "*") {
|
||||
return id.toString().startsWith(searchvalue.replace("*", ""));
|
||||
}
|
||||
return id.toString() === searchvalue;
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('DONATION:GET')}
|
||||
{#await donations_promise}
|
||||
<div
|
||||
class="bg-teal-lightest border-t-4 border-teal rounded-b text-teal-darkest px-4 py-3 shadow-md my-2"
|
||||
role="alert">
|
||||
<p class="font-bold">donations are being loaded</p>
|
||||
<p class="text-sm">{$_('this-might-take-a-moment')}</p>
|
||||
</div>
|
||||
{:then}
|
||||
{#if current_donations.length === 0}
|
||||
<DonationsEmptyState />
|
||||
{:else}
|
||||
<input
|
||||
type="search"
|
||||
bind:value={searchvalue}
|
||||
placeholder={$_('datatable.search')}
|
||||
aria-label={$_('datatable.search')}
|
||||
class="gridjs-input gridjs-search-input mb-4" />
|
||||
<div
|
||||
class="shadow border-b border-gray-200 sm:rounded-lg overflow-x-scroll">
|
||||
<table class="divide-y divide-gray-200 w-full">
|
||||
<thead class="bg-gray-50">
|
||||
<tr>
|
||||
<th
|
||||
scope="col"
|
||||
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
||||
{$_('donor')}
|
||||
</th>
|
||||
<th
|
||||
scope="col"
|
||||
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
||||
{$_('runner')}
|
||||
</th>
|
||||
<th
|
||||
scope="col"
|
||||
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
||||
{$_('amount-per-kilometer')}
|
||||
</th>
|
||||
<th
|
||||
scope="col"
|
||||
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
||||
{$_('donation-amount')}
|
||||
</th>
|
||||
<th scope="col" class="relative px-6 py-3">
|
||||
<span class="sr-only">{$_('action')}</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-200">
|
||||
{#each current_donations as donation}
|
||||
{#if donation.donor.firstname
|
||||
.toLowerCase()
|
||||
.includes(
|
||||
searchvalue.toLowerCase()
|
||||
) || donation.donor.lastname
|
||||
.toLowerCase()
|
||||
.includes(
|
||||
searchvalue.toLowerCase()
|
||||
) || donation.runner?.firstname
|
||||
.toLowerCase()
|
||||
.includes(
|
||||
searchvalue.toLowerCase()
|
||||
) || donation.runner?.lastname
|
||||
.toLowerCase()
|
||||
.includes(
|
||||
searchvalue.toLowerCase()
|
||||
) || should_display_based_on_id(donation.id)}
|
||||
<tr data-rowid="donation_{donation.id}">
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
<div class="flex items-center">
|
||||
<a
|
||||
href="../donors/{donation.donor.id}"
|
||||
class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-gray-100 text-gray-800">{donation.donor.firstname}
|
||||
{donation.donor.middlename || ''}
|
||||
{donation.donor.lastname}</a>
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
{#if donation.runner}
|
||||
<div class="text-sm font-medium text-gray-900">
|
||||
<a
|
||||
href="../runners/{donation.runner.id}"
|
||||
class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-gray-100 text-gray-800">{donation.runner.firstname}
|
||||
{donation.runner.middlename || ''}
|
||||
{donation.runner.lastname}</a>
|
||||
</div>
|
||||
{:else}
|
||||
<div class="text-sm font-medium text-gray-900">
|
||||
{$_('fixed-donation')}
|
||||
</div>
|
||||
{/if}
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
{#if donation.amountPerDistance}
|
||||
<div class="text-sm font-medium text-gray-900">
|
||||
{(donation.amountPerDistance / 100)
|
||||
.toFixed(2)
|
||||
.toLocaleString('de-DE', { valute: 'EUR' })}€
|
||||
</div>
|
||||
{:else}
|
||||
<div class="text-sm font-medium text-gray-900">
|
||||
{$_('fixed-donation')}
|
||||
</div>
|
||||
{/if}
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
<div class="text-sm font-medium text-gray-900">
|
||||
{(donation.amount / 100)
|
||||
.toFixed(2)
|
||||
.toLocaleString('de-DE', { valute: 'EUR' })}€
|
||||
</div>
|
||||
</td>
|
||||
{#if active_deletes[donation.id] === true}
|
||||
<td
|
||||
class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
|
||||
<button
|
||||
on:click={() => {
|
||||
active_deletes[donation.id] = false;
|
||||
}}
|
||||
tabindex="0"
|
||||
class="ml-4 text-indigo-600 hover:text-indigo-900 cursor-pointer">{$_('cancel-delete')}</button>
|
||||
<button
|
||||
on:click={() => {
|
||||
DonationService.donationControllerRemove(donation.id, false).then(
|
||||
(resp) => {
|
||||
current_donations = current_donations.filter(
|
||||
(obj) => obj.id !== donation.id
|
||||
);
|
||||
Toastify({
|
||||
text: 'Donation deleted',
|
||||
duration: 500,
|
||||
backgroundColor:
|
||||
'linear-gradient(to right, #00b09b, #96c93d)',
|
||||
}).showToast();
|
||||
}
|
||||
);
|
||||
}}
|
||||
tabindex="0"
|
||||
class="ml-4 text-red-600 hover:text-red-900 cursor-pointer">{$_('confirm-delete')}</button>
|
||||
</td>
|
||||
{:else}
|
||||
<td
|
||||
class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
|
||||
<a
|
||||
href="./{donation.id}"
|
||||
class="text-indigo-600 hover:text-indigo-900">{$_('details')}</a>
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('DONATION:DELETE')}
|
||||
<button
|
||||
on:click={() => {
|
||||
active_deletes[donation.id] = true;
|
||||
}}
|
||||
tabindex="0"
|
||||
class="ml-4 text-red-600 hover:text-red-900 cursor-pointer">{$_('delete')}</button>
|
||||
{/if}
|
||||
</td>
|
||||
{/if}
|
||||
</tr>
|
||||
{/if}
|
||||
{/each}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{/if}
|
||||
{:catch error}
|
||||
<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">
|
||||
<b class="capitalize">{$_('general_promise_error')}</b>
|
||||
{error}
|
||||
</span>
|
||||
</div>
|
||||
{/await}
|
||||
{/if}
|
1
src/components/donations/donations.svg
Normal file
1
src/components/donations/donations.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="598.11" height="535.11"><path d="M3.35 120.07a4.6 4.6 0 00-3.18 5.66l76.72 273.98a4.6 4.6 0 005.65 3.18l282.82-79.19a4.6 4.6 0 003.18-5.66L291.82 44.07a4.6 4.6 0 00-5.65-3.19z" fill="#e6e6e6"/><path d="M86.1 389.95l269.5-75.46-72.99-260.67-269.5 75.46z" fill="#fff"/><path d="M48.74 164.1c-1.8.5-2.54 3.48-1.65 6.65s3.07 5.33 4.87 4.83l122.91-34.42c1.8-.5 2.54-3.49 1.66-6.65s-3.08-5.34-4.87-4.84zM58.64 199.44c-1.8.5-2.54 3.5-1.65 6.66s3.07 5.34 4.87 4.83l122.91-34.42c1.8-.5 2.54-3.49 1.65-6.65s-3.07-5.34-4.86-4.83zM68.42 234.39c-1.8.5-2.54 3.49-1.65 6.66s3.07 5.33 4.87 4.83l122.92-34.42c1.8-.5 2.54-3.5 1.65-6.66s-3.07-5.33-4.87-4.83zM78.32 269.74c-1.8.5-2.54 3.49-1.65 6.66s3.07 5.33 4.87 4.83l122.92-34.42c1.8-.5 2.54-3.49 1.65-6.66s-3.07-5.33-4.87-4.83zM234.04 112.61a5.97 5.97 0 103.21 11.5l22.98-6.44a5.97 5.97 0 00-3.22-11.49zM243.74 147.28a5.97 5.97 0 103.22 11.49l22.98-6.43a5.97 5.97 0 00-3.22-11.5zM253.45 181.95a5.97 5.97 0 103.22 11.49l22.98-6.44a5.97 5.97 0 00-3.22-11.49zM263.16 216.61a5.97 5.97 0 003.21 11.5l22.98-6.44a5.97 5.97 0 00-3.21-11.49z" fill="#e6e6e6"/><path d="M272.43 276.7a7.6 7.6 0 104.1 14.64l29.28-8.2a7.6 7.6 0 00-4.1-14.64z" fill="#6c63ff"/><path fill="#e6e6e6" d="M85.9 307.81l216.66-60.67.54 1.93-216.67 60.67z"/><path fill="#a0616a" d="M520.2 506.07l-17.38 4.2-24.47-65.02 25.65-6.2 16.2 67.02z"/><path d="M472.85 535.11l-.12-.48a22.23 22.23 0 0116.37-26.8l34-8.23 5.33 22.08z" fill="#2f2e41"/><path fill="#a0616a" d="M443.28 517.91H425.4l-8.5-68.96h26.38v68.96z"/><path d="M447.6 535.01h-57.18v-.5a22.2 22.2 0 0122.2-22.2h34.99zM416.88 490.99l-17.36-206.87 71.86-13.25.28-.05 21.03 13.52-7.32 76.14 33.7 118.7-29.1 7.65-33.75-110.08-7.73-33.48-3.96 43.5 2.94 107.28z" fill="#2f2e41"/><path d="M397.3 288.81l-.2-.24 24.84-186.96.03-.24.17-.18c.37-.36 9.07-8.96 18.02-8.96 1.3 0 2.52-.03 3.7-.06 6.85-.18 12.26-.32 18.69 6.1 6.55 6.56 27.92 30.47 27.92 63.23 0 31.7 2.88 130.22 2.91 131.21l.04 1.4-1.16-.76c-.3-.19-29.03-18.49-53.14-1.48-7.53 5.32-14.3 7.18-20.09 7.18-13.47 0-21.62-10.1-21.73-10.24z" fill="#6c63ff"/><circle cx="737.3" cy="227.82" r="35.82" transform="rotate(-28.66 229.78 725.57)" fill="#a0616a"/><path d="M381.53 328.99a14.66 14.66 0 00.85-22.47l20.34-47.97-26.63 4.9-15.23 44.8A14.74 14.74 0 00381.53 329z" fill="#a0616a"/><path d="M361.88 291.67l6.55-13.83a2.7 2.7 0 01-.97-1c-6.12-10.6 30.84-98.67 33.3-104.51-.37-3.18-4.25-36.85-1.41-48.2 3.34-13.35 10.2-19.58 22.93-20.81 14.04-1.32 17.83 17.75 17.86 17.94l.02 49.02-16.12 56.43-36.75 74.97z" fill="#6c63ff"/><path d="M440.94 58.87c-4.3.56-7.54-3.83-9.04-7.9s-2.64-8.78-6.38-10.98c-5.1-3-11.62.61-17.45-.38-6.59-1.11-10.87-8.1-11.2-14.76s2.31-13.1 4.92-19.24l.9 7.64A15.16 15.16 0 01409.33 0l-1.17 11.22c.73-6.29 7.5-11.16 13.7-9.85l-.19 6.68c7.6-.9 15.28-1.81 22.91-1.12s15.31 3.1 21.1 8.13c8.64 7.51 11.8 19.89 10.74 31.3s-5.77 22.13-10.68 32.48c-1.23 2.6-2.94 5.54-5.8 5.88-2.58.3-4.93-1.86-5.73-4.32s-.41-5.14.07-7.69c.72-3.84 1.63-7.77.95-11.63s-3.45-7.66-7.33-8.13-7.86 3.97-6 7.4z" fill="#2f2e41"/><path fill="#3f3d56" d="M597.73 535.1H339.99v-2.11h258.12l-.38 2.1z"/></svg>
|
After Width: | Height: | Size: 3.1 KiB |
404
src/components/donors/AddDonorModal.svelte
Normal file
404
src/components/donors/AddDonorModal.svelte
Normal file
@@ -0,0 +1,404 @@
|
||||
<script>
|
||||
import { _ } from "svelte-i18n";
|
||||
import { clickOutside } from "../base/outsideclick";
|
||||
import { focusTrap } from "svelte-focus-trap";
|
||||
import {
|
||||
DonorService
|
||||
} from "@odit/lfk-client-js";
|
||||
import isEmail from "validator/es/lib/isEmail";
|
||||
import isMobilePhone from "validator/es/lib/isMobilePhone";
|
||||
import Toastify from "toastify-js";
|
||||
export let modal_open;
|
||||
export let current_donors;
|
||||
let firstname_input;
|
||||
let lastname_input;
|
||||
let middlename_input;
|
||||
let phone_input;
|
||||
let email_input;
|
||||
let address_input1;
|
||||
let address_input2;
|
||||
let address_zipcode;
|
||||
let address_city;
|
||||
function focus(el) {
|
||||
el.focus();
|
||||
}
|
||||
$: middlename_input_value = "";
|
||||
$: phone_input_value = "";
|
||||
$: email_input_value = "";
|
||||
$: lastname_input_value = "";
|
||||
$: firstname_input_value = "";
|
||||
$: address_input1_value = "";
|
||||
$: address_input2_value = "";
|
||||
$: address_zipcode_value = "";
|
||||
$: address_city_value = "";
|
||||
$: processed_last_submit = true;
|
||||
$: address_checked = false;
|
||||
$: isPhoneValidOrEmpty =
|
||||
(phone_input_value.includes("+") &&
|
||||
isMobilePhone(
|
||||
phone_input_value
|
||||
.replaceAll("(", "")
|
||||
.replaceAll(")", "")
|
||||
.replaceAll("-", "")
|
||||
.replaceAll(" ", "")
|
||||
)) ||
|
||||
phone_input_value === "";
|
||||
$: isEmailValidOrEmpty =
|
||||
isEmail(email_input_value) || email_input_value === "";
|
||||
$: isLastnameValid = lastname_input_value.trim().length !== 0;
|
||||
$: isFirstnameValid = firstname_input_value.trim().length !== 0;
|
||||
$: isAddress1Valid = address_input1_value.trim().length !== 0;
|
||||
$: iszipcodevalid = address_zipcode_value.trim().length !== 0;
|
||||
$: iscityvalid = address_city_value.trim().length !== 0;
|
||||
$: createbtnenabled =
|
||||
isFirstnameValid &&
|
||||
isLastnameValid &&
|
||||
isEmailValidOrEmpty &&
|
||||
isPhoneValidOrEmpty &&
|
||||
((isAddress1Valid && iszipcodevalid && iscityvalid) ||
|
||||
address_checked === false);
|
||||
(() => {
|
||||
document.onkeydown = (e) => {
|
||||
e = e || window.event;
|
||||
if (e.key === "Escape") {
|
||||
modal_open = false;
|
||||
}
|
||||
if (e.keyCode === 13) {
|
||||
if (createbtnenabled === true) {
|
||||
createbtnenabled = false;
|
||||
submit();
|
||||
}
|
||||
}
|
||||
};
|
||||
})();
|
||||
function submit() {
|
||||
if (processed_last_submit === true) {
|
||||
processed_last_submit = false;
|
||||
const toast = Toastify({
|
||||
text: $_('donor-is-being-added'),
|
||||
duration: -1,
|
||||
}).showToast();
|
||||
let address = {};
|
||||
if (address_checked === true) {
|
||||
address = {
|
||||
address1: address_input1_value,
|
||||
address2: address_input2_value || "",
|
||||
postalcode: address_zipcode_value,
|
||||
city: address_city_value,
|
||||
country: "DE",
|
||||
};
|
||||
}
|
||||
let postdata = {
|
||||
firstname: firstname_input_value,
|
||||
lastname: lastname_input_value,
|
||||
address,
|
||||
receiptNeeded: address_checked
|
||||
};
|
||||
if (middlename_input_value) {
|
||||
postdata.middlename = middlename_input_value;
|
||||
}
|
||||
if (phone_input_value) {
|
||||
postdata.phone = phone_input_value;
|
||||
}
|
||||
if (email_input_value) {
|
||||
postdata.email = email_input_value;
|
||||
}
|
||||
DonorService.donorControllerPost(postdata)
|
||||
.then((result) => {
|
||||
firstname_input_value = "";
|
||||
lastname_input_value = "";
|
||||
middlename_input_value = "";
|
||||
email_input_value = "";
|
||||
modal_open = false;
|
||||
//
|
||||
Toastify({
|
||||
text: $_('donor-added'),
|
||||
duration: 500,
|
||||
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
|
||||
}).showToast();
|
||||
current_donors.push(result);
|
||||
current_donors = current_donors;
|
||||
})
|
||||
.catch((err) => {
|
||||
//
|
||||
})
|
||||
.finally(() => {
|
||||
processed_last_submit = true;
|
||||
//
|
||||
toast.hideToast();
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if modal_open}
|
||||
<div
|
||||
class="fixed z-10 inset-0 overflow-y-auto"
|
||||
use:focusTrap
|
||||
use:clickOutside
|
||||
on:click_outside={() => {
|
||||
modal_open = false;
|
||||
}}>
|
||||
<div
|
||||
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="absolute inset-0 bg-gray-500 opacity-75"
|
||||
data-id="modal_backdrop" />
|
||||
</div>
|
||||
<span
|
||||
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 overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg 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">
|
||||
<svg
|
||||
class="h-6 w-6 text-blue-600"
|
||||
fill="currentColor"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
width="24"
|
||||
height="24"><path fill="none" d="M0 0h24v24H0z" />
|
||||
<path
|
||||
d="M9.33 11.5h2.17A4.5 4.5 0 0 1 16 16H8.999L9 17h8v-1a5.578 5.578 0 0 0-.886-3H19a5 5 0 0 1 4.516 2.851C21.151 18.972 17.322 21 13 21c-2.761 0-5.1-.59-7-1.625L6 10.071A6.967 6.967 0 0 1 9.33 11.5zM5 19a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v9zM18 5a3 3 0 1 1 0 6 3 3 0 0 1 0-6zm-7-3a3 3 0 1 1 0 6 3 3 0 0 1 0-6z" /></svg>
|
||||
</div>
|
||||
<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">
|
||||
{$_('create-a-new-donor')}
|
||||
</h3>
|
||||
<div class="mt-2 mb-6">
|
||||
<p class="text-sm text-gray-500">
|
||||
{$_('please-provide-the-nessecary-information-to-add-a-new-donor')}
|
||||
</p>
|
||||
</div>
|
||||
<div class="grid grid-cols-6 gap-6">
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="firstname"
|
||||
class="block text-sm font-medium text-gray-700">{$_('first-name')}</label>
|
||||
<input
|
||||
use:focus
|
||||
autocomplete="off"
|
||||
placeholder={$_('first-name')}
|
||||
class:border-red-500={!isFirstnameValid}
|
||||
class:focus:border-red-500={!isFirstnameValid}
|
||||
class:focus:ring-red-500={!isFirstnameValid}
|
||||
bind:value={firstname_input_value}
|
||||
bind:this={firstname_input}
|
||||
type="text"
|
||||
name="firstname"
|
||||
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 !isFirstnameValid}
|
||||
<span
|
||||
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
|
||||
{$_('first-name-is-required')}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="trackname"
|
||||
class="block text-sm font-medium text-gray-700">{$_('middle-name')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder={$_('middle-name')}
|
||||
bind:value={middlename_input_value}
|
||||
bind:this={middlename_input}
|
||||
type="text"
|
||||
name="trackname"
|
||||
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" />
|
||||
</div>
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="lastname"
|
||||
class="block text-sm font-medium text-gray-700">{$_('last-name')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="{$_('last-name')}"
|
||||
class:border-red-500={!isLastnameValid}
|
||||
class:focus:border-red-500={!isLastnameValid}
|
||||
class:focus:ring-red-500={!isLastnameValid}
|
||||
bind:value={lastname_input_value}
|
||||
bind:this={lastname_input}
|
||||
type="text"
|
||||
name="lastname"
|
||||
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 !isLastnameValid}
|
||||
<span
|
||||
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
|
||||
{$_('last-name-is-required')}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="phone"
|
||||
class="block text-sm font-medium text-gray-700">{$_('phone')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder={$_('phone')}
|
||||
class:border-red-500={!isPhoneValidOrEmpty}
|
||||
class:focus:border-red-500={!isPhoneValidOrEmpty}
|
||||
class:focus:ring-red-500={!isPhoneValidOrEmpty}
|
||||
bind:value={phone_input_value}
|
||||
bind:this={phone_input}
|
||||
type="tel"
|
||||
name="phone"
|
||||
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 !isPhoneValidOrEmpty}
|
||||
<span
|
||||
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
|
||||
{@html $_('the-provided-phone-number-is-invalid-less-than-br-greater-than-please-enter-a-valid-international-number')}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="email"
|
||||
class="block text-sm font-medium text-gray-700">{$_('e-mail-adress')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder={$_('e-mail-adress')}
|
||||
class:border-red-500={!isEmailValidOrEmpty}
|
||||
class:focus:border-red-500={!isEmailValidOrEmpty}
|
||||
class:focus:ring-red-500={!isEmailValidOrEmpty}
|
||||
bind:value={email_input_value}
|
||||
bind:this={email_input}
|
||||
type="email"
|
||||
name="email"
|
||||
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 !isEmailValidOrEmpty}
|
||||
<span
|
||||
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
|
||||
{$_('valid-email-is-required')}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="flex items-start">
|
||||
<div class="flex items-center h-5">
|
||||
<input
|
||||
bind:checked={address_checked}
|
||||
id="comments"
|
||||
name="comments"
|
||||
type="checkbox"
|
||||
class="focus:ring-indigo-500 h-4 w-4 text-indigo-600 border-gray-300 rounded" />
|
||||
</div>
|
||||
<div class="ml-3 text-sm">
|
||||
<label
|
||||
for="comments"
|
||||
class="font-medium text-gray-700">{$_('receipt-needed')}</label>
|
||||
</div>
|
||||
</div>
|
||||
{#if address_checked === true}
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="address1"
|
||||
class="block text-sm font-medium text-gray-700">{$_('address')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Address"
|
||||
class:border-red-500={!isAddress1Valid}
|
||||
class:focus:border-red-500={!isAddress1Valid}
|
||||
class:focus:ring-red-500={!isAddress1Valid}
|
||||
bind:value={address_input1_value}
|
||||
bind:this={address_input1}
|
||||
type="text"
|
||||
name="address1"
|
||||
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 !isAddress1Valid}
|
||||
<span
|
||||
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
|
||||
{$_('address-is-required')}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="address2"
|
||||
class="block text-sm font-medium text-gray-700">{$_('apartment-suite-etc')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder={$_('apartment-suite-etc')}
|
||||
bind:value={address_input2_value}
|
||||
bind:this={address_input2}
|
||||
type="text"
|
||||
name="address2"
|
||||
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" />
|
||||
</div>
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="zipcode"
|
||||
class="block text-sm font-medium text-gray-700">{$_('zip-postal-code')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder={$_('zip-postal-code')}
|
||||
class:border-red-500={!iszipcodevalid}
|
||||
class:focus:border-red-500={!iszipcodevalid}
|
||||
class:focus:ring-red-500={!iszipcodevalid}
|
||||
bind:value={address_zipcode_value}
|
||||
bind:this={address_zipcode}
|
||||
type="text"
|
||||
name="zipcode"
|
||||
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 !iszipcodevalid}
|
||||
<span
|
||||
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
|
||||
{$_('valid-zipcode-postal-code-is-required')}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="city"
|
||||
class="block text-sm font-medium text-gray-700">City</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="City"
|
||||
class:border-red-500={!iscityvalid}
|
||||
class:focus:border-red-500={!iscityvalid}
|
||||
class:focus:ring-red-500={!iscityvalid}
|
||||
bind:value={address_city_value}
|
||||
bind:this={address_city}
|
||||
type="text"
|
||||
name="city"
|
||||
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 !iscityvalid}
|
||||
<span
|
||||
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
|
||||
{$_('valid-city-is-required')}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse">
|
||||
<button
|
||||
disabled={!createbtnenabled}
|
||||
class:opacity-50={!createbtnenabled}
|
||||
on:click={submit}
|
||||
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')}
|
||||
</button>
|
||||
<button
|
||||
on:click={() => {
|
||||
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">
|
||||
{$_('cancel')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
92
src/components/donors/ConfirmDonorDeletion.svelte
Normal file
92
src/components/donors/ConfirmDonorDeletion.svelte
Normal file
@@ -0,0 +1,92 @@
|
||||
<script>
|
||||
import { _ } from "svelte-i18n";
|
||||
import { clickOutside } from "../base/outsideclick";
|
||||
import { focusTrap } from "svelte-focus-trap";
|
||||
import { DonorService } from "@odit/lfk-client-js";
|
||||
import Toastify from "toastify-js";
|
||||
import { createEventDispatcher } from "svelte";
|
||||
export let modal_open;
|
||||
export let delete_donor;
|
||||
const dispatch = createEventDispatcher();
|
||||
function cancelDelete() {
|
||||
modal_open = false;
|
||||
dispatch("cancelDelete", { id: delete_donor.id });
|
||||
}
|
||||
function deleteDonor() {
|
||||
DonorService.donorControllerRemove(
|
||||
delete_donor.id,
|
||||
true
|
||||
)
|
||||
.then((resp) => {
|
||||
Toastify({
|
||||
text: "Donor deleted",
|
||||
duration: 500,
|
||||
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
|
||||
}).showToast();
|
||||
location.replace("./");
|
||||
})
|
||||
.catch((err) => {});
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if modal_open}
|
||||
<div
|
||||
class="fixed z-10 inset-0 overflow-y-auto"
|
||||
use:focusTrap
|
||||
use:clickOutside
|
||||
on:click_outside={cancelDelete}>
|
||||
<div
|
||||
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="absolute inset-0 bg-gray-500 opacity-75"
|
||||
data-id="modal_backdrop" />
|
||||
</div>
|
||||
<span
|
||||
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 overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg 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">
|
||||
<svg class="h-6 w-6 text-blue-600" fill="currentColor" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M9.33 11.5h2.17A4.5 4.5 0 0116 16H9v1h8v-1a5.58 5.58 0 00-.89-3H19a5 5 0 014.52 2.85A13.15 13.15 0 0113 21c-2.76 0-5.1-.59-7-1.63v-9.3a6.97 6.97 0 013.33 1.43zM5 19a1 1 0 01-1 1H2a1 1 0 01-1-1v-9a1 1 0 011-1h2a1 1 0 011 1v9zM18 5a3 3 0 110 6 3 3 0 010-6zm-7-3a3 3 0 110 6 3 3 0 010-6z"/></svg>
|
||||
</div>
|
||||
<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">
|
||||
{$_('attention')}
|
||||
</h3>
|
||||
<div class="mt-2 mb-6">
|
||||
<p class="text-sm text-gray-500">
|
||||
{$_(
|
||||
'do-you-want-to-delete-this-donor-with-all-related-donations'
|
||||
)}
|
||||
<br />
|
||||
{$_('all-associated-donations-will-get-deleted-as-well')}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse">
|
||||
<button
|
||||
on:click={deleteDonor}
|
||||
type="button"
|
||||
class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm">
|
||||
{$_('confirm-delete-donor-with-all-donations')}
|
||||
</button>
|
||||
<button
|
||||
on:click={cancelDelete}
|
||||
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">
|
||||
{$_('cancel-keep-donor')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
406
src/components/donors/DonorDetail.svelte
Normal file
406
src/components/donors/DonorDetail.svelte
Normal file
@@ -0,0 +1,406 @@
|
||||
<script>
|
||||
import { _ } from "svelte-i18n";
|
||||
import store from "../../store";
|
||||
import { DonorService, DonationService } from "@odit/lfk-client-js";
|
||||
import Toastify from "toastify-js";
|
||||
import PromiseError from "../base/PromiseError.svelte";
|
||||
import isEmail from "validator/es/lib/isEmail";
|
||||
import ConfirmDonorDeletion from "./ConfirmDonorDeletion.svelte";
|
||||
let data_loaded = false;
|
||||
export let params;
|
||||
$: delete_triggered = false;
|
||||
$: original_data = {};
|
||||
$: editable = {};
|
||||
$: current_donations = [];
|
||||
$: changes_performed = !(
|
||||
JSON.stringify(original_data) === JSON.stringify(editable)
|
||||
);
|
||||
$: isEmailValid =
|
||||
(editable.email || "") === "" ||
|
||||
(editable.email && isEmail(editable.email || ""));
|
||||
$: isFirstnameValid = editable.firstname !== "";
|
||||
$: isLastnameValid = editable.lastname !== "";
|
||||
$: save_enabled =
|
||||
changes_performed &&
|
||||
isFirstnameValid &&
|
||||
isLastnameValid &&
|
||||
isEmailValid &&
|
||||
isPhoneValidOrEmpty &&
|
||||
((isAddress1Valid && iszipcodevalid && iscityvalid) ||
|
||||
editable.address_checked === false);
|
||||
const donation_promise = DonationService.donationControllerGetAll().then(
|
||||
(val) => {
|
||||
current_donations = val;
|
||||
}
|
||||
);
|
||||
const promise = DonorService.donorControllerGetOne(params.donorid).then(
|
||||
(data) => {
|
||||
data_loaded = true;
|
||||
original_data = Object.assign(original_data, data);
|
||||
editable = Object.assign(editable, original_data);
|
||||
editable.address_checked = editable.address.address1 !== null;
|
||||
original_data.address_checked = editable.address.address1 !== null;
|
||||
if (editable.address_checked === false) {
|
||||
editable.address = {
|
||||
address1: "",
|
||||
address2: "",
|
||||
city: "",
|
||||
postalcode: "",
|
||||
country: "",
|
||||
};
|
||||
}
|
||||
}
|
||||
);
|
||||
$: isPhoneValidOrEmpty =
|
||||
editable.phone?.includes("+") ||
|
||||
editable.phone === "" ||
|
||||
editable.phone === null;
|
||||
$: isAddress1Valid = editable.address?.address1?.trim().length !== 0;
|
||||
$: iszipcodevalid = editable.address?.postalcode?.trim().length !== 0;
|
||||
$: iscityvalid = editable.address?.city?.trim().length !== 0;
|
||||
let modal_open = false;
|
||||
let delete_donor = {};
|
||||
function submit() {
|
||||
if (data_loaded === true && save_enabled) {
|
||||
Toastify({
|
||||
text: $_("donor-is-being-updated"),
|
||||
duration: 2500,
|
||||
}).showToast();
|
||||
editable.address.country = "DE";
|
||||
if (editable.address_checked === false) {
|
||||
editable.address = null;
|
||||
}
|
||||
if (editable.email) editable.email = editable.email;
|
||||
if (editable.phone) editable.phone = editable.phone;
|
||||
if (editable.middlename) editable.middlename = editable.middlename;
|
||||
editable.receiptNeeded = editable.address_checked;
|
||||
DonorService.donorControllerPut(original_data.id, editable)
|
||||
.then((resp) => {
|
||||
Object.assign(original_data, editable);
|
||||
original_data = original_data;
|
||||
Toastify({
|
||||
text: $_("updated-donor"),
|
||||
duration: 2500,
|
||||
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
|
||||
}).showToast();
|
||||
})
|
||||
.catch((err) => {});
|
||||
} else {
|
||||
}
|
||||
}
|
||||
function deleteDonor() {
|
||||
DonorService.donorControllerRemove(original_data.id, false)
|
||||
.then((resp) => {
|
||||
Toastify({
|
||||
text: $_("donor-deleted"),
|
||||
duration: 500,
|
||||
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
|
||||
}).showToast();
|
||||
location.replace("./");
|
||||
})
|
||||
.catch((err) => {
|
||||
modal_open = true;
|
||||
delete_donor = original_data;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<ConfirmDonorDeletion bind:modal_open bind:delete_donor />
|
||||
{#await promise && donation_promise}
|
||||
{$_('loading-donor-details')}
|
||||
{:then}
|
||||
<section class="container p-5 select-none">
|
||||
<div class="flex flex-row mb-4">
|
||||
<div class="w-full">
|
||||
<nav class="w-full flex">
|
||||
<ol class="list-none flex flex-row items-center justify-start">
|
||||
<li class="flex items-center">
|
||||
<svg
|
||||
fill="currentColor"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
width="24"
|
||||
height="24"><path fill="none" d="M0 0h24v24H0z" />
|
||||
<path
|
||||
d="M9.33 11.5h2.17A4.5 4.5 0 0 1 16 16H8.999L9 17h8v-1a5.578 5.578 0 0 0-.886-3H19a5 5 0 0 1 4.516 2.851C21.151 18.972 17.322 21 13 21c-2.761 0-5.1-.59-7-1.625L6 10.071A6.967 6.967 0 0 1 9.33 11.5zM5 19a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v9zM18 5a3 3 0 1 1 0 6 3 3 0 0 1 0-6zm-7-3a3 3 0 1 1 0 6 3 3 0 0 1 0-6z" /></svg>
|
||||
</li>
|
||||
<li class="flex items-center ml-2">
|
||||
<a class="mr-2" href="./">{$_('donors')}</a><svg
|
||||
stroke="currentColor"
|
||||
fill="none"
|
||||
stroke-width="2"
|
||||
viewBox="0 0 24 24"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
class="h-3 w-3 mr-2 stroke-current"
|
||||
height="1em"
|
||||
width="1em"
|
||||
xmlns="http://www.w3.org/2000/svg"><line
|
||||
x1="5"
|
||||
y1="12"
|
||||
x2="19"
|
||||
y2="12" />
|
||||
<polyline points="12 5 19 12 12 19" /></svg>
|
||||
</li>
|
||||
<li class="flex items-center">
|
||||
<span class="mr-2">{original_data.firstname}
|
||||
{original_data.middlename || ''}
|
||||
{original_data.lastname}</span>
|
||||
</li>
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-8 text-3xl font-extrabold leading-tight">
|
||||
{original_data.firstname}
|
||||
{original_data.middlename || ''}
|
||||
{original_data.lastname}
|
||||
<span data-id="donor_actions_${editable.id}">
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('DONOR:DELETE')}
|
||||
{#if delete_triggered}
|
||||
<button
|
||||
on:click={deleteDonor}
|
||||
class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:">{$_('confirm-deletion')}</button>
|
||||
<button
|
||||
on:click={() => {
|
||||
delete_triggered = !delete_triggered;
|
||||
}}
|
||||
class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-400 text-base font-medium text-white sm:w-auto sm:">{$_('cancel')}</button>
|
||||
{/if}
|
||||
{#if !delete_triggered}
|
||||
<button
|
||||
on:click={() => {
|
||||
delete_triggered = true;
|
||||
}}
|
||||
type="button"
|
||||
class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:">{$_('delete-donor')}</button>
|
||||
{/if}
|
||||
{/if}
|
||||
{#if !delete_triggered}
|
||||
<button
|
||||
disabled={!save_enabled}
|
||||
class:opacity-50={!save_enabled}
|
||||
type="button"
|
||||
on:click={submit}
|
||||
class="w-full 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:">{$_('save-changes')}</button>
|
||||
{/if}
|
||||
</span>
|
||||
</div>
|
||||
<!-- -->
|
||||
<div>
|
||||
<span
|
||||
class="font-medium text-gray-700">{$_('total-donation-amount')}:</span>
|
||||
<span>{(editable.donationAmount / 100)
|
||||
.toFixed(2)
|
||||
.toLocaleString('de-DE', { valute: 'EUR' })}€</span>
|
||||
<br />
|
||||
<span class="font-medium text-gray-700">{$_('donations')}:</span>
|
||||
{#if current_donations.filter((d) => d.donor.id == editable.id).length > 0}
|
||||
{#each current_donations.filter((o) => o.donor.id == editable.id) as d}
|
||||
{#if d.responseType === 'DISTANCEDONATION'}
|
||||
<a
|
||||
href="../donations/{d.id}"
|
||||
class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-blue-600 text-white mr-1">{d.runner.firstname}
|
||||
{d.runner.middlename}
|
||||
{d.runner.lastname}</a>
|
||||
{:else}
|
||||
<a
|
||||
href="../donations/{d.id}"
|
||||
class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-700 text-white mr-1">{$_('fixed-donation')}:
|
||||
{(d.amount / 100)
|
||||
.toFixed(2)
|
||||
.toLocaleString('de-DE', { valute: 'EUR' })}€</a>
|
||||
{/if}
|
||||
{/each}
|
||||
{:else}{$_('donor-has-no-associated-donations')}{/if}
|
||||
</div>
|
||||
<div class=" w-full">
|
||||
<label
|
||||
for="firstname"
|
||||
class="font-medium text-gray-700">{$_('first-name')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder={$_('first-name')}
|
||||
type="text"
|
||||
class:border-red-500={!isFirstnameValid}
|
||||
class:focus:border-red-500={!isFirstnameValid}
|
||||
class:focus:ring-red-500={!isFirstnameValid}
|
||||
bind:value={editable.firstname}
|
||||
name="firstname"
|
||||
class="mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm rounded-l-md sm: border-gray-300 border bg-gray-50 text-gray-500 rounded-md p-2" />
|
||||
{#if !isFirstnameValid}
|
||||
<span
|
||||
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
|
||||
{$_('first-name-is-required')}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class=" w-full">
|
||||
<label
|
||||
for="middlename"
|
||||
class="font-medium text-gray-700">{$_('middle-name')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder={$_('middle-name')}
|
||||
type="text"
|
||||
bind:value={editable.middlename}
|
||||
name="middlename"
|
||||
class="mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm rounded-l-md sm: border-gray-300 border bg-gray-50 text-gray-500 rounded-md p-2" />
|
||||
</div>
|
||||
<div class=" w-full">
|
||||
<label
|
||||
for="lastname"
|
||||
class="font-medium text-gray-700">{$_('last-name')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder={$_('last-name')}
|
||||
type="text"
|
||||
bind:value={editable.lastname}
|
||||
class:border-red-500={!isLastnameValid}
|
||||
class:focus:border-red-500={!isLastnameValid}
|
||||
class:focus:ring-red-500={!isLastnameValid}
|
||||
name="lastname"
|
||||
class="mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm rounded-l-md sm: border-gray-300 border bg-gray-50 text-gray-500 rounded-md p-2" />
|
||||
{#if !isLastnameValid}
|
||||
<span
|
||||
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
|
||||
{$_('last-name-is-required')}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class=" w-full">
|
||||
<label
|
||||
for="email"
|
||||
class="font-medium text-gray-700">{$_('e-mail-adress')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder={$_('e-mail-adress')}
|
||||
type="email"
|
||||
bind:value={editable.email}
|
||||
class:border-red-500={!isEmailValid}
|
||||
class:focus:border-red-500={!isEmailValid}
|
||||
class:focus:ring-red-500={!isEmailValid}
|
||||
name="email"
|
||||
class="mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm rounded-l-md sm: border-gray-300 border bg-gray-50 text-gray-500 rounded-md p-2" />
|
||||
{#if !isEmailValid}
|
||||
<span
|
||||
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
|
||||
{$_('valid-email-is-required')}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class=" w-full">
|
||||
<label for="phone" class="font-medium text-gray-700">{$_('phone')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder={$_('phone')}
|
||||
type="tel"
|
||||
class:border-red-500={!isPhoneValidOrEmpty}
|
||||
class:focus:border-red-500={!isPhoneValidOrEmpty}
|
||||
class:focus:ring-red-500={!isPhoneValidOrEmpty}
|
||||
bind:value={editable.phone}
|
||||
name="phone"
|
||||
class="mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm rounded-l-md sm: border-gray-300 border bg-gray-50 text-gray-500 rounded-md p-2" />
|
||||
{#if !isPhoneValidOrEmpty}
|
||||
<span
|
||||
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
|
||||
{$_('valid-international-phone-number-is-required')}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="flex items-start mt-2">
|
||||
<div class="flex items-center h-5">
|
||||
<input
|
||||
bind:checked={editable.address_checked}
|
||||
id="comments"
|
||||
name="comments"
|
||||
type="checkbox"
|
||||
class="focus:ring-indigo-500 h-4 w-4 text-indigo-600 border-gray-300 rounded" />
|
||||
</div>
|
||||
<div class="ml-3 ">
|
||||
<label
|
||||
for="comments"
|
||||
class="font-medium text-gray-700">{$_('receipt-needed')}</label>
|
||||
</div>
|
||||
</div>
|
||||
{#if editable.address_checked === true}
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="address1"
|
||||
class="block font-medium text-gray-700">{$_('address')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Address"
|
||||
class:border-red-500={!isAddress1Valid}
|
||||
class:focus:border-red-500={!isAddress1Valid}
|
||||
class:focus:ring-red-500={!isAddress1Valid}
|
||||
bind:value={editable.address.address1}
|
||||
type="text"
|
||||
name="address1"
|
||||
class="mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm rounded-l-md sm: border-gray-300 border bg-gray-50 text-gray-500 rounded-md p-2" />
|
||||
{#if !isAddress1Valid}
|
||||
<span
|
||||
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
|
||||
{$_('address-is-required')}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="address2"
|
||||
class="block font-medium text-gray-700">{$_('apartment-suite-etc')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder={$_('apartment-suite-etc')}
|
||||
bind:value={editable.address.address2}
|
||||
type="text"
|
||||
name="address2"
|
||||
class="mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm rounded-l-md sm: border-gray-300 border bg-gray-50 text-gray-500 rounded-md p-2" />
|
||||
</div>
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="zipcode"
|
||||
class="block font-medium text-gray-700">{$_('zip-postal-code')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder={$_('zip-postal-code')}
|
||||
class:border-red-500={!iszipcodevalid}
|
||||
class:focus:border-red-500={!iszipcodevalid}
|
||||
class:focus:ring-red-500={!iszipcodevalid}
|
||||
bind:value={editable.address.postalcode}
|
||||
type="text"
|
||||
name="zipcode"
|
||||
class="mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm rounded-l-md sm: border-gray-300 border bg-gray-50 text-gray-500 rounded-md p-2" />
|
||||
{#if !iszipcodevalid}
|
||||
<span
|
||||
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
|
||||
{$_('valid-zipcode-postal-code-is-required')}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="city"
|
||||
class="block font-medium text-gray-700">{$_('city')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder={$_('city')}
|
||||
class:border-red-500={!iscityvalid}
|
||||
class:focus:border-red-500={!iscityvalid}
|
||||
class:focus:ring-red-500={!iscityvalid}
|
||||
bind:value={editable.address.city}
|
||||
type="text"
|
||||
name="city"
|
||||
class="mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm rounded-l-md sm: border-gray-300 border bg-gray-50 text-gray-500 rounded-md p-2" />
|
||||
{#if !iscityvalid}
|
||||
<span
|
||||
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
|
||||
{$_('valid-city-is-required')}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
</section>
|
||||
{:catch error}
|
||||
<PromiseError {error} />
|
||||
{/await}
|
29
src/components/donors/Donors.svelte
Normal file
29
src/components/donors/Donors.svelte
Normal file
@@ -0,0 +1,29 @@
|
||||
<script>
|
||||
import { _ } from "svelte-i18n";
|
||||
import store from "../../store";
|
||||
import AddDonorModal from "./AddDonorModal.svelte";
|
||||
import DonorsOverview from "./DonorsOverview.svelte";
|
||||
$: current_donors = [];
|
||||
export let modal_open = false;
|
||||
</script>
|
||||
|
||||
<section class="container p-5">
|
||||
<span class="mb-1 text-3xl font-extrabold leading-tight">
|
||||
{$_('donors')}
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('DONOR:CREATE')}
|
||||
<button
|
||||
on:click={() => {
|
||||
modal_open = true;
|
||||
}}
|
||||
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">
|
||||
{$_('add-donor')}
|
||||
</button>
|
||||
{/if}
|
||||
</span>
|
||||
<DonorsOverview bind:current_donors />
|
||||
</section>
|
||||
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('DONOR:CREATE')}
|
||||
<AddDonorModal bind:current_donors bind:modal_open />
|
||||
{/if}
|
12
src/components/donors/DonorsEmptyState.svelte
Normal file
12
src/components/donors/DonorsEmptyState.svelte
Normal file
@@ -0,0 +1,12 @@
|
||||
<script>
|
||||
import { _ } from "svelte-i18n";
|
||||
import donors_empty from "./donors_empty.svg";
|
||||
</script>
|
||||
|
||||
<div class="text-center items-center justify-center">
|
||||
<p class="mb-16 text-lg text-gray-500">
|
||||
<img class="w-full" style="height:15rem" src={donors_empty} alt="" />
|
||||
<span class="font-bold">{$_('there-are-no-donors-yet')}</span><br />
|
||||
<span>{$_('add-your-first-donor')}</span>
|
||||
</p>
|
||||
</div>
|
208
src/components/donors/DonorsOverview.svelte
Normal file
208
src/components/donors/DonorsOverview.svelte
Normal file
@@ -0,0 +1,208 @@
|
||||
<script>
|
||||
import { getLocaleFromNavigator, _ } from "svelte-i18n";
|
||||
import { DonationService, DonorService } from "@odit/lfk-client-js";
|
||||
import store from "../../store";
|
||||
import DonorsEmptyState from "./DonorsEmptyState.svelte";
|
||||
import ConfirmDonorDeletion from "./ConfirmDonorDeletion.svelte";
|
||||
import Toastify from "toastify-js";
|
||||
$: searchvalue = "";
|
||||
$: active_deletes = [];
|
||||
$: current_donations = [];
|
||||
let modal_open = false;
|
||||
let delete_donor = {};
|
||||
export let current_donors = [];
|
||||
const donors_promise = DonorService.donorControllerGetAll().then((val) => {
|
||||
current_donors = val;
|
||||
});
|
||||
const donation_promise = DonationService.donationControllerGetAll().then(
|
||||
(val) => {
|
||||
current_donations = val;
|
||||
}
|
||||
);
|
||||
function should_display_based_on_id(id) {
|
||||
if (searchvalue.toString().slice(-1) === "*") {
|
||||
return id.toString().startsWith(searchvalue.replace("*", ""));
|
||||
}
|
||||
return id.toString() === searchvalue;
|
||||
}
|
||||
</script>
|
||||
|
||||
<ConfirmDonorDeletion
|
||||
on:cancelDelete={(event) => {
|
||||
modal_open = false;
|
||||
active_deletes[event.detail.id] = false;
|
||||
}}
|
||||
bind:modal_open
|
||||
bind:delete_donor />
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('DONOR:GET')}
|
||||
{#await donors_promise && donation_promise}
|
||||
<div
|
||||
class="bg-teal-lightest border-t-4 border-teal rounded-b text-teal-darkest px-4 py-3 shadow-md my-2"
|
||||
role="alert">
|
||||
<p class="font-bold">{$_('donors-are-being-loaded')}</p>
|
||||
<p class="text-sm">{$_('this-might-take-a-moment')}</p>
|
||||
</div>
|
||||
{:then}
|
||||
{#if current_donors.length === 0}
|
||||
<DonorsEmptyState />
|
||||
{:else}
|
||||
<input
|
||||
type="search"
|
||||
bind:value={searchvalue}
|
||||
placeholder={$_('datatable.search')}
|
||||
aria-label={$_('datatable.search')}
|
||||
class="gridjs-input gridjs-search-input mb-4" />
|
||||
<div
|
||||
class="shadow border-b border-gray-200 sm:rounded-lg overflow-x-scroll">
|
||||
<table class="divide-y divide-gray-200 w-full">
|
||||
<thead class="bg-gray-50">
|
||||
<tr>
|
||||
<th
|
||||
scope="col"
|
||||
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
||||
{$_('name')}
|
||||
</th>
|
||||
<th
|
||||
scope="col"
|
||||
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
||||
{$_('contact-information')}
|
||||
</th>
|
||||
<th
|
||||
scope="col"
|
||||
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
||||
{$_('donations')}
|
||||
</th>
|
||||
<th
|
||||
scope="col"
|
||||
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
||||
{$_('total-donation-amount')}
|
||||
</th>
|
||||
<th scope="col" class="relative px-6 py-3">
|
||||
<span class="sr-only">{$_('action')}</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-200">
|
||||
{#each current_donors as donor}
|
||||
{#if donor.firstname
|
||||
.toLowerCase()
|
||||
.includes(
|
||||
searchvalue.toLowerCase()
|
||||
) || donor.lastname
|
||||
.toLowerCase()
|
||||
.includes(
|
||||
searchvalue.toLowerCase()
|
||||
) || should_display_based_on_id(donor.id)}
|
||||
<tr data-rowid="donor_{donor.id}">
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
<div class="flex items-center">
|
||||
<div class="ml-4">
|
||||
<div class="text-sm font-medium text-gray-900">
|
||||
{donor.firstname}
|
||||
{donor.middlename || ''}
|
||||
{donor.lastname}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
{#if donor.email}
|
||||
<div class="text-sm text-gray-500">{donor.email}</div>
|
||||
{/if}
|
||||
{#if donor.phone}
|
||||
<div class="text-sm text-gray-500">{donor.phone}</div>
|
||||
{/if}
|
||||
{#if donor.address.address1 !== null}
|
||||
{donor.address.address1}<br />
|
||||
{donor.address.address2 || ''}<br />
|
||||
{donor.address.postalcode}
|
||||
{donor.address.city}
|
||||
{donor.address.country}
|
||||
{/if}
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
{#if current_donations.filter((d) => d.donor.id == donor.id).length > 0}
|
||||
{#each current_donations.filter((o) => o.donor.id == donor.id) as d}
|
||||
{#if d.responseType === 'DISTANCEDONATION'}
|
||||
<a
|
||||
href="../donations/{d.id}"
|
||||
class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-blue-600 text-white mr-1">{d.runner.firstname}
|
||||
{d.runner.middlename}
|
||||
{d.runner.lastname}</a>
|
||||
{:else}
|
||||
<a
|
||||
href="../donations/{d.id}"
|
||||
class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-700 text-white mr-1">{$_('fixed-donation')}:
|
||||
{(d.amount / 100)
|
||||
.toFixed(2)
|
||||
.toLocaleString('de-DE', { valute: 'EUR' })}€</a>
|
||||
{/if}
|
||||
{/each}
|
||||
{:else}{$_('donor-has-no-associated-donations')}{/if}
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
{(donor.donationAmount / 100)
|
||||
.toFixed(2)
|
||||
.toLocaleString('de-DE', { valute: 'EUR' })}€
|
||||
</td>
|
||||
{#if active_deletes[donor.id] === true}
|
||||
<td
|
||||
class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
|
||||
<button
|
||||
on:click={() => {
|
||||
active_deletes[donor.id] = false;
|
||||
}}
|
||||
tabindex="0"
|
||||
class="ml-4 text-indigo-600 hover:text-indigo-900 cursor-pointer">{$_('cancel-delete')}</button>
|
||||
<button
|
||||
on:click={() => {
|
||||
DonorService.donorControllerRemove(donor.id, false)
|
||||
.then((resp) => {
|
||||
current_donors = current_donors.filter((obj) => obj.id !== donor.id);
|
||||
Toastify({
|
||||
text: 'Donor deleted',
|
||||
duration: 500,
|
||||
backgroundColor:
|
||||
'linear-gradient(to right, #00b09b, #96c93d)',
|
||||
}).showToast();
|
||||
})
|
||||
.catch((err) => {
|
||||
modal_open = true;
|
||||
delete_donor = donor;
|
||||
});
|
||||
}}
|
||||
tabindex="0"
|
||||
class="ml-4 text-red-600 hover:text-red-900 cursor-pointer">{$_('confirm-delete')}</button>
|
||||
</td>
|
||||
{:else}
|
||||
<td
|
||||
class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
|
||||
<a
|
||||
href="./{donor.id}"
|
||||
class="text-indigo-600 hover:text-indigo-900">{$_('details')}</a>
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('DONOR:DELETE')}
|
||||
<button
|
||||
on:click={() => {
|
||||
active_deletes[donor.id] = true;
|
||||
}}
|
||||
tabindex="0"
|
||||
class="ml-4 text-red-600 hover:text-red-900 cursor-pointer">{$_('delete')}</button>
|
||||
{/if}
|
||||
</td>
|
||||
{/if}
|
||||
</tr>
|
||||
{/if}
|
||||
{/each}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{/if}
|
||||
{:catch error}
|
||||
<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">
|
||||
<b class="capitalize">{$_('general_promise_error')}</b>
|
||||
{error}
|
||||
</span>
|
||||
</div>
|
||||
{/await}
|
||||
{/if}
|
1
src/components/donors/donors_empty.svg
Normal file
1
src/components/donors/donors_empty.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 40 KiB |
@@ -1,6 +1,6 @@
|
||||
<script>
|
||||
import { _ } from "svelte-i18n";
|
||||
import { clickOutside } from "./outsideclick";
|
||||
import { clickOutside } from "../base/outsideclick";
|
||||
import { focusTrap } from "svelte-focus-trap";
|
||||
export let modal_open;
|
||||
(function () {
|
||||
@@ -189,34 +189,5 @@
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<h2 class="mt-4 text-4xl font-display font-semibold md:text-5xl">
|
||||
{$_('faq')}
|
||||
</h2>
|
||||
<div class="mt-6 border-t-2 border-gray-100 pt-10">
|
||||
<dl class="md:grid md:grid-cols-2 md:gap-8">
|
||||
<div>
|
||||
<div>
|
||||
<dt class="text-lg leading-6 font-medium">Q</dt>
|
||||
<dd class="mt-2">
|
||||
<p class="text-base text-gray-500">A</p>
|
||||
</dd>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-12 sm:mt-0">
|
||||
<div id="team-pricing">
|
||||
<dt class="text-lg leading-6 font-medium">Q</dt>
|
||||
<dd class="mt-2">
|
||||
<p class="text-base text-gray-500">A</p>
|
||||
</dd>
|
||||
</div>
|
||||
<div class="mt-12">
|
||||
<dt class="text-lg leading-6 font-medium">Q</dt>
|
||||
<dd class="mt-2">
|
||||
<p class="text-base text-gray-500">A</p>
|
||||
</dd>
|
||||
</div>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@@ -1,12 +1,13 @@
|
||||
<script>
|
||||
import { onMount } from "svelte";
|
||||
import { _ } from "svelte-i18n";
|
||||
$: releaseinfo = "";
|
||||
setTimeout(() => {
|
||||
onMount(() => {
|
||||
releaseinfo = document
|
||||
.getElementById("buildinfo")
|
||||
.textContent.replace("RELEASE_INFO-", "")
|
||||
.replace("-RELEASE_INFO", "");
|
||||
}, 1500);
|
||||
});
|
||||
const year = new Date().getFullYear();
|
||||
</script>
|
||||
|
||||
@@ -31,5 +32,11 @@
|
||||
target="_blank"
|
||||
rel="noopener, noreferrer"
|
||||
href="https://git.odit.services/lfk/frontend/src/tag/{releaseinfo}">{releaseinfo}</a>
|
||||
-
|
||||
<a class="underline" href="https://docs.lauf-fuer-kaya.de" target="_blank">{$_('documentation')}</a>
|
||||
-
|
||||
<a class="underline" href="/privacy">{$_('privacy')}</a>
|
||||
-
|
||||
<a class="underline" href="/imprint">{$_('imprint')}</a>
|
||||
</p>
|
||||
</footer>
|
50
src/components/general/Imprint.svelte
Normal file
50
src/components/general/Imprint.svelte
Normal file
@@ -0,0 +1,50 @@
|
||||
<script>
|
||||
import { _, getLocaleFromNavigator } from "svelte-i18n";
|
||||
import marked from "marked";
|
||||
import Footer from "./Footer.svelte";
|
||||
import * as css from "../base/simple.css";
|
||||
let html = "";
|
||||
async function load() {
|
||||
let md = await fetch("/imprint_" + getLocaleFromNavigator() + ".md");
|
||||
let text = (await md.text()).toString();
|
||||
if(text.includes("<meta")){
|
||||
md.ok=false
|
||||
}
|
||||
if (!md.ok) {
|
||||
md = await fetch("/imprint_en.md");
|
||||
text = await md.text();
|
||||
}
|
||||
html = marked(text);
|
||||
}
|
||||
const promise = load();
|
||||
</script>
|
||||
|
||||
<div class="pt-12 px-4 sm:px-6 lg:px-8 lg:pt-20 bg-gray-900 pb-12">
|
||||
<div class="text-center mb-8">
|
||||
<h1
|
||||
class="mt-9 font-display text-4xl leading-none font-semibold text-white sm:text-5xl lg:text-6xl">
|
||||
{$_('imprint')}
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pt-0 pb-16 overflow-hidden lg:pt-12 lg:py-24">
|
||||
<div class="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8">
|
||||
{#await promise}
|
||||
<p class="text-center w-full">{$_('imprint-loading')}</p>
|
||||
{:then}
|
||||
<div class="simplecontent">
|
||||
{@html html}
|
||||
</div>
|
||||
{:catch error}
|
||||
<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">
|
||||
<b class="capitalize">{$_('general_promise_error')}</b>
|
||||
{error}
|
||||
</span>
|
||||
</div>
|
||||
{/await}
|
||||
</div>
|
||||
</div>
|
||||
<Footer />
|
50
src/components/general/Privacy.svelte
Normal file
50
src/components/general/Privacy.svelte
Normal file
@@ -0,0 +1,50 @@
|
||||
<script>
|
||||
import { _, getLocaleFromNavigator } from "svelte-i18n";
|
||||
import marked from "marked";
|
||||
import Footer from "./Footer.svelte";
|
||||
import * as css from "../base/simple.css";
|
||||
let html = "";
|
||||
async function load() {
|
||||
let md = await fetch("/privacy_" + getLocaleFromNavigator() + ".md");
|
||||
let text = (await md.text()).toString();
|
||||
if(text.includes("<meta")){
|
||||
md.ok=false
|
||||
}
|
||||
if (!md.ok) {
|
||||
md = await fetch("/privacy_en.md");
|
||||
text = await md.text();
|
||||
}
|
||||
html = marked(text);
|
||||
}
|
||||
const promise = load();
|
||||
</script>
|
||||
|
||||
<div class="pt-12 px-4 sm:px-6 lg:px-8 lg:pt-20 bg-gray-900 pb-12">
|
||||
<div class="text-center mb-8">
|
||||
<h1
|
||||
class="mt-9 font-display text-4xl leading-none font-semibold text-white sm:text-5xl lg:text-6xl">
|
||||
{$_('privacy')}
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pt-0 pb-16 overflow-hidden lg:pt-12 lg:py-24">
|
||||
<div class="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8">
|
||||
{#await promise}
|
||||
<p class="text-center w-full">{$_('privacy-loading')}</p>
|
||||
{:then}
|
||||
<div class="simplecontent">
|
||||
{@html html}
|
||||
</div>
|
||||
{:catch error}
|
||||
<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">
|
||||
<b class="capitalize">{$_('general_promise_error')}</b>
|
||||
{error}
|
||||
</span>
|
||||
</div>
|
||||
{/await}
|
||||
</div>
|
||||
</div>
|
||||
<Footer />
|
175
src/components/groups/AddGroupModal.svelte
Normal file
175
src/components/groups/AddGroupModal.svelte
Normal file
@@ -0,0 +1,175 @@
|
||||
<script>
|
||||
import { _ } from "svelte-i18n";
|
||||
import { clickOutside } from "../base/outsideclick";
|
||||
import { focusTrap } from "svelte-focus-trap";
|
||||
import Toastify from "toastify-js";
|
||||
import { UserGroupService } from "@odit/lfk-client-js";
|
||||
export let modal_open;
|
||||
export let current_groups;
|
||||
let description_input_value;
|
||||
function focus(el) {
|
||||
el.focus();
|
||||
}
|
||||
$: description_input_value = "";
|
||||
$: name_input_value = "";
|
||||
$: processed_last_submit = true;
|
||||
$: isNameValid = name_input_value.trim().length !== 0;
|
||||
$: createbtnenabled = isNameValid;
|
||||
(() => {
|
||||
document.onkeydown = (e) => {
|
||||
e = e || window.event;
|
||||
if (e.key === "Escape") {
|
||||
modal_open = false;
|
||||
}
|
||||
if (e.keyCode === 13) {
|
||||
if (createbtnenabled === true) {
|
||||
createbtnenabled = false;
|
||||
submit();
|
||||
}
|
||||
}
|
||||
};
|
||||
})();
|
||||
function submit() {
|
||||
if (processed_last_submit === true) {
|
||||
processed_last_submit = false;
|
||||
const toast = Toastify({
|
||||
text: $_('group-is-being-added'),
|
||||
duration: -1,
|
||||
}).showToast();
|
||||
let postdata = {
|
||||
name: name_input_value,
|
||||
description: description_input_value,
|
||||
};
|
||||
UserGroupService.userGroupControllerPost(postdata)
|
||||
.then((result) => {
|
||||
name_input_value = "";
|
||||
description_input_value = "";
|
||||
modal_open = false;
|
||||
//
|
||||
Toastify({
|
||||
text: $_('group-added'),
|
||||
duration: 500,
|
||||
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
|
||||
}).showToast();
|
||||
current_groups.push(result);
|
||||
current_groups = current_groups;
|
||||
})
|
||||
.catch((err) => {
|
||||
//
|
||||
})
|
||||
.finally(() => {
|
||||
processed_last_submit = true;
|
||||
//
|
||||
toast.hideToast();
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if modal_open}
|
||||
<div
|
||||
class="fixed z-10 inset-0 overflow-y-auto"
|
||||
use:focusTrap
|
||||
use:clickOutside
|
||||
on:click_outside={() => {
|
||||
modal_open = false;
|
||||
}}>
|
||||
<div
|
||||
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="absolute inset-0 bg-gray-500 opacity-75"
|
||||
data-id="modal_backdrop" />
|
||||
</div>
|
||||
<span
|
||||
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 overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg 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">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 640 512"
|
||||
class="h-6 w-6 text-blue-600"
|
||||
fill="currentColor"
|
||||
width="24"
|
||||
height="24"><path fill="none" d="M0 0h24v24H0z" />
|
||||
<path
|
||||
d="M610.5 341.3c2.6-14.1 2.6-28.5 0-42.6l25.8-14.9c3-1.7 4.3-5.2 3.3-8.5-6.7-21.6-18.2-41.2-33.2-57.4-2.3-2.5-6-3.1-9-1.4l-25.8 14.9c-10.9-9.3-23.4-16.5-36.9-21.3v-29.8c0-3.4-2.4-6.4-5.7-7.1-22.3-5-45-4.8-66.2 0-3.3.7-5.7 3.7-5.7 7.1v29.8c-13.5 4.8-26 12-36.9 21.3l-25.8-14.9c-2.9-1.7-6.7-1.1-9 1.4-15 16.2-26.5 35.8-33.2 57.4-1 3.3.4 6.8 3.3 8.5l25.8 14.9c-2.6 14.1-2.6 28.5 0 42.6l-25.8 14.9c-3 1.7-4.3 5.2-3.3 8.5 6.7 21.6 18.2 41.1 33.2 57.4 2.3 2.5 6 3.1 9 1.4l25.8-14.9c10.9 9.3 23.4 16.5 36.9 21.3v29.8c0 3.4 2.4 6.4 5.7 7.1 22.3 5 45 4.8 66.2 0 3.3-.7 5.7-3.7 5.7-7.1v-29.8c13.5-4.8 26-12 36.9-21.3l25.8 14.9c2.9 1.7 6.7 1.1 9-1.4 15-16.2 26.5-35.8 33.2-57.4 1-3.3-.4-6.8-3.3-8.5l-25.8-14.9zM496 368.5c-26.8 0-48.5-21.8-48.5-48.5s21.8-48.5 48.5-48.5 48.5 21.8 48.5 48.5-21.7 48.5-48.5 48.5zM96 224c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm224 32c1.9 0 3.7-.5 5.6-.6 8.3-21.7 20.5-42.1 36.3-59.2 7.4-8 17.9-12.6 28.9-12.6 6.9 0 13.7 1.8 19.6 5.3l7.9 4.6c.8-.5 1.6-.9 2.4-1.4 7-14.6 11.2-30.8 11.2-48 0-61.9-50.1-112-112-112S208 82.1 208 144c0 61.9 50.1 112 112 112zm105.2 194.5c-2.3-1.2-4.6-2.6-6.8-3.9-8.2 4.8-15.3 9.8-27.5 9.8-10.9 0-21.4-4.6-28.9-12.6-18.3-19.8-32.3-43.9-40.2-69.6-10.7-34.5 24.9-49.7 25.8-50.3-.1-2.6-.1-5.2 0-7.8l-7.9-4.6c-3.8-2.2-7-5-9.8-8.1-3.3.2-6.5.6-9.8.6-24.6 0-47.6-6-68.5-16h-8.3C179.6 288 128 339.6 128 403.2V432c0 26.5 21.5 48 48 48h255.4c-3.7-6-6.2-12.8-6.2-20.3v-9.2zM173.1 274.6C161.5 263.1 145.6 256 128 256H64c-35.3 0-64 28.7-64 64v32c0 17.7 14.3 32 32 32h65.9c6.3-47.4 34.9-87.3 75.2-109.4z" /></svg>
|
||||
</div>
|
||||
<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">
|
||||
{$_('create-a-new-user-group')}
|
||||
</h3>
|
||||
<div class="mt-2 mb-6">
|
||||
<p class="text-sm text-gray-500">
|
||||
{$_('please-provide-the-required-information-for-creating-a-new-user-group')}
|
||||
</p>
|
||||
</div>
|
||||
<div class="grid grid-cols-6 gap-6">
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="firstname"
|
||||
class="block text-sm font-medium text-gray-700">{$_('name')}</label>
|
||||
<input
|
||||
use:focus
|
||||
autocomplete="off"
|
||||
placeholder="{$_('name')}"
|
||||
class:border-red-500={!isNameValid}
|
||||
class:focus:border-red-500={!isNameValid}
|
||||
class:focus:ring-red-500={!isNameValid}
|
||||
bind:value={name_input_value}
|
||||
type="text"
|
||||
name="firstname"
|
||||
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 !isNameValid}
|
||||
<span
|
||||
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
|
||||
{$_('name-is-required')}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="trackname"
|
||||
class="block text-sm font-medium text-gray-700">{$_('description-optional')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="{$_('something-about-the-group')}"
|
||||
bind:value={description_input_value}
|
||||
type="text"
|
||||
name="trackname"
|
||||
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" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse">
|
||||
<button
|
||||
disabled={!createbtnenabled}
|
||||
class:opacity-50={!createbtnenabled}
|
||||
on:click={submit}
|
||||
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')}
|
||||
</button>
|
||||
<button
|
||||
on:click={() => {
|
||||
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">
|
||||
{$_('cancel')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
220
src/components/groups/GroupDetail.svelte
Normal file
220
src/components/groups/GroupDetail.svelte
Normal file
@@ -0,0 +1,220 @@
|
||||
<script>
|
||||
import { _ } from "svelte-i18n";
|
||||
import store from "../../store";
|
||||
import {
|
||||
UserGroupService
|
||||
} from "@odit/lfk-client-js";
|
||||
import Toastify from "toastify-js";
|
||||
import PromiseError from "../base/PromiseError.svelte";
|
||||
let data_loaded = false;
|
||||
export let params;
|
||||
const promise = UserGroupService.userGroupControllerGetOne(params.groupid);
|
||||
const colors = [
|
||||
"#f3558e",
|
||||
"#17b978",
|
||||
"#3498db",
|
||||
"#3f3b3b",
|
||||
"#775ada",
|
||||
"#7ed6df_#000000",
|
||||
"#000000",
|
||||
"#21e6c1_#000000",
|
||||
"#c0392b",
|
||||
"#d35400",
|
||||
"#7f8c8d",
|
||||
"#6ab04c",
|
||||
"#4834d4",
|
||||
"#ff1f5a",
|
||||
"#eac100",
|
||||
];
|
||||
let matched_colors = [];
|
||||
$: delete_triggered = false;
|
||||
$: search_permission = "";
|
||||
$: original_data = {};
|
||||
$: editable = {};
|
||||
$: changes_performed = !(JSON.stringify(original_data) == JSON.stringify(editable));
|
||||
$: isGroupnameValid = editable.name !== "";
|
||||
$: save_enabled =
|
||||
changes_performed && isGroupnameValid
|
||||
promise.then((data) => {
|
||||
let current_target = "";
|
||||
let colorindex = -1;
|
||||
data.permissions = data.permissions.sort();
|
||||
data.permissions.forEach((p) => {
|
||||
const target = p.split(":")[0];
|
||||
if (current_target !== p.split(":")[0]) {
|
||||
colorindex++;
|
||||
current_target = p.split(":")[0];
|
||||
}
|
||||
let background = colors[colorindex];
|
||||
let foreground = "#fff";
|
||||
if (background.includes("_")) {
|
||||
foreground = background.split("_")[1];
|
||||
background = background.split("_")[0];
|
||||
}
|
||||
matched_colors[target] = [background, foreground];
|
||||
});
|
||||
data_loaded = true;
|
||||
original_data = Object.assign(original_data, data);
|
||||
editable = Object.assign(editable, original_data);
|
||||
});
|
||||
function submit() {
|
||||
if (data_loaded === true && save_enabled) {
|
||||
Toastify({
|
||||
text: $_('updateing-group'),
|
||||
duration: 2500,
|
||||
}).showToast();
|
||||
UserGroupService.userGroupControllerPut(original_data.id, editable)
|
||||
.then((resp) => {
|
||||
Object.assign(original_data, editable);
|
||||
original_data = editable;
|
||||
Object.assign(original_data, editable);
|
||||
Toastify({
|
||||
text: $_('group-updated'),
|
||||
duration: 2500,
|
||||
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
|
||||
}).showToast();
|
||||
})
|
||||
.catch((err) => {});
|
||||
} else {
|
||||
}
|
||||
}
|
||||
function deleteGroup() {
|
||||
UserGroupService.userGroupControllerRemove(original_data.id, true)
|
||||
.then((resp) => {
|
||||
location.replace("./");
|
||||
})
|
||||
.catch((err) => {});
|
||||
}
|
||||
</script>
|
||||
|
||||
{#await promise}
|
||||
{$_('loading-group-detail')}
|
||||
{:then}
|
||||
<section class="container p-5 select-none">
|
||||
<div class="flex flex-row mb-4">
|
||||
<div class="w-full">
|
||||
<nav class="w-full flex">
|
||||
<ol class="list-none flex flex-row items-center justify-start">
|
||||
<li class="flex items-center">
|
||||
<svg class="flex-shrink-0 w-5 h-5 mr-2" fill="currentColor" width="24" height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><path fill="currentColor" d="M610.5 341.3c2.6-14.1 2.6-28.5 0-42.6l25.8-14.9c3-1.7 4.3-5.2 3.3-8.5-6.7-21.6-18.2-41.2-33.2-57.4-2.3-2.5-6-3.1-9-1.4l-25.8 14.9c-10.9-9.3-23.4-16.5-36.9-21.3v-29.8c0-3.4-2.4-6.4-5.7-7.1-22.3-5-45-4.8-66.2 0-3.3.7-5.7 3.7-5.7 7.1v29.8c-13.5 4.8-26 12-36.9 21.3l-25.8-14.9c-2.9-1.7-6.7-1.1-9 1.4-15 16.2-26.5 35.8-33.2 57.4-1 3.3.4 6.8 3.3 8.5l25.8 14.9c-2.6 14.1-2.6 28.5 0 42.6l-25.8 14.9c-3 1.7-4.3 5.2-3.3 8.5 6.7 21.6 18.2 41.1 33.2 57.4 2.3 2.5 6 3.1 9 1.4l25.8-14.9c10.9 9.3 23.4 16.5 36.9 21.3v29.8c0 3.4 2.4 6.4 5.7 7.1 22.3 5 45 4.8 66.2 0 3.3-.7 5.7-3.7 5.7-7.1v-29.8c13.5-4.8 26-12 36.9-21.3l25.8 14.9c2.9 1.7 6.7 1.1 9-1.4 15-16.2 26.5-35.8 33.2-57.4 1-3.3-.4-6.8-3.3-8.5l-25.8-14.9zM496 368.5c-26.8 0-48.5-21.8-48.5-48.5s21.8-48.5 48.5-48.5 48.5 21.8 48.5 48.5-21.7 48.5-48.5 48.5zM96 224c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm224 32c1.9 0 3.7-.5 5.6-.6 8.3-21.7 20.5-42.1 36.3-59.2 7.4-8 17.9-12.6 28.9-12.6 6.9 0 13.7 1.8 19.6 5.3l7.9 4.6c.8-.5 1.6-.9 2.4-1.4 7-14.6 11.2-30.8 11.2-48 0-61.9-50.1-112-112-112S208 82.1 208 144c0 61.9 50.1 112 112 112zm105.2 194.5c-2.3-1.2-4.6-2.6-6.8-3.9-8.2 4.8-15.3 9.8-27.5 9.8-10.9 0-21.4-4.6-28.9-12.6-18.3-19.8-32.3-43.9-40.2-69.6-10.7-34.5 24.9-49.7 25.8-50.3-.1-2.6-.1-5.2 0-7.8l-7.9-4.6c-3.8-2.2-7-5-9.8-8.1-3.3.2-6.5.6-9.8.6-24.6 0-47.6-6-68.5-16h-8.3C179.6 288 128 339.6 128 403.2V432c0 26.5 21.5 48 48 48h255.4c-3.7-6-6.2-12.8-6.2-20.3v-9.2zM173.1 274.6C161.5 263.1 145.6 256 128 256H64c-35.3 0-64 28.7-64 64v32c0 17.7 14.3 32 32 32h65.9c6.3-47.4 34.9-87.3 75.2-109.4z"></path></svg>
|
||||
</li>
|
||||
<li class="flex items-center">
|
||||
<a class="mr-2" href="../">{$_('groups')}</a><svg
|
||||
stroke="currentColor"
|
||||
fill="none"
|
||||
stroke-width="2"
|
||||
viewBox="0 0 24 24"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
class="h-3 w-3 mr-2 stroke-current"
|
||||
height="1em"
|
||||
width="1em"
|
||||
xmlns="http://www.w3.org/2000/svg"><line
|
||||
x1="5"
|
||||
y1="12"
|
||||
x2="19"
|
||||
y2="12" />
|
||||
<polyline points="12 5 19 12 12 19" /></svg>
|
||||
</li>
|
||||
<li class="flex items-center">
|
||||
<span class="mr-2">{editable.name}</span>
|
||||
</li>
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-8 text-3xl font-extrabold leading-tight">
|
||||
{original_data.name}
|
||||
<span data-id="group_actions_${editable.id}">
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('USERGROUP:DELETE')}
|
||||
{#if delete_triggered}
|
||||
<button
|
||||
on:click={deleteGroup}
|
||||
class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm">{$_('confirm-deletion')}</button>
|
||||
<button
|
||||
on:click={() => {
|
||||
delete_triggered = !delete_triggered;
|
||||
}}
|
||||
class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-400 text-base font-medium text-white sm:w-auto sm:text-sm">{$_('cancel')}</button>
|
||||
{/if}
|
||||
{#if !delete_triggered}
|
||||
<button
|
||||
on:click={() => {
|
||||
delete_triggered = true;
|
||||
}}
|
||||
type="button"
|
||||
class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm">{$_('delete-group')}</button>
|
||||
{/if}
|
||||
{/if}
|
||||
{#if !delete_triggered}
|
||||
<button
|
||||
disabled={!save_enabled}
|
||||
class:opacity-50={!save_enabled}
|
||||
type="button"
|
||||
on:click={submit}
|
||||
class="w-full 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">{$_('save-changes')}</button>
|
||||
{/if}
|
||||
</span>
|
||||
</div>
|
||||
<!-- -->
|
||||
<div class="text-sm w-full">
|
||||
<label
|
||||
for="title"
|
||||
class="font-medium text-gray-700">{$_('name')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder={$_('name')}
|
||||
type="text"
|
||||
bind:value={editable.name}
|
||||
class:border-red-500={!isGroupnameValid}
|
||||
class:focus:border-red-500={!isGroupnameValid}
|
||||
class:focus:ring-red-500={!isGroupnameValid}
|
||||
name="title"
|
||||
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 !isGroupnameValid}
|
||||
<span
|
||||
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
|
||||
{$_('group-name-is-required')}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="text-sm w-full">
|
||||
<label
|
||||
for="firstname"
|
||||
class="font-medium text-gray-700">{$_('description')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder={$_('description')}
|
||||
type="text"
|
||||
bind:value={editable.description}
|
||||
name="firstname"
|
||||
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" />
|
||||
</div>
|
||||
<div class="text-sm w-full mt-8">
|
||||
<p class="font-medium mb-4">
|
||||
{$_('permissions')}
|
||||
<a
|
||||
class="px-4 py-2 bg-gray-500 rounded-md text-white"
|
||||
href="/groups/{params.groupid}/permissions/">{$_('edit-permissions')}</a>
|
||||
</p>
|
||||
<div class="w-full sm:my-px sm:px-px sm:w-1/2">
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="{$_('search-for-permission')}"
|
||||
type="text"
|
||||
bind:value={search_permission}
|
||||
class="mt-4 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 dark:bg-gray-900 dark:text-gray-100 rounded-md p-2" />
|
||||
</div>
|
||||
{#each original_data.permissions as p}
|
||||
{#if p.toLowerCase().includes(search_permission.toLowerCase())}
|
||||
<span
|
||||
style="background:{matched_colors[p.split(':')[0]][0]};color:{matched_colors[p.split(':')[0]][1]};"
|
||||
class="mt-1 inline-flex items-center justify-center px-2 py-1 text-xs font-bold leading-none text-indigo-100 rounded">{p}</span>
|
||||
<!-- -->
|
||||
{/if}
|
||||
{/each}
|
||||
</div>
|
||||
</section>
|
||||
{:catch error}
|
||||
<PromiseError {error} />
|
||||
{/await}
|
226
src/components/groups/GroupPermissions.svelte
Normal file
226
src/components/groups/GroupPermissions.svelte
Normal file
@@ -0,0 +1,226 @@
|
||||
<script>
|
||||
import { _ } from "svelte-i18n";
|
||||
import {
|
||||
PermissionService,
|
||||
CreatePermission,
|
||||
UserGroupService,
|
||||
} from "@odit/lfk-client-js";
|
||||
import Toastify from "toastify-js";
|
||||
import PromiseError from "../base/PromiseError.svelte";
|
||||
export let params;
|
||||
let [
|
||||
grantedPermissions_initial,
|
||||
grantedPermissions,
|
||||
to_add,
|
||||
to_delete,
|
||||
allpermissions,
|
||||
promises,
|
||||
] = [[], [], [], [], [], []];
|
||||
$: original_data = {};
|
||||
$: save_enabled =
|
||||
JSON.stringify(grantedPermissions) ===
|
||||
JSON.stringify(grantedPermissions_initial);
|
||||
const group_promise = UserGroupService.userGroupControllerGetOne(params.groupid);
|
||||
group_promise.then((data) => {
|
||||
original_data = Object.assign(original_data, data);
|
||||
});
|
||||
function submit() {
|
||||
Toastify({
|
||||
text: $_('updating-permissions'),
|
||||
duration: 2500,
|
||||
}).showToast();
|
||||
to_delete.forEach((d) => {
|
||||
promises = promises.concat([
|
||||
PermissionService.permissionControllerRemove(d, true),
|
||||
]);
|
||||
});
|
||||
to_add.forEach((a) => {
|
||||
promises = promises.concat([
|
||||
PermissionService.permissionControllerPost(a),
|
||||
]);
|
||||
});
|
||||
Promise.all(promises).then((values) => {
|
||||
promises = [];
|
||||
to_delete.forEach((d) => {
|
||||
to_delete = to_delete.filter((o) => o !== d);
|
||||
});
|
||||
to_add.forEach((a) => {
|
||||
to_add = to_add.filter(
|
||||
(o) => o.target + ":" + o.action !== a.target + ":" + a.action
|
||||
);
|
||||
});
|
||||
grantedPermissions_initial = grantedPermissions;
|
||||
Toastify({
|
||||
text: $_("permissions-updated"),
|
||||
duration: 2500,
|
||||
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
|
||||
}).showToast();
|
||||
});
|
||||
}
|
||||
Object.values(CreatePermission.target).forEach((t) => {
|
||||
Object.values(CreatePermission.action).forEach((a) => {
|
||||
allpermissions = allpermissions.concat([{ target: t, action: a }]);
|
||||
});
|
||||
});
|
||||
UserGroupService.userGroupControllerGetPermissions(params.groupid).then((val) => {
|
||||
val.directlyGranted.forEach((p) => {
|
||||
delete p.responseType;
|
||||
grantedPermissions = grantedPermissions.concat([p]);
|
||||
});
|
||||
grantedPermissions_initial = grantedPermissions;
|
||||
});
|
||||
</script>
|
||||
|
||||
{#await group_promise}
|
||||
<!-- -->
|
||||
{:then user}
|
||||
<section class="container p-5 select-none">
|
||||
<div class="flex flex-row mb-4">
|
||||
<div class="w-full">
|
||||
<nav class="w-full flex">
|
||||
<ol class="list-none flex flex-row items-center justify-start">
|
||||
<li class="flex items-center">
|
||||
<svg
|
||||
class="flex-shrink-0 w-5 h-5 mr-2"
|
||||
fill="currentColor"
|
||||
width="24"
|
||||
height="24"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 640 512"><path
|
||||
fill="currentColor"
|
||||
d="M610.5 341.3c2.6-14.1 2.6-28.5 0-42.6l25.8-14.9c3-1.7 4.3-5.2 3.3-8.5-6.7-21.6-18.2-41.2-33.2-57.4-2.3-2.5-6-3.1-9-1.4l-25.8 14.9c-10.9-9.3-23.4-16.5-36.9-21.3v-29.8c0-3.4-2.4-6.4-5.7-7.1-22.3-5-45-4.8-66.2 0-3.3.7-5.7 3.7-5.7 7.1v29.8c-13.5 4.8-26 12-36.9 21.3l-25.8-14.9c-2.9-1.7-6.7-1.1-9 1.4-15 16.2-26.5 35.8-33.2 57.4-1 3.3.4 6.8 3.3 8.5l25.8 14.9c-2.6 14.1-2.6 28.5 0 42.6l-25.8 14.9c-3 1.7-4.3 5.2-3.3 8.5 6.7 21.6 18.2 41.1 33.2 57.4 2.3 2.5 6 3.1 9 1.4l25.8-14.9c10.9 9.3 23.4 16.5 36.9 21.3v29.8c0 3.4 2.4 6.4 5.7 7.1 22.3 5 45 4.8 66.2 0 3.3-.7 5.7-3.7 5.7-7.1v-29.8c13.5-4.8 26-12 36.9-21.3l25.8 14.9c2.9 1.7 6.7 1.1 9-1.4 15-16.2 26.5-35.8 33.2-57.4 1-3.3-.4-6.8-3.3-8.5l-25.8-14.9zM496 368.5c-26.8 0-48.5-21.8-48.5-48.5s21.8-48.5 48.5-48.5 48.5 21.8 48.5 48.5-21.7 48.5-48.5 48.5zM96 224c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm224 32c1.9 0 3.7-.5 5.6-.6 8.3-21.7 20.5-42.1 36.3-59.2 7.4-8 17.9-12.6 28.9-12.6 6.9 0 13.7 1.8 19.6 5.3l7.9 4.6c.8-.5 1.6-.9 2.4-1.4 7-14.6 11.2-30.8 11.2-48 0-61.9-50.1-112-112-112S208 82.1 208 144c0 61.9 50.1 112 112 112zm105.2 194.5c-2.3-1.2-4.6-2.6-6.8-3.9-8.2 4.8-15.3 9.8-27.5 9.8-10.9 0-21.4-4.6-28.9-12.6-18.3-19.8-32.3-43.9-40.2-69.6-10.7-34.5 24.9-49.7 25.8-50.3-.1-2.6-.1-5.2 0-7.8l-7.9-4.6c-3.8-2.2-7-5-9.8-8.1-3.3.2-6.5.6-9.8.6-24.6 0-47.6-6-68.5-16h-8.3C179.6 288 128 339.6 128 403.2V432c0 26.5 21.5 48 48 48h255.4c-3.7-6-6.2-12.8-6.2-20.3v-9.2zM173.1 274.6C161.5 263.1 145.6 256 128 256H64c-35.3 0-64 28.7-64 64v32c0 17.7 14.3 32 32 32h65.9c6.3-47.4 34.9-87.3 75.2-109.4z" /></svg>
|
||||
</li>
|
||||
<li class="flex items-center">
|
||||
<a class="mr-2" href="../../">{$_('user-groups')}</a><svg
|
||||
stroke="currentColor"
|
||||
fill="none"
|
||||
stroke-width="2"
|
||||
viewBox="0 0 24 24"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
class="h-3 w-3 mr-2 stroke-current"
|
||||
height="1em"
|
||||
width="1em"
|
||||
xmlns="http://www.w3.org/2000/svg"><line
|
||||
x1="5"
|
||||
y1="12"
|
||||
x2="19"
|
||||
y2="12" />
|
||||
<polyline points="12 5 19 12 12 19" /></svg>
|
||||
</li>
|
||||
<li class="flex items-center">
|
||||
<span class="mr-2"><a href="../">{original_data.name}</a></span>
|
||||
</li>
|
||||
<li class="flex items-center">
|
||||
<svg
|
||||
stroke="currentColor"
|
||||
fill="none"
|
||||
stroke-width="2"
|
||||
viewBox="0 0 24 24"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
class="h-3 w-3 mr-2 stroke-current"
|
||||
height="1em"
|
||||
width="1em"
|
||||
xmlns="http://www.w3.org/2000/svg"><line
|
||||
x1="5"
|
||||
y1="12"
|
||||
x2="19"
|
||||
y2="12" />
|
||||
<polyline points="12 5 19 12 12 19" /></svg>
|
||||
</li>
|
||||
<li class="flex items-center">
|
||||
<span class="mr-2">{$_('permissions')}</span>
|
||||
</li>
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-8 text-3xl font-extrabold">
|
||||
{$_('permissions')}:
|
||||
{original_data.name}
|
||||
<span>
|
||||
{#if promises.length === 0}
|
||||
<button
|
||||
disabled={save_enabled}
|
||||
class:opacity-50={save_enabled}
|
||||
type="button"
|
||||
on:click={submit}
|
||||
class="w-full 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">{$_('save-changes')}</button>
|
||||
{:else}
|
||||
<button
|
||||
type="button"
|
||||
class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-yellow-600 text-base font-medium text-white hover:bg-yellow-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-yellow-500 sm:ml-3 sm:w-auto sm:text-sm">{$_('applying-changes')}</button>
|
||||
{/if}
|
||||
</span>
|
||||
</div>
|
||||
<!-- -->
|
||||
<div class="flex flex-wrap -mx-1 overflow-hidden">
|
||||
<div class="my-1 px-1 w-full overflow-hidden sm:w-1/2">
|
||||
{$_('verfuegbare')}
|
||||
</div>
|
||||
<div class="my-1 px-1 w-full overflow-hidden sm:w-1/2">
|
||||
{$_('granted')}
|
||||
</div>
|
||||
</div>
|
||||
<!-- -->
|
||||
<div class="flex flex-wrap -mx-1 overflow-hidden">
|
||||
{#if allpermissions.length > 0}
|
||||
<div class="my-1 px-1 w-full overflow-hidden sm:w-1/2">
|
||||
<div
|
||||
class="border-4 border-dashed rounded mb-4 p-5 text-lg text-center">
|
||||
{#each allpermissions as p}
|
||||
{#if !(grantedPermissions.filter((o)=>p.target == o.target && p.action == o.action).length > 0)}
|
||||
<p
|
||||
class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 bg-gray-200 p-2 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input">
|
||||
{p.target + ':' + p.action}
|
||||
<button
|
||||
on:click={() => {
|
||||
grantedPermissions = grantedPermissions.concat([p]);
|
||||
if (to_delete.some((o) => o === p.id)) {
|
||||
to_delete = to_delete.filter((o) => o !== p.id);
|
||||
} else {
|
||||
to_add = to_add.concat([
|
||||
{
|
||||
action: p.action,
|
||||
target: p.target,
|
||||
principal: original_data.id,
|
||||
},
|
||||
]);
|
||||
}
|
||||
}}
|
||||
type="button"
|
||||
class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-green-200 text-base font-medium text-black hover:bg-green-700 hover:text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 sm:ml-3 sm:w-auto sm:text-sm">+</button>
|
||||
</p>
|
||||
{/if}
|
||||
{/each}
|
||||
</div>
|
||||
</div>
|
||||
<div class="my-1 px-1 w-full overflow-hidden sm:w-1/2">
|
||||
<div
|
||||
class="border-4 border-dashed rounded mb-4 p-5 text-lg text-center">
|
||||
{#each grantedPermissions as p}
|
||||
<p
|
||||
class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 bg-gray-200 p-2 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input">
|
||||
{p.target + ':' + p.action}
|
||||
<button
|
||||
on:click={() => {
|
||||
grantedPermissions = grantedPermissions.filter((o) => o.target + ':' + o.action !== p.target + ':' + p.action);
|
||||
if (to_add.some((o) => o.target + ':' + o.action === p.target + ':' + p.action)) {
|
||||
to_add = to_add.filter((o) => o.target + ':' + o.action !== p.target + ':' + p.action);
|
||||
} else {
|
||||
to_delete = to_delete.concat([p.id]);
|
||||
}
|
||||
}}
|
||||
type="button"
|
||||
class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-300 text-base font-medium text-black hover:bg-red-700 hover:text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500 sm:ml-3 sm:w-auto sm:text-sm">-</button>
|
||||
</p>
|
||||
{/each}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</section>
|
||||
{:catch error}
|
||||
<PromiseError {error} />
|
||||
{/await}
|
29
src/components/groups/Groups.svelte
Normal file
29
src/components/groups/Groups.svelte
Normal file
@@ -0,0 +1,29 @@
|
||||
<script>
|
||||
import { _ } from "svelte-i18n";
|
||||
import store from "../../store";
|
||||
import AddGroupModal from "./AddGroupModal.svelte";
|
||||
import UserGroupsOverview from "./UserGroupsOverview.svelte";
|
||||
$: current_groups = [];
|
||||
export let modal_open = false;
|
||||
</script>
|
||||
|
||||
<section class="container p-5">
|
||||
<span class="mb-1 text-3xl font-extrabold leading-tight">
|
||||
{$_('user-groups')}
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('USERGROUP:CREATE')}
|
||||
<button
|
||||
on:click={() => {
|
||||
modal_open = true;
|
||||
}}
|
||||
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">
|
||||
{$_('add-user-group')}
|
||||
</button>
|
||||
{/if}
|
||||
</span>
|
||||
<UserGroupsOverview bind:current_groups />
|
||||
</section>
|
||||
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('USERGROUP:CREATE')}
|
||||
<AddGroupModal bind:current_groups bind:modal_open />
|
||||
{/if}
|
12
src/components/groups/UserGroupsEmptyState.svelte
Normal file
12
src/components/groups/UserGroupsEmptyState.svelte
Normal file
@@ -0,0 +1,12 @@
|
||||
<script>
|
||||
import { _ } from "svelte-i18n";
|
||||
import groups_empty from "./groups_empty.svg";
|
||||
</script>
|
||||
|
||||
<div class="text-center items-center justify-center">
|
||||
<p class="mb-16 text-lg text-gray-500">
|
||||
<img class="w-full h-44" src={groups_empty} alt="" />
|
||||
<span class="font-bold">{$_('there-are-no-groups-yet')}.</span><br />
|
||||
<span>{$_('add-your-first-group')}</span>
|
||||
</p>
|
||||
</div>
|
126
src/components/groups/UserGroupsOverview.svelte
Normal file
126
src/components/groups/UserGroupsOverview.svelte
Normal file
@@ -0,0 +1,126 @@
|
||||
<script>
|
||||
import { _ } from "svelte-i18n";
|
||||
import { UserGroupService } from "@odit/lfk-client-js";
|
||||
import store from "../../store";
|
||||
import UserGroupsEmptyState from "./UserGroupsEmptyState.svelte";
|
||||
$: searchvalue = "";
|
||||
$: active_deletes = [];
|
||||
export let current_groups = [];
|
||||
const groups_promise = UserGroupService.userGroupControllerGetAll().then(
|
||||
(val) => {
|
||||
current_groups = val;
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('USERGROUP:GET')}
|
||||
{#await groups_promise}
|
||||
<div
|
||||
class="bg-teal-lightest border-t-4 border-teal rounded-b text-teal-darkest px-4 py-3 shadow-md my-2"
|
||||
role="alert">
|
||||
<p class="font-bold">{$_('groups-are-being-loaded')}</p>
|
||||
<p class="text-sm">{$_('this-might-take-a-moment')}</p>
|
||||
</div>
|
||||
{:then}
|
||||
{#if current_groups.length === 0}
|
||||
<UserGroupsEmptyState />
|
||||
{:else}
|
||||
<input
|
||||
type="search"
|
||||
bind:value={searchvalue}
|
||||
placeholder={$_('datatable.search')}
|
||||
aria-label={$_('datatable.search')}
|
||||
class="gridjs-input gridjs-search-input mb-4" />
|
||||
<div
|
||||
class="shadow border-b border-gray-200 sm:rounded-lg overflow-x-scroll">
|
||||
<table class="divide-y divide-gray-200 w-full">
|
||||
<thead class="bg-gray-50">
|
||||
<tr>
|
||||
<th
|
||||
scope="col"
|
||||
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
||||
{$_('name')}
|
||||
</th>
|
||||
<th
|
||||
scope="col"
|
||||
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
||||
{$_('description')}
|
||||
</th>
|
||||
<th scope="col" class="relative px-6 py-3">
|
||||
<span class="sr-only">{$_('action')}</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-200">
|
||||
{#each current_groups as group}
|
||||
{#if Object.values(group)
|
||||
.toString()
|
||||
.toLowerCase()
|
||||
.includes(searchvalue)}
|
||||
<tr data-rowid="user_{group.id}">
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
<div class="flex items-center">
|
||||
<div class="ml-4">
|
||||
<div class="text-sm font-medium text-gray-900">
|
||||
{group.name}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
{group.description}
|
||||
</td>
|
||||
{#if active_deletes[group.id] === true}
|
||||
<td
|
||||
class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
|
||||
<button
|
||||
on:click={() => {
|
||||
active_deletes[group.id] = false;
|
||||
}}
|
||||
tabindex="0"
|
||||
class="ml-4 text-indigo-600 hover:text-indigo-900 cursor-pointer">{$_('cancel-delete')}</button>
|
||||
<button
|
||||
on:click={() => {
|
||||
UserGroupService.userGroupControllerRemove(group.id, true)
|
||||
.then((resp) => {
|
||||
current_groups = current_groups.filter((obj) => obj.id !== group.id);
|
||||
})
|
||||
.catch((err) => {
|
||||
// error deleting user
|
||||
});
|
||||
}}
|
||||
tabindex="0"
|
||||
class="ml-4 text-red-600 hover:text-red-900 cursor-pointer">{$_('confirm-delete')}</button>
|
||||
</td>
|
||||
{:else}
|
||||
<td
|
||||
class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
|
||||
<a
|
||||
href="./{group.id}"
|
||||
class="text-indigo-600 hover:text-indigo-900">Details</a>
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('USERGROUP:DELETE')}
|
||||
<button
|
||||
on:click={() => {
|
||||
active_deletes[group.id] = true;
|
||||
}}
|
||||
tabindex="0"
|
||||
class="ml-4 text-red-600 hover:text-red-900 cursor-pointer">{$_('delete')}</button>
|
||||
{/if}
|
||||
</td>
|
||||
{/if}
|
||||
</tr>
|
||||
{/if}
|
||||
{/each}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{/if}
|
||||
{:catch error}
|
||||
<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">
|
||||
<b class="capitalize">{$_('general_promise_error')}</b>
|
||||
{error}
|
||||
</span>
|
||||
</div>
|
||||
{/await}
|
||||
{/if}
|
1
src/components/groups/groups_empty.svg
Normal file
1
src/components/groups/groups_empty.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 17 KiB |
279
src/components/orgs/AddOrgModal.svelte
Normal file
279
src/components/orgs/AddOrgModal.svelte
Normal file
@@ -0,0 +1,279 @@
|
||||
<script>
|
||||
import { _ } from "svelte-i18n";
|
||||
import { clickOutside } from "../base/outsideclick";
|
||||
import { focusTrap } from "svelte-focus-trap";
|
||||
import { RunnerOrganizationService } from "@odit/lfk-client-js";
|
||||
import Toastify from "toastify-js";
|
||||
export let modal_open;
|
||||
export let current_organizations;
|
||||
let name_input_dom;
|
||||
function focus(el) {
|
||||
el.focus();
|
||||
}
|
||||
$: name = "";
|
||||
$: processed_last_submit = true;
|
||||
$: isOrgnameValid = name.trim().length !== 0;
|
||||
$: isAddress1Valid = address_input1_value.trim().length !== 0;
|
||||
$: iszipcodevalid = address_zipcode_value.trim().length !== 0;
|
||||
$: iscityvalid = address_city_value.trim().length !== 0;
|
||||
$: createbtnenabled =
|
||||
isOrgnameValid &&
|
||||
((isAddress1Valid && iszipcodevalid && iscityvalid) ||
|
||||
address_checked === false);
|
||||
$: address_input1_value = "";
|
||||
$: address_input2_value = "";
|
||||
$: address_zipcode_value = "";
|
||||
$: address_city_value = "";
|
||||
$: address_checked = true;
|
||||
|
||||
let address_input1;
|
||||
let address_input2;
|
||||
let address_zipcode;
|
||||
let address_city;
|
||||
|
||||
(() => {
|
||||
document.onkeydown = (e) => {
|
||||
e = e || window.event;
|
||||
if (e.key === "Escape") {
|
||||
modal_open = false;
|
||||
}
|
||||
if (e.keyCode === 13) {
|
||||
if (createbtnenabled === true) {
|
||||
createbtnenabled = false;
|
||||
submit();
|
||||
}
|
||||
}
|
||||
};
|
||||
})();
|
||||
function submit() {
|
||||
if (processed_last_submit === true) {
|
||||
processed_last_submit = false;
|
||||
const toast = Toastify({
|
||||
text: $_("organization-is-being-added"),
|
||||
duration: -1,
|
||||
}).showToast();
|
||||
let address = {};
|
||||
if (address_checked === true) {
|
||||
address = {
|
||||
address1: address_input1_value,
|
||||
address2: address_input2_value || "",
|
||||
postalcode: address_zipcode_value,
|
||||
city: address_city_value,
|
||||
country: "DE",
|
||||
};
|
||||
}
|
||||
RunnerOrganizationService.runnerOrganizationControllerPost({
|
||||
name,
|
||||
address: address,
|
||||
contact: undefined,
|
||||
})
|
||||
.then((result) => {
|
||||
name = "";
|
||||
modal_open = false;
|
||||
Toastify({
|
||||
text: $_("organization-added"),
|
||||
duration: 500,
|
||||
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
|
||||
}).showToast();
|
||||
current_organizations = current_organizations.concat([result]);
|
||||
})
|
||||
.catch((err) => {})
|
||||
.finally(() => {
|
||||
processed_last_submit = true;
|
||||
toast.hideToast();
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if modal_open}
|
||||
<div
|
||||
class="fixed z-10 inset-0 overflow-y-auto"
|
||||
use:focusTrap
|
||||
use:clickOutside
|
||||
on:click_outside={() => {
|
||||
modal_open = false;
|
||||
}}>
|
||||
<div
|
||||
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="absolute inset-0 bg-gray-500 opacity-75"
|
||||
data-id="modal_backdrop" />
|
||||
</div>
|
||||
<span
|
||||
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 overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg 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">
|
||||
<svg
|
||||
class="h-6 w-6 text-blue-600"
|
||||
fill="currentColor"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
width="24"
|
||||
height="24"><path
|
||||
d="M17 19h2v-8h-6v8h2v-6h2v6zM3 19V4a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v5h2v10h1v2H2v-2h1zm4-8v2h2v-2H7zm0 4v2h2v-2H7zm0-8v2h2V7H7z" /></svg>
|
||||
</div>
|
||||
<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">
|
||||
{$_('create-a-new-organization')}
|
||||
</h3>
|
||||
<div class="mt-2 mb-6">
|
||||
<p class="text-sm text-gray-500">
|
||||
{$_('please-provide-the-required-information-to-add-a-new-organization')}
|
||||
</p>
|
||||
</div>
|
||||
<div class="grid grid-cols-6 gap-6">
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="firstname"
|
||||
class="block text-sm font-medium text-gray-700">{$_('name')}</label>
|
||||
<input
|
||||
use:focus
|
||||
autocomplete="off"
|
||||
placeholder={$_('name')}
|
||||
class:border-red-500={!isOrgnameValid}
|
||||
class:focus:border-red-500={!isOrgnameValid}
|
||||
class:focus:ring-red-500={!isOrgnameValid}
|
||||
bind:value={name}
|
||||
bind:this={name_input_dom}
|
||||
type="text"
|
||||
name="firstname"
|
||||
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 !isOrgnameValid}
|
||||
<span
|
||||
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
|
||||
{$_('organization-name-is-required')}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="flex items-start">
|
||||
<div class="flex items-center h-5">
|
||||
<input
|
||||
bind:checked={address_checked}
|
||||
id="comments"
|
||||
name="comments"
|
||||
type="checkbox"
|
||||
class="focus:ring-indigo-500 h-4 w-4 text-indigo-600 border-gray-300 rounded" />
|
||||
</div>
|
||||
<div class="ml-3 text-sm">
|
||||
<label
|
||||
for="comments"
|
||||
class="font-medium text-gray-700">{$_('address')}</label>
|
||||
</div>
|
||||
</div>
|
||||
{#if address_checked === true}
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="address1"
|
||||
class="block text-sm font-medium text-gray-700">{$_('address')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="{$_('address')}"
|
||||
class:border-red-500={!isAddress1Valid}
|
||||
class:focus:border-red-500={!isAddress1Valid}
|
||||
class:focus:ring-red-500={!isAddress1Valid}
|
||||
bind:value={address_input1_value}
|
||||
bind:this={address_input1}
|
||||
type="text"
|
||||
name="address1"
|
||||
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 !isAddress1Valid}
|
||||
<span
|
||||
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
|
||||
{$_('address-is-required')}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="address2"
|
||||
class="block text-sm font-medium text-gray-700">{$_('apartment-suite-etc')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="{$_('apartment-suite-etc')}"
|
||||
bind:value={address_input2_value}
|
||||
bind:this={address_input2}
|
||||
type="text"
|
||||
name="address2"
|
||||
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" />
|
||||
</div>
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="zipcode"
|
||||
class="block text-sm font-medium text-gray-700">{$_('zip-postal-code')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="{$_('zip-postal-code')}"
|
||||
class:border-red-500={!iszipcodevalid}
|
||||
class:focus:border-red-500={!iszipcodevalid}
|
||||
class:focus:ring-red-500={!iszipcodevalid}
|
||||
bind:value={address_zipcode_value}
|
||||
bind:this={address_zipcode}
|
||||
type="text"
|
||||
name="zipcode"
|
||||
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 !iszipcodevalid}
|
||||
<span
|
||||
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
|
||||
{$_('valid-zipcode-postal-code-is-required')}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="city"
|
||||
class="block text-sm font-medium text-gray-700">{$_('city')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="{$_('city')}"
|
||||
class:border-red-500={!iscityvalid}
|
||||
class:focus:border-red-500={!iscityvalid}
|
||||
class:focus:ring-red-500={!iscityvalid}
|
||||
bind:value={address_city_value}
|
||||
bind:this={address_city}
|
||||
type="text"
|
||||
name="city"
|
||||
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 !iscityvalid}
|
||||
<span
|
||||
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
|
||||
{$_('valid-city-is-required')}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse">
|
||||
<button
|
||||
disabled={!createbtnenabled}
|
||||
class:opacity-50={!createbtnenabled}
|
||||
on:click={submit}
|
||||
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')}
|
||||
</button>
|
||||
<button
|
||||
on:click={() => {
|
||||
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">
|
||||
{$_('cancel')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
@@ -1,8 +1,8 @@
|
||||
<script>
|
||||
import { _ } from "svelte-i18n";
|
||||
import { clickOutside } from "./outsideclick";
|
||||
import { clickOutside } from "../base/outsideclick";
|
||||
import { focusTrap } from "svelte-focus-trap";
|
||||
import { RunnerOrganisationService } from "@odit/lfk-client-js";
|
||||
import { RunnerOrganizationService } from "@odit/lfk-client-js";
|
||||
import Toastify from "toastify-js";
|
||||
import { createEventDispatcher } from "svelte";
|
||||
export let modal_open;
|
||||
@@ -13,7 +13,7 @@
|
||||
dispatch("cancelDelete", { id: delete_org.id });
|
||||
}
|
||||
function deleteOrg() {
|
||||
RunnerOrganisationService.runnerOrganisationControllerRemove(
|
||||
RunnerOrganizationService.runnerOrganizationControllerRemove(
|
||||
delete_org.id,
|
||||
true
|
||||
)
|
||||
@@ -25,9 +25,7 @@
|
||||
}).showToast();
|
||||
location.replace("./");
|
||||
})
|
||||
.catch((err) => {
|
||||
//
|
||||
});
|
||||
.catch((err) => {});
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -68,13 +66,17 @@
|
||||
</div>
|
||||
<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">
|
||||
Attention!
|
||||
{$_('attention')}
|
||||
</h3>
|
||||
<div class="mt-2 mb-6">
|
||||
<p class="text-sm text-gray-500">
|
||||
Do you want to delete the organization
|
||||
{delete_org.name}?<br />All associated teams and runners will
|
||||
be deleted too!
|
||||
{$_(
|
||||
'do-you-want-to-delete-the-organization-delete_org-name',
|
||||
{
|
||||
values: { orgname: delete_org.name },
|
||||
}
|
||||
)}<br />
|
||||
{$_('all-associated-teams-and-runners-will-be-deleted-too')}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -85,13 +87,13 @@
|
||||
on:click={deleteOrg}
|
||||
type="button"
|
||||
class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm">
|
||||
Confirm, delete organization and associated teams+runners.
|
||||
{$_('confirm-delete-organization-and-associated-teams-runners')}
|
||||
</button>
|
||||
<button
|
||||
on:click={cancelDelete}
|
||||
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">
|
||||
Cancel, keep organization
|
||||
{$_('cancel-keep-organization')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
476
src/components/orgs/OrgDetail.svelte
Normal file
476
src/components/orgs/OrgDetail.svelte
Normal file
@@ -0,0 +1,476 @@
|
||||
<script>
|
||||
import {
|
||||
GroupContactService,
|
||||
RunnerOrganizationService,
|
||||
} from "@odit/lfk-client-js";
|
||||
import { getLocaleFromNavigator, _ } from "svelte-i18n";
|
||||
import Toastify from "toastify-js";
|
||||
import store from "../../store";
|
||||
import ConfirmOrgDeletion from "./ConfirmOrgDeletion.svelte";
|
||||
import ImportRunnerModal from "../runners/ImportRunnerModal.svelte";
|
||||
import PromiseError from "../base/PromiseError.svelte";
|
||||
import Select from "svelte-select";
|
||||
import GenerateSponsoringContracts from "../pdf_generation/GenerateSponsoringContracts.svelte";
|
||||
import GenerateRunnerCards from "../pdf_generation/GenerateRunnerCards.svelte";
|
||||
import GenerateRunnerCertificates from "../pdf_generation/GenerateRunnerCertificates.svelte";
|
||||
import { tick } from "svelte";
|
||||
$: delete_triggered = false;
|
||||
$: address_valid_or_none =
|
||||
(isAddress1Valid && iszipcodevalid && iscityvalid) ||
|
||||
editable.address_checked === false;
|
||||
$: save_enabled = data_changed && address_valid_or_none;
|
||||
let original = "";
|
||||
let original_object = {};
|
||||
let contacts = [];
|
||||
let valueCopy = null;
|
||||
let areaDom;
|
||||
let copied = false;
|
||||
export let params;
|
||||
$: editable = {};
|
||||
$: contact = {};
|
||||
$: data_loaded = false;
|
||||
$: data_changed = !(JSON.stringify(editable) === original);
|
||||
$: isAddress1Valid = editable.address?.address1?.trim().length !== 0;
|
||||
$: iszipcodevalid = editable.address?.postalcode?.trim().length !== 0;
|
||||
$: iscityvalid = editable.address?.city?.trim().length !== 0;
|
||||
$: sponsoring_contracts_show = true;
|
||||
$: cards_show = true;
|
||||
$: certificates_show = true;
|
||||
$: generate_orgs = [original_object];
|
||||
$: registrationLink = `${config.baseurl}/selfservice/register/${editable.registrationKey}`;
|
||||
const getContactLabel = (option) =>
|
||||
option.firstname + " " + (option.middlename || "") + " " + option.lastname;
|
||||
const promise = RunnerOrganizationService.runnerOrganizationControllerGetOne(
|
||||
params.orgid
|
||||
).then((value) => {
|
||||
data_loaded = true;
|
||||
value.address_checked = value.address.address1 !== null;
|
||||
if (value.address_checked === false) {
|
||||
value.address = {
|
||||
address1: "",
|
||||
address2: "",
|
||||
city: "",
|
||||
postalcode: "",
|
||||
country: "",
|
||||
};
|
||||
}
|
||||
editable = Object.assign(editable, value);
|
||||
editable = editable;
|
||||
original_object = Object.assign(editable, value);
|
||||
original = JSON.stringify(value);
|
||||
GroupContactService.groupContactControllerGetAll().then((val) => {
|
||||
contacts = val.map((r) => {
|
||||
return { label: getContactLabel(r), value: r };
|
||||
});
|
||||
if (editable.contact) {
|
||||
contact = contacts.find((g) => g.value.id == editable.contact.id);
|
||||
} else {
|
||||
contact = null;
|
||||
}
|
||||
});
|
||||
});
|
||||
let modal_open = false;
|
||||
let delete_org = {};
|
||||
function deleteOrganization() {
|
||||
RunnerOrganizationService.runnerOrganizationControllerRemove(
|
||||
original_object.id,
|
||||
false
|
||||
)
|
||||
.then((resp) => {
|
||||
Toastify({
|
||||
text: $_("organization-deleted"),
|
||||
duration: 500,
|
||||
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
|
||||
}).showToast();
|
||||
location.replace("./");
|
||||
})
|
||||
.catch((err) => {
|
||||
modal_open = true;
|
||||
delete_org = original_object;
|
||||
});
|
||||
}
|
||||
function submit() {
|
||||
if (data_loaded === true && save_enabled) {
|
||||
Toastify({
|
||||
text: $_("updating-organization"),
|
||||
duration: 2500,
|
||||
}).showToast();
|
||||
let postdata = Object.assign({}, editable);
|
||||
if (postdata.address_checked === false) {
|
||||
postdata.address = null;
|
||||
}
|
||||
postdata.contact = postdata.contact?.id;
|
||||
RunnerOrganizationService.runnerOrganizationControllerPut(
|
||||
original_object.id,
|
||||
postdata
|
||||
)
|
||||
.then((resp) => {
|
||||
editable.registrationKey = resp.registrationKey;
|
||||
original_object = Object.assign({}, editable);
|
||||
original = JSON.stringify(original_object);
|
||||
Toastify({
|
||||
text: $_("updated-organization"),
|
||||
duration: 2500,
|
||||
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
|
||||
}).showToast();
|
||||
})
|
||||
.catch((err) => {});
|
||||
} else {
|
||||
}
|
||||
}
|
||||
async function copy() {
|
||||
if(!editable.registrationKey){
|
||||
Toastify({
|
||||
text: $_('you-have-to-save-your-changes-to-generate-a-link'),
|
||||
duration: 500,
|
||||
backgroundColor:
|
||||
"linear-gradient(90deg, hsla(281, 37%, 45%, 1) 0%, hsla(1, 62%, 48%, 1) 100%)",
|
||||
}).showToast();
|
||||
return;
|
||||
}
|
||||
valueCopy = registrationLink;
|
||||
await tick();
|
||||
areaDom.focus();
|
||||
areaDom.select();
|
||||
try {
|
||||
const successful = document.execCommand("copy");
|
||||
if (!successful) {
|
||||
throw new Error();
|
||||
}
|
||||
Toastify({
|
||||
text: $_("copied-link-to-clipboard"),
|
||||
duration: 500,
|
||||
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
|
||||
}).showToast();
|
||||
copied = true;
|
||||
} catch (err) {
|
||||
Toastify({
|
||||
text: $_("error-whyile-copying-to-clipboard"),
|
||||
duration: 500,
|
||||
backgroundColor:
|
||||
"linear-gradient(90deg, hsla(281, 37%, 45%, 1) 0%, hsla(1, 62%, 48%, 1) 100%)",
|
||||
}).showToast();
|
||||
}
|
||||
// we can notifi by event or storage about copy status
|
||||
valueCopy = null;
|
||||
}
|
||||
export let import_modal_open = false;
|
||||
</script>
|
||||
|
||||
{#if valueCopy != null}<textarea bind:this={areaDom}>{valueCopy}</textarea>{/if}
|
||||
<ImportRunnerModal
|
||||
on:cancelDelete={(event) => {
|
||||
import_modal_open = false;
|
||||
}}
|
||||
current_runners={[]}
|
||||
passed_team={{}}
|
||||
passed_orgs={[]}
|
||||
passed_org={editable}
|
||||
opened_from="OrgDetail"
|
||||
bind:import_modal_open />
|
||||
<ConfirmOrgDeletion bind:modal_open bind:delete_org />
|
||||
{#if data_loaded}
|
||||
<section class="container p-5">
|
||||
<div class="mb-8 text-3xl font-extrabold leading-tight">
|
||||
{original_object.name}
|
||||
<span data-id="org_actions_${editable.id}">
|
||||
<GenerateSponsoringContracts
|
||||
bind:sponsoring_contracts_show
|
||||
bind:generate_orgs />
|
||||
<GenerateRunnerCards bind:cards_show bind:generate_orgs />
|
||||
<GenerateRunnerCertificates bind:certificates_show bind:generate_orgs />
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('RUNNER:IMPORT')}
|
||||
<button
|
||||
on:click={() => {
|
||||
import_modal_open = true;
|
||||
}}
|
||||
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">
|
||||
{$_('import-runners')}
|
||||
</button>
|
||||
{/if}
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('RUNNER:DELETE')}
|
||||
{#if delete_triggered}
|
||||
<button
|
||||
on:click={deleteOrganization}
|
||||
class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm">{$_('confirm-delete')}</button>
|
||||
<button
|
||||
on:click={() => {
|
||||
delete_triggered = !delete_triggered;
|
||||
}}
|
||||
class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-400 text-base font-medium text-white sm:w-auto sm:text-sm">{$_('cancel')}</button>
|
||||
{/if}
|
||||
{#if !delete_triggered}
|
||||
<button
|
||||
on:click={() => {
|
||||
delete_triggered = true;
|
||||
}}
|
||||
type="button"
|
||||
class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm">{$_('delete-organization')}</button>
|
||||
{/if}
|
||||
{/if}
|
||||
{#if !delete_triggered}
|
||||
<button
|
||||
on:click={submit}
|
||||
disabled={!save_enabled}
|
||||
class:opacity-50={!save_enabled}
|
||||
type="button"
|
||||
class="w-full 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">{$_('save-changes')}</button>
|
||||
{/if}
|
||||
</span>
|
||||
</div>
|
||||
<div class="flex flex-row mb-4">
|
||||
<div class="w-full">
|
||||
<nav class="w-full flex">
|
||||
<ol class="list-none flex flex-row items-center justify-start">
|
||||
<li class="mr-2 flex items-center">
|
||||
<svg
|
||||
stroke="currentColor"
|
||||
fill="none"
|
||||
stroke-width="2"
|
||||
viewBox="0 0 24 24"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
class="h-3 w-3 stroke-current"
|
||||
height="1em"
|
||||
width="1em"
|
||||
xmlns="http://www.w3.org/2000/svg"><path
|
||||
d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" />
|
||||
<polyline points="9 22 9 12 15 12 15 22" /></svg>
|
||||
</li>
|
||||
<li class="flex items-center">
|
||||
<a class="mr-2" href="/">{$_('home')}</a><svg
|
||||
stroke="currentColor"
|
||||
fill="none"
|
||||
stroke-width="2"
|
||||
viewBox="0 0 24 24"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
class="h-3 w-3 mr-2 stroke-current"
|
||||
height="1em"
|
||||
width="1em"
|
||||
xmlns="http://www.w3.org/2000/svg"><line
|
||||
x1="5"
|
||||
y1="12"
|
||||
x2="19"
|
||||
y2="12" />
|
||||
<polyline points="12 5 19 12 12 19" /></svg>
|
||||
</li>
|
||||
<li class="mr-2 flex items-center">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
width="24"
|
||||
height="24"><path fill="none" d="M0 0h24v24H0z" />
|
||||
<path
|
||||
d="M21 20h2v2H1v-2h2V3a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v17zm-2 0V4H5v16h14zM8 11h3v2H8v-2zm0-4h3v2H8V7zm0 8h3v2H8v-2zm5 0h3v2h-3v-2zm0-4h3v2h-3v-2zm0-4h3v2h-3V7z" /></svg>
|
||||
</li>
|
||||
<li class="flex items-center">
|
||||
<a class="mr-2" href="./">{$_('organizations')}</a><svg
|
||||
stroke="currentColor"
|
||||
fill="none"
|
||||
stroke-width="2"
|
||||
viewBox="0 0 24 24"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
class="h-3 w-3 mr-2 stroke-current"
|
||||
height="1em"
|
||||
width="1em"
|
||||
xmlns="http://www.w3.org/2000/svg"><line
|
||||
x1="5"
|
||||
y1="12"
|
||||
x2="19"
|
||||
y2="12" />
|
||||
<polyline points="12 5 19 12 12 19" /></svg>
|
||||
</li>
|
||||
<li class="flex items-center">
|
||||
<span class="mr-2">Org-Details #{params.orgid}</span>
|
||||
</li>
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-sm w-full">
|
||||
<label for="name" class="font-medium text-gray-700">{$_('name')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder={$_('name')}
|
||||
type="text"
|
||||
bind:value={editable.name}
|
||||
name="name"
|
||||
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" />
|
||||
</div>
|
||||
<div class="text-sm w-full">
|
||||
<label
|
||||
for="contact"
|
||||
class="font-medium text-gray-700">{$_('contact')}</label>
|
||||
<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"
|
||||
itemFilter={(label, filterText, option) => label
|
||||
.toLowerCase()
|
||||
.includes(
|
||||
filterText.toLowerCase()
|
||||
) || option.value.id
|
||||
.toString()
|
||||
.startsWith(filterText.toLowerCase())}
|
||||
items={contacts}
|
||||
showChevron={true}
|
||||
placeholder={$_('no-contact-selected')}
|
||||
noOptionsMessage={$_('no-contact-found')}
|
||||
bind:selectedValue={contact}
|
||||
on:select={(selectedValue) => (editable.contact = selectedValue.detail.value)}
|
||||
on:clear={() => (editable.contact = null)} />
|
||||
</div>
|
||||
<div>
|
||||
<div class="flex items-start mt-2">
|
||||
<div class="flex items-center h-5">
|
||||
<input
|
||||
bind:checked={editable.registrationEnabled}
|
||||
id="comments"
|
||||
name="comments"
|
||||
type="checkbox"
|
||||
class="focus:ring-indigo-500 h-4 w-4 text-indigo-600 border-gray-300 rounded" />
|
||||
</div>
|
||||
<div class="ml-3 text-sm">
|
||||
<label
|
||||
for="comments"
|
||||
class="font-medium text-gray-700">{$_('selfservice-registration')}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
{#if editable.registrationEnabled}
|
||||
<div class="text-sm w-full">
|
||||
<div on:click={copy} class="inline-flex w-full">
|
||||
<p
|
||||
name="token"
|
||||
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 p-2">
|
||||
{#if editable.registrationKey}
|
||||
{registrationLink}
|
||||
{:else}
|
||||
{$_('you-have-to-save-your-changes-to-generate-a-link')}
|
||||
{/if}
|
||||
</p>
|
||||
<div
|
||||
class="bg-gray-200 border-gray-300 border-t border-b border-r text-black rounded-r-md sm:text-sm p-2 mt-1 cursor-pointer">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
width="24"
|
||||
height="24"><path fill="none" d="M0 0h24v24H0z" />
|
||||
<path
|
||||
fill="currentColor"
|
||||
d="M7 4V2h10v2h3l1 1v16a1 1 0 01-1 1H4a1 1 0 01-1-1V5l1-1h3zm0 2H5v14h14V6h-2v2H7V6zm2-2v2h6V4H9z" /></svg>
|
||||
</div>
|
||||
</div>
|
||||
{#if editable.registrationKey}
|
||||
<p class="text-gray-500 text-xs">
|
||||
{$_('click-to-copy-the-link-into-your-clipboard')}
|
||||
</p>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
<!-- -->
|
||||
<div>
|
||||
<div class="flex items-start mt-2">
|
||||
<div class="flex items-center h-5">
|
||||
<input
|
||||
bind:checked={editable.address_checked}
|
||||
id="comments"
|
||||
name="comments"
|
||||
type="checkbox"
|
||||
class="focus:ring-indigo-500 h-4 w-4 text-indigo-600 border-gray-300 rounded" />
|
||||
</div>
|
||||
<div class="ml-3 text-sm">
|
||||
<label
|
||||
for="comments"
|
||||
class="font-medium text-gray-700">{$_('address')}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{#if editable.address_checked === true}
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="address1"
|
||||
class="block text-sm font-medium text-gray-700">{$_('address')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Address"
|
||||
class:border-red-500={!isAddress1Valid}
|
||||
class:focus:border-red-500={!isAddress1Valid}
|
||||
class:focus:ring-red-500={!isAddress1Valid}
|
||||
bind:value={editable.address.address1}
|
||||
type="text"
|
||||
name="address1"
|
||||
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 !isAddress1Valid}
|
||||
<span
|
||||
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
|
||||
{$_('address-is-required')}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="address2"
|
||||
class="block text-sm font-medium text-gray-700">{$_('apartment-suite-etc')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder={$_('apartment-suite-etc')}
|
||||
bind:value={editable.address.address2}
|
||||
type="text"
|
||||
name="address2"
|
||||
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" />
|
||||
</div>
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="zipcode"
|
||||
class="block text-sm font-medium text-gray-700">{$_('zip-postal-code')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder={$_('zip-postal-code')}
|
||||
class:border-red-500={!iszipcodevalid}
|
||||
class:focus:border-red-500={!iszipcodevalid}
|
||||
class:focus:ring-red-500={!iszipcodevalid}
|
||||
bind:value={editable.address.postalcode}
|
||||
type="text"
|
||||
name="zipcode"
|
||||
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 !iszipcodevalid}
|
||||
<span
|
||||
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
|
||||
{$_('valid-zipcode-postal-code-is-required')}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="city"
|
||||
class="block text-sm font-medium text-gray-700">{$_('city')}</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder={$_('city')}
|
||||
class:border-red-500={!iscityvalid}
|
||||
class:focus:border-red-500={!iscityvalid}
|
||||
class:focus:ring-red-500={!iscityvalid}
|
||||
bind:value={editable.address.city}
|
||||
type="text"
|
||||
name="city"
|
||||
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 !iscityvalid}
|
||||
<span
|
||||
class="flex items-center font-medium tracking-wide text-red-500 text-xs mt-1 ml-1">
|
||||
{$_('valid-city-is-required')}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{:else}
|
||||
{#await promise}
|
||||
{$_('organization-detail-is-being-loaded')}
|
||||
{:catch error}
|
||||
<PromiseError />
|
||||
{/await}
|
||||
{/if}
|
219
src/components/orgs/OrgOverview.svelte
Normal file
219
src/components/orgs/OrgOverview.svelte
Normal file
@@ -0,0 +1,219 @@
|
||||
<script>
|
||||
import { getLocaleFromNavigator, _ } from "svelte-i18n";
|
||||
import GenerateSponsoringContracts from "../pdf_generation/GenerateSponsoringContracts.svelte";
|
||||
let modal_open = false;
|
||||
let delete_org = {};
|
||||
import { RunnerOrganizationService } from "@odit/lfk-client-js";
|
||||
import store from "../../store";
|
||||
import OrgsEmptyState from "./OrgsEmptyState.svelte";
|
||||
import Toastify from "toastify-js";
|
||||
import ConfirmOrgDeletion from "./ConfirmOrgDeletion.svelte";
|
||||
import GenerateRunnerCards from "../pdf_generation/GenerateRunnerCards.svelte";
|
||||
import GenerateRunnerCertificates from "../pdf_generation/GenerateRunnerCertificates.svelte";
|
||||
$: searchvalue = "";
|
||||
$: active_deletes = [];
|
||||
$: sponsoring_contracts_show = current_organizations.some((r) => r.is_selected === true);
|
||||
$: cards_show = current_organizations.some((r) => r.is_selected === true);
|
||||
$: generate_orgs = current_organizations.some((r) => r.is_selected === true);
|
||||
$: certificates_show = current_organizations.some(
|
||||
(r) => r.is_selected === true
|
||||
);
|
||||
export let current_organizations = [];
|
||||
|
||||
const promise = RunnerOrganizationService.runnerOrganizationControllerGetAll().then(
|
||||
(val) => {
|
||||
current_organizations = val;
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
<ConfirmOrgDeletion
|
||||
on:cancelDelete={(event) => {
|
||||
modal_open = false;
|
||||
active_deletes[event.detail.id] = false;
|
||||
}}
|
||||
bind:modal_open
|
||||
bind:delete_org />
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('ORGANIZATION:GET')}
|
||||
{#await promise}
|
||||
<div
|
||||
class="bg-teal-lightest border-t-4 border-teal rounded-b text-teal-darkest px-4 py-3 shadow-md my-2"
|
||||
role="alert">
|
||||
<p class="font-bold">{$_('organizations-are-being-loaded')}</p>
|
||||
<p class="text-sm">{$_('this-might-take-a-moment')}</p>
|
||||
</div>
|
||||
{:then}
|
||||
{#if current_organizations.length === 0}
|
||||
<OrgsEmptyState />
|
||||
{:else}
|
||||
<input
|
||||
type="search"
|
||||
bind:value={searchvalue}
|
||||
placeholder={$_('datatable.search')}
|
||||
aria-label={$_('datatable.search')}
|
||||
class="gridjs-input gridjs-search-input mb-4" />
|
||||
<div class="h-12">
|
||||
<GenerateSponsoringContracts
|
||||
bind:sponsoring_contracts_show
|
||||
bind:generate_orgs />
|
||||
<GenerateRunnerCards
|
||||
bind:cards_show
|
||||
bind:generate_orgs />
|
||||
<GenerateRunnerCertificates
|
||||
bind:certificates_show
|
||||
bind:generate_orgs />
|
||||
</div>
|
||||
<div
|
||||
class="shadow border-b border-gray-200 sm:rounded-lg overflow-x-scroll">
|
||||
<table class="divide-y divide-gray-200 w-full">
|
||||
<thead class="bg-gray-50">
|
||||
<tr>
|
||||
<th
|
||||
scope="col"
|
||||
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
||||
<span
|
||||
on:click={() => {
|
||||
const newstate = !current_organizations.some((r) => r.is_selected === true);
|
||||
current_organizations = current_organizations.map((r) => {
|
||||
r.is_selected = newstate;
|
||||
return r;
|
||||
});
|
||||
}}
|
||||
class="underline cursor-pointer select-none">{#if current_organizations.some((r) => r.is_selected === true)}
|
||||
{$_('deselect-all')}
|
||||
{:else}{$_('select-all')}{/if}
|
||||
</span>
|
||||
</th>
|
||||
<th
|
||||
scope="col"
|
||||
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
||||
{$_('name')}
|
||||
</th>
|
||||
<th
|
||||
scope="col"
|
||||
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
||||
{$_('address')}
|
||||
</th>
|
||||
<th
|
||||
scope="col"
|
||||
class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
||||
{$_('contact')}
|
||||
</th>
|
||||
<th scope="col" class="relative px-6 py-3">
|
||||
<span class="sr-only">{$_('action')}</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-200">
|
||||
{#each current_organizations as o}
|
||||
{#if Object.values(o)
|
||||
.toString()
|
||||
.toLowerCase()
|
||||
.includes(searchvalue)}
|
||||
<tr data-rowid="org_{o.id}">
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
<input
|
||||
bind:checked={o.is_selected}
|
||||
type="checkbox"
|
||||
class="focus:ring-indigo-500 h-4 w-4 text-indigo-600 border-gray-300 rounded" />
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
<div class="flex items-center">
|
||||
<div class="ml-4">
|
||||
<div class="text-sm font-medium text-gray-900">
|
||||
{o.name}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
<div class="flex items-center">
|
||||
<div class="ml-4">
|
||||
<div class="text-sm font-medium text-gray-900">
|
||||
{#if o.address.address1 !== null}
|
||||
{o.address.address1}<br />
|
||||
{o.address.address2 || ''}<br />
|
||||
{o.address.postalcode}
|
||||
{o.address.city}
|
||||
{o.address.country}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
<div class="flex items-center">
|
||||
<div class="ml-4">
|
||||
<div class="text-sm font-medium text-gray-900">
|
||||
{#if o.contact}
|
||||
<a
|
||||
href="../contacts/{o.contact.id}"
|
||||
class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-gray-100 text-gray-800">{o.contact.firstname}
|
||||
{o.contact.middlename || ''}
|
||||
{o.contact.lastname}</a>
|
||||
{:else}{$_('no-contact-specified')}{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
{#if active_deletes[o.id] === true}
|
||||
<td
|
||||
class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
|
||||
<button
|
||||
on:click={() => {
|
||||
active_deletes[o.id] = false;
|
||||
}}
|
||||
tabindex="0"
|
||||
class="ml-4 text-indigo-600 hover:text-indigo-900 cursor-pointer">{$_('cancel-delete')}</button>
|
||||
<button
|
||||
on:click={() => {
|
||||
RunnerOrganizationService.runnerOrganizationControllerRemove(o.id, false)
|
||||
.then((resp) => {
|
||||
current_organizations = current_organizations.filter((obj) => obj.id !== o.id);
|
||||
Toastify({
|
||||
text: 'Organization deleted',
|
||||
duration: 500,
|
||||
backgroundColor:
|
||||
'linear-gradient(to right, #00b09b, #96c93d)',
|
||||
}).showToast();
|
||||
})
|
||||
.catch((err) => {
|
||||
modal_open = true;
|
||||
delete_org = o;
|
||||
});
|
||||
}}
|
||||
tabindex="0"
|
||||
class="ml-4 text-red-600 hover:text-red-900 cursor-pointer">{$_('confirm-delete')}</button>
|
||||
</td>
|
||||
{:else}
|
||||
<td
|
||||
class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
|
||||
<a
|
||||
href="./{o.id}"
|
||||
class="text-indigo-600 hover:text-indigo-900">{$_('details')}</a>
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('ORGANIZATION:DELETE')}
|
||||
<button
|
||||
on:click={() => {
|
||||
active_deletes[o.id] = true;
|
||||
}}
|
||||
tabindex="0"
|
||||
class="ml-4 text-red-600 hover:text-red-900 cursor-pointer">{$_('delete')}</button>
|
||||
{/if}
|
||||
</td>
|
||||
{/if}
|
||||
</tr>
|
||||
{/if}
|
||||
{/each}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{/if}
|
||||
{:catch error}
|
||||
<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">
|
||||
<b class="capitalize">{$_('general_promise_error')}</b>
|
||||
{error}
|
||||
</span>
|
||||
</div>
|
||||
{/await}
|
||||
{/if}
|
@@ -1,17 +1,18 @@
|
||||
<script>
|
||||
import { _ } from "svelte-i18n";
|
||||
import store from "../store";
|
||||
import store from "../../store";
|
||||
import AddOrgModal from "./AddOrgModal.svelte";
|
||||
export let modal_open = false;
|
||||
import OrgOverview from "./OrgOverview.svelte";
|
||||
console.log(store.state.jwtinfo.userdetails.permissions);
|
||||
import ImportRunnerModal from "../runners/ImportRunnerModal.svelte";
|
||||
let current_organizations = [];
|
||||
export let import_modal_open = false;
|
||||
</script>
|
||||
|
||||
<section class="container p-5">
|
||||
<span class="mb-1 text-3xl font-extrabold leading-tight">
|
||||
{$_('organizations')}
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('ORGANISATION:CREATE')}
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('ORGANIZATION:CREATE')}
|
||||
<button
|
||||
on:click={() => {
|
||||
modal_open = true;
|
||||
@@ -21,11 +22,30 @@
|
||||
{$_('create-organization')}
|
||||
</button>
|
||||
{/if}
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('RUNNER:IMPORT')}
|
||||
<button
|
||||
on:click={() => {
|
||||
import_modal_open = true;
|
||||
}}
|
||||
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">
|
||||
{$_('import-runners')}
|
||||
</button>
|
||||
{/if}
|
||||
</span>
|
||||
<p class="mb-8 text-lg text-gray-500">manage runner organizations</p>
|
||||
<OrgOverview bind:current_organizations />
|
||||
</section>
|
||||
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('ORGANISATION:CREATE')}
|
||||
{#if store.state.jwtinfo.userdetails.permissions.includes('ORGANIZATION:CREATE')}
|
||||
<AddOrgModal bind:current_organizations bind:modal_open />
|
||||
<ImportRunnerModal
|
||||
on:cancelDelete={(event) => {
|
||||
import_modal_open = false;
|
||||
}}
|
||||
passed_team={{}}
|
||||
passed_org={{}}
|
||||
passed_orgs={current_organizations}
|
||||
opened_from="OrgOverview"
|
||||
current_runners={[]}
|
||||
bind:import_modal_open />
|
||||
{/if}
|
@@ -9,8 +9,9 @@
|
||||
<div class="text-center items-center justify-center">
|
||||
<p class="mb-16 text-lg text-gray-500">
|
||||
<img class="w-full h-44" src={org_empty} alt="" />
|
||||
<span class="font-bold">There are no organizations added yet.</span><br />
|
||||
<span>Add your first organization</span>
|
||||
<span
|
||||
class="font-bold">{$_('there-are-no-organizations-added-yet')}</span><br />
|
||||
<span>{$_('add-your-first-organization')}</span>
|
||||
</p>
|
||||
</div>
|
||||
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
344
src/components/pdf_generation/GenerateRunnerCards.svelte
Normal file
344
src/components/pdf_generation/GenerateRunnerCards.svelte
Normal file
@@ -0,0 +1,344 @@
|
||||
<script>
|
||||
import { getLocaleFromNavigator, _ } from "svelte-i18n";
|
||||
import {
|
||||
RunnerCardService,
|
||||
RunnerOrganizationService,
|
||||
RunnerTeamService,
|
||||
} from "@odit/lfk-client-js";
|
||||
import Toastify from "toastify-js";
|
||||
export let cards_show = false;
|
||||
export let generate_cards = [];
|
||||
export let generate_runners = [];
|
||||
export let generate_orgs = [];
|
||||
export let generate_teams = [];
|
||||
$: cards_dropdown_open = false;
|
||||
document.addEventListener("click", function (e) {
|
||||
if (
|
||||
e.target.parentNode?.parentNode?.id != "cards:dropdown" &&
|
||||
e.target.parentNode?.parentNode?.id != "cards:dropdown:menu"
|
||||
) {
|
||||
cards_dropdown_open = false;
|
||||
}
|
||||
});
|
||||
|
||||
function generateRunnerCards(locale) {
|
||||
cards_dropdown_open = false;
|
||||
|
||||
if (generate_orgs.length > 0) {
|
||||
generateOrgCards(locale);
|
||||
} else if (generate_teams.length > 0) {
|
||||
generateTeamCards(locale);
|
||||
} else if (generate_runners.length > 0) {
|
||||
generateRunnersCards(locale);
|
||||
} else {
|
||||
generateCards(locale);
|
||||
}
|
||||
}
|
||||
|
||||
function generateCards(locale) {
|
||||
const toast = Toastify({
|
||||
text: $_("generating-pdf"),
|
||||
duration: -1,
|
||||
}).showToast();
|
||||
fetch(
|
||||
`${config.baseurl}/documents/cards?locale=${locale}&download=true&key=${config.documentserver_key}`,
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(generate_cards),
|
||||
}
|
||||
)
|
||||
.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 = `${$_('runnercards')}-${locale}.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);
|
||||
});
|
||||
}
|
||||
|
||||
async function generateRunnersCards(locale) {
|
||||
const toast = Toastify({
|
||||
text: $_("generating-pdf"),
|
||||
duration: -1,
|
||||
}).showToast();
|
||||
const current_cards = await RunnerCardService.runnerCardControllerGetAll();
|
||||
let cards = [];
|
||||
for (let runner of generate_runners) {
|
||||
let card = current_cards.find((c) => c.runner?.id == runner.id);
|
||||
if (!card) {
|
||||
card = await RunnerCardService.runnerCardControllerPost({
|
||||
runner: runner.id,
|
||||
});
|
||||
}
|
||||
cards.push(card);
|
||||
}
|
||||
fetch(
|
||||
`${config.baseurl}/documents/cards?locale=${locale}&download=true&key=${config.documentserver_key}`,
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(cards),
|
||||
}
|
||||
)
|
||||
.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;
|
||||
if(generate_runners.length == 1){
|
||||
a.download = `${$_('runnercards')}_${generate_runners[0].firstname}_${generate_runners[0].lastname}-${locale}.pdf`;
|
||||
}
|
||||
else{
|
||||
a.download = `Runnercards-${locale}.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) => {});
|
||||
}
|
||||
|
||||
async function generateTeamCards(locale) {
|
||||
const toast = Toastify({
|
||||
text: $_("generating-pdfs"),
|
||||
duration: -1,
|
||||
}).showToast();
|
||||
let count = 0;
|
||||
const current_cards = await RunnerCardService.runnerCardControllerGetAll();
|
||||
for (const t of generate_teams) {
|
||||
const runners = await RunnerTeamService.runnerTeamControllerGetRunners(
|
||||
t.id
|
||||
);
|
||||
let cards = [];
|
||||
for (let runner of runners) {
|
||||
let card = current_cards.find((c) => c.runner?.id == runner.id);
|
||||
if (!card) {
|
||||
card = await RunnerCardService.runnerCardControllerPost({
|
||||
runner: runner.id,
|
||||
});
|
||||
}
|
||||
cards.push(card);
|
||||
}
|
||||
fetch(
|
||||
`${config.baseurl}/documents/cards?locale=${locale}&download=true&key=${config.documentserver_key}`,
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(cards),
|
||||
}
|
||||
)
|
||||
.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) => {
|
||||
count++;
|
||||
const url = window.URL.createObjectURL(blob);
|
||||
let a = document.createElement("a");
|
||||
a.href = url;
|
||||
a.download = `${$_('runnercards')}_${t.name}-${locale}.pdf`;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
a.remove();
|
||||
if (count === generate_teams.length) {
|
||||
toast.hideToast();
|
||||
Toastify({
|
||||
text: $_("pdfs-successfully-generated"),
|
||||
duration: 3500,
|
||||
backgroundColor:
|
||||
"linear-gradient(to right, #00b09b, #96c93d)",
|
||||
}).showToast();
|
||||
}
|
||||
})
|
||||
.catch((err) => {});
|
||||
}
|
||||
}
|
||||
|
||||
async function generateOrgCards(locale) {
|
||||
const toast = Toastify({
|
||||
text: $_("generating-pdf"),
|
||||
duration: -1,
|
||||
}).showToast();
|
||||
let count = 0;
|
||||
const current_cards = await RunnerCardService.runnerCardControllerGetAll();
|
||||
for (const o of generate_orgs) {
|
||||
const runners = await RunnerOrganizationService.runnerOrganizationControllerGetRunners(
|
||||
o.id
|
||||
);
|
||||
let cards = [];
|
||||
for (let runner of runners) {
|
||||
let card = current_cards.find((c) => c.runner?.id == runner.id);
|
||||
if (!card) {
|
||||
card = await RunnerCardService.runnerCardControllerPost({
|
||||
runner: runner.id,
|
||||
});
|
||||
}
|
||||
cards.push(card);
|
||||
}
|
||||
fetch(
|
||||
`${config.baseurl}/documents/cards?locale=${locale}&download=true&key=${config.documentserver_key}`,
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(cards),
|
||||
}
|
||||
)
|
||||
.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) => {
|
||||
count++;
|
||||
const url = window.URL.createObjectURL(blob);
|
||||
let a = document.createElement("a");
|
||||
a.href = url;
|
||||
a.download = `${$_('runnercards')}_${o.name}-${locale}.pdf`;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
a.remove();
|
||||
if (count === generate_orgs.length) {
|
||||
toast.hideToast();
|
||||
Toastify({
|
||||
text: $_("pdfs-successfully-generated"),
|
||||
duration: 3500,
|
||||
backgroundColor:
|
||||
"linear-gradient(to right, #00b09b, #96c93d)",
|
||||
}).showToast();
|
||||
}
|
||||
})
|
||||
.catch((err) => {});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if cards_show}
|
||||
<div id="cards:dropdown" class="relative inline-block">
|
||||
<div>
|
||||
<button
|
||||
on:click={() => {
|
||||
cards_dropdown_open = !cards_dropdown_open;
|
||||
}}
|
||||
type="button"
|
||||
class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-gray-600 text-base font-medium text-white hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500 sm:ml-3 sm:w-auto sm:text-sm inline-flex"
|
||||
id="options-menu"
|
||||
aria-haspopup="true"
|
||||
aria-expanded="true">
|
||||
{$_('generate-runnercards')}
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
class="-mr-1 ml-2 h-5 w-5"><path
|
||||
fill="none"
|
||||
d="M0 0h24v24H0z" />
|
||||
<path
|
||||
fill="currentColor"
|
||||
d="M3 19h18v2H3v-2zm10-5.83l6.07-6.07 1.42 1.41L12 17 3.52 8.52l1.4-1.42L11 13.17V2h2v11.17z" /></svg>
|
||||
</button>
|
||||
</div>
|
||||
{#if cards_dropdown_open}
|
||||
<div
|
||||
class="origin-top-right absolute right-0 mt-2 w-56 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5"
|
||||
id="cards:dropdown:menu">
|
||||
<div
|
||||
class="py-1"
|
||||
role="menu"
|
||||
aria-orientation="vertical"
|
||||
aria-labelledby="options-menu">
|
||||
<span
|
||||
class="block w-full text-left px-4 py-2 text-sm text-gray-700">{$_('select-language')}</span>
|
||||
<button
|
||||
on:click={() => {
|
||||
generateRunnerCards('de');
|
||||
}}
|
||||
type="submit"
|
||||
class="block w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900"
|
||||
role="menuitem">
|
||||
{$_('german')}
|
||||
</button>
|
||||
<button
|
||||
on:click={() => {
|
||||
generateRunnerCards('en');
|
||||
}}
|
||||
type="submit"
|
||||
class="block w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900"
|
||||
role="menuitem">
|
||||
{$_('english')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
277
src/components/pdf_generation/GenerateRunnerCertificates.svelte
Normal file
277
src/components/pdf_generation/GenerateRunnerCertificates.svelte
Normal file
@@ -0,0 +1,277 @@
|
||||
<script>
|
||||
import { _ } from "svelte-i18n";
|
||||
import {
|
||||
DonationService,
|
||||
RunnerTeamService,
|
||||
RunnerOrganizationService
|
||||
} from "@odit/lfk-client-js";
|
||||
import Toastify from "toastify-js";
|
||||
export let certificates_show = false;
|
||||
export let generate_runners = [];
|
||||
export let generate_orgs = [];
|
||||
export let generate_teams = [];
|
||||
$: certificates_dropdown_open = false;
|
||||
document.addEventListener("click", function (e) {
|
||||
if (
|
||||
e.target.parentNode?.parentNode?.id != "certificates:dropdown" &&
|
||||
e.target.parentNode?.parentNode?.id != "certificates:dropdown:menu"
|
||||
) {
|
||||
certificates_dropdown_open = false;
|
||||
}
|
||||
});
|
||||
|
||||
function generateCertificates(locale) {
|
||||
certificates_dropdown_open = false;
|
||||
|
||||
if (generate_orgs.length > 0) {
|
||||
generateOrgCertificates(locale);
|
||||
} else if (generate_teams.length > 0) {
|
||||
generateTeamCertificates(locale);
|
||||
} else {
|
||||
generateRunnerCertificates(locale);
|
||||
}
|
||||
}
|
||||
|
||||
async function generateRunnerCertificates(locale) {
|
||||
const toast = Toastify({
|
||||
text: $_("generating-pdf"),
|
||||
duration: -1,
|
||||
}).showToast();
|
||||
const current_donations = await DonationService.donationControllerGetAll();
|
||||
let certificateRunners = [];
|
||||
for (let runner of generate_runners) {
|
||||
runner.distanceDonations = current_donations.find((d) => d.runner?.id == runner.id) || [];
|
||||
certificateRunners.push(runner);
|
||||
}
|
||||
fetch(
|
||||
`${config.baseurl}/documents/certificates?locale=${locale}&download=true&key=${config.documentserver_key}`,
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(certificateRunners),
|
||||
}
|
||||
)
|
||||
.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;
|
||||
if(generate_runners.length == 1){
|
||||
a.download = `${$_('certificates')}_${generate_runners[0].firstname}_${generate_runners[0].lastname}-${locale}.pdf`;
|
||||
}
|
||||
else{
|
||||
a.download = `${$_('certificates')}-${locale}.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) => {});
|
||||
}
|
||||
|
||||
async function generateTeamCertificates(locale) {
|
||||
const toast = Toastify({
|
||||
text: $_("generating-pdfs"),
|
||||
duration: -1,
|
||||
}).showToast();
|
||||
let count = 0;
|
||||
const current_donations = await DonationService.donationControllerGetAll();
|
||||
for (const t of generate_teams) {
|
||||
const runners = await RunnerTeamService.runnerTeamControllerGetRunners(
|
||||
t.id
|
||||
);
|
||||
let certificateRunners = [];
|
||||
for (let runner of runners) {
|
||||
runner.distanceDonations = current_donations.find((d) => d.runner?.id == runner.id) || [];
|
||||
certificateRunners.push(runner);
|
||||
}
|
||||
fetch(
|
||||
`${config.baseurl}/documents/certificates?locale=${locale}&download=true&key=${config.documentserver_key}`,
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(certificateRunners),
|
||||
}
|
||||
)
|
||||
.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) => {
|
||||
count++;
|
||||
const url = window.URL.createObjectURL(blob);
|
||||
let a = document.createElement("a");
|
||||
a.href = url;
|
||||
a.download = `${$_('certificates')}_${t.name}-${locale}.pdf`;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
a.remove();
|
||||
if (count === generate_teams.length) {
|
||||
toast.hideToast();
|
||||
Toastify({
|
||||
text: $_("pdfs-successfully-generated"),
|
||||
duration: 3500,
|
||||
backgroundColor:
|
||||
"linear-gradient(to right, #00b09b, #96c93d)",
|
||||
}).showToast();
|
||||
}
|
||||
})
|
||||
.catch((err) => {});
|
||||
}
|
||||
}
|
||||
|
||||
async function generateOrgCertificates(locale) {
|
||||
const toast = Toastify({
|
||||
text: $_("generating-pdf"),
|
||||
duration: -1,
|
||||
}).showToast();
|
||||
let count = 0;
|
||||
const current_donations = await DonationService.donationControllerGetAll();
|
||||
for (const o of generate_orgs) {
|
||||
const runners = await RunnerOrganizationService.runnerOrganizationControllerGetRunners(
|
||||
o.id
|
||||
);
|
||||
let certificateRunners = [];
|
||||
for (let runner of runners) {
|
||||
runner.distanceDonations = current_donations.find((d) => d.runner?.id == runner.id) || [];
|
||||
certificateRunners.push(runner);
|
||||
}
|
||||
fetch(
|
||||
`${config.baseurl}/documents/certificates?locale=${locale}&download=true&key=${config.documentserver_key}`,
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(certificateRunners),
|
||||
}
|
||||
)
|
||||
.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) => {
|
||||
count++;
|
||||
const url = window.URL.createObjectURL(blob);
|
||||
let a = document.createElement("a");
|
||||
a.href = url;
|
||||
a.download = `${$_('certificates')}_${o.name}-${locale}.pdf`;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
a.remove();
|
||||
if (count === generate_orgs.length) {
|
||||
toast.hideToast();
|
||||
Toastify({
|
||||
text: $_("pdfs-successfully-generated"),
|
||||
duration: 3500,
|
||||
backgroundColor:
|
||||
"linear-gradient(to right, #00b09b, #96c93d)",
|
||||
}).showToast();
|
||||
}
|
||||
})
|
||||
.catch((err) => {});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if certificates_show}
|
||||
<div id="certificates:dropdown" class="relative inline-block">
|
||||
<div>
|
||||
<button
|
||||
on:click={() => {
|
||||
certificates_dropdown_open = !certificates_dropdown_open;
|
||||
}}
|
||||
type="button"
|
||||
class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-gray-600 text-base font-medium text-white hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500 sm:ml-3 sm:w-auto sm:text-sm inline-flex"
|
||||
id="options-menu"
|
||||
aria-haspopup="true"
|
||||
aria-expanded="true">
|
||||
{$_('generate-runner-certificates')}
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
class="-mr-1 ml-2 h-5 w-5"><path
|
||||
fill="none"
|
||||
d="M0 0h24v24H0z" />
|
||||
<path
|
||||
fill="currentColor"
|
||||
d="M3 19h18v2H3v-2zm10-5.83l6.07-6.07 1.42 1.41L12 17 3.52 8.52l1.4-1.42L11 13.17V2h2v11.17z" /></svg>
|
||||
</button>
|
||||
</div>
|
||||
{#if certificates_dropdown_open}
|
||||
<div
|
||||
class="origin-top-right absolute right-0 mt-2 w-56 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5"
|
||||
id="certificates:dropdown:menu">
|
||||
<div
|
||||
class="py-1"
|
||||
role="menu"
|
||||
aria-orientation="vertical"
|
||||
aria-labelledby="options-menu">
|
||||
<span
|
||||
class="block w-full text-left px-4 py-2 text-sm text-gray-700">{$_('select-language')}</span>
|
||||
<button
|
||||
on:click={() => {
|
||||
generateCertificates('de');
|
||||
}}
|
||||
type="submit"
|
||||
class="block w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900"
|
||||
role="menuitem">
|
||||
{$_('german')}
|
||||
</button>
|
||||
<button
|
||||
on:click={() => {
|
||||
generateCertificates('en');
|
||||
}}
|
||||
type="submit"
|
||||
class="block w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900"
|
||||
role="menuitem">
|
||||
{$_('english')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
257
src/components/pdf_generation/GenerateSponsoringContracts.svelte
Normal file
257
src/components/pdf_generation/GenerateSponsoringContracts.svelte
Normal file
@@ -0,0 +1,257 @@
|
||||
<script>
|
||||
import { getLocaleFromNavigator, _ } from "svelte-i18n";
|
||||
import {
|
||||
RunnerOrganizationService,
|
||||
RunnerTeamService,
|
||||
} from "@odit/lfk-client-js";
|
||||
import Toastify from "toastify-js";
|
||||
export let sponsoring_contracts_show = false;
|
||||
export let generate_runners = [];
|
||||
export let generate_orgs = [];
|
||||
export let generate_teams = [];
|
||||
$: sponsoring_contracts_download_open = false;
|
||||
document.addEventListener("click", function (e) {
|
||||
if (
|
||||
e.target.parentNode?.parentNode?.id != "sponsoring:dropdown" &&
|
||||
e.target.parentNode?.parentNode?.id != "sponsoring:dropdown:menu"
|
||||
) {
|
||||
sponsoring_contracts_download_open = false;
|
||||
}
|
||||
});
|
||||
|
||||
function generateSponsoringContract(locale) {
|
||||
sponsoring_contracts_download_open = false;
|
||||
|
||||
if (generate_orgs.length > 0) {
|
||||
generateOrgContracts(locale);
|
||||
} else if (generate_teams.length > 0) {
|
||||
generateTeamContracts(locale);
|
||||
} else {
|
||||
generateRunnerContracts(locale);
|
||||
}
|
||||
}
|
||||
|
||||
async function generateTeamContracts(locale) {
|
||||
const toast = Toastify({
|
||||
text: $_("generating-pdfs"),
|
||||
duration: -1,
|
||||
}).showToast();
|
||||
let count = 0;
|
||||
for (const t of generate_teams) {
|
||||
count++;
|
||||
const runners = await RunnerTeamService.runnerTeamControllerGetRunners(
|
||||
t.id
|
||||
);
|
||||
fetch(
|
||||
`${config.baseurl}/documents/contracts?locale=${locale}&download=true&key=${config.documentserver_key}`,
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(runners),
|
||||
}
|
||||
)
|
||||
.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 = `${$_('sponsorings')}_${t.name}-${locale}.pdf`;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
a.remove();
|
||||
if (count === generate_teams.length) {
|
||||
toast.hideToast();
|
||||
Toastify({
|
||||
text: $_("pdfs-successfully-generated"),
|
||||
duration: 3500,
|
||||
backgroundColor:
|
||||
"linear-gradient(to right, #00b09b, #96c93d)",
|
||||
}).showToast();
|
||||
}
|
||||
})
|
||||
.catch((err) => {});
|
||||
}
|
||||
}
|
||||
|
||||
async function generateOrgContracts(locale) {
|
||||
const toast = Toastify({
|
||||
text: $_("generating-pdf"),
|
||||
duration: -1,
|
||||
}).showToast();
|
||||
for (const o of generate_orgs) {
|
||||
const runners = await RunnerOrganizationService.runnerOrganizationControllerGetRunners(
|
||||
o.id
|
||||
);
|
||||
fetch(
|
||||
`${config.baseurl}/documents/contracts?locale=${locale}&download=true&key=${config.documentserver_key}`,
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(runners),
|
||||
}
|
||||
)
|
||||
.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) => {
|
||||
count++;
|
||||
const url = window.URL.createObjectURL(blob);
|
||||
let a = document.createElement("a");
|
||||
a.href = url;
|
||||
a.download = `${$_('sponsorings')}_${o.name}-${locale}.pdf`;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
a.remove();
|
||||
if (count === generate_orgs.length) {
|
||||
toast.hideToast();
|
||||
Toastify({
|
||||
text: $_("pdfs-successfully-generated"),
|
||||
duration: 3500,
|
||||
backgroundColor:
|
||||
"linear-gradient(to right, #00b09b, #96c93d)",
|
||||
}).showToast();
|
||||
}
|
||||
})
|
||||
.catch((err) => {});
|
||||
}
|
||||
}
|
||||
|
||||
function generateRunnerContracts(locale) {
|
||||
const toast = Toastify({
|
||||
text: $_("generating-pdf"),
|
||||
duration: -1,
|
||||
}).showToast();
|
||||
fetch(
|
||||
`${config.baseurl}/documents/contracts?locale=${locale}&download=true&key=${config.documentserver_key}`,
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(generate_runners),
|
||||
}
|
||||
)
|
||||
.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;
|
||||
if(generate_runners.length == 1){
|
||||
a.download = `${$_('sponsorings')}_${generate_runners[0].firstname}_${generate_runners[0].lastname}-${locale}.pdf`;
|
||||
}
|
||||
a.download = `${$_('sponsorings')}-${locale}.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);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if sponsoring_contracts_show}
|
||||
<div id="sponsoring:dropdown" class="relative inline-block">
|
||||
<div>
|
||||
<button
|
||||
on:click={() => {
|
||||
sponsoring_contracts_download_open = !sponsoring_contracts_download_open;
|
||||
}}
|
||||
type="button"
|
||||
class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-gray-600 text-base font-medium text-white hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500 sm:ml-3 sm:w-auto sm:text-sm inline-flex"
|
||||
id="options-menu"
|
||||
aria-haspopup="true"
|
||||
aria-expanded="true">
|
||||
{$_('generate-sponsoring-contracts')}
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
class="-mr-1 ml-2 h-5 w-5"><path
|
||||
fill="none"
|
||||
d="M0 0h24v24H0z" />
|
||||
<path
|
||||
fill="currentColor"
|
||||
d="M3 19h18v2H3v-2zm10-5.83l6.07-6.07 1.42 1.41L12 17 3.52 8.52l1.4-1.42L11 13.17V2h2v11.17z" /></svg>
|
||||
</button>
|
||||
</div>
|
||||
{#if sponsoring_contracts_download_open}
|
||||
<div
|
||||
class="origin-top-right absolute right-0 mt-2 w-56 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5"
|
||||
id="sponsoring:dropdown:menu">
|
||||
<div
|
||||
class="py-1"
|
||||
role="menu"
|
||||
aria-orientation="vertical"
|
||||
aria-labelledby="options-menu">
|
||||
<span
|
||||
class="block w-full text-left px-4 py-2 text-sm text-gray-700">{$_('select-language')}</span>
|
||||
<button
|
||||
on:click={() => {
|
||||
generateSponsoringContract('de');
|
||||
}}
|
||||
type="submit"
|
||||
class="block w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900"
|
||||
role="menuitem">
|
||||
{$_('german')}
|
||||
</button>
|
||||
<button
|
||||
on:click={() => {
|
||||
generateSponsoringContract('en');
|
||||
}}
|
||||
type="submit"
|
||||
class="block w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900"
|
||||
role="menuitem">
|
||||
{$_('english')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
@@ -30,7 +30,7 @@
|
||||
<Table />
|
||||
</div>
|
||||
<div
|
||||
class="widget w-full p-4 mb-4 rounded-lg bg-white border border-grey-100 dark:bg-grey-895 dark:border-grey-890">
|
||||
class="widget w-full p-4 mb-4 rounded-lg bg-white border border-grey-100">
|
||||
<div class="flex flex-row items-center justify-between mb-6">
|
||||
<div class="flex flex-col">
|
||||
<div class="text-sm font-light text-grey-500">Regular</div>
|
@@ -1,4 +1,4 @@
|
||||
<div class="w-full p-4 rounded-lg bg-white border border-grey-100 dark:bg-grey-895 dark:border-grey-890">
|
||||
<div class="w-full p-4 rounded-lg bg-white border border-grey-100">
|
||||
<div class="flex flex-row items-center justify-between mb-6">
|
||||
<div class="flex flex-col">
|
||||
<div class="text-sm font-light text-grey-500">Conversions</div>
|
||||
@@ -18,16 +18,16 @@
|
||||
<div class="flex flex-col w-full">
|
||||
<ul class="list-none">
|
||||
<li><a
|
||||
class="flex flex-row items-center justify-start h-10 w-full px-2 bg-white hover:bg-grey-100 dark:bg-grey-895 dark:hover:bg-grey-890"
|
||||
class="flex flex-row items-center justify-start h-10 w-full px-2 bg-white hover:bg-grey-100"
|
||||
href="/">Today</a></li>
|
||||
<li><a
|
||||
class="flex flex-row items-center justify-start h-10 w-full px-2 bg-white hover:bg-grey-100 dark:bg-grey-895 dark:hover:bg-grey-890"
|
||||
class="flex flex-row items-center justify-start h-10 w-full px-2 bg-white hover:bg-grey-100"
|
||||
href="/">This week</a></li>
|
||||
<li><a
|
||||
class="flex flex-row items-center justify-start h-10 w-full px-2 bg-white hover:bg-grey-100 dark:bg-grey-895 dark:hover:bg-grey-890"
|
||||
class="flex flex-row items-center justify-start h-10 w-full px-2 bg-white hover:bg-grey-100"
|
||||
href="/">This month</a></li>
|
||||
<li><a
|
||||
class="flex flex-row items-center justify-start h-10 w-full px-2 bg-white hover:bg-grey-100 dark:bg-grey-895 dark:hover:bg-grey-890"
|
||||
class="flex flex-row items-center justify-start h-10 w-full px-2 bg-white hover:bg-grey-100"
|
||||
href="/">This year</a></li>
|
||||
</ul>
|
||||
</div>
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user