mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Compare commits
1696 Commits
dspace-8.1
...
dspace-9.0
Author | SHA1 | Date | |
---|---|---|---|
![]() |
bcc437d029 | ||
![]() |
269404cb4f | ||
![]() |
120817f5f4 | ||
![]() |
c8a136f0d5 | ||
![]() |
bcd2081ee3 | ||
![]() |
e623b68d91 | ||
![]() |
814b411192 | ||
![]() |
f77dfa37da | ||
![]() |
04964787fa | ||
![]() |
20748d2f64 | ||
![]() |
b5a29fa400 | ||
![]() |
2fffda3a28 | ||
![]() |
537fb4bfda | ||
![]() |
4ab895f821 | ||
![]() |
880b9e4130 | ||
![]() |
d965968fc9 | ||
![]() |
3f02846fed | ||
![]() |
a36e085920 | ||
![]() |
443809f3b2 | ||
![]() |
e1f3cc09cb | ||
![]() |
f14cd51678 | ||
![]() |
f0a00aca95 | ||
![]() |
aed0460cfe | ||
![]() |
6017537107 | ||
![]() |
c6657b5f9b | ||
![]() |
2d8fada3c4 | ||
![]() |
eb0572640b | ||
![]() |
598471913e | ||
![]() |
8ff5a23c40 | ||
![]() |
01c8c60624 | ||
![]() |
4200357100 | ||
![]() |
39fec7ce64 | ||
![]() |
f10447b8d3 | ||
![]() |
abb03799e0 | ||
![]() |
d4aedbbb51 | ||
![]() |
d1beb28de0 | ||
![]() |
e3152c94e0 | ||
![]() |
e9b8b25da5 | ||
![]() |
5cdc72ddbf | ||
![]() |
be3dbd604b | ||
![]() |
f277832dc1 | ||
![]() |
ba3c43ac9a | ||
![]() |
520831bd33 | ||
![]() |
6703a07207 | ||
![]() |
056351ddfe | ||
![]() |
87e4a33621 | ||
![]() |
9be8a87a57 | ||
![]() |
15f96f3c82 | ||
![]() |
98da22047a | ||
![]() |
887bf0d266 | ||
![]() |
f1a1aebe33 | ||
![]() |
ebd69c04e8 | ||
![]() |
aba3a9439d | ||
![]() |
63c2ac0a96 | ||
![]() |
96d2b66068 | ||
![]() |
d32681bbe9 | ||
![]() |
dfc1ecef25 | ||
![]() |
cef7cae573 | ||
![]() |
be85947fb6 | ||
![]() |
830be1f15a | ||
![]() |
8ff943b084 | ||
![]() |
545b2ff8a7 | ||
![]() |
163cc75437 | ||
![]() |
e9940f4005 | ||
![]() |
8c8ff6189b | ||
![]() |
788f173066 | ||
![]() |
daaa8109d6 | ||
![]() |
7ec20edbc0 | ||
![]() |
80c38f0c3d | ||
![]() |
6a138eccc6 | ||
![]() |
1fe9065fca | ||
![]() |
c442d35505 | ||
![]() |
7da8f92b15 | ||
![]() |
de66aa294f | ||
![]() |
5f53a7c966 | ||
![]() |
6115e673cd | ||
![]() |
5b18304e1c | ||
![]() |
a51cc5485c | ||
![]() |
512d2e215f | ||
![]() |
3adb81e2c6 | ||
![]() |
0ae73c7131 | ||
![]() |
9926121912 | ||
![]() |
c1524c0713 | ||
![]() |
dd4aa5ac80 | ||
![]() |
a9dff09300 | ||
![]() |
37cef0fbae | ||
![]() |
e28d212789 | ||
![]() |
d5c9e694c3 | ||
![]() |
73bd0d67ea | ||
![]() |
c0a5420e8b | ||
![]() |
bec91c5b8d | ||
![]() |
484befafc3 | ||
![]() |
7a49802444 | ||
![]() |
12a3b4f846 | ||
![]() |
9e8c0dc262 | ||
![]() |
da6ace1882 | ||
![]() |
dec05e5cfe | ||
![]() |
4c9638150a | ||
![]() |
b1191117fc | ||
![]() |
fd23044005 | ||
![]() |
c2af23b3df | ||
![]() |
8757712905 | ||
![]() |
149feee93a | ||
![]() |
b15e9d74d6 | ||
![]() |
f5ce6301e0 | ||
![]() |
c222c446b5 | ||
![]() |
a84365996b | ||
![]() |
a7bcddf597 | ||
![]() |
81fb2e1cbf | ||
![]() |
3d32715d25 | ||
![]() |
25d6809e1c | ||
![]() |
bcd9bfd607 | ||
![]() |
3a419b733a | ||
![]() |
ea265075c8 | ||
![]() |
d423f82324 | ||
![]() |
79d03d0433 | ||
![]() |
bc3d3e4129 | ||
![]() |
9d3b298f1a | ||
![]() |
0180b633e2 | ||
![]() |
f1444b6edb | ||
![]() |
e9061a46b6 | ||
![]() |
052e1c39ab | ||
![]() |
19d438040b | ||
![]() |
4d74d2c6dc | ||
![]() |
e40a697dbd | ||
![]() |
c3ba7ef51a | ||
![]() |
6d7d3572a2 | ||
![]() |
e7359a3fd2 | ||
![]() |
46a89533f0 | ||
![]() |
f7b77a1c3f | ||
![]() |
2bdb996e1a | ||
![]() |
56e45a9f08 | ||
![]() |
62f15668b6 | ||
![]() |
6c1212de4e | ||
![]() |
b1c5460bbb | ||
![]() |
c68e5a181d | ||
![]() |
0574c8ed98 | ||
![]() |
70c6af3630 | ||
![]() |
4b0ab8161f | ||
![]() |
9a24fb2b64 | ||
![]() |
df9c950f1f | ||
![]() |
af3d68ff71 | ||
![]() |
8c1f50b4d2 | ||
![]() |
ca22bf327a | ||
![]() |
5eda4db743 | ||
![]() |
a41a2441df | ||
![]() |
f44599a3c9 | ||
![]() |
3370bda789 | ||
![]() |
19078a18fc | ||
![]() |
f9b58ecd06 | ||
![]() |
dc8b10593c | ||
![]() |
7b9cd73ee0 | ||
![]() |
41afcf9cf6 | ||
![]() |
d3b48f4ea4 | ||
![]() |
0aea4a7666 | ||
![]() |
4c26359e29 | ||
![]() |
5719f06dd1 | ||
![]() |
67e91e370a | ||
![]() |
aacedd2db6 | ||
![]() |
ea6f640820 | ||
![]() |
00143d29e7 | ||
![]() |
f16a03e226 | ||
![]() |
ad7aa36f88 | ||
![]() |
6232d4e9cf | ||
![]() |
a6c14e50c2 | ||
![]() |
c1bd65e8c6 | ||
![]() |
3c1d514807 | ||
![]() |
6cd88ec57b | ||
![]() |
28f865eb2e | ||
![]() |
f107573bc1 | ||
![]() |
557879941b | ||
![]() |
0dabc8ed8f | ||
![]() |
62822ade31 | ||
![]() |
a16f1e8248 | ||
![]() |
b123e86760 | ||
![]() |
d664f1f94a | ||
![]() |
0b02dbbb67 | ||
![]() |
16e4ae5583 | ||
![]() |
cace253d8b | ||
![]() |
97a4c3c0c0 | ||
![]() |
72a050c7ae | ||
![]() |
9dc96e7b33 | ||
![]() |
99e8c1044c | ||
![]() |
33d75cf217 | ||
![]() |
287d35cb26 | ||
![]() |
c5d203bbd6 | ||
![]() |
e4d53eddcc | ||
![]() |
25f474386b | ||
![]() |
3d8951db18 | ||
![]() |
d6875117b0 | ||
![]() |
b64f69105e | ||
![]() |
353d660f23 | ||
![]() |
80dd89da56 | ||
![]() |
fa96c8c5ab | ||
![]() |
ff3784ab5f | ||
![]() |
8d26b1509f | ||
![]() |
54ed550f4a | ||
![]() |
11f251755b | ||
![]() |
b00f489d09 | ||
![]() |
4e5b344ce8 | ||
![]() |
b1f0ed201a | ||
![]() |
f8cfb74555 | ||
![]() |
e3c6ad807b | ||
![]() |
818f60b4d7 | ||
![]() |
6f878e5c4a | ||
![]() |
3a347d83b5 | ||
![]() |
b89a626ffc | ||
![]() |
fef16bca14 | ||
![]() |
bb536192c2 | ||
![]() |
00d7e1f97c | ||
![]() |
4f48f39f7b | ||
![]() |
7998d2d8b9 | ||
![]() |
5fc83782b1 | ||
![]() |
7269f6c36a | ||
![]() |
583bed6164 | ||
![]() |
056e923ae8 | ||
![]() |
856d701b3e | ||
![]() |
7845d37b2e | ||
![]() |
1b112dd887 | ||
![]() |
e84af6ab91 | ||
![]() |
bde54ca6fa | ||
![]() |
4b6ef50611 | ||
![]() |
8140ed29e7 | ||
![]() |
d269d668e5 | ||
![]() |
b076738b53 | ||
![]() |
09e6452a48 | ||
![]() |
03bcdc37ce | ||
![]() |
8734a07592 | ||
![]() |
548fbf54cf | ||
![]() |
050c007e44 | ||
![]() |
5346679880 | ||
![]() |
fad41b2ddf | ||
![]() |
fcac66caab | ||
![]() |
11493914a7 | ||
![]() |
e14ed8804c | ||
![]() |
8abd71ab73 | ||
![]() |
41c4225c0f | ||
![]() |
d8896f78b8 | ||
![]() |
3d167acecb | ||
![]() |
9b5d008d66 | ||
![]() |
5ef0a57438 | ||
![]() |
f01ccbdae2 | ||
![]() |
6001652101 | ||
![]() |
6a49cdb54b | ||
![]() |
b9e2ec15ed | ||
![]() |
9896eab6ac | ||
![]() |
5e8571de80 | ||
![]() |
452493a828 | ||
![]() |
3a05733256 | ||
![]() |
71d7a7b659 | ||
![]() |
9f19b481cf | ||
![]() |
f95596ba02 | ||
![]() |
bd2b5d3bc0 | ||
![]() |
fd2e9a49ee | ||
![]() |
8f95d7b5b3 | ||
![]() |
67c2b33bb0 | ||
![]() |
237f183a18 | ||
![]() |
0d78cd57b3 | ||
![]() |
5bdf0974fc | ||
![]() |
7864909466 | ||
![]() |
d3130bd433 | ||
![]() |
fd9d899574 | ||
![]() |
42c52d619b | ||
![]() |
ef57754e6d | ||
![]() |
0989e28c38 | ||
![]() |
051828ca74 | ||
![]() |
119a5dc5aa | ||
![]() |
5e5c2ab6dd | ||
![]() |
46831cb9e8 | ||
![]() |
956ed427e6 | ||
![]() |
4d929dd3ac | ||
![]() |
201d8db167 | ||
![]() |
a31ef383d9 | ||
![]() |
7b88ac84a5 | ||
![]() |
4b3b660354 | ||
![]() |
0ff8ce9c25 | ||
![]() |
b7a130c8c2 | ||
![]() |
42b567fd65 | ||
![]() |
c90008e3c2 | ||
![]() |
3fb8ec8860 | ||
![]() |
d0b4dacf89 | ||
![]() |
6075317c88 | ||
![]() |
291db026c5 | ||
![]() |
b8fdf46340 | ||
![]() |
865e5216c1 | ||
![]() |
aa36e5f0e1 | ||
![]() |
45a3c11dfc | ||
![]() |
d814a4b6d7 | ||
![]() |
40a313f1a7 | ||
![]() |
7795d96d53 | ||
![]() |
318a2fe02a | ||
![]() |
b21e307af2 | ||
![]() |
f77c16ebee | ||
![]() |
19f78f5709 | ||
![]() |
e8a9770b6e | ||
![]() |
6b562f06ea | ||
![]() |
d6261e43ea | ||
![]() |
4887a2848d | ||
![]() |
b44f2a9c40 | ||
![]() |
57a62b0017 | ||
![]() |
c2b702427c | ||
![]() |
8f52250beb | ||
![]() |
c03bbb01a2 | ||
![]() |
832b5b1328 | ||
![]() |
bd4c6d6dfa | ||
![]() |
6212e3fbfc | ||
![]() |
9c9bff17be | ||
![]() |
ce35ca2dfd | ||
![]() |
5bcb9c43e1 | ||
![]() |
5a0e09a0eb | ||
![]() |
b7ebd0247f | ||
![]() |
27e9e61619 | ||
![]() |
507ecdb1dd | ||
![]() |
eb8a960ba6 | ||
![]() |
f4dbfc2f19 | ||
![]() |
de44252a56 | ||
![]() |
17d7912851 | ||
![]() |
502597aadc | ||
![]() |
57d5bb0359 | ||
![]() |
3d36cd2e48 | ||
![]() |
c9654b268e | ||
![]() |
826ff3050b | ||
![]() |
e0393babc9 | ||
![]() |
39bcaa0318 | ||
![]() |
bd0b75c315 | ||
![]() |
a2690eb628 | ||
![]() |
d804123b4e | ||
![]() |
ec6940afbe | ||
![]() |
b87380b07d | ||
![]() |
6f7f5450ca | ||
![]() |
9c23b4c9f9 | ||
![]() |
0bd93ae1d9 | ||
![]() |
6fd36bd2b7 | ||
![]() |
d5c3f4dbe9 | ||
![]() |
0c5c1e46b0 | ||
![]() |
6f6016a90d | ||
![]() |
1f760d882a | ||
![]() |
d4dee96823 | ||
![]() |
0be836ad80 | ||
![]() |
b6cdb7c6b1 | ||
![]() |
a16ea97b53 | ||
![]() |
8086c2242d | ||
![]() |
4ba9a4bf8f | ||
![]() |
1e4864f45a | ||
![]() |
bb18278b2f | ||
![]() |
2fc84783a5 | ||
![]() |
dda32dd81a | ||
![]() |
fa8ffaefd0 | ||
![]() |
69472b27c7 | ||
![]() |
87624c7699 | ||
![]() |
e9cf183bbf | ||
![]() |
f070dee931 | ||
![]() |
51127dc513 | ||
![]() |
11e02c9504 | ||
![]() |
ab9cbea7c3 | ||
![]() |
58cee5fb2e | ||
![]() |
7671595665 | ||
![]() |
d8fb9f1195 | ||
![]() |
a1e7d653f2 | ||
![]() |
1fff3b5b86 | ||
![]() |
57b618ce34 | ||
![]() |
16451807f9 | ||
![]() |
80fafbf2e1 | ||
![]() |
d1bcb9fb2e | ||
![]() |
58d0e7f513 | ||
![]() |
ce93b847d2 | ||
![]() |
c9c2a774ea | ||
![]() |
e928eab96b | ||
![]() |
bff5662116 | ||
![]() |
585347b1a2 | ||
![]() |
e736bbb9ec | ||
![]() |
0c58a5bf05 | ||
![]() |
60bbcf3420 | ||
![]() |
0de6481c24 | ||
![]() |
4281267cb6 | ||
![]() |
f3bb7327dc | ||
![]() |
aea41d74ec | ||
![]() |
5a53cc9738 | ||
![]() |
cadd1520ee | ||
![]() |
0976147d07 | ||
![]() |
fe3ae0e8b4 | ||
![]() |
2c6754a647 | ||
![]() |
96b596491e | ||
![]() |
de512610b4 | ||
![]() |
61576e94d0 | ||
![]() |
d72bc0d1bb | ||
![]() |
5f83139fcd | ||
![]() |
5b7d246f68 | ||
![]() |
93fff41b8d | ||
![]() |
fd59ca8053 | ||
![]() |
e4e5255a46 | ||
![]() |
6bd4f04174 | ||
![]() |
4039198a4a | ||
![]() |
1316540765 | ||
![]() |
c1b951b18c | ||
![]() |
d3c0ef501c | ||
![]() |
33062214da | ||
![]() |
99c5506d7d | ||
![]() |
94dd8e7206 | ||
![]() |
88d59a2152 | ||
![]() |
d6b674345f | ||
![]() |
02516f2251 | ||
![]() |
a18e03d754 | ||
![]() |
d9c68d41bf | ||
![]() |
41ac417543 | ||
![]() |
3468ef689d | ||
![]() |
da2c98aa32 | ||
![]() |
7929d8e419 | ||
![]() |
cfe16892ab | ||
![]() |
422a714935 | ||
![]() |
30b411285c | ||
![]() |
53562e5a3e | ||
![]() |
5d4006f753 | ||
![]() |
262f758699 | ||
![]() |
c212b3dccd | ||
![]() |
79c5d5a560 | ||
![]() |
cdcd886a3a | ||
![]() |
681efd9f52 | ||
![]() |
2df409ca63 | ||
![]() |
26f2b8c5b0 | ||
![]() |
b44b7a66c1 | ||
![]() |
d6776a8a1e | ||
![]() |
117514bace | ||
![]() |
9b7ccd9dfe | ||
![]() |
f2c5912dfa | ||
![]() |
34726614f0 | ||
![]() |
0e56427789 | ||
![]() |
b009e0b640 | ||
![]() |
fca8c6f418 | ||
![]() |
c53d7187c7 | ||
![]() |
ef8735e5a2 | ||
![]() |
20df163444 | ||
![]() |
639bb3e558 | ||
![]() |
a58456deab | ||
![]() |
6467b60e65 | ||
![]() |
a947e8cbf6 | ||
![]() |
4b921a641c | ||
![]() |
15f39ea93e | ||
![]() |
2eb34ee634 | ||
![]() |
601c6cd49d | ||
![]() |
923579e702 | ||
![]() |
308f0751cf | ||
![]() |
b6a507d2a2 | ||
![]() |
51c95de793 | ||
![]() |
1aa9faeb2f | ||
![]() |
b1eb4a8bf9 | ||
![]() |
dc70ec0ef0 | ||
![]() |
d1b9d4f692 | ||
![]() |
c4696c9ba8 | ||
![]() |
069fd02517 | ||
![]() |
b9e164de78 | ||
![]() |
432b6607c3 | ||
![]() |
c90b05650a | ||
![]() |
4d4fe529a5 | ||
![]() |
aca14117e7 | ||
![]() |
b6fc9b5444 | ||
![]() |
af3c78cc50 | ||
![]() |
6298724ea6 | ||
![]() |
7d04084642 | ||
![]() |
9065f4f606 | ||
![]() |
f56b6856dd | ||
![]() |
77b027a6c6 | ||
![]() |
0567ea7a2d | ||
![]() |
a2882b0644 | ||
![]() |
4cea196eb2 | ||
![]() |
082018d44d | ||
![]() |
122d31b11b | ||
![]() |
7ab598d571 | ||
![]() |
bd06eded8c | ||
![]() |
16eda4f186 | ||
![]() |
c2701c412c | ||
![]() |
e976ddb07c | ||
![]() |
987e146209 | ||
![]() |
e0e2e5affa | ||
![]() |
7fe155103a | ||
![]() |
13ae42f217 | ||
![]() |
2ea32752bc | ||
![]() |
a3a2f259b2 | ||
![]() |
c835b215af | ||
![]() |
c0bfc3a739 | ||
![]() |
a0c9b3da91 | ||
![]() |
10dc73498a | ||
![]() |
0f3a7ff902 | ||
![]() |
47d55ecd36 | ||
![]() |
1df73d6730 | ||
![]() |
540cb86b2d | ||
![]() |
8d02988da7 | ||
![]() |
2173f3956e | ||
![]() |
76e1a39208 | ||
![]() |
d87b375a35 | ||
![]() |
ae32581d20 | ||
![]() |
c52c4542ce | ||
![]() |
a0f6f4b0cc | ||
![]() |
1ab022ad6c | ||
![]() |
8150517f13 | ||
![]() |
99b3db365a | ||
![]() |
e259cf4c13 | ||
![]() |
8072d8f0f2 | ||
![]() |
54e6471fa5 | ||
![]() |
3a049da620 | ||
![]() |
bb55534f2c | ||
![]() |
5e7b066af1 | ||
![]() |
16eb620f4f | ||
![]() |
9db25ec2c8 | ||
![]() |
e0240259ec | ||
![]() |
4b3215412f | ||
![]() |
f28dc8bf72 | ||
![]() |
0251aaa3f8 | ||
![]() |
b480317599 | ||
![]() |
fd7a18bfc5 | ||
![]() |
261af2a2f5 | ||
![]() |
97312820d6 | ||
![]() |
47bd509e75 | ||
![]() |
8402aebde7 | ||
![]() |
0dbae112db | ||
![]() |
66d9c7079b | ||
![]() |
33ca20fbec | ||
![]() |
f7d34899a4 | ||
![]() |
649f64e6e6 | ||
![]() |
52d826eaf6 | ||
![]() |
ce30e58c67 | ||
![]() |
f456af7a51 | ||
![]() |
967a761ac1 | ||
![]() |
c9b2717344 | ||
![]() |
52392ab719 | ||
![]() |
958b3b8c05 | ||
![]() |
0437ec4c3f | ||
![]() |
cdbfcc7cc4 | ||
![]() |
0bab79bea4 | ||
![]() |
112eb7b3ce | ||
![]() |
08fe940e70 | ||
![]() |
43e4f9de49 | ||
![]() |
4a2158a178 | ||
![]() |
bb02acf13e | ||
![]() |
dcd32c48c3 | ||
![]() |
4235351d74 | ||
![]() |
cd825ac0da | ||
![]() |
ca80812d0a | ||
![]() |
eeec2b536d | ||
![]() |
b58dd32bff | ||
![]() |
4a74a3ac99 | ||
![]() |
62904747fc | ||
![]() |
4c30e2d0be | ||
![]() |
d05096c015 | ||
![]() |
caa5b1e29a | ||
![]() |
858ec87f2f | ||
![]() |
11f79a3e6b | ||
![]() |
174d185de3 | ||
![]() |
8b9af3b04c | ||
![]() |
b837f63b7c | ||
![]() |
e838873235 | ||
![]() |
ea53111aa1 | ||
![]() |
59481abd7f | ||
![]() |
81ec674f38 | ||
![]() |
ead548f499 | ||
![]() |
5e0ae8a26e | ||
![]() |
3437ee8420 | ||
![]() |
0fec5395ff | ||
![]() |
c19af67009 | ||
![]() |
4b3d7e8ef7 | ||
![]() |
276452e4b9 | ||
![]() |
2c49c04819 | ||
![]() |
f6263f86a4 | ||
![]() |
3197ec911e | ||
![]() |
41001f186b | ||
![]() |
961bb11b59 | ||
![]() |
f82426b1dc | ||
![]() |
8b90d999ac | ||
![]() |
51102e27a1 | ||
![]() |
a01966ac44 | ||
![]() |
a33afbef2b | ||
![]() |
80948d98f0 | ||
![]() |
446f681098 | ||
![]() |
d5ea6f563b | ||
![]() |
bf20787a24 | ||
![]() |
da05c05bb8 | ||
![]() |
8933df4184 | ||
![]() |
d7c156fce9 | ||
![]() |
7a4af88c0d | ||
![]() |
98d32bc7ad | ||
![]() |
5bf38231fa | ||
![]() |
1e73fa626d | ||
![]() |
fc5a3843a8 | ||
![]() |
4caa39bddb | ||
![]() |
516dd99a26 | ||
![]() |
6eb5eec050 | ||
![]() |
3fecbc245b | ||
![]() |
fbffcca945 | ||
![]() |
f08823333f | ||
![]() |
1956e25a83 | ||
![]() |
87eee70b0a | ||
![]() |
59cb19ae80 | ||
![]() |
3f7c42c51e | ||
![]() |
2e28a51b02 | ||
![]() |
7fab9633ea | ||
![]() |
a37bb6ade1 | ||
![]() |
7584b9e1c3 | ||
![]() |
be6de64fcd | ||
![]() |
8184acc480 | ||
![]() |
7660dd8d95 | ||
![]() |
6f4c3860a3 | ||
![]() |
d73885137a | ||
![]() |
290c24b448 | ||
![]() |
21dac408ee | ||
![]() |
d118496075 | ||
![]() |
cb5deb644e | ||
![]() |
f9d8e4e0b7 | ||
![]() |
a3ffda3bf8 | ||
![]() |
8ca668159e | ||
![]() |
3d6af1f8c0 | ||
![]() |
f721028d81 | ||
![]() |
542e2db930 | ||
![]() |
4d85639f31 | ||
![]() |
fd2120904c | ||
![]() |
2225c2e428 | ||
![]() |
fddc4936e8 | ||
![]() |
0649342658 | ||
![]() |
7acf79370b | ||
![]() |
95064122d0 | ||
![]() |
d92424e2f4 | ||
![]() |
72919cd867 | ||
![]() |
073cd079e8 | ||
![]() |
8eaff78737 | ||
![]() |
daf2dc40d9 | ||
![]() |
e1b773c097 | ||
![]() |
21f4dc5fd9 | ||
![]() |
65834fc86e | ||
![]() |
83d24f8c21 | ||
![]() |
ac3e87db05 | ||
![]() |
636fba40f7 | ||
![]() |
f8123fbbfd | ||
![]() |
8313b9a929 | ||
![]() |
51aa5fb61c | ||
![]() |
a5378e0cf5 | ||
![]() |
0abbf80c1d | ||
![]() |
d4536ffbf4 | ||
![]() |
7e69b448d6 | ||
![]() |
bf2d12a10b | ||
![]() |
04e5f59cdf | ||
![]() |
e1fad603f0 | ||
![]() |
6b73c75205 | ||
![]() |
f01e49f05f | ||
![]() |
bdac58d7fc | ||
![]() |
c8aae069f8 | ||
![]() |
073b2b0acd | ||
![]() |
d155d778ee | ||
![]() |
50e440bcf5 | ||
![]() |
af39526d77 | ||
![]() |
f77ce869f8 | ||
![]() |
bc06839926 | ||
![]() |
a3ebfc0f36 | ||
![]() |
362364136d | ||
![]() |
b892b13529 | ||
![]() |
b220e20053 | ||
![]() |
eaff0b1397 | ||
![]() |
0108f525ba | ||
![]() |
3f5de295a7 | ||
![]() |
62924cc5e0 | ||
![]() |
8453b667cb | ||
![]() |
3922130434 | ||
![]() |
c3b265d213 | ||
![]() |
2b58377830 | ||
![]() |
4536d9c74d | ||
![]() |
a3b7125ef9 | ||
![]() |
6f9c55d250 | ||
![]() |
9c6fb1794f | ||
![]() |
0f27ae1125 | ||
![]() |
73285284ce | ||
![]() |
53186988f5 | ||
![]() |
8f9236f06d | ||
![]() |
470ad80741 | ||
![]() |
c3f17b9754 | ||
![]() |
e867993bb8 | ||
![]() |
e296295df5 | ||
![]() |
cafe88a3b8 | ||
![]() |
98832f2540 | ||
![]() |
6e7c0da68a | ||
![]() |
45ee56fe8f | ||
![]() |
cfba84ce31 | ||
![]() |
a7276b8a30 | ||
![]() |
587e1546dc | ||
![]() |
ec9a1e22f7 | ||
![]() |
82ed3aadff | ||
![]() |
f262299382 | ||
![]() |
795f300158 | ||
![]() |
69164837f0 | ||
![]() |
38d5f87d3e | ||
![]() |
5a5c1f18e3 | ||
![]() |
090dda28ad | ||
![]() |
83d86d7b68 | ||
![]() |
bb3d2bb483 | ||
![]() |
8c92364d43 | ||
![]() |
1cc4756ee2 | ||
![]() |
d70fa8f569 | ||
![]() |
df377804bb | ||
![]() |
84feea9b30 | ||
![]() |
baf3886115 | ||
![]() |
262723b0ca | ||
![]() |
196a8c21db | ||
![]() |
08bda53a2e | ||
![]() |
cd2f8abd2d | ||
![]() |
920edef155 | ||
![]() |
8a4f24fc31 | ||
![]() |
7142e66910 | ||
![]() |
6cf62a6c61 | ||
![]() |
c7d8949c82 | ||
![]() |
b49e6fda9a | ||
![]() |
7f1ae419af | ||
![]() |
30d57174e6 | ||
![]() |
89b72b9dc1 | ||
![]() |
c155a60a7e | ||
![]() |
5d6bf0bb33 | ||
![]() |
65e1b8ed60 | ||
![]() |
2cebbd9b8f | ||
![]() |
147564b114 | ||
![]() |
c5603c7be2 | ||
![]() |
ecd2faea4a | ||
![]() |
990f00b129 | ||
![]() |
483b97d9c1 | ||
![]() |
171a971572 | ||
![]() |
8a4e8f6045 | ||
![]() |
32364e4f68 | ||
![]() |
311f648c3f | ||
![]() |
2c28f75263 | ||
![]() |
53335658e0 | ||
![]() |
9467838066 | ||
![]() |
99656f1357 | ||
![]() |
8ee05f4352 | ||
![]() |
6756a78ba0 | ||
![]() |
b482b58d53 | ||
![]() |
312a2a7f58 | ||
![]() |
d6f0f02c1a | ||
![]() |
61eb14783e | ||
![]() |
126f3c71f4 | ||
![]() |
6cd092671f | ||
![]() |
39c5de6e18 | ||
![]() |
5868a3198f | ||
![]() |
c5fd4426cd | ||
![]() |
8cfc61c7f3 | ||
![]() |
2a39bd831b | ||
![]() |
b69b21af6c | ||
![]() |
ea715ba9f5 | ||
![]() |
7a948f1e2a | ||
![]() |
d653c011fe | ||
![]() |
f097652594 | ||
![]() |
8dec8e4315 | ||
![]() |
cecf87364e | ||
![]() |
f4bc87d327 | ||
![]() |
afa0a9017f | ||
![]() |
03b4ce3e60 | ||
![]() |
7638511762 | ||
![]() |
87f05f428f | ||
![]() |
1b83f18960 | ||
![]() |
58ff240c05 | ||
![]() |
33a091d630 | ||
![]() |
63c98740ba | ||
![]() |
31336efad2 | ||
![]() |
17ecc592f3 | ||
![]() |
cb8a7cd402 | ||
![]() |
888459cb56 | ||
![]() |
f0ff625b4b | ||
![]() |
fc2d3f0a23 | ||
![]() |
6cb3e8bbfb | ||
![]() |
09d7a7f257 | ||
![]() |
c7ae1d63b5 | ||
![]() |
0475c0b2d9 | ||
![]() |
00ff0cc7e4 | ||
![]() |
81fa0ba446 | ||
![]() |
a5fb2e6417 | ||
![]() |
f6269a95ee | ||
![]() |
5342653b99 | ||
![]() |
5c50faa319 | ||
![]() |
88fb275017 | ||
![]() |
b55a318676 | ||
![]() |
b839252ed7 | ||
![]() |
e3f13f8c54 | ||
![]() |
b08edf1ea4 | ||
![]() |
2bd53d822a | ||
![]() |
b11543c3a5 | ||
![]() |
6035d9e925 | ||
![]() |
0a5d20e236 | ||
![]() |
5d04e44ff3 | ||
![]() |
74d6dbb454 | ||
![]() |
d0b6571954 | ||
![]() |
0a7307a515 | ||
![]() |
4f1013a20d | ||
![]() |
39ddc5cbcd | ||
![]() |
9bc65b99a6 | ||
![]() |
b65f1ee5e3 | ||
![]() |
6eabe425c4 | ||
![]() |
9741ce3e69 | ||
![]() |
7472be0098 | ||
![]() |
98fd9e7182 | ||
![]() |
9708c06372 | ||
![]() |
f02f8bab88 | ||
![]() |
bb412469c7 | ||
![]() |
f3df3cc96c | ||
![]() |
8ef53178db | ||
![]() |
7009cf32cc | ||
![]() |
cd2959603b | ||
![]() |
3c47acf9f1 | ||
![]() |
570d711e01 | ||
![]() |
395a5b2cb1 | ||
![]() |
b2a10e4ace | ||
![]() |
5b3b3bfb9c | ||
![]() |
89281d7c99 | ||
![]() |
c3e635bff1 | ||
![]() |
32fae27c7a | ||
![]() |
ce5ab70fd4 | ||
![]() |
2abdf122b4 | ||
![]() |
31c9b854c6 | ||
![]() |
75e45d4c15 | ||
![]() |
76ae286f2a | ||
![]() |
d88c8ef986 | ||
![]() |
0e29c09b7a | ||
![]() |
f07a62b8b6 | ||
![]() |
6cf05c1403 | ||
![]() |
2b96983f9d | ||
![]() |
09c11f8dbc | ||
![]() |
c8b2642f57 | ||
![]() |
fd166fe79a | ||
![]() |
6446911441 | ||
![]() |
9e1ce916f6 | ||
![]() |
ecceaf9ee1 | ||
![]() |
c20bf58b4b | ||
![]() |
7feb9fc617 | ||
![]() |
5623cc9221 | ||
![]() |
fcf3370d66 | ||
![]() |
6dd61ca25e | ||
![]() |
813e965938 | ||
![]() |
fa723c17a9 | ||
![]() |
f067eb9aae | ||
![]() |
d8a73c362c | ||
![]() |
e02326510f | ||
![]() |
096c5bdedd | ||
![]() |
ccdf5498d8 | ||
![]() |
3c16537fe4 | ||
![]() |
a57fd1a069 | ||
![]() |
6f5864d106 | ||
![]() |
fbe4ce5829 | ||
![]() |
112bed787a | ||
![]() |
05d5a0816d | ||
![]() |
c5f07daab7 | ||
![]() |
f52aac879a | ||
![]() |
08800f4469 | ||
![]() |
952611a3d3 | ||
![]() |
050cde3735 | ||
![]() |
58e9a60812 | ||
![]() |
272cb656cd | ||
![]() |
76539dd8a1 | ||
![]() |
d0a8448de6 | ||
![]() |
cf87b905b6 | ||
![]() |
c1fb26fe26 | ||
![]() |
8a62deb90b | ||
![]() |
9fce33f514 | ||
![]() |
04123f92aa | ||
![]() |
7538f49a36 | ||
![]() |
60586f6c33 | ||
![]() |
86a6897861 | ||
![]() |
68372b2cb8 | ||
![]() |
cefeb6a1d6 | ||
![]() |
9c859b1fdc | ||
![]() |
fbaa5068af | ||
![]() |
8515de3d10 | ||
![]() |
f24e53f1ea | ||
![]() |
96cdab8d6a | ||
![]() |
b1c507807a | ||
![]() |
ebc7799404 | ||
![]() |
d3d86f4f2d | ||
![]() |
a078932857 | ||
![]() |
5bd8795262 | ||
![]() |
53f46040d3 | ||
![]() |
2c22517090 | ||
![]() |
d8246f4550 | ||
![]() |
a1b7c8d9c5 | ||
![]() |
cb4a7b31f0 | ||
![]() |
fda9330221 | ||
![]() |
894448e3dc | ||
![]() |
9d4542c2a4 | ||
![]() |
c1a1fe7443 | ||
![]() |
e04cdef429 | ||
![]() |
b25294c872 | ||
![]() |
01cb2c7429 | ||
![]() |
d1d9f2f7f9 | ||
![]() |
2cde0d3f21 | ||
![]() |
08f48d8204 | ||
![]() |
ecf3298345 | ||
![]() |
af7c095af0 | ||
![]() |
b8bb3ff815 | ||
![]() |
fea109117f | ||
![]() |
4729ae950d | ||
![]() |
1c1bcc704a | ||
![]() |
d85d5fbd71 | ||
![]() |
33fdee554e | ||
![]() |
4dcc7c282d | ||
![]() |
d61cb33f9a | ||
![]() |
741cf66518 | ||
![]() |
b583e17880 | ||
![]() |
5c8eabddab | ||
![]() |
a18225aa4d | ||
![]() |
829d406808 | ||
![]() |
e06db4cbab | ||
![]() |
85a120da62 | ||
![]() |
d578222f8f | ||
![]() |
abc3c41c63 | ||
![]() |
6ac922971d | ||
![]() |
a8e658a399 | ||
![]() |
81522586dd | ||
![]() |
a8ff6a41e0 | ||
![]() |
75260b00d9 | ||
![]() |
14680b013e | ||
![]() |
b601405e56 | ||
![]() |
225a2b6736 | ||
![]() |
c6ef2f1bd0 | ||
![]() |
2a1ef02d75 | ||
![]() |
25ab69ff21 | ||
![]() |
aba988a6a4 | ||
![]() |
5b3da0236f | ||
![]() |
d13d8860f2 | ||
![]() |
0ade76a99c | ||
![]() |
a105bcd6f4 | ||
![]() |
eb3db9ceb6 | ||
![]() |
b454e49553 | ||
![]() |
84c0371aab | ||
![]() |
4bf4e18389 | ||
![]() |
f16015abc2 | ||
![]() |
253b2e84d1 | ||
![]() |
05c74123a5 | ||
![]() |
2ff5350302 | ||
![]() |
36dd4762ed | ||
![]() |
655558538c | ||
![]() |
f339d8bf37 | ||
![]() |
c1aabf6add | ||
![]() |
12fc5aff71 | ||
![]() |
cd500007b6 | ||
![]() |
686b61915a | ||
![]() |
996c877412 | ||
![]() |
c9d6c95563 | ||
![]() |
5a7190203a | ||
![]() |
dab6b1c12e | ||
![]() |
bad57def74 | ||
![]() |
0d516bfe9c | ||
![]() |
4575c3d7af | ||
![]() |
494771c0da | ||
![]() |
44d2450543 | ||
![]() |
8572bfb1b1 | ||
![]() |
cc70eaa82e | ||
![]() |
bee8bde87f | ||
![]() |
ff7c9ba955 | ||
![]() |
c71c6667e0 | ||
![]() |
010b2f9693 | ||
![]() |
ac00f88fe0 | ||
![]() |
edfaee6aab | ||
![]() |
c67dc4d8e4 | ||
![]() |
f2d6f774d3 | ||
![]() |
1a48a6c853 | ||
![]() |
297fc01892 | ||
![]() |
7ca4d8f2b1 | ||
![]() |
e4b2ebe7aa | ||
![]() |
2fb746f6e6 | ||
![]() |
11626e22eb | ||
![]() |
dbd67f056e | ||
![]() |
f9e67dc513 | ||
![]() |
acb7c9bd33 | ||
![]() |
97b5e0cc92 | ||
![]() |
e9a28c6d3d | ||
![]() |
2e174cd9e6 | ||
![]() |
15d3f257b3 | ||
![]() |
8509096c32 | ||
![]() |
84878ede67 | ||
![]() |
394ecea118 | ||
![]() |
71de4b600b | ||
![]() |
830ada37f5 | ||
![]() |
b5a8b56473 | ||
![]() |
2a72fac646 | ||
![]() |
6988df519e | ||
![]() |
ce17d23c08 | ||
![]() |
91acc957b1 | ||
![]() |
987ea5104a | ||
![]() |
dcea3baf46 | ||
![]() |
446280b59a | ||
![]() |
135c085024 | ||
![]() |
80e938b1f2 | ||
![]() |
c9df52cba2 | ||
![]() |
37bd26ed1e | ||
![]() |
0b3cb7906c | ||
![]() |
e975585350 | ||
![]() |
3ca56c3c28 | ||
![]() |
9f74d45e16 | ||
![]() |
7eeeab4c26 | ||
![]() |
67c253bbbb | ||
![]() |
a53df4fed4 | ||
![]() |
cdec4880d2 | ||
![]() |
c743387a26 | ||
![]() |
05508b63ab | ||
![]() |
be2662fb92 | ||
![]() |
feceb21d9c | ||
![]() |
2011aee21e | ||
![]() |
70b855e785 | ||
![]() |
b2715501b0 | ||
![]() |
7cd13f692e | ||
![]() |
e4daf2b825 | ||
![]() |
c38352ed22 | ||
![]() |
deb4a63c88 | ||
![]() |
ec016e80fb | ||
![]() |
ced163a25f | ||
![]() |
5a28e66b2f | ||
![]() |
35a25b372d | ||
![]() |
62b31ea8c5 | ||
![]() |
256d71cc1e | ||
![]() |
138c007f28 | ||
![]() |
9ac92e0196 | ||
![]() |
287d028331 | ||
![]() |
cae13942e2 | ||
![]() |
b16cec631d | ||
![]() |
dc8a699e94 | ||
![]() |
1c9272107c | ||
![]() |
5c9f494f76 | ||
![]() |
decacec404 | ||
![]() |
0f4d71eb58 | ||
![]() |
757d23e74d | ||
![]() |
b54e54da30 | ||
![]() |
628ec2b6ba | ||
![]() |
fdfa6e2c06 | ||
![]() |
ecb00a95a0 | ||
![]() |
fe90d39943 | ||
![]() |
e2615a798e | ||
![]() |
ff42b65fc9 | ||
![]() |
1e5eff918d | ||
![]() |
e59674b5ac | ||
![]() |
5a1522deac | ||
![]() |
bfefc4139e | ||
![]() |
a105131b2b | ||
![]() |
2b104183f7 | ||
![]() |
a5dff6df87 | ||
![]() |
790fa26953 | ||
![]() |
b2f9743f9f | ||
![]() |
aec402e77f | ||
![]() |
66dedc5b2e | ||
![]() |
0417e1de59 | ||
![]() |
2c16162948 | ||
![]() |
e267244caa | ||
![]() |
c062d95354 | ||
![]() |
f6d8446c75 | ||
![]() |
3fda97f573 | ||
![]() |
60dfe056dd | ||
![]() |
20263073c6 | ||
![]() |
6330516630 | ||
![]() |
bd638f0356 | ||
![]() |
b11efbbf0c | ||
![]() |
68b6cc9bd4 | ||
![]() |
d586a8450d | ||
![]() |
33bc8ba1a3 | ||
![]() |
865268e820 | ||
![]() |
e5ea435cbe | ||
![]() |
6b32d04aec | ||
![]() |
a0973090ee | ||
![]() |
4b6e4c60c2 | ||
![]() |
06783364c4 | ||
![]() |
19da7bf453 | ||
![]() |
fb55a04f70 | ||
![]() |
a812e6ae27 | ||
![]() |
10ccf32435 | ||
![]() |
841caec3e6 | ||
![]() |
9715eaba36 | ||
![]() |
bc50efec5e | ||
![]() |
25fd1a9d76 | ||
![]() |
bc7c086ca6 | ||
![]() |
0f850f3327 | ||
![]() |
a81799fd07 | ||
![]() |
89e458a9f6 | ||
![]() |
64628f7e0d | ||
![]() |
4353c57cd0 | ||
![]() |
821b8ee3f0 | ||
![]() |
e4cdd73294 | ||
![]() |
ce010725ac | ||
![]() |
d819cf4396 | ||
![]() |
7b4d5f9aad | ||
![]() |
2c7e30ce21 | ||
![]() |
9f879d3850 | ||
![]() |
87f5b50201 | ||
![]() |
1ccdec290a | ||
![]() |
65d17e4784 | ||
![]() |
752951ce3b | ||
![]() |
33dddc697f | ||
![]() |
bb7f0cd3a5 | ||
![]() |
752eb4c57b | ||
![]() |
ded0079f24 | ||
![]() |
ed0fcd982c | ||
![]() |
04515591e2 | ||
![]() |
37455a8b6c | ||
![]() |
82fd9539b7 | ||
![]() |
52eabec70d | ||
![]() |
cad086c945 | ||
![]() |
6a49df59af | ||
![]() |
d224a2c47d | ||
![]() |
b72ce73931 | ||
![]() |
8f708d0e28 | ||
![]() |
67f9623cf4 | ||
![]() |
38c7988274 | ||
![]() |
9c3363d465 | ||
![]() |
33262795ba | ||
![]() |
2aaa32ae5f | ||
![]() |
25d8f6e323 | ||
![]() |
da2a9d3389 | ||
![]() |
1aef6ce1d6 | ||
![]() |
5bd99a1216 | ||
![]() |
1645acece4 | ||
![]() |
6b521e7505 | ||
![]() |
1b77530a31 | ||
![]() |
2eb120909b | ||
![]() |
26f4d1d329 | ||
![]() |
449c092bf9 | ||
![]() |
23dd7903ba | ||
![]() |
9d4eeb9c9f | ||
![]() |
fde2db85e7 | ||
![]() |
1011468273 | ||
![]() |
1fad3cffc7 | ||
![]() |
c330e83095 | ||
![]() |
3b3fa4f643 | ||
![]() |
a6b45f777c | ||
![]() |
585bbec5d5 | ||
![]() |
4fd3df4f8a | ||
![]() |
33bdb69dca | ||
![]() |
28c8550ef5 | ||
![]() |
009da08177 | ||
![]() |
fa6e85d6db | ||
![]() |
ac720033dc | ||
![]() |
7b72a5f0c2 | ||
![]() |
e629d9edf0 | ||
![]() |
6257718377 | ||
![]() |
e516ae8653 | ||
![]() |
0ab4d903d9 | ||
![]() |
017e49aca0 | ||
![]() |
77b66a57b8 | ||
![]() |
2ba3f0b15e | ||
![]() |
f2c2fda9f2 | ||
![]() |
e589e95083 | ||
![]() |
54e3eeb56d | ||
![]() |
9eaaab5dd0 | ||
![]() |
8d00d435c4 | ||
![]() |
0cb5b76159 | ||
![]() |
976ac7604b | ||
![]() |
d3de28d909 | ||
![]() |
2581b66a18 | ||
![]() |
f7bb83013a | ||
![]() |
84df67c00b | ||
![]() |
2152bab717 | ||
![]() |
05232cdf2b | ||
![]() |
c08c2721ac | ||
![]() |
2547b1218f | ||
![]() |
0a005c2d95 | ||
![]() |
dda9c6ec09 | ||
![]() |
5b8cc3c9da | ||
![]() |
45fb5aa611 | ||
![]() |
13cbcd35ff | ||
![]() |
df08276440 | ||
![]() |
6f360a6a2d | ||
![]() |
4a394a2a38 | ||
![]() |
da9e856369 | ||
![]() |
835aa2ef87 | ||
![]() |
3a5cf9c6c3 | ||
![]() |
efc8cad00f | ||
![]() |
993e109e1f | ||
![]() |
eedaa2c120 | ||
![]() |
d4e6aa8660 | ||
![]() |
4d365936f2 | ||
![]() |
6655dec1ec | ||
![]() |
99d421caec | ||
![]() |
8d33d52174 | ||
![]() |
6a7c19ae4b | ||
![]() |
fc9eb1157b | ||
![]() |
31e2bd26ea | ||
![]() |
ec4ca74a97 | ||
![]() |
497f4fd8d4 | ||
![]() |
c83b6ff036 | ||
![]() |
e93e66d3e4 | ||
![]() |
43630bb7b6 | ||
![]() |
3832851ef4 | ||
![]() |
3b00cc1080 | ||
![]() |
4c5b064cfb | ||
![]() |
426a0ac488 | ||
![]() |
fef5dd72b3 | ||
![]() |
217b72a332 | ||
![]() |
b4231dcf77 | ||
![]() |
ef11340280 | ||
![]() |
660b87355a | ||
![]() |
d4bb79ca18 | ||
![]() |
9c4e8a3e68 | ||
![]() |
8c70ee800b | ||
![]() |
40e805f90f | ||
![]() |
a719a2337a | ||
![]() |
0ed8c05e1c | ||
![]() |
693adc7cfc | ||
![]() |
3deef34f5b | ||
![]() |
425078dc4e | ||
![]() |
5c877f56e9 | ||
![]() |
39c5c755d7 | ||
![]() |
c93ed03004 | ||
![]() |
bd43d959ab | ||
![]() |
9486ab5fa1 | ||
![]() |
abd0d696dc | ||
![]() |
74e85c79e7 | ||
![]() |
7c6ecf8e9e | ||
![]() |
ea8f24d410 | ||
![]() |
92ee89e8e5 | ||
![]() |
c7497cdf4e | ||
![]() |
81fb382b9a | ||
![]() |
ae816815fc | ||
![]() |
87dc6be213 | ||
![]() |
ee36bab60b | ||
![]() |
ccf6f36ade | ||
![]() |
5cb22bb1d0 | ||
![]() |
b237c7f5cb | ||
![]() |
30c3e3db0c | ||
![]() |
39cdd1692a | ||
![]() |
93c6ab2684 | ||
![]() |
2ab1472f22 | ||
![]() |
280d6d92ad | ||
![]() |
b7c4c737c1 | ||
![]() |
603e46283f | ||
![]() |
c17adef242 | ||
![]() |
bacd484832 | ||
![]() |
7eb0a47fca | ||
![]() |
cfa6d50583 | ||
![]() |
47db669191 | ||
![]() |
ab60ad2072 | ||
![]() |
f3eb5b8a86 | ||
![]() |
081c573653 | ||
![]() |
e22ed77527 | ||
![]() |
4eca7c062c | ||
![]() |
bef3d37802 | ||
![]() |
2ab52dad8e | ||
![]() |
6bd66910a9 | ||
![]() |
cfecf0ff62 | ||
![]() |
1bea5f8e6c | ||
![]() |
49809da1fb | ||
![]() |
d98ae341fd | ||
![]() |
ddafda33b8 | ||
![]() |
7ee4fd5b06 | ||
![]() |
b90f8e1b49 | ||
![]() |
2a92215d82 | ||
![]() |
d03b3c3a48 | ||
![]() |
5ac126250e | ||
![]() |
a1919a7a1f | ||
![]() |
dfae913dea | ||
![]() |
627d8097ac | ||
![]() |
f758d6250c | ||
![]() |
f0b4a56ed5 | ||
![]() |
23bc4b286b | ||
![]() |
3cd5432034 | ||
![]() |
49b329edb1 | ||
![]() |
8dc777fc46 | ||
![]() |
beb05b26ce | ||
![]() |
2e55f4b47f | ||
![]() |
08fe8beaf9 | ||
![]() |
e7430b9c1a | ||
![]() |
4543285a9d | ||
![]() |
88fd0b0094 | ||
![]() |
56321e6da8 | ||
![]() |
86ea2dc5cb | ||
![]() |
43d4122bc5 | ||
![]() |
65b8ba34e6 | ||
![]() |
57f8660ff1 | ||
![]() |
f646f0a350 | ||
![]() |
e87da70191 | ||
![]() |
4f24f2d12f | ||
![]() |
44fdc49e26 | ||
![]() |
610bd32869 | ||
![]() |
059da40c64 | ||
![]() |
6f7c64e8ca | ||
![]() |
1b99ffbf58 | ||
![]() |
36195a9ed1 | ||
![]() |
d784a28ddb | ||
![]() |
b170333030 | ||
![]() |
ce1dc46857 | ||
![]() |
2eaa6b8977 | ||
![]() |
95d0767137 | ||
![]() |
d0daf9cf49 | ||
![]() |
e1619e6a6b | ||
![]() |
a157f9f09f | ||
![]() |
e3be0cd794 | ||
![]() |
ac3bccc67d | ||
![]() |
b2d46190cb | ||
![]() |
b80aad1baa | ||
![]() |
16bda200c0 | ||
![]() |
2d44c988e4 | ||
![]() |
08e7bdebbc | ||
![]() |
532da9d21f | ||
![]() |
dc73f85458 | ||
![]() |
ac1adefeec | ||
![]() |
6eb407ff3b | ||
![]() |
2c152e632b | ||
![]() |
1592763f8a | ||
![]() |
f750259c50 | ||
![]() |
047b4629bf | ||
![]() |
1244f23522 | ||
![]() |
372444c50a | ||
![]() |
9e3c02e1f3 | ||
![]() |
20e67030a9 | ||
![]() |
9e79c42a9e | ||
![]() |
acd8cbed50 | ||
![]() |
5275f8d13f | ||
![]() |
c3eaf8bd6f | ||
![]() |
53c6e89486 | ||
![]() |
1bfd68bd34 | ||
![]() |
9410114be3 | ||
![]() |
5a7ebd4ba9 | ||
![]() |
5a3b0c6d78 | ||
![]() |
1ffb0f94a2 | ||
![]() |
9d6af0a538 | ||
![]() |
3459bf68cb | ||
![]() |
e713092c85 | ||
![]() |
ab7bded221 | ||
![]() |
14a6894540 | ||
![]() |
299693dfc3 | ||
![]() |
5a02217b45 | ||
![]() |
946a3afde8 | ||
![]() |
34b9124bde | ||
![]() |
6181adccae | ||
![]() |
b0900d5aa9 | ||
![]() |
e181e854cc | ||
![]() |
ad8dd8b648 | ||
![]() |
a74cd848fe | ||
![]() |
dfe2d4580e | ||
![]() |
12d67ec315 | ||
![]() |
7f1e267b2d | ||
![]() |
8c88f7052a | ||
![]() |
a8115b7201 | ||
![]() |
7e19686e8d | ||
![]() |
72246bdc60 | ||
![]() |
9c2b12ead8 | ||
![]() |
b1392ff009 | ||
![]() |
479e1be216 | ||
![]() |
696ce32ab4 | ||
![]() |
63a5217f6b | ||
![]() |
a1fcc2e3ba | ||
![]() |
77c245ae53 | ||
![]() |
9a2b794c8e | ||
![]() |
5e2809d14c | ||
![]() |
cacb1f9e44 | ||
![]() |
3ad1f6e69c | ||
![]() |
4bb1baf638 | ||
![]() |
9033e020ee | ||
![]() |
68d27e59bb | ||
![]() |
2044f7b2d5 | ||
![]() |
47e89426d9 | ||
![]() |
f749ade52c | ||
![]() |
533da6624f | ||
![]() |
db695d134f | ||
![]() |
fa601fcbb4 | ||
![]() |
2cf3682473 | ||
![]() |
0d36bcec2e | ||
![]() |
f9fa586060 | ||
![]() |
f7063d4eaf | ||
![]() |
4de3c58e06 | ||
![]() |
005936b18d | ||
![]() |
1975c63ad1 | ||
![]() |
680d6c9416 | ||
![]() |
ecb0de7374 | ||
![]() |
86ae3e4d47 | ||
![]() |
704cc06f16 | ||
![]() |
e74dc22077 | ||
![]() |
7884de94e0 | ||
![]() |
9ddfa27d0c | ||
![]() |
169ae41d49 | ||
![]() |
7cd82e542b | ||
![]() |
6388613948 | ||
![]() |
34a4f5b597 | ||
![]() |
7cf7749367 | ||
![]() |
101a3d70ce | ||
![]() |
adcc6f564d | ||
![]() |
1443e5b3e1 | ||
![]() |
ba2570b83b | ||
![]() |
7ac14daf46 | ||
![]() |
caed26d191 | ||
![]() |
5c0c559685 | ||
![]() |
9079a968f0 | ||
![]() |
3df66e0257 | ||
![]() |
be36175bb8 | ||
![]() |
d0265eb3f6 | ||
![]() |
5479cc6274 | ||
![]() |
db891f2f16 | ||
![]() |
543cc42bf3 | ||
![]() |
2ad9a44b99 | ||
![]() |
ecd2275e1b | ||
![]() |
f904c0f67d | ||
![]() |
64855c9cf8 | ||
![]() |
9a7b242827 | ||
![]() |
e46c801554 | ||
![]() |
7be3f1fada | ||
![]() |
e13b0e3e13 | ||
![]() |
144b455eae | ||
![]() |
c6a3794a76 | ||
![]() |
bd8659ac11 | ||
![]() |
5636db84a8 | ||
![]() |
5621b84284 | ||
![]() |
35cc7a8096 | ||
![]() |
a4e2c47c51 | ||
![]() |
7a60cd9aaf | ||
![]() |
d7ff9c3ec0 | ||
![]() |
8e1736f608 | ||
![]() |
c1cc9ba2d6 | ||
![]() |
b4d932a91b | ||
![]() |
b0356c58fb | ||
![]() |
75655f1bb8 | ||
![]() |
c2d3d8b216 | ||
![]() |
b543b32a37 | ||
![]() |
a012e4cea2 | ||
![]() |
968c5bda71 | ||
![]() |
7aba69edd6 | ||
![]() |
f9911ce5ba | ||
![]() |
59ba031b1f | ||
![]() |
7611635ad0 | ||
![]() |
9badd4a4b6 | ||
![]() |
5e5c627b8b | ||
![]() |
9e985cf2d4 | ||
![]() |
813d644b32 | ||
![]() |
2b466bb382 | ||
![]() |
55ab43f132 | ||
![]() |
0e5b924f42 | ||
![]() |
f131ae2f6b | ||
![]() |
2369b27178 | ||
![]() |
69f618e856 | ||
![]() |
4cd55d6669 | ||
![]() |
d12d0faf09 | ||
![]() |
85e486438a | ||
![]() |
a0e3c41be6 | ||
![]() |
e6a7fb852a | ||
![]() |
2f94f49c06 | ||
![]() |
3306d0d699 | ||
![]() |
b9c712c72f | ||
![]() |
bf9590c1e6 | ||
![]() |
e2a84b2145 | ||
![]() |
035ae803e2 | ||
![]() |
c5b395802c | ||
![]() |
3e01912eb2 | ||
![]() |
4bd6071071 | ||
![]() |
bbc93291ea | ||
![]() |
2643a459b6 | ||
![]() |
eeaac8965b | ||
![]() |
62006c00ca | ||
![]() |
762bc8ce8c | ||
![]() |
4aed1b6056 | ||
![]() |
df24a63a46 | ||
![]() |
161daffcc0 | ||
![]() |
876d94e124 | ||
![]() |
fec4aa6df1 | ||
![]() |
f975e1da89 | ||
![]() |
dd93a10007 | ||
![]() |
3d057bb1b2 | ||
![]() |
8fb4772b6c | ||
![]() |
a8e5b26744 | ||
![]() |
6c0514ab48 | ||
![]() |
c4dfed0e02 | ||
![]() |
ad7bbb85cb | ||
![]() |
bc84bc867b | ||
![]() |
98c49231b4 | ||
![]() |
73d39abfe5 | ||
![]() |
3658ad1ec0 | ||
![]() |
e54b1ce274 | ||
![]() |
9565f9b9ee | ||
![]() |
052b6a9bdd | ||
![]() |
0f5a50a868 | ||
![]() |
a2193a186a | ||
![]() |
cf5ac335ca | ||
![]() |
fe7d2a8a7e | ||
![]() |
cbd681d440 | ||
![]() |
5ffd405ba6 | ||
![]() |
edc738ae39 | ||
![]() |
ff322e2ae1 | ||
![]() |
46b241eda5 | ||
![]() |
f244d388be | ||
![]() |
59fd32ac68 | ||
![]() |
48ec0cdc34 | ||
![]() |
af7b14851c | ||
![]() |
aed97c9dcc | ||
![]() |
3664512e27 | ||
![]() |
26dcb6b8b0 | ||
![]() |
27eeefae5f | ||
![]() |
1b17879d7a | ||
![]() |
bcaa73a161 | ||
![]() |
1565a1dc32 | ||
![]() |
83615a1c90 | ||
![]() |
214a77a65c | ||
![]() |
29c1b51073 | ||
![]() |
35946dcf7c | ||
![]() |
f49bdcd8c8 | ||
![]() |
cd51baa5f1 | ||
![]() |
99100371b8 | ||
![]() |
fca5700012 | ||
![]() |
ed5ac47f88 | ||
![]() |
ee83beae94 | ||
![]() |
debc2325cd | ||
![]() |
e2dc89c737 | ||
![]() |
c249afdb3f | ||
![]() |
c419dd608b | ||
![]() |
4a7ebeea16 | ||
![]() |
1209b40ac9 | ||
![]() |
f65d6c5775 | ||
![]() |
685e6d83c5 | ||
![]() |
80e1daeb65 | ||
![]() |
0928dc1ca9 | ||
![]() |
5a609d5bb1 | ||
![]() |
9fd3c2d734 | ||
![]() |
58c5d742b7 | ||
![]() |
363356b47c | ||
![]() |
a9da80caae | ||
![]() |
7966efcaf2 | ||
![]() |
593e67fe72 | ||
![]() |
f7706760cd | ||
![]() |
779ff47260 | ||
![]() |
d7869f408e | ||
![]() |
0ef2db146b | ||
![]() |
83dc069673 | ||
![]() |
45875f13c4 | ||
![]() |
16943fef16 | ||
![]() |
8f70d3da25 | ||
![]() |
1a9d68c260 | ||
![]() |
a737719468 | ||
![]() |
ba05b22fae | ||
![]() |
8144d1bb9e | ||
![]() |
202e765b43 | ||
![]() |
2def01b8c2 | ||
![]() |
4d5910981a | ||
![]() |
5e24ed1fb6 | ||
![]() |
286de02158 | ||
![]() |
350cbea6d5 | ||
![]() |
98d9f639f7 | ||
![]() |
b5c00dd7d9 | ||
![]() |
36f07604ae | ||
![]() |
f00eae6760 | ||
![]() |
576aece31d | ||
![]() |
d11e4170fd | ||
![]() |
3894c87ba2 | ||
![]() |
fbf2aee48f | ||
![]() |
10df0ac366 | ||
![]() |
f3619ff4d8 | ||
![]() |
e29a6a3c0a | ||
![]() |
da1789aece | ||
![]() |
c6f984b4cb | ||
![]() |
ee33b8f9cc | ||
![]() |
ce3285c1f2 | ||
![]() |
74ac315b58 | ||
![]() |
84c88a118f | ||
![]() |
7fc54ec6f7 | ||
![]() |
4ee1c83073 | ||
![]() |
ab4d32a04e | ||
![]() |
e73139d977 | ||
![]() |
fa95f56be0 | ||
![]() |
d42d275b9e | ||
![]() |
88e145c0a9 | ||
![]() |
027a4e5d41 | ||
![]() |
8152d39ad0 | ||
![]() |
b17cc5d3c3 | ||
![]() |
5f922c06e0 | ||
![]() |
7dea5f7d98 | ||
![]() |
ef4496fd21 | ||
![]() |
dc3bf37521 | ||
![]() |
aca752a01e | ||
![]() |
81b89f5d0c | ||
![]() |
1c1497422b | ||
![]() |
c659061ff0 | ||
![]() |
843056d960 | ||
![]() |
3a5e309d38 | ||
![]() |
b00470aca0 | ||
![]() |
c9ecc560ee | ||
![]() |
d697d0f7a7 | ||
![]() |
27ee094310 | ||
![]() |
3b4e0d51cd | ||
![]() |
332be2bdb2 | ||
![]() |
b22ba6f3ef | ||
![]() |
297562249a | ||
![]() |
0eb2d5ce58 | ||
![]() |
0945021378 | ||
![]() |
b5d301e53c | ||
![]() |
bde12bab38 | ||
![]() |
0291942613 | ||
![]() |
c75f1f031a | ||
![]() |
04bbaf9cb9 | ||
![]() |
9c2909933c | ||
![]() |
d9d39b0cb5 | ||
![]() |
a862d84738 | ||
![]() |
973fd339da | ||
![]() |
3351615140 | ||
![]() |
f61e8652d7 | ||
![]() |
fd2bc90ae2 | ||
![]() |
ee7e8358e7 | ||
![]() |
288c75851e | ||
![]() |
fd7fb5de37 | ||
![]() |
ad6a9438de | ||
![]() |
7a24bf2c7f | ||
![]() |
d5a375ee65 | ||
![]() |
5101677d9a | ||
![]() |
9135c6318d | ||
![]() |
84b32b70a5 | ||
![]() |
f719fde602 | ||
![]() |
92dcffcba1 | ||
![]() |
45c018f5f6 | ||
![]() |
cddceadea1 | ||
![]() |
56ba23fc3d | ||
![]() |
6c2d541b89 | ||
![]() |
bfd61b2f19 | ||
![]() |
e7f235a90b | ||
![]() |
ce2abfe584 | ||
![]() |
a6e3bc3e41 | ||
![]() |
2c259f5ae9 | ||
![]() |
7e864d27b4 | ||
![]() |
b10563ea53 | ||
![]() |
7d5ae8e209 | ||
![]() |
d31e17894c | ||
![]() |
351abaa5c2 | ||
![]() |
6657b46a6b | ||
![]() |
6cb4faa8d3 | ||
![]() |
fa0ec0bf0c | ||
![]() |
703945c804 | ||
![]() |
43071da3eb | ||
![]() |
2c20833410 | ||
![]() |
84069055f5 | ||
![]() |
11fad8d3ce | ||
![]() |
8c60a67e8e | ||
![]() |
d252108f85 | ||
![]() |
3ba8019872 | ||
![]() |
f7f279c5ed | ||
![]() |
1efa88641b | ||
![]() |
35b83cc168 | ||
![]() |
65ce727157 | ||
![]() |
73b5d776da | ||
![]() |
b08b6cca8c | ||
![]() |
941dbe2871 | ||
![]() |
f4fe2b8632 | ||
![]() |
3800021ed3 | ||
![]() |
8eec2cdccb | ||
![]() |
f195484674 | ||
![]() |
5f4a049fdd | ||
![]() |
4ff15ec9bb | ||
![]() |
ddbcfa0268 | ||
![]() |
e2c886c9a4 | ||
![]() |
c6ee4a477f | ||
![]() |
b00ce65e8b | ||
![]() |
bdea9a6d71 | ||
![]() |
5a62342251 | ||
![]() |
bb770ba65b | ||
![]() |
ef89e3a9e3 | ||
![]() |
1d8d3b3c27 | ||
![]() |
2af168bd54 | ||
![]() |
e26ab86dd3 | ||
![]() |
eec1071f06 | ||
![]() |
ecacd14410 | ||
![]() |
7e600bef57 | ||
![]() |
583dc1f368 | ||
![]() |
4de99ba19d | ||
![]() |
6306776f8b | ||
![]() |
531d328663 | ||
![]() |
6cecd0abbe | ||
![]() |
b49216c173 | ||
![]() |
b7f3711de1 | ||
![]() |
33764f4caa | ||
![]() |
961e15fe5f | ||
![]() |
c3a26ea89e | ||
![]() |
6695cf44fa | ||
![]() |
da8a73ba0b | ||
![]() |
5e3d0fbdef | ||
![]() |
c06cd98a2e | ||
![]() |
4e783e76d1 | ||
![]() |
a3b6aef66a | ||
![]() |
77081e80c3 | ||
![]() |
9277908f77 | ||
![]() |
9a5cbba888 | ||
![]() |
f7a2e76cad | ||
![]() |
a0e23bd5d9 | ||
![]() |
e95d5bd73e | ||
![]() |
5f6b6ef984 | ||
![]() |
e06b67fd73 | ||
![]() |
f5f40c3dc7 | ||
![]() |
105547598f | ||
![]() |
a5595015e6 | ||
![]() |
a23cdfbc2b | ||
![]() |
78e5f66144 | ||
![]() |
087c203f72 | ||
![]() |
2d9ad8e5cf | ||
![]() |
3cedeffec9 | ||
![]() |
cc975bb0b5 | ||
![]() |
a0e7e2c617 | ||
![]() |
66e1a2488b | ||
![]() |
25e2e291cb | ||
![]() |
970b19bf01 | ||
![]() |
61e52cd2ab | ||
![]() |
89e4d3b9da | ||
![]() |
99384a7060 | ||
![]() |
96748b9bac | ||
![]() |
36c95db7bf | ||
![]() |
4a236906eb | ||
![]() |
8166c2ebfa | ||
![]() |
30aa34d1c0 | ||
![]() |
9c3e3d9c29 |
@@ -25,4 +25,6 @@ npm-debug.log.*
|
||||
|
||||
# Webpack files
|
||||
webpack.records.json
|
||||
package-lock.json
|
||||
|
||||
# Yarn no longer used
|
||||
yarn.lock
|
||||
|
@@ -15,6 +15,10 @@ trim_trailing_whitespace = false
|
||||
|
||||
[*.ts]
|
||||
quote_type = single
|
||||
ij_typescript_enforce_trailing_comma = whenmultiline
|
||||
|
||||
[*.js]
|
||||
ij_javascript_enforce_trailing_comma = whenmultiline
|
||||
|
||||
[*.json5]
|
||||
ij_json_keep_blank_lines_in_code = 3
|
||||
|
@@ -12,7 +12,6 @@
|
||||
"eslint-plugin-rxjs",
|
||||
"eslint-plugin-simple-import-sort",
|
||||
"eslint-plugin-import-newlines",
|
||||
"eslint-plugin-jsonc",
|
||||
"dspace-angular-ts",
|
||||
"dspace-angular-html"
|
||||
],
|
||||
@@ -161,6 +160,9 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"@angular-eslint/prefer-standalone": [
|
||||
"error"
|
||||
],
|
||||
"@angular-eslint/no-attribute-decorator": "error",
|
||||
"@angular-eslint/no-output-native": "warn",
|
||||
"@angular-eslint/no-output-on-prefix": "warn",
|
||||
@@ -261,9 +263,48 @@
|
||||
"rxjs/no-nested-subscribe": "off", // todo: go over _all_ cases
|
||||
|
||||
// Custom DSpace Angular rules
|
||||
"dspace-angular-ts/alias-imports": [
|
||||
"error",
|
||||
{
|
||||
"aliases": [
|
||||
{
|
||||
"package": "rxjs",
|
||||
"imported": "of",
|
||||
"local": "of"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"dspace-angular-ts/themed-component-classes": "error",
|
||||
"dspace-angular-ts/themed-component-selectors": "error",
|
||||
"dspace-angular-ts/themed-component-usages": "error"
|
||||
"dspace-angular-ts/themed-component-usages": "error",
|
||||
"dspace-angular-ts/themed-decorators": [
|
||||
"off",
|
||||
{
|
||||
"decorators": {
|
||||
"listableObjectComponent": 3,
|
||||
"rendersSectionForMenu": 2
|
||||
}
|
||||
}
|
||||
],
|
||||
"dspace-angular-ts/themed-wrapper-no-input-defaults": "error",
|
||||
"dspace-angular-ts/unique-decorators": [
|
||||
"off",
|
||||
{
|
||||
"decorators": [
|
||||
"listableObjectComponent"
|
||||
]
|
||||
}
|
||||
],
|
||||
"dspace-angular-ts/sort-standalone-imports": [
|
||||
"error",
|
||||
{
|
||||
"locale": "en-US",
|
||||
"maxItems": 0,
|
||||
"indent": 2,
|
||||
"trailingComma": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -294,7 +335,8 @@
|
||||
"rules": {
|
||||
// Custom DSpace Angular rules
|
||||
"dspace-angular-html/themed-component-usages": "error",
|
||||
"dspace-angular-html/no-disabled-attribute-on-button": "error"
|
||||
"dspace-angular-html/no-disabled-attribute-on-button": "error",
|
||||
"@angular-eslint/template/prefer-control-flow": "error"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -302,10 +344,13 @@
|
||||
"*.json5"
|
||||
],
|
||||
"extends": [
|
||||
"plugin:jsonc/recommended-with-jsonc"
|
||||
"plugin:jsonc/recommended-with-json5"
|
||||
],
|
||||
"rules": {
|
||||
"no-irregular-whitespace": "error",
|
||||
// The ESLint core no-irregular-whitespace rule doesn't work well in JSON
|
||||
// See: https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-irregular-whitespace.html
|
||||
"no-irregular-whitespace": "off",
|
||||
"jsonc/no-irregular-whitespace": "error",
|
||||
"no-trailing-spaces": "error",
|
||||
"jsonc/comma-dangle": [
|
||||
"error",
|
||||
|
8
.github/ISSUE_TEMPLATE/bug_report.md
vendored
8
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -7,16 +7,16 @@ assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
## Describe the bug
|
||||
A clear and concise description of what the bug is. Include the version(s) of DSpace where you've seen this problem & what *web browser* you were using. Link to examples if they are public.
|
||||
|
||||
**To Reproduce**
|
||||
## To Reproduce
|
||||
Steps to reproduce the behavior:
|
||||
1. Do this
|
||||
2. Then this...
|
||||
|
||||
**Expected behavior**
|
||||
## Expected behavior
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Related work**
|
||||
## Related work
|
||||
Link to any related tickets or PRs here.
|
||||
|
12
.github/ISSUE_TEMPLATE/feature_request.md
vendored
12
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -7,14 +7,14 @@ assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
## Is your feature request related to a problem? Please describe.
|
||||
A clear and concise description of what the problem or use case is. For example, I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
## Describe the solution you'd like
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives or workarounds you've considered**
|
||||
## Describe alternatives or workarounds you've considered
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
## Additional information
|
||||
Add any other information, related tickets or screenshots about the feature request here.
|
||||
|
298
.github/dependabot.yml
vendored
Normal file
298
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,298 @@
|
||||
#-------------------
|
||||
# DSpace's dependabot rules. Enables npm updates for all dependencies on a weekly basis
|
||||
# for main and any maintenance branches. Security updates only apply to main.
|
||||
#-------------------
|
||||
version: 2
|
||||
updates:
|
||||
###############
|
||||
## Main branch
|
||||
###############
|
||||
# NOTE: At this time, "security-updates" rules only apply if "target-branch" is unspecified
|
||||
# So, only this first section can include "applies-to: security-updates"
|
||||
- package-ecosystem: "npm"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
# Allow up to 10 open PRs for dependencies
|
||||
open-pull-requests-limit: 10
|
||||
# Group together Angular package upgrades
|
||||
groups:
|
||||
# Group together all minor/patch version updates for Angular in a single PR
|
||||
angular:
|
||||
applies-to: version-updates
|
||||
patterns:
|
||||
- "@angular*"
|
||||
update-types:
|
||||
- "minor"
|
||||
- "patch"
|
||||
# Group together all security updates for Angular. Only accept minor/patch types.
|
||||
angular-security:
|
||||
applies-to: security-updates
|
||||
patterns:
|
||||
- "@angular*"
|
||||
update-types:
|
||||
- "minor"
|
||||
- "patch"
|
||||
# Group together all minor/patch version updates for NgRx in a single PR
|
||||
ngrx:
|
||||
applies-to: version-updates
|
||||
patterns:
|
||||
- "@ngrx*"
|
||||
update-types:
|
||||
- "minor"
|
||||
- "patch"
|
||||
# Group together all security updates for NgRx. Only accept minor/patch types.
|
||||
ngrx-security:
|
||||
applies-to: security-updates
|
||||
patterns:
|
||||
- "@ngrx*"
|
||||
update-types:
|
||||
- "minor"
|
||||
- "patch"
|
||||
# Group together all patch version updates for eslint in a single PR
|
||||
eslint:
|
||||
applies-to: version-updates
|
||||
patterns:
|
||||
- "@typescript-eslint*"
|
||||
- "eslint*"
|
||||
update-types:
|
||||
- "minor"
|
||||
- "patch"
|
||||
# Group together all security updates for eslint.
|
||||
eslint-security:
|
||||
applies-to: security-updates
|
||||
patterns:
|
||||
- "@typescript-eslint*"
|
||||
- "eslint*"
|
||||
update-types:
|
||||
- "minor"
|
||||
- "patch"
|
||||
# Group together any testing related version updates
|
||||
testing:
|
||||
applies-to: version-updates
|
||||
patterns:
|
||||
- "@cypress*"
|
||||
- "axe-*"
|
||||
- "cypress*"
|
||||
- "jasmine*"
|
||||
- "karma*"
|
||||
- "ng-mocks"
|
||||
update-types:
|
||||
- "minor"
|
||||
- "patch"
|
||||
# Group together any testing related security updates
|
||||
testing-security:
|
||||
applies-to: security-updates
|
||||
patterns:
|
||||
- "@cypress*"
|
||||
- "axe-*"
|
||||
- "cypress*"
|
||||
- "jasmine*"
|
||||
- "karma*"
|
||||
- "ng-mocks"
|
||||
update-types:
|
||||
- "minor"
|
||||
- "patch"
|
||||
# Group together any postcss related version updates
|
||||
postcss:
|
||||
applies-to: version-updates
|
||||
patterns:
|
||||
- "postcss*"
|
||||
update-types:
|
||||
- "minor"
|
||||
- "patch"
|
||||
# Group together any postcss related security updates
|
||||
postcss-security:
|
||||
applies-to: security-updates
|
||||
patterns:
|
||||
- "postcss*"
|
||||
update-types:
|
||||
- "minor"
|
||||
- "patch"
|
||||
# Group together any sass related version updates
|
||||
sass:
|
||||
applies-to: version-updates
|
||||
patterns:
|
||||
- "sass*"
|
||||
update-types:
|
||||
- "minor"
|
||||
- "patch"
|
||||
# Group together any sass related security updates
|
||||
sass-security:
|
||||
applies-to: security-updates
|
||||
patterns:
|
||||
- "sass*"
|
||||
update-types:
|
||||
- "minor"
|
||||
- "patch"
|
||||
# Group together any webpack related version updates
|
||||
webpack:
|
||||
applies-to: version-updates
|
||||
patterns:
|
||||
- "webpack*"
|
||||
update-types:
|
||||
- "minor"
|
||||
- "patch"
|
||||
# Group together any webpack related seurity updates
|
||||
webpack-security:
|
||||
applies-to: security-updates
|
||||
patterns:
|
||||
- "webpack*"
|
||||
update-types:
|
||||
- "minor"
|
||||
- "patch"
|
||||
ignore:
|
||||
# Ignore all major version updates for all dependencies. We'll only automate minor/patch updates.
|
||||
- dependency-name: "*"
|
||||
update-types: ["version-update:semver-major"]
|
||||
#####################
|
||||
## dspace-8_x branch
|
||||
#####################
|
||||
- package-ecosystem: "npm"
|
||||
directory: "/"
|
||||
target-branch: dspace-8_x
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
# Allow up to 10 open PRs for dependencies
|
||||
open-pull-requests-limit: 10
|
||||
# Group together Angular package upgrades
|
||||
groups:
|
||||
# Group together all patch version updates for Angular in a single PR
|
||||
angular:
|
||||
applies-to: version-updates
|
||||
patterns:
|
||||
- "@angular*"
|
||||
update-types:
|
||||
- "minor"
|
||||
- "patch"
|
||||
# Group together all minor/patch version updates for NgRx in a single PR
|
||||
ngrx:
|
||||
applies-to: version-updates
|
||||
patterns:
|
||||
- "@ngrx*"
|
||||
update-types:
|
||||
- "minor"
|
||||
- "patch"
|
||||
# Group together all patch version updates for eslint in a single PR
|
||||
eslint:
|
||||
applies-to: version-updates
|
||||
patterns:
|
||||
- "@typescript-eslint*"
|
||||
- "eslint*"
|
||||
update-types:
|
||||
- "minor"
|
||||
- "patch"
|
||||
# Group together any testing related version updates
|
||||
testing:
|
||||
applies-to: version-updates
|
||||
patterns:
|
||||
- "@cypress*"
|
||||
- "axe-*"
|
||||
- "cypress*"
|
||||
- "jasmine*"
|
||||
- "karma*"
|
||||
- "ng-mocks"
|
||||
update-types:
|
||||
- "minor"
|
||||
- "patch"
|
||||
# Group together any postcss related version updates
|
||||
postcss:
|
||||
applies-to: version-updates
|
||||
patterns:
|
||||
- "postcss*"
|
||||
update-types:
|
||||
- "minor"
|
||||
- "patch"
|
||||
# Group together any sass related version updates
|
||||
sass:
|
||||
applies-to: version-updates
|
||||
patterns:
|
||||
- "sass*"
|
||||
update-types:
|
||||
- "minor"
|
||||
- "patch"
|
||||
# Group together any webpack related version updates
|
||||
webpack:
|
||||
applies-to: version-updates
|
||||
patterns:
|
||||
- "webpack*"
|
||||
update-types:
|
||||
- "minor"
|
||||
- "patch"
|
||||
ignore:
|
||||
# Ignore all major version updates for all dependencies. We'll only automate minor/patch updates.
|
||||
- dependency-name: "*"
|
||||
update-types: ["version-update:semver-major"]
|
||||
#####################
|
||||
## dspace-7_x branch
|
||||
#####################
|
||||
- package-ecosystem: "npm"
|
||||
directory: "/"
|
||||
target-branch: dspace-7_x
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
# Allow up to 10 open PRs for dependencies
|
||||
open-pull-requests-limit: 10
|
||||
# Group together Angular package upgrades
|
||||
groups:
|
||||
# Group together all minor/patch version updates for Angular in a single PR
|
||||
angular:
|
||||
applies-to: version-updates
|
||||
patterns:
|
||||
- "@angular*"
|
||||
update-types:
|
||||
- "minor"
|
||||
- "patch"
|
||||
# Group together all minor/patch version updates for NgRx in a single PR
|
||||
ngrx:
|
||||
applies-to: version-updates
|
||||
patterns:
|
||||
- "@ngrx*"
|
||||
update-types:
|
||||
- "minor"
|
||||
- "patch"
|
||||
# Group together all patch version updates for eslint in a single PR
|
||||
eslint:
|
||||
applies-to: version-updates
|
||||
patterns:
|
||||
- "@typescript-eslint*"
|
||||
- "eslint*"
|
||||
update-types:
|
||||
- "minor"
|
||||
- "patch"
|
||||
# Group together any testing related version updates
|
||||
testing:
|
||||
applies-to: version-updates
|
||||
patterns:
|
||||
- "@cypress*"
|
||||
- "axe-*"
|
||||
- "cypress*"
|
||||
- "jasmine*"
|
||||
- "karma*"
|
||||
- "ng-mocks"
|
||||
update-types:
|
||||
- "minor"
|
||||
- "patch"
|
||||
# Group together any postcss related version updates
|
||||
postcss:
|
||||
applies-to: version-updates
|
||||
patterns:
|
||||
- "postcss*"
|
||||
update-types:
|
||||
- "minor"
|
||||
- "patch"
|
||||
# Group together any sass related version updates
|
||||
sass:
|
||||
applies-to: version-updates
|
||||
patterns:
|
||||
- "sass*"
|
||||
update-types:
|
||||
- "minor"
|
||||
- "patch"
|
||||
ignore:
|
||||
# 7.x Cannot update Webpack past v5.76.1 as later versions not supported by Angular 15
|
||||
# See also https://github.com/DSpace/dspace-angular/pull/3283#issuecomment-2372488489
|
||||
- dependency-name: "webpack"
|
||||
# Ignore all major version updates for all dependencies. We'll only automate minor/patch updates.
|
||||
- dependency-name: "*"
|
||||
update-types: ["version-update:semver-major"]
|
21
.github/pull_request_template.md
vendored
21
.github/pull_request_template.md
vendored
@@ -1,7 +1,7 @@
|
||||
## References
|
||||
_Add references/links to any related issues or PRs. These may include:_
|
||||
* Fixes #`issue-number` (if this fixes an issue ticket)
|
||||
* Requires DSpace/DSpace#`pr-number` (if a REST API PR is required to test this)
|
||||
* Fixes #issue-number (if this fixes an issue ticket)
|
||||
* Requires DSpace/DSpace#pr-number (if a REST API PR is required to test this)
|
||||
|
||||
## Description
|
||||
Short summary of changes (1-2 sentences).
|
||||
@@ -16,13 +16,18 @@ List of changes in this PR:
|
||||
**Include guidance for how to test or review your PR.** This may include: steps to reproduce a bug, screenshots or description of a new feature, or reasons behind specific changes.
|
||||
|
||||
## Checklist
|
||||
_This checklist provides a reminder of what we are going to look for when reviewing your PR. You need not complete this checklist prior to creating your PR (draft PRs are always welcome). If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!_
|
||||
_This checklist provides a reminder of what we are going to look for when reviewing your PR. You do not need to complete this checklist prior creating your PR (draft PRs are always welcome).
|
||||
However, reviewers may request that you complete any actions in this list if you have not done so. If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!_
|
||||
|
||||
- [ ] My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
|
||||
- [ ] My PR passes [ESLint](https://eslint.org/) validation using `yarn lint`
|
||||
- [ ] My PR doesn't introduce circular dependencies (verified via `yarn check-circ-deps`)
|
||||
- [ ] My PR includes [TypeDoc](https://typedoc.org/) comments for _all new (or modified) public methods and classes_. It also includes TypeDoc for large or complex private methods.
|
||||
- [ ] My PR passes all specs/tests and includes new/updated specs or tests based on the [Code Testing Guide](https://wiki.lyrasis.org/display/DSPACE/Code+Testing+Guide).
|
||||
- [ ] My PR is **created against the `main` branch** of code (unless it is a backport or is fixing an issue specific to an older branch).
|
||||
- [ ] My PR is **small in size** (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
|
||||
- [ ] My PR **passes [ESLint](https://eslint.org/)** validation using `npm run lint`
|
||||
- [ ] My PR **doesn't introduce circular dependencies** (verified via `npm run check-circ-deps`)
|
||||
- [ ] My PR **includes [TypeDoc](https://typedoc.org/) comments** for _all new (or modified) public methods and classes_. It also includes TypeDoc for large or complex private methods.
|
||||
- [ ] My PR **passes all specs/tests and includes new/updated specs or tests** based on the [Code Testing Guide](https://wiki.lyrasis.org/display/DSPACE/Code+Testing+Guide).
|
||||
- [ ] My PR **aligns with [Accessibility guidelines](https://wiki.lyrasis.org/display/DSDOC8x/Accessibility)** if it makes changes to the user interface.
|
||||
- [ ] My PR **uses i18n (internationalization) keys** instead of hardcoded English text, to allow for translations.
|
||||
- [ ] My PR **includes details on how to test it**. I've provided clear instructions to reviewers on how to successfully test this fix or feature.
|
||||
- [ ] If my PR includes new libraries/dependencies (in `package.json`), I've made sure their licenses align with the [DSpace BSD License](https://github.com/DSpace/DSpace/blob/main/LICENSE) based on the [Licensing of Contributions](https://wiki.lyrasis.org/display/DSPACE/Code+Contribution+Guidelines#CodeContributionGuidelines-LicensingofContributions) documentation.
|
||||
- [ ] If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
|
||||
- [ ] If my PR fixes an issue ticket, I've [linked them together](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue).
|
||||
|
147
.github/workflows/build.yml
vendored
147
.github/workflows/build.yml
vendored
@@ -29,6 +29,8 @@ jobs:
|
||||
DSPACE_CACHE_SERVERSIDE_ANONYMOUSCACHE_MAX: 0
|
||||
# Tell Cypress to run e2e tests using the same UI URL
|
||||
CYPRESS_BASE_URL: http://127.0.0.1:4000
|
||||
# Disable the cookie consent banner in e2e tests to avoid errors because of elements hidden by it
|
||||
DSPACE_INFO_ENABLECOOKIECONSENTPOPUP: false
|
||||
# When Chrome version is specified, we pin to a specific version of Chrome
|
||||
# Comment this out to use the latest release
|
||||
#CHROME_VERSION: "90.0.4430.212-1"
|
||||
@@ -73,39 +75,39 @@ jobs:
|
||||
fi
|
||||
google-chrome --version
|
||||
|
||||
# https://github.com/actions/cache/blob/main/examples.md#node---yarn
|
||||
- name: Get Yarn cache directory
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
|
||||
- name: Cache Yarn dependencies
|
||||
# https://github.com/actions/cache/blob/main/examples.md#node---npm
|
||||
- name: Get NPM cache directory
|
||||
id: npm-cache-dir
|
||||
run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT
|
||||
- name: Cache NPM dependencies
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
# Cache entire Yarn cache directory (see previous step)
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
# Cache key is hash of yarn.lock. Therefore changes to yarn.lock will invalidate cache
|
||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: ${{ runner.os }}-yarn-
|
||||
# Cache entire NPM cache directory (see previous step)
|
||||
path: ${{ steps.npm-cache-dir.outputs.dir }}
|
||||
# Cache key is hash of package-lock.json. Therefore changes to package-lock.json will invalidate cache
|
||||
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: ${{ runner.os }}-npm-
|
||||
|
||||
- name: Install Yarn dependencies
|
||||
run: yarn install --frozen-lockfile
|
||||
- name: Install NPM dependencies
|
||||
run: npm clean-install
|
||||
|
||||
- name: Build lint plugins
|
||||
run: yarn run build:lint
|
||||
run: npm run build:lint
|
||||
|
||||
- name: Run lint plugin tests
|
||||
run: yarn run test:lint:nobuild
|
||||
run: npm run test:lint:nobuild
|
||||
|
||||
- name: Run lint
|
||||
run: yarn run lint:nobuild --quiet
|
||||
run: npm run lint:nobuild -- --quiet
|
||||
|
||||
- name: Check for circular dependencies
|
||||
run: yarn run check-circ-deps
|
||||
run: npm run check-circ-deps
|
||||
|
||||
- name: Run build
|
||||
run: yarn run build:prod
|
||||
run: npm run build:prod
|
||||
|
||||
- name: Run specs (unit tests)
|
||||
run: yarn run test:headless
|
||||
run: npm run test:headless
|
||||
|
||||
# Upload code coverage report to artifact (for one version of Node only),
|
||||
# so that it can be shared with the 'codecov' job (see below)
|
||||
@@ -143,7 +145,7 @@ jobs:
|
||||
# Run tests in Chrome, headless mode (default)
|
||||
browser: chrome
|
||||
# Start app before running tests (will be stopped automatically after tests finish)
|
||||
start: yarn run serve:ssr
|
||||
start: npm run serve:ssr
|
||||
# Wait for backend & frontend to be available
|
||||
# NOTE: We use the 'sites' REST endpoint to also ensure the database is ready
|
||||
wait-on: http://127.0.0.1:8080/server/api/core/sites, http://127.0.0.1:4000
|
||||
@@ -179,7 +181,7 @@ jobs:
|
||||
# Start up the app with SSR enabled (run in background)
|
||||
- name: Start app in SSR (server-side rendering) mode
|
||||
run: |
|
||||
nohup yarn run serve:ssr &
|
||||
nohup npm run serve:ssr &
|
||||
printf 'Waiting for app to start'
|
||||
until curl --output /dev/null --silent --head --fail http://127.0.0.1:4000/home; do
|
||||
printf '.'
|
||||
@@ -190,12 +192,115 @@ jobs:
|
||||
# Get homepage and verify that the <meta name="title"> tag includes "DSpace".
|
||||
# If it does, then SSR is working, as this tag is created by our MetadataService.
|
||||
# This step also prints entire HTML of homepage for easier debugging if grep fails.
|
||||
- name: Verify SSR (server-side rendering)
|
||||
- name: Verify SSR (server-side rendering) on Homepage
|
||||
run: |
|
||||
result=$(wget -O- -q http://127.0.0.1:4000/home)
|
||||
echo "$result"
|
||||
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep DSpace
|
||||
|
||||
# Get a specific community in our test data and verify that the "<h1>" tag includes "Publications" (the community name).
|
||||
# If it does, then SSR is working.
|
||||
- name: Verify SSR on a Community page
|
||||
run: |
|
||||
result=$(wget -O- -q http://127.0.0.1:4000/communities/0958c910-2037-42a9-81c7-dca80e3892b4)
|
||||
echo "$result"
|
||||
echo "$result" | grep -oE "<h1 [^>]*>[^><]*</h1>" | grep Publications
|
||||
|
||||
# Get a specific collection in our test data and verify that the "<h1>" tag includes "Articles" (the collection name).
|
||||
# If it does, then SSR is working.
|
||||
- name: Verify SSR on a Collection page
|
||||
run: |
|
||||
result=$(wget -O- -q http://127.0.0.1:4000/collections/282164f5-d325-4740-8dd1-fa4d6d3e7200)
|
||||
echo "$result"
|
||||
echo "$result" | grep -oE "<h1 [^>]*>[^><]*</h1>" | grep Articles
|
||||
|
||||
# Get a specific publication in our test data and verify that the <meta name="title"> tag includes
|
||||
# the title of this publication. If it does, then SSR is working.
|
||||
- name: Verify SSR on a Publication page
|
||||
run: |
|
||||
result=$(wget -O- -q http://127.0.0.1:4000/entities/publication/6160810f-1e53-40db-81ef-f6621a727398)
|
||||
echo "$result"
|
||||
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep "An Economic Model of Mortality Salience"
|
||||
|
||||
# Get a specific person in our test data and verify that the <meta name="title"> tag includes
|
||||
# the name of the person. If it does, then SSR is working.
|
||||
- name: Verify SSR on a Person page
|
||||
run: |
|
||||
result=$(wget -O- -q http://127.0.0.1:4000/entities/person/b1b2c768-bda1-448a-a073-fc541e8b24d9)
|
||||
echo "$result"
|
||||
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep "Simmons, Cameron"
|
||||
|
||||
# Get a specific project in our test data and verify that the <meta name="title"> tag includes
|
||||
# the name of the project. If it does, then SSR is working.
|
||||
- name: Verify SSR on a Project page
|
||||
run: |
|
||||
result=$(wget -O- -q http://127.0.0.1:4000/entities/project/46ccb608-a74c-4bf6-bc7a-e29cc7defea9)
|
||||
echo "$result"
|
||||
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep "University Research Fellowship"
|
||||
|
||||
# Get a specific orgunit in our test data and verify that the <meta name="title"> tag includes
|
||||
# the name of the orgunit. If it does, then SSR is working.
|
||||
- name: Verify SSR on an OrgUnit page
|
||||
run: |
|
||||
result=$(wget -O- -q http://127.0.0.1:4000/entities/orgunit/9851674d-bd9a-467b-8d84-068deb568ccf)
|
||||
echo "$result"
|
||||
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep "Law and Development"
|
||||
|
||||
# Get a specific journal in our test data and verify that the <meta name="title"> tag includes
|
||||
# the name of the journal. If it does, then SSR is working.
|
||||
- name: Verify SSR on a Journal page
|
||||
run: |
|
||||
result=$(wget -O- -q http://127.0.0.1:4000/entities/journal/d4af6c3e-53d0-4757-81eb-566f3b45d63a)
|
||||
echo "$result"
|
||||
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep "Environmental & Architectural Phenomenology"
|
||||
|
||||
# Get a specific journal volume in our test data and verify that the <meta name="title"> tag includes
|
||||
# the name of the volume. If it does, then SSR is working.
|
||||
- name: Verify SSR on a Journal Volume page
|
||||
run: |
|
||||
result=$(wget -O- -q http://127.0.0.1:4000/entities/journalvolume/07c6249f-4bf7-494d-9ce3-6ffdb2aed538)
|
||||
echo "$result"
|
||||
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep "Environmental & Architectural Phenomenology Volume 28 (2017)"
|
||||
|
||||
# Get a specific journal issue in our test data and verify that the <meta name="title"> tag includes
|
||||
# the name of the issue. If it does, then SSR is working.
|
||||
- name: Verify SSR on a Journal Issue page
|
||||
run: |
|
||||
result=$(wget -O- -q http://127.0.0.1:4000/entities/journalissue/44c29473-5de2-48fa-b005-e5029aa1a50b)
|
||||
echo "$result"
|
||||
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep "Environmental & Architectural Phenomenology Vol. 28, No. 1"
|
||||
|
||||
# Verify 301 Handle redirect behavior
|
||||
# Note: /handle/123456789/260 is the same test Publication used by our e2e tests
|
||||
- name: Verify 301 redirect from '/handle' URLs
|
||||
run: |
|
||||
result=$(wget --server-response --quiet http://127.0.0.1:4000/handle/123456789/260 2>&1 | head -1 | awk '{print $2}')
|
||||
echo "$result"
|
||||
[[ "$result" -eq "301" ]]
|
||||
|
||||
# Verify 403 error code behavior
|
||||
- name: Verify 403 error code from '/403'
|
||||
run: |
|
||||
result=$(wget --server-response --quiet http://127.0.0.1:4000/403 2>&1 | head -1 | awk '{print $2}')
|
||||
echo "$result"
|
||||
[[ "$result" -eq "403" ]]
|
||||
|
||||
# Verify 404 error code behavior
|
||||
- name: Verify 404 error code from '/404' and on invalid pages
|
||||
run: |
|
||||
result=$(wget --server-response --quiet http://127.0.0.1:4000/404 2>&1 | head -1 | awk '{print $2}')
|
||||
echo "$result"
|
||||
result2=$(wget --server-response --quiet http://127.0.0.1:4000/invalidurl 2>&1 | head -1 | awk '{print $2}')
|
||||
echo "$result2"
|
||||
[[ "$result" -eq "404" && "$result2" -eq "404" ]]
|
||||
|
||||
# Verify 500 error code behavior
|
||||
- name: Verify 500 error code from '/500'
|
||||
run: |
|
||||
result=$(wget --server-response --quiet http://127.0.0.1:4000/500 2>&1 | head -1 | awk '{print $2}')
|
||||
echo "$result"
|
||||
[[ "$result" -eq "500" ]]
|
||||
|
||||
- name: Stop running app
|
||||
run: kill -9 $(lsof -t -i:4000)
|
||||
|
||||
|
4
.gitignore
vendored
4
.gitignore
vendored
@@ -28,12 +28,12 @@ webpack.records.json
|
||||
|
||||
morgan.log
|
||||
|
||||
# Yarn no longer used
|
||||
yarn.lock
|
||||
yarn-error.log
|
||||
|
||||
*.css
|
||||
|
||||
package-lock.json
|
||||
|
||||
.java-version
|
||||
|
||||
.env
|
||||
|
@@ -10,7 +10,7 @@ DSpace is a community built and supported project. We do not have a centralized
|
||||
## Contribute new code via a Pull Request
|
||||
|
||||
We accept [GitHub Pull Requests (PRs)](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork) at any time from anyone.
|
||||
Contributors to each release are recognized in our [Release Notes](https://wiki.lyrasis.org/display/DSDOC7x/Release+Notes).
|
||||
Contributors to each release are recognized in our [Release Notes](https://wiki.lyrasis.org/display/DSDOC8x/Release+Notes).
|
||||
|
||||
Code Contribution Checklist
|
||||
- [ ] PRs _should_ be smaller in size (ideally less than 1,000 lines of code, not including comments & tests)
|
||||
@@ -18,6 +18,9 @@ Code Contribution Checklist
|
||||
- [ ] PRs **must** not introduce circular dependencies (verified via `yarn check-circ-deps`)
|
||||
- [ ] PRs **must** include [TypeDoc](https://typedoc.org/) comments for _all new (or modified) public methods and classes_. Large or complex private methods should also have TypeDoc.
|
||||
- [ ] PRs **must** pass all automated pecs/tests and includes new/updated specs or tests based on the [Code Testing Guide](https://wiki.lyrasis.org/display/DSPACE/Code+Testing+Guide).
|
||||
- [ ] User interface changes **must** align with [Accessibility guidelines](https://wiki.lyrasis.org/display/DSDOC8x/Accessibility)
|
||||
- [ ] PRs **must** use i18n (internationalization) keys instead of hardcoded English text, to allow for translations.
|
||||
- [ ] Details on how to test the PR **must** be provided. Reviewers must be aware of any steps they need to take to successfully test your fix or feature.
|
||||
- [ ] If a PR includes new libraries/dependencies (in `package.json`), then their software licenses **must** align with the [DSpace BSD License](https://github.com/DSpace/dspace-angular/blob/main/LICENSE) based on the [Licensing of Contributions](https://wiki.lyrasis.org/display/DSPACE/Code+Contribution+Guidelines#CodeContributionGuidelines-LicensingofContributions) documentation.
|
||||
- [ ] Basic technical documentation _should_ be provided for any new features or configuration, either in the PR itself or in the DSpace Wiki documentation.
|
||||
- [ ] If a PR fixes an issue ticket, please [link them together](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue).
|
||||
@@ -26,7 +29,7 @@ Additional details on the code contribution process can be found in our [Code Co
|
||||
|
||||
## Contribute documentation
|
||||
|
||||
DSpace Documentation is a collaborative effort in a shared Wiki. The latest documentation is at https://wiki.lyrasis.org/display/DSDOC7x
|
||||
DSpace Documentation is a collaborative effort in a shared Wiki. The latest documentation is at https://wiki.lyrasis.org/display/DSDOC
|
||||
|
||||
If you find areas of the DSpace Documentation which you wish to improve, please request a Wiki account by emailing wikihelp@lyrasis.org.
|
||||
Once you have an account setup, contact @tdonohue (via [Slack](https://wiki.lyrasis.org/display/DSPACE/Slack) or email) for access to edit our Documentation.
|
||||
@@ -34,7 +37,7 @@ Once you have an account setup, contact @tdonohue (via [Slack](https://wiki.lyra
|
||||
## Help others on mailing lists or Slack
|
||||
|
||||
DSpace has our own [Slack](https://wiki.lyrasis.org/display/DSPACE/Slack) community and [Mailing Lists](https://wiki.lyrasis.org/display/DSPACE/Mailing+Lists) where discussions take place and questions are answered.
|
||||
Anyone is welcome to join and help others. We just ask you to follow our [Code of Conduct](https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx) (adopted via LYRASIS).
|
||||
Anyone is welcome to join and help others. We just ask you to follow our [Code of Conduct](https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx) (adopted via Lyrasis).
|
||||
|
||||
## Join a working or interest group
|
||||
|
||||
@@ -42,5 +45,5 @@ Most of the work in building/improving DSpace comes via [Working Groups](https:/
|
||||
|
||||
All working/interest groups are open to anyone to join and participate. A few key groups to be aware of include:
|
||||
|
||||
* [DSpace 7 Working Group](https://wiki.lyrasis.org/display/DSPACE/DSpace+7+Working+Group) - This is the main (mostly volunteer) development team. We meet weekly to review our current development [project board](https://github.com/orgs/DSpace/projects), assigning tickets and/or PRs.
|
||||
* [DSpace Community Advisory Team (DCAT)](https://wiki.lyrasis.org/display/cmtygp/DSpace+Community+Advisory+Team) - This is an interest group for repository managers/administrators. We meet monthly to discuss DSpace, share tips & provide feedback back to developers.
|
||||
* [DSpace Developer Team](https://wiki.lyrasis.org/display/DSPACE/Developer+Meetings) - This is the primary, volunteer development team. We meet weekly to review our current development [project board](https://github.com/orgs/DSpace/projects), assigning tickets and/or PRs. This is also were discussions of the next release or major issues occur. Anyone is welcome to attend.
|
||||
* [DSpace Community Advisory Team (DCAT)](https://wiki.lyrasis.org/display/cmtygp/DSpace+Community+Advisory+Team) - This is an interest group for repository managers/administrators. We meet monthly to discuss DSpace, share tips & provide feedback back to developers. Anyone is welcome to attend.
|
||||
|
@@ -11,9 +11,7 @@ WORKDIR /app
|
||||
ADD . /app/
|
||||
EXPOSE 4000
|
||||
|
||||
# We run yarn install with an increased network timeout (5min) to avoid "ESOCKETTIMEDOUT" errors from hub.docker.com
|
||||
# See, for example https://github.com/yarnpkg/yarn/issues/5540
|
||||
RUN yarn install --network-timeout 300000
|
||||
RUN npm install
|
||||
|
||||
# When running in dev mode, 4GB of memory is required to build & launch the app.
|
||||
# This default setting can be overridden as needed in your shell, via an env file or in docker-compose.
|
||||
@@ -25,4 +23,4 @@ ENV NODE_OPTIONS="--max_old_space_size=4096"
|
||||
# NOTE: At this time it is only possible to run Docker container in Production mode
|
||||
# if you have a public URL. See https://github.com/DSpace/dspace-angular/issues/1485
|
||||
ENV NODE_ENV=development
|
||||
CMD yarn serve --host 0.0.0.0
|
||||
CMD npm run serve -- --host 0.0.0.0
|
||||
|
@@ -2,7 +2,7 @@
|
||||
# See https://github.com/DSpace/dspace-angular/tree/main/docker for usage details
|
||||
|
||||
# Test build:
|
||||
# docker build -f Dockerfile.dist -t dspace/dspace-angular:dspace-8_x-dist .
|
||||
# docker build -f Dockerfile.dist -t dspace/dspace-angular:latest-dist .
|
||||
|
||||
FROM docker.io/node:18-alpine AS build
|
||||
|
||||
@@ -11,11 +11,11 @@ FROM docker.io/node:18-alpine AS build
|
||||
RUN apk add --update python3 make g++ && rm -rf /var/cache/apk/*
|
||||
|
||||
WORKDIR /app
|
||||
COPY package.json yarn.lock ./
|
||||
RUN yarn install --network-timeout 300000
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm install
|
||||
|
||||
ADD . /app/
|
||||
RUN yarn build:prod
|
||||
RUN npm run build:prod
|
||||
|
||||
FROM node:18-alpine
|
||||
RUN npm install --global pm2
|
||||
|
86
README.md
86
README.md
@@ -35,7 +35,7 @@ https://wiki.lyrasis.org/display/DSDOC7x/Installing+DSpace
|
||||
Quick start
|
||||
-----------
|
||||
|
||||
**Ensure you're running [Node](https://nodejs.org) `v18.x` or `v20.x`, [npm](https://www.npmjs.com/) >= `v10.x` and [yarn](https://yarnpkg.com) == `v1.x`**
|
||||
**Ensure you're running [Node](https://nodejs.org) `v18.x` or `v20.x`, [npm](https://www.npmjs.com/) >= `v10.x`**
|
||||
|
||||
```bash
|
||||
# clone the repo
|
||||
@@ -45,10 +45,10 @@ git clone https://github.com/DSpace/dspace-angular.git
|
||||
cd dspace-angular
|
||||
|
||||
# install the local dependencies
|
||||
yarn install
|
||||
npm install
|
||||
|
||||
# start the server
|
||||
yarn start
|
||||
npm start
|
||||
```
|
||||
|
||||
Then go to [http://localhost:4000](http://localhost:4000) in your browser
|
||||
@@ -77,7 +77,7 @@ Table of Contents
|
||||
- [Recommended Editors/IDEs](#recommended-editorsides)
|
||||
- [Collaborating](#collaborating)
|
||||
- [File Structure](#file-structure)
|
||||
- [Managing Dependencies (via yarn)](#managing-dependencies-via-yarn)
|
||||
- [Managing Dependencies (via npm)](#managing-dependencies-via-npm)
|
||||
- [Frequently asked questions](#frequently-asked-questions)
|
||||
- [License](#license)
|
||||
|
||||
@@ -89,15 +89,15 @@ You can find more information on the technologies used in this project (Angular.
|
||||
Requirements
|
||||
------------
|
||||
|
||||
- [Node.js](https://nodejs.org) and [yarn](https://yarnpkg.com)
|
||||
- Ensure you're running node `v18.x` or `v20.x` and yarn == `v1.x`
|
||||
- [Node.js](https://nodejs.org)
|
||||
- Ensure you're running node `v18.x` or `v20.x`
|
||||
|
||||
If you have [`nvm`](https://github.com/creationix/nvm#install-script) or [`nvm-windows`](https://github.com/coreybutler/nvm-windows) installed, which is highly recommended, you can run `nvm install --lts && nvm use` to install and start using the latest Node LTS.
|
||||
|
||||
Installing
|
||||
----------
|
||||
|
||||
- `yarn install` to install the local dependencies
|
||||
- `npm install` to install the local dependencies
|
||||
|
||||
### Configuring
|
||||
|
||||
@@ -202,7 +202,7 @@ import { environment } from '../environment.ts';
|
||||
Running the app
|
||||
---------------
|
||||
|
||||
After you have installed all dependencies you can now run the app. Run `yarn run start:dev` to start a local server which will watch for changes, rebuild the code, and reload the server for you. You can visit it at `http://localhost:4000`.
|
||||
After you have installed all dependencies you can now run the app. Run `npm run start:dev` to start a local server which will watch for changes, rebuild the code, and reload the server for you. You can visit it at `http://localhost:4000`.
|
||||
|
||||
### Running in production mode
|
||||
|
||||
@@ -211,20 +211,20 @@ When building for production we're using Ahead of Time (AoT) compilation. With A
|
||||
To build the app for production and start the server (in one command) run:
|
||||
|
||||
```bash
|
||||
yarn start
|
||||
npm start
|
||||
```
|
||||
This will run the application in an instance of the Express server, which is included.
|
||||
|
||||
If you only want to build for production, without starting, run:
|
||||
|
||||
```bash
|
||||
yarn run build:prod
|
||||
npm run build:prod
|
||||
```
|
||||
This will build the application and put the result in the `dist` folder. You can copy this folder to wherever you need it for your application server. If you will be using the built-in Express server, you'll also need a copy of the `node_modules` folder tucked inside your copy of `dist`.
|
||||
|
||||
After building the app for production, it can be started by running:
|
||||
```bash
|
||||
yarn run serve:ssr
|
||||
npm run serve:ssr
|
||||
```
|
||||
|
||||
### Running the application with Docker
|
||||
@@ -238,14 +238,14 @@ Cleaning
|
||||
--------
|
||||
|
||||
```bash
|
||||
# clean everything, including node_modules. You'll need to run yarn install again afterwards.
|
||||
yarn run clean
|
||||
# clean everything, including node_modules. You'll need to run npm install again afterwards.
|
||||
npm run clean
|
||||
|
||||
# clean files generated by the production build (.ngfactory files, css files, etc)
|
||||
yarn run clean:prod
|
||||
npm run clean:prod
|
||||
|
||||
# cleans the distribution directory
|
||||
yarn run clean:dist
|
||||
npm run clean:dist
|
||||
```
|
||||
|
||||
|
||||
@@ -259,9 +259,9 @@ If you would like to contribute by testing a Pull Request (PR), here's how to do
|
||||
1. Pull down the branch that the Pull Request was built from. Easy instructions for doing so can be found on the Pull Request itself.
|
||||
* Next to the "Merge" button, you'll see a link that says "command line instructions".
|
||||
* Click it, and follow "Step 1" of those instructions to checkout the pull down the PR branch.
|
||||
2. `yarn run clean` (This resets your local dependencies to ensure you are up-to-date with this PR)
|
||||
3. `yarn install` (Updates your local dependencies to those in the PR)
|
||||
4. `yarn start` (Rebuilds the project, and deploys to localhost:4000, by default)
|
||||
2. `npm run clean` (This resets your local dependencies to ensure you are up-to-date with this PR)
|
||||
3. `npm install` (Updates your local dependencies to those in the PR)
|
||||
4. `npm start` (Rebuilds the project, and deploys to localhost:4000, by default)
|
||||
5. At this point, the code from the PR will be deployed to http://localhost:4000. Test it out, and ensure that it does what is described in the PR (or fixes the bug described in the ticket linked to the PR).
|
||||
|
||||
Once you have tested the Pull Request, please add a comment and/or approval to the PR to let us know whether you found it to be successful (or not). Thanks!
|
||||
@@ -271,13 +271,13 @@ Once you have tested the Pull Request, please add a comment and/or approval to t
|
||||
|
||||
Unit tests use the [Jasmine test framework](https://jasmine.github.io/), and are run via [Karma](https://karma-runner.github.io/).
|
||||
|
||||
You can find the Karma configuration file at the same level of this README file:`./karma.conf.js` If you are going to use a remote test environment you need to edit the `./karma.conf.js`. Follow the instructions you will find inside it. To executing tests whenever any file changes you can modify the 'autoWatch' option to 'true' and 'singleRun' option to 'false'. A coverage report is also available at: http://localhost:9876/ after you run: `yarn run coverage`.
|
||||
You can find the Karma configuration file at the same level of this README file:`./karma.conf.js` If you are going to use a remote test environment you need to edit the `./karma.conf.js`. Follow the instructions you will find inside it. To executing tests whenever any file changes you can modify the 'autoWatch' option to 'true' and 'singleRun' option to 'false'. A coverage report is also available at: http://localhost:9876/ after you run: `npm run coverage`.
|
||||
|
||||
The default browser is Google Chrome.
|
||||
|
||||
Place your tests in the same location of the application source code files that they test, e.g. ending with `*.component.spec.ts`
|
||||
|
||||
and run: `yarn test`
|
||||
and run: `npm test`
|
||||
|
||||
If you run into odd test errors, see the Angular guide to debugging tests: https://angular.io/guide/test-debugging
|
||||
|
||||
@@ -330,9 +330,9 @@ All E2E tests must be created under the `./cypress/integration/` folder, and mus
|
||||
* In the [Cypress Test Runner](https://docs.cypress.io/guides/core-concepts/test-runner), you'll Cypress automatically visit the page. This first test will succeed, as all you are doing is making sure the _page exists_.
|
||||
* From here, you can use the [Selector Playground](https://docs.cypress.io/guides/core-concepts/test-runner#Selector-Playground) in the Cypress Test Runner window to determine how to tell Cypress to interact with a specific HTML element on that page.
|
||||
* Most commands start by telling Cypress to [get()](https://docs.cypress.io/api/commands/get) a specific element, using a CSS or jQuery style selector
|
||||
* It's generally best not to rely on attributes like `class` and `id` in tests, as those are likely to change later on. Instead, you can add a `data-test` attribute to makes it clear that it's required for a test.
|
||||
* It's generally best not to rely on attributes like `class` and `id` in tests, as those are likely to change later on. Instead, you can add a `data-test` attribute to makes it clear that it's required for a test.
|
||||
* Cypress can then do actions like [click()](https://docs.cypress.io/api/commands/click) an element, or [type()](https://docs.cypress.io/api/commands/type) text in an input field, etc.
|
||||
* When running with server-side rendering enabled, the client first receives HTML without the JS; only once the page is rendered client-side do some elements (e.g. a button that toggles a Bootstrap dropdown) become fully interactive. This can trip up Cypress in some cases as it may try to `click` or `type` in an element that's not fully loaded yet, causing tests to fail.
|
||||
* When running with server-side rendering enabled, the client first receives HTML without the JS; only once the page is rendered client-side do some elements (e.g. a button that toggles a Bootstrap dropdown) become fully interactive. This can trip up Cypress in some cases as it may try to `click` or `type` in an element that's not fully loaded yet, causing tests to fail.
|
||||
* To work around this issue, define the attributes you use for Cypress selectors as `[attr.data-test]="'button' | ngBrowserOnly"`. This will only show the attribute in CSR HTML, forcing Cypress to wait until CSR is complete before interacting with the element.
|
||||
* Cypress can also validate that something occurs, using [should()](https://docs.cypress.io/api/commands/should) assertions.
|
||||
* Any time you save your test file, the Cypress Test Runner will reload & rerun it. This allows you can see your results quickly as you write the tests & correct any broken tests rapidly.
|
||||
@@ -357,14 +357,14 @@ Some UI specific configuration documentation is also found in the [`./docs`](doc
|
||||
|
||||
To build the code documentation we use [TYPEDOC](http://typedoc.org). TYPEDOC is a documentation generator for TypeScript projects. It extracts information from properly formatted comments that can be written within the code files. Follow the instructions [here](http://typedoc.org/guides/doccomments/) to know how to make those comments.
|
||||
|
||||
Run:`yarn run docs` to produce the documentation that will be available in the 'doc' folder.
|
||||
Run:`npm run docs` to produce the documentation that will be available in the 'doc' folder.
|
||||
|
||||
Other commands
|
||||
--------------
|
||||
|
||||
There are many more commands in the `scripts` section of `package.json`. Most of these are executed by one of the commands mentioned above.
|
||||
|
||||
A command with a name that starts with `pre` or `post` will be executed automatically before or after the script with the matching name. e.g. if you type `yarn run start` the `prestart` script will run first, then the `start` script will trigger.
|
||||
A command with a name that starts with `pre` or `post` will be executed automatically before or after the script with the matching name. e.g. if you type `npm run start` the `prestart` script will run first, then the `start` script will trigger.
|
||||
|
||||
Recommended Editors/IDEs
|
||||
------------------------
|
||||
@@ -456,6 +456,7 @@ dspace-angular
|
||||
├── LICENSES_THIRD_PARTY *
|
||||
├── nodemon.json * Nodemon (https://nodemon.io/) configuration
|
||||
├── package.json * This file describes the npm package for this project, its dependencies, scripts, etc.
|
||||
├── package-lock.json * npm lockfile (https://docs.npmjs.com/cli/v10/configuring-npm/package-lock-json)
|
||||
├── postcss.config.js * PostCSS (http://postcss.org/) configuration
|
||||
├── README.md * This document
|
||||
├── SECURITY.md *
|
||||
@@ -466,30 +467,29 @@ dspace-angular
|
||||
├── tsconfig.spec.json * TypeScript config for tests
|
||||
├── tsconfig.ts-node.json * TypeScript config for using ts-node directly
|
||||
├── tslint.json * TSLint (https://palantir.github.io/tslint/) configuration
|
||||
├── typedoc.json * TYPEDOC configuration
|
||||
└── yarn.lock * Yarn lockfile (https://yarnpkg.com/en/docs/yarn-lock)
|
||||
└── typedoc.json * TYPEDOC configuration
|
||||
```
|
||||
|
||||
Managing Dependencies (via yarn)
|
||||
Managing Dependencies (via npm)
|
||||
-------------
|
||||
|
||||
This project makes use of [`yarn`](https://yarnpkg.com/en/) to ensure that the exact same dependency versions are used every time you install it.
|
||||
This project makes use of [`npm`](https://docs.npmjs.com/about-npm) to ensure that the exact same dependency versions are used every time you install it.
|
||||
|
||||
* `yarn` creates a [`yarn.lock`](https://yarnpkg.com/en/docs/yarn-lock) to track those versions. That file is updated automatically by whenever dependencies are added/updated/removed via yarn.
|
||||
* **Adding new dependencies**: To install/add a new dependency (third party library), use [`yarn add`](https://yarnpkg.com/en/docs/cli/add). For example: `yarn add some-lib`.
|
||||
* If you are adding a new build tool dependency (to `devDependencies`), use `yarn add some-lib --dev`
|
||||
* **Upgrading existing dependencies**: To upgrade existing dependencies, you can use [`yarn upgrade`](https://yarnpkg.com/en/docs/cli/upgrade). For example: `yarn upgrade some-lib` or `yarn upgrade some-lib@version`
|
||||
* **Removing dependencies**: If a dependency is no longer needed, or replaced, use [`yarn remove`](https://yarnpkg.com/en/docs/cli/remove) to remove it.
|
||||
* `npm` creates a [`package-lock.json`](https://docs.npmjs.com/cli/v10/configuring-npm/package-lock-json) to track those versions. That file is updated automatically by whenever dependencies are added/updated/removed via npm.
|
||||
* **Adding new dependencies**: To install/add a new dependency (third party library), use [`npm install`](https://docs.npmjs.com/cli/v10/commands/npm-install). For example: `npm install some-lib`.
|
||||
* If you are adding a new build tool dependency (to `devDependencies`), use `npm install some-lib --save--dev`
|
||||
* **Upgrading existing dependencies**: To upgrade existing dependencies, you can use [`npm update`](https://docs.npmjs.com/cli/v10/commands/npm-update). For example: `npm update some-lib` or `npm update some-lib@version`
|
||||
* **Removing dependencies**: If a dependency is no longer needed, or replaced, use [`npm uninstall`](https://docs.npmjs.com/cli/v10/commands/npm-uninstall) to remove it.
|
||||
|
||||
As you can see above, using `yarn` commandline tools means that you should never need to modify the `package.json` manually. *We recommend always using `yarn` to keep dependencies updated / in sync.*
|
||||
As you can see above, using `npm` commandline tools means that you should never need to modify the `package.json` manually. *We recommend always using `npm` to keep dependencies updated / in sync.*
|
||||
|
||||
### Adding Typings for libraries
|
||||
|
||||
If the library does not include typings, you can install them using yarn:
|
||||
If the library does not include typings, you can install them using npm:
|
||||
|
||||
```bash
|
||||
yarn add d3
|
||||
yarn add @types/d3 --dev
|
||||
npm install d3
|
||||
npm install @types/d3 --save-dev
|
||||
```
|
||||
|
||||
If the library doesn't have typings available at `@types/`, you can still use it by manually adding typings for it:
|
||||
@@ -527,13 +527,13 @@ Frequently asked questions
|
||||
- What are the naming conventions for Angular?
|
||||
- See [the official angular style guide](https://angular.io/styleguide)
|
||||
- Why is the size of my app larger in development?
|
||||
- The production build uses a whole host of techniques (ahead-of-time compilation, rollup to remove unreachable code, minification, etc.) to reduce the size, that aren't used during development in the intrest of build speed.
|
||||
- node-pre-gyp ERR in yarn install (Windows)
|
||||
- The production build uses a whole host of techniques (ahead-of-time compilation, rollup to remove unreachable code, minification, etc.) to reduce the size, that aren't used during development in the interest of build speed.
|
||||
- node-pre-gyp ERR in npm install (Windows)
|
||||
- install Python x86 version between 2.5 and 3.0 on windows. See [this issue](https://github.com/AngularClass/angular2-webpack-starter/issues/626)
|
||||
- How do I handle merge conflicts in yarn.lock?
|
||||
- first check out the yarn.lock file from the branch you're merging in to yours: e.g. `git checkout --theirs yarn.lock`
|
||||
- now run `yarn install` again. Yarn will create a new lockfile that contains both sets of changes.
|
||||
- then run `git add yarn.lock` to stage the lockfile for commit
|
||||
- How do I handle merge conflicts in package-lock.json?
|
||||
- first check out the package-lock.json file from the branch you're merging in to yours: e.g. `git checkout --theirs package-lock.json`
|
||||
- now run `npm install` again. NPM will create a new lockfile that contains both sets of changes.
|
||||
- then run `git add package-lock.json` to stage the lockfile for commit
|
||||
- and `git commit` to conclude the merge
|
||||
|
||||
Getting Help
|
||||
|
@@ -58,7 +58,10 @@
|
||||
"input": "src/themes/dspace/styles/theme.scss",
|
||||
"inject": false,
|
||||
"bundleName": "dspace-theme"
|
||||
}
|
||||
},
|
||||
"node_modules/leaflet/dist/leaflet.css",
|
||||
"node_modules/leaflet.markercluster/dist/MarkerCluster.Default.css",
|
||||
"node_modules/leaflet.markercluster/dist/MarkerCluster.css"
|
||||
],
|
||||
"scripts": [],
|
||||
"baseHref": "/"
|
||||
|
@@ -23,10 +23,24 @@ ssr:
|
||||
# Determining which styles are critical is a relatively expensive operation; this option is
|
||||
# disabled (false) by default to boost server performance at the expense of loading smoothness.
|
||||
inlineCriticalCss: false
|
||||
# Path prefixes to enable SSR for. By default these are limited to paths of primary DSpace objects.
|
||||
# NOTE: The "/handle/" path ensures Handle redirects work via SSR. The "/reload/" path ensures
|
||||
# hard refreshes (e.g. after login) trigger SSR while fully reloading the page.
|
||||
paths: [ '/home', '/items/', '/entities/', '/collections/', '/communities/', '/bitstream/', '/bitstreams/', '/handle/', '/reload/' ]
|
||||
# Patterns to be run as regexes against the path of the page to check if SSR is allowed.
|
||||
# If the path match any of the regexes it will be served directly in CSR.
|
||||
# By default, excludes community and collection browse, global browse, global search, community list, statistics and various administrative tools.
|
||||
excludePathPatterns:
|
||||
- pattern: "^/communities/[a-f0-9-]{36}/browse(/.*)?$"
|
||||
flag: "i"
|
||||
- pattern: "^/collections/[a-f0-9-]{36}/browse(/.*)?$"
|
||||
flag: "i"
|
||||
- pattern: "^/browse/"
|
||||
- pattern: "^/search$"
|
||||
- pattern: "^/community-list$"
|
||||
- pattern: "^/admin/"
|
||||
- pattern: "^/processes/?"
|
||||
- pattern: "^/notifications/"
|
||||
- pattern: "^/statistics/?"
|
||||
- pattern: "^/access-control/"
|
||||
- pattern: "^/health$"
|
||||
|
||||
# Whether to enable rendering of Search component on SSR.
|
||||
# If set to true the component will be included in the HTML returned from the server side rendering.
|
||||
# If set to false the component will not be included in the HTML returned from the server side rendering.
|
||||
@@ -87,7 +101,7 @@ cache:
|
||||
# Set to true to see all cache hits/misses/refreshes in your console logs. Useful for debugging SSR caching issues.
|
||||
debug: false
|
||||
# When enabled (i.e. max > 0), known bots will be sent pages from a server side cache specific for bots.
|
||||
# (Keep in mind, bot detection cannot be guarranteed. It is possible some bots will bypass this cache.)
|
||||
# (Keep in mind, bot detection cannot be guaranteed. It is possible some bots will bypass this cache.)
|
||||
botCache:
|
||||
# Maximum number of pages to cache for known bots. Set to zero (0) to disable server side caching for bots.
|
||||
# Default is 1000, which means the 1000 most recently accessed public pages will be cached.
|
||||
@@ -350,15 +364,25 @@ item:
|
||||
# Rounded to the nearest size in the list of selectable sizes on the
|
||||
# settings menu. See pageSizeOptions in 'pagination-component-options.model.ts'.
|
||||
pageSize: 5
|
||||
# Show the bitstream access status label on the item page
|
||||
showAccessStatuses: false
|
||||
|
||||
# Community Page Config
|
||||
community:
|
||||
# Default tab to be shown when browsing a Community. Valid values are: comcols, search, or browse_<field>
|
||||
# <field> must be any of the configured "browse by" fields, e.g., dateissued, author, title, or subject
|
||||
# When the default tab is not the 'search' tab, the search tab is moved to the last position
|
||||
defaultBrowseTab: search
|
||||
# Search tab config
|
||||
searchSection:
|
||||
showSidebar: true
|
||||
|
||||
# Collection Page Config
|
||||
collection:
|
||||
# Default tab to be shown when browsing a Collection. Valid values are: search, or browse_<field>
|
||||
# <field> must be any of the configured "browse by" fields, e.g., dateissued, author, title, or subject
|
||||
# When the default tab is not the 'search' tab, the search tab is moved to the last position
|
||||
defaultBrowseTab: search
|
||||
# Search tab config
|
||||
searchSection:
|
||||
showSidebar: true
|
||||
@@ -443,6 +467,8 @@ info:
|
||||
enableEndUserAgreement: true
|
||||
enablePrivacyStatement: true
|
||||
enableCOARNotifySupport: true
|
||||
# Whether to show the cookie consent popup and the cookie settings footer link or not.
|
||||
enableCookieConsentPopup: true
|
||||
|
||||
# Whether to enable Markdown (https://commonmark.org/) and MathJax (https://www.mathjax.org/)
|
||||
# display in supported metadata fields. By default, only dc.description.abstract is supported.
|
||||
@@ -536,7 +562,6 @@ notifyMetrics:
|
||||
config: 'NOTIFY.outgoing.delivered'
|
||||
description: 'admin-notify-dashboard.NOTIFY.outgoing.delivered.description'
|
||||
|
||||
|
||||
# Live Region configuration
|
||||
# Live Region as defined by w3c, https://www.w3.org/TR/wai-aria-1.1/#terms:
|
||||
# Live regions are perceivable regions of a web page that are typically updated as a
|
||||
@@ -550,3 +575,42 @@ liveRegion:
|
||||
messageTimeOutDurationMs: 30000
|
||||
# The visibility of the live region. Setting this to true is only useful for debugging purposes.
|
||||
isVisible: false
|
||||
|
||||
# Geospatial Map display options
|
||||
geospatialMapViewer:
|
||||
# Which fields to use for parsing as geospatial points in search maps
|
||||
# (note, the item page field component allows any field(s) to be used
|
||||
# and is set as an input when declaring the component)
|
||||
spatialMetadataFields:
|
||||
- 'dcterms.spatial'
|
||||
# Which discovery configuration to use for 'geospatial search', used
|
||||
# in the browse map
|
||||
spatialFacetDiscoveryConfiguration: 'geospatial'
|
||||
# Which filter / facet name to use for faceted geospatial search
|
||||
# used in the browse map
|
||||
spatialPointFilterName: 'point'
|
||||
# Whether item page geospatial metadata should be displayed
|
||||
# (assumes they are wrapped in a test for this config in the template as
|
||||
# per the default templates supplied with DSpace for untyped-item and publication)
|
||||
enableItemPageFields: false
|
||||
# Whether the browse map should be enabled and included in the browse menu
|
||||
enableBrowseMap: false
|
||||
# Whether a 'map view' mode should be included alongside list and grid views
|
||||
# in search result pages
|
||||
enableSearchViewMode: false
|
||||
# The tile provider(s) to use for the map tiles drawn in the leaflet maps.
|
||||
# (see https://leaflet-extras.github.io/leaflet-providers/preview/) for a full list
|
||||
tileProviders:
|
||||
- 'OpenStreetMap.Mapnik'
|
||||
# Starting centre point for the map, as lat and lng coordinates. This is useful
|
||||
# to set the centre of the map when the map is first loaded and if there are no
|
||||
# points, shapes or markers to display.
|
||||
# Defaults to the centre of Istanbul
|
||||
defaultCentrePoint:
|
||||
lat: 41.015137
|
||||
lng: 28.979530
|
||||
|
||||
# Configuration for storing accessibility settings, used by the AccessibilitySettingsService
|
||||
accessibility:
|
||||
# The duration in days after which the accessibility settings cookie expires
|
||||
cookieExpirationDuration: 7
|
||||
|
@@ -34,6 +34,7 @@ export default defineConfig({
|
||||
DSPACE_TEST_SUBMIT_PERSON_COLLECTION_NAME: 'People',
|
||||
// Account used to test basic submission process
|
||||
DSPACE_TEST_SUBMIT_USER: 'dspacedemo+submit@gmail.com',
|
||||
DSPACE_TEST_SUBMIT_USER_UUID: '914955b1-cf2e-4884-8af7-a166aa24cf73',
|
||||
DSPACE_TEST_SUBMIT_USER_PASSWORD: 'dspace',
|
||||
// Administrator users group
|
||||
DSPACE_ADMINISTRATOR_GROUP: 'e59f5659-bff9-451e-b28f-439e7bd467e4'
|
||||
|
@@ -9,12 +9,12 @@ describe('Admin Add New Modals', () => {
|
||||
|
||||
it('Add new Community modal should pass accessibility tests', () => {
|
||||
// Pin the sidebar open
|
||||
cy.get('#sidebar-collapse-toggle').trigger('mouseover');
|
||||
cy.get('#sidebar-collapse-toggle').click();
|
||||
cy.get('[data-test="sidebar-collapse-toggle"]').trigger('mouseover');
|
||||
cy.get('[data-test="sidebar-collapse-toggle"]').click();
|
||||
|
||||
// Click on entry of menu
|
||||
cy.get('#admin-menu-section-new-title').should('be.visible');
|
||||
cy.get('#admin-menu-section-new-title').click();
|
||||
cy.get('[data-test="admin-menu-section-new-title"]').should('be.visible');
|
||||
cy.get('[data-test="admin-menu-section-new-title"]').click();
|
||||
|
||||
cy.get('a[data-test="menu.section.new_community"]').click();
|
||||
|
||||
@@ -24,12 +24,12 @@ describe('Admin Add New Modals', () => {
|
||||
|
||||
it('Add new Collection modal should pass accessibility tests', () => {
|
||||
// Pin the sidebar open
|
||||
cy.get('#sidebar-collapse-toggle').trigger('mouseover');
|
||||
cy.get('#sidebar-collapse-toggle').click();
|
||||
cy.get('[data-test="sidebar-collapse-toggle"]').trigger('mouseover');
|
||||
cy.get('[data-test="sidebar-collapse-toggle"]').click();
|
||||
|
||||
// Click on entry of menu
|
||||
cy.get('#admin-menu-section-new-title').should('be.visible');
|
||||
cy.get('#admin-menu-section-new-title').click();
|
||||
cy.get('[data-test="admin-menu-section-new-title"]').should('be.visible');
|
||||
cy.get('[data-test="admin-menu-section-new-title"]').click();
|
||||
|
||||
cy.get('a[data-test="menu.section.new_collection"]').click();
|
||||
|
||||
@@ -39,12 +39,12 @@ describe('Admin Add New Modals', () => {
|
||||
|
||||
it('Add new Item modal should pass accessibility tests', () => {
|
||||
// Pin the sidebar open
|
||||
cy.get('#sidebar-collapse-toggle').trigger('mouseover');
|
||||
cy.get('#sidebar-collapse-toggle').click();
|
||||
cy.get('[data-test="sidebar-collapse-toggle"]').trigger('mouseover');
|
||||
cy.get('[data-test="sidebar-collapse-toggle"]').click();
|
||||
|
||||
// Click on entry of menu
|
||||
cy.get('#admin-menu-section-new-title').should('be.visible');
|
||||
cy.get('#admin-menu-section-new-title').click();
|
||||
cy.get('[data-test="admin-menu-section-new-title"]').should('be.visible');
|
||||
cy.get('[data-test="admin-menu-section-new-title"]').click();
|
||||
|
||||
cy.get('a[data-test="menu.section.new_item"]').click();
|
||||
|
||||
|
@@ -9,12 +9,12 @@ describe('Admin Edit Modals', () => {
|
||||
|
||||
it('Edit Community modal should pass accessibility tests', () => {
|
||||
// Pin the sidebar open
|
||||
cy.get('#sidebar-collapse-toggle').trigger('mouseover');
|
||||
cy.get('#sidebar-collapse-toggle').click();
|
||||
cy.get('[data-test="sidebar-collapse-toggle"]').trigger('mouseover');
|
||||
cy.get('[data-test="sidebar-collapse-toggle"]').click();
|
||||
|
||||
// Click on entry of menu
|
||||
cy.get('#admin-menu-section-edit-title').should('be.visible');
|
||||
cy.get('#admin-menu-section-edit-title').click();
|
||||
cy.get('[data-test="admin-menu-section-edit-title"]').should('be.visible');
|
||||
cy.get('[data-test="admin-menu-section-edit-title"]').click();
|
||||
|
||||
cy.get('a[data-test="menu.section.edit_community"]').click();
|
||||
|
||||
@@ -24,12 +24,12 @@ describe('Admin Edit Modals', () => {
|
||||
|
||||
it('Edit Collection modal should pass accessibility tests', () => {
|
||||
// Pin the sidebar open
|
||||
cy.get('#sidebar-collapse-toggle').trigger('mouseover');
|
||||
cy.get('#sidebar-collapse-toggle').click();
|
||||
cy.get('[data-test="sidebar-collapse-toggle"]').trigger('mouseover');
|
||||
cy.get('[data-test="sidebar-collapse-toggle"]').click();
|
||||
|
||||
// Click on entry of menu
|
||||
cy.get('#admin-menu-section-edit-title').should('be.visible');
|
||||
cy.get('#admin-menu-section-edit-title').click();
|
||||
cy.get('[data-test="admin-menu-section-edit-title"]').should('be.visible');
|
||||
cy.get('[data-test="admin-menu-section-edit-title"]').click();
|
||||
|
||||
cy.get('a[data-test="menu.section.edit_collection"]').click();
|
||||
|
||||
@@ -39,12 +39,12 @@ describe('Admin Edit Modals', () => {
|
||||
|
||||
it('Edit Item modal should pass accessibility tests', () => {
|
||||
// Pin the sidebar open
|
||||
cy.get('#sidebar-collapse-toggle').trigger('mouseover');
|
||||
cy.get('#sidebar-collapse-toggle').click();
|
||||
cy.get('[data-test="sidebar-collapse-toggle"]').trigger('mouseover');
|
||||
cy.get('[data-test="sidebar-collapse-toggle"]').click();
|
||||
|
||||
// Click on entry of menu
|
||||
cy.get('#admin-menu-section-edit-title').should('be.visible');
|
||||
cy.get('#admin-menu-section-edit-title').click();
|
||||
cy.get('[data-test="admin-menu-section-edit-title"]').should('be.visible');
|
||||
cy.get('[data-test="admin-menu-section-edit-title"]').click();
|
||||
|
||||
cy.get('a[data-test="menu.section.edit_item"]').click();
|
||||
|
||||
|
@@ -9,12 +9,12 @@ describe('Admin Export Modals', () => {
|
||||
|
||||
it('Export metadata modal should pass accessibility tests', () => {
|
||||
// Pin the sidebar open
|
||||
cy.get('#sidebar-collapse-toggle').trigger('mouseover');
|
||||
cy.get('#sidebar-collapse-toggle').click();
|
||||
cy.get('[data-test="sidebar-collapse-toggle"]').trigger('mouseover');
|
||||
cy.get('[data-test="sidebar-collapse-toggle"]').click();
|
||||
|
||||
// Click on entry of menu
|
||||
cy.get('#admin-menu-section-export-title').should('be.visible');
|
||||
cy.get('#admin-menu-section-export-title').click();
|
||||
cy.get('[data-test="admin-menu-section-export-title"]').should('be.visible');
|
||||
cy.get('[data-test="admin-menu-section-export-title"]').click();
|
||||
|
||||
cy.get('a[data-test="menu.section.export_metadata"]').click();
|
||||
|
||||
@@ -24,12 +24,12 @@ describe('Admin Export Modals', () => {
|
||||
|
||||
it('Export batch modal should pass accessibility tests', () => {
|
||||
// Pin the sidebar open
|
||||
cy.get('#sidebar-collapse-toggle').trigger('mouseover');
|
||||
cy.get('#sidebar-collapse-toggle').click();
|
||||
cy.get('[data-test="sidebar-collapse-toggle"]').trigger('mouseover');
|
||||
cy.get('[data-test="sidebar-collapse-toggle"]').click();
|
||||
|
||||
// Click on entry of menu
|
||||
cy.get('#admin-menu-section-export-title').should('be.visible');
|
||||
cy.get('#admin-menu-section-export-title').click();
|
||||
cy.get('[data-test="admin-menu-section-export-title"]').should('be.visible');
|
||||
cy.get('[data-test="admin-menu-section-export-title"]').click();
|
||||
|
||||
cy.get('a[data-test="menu.section.export_batch"]').click();
|
||||
|
||||
|
@@ -1,5 +1,4 @@
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
import { Options } from 'cypress-axe';
|
||||
|
||||
describe('Admin Sidebar', () => {
|
||||
beforeEach(() => {
|
||||
@@ -10,19 +9,12 @@ describe('Admin Sidebar', () => {
|
||||
|
||||
it('should be pinnable and pass accessibility tests', () => {
|
||||
// Pin the sidebar open
|
||||
cy.get('#sidebar-collapse-toggle').click();
|
||||
cy.get('[data-test="sidebar-collapse-toggle"]').click();
|
||||
|
||||
// Click on every expandable section to open all menus
|
||||
cy.get('ds-expandable-admin-sidebar-section').click({ multiple: true });
|
||||
|
||||
// Analyze <ds-admin-sidebar> for accessibility
|
||||
testA11y('ds-admin-sidebar',
|
||||
{
|
||||
rules: {
|
||||
// Currently all expandable sections have nested interactive elements
|
||||
// See https://github.com/DSpace/dspace-angular/issues/2178
|
||||
'nested-interactive': { enabled: false },
|
||||
},
|
||||
} as Options);
|
||||
testA11y('ds-admin-sidebar');
|
||||
});
|
||||
});
|
||||
|
@@ -12,6 +12,13 @@ describe('Community List Page', () => {
|
||||
cy.get('[data-test="expand-button"]').click({ multiple: true });
|
||||
|
||||
// Analyze <ds-community-list-page> for accessibility issues
|
||||
testA11y('ds-community-list-page');
|
||||
testA11y('ds-community-list-page', {
|
||||
rules: {
|
||||
// When expanding a cdk node on the community-list page, the 'aria-posinset' property becomes 0.
|
||||
// 0 is not a valid value for 'aria-posinset' so the test fails.
|
||||
// see https://github.com/DSpace/dspace-angular/issues/4068
|
||||
'aria-valid-attr-value': { enabled: false },
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -15,24 +15,24 @@ describe('Header', () => {
|
||||
cy.visit('/');
|
||||
|
||||
// Click the language switcher (globe) in header
|
||||
cy.get('a[data-test="lang-switch"]').click();
|
||||
cy.get('button[data-test="lang-switch"]').click();
|
||||
// Click on the "Deusch" language in dropdown
|
||||
cy.get('#language-menu-list li').contains('Deutsch').click();
|
||||
cy.get('#language-menu-list div[role="option"]').contains('Deutsch').click();
|
||||
|
||||
// HTML "lang" attribute should switch to "de"
|
||||
cy.get('html').invoke('attr', 'lang').should('eq', 'de');
|
||||
|
||||
// Login menu should now be in German
|
||||
cy.get('a[data-test="login-menu"]').contains('Anmelden');
|
||||
cy.get('[data-test="login-menu"]').contains('Anmelden');
|
||||
|
||||
// Change back to English from language switcher
|
||||
cy.get('a[data-test="lang-switch"]').click();
|
||||
cy.get('#language-menu-list li').contains('English').click();
|
||||
cy.get('button[data-test="lang-switch"]').click();
|
||||
cy.get('#language-menu-list div[role="option"]').contains('English').click();
|
||||
|
||||
// HTML "lang" attribute should switch to "en"
|
||||
cy.get('html').invoke('attr', 'lang').should('eq', 'en');
|
||||
|
||||
// Login menu should now be in English
|
||||
cy.get('a[data-test="login-menu"]').contains('Log In');
|
||||
cy.get('[data-test="login-menu"]').contains('Log In');
|
||||
});
|
||||
});
|
||||
|
@@ -4,13 +4,14 @@ import { Options } from 'cypress-axe';
|
||||
|
||||
beforeEach(() => {
|
||||
// Must login as an Admin to see the page
|
||||
cy.intercept('GET', '/server/actuator/health').as('status');
|
||||
cy.intercept('GET', '/server/actuator/info').as('info');
|
||||
cy.visit('/health');
|
||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||
});
|
||||
|
||||
describe('Health Page > Status Tab', () => {
|
||||
it('should pass accessibility tests', () => {
|
||||
cy.intercept('GET', '/server/actuator/health').as('status');
|
||||
cy.wait('@status');
|
||||
|
||||
cy.get('a[data-test="health-page.status-tab"]').click();
|
||||
@@ -36,7 +37,6 @@ describe('Health Page > Status Tab', () => {
|
||||
|
||||
describe('Health Page > Info Tab', () => {
|
||||
it('should pass accessibility tests', () => {
|
||||
cy.intercept('GET', '/server/actuator/info').as('info');
|
||||
cy.wait('@info');
|
||||
|
||||
cy.get('a[data-test="health-page.info-tab"]').click();
|
||||
|
@@ -17,7 +17,7 @@ describe('Site Statistics Page', () => {
|
||||
|
||||
cy.visit('/statistics');
|
||||
|
||||
// <ds-site-statistics-page> tag must be visable
|
||||
// <ds-site-statistics-page> tag must be visible
|
||||
cy.get('ds-site-statistics-page').should('be.visible');
|
||||
|
||||
// Verify / wait until "Total Visits" table's *last* label is non-empty
|
||||
|
@@ -26,6 +26,12 @@ describe('Homepage', () => {
|
||||
// Wait for homepage tag to appear
|
||||
cy.get('ds-home-page').should('be.visible');
|
||||
|
||||
// Wait for at least one loading component to show up
|
||||
cy.get('ds-loading').should('exist');
|
||||
|
||||
// Wait until all loading components have disappeared
|
||||
cy.get('ds-loading').should('not.exist');
|
||||
|
||||
// Analyze <ds-home-page> for accessibility issues
|
||||
testA11y('ds-home-page');
|
||||
});
|
||||
|
@@ -7,7 +7,7 @@ describe('Item Statistics Page', () => {
|
||||
it('should load if you click on "Statistics" from an Item/Entity page', () => {
|
||||
cy.visit('/entities/publication/'.concat(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION')));
|
||||
cy.get('ds-navbar ds-link-menu-item a[data-test="link-menu-item.menu.section.statistics"]').click();
|
||||
cy.location('pathname').should('eq', ITEMSTATISTICSPAGE);
|
||||
cy.location('pathname').should('eq', '/statistics/entities/publication/'.concat(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION')));
|
||||
});
|
||||
|
||||
it('should contain element ds-item-statistics-page when navigating to an item statistics page', () => {
|
||||
|
@@ -142,7 +142,7 @@ describe('Login Modal', () => {
|
||||
page.submitLoginAndPasswordByPressingButton(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||
cy.get('ds-log-in').should('not.exist');
|
||||
|
||||
// Open user menu, verify user menu accesibility
|
||||
// Open user menu, verify user menu accessibility
|
||||
page.openUserMenu();
|
||||
cy.get('ds-user-menu').should('be.visible');
|
||||
testA11y('ds-user-menu');
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('PageNotFound', () => {
|
||||
it('should contain element ds-pagenotfound when navigating to page that doesnt exist', () => {
|
||||
it('should contain element ds-pagenotfound when navigating to page that does not exist', () => {
|
||||
// request an invalid page (UUIDs at root path aren't valid)
|
||||
cy.visit('/e9019a69-d4f1-4773-b6a3-bd362caa46f2', { failOnStatusCode: false });
|
||||
cy.get('ds-pagenotfound').should('be.visible');
|
||||
|
@@ -34,7 +34,7 @@ describe('New Submission page', () => {
|
||||
// Author & Subject fields have invalid "aria-multiline" attrs.
|
||||
// See https://github.com/DSpace/dspace-angular/issues/1272
|
||||
'aria-allowed-attr': { enabled: false },
|
||||
// All panels are accordians & fail "aria-required-children" and "nested-interactive".
|
||||
// All panels are accordions & fail "aria-required-children" and "nested-interactive".
|
||||
// Seem to require updating ng-bootstrap and https://github.com/DSpace/dspace-angular/issues/2216
|
||||
'aria-required-children': { enabled: false },
|
||||
'nested-interactive': { enabled: false },
|
||||
@@ -192,7 +192,7 @@ describe('New Submission page', () => {
|
||||
testA11y('ds-submission-edit',
|
||||
{
|
||||
rules: {
|
||||
// All panels are accordians & fail "aria-required-children" and "nested-interactive".
|
||||
// All panels are accordions & fail "aria-required-children" and "nested-interactive".
|
||||
// Seem to require updating ng-bootstrap and https://github.com/DSpace/dspace-angular/issues/2216
|
||||
'aria-required-children': { enabled: false },
|
||||
'nested-interactive': { enabled: false },
|
||||
@@ -217,7 +217,7 @@ describe('New Submission page', () => {
|
||||
});
|
||||
|
||||
// Close popup window
|
||||
cy.get('ds-dynamic-lookup-relation-modal button.close').click();
|
||||
cy.get('ds-dynamic-lookup-relation-modal button.btn-close').click();
|
||||
|
||||
// Back on the form, click the discard button to remove new submission
|
||||
// Clicking it will display a confirmation, which we will confirm with another click
|
||||
|
@@ -54,9 +54,9 @@ before(() => {
|
||||
|
||||
// Runs once before the first test in each "block"
|
||||
beforeEach(() => {
|
||||
// Pre-agree to all Klaro cookies by setting the klaro-anonymous cookie
|
||||
// Pre-agree to all Orejime cookies by setting the orejime-anonymous cookie
|
||||
// This just ensures it doesn't get in the way of matching other objects in the page.
|
||||
cy.setCookie('klaro-anonymous', '{%22authentication%22:true%2C%22preferences%22:true%2C%22acknowledgement%22:true%2C%22google-analytics%22:true%2C%22google-recaptcha%22:true}');
|
||||
cy.setCookie('orejime-anonymous', '{"authentication":true,"preferences":true,"acknowledgement":true,"google-analytics":true,"correlation-id":true,"accessibility":true}');
|
||||
|
||||
// Remove any CSRF cookies saved from prior tests
|
||||
cy.clearCookie(DSPACE_XSRF_COOKIE);
|
||||
|
@@ -1,10 +1,16 @@
|
||||
{
|
||||
"extends": "../tsconfig.json",
|
||||
"include": [
|
||||
"**/*.ts"
|
||||
"**/*.ts",
|
||||
"../cypress.config.ts"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"sourceMap": false,
|
||||
"typeRoots": [
|
||||
"../node_modules",
|
||||
"../node_modules/@types",
|
||||
"../src/typings.d.ts"
|
||||
],
|
||||
"types": [
|
||||
"cypress",
|
||||
"cypress-axe",
|
||||
|
@@ -23,14 +23,14 @@ the Docker compose scripts in this 'docker' folder.
|
||||
This Dockerfile is used to build a *development* DSpace Angular UI image, published as 'dspace/dspace-angular'
|
||||
|
||||
```
|
||||
docker build -t dspace/dspace-angular:dspace-8_x .
|
||||
docker build -t dspace/dspace-angular:latest .
|
||||
```
|
||||
|
||||
This image is built *automatically* after each commit is made to the `main` branch.
|
||||
|
||||
Admins to our DockerHub repo can manually publish with the following command.
|
||||
```
|
||||
docker push dspace/dspace-angular:dspace-8_x
|
||||
docker push dspace/dspace-angular:latest
|
||||
```
|
||||
|
||||
### Dockerfile.dist
|
||||
@@ -39,7 +39,7 @@ The `Dockerfile.dist` is used to generate a *production* build and runtime envir
|
||||
|
||||
```bash
|
||||
# build the latest image
|
||||
docker build -f Dockerfile.dist -t dspace/dspace-angular:dspace-8_x-dist .
|
||||
docker build -f Dockerfile.dist -t dspace/dspace-angular:latest-dist .
|
||||
```
|
||||
|
||||
A default/demo version of this image is built *automatically*.
|
||||
|
@@ -14,14 +14,14 @@
|
||||
# Therefore, it should be kept in sync with that file
|
||||
networks:
|
||||
# Default to using network named 'dspacenet' from docker-compose-rest.yml.
|
||||
# Its full name will be prepended with the project name (e.g. "-p d8" means it will be named "d8_dspacenet")
|
||||
# Its full name will be prepended with the project name (e.g. "-p d7" means it will be named "d7_dspacenet")
|
||||
# If COMPOSITE_PROJECT_NAME is missing, default value will be "docker" (name of folder this file is in)
|
||||
default:
|
||||
name: ${COMPOSE_PROJECT_NAME:-docker}_dspacenet
|
||||
external: true
|
||||
services:
|
||||
dspace-cli:
|
||||
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-cli:${DSPACE_VER:-dspace-8_x}"
|
||||
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-cli:${DSPACE_VER:-latest}"
|
||||
container_name: dspace-cli
|
||||
environment:
|
||||
# Below syntax may look odd, but it is how to override dspace.cfg settings via env variables.
|
||||
|
@@ -14,11 +14,10 @@
|
||||
# # Therefore, it should be kept in sync with that file
|
||||
services:
|
||||
dspacedb:
|
||||
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-postgres-pgcrypto:${DSPACE_VER:-dspace-8_x}-loadsql"
|
||||
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-postgres-pgcrypto:${DSPACE_VER:-latest}-loadsql"
|
||||
environment:
|
||||
# This LOADSQL should be kept in sync with the URL in DSpace/DSpace
|
||||
# This SQL is available from https://github.com/DSpace-Labs/AIP-Files/releases/tag/demo-entities-data
|
||||
# NOTE: currently there is no dspace8 version
|
||||
- LOADSQL=https://github.com/DSpace-Labs/AIP-Files/releases/download/demo-entities-data/dspace7-entities-data.sql
|
||||
dspace:
|
||||
### OVERRIDE default 'entrypoint' in 'docker-compose-rest.yml' ####
|
||||
|
@@ -33,7 +33,7 @@ services:
|
||||
# This allows us to generate statistics in e2e tests so that statistics pages can be tested thoroughly.
|
||||
solr__D__statistics__P__autoCommit: 'false'
|
||||
LOGGING_CONFIG: /dspace/config/log4j2-container.xml
|
||||
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace:${DSPACE_VER:-dspace-8_x-test}"
|
||||
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace:${DSPACE_VER:-latest-test}"
|
||||
depends_on:
|
||||
- dspacedb
|
||||
networks:
|
||||
@@ -60,12 +60,11 @@ services:
|
||||
# NOTE: This is customized to use our loadsql image, so that we are using a database with existing test data
|
||||
dspacedb:
|
||||
container_name: dspacedb
|
||||
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-postgres-pgcrypto:${DSPACE_VER:-dspace-8_x}-loadsql"
|
||||
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-postgres-pgcrypto:${DSPACE_VER:-latest}-loadsql"
|
||||
environment:
|
||||
# This LOADSQL should be kept in sync with the LOADSQL in
|
||||
# https://github.com/DSpace/DSpace/blob/main/dspace/src/main/docker-compose/db.entities.yml
|
||||
# This SQL is available from https://github.com/DSpace-Labs/AIP-Files/releases/tag/demo-entities-data
|
||||
# NOTE: currently there is no dspace8 version
|
||||
LOADSQL: https://github.com/DSpace-Labs/AIP-Files/releases/download/demo-entities-data/dspace7-entities-data.sql
|
||||
PGDATA: /pgdata
|
||||
POSTGRES_PASSWORD: dspace
|
||||
@@ -82,7 +81,7 @@ services:
|
||||
# DSpace Solr container
|
||||
dspacesolr:
|
||||
container_name: dspacesolr
|
||||
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-solr:${DSPACE_VER:-dspace-8_x}"
|
||||
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-solr:${DSPACE_VER:-latest}"
|
||||
networks:
|
||||
- dspacenet
|
||||
ports:
|
||||
@@ -94,7 +93,10 @@ services:
|
||||
volumes:
|
||||
# Keep Solr data directory between reboots
|
||||
- solr_data:/var/solr/data
|
||||
# Initialize all DSpace Solr cores using the mounted configsets (see above), then start Solr
|
||||
# NOTE: We are not running Solr as "root", but we need root permissions to copy our cores to the mounted
|
||||
# /var/solr/data directory. Then we start Solr as the "solr" user.
|
||||
user: root
|
||||
# Initialize all DSpace Solr cores, then start Solr
|
||||
entrypoint:
|
||||
- /bin/bash
|
||||
- '-c'
|
||||
@@ -112,7 +114,8 @@ services:
|
||||
cp -r /opt/solr/server/solr/configsets/qaevent/* qaevent
|
||||
precreate-core suggestion /opt/solr/server/solr/configsets/suggestion
|
||||
cp -r /opt/solr/server/solr/configsets/suggestion/* suggestion
|
||||
exec solr -f
|
||||
chown -R solr:solr /var/solr
|
||||
runuser -u solr -- solr-foreground
|
||||
volumes:
|
||||
assetstore:
|
||||
pgdata:
|
||||
|
@@ -26,7 +26,7 @@ services:
|
||||
DSPACE_REST_HOST: sandbox.dspace.org
|
||||
DSPACE_REST_PORT: 443
|
||||
DSPACE_REST_NAMESPACE: /server
|
||||
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-angular:${DSPACE_VER:-dspace-8_x}-dist"
|
||||
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-angular:${DSPACE_VER:-latest}-dist"
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: Dockerfile.dist
|
||||
|
@@ -40,7 +40,7 @@ services:
|
||||
# from the host machine. This IP range MUST correspond to the 'dspacenet' subnet defined above.
|
||||
proxies__P__trusted__P__ipranges: '172.23.0'
|
||||
LOGGING_CONFIG: /dspace/config/log4j2-container.xml
|
||||
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace:${DSPACE_VER:-dspace-8_x-test}"
|
||||
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace:${DSPACE_VER:-latest-test}"
|
||||
depends_on:
|
||||
- dspacedb
|
||||
networks:
|
||||
@@ -68,7 +68,7 @@ services:
|
||||
dspacedb:
|
||||
container_name: dspacedb
|
||||
# Uses a custom Postgres image with pgcrypto installed
|
||||
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-postgres-pgcrypto:${DSPACE_VER:-dspace-8_x}"
|
||||
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-postgres-pgcrypto:${DSPACE_VER:-latest}"
|
||||
environment:
|
||||
PGDATA: /pgdata
|
||||
POSTGRES_PASSWORD: dspace
|
||||
@@ -85,7 +85,7 @@ services:
|
||||
# DSpace Solr container
|
||||
dspacesolr:
|
||||
container_name: dspacesolr
|
||||
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-solr:${DSPACE_VER:-dspace-8_x}"
|
||||
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-solr:${DSPACE_VER:-latest}"
|
||||
networks:
|
||||
- dspacenet
|
||||
ports:
|
||||
@@ -97,11 +97,16 @@ services:
|
||||
volumes:
|
||||
# Keep Solr data directory between reboots
|
||||
- solr_data:/var/solr/data
|
||||
# NOTE: We are not running Solr as "root", but we need root permissions to copy our cores to the mounted
|
||||
# /var/solr/data directory. Then we start Solr as the "solr" user.
|
||||
user: root
|
||||
# Initialize all DSpace Solr cores using the mounted local configsets (see above), then start Solr
|
||||
# * First, run precreate-core to create the core (if it doesn't yet exist). If exists already, this is a no-op
|
||||
# * Second, copy configsets to this core:
|
||||
# Updates to Solr configs require the container to be rebuilt/restarted:
|
||||
# `docker compose -p d7 -f docker/docker-compose.yml -f docker/docker-compose-rest.yml up -d --build dspacesolr`
|
||||
# * Third, ensure all new folders are owned by "solr" user
|
||||
# * Finally, start Solr as the "solr" user via the provided solr-foreground script
|
||||
entrypoint:
|
||||
- /bin/bash
|
||||
- '-c'
|
||||
@@ -119,7 +124,8 @@ services:
|
||||
cp -r /opt/solr/server/solr/configsets/qaevent/* qaevent
|
||||
precreate-core suggestion /opt/solr/server/solr/configsets/suggestion
|
||||
cp -r /opt/solr/server/solr/configsets/suggestion/* suggestion
|
||||
exec solr -f
|
||||
chown -R solr:solr /var/solr
|
||||
runuser -u solr -- solr-foreground
|
||||
volumes:
|
||||
assetstore:
|
||||
pgdata:
|
||||
|
@@ -23,7 +23,7 @@ services:
|
||||
DSPACE_REST_HOST: localhost
|
||||
DSPACE_REST_PORT: 8080
|
||||
DSPACE_REST_NAMESPACE: /server
|
||||
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-angular:${DSPACE_VER:-dspace-8_x}"
|
||||
image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-angular:${DSPACE_VER:-latest}"
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: Dockerfile
|
||||
|
@@ -15,7 +15,7 @@ DSPACE_APP_CONFIG_PATH=/usr/local/dspace/config/config.yml
|
||||
Configuration options can be overridden by setting environment variables.
|
||||
|
||||
## Nodejs server
|
||||
When you start dspace-angular on node, it spins up an http server on which it listens for incoming connections. You can define the ip address and port the server should bind itsself to, and if ssl should be enabled not. By default it listens on `localhost:4000`. If you want it to listen on all your network connections, configure it to bind itself to `0.0.0.0`.
|
||||
When you start dspace-angular on node, it spins up an http server on which it listens for incoming connections. You can define the ip address and port the server should bind itself to, and if ssl should be enabled not. By default it listens on `localhost:4000`. If you want it to listen on all your network connections, configure it to bind itself to `0.0.0.0`.
|
||||
|
||||
To change this configuration, change the options `ui.host`, `ui.port` and `ui.ssl` in the appropriate configuration file (see above):
|
||||
|
||||
|
@@ -9,6 +9,8 @@ _______
|
||||
|
||||
[Source code](../../../../lint/src/rules/html/no-disabled-attribute-on-button.ts)
|
||||
|
||||
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@@ -19,24 +21,28 @@ _______
|
||||
```html
|
||||
<button [dsBtnDisabled]="true">Submit</button>
|
||||
```
|
||||
|
||||
|
||||
##### disabled attribute is still valid on non-button elements
|
||||
|
||||
```html
|
||||
<input disabled>
|
||||
```
|
||||
|
||||
|
||||
##### [disabled] attribute is still valid on non-button elements
|
||||
|
||||
```html
|
||||
<input [disabled]="true">
|
||||
```
|
||||
|
||||
|
||||
##### angular dynamic attributes that use disabled are still valid
|
||||
|
||||
```html
|
||||
<button [class.disabled]="isDisabled">Submit</button>
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -47,6 +53,9 @@ _______
|
||||
|
||||
```html
|
||||
<button disabled>Submit</button>
|
||||
|
||||
|
||||
|
||||
```
|
||||
Will produce the following error(s):
|
||||
```
|
||||
@@ -63,6 +72,9 @@ Result of `yarn lint --fix`:
|
||||
|
||||
```html
|
||||
<button [disabled]="true">Submit</button>
|
||||
|
||||
|
||||
|
||||
```
|
||||
Will produce the following error(s):
|
||||
```
|
||||
|
@@ -11,6 +11,8 @@ _______
|
||||
|
||||
[Source code](../../../../lint/src/rules/html/themed-component-usages.ts)
|
||||
|
||||
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@@ -23,6 +25,7 @@ _______
|
||||
<ds-test-themeable></ds-test-themeable>
|
||||
<ds-test-themeable [test]="something"></ds-test-themeable>
|
||||
```
|
||||
|
||||
|
||||
##### use no-prefix selectors in TypeScript templates
|
||||
|
||||
@@ -33,6 +36,7 @@ _______
|
||||
class Test {
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
##### use no-prefix selectors in TypeScript test templates
|
||||
|
||||
@@ -45,6 +49,7 @@ Filename: `lint/test/fixture/src/test.spec.ts`
|
||||
class Test {
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
##### base selectors are also allowed in TypeScript test templates
|
||||
|
||||
@@ -57,6 +62,7 @@ Filename: `lint/test/fixture/src/test.spec.ts`
|
||||
class Test {
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -69,6 +75,9 @@ class Test {
|
||||
<ds-themed-test-themeable/>
|
||||
<ds-themed-test-themeable></ds-themed-test-themeable>
|
||||
<ds-themed-test-themeable [test]="something"></ds-themed-test-themeable>
|
||||
|
||||
|
||||
|
||||
```
|
||||
Will produce the following error(s):
|
||||
```
|
||||
@@ -91,6 +100,9 @@ Result of `yarn lint --fix`:
|
||||
<ds-base-test-themeable/>
|
||||
<ds-base-test-themeable></ds-base-test-themeable>
|
||||
<ds-base-test-themeable [test]="something"></ds-base-test-themeable>
|
||||
|
||||
|
||||
|
||||
```
|
||||
Will produce the following error(s):
|
||||
```
|
||||
|
@@ -1,6 +1,11 @@
|
||||
[DSpace ESLint plugins](../../../lint/README.md) > TypeScript rules
|
||||
_______
|
||||
|
||||
- [`dspace-angular-ts/alias-imports`](./rules/alias-imports.md): Unclear imports should be aliased for clarity
|
||||
- [`dspace-angular-ts/sort-standalone-imports`](./rules/sort-standalone-imports.md): Sorts the standalone `@Component` imports alphabetically
|
||||
- [`dspace-angular-ts/themed-component-classes`](./rules/themed-component-classes.md): Formatting rules for themeable component classes
|
||||
- [`dspace-angular-ts/themed-component-selectors`](./rules/themed-component-selectors.md): Themeable component selectors should follow the DSpace convention
|
||||
- [`dspace-angular-ts/themed-component-usages`](./rules/themed-component-usages.md): Themeable components should be used via their `ThemedComponent` wrapper class
|
||||
- [`dspace-angular-ts/themed-decorators`](./rules/themed-decorators.md): Entry components with theme support should declare the correct theme
|
||||
- [`dspace-angular-ts/themed-wrapper-no-input-defaults`](./rules/themed-wrapper-no-input-defaults.md): ThemedComponent wrappers should not declare input defaults (see [DSpace Angular #2164](https://github.com/DSpace/dspace-angular/pull/2164))
|
||||
- [`dspace-angular-ts/unique-decorators`](./rules/unique-decorators.md): Some decorators must be called with unique arguments (e.g. when they construct a mapping based on the argument values)
|
||||
|
148
docs/lint/ts/rules/alias-imports.md
Normal file
148
docs/lint/ts/rules/alias-imports.md
Normal file
@@ -0,0 +1,148 @@
|
||||
[DSpace ESLint plugins](../../../../lint/README.md) > [TypeScript rules](../index.md) > `dspace-angular-ts/alias-imports`
|
||||
_______
|
||||
|
||||
Unclear imports should be aliased for clarity
|
||||
|
||||
_______
|
||||
|
||||
[Source code](../../../../lint/src/rules/ts/alias-imports.ts)
|
||||
|
||||
|
||||
### Options
|
||||
|
||||
#### `aliases`
|
||||
|
||||
A list of all the imports that you want to alias for clarity. Every alias should be declared in the following format:
|
||||
```json
|
||||
{
|
||||
"package": "rxjs",
|
||||
"imported": "of",
|
||||
"local": "observableOf"
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
#### Valid code
|
||||
|
||||
##### correctly aliased imports
|
||||
|
||||
```typescript
|
||||
import { of as observableOf } from 'rxjs';
|
||||
```
|
||||
|
||||
With options:
|
||||
|
||||
```json
|
||||
{
|
||||
"aliases": [
|
||||
{
|
||||
"package": "rxjs",
|
||||
"imported": "of",
|
||||
"local": "observableOf"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
##### enforce unaliased import
|
||||
|
||||
```typescript
|
||||
import { combineLatest } from 'rxjs';
|
||||
```
|
||||
|
||||
With options:
|
||||
|
||||
```json
|
||||
{
|
||||
"aliases": [
|
||||
{
|
||||
"package": "rxjs",
|
||||
"imported": "combineLatest",
|
||||
"local": "combineLatest"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#### Invalid code & automatic fixes
|
||||
|
||||
##### imports without alias
|
||||
|
||||
```typescript
|
||||
import { of } from 'rxjs';
|
||||
|
||||
|
||||
|
||||
```
|
||||
Will produce the following error(s):
|
||||
```
|
||||
This import must be aliased
|
||||
```
|
||||
|
||||
Result of `yarn lint --fix`:
|
||||
```typescript
|
||||
import { of as observableOf } from 'rxjs';
|
||||
```
|
||||
|
||||
|
||||
##### imports under the wrong alias
|
||||
|
||||
```typescript
|
||||
import { of as ofSomething } from 'rxjs';
|
||||
|
||||
|
||||
|
||||
```
|
||||
Will produce the following error(s):
|
||||
```
|
||||
This import uses the wrong alias (should be {{ local }})
|
||||
```
|
||||
|
||||
Result of `yarn lint --fix`:
|
||||
```typescript
|
||||
import { of as observableOf } from 'rxjs';
|
||||
```
|
||||
|
||||
|
||||
##### disallow aliasing import
|
||||
|
||||
```typescript
|
||||
import { combineLatest as observableCombineLatest } from 'rxjs';
|
||||
|
||||
|
||||
With options:
|
||||
|
||||
```json
|
||||
{
|
||||
"aliases": [
|
||||
{
|
||||
"package": "rxjs",
|
||||
"imported": "combineLatest",
|
||||
"local": "combineLatest"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
```
|
||||
Will produce the following error(s):
|
||||
```
|
||||
This import should not use an alias
|
||||
```
|
||||
|
||||
Result of `yarn lint --fix`:
|
||||
```typescript
|
||||
import { combineLatest } from 'rxjs';
|
||||
```
|
||||
|
||||
|
||||
|
245
docs/lint/ts/rules/sort-standalone-imports.md
Normal file
245
docs/lint/ts/rules/sort-standalone-imports.md
Normal file
@@ -0,0 +1,245 @@
|
||||
[DSpace ESLint plugins](../../../../lint/README.md) > [TypeScript rules](../index.md) > `dspace-angular-ts/sort-standalone-imports`
|
||||
_______
|
||||
|
||||
Sorts the standalone `@Component` imports alphabetically
|
||||
|
||||
_______
|
||||
|
||||
[Source code](../../../../lint/src/rules/ts/sort-standalone-imports.ts)
|
||||
|
||||
|
||||
### Options
|
||||
|
||||
#### `locale`
|
||||
|
||||
The locale used to sort the imports.,
|
||||
#### `maxItems`
|
||||
|
||||
The maximum number of imports that should be displayed before each import is separated onto its own line.,
|
||||
#### `indent`
|
||||
|
||||
The indent used for the project.,
|
||||
#### `trailingComma`
|
||||
|
||||
Whether the last import should have a trailing comma (only applicable for multiline imports).
|
||||
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
#### Valid code
|
||||
|
||||
##### should sort multiple imports on separate lines
|
||||
|
||||
```typescript
|
||||
@Component({
|
||||
selector: 'ds-app',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./app.component.scss'],
|
||||
standalone: true,
|
||||
imports: [
|
||||
AsyncPipe,
|
||||
RootComponent,
|
||||
],
|
||||
})
|
||||
export class AppComponent {}
|
||||
```
|
||||
|
||||
|
||||
##### should not inlines singular imports when maxItems is 0
|
||||
|
||||
```typescript
|
||||
@Component({
|
||||
selector: 'ds-app',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./app.component.scss'],
|
||||
standalone: true,
|
||||
imports: [
|
||||
RootComponent,
|
||||
],
|
||||
})
|
||||
export class AppComponent {}
|
||||
```
|
||||
|
||||
|
||||
##### should inline singular imports when maxItems is 1
|
||||
|
||||
```typescript
|
||||
@Component({
|
||||
selector: 'ds-app',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./app.component.scss'],
|
||||
standalone: true,
|
||||
imports: [RootComponent],
|
||||
})
|
||||
export class AppComponent {}
|
||||
```
|
||||
|
||||
With options:
|
||||
|
||||
```json
|
||||
{
|
||||
"maxItems": 1
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#### Invalid code & automatic fixes
|
||||
|
||||
##### should sort multiple imports alphabetically
|
||||
|
||||
```typescript
|
||||
@Component({
|
||||
selector: 'ds-app',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./app.component.scss'],
|
||||
standalone: true,
|
||||
imports: [
|
||||
RootComponent,
|
||||
AsyncPipe,
|
||||
],
|
||||
})
|
||||
export class AppComponent {}
|
||||
|
||||
|
||||
|
||||
```
|
||||
Will produce the following error(s):
|
||||
```
|
||||
Standalone imports should be sorted alphabetically
|
||||
```
|
||||
|
||||
Result of `yarn lint --fix`:
|
||||
```typescript
|
||||
@Component({
|
||||
selector: 'ds-app',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./app.component.scss'],
|
||||
standalone: true,
|
||||
imports: [
|
||||
AsyncPipe,
|
||||
RootComponent,
|
||||
],
|
||||
})
|
||||
export class AppComponent {}
|
||||
```
|
||||
|
||||
|
||||
##### should not put singular imports on one line when maxItems is 0
|
||||
|
||||
```typescript
|
||||
@Component({
|
||||
selector: 'ds-app',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./app.component.scss'],
|
||||
standalone: true,
|
||||
imports: [RootComponent],
|
||||
})
|
||||
export class AppComponent {}
|
||||
|
||||
|
||||
|
||||
```
|
||||
Will produce the following error(s):
|
||||
```
|
||||
Standalone imports should be sorted alphabetically
|
||||
```
|
||||
|
||||
Result of `yarn lint --fix`:
|
||||
```typescript
|
||||
@Component({
|
||||
selector: 'ds-app',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./app.component.scss'],
|
||||
standalone: true,
|
||||
imports: [
|
||||
RootComponent,
|
||||
],
|
||||
})
|
||||
export class AppComponent {}
|
||||
```
|
||||
|
||||
|
||||
##### should not put singular imports on a separate line when maxItems is 1
|
||||
|
||||
```typescript
|
||||
@Component({
|
||||
selector: 'ds-app',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./app.component.scss'],
|
||||
standalone: true,
|
||||
imports: [
|
||||
RootComponent,
|
||||
],
|
||||
})
|
||||
export class AppComponent {}
|
||||
|
||||
|
||||
With options:
|
||||
|
||||
```json
|
||||
{
|
||||
"maxItems": 1
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
```
|
||||
Will produce the following error(s):
|
||||
```
|
||||
Standalone imports should be sorted alphabetically
|
||||
```
|
||||
|
||||
Result of `yarn lint --fix`:
|
||||
```typescript
|
||||
@Component({
|
||||
selector: 'ds-app',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./app.component.scss'],
|
||||
standalone: true,
|
||||
imports: [RootComponent],
|
||||
})
|
||||
export class AppComponent {}
|
||||
```
|
||||
|
||||
|
||||
##### should not display multiple imports on the same line
|
||||
|
||||
```typescript
|
||||
@Component({
|
||||
selector: 'ds-app',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./app.component.scss'],
|
||||
standalone: true,
|
||||
imports: [AsyncPipe, RootComponent],
|
||||
})
|
||||
export class AppComponent {}
|
||||
|
||||
|
||||
|
||||
```
|
||||
Will produce the following error(s):
|
||||
```
|
||||
Standalone imports should be sorted alphabetically
|
||||
```
|
||||
|
||||
Result of `yarn lint --fix`:
|
||||
```typescript
|
||||
@Component({
|
||||
selector: 'ds-app',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./app.component.scss'],
|
||||
standalone: true,
|
||||
imports: [
|
||||
AsyncPipe,
|
||||
RootComponent,
|
||||
],
|
||||
})
|
||||
export class AppComponent {}
|
||||
```
|
||||
|
||||
|
||||
|
@@ -11,6 +11,8 @@ _______
|
||||
|
||||
[Source code](../../../../lint/src/rules/ts/themed-component-classes.ts)
|
||||
|
||||
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@@ -26,6 +28,7 @@ _______
|
||||
class Something {
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
##### Base component
|
||||
|
||||
@@ -34,9 +37,10 @@ class Something {
|
||||
selector: 'ds-base-test-themable',
|
||||
standalone: true,
|
||||
})
|
||||
class TestThemeableTomponent {
|
||||
class TestThemeableComponent {
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
##### Wrapper component
|
||||
|
||||
@@ -50,9 +54,10 @@ Filename: `lint/test/fixture/src/app/test/themed-test-themeable.component.ts`
|
||||
TestThemeableComponent,
|
||||
],
|
||||
})
|
||||
class ThemedTestThemeableTomponent extends ThemedComponent<TestThemeableComponent> {
|
||||
class ThemedTestThemeableComponent extends ThemedComponent<TestThemeableComponent> {
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
##### Override component
|
||||
|
||||
@@ -66,6 +71,7 @@ Filename: `lint/test/fixture/src/themes/test/app/test/test-themeable.component.t
|
||||
class Override extends BaseComponent {
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -80,6 +86,9 @@ class Override extends BaseComponent {
|
||||
})
|
||||
class TestThemeableComponent {
|
||||
}
|
||||
|
||||
|
||||
|
||||
```
|
||||
Will produce the following error(s):
|
||||
```
|
||||
@@ -107,6 +116,9 @@ Filename: `lint/test/fixture/src/app/test/themed-test-themeable.component.ts`
|
||||
})
|
||||
class ThemedTestThemeableComponent extends ThemedComponent<TestThemeableComponent> {
|
||||
}
|
||||
|
||||
|
||||
|
||||
```
|
||||
Will produce the following error(s):
|
||||
```
|
||||
@@ -137,6 +149,9 @@ Filename: `lint/test/fixture/src/app/test/themed-test-themeable.component.ts`
|
||||
})
|
||||
class ThemedTestThemeableComponent extends ThemedComponent<TestThemeableComponent> {
|
||||
}
|
||||
|
||||
|
||||
|
||||
```
|
||||
Will produce the following error(s):
|
||||
```
|
||||
@@ -171,6 +186,9 @@ import { SomethingElse } from './somewhere-else';
|
||||
})
|
||||
class ThemedTestThemeableComponent extends ThemedComponent<TestThemeableComponent> {
|
||||
}
|
||||
|
||||
|
||||
|
||||
```
|
||||
Will produce the following error(s):
|
||||
```
|
||||
@@ -207,6 +225,9 @@ import { Something, SomethingElse } from './somewhere-else';
|
||||
})
|
||||
class ThemedTestThemeableComponent extends ThemedComponent<TestThemeableComponent> {
|
||||
}
|
||||
|
||||
|
||||
|
||||
```
|
||||
Will produce the following error(s):
|
||||
```
|
||||
@@ -237,6 +258,9 @@ Filename: `lint/test/fixture/src/themes/test/app/test/test-themeable.component.t
|
||||
})
|
||||
class Override extends BaseComponent {
|
||||
}
|
||||
|
||||
|
||||
|
||||
```
|
||||
Will produce the following error(s):
|
||||
```
|
||||
|
@@ -17,6 +17,8 @@ _______
|
||||
|
||||
[Source code](../../../../lint/src/rules/ts/themed-component-selectors.ts)
|
||||
|
||||
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@@ -31,6 +33,7 @@ _______
|
||||
class Something {
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
##### Themeable component selector should replace the original version, unthemed version should be changed to ds-base-
|
||||
|
||||
@@ -53,6 +56,7 @@ class ThemedSomething extends ThemedComponent<Something> {
|
||||
class OverrideSomething extends Something {
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
##### Other themed component wrappers should not interfere
|
||||
|
||||
@@ -69,6 +73,7 @@ class Something {
|
||||
class ThemedSomethingElse extends ThemedComponent<SomethingElse> {
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -85,6 +90,9 @@ Filename: `lint/test/fixture/src/app/test/test-themeable.component.ts`
|
||||
})
|
||||
class TestThemeableComponent {
|
||||
}
|
||||
|
||||
|
||||
|
||||
```
|
||||
Will produce the following error(s):
|
||||
```
|
||||
@@ -111,6 +119,9 @@ Filename: `lint/test/fixture/src/app/test/themed-test-themeable.component.ts`
|
||||
})
|
||||
class ThemedTestThemeableComponent extends ThemedComponent<TestThemeableComponent> {
|
||||
}
|
||||
|
||||
|
||||
|
||||
```
|
||||
Will produce the following error(s):
|
||||
```
|
||||
@@ -137,6 +148,9 @@ Filename: `lint/test/fixture/src/themes/test/app/test/test-themeable.component.t
|
||||
})
|
||||
class TestThememeableComponent extends BaseComponent {
|
||||
}
|
||||
|
||||
|
||||
|
||||
```
|
||||
Will produce the following error(s):
|
||||
```
|
||||
|
@@ -15,6 +15,8 @@ _______
|
||||
|
||||
[Source code](../../../../lint/src/rules/ts/themed-component-usages.ts)
|
||||
|
||||
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@@ -30,6 +32,7 @@ const config = {
|
||||
b: ChipsComponent,
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
##### allow base class in class declaration
|
||||
|
||||
@@ -37,6 +40,7 @@ const config = {
|
||||
export class TestThemeableComponent {
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
##### allow inheriting from base class
|
||||
|
||||
@@ -46,6 +50,7 @@ import { TestThemeableComponent } from './app/test/test-themeable.component';
|
||||
export class ThemedAdminSidebarComponent extends ThemedComponent<TestThemeableComponent> {
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
##### allow base class in ViewChild
|
||||
|
||||
@@ -56,6 +61,7 @@ export class Something {
|
||||
@ViewChild(TestThemeableComponent) test: TestThemeableComponent;
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
##### allow wrapper selectors in test queries
|
||||
|
||||
@@ -65,6 +71,7 @@ Filename: `lint/test/fixture/src/app/test/test.component.spec.ts`
|
||||
By.css('ds-themeable');
|
||||
By.css('#test > ds-themeable > #nest');
|
||||
```
|
||||
|
||||
|
||||
##### allow wrapper selectors in cypress queries
|
||||
|
||||
@@ -74,6 +81,7 @@ Filename: `lint/test/fixture/src/app/test/test.component.cy.ts`
|
||||
By.css('ds-themeable');
|
||||
By.css('#test > ds-themeable > #nest');
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -90,6 +98,9 @@ const config = {
|
||||
a: TestThemeableComponent,
|
||||
b: TestComponent,
|
||||
}
|
||||
|
||||
|
||||
|
||||
```
|
||||
Will produce the following error(s):
|
||||
```
|
||||
@@ -120,6 +131,9 @@ const config = {
|
||||
b: TestComponent,
|
||||
c: Something,
|
||||
}
|
||||
|
||||
|
||||
|
||||
```
|
||||
Will produce the following error(s):
|
||||
```
|
||||
@@ -150,6 +164,9 @@ const DECLARATIONS = [
|
||||
Something,
|
||||
ThemedTestThemeableComponent,
|
||||
];
|
||||
|
||||
|
||||
|
||||
```
|
||||
Will produce the following error(s):
|
||||
```
|
||||
@@ -173,6 +190,9 @@ Filename: `lint/test/fixture/src/app/test/test.component.spec.ts`
|
||||
```typescript
|
||||
By.css('ds-themed-themeable');
|
||||
By.css('#test > ds-themed-themeable > #nest');
|
||||
|
||||
|
||||
|
||||
```
|
||||
Will produce the following error(s):
|
||||
```
|
||||
@@ -194,6 +214,9 @@ Filename: `lint/test/fixture/src/app/test/test.component.spec.ts`
|
||||
```typescript
|
||||
By.css('ds-base-themeable');
|
||||
By.css('#test > ds-base-themeable > #nest');
|
||||
|
||||
|
||||
|
||||
```
|
||||
Will produce the following error(s):
|
||||
```
|
||||
@@ -215,6 +238,9 @@ Filename: `lint/test/fixture/src/app/test/test.component.cy.ts`
|
||||
```typescript
|
||||
cy.get('ds-themed-themeable');
|
||||
cy.get('#test > ds-themed-themeable > #nest');
|
||||
|
||||
|
||||
|
||||
```
|
||||
Will produce the following error(s):
|
||||
```
|
||||
@@ -236,6 +262,9 @@ Filename: `lint/test/fixture/src/app/test/test.component.cy.ts`
|
||||
```typescript
|
||||
cy.get('ds-base-themeable');
|
||||
cy.get('#test > ds-base-themeable > #nest');
|
||||
|
||||
|
||||
|
||||
```
|
||||
Will produce the following error(s):
|
||||
```
|
||||
@@ -266,6 +295,9 @@ import { TestThemeableComponent } from '../../../../app/test/test-themeable.comp
|
||||
})
|
||||
export class UsageComponent {
|
||||
}
|
||||
|
||||
|
||||
|
||||
```
|
||||
Will produce the following error(s):
|
||||
```
|
||||
@@ -306,6 +338,9 @@ import { ThemedTestThemeableComponent } from '../../../../app/test/themed-test-t
|
||||
})
|
||||
export class UsageComponent {
|
||||
}
|
||||
|
||||
|
||||
|
||||
```
|
||||
Will produce the following error(s):
|
||||
```
|
||||
|
183
docs/lint/ts/rules/themed-decorators.md
Normal file
183
docs/lint/ts/rules/themed-decorators.md
Normal file
@@ -0,0 +1,183 @@
|
||||
[DSpace ESLint plugins](../../../../lint/README.md) > [TypeScript rules](../index.md) > `dspace-angular-ts/themed-decorators`
|
||||
_______
|
||||
|
||||
Entry components with theme support should declare the correct theme
|
||||
|
||||
_______
|
||||
|
||||
[Source code](../../../../lint/src/rules/ts/themed-decorators.ts)
|
||||
|
||||
|
||||
### Options
|
||||
|
||||
#### `decorators`
|
||||
|
||||
A mapping for all the existing themeable decorators, with the decorator name as the key and the index of the `theme` argument as the value.
|
||||
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
#### Valid code
|
||||
|
||||
##### theme file declares the correct theme in @listableObjectComponent
|
||||
|
||||
Filename: `lint/test/fixture/src/themes/test/app/dynamic-component/dynamic-component.ts`
|
||||
|
||||
```typescript
|
||||
@listableObjectComponent(something, somethingElse, undefined, 'test')
|
||||
export class Something extends SomethingElse {
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
##### plain file declares no theme in @listableObjectComponent
|
||||
|
||||
Filename: `lint/test/fixture/src/app/dynamic-component/dynamic-component.ts`
|
||||
|
||||
```typescript
|
||||
@listableObjectComponent(something, somethingElse, undefined)
|
||||
export class Something extends SomethingElse {
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
##### plain file declares explicit undefined theme in @listableObjectComponent
|
||||
|
||||
Filename: `lint/test/fixture/src/app/dynamic-component/dynamic-component.ts`
|
||||
|
||||
```typescript
|
||||
@listableObjectComponent(something, somethingElse, undefined, undefined)
|
||||
export class Something extends SomethingElse {
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
##### test file declares theme outside of theme directory
|
||||
|
||||
Filename: `lint/test/fixture/src/app/dynamic-component/dynamic-component.spec.ts`
|
||||
|
||||
```typescript
|
||||
@listableObjectComponent(something, somethingElse, undefined, 'test')
|
||||
export class Something extends SomethingElse {
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
##### only track configured decorators
|
||||
|
||||
Filename: `lint/test/fixture/src/app/dynamic-component/dynamic-component.ts`
|
||||
|
||||
```typescript
|
||||
@something('test')
|
||||
export class Something extends SomethingElse {
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#### Invalid code & automatic fixes
|
||||
|
||||
##### theme file declares the wrong theme in @listableObjectComponent
|
||||
|
||||
Filename: `lint/test/fixture/src/themes/test/app/dynamic-component/dynamic-component.ts`
|
||||
|
||||
```typescript
|
||||
@listableObjectComponent(something, somethingElse, undefined, 'test-2')
|
||||
export class Something extends SomethingElse {
|
||||
}
|
||||
|
||||
|
||||
|
||||
```
|
||||
Will produce the following error(s):
|
||||
```
|
||||
Wrong theme declaration in decorator
|
||||
```
|
||||
|
||||
Result of `yarn lint --fix`:
|
||||
```typescript
|
||||
@listableObjectComponent(something, somethingElse, undefined, 'test')
|
||||
export class Something extends SomethingElse {
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
##### plain file declares a theme in @listableObjectComponent
|
||||
|
||||
Filename: `lint/test/fixture/src/app/dynamic-component/dynamic-component.ts`
|
||||
|
||||
```typescript
|
||||
@listableObjectComponent(something, somethingElse, undefined, 'test-2')
|
||||
export class Something extends SomethingElse {
|
||||
}
|
||||
|
||||
|
||||
|
||||
```
|
||||
Will produce the following error(s):
|
||||
```
|
||||
There is a theme declaration in decorator, but this file is not part of a theme
|
||||
```
|
||||
|
||||
Result of `yarn lint --fix`:
|
||||
```typescript
|
||||
@listableObjectComponent(something, somethingElse, undefined)
|
||||
export class Something extends SomethingElse {
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
##### theme file declares no theme in @listableObjectComponent
|
||||
|
||||
Filename: `lint/test/fixture/src/themes/test-2/app/dynamic-component/dynamic-component.ts`
|
||||
|
||||
```typescript
|
||||
@listableObjectComponent(something, somethingElse, undefined)
|
||||
export class Something extends SomethingElse {
|
||||
}
|
||||
|
||||
|
||||
|
||||
```
|
||||
Will produce the following error(s):
|
||||
```
|
||||
No theme declaration in decorator
|
||||
```
|
||||
|
||||
Result of `yarn lint --fix`:
|
||||
```typescript
|
||||
@listableObjectComponent(something, somethingElse, undefined, 'test-2')
|
||||
export class Something extends SomethingElse {
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
##### theme file declares explicit undefined theme in @listableObjectComponent
|
||||
|
||||
Filename: `lint/test/fixture/src/themes/test-2/app/dynamic-component/dynamic-component.ts`
|
||||
|
||||
```typescript
|
||||
@listableObjectComponent(something, somethingElse, undefined, undefined)
|
||||
export class Something extends SomethingElse {
|
||||
}
|
||||
|
||||
|
||||
|
||||
```
|
||||
Will produce the following error(s):
|
||||
```
|
||||
No theme declaration in decorator
|
||||
```
|
||||
|
||||
Result of `yarn lint --fix`:
|
||||
```typescript
|
||||
@listableObjectComponent(something, somethingElse, undefined, 'test-2')
|
||||
export class Something extends SomethingElse {
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
92
docs/lint/ts/rules/themed-wrapper-no-input-defaults.md
Normal file
92
docs/lint/ts/rules/themed-wrapper-no-input-defaults.md
Normal file
@@ -0,0 +1,92 @@
|
||||
[DSpace ESLint plugins](../../../../lint/README.md) > [TypeScript rules](../index.md) > `dspace-angular-ts/themed-wrapper-no-input-defaults`
|
||||
_______
|
||||
|
||||
ThemedComponent wrappers should not declare input defaults (see [DSpace Angular #2164](https://github.com/DSpace/dspace-angular/pull/2164))
|
||||
|
||||
_______
|
||||
|
||||
[Source code](../../../../lint/src/rules/ts/themed-wrapper-no-input-defaults.ts)
|
||||
|
||||
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
#### Valid code
|
||||
|
||||
##### ThemedComponent wrapper defines an input without a default value
|
||||
|
||||
```typescript
|
||||
export class TTest extends ThemedComponent<Test> {
|
||||
|
||||
@Input()
|
||||
test;
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
##### Regular class defines an input with a default value
|
||||
|
||||
```typescript
|
||||
export class Test {
|
||||
|
||||
@Input()
|
||||
test = 'test';
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#### Invalid code
|
||||
|
||||
##### ThemedComponent wrapper defines an input with a default value
|
||||
|
||||
```typescript
|
||||
export class TTest extends ThemedComponent<Test> {
|
||||
|
||||
@Input()
|
||||
test1 = 'test';
|
||||
|
||||
@Input()
|
||||
test2 = true;
|
||||
|
||||
@Input()
|
||||
test2: number = 123;
|
||||
|
||||
@Input()
|
||||
test3: number[] = [1,2,3];
|
||||
}
|
||||
|
||||
|
||||
|
||||
```
|
||||
Will produce the following error(s):
|
||||
```
|
||||
ThemedComponent wrapper declares inputs with defaults
|
||||
ThemedComponent wrapper declares inputs with defaults
|
||||
ThemedComponent wrapper declares inputs with defaults
|
||||
ThemedComponent wrapper declares inputs with defaults
|
||||
```
|
||||
|
||||
|
||||
##### ThemedComponent wrapper defines an input with an undefined default value
|
||||
|
||||
```typescript
|
||||
export class TTest extends ThemedComponent<Test> {
|
||||
|
||||
@Input()
|
||||
test = undefined;
|
||||
}
|
||||
|
||||
|
||||
|
||||
```
|
||||
Will produce the following error(s):
|
||||
```
|
||||
ThemedComponent wrapper declares inputs with defaults
|
||||
```
|
||||
|
||||
|
||||
|
86
docs/lint/ts/rules/unique-decorators.md
Normal file
86
docs/lint/ts/rules/unique-decorators.md
Normal file
@@ -0,0 +1,86 @@
|
||||
[DSpace ESLint plugins](../../../../lint/README.md) > [TypeScript rules](../index.md) > `dspace-angular-ts/unique-decorators`
|
||||
_______
|
||||
|
||||
Some decorators must be called with unique arguments (e.g. when they construct a mapping based on the argument values)
|
||||
|
||||
_______
|
||||
|
||||
[Source code](../../../../lint/src/rules/ts/unique-decorators.ts)
|
||||
|
||||
|
||||
### Options
|
||||
|
||||
#### `decorators`
|
||||
|
||||
The list of all the decorators for which you want to enforce this behavior.
|
||||
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
#### Valid code
|
||||
|
||||
##### checked decorator, no repetitions
|
||||
|
||||
```typescript
|
||||
@listableObjectComponent(a)
|
||||
export class A {
|
||||
}
|
||||
|
||||
@listableObjectComponent(a, 'b')
|
||||
export class B {
|
||||
}
|
||||
|
||||
@listableObjectComponent(a, 'b', 3)
|
||||
export class C {
|
||||
}
|
||||
|
||||
@listableObjectComponent(a, 'b', 3, Enum.TEST1)
|
||||
export class C {
|
||||
}
|
||||
|
||||
@listableObjectComponent(a, 'b', 3, Enum.TEST2)
|
||||
export class C {
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
##### unchecked decorator, some repetitions
|
||||
|
||||
```typescript
|
||||
@something(a)
|
||||
export class A {
|
||||
}
|
||||
|
||||
@something(a)
|
||||
export class B {
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#### Invalid code
|
||||
|
||||
##### checked decorator, some repetitions
|
||||
|
||||
```typescript
|
||||
@listableObjectComponent(a)
|
||||
export class A {
|
||||
}
|
||||
|
||||
@listableObjectComponent(a)
|
||||
export class B {
|
||||
}
|
||||
|
||||
|
||||
|
||||
```
|
||||
Will produce the following error(s):
|
||||
```
|
||||
Duplicate decorator call
|
||||
```
|
||||
|
||||
|
||||
|
@@ -33,6 +33,7 @@ export const info = {
|
||||
[Message.USE_DSBTN_DISABLED]: 'Buttons should use the `dsBtnDisabled` directive instead of the `disabled` attribute.',
|
||||
},
|
||||
},
|
||||
optionDocs: [],
|
||||
defaultOptions: [],
|
||||
} as DSpaceESLintRuleInfo;
|
||||
|
||||
|
@@ -45,6 +45,7 @@ The only exception to this rule are unit tests, where we may want to use the bas
|
||||
[Message.WRONG_SELECTOR]: 'Themeable components should be used via their ThemedComponent wrapper\'s selector',
|
||||
},
|
||||
},
|
||||
optionDocs: [],
|
||||
defaultOptions: [],
|
||||
} as DSpaceESLintRuleInfo;
|
||||
|
||||
|
304
lint/src/rules/ts/alias-imports.ts
Normal file
304
lint/src/rules/ts/alias-imports.ts
Normal file
@@ -0,0 +1,304 @@
|
||||
import {
|
||||
AST_NODE_TYPES,
|
||||
ESLintUtils,
|
||||
TSESLint,
|
||||
TSESTree,
|
||||
} from '@typescript-eslint/utils';
|
||||
import { Scope } from '@typescript-eslint/utils/ts-eslint';
|
||||
|
||||
import {
|
||||
DSpaceESLintRuleInfo,
|
||||
NamedTests,
|
||||
OptionDoc,
|
||||
} from '../../util/structure';
|
||||
|
||||
export enum Message {
|
||||
MISSING_ALIAS = 'missingAlias',
|
||||
WRONG_ALIAS = 'wrongAlias',
|
||||
MULTIPLE_ALIASES = 'multipleAliases',
|
||||
UNNECESSARY_ALIAS = 'unnecessaryAlias',
|
||||
}
|
||||
|
||||
interface AliasImportOptions {
|
||||
aliases: AliasImportOption[];
|
||||
}
|
||||
|
||||
interface AliasImportOption {
|
||||
package: string;
|
||||
imported: string;
|
||||
local: string;
|
||||
}
|
||||
|
||||
interface AliasImportDocOptions {
|
||||
aliases: OptionDoc;
|
||||
}
|
||||
|
||||
export const info: DSpaceESLintRuleInfo<[AliasImportOptions], [AliasImportDocOptions]> = {
|
||||
name: 'alias-imports',
|
||||
meta: {
|
||||
docs: {
|
||||
description: 'Unclear imports should be aliased for clarity',
|
||||
},
|
||||
messages: {
|
||||
[Message.MISSING_ALIAS]: 'This import must be aliased',
|
||||
[Message.WRONG_ALIAS]: 'This import uses the wrong alias (should be {{ local }})',
|
||||
[Message.MULTIPLE_ALIASES]: 'This import was used twice with a different alias (should be {{ local }})',
|
||||
[Message.UNNECESSARY_ALIAS]: 'This import should not use an alias',
|
||||
},
|
||||
fixable: 'code',
|
||||
type: 'problem',
|
||||
schema: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
package: { type: 'string' },
|
||||
imported: { type: 'string' },
|
||||
local: { type: 'string' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
optionDocs: [
|
||||
{
|
||||
aliases: {
|
||||
title: '`aliases`',
|
||||
description: `A list of all the imports that you want to alias for clarity. Every alias should be declared in the following format:
|
||||
\`\`\`json
|
||||
{
|
||||
"package": "rxjs",
|
||||
"imported": "of",
|
||||
"local": "observableOf"
|
||||
}
|
||||
\`\`\``,
|
||||
},
|
||||
},
|
||||
],
|
||||
defaultOptions: [
|
||||
{
|
||||
aliases: [
|
||||
{
|
||||
package: 'rxjs',
|
||||
imported: 'of',
|
||||
local: 'observableOf',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export const rule = ESLintUtils.RuleCreator.withoutDocs({
|
||||
...info,
|
||||
create(context: TSESLint.RuleContext<Message, unknown[]>, options: any) {
|
||||
return (options[0] as AliasImportOptions).aliases.reduce((selectors: any, option: AliasImportOption) => {
|
||||
selectors[`ImportDeclaration[source.value = "${option.package}"] > ImportSpecifier[imported.name = "${option.imported}"][local.name != "${option.local}"]`] = (node: TSESTree.ImportSpecifier) => handleUnaliasedImport(context, option, node);
|
||||
return selectors;
|
||||
}, {});
|
||||
},
|
||||
});
|
||||
|
||||
export const tests: NamedTests = {
|
||||
plugin: info.name,
|
||||
valid: [
|
||||
{
|
||||
name: 'correctly aliased imports',
|
||||
code: `
|
||||
import { of as observableOf } from 'rxjs';
|
||||
`,
|
||||
options: [
|
||||
{
|
||||
aliases: [
|
||||
{
|
||||
package: 'rxjs',
|
||||
imported: 'of',
|
||||
local: 'observableOf',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'enforce unaliased import',
|
||||
code: `
|
||||
import { combineLatest } from 'rxjs';
|
||||
`,
|
||||
options: [
|
||||
{
|
||||
aliases: [
|
||||
{
|
||||
package: 'rxjs',
|
||||
imported: 'combineLatest',
|
||||
local: 'combineLatest',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
invalid: [
|
||||
{
|
||||
name: 'imports without alias',
|
||||
code: `
|
||||
import { of } from 'rxjs';
|
||||
`,
|
||||
errors: [
|
||||
{
|
||||
messageId: 'missingAlias',
|
||||
},
|
||||
],
|
||||
output: `
|
||||
import { of as observableOf } from 'rxjs';
|
||||
`,
|
||||
},
|
||||
{
|
||||
name: 'imports under the wrong alias',
|
||||
code: `
|
||||
import { of as ofSomething } from 'rxjs';
|
||||
`,
|
||||
errors: [
|
||||
{
|
||||
messageId: 'wrongAlias',
|
||||
},
|
||||
],
|
||||
output: `
|
||||
import { of as observableOf } from 'rxjs';
|
||||
`,
|
||||
},
|
||||
{
|
||||
name: 'disallow aliasing import',
|
||||
code: `
|
||||
import { combineLatest as observableCombineLatest } from 'rxjs';
|
||||
`,
|
||||
errors: [
|
||||
{
|
||||
messageId: 'unnecessaryAlias',
|
||||
},
|
||||
],
|
||||
output: `
|
||||
import { combineLatest } from 'rxjs';
|
||||
`,
|
||||
options: [
|
||||
{
|
||||
aliases: [
|
||||
{
|
||||
package: 'rxjs',
|
||||
imported: 'combineLatest',
|
||||
local: 'combineLatest',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
/**
|
||||
* Replaces the incorrectly aliased imports with the ones defined in the defaultOptions
|
||||
*
|
||||
* @param context The current {@link TSESLint.RuleContext}
|
||||
* @param option The current {@link AliasImportOption} that needs to be handled
|
||||
* @param node The incorrect import node that should be fixed
|
||||
*/
|
||||
function handleUnaliasedImport(context: TSESLint.RuleContext<Message, unknown[]>, option: AliasImportOption, node: TSESTree.ImportSpecifier): void {
|
||||
const hasCorrectAliasedImport: boolean = (node.parent as TSESTree.ImportDeclaration).specifiers.find((specifier: TSESTree.ImportClause) => specifier.local.name === option.local && specifier.type === AST_NODE_TYPES.ImportSpecifier && (specifier as TSESTree.ImportSpecifier).imported.name === option.imported) !== undefined;
|
||||
if (option.imported === option.local) {
|
||||
if (hasCorrectAliasedImport) {
|
||||
context.report({
|
||||
messageId: Message.MULTIPLE_ALIASES,
|
||||
data: { local: option.local },
|
||||
node: node,
|
||||
fix(fixer: TSESLint.RuleFixer) {
|
||||
const fixes: TSESLint.RuleFix[] = [];
|
||||
|
||||
const commaAfter = context.sourceCode.getTokenAfter(node, {
|
||||
filter: (token: TSESTree.Token) => token.value === ',',
|
||||
});
|
||||
if (commaAfter) {
|
||||
fixes.push(fixer.removeRange([node.range[0], commaAfter.range[1]]));
|
||||
} else {
|
||||
fixes.push(fixer.remove(node));
|
||||
}
|
||||
fixes.push(...retrieveUsageReplacementFixes(context, fixer, node, option.local));
|
||||
|
||||
return fixes;
|
||||
},
|
||||
});
|
||||
} else {
|
||||
context.report({
|
||||
messageId: Message.UNNECESSARY_ALIAS,
|
||||
data: { local: option.local },
|
||||
node: node,
|
||||
fix(fixer: TSESLint.RuleFixer) {
|
||||
const fixes: TSESLint.RuleFix[] = [];
|
||||
|
||||
fixes.push(fixer.replaceText(node, option.imported));
|
||||
fixes.push(...retrieveUsageReplacementFixes(context, fixer, node, option.local));
|
||||
|
||||
return fixes;
|
||||
},
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (hasCorrectAliasedImport) {
|
||||
context.report({
|
||||
messageId: Message.MULTIPLE_ALIASES,
|
||||
data: { local: option.local },
|
||||
node: node,
|
||||
fix(fixer: TSESLint.RuleFixer) {
|
||||
const fixes: TSESLint.RuleFix[] = [];
|
||||
|
||||
const commaAfter = context.sourceCode.getTokenAfter(node, {
|
||||
filter: (token: TSESTree.Token) => token.value === ',',
|
||||
});
|
||||
if (commaAfter) {
|
||||
fixes.push(fixer.removeRange([node.range[0], commaAfter.range[1]]));
|
||||
} else {
|
||||
fixes.push(fixer.remove(node));
|
||||
}
|
||||
fixes.push(...retrieveUsageReplacementFixes(context, fixer, node, option.local));
|
||||
|
||||
return fixes;
|
||||
},
|
||||
});
|
||||
} else if (node.local.name === node.imported.name) {
|
||||
context.report({
|
||||
messageId: Message.MISSING_ALIAS,
|
||||
node: node,
|
||||
fix(fixer: TSESLint.RuleFixer) {
|
||||
const fixes: TSESLint.RuleFix[] = [];
|
||||
|
||||
fixes.push(fixer.replaceText(node.local, `${option.imported} as ${option.local}`));
|
||||
fixes.push(...retrieveUsageReplacementFixes(context, fixer, node, option.local));
|
||||
|
||||
return fixes;
|
||||
},
|
||||
});
|
||||
} else {
|
||||
context.report({
|
||||
messageId: Message.WRONG_ALIAS,
|
||||
data: { local: option.local },
|
||||
node: node,
|
||||
fix(fixer: TSESLint.RuleFixer) {
|
||||
const fixes: TSESLint.RuleFix[] = [];
|
||||
|
||||
fixes.push(fixer.replaceText(node.local, option.local));
|
||||
fixes.push(...retrieveUsageReplacementFixes(context, fixer, node, option.local));
|
||||
|
||||
return fixes;
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates the {@link TSESLint.RuleFix}s for all the usages of the incorrect import.
|
||||
*
|
||||
* @param context The current {@link TSESLint.RuleContext}
|
||||
* @param fixer The instance {@link TSESLint.RuleFixer}
|
||||
* @param node The node which needs to be replaced
|
||||
* @param newAlias The new import name
|
||||
*/
|
||||
function retrieveUsageReplacementFixes(context: TSESLint.RuleContext<Message, unknown[]>, fixer: TSESLint.RuleFixer, node: TSESTree.ImportSpecifier, newAlias: string): TSESLint.RuleFix[] {
|
||||
return context.sourceCode.getDeclaredVariables(node)[0].references.map((reference: Scope.Reference) => fixer.replaceText(reference.identifier, newAlias));
|
||||
}
|
@@ -10,14 +10,24 @@ import {
|
||||
RuleExports,
|
||||
} from '../../util/structure';
|
||||
/* eslint-disable import/no-namespace */
|
||||
import * as aliasImports from './alias-imports';
|
||||
import * as sortStandaloneImports from './sort-standalone-imports';
|
||||
import * as themedComponentClasses from './themed-component-classes';
|
||||
import * as themedComponentSelectors from './themed-component-selectors';
|
||||
import * as themedComponentUsages from './themed-component-usages';
|
||||
import * as themedDecorators from './themed-decorators';
|
||||
import * as themedWrapperNoInputDefaults from './themed-wrapper-no-input-defaults';
|
||||
import * as uniqueDecorators from './unique-decorators';
|
||||
|
||||
const index = [
|
||||
aliasImports,
|
||||
sortStandaloneImports,
|
||||
themedComponentClasses,
|
||||
themedComponentSelectors,
|
||||
themedComponentUsages,
|
||||
themedDecorators,
|
||||
themedWrapperNoInputDefaults,
|
||||
uniqueDecorators,
|
||||
] as unknown as RuleExports[];
|
||||
|
||||
export = {
|
||||
|
306
lint/src/rules/ts/sort-standalone-imports.ts
Normal file
306
lint/src/rules/ts/sort-standalone-imports.ts
Normal file
@@ -0,0 +1,306 @@
|
||||
import {
|
||||
ASTUtils as TSESLintASTUtils,
|
||||
ESLintUtils,
|
||||
TSESLint,
|
||||
TSESTree,
|
||||
} from '@typescript-eslint/utils';
|
||||
|
||||
import {
|
||||
DSpaceESLintRuleInfo,
|
||||
NamedTests,
|
||||
OptionDoc,
|
||||
} from '../../util/structure';
|
||||
|
||||
const DEFAULT_LOCALE = 'en-US';
|
||||
const DEFAULT_MAX_SIZE = 0;
|
||||
const DEFAULT_SPACE_INDENT_AMOUNT = 2;
|
||||
const DEFAULT_TRAILING_COMMA = true;
|
||||
|
||||
export enum Message {
|
||||
SORT_STANDALONE_IMPORTS_ARRAYS = 'sortStandaloneImportsArrays',
|
||||
}
|
||||
|
||||
export interface UniqueDecoratorsOptions {
|
||||
locale: string;
|
||||
maxItems: number;
|
||||
indent: number;
|
||||
trailingComma: boolean;
|
||||
}
|
||||
|
||||
export interface UniqueDecoratorsDocOptions {
|
||||
locale: OptionDoc;
|
||||
maxItems: OptionDoc;
|
||||
indent: OptionDoc;
|
||||
trailingComma: OptionDoc;
|
||||
}
|
||||
|
||||
export const info: DSpaceESLintRuleInfo<[UniqueDecoratorsOptions], [UniqueDecoratorsDocOptions]> = {
|
||||
name: 'sort-standalone-imports',
|
||||
meta: {
|
||||
docs: {
|
||||
description: 'Sorts the standalone `@Component` imports alphabetically',
|
||||
},
|
||||
messages: {
|
||||
[Message.SORT_STANDALONE_IMPORTS_ARRAYS]: 'Standalone imports should be sorted alphabetically',
|
||||
},
|
||||
fixable: 'code',
|
||||
type: 'problem',
|
||||
schema: [
|
||||
{
|
||||
type: 'object',
|
||||
properties: {
|
||||
locale: {
|
||||
type: 'string',
|
||||
},
|
||||
maxItems: {
|
||||
type: 'number',
|
||||
},
|
||||
indent: {
|
||||
type: 'number',
|
||||
},
|
||||
trailingComma: {
|
||||
type: 'boolean',
|
||||
},
|
||||
},
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
optionDocs: [
|
||||
{
|
||||
locale: {
|
||||
title: '`locale`',
|
||||
description: 'The locale used to sort the imports.',
|
||||
},
|
||||
maxItems: {
|
||||
title: '`maxItems`',
|
||||
description: 'The maximum number of imports that should be displayed before each import is separated onto its own line.',
|
||||
},
|
||||
indent: {
|
||||
title: '`indent`',
|
||||
description: 'The indent used for the project.',
|
||||
},
|
||||
trailingComma: {
|
||||
title: '`trailingComma`',
|
||||
description: 'Whether the last import should have a trailing comma (only applicable for multiline imports).',
|
||||
},
|
||||
},
|
||||
],
|
||||
defaultOptions: [
|
||||
{
|
||||
locale: DEFAULT_LOCALE,
|
||||
maxItems: DEFAULT_MAX_SIZE,
|
||||
indent: DEFAULT_SPACE_INDENT_AMOUNT,
|
||||
trailingComma: DEFAULT_TRAILING_COMMA,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export const rule = ESLintUtils.RuleCreator.withoutDocs({
|
||||
...info,
|
||||
create(context: TSESLint.RuleContext<Message, unknown[]>, [{ locale, maxItems, indent, trailingComma }]: any) {
|
||||
return {
|
||||
['ClassDeclaration > Decorator > CallExpression[callee.name="Component"] > ObjectExpression > Property[key.name="imports"] > ArrayExpression']: (node: TSESTree.ArrayExpression) => {
|
||||
const elements = node.elements.filter((element) => element !== null && (TSESLintASTUtils.isIdentifier(element) || element?.type === TSESTree.AST_NODE_TYPES.CallExpression));
|
||||
const sortedNames: string[] = elements
|
||||
.map((element) => context.sourceCode.getText(element!))
|
||||
.sort((a: string, b: string) => a.localeCompare(b, locale));
|
||||
|
||||
const isSorted: boolean = elements.every((identifier, index) => context.sourceCode.getText(identifier!) === sortedNames[index]);
|
||||
|
||||
const requiresMultiline: boolean = maxItems < node.elements.length;
|
||||
const isMultiline: boolean = /\n/.test(context.sourceCode.getText(node));
|
||||
|
||||
const incorrectFormat: boolean = requiresMultiline !== isMultiline;
|
||||
|
||||
if (isSorted && !incorrectFormat) {
|
||||
return;
|
||||
}
|
||||
|
||||
context.report({
|
||||
node: node.parent,
|
||||
messageId: Message.SORT_STANDALONE_IMPORTS_ARRAYS,
|
||||
fix: (fixer: TSESLint.RuleFixer) => {
|
||||
if (requiresMultiline) {
|
||||
const multilineImports: string = sortedNames
|
||||
.map((name: string) => `${' '.repeat(2 * indent)}${name}${trailingComma ? ',' : ''}`)
|
||||
.join(trailingComma ? '\n' : ',\n');
|
||||
|
||||
return fixer.replaceText(node, `[\n${multilineImports}\n${' '.repeat(indent)}]`);
|
||||
} else {
|
||||
return fixer.replaceText(node, `[${sortedNames.join(', ')}]`);
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
export const tests: NamedTests = {
|
||||
plugin: info.name,
|
||||
valid: [
|
||||
{
|
||||
name: 'should sort multiple imports on separate lines',
|
||||
code: `
|
||||
@Component({
|
||||
selector: 'ds-app',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./app.component.scss'],
|
||||
standalone: true,
|
||||
imports: [
|
||||
AsyncPipe,
|
||||
RootComponent,
|
||||
],
|
||||
})
|
||||
export class AppComponent {}`,
|
||||
},
|
||||
{
|
||||
name: 'should not inlines singular imports when maxItems is 0',
|
||||
code: `
|
||||
@Component({
|
||||
selector: 'ds-app',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./app.component.scss'],
|
||||
standalone: true,
|
||||
imports: [
|
||||
RootComponent,
|
||||
],
|
||||
})
|
||||
export class AppComponent {}`,
|
||||
},
|
||||
{
|
||||
name: 'should inline singular imports when maxItems is 1',
|
||||
options: [{ maxItems: 1 }],
|
||||
code: `
|
||||
@Component({
|
||||
selector: 'ds-app',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./app.component.scss'],
|
||||
standalone: true,
|
||||
imports: [RootComponent],
|
||||
})
|
||||
export class AppComponent {}`,
|
||||
},
|
||||
],
|
||||
invalid: [
|
||||
{
|
||||
name: 'should sort multiple imports alphabetically',
|
||||
code: `
|
||||
@Component({
|
||||
selector: 'ds-app',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./app.component.scss'],
|
||||
standalone: true,
|
||||
imports: [
|
||||
RootComponent,
|
||||
AsyncPipe,
|
||||
],
|
||||
})
|
||||
export class AppComponent {}`,
|
||||
errors: [
|
||||
{
|
||||
messageId: Message.SORT_STANDALONE_IMPORTS_ARRAYS,
|
||||
},
|
||||
],
|
||||
output: `
|
||||
@Component({
|
||||
selector: 'ds-app',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./app.component.scss'],
|
||||
standalone: true,
|
||||
imports: [
|
||||
AsyncPipe,
|
||||
RootComponent,
|
||||
],
|
||||
})
|
||||
export class AppComponent {}`,
|
||||
},
|
||||
{
|
||||
name: 'should not put singular imports on one line when maxItems is 0',
|
||||
code: `
|
||||
@Component({
|
||||
selector: 'ds-app',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./app.component.scss'],
|
||||
standalone: true,
|
||||
imports: [RootComponent],
|
||||
})
|
||||
export class AppComponent {}`,
|
||||
errors: [
|
||||
{
|
||||
messageId: Message.SORT_STANDALONE_IMPORTS_ARRAYS,
|
||||
},
|
||||
],
|
||||
output: `
|
||||
@Component({
|
||||
selector: 'ds-app',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./app.component.scss'],
|
||||
standalone: true,
|
||||
imports: [
|
||||
RootComponent,
|
||||
],
|
||||
})
|
||||
export class AppComponent {}`,
|
||||
},
|
||||
{
|
||||
name: 'should not put singular imports on a separate line when maxItems is 1',
|
||||
options: [{ maxItems: 1 }],
|
||||
code: `
|
||||
@Component({
|
||||
selector: 'ds-app',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./app.component.scss'],
|
||||
standalone: true,
|
||||
imports: [
|
||||
RootComponent,
|
||||
],
|
||||
})
|
||||
export class AppComponent {}`,
|
||||
errors: [
|
||||
{
|
||||
messageId: Message.SORT_STANDALONE_IMPORTS_ARRAYS,
|
||||
},
|
||||
],
|
||||
output: `
|
||||
@Component({
|
||||
selector: 'ds-app',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./app.component.scss'],
|
||||
standalone: true,
|
||||
imports: [RootComponent],
|
||||
})
|
||||
export class AppComponent {}`,
|
||||
},
|
||||
{
|
||||
name: 'should not display multiple imports on the same line',
|
||||
code: `
|
||||
@Component({
|
||||
selector: 'ds-app',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./app.component.scss'],
|
||||
standalone: true,
|
||||
imports: [AsyncPipe, RootComponent],
|
||||
})
|
||||
export class AppComponent {}`,
|
||||
errors: [
|
||||
{
|
||||
messageId: Message.SORT_STANDALONE_IMPORTS_ARRAYS,
|
||||
},
|
||||
],
|
||||
output: `
|
||||
@Component({
|
||||
selector: 'ds-app',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./app.component.scss'],
|
||||
standalone: true,
|
||||
imports: [
|
||||
AsyncPipe,
|
||||
RootComponent,
|
||||
],
|
||||
})
|
||||
export class AppComponent {}`,
|
||||
},
|
||||
],
|
||||
};
|
@@ -52,6 +52,7 @@ export const info = {
|
||||
[Message.WRAPPER_IMPORTS_BASE]: 'Themed component wrapper classes must only import the base class',
|
||||
},
|
||||
},
|
||||
optionDocs: [],
|
||||
defaultOptions: [],
|
||||
} as DSpaceESLintRuleInfo;
|
||||
|
||||
@@ -180,7 +181,7 @@ class Something {
|
||||
selector: 'ds-base-test-themable',
|
||||
standalone: true,
|
||||
})
|
||||
class TestThemeableTomponent {
|
||||
class TestThemeableComponent {
|
||||
}
|
||||
`,
|
||||
},
|
||||
@@ -195,7 +196,7 @@ class TestThemeableTomponent {
|
||||
TestThemeableComponent,
|
||||
],
|
||||
})
|
||||
class ThemedTestThemeableTomponent extends ThemedComponent<TestThemeableComponent> {
|
||||
class ThemedTestThemeableComponent extends ThemedComponent<TestThemeableComponent> {
|
||||
}
|
||||
`,
|
||||
},
|
||||
|
@@ -53,6 +53,7 @@ Unit tests are exempt from this rule, because they may redefine components using
|
||||
[Message.THEMED]: 'Theme override of themeable component should have a selector starting with \'ds-themed-\'',
|
||||
},
|
||||
},
|
||||
optionDocs: [],
|
||||
defaultOptions: [],
|
||||
} as DSpaceESLintRuleInfo;
|
||||
|
||||
|
@@ -63,6 +63,7 @@ There are a few exceptions where the base class can still be used:
|
||||
[Message.BASE_IN_MODULE]: 'Base themeable components shouldn\'t be declared in modules',
|
||||
},
|
||||
},
|
||||
optionDocs: [],
|
||||
defaultOptions: [],
|
||||
} as DSpaceESLintRuleInfo;
|
||||
|
||||
|
280
lint/src/rules/ts/themed-decorators.ts
Normal file
280
lint/src/rules/ts/themed-decorators.ts
Normal file
@@ -0,0 +1,280 @@
|
||||
import {
|
||||
AST_NODE_TYPES,
|
||||
ESLintUtils,
|
||||
TSESLint,
|
||||
TSESTree,
|
||||
} from '@typescript-eslint/utils';
|
||||
|
||||
import { fixture } from '../../../test/fixture';
|
||||
import { isTestFile } from '../../util/filter';
|
||||
import {
|
||||
DSpaceESLintRuleInfo,
|
||||
NamedTests,
|
||||
OptionDoc,
|
||||
} from '../../util/structure';
|
||||
import { getFileTheme } from '../../util/theme-support';
|
||||
|
||||
export enum Message {
|
||||
NO_THEME_DECLARED_IN_THEME_FILE = 'noThemeDeclaredInThemeFile',
|
||||
THEME_DECLARED_IN_NON_THEME_FILE = 'themeDeclaredInNonThemeFile',
|
||||
WRONG_THEME_DECLARED_IN_THEME_FILE = 'wrongThemeDeclaredInThemeFile',
|
||||
}
|
||||
|
||||
interface ThemedDecoratorsOption {
|
||||
decorators: { [name: string]: number };
|
||||
}
|
||||
|
||||
interface ThemedDecoratorsDocsOption {
|
||||
decorators: OptionDoc;
|
||||
}
|
||||
|
||||
export const info: DSpaceESLintRuleInfo<[ThemedDecoratorsOption], [ThemedDecoratorsDocsOption]> = {
|
||||
name: 'themed-decorators',
|
||||
meta: {
|
||||
docs: {
|
||||
description: 'Entry components with theme support should declare the correct theme',
|
||||
},
|
||||
fixable: 'code',
|
||||
messages: {
|
||||
[Message.NO_THEME_DECLARED_IN_THEME_FILE]: 'No theme declaration in decorator',
|
||||
[Message.THEME_DECLARED_IN_NON_THEME_FILE]: 'There is a theme declaration in decorator, but this file is not part of a theme',
|
||||
[Message.WRONG_THEME_DECLARED_IN_THEME_FILE]: 'Wrong theme declaration in decorator',
|
||||
},
|
||||
type: 'problem',
|
||||
schema: [
|
||||
{
|
||||
type: 'object',
|
||||
properties: {
|
||||
decorators: {
|
||||
type: 'object',
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
optionDocs: [
|
||||
{
|
||||
decorators: {
|
||||
title: '`decorators`',
|
||||
description: 'A mapping for all the existing themeable decorators, with the decorator name as the key and the index of the `theme` argument as the value.',
|
||||
},
|
||||
},
|
||||
],
|
||||
defaultOptions: [
|
||||
{
|
||||
decorators: {
|
||||
listableObjectComponent: 3,
|
||||
rendersSectionForMenu: 2,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export const rule = ESLintUtils.RuleCreator.withoutDocs({
|
||||
...info,
|
||||
create(context: TSESLint.RuleContext<Message, unknown[]>, options: any) {
|
||||
return {
|
||||
[`ClassDeclaration > Decorator > CallExpression[callee.name=/^(${Object.keys(options[0].decorators).join('|')})$/]`]: (node: TSESTree.CallExpression) => {
|
||||
if (isTestFile(context)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (node.callee.type !== AST_NODE_TYPES.Identifier) {
|
||||
// We only support regular method identifiers
|
||||
return;
|
||||
}
|
||||
|
||||
const fileTheme = getFileTheme(context);
|
||||
const themeDeclaration = getDeclaredTheme(options, node as TSESTree.CallExpression);
|
||||
|
||||
if (themeDeclaration === undefined) {
|
||||
if (fileTheme !== undefined) {
|
||||
context.report({
|
||||
messageId: Message.NO_THEME_DECLARED_IN_THEME_FILE,
|
||||
node: node,
|
||||
fix(fixer) {
|
||||
return fixer.insertTextAfter(node.arguments[node.arguments.length - 1], `, '${fileTheme as string}'`);
|
||||
},
|
||||
});
|
||||
}
|
||||
} else if (themeDeclaration?.type === AST_NODE_TYPES.Literal) {
|
||||
if (fileTheme === undefined) {
|
||||
context.report({
|
||||
messageId: Message.THEME_DECLARED_IN_NON_THEME_FILE,
|
||||
node: themeDeclaration,
|
||||
fix(fixer) {
|
||||
const idx = node.arguments.findIndex((v) => v.range === themeDeclaration.range);
|
||||
|
||||
if (idx === 0) {
|
||||
return fixer.remove(themeDeclaration);
|
||||
} else {
|
||||
const previousArgument = node.arguments[idx - 1];
|
||||
return fixer.removeRange([previousArgument.range[1], themeDeclaration.range[1]]); // todo: comma?
|
||||
}
|
||||
},
|
||||
});
|
||||
} else if (fileTheme !== themeDeclaration?.value) {
|
||||
context.report({
|
||||
messageId: Message.WRONG_THEME_DECLARED_IN_THEME_FILE,
|
||||
node: themeDeclaration,
|
||||
fix(fixer) {
|
||||
return fixer.replaceText(themeDeclaration, `'${fileTheme as string}'`);
|
||||
},
|
||||
});
|
||||
}
|
||||
} else if (themeDeclaration?.type === AST_NODE_TYPES.Identifier && themeDeclaration.name === 'undefined') {
|
||||
if (fileTheme !== undefined) {
|
||||
context.report({
|
||||
messageId: Message.NO_THEME_DECLARED_IN_THEME_FILE,
|
||||
node: node,
|
||||
fix(fixer) {
|
||||
return fixer.replaceText(node.arguments[node.arguments.length - 1], `'${fileTheme as string}'`);
|
||||
},
|
||||
});
|
||||
}
|
||||
} else {
|
||||
throw new Error('Unexpected theme declaration');
|
||||
}
|
||||
},
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
export const tests: NamedTests = {
|
||||
plugin: info.name,
|
||||
valid: [
|
||||
{
|
||||
name: 'theme file declares the correct theme in @listableObjectComponent',
|
||||
code: `
|
||||
@listableObjectComponent(something, somethingElse, undefined, 'test')
|
||||
export class Something extends SomethingElse {
|
||||
}
|
||||
`,
|
||||
filename: fixture('src/themes/test/app/dynamic-component/dynamic-component.ts'),
|
||||
},
|
||||
{
|
||||
name: 'plain file declares no theme in @listableObjectComponent',
|
||||
code: `
|
||||
@listableObjectComponent(something, somethingElse, undefined)
|
||||
export class Something extends SomethingElse {
|
||||
}
|
||||
`,
|
||||
filename: fixture('src/app/dynamic-component/dynamic-component.ts'),
|
||||
},
|
||||
{
|
||||
name: 'plain file declares explicit undefined theme in @listableObjectComponent',
|
||||
code: `
|
||||
@listableObjectComponent(something, somethingElse, undefined, undefined)
|
||||
export class Something extends SomethingElse {
|
||||
}
|
||||
`,
|
||||
filename: fixture('src/app/dynamic-component/dynamic-component.ts'),
|
||||
},
|
||||
{
|
||||
name: 'test file declares theme outside of theme directory',
|
||||
code: `
|
||||
@listableObjectComponent(something, somethingElse, undefined, 'test')
|
||||
export class Something extends SomethingElse {
|
||||
}
|
||||
`,
|
||||
filename: fixture('src/app/dynamic-component/dynamic-component.spec.ts'),
|
||||
},
|
||||
{
|
||||
name: 'only track configured decorators',
|
||||
code: `
|
||||
@something('test')
|
||||
export class Something extends SomethingElse {
|
||||
}
|
||||
`,
|
||||
filename: fixture('src/app/dynamic-component/dynamic-component.ts'),
|
||||
},
|
||||
],
|
||||
invalid: [
|
||||
{
|
||||
name: 'theme file declares the wrong theme in @listableObjectComponent',
|
||||
code: `
|
||||
@listableObjectComponent(something, somethingElse, undefined, 'test-2')
|
||||
export class Something extends SomethingElse {
|
||||
}
|
||||
`,
|
||||
filename: fixture('src/themes/test/app/dynamic-component/dynamic-component.ts'),
|
||||
errors: [
|
||||
{
|
||||
messageId: 'wrongThemeDeclaredInThemeFile',
|
||||
},
|
||||
],
|
||||
output: `
|
||||
@listableObjectComponent(something, somethingElse, undefined, 'test')
|
||||
export class Something extends SomethingElse {
|
||||
}
|
||||
`,
|
||||
},
|
||||
{
|
||||
name: 'plain file declares a theme in @listableObjectComponent',
|
||||
code: `
|
||||
@listableObjectComponent(something, somethingElse, undefined, 'test-2')
|
||||
export class Something extends SomethingElse {
|
||||
}
|
||||
`,
|
||||
filename: fixture('src/app/dynamic-component/dynamic-component.ts'),
|
||||
errors: [
|
||||
{
|
||||
messageId: 'themeDeclaredInNonThemeFile',
|
||||
},
|
||||
],
|
||||
output: `
|
||||
@listableObjectComponent(something, somethingElse, undefined)
|
||||
export class Something extends SomethingElse {
|
||||
}
|
||||
`,
|
||||
},
|
||||
{
|
||||
name: 'theme file declares no theme in @listableObjectComponent',
|
||||
code: `
|
||||
@listableObjectComponent(something, somethingElse, undefined)
|
||||
export class Something extends SomethingElse {
|
||||
}
|
||||
`,
|
||||
filename: fixture('src/themes/test-2/app/dynamic-component/dynamic-component.ts'),
|
||||
errors: [
|
||||
{
|
||||
messageId: 'noThemeDeclaredInThemeFile',
|
||||
},
|
||||
],
|
||||
output: `
|
||||
@listableObjectComponent(something, somethingElse, undefined, 'test-2')
|
||||
export class Something extends SomethingElse {
|
||||
}
|
||||
`,
|
||||
},
|
||||
{
|
||||
name: 'theme file declares explicit undefined theme in @listableObjectComponent',
|
||||
code: `
|
||||
@listableObjectComponent(something, somethingElse, undefined, undefined)
|
||||
export class Something extends SomethingElse {
|
||||
}
|
||||
`,
|
||||
filename: fixture('src/themes/test-2/app/dynamic-component/dynamic-component.ts'),
|
||||
errors: [
|
||||
{
|
||||
messageId: 'noThemeDeclaredInThemeFile',
|
||||
},
|
||||
],
|
||||
output: `
|
||||
@listableObjectComponent(something, somethingElse, undefined, 'test-2')
|
||||
export class Something extends SomethingElse {
|
||||
}
|
||||
`,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
function getDeclaredTheme(options: [ThemedDecoratorsOption], decoratorCall: TSESTree.CallExpression): TSESTree.Node | undefined {
|
||||
const index: number = options[0].decorators[(decoratorCall.callee as TSESTree.Identifier).name];
|
||||
|
||||
if (decoratorCall.arguments.length >= index + 1) {
|
||||
return decoratorCall.arguments[index];
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
158
lint/src/rules/ts/themed-wrapper-no-input-defaults.ts
Normal file
158
lint/src/rules/ts/themed-wrapper-no-input-defaults.ts
Normal file
@@ -0,0 +1,158 @@
|
||||
import {
|
||||
ESLintUtils,
|
||||
TSESTree,
|
||||
} from '@typescript-eslint/utils';
|
||||
import { RuleContext } from '@typescript-eslint/utils/ts-eslint';
|
||||
|
||||
import {
|
||||
DSpaceESLintRuleInfo,
|
||||
NamedTests,
|
||||
} from '../../util/structure';
|
||||
import { isThemedComponentWrapper } from '../../util/theme-support';
|
||||
|
||||
export enum Message {
|
||||
WRAPPER_HAS_INPUT_DEFAULTS = 'wrapperHasInputDefaults',
|
||||
}
|
||||
|
||||
export const info: DSpaceESLintRuleInfo = {
|
||||
name: 'themed-wrapper-no-input-defaults',
|
||||
meta: {
|
||||
docs: {
|
||||
description: 'ThemedComponent wrappers should not declare input defaults (see [DSpace Angular #2164](https://github.com/DSpace/dspace-angular/pull/2164))',
|
||||
},
|
||||
messages: {
|
||||
[Message.WRAPPER_HAS_INPUT_DEFAULTS]: 'ThemedComponent wrapper declares inputs with defaults',
|
||||
},
|
||||
type: 'problem',
|
||||
schema: [],
|
||||
},
|
||||
optionDocs: [],
|
||||
defaultOptions: [],
|
||||
};
|
||||
|
||||
export const rule = ESLintUtils.RuleCreator.withoutDocs({
|
||||
...info,
|
||||
create(context: RuleContext<any, any>, options: any) {
|
||||
return {
|
||||
'ClassBody > PropertyDefinition > Decorator > CallExpression[callee.name=\'Input\']': (node: TSESTree.CallExpression) => {
|
||||
const classDeclaration = (node?.parent?.parent?.parent as TSESTree.Decorator); // todo: clean this up
|
||||
if (!isThemedComponentWrapper(classDeclaration)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const propertyDefinition: TSESTree.PropertyDefinition = (node.parent.parent as any); // todo: clean this up
|
||||
|
||||
if (propertyDefinition.value !== null) {
|
||||
context.report({
|
||||
messageId: Message.WRAPPER_HAS_INPUT_DEFAULTS,
|
||||
node: propertyDefinition.value,
|
||||
// fix(fixer) {
|
||||
// // todo: don't strip type annotations!
|
||||
// // todo: replace default with appropriate type annotation if not present!
|
||||
// return fixer.removeRange([propertyDefinition.key.range[1], (propertyDefinition.value as any).range[1]]);
|
||||
// }
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
export const tests: NamedTests = {
|
||||
plugin: info.name,
|
||||
valid: [
|
||||
{
|
||||
name: 'ThemedComponent wrapper defines an input without a default value',
|
||||
code: `
|
||||
export class TTest extends ThemedComponent<Test> {
|
||||
|
||||
@Input()
|
||||
test;
|
||||
}
|
||||
`,
|
||||
},
|
||||
{
|
||||
name: 'Regular class defines an input with a default value',
|
||||
code: `
|
||||
export class Test {
|
||||
|
||||
@Input()
|
||||
test = 'test';
|
||||
}
|
||||
`,
|
||||
},
|
||||
],
|
||||
invalid: [
|
||||
{
|
||||
name: 'ThemedComponent wrapper defines an input with a default value',
|
||||
code: `
|
||||
export class TTest extends ThemedComponent<Test> {
|
||||
|
||||
@Input()
|
||||
test1 = 'test';
|
||||
|
||||
@Input()
|
||||
test2 = true;
|
||||
|
||||
@Input()
|
||||
test2: number = 123;
|
||||
|
||||
@Input()
|
||||
test3: number[] = [1,2,3];
|
||||
}
|
||||
`,
|
||||
errors: [
|
||||
{
|
||||
messageId: 'wrapperHasInputDefaults',
|
||||
},
|
||||
{
|
||||
messageId: 'wrapperHasInputDefaults',
|
||||
},
|
||||
{
|
||||
messageId: 'wrapperHasInputDefaults',
|
||||
},
|
||||
{
|
||||
messageId: 'wrapperHasInputDefaults',
|
||||
},
|
||||
],
|
||||
// output: `
|
||||
// export class TTest extends ThemedComponent<Test> {
|
||||
//
|
||||
// @Input()
|
||||
// test1: string;
|
||||
//
|
||||
// @Input()
|
||||
// test2: boolean;
|
||||
//
|
||||
// @Input()
|
||||
// test2: number;
|
||||
//
|
||||
// @Input()
|
||||
// test3: number[];
|
||||
// }
|
||||
// `,
|
||||
},
|
||||
{
|
||||
name: 'ThemedComponent wrapper defines an input with an undefined default value',
|
||||
code: `
|
||||
export class TTest extends ThemedComponent<Test> {
|
||||
|
||||
@Input()
|
||||
test = undefined;
|
||||
}
|
||||
`,
|
||||
errors: [
|
||||
{
|
||||
messageId: 'wrapperHasInputDefaults',
|
||||
},
|
||||
],
|
||||
// output: `
|
||||
// export class TTest extends ThemedComponent<Test> {
|
||||
//
|
||||
// @Input()
|
||||
// test;
|
||||
// }
|
||||
// `,
|
||||
},
|
||||
],
|
||||
};
|
226
lint/src/rules/ts/unique-decorators.ts
Normal file
226
lint/src/rules/ts/unique-decorators.ts
Normal file
@@ -0,0 +1,226 @@
|
||||
import {
|
||||
AST_NODE_TYPES,
|
||||
ESLintUtils,
|
||||
TSESLint,
|
||||
TSESTree,
|
||||
} from '@typescript-eslint/utils';
|
||||
|
||||
import { isTestFile } from '../../util/filter';
|
||||
import {
|
||||
DSpaceESLintRuleInfo,
|
||||
NamedTests,
|
||||
OptionDoc,
|
||||
} from '../../util/structure';
|
||||
|
||||
export enum Message {
|
||||
DUPLICATE_DECORATOR_CALL = 'duplicateDecoratorCall',
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the decorators by decoratorName → file → Set<String>
|
||||
*/
|
||||
const decoratorCalls: Map<string, Map<string, Set<string>>> = new Map();
|
||||
|
||||
/**
|
||||
* Keep a list of the files wo contain a decorator. This is done in order to prevent the `Program` selector from being
|
||||
* run for every file.
|
||||
*/
|
||||
const fileWithDecorators: Set<string> = new Set();
|
||||
|
||||
export interface UniqueDecoratorsOptions {
|
||||
decorators: string[];
|
||||
}
|
||||
|
||||
export interface UniqueDecoratorsDocOptions {
|
||||
decorators: OptionDoc;
|
||||
}
|
||||
|
||||
export const info: DSpaceESLintRuleInfo<[UniqueDecoratorsOptions], [UniqueDecoratorsDocOptions]> = {
|
||||
name: 'unique-decorators',
|
||||
meta: {
|
||||
docs: {
|
||||
description: 'Some decorators must be called with unique arguments (e.g. when they construct a mapping based on the argument values)',
|
||||
},
|
||||
messages: {
|
||||
[Message.DUPLICATE_DECORATOR_CALL]: 'Duplicate decorator call',
|
||||
},
|
||||
type: 'problem',
|
||||
schema: [
|
||||
{
|
||||
type: 'object',
|
||||
properties: {
|
||||
decorators: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
optionDocs: [
|
||||
{
|
||||
decorators: {
|
||||
title: '`decorators`',
|
||||
description: 'The list of all the decorators for which you want to enforce this behavior.',
|
||||
},
|
||||
},
|
||||
],
|
||||
defaultOptions: [
|
||||
{
|
||||
decorators: [
|
||||
'listableObjectComponent', // todo: must take default arguments into account!
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export const rule = ESLintUtils.RuleCreator.withoutDocs({
|
||||
...info,
|
||||
create(context: TSESLint.RuleContext<Message, unknown[]>, options: any) {
|
||||
|
||||
return {
|
||||
['Program']: () => {
|
||||
if (fileWithDecorators.has(context.physicalFilename)) {
|
||||
for (const decorator of options[0].decorators) {
|
||||
decoratorCalls.get(decorator)?.get(context.physicalFilename)?.clear();
|
||||
}
|
||||
}
|
||||
},
|
||||
[`ClassDeclaration > Decorator > CallExpression[callee.name=/^(${options[0].decorators.join('|')})$/]`]: (node: TSESTree.CallExpression) => {
|
||||
if (isTestFile(context)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (node.callee.type !== AST_NODE_TYPES.Identifier) {
|
||||
// We only support regular method identifiers
|
||||
return;
|
||||
}
|
||||
|
||||
fileWithDecorators.add(context.physicalFilename);
|
||||
|
||||
if (!isUnique(node, context.physicalFilename)) {
|
||||
context.report({
|
||||
messageId: Message.DUPLICATE_DECORATOR_CALL,
|
||||
node: node,
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
export const tests: NamedTests = {
|
||||
plugin: info.name,
|
||||
valid: [
|
||||
{
|
||||
name: 'checked decorator, no repetitions',
|
||||
code: `
|
||||
@listableObjectComponent(a)
|
||||
export class A {
|
||||
}
|
||||
|
||||
@listableObjectComponent(a, 'b')
|
||||
export class B {
|
||||
}
|
||||
|
||||
@listableObjectComponent(a, 'b', 3)
|
||||
export class C {
|
||||
}
|
||||
|
||||
@listableObjectComponent(a, 'b', 3, Enum.TEST1)
|
||||
export class C {
|
||||
}
|
||||
|
||||
@listableObjectComponent(a, 'b', 3, Enum.TEST2)
|
||||
export class C {
|
||||
}
|
||||
`,
|
||||
},
|
||||
{
|
||||
name: 'unchecked decorator, some repetitions',
|
||||
code: `
|
||||
@something(a)
|
||||
export class A {
|
||||
}
|
||||
|
||||
@something(a)
|
||||
export class B {
|
||||
}
|
||||
`,
|
||||
},
|
||||
],
|
||||
invalid: [
|
||||
{
|
||||
name: 'checked decorator, some repetitions',
|
||||
code: `
|
||||
@listableObjectComponent(a)
|
||||
export class A {
|
||||
}
|
||||
|
||||
@listableObjectComponent(a)
|
||||
export class B {
|
||||
}
|
||||
`,
|
||||
errors: [
|
||||
{
|
||||
messageId: 'duplicateDecoratorCall',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
function callKey(node: TSESTree.CallExpression): string {
|
||||
let key = '';
|
||||
|
||||
for (const arg of node.arguments) {
|
||||
switch ((arg as TSESTree.Node).type) {
|
||||
// todo: can we make this more generic somehow?
|
||||
case AST_NODE_TYPES.Identifier:
|
||||
key += (arg as TSESTree.Identifier).name;
|
||||
break;
|
||||
case AST_NODE_TYPES.Literal:
|
||||
// eslint-disable-next-line @typescript-eslint/no-base-to-string
|
||||
key += (arg as TSESTree.Literal).value;
|
||||
break;
|
||||
case AST_NODE_TYPES.MemberExpression:
|
||||
key += (arg as any).object.name + '.' + (arg as any).property.name;
|
||||
break;
|
||||
default:
|
||||
throw new Error(`Unrecognized decorator argument type: ${arg.type}`);
|
||||
}
|
||||
|
||||
key += ', ';
|
||||
}
|
||||
|
||||
return key;
|
||||
}
|
||||
|
||||
function isUnique(node: TSESTree.CallExpression, filePath: string): boolean {
|
||||
const decorator = (node.callee as TSESTree.Identifier).name;
|
||||
|
||||
if (!decoratorCalls.has(decorator)) {
|
||||
decoratorCalls.set(decorator, new Map());
|
||||
}
|
||||
|
||||
if (!decoratorCalls.get(decorator)!.has(filePath)) {
|
||||
decoratorCalls.get(decorator)!.set(filePath, new Set());
|
||||
}
|
||||
|
||||
const key = callKey(node);
|
||||
|
||||
let unique = true;
|
||||
|
||||
for (const decoratorCallsByFile of decoratorCalls.get(decorator)!.values()) {
|
||||
if (decoratorCallsByFile.has(key)) {
|
||||
unique = !unique;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
decoratorCalls.get(decorator)?.get(filePath)?.add(key);
|
||||
|
||||
return unique;
|
||||
}
|
10
lint/src/util/filter.ts
Normal file
10
lint/src/util/filter.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { RuleContext } from '@typescript-eslint/utils/ts-eslint';
|
||||
|
||||
/**
|
||||
* Determine whether the current file is a test file
|
||||
* @param context the current ESLint rule context
|
||||
*/
|
||||
export function isTestFile(context: RuleContext<any, any>): boolean {
|
||||
// note: shouldn't use plain .filename (doesn't work in DSpace Angular 7.4)
|
||||
return context.getFilename()?.endsWith('.spec.ts') ;
|
||||
}
|
@@ -17,10 +17,16 @@ export type Meta = RuleMetaData<string, unknown[]>;
|
||||
export type Valid = ValidTestCase<unknown[]>;
|
||||
export type Invalid = InvalidTestCase<string, unknown[]>;
|
||||
|
||||
export interface DSpaceESLintRuleInfo {
|
||||
export interface DSpaceESLintRuleInfo<T = unknown[], D = unknown[]> {
|
||||
name: string;
|
||||
meta: Meta,
|
||||
defaultOptions: unknown[],
|
||||
optionDocs: D,
|
||||
defaultOptions: T,
|
||||
}
|
||||
|
||||
export interface OptionDoc {
|
||||
title: string;
|
||||
description: string;
|
||||
}
|
||||
|
||||
export interface NamedTests {
|
||||
|
@@ -7,6 +7,11 @@ _______
|
||||
|
||||
[Source code](../../../../lint/src/rules/<%- plugin.name.replace('dspace-angular-', '') %>/<%- rule.name %>.ts)
|
||||
|
||||
<% if (rule.optionDocs?.length > 0) { %>
|
||||
### Options
|
||||
<%- rule.optionDocs.map(optionDoc => Object.keys(optionDoc).map(option => '\n#### ' + optionDoc[option].title + '\n\n' + optionDoc[option].description)) %>
|
||||
<% } %>
|
||||
|
||||
### Examples
|
||||
|
||||
<% if (tests.valid) {%>
|
||||
@@ -19,6 +24,13 @@ Filename: `<%- test.filename %>`
|
||||
```<%- plugin.language.toLowerCase() %>
|
||||
<%- test.code.trim() %>
|
||||
```
|
||||
<% if (test?.options?.length > 0) { %>
|
||||
With options:
|
||||
|
||||
```json
|
||||
<%- JSON.stringify(test.options[0], null, 2) %>
|
||||
```
|
||||
<% }%>
|
||||
<% }) %>
|
||||
<% } %>
|
||||
|
||||
@@ -31,6 +43,15 @@ Filename: `<%- test.filename %>`
|
||||
<% } %>
|
||||
```<%- plugin.language.toLowerCase() %>
|
||||
<%- test.code.trim() %>
|
||||
|
||||
<% if (test?.options?.length > 0) { %>
|
||||
With options:
|
||||
|
||||
```json
|
||||
<%- JSON.stringify(test.options[0], null, 2) %>
|
||||
```
|
||||
<% }%>
|
||||
|
||||
```
|
||||
Will produce the following error(s):
|
||||
```
|
||||
|
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
import { TSESTree } from '@typescript-eslint/utils';
|
||||
import { RuleContext } from '@typescript-eslint/utils/ts-eslint';
|
||||
import { readFileSync } from 'fs';
|
||||
import { basename } from 'path';
|
||||
import ts, { Identifier } from 'typescript';
|
||||
@@ -263,3 +264,18 @@ export const DISALLOWED_THEME_SELECTORS = 'ds-(base|themed)-';
|
||||
export function fixSelectors(text: string): string {
|
||||
return text.replaceAll(/ds-(base|themed)-/g, 'ds-');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine the theme of the current file based on its path in the project.
|
||||
* @param context the current ESLint rule context
|
||||
*/
|
||||
export function getFileTheme(context: RuleContext<any, any>): string | undefined {
|
||||
// note: shouldn't use plain .filename (doesn't work in DSpace Angular 7.4)
|
||||
const m = context.getFilename()?.match(/\/src\/themes\/([^/]+)\//);
|
||||
|
||||
if (m?.length === 2) {
|
||||
return m[1];
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
@@ -6,6 +6,8 @@
|
||||
* http://www.dspace.org/license/
|
||||
*/
|
||||
|
||||
import { RuleMetaData } from '@typescript-eslint/utils/ts-eslint';
|
||||
|
||||
import { default as html } from '../src/rules/html';
|
||||
import { default as ts } from '../src/rules/ts';
|
||||
|
||||
@@ -69,6 +71,16 @@ describe('plugin structure', () => {
|
||||
expect(ruleExports.tests.valid.length).toBeGreaterThan(0);
|
||||
expect(ruleExports.tests.invalid.length).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
it('should contain a valid ESLint rule', () => {
|
||||
// we don't have a better way to enforce this, but it's something at least
|
||||
expect((ruleExports.rule as any).name).toBeUndefined(
|
||||
'Rules should be passed to RuleCreator, omitting info.name since it is not part of the RuleWithMeta interface',
|
||||
);
|
||||
|
||||
expect(ruleExports.rule.create).toBeTruthy();
|
||||
expect(ruleExports.rule.meta).toEqual(ruleExports.info.meta as RuleMetaData<string, []>);
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
23477
package-lock.json
generated
Normal file
23477
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
189
package.json
189
package.json
@@ -1,30 +1,31 @@
|
||||
{
|
||||
"name": "dspace-angular",
|
||||
"version": "8.1.0",
|
||||
"version": "9.0.0",
|
||||
"scripts": {
|
||||
"ng": "ng",
|
||||
"config:watch": "nodemon",
|
||||
"test:rest": "ts-node --project ./tsconfig.ts-node.json scripts/test-rest.ts",
|
||||
"start": "yarn run start:prod",
|
||||
"start:dev": "nodemon --exec \"cross-env NODE_ENV=development yarn run serve\"",
|
||||
"start:prod": "yarn run build:prod && cross-env NODE_ENV=production yarn run serve:ssr",
|
||||
"start:mirador:prod": "yarn run build:mirador && yarn run start:prod",
|
||||
"preserve": "yarn base-href",
|
||||
"start": "npm run start:prod",
|
||||
"start:dev": "nodemon --exec \"cross-env NODE_ENV=development npm run serve\"",
|
||||
"start:prod": "npm run build:prod && cross-env NODE_ENV=production npm run serve:ssr",
|
||||
"start:mirador:prod": "npm run build:mirador && npm run start:prod",
|
||||
"preserve": "npm run base-href",
|
||||
"serve": "ts-node --project ./tsconfig.ts-node.json scripts/serve.ts",
|
||||
"serve:ssr": "node dist/server/main",
|
||||
"analyze": "webpack-bundle-analyzer dist/browser/stats.json",
|
||||
"build": "ng build --configuration development",
|
||||
"build:stats": "ng build --stats-json",
|
||||
"build:prod": "cross-env NODE_ENV=production yarn run build:ssr",
|
||||
"build:prod": "cross-env NODE_ENV=production npm run build:ssr",
|
||||
"build:ssr": "ng build --configuration production && ng run dspace-angular:server:production",
|
||||
"build:lint": "rimraf 'lint/dist/**/*.js' 'lint/dist/**/*.js.map' && tsc -b lint/tsconfig.json",
|
||||
"test": "ng test --source-map=true --watch=false --configuration test",
|
||||
"test:watch": "nodemon --exec \"ng test --source-map=true --watch=true --configuration test\"",
|
||||
"test:headless": "ng test --source-map=true --watch=false --configuration test --browsers=ChromeHeadless --code-coverage",
|
||||
"test:lint": "yarn build:lint && yarn test:lint:nobuild",
|
||||
"test:lint": "npm run build:lint && npm run test:lint:nobuild",
|
||||
"test:lint:nobuild": "jasmine --config=lint/jasmine.json",
|
||||
"lint": "yarn build:lint && yarn lint:nobuild",
|
||||
"lint": "npm run build:lint && npm run lint:nobuild",
|
||||
"lint:nobuild": "ng lint",
|
||||
"lint-fix": "yarn build:lint && ng lint --fix=true",
|
||||
"lint-fix": "npm run build:lint && ng lint --fix=true",
|
||||
"docs:lint": "ts-node --project ./lint/tsconfig.json ./lint/generate-docs.ts",
|
||||
"e2e": "cross-env NODE_ENV=production ng e2e",
|
||||
"clean:dev:config": "rimraf src/assets/config.json",
|
||||
@@ -35,8 +36,8 @@
|
||||
"clean:json": "rimraf *.records.json",
|
||||
"clean:node": "rimraf node_modules",
|
||||
"clean:cli": "rimraf .angular/cache",
|
||||
"clean:prod": "yarn run clean:dist && yarn run clean:log && yarn run clean:doc && yarn run clean:coverage && yarn run clean:json",
|
||||
"clean": "yarn run clean:prod && yarn run clean:dev:config && yarn run clean:cli && yarn run clean:node",
|
||||
"clean:prod": "npm run clean:dist && npm run clean:log && npm run clean:doc && npm run clean:coverage && npm run clean:json",
|
||||
"clean": "npm run clean:prod && npm run clean:dev:config && npm run clean:cli && npm run clean:node",
|
||||
"sync-i18n": "ts-node --project ./tsconfig.ts-node.json scripts/sync-i18n-files.ts",
|
||||
"build:mirador": "webpack --config webpack/webpack.mirador.config.ts",
|
||||
"merge-i18n": "ts-node --project ./tsconfig.ts-node.json scripts/merge-i18n-files.ts",
|
||||
@@ -45,7 +46,7 @@
|
||||
"env:yaml": "ts-node --project ./tsconfig.ts-node.json scripts/env-to-yaml.ts",
|
||||
"base-href": "ts-node --project ./tsconfig.ts-node.json scripts/base-href.ts",
|
||||
"check-circ-deps": "npx madge --exclude '(bitstream|bundle|collection|config-submission-form|eperson|item|version)\\.model\\.ts$' --circular --extensions ts ./",
|
||||
"postinstall": "yarn build:lint || echo 'Skipped DSpace ESLint plugins.'"
|
||||
"postinstall": "npm run build:lint || echo 'Skipped DSpace ESLint plugins.'"
|
||||
},
|
||||
"browser": {
|
||||
"fs": false,
|
||||
@@ -54,38 +55,76 @@
|
||||
"https": false
|
||||
},
|
||||
"private": true,
|
||||
"overrides": {
|
||||
"@kolkov/ngx-gallery": {
|
||||
"@angular/animations": "^18.2.12",
|
||||
"@angular/common": "^18.2.12",
|
||||
"@angular/core": "^18.2.12"
|
||||
},
|
||||
"@ng-bootstrap/ng-bootstrap": {
|
||||
"@angular/common": "^18.2.12",
|
||||
"@angular/core": "^18.2.12",
|
||||
"@angular/forms": "^18.2.12",
|
||||
"@angular/localize": "^18.2.12"
|
||||
},
|
||||
"@ng-dynamic-forms/core": {
|
||||
"@angular/common": "^18.2.12",
|
||||
"@angular/core": "^18.2.12",
|
||||
"@angular/forms": "^18.2.12"
|
||||
},
|
||||
"@ng-dynamic-forms/ui-ng-bootstrap": {
|
||||
"ngx-mask": "14.2.4",
|
||||
"@ng-bootstrap/ng-bootstrap": "^12.0.0",
|
||||
"bootstrap": "^5.3"
|
||||
},
|
||||
"@nicky-lenaers/ngx-scroll-to": {
|
||||
"@angular/common": "^18.2.12",
|
||||
"@angular/core": "^18.2.12"
|
||||
},
|
||||
"eslint-plugin-unused-imports": {
|
||||
"@typescript-eslint/eslint-plugin": "^7.2.0"
|
||||
},
|
||||
"ngx-infinite-scroll": {
|
||||
"@angular/common": "^18.2.12",
|
||||
"@angular/core": "^18.2.12"
|
||||
},
|
||||
"notistack": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@angular/animations": "^17.3.11",
|
||||
"@angular/cdk": "^17.3.10",
|
||||
"@angular/common": "^17.3.11",
|
||||
"@angular/compiler": "^17.3.11",
|
||||
"@angular/core": "^17.3.11",
|
||||
"@angular/forms": "^17.3.11",
|
||||
"@angular/localize": "17.3.12",
|
||||
"@angular/platform-browser": "^17.3.11",
|
||||
"@angular/platform-browser-dynamic": "^17.3.11",
|
||||
"@angular/platform-server": "^17.3.11",
|
||||
"@angular/router": "^17.3.11",
|
||||
"@angular/ssr": "^17.3.11",
|
||||
"@babel/runtime": "7.26.0",
|
||||
"@angular/animations": "^18.2.12",
|
||||
"@angular/cdk": "^18.2.12",
|
||||
"@angular/common": "^18.2.12",
|
||||
"@angular/compiler": "^18.2.12",
|
||||
"@angular/core": "^18.2.12",
|
||||
"@angular/forms": "^18.2.12",
|
||||
"@angular/localize": "^18.2.12",
|
||||
"@angular/platform-browser": "^18.2.12",
|
||||
"@angular/platform-browser-dynamic": "^18.2.12",
|
||||
"@angular/platform-server": "^18.2.12",
|
||||
"@angular/router": "^18.2.12",
|
||||
"@angular/ssr": "^18.2.19",
|
||||
"@babel/runtime": "7.27.1",
|
||||
"@kolkov/ngx-gallery": "^2.0.1",
|
||||
"@ng-bootstrap/ng-bootstrap": "^11.0.0",
|
||||
"@ng-bootstrap/ng-bootstrap": "^12.0.0",
|
||||
"@ng-dynamic-forms/core": "^16.0.0",
|
||||
"@ng-dynamic-forms/ui-ng-bootstrap": "^16.0.0",
|
||||
"@ngrx/effects": "^17.1.1",
|
||||
"@ngrx/router-store": "^17.1.1",
|
||||
"@ngrx/store": "^17.1.1",
|
||||
"@ngx-translate/core": "^14.0.0",
|
||||
"@ngrx/effects": "^18.1.1",
|
||||
"@ngrx/operators": "^18.0.0",
|
||||
"@ngrx/router-store": "^18.1.1",
|
||||
"@ngrx/store": "^18.1.1",
|
||||
"@ngx-translate/core": "^16.0.3",
|
||||
"@nicky-lenaers/ngx-scroll-to": "^14.0.0",
|
||||
"@terraformer/wkt": "^2.2.1",
|
||||
"altcha": "^0.9.0",
|
||||
"angulartics2": "^12.2.0",
|
||||
"axios": "^1.7.9",
|
||||
"bootstrap": "^4.6.1",
|
||||
"axios": "^1.9.0",
|
||||
"bootstrap": "^5.3",
|
||||
"cerialize": "0.1.18",
|
||||
"cli-progress": "^3.12.0",
|
||||
"colors": "^1.4.0",
|
||||
"compression": "^1.7.5",
|
||||
"cookie-parser": "1.4.7",
|
||||
"core-js": "^3.40.0",
|
||||
"core-js": "^3.42.0",
|
||||
"date-fns": "^2.29.3",
|
||||
"date-fns-tz": "^1.3.7",
|
||||
"deepmerge": "^4.3.1",
|
||||
@@ -93,82 +132,84 @@
|
||||
"express": "^4.21.2",
|
||||
"express-rate-limit": "^5.1.3",
|
||||
"fast-json-patch": "^3.1.1",
|
||||
"filesize": "^6.1.0",
|
||||
"http-proxy-middleware": "^2.0.7",
|
||||
"filesize": "^10.1.6",
|
||||
"http-proxy-middleware": "^2.0.9",
|
||||
"http-terminator": "^3.2.0",
|
||||
"isbot": "^5.1.21",
|
||||
"isbot": "^5.1.28",
|
||||
"js-cookie": "2.2.1",
|
||||
"js-yaml": "^4.1.0",
|
||||
"json5": "^2.2.3",
|
||||
"jsonschema": "1.5.0",
|
||||
"jwt-decode": "^3.1.2",
|
||||
"klaro": "^0.7.18",
|
||||
"lodash": "^4.17.21",
|
||||
"leaflet": "^1.9.4",
|
||||
"leaflet-providers": "^2.0.0",
|
||||
"leaflet.markercluster": "^1.5.3",
|
||||
"lodash-es": "^4.17.21",
|
||||
"lru-cache": "^7.14.1",
|
||||
"markdown-it": "^13.0.1",
|
||||
"mirador": "^3.4.3",
|
||||
"mirador-dl-plugin": "^0.13.0",
|
||||
"mirador-share-plugin": "^0.16.0",
|
||||
"morgan": "^1.10.0",
|
||||
"ng2-file-upload": "5.0.0",
|
||||
"ng2-file-upload": "7.0.1",
|
||||
"ng2-nouislider": "^2.0.0",
|
||||
"ngx-infinite-scroll": "^16.0.0",
|
||||
"ngx-infinite-scroll": "^18.0.0",
|
||||
"ngx-matomo-client": "^6.4.1",
|
||||
"ngx-pagination": "6.0.3",
|
||||
"ngx-skeleton-loader": "^9.0.0",
|
||||
"ngx-ui-switch": "^14.1.0",
|
||||
"ngx-ui-switch": "^15.0.0",
|
||||
"nouislider": "^15.7.1",
|
||||
"orejime": "^2.3.1",
|
||||
"pem": "1.14.8",
|
||||
"reflect-metadata": "^0.2.2",
|
||||
"rxjs": "^7.8.0",
|
||||
"uuid": "^8.3.2",
|
||||
"zone.js": "~0.15.0"
|
||||
"zone.js": "~0.14.10"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-builders/custom-webpack": "~17.0.2",
|
||||
"@angular-devkit/build-angular": "^17.3.11",
|
||||
"@angular-eslint/builder": "17.5.3",
|
||||
"@angular-eslint/bundled-angular-compiler": "17.5.3",
|
||||
"@angular-eslint/eslint-plugin": "17.5.3",
|
||||
"@angular-eslint/eslint-plugin-template": "17.5.3",
|
||||
"@angular-eslint/schematics": "17.5.3",
|
||||
"@angular-eslint/template-parser": "17.5.3",
|
||||
"@angular/cli": "^17.3.11",
|
||||
"@angular/compiler-cli": "^17.3.11",
|
||||
"@angular/language-service": "^17.3.11",
|
||||
"@angular-builders/custom-webpack": "~18.0.0",
|
||||
"@angular-devkit/build-angular": "^18.2.19",
|
||||
"@angular-eslint/builder": "^18.4.1",
|
||||
"@angular-eslint/bundled-angular-compiler": "^18.4.1",
|
||||
"@angular-eslint/eslint-plugin": "^18.4.1",
|
||||
"@angular-eslint/eslint-plugin-template": "^18.4.1",
|
||||
"@angular-eslint/schematics": "^18.4.1",
|
||||
"@angular-eslint/template-parser": "^18.4.1",
|
||||
"@angular-eslint/utils": "^18.4.1",
|
||||
"@angular/cli": "^18.2.19",
|
||||
"@angular/compiler-cli": "^18.2.12",
|
||||
"@angular/language-service": "^18.2.12",
|
||||
"@cypress/schematic": "^1.5.0",
|
||||
"@fortawesome/fontawesome-free": "^6.7.2",
|
||||
"@material-ui/core": "^4.12.4",
|
||||
"@material-ui/icons": "^4.11.3",
|
||||
"@ngrx/store-devtools": "^17.1.1",
|
||||
"@ngtools/webpack": "^16.2.16",
|
||||
"@ngrx/store-devtools": "^18.1.1",
|
||||
"@ngtools/webpack": "^18.2.19",
|
||||
"@types/deep-freeze": "0.1.5",
|
||||
"@types/ejs": "^3.1.2",
|
||||
"@types/express": "^4.17.17",
|
||||
"@types/grecaptcha": "^3.0.9",
|
||||
"@types/jasmine": "~3.6.0",
|
||||
"@types/js-cookie": "2.2.6",
|
||||
"@types/lodash": "^4.17.14",
|
||||
"@types/lodash-es": "^4.17.12",
|
||||
"@types/node": "^14.14.9",
|
||||
"@typescript-eslint/eslint-plugin": "^7.2.0",
|
||||
"@typescript-eslint/parser": "^7.2.0",
|
||||
"@typescript-eslint/rule-tester": "^7.2.0",
|
||||
"@typescript-eslint/utils": "^7.2.0",
|
||||
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
||||
"@typescript-eslint/parser": "^7.18.0",
|
||||
"@typescript-eslint/rule-tester": "^7.18.0",
|
||||
"@typescript-eslint/utils": "^7.18.0",
|
||||
"axe-core": "^4.10.2",
|
||||
"compression-webpack-plugin": "^9.2.0",
|
||||
"copy-webpack-plugin": "^6.4.1",
|
||||
"cross-env": "^7.0.3",
|
||||
"csstype": "^3.1.3",
|
||||
"cypress": "^13.17.0",
|
||||
"cypress-axe": "^1.5.0",
|
||||
"cypress-axe": "^1.6.0",
|
||||
"deep-freeze": "0.0.1",
|
||||
"eslint": "^8.39.0",
|
||||
"eslint-plugin-deprecation": "^1.4.1",
|
||||
"eslint-plugin-dspace-angular-html": "link:./lint/dist/src/rules/html",
|
||||
"eslint-plugin-dspace-angular-ts": "link:./lint/dist/src/rules/ts",
|
||||
"eslint-plugin-dspace-angular-html": "file:./lint/dist/src/rules/html",
|
||||
"eslint-plugin-dspace-angular-ts": "file:./lint/dist/src/rules/ts",
|
||||
"eslint-plugin-import": "^2.31.0",
|
||||
"eslint-plugin-import-newlines": "^1.3.1",
|
||||
"eslint-plugin-jsdoc": "^45.0.0",
|
||||
"eslint-plugin-jsonc": "^2.18.2",
|
||||
"eslint-plugin-jsonc": "^2.20.1",
|
||||
"eslint-plugin-lodash": "^7.4.0",
|
||||
"eslint-plugin-rxjs": "^5.0.3",
|
||||
"eslint-plugin-simple-import-sort": "^10.0.0",
|
||||
@@ -177,30 +218,26 @@
|
||||
"jasmine": "^3.8.0",
|
||||
"jasmine-core": "^3.8.0",
|
||||
"jasmine-marbles": "0.9.2",
|
||||
"karma": "^6.4.2",
|
||||
"karma": "^6.4.4",
|
||||
"karma-chrome-launcher": "~3.2.0",
|
||||
"karma-coverage-istanbul-reporter": "~3.0.3",
|
||||
"karma-jasmine": "~4.0.0",
|
||||
"karma-jasmine-html-reporter": "^1.5.0",
|
||||
"karma-mocha-reporter": "2.2.5",
|
||||
"ng-mocks": "^14.13.2",
|
||||
"ng-mocks": "^14.13.4",
|
||||
"ngx-mask": "14.2.4",
|
||||
"nodemon": "^2.0.22",
|
||||
"postcss": "^8.5",
|
||||
"postcss-import": "^14.0.0",
|
||||
"postcss-loader": "^4.0.3",
|
||||
"postcss-preset-env": "^7.4.2",
|
||||
"prop-types": "^15.8.1",
|
||||
"react": "^16.14.0",
|
||||
"react-copy-to-clipboard": "^5.1.0",
|
||||
"react-dom": "^16.14.0",
|
||||
"rimraf": "^3.0.2",
|
||||
"sass": "~1.83.4",
|
||||
"sass": "~1.89.0",
|
||||
"sass-loader": "^12.6.0",
|
||||
"sass-resources-loader": "^2.2.5",
|
||||
"ts-node": "^8.10.2",
|
||||
"typescript": "~5.4.5",
|
||||
"webpack": "5.97.1",
|
||||
"webpack": "5.99.8",
|
||||
"webpack-cli": "^5.1.4",
|
||||
"webpack-dev-server": "^4.15.1"
|
||||
}
|
||||
|
@@ -38,7 +38,7 @@ parseCliInput();
|
||||
function parseCliInput() {
|
||||
program
|
||||
.option('-d, --output-dir <output-dir>', 'output dir when running script on all language files', projectRoot(LANGUAGE_FILES_LOCATION))
|
||||
.option('-s, --source-dir <source-dir>', 'source dir of transalations to be merged')
|
||||
.option('-s, --source-dir <source-dir>', 'source dir of translations to be merged')
|
||||
.usage('(-s <source-dir> [-d <output-dir>])')
|
||||
.parse(process.argv);
|
||||
|
||||
|
26
server.ts
26
server.ts
@@ -20,10 +20,10 @@ import 'reflect-metadata';
|
||||
|
||||
/* eslint-disable import/no-namespace */
|
||||
import * as morgan from 'morgan';
|
||||
import * as express from 'express';
|
||||
import express from 'express';
|
||||
import * as ejs from 'ejs';
|
||||
import * as compression from 'compression';
|
||||
import * as expressStaticGzip from 'express-static-gzip';
|
||||
import expressStaticGzip from 'express-static-gzip';
|
||||
/* eslint-enable import/no-namespace */
|
||||
import axios from 'axios';
|
||||
import LRU from 'lru-cache';
|
||||
@@ -58,6 +58,7 @@ import {
|
||||
REQUEST,
|
||||
RESPONSE,
|
||||
} from './src/express.tokens';
|
||||
import { SsrExcludePatterns } from "./src/config/ssr-config.interface";
|
||||
|
||||
/*
|
||||
* Set path for the browser application's dist folder
|
||||
@@ -102,7 +103,7 @@ export function app() {
|
||||
* If production mode is enabled in the environment file:
|
||||
* - Enable Angular's production mode
|
||||
* - Initialize caching of SSR rendered pages (if enabled in config.yml)
|
||||
* - Enable compression for SSR reponses. See [compression](https://github.com/expressjs/compression)
|
||||
* - Enable compression for SSR responses. See [compression](https://github.com/expressjs/compression)
|
||||
*/
|
||||
if (environment.production) {
|
||||
enableProdMode();
|
||||
@@ -221,7 +222,7 @@ export function app() {
|
||||
* The callback function to serve server side angular
|
||||
*/
|
||||
function ngApp(req, res, next) {
|
||||
if (environment.ssr.enabled && req.method === 'GET' && (req.path === '/' || environment.ssr.paths.some(pathPrefix => req.path.startsWith(pathPrefix)))) {
|
||||
if (environment.ssr.enabled && req.method === 'GET' && (req.path === '/' || !isExcludedFromSsr(req.path, environment.ssr.excludePathPatterns))) {
|
||||
// Render the page to user via SSR (server side rendering)
|
||||
serverSideRender(req, res, next);
|
||||
} else {
|
||||
@@ -436,7 +437,7 @@ function checkCacheForRequest(cacheName: string, cache: LRU<string, any>, req, r
|
||||
if (environment.cache.serverSide.debug) { console.log(`CACHE EXPIRED FOR ${key} in ${cacheName} cache. Re-rendering...`); }
|
||||
// Update cached copy by rerendering server-side
|
||||
// NOTE: In this scenario the currently cached copy will be returned to the current user.
|
||||
// This re-render is peformed behind the scenes to update cached copy for next user.
|
||||
// This re-render is performed behind the scenes to update cached copy for next user.
|
||||
serverSideRender(req, res, next, false);
|
||||
}
|
||||
} else {
|
||||
@@ -627,6 +628,21 @@ function start() {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if SSR should be skipped for path
|
||||
*
|
||||
* @param path
|
||||
* @param excludePathPattern
|
||||
*/
|
||||
function isExcludedFromSsr(path: string, excludePathPattern: SsrExcludePatterns[]): boolean {
|
||||
const patterns = excludePathPattern.map(p =>
|
||||
new RegExp(p.pattern, p.flag || '')
|
||||
);
|
||||
return patterns.some((regex) => {
|
||||
return regex.test(path)
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* The callback function to serve health check requests
|
||||
*/
|
||||
|
@@ -1,19 +1,13 @@
|
||||
<ngb-accordion #acc="ngbAccordion" [activeIds]="'browse'">
|
||||
<ngb-panel [id]="'browse'">
|
||||
<ng-template ngbPanelHeader>
|
||||
<div class="w-100 d-flex gap-3 justify-content-between collapse-toggle" ngbPanelToggle (click)="acc.toggle('browse')"
|
||||
data-test="browse">
|
||||
<ng-template ngbPanelTitle>
|
||||
<div class="w-100 d-flex gap-3 justify-content-between collapse-toggle" (click)="acc.toggle('browse')"
|
||||
data-test="browse">
|
||||
<button type="button" class="btn btn-link p-0" (click)="$event.preventDefault()"
|
||||
[attr.aria-expanded]="acc.isExpanded('browse')"
|
||||
aria-controls="bulk-access-browse-panel-content">
|
||||
[attr.aria-expanded]="acc.isExpanded('browse')"
|
||||
aria-controls="bulk-access-browse-panel-content">
|
||||
{{ 'admin.access-control.bulk-access-browse.header' | translate }}
|
||||
</button>
|
||||
<div class="text-right d-flex gap-2">
|
||||
<div class="d-flex my-auto">
|
||||
<span *ngIf="acc.isExpanded('browse')" class="fas fa-chevron-up fa-fw"></span>
|
||||
<span *ngIf="!acc.isExpanded('browse')" class="fas fa-chevron-down fa-fw"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ng-template>
|
||||
<ng-template ngbPanelContent>
|
||||
@@ -22,11 +16,11 @@
|
||||
<li [ngbNavItem]="'search'" role="presentation">
|
||||
<a ngbNavLink>{{'admin.access-control.bulk-access-browse.search.header' | translate}}</a>
|
||||
<ng-template ngbNavContent>
|
||||
<div class="mx-n3">
|
||||
<div class="bulk-access-search">
|
||||
<ds-search [configuration]="'administrativeBulkAccess'"
|
||||
[selectable]="true"
|
||||
[selectionConfig]="{ repeatable: true, listId: listId }"
|
||||
[showThumbnails]="false"></ds-search>
|
||||
[selectable]="true"
|
||||
[selectionConfig]="{ repeatable: true, listId: listId }"
|
||||
[showThumbnails]="false"></ds-search>
|
||||
</div>
|
||||
</ng-template>
|
||||
</li>
|
||||
@@ -42,21 +36,25 @@
|
||||
[showPaginator]="false"
|
||||
(prev)="pagePrev()"
|
||||
(next)="pageNext()">
|
||||
<ul *ngIf="(objectsSelected$|async)?.hasSucceeded" class="list-unstyled ml-4">
|
||||
<li *ngFor='let object of (objectsSelected$|async)?.payload?.page | paginate: { itemsPerPage: (paginationOptions$ | async).pageSize,
|
||||
currentPage: (paginationOptions$ | async).currentPage, totalItems: (objectsSelected$|async)?.payload?.page.length }; let i = index; let last = last '
|
||||
class="mt-4 mb-4 d-flex"
|
||||
[attr.data-test]="'list-object' | dsBrowserOnly">
|
||||
<ds-selectable-list-item-control [index]="i"
|
||||
[object]="object"
|
||||
[selectionConfig]="{ repeatable: true, listId: listId }"></ds-selectable-list-item-control>
|
||||
<ds-listable-object-component-loader [listID]="listId"
|
||||
[index]="i"
|
||||
[object]="object"
|
||||
[showThumbnails]="false"
|
||||
[viewMode]="'list'"></ds-listable-object-component-loader>
|
||||
</li>
|
||||
</ul>
|
||||
@if ((objectsSelected$|async)?.hasSucceeded) {
|
||||
<ul class="list-unstyled ms-4">
|
||||
@for (object of (objectsSelected$|async)?.payload?.page | paginate: { itemsPerPage: (paginationOptions$ | async).pageSize,
|
||||
currentPage: (paginationOptions$ | async).currentPage, totalItems: (objectsSelected$|async)?.payload?.page.length }; track object; let i = $index; let last = $last) {
|
||||
<li
|
||||
class="mt-4 mb-4 d-flex"
|
||||
[attr.data-test]="'list-object' | dsBrowserOnly">
|
||||
<ds-selectable-list-item-control [index]="i"
|
||||
[object]="object"
|
||||
[selectionConfig]="{ repeatable: true, listId: listId }"></ds-selectable-list-item-control>
|
||||
<ds-listable-object-component-loader [listID]="listId"
|
||||
[index]="i"
|
||||
[object]="object"
|
||||
[showThumbnails]="false"
|
||||
[viewMode]="'list'"></ds-listable-object-component-loader>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
}
|
||||
</ds-pagination>
|
||||
</ng-template>
|
||||
</li>
|
||||
|
@@ -0,0 +1,4 @@
|
||||
.bulk-access-search {
|
||||
margin-right: calc(var(--bs-gutter-x, 1.5rem) / -2);
|
||||
margin-left: calc(var(--bs-gutter-x, 1.5rem) / -2);
|
||||
}
|
||||
|
@@ -1,8 +1,4 @@
|
||||
import {
|
||||
AsyncPipe,
|
||||
NgForOf,
|
||||
NgIf,
|
||||
} from '@angular/common';
|
||||
import { AsyncPipe } from '@angular/common';
|
||||
import {
|
||||
Component,
|
||||
Input,
|
||||
@@ -55,18 +51,16 @@ import { BrowserOnlyPipe } from '../../../shared/utils/browser-only.pipe';
|
||||
},
|
||||
],
|
||||
imports: [
|
||||
PaginationComponent,
|
||||
AsyncPipe,
|
||||
NgbAccordionModule,
|
||||
TranslateModule,
|
||||
NgIf,
|
||||
NgbNavModule,
|
||||
ThemedSearchComponent,
|
||||
BrowserOnlyPipe,
|
||||
NgForOf,
|
||||
NgxPaginationModule,
|
||||
SelectableListItemControlComponent,
|
||||
ListableObjectComponentLoaderComponent,
|
||||
NgbAccordionModule,
|
||||
NgbNavModule,
|
||||
NgxPaginationModule,
|
||||
PaginationComponent,
|
||||
SelectableListItemControlComponent,
|
||||
ThemedSearchComponent,
|
||||
TranslateModule,
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<hr>
|
||||
|
||||
<div class="d-flex justify-content-end">
|
||||
<button class="btn btn-outline-primary mr-3" (click)="reset()">
|
||||
<button class="btn btn-outline-primary me-3" (click)="reset()">
|
||||
{{ 'access-control-cancel' | translate }}
|
||||
</button>
|
||||
<button class="btn btn-primary" [dsBtnDisabled]="!canExport()" (click)="submit()">
|
||||
|
@@ -1,4 +1,7 @@
|
||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import {
|
||||
Component,
|
||||
NO_ERRORS_SCHEMA,
|
||||
} from '@angular/core';
|
||||
import {
|
||||
ComponentFixture,
|
||||
TestBed,
|
||||
@@ -62,10 +65,17 @@ describe('BulkAccessComponent', () => {
|
||||
'file': { },
|
||||
};
|
||||
|
||||
const mockSettings: any = jasmine.createSpyObj('AccessControlFormContainerComponent', {
|
||||
getValue: jasmine.createSpy('getValue'),
|
||||
reset: jasmine.createSpy('reset'),
|
||||
});
|
||||
@Component({
|
||||
selector: 'ds-bulk-access-settings',
|
||||
template: '',
|
||||
exportAs: 'dsBulkSettings',
|
||||
standalone: true,
|
||||
})
|
||||
class MockBulkAccessSettingsComponent {
|
||||
isFormValid = jasmine.createSpy('isFormValid').and.returnValue(false);
|
||||
getValue = jasmine.createSpy('getValue');
|
||||
reset = jasmine.createSpy('reset');
|
||||
}
|
||||
const selection: any[] = [{ indexableObject: { uuid: '1234' } }, { indexableObject: { uuid: '5678' } }];
|
||||
const selectableListState: SelectableListState = { id: 'test', selection };
|
||||
const expectedIdList = ['1234', '5678'];
|
||||
@@ -93,6 +103,9 @@ describe('BulkAccessComponent', () => {
|
||||
BulkAccessSettingsComponent,
|
||||
],
|
||||
},
|
||||
add: {
|
||||
imports: [MockBulkAccessSettingsComponent],
|
||||
},
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
@@ -109,13 +122,12 @@ describe('BulkAccessComponent', () => {
|
||||
fixture.destroy();
|
||||
});
|
||||
|
||||
describe('when there are no elements selected', () => {
|
||||
describe('when there are no elements selected and step two form is invalid', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
(component as any).selectableListService.getSelectableList.and.returnValue(of(selectableListStateEmpty));
|
||||
fixture.detectChanges();
|
||||
component.settings = mockSettings;
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
@@ -138,7 +150,6 @@ describe('BulkAccessComponent', () => {
|
||||
|
||||
(component as any).selectableListService.getSelectableList.and.returnValue(of(selectableListState));
|
||||
fixture.detectChanges();
|
||||
component.settings = mockSettings;
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
@@ -149,15 +160,29 @@ describe('BulkAccessComponent', () => {
|
||||
expect(component.objectsSelected$.value).toEqual(expectedIdList);
|
||||
});
|
||||
|
||||
it('should enable the execute button when there are objects selected', () => {
|
||||
it('should not enable the execute button when there are objects selected and step two form is invalid', () => {
|
||||
component.objectsSelected$.next(['1234']);
|
||||
expect(component.canExport()).toBe(true);
|
||||
expect(component.canExport()).toBe(false);
|
||||
});
|
||||
|
||||
it('should call the settings reset method when reset is called', () => {
|
||||
component.reset();
|
||||
expect(component.settings.reset).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
describe('when there are elements selected and the step two form is valid', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
(component as any).selectableListService.getSelectableList.and.returnValue(of(selectableListState));
|
||||
fixture.detectChanges();
|
||||
(component as any).settings.isFormValid.and.returnValue(true);
|
||||
});
|
||||
|
||||
it('should enable the execute button when there are objects selected and step two form is valid', () => {
|
||||
component.objectsSelected$.next(['1234']);
|
||||
expect(component.canExport()).toBe(true);
|
||||
});
|
||||
|
||||
it('should call the bulkAccessControlService executeScript method when submit is called', () => {
|
||||
(component.settings as any).getValue.and.returnValue(mockFormState);
|
||||
|
@@ -1,4 +1,5 @@
|
||||
import {
|
||||
ChangeDetectionStrategy,
|
||||
Component,
|
||||
OnInit,
|
||||
ViewChild,
|
||||
@@ -25,12 +26,13 @@ import { BulkAccessSettingsComponent } from './settings/bulk-access-settings.com
|
||||
templateUrl: './bulk-access.component.html',
|
||||
styleUrls: ['./bulk-access.component.scss'],
|
||||
imports: [
|
||||
TranslateModule,
|
||||
BulkAccessSettingsComponent,
|
||||
BulkAccessBrowseComponent,
|
||||
BtnDisabledDirective,
|
||||
BulkAccessBrowseComponent,
|
||||
BulkAccessSettingsComponent,
|
||||
TranslateModule,
|
||||
],
|
||||
standalone: true,
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class BulkAccessComponent implements OnInit {
|
||||
|
||||
@@ -70,7 +72,7 @@ export class BulkAccessComponent implements OnInit {
|
||||
}
|
||||
|
||||
canExport(): boolean {
|
||||
return this.objectsSelected$.value?.length > 0;
|
||||
return this.objectsSelected$.value?.length > 0 && this.settings?.isFormValid();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -1,17 +1,11 @@
|
||||
<ngb-accordion #acc="ngbAccordion" [activeIds]="'settings'">
|
||||
<ngb-panel [id]="'settings'">
|
||||
<ng-template ngbPanelHeader>
|
||||
<ng-template ngbPanelTitle>
|
||||
<div class="w-100 d-flex gap-3 justify-content-between collapse-toggle" ngbPanelToggle (click)="acc.toggle('settings')" data-test="settings">
|
||||
<button type="button" class="btn btn-link p-0" (click)="$event.preventDefault()" [attr.aria-expanded]="acc.isExpanded('settings')"
|
||||
aria-controls="bulk-access-settings-panel-content">
|
||||
{{ 'admin.access-control.bulk-access-settings.header' | translate }}
|
||||
</button>
|
||||
<div class="text-right d-flex gap-2">
|
||||
<div class="d-flex my-auto">
|
||||
<span *ngIf="acc.isExpanded('settings')" class="fas fa-chevron-up fa-fw"></span>
|
||||
<span *ngIf="!acc.isExpanded('settings')" class="fas fa-chevron-down fa-fw"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ng-template>
|
||||
<ng-template ngbPanelContent>
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { NgIf } from '@angular/common';
|
||||
|
||||
import {
|
||||
Component,
|
||||
ViewChild,
|
||||
@@ -14,10 +14,9 @@ import { AccessControlFormContainerComponent } from '../../../shared/access-cont
|
||||
styleUrls: ['./bulk-access-settings.component.scss'],
|
||||
exportAs: 'dsBulkSettings',
|
||||
imports: [
|
||||
AccessControlFormContainerComponent,
|
||||
NgbAccordionModule,
|
||||
TranslateModule,
|
||||
NgIf,
|
||||
AccessControlFormContainerComponent,
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
@@ -43,4 +42,8 @@ export class BulkAccessSettingsComponent {
|
||||
this.controlForm.reset();
|
||||
}
|
||||
|
||||
isFormValid() {
|
||||
return this.controlForm.isValid();
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -5,10 +5,10 @@
|
||||
<h1 id="header" class="pb-2">{{labelPrefix + 'head' | translate}}</h1>
|
||||
|
||||
<div>
|
||||
<button class="mr-auto btn btn-success addEPerson-button"
|
||||
[routerLink]="'create'">
|
||||
<button class="me-auto btn btn-success addEPerson-button"
|
||||
[routerLink]="'create'">
|
||||
<i class="fas fa-plus"></i>
|
||||
<span class="d-none d-sm-inline ml-1">{{labelPrefix + 'button.add' | translate}}</span>
|
||||
<span class="d-none d-sm-inline ms-1">{{labelPrefix + 'button.add' | translate}}</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -18,77 +18,84 @@
|
||||
</h2>
|
||||
<form [formGroup]="searchForm" (ngSubmit)="search(searchForm.value)" class="d-flex justify-content-between">
|
||||
<div>
|
||||
<select name="scope" id="scope" formControlName="scope" class="form-control" aria-label="Search scope">
|
||||
<select name="scope" id="scope" formControlName="scope" class="form-select" aria-label="Search scope">
|
||||
<option value="metadata">{{labelPrefix + 'search.scope.metadata' | translate}}</option>
|
||||
<option value="email">{{labelPrefix + 'search.scope.email' | translate}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="flex-grow-1 mr-3 ml-3">
|
||||
<div class="form-group input-group">
|
||||
<div class="flex-grow-1 me-3 ms-3">
|
||||
<div class="mb-3 input-group">
|
||||
<input type="text" name="query" id="query" formControlName="query"
|
||||
class="form-control" [attr.aria-label]="labelPrefix + 'search.placeholder' | translate"
|
||||
[placeholder]="(labelPrefix + 'search.placeholder' | translate)">
|
||||
class="form-control" [attr.aria-label]="labelPrefix + 'search.placeholder' | translate"
|
||||
[placeholder]="(labelPrefix + 'search.placeholder' | translate)">
|
||||
<span class="input-group-append">
|
||||
<button type="submit" class="search-button btn btn-primary">
|
||||
<i class="fas fa-search"></i> {{ labelPrefix + 'search.button' | translate }}
|
||||
</button>
|
||||
</span>
|
||||
<button type="submit" class="search-button btn btn-primary">
|
||||
<i class="fas fa-search"></i> {{ labelPrefix + 'search.button' | translate }}
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<button (click)="clearFormAndResetResult();"
|
||||
class="search-button btn btn-secondary">{{labelPrefix + 'button.see-all' | translate}}</button>
|
||||
class="search-button btn btn-secondary">{{labelPrefix + 'button.see-all' | translate}}</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<ds-loading *ngIf="searching$ | async"></ds-loading>
|
||||
<ds-pagination
|
||||
*ngIf="(pageInfoState$ | async)?.totalElements > 0 && (searching$ | async) !== true"
|
||||
[paginationOptions]="config"
|
||||
[collectionSize]="(pageInfoState$ | async)?.totalElements"
|
||||
[hideGear]="true"
|
||||
[hidePagerWhenSinglePage]="true">
|
||||
|
||||
<div class="table-responsive">
|
||||
<table id="epeople" class="table table-striped table-hover table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">{{labelPrefix + 'table.id' | translate}}</th>
|
||||
<th scope="col">{{labelPrefix + 'table.name' | translate}}</th>
|
||||
<th scope="col">{{labelPrefix + 'table.email' | translate}}</th>
|
||||
<th>{{labelPrefix + 'table.edit' | translate}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let epersonDto of (ePeopleDto$ | async)?.page"
|
||||
[ngClass]="{'table-primary' : (activeEPerson$ | async) === epersonDto.eperson}">
|
||||
<td>{{epersonDto.eperson.id}}</td>
|
||||
<td>{{ dsoNameService.getName(epersonDto.eperson) }}</td>
|
||||
<td>{{epersonDto.eperson.email}}</td>
|
||||
<td>
|
||||
<div class="btn-group edit-field">
|
||||
<button [routerLink]="getEditEPeoplePage(epersonDto.eperson.id)"
|
||||
@if (searching$ | async) {
|
||||
<ds-loading></ds-loading>
|
||||
}
|
||||
@if ((pageInfoState$ | async)?.totalElements > 0 && (searching$ | async) !== true) {
|
||||
<ds-pagination
|
||||
[paginationOptions]="config"
|
||||
[collectionSize]="(pageInfoState$ | async)?.totalElements"
|
||||
[hideGear]="true"
|
||||
[hidePagerWhenSinglePage]="true">
|
||||
<div class="table-responsive">
|
||||
<table id="epeople" class="table table-striped table-hover table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">{{labelPrefix + 'table.id' | translate}}</th>
|
||||
<th scope="col">{{labelPrefix + 'table.name' | translate}}</th>
|
||||
<th scope="col">{{labelPrefix + 'table.email' | translate}}</th>
|
||||
<th>{{labelPrefix + 'table.edit' | translate}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@for (epersonDto of (ePeopleDto$ | async)?.page; track epersonDto) {
|
||||
<tr
|
||||
[ngClass]="{'table-primary' : (activeEPerson$ | async) === epersonDto.eperson}">
|
||||
<td>{{epersonDto.eperson.id}}</td>
|
||||
<td>{{ dsoNameService.getName(epersonDto.eperson) }}</td>
|
||||
<td>{{epersonDto.eperson.email}}</td>
|
||||
<td>
|
||||
<div class="btn-group edit-field">
|
||||
<button [routerLink]="getEditEPeoplePage(epersonDto.eperson.id)"
|
||||
class="btn btn-outline-primary btn-sm access-control-editEPersonButton"
|
||||
title="{{labelPrefix + 'table.edit.buttons.edit' | translate: { name: dsoNameService.getName(epersonDto.eperson) } }}">
|
||||
<i class="fas fa-edit fa-fw"></i>
|
||||
</button>
|
||||
<button *ngIf="epersonDto.ableToDelete" (click)="deleteEPerson(epersonDto.eperson)"
|
||||
class="delete-button btn btn-outline-danger btn-sm access-control-deleteEPersonButton"
|
||||
title="{{labelPrefix + 'table.edit.buttons.remove' | translate: { name: dsoNameService.getName(epersonDto.eperson) } }}">
|
||||
<i class="fas fa-trash-alt fa-fw"></i>
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<i class="fas fa-edit fa-fw"></i>
|
||||
</button>
|
||||
@if (epersonDto.ableToDelete) {
|
||||
<button (click)="deleteEPerson(epersonDto.eperson)"
|
||||
class="delete-button btn btn-outline-danger btn-sm access-control-deleteEPersonButton"
|
||||
title="{{labelPrefix + 'table.edit.buttons.remove' | translate: { name: dsoNameService.getName(epersonDto.eperson) } }}">
|
||||
<i class="fas fa-trash-alt fa-fw"></i>
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</ds-pagination>
|
||||
}
|
||||
|
||||
@if ((pageInfoState$ | async)?.totalElements === 0) {
|
||||
<div class="alert alert-info w-100 mb-2" role="alert">
|
||||
{{labelPrefix + 'no-items' | translate}}
|
||||
</div>
|
||||
|
||||
</ds-pagination>
|
||||
|
||||
<div *ngIf="(pageInfoState$ | async)?.totalElements === 0" class="alert alert-info w-100 mb-2" role="alert">
|
||||
{{labelPrefix + 'no-items' | translate}}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -27,7 +27,7 @@ import {
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import {
|
||||
Observable,
|
||||
of as observableOf,
|
||||
of,
|
||||
} from 'rxjs';
|
||||
|
||||
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
|
||||
@@ -85,7 +85,7 @@ describe('EPeopleRegistryComponent', () => {
|
||||
}), this.allEpeople));
|
||||
},
|
||||
getActiveEPerson(): Observable<EPerson> {
|
||||
return observableOf(this.activeEPerson);
|
||||
return of(this.activeEPerson);
|
||||
},
|
||||
searchByScope(scope: string, query: string, options: FindListOptions = {}): Observable<RemoteData<PaginatedList<EPerson>>> {
|
||||
if (scope === 'email') {
|
||||
@@ -129,7 +129,7 @@ describe('EPeopleRegistryComponent', () => {
|
||||
this.allEpeople = this.allEpeople.filter((ePerson2: EPerson) => {
|
||||
return (ePerson2.uuid !== ePerson.uuid);
|
||||
});
|
||||
return observableOf(true);
|
||||
return of(true);
|
||||
},
|
||||
editEPerson(ePerson: EPerson) {
|
||||
this.activeEPerson = ePerson;
|
||||
@@ -145,7 +145,7 @@ describe('EPeopleRegistryComponent', () => {
|
||||
},
|
||||
};
|
||||
authorizationService = jasmine.createSpyObj('authorizationService', {
|
||||
isAuthorized: observableOf(true),
|
||||
isAuthorized: of(true),
|
||||
});
|
||||
builderService = getMockFormBuilderService();
|
||||
|
||||
@@ -180,7 +180,7 @@ describe('EPeopleRegistryComponent', () => {
|
||||
fixture = TestBed.createComponent(EPeopleRegistryComponent);
|
||||
component = fixture.componentInstance;
|
||||
modalService = TestBed.inject(NgbModal);
|
||||
spyOn(modalService, 'open').and.returnValue(Object.assign({ componentInstance: Object.assign({ response: observableOf(true) }) }));
|
||||
spyOn(modalService, 'open').and.returnValue(Object.assign({ componentInstance: Object.assign({ response: of(true) }) }));
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
@@ -261,7 +261,7 @@ describe('EPeopleRegistryComponent', () => {
|
||||
|
||||
|
||||
it('should hide delete EPerson button when the isAuthorized returns false', () => {
|
||||
spyOn(authorizationService, 'isAuthorized').and.returnValue(observableOf(false));
|
||||
spyOn(authorizationService, 'isAuthorized').and.returnValue(of(false));
|
||||
component.initialisePage();
|
||||
fixture.detectChanges();
|
||||
|
||||
|
@@ -1,8 +1,6 @@
|
||||
import {
|
||||
AsyncPipe,
|
||||
NgClass,
|
||||
NgForOf,
|
||||
NgIf,
|
||||
} from '@angular/common';
|
||||
import {
|
||||
Component,
|
||||
@@ -69,16 +67,14 @@ import { EPersonFormComponent } from './eperson-form/eperson-form.component';
|
||||
selector: 'ds-epeople-registry',
|
||||
templateUrl: './epeople-registry.component.html',
|
||||
imports: [
|
||||
TranslateModule,
|
||||
RouterModule,
|
||||
AsyncPipe,
|
||||
NgIf,
|
||||
EPersonFormComponent,
|
||||
ReactiveFormsModule,
|
||||
ThemedLoadingComponent,
|
||||
PaginationComponent,
|
||||
NgClass,
|
||||
NgForOf,
|
||||
PaginationComponent,
|
||||
ReactiveFormsModule,
|
||||
RouterModule,
|
||||
ThemedLoadingComponent,
|
||||
TranslateModule,
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
|
@@ -2,97 +2,111 @@
|
||||
<div class="group-form row">
|
||||
<div class="col-12">
|
||||
|
||||
<div *ngIf="activeEPerson$ | async; then editHeader; else createHeader"></div>
|
||||
|
||||
<ng-template #createHeader>
|
||||
<h1 class="border-bottom pb-2">{{messagePrefix + '.create' | translate}}</h1>
|
||||
</ng-template>
|
||||
|
||||
<ng-template #editHeader>
|
||||
@if (activeEPerson$ | async) {
|
||||
<h1 class="border-bottom pb-2">{{messagePrefix + '.edit' | translate}}</h1>
|
||||
</ng-template>
|
||||
} @else {
|
||||
<h1 class="border-bottom pb-2">{{messagePrefix + '.create' | translate}}</h1>
|
||||
}
|
||||
|
||||
|
||||
|
||||
<ds-form [formId]="formId"
|
||||
[formModel]="formModel"
|
||||
[formGroup]="formGroup"
|
||||
[formLayout]="formLayout"
|
||||
[displayCancel]="false"
|
||||
[submitLabel]="submitLabel"
|
||||
(submitForm)="onSubmit()">
|
||||
[formModel]="formModel"
|
||||
[formGroup]="formGroup"
|
||||
[formLayout]="formLayout"
|
||||
[displayCancel]="false"
|
||||
[submitLabel]="submitLabel"
|
||||
(submitForm)="onSubmit()">
|
||||
<div before class="btn-group">
|
||||
<button (click)="onCancel()" type="button" class="btn btn-outline-secondary">
|
||||
<i class="fas fa-arrow-left"></i> {{messagePrefix + '.return' | translate}}
|
||||
</button>
|
||||
</div>
|
||||
<div *ngIf="displayResetPassword" between class="btn-group">
|
||||
<button class="btn btn-primary" [dsBtnDisabled]="(canReset$ | async) !== true" type="button" (click)="resetPassword()">
|
||||
<i class="fa fa-key"></i> {{'admin.access-control.epeople.actions.reset' | translate}}
|
||||
@if (displayResetPassword) {
|
||||
<div between class="btn-group">
|
||||
<button class="btn btn-primary" [dsBtnDisabled]="(canReset$ | async) !== true" type="button" (click)="resetPassword()">
|
||||
<i class="fa fa-key"></i> {{'admin.access-control.epeople.actions.reset' | translate}}
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
@if (canImpersonate$ | async) {
|
||||
<div between class="btn-group">
|
||||
@if (!isImpersonated) {
|
||||
<button class="btn btn-primary" type="button" (click)="impersonate()">
|
||||
<i class="fa fa-user-secret"></i> {{'admin.access-control.epeople.actions.impersonate' | translate}}
|
||||
</button>
|
||||
}
|
||||
@if (isImpersonated) {
|
||||
<button class="btn btn-primary" type="button" (click)="stopImpersonating()">
|
||||
<i class="fa fa-user-secret"></i> {{'admin.access-control.epeople.actions.stop-impersonating' | translate}}
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
@if (canDelete$ | async) {
|
||||
<button after class="btn btn-danger delete-button" type="button" (click)="delete()">
|
||||
<i class="fas fa-trash"></i> {{'admin.access-control.epeople.actions.delete' | translate}}
|
||||
</button>
|
||||
</div>
|
||||
<div *ngIf="canImpersonate$ | async" between class="btn-group">
|
||||
<button *ngIf="!isImpersonated" class="btn btn-primary" type="button" (click)="impersonate()">
|
||||
<i class="fa fa-user-secret"></i> {{'admin.access-control.epeople.actions.impersonate' | translate}}
|
||||
</button>
|
||||
<button *ngIf="isImpersonated" class="btn btn-primary" type="button" (click)="stopImpersonating()">
|
||||
<i class="fa fa-user-secret"></i> {{'admin.access-control.epeople.actions.stop-impersonating' | translate}}
|
||||
</button>
|
||||
</div>
|
||||
<button *ngIf="canDelete$ | async" after class="btn btn-danger delete-button" type="button" (click)="delete()">
|
||||
<i class="fas fa-trash"></i> {{'admin.access-control.epeople.actions.delete' | translate}}
|
||||
</button>
|
||||
}
|
||||
</ds-form>
|
||||
|
||||
<ds-loading [showMessage]="false" *ngIf="!formGroup"></ds-loading>
|
||||
@if (!formGroup) {
|
||||
<ds-loading [showMessage]="false"></ds-loading>
|
||||
}
|
||||
|
||||
<div *ngIf="activeEPerson$ | async">
|
||||
<h2>{{messagePrefix + '.groupsEPersonIsMemberOf' | translate}}</h2>
|
||||
|
||||
<ds-loading [showMessage]="false" *ngIf="groups$ | async | dsHasNoValue"></ds-loading>
|
||||
|
||||
<ds-pagination
|
||||
*ngIf="(groups$ | async)?.payload?.totalElements > 0"
|
||||
[paginationOptions]="config"
|
||||
[collectionSize]="(groups$ | async)?.payload?.totalElements"
|
||||
[hideGear]="true"
|
||||
[hidePagerWhenSinglePage]="true"
|
||||
(pageChange)="onPageChange($event)">
|
||||
|
||||
<div class="table-responsive">
|
||||
<table id="groups" class="table table-striped table-hover table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="align-middle">{{messagePrefix + '.table.id' | translate}}</th>
|
||||
<th scope="col" class="align-middle">{{messagePrefix + '.table.name' | translate}}</th>
|
||||
<th scope="col" class="align-middle">{{messagePrefix + '.table.collectionOrCommunity' | translate}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let group of (groups$ | async)?.payload?.page">
|
||||
<td class="align-middle">{{group.id}}</td>
|
||||
<td class="align-middle">
|
||||
<a (click)="groupsDataService.startEditingNewGroup(group)"
|
||||
[routerLink]="[groupsDataService.getGroupEditPageRouterLink(group)]">
|
||||
{{ dsoNameService.getName(group) }}
|
||||
</a>
|
||||
</td>
|
||||
<td class="align-middle">
|
||||
{{ dsoNameService.getName((group.object | async)?.payload) }}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</ds-pagination>
|
||||
|
||||
<div *ngIf="(groups$ | async)?.payload?.totalElements === 0" class="alert alert-info w-100 mb-2" role="alert">
|
||||
<div>{{messagePrefix + '.memberOfNoGroups' | translate}}</div>
|
||||
<div>
|
||||
<button [routerLink]="[groupsDataService.getGroupRegistryRouterLink()]"
|
||||
class="btn btn-primary">{{messagePrefix + '.goToGroups' | translate}}</button>
|
||||
</div>
|
||||
@if (activeEPerson$ | async) {
|
||||
<div>
|
||||
<h2>{{messagePrefix + '.groupsEPersonIsMemberOf' | translate}}</h2>
|
||||
@if (groups$ | async | dsHasNoValue) {
|
||||
<ds-loading [showMessage]="false"></ds-loading>
|
||||
}
|
||||
@if ((groups$ | async)?.payload?.totalElements > 0) {
|
||||
<ds-pagination
|
||||
[paginationOptions]="config"
|
||||
[collectionSize]="(groups$ | async)?.payload?.totalElements"
|
||||
[hideGear]="true"
|
||||
[hidePagerWhenSinglePage]="true"
|
||||
(pageChange)="onPageChange($event)">
|
||||
<div class="table-responsive">
|
||||
<table id="groups" class="table table-striped table-hover table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="align-middle">{{messagePrefix + '.table.id' | translate}}</th>
|
||||
<th scope="col" class="align-middle">{{messagePrefix + '.table.name' | translate}}</th>
|
||||
<th scope="col" class="align-middle">{{messagePrefix + '.table.collectionOrCommunity' | translate}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@for (group of (groups$ | async)?.payload?.page; track group) {
|
||||
<tr>
|
||||
<td class="align-middle">{{group.id}}</td>
|
||||
<td class="align-middle">
|
||||
<a (click)="groupsDataService.startEditingNewGroup(group)"
|
||||
[routerLink]="[groupsDataService.getGroupEditPageRouterLink(group)]">
|
||||
{{ dsoNameService.getName(group) }}
|
||||
</a>
|
||||
</td>
|
||||
<td class="align-middle">
|
||||
{{ dsoNameService.getName((group.object | async)?.payload) }}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</ds-pagination>
|
||||
}
|
||||
@if ((groups$ | async)?.payload?.totalElements === 0) {
|
||||
<div class="alert alert-info w-100 mb-2" role="alert">
|
||||
<div>{{messagePrefix + '.memberOfNoGroups' | translate}}</div>
|
||||
<div>
|
||||
<button [routerLink]="[groupsDataService.getGroupRegistryRouterLink()]"
|
||||
class="btn btn-primary">{{messagePrefix + '.goToGroups' | translate}}</button>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -25,7 +25,7 @@ import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import {
|
||||
Observable,
|
||||
of as observableOf,
|
||||
of,
|
||||
} from 'rxjs';
|
||||
|
||||
import { AuthService } from '../../../core/auth/auth.service';
|
||||
@@ -91,7 +91,7 @@ describe('EPersonFormComponent', () => {
|
||||
activeEPerson: null,
|
||||
allEpeople: mockEPeople,
|
||||
getActiveEPerson(): Observable<EPerson> {
|
||||
return observableOf(this.activeEPerson);
|
||||
return of(this.activeEPerson);
|
||||
},
|
||||
searchByScope(scope: string, query: string, options: FindListOptions = {}): Observable<RemoteData<PaginatedList<EPerson>>> {
|
||||
if (scope === 'email') {
|
||||
@@ -115,7 +115,7 @@ describe('EPersonFormComponent', () => {
|
||||
this.allEpeople = this.allEpeople.filter((ePerson2: EPerson) => {
|
||||
return (ePerson2.uuid !== ePerson.uuid);
|
||||
});
|
||||
return observableOf(true);
|
||||
return of(true);
|
||||
},
|
||||
create(ePerson: EPerson): Observable<RemoteData<EPerson>> {
|
||||
this.allEpeople = [...this.allEpeople, ePerson];
|
||||
@@ -210,7 +210,7 @@ describe('EPersonFormComponent', () => {
|
||||
});
|
||||
authService = new AuthServiceStub();
|
||||
authorizationService = jasmine.createSpyObj('authorizationService', {
|
||||
isAuthorized: observableOf(true),
|
||||
isAuthorized: of(true),
|
||||
|
||||
});
|
||||
groupsDataService = jasmine.createSpyObj('groupsDataService', {
|
||||
@@ -389,7 +389,7 @@ describe('EPersonFormComponent', () => {
|
||||
});
|
||||
describe('without active EPerson', () => {
|
||||
beforeEach(() => {
|
||||
spyOn(ePersonDataServiceStub, 'getActiveEPerson').and.returnValue(observableOf(undefined));
|
||||
spyOn(ePersonDataServiceStub, 'getActiveEPerson').and.returnValue(of(undefined));
|
||||
component.onSubmit();
|
||||
fixture.detectChanges();
|
||||
});
|
||||
@@ -429,7 +429,7 @@ describe('EPersonFormComponent', () => {
|
||||
},
|
||||
},
|
||||
});
|
||||
spyOn(ePersonDataServiceStub, 'getActiveEPerson').and.returnValue(observableOf(expectedWithId));
|
||||
spyOn(ePersonDataServiceStub, 'getActiveEPerson').and.returnValue(of(expectedWithId));
|
||||
component.ngOnInit();
|
||||
component.onSubmit();
|
||||
fixture.detectChanges();
|
||||
@@ -485,10 +485,10 @@ describe('EPersonFormComponent', () => {
|
||||
spyOn(authService, 'impersonate').and.callThrough();
|
||||
eperson = EPersonMock;
|
||||
component.epersonInitial = eperson;
|
||||
component.canDelete$ = observableOf(true);
|
||||
spyOn(component.epersonService, 'getActiveEPerson').and.returnValue(observableOf(eperson));
|
||||
component.canDelete$ = of(true);
|
||||
spyOn(component.epersonService, 'getActiveEPerson').and.returnValue(of(eperson));
|
||||
modalService = (component as any).modalService;
|
||||
spyOn(modalService, 'open').and.returnValue(Object.assign({ componentInstance: Object.assign({ response: observableOf(true) }) }));
|
||||
spyOn(modalService, 'open').and.returnValue(Object.assign({ componentInstance: Object.assign({ response: of(true) }) }));
|
||||
component.ngOnInit();
|
||||
fixture.detectChanges();
|
||||
});
|
||||
@@ -499,7 +499,7 @@ describe('EPersonFormComponent', () => {
|
||||
});
|
||||
|
||||
it('the delete button should be hidden if the ePerson cannot be deleted', () => {
|
||||
component.canDelete$ = observableOf(false);
|
||||
component.canDelete$ = of(false);
|
||||
fixture.detectChanges();
|
||||
const deleteButton = fixture.debugElement.query(By.css('.delete-button'));
|
||||
expect(deleteButton).toBeNull();
|
||||
|
@@ -1,9 +1,4 @@
|
||||
import {
|
||||
AsyncPipe,
|
||||
NgClass,
|
||||
NgFor,
|
||||
NgIf,
|
||||
} from '@angular/common';
|
||||
import { AsyncPipe } from '@angular/common';
|
||||
import {
|
||||
ChangeDetectorRef,
|
||||
Component,
|
||||
@@ -32,7 +27,7 @@ import {
|
||||
import {
|
||||
combineLatest as observableCombineLatest,
|
||||
Observable,
|
||||
of as observableOf,
|
||||
of,
|
||||
Subscription,
|
||||
} from 'rxjs';
|
||||
import {
|
||||
@@ -83,17 +78,14 @@ import { ValidateEmailNotTaken } from './validators/email-taken.validator';
|
||||
selector: 'ds-eperson-form',
|
||||
templateUrl: './eperson-form.component.html',
|
||||
imports: [
|
||||
FormComponent,
|
||||
NgIf,
|
||||
NgFor,
|
||||
AsyncPipe,
|
||||
TranslateModule,
|
||||
NgClass,
|
||||
ThemedLoadingComponent,
|
||||
BtnDisabledDirective,
|
||||
FormComponent,
|
||||
HasNoValuePipe,
|
||||
PaginationComponent,
|
||||
RouterLink,
|
||||
HasNoValuePipe,
|
||||
BtnDisabledDirective,
|
||||
ThemedLoadingComponent,
|
||||
TranslateModule,
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
@@ -365,7 +357,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
||||
|
||||
this.groups$ = this.activeEPerson$.pipe(
|
||||
switchMap((eperson) => {
|
||||
return observableCombineLatest([observableOf(eperson), this.paginationService.getFindListOptions(this.config.id, {
|
||||
return observableCombineLatest([of(eperson), this.paginationService.getFindListOptions(this.config.id, {
|
||||
currentPage: 1,
|
||||
elementsPerPage: this.config.pageSize,
|
||||
})]);
|
||||
@@ -374,7 +366,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
||||
if (eperson != null) {
|
||||
return this.groupsDataService.findListByHref(eperson._links.groups.href, findListOptions, true, true, followLink('object'));
|
||||
}
|
||||
return observableOf(undefined);
|
||||
return of(undefined);
|
||||
}),
|
||||
);
|
||||
|
||||
@@ -387,14 +379,14 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
||||
if (hasValue(eperson)) {
|
||||
return this.authorizationService.isAuthorized(FeatureID.LoginOnBehalfOf, eperson.self);
|
||||
} else {
|
||||
return observableOf(false);
|
||||
return of(false);
|
||||
}
|
||||
}),
|
||||
);
|
||||
this.canDelete$ = this.activeEPerson$.pipe(
|
||||
switchMap((eperson) => this.authorizationService.isAuthorized(FeatureID.CanDelete, hasValue(eperson) ? eperson.self : undefined)),
|
||||
);
|
||||
this.canReset$ = observableOf(true);
|
||||
this.canReset$ = of(true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -548,16 +540,16 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
||||
take(1),
|
||||
switchMap((confirm: boolean) => {
|
||||
if (confirm && hasValue(eperson.id)) {
|
||||
this.canDelete$ = observableOf(false);
|
||||
this.canDelete$ = of(false);
|
||||
return this.epersonService.deleteEPerson(eperson).pipe(
|
||||
getFirstCompletedRemoteData(),
|
||||
map((restResponse: RemoteData<NoContent>) => ({ restResponse, eperson })),
|
||||
);
|
||||
} else {
|
||||
return observableOf(null);
|
||||
return of(null);
|
||||
}
|
||||
}),
|
||||
finalize(() => this.canDelete$ = observableOf(true)),
|
||||
finalize(() => this.canDelete$ = of(true)),
|
||||
);
|
||||
}),
|
||||
).subscribe(({ restResponse, eperson }: { restResponse: RemoteData<NoContent> | null, eperson: EPerson }) => {
|
||||
|
@@ -2,13 +2,7 @@
|
||||
<div class="group-form row">
|
||||
<div class="col-12">
|
||||
|
||||
<div *ngIf="activeGroup$ | async; then editHeader; else createHeader"></div>
|
||||
|
||||
<ng-template #createHeader>
|
||||
<h1 class="border-bottom pb-2">{{messagePrefix + '.head.create' | translate}}</h1>
|
||||
</ng-template>
|
||||
|
||||
<ng-template #editHeader>
|
||||
@if (activeGroup$ | async) {
|
||||
<h1 class="border-bottom pb-2">
|
||||
<span
|
||||
*dsContextHelp="{
|
||||
@@ -17,47 +11,61 @@
|
||||
iconPlacement: 'right',
|
||||
tooltipPlacement: ['right', 'bottom']
|
||||
}"
|
||||
>
|
||||
>
|
||||
{{messagePrefix + '.head.edit' | translate}}
|
||||
</span>
|
||||
</h1>
|
||||
</ng-template>
|
||||
} @else {
|
||||
<h1 class="border-bottom pb-2">{{messagePrefix + '.head.create' | translate}}</h1>
|
||||
}
|
||||
|
||||
<ng-container *ngIf="(activeGroup$ | async) as groupBeingEdited">
|
||||
<ds-alert *ngIf="groupBeingEdited?.permanent" [type]="AlertType.Warning"
|
||||
[content]="messagePrefix + '.alert.permanent'"></ds-alert>
|
||||
<ng-container *ngIf="(activeGroupLinkedDSO$ | async) as activeGroupLinkedDSO">
|
||||
<ds-alert *ngIf="(canEdit$ | async) !== true" [type]="AlertType.Warning"
|
||||
[content]="(messagePrefix + '.alert.workflowGroup' | translate:{ name: dsoNameService.getName(activeGroupLinkedDSO), comcol: activeGroupLinkedDSO.type, comcolEditRolesRoute: (linkedEditRolesRoute$ | async) })">
|
||||
</ds-alert>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
|
||||
|
||||
@if ((activeGroup$ | async); as groupBeingEdited) {
|
||||
@if (groupBeingEdited?.permanent) {
|
||||
<ds-alert [type]="AlertType.Warning"
|
||||
[content]="messagePrefix + '.alert.permanent'"></ds-alert>
|
||||
}
|
||||
@if ((activeGroupLinkedDSO$ | async); as activeGroupLinkedDSO) {
|
||||
@if ((canEdit$ | async) !== true) {
|
||||
<ds-alert [type]="AlertType.Warning"
|
||||
[content]="(messagePrefix + '.alert.workflowGroup' | translate:{ name: dsoNameService.getName(activeGroupLinkedDSO), comcol: activeGroupLinkedDSO.type, comcolEditRolesRoute: (linkedEditRolesRoute$ | async) })">
|
||||
</ds-alert>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
<ds-form [formId]="formId"
|
||||
[formModel]="formModel"
|
||||
[formGroup]="formGroup"
|
||||
[formLayout]="formLayout"
|
||||
[displayCancel]="false"
|
||||
(submitForm)="onSubmit()">
|
||||
[formModel]="formModel"
|
||||
[formGroup]="formGroup"
|
||||
[formLayout]="formLayout"
|
||||
[displayCancel]="false"
|
||||
(submitForm)="onSubmit()">
|
||||
<div before class="btn-group">
|
||||
<button (click)="onCancel()" type="button"
|
||||
class="btn btn-outline-secondary"><i class="fas fa-arrow-left"></i> {{messagePrefix + '.return' | translate}}</button>
|
||||
</div>
|
||||
<div after *ngIf="(canEdit$ | async) && !(activeGroup$ | async)?.permanent" class="btn-group">
|
||||
<button (click)="delete()" class="btn btn-danger delete-button" type="button">
|
||||
<i class="fa fa-trash"></i> {{ messagePrefix + '.actions.delete' | translate}}
|
||||
</button>
|
||||
</div>
|
||||
</ds-form>
|
||||
class="btn btn-outline-secondary"><i class="fas fa-arrow-left"></i> {{messagePrefix + '.return' | translate}}</button>
|
||||
</div>
|
||||
@if ((canEdit$ | async) && !(activeGroup$ | async)?.permanent) {
|
||||
<div after class="btn-group">
|
||||
<button (click)="delete()" class="btn btn-danger delete-button" type="button">
|
||||
<i class="fa fa-trash"></i> {{ messagePrefix + '.actions.delete' | translate}}
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
</ds-form>
|
||||
|
||||
<ng-container *ngIf="(activeGroup$ | async) as groupBeingEdited">
|
||||
<div class="mb-5">
|
||||
<ds-members-list *ngIf="groupBeingEdited !== undefined"
|
||||
[messagePrefix]="messagePrefix + '.members-list'"></ds-members-list>
|
||||
</div>
|
||||
<ds-subgroups-list *ngIf="groupBeingEdited !== undefined"
|
||||
[messagePrefix]="messagePrefix + '.subgroups-list'"></ds-subgroups-list>
|
||||
</ng-container>
|
||||
@if ((activeGroup$ | async); as groupBeingEdited) {
|
||||
<div class="mb-5">
|
||||
@if (groupBeingEdited !== undefined) {
|
||||
<ds-members-list
|
||||
[messagePrefix]="messagePrefix + '.members-list'"></ds-members-list>
|
||||
}
|
||||
</div>
|
||||
@if (groupBeingEdited !== undefined) {
|
||||
<ds-subgroups-list
|
||||
[messagePrefix]="messagePrefix + '.subgroups-list'"></ds-subgroups-list>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -27,7 +27,7 @@ import { TranslateModule } from '@ngx-translate/core';
|
||||
import { Operation } from 'fast-json-patch';
|
||||
import {
|
||||
Observable,
|
||||
of as observableOf,
|
||||
of,
|
||||
} from 'rxjs';
|
||||
|
||||
import { DSONameService } from '../../../core/breadcrumbs/dso-name.service';
|
||||
@@ -116,7 +116,7 @@ describe('GroupFormComponent', () => {
|
||||
activeGroup: null,
|
||||
createdGroup: null,
|
||||
getActiveGroup(): Observable<Group> {
|
||||
return observableOf(this.activeGroup);
|
||||
return of(this.activeGroup);
|
||||
},
|
||||
getGroupRegistryRouterLink(): string {
|
||||
return '/access-control/groups';
|
||||
@@ -137,7 +137,7 @@ describe('GroupFormComponent', () => {
|
||||
this.activeGroup = null;
|
||||
},
|
||||
findById(id: string) {
|
||||
return observableOf({ payload: null, hasSucceeded: true });
|
||||
return of({ payload: null, hasSucceeded: true });
|
||||
},
|
||||
findByHref(href: string) {
|
||||
return createSuccessfulRemoteDataObject$(this.createdGroup);
|
||||
@@ -164,7 +164,7 @@ describe('GroupFormComponent', () => {
|
||||
},
|
||||
};
|
||||
authorizationService = jasmine.createSpyObj('authorizationService', {
|
||||
isAuthorized: observableOf(true),
|
||||
isAuthorized: of(true),
|
||||
});
|
||||
dsoDataServiceStub = {
|
||||
findByHref(href: string): Observable<RemoteData<DSpaceObject>> {
|
||||
@@ -330,7 +330,7 @@ describe('GroupFormComponent', () => {
|
||||
},
|
||||
},
|
||||
});
|
||||
spyOn(groupsDataServiceStub, 'getActiveGroup').and.returnValue(observableOf(expected));
|
||||
spyOn(groupsDataServiceStub, 'getActiveGroup').and.returnValue(of(expected));
|
||||
spyOn(groupsDataServiceStub, 'patch').and.returnValue(createSuccessfulRemoteDataObject$(expected2));
|
||||
component.ngOnInit();
|
||||
});
|
||||
@@ -417,7 +417,7 @@ describe('GroupFormComponent', () => {
|
||||
},
|
||||
});
|
||||
spyOn(component.submitForm, 'emit');
|
||||
spyOn(dsoDataServiceStub, 'findByHref').and.returnValue(observableOf(expected));
|
||||
spyOn(dsoDataServiceStub, 'findByHref').and.returnValue(of(expected));
|
||||
|
||||
fixture.detectChanges();
|
||||
component.initialisePage();
|
||||
@@ -471,11 +471,11 @@ describe('GroupFormComponent', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
spyOn(groupsDataServiceStub, 'delete').and.callThrough();
|
||||
component.activeGroup$ = observableOf({
|
||||
component.activeGroup$ = of({
|
||||
id: 'active-group',
|
||||
permanent: false,
|
||||
} as Group);
|
||||
component.canEdit$ = observableOf(true);
|
||||
component.canEdit$ = of(true);
|
||||
|
||||
component.initialisePage();
|
||||
|
||||
|
@@ -1,7 +1,4 @@
|
||||
import {
|
||||
AsyncPipe,
|
||||
NgIf,
|
||||
} from '@angular/common';
|
||||
import { AsyncPipe } from '@angular/common';
|
||||
import {
|
||||
ChangeDetectorRef,
|
||||
Component,
|
||||
@@ -90,14 +87,13 @@ import { ValidateGroupExists } from './validators/group-exists.validator';
|
||||
selector: 'ds-group-form',
|
||||
templateUrl: './group-form.component.html',
|
||||
imports: [
|
||||
FormComponent,
|
||||
AlertComponent,
|
||||
NgIf,
|
||||
AsyncPipe,
|
||||
TranslateModule,
|
||||
ContextHelpDirective,
|
||||
FormComponent,
|
||||
MembersListComponent,
|
||||
SubgroupsListComponent,
|
||||
TranslateModule,
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
@@ -504,7 +500,7 @@ export class GroupFormComponent implements OnInit, OnDestroy {
|
||||
this.groupDataService.cancelEditGroup();
|
||||
this.subs.filter((sub) => hasValue(sub)).forEach((sub) => sub.unsubscribe());
|
||||
|
||||
if (hasValue(this.groupNameValueChangeSubscribe)) {
|
||||
if ( hasValue(this.groupNameValueChangeSubscribe) ) {
|
||||
this.groupNameValueChangeSubscribe.unsubscribe();
|
||||
}
|
||||
|
||||
|
@@ -3,63 +3,70 @@
|
||||
|
||||
<h3>{{messagePrefix + '.headMembers' | translate}}</h3>
|
||||
|
||||
<ds-pagination *ngIf="(ePeopleMembersOfGroup | async)?.totalElements > 0"
|
||||
[paginationOptions]="config"
|
||||
[collectionSize]="(ePeopleMembersOfGroup | async)?.totalElements"
|
||||
[hideGear]="true"
|
||||
[hidePagerWhenSinglePage]="true">
|
||||
@if ((ePeopleMembersOfGroup | async)?.totalElements > 0) {
|
||||
<ds-pagination
|
||||
[paginationOptions]="config"
|
||||
[collectionSize]="(ePeopleMembersOfGroup | async)?.totalElements"
|
||||
[hideGear]="true"
|
||||
[hidePagerWhenSinglePage]="true">
|
||||
<div class="table-responsive">
|
||||
<table id="ePeopleMembersOfGroup" class="table table-striped table-hover table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="align-middle">{{messagePrefix + '.table.id' | translate}}</th>
|
||||
<th scope="col" class="align-middle">{{messagePrefix + '.table.name' | translate}}</th>
|
||||
<th scope="col" class="align-middle">{{messagePrefix + '.table.identity' | translate}}</th>
|
||||
<th class="align-middle">{{messagePrefix + '.table.edit' | translate}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@for (epersonDTO of (ePeopleMembersOfGroup | async)?.page; track epersonDTO) {
|
||||
<tr>
|
||||
<td class="align-middle">{{epersonDTO.eperson.id}}</td>
|
||||
<td class="align-middle">
|
||||
<a [routerLink]="getEPersonEditRoute(epersonDTO.eperson.id)">
|
||||
{{ dsoNameService.getName(epersonDTO.eperson) }}
|
||||
</a>
|
||||
</td>
|
||||
<td class="align-middle">
|
||||
{{messagePrefix + '.table.email' | translate}}: {{ epersonDTO.eperson.email ? epersonDTO.eperson.email : '-' }}<br/>
|
||||
{{messagePrefix + '.table.netid' | translate}}: {{ epersonDTO.eperson.netid ? epersonDTO.eperson.netid : '-' }}
|
||||
</td>
|
||||
<td class="align-middle">
|
||||
<div class="btn-group edit-field">
|
||||
@if (epersonDTO.ableToDelete) {
|
||||
<button (click)="deleteMemberFromGroup(epersonDTO.eperson)"
|
||||
[dsBtnDisabled]="actionConfig.remove.disabled"
|
||||
[ngClass]="['btn btn-sm', actionConfig.remove.css]"
|
||||
title="{{messagePrefix + '.table.edit.buttons.remove' | translate: { name: dsoNameService.getName(epersonDTO.eperson) } }}">
|
||||
<i [ngClass]="actionConfig.remove.icon"></i>
|
||||
</button>
|
||||
}
|
||||
@if (!epersonDTO.ableToDelete) {
|
||||
<button
|
||||
(click)="addMemberToGroup(epersonDTO.eperson)"
|
||||
[dsBtnDisabled]="actionConfig.add.disabled"
|
||||
[ngClass]="['btn btn-sm', actionConfig.add.css]"
|
||||
title="{{messagePrefix + '.table.edit.buttons.add' | translate: { name: dsoNameService.getName(epersonDTO.eperson) } }}">
|
||||
<i [ngClass]="actionConfig.add.icon"></i>
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</ds-pagination>
|
||||
}
|
||||
|
||||
<div class="table-responsive">
|
||||
<table id="ePeopleMembersOfGroup" class="table table-striped table-hover table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="align-middle">{{messagePrefix + '.table.id' | translate}}</th>
|
||||
<th scope="col" class="align-middle">{{messagePrefix + '.table.name' | translate}}</th>
|
||||
<th scope="col" class="align-middle">{{messagePrefix + '.table.identity' | translate}}</th>
|
||||
<th class="align-middle">{{messagePrefix + '.table.edit' | translate}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let epersonDTO of (ePeopleMembersOfGroup | async)?.page">
|
||||
<td class="align-middle">{{epersonDTO.eperson.id}}</td>
|
||||
<td class="align-middle">
|
||||
<a [routerLink]="getEPersonEditRoute(epersonDTO.eperson.id)">
|
||||
{{ dsoNameService.getName(epersonDTO.eperson) }}
|
||||
</a>
|
||||
</td>
|
||||
<td class="align-middle">
|
||||
{{messagePrefix + '.table.email' | translate}}: {{ epersonDTO.eperson.email ? epersonDTO.eperson.email : '-' }}<br/>
|
||||
{{messagePrefix + '.table.netid' | translate}}: {{ epersonDTO.eperson.netid ? epersonDTO.eperson.netid : '-' }}
|
||||
</td>
|
||||
<td class="align-middle">
|
||||
<div class="btn-group edit-field">
|
||||
<button (click)="deleteMemberFromGroup(epersonDTO.eperson)"
|
||||
*ngIf="epersonDTO.ableToDelete"
|
||||
[dsBtnDisabled]="actionConfig.remove.disabled"
|
||||
[ngClass]="['btn btn-sm', actionConfig.remove.css]"
|
||||
title="{{messagePrefix + '.table.edit.buttons.remove' | translate: { name: dsoNameService.getName(epersonDTO.eperson) } }}">
|
||||
<i [ngClass]="actionConfig.remove.icon"></i>
|
||||
</button>
|
||||
<button *ngIf="!epersonDTO.ableToDelete"
|
||||
(click)="addMemberToGroup(epersonDTO.eperson)"
|
||||
[dsBtnDisabled]="actionConfig.add.disabled"
|
||||
[ngClass]="['btn btn-sm', actionConfig.add.css]"
|
||||
title="{{messagePrefix + '.table.edit.buttons.add' | translate: { name: dsoNameService.getName(epersonDTO.eperson) } }}">
|
||||
<i [ngClass]="actionConfig.add.icon"></i>
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@if ((ePeopleMembersOfGroup | async) === undefined || (ePeopleMembersOfGroup | async)?.totalElements === 0) {
|
||||
<div class="alert alert-info w-100 mb-2"
|
||||
role="alert">
|
||||
{{messagePrefix + '.no-members-yet' | translate}}
|
||||
</div>
|
||||
|
||||
</ds-pagination>
|
||||
|
||||
<div *ngIf="(ePeopleMembersOfGroup | async) === undefined || (ePeopleMembersOfGroup | async)?.totalElements === 0" class="alert alert-info w-100 mb-2"
|
||||
role="alert">
|
||||
{{messagePrefix + '.no-members-yet' | translate}}
|
||||
</div>
|
||||
}
|
||||
|
||||
<h3 id="search" class="border-bottom pb-2">
|
||||
<span
|
||||
@@ -69,77 +76,81 @@
|
||||
iconPlacement: 'right',
|
||||
tooltipPlacement: ['top', 'right', 'bottom']
|
||||
}"
|
||||
>
|
||||
>
|
||||
{{messagePrefix + '.search.head' | translate}}
|
||||
</span>
|
||||
</h3>
|
||||
|
||||
<form [formGroup]="searchForm" (ngSubmit)="search(searchForm.value)" class="d-flex justify-content-between">
|
||||
<div class="flex-grow-1 mr-3">
|
||||
<div class="form-group input-group mr-3">
|
||||
<div class="flex-grow-1 me-3">
|
||||
<div class="form-group input-group me-3">
|
||||
<input type="text" name="query" id="query" formControlName="query"
|
||||
class="form-control" aria-label="Search input">
|
||||
class="form-control" aria-label="Search input">
|
||||
<span class="input-group-append">
|
||||
<button type="submit" class="search-button btn btn-primary">
|
||||
<i class="fas fa-search"></i> {{ messagePrefix + '.search.button' | translate }}</button>
|
||||
</span>
|
||||
<button type="submit" class="search-button btn btn-primary">
|
||||
<i class="fas fa-search"></i> {{ messagePrefix + '.search.button' | translate }}</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<button (click)="clearFormAndResetResult();"
|
||||
class="btn btn-secondary">{{messagePrefix + '.button.see-all' | translate}}</button>
|
||||
</div>
|
||||
</form>
|
||||
<div>
|
||||
<button (click)="clearFormAndResetResult();"
|
||||
class="btn btn-secondary">{{messagePrefix + '.button.see-all' | translate}}</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<ds-pagination *ngIf="(ePeopleSearch | async)?.totalElements > 0"
|
||||
[paginationOptions]="configSearch"
|
||||
[collectionSize]="(ePeopleSearch | async)?.totalElements"
|
||||
[hideGear]="true"
|
||||
[hidePagerWhenSinglePage]="true">
|
||||
@if ((ePeopleSearch | async)?.totalElements > 0) {
|
||||
<ds-pagination
|
||||
[paginationOptions]="configSearch"
|
||||
[collectionSize]="(ePeopleSearch | async)?.totalElements"
|
||||
[hideGear]="true"
|
||||
[hidePagerWhenSinglePage]="true">
|
||||
<div class="table-responsive">
|
||||
<table id="epersonsSearch" class="table table-striped table-hover table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="align-middle">{{messagePrefix + '.table.id' | translate}}</th>
|
||||
<th scope="col" class="align-middle">{{messagePrefix + '.table.name' | translate}}</th>
|
||||
<th scope="col" class="align-middle">{{messagePrefix + '.table.identity' | translate}}</th>
|
||||
<th class="align-middle">{{messagePrefix + '.table.edit' | translate}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@for (eperson of (ePeopleSearch | async)?.page; track eperson) {
|
||||
<tr>
|
||||
<td class="align-middle">{{eperson.id}}</td>
|
||||
<td class="align-middle">
|
||||
<a [routerLink]="getEPersonEditRoute(eperson.id)">
|
||||
{{ dsoNameService.getName(eperson) }}
|
||||
</a>
|
||||
</td>
|
||||
<td class="align-middle">
|
||||
{{messagePrefix + '.table.email' | translate}}: {{ eperson.email ? eperson.email : '-' }}<br/>
|
||||
{{messagePrefix + '.table.netid' | translate}}: {{ eperson.netid ? eperson.netid : '-' }}
|
||||
</td>
|
||||
<td class="align-middle">
|
||||
<div class="btn-group edit-field">
|
||||
<button (click)="addMemberToGroup(eperson)"
|
||||
[dsBtnDisabled]="actionConfig.add.disabled"
|
||||
[ngClass]="['btn btn-sm', actionConfig.add.css]"
|
||||
title="{{messagePrefix + '.table.edit.buttons.add' | translate: { name: dsoNameService.getName(eperson) } }}">
|
||||
<i [ngClass]="actionConfig.add.icon"></i>
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</ds-pagination>
|
||||
}
|
||||
|
||||
<div class="table-responsive">
|
||||
<table id="epersonsSearch" class="table table-striped table-hover table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="align-middle">{{messagePrefix + '.table.id' | translate}}</th>
|
||||
<th scope="col" class="align-middle">{{messagePrefix + '.table.name' | translate}}</th>
|
||||
<th scope="col" class="align-middle">{{messagePrefix + '.table.identity' | translate}}</th>
|
||||
<th class="align-middle">{{messagePrefix + '.table.edit' | translate}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let eperson of (ePeopleSearch | async)?.page">
|
||||
<td class="align-middle">{{eperson.id}}</td>
|
||||
<td class="align-middle">
|
||||
<a [routerLink]="getEPersonEditRoute(eperson.id)">
|
||||
{{ dsoNameService.getName(eperson) }}
|
||||
</a>
|
||||
</td>
|
||||
<td class="align-middle">
|
||||
{{messagePrefix + '.table.email' | translate}}: {{ eperson.email ? eperson.email : '-' }}<br/>
|
||||
{{messagePrefix + '.table.netid' | translate}}: {{ eperson.netid ? eperson.netid : '-' }}
|
||||
</td>
|
||||
<td class="align-middle">
|
||||
<div class="btn-group edit-field">
|
||||
<button (click)="addMemberToGroup(eperson)"
|
||||
[dsBtnDisabled]="actionConfig.add.disabled"
|
||||
[ngClass]="['btn btn-sm', actionConfig.add.css]"
|
||||
title="{{messagePrefix + '.table.edit.buttons.add' | translate: { name: dsoNameService.getName(eperson) } }}">
|
||||
<i [ngClass]="actionConfig.add.icon"></i>
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@if ((ePeopleSearch | async)?.totalElements === 0 && searchDone) {
|
||||
<div
|
||||
class="alert alert-info w-100 mb-2"
|
||||
role="alert">
|
||||
{{messagePrefix + '.no-items' | translate}}
|
||||
</div>
|
||||
}
|
||||
|
||||
</ds-pagination>
|
||||
|
||||
<div *ngIf="(ePeopleSearch | async)?.totalElements === 0 && searchDone"
|
||||
class="alert alert-info w-100 mb-2"
|
||||
role="alert">
|
||||
{{messagePrefix + '.no-items' | translate}}
|
||||
</div>
|
||||
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
|
@@ -32,7 +32,7 @@ import {
|
||||
} from '@ngx-translate/core';
|
||||
import {
|
||||
Observable,
|
||||
of as observableOf,
|
||||
of,
|
||||
} from 'rxjs';
|
||||
|
||||
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
||||
@@ -113,7 +113,7 @@ describe('MembersListComponent', () => {
|
||||
epersonMembers: epersonMembers,
|
||||
epersonNonMembers: epersonNonMembers,
|
||||
getActiveGroup(): Observable<Group> {
|
||||
return observableOf(activeGroup);
|
||||
return of(activeGroup);
|
||||
},
|
||||
getEPersonMembers() {
|
||||
return this.epersonMembers;
|
||||
@@ -127,7 +127,7 @@ describe('MembersListComponent', () => {
|
||||
this.epersonNonMembers.splice(index, 1);
|
||||
}
|
||||
});
|
||||
return observableOf(new RestResponse(true, 200, 'Success'));
|
||||
return of(new RestResponse(true, 200, 'Success'));
|
||||
},
|
||||
clearGroupsRequests() {
|
||||
// empty
|
||||
@@ -147,7 +147,7 @@ describe('MembersListComponent', () => {
|
||||
});
|
||||
// Add eperson to list of non-members
|
||||
this.epersonNonMembers = [...this.epersonNonMembers, epersonToDelete];
|
||||
return observableOf(new RestResponse(true, 200, 'Success'));
|
||||
return of(new RestResponse(true, 200, 'Success'));
|
||||
},
|
||||
};
|
||||
builderService = getMockFormBuilderService();
|
||||
|
@@ -1,8 +1,6 @@
|
||||
import {
|
||||
AsyncPipe,
|
||||
NgClass,
|
||||
NgForOf,
|
||||
NgIf,
|
||||
} from '@angular/common';
|
||||
import {
|
||||
Component,
|
||||
@@ -27,7 +25,7 @@ import {
|
||||
combineLatest as observableCombineLatest,
|
||||
Observable,
|
||||
ObservedValueOf,
|
||||
of as observableOf,
|
||||
of,
|
||||
Subscription,
|
||||
} from 'rxjs';
|
||||
import {
|
||||
@@ -105,16 +103,14 @@ export interface EPersonListActionConfig {
|
||||
selector: 'ds-members-list',
|
||||
templateUrl: './members-list.component.html',
|
||||
imports: [
|
||||
TranslateModule,
|
||||
ContextHelpDirective,
|
||||
ReactiveFormsModule,
|
||||
PaginationComponent,
|
||||
NgIf,
|
||||
AsyncPipe,
|
||||
RouterLink,
|
||||
NgClass,
|
||||
NgForOf,
|
||||
BtnDisabledDirective,
|
||||
ContextHelpDirective,
|
||||
NgClass,
|
||||
PaginationComponent,
|
||||
ReactiveFormsModule,
|
||||
RouterLink,
|
||||
TranslateModule,
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
@@ -264,7 +260,7 @@ export class MembersListComponent implements OnInit, OnDestroy {
|
||||
* @param possibleMember EPerson that is a possible member (being tested) of the group currently being edited
|
||||
*/
|
||||
isMemberOfGroup(possibleMember: EPerson): Observable<boolean> {
|
||||
return observableOf(true);
|
||||
return of(true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -3,51 +3,56 @@
|
||||
|
||||
<h4>{{messagePrefix + '.headSubgroups' | translate}}</h4>
|
||||
|
||||
<ds-pagination *ngIf="(subGroups$ | async)?.payload?.totalElements > 0"
|
||||
[paginationOptions]="config"
|
||||
[collectionSize]="(subGroups$ | async)?.payload?.totalElements"
|
||||
[hideGear]="true"
|
||||
[hidePagerWhenSinglePage]="true">
|
||||
|
||||
<div class="table-responsive">
|
||||
<table id="subgroupsOfGroup" class="table table-striped table-hover table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="align-middle">{{messagePrefix + '.table.id' | translate}}</th>
|
||||
<th scope="col" class="align-middle">{{messagePrefix + '.table.name' | translate}}</th>
|
||||
<th scope="col" class="align-middle">{{messagePrefix + '.table.collectionOrCommunity' | translate}}</th>
|
||||
<th>{{messagePrefix + '.table.edit' | translate}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let group of (subGroups$ | async)?.payload?.page">
|
||||
<td class="align-middle">{{group.id}}</td>
|
||||
<td class="align-middle">
|
||||
<a (click)="groupDataService.startEditingNewGroup(group)"
|
||||
[routerLink]="[groupDataService.getGroupEditPageRouterLink(group)]">
|
||||
{{ dsoNameService.getName(group) }}
|
||||
</a>
|
||||
</td>
|
||||
<td class="align-middle">{{ dsoNameService.getName((group.object | async)?.payload)}}</td>
|
||||
<td class="align-middle">
|
||||
<div class="btn-group edit-field">
|
||||
<button (click)="deleteSubgroupFromGroup(group)"
|
||||
@if ((subGroups$ | async)?.payload?.totalElements > 0) {
|
||||
<ds-pagination
|
||||
[paginationOptions]="config"
|
||||
[collectionSize]="(subGroups$ | async)?.payload?.totalElements"
|
||||
[hideGear]="true"
|
||||
[hidePagerWhenSinglePage]="true">
|
||||
<div class="table-responsive">
|
||||
<table id="subgroupsOfGroup" class="table table-striped table-hover table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="align-middle">{{messagePrefix + '.table.id' | translate}}</th>
|
||||
<th scope="col" class="align-middle">{{messagePrefix + '.table.name' | translate}}</th>
|
||||
<th scope="col" class="align-middle">{{messagePrefix + '.table.collectionOrCommunity' | translate}}</th>
|
||||
<th>{{messagePrefix + '.table.edit' | translate}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@for (group of (subGroups$ | async)?.payload?.page; track group) {
|
||||
<tr>
|
||||
<td class="align-middle">{{group.id}}</td>
|
||||
<td class="align-middle">
|
||||
<a (click)="groupDataService.startEditingNewGroup(group)"
|
||||
[routerLink]="[groupDataService.getGroupEditPageRouterLink(group)]">
|
||||
{{ dsoNameService.getName(group) }}
|
||||
</a>
|
||||
</td>
|
||||
<td class="align-middle">{{ dsoNameService.getName((group.object | async)?.payload)}}</td>
|
||||
<td class="align-middle">
|
||||
<div class="btn-group edit-field">
|
||||
<button (click)="deleteSubgroupFromGroup(group)"
|
||||
class="btn btn-outline-danger btn-sm deleteButton"
|
||||
title="{{messagePrefix + '.table.edit.buttons.remove' | translate: { name: dsoNameService.getName(group) } }}">
|
||||
<i class="fas fa-trash-alt fa-fw"></i>
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</ds-pagination>
|
||||
<i class="fas fa-trash-alt fa-fw"></i>
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</ds-pagination>
|
||||
}
|
||||
|
||||
<div *ngIf="(subGroups$ | async)?.payload?.totalElements === 0" class="alert alert-info w-100 mb-2"
|
||||
role="alert">
|
||||
{{messagePrefix + '.no-subgroups-yet' | translate}}
|
||||
</div>
|
||||
@if ((subGroups$ | async)?.payload?.totalElements === 0) {
|
||||
<div class="alert alert-info w-100 mb-2"
|
||||
role="alert">
|
||||
{{messagePrefix + '.no-subgroups-yet' | translate}}
|
||||
</div>
|
||||
}
|
||||
|
||||
<h4 id="search" class="border-bottom pb-2">
|
||||
<span *dsContextHelp="{
|
||||
@@ -56,75 +61,80 @@
|
||||
iconPlacement: 'right',
|
||||
tooltipPlacement: ['top', 'right', 'bottom']
|
||||
}"
|
||||
>
|
||||
>
|
||||
{{messagePrefix + '.search.head' | translate}}
|
||||
</span>
|
||||
|
||||
</h4>
|
||||
<form [formGroup]="searchForm" (ngSubmit)="search(searchForm.value)" class="d-flex justify-content-between">
|
||||
<div class="flex-grow-1 mr-3">
|
||||
<div class="form-group input-group mr-3">
|
||||
<div class="flex-grow-1 me-3">
|
||||
<div class="mb-3 input-group me-3">
|
||||
<input type="text" name="query" id="query" formControlName="query"
|
||||
class="form-control" aria-label="Search input">
|
||||
class="form-control" aria-label="Search input">
|
||||
<span class="input-group-append">
|
||||
<button type="submit" class="search-button btn btn-primary">
|
||||
<i class="fas fa-search"></i> {{ messagePrefix + '.search.button' | translate }}
|
||||
</button>
|
||||
<button type="submit" class="search-button btn btn-primary">
|
||||
<i class="fas fa-search"></i> {{ messagePrefix + '.search.button' | translate }}
|
||||
</button>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<button (click)="clearFormAndResetResult();" class="btn btn-secondary float-right">
|
||||
<button (click)="clearFormAndResetResult();" class="btn btn-secondary float-end">
|
||||
{{messagePrefix + '.button.see-all' | translate}}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<ds-pagination *ngIf="(searchResults$ | async)?.payload?.totalElements > 0"
|
||||
[paginationOptions]="configSearch"
|
||||
[collectionSize]="(searchResults$ | async)?.payload?.totalElements"
|
||||
[hideGear]="true"
|
||||
[hidePagerWhenSinglePage]="true">
|
||||
|
||||
<div class="table-responsive">
|
||||
<table id="groupsSearch" class="table table-striped table-hover table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="align-middle">{{messagePrefix + '.table.id' | translate}}</th>
|
||||
<th scope="col" class="align-middle">{{messagePrefix + '.table.name' | translate}}</th>
|
||||
<th scope="col" class="align-middle">{{messagePrefix + '.table.collectionOrCommunity' | translate}}</th>
|
||||
<th class="align-middle">{{messagePrefix + '.table.edit' | translate}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let group of (searchResults$ | async)?.payload?.page">
|
||||
<td class="align-middle">{{group.id}}</td>
|
||||
<td class="align-middle">
|
||||
<a (click)="groupDataService.startEditingNewGroup(group)"
|
||||
[routerLink]="[groupDataService.getGroupEditPageRouterLink(group)]">
|
||||
{{ dsoNameService.getName(group) }}
|
||||
</a>
|
||||
</td>
|
||||
<td class="align-middle">{{ dsoNameService.getName((group.object | async)?.payload) }}</td>
|
||||
<td class="align-middle">
|
||||
<div class="btn-group edit-field">
|
||||
<button (click)="addSubgroupToGroup(group)"
|
||||
@if ((searchResults$ | async)?.payload?.totalElements > 0) {
|
||||
<ds-pagination
|
||||
[paginationOptions]="configSearch"
|
||||
[collectionSize]="(searchResults$ | async)?.payload?.totalElements"
|
||||
[hideGear]="true"
|
||||
[hidePagerWhenSinglePage]="true">
|
||||
<div class="table-responsive">
|
||||
<table id="groupsSearch" class="table table-striped table-hover table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="align-middle">{{messagePrefix + '.table.id' | translate}}</th>
|
||||
<th scope="col" class="align-middle">{{messagePrefix + '.table.name' | translate}}</th>
|
||||
<th scope="col" class="align-middle">{{messagePrefix + '.table.collectionOrCommunity' | translate}}</th>
|
||||
<th class="align-middle">{{messagePrefix + '.table.edit' | translate}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@for (group of (searchResults$ | async)?.payload?.page; track group) {
|
||||
<tr>
|
||||
<td class="align-middle">{{group.id}}</td>
|
||||
<td class="align-middle">
|
||||
<a (click)="groupDataService.startEditingNewGroup(group)"
|
||||
[routerLink]="[groupDataService.getGroupEditPageRouterLink(group)]">
|
||||
{{ dsoNameService.getName(group) }}
|
||||
</a>
|
||||
</td>
|
||||
<td class="align-middle">{{ dsoNameService.getName((group.object | async)?.payload) }}</td>
|
||||
<td class="align-middle">
|
||||
<div class="btn-group edit-field">
|
||||
<button (click)="addSubgroupToGroup(group)"
|
||||
class="btn btn-outline-primary btn-sm addButton"
|
||||
title="{{messagePrefix + '.table.edit.buttons.add' | translate: { name: dsoNameService.getName(group) } }}">
|
||||
<i class="fas fa-plus fa-fw"></i>
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</ds-pagination>
|
||||
<i class="fas fa-plus fa-fw"></i>
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</ds-pagination>
|
||||
}
|
||||
|
||||
<div *ngIf="(searchResults$ | async)?.payload?.totalElements === 0 && searchDone" class="alert alert-info w-100 mb-2"
|
||||
role="alert">
|
||||
{{messagePrefix + '.no-items' | translate}}
|
||||
</div>
|
||||
@if ((searchResults$ | async)?.payload?.totalElements === 0 && searchDone) {
|
||||
<div class="alert alert-info w-100 mb-2"
|
||||
role="alert">
|
||||
{{messagePrefix + '.no-items' | translate}}
|
||||
</div>
|
||||
}
|
||||
|
||||
</ng-container>
|
||||
|
@@ -31,7 +31,7 @@ import {
|
||||
} from '@ngx-translate/core';
|
||||
import {
|
||||
Observable,
|
||||
of as observableOf,
|
||||
of,
|
||||
} from 'rxjs';
|
||||
import { EPersonMock2 } from 'src/app/shared/testing/eperson.mock';
|
||||
|
||||
@@ -108,7 +108,7 @@ describe('SubgroupsListComponent', () => {
|
||||
subgroups: subgroups,
|
||||
groupNonMembers: groupNonMembers,
|
||||
getActiveGroup(): Observable<Group> {
|
||||
return observableOf(this.activeGroup);
|
||||
return of(this.activeGroup);
|
||||
},
|
||||
getSubgroups(): Group {
|
||||
return this.subgroups;
|
||||
@@ -138,7 +138,7 @@ describe('SubgroupsListComponent', () => {
|
||||
this.groupNonMembers.splice(index, 1);
|
||||
}
|
||||
});
|
||||
return observableOf(new RestResponse(true, 200, 'Success'));
|
||||
return of(new RestResponse(true, 200, 'Success'));
|
||||
},
|
||||
clearGroupsRequests() {
|
||||
// empty
|
||||
@@ -155,7 +155,7 @@ describe('SubgroupsListComponent', () => {
|
||||
});
|
||||
// Add group to list of non-members
|
||||
this.groupNonMembers = [...this.groupNonMembers, subgroupToDelete];
|
||||
return observableOf(new RestResponse(true, 200, 'Success'));
|
||||
return of(new RestResponse(true, 200, 'Success'));
|
||||
},
|
||||
};
|
||||
routerStub = new RouterMock();
|
||||
|
@@ -1,8 +1,4 @@
|
||||
import {
|
||||
AsyncPipe,
|
||||
NgForOf,
|
||||
NgIf,
|
||||
} from '@angular/common';
|
||||
import { AsyncPipe } from '@angular/common';
|
||||
import {
|
||||
Component,
|
||||
Input,
|
||||
@@ -63,14 +59,12 @@ enum SubKey {
|
||||
selector: 'ds-subgroups-list',
|
||||
templateUrl: './subgroups-list.component.html',
|
||||
imports: [
|
||||
RouterLink,
|
||||
AsyncPipe,
|
||||
NgForOf,
|
||||
ContextHelpDirective,
|
||||
TranslateModule,
|
||||
ReactiveFormsModule,
|
||||
PaginationComponent,
|
||||
NgIf,
|
||||
ReactiveFormsModule,
|
||||
RouterLink,
|
||||
TranslateModule,
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
|
@@ -9,7 +9,7 @@ import {
|
||||
} from '@angular/router';
|
||||
import {
|
||||
Observable,
|
||||
of as observableOf,
|
||||
of,
|
||||
} from 'rxjs';
|
||||
|
||||
import { AuthService } from '../../core/auth/auth.service';
|
||||
@@ -37,7 +37,7 @@ describe('GroupPageGuard', () => {
|
||||
|
||||
function init() {
|
||||
halEndpointService = jasmine.createSpyObj(['getEndpoint']);
|
||||
( halEndpointService as any ).getEndpoint.and.returnValue(observableOf(groupsEndpointUrl));
|
||||
( halEndpointService as any ).getEndpoint.and.returnValue(of(groupsEndpointUrl));
|
||||
|
||||
authorizationService = jasmine.createSpyObj(['isAuthorized']);
|
||||
// NOTE: value is set in beforeEach
|
||||
@@ -46,7 +46,7 @@ describe('GroupPageGuard', () => {
|
||||
( router as any ).parseUrl.and.returnValue = {};
|
||||
|
||||
authService = jasmine.createSpyObj(['isAuthenticated']);
|
||||
( authService as any ).isAuthenticated.and.returnValue(observableOf(true));
|
||||
( authService as any ).isAuthenticated.and.returnValue(of(true));
|
||||
|
||||
TestBed.configureTestingModule({
|
||||
providers: [
|
||||
@@ -69,7 +69,7 @@ describe('GroupPageGuard', () => {
|
||||
describe('canActivate', () => {
|
||||
describe('when the current user can manage the group', () => {
|
||||
beforeEach(() => {
|
||||
( authorizationService as any ).isAuthorized.and.returnValue(observableOf(true));
|
||||
( authorizationService as any ).isAuthorized.and.returnValue(of(true));
|
||||
});
|
||||
|
||||
it('should return true', (done) => {
|
||||
@@ -89,7 +89,7 @@ describe('GroupPageGuard', () => {
|
||||
|
||||
describe('when the current user can not manage the group', () => {
|
||||
beforeEach(() => {
|
||||
(authorizationService as any).isAuthorized.and.returnValue(observableOf(false));
|
||||
(authorizationService as any).isAuthorized.and.returnValue(of(false));
|
||||
});
|
||||
|
||||
it('should not return true', (done) => {
|
||||
|
@@ -6,7 +6,7 @@ import {
|
||||
} from '@angular/router';
|
||||
import {
|
||||
Observable,
|
||||
of as observableOf,
|
||||
of,
|
||||
} from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
|
||||
@@ -33,6 +33,6 @@ export const groupPageGuard = (
|
||||
getObjectUrl = defaultGroupPageGetObjectUrl,
|
||||
getEPersonUuid?: StringGuardParamFn,
|
||||
): CanActivateFn => someFeatureAuthorizationGuard(
|
||||
() => observableOf([FeatureID.CanManageGroup]),
|
||||
() => of([FeatureID.CanManageGroup]),
|
||||
getObjectUrl,
|
||||
getEPersonUuid);
|
||||
|
@@ -4,21 +4,21 @@
|
||||
<div class="d-flex justify-content-between border-bottom mb-3">
|
||||
<h1 id="header" class="pb-2">{{messagePrefix + 'head' | translate}}</h1>
|
||||
<div>
|
||||
<button class="mr-auto btn btn-success"
|
||||
[routerLink]="'create'">
|
||||
<button class="me-auto btn btn-success"
|
||||
[routerLink]="'create'">
|
||||
<i class="fas fa-plus"></i>
|
||||
<span class="d-none d-sm-inline ml-1">{{messagePrefix + 'button.add' | translate}}</span>
|
||||
<span class="d-none d-sm-inline ms-1">{{messagePrefix + 'button.add' | translate}}</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2 id="search" class="border-bottom pb-2">{{messagePrefix + 'search.head' | translate}}</h2>
|
||||
<form [formGroup]="searchForm" (ngSubmit)="search(searchForm.value)" class="d-flex justify-content-between">
|
||||
<div class="flex-grow-1 mr-3">
|
||||
<div class="form-group input-group">
|
||||
<div class="flex-grow-1 me-3">
|
||||
<div class="mb-3 input-group">
|
||||
<input type="text" name="query" id="query" formControlName="query"
|
||||
class="form-control" [attr.aria-label]="messagePrefix + 'search.placeholder' | translate"
|
||||
[placeholder]="(messagePrefix + 'search.placeholder' | translate)" >
|
||||
class="form-control" [attr.aria-label]="messagePrefix + 'search.placeholder' | translate"
|
||||
[placeholder]="(messagePrefix + 'search.placeholder' | translate)" >
|
||||
<span class="input-group-append">
|
||||
<button type="submit" class="search-button btn btn-primary">
|
||||
<i class="fas fa-search"></i> {{ messagePrefix + 'search.button' | translate }}
|
||||
@@ -33,66 +33,78 @@
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<ds-loading *ngIf="loading$ | async"></ds-loading>
|
||||
<ds-pagination
|
||||
*ngIf="(pageInfoState$ | async)?.totalElements > 0 && (loading$ | async) !== true"
|
||||
[paginationOptions]="config"
|
||||
[collectionSize]="(pageInfoState$ | async)?.totalElements"
|
||||
[hideGear]="true"
|
||||
[hidePagerWhenSinglePage]="true">
|
||||
@if (loading$ | async) {
|
||||
<ds-loading></ds-loading>
|
||||
}
|
||||
@if ((pageInfoState$ | async)?.totalElements > 0 && (loading$ | async) !== true) {
|
||||
<ds-pagination
|
||||
[paginationOptions]="config"
|
||||
[collectionSize]="(pageInfoState$ | async)?.totalElements"
|
||||
[hideGear]="true"
|
||||
[hidePagerWhenSinglePage]="true">
|
||||
<div class="table-responsive">
|
||||
<table id="groups" class="table table-striped table-hover table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">{{messagePrefix + 'table.id' | translate}}</th>
|
||||
<th scope="col">{{messagePrefix + 'table.name' | translate}}</th>
|
||||
<th scope="col">{{messagePrefix + 'table.collectionOrCommunity' | translate}}</th>
|
||||
<th scope="col">{{messagePrefix + 'table.members' | translate}}</th>
|
||||
<th>{{messagePrefix + 'table.edit' | translate}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@for (groupDto of (groupsDto$ | async)?.page; track groupDto) {
|
||||
<tr>
|
||||
<td>{{groupDto.group.id}}</td>
|
||||
<td>{{ dsoNameService.getName(groupDto.group) }}</td>
|
||||
<td>{{ dsoNameService.getName((groupDto.group.object | async)?.payload) }}</td>
|
||||
<td>{{groupDto.epersons?.totalElements + groupDto.subgroups?.totalElements}}</td>
|
||||
<td>
|
||||
<div class="btn-group edit-field">
|
||||
@switch (groupDto.ableToEdit) {
|
||||
@case (true) {
|
||||
<button
|
||||
[routerLink]="groupService.getGroupEditPageRouterLink(groupDto.group)"
|
||||
class="btn btn-outline-primary btn-sm btn-edit"
|
||||
title="{{messagePrefix + 'table.edit.buttons.edit' | translate: {name: dsoNameService.getName(groupDto.group) } }}"
|
||||
>
|
||||
<i class="fas fa-edit fa-fw"></i>
|
||||
</button>
|
||||
}
|
||||
@case (false) {
|
||||
<button
|
||||
[dsBtnDisabled]="true"
|
||||
class="btn btn-outline-primary btn-sm btn-edit"
|
||||
placement="left"
|
||||
[ngbTooltip]="'admin.access-control.epeople.table.edit.buttons.edit-disabled' | translate"
|
||||
>
|
||||
<i class="fas fa-edit fa-fw"></i>
|
||||
</button>
|
||||
}
|
||||
}
|
||||
@if (!groupDto.group?.permanent && groupDto.ableToDelete) {
|
||||
<button
|
||||
(click)="deleteGroup(groupDto)" class="btn btn-outline-danger btn-sm btn-delete"
|
||||
title="{{messagePrefix + 'table.edit.buttons.remove' | translate: {name: dsoNameService.getName(groupDto.group) } }}">
|
||||
<i class="fas fa-trash-alt fa-fw"></i>
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</ds-pagination>
|
||||
}
|
||||
|
||||
<div class="table-responsive">
|
||||
<table id="groups" class="table table-striped table-hover table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">{{messagePrefix + 'table.id' | translate}}</th>
|
||||
<th scope="col">{{messagePrefix + 'table.name' | translate}}</th>
|
||||
<th scope="col">{{messagePrefix + 'table.collectionOrCommunity' | translate}}</th>
|
||||
<th scope="col">{{messagePrefix + 'table.members' | translate}}</th>
|
||||
<th>{{messagePrefix + 'table.edit' | translate}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let groupDto of (groupsDto$ | async)?.page">
|
||||
<td>{{groupDto.group.id}}</td>
|
||||
<td>{{ dsoNameService.getName(groupDto.group) }}</td>
|
||||
<td>{{ dsoNameService.getName((groupDto.group.object | async)?.payload) }}</td>
|
||||
<td>{{groupDto.epersons?.totalElements + groupDto.subgroups?.totalElements}}</td>
|
||||
<td>
|
||||
<div class="btn-group edit-field">
|
||||
<ng-container [ngSwitch]="groupDto.ableToEdit">
|
||||
<button *ngSwitchCase="true"
|
||||
[routerLink]="groupService.getGroupEditPageRouterLink(groupDto.group)"
|
||||
class="btn btn-outline-primary btn-sm btn-edit"
|
||||
title="{{messagePrefix + 'table.edit.buttons.edit' | translate: {name: dsoNameService.getName(groupDto.group) } }}"
|
||||
>
|
||||
<i class="fas fa-edit fa-fw"></i>
|
||||
</button>
|
||||
<button *ngSwitchCase="false"
|
||||
[dsBtnDisabled]="true"
|
||||
class="btn btn-outline-primary btn-sm btn-edit"
|
||||
placement="left"
|
||||
[ngbTooltip]="'admin.access-control.epeople.table.edit.buttons.edit-disabled' | translate"
|
||||
>
|
||||
<i class="fas fa-edit fa-fw"></i>
|
||||
</button>
|
||||
</ng-container>
|
||||
<button *ngIf="!groupDto.group?.permanent && groupDto.ableToDelete"
|
||||
(click)="deleteGroup(groupDto)" class="btn btn-outline-danger btn-sm btn-delete"
|
||||
title="{{messagePrefix + 'table.edit.buttons.remove' | translate: {name: dsoNameService.getName(groupDto.group) } }}">
|
||||
<i class="fas fa-trash-alt fa-fw"></i>
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@if ((pageInfoState$ | async)?.totalElements === 0) {
|
||||
<div class="alert alert-info w-100 mb-2" role="alert">
|
||||
{{messagePrefix + 'no-items' | translate}}
|
||||
</div>
|
||||
</ds-pagination>
|
||||
|
||||
<div *ngIf="(pageInfoState$ | async)?.totalElements === 0" class="alert alert-info w-100 mb-2" role="alert">
|
||||
{{messagePrefix + 'no-items' | translate}}
|
||||
</div>
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user