Compare commits
941 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f182be3db0 | ||
|
|
81a32f6d58 | ||
|
|
82552b1748 | ||
|
|
af7a45d739 | ||
|
|
21013a6fe5 | ||
|
|
c81ad67844 | ||
|
|
13797f1fb3 | ||
|
|
ef5cd39b16 | ||
|
|
e133e944e3 | ||
|
|
2ffb5bbb63 | ||
|
|
0f16644944 | ||
|
|
0b41159ee4 | ||
|
|
2a78aea898 | ||
|
|
4c5face779 | ||
|
|
b3a8a8d30c | ||
|
|
7836750171 | ||
|
|
ef9d3d2e8f | ||
|
|
3ca846b2c2 | ||
|
|
ae7b68bc16 | ||
|
|
3150134e65 | ||
|
|
b552628b43 | ||
|
|
9b3eb4702b | ||
|
|
52fa98f918 | ||
|
|
1d874f37b2 | ||
|
|
582ba6023e | ||
|
|
fbcb522b43 | ||
|
|
1d3096d82c | ||
|
|
43ea2e7857 | ||
|
|
92038a1949 | ||
|
|
a323ddd5dd | ||
|
|
e70cdd4cc5 | ||
|
|
427a81cff6 | ||
|
|
4933c7a678 | ||
|
|
8ee2ec5749 | ||
|
|
ce4216e56c | ||
|
|
a3526d338f | ||
|
|
65041f77c3 | ||
|
|
4206993c72 | ||
|
|
a7d8dc6a66 | ||
|
|
56bdf1bc4d | ||
|
|
acb009a909 | ||
|
|
96532fa61e | ||
|
|
eed7f1917e | ||
|
|
51b99089e4 | ||
|
|
118e35e897 | ||
|
|
b9197b1eb3 | ||
|
|
568bb696a7 | ||
|
|
43616297c8 | ||
|
|
51801a03a0 | ||
|
|
59254c0294 | ||
|
|
61b238d511 | ||
|
|
d5ca5331a7 | ||
|
|
8f72d8608b | ||
|
|
425f3da9d4 | ||
|
|
34dc025b79 | ||
|
|
b2f8cda99b | ||
|
|
dd1e0c672b | ||
|
|
0e3cf56034 | ||
|
|
bfe409305c | ||
|
|
b225917a51 | ||
|
|
5359f5aca9 | ||
|
|
1d2f450ba4 | ||
|
|
4aa03ba3c5 | ||
|
|
118e34b380 | ||
|
|
ff3c5768c6 | ||
|
|
f293eefe8c | ||
|
|
49c59897bf | ||
|
|
0e53484b62 | ||
|
|
842bd4e251 | ||
|
|
003817ed9d | ||
|
|
fb68e63bd0 | ||
|
|
e6a03c3b30 | ||
|
|
fb8b3a3b09 | ||
|
|
43fd966bf1 | ||
|
|
315fa5a440 | ||
|
|
3be593f464 | ||
|
|
8c47a8b758 | ||
|
|
5515a5b4d6 | ||
|
|
cee0a92430 | ||
|
|
ddc163f286 | ||
|
|
81ce0bc708 | ||
|
|
29c870631b | ||
|
|
261674339a | ||
|
|
bfb418fdfd | ||
|
|
5c8c191151 | ||
|
|
9e558944d1 | ||
|
|
d8134f6d42 | ||
|
|
aa3ae524f4 | ||
|
|
cd2b12c35a | ||
|
|
b7e1e5764e | ||
|
|
9ef4ba4af5 | ||
|
|
86deaceade | ||
|
|
fd76d110d4 | ||
|
|
21f67651ff | ||
|
|
0cf22e96bc | ||
|
|
86eeab5e69 | ||
|
|
e8c98be687 | ||
|
|
bf04423524 | ||
|
|
25df51af78 | ||
|
|
6ef4b981fc | ||
|
|
4bd13949f6 | ||
|
|
5fea526d6c | ||
|
|
0b367efa27 | ||
|
|
8d60e8d864 | ||
|
|
047a599809 | ||
|
|
44d361b658 | ||
|
|
780976243a | ||
|
|
820dab3bfb | ||
|
|
67020213ed | ||
|
|
13e019b5e5 | ||
|
|
78c8dcb8e6 | ||
|
|
db90ae538e | ||
|
|
97484c5f1a | ||
|
|
1f6bdc30c8 | ||
|
|
19dd650510 | ||
|
|
72d57ca342 | ||
|
|
fc3258ad9a | ||
|
|
2632675cbe | ||
|
|
b7c820e87c | ||
|
|
3578ed8512 | ||
|
|
7c719b4d26 | ||
|
|
4e3de53e45 | ||
|
|
13cba9831c | ||
|
|
c02863b079 | ||
|
|
27e64380b0 | ||
|
|
2699b36ab0 | ||
|
|
420c59a862 | ||
|
|
5ece842b2c | ||
|
|
6f77cef2ab | ||
|
|
54b59ab90c | ||
|
|
01fb7f0a1a | ||
|
|
d7586c2705 | ||
|
|
b00ff1186d | ||
|
|
9bea3c487a | ||
|
|
2b2c72fe04 | ||
|
|
edadf1ea41 | ||
|
|
c8e5752395 | ||
|
|
bac2d96605 | ||
|
|
063d40f845 | ||
|
|
881ad3a110 | ||
|
|
c248f55fbd | ||
|
|
2501bf5d56 | ||
|
|
48c8613f9b | ||
|
|
b26053efa4 | ||
|
|
32ef5393e2 | ||
|
|
abc54fae4f | ||
|
|
d094001792 | ||
|
|
573e1f3865 | ||
|
|
d99f96b079 | ||
|
|
4b68708624 | ||
|
|
7e764cdf62 | ||
|
|
32dd6e6ced | ||
|
|
fb9242f637 | ||
|
|
acf4a4f4d7 | ||
|
|
260a53aaf1 | ||
|
|
42d4829f2e | ||
|
|
6ac6f0a441 | ||
|
|
54ad666355 | ||
|
|
43f4cc6c9e | ||
|
|
6219ceb0a2 | ||
|
|
725c99211b | ||
|
|
bcf29eea45 | ||
|
|
0d4546bb9e | ||
|
|
e4ce12057b | ||
|
|
19ecd12c5f | ||
|
|
b96e55f42c | ||
|
|
31d4018698 | ||
|
|
ef26003755 | ||
|
|
931d311281 | ||
|
|
01eda98415 | ||
|
|
1b0fe9d352 | ||
|
|
f31db95241 | ||
|
|
ebedde5ed6 | ||
|
|
8e2ab6c2c4 | ||
|
|
e1308b6fd5 | ||
|
|
a5b3caea11 | ||
|
|
de1495ee2e | ||
|
|
7a78dd6547 | ||
|
|
8cdb869a10 | ||
|
|
f5639ec79d | ||
|
|
3d31728194 | ||
|
|
a996eaf53c | ||
|
|
f0b6cf9712 | ||
|
|
470685a94f | ||
|
|
c10b2c49b5 | ||
|
|
f1aa0e4817 | ||
|
|
82e31fffd8 | ||
|
|
cdc5d2ee6c | ||
|
|
3d26a73b05 | ||
|
|
b1fb38027d | ||
|
|
eef1139c0d | ||
|
|
cb0bdb89c5 | ||
|
|
d6a4b11b65 | ||
|
|
a80a75ca77 | ||
|
|
a56c66d19f | ||
|
|
bc7e2483c2 | ||
|
|
00decf1f6c | ||
|
|
306b524dee | ||
|
|
f26772d4a0 | ||
|
|
e39ab31397 | ||
|
|
208a1568b3 | ||
|
|
a7a4c18715 | ||
|
|
9228976803 | ||
|
|
6619b9f4de | ||
|
|
9f1f654521 | ||
|
|
ad974ef07b | ||
|
|
ff8009167b | ||
|
|
b3dc8b04c8 | ||
|
|
5684f97389 | ||
|
|
bce93733c9 | ||
|
|
c677bc17e4 | ||
|
|
91e344ae28 | ||
|
|
f4ad886a79 | ||
|
|
ef51c2dbe3 | ||
|
|
8984078767 | ||
|
|
59231003ea | ||
|
|
fb2fa6e6c2 | ||
|
|
dc253b0254 | ||
|
|
f3c1de430b | ||
|
|
af5adade4d | ||
|
|
d150fe6f80 | ||
|
|
ff132b2d87 | ||
|
|
90e8af9765 | ||
|
|
ab27b6f63b | ||
|
|
dcc711d4eb | ||
|
|
95d57642c4 | ||
|
|
7252119228 | ||
|
|
0adf3288c8 | ||
|
|
b30a6e159c | ||
|
|
3c8a814abb | ||
|
|
42093b81b2 | ||
|
|
f11ffa18a1 | ||
|
|
8f541081ae | ||
|
|
6a215c0440 | ||
|
|
ada527370f | ||
|
|
97f0230ac5 | ||
|
|
1070d62e47 | ||
|
|
ba3cb01f02 | ||
|
|
c52116f4e7 | ||
|
|
c787881c76 | ||
|
|
fa7fd420a8 | ||
|
|
12d30af308 | ||
|
|
4695d31c72 | ||
|
|
866e6ac45a | ||
|
|
b1f8453daf | ||
|
|
317d6d576b | ||
|
|
d66ea4e154 | ||
|
|
bcfb915d93 | ||
|
|
e5c3d9c07b | ||
|
|
8a8c1b957f | ||
|
|
76b7ec9bc5 | ||
|
|
78fa17dc73 | ||
|
|
e678f6f4b3 | ||
|
|
2eb6d7b27c | ||
|
|
5805bb2a33 | ||
|
|
e92c7632d5 | ||
|
|
370b116656 | ||
|
|
35ebe4774f | ||
|
|
8fab3fc04d | ||
|
|
3dc63bf77c | ||
|
|
305bde5561 | ||
|
|
048356bf3f | ||
|
|
b389b07a6e | ||
|
|
7f72ef0021 | ||
|
|
395c9b0cd3 | ||
|
|
7e44bdf1e2 | ||
|
|
9e0ec97845 | ||
|
|
0259bcee06 | ||
|
|
64e7cce171 | ||
|
|
4e39914cff | ||
|
|
5347f986e4 | ||
|
|
7dd24698b1 | ||
|
|
a8534a8b13 | ||
|
|
d15cedd6d1 | ||
|
|
51e46f20f4 | ||
|
|
3a5a91f1e1 | ||
|
|
7e910b9339 | ||
|
|
0fbf580293 | ||
|
|
d8b20774f4 | ||
|
|
63af59e624 | ||
|
|
61e9df1844 | ||
|
|
a2823df27e | ||
|
|
7557025b01 | ||
|
|
96662844b2 | ||
|
|
16e7cdaa1f | ||
|
|
feffcd5cdc | ||
|
|
89d26778f2 | ||
|
|
b7ea2ac415 | ||
|
|
bb1f86c9d2 | ||
|
|
cc972db41d | ||
|
|
d9ce51f7e3 | ||
|
|
5dd75f836c | ||
|
|
b45627b4a7 | ||
|
|
404e783060 | ||
|
|
3515b9a942 | ||
|
|
b244d1e4b4 | ||
|
|
c4729167cd | ||
|
|
a7b652c137 | ||
|
|
d396b782a7 | ||
|
|
965166a349 | ||
|
|
733f811f9d | ||
|
|
7e42932028 | ||
|
|
cdc58066f6 | ||
|
|
224dafcae6 | ||
|
|
bb3f59f1bb | ||
|
|
876127d1fb | ||
|
|
f27807097d | ||
|
|
68bfcf6700 | ||
|
|
829e009d4c | ||
|
|
6dbe365362 | ||
|
|
db1d65e601 | ||
|
|
767e688d3c | ||
|
|
e647d4b355 | ||
|
|
b85559c686 | ||
|
|
6f353ce01d | ||
|
|
5dfea0175d | ||
|
|
b4c0ce17de | ||
|
|
c805887bbd | ||
|
|
d4b419ded8 | ||
|
|
a5e70e9def | ||
|
|
d06cd4be54 | ||
|
|
20d0334489 | ||
|
|
5438e800c7 | ||
|
|
4593b09bf3 | ||
|
|
33ed133f9f | ||
|
|
fe2214d12c | ||
|
|
2e41ac041e | ||
|
|
98c3f749d8 | ||
|
|
851b9fb3b2 | ||
|
|
6aea290693 | ||
|
|
ace0ecfce1 | ||
|
|
a8c4f6dd29 | ||
|
|
3818741453 | ||
|
|
da3c18fde2 | ||
|
|
9836c2aab5 | ||
|
|
46202a0b64 | ||
|
|
16a8d91815 | ||
|
|
6f5cd79a7f | ||
|
|
bf7fab3600 | ||
|
|
d4653ca983 | ||
|
|
c9444d7747 | ||
|
|
287b95a538 | ||
|
|
686f390b1a | ||
|
|
46fba3ca5a | ||
|
|
7d2f07d6b0 | ||
|
|
6f9d2a7c85 | ||
|
|
59998396d4 | ||
|
|
60e151db0f | ||
|
|
211d81ab7a | ||
|
|
eb255daac2 | ||
|
|
032b1eeabe | ||
|
|
4526138fae | ||
|
|
428f1dd5fb | ||
|
|
4f4f286a5e | ||
|
|
05799650e6 | ||
|
|
d67bef3001 | ||
|
|
76d329b888 | ||
|
|
0329e74bbd | ||
|
|
9fabb7223a | ||
|
|
671c44438d | ||
|
|
2377fbff55 | ||
|
|
af17c026ff | ||
|
|
7a1e968a52 | ||
|
|
8e9f6e19bf | ||
|
|
bef117a22c | ||
|
|
d4a50efc38 | ||
|
|
6693933941 | ||
|
|
b627b181e3 | ||
|
|
fcf159d091 | ||
|
|
aa9de3c369 | ||
|
|
b989da3f05 | ||
|
|
cdf39fd838 | ||
|
|
c3fbb9100a | ||
|
|
fbc7dfce60 | ||
|
|
bde8bd8475 | ||
|
|
c713b9d2f4 | ||
|
|
25a0848c3e | ||
|
|
ccd008666e | ||
|
|
40d9eb15cf | ||
|
|
fad870e83e | ||
|
|
0f494b10d0 | ||
|
|
b2091d4f83 | ||
|
|
7b9c0d85cd | ||
|
|
5662cccc98 | ||
|
|
2b6001402a | ||
|
|
8d9df1f397 | ||
|
|
aa30982ff1 | ||
|
|
c5f072f6b6 | ||
|
|
fb8e66e32d | ||
|
|
d457f9a46f | ||
|
|
6bbe992940 | ||
|
|
1cb658f9d1 | ||
|
|
b3de35eac7 | ||
|
|
5bb7c780a1 | ||
|
|
5c5d1dc877 | ||
|
|
8ab324f69e | ||
|
|
e30a54297a | ||
|
|
c4fc832ef6 | ||
|
|
750312c59e | ||
|
|
e8665f7484 | ||
|
|
81669177cd | ||
|
|
dc063218ff | ||
|
|
004025636c | ||
|
|
5a2e806e4a | ||
|
|
b918933665 | ||
|
|
e39e2522aa | ||
|
|
8caa92d663 | ||
|
|
0be67a8589 | ||
|
|
d0250f3fd0 | ||
|
|
a11bb2282f | ||
|
|
664410821c | ||
|
|
a2a0defa23 | ||
|
|
c6595c6481 | ||
|
|
cbedb8370b | ||
|
|
b92d9c9e04 | ||
|
|
bd054ecedd | ||
|
|
9dfa101afe | ||
|
|
f52a378280 | ||
|
|
bda96f952e | ||
|
|
79fb9bd785 | ||
|
|
5de6b359ee | ||
|
|
b5f1afb81e | ||
|
|
63e53cb2ed | ||
|
|
7f08355311 | ||
|
|
76403ef8ea | ||
|
|
12768b5219 | ||
|
|
aa2012bbda | ||
|
|
179abe4f37 | ||
|
|
43154346e3 | ||
|
|
1b9128a68f | ||
|
|
b5b465d56f | ||
|
|
94cbb2cf3d | ||
|
|
a51e68c3d8 | ||
|
|
7208126584 | ||
|
|
256305d12f | ||
|
|
7996bc7e23 | ||
|
|
e86a7cf59f | ||
|
|
6abcbc96ac | ||
|
|
b23c3e60d7 | ||
|
|
2f6d460442 | ||
|
|
3cd1eaeddc | ||
|
|
feb3aa34e9 | ||
|
|
7f8c622f6b | ||
|
|
6628cf3495 | ||
|
|
e6f3cd77de | ||
|
|
8705524a4b | ||
|
|
4475f5979e | ||
|
|
93321437c1 | ||
|
|
0bf7f5f9ce | ||
|
|
ef8b1bc58e | ||
|
|
8f938c825d | ||
|
|
766ba97a0e | ||
|
|
24c433dd5b | ||
|
|
570dc20e8e | ||
|
|
34be5155c4 | ||
|
|
e752e4607c | ||
|
|
9e5ab63434 | ||
|
|
66cd961fc3 | ||
|
|
6216dd8bac | ||
|
|
3677b7d761 | ||
|
|
eae53022ee | ||
|
|
24e793582d | ||
|
|
01b8948b6a | ||
|
|
1b3dbfc98d | ||
|
|
a2930ccfdd | ||
|
|
201f4ca07f | ||
|
|
e81e8e7252 | ||
|
|
9d01fb5784 | ||
|
|
9921e868bc | ||
|
|
9dd6085bcf | ||
|
|
2d1928ebd0 | ||
|
|
095853d090 | ||
|
|
fe46e69c53 | ||
|
|
a55571a381 | ||
|
|
7d449d3ff7 | ||
|
|
db1257751a | ||
|
|
43830f463d | ||
|
|
e798197110 | ||
|
|
35f2161913 | ||
|
|
6f8edaf4ba | ||
|
|
80a713d850 | ||
|
|
ed518d6910 | ||
|
|
7ad36ea6f6 | ||
|
|
65fc2971ac | ||
|
|
4438f90af4 | ||
|
|
2daa033b8e | ||
|
|
726f909589 | ||
|
|
6a6db17d2c | ||
|
|
021775d3a7 | ||
|
|
88ef8830c2 | ||
|
|
eb9bd777e0 | ||
|
|
e3ef820bac | ||
|
|
9317f55d81 | ||
|
|
5d7849be45 | ||
|
|
74b4c1a11f | ||
|
|
0f79f04f52 | ||
|
|
ea07686946 | ||
|
|
3df6005549 | ||
|
|
511f24e3ef | ||
|
|
4e49d2d7a6 | ||
|
|
c7e03043e0 | ||
|
|
f85626a8e4 | ||
|
|
6282675682 | ||
|
|
747d8157b5 | ||
|
|
1bcd1869f0 | ||
|
|
95c273e7b2 | ||
|
|
6236275528 | ||
|
|
d654bcfc4b | ||
|
|
fcbffdad8f | ||
|
|
8079079217 | ||
|
|
87fa2df399 | ||
|
|
5d6d69c8c4 | ||
|
|
538f36aebc | ||
|
|
9067272382 | ||
|
|
bc430a796f | ||
|
|
24fc875cc9 | ||
|
|
fc8a9da8cd | ||
|
|
486ef92b07 | ||
|
|
630db9071a | ||
|
|
8e2219235d | ||
|
|
0a05d02623 | ||
|
|
f242c52a0c | ||
|
|
6e115038b0 | ||
|
|
428debcd6f | ||
|
|
ddbef9bd11 | ||
|
|
1dc013e46b | ||
|
|
d409811aa6 | ||
|
|
ecb7b89f31 | ||
|
|
8a3d372223 | ||
|
|
3544538c19 | ||
|
|
f82cdcf5bb | ||
|
|
e6a3b1a585 | ||
|
|
8d970779f5 | ||
|
|
954fba26f7 | ||
|
|
25418ced4a | ||
|
|
591b6eee36 | ||
|
|
d7cc8e3232 | ||
|
|
0d7adb4e6b | ||
|
|
62b8a55406 | ||
|
|
c4c549fe1b | ||
|
|
e41ac70dfe | ||
|
|
59ce4177d2 | ||
|
|
926d14056b | ||
|
|
937803fd75 | ||
|
|
168730cfca | ||
|
|
87c4becbe6 | ||
|
|
f0535eb47f | ||
|
|
522a78d6a2 | ||
|
|
4f955bcd50 | ||
|
|
d9ccf89166 | ||
|
|
0af6e45868 | ||
|
|
b1c40806c5 | ||
|
|
826c564af6 | ||
|
|
b623449efb | ||
|
|
221948411a | ||
|
|
fcba520003 | ||
|
|
f9c8571c31 | ||
|
|
90ba67a79c | ||
|
|
e78dcff3a7 | ||
|
|
40897cf2b3 | ||
|
|
1bbef9eb37 | ||
|
|
9b770b2be7 | ||
|
|
77b133757e | ||
|
|
37b692c260 | ||
|
|
dc2ad98120 | ||
|
|
91d1ee28f6 | ||
|
|
e2b7807cf3 | ||
|
|
46375a3db4 | ||
|
|
0585800532 | ||
|
|
eccb00345a | ||
|
|
621b8185fd | ||
|
|
907249cc40 | ||
|
|
35342707f0 | ||
|
|
0a7919f786 | ||
|
|
c1fc52223b | ||
|
|
246e69d754 | ||
|
|
16927903cd | ||
|
|
862b420488 | ||
|
|
d445c5f31c | ||
|
|
c4625d2e7e | ||
|
|
3f14690c39 | ||
|
|
30c1f8628b | ||
|
|
f18cd31a72 | ||
|
|
9b197811d1 | ||
|
|
e2846a3178 | ||
|
|
ed8eb4840e | ||
|
|
f1b7effe3a | ||
|
|
8390687c5a | ||
|
|
7f7148c859 | ||
|
|
66df5f807c | ||
|
|
53044bd391 | ||
|
|
2b4c52c13b | ||
|
|
6540684063 | ||
|
|
171e18c8a9 | ||
|
|
5ddae5f664 | ||
|
|
f25d134590 | ||
|
|
dbc609765b | ||
|
|
aaef6c7649 | ||
|
|
333f5c7fc5 | ||
|
|
47b16d2287 | ||
|
|
c1a8898e92 | ||
|
|
456ca8cc46 | ||
|
|
10fa81e77c | ||
|
|
b015b804a1 | ||
|
|
c5fd581a62 | ||
|
|
613a7429b8 | ||
|
|
9010677c6d | ||
|
|
2b00876e6b | ||
|
|
a87e4c7472 | ||
|
|
ebc074c308 | ||
|
|
e3325bb620 | ||
|
|
0bcb3829c7 | ||
|
|
848a44276f | ||
|
|
299be2364e | ||
|
|
a9b399ebbd | ||
|
|
87e2e27e56 | ||
|
|
4f2d320553 | ||
|
|
425c982865 | ||
|
|
804fbf7b05 | ||
|
|
111b354a58 | ||
|
|
7b4c6b42ae | ||
|
|
d21abaad3f | ||
|
|
e7670e65b3 | ||
|
|
c0e59a58c5 | ||
|
|
4f7e5c8259 | ||
|
|
2b93d00833 | ||
|
|
1b95e0e82a | ||
|
|
cfbc6bc83c | ||
|
|
23df273ae6 | ||
|
|
f00127f3f4 | ||
|
|
6c1c58e641 | ||
|
|
1b46ab0811 | ||
|
|
dab2340c19 | ||
|
|
959710675f | ||
|
|
6057a904ca | ||
|
|
16163eb7cd | ||
|
|
489de89e85 | ||
|
|
765c8234e3 | ||
|
|
697d6e9014 | ||
|
|
985e2c86ef | ||
|
|
5779539c94 | ||
|
|
7f5a453f26 | ||
|
|
0ef1f3d61e | ||
|
|
384c847a90 | ||
|
|
a091a96b69 | ||
|
|
366f8cd2bf | ||
|
|
fd78f0b177 | ||
|
|
8572830c69 | ||
|
|
8a045a4879 | ||
|
|
85faea9ea5 | ||
|
|
0a1ab112ee | ||
|
|
6846ff5ad1 | ||
|
|
e0e581c1b8 | ||
|
|
65808ccf58 | ||
|
|
d6d2d1157b | ||
|
|
f5c46b23b9 | ||
|
|
db90287c1f | ||
|
|
33e0daee77 | ||
|
|
7276966af9 | ||
|
|
1fe2efca4d | ||
|
|
f6346c27bc | ||
|
|
0b693fbcb7 | ||
|
|
ad4016f6d0 | ||
|
|
78d6328af8 | ||
|
|
48c3a4ee63 | ||
|
|
0f5411ab46 | ||
|
|
14b268c796 | ||
|
|
e9c0b6e458 | ||
|
|
f6f9e96c26 | ||
|
|
ca24134c6e | ||
|
|
8163dc96ca | ||
|
|
2eb5d81e74 | ||
|
|
4700ec8098 | ||
|
|
47325b387e | ||
|
|
1d04a5b7b1 | ||
|
|
0e2b9f136a | ||
|
|
a37dc2feef | ||
|
|
7a2551f71f | ||
|
|
3a3973744f | ||
|
|
66831fe655 | ||
|
|
484f219270 | ||
|
|
4636520cb4 | ||
|
|
64d57e3263 | ||
|
|
07a78fcc26 | ||
|
|
b5fc95bfed | ||
|
|
f28dd40242 | ||
|
|
423f7c1c12 | ||
|
|
76f0b9315a | ||
|
|
41695edc45 | ||
|
|
2685c82ec6 | ||
|
|
ba2fcf6ad8 | ||
|
|
e35d20e57e | ||
|
|
61c37e7fb3 | ||
|
|
fd8ea88d31 | ||
|
|
8daacfcf9a | ||
|
|
24f030591b | ||
|
|
3719cc70e7 | ||
|
|
53fb99f8f2 | ||
|
|
830722904b | ||
|
|
3dec406733 | ||
|
|
0b68d071a1 | ||
|
|
9cae140cb1 | ||
|
|
d43f46ceb9 | ||
|
|
1c400d6685 | ||
|
|
ac910efbda | ||
|
|
a1e1a123f3 | ||
|
|
4c4032b5ad | ||
|
|
9c5a66b80e | ||
|
|
1ba99def41 | ||
|
|
eeca03ae61 | ||
|
|
3aa7ba1629 | ||
|
|
ea06f4940a | ||
|
|
e9b89b377a | ||
|
|
eb1a592abe | ||
|
|
797a4d6afd | ||
|
|
a0ab248479 | ||
|
|
6b7a089057 | ||
|
|
c634d46b06 | ||
|
|
6d7f6cbe2b | ||
|
|
0673ab6ce7 | ||
|
|
87441ab0ec | ||
|
|
c8bc0e7328 | ||
|
|
00dfb87c17 | ||
|
|
64187bd254 | ||
|
|
2173737132 | ||
|
|
b32573f9b7 | ||
|
|
797ffeff2a | ||
|
|
26a70a8398 | ||
|
|
fe4e67b953 | ||
|
|
3d481e5e47 | ||
|
|
6e60cff400 | ||
|
|
4f196eb27d | ||
|
|
54b07d1e43 | ||
|
|
d7bbf20585 | ||
|
|
6f80f5f4ad | ||
|
|
aacca45da6 | ||
|
|
d0f95923a3 | ||
|
|
91ab867792 | ||
|
|
0654558b6b | ||
|
|
be756b3fe9 | ||
|
|
6202c0c462 | ||
|
|
d92d346de3 | ||
|
|
7f686c28c6 | ||
|
|
dba8663e18 | ||
|
|
f0b4070ae2 | ||
|
|
ab550a2831 | ||
|
|
7b836c2894 | ||
|
|
b7dbac0695 | ||
|
|
04e3f5b522 | ||
|
|
ffd02c787d | ||
|
|
c3662f6bc5 | ||
|
|
5d3af7e3cb | ||
|
|
ae01864e0d | ||
|
|
0e9dcc2b1f | ||
|
|
28b3301063 | ||
|
|
c4912ffd8f | ||
|
|
0fe7584f4b | ||
|
|
6469e3de36 | ||
|
|
6924cc1799 | ||
|
|
1378543bf7 | ||
|
|
cf6b7b4d24 | ||
|
|
9409261f3b | ||
|
|
3d7dca1f43 | ||
|
|
5cd5c39916 | ||
|
|
b0ab6bd302 | ||
|
|
7dad19f8be | ||
|
|
681cf01bd4 | ||
|
|
403d890140 | ||
|
|
0fcd8a45b6 | ||
|
|
a63dd4a846 | ||
|
|
cdd4cecb5b | ||
|
|
57a650cf6b | ||
|
|
e39ba6e62f | ||
|
|
59b1219128 | ||
|
|
244ec6626f | ||
|
|
d797f57751 | ||
|
|
bc2c700ca5 | ||
|
|
bc8ba16b6b | ||
|
|
640297867f | ||
|
|
cf3aa9f0cf | ||
|
|
2663c36dc2 | ||
|
|
1179d9330a | ||
|
|
d0b401d3cf | ||
|
|
aa6bc36b89 | ||
|
|
19dc8f2704 | ||
|
|
939b40b014 | ||
|
|
f1ece3a89e | ||
|
|
97ebca5046 | ||
|
|
20a80933b5 | ||
|
|
adf3b6b663 | ||
|
|
b546929c9c | ||
|
|
c5b515bb35 | ||
|
|
223575c232 | ||
|
|
466139fadf | ||
|
|
cfc882f303 | ||
|
|
717861057f | ||
|
|
4841bfc690 | ||
|
|
b8fe0bca90 | ||
|
|
072d9e3538 | ||
|
|
2eb371fcd6 | ||
|
|
190b040b1a | ||
|
|
3c9904ddd5 | ||
|
|
27597e9a5a | ||
|
|
3b29c0613a | ||
|
|
6b4f1b91d5 | ||
|
|
039b5540a9 | ||
|
|
463fddefd3 | ||
|
|
6da2e35e5b | ||
|
|
d003283939 | ||
|
|
f560322547 | ||
|
|
e09663aa71 | ||
|
|
93f8a0a4d3 | ||
|
|
ff16ae33c5 | ||
|
|
b8a3f81859 | ||
|
|
d0c6bef6b5 | ||
|
|
355b8edd86 | ||
|
|
bbe8ac9742 | ||
|
|
b9c9e8af98 | ||
|
|
820a3cb4d0 | ||
|
|
aaa1d7f0a4 | ||
|
|
ea6a0c4d5f | ||
|
|
dbdce02e79 | ||
|
|
99b31ba9a2 | ||
|
|
f84fb52609 | ||
|
|
a035b9dbb0 | ||
|
|
96223eee10 | ||
|
|
ce015babec | ||
|
|
3dfe705da1 | ||
|
|
13c1a2a0b0 | ||
|
|
eefbe0f7c1 | ||
|
|
53123e05e0 | ||
|
|
54835866a7 | ||
|
|
8f3ed70a57 | ||
|
|
6b7c0e4ac9 | ||
|
|
40cc4a3d37 | ||
|
|
a960b837df | ||
|
|
47342ee739 | ||
|
|
435c4e0ed4 | ||
|
|
597b613e2d | ||
|
|
7f51609b72 | ||
|
|
8f2484e736 | ||
|
|
8a32910084 | ||
|
|
6b30ac27ea | ||
|
|
51c4dd05ae | ||
|
|
98f53cddc8 | ||
|
|
25d8815c17 | ||
|
|
8220f502e6 | ||
|
|
129f2d97d6 | ||
|
|
1ea03ac015 | ||
|
|
f02323561c | ||
|
|
050b0bc55a | ||
|
|
ca7c145457 | ||
|
|
668dff4620 | ||
|
|
85560cc438 | ||
|
|
d3f293f622 | ||
|
|
9922526fc6 | ||
|
|
4cdfc97a9f | ||
|
|
4bcc5c5b38 | ||
|
|
cfe897c3a3 | ||
|
|
b6491f9d6a | ||
|
|
d3d042e539 | ||
|
|
26a3a2abb6 | ||
|
|
d98b55c7ff | ||
|
|
a0ebd52c0a | ||
|
|
d74f501f4c | ||
|
|
ee2d53f10b | ||
|
|
ad64637a0d | ||
|
|
7abcd054aa | ||
|
|
3dd0740222 | ||
|
|
185d421074 | ||
|
|
a94d8bfbc3 | ||
|
|
29b23cc862 | ||
|
|
18ca33e9d2 | ||
|
|
4e4aa23552 | ||
|
|
32d45c9097 | ||
|
|
b107237a90 | ||
|
|
0ff7c16d0d | ||
|
|
19c51fa721 | ||
|
|
7319cc7cc9 | ||
|
|
29cc0d9a11 | ||
|
|
977213c70e | ||
|
|
fd4b9c2ab1 | ||
|
|
81ef952451 | ||
|
|
a3748a6ae8 | ||
|
|
6dd46ca19f | ||
|
|
ef62fbe44a | ||
|
|
db18d9ad81 | ||
|
|
019d0994c8 | ||
|
|
f9ca725899 | ||
|
|
cfde7dc6a8 | ||
|
|
0630b0e078 | ||
|
|
d5a8b13b0e | ||
|
|
bea47cc003 | ||
|
|
28d354b90a | ||
|
|
10140556e6 | ||
|
|
63ee7e17b8 | ||
|
|
84c8aa4129 | ||
|
|
460046c732 | ||
|
|
239f2d0269 | ||
|
|
0f89a490de | ||
|
|
b8ebbcbb6c | ||
|
|
8088c32218 | ||
|
|
912f66883a | ||
|
|
fd4ba25f1b | ||
|
|
d4706a62bd | ||
|
|
df859686bf | ||
|
|
9a651e3725 | ||
|
|
5dd9cd5831 | ||
|
|
c7658527d5 | ||
|
|
cd3ead7ac2 | ||
|
|
d8dca25a0e | ||
|
|
836dae0c0e | ||
|
|
da4c9e6331 | ||
|
|
d0e6f325c4 | ||
|
|
bbd337fa1f | ||
|
|
3c64d2ebcf | ||
|
|
ee70abbfbe | ||
|
|
0a8147cee2 | ||
|
|
722794c425 | ||
|
|
033c473199 | ||
|
|
52c6dfed5b | ||
|
|
64bd9ba86f | ||
|
|
c2f40a8d50 | ||
|
|
cae3f2dec3 | ||
|
|
f709edb2ee | ||
|
|
1d2485db3c | ||
|
|
45a3729ae1 | ||
|
|
b157980d8a | ||
|
|
73438f493b | ||
|
|
3a51868d2d | ||
|
|
c024d06806 | ||
|
|
7c940010fd | ||
|
|
09fce959d4 | ||
|
|
e4502ea55c | ||
|
|
18b3da9c1e | ||
|
|
7cc64d6aa2 | ||
|
|
a41f4a6639 | ||
|
|
5e548798a5 | ||
|
|
48bc514f5b | ||
|
|
46e016d55e | ||
|
|
690ffea6c5 |
@ -16,6 +16,7 @@
|
||||
},
|
||||
"rules": {
|
||||
"rxjs/no-ignored-subscription": "warn",
|
||||
"@angular-eslint/prefer-standalone": "off",
|
||||
"@angular-eslint/no-conflicting-lifecycle": "error",
|
||||
"@angular-eslint/no-host-metadata-property": "error",
|
||||
"@angular-eslint/no-input-rename": "error",
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@ -47,3 +47,4 @@ paligo-styles/style.css*
|
||||
|
||||
migrations.json
|
||||
*.iml
|
||||
/.nx/
|
||||
|
||||
@ -4,38 +4,60 @@ variables:
|
||||
PROJECT: red-ui
|
||||
DOCKERFILELOCATION: 'docker/$PROJECT/Dockerfile'
|
||||
|
||||
|
||||
include:
|
||||
- project: 'gitlab/gitlab'
|
||||
ref: 'main'
|
||||
file: 'ci-templates/docker_build_nexus_v2.yml'
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE != "schedule"
|
||||
- if: $CI_PIPELINE_SOURCE != "schedule"
|
||||
|
||||
sonarqube:
|
||||
stage: test
|
||||
image:
|
||||
name: sonarsource/sonar-scanner-cli:11.1
|
||||
entrypoint:
|
||||
- ''
|
||||
variables:
|
||||
SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar"
|
||||
GIT_DEPTH: '0'
|
||||
cache:
|
||||
key: "${CI_JOB_NAME}"
|
||||
paths:
|
||||
- ".sonar/cache"
|
||||
script:
|
||||
- sonar-scanner
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
||||
- if: "$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH"
|
||||
- if: "$CI_COMMIT_BRANCH =~ /^release/"
|
||||
|
||||
localazy update:
|
||||
image: node:20.5
|
||||
cache:
|
||||
- key:
|
||||
files:
|
||||
- yarn.lock
|
||||
paths:
|
||||
- .yarn-cache/
|
||||
script:
|
||||
- git config user.email "${CI_EMAIL}"
|
||||
- git config user.name "${CI_USERNAME}"
|
||||
- git remote add gitlab_origin https://${CI_USERNAME}:${CI_ACCESS_TOKEN}@gitlab.knecon.com/redactmanager/red-ui.git
|
||||
- cd tools/localazy
|
||||
- yarn install --cache-folder .yarn-cache
|
||||
- yarn start
|
||||
- cd ../..
|
||||
- git add .
|
||||
- |-
|
||||
CHANGES=$(git status --porcelain | wc -l)
|
||||
if [ "$CHANGES" -gt "0" ]
|
||||
then
|
||||
git status
|
||||
git commit -m "push back localazy update"
|
||||
git push gitlab_origin HEAD:${CI_COMMIT_REF_NAME}
|
||||
fi
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "schedule"
|
||||
image: node:20.5
|
||||
cache:
|
||||
- key:
|
||||
files:
|
||||
- yarn.lock
|
||||
paths:
|
||||
- .yarn-cache/
|
||||
script:
|
||||
# - git config user.email "${CI_EMAIL}"
|
||||
# - git config user.name "${CI_USERNAME}"
|
||||
# - git remote add gitlab_origin https://${CI_USERNAME}:${CI_ACCESS_TOKEN}@gitlab.knecon.com/redactmanager/red-ui.git
|
||||
- git push https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.knecon.com/redactmanager/red-ui.git
|
||||
- cd tools/localazy
|
||||
- yarn install --cache-folder .yarn-cache
|
||||
- yarn start
|
||||
- cd ../..
|
||||
- git add .
|
||||
- |-
|
||||
CHANGES=$(git status --porcelain | wc -l)
|
||||
if [ "$CHANGES" -gt "0" ]
|
||||
then
|
||||
git status
|
||||
git commit -m "push back localazy update"
|
||||
git push gitlab_origin HEAD:${CI_COMMIT_REF_NAME}
|
||||
# git push https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.knecon.com/redactmanager/red-ui.git
|
||||
# git push
|
||||
fi
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "schedule"
|
||||
|
||||
11
README.md
11
README.md
@ -2,13 +2,12 @@
|
||||
|
||||
### To Create a new Stack in rancher check [this Wiki page](https://wiki.iqser.com/pages/viewpage.action?spaceKey=RED&title=Work+with+kubectl)
|
||||
|
||||
## Code style
|
||||
# Dependencies update guide
|
||||
* When updating @pdftron/webviewer, make sure to change the version also in the angular.json and everywhere where the path to /assets/wv-recources is used
|
||||
* Make sure the keycloak.js version is the same with the keycloak version from helm chart
|
||||
|
||||
* Always use `trackBy` in `*ngFor` loops (see shorthand below)
|
||||
```typescript
|
||||
readonly trackBy = trackByFactory();
|
||||
```
|
||||
* Don't use `setInterval` without calling `clearInterval` in `ngOnDestroy`
|
||||
## Code style
|
||||
* Don't use `setInterval` without calling `clearInterval` in `ngOnDestroy` or in `destroyRef.onDestroy(() => clearInterval(intervalId))`
|
||||
* Never call getters in HTML templates
|
||||
|
||||
## Keycloak Staging Config
|
||||
|
||||
25
angular.json
25
angular.json
@ -36,12 +36,13 @@
|
||||
"prefix": "redaction",
|
||||
"targets": {
|
||||
"build": {
|
||||
"builder": "@angular-devkit/build-angular:browser",
|
||||
"builder": "@angular/build:application",
|
||||
"options": {
|
||||
"outputPath": "dist/apps/red-ui",
|
||||
"outputPath": {
|
||||
"base": "dist/apps/red-ui"
|
||||
},
|
||||
"index": "apps/red-ui/src/index.html",
|
||||
"main": "apps/red-ui/src/main.ts",
|
||||
"polyfills": "apps/red-ui/src/polyfills.ts",
|
||||
"polyfills": ["apps/red-ui/src/polyfills.ts"],
|
||||
"tsConfig": "tsconfig.json",
|
||||
"baseHref": "/ui/",
|
||||
"assets": [
|
||||
@ -49,7 +50,7 @@
|
||||
{
|
||||
"glob": "**/*",
|
||||
"input": "node_modules/@pdftron/webviewer/public/",
|
||||
"output": "/assets/wv-resources/"
|
||||
"output": "/assets/wv-resources/11.1.0/"
|
||||
},
|
||||
{
|
||||
"glob": "**/*",
|
||||
@ -72,13 +73,12 @@
|
||||
"stylePreprocessorOptions": {
|
||||
"includePaths": ["./apps/red-ui/src/assets/styles", "./libs/common-ui/src/assets/styles"]
|
||||
},
|
||||
"scripts": ["node_modules/@pdftron/webviewer/webviewer.min.js", "node_modules/chart.js/dist/chart.js"],
|
||||
"vendorChunk": true,
|
||||
"scripts": ["node_modules/chart.js/auto/auto.cjs"],
|
||||
"extractLicenses": false,
|
||||
"buildOptimizer": false,
|
||||
"sourceMap": true,
|
||||
"optimization": false,
|
||||
"namedChunks": true
|
||||
"namedChunks": true,
|
||||
"browser": "apps/red-ui/src/main.ts"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
@ -100,8 +100,6 @@
|
||||
"sourceMap": false,
|
||||
"namedChunks": false,
|
||||
"extractLicenses": true,
|
||||
"vendorChunk": false,
|
||||
"buildOptimizer": true,
|
||||
"budgets": [
|
||||
{
|
||||
"type": "initial",
|
||||
@ -114,13 +112,12 @@
|
||||
"maximumError": "20kb"
|
||||
}
|
||||
],
|
||||
"serviceWorker": true,
|
||||
"ngswConfigPath": "ngsw-config.json"
|
||||
"serviceWorker": "ngsw-config.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"serve": {
|
||||
"builder": "@angular-devkit/build-angular:dev-server",
|
||||
"builder": "@angular/build:dev-server",
|
||||
"options": {
|
||||
"buildTarget": "red-ui:build"
|
||||
},
|
||||
|
||||
@ -8,7 +8,7 @@ import { DossierFilesGuard } from '@guards/dossier-files-guard';
|
||||
import { templateExistsWhenEnteringDossierList } from '@guards/dossier-template-exists.guard';
|
||||
import { DossierTemplatesGuard } from '@guards/dossier-templates.guard';
|
||||
import { loadActiveDossiersGuard, loadAllDossiersGuard, loadArchivedDossiersGuard } from '@guards/dossiers.guard';
|
||||
import { editAttributeGuard } from '@guards/edit-attribute.guard';
|
||||
import { isNotEditingFileAttributeGuard } from '@guards/file-attribute.guard';
|
||||
import { FeaturesGuard } from '@guards/features-guard.service';
|
||||
import { ifLoggedIn } from '@guards/if-logged-in.guard';
|
||||
import { TrashGuard } from '@guards/trash.guard';
|
||||
@ -16,7 +16,7 @@ import { CompositeRouteGuard, DEFAULT_REDIRECT_KEY, IqserPermissionsGuard, Iqser
|
||||
import { TenantSelectComponent } from '@iqser/common-ui/lib/tenants';
|
||||
import { doesNotHaveAnyRole, hasAnyRole, IqserAuthGuard } from '@iqser/common-ui/lib/users';
|
||||
import { CustomRouteReuseStrategy } from '@iqser/common-ui/lib/utils';
|
||||
import { ARCHIVE_ROUTE, BreadcrumbTypes, DOSSIER_ID, DOSSIER_TEMPLATE_ID, DOSSIERS_ARCHIVE, DOSSIERS_ROUTE, FILE_ID } from '@red/domain';
|
||||
import { ARCHIVE_ROUTE, BreadcrumbTypes, DOSSIER_ID, DOSSIER_TEMPLATE_ID, DOSSIERS_ROUTE, FILE_ID } from '@red/domain';
|
||||
import { RedRoleGuard } from '@users/red-role.guard';
|
||||
import { Roles } from '@users/roles';
|
||||
import { mainGuard } from '@utils/main.guard';
|
||||
@ -38,7 +38,7 @@ const dossierTemplateIdRoutes: IqserRoutes = [
|
||||
{
|
||||
path: `:${DOSSIER_ID}`,
|
||||
canActivate: [CompositeRouteGuard, IqserPermissionsGuard],
|
||||
canDeactivate: [editAttributeGuard],
|
||||
canDeactivate: [isNotEditingFileAttributeGuard],
|
||||
data: {
|
||||
routeGuards: [DossierFilesGuard],
|
||||
breadcrumbs: [BreadcrumbTypes.dossierTemplate, BreadcrumbTypes.dossier],
|
||||
@ -49,7 +49,7 @@ const dossierTemplateIdRoutes: IqserRoutes = [
|
||||
},
|
||||
skeleton: 'dossier',
|
||||
},
|
||||
loadChildren: () => import('./modules/dossier-overview/dossier-overview.module').then(m => m.DossierOverviewModule),
|
||||
loadChildren: () => import('./modules/dossier-overview/dossier-overview.routes'),
|
||||
},
|
||||
{
|
||||
path: `:${DOSSIER_ID}/file/:${FILE_ID}`,
|
||||
@ -63,12 +63,12 @@ const dossierTemplateIdRoutes: IqserRoutes = [
|
||||
redirectTo: '/auth-error',
|
||||
},
|
||||
},
|
||||
loadChildren: () => import('./modules/file-preview/file-preview.module').then(m => m.FilePreviewModule),
|
||||
loadChildren: () => import('./modules/file-preview/file-preview.routes'),
|
||||
},
|
||||
{
|
||||
path: '',
|
||||
pathMatch: 'full',
|
||||
loadChildren: () => import('./modules/dossiers-listing/dossiers-listing.module').then(m => m.DossiersListingModule),
|
||||
loadChildren: () => import('./modules/dossiers-listing/dossiers-listing.routes'),
|
||||
data: {
|
||||
breadcrumbs: [BreadcrumbTypes.dossierTemplate],
|
||||
},
|
||||
@ -77,11 +77,10 @@ const dossierTemplateIdRoutes: IqserRoutes = [
|
||||
},
|
||||
{
|
||||
path: `${ARCHIVE_ROUTE}`,
|
||||
loadChildren: () => import('./modules/archive/archive.module').then(m => m.ArchiveModule),
|
||||
canActivate: [CompositeRouteGuard, webViewerLoadedGuard(), loadArchivedDossiersGuard()],
|
||||
loadChildren: () => import('./modules/archive/archive.routes'),
|
||||
canActivate: [CompositeRouteGuard, loadArchivedDossiersGuard()],
|
||||
data: {
|
||||
routeGuards: [FeaturesGuard],
|
||||
features: [DOSSIERS_ARCHIVE],
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -99,16 +98,16 @@ const mainRoutes: IqserRoutes = [
|
||||
},
|
||||
{
|
||||
path: 'account',
|
||||
loadChildren: () => import('./modules/account/account.module').then(m => m.AccountModule),
|
||||
loadChildren: () => import('./modules/account/account.routes'),
|
||||
},
|
||||
{
|
||||
path: 'admin',
|
||||
loadChildren: () => import('./modules/admin/admin.module').then(m => m.AdminModule),
|
||||
loadChildren: () => import('./modules/admin/admin.routes'),
|
||||
canActivate: [RedRoleGuard],
|
||||
},
|
||||
{
|
||||
path: 'dashboard',
|
||||
loadChildren: () => import('./modules/dashboard/dashboard.module').then(m => m.DashboardModule),
|
||||
loadChildren: () => import('./modules/dashboard/dashboard.routes'),
|
||||
canActivate: [CompositeRouteGuard],
|
||||
data: {
|
||||
routeGuards: [IqserAuthGuard, RedRoleGuard, IqserPermissionsGuard, DossierTemplatesGuard, DashboardGuard],
|
||||
@ -147,7 +146,7 @@ const mainRoutes: IqserRoutes = [
|
||||
},
|
||||
{
|
||||
path: 'search',
|
||||
loadChildren: () => import('./modules/search/search.module').then(m => m.SearchModule),
|
||||
loadComponent: () => import('./modules/search/search-screen/search-screen.component'),
|
||||
canActivate: [CompositeRouteGuard, IqserPermissionsGuard, loadAllDossiersGuard()],
|
||||
data: {
|
||||
routeGuards: [IqserAuthGuard, RedRoleGuard],
|
||||
@ -159,7 +158,7 @@ const mainRoutes: IqserRoutes = [
|
||||
},
|
||||
{
|
||||
path: 'trash',
|
||||
loadChildren: () => import('./modules/trash/trash.module').then(m => m.TrashModule),
|
||||
loadChildren: () => import('./modules/trash/trash.routes'),
|
||||
canActivate: [CompositeRouteGuard, IqserPermissionsGuard],
|
||||
data: {
|
||||
routeGuards: [IqserAuthGuard, RedRoleGuard, TrashGuard],
|
||||
|
||||
@ -4,26 +4,27 @@ import { UserPreferenceService } from '@users/user-preference.service';
|
||||
import { getConfig } from '@iqser/common-ui';
|
||||
import { AppConfig } from '@red/domain';
|
||||
import { NavigationEnd, Router } from '@angular/router';
|
||||
import { filter, map, switchMap, take } from 'rxjs/operators';
|
||||
import { filter, map, switchMap, take, tap } from 'rxjs/operators';
|
||||
import { APP_TYPE_PATHS } from '@common-ui/utils/constants';
|
||||
import { MatIconRegistry } from '@angular/material/icon';
|
||||
import { DomSanitizer } from '@angular/platform-browser';
|
||||
import { TenantsService } from '@common-ui/tenants';
|
||||
|
||||
function loadCustomTheme() {
|
||||
const cssFileName = getConfig<AppConfig>().THEME;
|
||||
|
||||
if (cssFileName) {
|
||||
const head = document.getElementsByTagName('head')[0];
|
||||
const link = document.createElement('link');
|
||||
link.id = cssFileName;
|
||||
link.rel = 'stylesheet';
|
||||
link.type = 'text/css';
|
||||
link.href = 'assets/styles/themes/' + cssFileName + '.css';
|
||||
link.media = 'all';
|
||||
head.appendChild(link);
|
||||
}
|
||||
export function loadCustomTheme(cssFileName: string) {
|
||||
const head = document.getElementsByTagName('head')[0];
|
||||
const link = document.createElement('link');
|
||||
link.id = cssFileName;
|
||||
link.rel = 'stylesheet';
|
||||
link.type = 'text/css';
|
||||
link.href = 'assets/styles/themes/' + cssFileName + '.css';
|
||||
link.media = 'all';
|
||||
head.appendChild(link);
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-root',
|
||||
templateUrl: './app.component.html',
|
||||
standalone: false,
|
||||
})
|
||||
export class AppComponent {
|
||||
constructor(
|
||||
@ -34,9 +35,12 @@ export class AppComponent {
|
||||
userPreferenceService: UserPreferenceService,
|
||||
renderer: Renderer2,
|
||||
private readonly _router: Router,
|
||||
private readonly _iconRegistry: MatIconRegistry,
|
||||
private readonly _sanitizer: DomSanitizer,
|
||||
private readonly _tenantsService: TenantsService,
|
||||
) {
|
||||
const config = getConfig<AppConfig>();
|
||||
renderer.addClass(document.body, userPreferenceService.getTheme());
|
||||
loadCustomTheme();
|
||||
|
||||
const removeQueryParams = _router.events.pipe(
|
||||
filter((event): event is NavigationEnd => event instanceof NavigationEnd),
|
||||
@ -47,9 +51,25 @@ export class AppComponent {
|
||||
);
|
||||
removeQueryParams.subscribe();
|
||||
|
||||
if (getConfig().IS_DOCUMINE) {
|
||||
document.getElementById('favicon').setAttribute('href', 'assets/icons/documine-logo.ico');
|
||||
}
|
||||
this._tenantsService
|
||||
.waitForSettingTenant()
|
||||
.pipe(
|
||||
tap(() => {
|
||||
const isDocumine = this._tenantsService.activeTenant.documine;
|
||||
const logo = isDocumine ? 'documine' : 'redaction';
|
||||
_iconRegistry.addSvgIconInNamespace(
|
||||
'iqser',
|
||||
'logo',
|
||||
_sanitizer.bypassSecurityTrustResourceUrl(`/assets/icons/general/${logo}-logo.svg`),
|
||||
);
|
||||
if (isDocumine) {
|
||||
document.getElementById('favicon').setAttribute('href', 'assets/icons/documine-logo.ico');
|
||||
}
|
||||
loadCustomTheme(isDocumine ? APP_TYPE_PATHS.SCM : APP_TYPE_PATHS.REDACT);
|
||||
}),
|
||||
take(1),
|
||||
)
|
||||
.subscribe();
|
||||
}
|
||||
|
||||
#removeKeycloakQueryParams() {
|
||||
|
||||
@ -1,12 +1,21 @@
|
||||
import { APP_BASE_HREF, DatePipe as BaseDatePipe } from '@angular/common';
|
||||
import { HTTP_INTERCEPTORS } from '@angular/common/http';
|
||||
import { ENVIRONMENT_INITIALIZER, ErrorHandler, inject, NgModule } from '@angular/core';
|
||||
import { ErrorHandler, inject, NgModule, provideEnvironmentInitializer } from '@angular/core';
|
||||
import { MatDividerModule } from '@angular/material/divider';
|
||||
import { MAT_TOOLTIP_DEFAULT_OPTIONS } from '@angular/material/tooltip';
|
||||
import { MatIcon } from '@angular/material/icon';
|
||||
import { MatMenu, MatMenuContent, MatMenuItem, MatMenuTrigger } from '@angular/material/menu';
|
||||
import { MatProgressSpinner } from '@angular/material/progress-spinner';
|
||||
import { MAT_TOOLTIP_DEFAULT_OPTIONS, MatTooltip } from '@angular/material/tooltip';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { ServiceWorkerModule } from '@angular/service-worker';
|
||||
import { ChevronButtonComponent } from '@common-ui/buttons/chevron-button';
|
||||
import { EmptyStateComponent } from '@common-ui/empty-state';
|
||||
import { HelpModeKey } from '@common-ui/help-mode/types';
|
||||
import { InputWithActionComponent } from '@common-ui/inputs/input-with-action/input-with-action.component';
|
||||
import { RoundCheckboxComponent } from '@common-ui/inputs/round-checkbox/round-checkbox.component';
|
||||
import { GET_TENANT_FROM_PATH_FN, UI_ROOT } from '@common-ui/utils';
|
||||
import { AuthErrorComponent } from '@components/auth-error/auth-error.component';
|
||||
import { BaseScreenComponent } from '@components/base-screen/base-screen.component';
|
||||
import { BreadcrumbsComponent } from '@components/breadcrumbs/breadcrumbs.component';
|
||||
import { DownloadsListScreenComponent } from '@components/downloads-list-screen/downloads-list-screen.component';
|
||||
@ -21,54 +30,51 @@ import { UserMenuComponent } from '@components/user-menu/user-menu.component';
|
||||
import { environment } from '@environments/environment';
|
||||
import {
|
||||
CachingModule,
|
||||
ChevronButtonComponent,
|
||||
CircleButtonComponent,
|
||||
EmptyStateComponent,
|
||||
HelpModeKey,
|
||||
HelpButtonComponent,
|
||||
HelpModeComponent,
|
||||
HiddenActionDirective,
|
||||
IconButtonComponent,
|
||||
InputWithActionComponent,
|
||||
IqserAllowDirective,
|
||||
IqserDenyDirective,
|
||||
IqserHelpModeModule,
|
||||
IqserListingModule,
|
||||
IqserLoadingModule,
|
||||
IqserTranslateModule,
|
||||
LanguageService,
|
||||
MAX_RETRIES_ON_SERVER_ERROR,
|
||||
RoundCheckboxComponent,
|
||||
SERVER_ERROR_SKIP_PATHS,
|
||||
ServerErrorInterceptor,
|
||||
StopPropagationDirective,
|
||||
} from '@iqser/common-ui';
|
||||
import { CommonUiModule } from '@iqser/common-ui/lib/common-ui.module';
|
||||
import { provideHelpMode } from '@iqser/common-ui/lib/help-mode/utils/help-mode.provider';
|
||||
import { LogoComponent, SkeletonComponent, ToastComponent } from '@iqser/common-ui/lib/shared';
|
||||
import { TenantsModule } from '@iqser/common-ui/lib/tenants';
|
||||
import { IqserUsersModule } from '@iqser/common-ui/lib/users';
|
||||
import { InitialsAvatarComponent, IqserUsersModule } from '@iqser/common-ui/lib/users';
|
||||
import { MonacoEditorModule } from '@materia-ui/ngx-monaco-editor';
|
||||
import { MissingTranslationHandler } from '@ngx-translate/core';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { AppConfig, ILoggerConfig } from '@red/domain';
|
||||
import { ConfigService } from '@services/config.service';
|
||||
import { ActiveDossiersService } from '@services/dossiers/active-dossiers.service';
|
||||
import { ArchivedDossiersService } from '@services/dossiers/archived-dossiers.service';
|
||||
import { GlobalErrorHandler } from '@services/global-error-handler.service';
|
||||
import { LoggerRulesService } from '@services/logger-rules.service';
|
||||
import { provideCustomDateFormatter } from '@shared/custom-date-formatting.provider';
|
||||
import { NavigateLastDossiersScreenDirective } from '@shared/directives/navigate-last-dossiers-screen.directive';
|
||||
import { DatePipe } from '@shared/pipes/date.pipe';
|
||||
import { SharedModule } from '@shared/shared.module';
|
||||
import { FileUploadDownloadModule } from '@upload-download/file-upload-download.module';
|
||||
import { RedRoleGuard } from '@users/red-role.guard';
|
||||
import { UserPreferenceService } from '@users/user-preference.service';
|
||||
import { UserService } from '@users/user.service';
|
||||
import { UI_CACHES } from '@utils/constants';
|
||||
import { REDMissingTranslationHandler } from '@utils/missing-translations-handler';
|
||||
import { ColorPickerService } from 'ngx-color-picker';
|
||||
import { LoggerModule, NGXLogger, NgxLoggerLevel, TOKEN_LOGGER_CONFIG, TOKEN_LOGGER_RULES_SERVICE } from 'ngx-logger';
|
||||
import { ToastrModule } from 'ngx-toastr';
|
||||
import * as helpModeKeys from '../assets/help-mode/help-mode-keys.json';
|
||||
import helpModeKeys from '../assets/help-mode/help-mode-keys.json';
|
||||
import { AppRoutingModule } from './app-routing.module';
|
||||
import { AppComponent } from './app.component';
|
||||
import { IconsModule } from './modules/icons/icons.module';
|
||||
import { PdfViewerModule } from './modules/pdf-viewer/pdf-viewer.module';
|
||||
import { ACTIVE_DOSSIERS_SERVICE, ARCHIVED_DOSSIERS_SERVICE } from './tokens';
|
||||
import { AuthErrorComponent } from '@components/auth-error/auth-error.component';
|
||||
|
||||
export const appModuleFactory = (config: AppConfig) => {
|
||||
@NgModule({
|
||||
@ -90,8 +96,6 @@ export const appModuleFactory = (config: AppConfig) => {
|
||||
imports: [
|
||||
BrowserModule,
|
||||
BrowserAnimationsModule,
|
||||
SharedModule,
|
||||
FileUploadDownloadModule,
|
||||
AppRoutingModule,
|
||||
MonacoEditorModule,
|
||||
CommonUiModule.forRoot({
|
||||
@ -104,7 +108,6 @@ export const appModuleFactory = (config: AppConfig) => {
|
||||
existingRoleGuard: RedRoleGuard,
|
||||
}),
|
||||
CachingModule.forRoot(UI_CACHES),
|
||||
IqserHelpModeModule.forRoot(helpModeKeys as HelpModeKey[]),
|
||||
PdfViewerModule,
|
||||
ToastrModule.forRoot({
|
||||
closeButton: true,
|
||||
@ -114,7 +117,7 @@ export const appModuleFactory = (config: AppConfig) => {
|
||||
resetTimeoutOnDuplicate: true,
|
||||
}),
|
||||
TenantsModule.forRoot(),
|
||||
IqserTranslateModule.forRoot({ pathPrefix: config.BASE_TRANSLATIONS_DIRECTORY || '/assets/i18n/redact/' }),
|
||||
IqserTranslateModule.forRoot({ pathPrefix: config.BASE_TRANSLATIONS_DIRECTORY }),
|
||||
IqserLoadingModule.forRoot(),
|
||||
ServiceWorkerModule.register('ngsw-worker.js', { enabled: environment.production }),
|
||||
LoggerModule.forRoot(undefined, {
|
||||
@ -132,20 +135,20 @@ export const appModuleFactory = (config: AppConfig) => {
|
||||
features: {
|
||||
ANNOTATIONS: {
|
||||
color: 'aqua',
|
||||
enabled: true,
|
||||
enabled: false,
|
||||
level: NgxLoggerLevel.DEBUG,
|
||||
},
|
||||
FILTERS: {
|
||||
enabled: false,
|
||||
},
|
||||
TENANTS: {
|
||||
enabled: true,
|
||||
enabled: false,
|
||||
},
|
||||
ROUTES: {
|
||||
enabled: true,
|
||||
enabled: false,
|
||||
},
|
||||
PDF: {
|
||||
enabled: true,
|
||||
enabled: false,
|
||||
},
|
||||
FILE: {
|
||||
enabled: false,
|
||||
@ -168,6 +171,9 @@ export const appModuleFactory = (config: AppConfig) => {
|
||||
DOSSIERS_CHANGES: {
|
||||
enabled: false,
|
||||
},
|
||||
GUARDS: {
|
||||
enabled: false,
|
||||
},
|
||||
},
|
||||
} as ILoggerConfig,
|
||||
},
|
||||
@ -186,6 +192,20 @@ export const appModuleFactory = (config: AppConfig) => {
|
||||
IconButtonComponent,
|
||||
MatDividerModule,
|
||||
ChevronButtonComponent,
|
||||
InitialsAvatarComponent,
|
||||
HelpModeComponent,
|
||||
HelpButtonComponent,
|
||||
MatMenuTrigger,
|
||||
MatMenuItem,
|
||||
MatIcon,
|
||||
MatMenu,
|
||||
MatMenuContent,
|
||||
MatTooltip,
|
||||
MatProgressSpinner,
|
||||
IconsModule,
|
||||
NavigateLastDossiersScreenDirective,
|
||||
DatePipe,
|
||||
TranslateModule,
|
||||
],
|
||||
providers: [
|
||||
{
|
||||
@ -213,18 +233,10 @@ export const appModuleFactory = (config: AppConfig) => {
|
||||
provide: ErrorHandler,
|
||||
useClass: GlobalErrorHandler,
|
||||
},
|
||||
{
|
||||
provide: ENVIRONMENT_INITIALIZER,
|
||||
multi: true,
|
||||
useValue: async () => {
|
||||
const languageService = inject(LanguageService);
|
||||
return languageService.setInitialLanguage();
|
||||
},
|
||||
},
|
||||
{
|
||||
provide: MissingTranslationHandler,
|
||||
useClass: REDMissingTranslationHandler,
|
||||
},
|
||||
provideEnvironmentInitializer(async () => {
|
||||
const languageService = inject(LanguageService);
|
||||
return languageService.setInitialLanguage();
|
||||
}),
|
||||
{
|
||||
provide: MAX_RETRIES_ON_SERVER_ERROR,
|
||||
useFactory: () => config.MAX_RETRIES_ON_SERVER_ERROR,
|
||||
@ -245,10 +257,14 @@ export const appModuleFactory = (config: AppConfig) => {
|
||||
provide: MAT_TOOLTIP_DEFAULT_OPTIONS,
|
||||
useValue: {
|
||||
disableTooltipInteractivity: true,
|
||||
showDelay: 1,
|
||||
},
|
||||
},
|
||||
BaseDatePipe,
|
||||
DatePipe,
|
||||
...provideCustomDateFormatter(),
|
||||
...provideHelpMode(helpModeKeys as HelpModeKey[]),
|
||||
ColorPickerService,
|
||||
],
|
||||
bootstrap: [AppComponent],
|
||||
})
|
||||
|
||||
@ -7,6 +7,7 @@ import { AppConfig } from '@red/domain';
|
||||
selector: 'redaction-auth-error',
|
||||
templateUrl: './auth-error.component.html',
|
||||
styleUrls: ['./auth-error.component.scss'],
|
||||
standalone: false,
|
||||
})
|
||||
export class AuthErrorComponent {
|
||||
readonly #config = getConfig<AppConfig>();
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
<redaction-breadcrumbs></redaction-breadcrumbs>
|
||||
</div>
|
||||
|
||||
<a [matTooltip]="'top-bar.navigation-items.back-to-dashboard' | translate" [routerLink]="['/']" class="logo">
|
||||
<a [matTooltip]="'top-bar.navigation-items.back-to-dashboard' | translate" [routerLink]="['/main']" class="logo">
|
||||
<div [attr.help-mode-key]="'home'" class="actions">
|
||||
<iqser-logo (iqserHiddenAction)="userPreferenceService.toggleDevFeatures()" icon="iqser:logo"></iqser-logo>
|
||||
<div class="app-name">{{ titleService.getTitle() }}</div>
|
||||
@ -25,7 +25,7 @@
|
||||
[placeholder]="'search.placeholder' | translate"
|
||||
></redaction-spotlight-search>
|
||||
|
||||
<iqser-help-button [attr.help-mode-key]="'help_mode'" id="help-mode-button"></iqser-help-button>
|
||||
<iqser-help-button [dialogButton]="false"></iqser-help-button>
|
||||
|
||||
<redaction-notifications
|
||||
*ngIf="currentUser.isUser || currentUser.isManager"
|
||||
|
||||
@ -8,8 +8,7 @@ import { SpotlightSearchAction } from '@components/spotlight-search/spotlight-se
|
||||
import { filter, map, startWith } from 'rxjs/operators';
|
||||
import { getConfig, IqserPermissionsService } from '@iqser/common-ui';
|
||||
import { BreadcrumbsService } from '@services/breadcrumbs.service';
|
||||
import { FeaturesService } from '@services/features.service';
|
||||
import { ARCHIVE_ROUTE, DOSSIERS_ARCHIVE, DOSSIERS_ROUTE } from '@red/domain';
|
||||
import { ARCHIVE_ROUTE, DOSSIERS_ROUTE } from '@red/domain';
|
||||
import { Roles } from '@users/roles';
|
||||
import { REDDocumentViewer } from '../../modules/pdf-viewer/services/document-viewer.service';
|
||||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||
@ -21,6 +20,7 @@ const isSearchScreen: (url: string) => boolean = url => url.includes('/search');
|
||||
@Component({
|
||||
templateUrl: './base-screen.component.html',
|
||||
styleUrls: ['./base-screen.component.scss'],
|
||||
standalone: false,
|
||||
})
|
||||
export class BaseScreenComponent {
|
||||
readonly roles = Roles;
|
||||
@ -36,7 +36,6 @@ export class BaseScreenComponent {
|
||||
{
|
||||
text: this._translateService.instant('search.active-dossiers'),
|
||||
icon: 'red:enter',
|
||||
hide: () => !this._featuresService.isEnabled(DOSSIERS_ARCHIVE),
|
||||
action: (query): void => this.#search(query, [], true),
|
||||
},
|
||||
{
|
||||
@ -58,7 +57,6 @@ export class BaseScreenComponent {
|
||||
private readonly _router: Router,
|
||||
activatedRoute: ActivatedRoute,
|
||||
private readonly _translateService: TranslateService,
|
||||
private readonly _featuresService: FeaturesService,
|
||||
readonly permissionsService: IqserPermissionsService,
|
||||
readonly userService: UserService,
|
||||
readonly userPreferenceService: UserPreferenceService,
|
||||
|
||||
@ -7,6 +7,7 @@ import { Breadcrumb, BreadcrumbDisplayType, BreadcrumbsService } from '@services
|
||||
selector: 'redaction-breadcrumbs',
|
||||
templateUrl: './breadcrumbs.component.html',
|
||||
styleUrls: ['./breadcrumbs.component.scss'],
|
||||
standalone: false,
|
||||
})
|
||||
export class BreadcrumbsComponent {
|
||||
constructor(readonly breadcrumbsService: BreadcrumbsService) {}
|
||||
|
||||
@ -13,6 +13,7 @@ import { firstValueFrom } from 'rxjs';
|
||||
entitiesService: FileDownloadService,
|
||||
component: DownloadsListScreenComponent,
|
||||
}),
|
||||
standalone: false,
|
||||
})
|
||||
export class DownloadsListScreenComponent extends ListingComponent<DownloadStatus> implements OnDestroy {
|
||||
readonly #interval: number;
|
||||
|
||||
@ -32,19 +32,18 @@
|
||||
</div>
|
||||
|
||||
<div
|
||||
(click)="markRead([notification], true)"
|
||||
(click)="handleMarkReadEvent($event, [notification], true)"
|
||||
*ngFor="let notification of group.notifications; trackBy: trackBy"
|
||||
[class.unread]="!notification.readDate"
|
||||
[id]="'notifications-mark-as-read-' + notification.id + '-btn'"
|
||||
class="notification"
|
||||
iqserStopPropagation
|
||||
mat-menu-item
|
||||
>
|
||||
<iqser-initials-avatar [user]="notification.userId"></iqser-initials-avatar>
|
||||
|
||||
<div class="notification-content">
|
||||
<div [innerHTML]="notification.message"></div>
|
||||
<div class="small-label mt-2">{{ notification.creationDate | date : 'exactDate' }}</div>
|
||||
<div class="small-label mt-2">{{ notification.creationDate | date: 'exactDate' }}</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
@ -52,7 +51,7 @@
|
||||
[id]="'notifications-mark-' + notification.id"
|
||||
class="dot"
|
||||
iqserStopPropagation
|
||||
matTooltip="{{ 'notifications.mark-as' | translate : { type: notification.readDate ? 'unread' : 'read' } }}"
|
||||
matTooltip="{{ 'notifications.mark-as' | translate: { type: notification.readDate ? 'unread' : 'read' } }}"
|
||||
matTooltipPosition="before"
|
||||
></div>
|
||||
</div>
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
}
|
||||
|
||||
.mat-mdc-menu-item.notification {
|
||||
padding: 8px 26px 10px 8px;
|
||||
padding: 8px 26px 10px 8px !important;
|
||||
margin: 2px 0 0 0;
|
||||
height: fit-content;
|
||||
position: relative;
|
||||
|
||||
@ -25,6 +25,7 @@ function chronologically(first: string, second: string) {
|
||||
selector: 'redaction-notifications',
|
||||
templateUrl: './notifications.component.html',
|
||||
styleUrls: ['./notifications.component.scss'],
|
||||
standalone: false,
|
||||
})
|
||||
export class NotificationsComponent {
|
||||
readonly hasUnreadNotifications$: Observable<boolean>;
|
||||
@ -58,6 +59,15 @@ export class NotificationsComponent {
|
||||
await this._notificationsService.toggleNotificationRead(notificationsIds, isRead);
|
||||
}
|
||||
|
||||
async handleMarkReadEvent(event: MouseEvent, notifications: Notification[] = this._notificationsService.all, isRead = true) {
|
||||
if (!(event.target as HTMLBaseElement).href) {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
await this.markRead(notifications, isRead);
|
||||
}
|
||||
|
||||
#groupNotifications(notifications: Notification[]): NotificationsGroup[] {
|
||||
const todayTranslation = this._translateService.instant('today');
|
||||
const groupedMap = notifications.groupBy(n => {
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
|
||||
.container {
|
||||
padding: 32px;
|
||||
width: 900px;
|
||||
width: 1000px;
|
||||
max-width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
@ -5,5 +5,6 @@ import { ChangeDetectionStrategy, Component } from '@angular/core';
|
||||
templateUrl: './dashboard-skeleton.component.html',
|
||||
styleUrls: ['./dashboard-skeleton.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
standalone: false,
|
||||
})
|
||||
export class DashboardSkeletonComponent {}
|
||||
|
||||
@ -5,6 +5,7 @@ import { ChangeDetectionStrategy, Component, OnInit, TemplateRef, ViewChild } fr
|
||||
templateUrl: './dossier-skeleton.component.html',
|
||||
styleUrls: ['./dossier-skeleton.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
standalone: false,
|
||||
})
|
||||
export class DossierSkeletonComponent implements OnInit {
|
||||
@ViewChild('workload1', { static: true }) workload1: TemplateRef<unknown>;
|
||||
|
||||
@ -5,5 +5,6 @@ import { ChangeDetectionStrategy, Component } from '@angular/core';
|
||||
templateUrl: './skeleton-stats.component.html',
|
||||
styleUrls: ['./skeleton-stats.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
standalone: false,
|
||||
})
|
||||
export class SkeletonStatsComponent {}
|
||||
|
||||
@ -6,6 +6,7 @@ import { Title } from '@angular/platform-browser';
|
||||
templateUrl: './skeleton-top-bar.component.html',
|
||||
styleUrls: ['./skeleton-top-bar.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
standalone: false,
|
||||
})
|
||||
export class SkeletonTopBarComponent {
|
||||
constructor(readonly titleService: Title) {}
|
||||
|
||||
@ -9,6 +9,7 @@ import { MatMenuTrigger } from '@angular/material/menu';
|
||||
templateUrl: './spotlight-search.component.html',
|
||||
styleUrls: ['./spotlight-search.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
standalone: false,
|
||||
})
|
||||
export class SpotlightSearchComponent {
|
||||
@Input() actions: readonly SpotlightSearchAction[];
|
||||
|
||||
@ -9,6 +9,7 @@ interface ITenant extends IStoredTenantId {
|
||||
selector: 'app-tenants-menu',
|
||||
templateUrl: './tenants-menu.component.html',
|
||||
styleUrls: ['./tenants-menu.component.scss'],
|
||||
standalone: false,
|
||||
})
|
||||
export class TenantsMenuComponent {
|
||||
readonly tenantsService = inject(TenantsService);
|
||||
|
||||
@ -20,6 +20,7 @@ interface MenuItem {
|
||||
selector: 'app-user-menu',
|
||||
templateUrl: './user-menu.component.html',
|
||||
styleUrls: ['./user-menu.component.scss'],
|
||||
standalone: false,
|
||||
})
|
||||
export class UserMenuComponent {
|
||||
readonly currentUser = getCurrentUser<User>();
|
||||
|
||||
@ -11,7 +11,9 @@ import { DictionaryService } from '@services/entity-services/dictionary.service'
|
||||
import { DefaultColorsService } from '@services/entity-services/default-colors.service';
|
||||
import { WatermarkService } from '@services/entity-services/watermark.service';
|
||||
import { FileAttributesService } from '@services/entity-services/file-attributes.service';
|
||||
import { getConfig } from '@iqser/common-ui';
|
||||
import { getConfig, Toaster } from '@iqser/common-ui';
|
||||
import { RulesService } from '../modules/admin/services/rules.service';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
|
||||
export function templateExistsWhenEnteringAdmin(): CanActivateFn {
|
||||
return async function (route: ActivatedRouteSnapshot): Promise<boolean> {
|
||||
@ -21,12 +23,14 @@ export function templateExistsWhenEnteringAdmin(): CanActivateFn {
|
||||
const defaultColorsService = inject(DefaultColorsService);
|
||||
const watermarksService = inject(WatermarkService);
|
||||
const router = inject(Router);
|
||||
const rulesService = inject(RulesService);
|
||||
const isDocumine = getConfig().IS_DOCUMINE;
|
||||
|
||||
const dossierTemplate = inject(DossierTemplateStatsService).get(dossierTemplateId);
|
||||
await firstValueFrom(fileAttributesService.loadFileAttributesConfig(dossierTemplateId));
|
||||
await firstValueFrom(dictionaryService.loadDictionaryDataForDossierTemplate(dossierTemplateId));
|
||||
await firstValueFrom(defaultColorsService.loadForDossierTemplate(dossierTemplateId));
|
||||
await firstValueFrom(rulesService.getFor(dossierTemplateId));
|
||||
if (!isDocumine) {
|
||||
await firstValueFrom(watermarksService.loadForDossierTemplate(dossierTemplateId));
|
||||
}
|
||||
@ -50,6 +54,8 @@ export function templateExistsWhenEnteringDossierList(): CanActivateFn {
|
||||
const dictionaryService = inject(DictionaryService);
|
||||
const defaultColorsService = inject(DefaultColorsService);
|
||||
const watermarksService = inject(WatermarkService);
|
||||
const rulesService = inject(RulesService);
|
||||
const toaster = inject(Toaster);
|
||||
const isDocumine = getConfig().IS_DOCUMINE;
|
||||
|
||||
await firstValueFrom(dashboardStatsService.loadForTemplate(dossierTemplateId));
|
||||
@ -64,6 +70,10 @@ export function templateExistsWhenEnteringDossierList(): CanActivateFn {
|
||||
await firstValueFrom(fileAttributesService.loadFileAttributesConfig(dossierTemplateId));
|
||||
await firstValueFrom(dictionaryService.loadDictionaryDataForDossierTemplate(dossierTemplateId));
|
||||
await firstValueFrom(defaultColorsService.loadForDossierTemplate(dossierTemplateId));
|
||||
const rules = await firstValueFrom(rulesService.getFor(dossierTemplateId));
|
||||
if (rules.timeoutDetected) {
|
||||
toaster.error(_('dossier-listing.rules.timeoutError'));
|
||||
}
|
||||
if (!isDocumine) {
|
||||
await firstValueFrom(watermarksService.loadForDossierTemplate(dossierTemplateId));
|
||||
}
|
||||
|
||||
@ -1,8 +0,0 @@
|
||||
import { inject } from '@angular/core';
|
||||
import { CanDeactivateFn } from '@angular/router';
|
||||
import { FileAttributesService } from '@services/entity-services/file-attributes.service';
|
||||
import { DossierOverviewScreenComponent } from '../modules/dossier-overview/screen/dossier-overview-screen.component';
|
||||
|
||||
// TODO: rename to something like "isNotEditingFileAttributeGuard"
|
||||
export const editAttributeGuard: CanDeactivateFn<DossierOverviewScreenComponent> = () =>
|
||||
!inject(FileAttributesService).isEditingFileAttribute();
|
||||
7
apps/red-ui/src/app/guards/file-attribute.guard.ts
Normal file
7
apps/red-ui/src/app/guards/file-attribute.guard.ts
Normal file
@ -0,0 +1,7 @@
|
||||
import { inject } from '@angular/core';
|
||||
import { CanDeactivateFn } from '@angular/router';
|
||||
import { FileAttributesService } from '@services/entity-services/file-attributes.service';
|
||||
import DossierOverviewScreenComponent from '../modules/dossier-overview/screen/dossier-overview-screen.component';
|
||||
|
||||
export const isNotEditingFileAttributeGuard: CanDeactivateFn<DossierOverviewScreenComponent> = () =>
|
||||
!inject(FileAttributesService).isEditingFileAttribute();
|
||||
@ -40,8 +40,7 @@ export function ifLoggedIn(): AsyncGuard {
|
||||
|
||||
logger.info('[KEYCLOAK] Keycloak init...');
|
||||
await keycloakInitializer(tenant);
|
||||
logger.info('[KEYCLOAK] Keycloak init done!');
|
||||
console.log({ tenant });
|
||||
logger.info('[KEYCLOAK] Keycloak init done for tenant: ', { tenant });
|
||||
await tenantsService.selectTenant(tenant);
|
||||
await usersService.initialize();
|
||||
await licenseService.loadLicenses();
|
||||
@ -51,6 +50,7 @@ export function ifLoggedIn(): AsyncGuard {
|
||||
const jwtToken = jwtDecode(token) as JwtToken;
|
||||
const authTime = (jwtToken.auth_time || jwtToken.iat).toString();
|
||||
localStorage.setItem('authTime', authTime);
|
||||
localStorage.setItem('token', token);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ActivatedRouteSnapshot, CanActivate } from '@angular/router';
|
||||
import { firstValueFrom } from 'rxjs';
|
||||
import { EntityPermissionsService } from '@services/entity-permissions/entity-permissions.service';
|
||||
import { firstValueFrom } from 'rxjs';
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class PermissionsGuard implements CanActivate {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { AnnotationPermissions } from '@models/file/annotation.permissions';
|
||||
import { AnnotationWrapper } from '@models/file/annotation.wrapper';
|
||||
import { Dictionary } from '@red/domain';
|
||||
import { Dictionary, SuperTypes } from '@red/domain';
|
||||
|
||||
export const canUndo = (annotation: AnnotationWrapper, isApprover: boolean) => !isApprover && annotation.pending;
|
||||
|
||||
@ -8,15 +8,15 @@ export const canForceHint = (annotation: AnnotationWrapper, canAddRedaction: boo
|
||||
canAddRedaction && annotation.isIgnoredHint && !annotation.pending;
|
||||
|
||||
export const canForceRedaction = (annotation: AnnotationWrapper, canAddRedaction: boolean) =>
|
||||
canAddRedaction && annotation.isSkipped && !annotation.isFalsePositive && !annotation.pending;
|
||||
canAddRedaction &&
|
||||
(annotation.isSkipped || (annotation.IMAGE_HINT && annotation.superType === SuperTypes.Hint)) &&
|
||||
!annotation.isFalsePositive &&
|
||||
!annotation.pending;
|
||||
|
||||
export const canAcceptRecommendation = (annotation: AnnotationWrapper) => annotation.isRecommendation && !annotation.pending;
|
||||
|
||||
export const canMarkAsFalsePositive = (annotation: AnnotationWrapper, annotationEntity: Dictionary) =>
|
||||
annotation.canBeMarkedAsFalsePositive &&
|
||||
!annotation.hasBeenForcedRedaction &&
|
||||
!annotation.hasBeenResizedLocally &&
|
||||
annotationEntity?.hasDictionary;
|
||||
annotation.canBeMarkedAsFalsePositive && !annotation.hasBeenResizedLocally && annotationEntity?.hasDictionary;
|
||||
|
||||
export const canRemoveOnlyHere = (annotation: AnnotationWrapper, canAddRedaction: boolean, autoAnalysisDisabled: boolean) =>
|
||||
canAddRedaction &&
|
||||
@ -24,11 +24,10 @@ export const canRemoveOnlyHere = (annotation: AnnotationWrapper, canAddRedaction
|
||||
(annotation.isRedacted || (annotation.isHint && !annotation.isImage));
|
||||
|
||||
export const canRemoveFromDictionary = (annotation: AnnotationWrapper, autoAnalysisDisabled: boolean) =>
|
||||
annotation.isModifyDictionary &&
|
||||
(annotation.isModifyDictionary || annotation.engines.includes('DICTIONARY') || annotation.engines.includes('DOSSIER_DICTIONARY')) &&
|
||||
(annotation.isRedacted || annotation.isSkipped || annotation.isHint || (annotation.isIgnoredHint && !annotation.isRuleBased)) &&
|
||||
(autoAnalysisDisabled || !annotation.pending) &&
|
||||
!annotation.hasBeenResizedLocally &&
|
||||
!(annotation.hasBeenForcedHint || annotation.hasBeenForcedRedaction);
|
||||
annotation.isDictBased;
|
||||
|
||||
export const canRemoveRedaction = (annotation: AnnotationWrapper, permissions: AnnotationPermissions) =>
|
||||
(!annotation.isIgnoredHint || !annotation.isRuleBased) &&
|
||||
@ -70,3 +69,5 @@ export const canEditHint = (annotation: AnnotationWrapper) =>
|
||||
((annotation.isHint && !annotation.isRuleBased) || annotation.isIgnoredHint) && !annotation.isImage;
|
||||
|
||||
export const canEditImage = (annotation: AnnotationWrapper) => annotation.isImage;
|
||||
|
||||
export const canRevertChanges = (annotation: AnnotationWrapper) => annotation.hasRedactionChanges;
|
||||
|
||||
@ -17,6 +17,7 @@ import {
|
||||
canRemoveRedaction,
|
||||
canResizeAnnotation,
|
||||
canResizeInDictionary,
|
||||
canRevertChanges,
|
||||
canUndo,
|
||||
} from './annotation-permissions.utils';
|
||||
import { AnnotationWrapper } from './annotation.wrapper';
|
||||
@ -37,6 +38,7 @@ export class AnnotationPermissions {
|
||||
canEditAnnotations = true;
|
||||
canEditHints = true;
|
||||
canEditImages = true;
|
||||
canRevertChanges = true;
|
||||
|
||||
static forUser(
|
||||
isApprover: boolean,
|
||||
@ -75,6 +77,7 @@ export class AnnotationPermissions {
|
||||
permissions.canEditAnnotations = canEditAnnotation(annotation);
|
||||
permissions.canEditHints = canEditHint(annotation);
|
||||
permissions.canEditImages = canEditImage(annotation);
|
||||
permissions.canRevertChanges = canRevertChanges(annotation);
|
||||
summedPermissions._merge(permissions);
|
||||
}
|
||||
return summedPermissions;
|
||||
@ -97,6 +100,7 @@ export class AnnotationPermissions {
|
||||
result.canEditAnnotations = permissions.reduce((acc, next) => acc && next.canEditAnnotations, true);
|
||||
result.canEditHints = permissions.reduce((acc, next) => acc && next.canEditHints, true);
|
||||
result.canEditImages = permissions.reduce((acc, next) => acc && next.canEditImages, true);
|
||||
result.canRevertChanges = permissions.reduce((acc, next) => acc && next.canRevertChanges, true);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@ -26,6 +26,12 @@ import {
|
||||
} from '@red/domain';
|
||||
import { annotationTypesTranslations } from '@translations/annotation-types-translations';
|
||||
|
||||
interface AnnotationContent {
|
||||
translation: string;
|
||||
params: { [key: string]: string };
|
||||
untranslatedContent: string;
|
||||
}
|
||||
|
||||
export class AnnotationWrapper implements IListable {
|
||||
id: string;
|
||||
superType: SuperType;
|
||||
@ -34,9 +40,9 @@ export class AnnotationWrapper implements IListable {
|
||||
typeLabel?: string;
|
||||
color: string;
|
||||
numberOfComments = 0;
|
||||
firstTopLeftPoint: IPoint;
|
||||
firstBottomLeftPoint: IPoint;
|
||||
shortContent: string;
|
||||
content: string;
|
||||
content: AnnotationContent;
|
||||
value: string;
|
||||
pageNumber: number;
|
||||
dictionaryOperation = false;
|
||||
@ -74,7 +80,18 @@ export class AnnotationWrapper implements IListable {
|
||||
}
|
||||
|
||||
get isDictBased() {
|
||||
return this.engines.includes(LogEntryEngines.DICTIONARY);
|
||||
return [LogEntryEngines.DICTIONARY, LogEntryEngines.DOSSIER_DICTIONARY].some(engine => this.engines.includes(engine));
|
||||
}
|
||||
|
||||
get isRedactedImageHint() {
|
||||
return (
|
||||
(this.IMAGE_HINT && this.superType === SuperTypes.Redaction) ||
|
||||
(this.IMAGE_HINT && this.superType === SuperTypes.ManualRedaction)
|
||||
);
|
||||
}
|
||||
|
||||
get isSkippedImageHint() {
|
||||
return this.IMAGE_HINT && this.superType === SuperTypes.Hint;
|
||||
}
|
||||
|
||||
get searchKey(): string {
|
||||
@ -95,7 +112,10 @@ export class AnnotationWrapper implements IListable {
|
||||
|
||||
get canBeMarkedAsFalsePositive() {
|
||||
return (
|
||||
(this.isRecommendation || this.superType === SuperTypes.Redaction || (this.isSkipped && this.isDictBased)) &&
|
||||
(this.isRecommendation ||
|
||||
this.superType === SuperTypes.Redaction ||
|
||||
(this.isSkipped && this.isDictBased) ||
|
||||
(this.isRemovedLocally && this.isDictBased)) &&
|
||||
!this.isImage &&
|
||||
!this.imported &&
|
||||
!this.pending &&
|
||||
@ -179,11 +199,11 @@ export class AnnotationWrapper implements IListable {
|
||||
}
|
||||
|
||||
get x() {
|
||||
return this.firstTopLeftPoint.x;
|
||||
return this.firstBottomLeftPoint.x;
|
||||
}
|
||||
|
||||
get y() {
|
||||
return this.firstTopLeftPoint.y;
|
||||
return this.firstBottomLeftPoint.y;
|
||||
}
|
||||
|
||||
get legalBasis() {
|
||||
@ -208,7 +228,7 @@ export class AnnotationWrapper implements IListable {
|
||||
annotationWrapper.value = 'Imported';
|
||||
annotationWrapper.color = earmark.hexColor;
|
||||
annotationWrapper.positions = earmark.positions;
|
||||
annotationWrapper.firstTopLeftPoint = earmark.positions[0]?.topLeft;
|
||||
annotationWrapper.firstBottomLeftPoint = earmark.positions[0]?.topLeft;
|
||||
annotationWrapper.superTypeLabel = annotationTypesTranslations[annotationWrapper.superType];
|
||||
|
||||
return annotationWrapper;
|
||||
@ -229,7 +249,7 @@ export class AnnotationWrapper implements IListable {
|
||||
annotationWrapper.isChangeLogEntry = logEntry.state === EntryStates.REMOVED || !!changeLogType;
|
||||
annotationWrapper.type = logEntry.type;
|
||||
annotationWrapper.value = logEntry.value;
|
||||
annotationWrapper.firstTopLeftPoint = { x: logEntry.positions[0].rectangle[0], y: logEntry.positions[0].rectangle[1] };
|
||||
annotationWrapper.firstBottomLeftPoint = { x: logEntry.positions[0].rectangle[0], y: logEntry.positions[0].rectangle[1] };
|
||||
annotationWrapper.pageNumber = logEntry.positions[0].pageNumber;
|
||||
annotationWrapper.positions = logEntry.positions.map(p => ({
|
||||
page: p.pageNumber,
|
||||
@ -262,16 +282,16 @@ export class AnnotationWrapper implements IListable {
|
||||
annotationWrapper.hasLegalBasisChanged = !!logEntry.manualChanges?.find(
|
||||
c => c.manualRedactionType === ManualRedactionTypes.LEGAL_BASIS_CHANGE,
|
||||
);
|
||||
annotationWrapper.hasBeenForcedHint = !!logEntry.manualChanges?.find(c => c.manualRedactionType === ManualRedactionTypes.FORCE);
|
||||
annotationWrapper.hasBeenForcedRedaction = !!logEntry.manualChanges?.find(
|
||||
c => c.manualRedactionType === ManualRedactionTypes.FORCE,
|
||||
);
|
||||
annotationWrapper.hasBeenForcedHint =
|
||||
!!logEntry.manualChanges?.find(c => c.manualRedactionType === ManualRedactionTypes.FORCE) && annotationWrapper.HINT;
|
||||
annotationWrapper.hasBeenForcedRedaction =
|
||||
!!logEntry.manualChanges?.find(c => c.manualRedactionType === ManualRedactionTypes.FORCE) && !annotationWrapper.HINT;
|
||||
annotationWrapper.hasBeenRemovedByManualOverride = !!logEntry.manualChanges?.find(
|
||||
c => c.manualRedactionType === ManualRedactionTypes.REMOVE,
|
||||
);
|
||||
|
||||
const content = this.#createContent(annotationWrapper, logEntry, isDocumine);
|
||||
annotationWrapper.shortContent = this.#getShortContent(annotationWrapper, legalBasisList) || content;
|
||||
annotationWrapper.shortContent = this.#getShortContent(annotationWrapper, legalBasisList) || content.untranslatedContent;
|
||||
annotationWrapper.content = content;
|
||||
|
||||
const lastRelevantManualChange = logEntry.manualChanges?.at(-1);
|
||||
@ -291,7 +311,10 @@ export class AnnotationWrapper implements IListable {
|
||||
} else {
|
||||
const colorKey = annotationEntityColorConfig[annotationWrapper.superType];
|
||||
const defaultColor = annotationDefaultColorConfig[annotationWrapper.superType];
|
||||
annotationWrapper.color = dictionary ? (dictionary[colorKey] as string) : (defaultColors[defaultColor] as string);
|
||||
annotationWrapper.color =
|
||||
dictionary && !annotationWrapper.isRedactedImageHint
|
||||
? (dictionary[colorKey] as string)
|
||||
: (defaultColors[defaultColor] as string);
|
||||
}
|
||||
|
||||
annotationWrapper.entry = logEntry;
|
||||
@ -300,44 +323,62 @@ export class AnnotationWrapper implements IListable {
|
||||
}
|
||||
|
||||
static #createContent(annotationWrapper: AnnotationWrapper, logEntry: IEntityLogEntry, isDocumine: boolean) {
|
||||
let content = '';
|
||||
let untranslatedContent = '';
|
||||
const params: { [key: string]: string } = {};
|
||||
if (logEntry.matchedRule) {
|
||||
content += `Rule ${logEntry.matchedRule} matched${isDocumine ? ':' : ''} \n\n`;
|
||||
params['hasRule'] = 'true';
|
||||
params['matchedRule'] = logEntry.matchedRule.replace(/(^[, ]*)|([, ]*$)/g, '');
|
||||
params['ruleSymbol'] = isDocumine ? ':' : '';
|
||||
|
||||
untranslatedContent += `Rule ${logEntry.matchedRule} matched${isDocumine ? ':' : ''} \n\n`;
|
||||
}
|
||||
|
||||
if (logEntry.reason) {
|
||||
params['hasReason'] = 'true';
|
||||
if (isDocumine && logEntry.reason.slice(-1) === '.') {
|
||||
logEntry.reason = logEntry.reason.slice(0, -1);
|
||||
}
|
||||
|
||||
content += logEntry.reason + '\n\n';
|
||||
if (!params['hasRule']) {
|
||||
params['reason'] = logEntry.reason.substring(0, 1).toUpperCase() + logEntry.reason.substring(1);
|
||||
} else {
|
||||
params['reason'] = logEntry.reason;
|
||||
}
|
||||
params['reason'] = params['reason'].replace(/(^[, ]*)|([, ]*$)/g, '');
|
||||
untranslatedContent += logEntry.reason + '\n\n';
|
||||
//remove leading and trailing commas and whitespaces
|
||||
content = content.replace(/(^[, ]*)|([, ]*$)/g, '');
|
||||
content = content.substring(0, 1).toUpperCase() + content.substring(1);
|
||||
untranslatedContent = untranslatedContent.replace(/(^[, ]*)|([, ]*$)/g, '');
|
||||
untranslatedContent = untranslatedContent.substring(0, 1).toUpperCase() + untranslatedContent.substring(1);
|
||||
}
|
||||
|
||||
if (annotationWrapper.legalBasis && !isDocumine) {
|
||||
content += 'Legal basis: ' + annotationWrapper.legalBasis + '\n\n';
|
||||
params['hasLb'] = 'true';
|
||||
params['legalBasis'] = annotationWrapper.legalBasis;
|
||||
untranslatedContent += 'Legal basis: ' + annotationWrapper.legalBasis + '\n\n';
|
||||
}
|
||||
|
||||
if (annotationWrapper.hasBeenRemovedByManualOverride) {
|
||||
content += 'Removed by manual override';
|
||||
params['hasOverride'] = 'true';
|
||||
untranslatedContent += 'Removed by manual override';
|
||||
}
|
||||
|
||||
if (logEntry.section) {
|
||||
params['hasSection'] = 'true';
|
||||
params['sectionSymbol'] = isDocumine ? '' : ':';
|
||||
params['shouldLower'] = untranslatedContent.length.toString();
|
||||
params['section'] = logEntry.section;
|
||||
let prefix = `In section${isDocumine ? '' : ':'} `;
|
||||
if (content.length) {
|
||||
if (untranslatedContent.length) {
|
||||
prefix = ` ${prefix.toLowerCase()}`;
|
||||
}
|
||||
content += `${prefix} "${logEntry.section}"`;
|
||||
untranslatedContent += `${prefix} "${logEntry.section}"`;
|
||||
}
|
||||
|
||||
return content;
|
||||
return { translation: _('annotation-content'), params: params, untranslatedContent: untranslatedContent };
|
||||
}
|
||||
|
||||
static #getShortContent(annotationWrapper: AnnotationWrapper, legalBasisList: ILegalBasis[]) {
|
||||
if (annotationWrapper.legalBasis) {
|
||||
const lb = legalBasisList.find(lbm => lbm.reason?.toLowerCase().includes(annotationWrapper.legalBasis.toLowerCase()));
|
||||
const lb = legalBasisList.find(lbm => lbm.technicalName?.toLowerCase().includes(annotationWrapper.legalBasis.toLowerCase()));
|
||||
if (lb) {
|
||||
return lb.name;
|
||||
}
|
||||
|
||||
@ -4,6 +4,10 @@ import { IqserPermissionsService } from '@iqser/common-ui';
|
||||
import { Roles } from '@users/roles';
|
||||
import { User } from '@red/domain';
|
||||
import { getCurrentUser } from '@iqser/common-ui/lib/users';
|
||||
import { SideNavComponent } from '@common-ui/shared';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { NgForOf, NgIf } from '@angular/common';
|
||||
import { RouterLink, RouterLinkActive } from '@angular/router';
|
||||
|
||||
interface NavItem {
|
||||
readonly label: string;
|
||||
@ -17,6 +21,7 @@ interface NavItem {
|
||||
templateUrl: './account-side-nav.component.html',
|
||||
styleUrls: ['./account-side-nav.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
imports: [SideNavComponent, TranslateModule, NgForOf, NgIf, RouterLinkActive, RouterLink],
|
||||
})
|
||||
export class AccountSideNavComponent {
|
||||
readonly currentUser = getCurrentUser<User>();
|
||||
|
||||
@ -1,28 +0,0 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { SharedModule } from '@shared/shared.module';
|
||||
import { AccountRoutingModule } from './account-routing.module';
|
||||
import { AccountSideNavComponent } from './account-side-nav/account-side-nav.component';
|
||||
import { BaseAccountScreenComponent } from './base-account-screen/base-account-screen-component';
|
||||
import { NotificationPreferencesService } from './services/notification-preferences.service';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { IconButtonComponent, IqserAllowDirective, IqserHelpModeModule } from '@iqser/common-ui';
|
||||
import { PreferencesComponent } from './screens/preferences/preferences.component';
|
||||
import { SideNavComponent } from '@iqser/common-ui/lib/shared';
|
||||
import { DialogDefaultsComponent } from './screens/preferences/dialog-defaults/dialog-defaults.component';
|
||||
|
||||
@NgModule({
|
||||
declarations: [AccountSideNavComponent, BaseAccountScreenComponent, PreferencesComponent, DialogDefaultsComponent],
|
||||
imports: [
|
||||
CommonModule,
|
||||
SharedModule,
|
||||
AccountRoutingModule,
|
||||
TranslateModule,
|
||||
IqserHelpModeModule,
|
||||
IconButtonComponent,
|
||||
SideNavComponent,
|
||||
IqserAllowDirective,
|
||||
],
|
||||
providers: [NotificationPreferencesService],
|
||||
})
|
||||
export class AccountModule {}
|
||||
@ -1,13 +1,13 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { CompositeRouteGuard, IqserPermissionsGuard, IqserRoutes } from '@iqser/common-ui';
|
||||
import { RedRoleGuard } from '@users/red-role.guard';
|
||||
import { BaseAccountScreenComponent } from './base-account-screen/base-account-screen-component';
|
||||
import { PreferencesComponent } from './screens/preferences/preferences.component';
|
||||
import { Roles } from '@users/roles';
|
||||
import { IqserAuthGuard } from '@iqser/common-ui/lib/users';
|
||||
import { PendingChangesGuard } from '@guards/can-deactivate.guard';
|
||||
import { NotificationPreferencesService } from './services/notification-preferences.service';
|
||||
|
||||
const routes: IqserRoutes = [
|
||||
export default [
|
||||
{ path: '', redirectTo: 'user-profile', pathMatch: 'full' },
|
||||
{
|
||||
path: 'user-profile',
|
||||
@ -16,12 +16,13 @@ const routes: IqserRoutes = [
|
||||
data: {
|
||||
routeGuards: [IqserAuthGuard, RedRoleGuard],
|
||||
},
|
||||
loadChildren: () => import('./screens/user-profile/user-profile.module').then(m => m.UserProfileModule),
|
||||
loadChildren: () => import('./screens/user-profile/user-profile.routes'),
|
||||
},
|
||||
{
|
||||
path: 'notifications',
|
||||
component: BaseAccountScreenComponent,
|
||||
canActivate: [CompositeRouteGuard, IqserPermissionsGuard],
|
||||
canDeactivate: [PendingChangesGuard],
|
||||
data: {
|
||||
routeGuards: [IqserAuthGuard, RedRoleGuard],
|
||||
permissions: {
|
||||
@ -29,7 +30,8 @@ const routes: IqserRoutes = [
|
||||
redirectTo: '/',
|
||||
},
|
||||
},
|
||||
loadChildren: () => import('./screens/notifications/notifications.module').then(m => m.NotificationsModule),
|
||||
providers: [NotificationPreferencesService],
|
||||
loadChildren: () => import('./screens/notifications/notifications.routes'),
|
||||
},
|
||||
{
|
||||
path: 'preferences',
|
||||
@ -61,10 +63,4 @@ const routes: IqserRoutes = [
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class AccountRoutingModule {}
|
||||
] satisfies IqserRoutes;
|
||||
@ -7,11 +7,12 @@
|
||||
<div class="content-inner">
|
||||
<div class="content-container full-height">
|
||||
<div class="overlay-shadow"></div>
|
||||
<div class="dialog">
|
||||
<div class="dialog-header">
|
||||
<div class="heading-l" [translate]="translations[path]"></div>
|
||||
</div>
|
||||
|
||||
<div [ngClass]="!isWarningsScreen && 'dialog'">
|
||||
@if (!isWarningsScreen) {
|
||||
<div class="dialog-header">
|
||||
<div class="heading-l" [translate]="translations[path]"></div>
|
||||
</div>
|
||||
}
|
||||
<router-outlet></router-outlet>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1,26 +1,35 @@
|
||||
import { ChangeDetectionStrategy, Component, OnInit, ViewContainerRef } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { Router, RouterOutlet } from '@angular/router';
|
||||
import { accountTranslations } from '@translations/account-translations';
|
||||
import { NgClass } from '@angular/common';
|
||||
import { AccountSideNavComponent } from '../account-side-nav/account-side-nav.component';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-base-account-screen',
|
||||
templateUrl: './base-account-screen-component.html',
|
||||
styleUrls: ['./base-account-screen-component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
imports: [NgClass, RouterOutlet, AccountSideNavComponent, TranslateModule],
|
||||
})
|
||||
export class BaseAccountScreenComponent implements OnInit {
|
||||
readonly translations = accountTranslations;
|
||||
readonly path: string;
|
||||
readonly isWarningsScreen: boolean;
|
||||
|
||||
constructor(private readonly _router: Router, private readonly _hostRef: ViewContainerRef) {
|
||||
constructor(
|
||||
private readonly _router: Router,
|
||||
private readonly _hostRef: ViewContainerRef,
|
||||
) {
|
||||
this.path = this._router.url.split('/').pop();
|
||||
this.isWarningsScreen = this.path === 'warnings-preferences';
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this._setDialogWidth();
|
||||
this.#setDialogWidth();
|
||||
}
|
||||
|
||||
private _setDialogWidth() {
|
||||
#setDialogWidth() {
|
||||
const element = this._hostRef.element.nativeElement as HTMLElement;
|
||||
element.style.setProperty('--width', this.path === 'user-profile' ? 'unset' : '100%');
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, inject, OnInit } from '@angular/core';
|
||||
import { UntypedFormBuilder } from '@angular/forms';
|
||||
import { ReactiveFormsModule, UntypedFormBuilder } from '@angular/forms';
|
||||
import { NotificationPreferencesService } from '../../../services/notification-preferences.service';
|
||||
import { BaseFormComponent, getConfig, LoadingService, Toaster } from '@iqser/common-ui';
|
||||
import { BaseFormComponent, getConfig, IconButtonComponent, LoadingService, Toaster } from '@iqser/common-ui';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import {
|
||||
DocumentNotificationsTypes,
|
||||
@ -14,6 +14,10 @@ import {
|
||||
import { firstValueFrom } from 'rxjs';
|
||||
import { notificationsSettingsTranslations } from '@translations/notifications-settings-translations';
|
||||
import { getCurrentUser } from '@iqser/common-ui/lib/users';
|
||||
import { NgForOf, NgIf } from '@angular/common';
|
||||
import { MatSlideToggle } from '@angular/material/slide-toggle';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { MatCheckbox } from '@angular/material/checkbox';
|
||||
|
||||
const RSS_EXCLUDED_SETTINGS = ['USER_PROMOTED_TO_APPROVER', 'USER_DEGRADED_TO_REVIEWER', 'ASSIGN_REVIEWER'];
|
||||
|
||||
@ -21,6 +25,7 @@ const RSS_EXCLUDED_SETTINGS = ['USER_PROMOTED_TO_APPROVER', 'USER_DEGRADED_TO_RE
|
||||
templateUrl: './notifications-screen.component.html',
|
||||
styleUrls: ['./notifications-screen.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
imports: [ReactiveFormsModule, NgForOf, MatSlideToggle, TranslateModule, NgIf, MatCheckbox, IconButtonComponent],
|
||||
})
|
||||
export class NotificationsScreenComponent extends BaseFormComponent implements OnInit {
|
||||
readonly #toaster = inject(Toaster);
|
||||
|
||||
@ -1,16 +0,0 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { SharedModule } from '@shared/shared.module';
|
||||
import { NotificationsScreenComponent } from './notifications-screen/notifications-screen.component';
|
||||
import { PendingChangesGuard } from '@guards/can-deactivate.guard';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { IconButtonComponent } from '@iqser/common-ui';
|
||||
|
||||
const routes = [{ path: '', component: NotificationsScreenComponent, canDeactivate: [PendingChangesGuard] }];
|
||||
|
||||
@NgModule({
|
||||
declarations: [NotificationsScreenComponent],
|
||||
imports: [RouterModule.forChild(routes), CommonModule, SharedModule, TranslateModule, IconButtonComponent],
|
||||
})
|
||||
export class NotificationsModule {}
|
||||
@ -0,0 +1,11 @@
|
||||
import { NotificationsScreenComponent } from './notifications-screen/notifications-screen.component';
|
||||
import { PendingChangesGuard } from '@guards/can-deactivate.guard';
|
||||
import { IqserRoutes } from '@iqser/common-ui';
|
||||
|
||||
export default [
|
||||
{
|
||||
path: '',
|
||||
component: NotificationsScreenComponent,
|
||||
canDeactivate: [PendingChangesGuard],
|
||||
},
|
||||
] satisfies IqserRoutes;
|
||||
@ -1,77 +1,79 @@
|
||||
<form [formGroup]="form">
|
||||
<div class="dialog-content">
|
||||
<h1>{{ 'dialog-defaults-form.title' | translate }}</h1>
|
||||
<h2>{{ 'dialog-defaults-form.redaction.title' | translate }}</h2>
|
||||
<div class="iqser-input-group w-450">
|
||||
<label translate="dialog-defaults-form.redaction.add-dialog"></label>
|
||||
<mat-form-field>
|
||||
<mat-select formControlName="addRedaction">
|
||||
<mat-option *ngFor="let option of redactionAddOptions" [value]="option.value">{{
|
||||
option.label | translate
|
||||
}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-checkbox *ngIf="displayExtraOptionAddRedaction" formControlName="addRedactionApplyToAll">{{
|
||||
'dialog-defaults-form.extra-option-label' | translate
|
||||
}}</mat-checkbox>
|
||||
<div class="dialog">
|
||||
<form [formGroup]="form">
|
||||
<div class="dialog-content">
|
||||
<h1>{{ 'dialog-defaults-form.title' | translate }}</h1>
|
||||
<h3>{{ 'dialog-defaults-form.redaction.title' | translate }}</h3>
|
||||
<div class="iqser-input-group w-450">
|
||||
<label translate="dialog-defaults-form.redaction.add-dialog"></label>
|
||||
<mat-form-field>
|
||||
<mat-select formControlName="addRedaction">
|
||||
<mat-option *ngFor="let option of redactionAddOptions" [value]="option.value">{{
|
||||
option.label | translate
|
||||
}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-checkbox *ngIf="displayExtraOptionAddRedaction" formControlName="addRedactionApplyToAll">{{
|
||||
'dialog-defaults-form.extra-option-label' | translate
|
||||
}}</mat-checkbox>
|
||||
</div>
|
||||
<div class="iqser-input-group w-450">
|
||||
<label translate="dialog-defaults-form.redaction.remove-dialog"></label>
|
||||
<mat-form-field>
|
||||
<mat-select formControlName="removeRedaction">
|
||||
<mat-option *ngFor="let option of redactionRemoveOptions" [value]="option.value">{{
|
||||
option.label | translate
|
||||
}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-checkbox *ngIf="displayExtraOptionRemoveRedaction" formControlName="removeRedactionApplyToAll">{{
|
||||
'dialog-defaults-form.extra-option-label' | translate
|
||||
}}</mat-checkbox>
|
||||
</div>
|
||||
<h3>{{ 'dialog-defaults-form.recommendation.title' | translate }}</h3>
|
||||
<div class="iqser-input-group w-450">
|
||||
<label translate="dialog-defaults-form.recommendation.remove-dialog"></label>
|
||||
<mat-form-field>
|
||||
<mat-select formControlName="removeRecommendation">
|
||||
<mat-option *ngFor="let option of recommendationRemoveOptions" [value]="option.value">{{
|
||||
option.label | translate
|
||||
}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-checkbox *ngIf="displayExtraOptionRemoveRecommendation" formControlName="removeRecommendationApplyToAll">{{
|
||||
'dialog-defaults-form.extra-option-label' | translate
|
||||
}}</mat-checkbox>
|
||||
</div>
|
||||
<h3>{{ 'dialog-defaults-form.hint.title' | translate }}</h3>
|
||||
<div class="iqser-input-group w-450">
|
||||
<label translate="dialog-defaults-form.hint.add-dialog"></label>
|
||||
<mat-form-field>
|
||||
<mat-select formControlName="addHint">
|
||||
<mat-option *ngFor="let option of hintAddOptions" [value]="option.value">{{ option.label | translate }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-checkbox *ngIf="displayExtraOptionAddHint" formControlName="addHintApplyToAll">{{
|
||||
'dialog-defaults-form.extra-option-label' | translate
|
||||
}}</mat-checkbox>
|
||||
</div>
|
||||
<div class="iqser-input-group w-450">
|
||||
<label translate="dialog-defaults-form.hint.remove-dialog"></label>
|
||||
<mat-form-field>
|
||||
<mat-select formControlName="removeHint">
|
||||
<mat-option *ngFor="let option of removeOptions" [value]="option.value">{{ option.label | translate }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-checkbox *ngIf="displayExtraOptionRemoveHint" formControlName="removeHintApplyToAll">{{
|
||||
'dialog-defaults-form.extra-option-label' | translate
|
||||
}}</mat-checkbox>
|
||||
</div>
|
||||
</div>
|
||||
<div class="iqser-input-group w-450">
|
||||
<label translate="dialog-defaults-form.redaction.remove-dialog"></label>
|
||||
<mat-form-field>
|
||||
<mat-select formControlName="removeRedaction">
|
||||
<mat-option *ngFor="let option of redactionRemoveOptions" [value]="option.value">{{
|
||||
option.label | translate
|
||||
}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-checkbox *ngIf="displayExtraOptionRemoveRedaction" formControlName="removeRedactionApplyToAll">{{
|
||||
'dialog-defaults-form.extra-option-label' | translate
|
||||
}}</mat-checkbox>
|
||||
<div class="dialog-actions">
|
||||
<iqser-icon-button
|
||||
(action)="save()"
|
||||
[disabled]="!valid || !changed"
|
||||
[label]="'preferences-screen.actions.save' | translate"
|
||||
[type]="iconButtonTypes.primary"
|
||||
></iqser-icon-button>
|
||||
</div>
|
||||
<h2>{{ 'dialog-defaults-form.recommendation.title' | translate }}</h2>
|
||||
<div class="iqser-input-group w-450">
|
||||
<label translate="dialog-defaults-form.recommendation.remove-dialog"></label>
|
||||
<mat-form-field>
|
||||
<mat-select formControlName="removeRecommendation">
|
||||
<mat-option *ngFor="let option of recommendationRemoveOptions" [value]="option.value">{{
|
||||
option.label | translate
|
||||
}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-checkbox *ngIf="displayExtraOptionRemoveRecommendation" formControlName="removeRecommendationApplyToAll">{{
|
||||
'dialog-defaults-form.extra-option-label' | translate
|
||||
}}</mat-checkbox>
|
||||
</div>
|
||||
<h2>{{ 'dialog-defaults-form.hint.title' | translate }}</h2>
|
||||
<div class="iqser-input-group w-450">
|
||||
<label translate="dialog-defaults-form.hint.add-dialog"></label>
|
||||
<mat-form-field>
|
||||
<mat-select formControlName="addHint">
|
||||
<mat-option *ngFor="let option of hintAddOptions" [value]="option.value">{{ option.label | translate }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-checkbox *ngIf="displayExtraOptionAddHint" formControlName="addHintApplyToAll">{{
|
||||
'dialog-defaults-form.extra-option-label' | translate
|
||||
}}</mat-checkbox>
|
||||
</div>
|
||||
<div class="iqser-input-group w-450">
|
||||
<label translate="dialog-defaults-form.hint.remove-dialog"></label>
|
||||
<mat-form-field>
|
||||
<mat-select formControlName="removeHint">
|
||||
<mat-option *ngFor="let option of removeOptions" [value]="option.value">{{ option.label | translate }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-checkbox *ngIf="displayExtraOptionRemoveHint" formControlName="removeHintApplyToAll">{{
|
||||
'dialog-defaults-form.extra-option-label' | translate
|
||||
}}</mat-checkbox>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dialog-actions">
|
||||
<iqser-icon-button
|
||||
(action)="save()"
|
||||
[disabled]="!valid || !changed"
|
||||
[label]="'preferences-screen.actions.save' | translate"
|
||||
[type]="iconButtonTypes.primary"
|
||||
></iqser-icon-button>
|
||||
</div>
|
||||
</form>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@ -1,3 +1,16 @@
|
||||
mat-checkbox {
|
||||
margin: 8px 0 0 8px;
|
||||
}
|
||||
|
||||
h3 {
|
||||
margin-top: 24px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
form .iqser-input-group:not(first-of-type) {
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.dialog {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
@ -1,14 +1,20 @@
|
||||
import { NgForOf, NgIf } from '@angular/common';
|
||||
import { ChangeDetectorRef, Component, inject } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
||||
import { MatCheckbox } from '@angular/material/checkbox';
|
||||
import { MatFormField } from '@angular/material/form-field';
|
||||
import { MatOption, MatSelect } from '@angular/material/select';
|
||||
import { BaseFormComponent } from '@common-ui/form';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { AsControl } from '@common-ui/utils';
|
||||
import { IconButtonComponent } from '@iqser/common-ui';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { PreferencesKeys, UserPreferenceService } from '@users/user-preference.service';
|
||||
import {
|
||||
RedactOrHintOption,
|
||||
RedactOrHintOptions,
|
||||
RemoveRedactionOption,
|
||||
RemoveRedactionOptions,
|
||||
} from '../../../../file-preview/utils/dialog-options';
|
||||
import { PreferencesKeys, UserPreferenceService } from '@users/user-preference.service';
|
||||
import { AsControl } from '@common-ui/utils';
|
||||
} from '../../../../file-preview/utils/dialog-types';
|
||||
import {
|
||||
hintAddOptions,
|
||||
recommendationRemoveOptions,
|
||||
@ -35,6 +41,7 @@ interface DefaultOptionsForm {
|
||||
selector: 'redaction-dialog-defaults',
|
||||
templateUrl: './dialog-defaults.component.html',
|
||||
styleUrl: './dialog-defaults.component.scss',
|
||||
imports: [ReactiveFormsModule, TranslateModule, MatFormField, MatSelect, MatOption, NgForOf, MatCheckbox, NgIf, IconButtonComponent],
|
||||
})
|
||||
export class DialogDefaultsComponent extends BaseFormComponent {
|
||||
readonly #formBuilder = inject(FormBuilder);
|
||||
@ -60,6 +67,10 @@ export class DialogDefaultsComponent extends BaseFormComponent {
|
||||
readonly redactionRemoveOptions = redactionRemoveOptions;
|
||||
readonly recommendationRemoveOptions = recommendationRemoveOptions;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
get displayExtraOptionAddRedaction() {
|
||||
return RedactOrHintOptions.IN_DOSSIER === this.form.controls.addRedaction.value;
|
||||
}
|
||||
@ -84,10 +95,6 @@ export class DialogDefaultsComponent extends BaseFormComponent {
|
||||
return RemoveRedactionOptions.DO_NOT_RECOMMEND === this.form.controls.removeRecommendation.value;
|
||||
}
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
async save(): Promise<any> {
|
||||
const formValue = this.form.value;
|
||||
|
||||
|
||||
@ -1,46 +1,52 @@
|
||||
<redaction-dialog-defaults *ngIf="currentScreen === screens.WARNING_PREFERENCES && !config.IS_DOCUMINE"></redaction-dialog-defaults>
|
||||
|
||||
<form [formGroup]="form">
|
||||
<div class="dialog-content">
|
||||
<div class="dialog-content-left">
|
||||
<ng-container *ngIf="currentScreen === screens.PREFERENCES">
|
||||
<div class="iqser-input-group">
|
||||
<mat-slide-toggle color="primary" formControlName="autoExpandFiltersOnActions">
|
||||
{{ 'preferences-screen.form.auto-expand-filters-on-action' | translate }}
|
||||
</mat-slide-toggle>
|
||||
</div>
|
||||
<div [ngClass]="currentScreen === screens.WARNING_PREFERENCES && 'dialog'">
|
||||
<form [formGroup]="form">
|
||||
<div class="dialog-content">
|
||||
<div class="dialog-content-left">
|
||||
<ng-container *ngIf="currentScreen === screens.PREFERENCES">
|
||||
<div class="iqser-input-group">
|
||||
<mat-slide-toggle color="primary" formControlName="autoExpandFiltersOnActions">
|
||||
{{ 'preferences-screen.form.auto-expand-filters-on-action' | translate }}
|
||||
</mat-slide-toggle>
|
||||
</div>
|
||||
|
||||
<div *ngIf="config.IS_DOCUMINE" class="iqser-input-group">
|
||||
<mat-slide-toggle color="primary" formControlName="openScmDialogByDefault">
|
||||
{{ 'preferences-screen.form.open-structured-view-by-default' | translate }}
|
||||
</mat-slide-toggle>
|
||||
</div>
|
||||
<div *allow="roles.getTables" class="iqser-input-group">
|
||||
<label [translate]="'preferences-screen.form.table-extraction-type'"></label>
|
||||
<input formControlName="tableExtractionType" />
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
<div *allow="roles.getTables" class="iqser-input-group">
|
||||
<label [translate]="'preferences-screen.form.table-extraction-type'"></label>
|
||||
<input formControlName="tableExtractionType" />
|
||||
</div>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="currentScreen === screens.WARNING_PREFERENCES">
|
||||
<h1>{{ 'preferences-screen.warnings-subtitle' | translate }}</h1>
|
||||
<p class="warnings-description">{{ 'preferences-screen.warnings-description' | translate }}</p>
|
||||
|
||||
<ng-container *ngIf="currentScreen === screens.WARNING_PREFERENCES">
|
||||
<h1>{{ 'preferences-screen.warnings-subtitle' | translate }}</h1>
|
||||
<p class="warnings-description">{{ 'preferences-screen.warnings-description' | translate }}</p>
|
||||
|
||||
<div class="iqser-input-group">
|
||||
<mat-checkbox color="primary" formControlName="loadAllAnnotationsWarning">
|
||||
{{ 'preferences-screen.form.load-all-annotations-warning' | translate }}
|
||||
</mat-checkbox>
|
||||
</div>
|
||||
</ng-container>
|
||||
<div class="iqser-input-group">
|
||||
<mat-checkbox color="primary" formControlName="loadAllAnnotationsWarning">
|
||||
{{ 'preferences-screen.form.load-all-annotations-warning' | translate }}
|
||||
</mat-checkbox>
|
||||
</div>
|
||||
<div class="iqser-input-group">
|
||||
<mat-checkbox color="primary" formControlName="helpModeDialog">
|
||||
{{ 'preferences-screen.form.help-mode-dialog' | translate }}
|
||||
</mat-checkbox>
|
||||
</div>
|
||||
<div class="iqser-input-group">
|
||||
<mat-checkbox color="primary" formControlName="overwriteFileOption">
|
||||
{{ 'preferences-screen.form.overwrite-file-option' | translate }}
|
||||
</mat-checkbox>
|
||||
</div>
|
||||
</ng-container>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="dialog-actions">
|
||||
<iqser-icon-button
|
||||
(action)="save()"
|
||||
[disabled]="!valid || !changed"
|
||||
[label]="'preferences-screen.actions.save' | translate"
|
||||
[type]="iconButtonTypes.primary"
|
||||
></iqser-icon-button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="dialog-actions">
|
||||
<iqser-icon-button
|
||||
(action)="save()"
|
||||
[disabled]="!valid || !changed"
|
||||
[label]="'preferences-screen.actions.save' | translate"
|
||||
[type]="iconButtonTypes.primary"
|
||||
></iqser-icon-button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@ -1,10 +1,3 @@
|
||||
@use 'variables';
|
||||
|
||||
.content-delimiter {
|
||||
border-top: 1px solid var(--iqser-separator);
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.warnings-description {
|
||||
width: 105%;
|
||||
}
|
||||
|
||||
@ -1,18 +1,33 @@
|
||||
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, inject, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { BaseFormComponent, getConfig, IqserPermissionsService, isIqserDevMode, LoadingService } from '@iqser/common-ui';
|
||||
import {
|
||||
BaseFormComponent,
|
||||
getConfig,
|
||||
IconButtonComponent,
|
||||
IqserAllowDirective,
|
||||
IqserPermissionsService,
|
||||
isIqserDevMode,
|
||||
KEYS,
|
||||
LoadingService,
|
||||
} from '@iqser/common-ui';
|
||||
import { AsControl } from '@iqser/common-ui/lib/utils';
|
||||
import { Roles } from '@users/roles';
|
||||
import { PreferencesKeys, UserPreferenceService } from '@users/user-preference.service';
|
||||
import { DialogDefaultsComponent } from './dialog-defaults/dialog-defaults.component';
|
||||
import { NgClass, NgIf } from '@angular/common';
|
||||
import { MatSlideToggle } from '@angular/material/slide-toggle';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { MatCheckbox } from '@angular/material/checkbox';
|
||||
|
||||
interface PreferencesForm {
|
||||
// preferences
|
||||
autoExpandFiltersOnActions: boolean;
|
||||
openScmDialogByDefault: boolean;
|
||||
tableExtractionType: string;
|
||||
// warnings preferences
|
||||
loadAllAnnotationsWarning: boolean;
|
||||
helpModeDialog: boolean;
|
||||
overwriteFileOption: boolean;
|
||||
|
||||
[k: string]: any;
|
||||
}
|
||||
@ -29,8 +44,25 @@ const Screens = {
|
||||
templateUrl: './preferences.component.html',
|
||||
styleUrls: ['./preferences.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
imports: [
|
||||
DialogDefaultsComponent,
|
||||
NgClass,
|
||||
NgIf,
|
||||
ReactiveFormsModule,
|
||||
MatSlideToggle,
|
||||
TranslateModule,
|
||||
IqserAllowDirective,
|
||||
MatCheckbox,
|
||||
IconButtonComponent,
|
||||
],
|
||||
})
|
||||
export class PreferencesComponent extends BaseFormComponent implements OnInit {
|
||||
readonly #formBuilder = inject(FormBuilder);
|
||||
readonly #permissionsService = inject(IqserPermissionsService);
|
||||
readonly #changeRef = inject(ChangeDetectorRef);
|
||||
readonly #loadingService = inject(LoadingService);
|
||||
readonly #userPreferenceService = inject(UserPreferenceService);
|
||||
|
||||
readonly form: FormGroup<AsControl<PreferencesForm>>;
|
||||
readonly currentScreen: Screen;
|
||||
readonly screens = Screens;
|
||||
@ -39,75 +71,87 @@ export class PreferencesComponent extends BaseFormComponent implements OnInit {
|
||||
readonly config = getConfig();
|
||||
readonly isIqserDevMode = isIqserDevMode();
|
||||
|
||||
constructor(
|
||||
route: ActivatedRoute,
|
||||
readonly userPreferenceService: UserPreferenceService,
|
||||
private readonly _formBuilder: FormBuilder,
|
||||
private readonly _permissionsService: IqserPermissionsService,
|
||||
private readonly _changeRef: ChangeDetectorRef,
|
||||
private readonly _loadingService: LoadingService,
|
||||
) {
|
||||
get #isOverwriteFileOptionActive() {
|
||||
return !(this.#userPreferenceService.getOverwriteFileOption() === 'undefined');
|
||||
}
|
||||
|
||||
constructor(route: ActivatedRoute) {
|
||||
super();
|
||||
this.form = this._formBuilder.group({
|
||||
this.form = this.#formBuilder.group({
|
||||
// preferences
|
||||
autoExpandFiltersOnActions: [this.userPreferenceService.getAutoExpandFiltersOnActions()],
|
||||
openScmDialogByDefault: [this.userPreferenceService.getOpenScmDialogByDefault()],
|
||||
tableExtractionType: [this.userPreferenceService.getTableExtractionType()],
|
||||
autoExpandFiltersOnActions: [this.#userPreferenceService.getAutoExpandFiltersOnActions()],
|
||||
tableExtractionType: [this.#userPreferenceService.getTableExtractionType()],
|
||||
// warnings preferences
|
||||
loadAllAnnotationsWarning: [this.userPreferenceService.getBool(PreferencesKeys.loadAllAnnotationsWarning)],
|
||||
loadAllAnnotationsWarning: [this.#userPreferenceService.getBool(PreferencesKeys.loadAllAnnotationsWarning)],
|
||||
helpModeDialog: [this.#userPreferenceService.getBool(KEYS.helpModeDialog)],
|
||||
overwriteFileOption: [this.#isOverwriteFileOptionActive],
|
||||
});
|
||||
|
||||
if (!this._permissionsService.has(Roles.managePreferences)) {
|
||||
if (!this.#permissionsService.has(Roles.managePreferences)) {
|
||||
this.form.disable();
|
||||
}
|
||||
|
||||
if (!this._permissionsService.has(Roles.getTables)) {
|
||||
if (!this.#permissionsService.has(Roles.getTables)) {
|
||||
this.form.controls.tableExtractionType.disable();
|
||||
}
|
||||
|
||||
if (!this.#isOverwriteFileOptionActive) {
|
||||
this.form.controls.overwriteFileOption.disable();
|
||||
}
|
||||
|
||||
this.initialFormValue = this.form.getRawValue();
|
||||
this.currentScreen = route.snapshot.data.screen;
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this._loadingService.stop();
|
||||
this.#loadingService.stop();
|
||||
}
|
||||
|
||||
async save(): Promise<any> {
|
||||
if (this.form.controls.autoExpandFiltersOnActions.value !== this.userPreferenceService.getAutoExpandFiltersOnActions()) {
|
||||
await this.userPreferenceService.toggleAutoExpandFiltersOnActions();
|
||||
}
|
||||
if (this.form.controls.openScmDialogByDefault.value !== this.userPreferenceService.getOpenScmDialogByDefault()) {
|
||||
await this.userPreferenceService.toggleOpenScmDialogByDefault();
|
||||
if (this.form.controls.autoExpandFiltersOnActions.value !== this.#userPreferenceService.getAutoExpandFiltersOnActions()) {
|
||||
await this.#userPreferenceService.toggleAutoExpandFiltersOnActions();
|
||||
}
|
||||
|
||||
if (this.form.controls.tableExtractionType.value !== this.userPreferenceService.getTableExtractionType()) {
|
||||
await this.userPreferenceService.save(PreferencesKeys.tableExtractionType, this.form.controls.tableExtractionType.value);
|
||||
if (this.form.controls.tableExtractionType.value !== this.#userPreferenceService.getTableExtractionType()) {
|
||||
await this.#userPreferenceService.save(PreferencesKeys.tableExtractionType, this.form.controls.tableExtractionType.value);
|
||||
}
|
||||
|
||||
if (
|
||||
this.form.controls.loadAllAnnotationsWarning.value !==
|
||||
this.userPreferenceService.getBool(PreferencesKeys.loadAllAnnotationsWarning)
|
||||
this.#userPreferenceService.getBool(PreferencesKeys.loadAllAnnotationsWarning)
|
||||
) {
|
||||
await this.userPreferenceService.save(
|
||||
await this.#userPreferenceService.save(
|
||||
PreferencesKeys.loadAllAnnotationsWarning,
|
||||
String(this.form.controls.loadAllAnnotationsWarning.value),
|
||||
);
|
||||
}
|
||||
|
||||
await this.userPreferenceService.reload();
|
||||
if (this.form.controls.helpModeDialog.value !== this.#userPreferenceService.getBool(KEYS.helpModeDialog)) {
|
||||
await this.#userPreferenceService.save(KEYS.helpModeDialog, String(this.form.controls.helpModeDialog.value));
|
||||
}
|
||||
|
||||
if (this.form.controls.overwriteFileOption.enabled && !this.form.controls.overwriteFileOption.value) {
|
||||
await this.#userPreferenceService.saveOverwriteFileOption('undefined');
|
||||
}
|
||||
|
||||
await this.#userPreferenceService.reload();
|
||||
this.#patchValues();
|
||||
|
||||
this.initialFormValue = this.form.getRawValue();
|
||||
this._changeRef.markForCheck();
|
||||
this.#changeRef.markForCheck();
|
||||
}
|
||||
|
||||
#patchValues() {
|
||||
this.form.patchValue({
|
||||
autoExpandFiltersOnActions: this.userPreferenceService.getAutoExpandFiltersOnActions(),
|
||||
openScmDialogByDefault: this.userPreferenceService.getOpenScmDialogByDefault(),
|
||||
tableExtractionType: this.userPreferenceService.getTableExtractionType(),
|
||||
loadAllAnnotationsWarning: this.userPreferenceService.getBool(PreferencesKeys.loadAllAnnotationsWarning),
|
||||
autoExpandFiltersOnActions: this.#userPreferenceService.getAutoExpandFiltersOnActions(),
|
||||
tableExtractionType: this.#userPreferenceService.getTableExtractionType(),
|
||||
loadAllAnnotationsWarning: this.#userPreferenceService.getBool(PreferencesKeys.loadAllAnnotationsWarning),
|
||||
helpModeDialog: this.#userPreferenceService.getBool(KEYS.helpModeDialog),
|
||||
overwriteFileOption: this.#isOverwriteFileOptionActive,
|
||||
});
|
||||
|
||||
if (!this.#isOverwriteFileOptionActive) {
|
||||
this.form.controls.overwriteFileOption.disable();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { BaseDialogComponent } from '@iqser/common-ui';
|
||||
import { BaseDialogComponent, CircleButtonComponent, IconButtonComponent } from '@iqser/common-ui';
|
||||
import { MatDialogRef } from '@angular/material/dialog';
|
||||
import { AbstractControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { AbstractControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
interface FormType {
|
||||
password: AbstractControl<string>;
|
||||
@ -9,6 +10,7 @@ interface FormType {
|
||||
|
||||
@Component({
|
||||
templateUrl: './confirm-password-dialog.component.html',
|
||||
imports: [ReactiveFormsModule, IconButtonComponent, TranslateModule, CircleButtonComponent],
|
||||
})
|
||||
export class ConfirmPasswordDialogComponent extends BaseDialogComponent {
|
||||
constructor(protected readonly _dialogRef: MatDialogRef<ConfirmPasswordDialogComponent>) {
|
||||
|
||||
@ -16,13 +16,16 @@
|
||||
<input formControlName="lastName" name="lastName" type="text" />
|
||||
</div>
|
||||
|
||||
<div *ngIf="devMode" class="iqser-input-group">
|
||||
<div class="iqser-input-group">
|
||||
<label [translate]="'top-bar.navigation-items.my-account.children.language.label'"></label>
|
||||
<mat-form-field>
|
||||
<mat-select formControlName="language">
|
||||
<mat-option *ngFor="let language of languages" [value]="language">
|
||||
{{ translations[language] | translate }}
|
||||
</mat-option>
|
||||
<mat-select-trigger>{{ languageSelectLabel() | translate }}</mat-select-trigger>
|
||||
@for (language of languages; track language) {
|
||||
<mat-option [value]="language">
|
||||
{{ translations[language] | translate }}
|
||||
</mat-option>
|
||||
}
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
@ -31,17 +34,19 @@
|
||||
<a (click)="resetPassword()" target="_blank"> {{ 'user-profile-screen.actions.change-password' | translate }}</a>
|
||||
</div>
|
||||
|
||||
<div *ngIf="devMode" class="iqser-input-group">
|
||||
<mat-slide-toggle color="primary" formControlName="darkTheme">
|
||||
{{ 'user-profile-screen.form.dark-theme' | translate }}
|
||||
</mat-slide-toggle>
|
||||
</div>
|
||||
@if (devMode) {
|
||||
<div class="iqser-input-group">
|
||||
<mat-slide-toggle color="primary" formControlName="darkTheme">
|
||||
{{ 'user-profile-screen.form.dark-theme' | translate }}
|
||||
</mat-slide-toggle>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="dialog-actions">
|
||||
<iqser-icon-button
|
||||
[disabled]="form.invalid || !(profileChanged || languageChanged || themeChanged)"
|
||||
[disabled]="disabled"
|
||||
[label]="'user-profile-screen.actions.save' | translate"
|
||||
[submit]="true"
|
||||
[type]="iconButtonTypes.primary"
|
||||
|
||||
@ -1,8 +1,15 @@
|
||||
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit } from '@angular/core';
|
||||
import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
|
||||
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, computed } from '@angular/core';
|
||||
import { FormGroup, ReactiveFormsModule, UntypedFormBuilder, Validators } from '@angular/forms';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { BaseFormComponent, IqserPermissionsService, LanguageService, LoadingService, Toaster } from '@iqser/common-ui';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import {
|
||||
BaseFormComponent,
|
||||
IconButtonComponent,
|
||||
IqserPermissionsService,
|
||||
LanguageService,
|
||||
LoadingService,
|
||||
Toaster,
|
||||
} from '@iqser/common-ui';
|
||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
||||
import { IProfile } from '@red/domain';
|
||||
import { languagesTranslations } from '@translations/languages-translations';
|
||||
import { Roles } from '@users/roles';
|
||||
@ -10,17 +17,47 @@ import { UserPreferenceService } from '@users/user-preference.service';
|
||||
import { UserService } from '@users/user.service';
|
||||
import { firstValueFrom } from 'rxjs';
|
||||
import { UserProfileDialogService } from '../services/user-profile-dialog.service';
|
||||
import { MatFormField } from '@angular/material/form-field';
|
||||
import { MatOption, MatSelect, MatSelectTrigger } from '@angular/material/select';
|
||||
import { MatSlideToggle } from '@angular/material/slide-toggle';
|
||||
import { PdfViewer } from '../../../../pdf-viewer/services/pdf-viewer.service';
|
||||
import { formControlToSignal } from '@utils/functions';
|
||||
import { AsControl } from '@common-ui/utils';
|
||||
|
||||
interface UserProfileForm {
|
||||
email: string;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
language: string;
|
||||
darkTheme: boolean;
|
||||
}
|
||||
|
||||
@Component({
|
||||
templateUrl: './user-profile-screen.component.html',
|
||||
styleUrls: ['./user-profile-screen.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
imports: [
|
||||
ReactiveFormsModule,
|
||||
MatFormField,
|
||||
MatSelect,
|
||||
MatOption,
|
||||
TranslateModule,
|
||||
MatSlideToggle,
|
||||
IconButtonComponent,
|
||||
MatSelectTrigger,
|
||||
],
|
||||
})
|
||||
export class UserProfileScreenComponent extends BaseFormComponent implements OnInit {
|
||||
#profileModel: IProfile;
|
||||
export class UserProfileScreenComponent extends BaseFormComponent {
|
||||
readonly form: FormGroup<AsControl<UserProfileForm>> = this.#getForm();
|
||||
initialFormValue = this.form.getRawValue();
|
||||
readonly translations = languagesTranslations;
|
||||
readonly devMode = this._userPreferenceService.isIqserDevMode;
|
||||
|
||||
readonly profileKeys = ['email', 'firstName', 'lastName'];
|
||||
readonly languages = this._translateService.langs;
|
||||
readonly language = formControlToSignal<UserProfileForm['language']>(this.form.controls.language);
|
||||
readonly languageSelectLabel = computed(() => this.translations[this.language()]);
|
||||
|
||||
constructor(
|
||||
private readonly _userService: UserService,
|
||||
private readonly _loadingService: LoadingService,
|
||||
@ -32,43 +69,29 @@ export class UserProfileScreenComponent extends BaseFormComponent implements OnI
|
||||
protected readonly _userPreferenceService: UserPreferenceService,
|
||||
private readonly _changeRef: ChangeDetectorRef,
|
||||
private readonly _toaster: Toaster,
|
||||
private readonly _pdfViewer: PdfViewer,
|
||||
) {
|
||||
super();
|
||||
this._loadingService.start();
|
||||
if (!this._permissionsService.has(Roles.updateMyProfile)) {
|
||||
this.form.disable();
|
||||
}
|
||||
this._loadingService.stop();
|
||||
}
|
||||
|
||||
get languageChanged(): boolean {
|
||||
return this.#profileModel['language'] !== this.form.get('language').value;
|
||||
return this.initialFormValue['language'] !== this.form.controls.language.value;
|
||||
}
|
||||
|
||||
get themeChanged(): boolean {
|
||||
return this.#profileModel['darkTheme'] !== this.form.get('darkTheme').value;
|
||||
return this.initialFormValue['darkTheme'] !== this.form.controls.darkTheme.value;
|
||||
}
|
||||
|
||||
get emailChanged(): boolean {
|
||||
return this.#profileModel['email'] !== this.form.get('email').value;
|
||||
return this.initialFormValue['email'] !== this.form.controls.email.value;
|
||||
}
|
||||
|
||||
get profileChanged(): boolean {
|
||||
const keys = Object.keys(this.form.getRawValue());
|
||||
keys.splice(keys.indexOf('language'), 1);
|
||||
keys.splice(keys.indexOf('darkTheme'), 1);
|
||||
|
||||
for (const key of keys) {
|
||||
if (this.#profileModel[key] !== this.form.get(key).value) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
get languages(): string[] {
|
||||
return this._translateService.langs;
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this._initializeForm();
|
||||
return this.profileKeys.some(key => this.initialFormValue[key] !== this.form.get(key).value);
|
||||
}
|
||||
|
||||
async save(): Promise<void> {
|
||||
@ -93,15 +116,17 @@ export class UserProfileScreenComponent extends BaseFormComponent implements OnI
|
||||
}
|
||||
|
||||
if (this.languageChanged) {
|
||||
await this._languageService.change(this.form.get('language').value);
|
||||
await this._languageService.change(this.form.controls.language.value);
|
||||
await this._pdfViewer.instance?.UI.setLanguage(this._languageService.currentLanguage);
|
||||
}
|
||||
|
||||
if (this.themeChanged) {
|
||||
await this._userPreferenceService.saveTheme(this.form.get('darkTheme').value ? 'dark' : 'light');
|
||||
await this._userPreferenceService.saveTheme(this.form.controls.darkTheme.value ? 'dark' : 'light');
|
||||
}
|
||||
|
||||
this._initializeForm();
|
||||
|
||||
this.initialFormValue = this.form.getRawValue();
|
||||
this._changeRef.markForCheck();
|
||||
this._loadingService.stop();
|
||||
this._toaster.success(_('user-profile-screen.update.success'));
|
||||
} catch (e) {
|
||||
this._loadingService.stop();
|
||||
@ -112,35 +137,13 @@ export class UserProfileScreenComponent extends BaseFormComponent implements OnI
|
||||
await this._userService.createResetPasswordAction();
|
||||
}
|
||||
|
||||
private _getForm(): UntypedFormGroup {
|
||||
#getForm() {
|
||||
return this._formBuilder.group({
|
||||
email: ['', [Validators.required, Validators.email]],
|
||||
firstName: [''],
|
||||
lastName: [''],
|
||||
language: [''],
|
||||
darkTheme: [false],
|
||||
email: [this._userService.currentUser.email ?? '', [Validators.required, Validators.email]],
|
||||
firstName: [this._userService.currentUser.firstName ?? ''],
|
||||
lastName: [this._userService.currentUser.lastName ?? ''],
|
||||
language: [this._userPreferenceService.getLanguage()],
|
||||
darkTheme: [this._userPreferenceService.getTheme() === 'dark'],
|
||||
});
|
||||
}
|
||||
|
||||
private _initializeForm(): void {
|
||||
try {
|
||||
this.form = this._getForm();
|
||||
if (!this._permissionsService.has(Roles.updateMyProfile)) {
|
||||
this.form.disable();
|
||||
}
|
||||
this.#profileModel = {
|
||||
email: this._userService.currentUser.email ?? '',
|
||||
firstName: this._userService.currentUser.firstName ?? '',
|
||||
lastName: this._userService.currentUser.lastName ?? '',
|
||||
language: this._languageService.currentLanguage ?? '',
|
||||
darkTheme: this._userPreferenceService.getTheme() === 'dark',
|
||||
};
|
||||
this.form.patchValue(this.#profileModel, { emitEvent: false });
|
||||
this.initialFormValue = this.form.getRawValue();
|
||||
} catch (e) {
|
||||
} finally {
|
||||
this._loadingService.stop();
|
||||
this._changeRef.markForCheck();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,19 +0,0 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { SharedModule } from '@shared/shared.module';
|
||||
import { UserProfileScreenComponent } from './user-profile-screen/user-profile-screen.component';
|
||||
import { PendingChangesGuard } from '@guards/can-deactivate.guard';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { ConfirmPasswordDialogComponent } from './confirm-password-dialog/confirm-password-dialog.component';
|
||||
import { UserProfileDialogService } from './services/user-profile-dialog.service';
|
||||
import { CircleButtonComponent, IconButtonComponent } from '@iqser/common-ui';
|
||||
|
||||
const routes = [{ path: '', component: UserProfileScreenComponent, canDeactivate: [PendingChangesGuard] }];
|
||||
|
||||
@NgModule({
|
||||
declarations: [UserProfileScreenComponent, ConfirmPasswordDialogComponent],
|
||||
imports: [RouterModule.forChild(routes), CommonModule, SharedModule, TranslateModule, IconButtonComponent, CircleButtonComponent],
|
||||
providers: [UserProfileDialogService],
|
||||
})
|
||||
export class UserProfileModule {}
|
||||
@ -0,0 +1,8 @@
|
||||
import { UserProfileScreenComponent } from './user-profile-screen/user-profile-screen.component';
|
||||
import { PendingChangesGuard } from '@guards/can-deactivate.guard';
|
||||
import { UserProfileDialogService } from './services/user-profile-dialog.service';
|
||||
import { IqserRoutes } from '@iqser/common-ui';
|
||||
|
||||
export default [
|
||||
{ path: '', component: UserProfileScreenComponent, canDeactivate: [PendingChangesGuard], providers: [UserProfileDialogService] },
|
||||
] satisfies IqserRoutes;
|
||||
@ -1,12 +1,19 @@
|
||||
import { redactTextTranslations } from '@translations/redact-text-translations';
|
||||
import { RedactOrHintOptions, RemoveRedactionOptions } from '../../file-preview/utils/dialog-options';
|
||||
import { removeRedactionTranslations } from '@translations/remove-redaction-translations';
|
||||
import { addHintTranslations } from '@translations/add-hint-translations';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { addHintTranslations } from '@translations/add-hint-translations';
|
||||
import { redactTextTranslations } from '@translations/redact-text-translations';
|
||||
import { removeRedactionTranslations } from '@translations/remove-redaction-translations';
|
||||
import {
|
||||
ForceAnnotationOptions,
|
||||
RectangleRedactOptions,
|
||||
RedactOrHintOptions,
|
||||
RemoveRedactionOptions,
|
||||
} from '../../file-preview/utils/dialog-types';
|
||||
|
||||
export const SystemDefaults = {
|
||||
RECTANGLE_REDACT_DEFAULT: RectangleRedactOptions.ONLY_THIS_PAGE,
|
||||
ADD_REDACTION_DEFAULT: RedactOrHintOptions.IN_DOSSIER,
|
||||
ADD_HINT_DEFAULT: RedactOrHintOptions.IN_DOSSIER,
|
||||
FORCE_REDACTION_DEFAULT: ForceAnnotationOptions.ONLY_HERE,
|
||||
REMOVE_REDACTION_DEFAULT: RemoveRedactionOptions.ONLY_HERE,
|
||||
REMOVE_HINT_DEFAULT: RemoveRedactionOptions.ONLY_HERE,
|
||||
REMOVE_RECOMMENDATION_DEFAULT: RemoveRedactionOptions.DO_NOT_RECOMMEND,
|
||||
@ -28,6 +35,10 @@ export const redactionAddOptions = [
|
||||
label: redactTextTranslations.onlyHere.label,
|
||||
value: RedactOrHintOptions.ONLY_HERE,
|
||||
},
|
||||
{
|
||||
label: redactTextTranslations.inDocument.label,
|
||||
value: RedactOrHintOptions.IN_DOCUMENT,
|
||||
},
|
||||
{
|
||||
label: redactTextTranslations.inDossier.label,
|
||||
value: RedactOrHintOptions.IN_DOSSIER,
|
||||
|
||||
@ -1,282 +0,0 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CompositeRouteGuard, IqserPermissionsGuard, IqserRoutes } from '@iqser/common-ui';
|
||||
import { RedRoleGuard } from '@users/red-role.guard';
|
||||
import { EntitiesListingScreenComponent } from './screens/entities-listing/entities-listing-screen.component';
|
||||
import { PendingChangesGuard } from '@guards/can-deactivate.guard';
|
||||
import { DefaultColorsScreenComponent } from './screens/default-colors/default-colors-screen.component';
|
||||
import { UserListingScreenComponent } from './screens/user-listing/user-listing-screen.component';
|
||||
import { DigitalSignatureScreenComponent } from './screens/digital-signature/digital-signature-screen.component';
|
||||
import { AuditScreenComponent } from './screens/audit/audit-screen.component';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { GeneralConfigScreenComponent } from './screens/general-config/general-config-screen.component';
|
||||
import { BaseAdminScreenComponent } from './base-admin-screen/base-admin-screen.component';
|
||||
import { BaseDossierTemplateScreenComponent } from './base-dossier-templates-screen/base-dossier-template-screen.component';
|
||||
import { DossierTemplatesGuard } from '@guards/dossier-templates.guard';
|
||||
import { DOSSIER_TEMPLATE_ID, ENTITY_TYPE } from '@red/domain';
|
||||
import { templateExistsWhenEnteringAdmin } from '@guards/dossier-template-exists.guard';
|
||||
import { entityExistsGuard } from '@guards/entity-exists-guard.service';
|
||||
import { BaseEntityScreenComponent } from './base-entity-screen/base-entity-screen.component';
|
||||
import { PermissionsGuard } from '@guards/permissions-guard';
|
||||
import { Roles } from '@users/roles';
|
||||
import { IqserAuthGuard } from '@iqser/common-ui/lib/users';
|
||||
|
||||
const dossierTemplateIdRoutes: IqserRoutes = [
|
||||
{
|
||||
path: 'info',
|
||||
component: BaseDossierTemplateScreenComponent,
|
||||
loadChildren: () => import('./screens/info/dossier-template-info.module').then(m => m.DossierTemplateInfoModule),
|
||||
},
|
||||
{
|
||||
path: 'entities',
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: EntitiesListingScreenComponent,
|
||||
canActivate: [CompositeRouteGuard],
|
||||
data: {
|
||||
routeGuards: [IqserAuthGuard, RedRoleGuard],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: `:${ENTITY_TYPE}`,
|
||||
component: BaseEntityScreenComponent,
|
||||
canActivate: [CompositeRouteGuard, entityExistsGuard()],
|
||||
loadChildren: () => import('./screens/entities/entities.module').then(m => m.EntitiesModule),
|
||||
data: {
|
||||
routeGuards: [IqserAuthGuard, RedRoleGuard],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'entity-rules',
|
||||
component: BaseDossierTemplateScreenComponent,
|
||||
canActivate: [CompositeRouteGuard, IqserPermissionsGuard],
|
||||
data: {
|
||||
routeGuards: [IqserAuthGuard, RedRoleGuard],
|
||||
permissions: {
|
||||
allow: [Roles.rules.read],
|
||||
redirectTo: 'info',
|
||||
},
|
||||
type: 'ENTITY',
|
||||
},
|
||||
loadChildren: () => import('./screens/rules/rules.module').then(m => m.RulesModule),
|
||||
},
|
||||
{
|
||||
path: 'component-rules',
|
||||
component: BaseDossierTemplateScreenComponent,
|
||||
canActivate: [CompositeRouteGuard, IqserPermissionsGuard],
|
||||
data: {
|
||||
routeGuards: [IqserAuthGuard, RedRoleGuard],
|
||||
permissions: {
|
||||
allow: [Roles.rules.read],
|
||||
redirectTo: 'info',
|
||||
},
|
||||
type: 'COMPONENT',
|
||||
},
|
||||
loadChildren: () => import('./screens/rules/rules.module').then(m => m.RulesModule),
|
||||
},
|
||||
{
|
||||
path: 'file-attributes',
|
||||
component: BaseDossierTemplateScreenComponent,
|
||||
loadChildren: () =>
|
||||
import('./screens/file-attributes-listing/file-attributes-listing.module').then(m => m.FileAttributesListingModule),
|
||||
canActivate: [CompositeRouteGuard],
|
||||
data: {
|
||||
routeGuards: [IqserAuthGuard, RedRoleGuard],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'watermarks',
|
||||
component: BaseDossierTemplateScreenComponent,
|
||||
loadChildren: () => import('./screens/watermark/watermark.module').then(m => m.WatermarkModule),
|
||||
},
|
||||
{
|
||||
path: 'reports',
|
||||
component: BaseDossierTemplateScreenComponent,
|
||||
loadChildren: () => import('./screens/reports/reports.module').then(m => m.ReportsModule),
|
||||
canActivate: [IqserAuthGuard, IqserPermissionsGuard],
|
||||
data: {
|
||||
permissions: {
|
||||
allow: [Roles.reportTemplates.read],
|
||||
redirectTo: '/auth-error',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'dossier-attributes',
|
||||
component: BaseDossierTemplateScreenComponent,
|
||||
loadChildren: () =>
|
||||
import('./screens/dossier-attributes-listing/dossier-attributes-listing.module').then(m => m.DossierAttributesListingModule),
|
||||
canActivate: [CompositeRouteGuard],
|
||||
data: {
|
||||
routeGuards: [IqserAuthGuard, RedRoleGuard],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'dossier-states',
|
||||
component: BaseDossierTemplateScreenComponent,
|
||||
loadChildren: () =>
|
||||
import('./screens/dossier-states-listing/dossier-states-listing.module').then(m => m.DossierStatesListingModule),
|
||||
canActivate: [CompositeRouteGuard],
|
||||
data: {
|
||||
routeGuards: [IqserAuthGuard, RedRoleGuard],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'default-colors',
|
||||
component: DefaultColorsScreenComponent,
|
||||
canActivate: [CompositeRouteGuard],
|
||||
data: {
|
||||
routeGuards: [IqserAuthGuard, RedRoleGuard],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'justifications',
|
||||
component: BaseDossierTemplateScreenComponent,
|
||||
loadChildren: () => import('./screens/justifications/justifications.module').then(m => m.JustificationsModule),
|
||||
canActivate: [IqserPermissionsGuard],
|
||||
data: {
|
||||
permissions: {
|
||||
allow: [Roles.legalBasis.read],
|
||||
redirectTo: '/auth-error',
|
||||
},
|
||||
},
|
||||
},
|
||||
{ path: '', redirectTo: 'info', pathMatch: 'full' },
|
||||
];
|
||||
|
||||
const dossierTemplatesRoutes: IqserRoutes = [
|
||||
{
|
||||
path: '',
|
||||
component: BaseAdminScreenComponent,
|
||||
canActivate: [IqserAuthGuard],
|
||||
loadChildren: () =>
|
||||
import('./screens/dossier-templates-listing/dossier-templates-listing.module').then(m => m.DossierTemplatesListingModule),
|
||||
},
|
||||
{
|
||||
path: `:${DOSSIER_TEMPLATE_ID}`,
|
||||
children: dossierTemplateIdRoutes,
|
||||
canActivate: [templateExistsWhenEnteringAdmin()],
|
||||
},
|
||||
];
|
||||
|
||||
const routes: IqserRoutes = [
|
||||
{ path: '', redirectTo: 'dossier-templates', pathMatch: 'full' },
|
||||
{
|
||||
path: 'dossier-templates',
|
||||
children: dossierTemplatesRoutes,
|
||||
canActivate: [CompositeRouteGuard, IqserPermissionsGuard],
|
||||
data: {
|
||||
routeGuards: [IqserAuthGuard, RedRoleGuard, DossierTemplatesGuard],
|
||||
requiredRoles: ['RED_MANAGER', 'RED_ADMIN'],
|
||||
permissions: {
|
||||
allow: [Roles.templates.read],
|
||||
redirectTo: '/',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'users',
|
||||
component: BaseAdminScreenComponent,
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: UserListingScreenComponent,
|
||||
},
|
||||
],
|
||||
canActivate: [CompositeRouteGuard, IqserPermissionsGuard],
|
||||
data: {
|
||||
routeGuards: [IqserAuthGuard, RedRoleGuard],
|
||||
permissions: {
|
||||
allow: [Roles.users.read, 'RED_USER_ADMIN'],
|
||||
redirectTo: '/',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'dossier-permissions',
|
||||
component: BaseAdminScreenComponent,
|
||||
canActivate: [CompositeRouteGuard, IqserPermissionsGuard],
|
||||
data: {
|
||||
routeGuards: [IqserAuthGuard, RedRoleGuard, PermissionsGuard],
|
||||
permissionsObject: 'Dossier',
|
||||
permissions: {
|
||||
allow: [Roles.manageAclPermissions, 'RED_ADMIN'],
|
||||
redirectTo: '/',
|
||||
},
|
||||
},
|
||||
loadChildren: () => import('./screens/permissions/permissions.module').then(m => m.PermissionsModule),
|
||||
},
|
||||
{
|
||||
path: 'license-info',
|
||||
component: BaseAdminScreenComponent,
|
||||
canActivate: [IqserAuthGuard, IqserPermissionsGuard, RedRoleGuard],
|
||||
data: {
|
||||
permissions: {
|
||||
allow: [Roles.license.readReport, 'RED_ADMIN'],
|
||||
redirectTo: '/',
|
||||
},
|
||||
},
|
||||
loadChildren: () => import('./screens/license/license.module').then(m => m.LicenseModule),
|
||||
},
|
||||
{
|
||||
path: 'digital-signature',
|
||||
component: BaseAdminScreenComponent,
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: DigitalSignatureScreenComponent,
|
||||
},
|
||||
],
|
||||
canActivate: [IqserAuthGuard, IqserPermissionsGuard, RedRoleGuard],
|
||||
data: {
|
||||
permissions: {
|
||||
allow: [Roles.digitalSignature.read, 'RED_ADMIN'],
|
||||
redirectTo: '/',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'audit',
|
||||
component: BaseAdminScreenComponent,
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: AuditScreenComponent,
|
||||
},
|
||||
],
|
||||
canActivate: [IqserAuthGuard, IqserPermissionsGuard, RedRoleGuard],
|
||||
data: {
|
||||
permissions: {
|
||||
allow: [Roles.searchAudit, 'RED_ADMIN'],
|
||||
redirectTo: '/',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'general-config',
|
||||
component: BaseAdminScreenComponent,
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: GeneralConfigScreenComponent,
|
||||
},
|
||||
],
|
||||
canActivate: [CompositeRouteGuard, IqserPermissionsGuard],
|
||||
canDeactivate: [PendingChangesGuard],
|
||||
data: {
|
||||
routeGuards: [IqserAuthGuard, RedRoleGuard],
|
||||
permissions: {
|
||||
allow: [Roles.generalConfiguration.read, Roles.smtp.read, 'RED_ADMIN'],
|
||||
redirectTo: '/',
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class AdminRoutingModule {}
|
||||
@ -1,130 +0,0 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { AdminRoutingModule } from './admin-routing.module';
|
||||
import { SharedModule } from '@shared/shared.module';
|
||||
import { AuditScreenComponent } from './screens/audit/audit-screen.component';
|
||||
import { DefaultColorsScreenComponent } from './screens/default-colors/default-colors-screen.component';
|
||||
import { EntitiesListingScreenComponent } from './screens/entities-listing/entities-listing-screen.component';
|
||||
import { DigitalSignatureScreenComponent } from './screens/digital-signature/digital-signature-screen.component';
|
||||
import { UserListingScreenComponent } from './screens/user-listing/user-listing-screen.component';
|
||||
import { DossierTemplateBreadcrumbsComponent } from './shared/components/dossier-template-breadcrumbs/dossier-template-breadcrumbs.component';
|
||||
import { AddEditCloneDossierTemplateDialogComponent } from './dialogs/add-edit-dossier-template-dialog/add-edit-clone-dossier-template-dialog.component';
|
||||
import { AddEntityDialogComponent } from './dialogs/add-entity-dialog/add-entity-dialog.component';
|
||||
import { EditColorDialogComponent } from './dialogs/edit-color-dialog/edit-color-dialog.component';
|
||||
import { AdminDialogService } from './services/admin-dialog.service';
|
||||
import { GeneralConfigScreenComponent } from './screens/general-config/general-config-screen.component';
|
||||
import { SmtpAuthDialogComponent } from './dialogs/smtp-auth-dialog/smtp-auth-dialog.component';
|
||||
import { AddEditUserDialogComponent } from './dialogs/add-edit-user-dialog/add-edit-user-dialog.component';
|
||||
import { UsersStatsComponent } from './components/users-stats/users-stats.component';
|
||||
import { ResetPasswordComponent } from './dialogs/add-edit-user-dialog/reset-password/reset-password.component';
|
||||
import { UserDetailsComponent } from './dialogs/add-edit-user-dialog/user-details/user-details.component';
|
||||
import { AuditService } from './services/audit.service';
|
||||
import { DigitalSignatureService } from './services/digital-signature.service';
|
||||
import { BaseAdminScreenComponent } from './base-admin-screen/base-admin-screen.component';
|
||||
import { RulesService } from './services/rules.service';
|
||||
import { SmtpConfigService } from './services/smtp-config.service';
|
||||
import { UploadDictionaryDialogComponent } from './dialogs/upload-dictionary-dialog/upload-dictionary-dialog.component';
|
||||
import { GeneralConfigFormComponent } from './screens/general-config/general-config-form/general-config-form.component';
|
||||
import { SmtpFormComponent } from './screens/general-config/smtp-form/smtp-form.component';
|
||||
import { BaseDossierTemplateScreenComponent } from './base-dossier-templates-screen/base-dossier-template-screen.component';
|
||||
import { A11yModule } from '@angular/cdk/a11y';
|
||||
import { BaseEntityScreenComponent } from './base-entity-screen/base-entity-screen.component';
|
||||
import { AdminSideNavComponent } from './shared/components/admin-side-nav/admin-side-nav.component';
|
||||
import { SystemPreferencesFormComponent } from './screens/general-config/system-preferences-form/system-preferences-form.component';
|
||||
import { ConfigureCertificateDialogComponent } from './dialogs/configure-digital-signature-dialog/configure-certificate-dialog.component';
|
||||
import { PkcsSignatureConfigurationComponent } from './dialogs/configure-digital-signature-dialog/form/pkcs-signature-configuration/pkcs-signature-configuration.component';
|
||||
import { KmsSignatureConfigurationComponent } from './dialogs/configure-digital-signature-dialog/form/kms-signature-configuration/kms-signature-configuration.component';
|
||||
import {
|
||||
ChevronButtonComponent,
|
||||
CircleButtonComponent,
|
||||
DetailsRadioComponent,
|
||||
EditableInputComponent,
|
||||
EmptyStateComponent,
|
||||
HasScrollbarDirective,
|
||||
HumanizePipe,
|
||||
IconButtonComponent,
|
||||
InputWithActionComponent,
|
||||
IqserAllowDirective,
|
||||
IqserDenyDirective,
|
||||
IqserHelpModeModule,
|
||||
IqserListingModule,
|
||||
IqserUploadFileModule,
|
||||
RoundCheckboxComponent,
|
||||
} from '@iqser/common-ui';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { AuditInfoDialogComponent } from './dialogs/audit-info-dialog/audit-info-dialog.component';
|
||||
import { DossierTemplateActionsComponent } from './shared/components/dossier-template-actions/dossier-template-actions.component';
|
||||
import { IqserUsersModule } from '@iqser/common-ui/lib/users';
|
||||
import { SelectComponent } from '@shared/components/select/select.component';
|
||||
import { PaginationComponent } from '@common-ui/pagination/pagination.component';
|
||||
|
||||
const dialogs = [
|
||||
AddEditCloneDossierTemplateDialogComponent,
|
||||
AddEntityDialogComponent,
|
||||
EditColorDialogComponent,
|
||||
SmtpAuthDialogComponent,
|
||||
AddEditUserDialogComponent,
|
||||
UploadDictionaryDialogComponent,
|
||||
ConfigureCertificateDialogComponent,
|
||||
AuditInfoDialogComponent,
|
||||
];
|
||||
|
||||
const screens = [
|
||||
AuditScreenComponent,
|
||||
DefaultColorsScreenComponent,
|
||||
EntitiesListingScreenComponent,
|
||||
DigitalSignatureScreenComponent,
|
||||
UserListingScreenComponent,
|
||||
GeneralConfigScreenComponent,
|
||||
];
|
||||
|
||||
const components = [
|
||||
UsersStatsComponent,
|
||||
ResetPasswordComponent,
|
||||
UserDetailsComponent,
|
||||
BaseAdminScreenComponent,
|
||||
BaseDossierTemplateScreenComponent,
|
||||
BaseEntityScreenComponent,
|
||||
GeneralConfigFormComponent,
|
||||
SmtpFormComponent,
|
||||
SystemPreferencesFormComponent,
|
||||
PkcsSignatureConfigurationComponent,
|
||||
KmsSignatureConfigurationComponent,
|
||||
|
||||
...dialogs,
|
||||
...screens,
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
declarations: [...components],
|
||||
providers: [AdminDialogService, AuditService, DigitalSignatureService, RulesService, SmtpConfigService],
|
||||
imports: [
|
||||
CommonModule,
|
||||
SharedModule,
|
||||
AdminRoutingModule,
|
||||
A11yModule,
|
||||
IqserUsersModule,
|
||||
TranslateModule,
|
||||
HumanizePipe,
|
||||
IqserListingModule,
|
||||
IqserUploadFileModule,
|
||||
IqserHelpModeModule,
|
||||
AdminSideNavComponent,
|
||||
DossierTemplateActionsComponent,
|
||||
DossierTemplateBreadcrumbsComponent,
|
||||
IconButtonComponent,
|
||||
CircleButtonComponent,
|
||||
ChevronButtonComponent,
|
||||
EmptyStateComponent,
|
||||
HasScrollbarDirective,
|
||||
RoundCheckboxComponent,
|
||||
InputWithActionComponent,
|
||||
EditableInputComponent,
|
||||
DetailsRadioComponent,
|
||||
IqserAllowDirective,
|
||||
IqserDenyDirective,
|
||||
SelectComponent,
|
||||
PaginationComponent,
|
||||
],
|
||||
})
|
||||
export class AdminModule {}
|
||||
302
apps/red-ui/src/app/modules/admin/admin.routes.ts
Normal file
302
apps/red-ui/src/app/modules/admin/admin.routes.ts
Normal file
@ -0,0 +1,302 @@
|
||||
import { inject, provideEnvironmentInitializer } from '@angular/core';
|
||||
import { PendingChangesGuard } from '@guards/can-deactivate.guard';
|
||||
import { templateExistsWhenEnteringAdmin } from '@guards/dossier-template-exists.guard';
|
||||
import { DossierTemplatesGuard } from '@guards/dossier-templates.guard';
|
||||
import { entityExistsGuard } from '@guards/entity-exists-guard.service';
|
||||
import { PermissionsGuard } from '@guards/permissions-guard';
|
||||
import { CompositeRouteGuard, IqserPermissionsGuard, IqserRoutes } from '@iqser/common-ui';
|
||||
import { IqserAuthGuard } from '@iqser/common-ui/lib/users';
|
||||
import { DOSSIER_TEMPLATE_ID, ENTITY_TYPE } from '@red/domain';
|
||||
import { CopilotService } from '@services/copilot.service';
|
||||
import { RedRoleGuard } from '@users/red-role.guard';
|
||||
import { Roles } from '@users/roles';
|
||||
import { BaseAdminScreenComponent } from './base-admin-screen/base-admin-screen.component';
|
||||
import { BaseDossierTemplateScreenComponent } from './base-dossier-templates-screen/base-dossier-template-screen.component';
|
||||
import { BaseEntityScreenComponent } from './base-entity-screen/base-entity-screen.component';
|
||||
import { AuditScreenComponent } from './screens/audit/audit-screen.component';
|
||||
import { DefaultColorsScreenComponent } from './screens/default-colors/default-colors-screen.component';
|
||||
import { DigitalSignatureScreenComponent } from './screens/digital-signature/digital-signature-screen.component';
|
||||
import { EntitiesListingScreenComponent } from './screens/entities-listing/entities-listing-screen.component';
|
||||
import { GeneralConfigScreenComponent } from './screens/general-config/general-config-screen.component';
|
||||
import { UserListingScreenComponent } from './screens/user-listing/user-listing-screen.component';
|
||||
import { AdminDialogService } from './services/admin-dialog.service';
|
||||
import { AuditService } from './services/audit.service';
|
||||
import { DigitalSignatureService } from './services/digital-signature.service';
|
||||
import { RulesService } from './services/rules.service';
|
||||
import { SmtpConfigService } from './services/smtp-config.service';
|
||||
|
||||
const entityRoutes: IqserRoutes = [
|
||||
{
|
||||
path: '',
|
||||
component: BaseDossierTemplateScreenComponent,
|
||||
children: [{ path: '', component: EntitiesListingScreenComponent }],
|
||||
canActivate: [CompositeRouteGuard],
|
||||
data: {
|
||||
routeGuards: [IqserAuthGuard, RedRoleGuard],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: `:${ENTITY_TYPE}`,
|
||||
component: BaseEntityScreenComponent,
|
||||
canActivate: [CompositeRouteGuard, entityExistsGuard()],
|
||||
data: {
|
||||
routeGuards: [IqserAuthGuard, RedRoleGuard],
|
||||
},
|
||||
loadChildren: () => import('./screens/entities/entities.routes'),
|
||||
},
|
||||
];
|
||||
|
||||
const dossierTemplateIdRoutes: IqserRoutes = [
|
||||
{ path: '', redirectTo: 'info', pathMatch: 'full' },
|
||||
{
|
||||
path: 'info',
|
||||
component: BaseDossierTemplateScreenComponent,
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
canDeactivate: [PendingChangesGuard],
|
||||
loadComponent: () => import('./screens/info/dossier-template-info-screen/dossier-template-info-screen.component'),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'entities',
|
||||
children: entityRoutes,
|
||||
},
|
||||
{
|
||||
path: '',
|
||||
component: BaseDossierTemplateScreenComponent,
|
||||
children: [
|
||||
{
|
||||
path: 'entity-rules',
|
||||
loadComponent: () => import('./screens/rules/rules-screen/rules-screen.component'),
|
||||
canActivate: [CompositeRouteGuard, IqserPermissionsGuard],
|
||||
canDeactivate: [PendingChangesGuard],
|
||||
data: {
|
||||
routeGuards: [IqserAuthGuard, RedRoleGuard],
|
||||
permissions: {
|
||||
allow: [Roles.rules.read],
|
||||
redirectTo: 'info',
|
||||
},
|
||||
type: 'ENTITY',
|
||||
},
|
||||
providers: [
|
||||
RulesService,
|
||||
provideEnvironmentInitializer(() => {
|
||||
return inject(CopilotService).connectAsync('/api/llm/llm-websocket');
|
||||
}),
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'component-rules',
|
||||
loadComponent: () => import('./screens/rules/rules-screen/rules-screen.component'),
|
||||
canActivate: [CompositeRouteGuard, IqserPermissionsGuard],
|
||||
canDeactivate: [PendingChangesGuard],
|
||||
data: {
|
||||
routeGuards: [IqserAuthGuard, RedRoleGuard],
|
||||
permissions: {
|
||||
allow: [Roles.rules.read],
|
||||
redirectTo: 'info',
|
||||
},
|
||||
type: 'COMPONENT',
|
||||
},
|
||||
providers: [RulesService],
|
||||
},
|
||||
{
|
||||
path: 'component-mappings',
|
||||
loadComponent: () => import('./screens/component-mappings/component-mappings-screen.component'),
|
||||
canActivate: [CompositeRouteGuard],
|
||||
data: {
|
||||
routeGuards: [IqserAuthGuard, RedRoleGuard],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'components',
|
||||
loadComponent: () => import('./screens/component-definitions/component-definitions.component'),
|
||||
canActivate: [CompositeRouteGuard],
|
||||
data: {
|
||||
routeGuards: [IqserAuthGuard, RedRoleGuard],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'file-attributes',
|
||||
loadComponent: () => import('./screens/file-attributes-listing/file-attributes-listing-screen.component'),
|
||||
canActivate: [CompositeRouteGuard],
|
||||
data: {
|
||||
routeGuards: [IqserAuthGuard, RedRoleGuard],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'watermarks',
|
||||
loadChildren: () => import('./screens/watermark/watermark.routes'),
|
||||
},
|
||||
{
|
||||
path: 'reports',
|
||||
loadComponent: () => import('./screens/reports/reports-screen/reports-screen.component'),
|
||||
canActivate: [IqserAuthGuard, IqserPermissionsGuard],
|
||||
data: {
|
||||
permissions: {
|
||||
allow: [Roles.reportTemplates.read],
|
||||
redirectTo: '/auth-error',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'dossier-attributes',
|
||||
loadComponent: () => import('./screens/dossier-attributes-listing/dossier-attributes-listing-screen.component'),
|
||||
canActivate: [CompositeRouteGuard],
|
||||
data: {
|
||||
routeGuards: [IqserAuthGuard, RedRoleGuard],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'dossier-states',
|
||||
loadComponent: () =>
|
||||
import('./screens/dossier-states-listing/dossier-states-listing-screen/dossier-states-listing-screen.component'),
|
||||
canActivate: [CompositeRouteGuard],
|
||||
data: {
|
||||
routeGuards: [IqserAuthGuard, RedRoleGuard],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'default-colors',
|
||||
component: DefaultColorsScreenComponent,
|
||||
canActivate: [CompositeRouteGuard],
|
||||
data: {
|
||||
routeGuards: [IqserAuthGuard, RedRoleGuard],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'justifications',
|
||||
loadComponent: () => import('./screens/justifications/justifications-screen/justifications-screen.component'),
|
||||
canActivate: [IqserPermissionsGuard],
|
||||
data: {
|
||||
permissions: {
|
||||
allow: [Roles.legalBasis.read],
|
||||
redirectTo: '/auth-error',
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
const dossierTemplatesRoutes: IqserRoutes = [
|
||||
{
|
||||
path: '',
|
||||
component: BaseAdminScreenComponent,
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
loadComponent: () =>
|
||||
import(
|
||||
'./screens/dossier-templates-listing/dossier-templates-listing-screen/dossier-templates-listing-screen.component'
|
||||
),
|
||||
},
|
||||
],
|
||||
canActivate: [IqserAuthGuard],
|
||||
},
|
||||
{
|
||||
path: `:${DOSSIER_TEMPLATE_ID}`,
|
||||
children: dossierTemplateIdRoutes,
|
||||
canActivate: [templateExistsWhenEnteringAdmin()],
|
||||
},
|
||||
];
|
||||
|
||||
export default [
|
||||
{ path: '', redirectTo: 'dossier-templates', pathMatch: 'full' },
|
||||
{
|
||||
path: 'dossier-templates',
|
||||
children: dossierTemplatesRoutes,
|
||||
canActivate: [CompositeRouteGuard, IqserPermissionsGuard],
|
||||
data: {
|
||||
routeGuards: [IqserAuthGuard, RedRoleGuard, DossierTemplatesGuard],
|
||||
requiredRoles: ['RED_MANAGER', 'RED_ADMIN'],
|
||||
permissions: {
|
||||
allow: [Roles.templates.read],
|
||||
redirectTo: '/',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '',
|
||||
component: BaseAdminScreenComponent,
|
||||
providers: [AdminDialogService],
|
||||
children: [
|
||||
{
|
||||
path: 'users',
|
||||
component: UserListingScreenComponent,
|
||||
canActivate: [CompositeRouteGuard, IqserPermissionsGuard],
|
||||
data: {
|
||||
routeGuards: [IqserAuthGuard, RedRoleGuard],
|
||||
permissions: {
|
||||
allow: [Roles.users.read, 'RED_USER_ADMIN'],
|
||||
redirectTo: '/',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'dossier-permissions',
|
||||
loadComponent: () => import('./screens/permissions/permissions-screen/permissions-screen.component'),
|
||||
canActivate: [CompositeRouteGuard, IqserPermissionsGuard],
|
||||
data: {
|
||||
routeGuards: [IqserAuthGuard, RedRoleGuard, PermissionsGuard],
|
||||
permissionsObject: 'Dossier',
|
||||
permissions: {
|
||||
allow: [Roles.manageAclPermissions, 'RED_ADMIN'],
|
||||
redirectTo: '/',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'license-info',
|
||||
loadChildren: () => import('./screens/license/license.routes'),
|
||||
canActivate: [IqserAuthGuard, IqserPermissionsGuard, RedRoleGuard],
|
||||
data: {
|
||||
permissions: {
|
||||
allow: [Roles.license.readReport, 'RED_ADMIN'],
|
||||
redirectTo: '/',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'digital-signature',
|
||||
component: DigitalSignatureScreenComponent,
|
||||
canActivate: [IqserAuthGuard, IqserPermissionsGuard, RedRoleGuard],
|
||||
data: {
|
||||
permissions: {
|
||||
allow: [Roles.digitalSignature.read, 'RED_ADMIN'],
|
||||
redirectTo: '/',
|
||||
},
|
||||
},
|
||||
providers: [DigitalSignatureService],
|
||||
},
|
||||
{
|
||||
path: 'audit',
|
||||
component: AuditScreenComponent,
|
||||
canActivate: [IqserAuthGuard, IqserPermissionsGuard, RedRoleGuard],
|
||||
data: {
|
||||
permissions: {
|
||||
allow: [Roles.searchAudit, 'RED_ADMIN'],
|
||||
redirectTo: '/',
|
||||
},
|
||||
},
|
||||
providers: [AuditService],
|
||||
},
|
||||
{
|
||||
path: 'general-config',
|
||||
component: GeneralConfigScreenComponent,
|
||||
canActivate: [CompositeRouteGuard, IqserPermissionsGuard],
|
||||
canDeactivate: [PendingChangesGuard],
|
||||
data: {
|
||||
routeGuards: [IqserAuthGuard, RedRoleGuard],
|
||||
permissions: {
|
||||
allow: [Roles.generalConfiguration.read, Roles.smtp.read, 'RED_ADMIN'],
|
||||
redirectTo: '/',
|
||||
},
|
||||
},
|
||||
providers: [SmtpConfigService],
|
||||
},
|
||||
],
|
||||
},
|
||||
] satisfies IqserRoutes;
|
||||
@ -1,7 +1,10 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { AdminSideNavComponent } from '../shared/components/admin-side-nav/admin-side-nav.component';
|
||||
import { RouterOutlet } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
templateUrl: './base-admin-screen.component.html',
|
||||
styleUrls: ['./base-admin-screen.component.scss'],
|
||||
imports: [AdminSideNavComponent, RouterOutlet],
|
||||
})
|
||||
export class BaseAdminScreenComponent {}
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
<!--TODO: Use this for all dossier template screens -->
|
||||
|
||||
<section>
|
||||
<div class="page-header">
|
||||
<redaction-dossier-template-breadcrumbs class="flex-1"></redaction-dossier-template-breadcrumbs>
|
||||
|
||||
@ -1,7 +1,22 @@
|
||||
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
||||
import { DossierTemplateBreadcrumbsComponent } from '../shared/components/dossier-template-breadcrumbs/dossier-template-breadcrumbs.component';
|
||||
import { DossierTemplateActionsComponent } from '../shared/components/dossier-template-actions/dossier-template-actions.component';
|
||||
import { CircleButtonComponent } from '@iqser/common-ui';
|
||||
import { RouterLink, RouterOutlet } from '@angular/router';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { AdminSideNavComponent } from '../shared/components/admin-side-nav/admin-side-nav.component';
|
||||
|
||||
@Component({
|
||||
templateUrl: './base-dossier-template-screen.component.html',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
imports: [
|
||||
DossierTemplateBreadcrumbsComponent,
|
||||
DossierTemplateActionsComponent,
|
||||
CircleButtonComponent,
|
||||
RouterLink,
|
||||
TranslateModule,
|
||||
AdminSideNavComponent,
|
||||
RouterOutlet,
|
||||
],
|
||||
})
|
||||
export class BaseDossierTemplateScreenComponent {}
|
||||
|
||||
@ -1,19 +1,33 @@
|
||||
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
|
||||
import { DOSSIER_TEMPLATE_ID, ENTITY_TYPE } from '@red/domain';
|
||||
import { Router } from '@angular/router';
|
||||
import { Router, RouterLink, RouterOutlet } from '@angular/router';
|
||||
import { firstValueFrom, Observable } from 'rxjs';
|
||||
import { AdminDialogService } from '../services/admin-dialog.service';
|
||||
import { DictionaryService } from '@services/entity-services/dictionary.service';
|
||||
import { LoadingService } from '@iqser/common-ui';
|
||||
import { CircleButtonComponent, LoadingService } from '@iqser/common-ui';
|
||||
import { DossierTemplatesService } from '@services/dossier-templates/dossier-templates.service';
|
||||
import { DictionariesMapService } from '@services/entity-services/dictionaries-map.service';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { PermissionsService } from '@services/permissions.service';
|
||||
import { getParam } from '@iqser/common-ui/lib/utils';
|
||||
import { DossierTemplateBreadcrumbsComponent } from '../shared/components/dossier-template-breadcrumbs/dossier-template-breadcrumbs.component';
|
||||
import { AsyncPipe, NgIf } from '@angular/common';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { AdminSideNavComponent } from '../shared/components/admin-side-nav/admin-side-nav.component';
|
||||
|
||||
@Component({
|
||||
templateUrl: './base-entity-screen.component.html',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
imports: [
|
||||
DossierTemplateBreadcrumbsComponent,
|
||||
CircleButtonComponent,
|
||||
NgIf,
|
||||
AsyncPipe,
|
||||
TranslateModule,
|
||||
RouterLink,
|
||||
AdminSideNavComponent,
|
||||
RouterOutlet,
|
||||
],
|
||||
})
|
||||
export class BaseEntityScreenComponent implements OnInit {
|
||||
readonly disabledItems$: Observable<string[]>;
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
|
||||
<div class="mt-44">
|
||||
<redaction-donut-chart
|
||||
[config]="chartConfig"
|
||||
[config]="chartConfig()"
|
||||
[radius]="63"
|
||||
[strokeWidth]="15"
|
||||
[subtitles]="['user-stats.chart.users' | translate]"
|
||||
|
||||
@ -1,12 +1,16 @@
|
||||
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
||||
import { Component, EventEmitter, input, Input, output, Output } from '@angular/core';
|
||||
import { DonutChartConfig } from '@red/domain';
|
||||
import { CircleButtonComponent } from '@iqser/common-ui';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { DonutChartComponent } from '@shared/components/donut-chart/donut-chart.component';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-users-stats',
|
||||
templateUrl: './users-stats.component.html',
|
||||
styleUrls: ['./users-stats.component.scss'],
|
||||
imports: [CircleButtonComponent, TranslateModule, DonutChartComponent],
|
||||
})
|
||||
export class UsersStatsComponent {
|
||||
@Output() toggleCollapse = new EventEmitter();
|
||||
@Input() chartConfig: DonutChartConfig[];
|
||||
readonly chartConfig = input.required<DonutChartConfig[]>();
|
||||
readonly toggleCollapse = output();
|
||||
}
|
||||
|
||||
@ -0,0 +1,48 @@
|
||||
<section class="dialog">
|
||||
<div [innerHTML]="'add-clone-dossier-template.title' | translate: translateParams" class="dialog-header heading-l"></div>
|
||||
|
||||
<form [formGroup]="form">
|
||||
<div class="dialog-content">
|
||||
<div class="iqser-input-group required w-300">
|
||||
<label [translate]="'add-edit-clone-dossier-template.form.name'"></label>
|
||||
<input
|
||||
[placeholder]="'add-edit-clone-dossier-template.form.name-placeholder' | translate"
|
||||
formControlName="name"
|
||||
name="name"
|
||||
type="text"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="iqser-input-group w-400">
|
||||
<label [translate]="'add-edit-clone-dossier-template.form.description'"></label>
|
||||
<textarea
|
||||
[placeholder]="'add-edit-clone-dossier-template.form.description-placeholder' | translate"
|
||||
formControlName="description"
|
||||
name="description"
|
||||
rows="4"
|
||||
type="text"
|
||||
></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="dialog-actions">
|
||||
<iqser-icon-button
|
||||
(action)="save()"
|
||||
[buttonId]="'saveButton'"
|
||||
[disabled]="disabled"
|
||||
[label]="'add-clone-dossier-template.save' | translate: translateParams"
|
||||
[type]="iconButtonTypes.primary"
|
||||
></iqser-icon-button>
|
||||
|
||||
<iqser-icon-button
|
||||
(action)="save({ nextAction: true })"
|
||||
[buttonId]="'saveButton'"
|
||||
[disabled]="disabled"
|
||||
[label]="'add-clone-dossier-template.save-and-edit' | translate"
|
||||
[type]="iconButtonTypes.dark"
|
||||
></iqser-icon-button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<iqser-circle-button (action)="close()" class="dialog-close" icon="iqser:close"></iqser-circle-button>
|
||||
</section>
|
||||
@ -0,0 +1,103 @@
|
||||
import { HttpStatusCode } from '@angular/common/http';
|
||||
import { Component, Inject } from '@angular/core';
|
||||
import { ReactiveFormsModule, Validators } from '@angular/forms';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { BaseDialogComponent, CircleButtonComponent, getConfig, IconButtonComponent, SaveOptions } from '@iqser/common-ui';
|
||||
import { DossierTemplate } from '@red/domain';
|
||||
import { DossierTemplatesService } from '@services/dossier-templates/dossier-templates.service';
|
||||
import { Router } from '@angular/router';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
export interface CloneTemplateData {
|
||||
dossierTemplateId?: string;
|
||||
}
|
||||
|
||||
@Component({
|
||||
templateUrl: './add-clone-dossier-template-dialog.component.html',
|
||||
styleUrls: ['./add-clone-dossier-template-dialog.component.scss'],
|
||||
imports: [TranslateModule, ReactiveFormsModule, IconButtonComponent, CircleButtonComponent],
|
||||
})
|
||||
export class AddCloneDossierTemplateDialogComponent extends BaseDialogComponent {
|
||||
readonly dossierTemplate?: DossierTemplate;
|
||||
readonly isDocumine = getConfig().IS_DOCUMINE;
|
||||
readonly translateParams: { type: string; dossierTemplateName?: string };
|
||||
|
||||
constructor(
|
||||
private readonly _dossierTemplatesService: DossierTemplatesService,
|
||||
private readonly _router: Router,
|
||||
protected readonly _dialogRef: MatDialogRef<AddCloneDossierTemplateDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) readonly data: CloneTemplateData,
|
||||
) {
|
||||
super(_dialogRef);
|
||||
this.dossierTemplate = this._dossierTemplatesService.find(this.data.dossierTemplateId);
|
||||
|
||||
this.translateParams = {
|
||||
type: this.dossierTemplate ? 'clone' : 'create',
|
||||
dossierTemplateName: this.dossierTemplate?.name,
|
||||
};
|
||||
|
||||
this.form = this.#getForm();
|
||||
this.initialFormValue = this.form.getRawValue();
|
||||
}
|
||||
|
||||
override get disabled(): boolean {
|
||||
// Ignore 'changed' value, doesn't make sense in this context
|
||||
return !this.valid || this._hasErrors();
|
||||
}
|
||||
|
||||
async save(options?: SaveOptions): Promise<void> {
|
||||
let dossierTemplate: DossierTemplate;
|
||||
this._loadingService.start();
|
||||
const body = {
|
||||
...this.dossierTemplate,
|
||||
...this.form.getRawValue(),
|
||||
};
|
||||
try {
|
||||
if (this.dossierTemplate) {
|
||||
dossierTemplate = await this._dossierTemplatesService.clone(this.dossierTemplate.id, body);
|
||||
} else {
|
||||
dossierTemplate = await this._dossierTemplatesService.createOrUpdate(body);
|
||||
}
|
||||
if (options?.nextAction) {
|
||||
await this._router.navigate([dossierTemplate.routerLink]);
|
||||
}
|
||||
this._dialogRef.close(true);
|
||||
} catch (error) {
|
||||
if (error.status === HttpStatusCode.Conflict) {
|
||||
this._toaster.error(_('add-edit-clone-dossier-template.error.conflict'), { error });
|
||||
} else {
|
||||
this._toaster.rawError(error.error.message);
|
||||
}
|
||||
}
|
||||
this._loadingService.stop();
|
||||
}
|
||||
|
||||
#getForm() {
|
||||
return this._formBuilder.group({
|
||||
name: [this.dossierTemplate ? this.#getCloneName(this.dossierTemplate) : undefined, Validators.required],
|
||||
description: [this.dossierTemplate?.description],
|
||||
});
|
||||
}
|
||||
|
||||
#getCloneName(initialTemplate: DossierTemplate): string {
|
||||
const templateName = initialTemplate.name.trim();
|
||||
let nameOfClonedTemplate: string = templateName.split('Copy of ').filter(n => n)[0];
|
||||
nameOfClonedTemplate = nameOfClonedTemplate.split(/\(\s*\d+\s*\)$/)[0].trim();
|
||||
const allTemplatesNames = this._dossierTemplatesService.all.map(t => t.name);
|
||||
|
||||
let clonesCount = 0;
|
||||
for (const name of allTemplatesNames) {
|
||||
const splitName = name.split(nameOfClonedTemplate);
|
||||
const suffixRegExp = new RegExp(/^\(\s*\d+\s*\)$/);
|
||||
if (splitName[0] === 'Copy of ' && (splitName[1].trim().match(suffixRegExp) || splitName[1] === '')) {
|
||||
clonesCount++;
|
||||
}
|
||||
}
|
||||
|
||||
if (clonesCount >= 1) {
|
||||
return `Copy of ${nameOfClonedTemplate} (${clonesCount})`;
|
||||
}
|
||||
return `Copy of ${nameOfClonedTemplate}`;
|
||||
}
|
||||
}
|
||||
@ -1,58 +0,0 @@
|
||||
.validity {
|
||||
width: 230px;
|
||||
display: flex;
|
||||
|
||||
> div {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-top: 16px;
|
||||
|
||||
mat-checkbox {
|
||||
margin-right: 16px;
|
||||
height: 100%;
|
||||
align-items: center;
|
||||
display: flex;
|
||||
min-height: 42px;
|
||||
}
|
||||
|
||||
.iqser-input-group {
|
||||
min-height: 42px;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
redaction-select {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.download-includes {
|
||||
margin: 16px 0 10px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.hidden-elements {
|
||||
display: flex;
|
||||
gap: 40px;
|
||||
|
||||
.iqser-input-group {
|
||||
margin-top: 0;
|
||||
flex: 1;
|
||||
|
||||
mat-checkbox {
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.info {
|
||||
margin-left: 24px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.half-flex-basis {
|
||||
flex-basis: 50%;
|
||||
}
|
||||
|
||||
.pl-75 {
|
||||
padding: 0 0 0 75px;
|
||||
}
|
||||
@ -1,173 +0,0 @@
|
||||
import { HttpStatusCode } from '@angular/common/http';
|
||||
import { Component, Inject } from '@angular/core';
|
||||
import { AbstractControl, Validators } from '@angular/forms';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { BaseDialogComponent, getConfig } from '@iqser/common-ui';
|
||||
import { DossierTemplate, IDossierTemplate } from '@red/domain';
|
||||
import { DossierTemplatesService } from '@services/dossier-templates/dossier-templates.service';
|
||||
import { downloadTypesTranslations } from '@translations/download-types-translations';
|
||||
import { applyIntervalConstraints } from '@utils/date-inputs-utils';
|
||||
import dayjs, { Dayjs } from 'dayjs';
|
||||
|
||||
interface EditCloneTemplateData {
|
||||
dossierTemplateId: string;
|
||||
clone?: boolean;
|
||||
}
|
||||
|
||||
const downloadTypes = ['ORIGINAL', 'PREVIEW', 'DELTA_PREVIEW', 'REDACTED'].map(type => ({
|
||||
key: type,
|
||||
label: downloadTypesTranslations[type],
|
||||
}));
|
||||
|
||||
@Component({
|
||||
templateUrl: './add-edit-clone-dossier-template-dialog.component.html',
|
||||
styleUrls: ['./add-edit-clone-dossier-template-dialog.component.scss'],
|
||||
})
|
||||
export class AddEditCloneDossierTemplateDialogComponent extends BaseDialogComponent {
|
||||
readonly isDocumine = getConfig().IS_DOCUMINE;
|
||||
hasValidFrom: boolean;
|
||||
hasValidTo: boolean;
|
||||
readonly downloadTypes = downloadTypes;
|
||||
readonly dossierTemplate: DossierTemplate;
|
||||
private _previousValidFrom: Dayjs;
|
||||
private _previousValidTo: Dayjs;
|
||||
private _lastValidFrom: Dayjs;
|
||||
private _lastValidTo: Dayjs;
|
||||
|
||||
get disabled(): boolean {
|
||||
if (!this.data?.clone) {
|
||||
return super.disabled;
|
||||
}
|
||||
return !this.valid;
|
||||
}
|
||||
|
||||
get translateParams() {
|
||||
return {
|
||||
type: this.dossierTemplate ? (this.data.clone ? 'clone' : 'edit') : 'create',
|
||||
name: this.dossierTemplate?.name,
|
||||
};
|
||||
}
|
||||
|
||||
constructor(
|
||||
private readonly _dossierTemplatesService: DossierTemplatesService,
|
||||
protected readonly _dialogRef: MatDialogRef<AddEditCloneDossierTemplateDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) readonly data: EditCloneTemplateData,
|
||||
) {
|
||||
super(_dialogRef, !!data && !data.clone);
|
||||
this.dossierTemplate = this._dossierTemplatesService.find(this.data?.dossierTemplateId);
|
||||
this.form = this.#getForm();
|
||||
this.initialFormValue = this.form.getRawValue();
|
||||
this.hasValidFrom = !!this.dossierTemplate?.validFrom;
|
||||
this.hasValidTo = !!this.dossierTemplate?.validTo;
|
||||
|
||||
this._previousValidFrom = this._lastValidFrom = this.form.get('validFrom').value;
|
||||
this._previousValidTo = this._lastValidTo = this.form.get('validTo').value;
|
||||
}
|
||||
|
||||
toggleHasValid(extremity: string) {
|
||||
if (extremity === 'from') {
|
||||
this.hasValidFrom = !this.hasValidFrom;
|
||||
this.form.controls['validFrom'].setValue(this.hasValidFrom ? this._lastValidFrom : null);
|
||||
} else {
|
||||
this.hasValidTo = !this.hasValidTo;
|
||||
this.form.controls['validTo'].setValue(this.hasValidTo ? this._lastValidTo : null);
|
||||
}
|
||||
this.applyValidityIntervalConstraints();
|
||||
}
|
||||
|
||||
async save() {
|
||||
this._loadingService.start();
|
||||
const dossierTemplate = {
|
||||
dossierTemplateId: this.dossierTemplate?.dossierTemplateId,
|
||||
...this.form.getRawValue(),
|
||||
validFrom: this.hasValidFrom ? this.form.get('validFrom').value : null,
|
||||
validTo: this.hasValidTo ? this.form.get('validTo').value : null,
|
||||
} as IDossierTemplate;
|
||||
|
||||
try {
|
||||
if (this.data?.clone) {
|
||||
await this._dossierTemplatesService.clone(this.dossierTemplate.id, dossierTemplate);
|
||||
} else {
|
||||
await this._dossierTemplatesService.createOrUpdate(dossierTemplate);
|
||||
}
|
||||
this._dialogRef.close(true);
|
||||
} catch (error) {
|
||||
if (error.status === HttpStatusCode.Conflict) {
|
||||
this._toaster.error(_('add-edit-clone-dossier-template.error.conflict'), { error });
|
||||
} else {
|
||||
this._toaster.rawError(error.error.message);
|
||||
}
|
||||
}
|
||||
this._loadingService.stop();
|
||||
}
|
||||
|
||||
applyValidityIntervalConstraints(): void {
|
||||
const formValue = this.form.value;
|
||||
applyIntervalConstraints(formValue, this._previousValidFrom, this._previousValidTo, this.form, 'validFrom', 'validTo');
|
||||
|
||||
this._previousValidFrom = this.form.get('validFrom').value;
|
||||
this._previousValidTo = this.form.get('validTo').value;
|
||||
this._lastValidFrom = this._previousValidFrom || this._lastValidFrom;
|
||||
this._lastValidTo = this._previousValidTo || this._lastValidTo;
|
||||
}
|
||||
|
||||
#getForm() {
|
||||
return this._formBuilder.group({
|
||||
name: [this.#getCloneName(), Validators.required],
|
||||
description: [this.dossierTemplate?.description],
|
||||
validFrom: [
|
||||
this.dossierTemplate?.validFrom ? dayjs(this.dossierTemplate?.validFrom) : null,
|
||||
this.#requiredIfValidator(() => this.hasValidFrom),
|
||||
],
|
||||
validTo: [
|
||||
this.dossierTemplate?.validTo ? dayjs(this.dossierTemplate?.validTo) : null,
|
||||
this.#requiredIfValidator(() => this.hasValidTo),
|
||||
],
|
||||
applyDictionaryUpdatesToAllDossiersByDefault: [this.dossierTemplate?.applyDictionaryUpdatesToAllDossiersByDefault],
|
||||
ocrByDefault: [this.dossierTemplate?.ocrByDefault],
|
||||
removeWatermark: [this.dossierTemplate?.removeWatermark],
|
||||
downloadFileTypes: [this.dossierTemplate?.downloadFileTypes || ['PREVIEW', 'REDACTED']],
|
||||
keepHiddenText: [this.dossierTemplate?.keepHiddenText],
|
||||
keepImageMetadata: [this.dossierTemplate?.keepImageMetadata],
|
||||
keepOverlappingObjects: [this.dossierTemplate?.keepOverlappingObjects],
|
||||
});
|
||||
}
|
||||
|
||||
#getCloneName(): string {
|
||||
if (!this.data?.clone) {
|
||||
return this.dossierTemplate?.name;
|
||||
}
|
||||
|
||||
const templateName = this.dossierTemplate.name.trim();
|
||||
let nameOfClonedTemplate: string = templateName.split('Copy of ').filter(n => n)[0];
|
||||
nameOfClonedTemplate = nameOfClonedTemplate.split(/\(\s*\d+\s*\)$/)[0].trim();
|
||||
const allTemplatesNames = this._dossierTemplatesService.all.map(t => t.name);
|
||||
|
||||
let clonesCount = 0;
|
||||
for (const name of allTemplatesNames) {
|
||||
const splitName = name.split(nameOfClonedTemplate);
|
||||
const suffixRegExp = new RegExp(/^\(\s*\d+\s*\)$/);
|
||||
if (splitName[0] === 'Copy of ' && (splitName[1].trim().match(suffixRegExp) || splitName[1] === '')) {
|
||||
clonesCount++;
|
||||
}
|
||||
}
|
||||
|
||||
if (clonesCount >= 1) {
|
||||
return `Copy of ${nameOfClonedTemplate} (${clonesCount})`;
|
||||
}
|
||||
return `Copy of ${nameOfClonedTemplate}`;
|
||||
}
|
||||
|
||||
#requiredIfValidator(predicate) {
|
||||
return (formControl: AbstractControl) => {
|
||||
if (!formControl.parent) {
|
||||
return null;
|
||||
}
|
||||
if (predicate()) {
|
||||
return Validators.required(formControl);
|
||||
}
|
||||
return null;
|
||||
};
|
||||
}
|
||||
}
|
||||
@ -1,18 +1,23 @@
|
||||
import { Component, Inject, ViewChild } from '@angular/core';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { BaseDialogComponent, CircleButtonComponent } from '@iqser/common-ui';
|
||||
import { User } from '@red/domain';
|
||||
import { ResetPasswordComponent } from './reset-password/reset-password.component';
|
||||
import { UserDetailsComponent } from './user-details/user-details.component';
|
||||
import { BaseDialogComponent } from '@iqser/common-ui';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-add-edit-user-dialog',
|
||||
templateUrl: './add-edit-user-dialog.component.html',
|
||||
imports: [UserDetailsComponent, ResetPasswordComponent, CircleButtonComponent],
|
||||
})
|
||||
export class AddEditUserDialogComponent extends BaseDialogComponent {
|
||||
resettingPassword = false;
|
||||
@ViewChild(UserDetailsComponent) private readonly _userDetailsComponent: UserDetailsComponent;
|
||||
resettingPassword = false;
|
||||
|
||||
constructor(protected readonly _dialogRef: MatDialogRef<AddEditUserDialogComponent>, @Inject(MAT_DIALOG_DATA) readonly user: User) {
|
||||
constructor(
|
||||
protected readonly _dialogRef: MatDialogRef<AddEditUserDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) readonly user: User,
|
||||
) {
|
||||
super(_dialogRef, !!user);
|
||||
}
|
||||
|
||||
|
||||
@ -1,13 +1,16 @@
|
||||
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
||||
import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
|
||||
import { ReactiveFormsModule, UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
|
||||
import { UserService } from '@users/user.service';
|
||||
import { IconButtonTypes, LoadingService } from '@iqser/common-ui';
|
||||
import { IconButtonComponent, IconButtonTypes, LoadingService } from '@iqser/common-ui';
|
||||
import { User } from '@red/domain';
|
||||
import { firstValueFrom } from 'rxjs';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { NamePipe } from '@common-ui/users/name.pipe';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-reset-password',
|
||||
templateUrl: './reset-password.component.html',
|
||||
imports: [TranslateModule, NamePipe, ReactiveFormsModule, IconButtonComponent],
|
||||
})
|
||||
export class ResetPasswordComponent {
|
||||
readonly iconButtonTypes = IconButtonTypes;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<div
|
||||
[translateParams]="{
|
||||
type: user ? 'edit' : 'create'
|
||||
type: !!user() ? 'edit' : 'create',
|
||||
}"
|
||||
[translate]="'add-edit-user.title'"
|
||||
class="dialog-header heading-l"
|
||||
@ -32,14 +32,22 @@
|
||||
[formControlName]="role"
|
||||
color="primary"
|
||||
>
|
||||
{{ translations[role] | translate }}
|
||||
{{ translations[role] | translate: { count: 1 } }}
|
||||
</mat-checkbox>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (!user()) {
|
||||
<div class="iqser-input-group">
|
||||
<label [translate]="'add-edit-user.form.account-setup'"></label>
|
||||
<mat-checkbox formControlName="sendSetPasswordMail">{{ 'add-edit-user.form.send-email' | translate }}</mat-checkbox>
|
||||
<span [translate]="'add-edit-user.form.send-email-explanation'" class="hint"></span>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div
|
||||
(click)="toggleResetPassword.emit()"
|
||||
*ngIf="!!user"
|
||||
*ngIf="!!user()"
|
||||
[translate]="'add-edit-user.form.reset-password'"
|
||||
class="mt-24 fit-content link-action"
|
||||
></div>
|
||||
@ -48,14 +56,14 @@
|
||||
<div class="dialog-actions">
|
||||
<iqser-icon-button
|
||||
[disabled]="form.invalid || !changed"
|
||||
[label]="(user ? 'add-edit-user.actions.save-changes' : 'add-edit-user.actions.save') | translate"
|
||||
[label]="(user() ? 'add-edit-user.actions.save-changes' : 'add-edit-user.actions.save') | translate"
|
||||
[submit]="true"
|
||||
[type]="iconButtonTypes.primary"
|
||||
></iqser-icon-button>
|
||||
|
||||
<iqser-icon-button
|
||||
(action)="delete()"
|
||||
*ngIf="user && !disabledDelete(user)"
|
||||
*ngIf="user() && !disabledDelete(user())"
|
||||
[label]="'add-edit-user.actions.delete' | translate"
|
||||
[type]="iconButtonTypes.dark"
|
||||
icon="iqser:trash"
|
||||
|
||||
@ -5,3 +5,7 @@
|
||||
margin-top: 8px;
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
.hint {
|
||||
margin-left: 23px;
|
||||
}
|
||||
|
||||
@ -1,29 +1,31 @@
|
||||
import { Component, EventEmitter, Input, OnChanges, Output } from '@angular/core';
|
||||
import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
|
||||
import { Component, input, OnInit, output } from '@angular/core';
|
||||
import { ReactiveFormsModule, UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
|
||||
import { AdminDialogService } from '../../../services/admin-dialog.service';
|
||||
import { BaseFormComponent, LoadingService, Toaster } from '@iqser/common-ui';
|
||||
import { BaseFormComponent, IconButtonComponent, LoadingService, Toaster } from '@iqser/common-ui';
|
||||
import { rolesTranslations } from '@translations/roles-translations';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { User } from '@red/domain';
|
||||
import { UserService } from '@users/user.service';
|
||||
import { HttpStatusCode } from '@angular/common/http';
|
||||
import { firstValueFrom } from 'rxjs';
|
||||
import { IProfileUpdateRequest } from '@iqser/common-ui/lib/users';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { MatCheckbox } from '@angular/material/checkbox';
|
||||
import { NgForOf, NgIf } from '@angular/common';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-user-details',
|
||||
templateUrl: './user-details.component.html',
|
||||
styleUrls: ['./user-details.component.scss'],
|
||||
imports: [TranslateModule, ReactiveFormsModule, MatCheckbox, NgForOf, IconButtonComponent, NgIf],
|
||||
})
|
||||
export class UserDetailsComponent extends BaseFormComponent implements OnChanges {
|
||||
/** e.g. a RED_ADMIN is automatically a RED_USER_ADMIN => can't disable RED_USER_ADMIN as long as RED_ADMIN is checked */
|
||||
private readonly _ROLE_REQUIREMENTS = { RED_MANAGER: 'RED_USER', RED_ADMIN: 'RED_USER_ADMIN' };
|
||||
@Input() user: User;
|
||||
@Output() readonly toggleResetPassword = new EventEmitter();
|
||||
@Output() readonly closeDialog = new EventEmitter();
|
||||
@Output() readonly cancel = new EventEmitter();
|
||||
export class UserDetailsComponent extends BaseFormComponent implements OnInit {
|
||||
user = input<User>();
|
||||
readonly toggleResetPassword = output();
|
||||
readonly closeDialog = output<boolean>();
|
||||
readonly cancel = output();
|
||||
readonly ROLES = ['RED_USER', 'RED_MANAGER', 'RED_USER_ADMIN', 'RED_ADMIN'];
|
||||
readonly translations = rolesTranslations;
|
||||
/** e.g. a RED_ADMIN is automatically a RED_USER_ADMIN => can't disable RED_USER_ADMIN as long as RED_ADMIN is checked */
|
||||
readonly #ROLE_REQUIREMENTS = { RED_MANAGER: 'RED_USER', RED_ADMIN: 'RED_USER_ADMIN' };
|
||||
|
||||
constructor(
|
||||
private readonly _formBuilder: UntypedFormBuilder,
|
||||
@ -44,13 +46,17 @@ export class UserDetailsComponent extends BaseFormComponent implements OnChanges
|
||||
}, []);
|
||||
}
|
||||
|
||||
private get _rolesControls(): any {
|
||||
get sendSetPasswordMail() {
|
||||
return !this.form.controls.sendSetPasswordMail.value;
|
||||
}
|
||||
|
||||
get #rolesControls() {
|
||||
return this.ROLES.reduce(
|
||||
(prev, role) => ({
|
||||
...prev,
|
||||
[role]: [
|
||||
{
|
||||
value: this.user && this.user.has(role),
|
||||
value: this.user() && this.user().has(role),
|
||||
disabled: this.shouldBeDisabled(role),
|
||||
},
|
||||
],
|
||||
@ -59,20 +65,20 @@ export class UserDetailsComponent extends BaseFormComponent implements OnChanges
|
||||
);
|
||||
}
|
||||
|
||||
ngOnChanges() {
|
||||
this.form = this._getForm();
|
||||
ngOnInit() {
|
||||
this.form = this.#getForm();
|
||||
this.initialFormValue = this.form.getRawValue();
|
||||
}
|
||||
|
||||
shouldBeDisabled(role: string): boolean {
|
||||
const isCurrentAdminUser = this.user && this.user.isAdmin && this.user.id === this._userService.currentUser.id;
|
||||
const isCurrentAdminUser = this.user() && this.user().isAdmin && this.user().id === this._userService.currentUser.id;
|
||||
return (
|
||||
// RED_ADMIN can't remove own RED_ADMIN role
|
||||
(role === 'RED_ADMIN' && isCurrentAdminUser) ||
|
||||
// only RED_ADMINs can edit RED_ADMIN roles
|
||||
(role === 'RED_ADMIN' && !this._userService.currentUser.isAdmin) ||
|
||||
Object.keys(this._ROLE_REQUIREMENTS).reduce(
|
||||
(value, key) => value || (role === this._ROLE_REQUIREMENTS[key] && this.user?.roles.includes(key)),
|
||||
Object.keys(this.#ROLE_REQUIREMENTS).reduce(
|
||||
(value, key) => value || (role === this.#ROLE_REQUIREMENTS[key] && this.user()?.roles.includes(key)),
|
||||
false,
|
||||
)
|
||||
);
|
||||
@ -80,38 +86,38 @@ export class UserDetailsComponent extends BaseFormComponent implements OnChanges
|
||||
|
||||
async save() {
|
||||
this._loadingService.start();
|
||||
const userData: IProfileUpdateRequest = { ...this.form.getRawValue(), roles: this.activeRoles };
|
||||
const userData: IProfileUpdateRequest = {
|
||||
...this.form.getRawValue(),
|
||||
roles: this.activeRoles,
|
||||
sendSetPasswordMail: this.sendSetPasswordMail,
|
||||
};
|
||||
|
||||
if (!this.user) {
|
||||
if (!this.user()) {
|
||||
await firstValueFrom(this._userService.create(userData))
|
||||
.then(() => {
|
||||
this.closeDialog.emit(true);
|
||||
})
|
||||
.catch(error => {
|
||||
if (error.status === HttpStatusCode.Conflict) {
|
||||
this._toaster.error(_('add-edit-user.error.email-already-used'));
|
||||
} else {
|
||||
this._toaster.error(_('add-edit-user.error.generic'));
|
||||
}
|
||||
this._toaster.error(null, { error });
|
||||
this._loadingService.stop();
|
||||
});
|
||||
} else {
|
||||
await firstValueFrom(this._userService.updateProfile(userData, this.user.id));
|
||||
await firstValueFrom(this._userService.updateProfile(userData, this.user().id));
|
||||
this.closeDialog.emit(true);
|
||||
}
|
||||
}
|
||||
|
||||
delete() {
|
||||
this._dialogService.deleteUsers([this.user.id], () => this.closeDialog.emit(true));
|
||||
this._dialogService.deleteUsers([this.user().id], () => this.closeDialog.emit(true));
|
||||
}
|
||||
|
||||
setRolesRequirements(checked: boolean, role: string): void {
|
||||
if (Object.keys(this._ROLE_REQUIREMENTS).includes(role)) {
|
||||
if (Object.keys(this.#ROLE_REQUIREMENTS).includes(role)) {
|
||||
if (checked) {
|
||||
this.form.patchValue({ [this._ROLE_REQUIREMENTS[role]]: true });
|
||||
this.form.controls[this._ROLE_REQUIREMENTS[role]].disable();
|
||||
this.form.patchValue({ [this.#ROLE_REQUIREMENTS[role]]: true });
|
||||
this.form.controls[this.#ROLE_REQUIREMENTS[role]].disable();
|
||||
} else {
|
||||
this.form.controls[this._ROLE_REQUIREMENTS[role]].enable();
|
||||
this.form.controls[this.#ROLE_REQUIREMENTS[role]].enable();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -122,18 +128,19 @@ export class UserDetailsComponent extends BaseFormComponent implements OnChanges
|
||||
return user.id === this._userService.currentUser.id || (userAdmin && !currentUserAdmin);
|
||||
}
|
||||
|
||||
private _getForm(): UntypedFormGroup {
|
||||
#getForm(): UntypedFormGroup {
|
||||
return this._formBuilder.group({
|
||||
firstName: [this.user?.firstName, Validators.required],
|
||||
lastName: [this.user?.lastName, Validators.required],
|
||||
firstName: [this.user()?.firstName, Validators.required],
|
||||
lastName: [this.user()?.lastName, Validators.required],
|
||||
email: [
|
||||
{
|
||||
value: this.user?.email,
|
||||
disabled: !!this.user?.email,
|
||||
value: this.user()?.email,
|
||||
disabled: !!this.user()?.email,
|
||||
},
|
||||
[Validators.required, Validators.email],
|
||||
],
|
||||
...this._rolesControls,
|
||||
...this.#rolesControls,
|
||||
sendSetPasswordMail: [false],
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
[type]="iconButtonTypes.primary"
|
||||
></iqser-icon-button>
|
||||
|
||||
<iqser-help-button *ngIf="!config.IS_DOCUMINE" [helpButtonKey]="'create_new_entity'"></iqser-help-button>
|
||||
<iqser-help-button *ngIf="!config.IS_DOCUMINE"></iqser-help-button>
|
||||
</div>
|
||||
|
||||
<iqser-circle-button (action)="close()" class="dialog-close" icon="iqser:close"></iqser-circle-button>
|
||||
|
||||
@ -1,7 +1,16 @@
|
||||
import { Component, inject, ViewChild } from '@angular/core';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { BaseDialogComponent, getConfig, IconButtonTypes } from '@iqser/common-ui';
|
||||
import {
|
||||
BaseDialogComponent,
|
||||
CircleButtonComponent,
|
||||
getConfig,
|
||||
HelpButtonComponent,
|
||||
IconButtonComponent,
|
||||
IconButtonTypes,
|
||||
} from '@iqser/common-ui';
|
||||
import { AddEditEntityComponent } from '@shared/components/add-edit-entity/add-edit-entity.component';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { NgIf } from '@angular/common';
|
||||
|
||||
interface DialogData {
|
||||
readonly dossierTemplateId: string;
|
||||
@ -10,6 +19,7 @@ interface DialogData {
|
||||
@Component({
|
||||
templateUrl: './add-entity-dialog.component.html',
|
||||
styleUrls: ['./add-entity-dialog.component.scss'],
|
||||
imports: [AddEditEntityComponent, TranslateModule, IconButtonComponent, NgIf, CircleButtonComponent, HelpButtonComponent],
|
||||
})
|
||||
export class AddEntityDialogComponent extends BaseDialogComponent {
|
||||
@ViewChild(AddEditEntityComponent, { static: true }) private readonly _addEditEntityComponent: AddEditEntityComponent;
|
||||
|
||||
@ -6,9 +6,11 @@
|
||||
<div class="table-header">Key</div>
|
||||
<div class="table-header">Value</div>
|
||||
|
||||
<ng-container *ngFor="let entry of data.auditEntry.details | keyvalue : originalOrder">
|
||||
<ng-container *ngFor="let entry of data.auditEntry.details | keyvalue: originalOrder">
|
||||
<div class="bold">{{ entry.key | humanize }}</div>
|
||||
<div>{{ entry.value }}</div>
|
||||
<div>
|
||||
<pre>{{ entry.value | json }}</pre>
|
||||
</div>
|
||||
</ng-container>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
import { KeyValue } from '@angular/common';
|
||||
import { JsonPipe, KeyValue, KeyValuePipe, NgForOf } from '@angular/common';
|
||||
import { ChangeDetectionStrategy, Component, Inject } from '@angular/core';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { BaseDialogComponent } from '@iqser/common-ui';
|
||||
import { BaseDialogComponent, CircleButtonComponent, HumanizePipe } from '@iqser/common-ui';
|
||||
import { IAudit } from '@red/domain';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
interface DialogData {
|
||||
readonly auditEntry: IAudit;
|
||||
@ -15,6 +16,7 @@ type OrderFn = (a: KeyValue<string, string>, b: KeyValue<string, string>) => num
|
||||
templateUrl: './audit-info-dialog.component.html',
|
||||
styleUrls: ['./audit-info-dialog.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
imports: [TranslateModule, NgForOf, KeyValuePipe, HumanizePipe, CircleButtonComponent, JsonPipe],
|
||||
})
|
||||
export class AuditInfoDialogComponent extends BaseDialogComponent {
|
||||
constructor(
|
||||
|
||||
@ -1,12 +1,18 @@
|
||||
import { ChangeDetectorRef, Component, ViewChild } from '@angular/core';
|
||||
import { digitalSignatureDialogTranslations } from '../../translations/digital-signature-dialog-translations';
|
||||
import { BaseDialogComponent, DetailsRadioOption } from '@iqser/common-ui';
|
||||
import { MatDialogRef } from '@angular/material/dialog';
|
||||
import { PkcsSignatureConfigurationComponent } from './form/pkcs-signature-configuration/pkcs-signature-configuration.component';
|
||||
import { KmsSignatureConfigurationComponent } from './form/kms-signature-configuration/kms-signature-configuration.component';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { NgIf } from '@angular/common';
|
||||
import { HttpStatusCode } from '@angular/common/http';
|
||||
import { ChangeDetectorRef, Component, ViewChild } from '@angular/core';
|
||||
import { ReactiveFormsModule } from '@angular/forms';
|
||||
import { MatDialogClose, MatDialogRef } from '@angular/material/dialog';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { DetailsRadioOption } from '@common-ui/inputs/details-radio/details-radio-option';
|
||||
import { DetailsRadioComponent } from '@common-ui/inputs/details-radio/details-radio.component';
|
||||
import { BaseDialogComponent, CircleButtonComponent, IconButtonComponent } from '@iqser/common-ui';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { DigitalSignatureOption, DigitalSignatureOptions } from '@red/domain';
|
||||
import { DigitalSignatureService } from '../../services/digital-signature.service';
|
||||
import { digitalSignatureDialogTranslations } from '../../translations/digital-signature-dialog-translations';
|
||||
import { KmsSignatureConfigurationComponent } from './form/kms-signature-configuration/kms-signature-configuration.component';
|
||||
import { PkcsSignatureConfigurationComponent } from './form/pkcs-signature-configuration/pkcs-signature-configuration.component';
|
||||
|
||||
const DEFAULT_DIALOG_WIDTH = '662px';
|
||||
const KMS_SIGNATURE_DIALOG_WIDTH = '810px';
|
||||
@ -14,6 +20,18 @@ const KMS_SIGNATURE_DIALOG_WIDTH = '810px';
|
||||
@Component({
|
||||
templateUrl: './configure-certificate-dialog.component.html',
|
||||
styleUrls: ['./configure-certificate-dialog.component.scss'],
|
||||
imports: [
|
||||
DetailsRadioComponent,
|
||||
NgIf,
|
||||
ReactiveFormsModule,
|
||||
TranslateModule,
|
||||
PkcsSignatureConfigurationComponent,
|
||||
KmsSignatureConfigurationComponent,
|
||||
IconButtonComponent,
|
||||
MatDialogClose,
|
||||
CircleButtonComponent,
|
||||
],
|
||||
providers: [DigitalSignatureService],
|
||||
})
|
||||
export class ConfigureCertificateDialogComponent extends BaseDialogComponent {
|
||||
@ViewChild(PkcsSignatureConfigurationComponent) pkcsSignatureConfigurationComponent: PkcsSignatureConfigurationComponent;
|
||||
|
||||
@ -1,20 +1,27 @@
|
||||
import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core';
|
||||
import { UntypedFormBuilder, Validators } from '@angular/forms';
|
||||
import { ReactiveFormsModule, UntypedFormBuilder, Validators } from '@angular/forms';
|
||||
import { BaseSignatureConfigurationComponent } from '../base-signature-configuration-component';
|
||||
import { DigitalSignatureOptions, IKmsDigitalSignature, IKmsDigitalSignatureRequest } from '@red/domain';
|
||||
import { firstValueFrom } from 'rxjs';
|
||||
import { DigitalSignatureService } from '../../../../services/digital-signature.service';
|
||||
import { UploadFileComponent } from '@iqser/common-ui';
|
||||
import { NgIf } from '@angular/common';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-kms-signature-configuration',
|
||||
templateUrl: './kms-signature-configuration.component.html',
|
||||
styleUrls: ['./kms-signature-configuration.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
imports: [UploadFileComponent, ReactiveFormsModule, NgIf, TranslateModule],
|
||||
})
|
||||
export class KmsSignatureConfigurationComponent extends BaseSignatureConfigurationComponent implements OnInit {
|
||||
@Input() digitalSignature!: IKmsDigitalSignatureRequest;
|
||||
|
||||
constructor(protected readonly _digitalSignatureService: DigitalSignatureService, private readonly _formBuilder: UntypedFormBuilder) {
|
||||
constructor(
|
||||
protected readonly _digitalSignatureService: DigitalSignatureService,
|
||||
private readonly _formBuilder: UntypedFormBuilder,
|
||||
) {
|
||||
super(_digitalSignatureService, DigitalSignatureOptions.KMS);
|
||||
}
|
||||
|
||||
|
||||
@ -1,16 +1,20 @@
|
||||
import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core';
|
||||
import { UntypedFormBuilder, Validators } from '@angular/forms';
|
||||
import { ReactiveFormsModule, UntypedFormBuilder, Validators } from '@angular/forms';
|
||||
import { DigitalSignatureOptions, IPkcsDigitalSignature, IPkcsDigitalSignatureRequest } from '@red/domain';
|
||||
import { lastIndexOfEnd } from '@utils/functions';
|
||||
import { firstValueFrom } from 'rxjs';
|
||||
import { DigitalSignatureService } from '../../../../services/digital-signature.service';
|
||||
import { BaseSignatureConfigurationComponent } from '../base-signature-configuration-component';
|
||||
import { UploadFileComponent } from '@iqser/common-ui';
|
||||
import { NgIf } from '@angular/common';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-pkcs-signature-configuration',
|
||||
templateUrl: './pkcs-signature-configuration.component.html',
|
||||
styleUrls: ['./pkcs-signature-configuration.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
imports: [UploadFileComponent, ReactiveFormsModule, NgIf, TranslateModule],
|
||||
})
|
||||
export class PkcsSignatureConfigurationComponent extends BaseSignatureConfigurationComponent implements OnInit {
|
||||
@Input() digitalSignature!: IPkcsDigitalSignatureRequest;
|
||||
|
||||
@ -1,12 +1,16 @@
|
||||
import { Component, Inject } from '@angular/core';
|
||||
import { DefaultColorType } from '@red/domain';
|
||||
import { BaseDialogComponent, IconButtonTypes } from '@iqser/common-ui';
|
||||
import { UntypedFormGroup, Validators } from '@angular/forms';
|
||||
import { BaseDialogComponent, CircleButtonComponent, IconButtonComponent, IconButtonTypes } from '@iqser/common-ui';
|
||||
import { ReactiveFormsModule, UntypedFormGroup, Validators } from '@angular/forms';
|
||||
import { defaultColorsTranslations } from '@translations/default-colors-translations';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { firstValueFrom } from 'rxjs';
|
||||
import { DefaultColorsService } from '@services/entity-services/default-colors.service';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { ColorPickerModule } from 'ngx-color-picker';
|
||||
import { MatIcon } from '@angular/material/icon';
|
||||
import { NgIf } from '@angular/common';
|
||||
|
||||
interface IEditColorData {
|
||||
colorKey: DefaultColorType;
|
||||
@ -16,6 +20,7 @@ interface IEditColorData {
|
||||
@Component({
|
||||
templateUrl: './edit-color-dialog.component.html',
|
||||
styleUrls: ['./edit-color-dialog.component.scss'],
|
||||
imports: [ReactiveFormsModule, TranslateModule, ColorPickerModule, MatIcon, NgIf, IconButtonComponent, CircleButtonComponent],
|
||||
})
|
||||
export class EditColorDialogComponent extends BaseDialogComponent {
|
||||
readonly iconButtonTypes = IconButtonTypes;
|
||||
|
||||
@ -1,13 +1,15 @@
|
||||
import { Component, Inject } from '@angular/core';
|
||||
import { Validators } from '@angular/forms';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { BaseDialogComponent } from '@iqser/common-ui';
|
||||
import { ReactiveFormsModule, Validators } from '@angular/forms';
|
||||
import { MAT_DIALOG_DATA, MatDialogClose, MatDialogRef } from '@angular/material/dialog';
|
||||
import { BaseDialogComponent, CircleButtonComponent, IconButtonComponent } from '@iqser/common-ui';
|
||||
import { ISmtpConfiguration } from '@red/domain';
|
||||
import { getCurrentUser } from '@users/user.service';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-smtp-auth-dialog',
|
||||
templateUrl: './smtp-auth-dialog.component.html',
|
||||
imports: [ReactiveFormsModule, TranslateModule, IconButtonComponent, CircleButtonComponent, MatDialogClose],
|
||||
})
|
||||
export class SmtpAuthDialogComponent extends BaseDialogComponent {
|
||||
readonly #currentUser = getCurrentUser();
|
||||
|
||||
@ -1,11 +1,13 @@
|
||||
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
||||
import { MatDialogRef } from '@angular/material/dialog';
|
||||
import { IconButtonTypes } from '@iqser/common-ui';
|
||||
import { IconButtonComponent, IconButtonTypes } from '@iqser/common-ui';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
@Component({
|
||||
templateUrl: './upload-dictionary-dialog.component.html',
|
||||
styleUrls: ['./upload-dictionary-dialog.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
imports: [IconButtonComponent, TranslateModule],
|
||||
})
|
||||
export class UploadDictionaryDialogComponent {
|
||||
readonly iconButtonTypes = IconButtonTypes;
|
||||
|
||||
@ -1,17 +1,34 @@
|
||||
import { Component, inject, OnDestroy, OnInit } from '@angular/core';
|
||||
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||
import { ReactiveFormsModule, UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { IqserPermissionsService, ListingComponent, listingProvidersFactory, LoadingService, TableColumnConfig } from '@iqser/common-ui';
|
||||
import { getCurrentUser } from '@iqser/common-ui/lib/users';
|
||||
import {
|
||||
CircleButtonComponent,
|
||||
HumanizePipe,
|
||||
IqserListingModule,
|
||||
IqserPermissionsService,
|
||||
ListingComponent,
|
||||
listingProvidersFactory,
|
||||
LoadingService,
|
||||
TableColumnConfig,
|
||||
} from '@iqser/common-ui';
|
||||
import { getCurrentUser, InitialsAvatarComponent } from '@iqser/common-ui/lib/users';
|
||||
import { Audit, IAudit, IAuditResponse, IAuditSearchRequest, User } from '@red/domain';
|
||||
import { RouterHistoryService } from '@services/router-history.service';
|
||||
import { auditCategoriesTranslations } from '@translations/audit-categories-translations';
|
||||
import { Roles } from '@users/roles';
|
||||
import { applyIntervalConstraints } from '@utils/date-inputs-utils';
|
||||
import { Dayjs } from 'dayjs';
|
||||
import dayjs, { Dayjs } from 'dayjs';
|
||||
import { firstValueFrom } from 'rxjs';
|
||||
import { AdminDialogService } from '../../services/admin-dialog.service';
|
||||
import { AuditService } from '../../services/audit.service';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { PaginationComponent } from '@common-ui/pagination';
|
||||
import { MatFormField, MatSuffix } from '@angular/material/form-field';
|
||||
import { MatOption, MatSelect, MatSelectTrigger } from '@angular/material/select';
|
||||
import { AsyncPipe, NgForOf, NgIf } from '@angular/common';
|
||||
import { MatDatepickerModule } from '@angular/material/datepicker';
|
||||
import { MatIcon } from '@angular/material/icon';
|
||||
import { DatePipe } from '@shared/pipes/date.pipe';
|
||||
|
||||
const PAGE_SIZE = 50;
|
||||
|
||||
@ -19,6 +36,26 @@ const PAGE_SIZE = 50;
|
||||
templateUrl: './audit-screen.component.html',
|
||||
styleUrls: ['./audit-screen.component.scss'],
|
||||
providers: listingProvidersFactory(AuditScreenComponent),
|
||||
imports: [
|
||||
IqserListingModule,
|
||||
TranslateModule,
|
||||
PaginationComponent,
|
||||
ReactiveFormsModule,
|
||||
MatFormField,
|
||||
MatOption,
|
||||
NgForOf,
|
||||
InitialsAvatarComponent,
|
||||
NgIf,
|
||||
MatIcon,
|
||||
MatSuffix,
|
||||
AsyncPipe,
|
||||
DatePipe,
|
||||
HumanizePipe,
|
||||
CircleButtonComponent,
|
||||
MatSelectTrigger,
|
||||
MatSelect,
|
||||
MatDatepickerModule,
|
||||
],
|
||||
})
|
||||
export class AuditScreenComponent extends ListingComponent<Audit> implements OnInit, OnDestroy {
|
||||
private _previousFrom: Dayjs;
|
||||
@ -26,7 +63,7 @@ export class AuditScreenComponent extends ListingComponent<Audit> implements OnI
|
||||
readonly ALL_CATEGORIES = 'allCategories';
|
||||
readonly ALL_USERS = _('audit-screen.all-users');
|
||||
readonly translations = auditCategoriesTranslations;
|
||||
readonly form: UntypedFormGroup = this._getForm();
|
||||
readonly form: UntypedFormGroup = this.#getForm();
|
||||
readonly routerHistoryService = inject(RouterHistoryService);
|
||||
readonly permissionsService = inject(IqserPermissionsService);
|
||||
readonly roles = Roles;
|
||||
@ -59,17 +96,17 @@ export class AuditScreenComponent extends ListingComponent<Audit> implements OnI
|
||||
}
|
||||
|
||||
async pageChanged(page: number) {
|
||||
await this._fetchData(page);
|
||||
await this.#fetchData(page);
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
this.sortingService.setSortingOption({ column: 'recordDate', order: 'desc' });
|
||||
await this._fetchData();
|
||||
await this.#fetchData();
|
||||
}
|
||||
|
||||
async filterChange() {
|
||||
if (!this._updateDateFilters(this.form.value)) {
|
||||
await this._fetchData();
|
||||
if (!this.#updateDateFilters(this.form.value)) {
|
||||
await this.#fetchData();
|
||||
}
|
||||
}
|
||||
|
||||
@ -77,7 +114,7 @@ export class AuditScreenComponent extends ListingComponent<Audit> implements OnI
|
||||
this._dialogService.openDialog('auditInfo', { auditEntry: log });
|
||||
}
|
||||
|
||||
private _getForm(): UntypedFormGroup {
|
||||
#getForm(): UntypedFormGroup {
|
||||
return this._formBuilder.group({
|
||||
category: [this.ALL_CATEGORIES],
|
||||
userId: [this.ALL_USERS],
|
||||
@ -86,7 +123,7 @@ export class AuditScreenComponent extends ListingComponent<Audit> implements OnI
|
||||
});
|
||||
}
|
||||
|
||||
private _updateDateFilters(value): boolean {
|
||||
#updateDateFilters(value): boolean {
|
||||
if (applyIntervalConstraints(value, this._previousFrom, this._previousTo, this.form, 'from', 'to')) {
|
||||
return true;
|
||||
}
|
||||
@ -96,21 +133,14 @@ export class AuditScreenComponent extends ListingComponent<Audit> implements OnI
|
||||
return false;
|
||||
}
|
||||
|
||||
private async _fetchData(page?: number) {
|
||||
async #fetchData(page?: number) {
|
||||
this._loadingService.start();
|
||||
const promises = [];
|
||||
const category = this.form.get('category').value;
|
||||
const userId = this.form.get('userId').value;
|
||||
const from = this.form.get('from').value;
|
||||
let to = this.form.get('to').value;
|
||||
if (to) {
|
||||
const hoursLeft = new Date(to).getHours();
|
||||
const minutesLeft = new Date(to).getMinutes();
|
||||
to = to
|
||||
.clone()
|
||||
.add(24 - hoursLeft - 1, 'h')
|
||||
.add(60 - minutesLeft - 1);
|
||||
}
|
||||
const from = this.form.get('from').value ? dayjs(this.form.get('from').value).startOf('day').toISOString() : null;
|
||||
const to = this.form.get('to').value ? dayjs(this.form.get('to').value).endOf('day').toISOString() : null;
|
||||
|
||||
const logsRequestBody: IAuditSearchRequest = {
|
||||
pageSize: PAGE_SIZE,
|
||||
page: page,
|
||||
|
||||
@ -0,0 +1,130 @@
|
||||
@if (componentDefinitions$ | async; as componentDefinitions) {
|
||||
<div class="content-container">
|
||||
<div class="content-header">
|
||||
<div class="header-title">
|
||||
<span
|
||||
class="all-caps-label"
|
||||
[innerHTML]="'component-definitions.title' | translate: { length: componentDefinitions.length }"
|
||||
></span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
@if (permissionsService.canEditEntities()) {
|
||||
<iqser-icon-button
|
||||
(action)="createEmptyComponentDefinition()"
|
||||
[label]="'component-definitions.add-new' | translate"
|
||||
[type]="iconButtonTypes.primary"
|
||||
icon="iqser:plus"
|
||||
></iqser-icon-button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
<div class="components-list">
|
||||
<div class="header">
|
||||
<div class="item-content">
|
||||
<div class="all-caps-label">{{ 'component-definitions.columns.position' | translate }}</div>
|
||||
<div class="all-caps-label">{{ 'component-definitions.columns.name' | translate }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div (cdkDropListDropped)="drop($event)" cdkDropList class="list-content">
|
||||
@for (component of componentDefinitions; track component) {
|
||||
<div
|
||||
class="list-item"
|
||||
[class.selected]="selectedComponent?.id === component.id"
|
||||
cdkDrag
|
||||
(click)="selectComponent(component)"
|
||||
>
|
||||
<div class="item-content">
|
||||
<div class="table-item-title heading">
|
||||
<mat-icon cdkDragHandle class="draggable" svgIcon="red:draggable-dots"></mat-icon>
|
||||
<span> {{ component.rank }} </span>
|
||||
</div>
|
||||
<div class="table-item-title heading">{{ component.displayName }}</div>
|
||||
<div class="right-content">
|
||||
@if (permissionsService.canEditEntities()) {
|
||||
<iqser-circle-button
|
||||
[class]="'delete-component-definition'"
|
||||
(action)="deleteComponent(component.id)"
|
||||
[tooltip]="'trash.action.delete' | translate"
|
||||
icon="iqser:trash"
|
||||
></iqser-circle-button>
|
||||
}
|
||||
<mat-icon
|
||||
[class.not-visible]="selectedComponent?.id !== component.id"
|
||||
class="arrow-right"
|
||||
svgIcon="red:arrow-right"
|
||||
></mat-icon>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
@if (selectedComponent) {
|
||||
<section class="dialog">
|
||||
<div class="dialog-header">
|
||||
@if (selectedComponent.id) {
|
||||
<div
|
||||
class="heading-l"
|
||||
[innerHTML]="'component-definitions.edit-title' | translate: { displayName: selectedComponent.displayName }"
|
||||
></div>
|
||||
} @else {
|
||||
<div class="heading-l" [innerHTML]="'component-definitions.add-title' | translate"></div>
|
||||
}
|
||||
</div>
|
||||
@if (form) {
|
||||
<form (submit)="save()" [formGroup]="form">
|
||||
<div class="dialog-content">
|
||||
<div class="iqser-input-group w-300 required">
|
||||
<label [translate]="'component-definitions.form.display-name'"></label>
|
||||
<input
|
||||
formControlName="displayName"
|
||||
name="displayName"
|
||||
placeholder="{{ 'component-definitions.form.display-name-placeholder' | translate }}"
|
||||
type="text"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="iqser-input-group w-450">
|
||||
<label [translate]="'component-definitions.form.description'"></label>
|
||||
<textarea
|
||||
[placeholder]="'component-definitions.form.description-placeholder' | translate"
|
||||
formControlName="description"
|
||||
iqserHasScrollbar
|
||||
name="description"
|
||||
rows="5"
|
||||
type="text"
|
||||
></textarea>
|
||||
</div>
|
||||
|
||||
<div class="iqser-input-group w-450">
|
||||
<label [translate]="'component-definitions.form.technical-name-label'"></label>
|
||||
<span class="technical-name"> {{ technicalName }} </span>
|
||||
<label [translate]="'component-definitions.form.autogenerated-label'"></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="dialog-actions">
|
||||
<iqser-icon-button
|
||||
[disabled]="disabled"
|
||||
[label]="'component-definitions.actions.save' | translate"
|
||||
[submit]="true"
|
||||
[type]="iconButtonTypes.primary"
|
||||
></iqser-icon-button>
|
||||
@if (selectedComponent.id) {
|
||||
<div
|
||||
(click)="initForm()"
|
||||
[class.disabled]="disabled"
|
||||
[translate]="'component-definitions.actions.revert'"
|
||||
class="all-caps-label cancel"
|
||||
></div>
|
||||
}
|
||||
</div>
|
||||
</form>
|
||||
}
|
||||
</section>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@ -0,0 +1,145 @@
|
||||
%item-content-style {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex: 1;
|
||||
margin: 5px;
|
||||
|
||||
div:first-child {
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
div {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.draggable {
|
||||
cursor: grab;
|
||||
transform: scale(0.7);
|
||||
width: 40px;
|
||||
margin-left: -30px;
|
||||
|
||||
::ng-deep svg {
|
||||
fill: var(--iqser-grey-7);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.right-content {
|
||||
visibility: hidden;
|
||||
flex: 1;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
|
||||
iqser-circle-button {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.arrow-right {
|
||||
transform: scale(0.7);
|
||||
|
||||
&.not-visible {
|
||||
visibility: hidden;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.content-container {
|
||||
background-color: var(--iqser-grey-6);
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.content-header {
|
||||
display: flex;
|
||||
height: 50px;
|
||||
background-color: var(--iqser-grey-6);
|
||||
align-items: center;
|
||||
padding: 0 24px;
|
||||
|
||||
.actions {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
gap: 20px;
|
||||
overflow: hidden;
|
||||
|
||||
.components-list {
|
||||
flex: 1;
|
||||
background-color: var(--iqser-white);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.header {
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
.list-content {
|
||||
overflow-y: auto;
|
||||
height: calc(100vh - 30px);
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.list-item {
|
||||
height: 80px;
|
||||
transition: background 0.3s ease;
|
||||
}
|
||||
|
||||
.header,
|
||||
.list-item {
|
||||
display: flex;
|
||||
border-bottom: 1px solid var(--iqser-separator);
|
||||
|
||||
.item-content {
|
||||
@extend %item-content-style;
|
||||
}
|
||||
}
|
||||
|
||||
.list-item:hover,
|
||||
.selected {
|
||||
cursor: pointer;
|
||||
|
||||
.item-content {
|
||||
background-color: var(--iqser-grey-8);
|
||||
|
||||
.right-content {
|
||||
visibility: visible;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.list-item:hover > .item-content > .right-content > iqser-circle-button {
|
||||
visibility: visible;
|
||||
}
|
||||
}
|
||||
|
||||
section {
|
||||
background-color: var(--iqser-white);
|
||||
border-radius: 8px;
|
||||
width: 700px;
|
||||
height: 470px;
|
||||
margin-right: 150px;
|
||||
|
||||
.technical-name {
|
||||
min-height: 16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.cdk-drag-preview {
|
||||
.list-item {
|
||||
transition: background 0.3s ease;
|
||||
}
|
||||
.item-content {
|
||||
@extend %item-content-style;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,138 @@
|
||||
import { Component, OnInit, signal } from '@angular/core';
|
||||
import {
|
||||
BaseFormComponent,
|
||||
CircleButtonComponent,
|
||||
HasScrollbarDirective,
|
||||
IconButtonComponent,
|
||||
listingProvidersFactory,
|
||||
LoadingService,
|
||||
} from '@iqser/common-ui';
|
||||
import { ComponentDefinitionsService } from '@services/entity-services/component-definitions.service';
|
||||
import { firstValueFrom } from 'rxjs';
|
||||
import { getParam } from '@common-ui/utils';
|
||||
import { DOSSIER_TEMPLATE_ID, IComponentDefinition } from '@red/domain';
|
||||
import { toObservable } from '@angular/core/rxjs-interop';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { PermissionsService } from '@services/permissions.service';
|
||||
import { MatIcon } from '@angular/material/icon';
|
||||
import { CdkDrag, CdkDragDrop, CdkDragHandle, CdkDropList, moveItemInArray } from '@angular/cdk/drag-drop';
|
||||
import { FormBuilder, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms';
|
||||
import { AdminDialogService } from '../../services/admin-dialog.service';
|
||||
|
||||
@Component({
|
||||
templateUrl: './component-definitions.component.html',
|
||||
styleUrls: ['./component-definitions.component.scss'],
|
||||
providers: listingProvidersFactory(ComponentDefinitionsComponent),
|
||||
imports: [
|
||||
IconButtonComponent,
|
||||
TranslateModule,
|
||||
CommonModule,
|
||||
MatIcon,
|
||||
CdkDragHandle,
|
||||
CdkDropList,
|
||||
CdkDrag,
|
||||
FormsModule,
|
||||
ReactiveFormsModule,
|
||||
CircleButtonComponent,
|
||||
HasScrollbarDirective,
|
||||
],
|
||||
})
|
||||
export default class ComponentDefinitionsComponent extends BaseFormComponent implements OnInit {
|
||||
readonly #dossierTemplateId = getParam(DOSSIER_TEMPLATE_ID);
|
||||
readonly #componentDefinitions = signal<IComponentDefinition[]>([]);
|
||||
protected readonly componentDefinitions$ = toObservable(this.#componentDefinitions);
|
||||
protected selectedComponent: IComponentDefinition | null = null;
|
||||
|
||||
constructor(
|
||||
private readonly _loadingService: LoadingService,
|
||||
private readonly _componentDefinitionsService: ComponentDefinitionsService,
|
||||
private readonly _formBuilder: FormBuilder,
|
||||
private readonly _dialogService: AdminDialogService,
|
||||
protected readonly permissionsService: PermissionsService,
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
this._loadingService.stop();
|
||||
await this.#loadData();
|
||||
}
|
||||
|
||||
async #loadData() {
|
||||
const componentDefinitions = await firstValueFrom(
|
||||
this._componentDefinitionsService.getComponentDefinitions(this.#dossierTemplateId),
|
||||
);
|
||||
this.#componentDefinitions.set(componentDefinitions);
|
||||
}
|
||||
|
||||
async createEmptyComponentDefinition() {
|
||||
this.selectedComponent = {
|
||||
displayName: '',
|
||||
description: '',
|
||||
} as IComponentDefinition;
|
||||
this.initForm();
|
||||
}
|
||||
|
||||
async save() {
|
||||
if (this.selectedComponent.id) {
|
||||
const component = { ...this.form.getRawValue(), id: this.selectedComponent.id };
|
||||
await firstValueFrom(this._componentDefinitionsService.updateComponentDefinition(this.#dossierTemplateId, component));
|
||||
} else {
|
||||
const component = {
|
||||
...this.form.getRawValue(),
|
||||
dossierTemplateId: this.#dossierTemplateId,
|
||||
technicalName: this.technicalName,
|
||||
};
|
||||
await firstValueFrom(this._componentDefinitionsService.createComponentDefinition(this.#dossierTemplateId, component));
|
||||
}
|
||||
await this.#loadData();
|
||||
this.selectComponent();
|
||||
await this.initForm();
|
||||
}
|
||||
|
||||
async drop(event: CdkDragDrop<string>) {
|
||||
if (event.isPointerOverContainer) {
|
||||
moveItemInArray(this.#componentDefinitions(), event.previousIndex, event.currentIndex);
|
||||
|
||||
const componentIds = this.#componentDefinitions().map(c => c.id);
|
||||
const componentDefinitions = await firstValueFrom(
|
||||
this._componentDefinitionsService.reorderComponentDefinitions(this.#dossierTemplateId, componentIds),
|
||||
);
|
||||
this.#componentDefinitions.set(componentDefinitions);
|
||||
}
|
||||
}
|
||||
|
||||
async deleteComponent(componentId: string) {
|
||||
this._dialogService.openDialog('confirm', null, async () => {
|
||||
await firstValueFrom(this._componentDefinitionsService.deleteComponentDefinitions(this.#dossierTemplateId, [componentId]));
|
||||
await this.#loadData();
|
||||
this.selectedComponent = null;
|
||||
});
|
||||
}
|
||||
|
||||
initForm() {
|
||||
this.form = this.#getForm();
|
||||
this.initialFormValue = this.form.getRawValue();
|
||||
}
|
||||
|
||||
#getForm() {
|
||||
return this._formBuilder.group({
|
||||
displayName: [this.selectedComponent?.displayName, Validators.required],
|
||||
description: [this.selectedComponent?.description],
|
||||
});
|
||||
}
|
||||
|
||||
selectComponent(component?: IComponentDefinition) {
|
||||
if (component && this.selectedComponent?.id !== component.id) {
|
||||
this.selectedComponent = component;
|
||||
this.initForm();
|
||||
return;
|
||||
}
|
||||
this.selectedComponent = null;
|
||||
}
|
||||
|
||||
get technicalName() {
|
||||
return this.selectedComponent.technicalName ?? this.form.get('displayName')?.value?.toLowerCase().trim().replace(/\s+/g, '_');
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,79 @@
|
||||
<section class="dialog">
|
||||
<div
|
||||
[innerHTML]="'add-edit-component-mapping.dialog.title' | translate: { type: data.mapping ? 'edit' : 'add' }"
|
||||
class="dialog-header heading-l"
|
||||
></div>
|
||||
<form (submit)="save()" [formGroup]="form">
|
||||
<div class="dialog-content">
|
||||
<div class="row">
|
||||
<div class="iqser-input-group required w-300">
|
||||
<label translate="add-edit-component-mapping.form.name"></label>
|
||||
<input
|
||||
[placeholder]="'add-edit-component-mapping.form.name-placeholder' | translate"
|
||||
formControlName="name"
|
||||
name="label"
|
||||
type="text"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="iqser-input-group w-100 version" *ngIf="data?.mapping?.id">
|
||||
<label translate="add-edit-component-mapping.form.version"></label>
|
||||
<span> {{ data.mapping.version }} </span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="iqser-input-group required">
|
||||
<label translate="add-edit-component-mapping.form.file"></label>
|
||||
<iqser-upload-file (fileChanged)="changeFile($event)" [file]="activeFile" [accept]="'.csv'" />
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="row"
|
||||
[matTooltip]="'add-edit-component-mapping.disabled-file-options' | translate"
|
||||
[matTooltipDisabled]="!form.get('encoding')?.disabled"
|
||||
[matTooltipPosition]="'above'"
|
||||
>
|
||||
<div class="iqser-input-group required w-150">
|
||||
<label translate="add-edit-component-mapping.form.delimiter"></label>
|
||||
<input
|
||||
[placeholder]="'add-edit-component-mapping.form.delimiter-placeholder' | translate"
|
||||
formControlName="delimiter"
|
||||
name="delimiter"
|
||||
type="text"
|
||||
/>
|
||||
</div>
|
||||
<div class="iqser-input-group required w-150">
|
||||
<label translate="add-edit-component-mapping.form.quote-char"></label>
|
||||
<input
|
||||
[placeholder]="'add-edit-component-mapping.form.quote-char-placeholder' | translate"
|
||||
formControlName="quoteChar"
|
||||
name="quoteChar"
|
||||
type="text"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="iqser-input-group required w-150">
|
||||
<label translate="add-edit-component-mapping.form.encoding-type"></label>
|
||||
<mat-form-field>
|
||||
<mat-select formControlName="encoding">
|
||||
<mat-option *ngFor="let type of encodingTypeOptions" [value]="type">
|
||||
{{ translations[type] | translate }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="dialog-actions">
|
||||
<iqser-icon-button
|
||||
(action)="save()"
|
||||
[disabled]="disabled"
|
||||
[label]="'add-edit-component-mapping.actions.save' | translate"
|
||||
[type]="iconButtonTypes.primary"
|
||||
></iqser-icon-button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<iqser-circle-button class="dialog-close" icon="iqser:close" mat-dialog-close></iqser-circle-button>
|
||||
</section>
|
||||
@ -0,0 +1,25 @@
|
||||
.row {
|
||||
display: flex;
|
||||
margin-top: 14px;
|
||||
|
||||
> *:not(:last-child) {
|
||||
margin-right: 16px;
|
||||
}
|
||||
|
||||
.iqser-input-group {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.version {
|
||||
margin-left: 50px;
|
||||
|
||||
span {
|
||||
margin-top: 10px;
|
||||
font-size: 15px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.row:last-child {
|
||||
max-width: 300px;
|
||||
}
|
||||
@ -0,0 +1,111 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { CircleButtonComponent, IconButtonComponent, IqserDialogComponent, UploadFileComponent } from '@iqser/common-ui';
|
||||
import { FileAttributeEncodingTypes, IComponentMapping } from '@red/domain';
|
||||
import { FormBuilder, ReactiveFormsModule, UntypedFormGroup, Validators } from '@angular/forms';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { NgForOf, NgIf } from '@angular/common';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { MatDialogModule } from '@angular/material/dialog';
|
||||
import { MatOption } from '@angular/material/autocomplete';
|
||||
import { MatSelect } from '@angular/material/select';
|
||||
import { fileAttributeEncodingTypesTranslations } from '@translations/file-attribute-encoding-types-translations';
|
||||
import { firstValueFrom } from 'rxjs';
|
||||
import { ComponentMappingsService } from '@services/entity-services/component-mappings.service';
|
||||
import { MatTooltip } from '@angular/material/tooltip';
|
||||
|
||||
interface DialogData {
|
||||
dossierTemplateId: string;
|
||||
mapping: IComponentMapping;
|
||||
}
|
||||
|
||||
interface DialogResult {
|
||||
id: string;
|
||||
name: string;
|
||||
file: Blob;
|
||||
encoding: string;
|
||||
delimiter: string;
|
||||
quoteChar: string;
|
||||
fileName?: string;
|
||||
}
|
||||
|
||||
@Component({
|
||||
templateUrl: './add-edit-component-mapping-dialog.component.html',
|
||||
styleUrls: ['./add-edit-component-mapping-dialog.component.scss'],
|
||||
imports: [
|
||||
TranslateModule,
|
||||
ReactiveFormsModule,
|
||||
NgIf,
|
||||
MatFormFieldModule,
|
||||
NgForOf,
|
||||
CircleButtonComponent,
|
||||
MatDialogModule,
|
||||
MatOption,
|
||||
MatSelect,
|
||||
IconButtonComponent,
|
||||
UploadFileComponent,
|
||||
MatTooltip,
|
||||
],
|
||||
})
|
||||
export class AddEditComponentMappingDialogComponent
|
||||
extends IqserDialogComponent<AddEditComponentMappingDialogComponent, DialogData, DialogResult>
|
||||
implements OnInit
|
||||
{
|
||||
protected readonly encodingTypeOptions = Object.keys(FileAttributeEncodingTypes);
|
||||
protected readonly translations = fileAttributeEncodingTypesTranslations;
|
||||
activeFile: File;
|
||||
form!: UntypedFormGroup;
|
||||
|
||||
constructor(
|
||||
private readonly _formBuilder: FormBuilder,
|
||||
private readonly _componentMappingService: ComponentMappingsService,
|
||||
) {
|
||||
super();
|
||||
this.form = this.#getForm();
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
if (this.data.mapping?.fileName) {
|
||||
this.activeFile = { name: this.data.mapping.fileName } as File;
|
||||
const fileContent = await firstValueFrom(
|
||||
this._componentMappingService.getComponentMappingFile(this.data.dossierTemplateId, this.data.mapping.id),
|
||||
);
|
||||
const file = new Blob([fileContent.body as Blob], { type: 'text/csv' });
|
||||
this.form.get('file').setValue(file);
|
||||
this.initialFormValue = this.form.getRawValue();
|
||||
this.#disableEncodingAndQuoteCharAndDelimiter();
|
||||
}
|
||||
}
|
||||
|
||||
changeFile(file: File) {
|
||||
this.form.get('file').setValue(file);
|
||||
this.form.get('fileName').setValue(file?.name);
|
||||
this.#enableEncodingAndQuoteCharAndDelimiter();
|
||||
}
|
||||
|
||||
save() {
|
||||
this.dialogRef.close({ ...this.data.mapping, ...this.form.getRawValue() });
|
||||
}
|
||||
|
||||
#getForm(): UntypedFormGroup {
|
||||
return this._formBuilder.group({
|
||||
name: [this.data?.mapping?.name, Validators.required],
|
||||
file: [null, Validators.required],
|
||||
fileName: [this.data?.mapping?.fileName, Validators.required],
|
||||
encoding: this.encodingTypeOptions.find(e => e === this.data?.mapping?.encoding) ?? this.encodingTypeOptions[0],
|
||||
delimiter: [this.data?.mapping?.delimiter ?? ',', Validators.required],
|
||||
quoteChar: [this.data?.mapping?.quoteChar ?? '"', Validators.required],
|
||||
});
|
||||
}
|
||||
|
||||
#disableEncodingAndQuoteCharAndDelimiter() {
|
||||
this.form.get('encoding').disable();
|
||||
this.form.get('delimiter').disable();
|
||||
this.form.get('quoteChar').disable();
|
||||
}
|
||||
|
||||
#enableEncodingAndQuoteCharAndDelimiter() {
|
||||
this.form.get('encoding').enable();
|
||||
this.form.get('delimiter').enable();
|
||||
this.form.get('quoteChar').enable();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,73 @@
|
||||
<div class="content-container" *ngIf="context$ | async as context">
|
||||
<iqser-table
|
||||
(noDataAction)="openAddEditComponentMappingDialog()"
|
||||
[headerTemplate]="headerTemplate"
|
||||
[itemSize]="80"
|
||||
[tableColumnConfigs]="tableColumnConfigs"
|
||||
[noDataText]="'component-mappings-screen.no-data.title' | translate"
|
||||
[showNoDataButton]="roles.componentMappings.write && currentUser.isAdmin"
|
||||
[noDataButtonLabel]="'component-mappings-screen.no-data.action' | translate"
|
||||
emptyColumnWidth="2fr"
|
||||
noDataIcon="iqser:csv"
|
||||
></iqser-table>
|
||||
</div>
|
||||
|
||||
<ng-template #headerTemplate>
|
||||
<div class="table-header-actions">
|
||||
<iqser-input-with-action
|
||||
[(value)]="searchService.searchValue"
|
||||
[placeholder]="'component-mappings-screen.search' | translate"
|
||||
></iqser-input-with-action>
|
||||
<div class="actions">
|
||||
<iqser-icon-button
|
||||
(action)="openAddEditComponentMappingDialog()"
|
||||
*allow="roles.componentMappings.write; if: currentUser.isAdmin"
|
||||
[label]="'component-mappings-screen.add-new' | translate"
|
||||
[type]="iconButtonTypes.primary"
|
||||
icon="iqser:plus"
|
||||
></iqser-icon-button>
|
||||
</div>
|
||||
</div>
|
||||
</ng-template>
|
||||
|
||||
<ng-template #tableItemTemplate let-entity="entity">
|
||||
<div>
|
||||
<div class="label cell">
|
||||
<span>{{ entity.name }}</span>
|
||||
</div>
|
||||
|
||||
<div class="cell">
|
||||
<span>{{ entity.version }}</span>
|
||||
</div>
|
||||
|
||||
<div class="cell">
|
||||
<span>{{ entity.numberOfLines }}</span>
|
||||
</div>
|
||||
|
||||
<div class="cell" [matTooltip]="entity.columnLabelsString" [matTooltipPosition]="'above'" [matTooltipClass]="'custom-tooltip'">
|
||||
<span class="ellipsis">{{ entity.columnLabelsString }}</span>
|
||||
</div>
|
||||
|
||||
<div class="cell">
|
||||
<div *allow="roles.componentMappings.write; if: currentUser.isAdmin" class="action-buttons">
|
||||
<iqser-circle-button
|
||||
(action)="openAddEditComponentMappingDialog(entity)"
|
||||
[tooltip]="'component-mappings-screen.action.edit' | translate"
|
||||
icon="iqser:edit"
|
||||
></iqser-circle-button>
|
||||
|
||||
<iqser-circle-button
|
||||
(action)="downloadMapping(entity)"
|
||||
[tooltip]="'component-mappings-screen.action.download' | translate"
|
||||
icon="iqser:download"
|
||||
></iqser-circle-button>
|
||||
|
||||
<iqser-circle-button
|
||||
(action)="openDeleteComponentMappingDialog(entity)"
|
||||
[tooltip]="'component-mappings-screen.action.delete' | translate"
|
||||
icon="iqser:trash"
|
||||
></iqser-circle-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ng-template>
|
||||
@ -0,0 +1,11 @@
|
||||
.ellipsis {
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
::ng-deep .custom-tooltip {
|
||||
max-width: 300px;
|
||||
white-space: normal;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
@ -0,0 +1,120 @@
|
||||
import { AsyncPipe, NgIf } from '@angular/common';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { InputWithActionComponent } from '@common-ui/inputs/input-with-action/input-with-action.component';
|
||||
import { getCurrentUser } from '@common-ui/users';
|
||||
import { getParam } from '@common-ui/utils';
|
||||
import {
|
||||
CircleButtonComponent,
|
||||
IconButtonComponent,
|
||||
IconButtonTypes,
|
||||
IqserAllowDirective,
|
||||
IqserDialog,
|
||||
IqserListingModule,
|
||||
ListingComponent,
|
||||
listingProvidersFactory,
|
||||
LoadingService,
|
||||
TableColumnConfig,
|
||||
} from '@iqser/common-ui';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { ComponentMapping, DOSSIER_TEMPLATE_ID, User } from '@red/domain';
|
||||
import { ComponentMappingsService } from '@services/entity-services/component-mappings.service';
|
||||
import { defaultColorsTranslations } from '@translations/default-colors-translations';
|
||||
import { Roles } from '@users/roles';
|
||||
import { combineLatest, firstValueFrom } from 'rxjs';
|
||||
import { map, tap } from 'rxjs/operators';
|
||||
import { AdminDialogService } from '../../services/admin-dialog.service';
|
||||
import { AddEditComponentMappingDialogComponent } from './add-edit-component-mapping-dialog/add-edit-component-mapping-dialog.component';
|
||||
import { download } from '@utils/file-download-utils';
|
||||
import { MatTooltip } from '@angular/material/tooltip';
|
||||
|
||||
@Component({
|
||||
templateUrl: './component-mappings-screen.component.html',
|
||||
styleUrls: ['./component-mappings-screen.component.scss'],
|
||||
providers: listingProvidersFactory(ComponentMappingsScreenComponent),
|
||||
imports: [
|
||||
AsyncPipe,
|
||||
NgIf,
|
||||
CircleButtonComponent,
|
||||
TranslateModule,
|
||||
IqserListingModule,
|
||||
InputWithActionComponent,
|
||||
IconButtonComponent,
|
||||
IqserAllowDirective,
|
||||
MatTooltip,
|
||||
],
|
||||
})
|
||||
export default class ComponentMappingsScreenComponent extends ListingComponent<ComponentMapping> implements OnInit {
|
||||
readonly #dossierTemplateId = getParam(DOSSIER_TEMPLATE_ID);
|
||||
protected readonly context$;
|
||||
protected readonly currentUser = getCurrentUser<User>();
|
||||
protected readonly translations = defaultColorsTranslations;
|
||||
protected readonly roles = Roles;
|
||||
protected readonly iconButtonTypes = IconButtonTypes;
|
||||
tableColumnConfigs: readonly TableColumnConfig<ComponentMapping>[] = [
|
||||
{ label: _('component-mappings-screen.table-col-names.name'), sortByKey: 'searchKey' },
|
||||
{ label: _('component-mappings-screen.table-col-names.version') },
|
||||
{ label: _('component-mappings-screen.table-col-names.number-of-lines') },
|
||||
{ label: _('component-mappings-screen.table-col-names.column-labels') },
|
||||
];
|
||||
readonly tableHeaderLabel = _('component-mappings-screen.table-header.title');
|
||||
|
||||
constructor(
|
||||
private readonly _loadingService: LoadingService,
|
||||
private readonly _componentMappingService: ComponentMappingsService,
|
||||
private readonly _iqserDialog: IqserDialog,
|
||||
private readonly _dialogService: AdminDialogService,
|
||||
) {
|
||||
super();
|
||||
this.context$ = this.loadData$();
|
||||
}
|
||||
|
||||
loadData$() {
|
||||
return combineLatest([this._componentMappingService.getComponentMappings(this.#dossierTemplateId)]).pipe(
|
||||
map(([mappingList]) => mappingList.componentMappingList),
|
||||
tap(mappings => this.entitiesService.setEntities(mappings)),
|
||||
);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this._loadingService.stop();
|
||||
}
|
||||
|
||||
async openAddEditComponentMappingDialog(mapping?: ComponentMapping) {
|
||||
const dialog = this._iqserDialog.openDefault(AddEditComponentMappingDialogComponent, {
|
||||
data: {
|
||||
dossierTemplateId: this.#dossierTemplateId,
|
||||
mapping,
|
||||
},
|
||||
});
|
||||
const result = await dialog.result();
|
||||
if (result) {
|
||||
this._loadingService.start();
|
||||
const { id, name, encoding, delimiter, fileName, quoteChar } = result;
|
||||
const newMapping = { id, name, encoding, delimiter, fileName, quoteChar };
|
||||
await firstValueFrom(
|
||||
this._componentMappingService.createUpdateComponentMapping(this.#dossierTemplateId, newMapping, result.file),
|
||||
);
|
||||
await firstValueFrom(this.loadData$());
|
||||
this._loadingService.stop();
|
||||
}
|
||||
}
|
||||
|
||||
async downloadMapping(entity: ComponentMapping) {
|
||||
const componentMappingFile = await firstValueFrom(
|
||||
this._componentMappingService.getComponentMappingFile(this.#dossierTemplateId, entity.id),
|
||||
);
|
||||
download(componentMappingFile, entity.fileName);
|
||||
}
|
||||
|
||||
openDeleteComponentMappingDialog(entity: ComponentMapping) {
|
||||
this._dialogService.openDialog('confirm', null, async confirmation => {
|
||||
if (confirmation) {
|
||||
this._loadingService.start();
|
||||
await firstValueFrom(this._componentMappingService.deleteComponentMapping(this.#dossierTemplateId, entity.id));
|
||||
await firstValueFrom(this.loadData$());
|
||||
this._loadingService.stop();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -1,29 +1,6 @@
|
||||
<section *ngIf="context$ | async as context">
|
||||
<div class="page-header">
|
||||
<redaction-dossier-template-breadcrumbs class="flex-1"></redaction-dossier-template-breadcrumbs>
|
||||
|
||||
<div class="flex-1 actions">
|
||||
<redaction-dossier-template-actions></redaction-dossier-template-actions>
|
||||
|
||||
<iqser-circle-button
|
||||
[routerLink]="['../..']"
|
||||
[tooltip]="'common.close' | translate"
|
||||
icon="iqser:close"
|
||||
tooltipPosition="below"
|
||||
></iqser-circle-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="content-inner">
|
||||
<div class="overlay-shadow"></div>
|
||||
|
||||
<redaction-admin-side-nav type="dossierTemplates"></redaction-admin-side-nav>
|
||||
|
||||
<div class="content-container">
|
||||
<iqser-table [itemSize]="80" [tableColumnConfigs]="tableColumnConfigs" emptyColumnWidth="2fr"></iqser-table>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<div class="content-container" *ngIf="context$ | async as context">
|
||||
<iqser-table [itemSize]="80" [tableColumnConfigs]="tableColumnConfigs" emptyColumnWidth="2fr"></iqser-table>
|
||||
</div>
|
||||
|
||||
<ng-template #tableItemTemplate let-entity="entity">
|
||||
<div>
|
||||
|
||||
@ -1,6 +1,16 @@
|
||||
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { getConfig, IListable, ListingComponent, listingProvidersFactory, LoadingService, TableColumnConfig } from '@iqser/common-ui';
|
||||
import {
|
||||
CircleButtonComponent,
|
||||
getConfig,
|
||||
IListable,
|
||||
IqserAllowDirective,
|
||||
IqserListingModule,
|
||||
ListingComponent,
|
||||
listingProvidersFactory,
|
||||
LoadingService,
|
||||
TableColumnConfig,
|
||||
} from '@iqser/common-ui';
|
||||
import { getCurrentUser } from '@iqser/common-ui/lib/users';
|
||||
import { getParam } from '@iqser/common-ui/lib/utils';
|
||||
import { DefaultColorTypes, DOSSIER_TEMPLATE_ID, User } from '@red/domain';
|
||||
@ -10,6 +20,8 @@ import { Roles } from '@users/roles';
|
||||
import { combineLatest } from 'rxjs';
|
||||
import { map, tap } from 'rxjs/operators';
|
||||
import { AdminDialogService } from '../../services/admin-dialog.service';
|
||||
import { AsyncPipe, NgIf, NgStyle } from '@angular/common';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
interface ListItem extends IListable {
|
||||
readonly key: string;
|
||||
@ -21,6 +33,7 @@ interface ListItem extends IListable {
|
||||
styleUrls: ['./default-colors-screen.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
providers: listingProvidersFactory(DefaultColorsScreenComponent),
|
||||
imports: [IqserListingModule, NgStyle, CircleButtonComponent, IqserAllowDirective, TranslateModule, AsyncPipe, NgIf],
|
||||
})
|
||||
export class DefaultColorsScreenComponent extends ListingComponent<ListItem> implements OnInit {
|
||||
readonly #dossierTemplateId = getParam(DOSSIER_TEMPLATE_ID);
|
||||
|
||||
@ -1,20 +1,40 @@
|
||||
import { AsyncPipe, NgIf } from '@angular/common';
|
||||
import { ChangeDetectorRef, Component, computed, OnInit, ViewChild } from '@angular/core';
|
||||
import { IconButtonTypes, IqserPermissionsService, LoadingService, Toaster } from '@iqser/common-ui';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { RouterHistoryService } from '@services/router-history.service';
|
||||
import { DigitalSignatureService } from '../../services/digital-signature.service';
|
||||
import { firstValueFrom } from 'rxjs';
|
||||
import { AdminDialogService } from '../../services/admin-dialog.service';
|
||||
import { PkcsSignatureConfigurationComponent } from '../../dialogs/configure-digital-signature-dialog/form/pkcs-signature-configuration/pkcs-signature-configuration.component';
|
||||
import { KmsSignatureConfigurationComponent } from '../../dialogs/configure-digital-signature-dialog/form/kms-signature-configuration/kms-signature-configuration.component';
|
||||
import { DigitalSignatureOptions, IKmsDigitalSignatureRequest, IPkcsDigitalSignatureRequest, User } from '@red/domain';
|
||||
import { Roles } from '@users/roles';
|
||||
import { EmptyStateComponent } from '@common-ui/empty-state';
|
||||
import {
|
||||
IconButtonComponent,
|
||||
IconButtonTypes,
|
||||
IqserListingModule,
|
||||
IqserPermissionsService,
|
||||
LoadingService,
|
||||
Toaster,
|
||||
} from '@iqser/common-ui';
|
||||
import { getCurrentUser } from '@iqser/common-ui/lib/users';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { DigitalSignatureOptions, IKmsDigitalSignatureRequest, IPkcsDigitalSignatureRequest, User } from '@red/domain';
|
||||
import { RouterHistoryService } from '@services/router-history.service';
|
||||
import { Roles } from '@users/roles';
|
||||
import { firstValueFrom } from 'rxjs';
|
||||
import { KmsSignatureConfigurationComponent } from '../../dialogs/configure-digital-signature-dialog/form/kms-signature-configuration/kms-signature-configuration.component';
|
||||
import { PkcsSignatureConfigurationComponent } from '../../dialogs/configure-digital-signature-dialog/form/pkcs-signature-configuration/pkcs-signature-configuration.component';
|
||||
import { AdminDialogService } from '../../services/admin-dialog.service';
|
||||
import { DigitalSignatureService } from '../../services/digital-signature.service';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-digital-signature-screen',
|
||||
templateUrl: './digital-signature-screen.component.html',
|
||||
styleUrls: ['./digital-signature-screen.component.scss'],
|
||||
imports: [
|
||||
IqserListingModule,
|
||||
EmptyStateComponent,
|
||||
NgIf,
|
||||
TranslateModule,
|
||||
AsyncPipe,
|
||||
PkcsSignatureConfigurationComponent,
|
||||
KmsSignatureConfigurationComponent,
|
||||
IconButtonComponent,
|
||||
],
|
||||
})
|
||||
export class DigitalSignatureScreenComponent implements OnInit {
|
||||
@ViewChild(PkcsSignatureConfigurationComponent) pkcsSignatureConfigurationComponent: PkcsSignatureConfigurationComponent;
|
||||
|
||||
@ -20,7 +20,6 @@ export interface AddEditDossierAttributeDialogData {
|
||||
@Component({
|
||||
templateUrl: './add-edit-dossier-attribute-dialog.component.html',
|
||||
styleUrls: ['./add-edit-dossier-attribute-dialog.component.scss'],
|
||||
standalone: true,
|
||||
imports: [
|
||||
TranslateModule,
|
||||
ReactiveFormsModule,
|
||||
@ -91,7 +90,7 @@ export class AddEditDossierAttributeDialogComponent extends BaseDialogComponent
|
||||
const createOrUpdate = this._dossierAttributesService.createOrUpdate(attribute, this.data.dossierTemplateId);
|
||||
const result = await createOrUpdate.catch((error: HttpErrorResponse) => {
|
||||
this._loadingService.stop();
|
||||
this._toaster.error(_('add-edit-dossier-attribute.error.generic'), { error });
|
||||
this._toaster.rawError(error.error.message);
|
||||
return undefined;
|
||||
});
|
||||
|
||||
|
||||
@ -1,9 +1,14 @@
|
||||
import { AsyncPipe, NgForOf, NgIf } from '@angular/common';
|
||||
import { Component, OnInit, TemplateRef, ViewChild } from '@angular/core';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { InputWithActionComponent } from '@common-ui/inputs/input-with-action/input-with-action.component';
|
||||
import {
|
||||
CircleButtonComponent,
|
||||
defaultDialogConfig,
|
||||
IconButtonComponent,
|
||||
IconButtonTypes,
|
||||
IqserListingModule,
|
||||
ListingComponent,
|
||||
listingProvidersFactory,
|
||||
LoadingService,
|
||||
@ -11,6 +16,7 @@ import {
|
||||
} from '@iqser/common-ui';
|
||||
import { getCurrentUser } from '@iqser/common-ui/lib/users';
|
||||
import { getParam } from '@iqser/common-ui/lib/utils';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { DOSSIER_TEMPLATE_ID, DossierAttributeConfig, IDossierAttributeConfig, User } from '@red/domain';
|
||||
import { DossierAttributesService } from '@services/entity-services/dossier-attributes.service';
|
||||
import { PermissionsService } from '@services/permissions.service';
|
||||
@ -20,6 +26,7 @@ import {
|
||||
AddEditDossierAttributeDialogComponent,
|
||||
AddEditDossierAttributeDialogData,
|
||||
} from './add-edit-dossier-attribute-dialog/add-edit-dossier-attribute-dialog.component';
|
||||
import { TableItemComponent } from './table-item/table-item.component';
|
||||
|
||||
@Component({
|
||||
templateUrl: './dossier-attributes-listing-screen.component.html',
|
||||
@ -28,8 +35,19 @@ import {
|
||||
entitiesService: DossierAttributesService,
|
||||
component: DossierAttributesListingScreenComponent,
|
||||
}),
|
||||
imports: [
|
||||
IqserListingModule,
|
||||
TranslateModule,
|
||||
CircleButtonComponent,
|
||||
AsyncPipe,
|
||||
NgIf,
|
||||
InputWithActionComponent,
|
||||
IconButtonComponent,
|
||||
NgForOf,
|
||||
TableItemComponent,
|
||||
],
|
||||
})
|
||||
export class DossierAttributesListingScreenComponent extends ListingComponent<DossierAttributeConfig> implements OnInit {
|
||||
export default class DossierAttributesListingScreenComponent extends ListingComponent<DossierAttributeConfig> implements OnInit {
|
||||
readonly #dossierTemplateId = getParam(DOSSIER_TEMPLATE_ID);
|
||||
readonly iconButtonTypes = IconButtonTypes;
|
||||
readonly currentUser = getCurrentUser<User>();
|
||||
|
||||
@ -1,38 +0,0 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { DossierAttributesListingScreenComponent } from './dossier-attributes-listing-screen.component';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import {
|
||||
CircleButtonComponent,
|
||||
IconButtonComponent,
|
||||
InputWithActionComponent,
|
||||
IqserHelpModeModule,
|
||||
IqserListingModule,
|
||||
IqserRoutes,
|
||||
} from '@iqser/common-ui';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||
import { TableItemComponent } from './table-item/table-item.component';
|
||||
|
||||
const routes: IqserRoutes = [
|
||||
{
|
||||
path: '',
|
||||
component: DossierAttributesListingScreenComponent,
|
||||
},
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
declarations: [DossierAttributesListingScreenComponent, TableItemComponent],
|
||||
imports: [
|
||||
CommonModule,
|
||||
RouterModule.forChild(routes),
|
||||
TranslateModule,
|
||||
CircleButtonComponent,
|
||||
InputWithActionComponent,
|
||||
IconButtonComponent,
|
||||
IqserHelpModeModule,
|
||||
MatTooltipModule,
|
||||
IqserListingModule,
|
||||
],
|
||||
})
|
||||
export class DossierAttributesListingModule {}
|
||||
@ -1,11 +1,16 @@
|
||||
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
||||
import { DossierAttributeConfig, IDossierAttributeConfig } from '@red/domain';
|
||||
import { dossierAttributeTypesTranslations } from '@translations/dossier-attribute-types-translations';
|
||||
import { MatTooltip } from '@angular/material/tooltip';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { CircleButtonComponent } from '@iqser/common-ui';
|
||||
import { NgIf } from '@angular/common';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-table-item [attribute] [canEditDossierAttributes]',
|
||||
templateUrl: './table-item.component.html',
|
||||
styleUrls: ['./table-item.component.scss'],
|
||||
imports: [MatTooltip, TranslateModule, CircleButtonComponent, NgIf],
|
||||
})
|
||||
export class TableItemComponent {
|
||||
readonly translations = dossierAttributeTypesTranslations;
|
||||
|
||||
@ -47,6 +47,7 @@
|
||||
<div class="dialog-actions">
|
||||
<iqser-icon-button
|
||||
(action)="save()"
|
||||
[buttonId]="'save-dossier-state'"
|
||||
[disabled]="disabled"
|
||||
[label]="'add-edit-dossier-state.save' | translate"
|
||||
[submit]="true"
|
||||
|
||||
@ -1,10 +1,14 @@
|
||||
import { Component, Inject } from '@angular/core';
|
||||
import { BaseDialogComponent } from '@iqser/common-ui';
|
||||
import { Validators } from '@angular/forms';
|
||||
import { BaseDialogComponent, CircleButtonComponent, IconButtonComponent } from '@iqser/common-ui';
|
||||
import { ReactiveFormsModule, Validators } from '@angular/forms';
|
||||
import { IDossierState } from '@red/domain';
|
||||
import { DossierStatesService } from '@services/entity-services/dossier-states.service';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { ColorPickerModule } from 'ngx-color-picker';
|
||||
import { MatIcon } from '@angular/material/icon';
|
||||
import { NgIf } from '@angular/common';
|
||||
|
||||
export interface AddEditDossierStateDialogData {
|
||||
readonly dossierState?: IDossierState;
|
||||
@ -14,6 +18,7 @@ export interface AddEditDossierStateDialogData {
|
||||
@Component({
|
||||
templateUrl: './add-edit-dossier-state-dialog.component.html',
|
||||
styleUrls: ['./add-edit-dossier-state-dialog.component.scss'],
|
||||
imports: [TranslateModule, ReactiveFormsModule, ColorPickerModule, MatIcon, NgIf, IconButtonComponent, CircleButtonComponent],
|
||||
})
|
||||
export class AddEditDossierStateDialogComponent extends BaseDialogComponent {
|
||||
readonly type = this.data.dossierState ? 'edit' : 'create';
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user