mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Compare commits
1501 Commits
dspace-7.5
...
dspace-7.6
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c5448fe252 | ||
![]() |
a705067aed | ||
![]() |
28bd6a5fe6 | ||
![]() |
5b2966cf48 | ||
![]() |
735a3af254 | ||
![]() |
3036e72c4c | ||
![]() |
4eacdfb113 | ||
![]() |
fbb97167d6 | ||
![]() |
2d881c9621 | ||
![]() |
31508ed5eb | ||
![]() |
3895d26d0b | ||
![]() |
e9b39ff106 | ||
![]() |
8615c70ccc | ||
![]() |
93f1ae0b49 | ||
![]() |
8990a2d132 | ||
![]() |
f4eb8876c2 | ||
![]() |
eb7a93a12f | ||
![]() |
69eedf4015 | ||
![]() |
ff31c302e2 | ||
![]() |
7b554a48f9 | ||
![]() |
c088ccb32e | ||
![]() |
1990120fa0 | ||
![]() |
1444271e69 | ||
![]() |
09bf25a233 | ||
![]() |
9580b29491 | ||
![]() |
5fe6dfb949 | ||
![]() |
ebb846f2a9 | ||
![]() |
983e955398 | ||
![]() |
36266dffef | ||
![]() |
53fb9f85fc | ||
![]() |
16210365be | ||
![]() |
a0260f5267 | ||
![]() |
2d28dfc6e6 | ||
![]() |
31ab05f4fe | ||
![]() |
813db7cc9f | ||
![]() |
0d3db9f19d | ||
![]() |
1f4700cb91 | ||
![]() |
27c57d6f4e | ||
![]() |
3f7e273597 | ||
![]() |
6d1e6f90fc | ||
![]() |
8ee375016f | ||
![]() |
f1706e24c2 | ||
![]() |
33b59c739d | ||
![]() |
2d81a487d3 | ||
![]() |
df8f0db784 | ||
![]() |
950038e6df | ||
![]() |
769210bef2 | ||
![]() |
7d5e499f21 | ||
![]() |
cbee67cd4b | ||
![]() |
5580c81ff7 | ||
![]() |
73be8a972c | ||
![]() |
5f5f6da067 | ||
![]() |
be817b0ab6 | ||
![]() |
bedfe02f65 | ||
![]() |
227d47154c | ||
![]() |
4a70382072 | ||
![]() |
c687d3ff5d | ||
![]() |
491a61b8b1 | ||
![]() |
8c6df7ac8e | ||
![]() |
8c35ca86c8 | ||
![]() |
7993020463 | ||
![]() |
8b3010be0c | ||
![]() |
2843659416 | ||
![]() |
a77d80946b | ||
![]() |
a3a298f51e | ||
![]() |
c332600633 | ||
![]() |
f1b397fc11 | ||
![]() |
7a9bb4d726 | ||
![]() |
975e9fd356 | ||
![]() |
6cab13a876 | ||
![]() |
da439000ac | ||
![]() |
f8a8b90556 | ||
![]() |
7b374f7a32 | ||
![]() |
14dbced218 | ||
![]() |
9053489ddd | ||
![]() |
f7c9058e50 | ||
![]() |
f65b96412a | ||
![]() |
088e56fb8a | ||
![]() |
1b38f2d25d | ||
![]() |
e0fb590b02 | ||
![]() |
8ea7a2572a | ||
![]() |
3edb663b21 | ||
![]() |
432692edc8 | ||
![]() |
dfc304f9aa | ||
![]() |
d1890e0253 | ||
![]() |
66832eeb28 | ||
![]() |
83b67149a6 | ||
![]() |
ba1eee27b3 | ||
![]() |
bb055e12fb | ||
![]() |
242043b3f8 | ||
![]() |
170c7ac6cc | ||
![]() |
c2ddaf286d | ||
![]() |
071fa370bf | ||
![]() |
eeb562dd14 | ||
![]() |
479adf6519 | ||
![]() |
84e4cc01cc | ||
![]() |
d95574df6f | ||
![]() |
40b4df6354 | ||
![]() |
7a364fddeb | ||
![]() |
d9a5f324a5 | ||
![]() |
fdafa0f034 | ||
![]() |
d55b0c0dd3 | ||
![]() |
30c025c5c1 | ||
![]() |
75718bf3ec | ||
![]() |
36fa4d4cae | ||
![]() |
1aa6d358bb | ||
![]() |
5e59403779 | ||
![]() |
6ff9edaa8b | ||
![]() |
876ecb1d12 | ||
![]() |
9bd154792a | ||
![]() |
d43c44e911 | ||
![]() |
8467bb7c0a | ||
![]() |
01719822c1 | ||
![]() |
ffbe407d83 | ||
![]() |
202c84c484 | ||
![]() |
6ac2e9a95d | ||
![]() |
daff8a4594 | ||
![]() |
ae8e0f9ae8 | ||
![]() |
0aadcdfdd9 | ||
![]() |
a658bf4531 | ||
![]() |
4541788a34 | ||
![]() |
c44fce9e0f | ||
![]() |
cb59c05baf | ||
![]() |
d75b158ee1 | ||
![]() |
1c50dbf4c6 | ||
![]() |
ce3eb76190 | ||
![]() |
6dac7ceec4 | ||
![]() |
3454ca99f3 | ||
![]() |
dd5a167d0d | ||
![]() |
9f3ee32858 | ||
![]() |
3ae9c8e9f8 | ||
![]() |
3c9cb4e3b6 | ||
![]() |
f80d1fdc68 | ||
![]() |
4bf8944c48 | ||
![]() |
2b0f0f627e | ||
![]() |
b7b1c3e582 | ||
![]() |
488958c251 | ||
![]() |
26c234e36c | ||
![]() |
55e742fbfb | ||
![]() |
0be17bb0ed | ||
![]() |
aa7496e41d | ||
![]() |
bc5262f5f7 | ||
![]() |
07a91222c4 | ||
![]() |
b06bece1cb | ||
![]() |
053844a7bc | ||
![]() |
7129d6b9c8 | ||
![]() |
ae35461516 | ||
![]() |
a250de49a0 | ||
![]() |
13775e53de | ||
![]() |
e9c5340f67 | ||
![]() |
861132d04d | ||
![]() |
a7517d6814 | ||
![]() |
971c07632a | ||
![]() |
45840c1c17 | ||
![]() |
91d72c19dd | ||
![]() |
5301a8fc51 | ||
![]() |
27d00d133a | ||
![]() |
6447c3769b | ||
![]() |
ebb99c813a | ||
![]() |
e1fe4031e5 | ||
![]() |
65860b81b1 | ||
![]() |
dabc0e9b4b | ||
![]() |
2530845b9b | ||
![]() |
f055ff6fbd | ||
![]() |
e4b098e64d | ||
![]() |
132e1f9524 | ||
![]() |
679702bb5a | ||
![]() |
f8e0cc6808 | ||
![]() |
45ab7231a0 | ||
![]() |
c794e1ebde | ||
![]() |
7d49666865 | ||
![]() |
7e6f736b2f | ||
![]() |
b43e99518d | ||
![]() |
7a5694347a | ||
![]() |
92f2a77dae | ||
![]() |
57c2b02277 | ||
![]() |
fde0ebf872 | ||
![]() |
268d2e54fc | ||
![]() |
59197cff2d | ||
![]() |
da31c4f253 | ||
![]() |
4aa3158f33 | ||
![]() |
3768dc030e | ||
![]() |
27286998f7 | ||
![]() |
d8b6e86896 | ||
![]() |
47537a019c | ||
![]() |
8e59b7d0b0 | ||
![]() |
f72725ceed | ||
![]() |
4251630ab8 | ||
![]() |
e2c2174bf7 | ||
![]() |
de1a240140 | ||
![]() |
b12bdfdd22 | ||
![]() |
971c302378 | ||
![]() |
b758d0a5f9 | ||
![]() |
78f1d9f763 | ||
![]() |
90dc0e3f61 | ||
![]() |
fd10fbe2a8 | ||
![]() |
3b11ac517c | ||
![]() |
a1090fbb0d | ||
![]() |
4239d37a38 | ||
![]() |
a87a5f9b5e | ||
![]() |
777fc571b0 | ||
![]() |
dc92bbd80a | ||
![]() |
d503e4db07 | ||
![]() |
bba7fe2f74 | ||
![]() |
ed8e280aa4 | ||
![]() |
60d93e653f | ||
![]() |
fb8733ca0b | ||
![]() |
2dfa075423 | ||
![]() |
43137fe676 | ||
![]() |
d05438dc3e | ||
![]() |
25cb0455e2 | ||
![]() |
692bb991a0 | ||
![]() |
badf00258c | ||
![]() |
4c693a1294 | ||
![]() |
85922433a5 | ||
![]() |
3caac21648 | ||
![]() |
f26b265e64 | ||
![]() |
89c88ca6e0 | ||
![]() |
e3f1fa39d5 | ||
![]() |
49efc4175d | ||
![]() |
48e9817245 | ||
![]() |
a9c3008cee | ||
![]() |
8efc401811 | ||
![]() |
9518f70b42 | ||
![]() |
2f5c3b1267 | ||
![]() |
bb16983029 | ||
![]() |
5b1438f09f | ||
![]() |
510968b0c6 | ||
![]() |
8718bd0df6 | ||
![]() |
7d2fdb7598 | ||
![]() |
6c6afbf148 | ||
![]() |
d95d5753b4 | ||
![]() |
2178e0e6a3 | ||
![]() |
77f3b97e46 | ||
![]() |
203b0bbbaf | ||
![]() |
781de6e998 | ||
![]() |
6fefbe129d | ||
![]() |
3add551bde | ||
![]() |
51f48b31dc | ||
![]() |
b2adc42aaf | ||
![]() |
f2dab663ca | ||
![]() |
0f09920cb1 | ||
![]() |
41faa5ee52 | ||
![]() |
d920567f8a | ||
![]() |
85694ec285 | ||
![]() |
325728de8f | ||
![]() |
3ce4603328 | ||
![]() |
9cff5e9c34 | ||
![]() |
0fdfecd973 | ||
![]() |
9dc0363337 | ||
![]() |
d96c048874 | ||
![]() |
865f4899b2 | ||
![]() |
b350916fe3 | ||
![]() |
381254a16e | ||
![]() |
8506d36dbf | ||
![]() |
0366e8b934 | ||
![]() |
eba7683f6b | ||
![]() |
5a0018d4fa | ||
![]() |
17dc120ca1 | ||
![]() |
8eb2e2ce80 | ||
![]() |
b2b9fb8bf9 | ||
![]() |
9d9d90ab9c | ||
![]() |
ccd7056a87 | ||
![]() |
c50dd1a3e9 | ||
![]() |
8b3bc90864 | ||
![]() |
9f99555c64 | ||
![]() |
eb4633557d | ||
![]() |
effa19f719 | ||
![]() |
835891fe59 | ||
![]() |
ff55646c62 | ||
![]() |
972c1098cb | ||
![]() |
59fc3e5635 | ||
![]() |
60b310e216 | ||
![]() |
b9cc5ba824 | ||
![]() |
f072ae74af | ||
![]() |
e2d014d0a6 | ||
![]() |
ab579da614 | ||
![]() |
05c978bc62 | ||
![]() |
95c635c451 | ||
![]() |
3e48e5903e | ||
![]() |
63fa8f39f5 | ||
![]() |
138e163fa8 | ||
![]() |
ac743c5138 | ||
![]() |
37803e9330 | ||
![]() |
8b5cd79bdc | ||
![]() |
949e55235a | ||
![]() |
5173ac3704 | ||
![]() |
9335c32334 | ||
![]() |
b0d3710454 | ||
![]() |
e0849af926 | ||
![]() |
b076b98996 | ||
![]() |
cc0501f340 | ||
![]() |
6b204b5b53 | ||
![]() |
3bf7d819de | ||
![]() |
6497a156aa | ||
![]() |
67fc0054c1 | ||
![]() |
d4493cb534 | ||
![]() |
682ec2b678 | ||
![]() |
20f5f17aac | ||
![]() |
f1a7f36f17 | ||
![]() |
5d700d5563 | ||
![]() |
c11a3b1372 | ||
![]() |
be0512d74e | ||
![]() |
2d0d6ddc5d | ||
![]() |
b2cae3b48d | ||
![]() |
5f19b6a26a | ||
![]() |
d880b728ce | ||
![]() |
e7490340f8 | ||
![]() |
fed70c5e9b | ||
![]() |
f08d74b269 | ||
![]() |
f2f5156065 | ||
![]() |
0ed96d893d | ||
![]() |
2137720602 | ||
![]() |
12a19378f7 | ||
![]() |
75c81b712e | ||
![]() |
4e0a889fa1 | ||
![]() |
9a7277065f | ||
![]() |
16a10548b8 | ||
![]() |
4187847ad0 | ||
![]() |
77bb3ed952 | ||
![]() |
023f8a6900 | ||
![]() |
0be04c754a | ||
![]() |
07b95c2634 | ||
![]() |
e9efb50e02 | ||
![]() |
868229460f | ||
![]() |
9d593b657b | ||
![]() |
0b43109a29 | ||
![]() |
07a2f3bbbb | ||
![]() |
fc28693b12 | ||
![]() |
77d2086796 | ||
![]() |
8dd0db094e | ||
![]() |
b28e24fda3 | ||
![]() |
480c7a6ce0 | ||
![]() |
33a5dd3e7f | ||
![]() |
9a9311e02a | ||
![]() |
2fec884072 | ||
![]() |
4a0bf8a7af | ||
![]() |
53f5ceabee | ||
![]() |
8f8a3acba7 | ||
![]() |
dbb7917058 | ||
![]() |
7ec57988b8 | ||
![]() |
3300f72621 | ||
![]() |
77f52df047 | ||
![]() |
79ce4e9ec2 | ||
![]() |
73cffe990a | ||
![]() |
b94f0a9b69 | ||
![]() |
5d5582e2d2 | ||
![]() |
5e52233cf3 | ||
![]() |
9ed13f31ff | ||
![]() |
bc1ed9a96f | ||
![]() |
57ebe88994 | ||
![]() |
96b3423ed1 | ||
![]() |
fc7aa27706 | ||
![]() |
1c4be7d1fe | ||
![]() |
9f468c2c11 | ||
![]() |
69100f0a24 | ||
![]() |
d32303bf47 | ||
![]() |
91789a698f | ||
![]() |
1d4a36e3b8 | ||
![]() |
790e717199 | ||
![]() |
c8ac260b78 | ||
![]() |
9f95eb452c | ||
![]() |
970c449b30 | ||
![]() |
3b568f7d32 | ||
![]() |
5de6cedf5e | ||
![]() |
9c69a77d43 | ||
![]() |
db29263eb1 | ||
![]() |
5b59d37e2f | ||
![]() |
38752d9d71 | ||
![]() |
92d25dd2a8 | ||
![]() |
65fff9361c | ||
![]() |
b83a8421a3 | ||
![]() |
714652ebb0 | ||
![]() |
c3f424dae4 | ||
![]() |
6758b4c4c7 | ||
![]() |
bd78acd559 | ||
![]() |
62ccd18345 | ||
![]() |
5ab87ec6c3 | ||
![]() |
63e792990f | ||
![]() |
526da8cddf | ||
![]() |
02eb618c5f | ||
![]() |
45e8977db7 | ||
![]() |
5a839c2906 | ||
![]() |
d8ed267e5f | ||
![]() |
ab23613b79 | ||
![]() |
c93a64db83 | ||
![]() |
038e31ccd1 | ||
![]() |
fdcaeb592c | ||
![]() |
8872fd3340 | ||
![]() |
959d592394 | ||
![]() |
c98e8f6504 | ||
![]() |
e293f3db52 | ||
![]() |
651b6a7d76 | ||
![]() |
dd554590b1 | ||
![]() |
0a3502e9cc | ||
![]() |
94866cab45 | ||
![]() |
a5a59dcf8b | ||
![]() |
8f9a358afb | ||
![]() |
0cd72e4917 | ||
![]() |
1222ed45ca | ||
![]() |
27f3fc310f | ||
![]() |
d3fdfebde1 | ||
![]() |
626cc30738 | ||
![]() |
64364c9ddb | ||
![]() |
a276f415a8 | ||
![]() |
59c4d59e45 | ||
![]() |
a12488c827 | ||
![]() |
ff03243298 | ||
![]() |
116bfbded1 | ||
![]() |
68cdd120c9 | ||
![]() |
7d5c4560cd | ||
![]() |
755e89dffa | ||
![]() |
8458d589b2 | ||
![]() |
30ce8440e1 | ||
![]() |
c8d98ec0b1 | ||
![]() |
6975fd15d5 | ||
![]() |
d305e6096a | ||
![]() |
37ae09acd1 | ||
![]() |
8cc36d7056 | ||
![]() |
4a1f2a1b75 | ||
![]() |
1f1dc59f8b | ||
![]() |
f0b4239df9 | ||
![]() |
753a31f7f4 | ||
![]() |
ac6a7be7aa | ||
![]() |
c02cfff8da | ||
![]() |
d7ccce1f8f | ||
![]() |
139446118b | ||
![]() |
787feae631 | ||
![]() |
e545c42aae | ||
![]() |
d166b5e37a | ||
![]() |
61ded72183 | ||
![]() |
b6d8c7d18e | ||
![]() |
1d0ca04992 | ||
![]() |
34b91a7dea | ||
![]() |
203dcbebda | ||
![]() |
c6ade09e4a | ||
![]() |
5f46b638e4 | ||
![]() |
0d0c2dac17 | ||
![]() |
bc21085398 | ||
![]() |
137a83e7f1 | ||
![]() |
31ee580047 | ||
![]() |
e815b1d938 | ||
![]() |
a758848146 | ||
![]() |
fba30781de | ||
![]() |
4b4c1dc08a | ||
![]() |
5eb62e22eb | ||
![]() |
fbe4732450 | ||
![]() |
c5f22ab959 | ||
![]() |
75e45cc8c2 | ||
![]() |
5bb451a649 | ||
![]() |
042c0f06f1 | ||
![]() |
f3f87dc928 | ||
![]() |
4a10d37d0d | ||
![]() |
c99487babc | ||
![]() |
e54723aa85 | ||
![]() |
8b48a0b118 | ||
![]() |
e1494c0518 | ||
![]() |
701c6e36b0 | ||
![]() |
c6b66b62e3 | ||
![]() |
6a182c32e1 | ||
![]() |
b8079a350c | ||
![]() |
3e9f3aba92 | ||
![]() |
e548ebcb5a | ||
![]() |
166444fc50 | ||
![]() |
a40e26985d | ||
![]() |
72dcfddff1 | ||
![]() |
b9f60fa627 | ||
![]() |
97b22c63f8 | ||
![]() |
163661a956 | ||
![]() |
f8671e7d4b | ||
![]() |
673f81759e | ||
![]() |
e10a08ecfa | ||
![]() |
00eb24c39d | ||
![]() |
3b6dd66680 | ||
![]() |
d6951dc8e3 | ||
![]() |
1d2cdf75e6 | ||
![]() |
4945460382 | ||
![]() |
2ec90b8273 | ||
![]() |
a4aecce865 | ||
![]() |
de826634c8 | ||
![]() |
d04d9fd250 | ||
![]() |
86657108dd | ||
![]() |
73f21f21e7 | ||
![]() |
5ab69af71e | ||
![]() |
884e113168 | ||
![]() |
a92aa05049 | ||
![]() |
d7dba4bfcf | ||
![]() |
e82a1ebedb | ||
![]() |
d7f1d37e41 | ||
![]() |
d6de6fee6c | ||
![]() |
7dd9156375 | ||
![]() |
8428b0549b | ||
![]() |
33c2c98757 | ||
![]() |
e9b70e34d5 | ||
![]() |
c3ee2ca6c1 | ||
![]() |
2834ac33a4 | ||
![]() |
1eeed36036 | ||
![]() |
bc0629e004 | ||
![]() |
d473fcdf16 | ||
![]() |
2e571767ea | ||
![]() |
c25b80abdd | ||
![]() |
b5f942b71d | ||
![]() |
21dcef0a42 | ||
![]() |
c4a60abd65 | ||
![]() |
fd850164f5 | ||
![]() |
8f881dbb52 | ||
![]() |
a419956e2a | ||
![]() |
3cb23c18e7 | ||
![]() |
59be2ae907 | ||
![]() |
15d2880ca4 | ||
![]() |
c03cd03274 | ||
![]() |
ec86bc12bd | ||
![]() |
77dd72b6ef | ||
![]() |
709848ee25 | ||
![]() |
980e254d9a | ||
![]() |
6d195f5ffa | ||
![]() |
578a427f46 | ||
![]() |
506579cd23 | ||
![]() |
19eec6ac31 | ||
![]() |
2aab4265a5 | ||
![]() |
67a6f58865 | ||
![]() |
6a99185214 | ||
![]() |
d02c5397f8 | ||
![]() |
32fc28ec54 | ||
![]() |
77efe52f4a | ||
![]() |
83beb5474e | ||
![]() |
1c38d9259a | ||
![]() |
d6d5a2891c | ||
![]() |
abd6c01a98 | ||
![]() |
f77d01c01f | ||
![]() |
fd3f1628ee | ||
![]() |
c7fe310d81 | ||
![]() |
742b2d920a | ||
![]() |
7a8e2206ae | ||
![]() |
8fbe8c16dc | ||
![]() |
0104f81d54 | ||
![]() |
5ad621b27e | ||
![]() |
47029c0a78 | ||
![]() |
5a5f71a3d9 | ||
![]() |
3e8d180f1b | ||
![]() |
2d733732f6 | ||
![]() |
d6cabd1d01 | ||
![]() |
46e2f4e22c | ||
![]() |
15c2af5fbf | ||
![]() |
a37e0f29b7 | ||
![]() |
b423b49cac | ||
![]() |
bdf7414392 | ||
![]() |
459a43184a | ||
![]() |
0905a53db5 | ||
![]() |
cd93c6eecd | ||
![]() |
161d7e069b | ||
![]() |
e3ea2cb2b0 | ||
![]() |
8d295419c7 | ||
![]() |
22538f30dc | ||
![]() |
5daf993451 | ||
![]() |
b7b3db5ba8 | ||
![]() |
a0a8607628 | ||
![]() |
3a465ac452 | ||
![]() |
97b2eb7a7c | ||
![]() |
b46390c315 | ||
![]() |
d14e258b5b | ||
![]() |
1622b25aac | ||
![]() |
d95fa43c6b | ||
![]() |
4918ff212c | ||
![]() |
c2790584bd | ||
![]() |
162cf94772 | ||
![]() |
92e0b6dddf | ||
![]() |
5b646af818 | ||
![]() |
8363273f58 | ||
![]() |
5f5d11cc0b | ||
![]() |
eb38b5877e | ||
![]() |
f88638e9fe | ||
![]() |
cd350ddf5f | ||
![]() |
2987ad05be | ||
![]() |
9afbd8d746 | ||
![]() |
a4eaf02a47 | ||
![]() |
d1ebf07456 | ||
![]() |
02c47c3234 | ||
![]() |
63c752b3f4 | ||
![]() |
6df76515ba | ||
![]() |
3cdcdaf475 | ||
![]() |
b90d102e5e | ||
![]() |
13ead8174a | ||
![]() |
a7a807c0bb | ||
![]() |
baecf2ac11 | ||
![]() |
7ebdc43ca2 | ||
![]() |
13c0cb48ed | ||
![]() |
6639594f7e | ||
![]() |
07a2e333ca | ||
![]() |
af8c599497 | ||
![]() |
0542e9b2fd | ||
![]() |
2a55e36082 | ||
![]() |
8a5d6897c4 | ||
![]() |
e89a277702 | ||
![]() |
9fc4e213df | ||
![]() |
46ac61dcac | ||
![]() |
eef98d70c3 | ||
![]() |
5c669fb1b7 | ||
![]() |
a343991e74 | ||
![]() |
83de2c5769 | ||
![]() |
8b57a2f6af | ||
![]() |
7352d9e273 | ||
![]() |
4e14bc0b78 | ||
![]() |
0e289b3f39 | ||
![]() |
815425c101 | ||
![]() |
6ad641f4e2 | ||
![]() |
7f00253d3d | ||
![]() |
03d17678e2 | ||
![]() |
0efb95825d | ||
![]() |
95cde220e6 | ||
![]() |
964066056c | ||
![]() |
22db36f938 | ||
![]() |
9df4d660e7 | ||
![]() |
a5b30ea3c2 | ||
![]() |
2078b7593a | ||
![]() |
fe8429ebbe | ||
![]() |
8feeedfc3a | ||
![]() |
3292222e47 | ||
![]() |
36868c06f0 | ||
![]() |
5853e49bd0 | ||
![]() |
2fd53c7ad2 | ||
![]() |
63345a335a | ||
![]() |
bbb50f2858 | ||
![]() |
3e31c1eee3 | ||
![]() |
cfcf93ecf8 | ||
![]() |
74c2f3d9bb | ||
![]() |
f22fcc7b3c | ||
![]() |
c3b9a1d5c6 | ||
![]() |
d072ae7027 | ||
![]() |
f746d45ac1 | ||
![]() |
1fd917dd4a | ||
![]() |
99e349b91f | ||
![]() |
a7ed053d15 | ||
![]() |
99c6dd1829 | ||
![]() |
0a48b09bd7 | ||
![]() |
0dc74165dc | ||
![]() |
9cbb634245 | ||
![]() |
7c379db7ee | ||
![]() |
3dc73f9021 | ||
![]() |
94ceee9080 | ||
![]() |
71cf66ecf4 | ||
![]() |
1b9656b135 | ||
![]() |
85acdcb9c5 | ||
![]() |
867ae9c341 | ||
![]() |
4965bdee5f | ||
![]() |
ebaccc055e | ||
![]() |
273be5bd81 | ||
![]() |
5062e46433 | ||
![]() |
9b1d18bd32 | ||
![]() |
15656b03ce | ||
![]() |
75ec046bba | ||
![]() |
998e1fac8d | ||
![]() |
9ac19d40fc | ||
![]() |
2a35180a1b | ||
![]() |
648925f3e1 | ||
![]() |
4f0e1d6de1 | ||
![]() |
1809f0585c | ||
![]() |
a484379f69 | ||
![]() |
7bf4da55cf | ||
![]() |
a079ed729c | ||
![]() |
3a48ed390b | ||
![]() |
cf77726866 | ||
![]() |
b2b1782cd8 | ||
![]() |
02a20c8862 | ||
![]() |
ae6b183fae | ||
![]() |
884aa07430 | ||
![]() |
404ccd9b0e | ||
![]() |
990bde43ab | ||
![]() |
db526a0c25 | ||
![]() |
9a5e26f640 | ||
![]() |
d4a59dd51c | ||
![]() |
3d133f6166 | ||
![]() |
163014306c | ||
![]() |
d9857a7a9a | ||
![]() |
5331ff68db | ||
![]() |
d4a5308d0c | ||
![]() |
6a58e49fb4 | ||
![]() |
661b4aef9d | ||
![]() |
47e7eb1a4f | ||
![]() |
0fe33eecd1 | ||
![]() |
275b057b40 | ||
![]() |
499bfe3154 | ||
![]() |
5d39026eb7 | ||
![]() |
ee3e5ca14c | ||
![]() |
834893249c | ||
![]() |
07a8024daa | ||
![]() |
5c10e473e9 | ||
![]() |
1919f976f4 | ||
![]() |
2fa8ab5365 | ||
![]() |
157eedade4 | ||
![]() |
f471957c4c | ||
![]() |
72eaf35de1 | ||
![]() |
e6fdc4597a | ||
![]() |
130c3c9496 | ||
![]() |
82d17d795f | ||
![]() |
52dbb21339 | ||
![]() |
4eb2297910 | ||
![]() |
1caeecaa50 | ||
![]() |
00aa0271f2 | ||
![]() |
471051dd59 | ||
![]() |
d728cc227d | ||
![]() |
d266367070 | ||
![]() |
c63001c205 | ||
![]() |
d3d33536bf | ||
![]() |
c903df80d8 | ||
![]() |
022c6840f2 | ||
![]() |
adf8cc7bc5 | ||
![]() |
5c8828f6b5 | ||
![]() |
86b27de6e4 | ||
![]() |
e9b18d87fe | ||
![]() |
3785729ae5 | ||
![]() |
42026b36d5 | ||
![]() |
69726f6fa0 | ||
![]() |
d00ad0cd0e | ||
![]() |
4c6cae911b | ||
![]() |
91027094ed | ||
![]() |
12f9023810 | ||
![]() |
47543b4237 | ||
![]() |
fda4ef77e4 | ||
![]() |
7ebdcd3686 | ||
![]() |
0c9baf22f5 | ||
![]() |
25ca13735b | ||
![]() |
327031cceb | ||
![]() |
2f06a7cb17 | ||
![]() |
2d716c7630 | ||
![]() |
004645b5e4 | ||
![]() |
93fcbe79aa | ||
![]() |
6e6b775c20 | ||
![]() |
e720c77388 | ||
![]() |
9919abebce | ||
![]() |
ce517adf7d | ||
![]() |
134eac5f39 | ||
![]() |
de65530e72 | ||
![]() |
adebc30d3b | ||
![]() |
3b93f5bd23 | ||
![]() |
c70e0464ed | ||
![]() |
8bcceff085 | ||
![]() |
ac9be25faf | ||
![]() |
302f5a6076 | ||
![]() |
486aefebc7 | ||
![]() |
ec8470de06 | ||
![]() |
187702d52d | ||
![]() |
ff85422bb3 | ||
![]() |
685fbf630a | ||
![]() |
c3854355fd | ||
![]() |
de0d7bf33a | ||
![]() |
48ea7df8b2 | ||
![]() |
a3779622f0 | ||
![]() |
5d6edade22 | ||
![]() |
e85f9f2b25 | ||
![]() |
2c7cf18be5 | ||
![]() |
58a3ec3972 | ||
![]() |
9a74190bf4 | ||
![]() |
155f3f9a12 | ||
![]() |
91b635787d | ||
![]() |
b8d282ebe4 | ||
![]() |
404e2f8e02 | ||
![]() |
00e0028864 | ||
![]() |
2fc3f2bbc3 | ||
![]() |
96903d89de | ||
![]() |
8cc96060ff | ||
![]() |
c4b2565373 | ||
![]() |
95f33848f9 | ||
![]() |
daf297b94b | ||
![]() |
ba6d3f363c | ||
![]() |
00d895b304 | ||
![]() |
9d2fed4186 | ||
![]() |
a936878c96 | ||
![]() |
c9324b0714 | ||
![]() |
706c49d04b | ||
![]() |
d449108395 | ||
![]() |
84f4f017fb | ||
![]() |
56cba82c2d | ||
![]() |
45bf5a77e2 | ||
![]() |
b3b5b761db | ||
![]() |
02bb7db119 | ||
![]() |
16ff75c92e | ||
![]() |
cdca1b5313 | ||
![]() |
b44acd68ee | ||
![]() |
ed6fe8c609 | ||
![]() |
50acff1b59 | ||
![]() |
5331b43a62 | ||
![]() |
88b69a55eb | ||
![]() |
12b3eb839b | ||
![]() |
3c871f90c0 | ||
![]() |
d69adab419 | ||
![]() |
9f78f6c5c1 | ||
![]() |
47e0314c9b | ||
![]() |
6b0318fc03 | ||
![]() |
9db595c232 | ||
![]() |
77a8fde646 | ||
![]() |
a7f7cecdab | ||
![]() |
f6f68de6d1 | ||
![]() |
829b111663 | ||
![]() |
e2b3f52fe4 | ||
![]() |
25e06fffe9 | ||
![]() |
755451191c | ||
![]() |
d2dfd0b293 | ||
![]() |
454d869c53 | ||
![]() |
b1aa2f3550 | ||
![]() |
3fdef20dc2 | ||
![]() |
1b2d9829ed | ||
![]() |
3611f37563 | ||
![]() |
dbccda4330 | ||
![]() |
7a19603f5c | ||
![]() |
70b1717a3c | ||
![]() |
72be58aa2a | ||
![]() |
3f343dbd60 | ||
![]() |
8f536d31ef | ||
![]() |
5af9793cdf | ||
![]() |
1ba72f54c2 | ||
![]() |
5dda1989b5 | ||
![]() |
21c7f438ac | ||
![]() |
2cfef082f1 | ||
![]() |
2824469dc5 | ||
![]() |
cdff2aba6c | ||
![]() |
092608f6cb | ||
![]() |
165bdf7797 | ||
![]() |
f52e95871a | ||
![]() |
d99b98d140 | ||
![]() |
58caa84153 | ||
![]() |
9ca57e942a | ||
![]() |
ef9fd36fe2 | ||
![]() |
5a9e9fdd5a | ||
![]() |
e0f0b6935c | ||
![]() |
acb9b24722 | ||
![]() |
db8b9f13b6 | ||
![]() |
4cf69eb9c9 | ||
![]() |
df71391647 | ||
![]() |
81f7b5ae12 | ||
![]() |
ae269f64b6 | ||
![]() |
7135f8ab30 | ||
![]() |
9d08cac566 | ||
![]() |
da245b88b8 | ||
![]() |
f16befb088 | ||
![]() |
f09a26f019 | ||
![]() |
10899aa22c | ||
![]() |
6ba8cbd49c | ||
![]() |
3a5d8022e5 | ||
![]() |
dd548c20e9 | ||
![]() |
37a323e94f | ||
![]() |
be7938a21b | ||
![]() |
aa7409051b | ||
![]() |
8e450402af | ||
![]() |
86e1333025 | ||
![]() |
97673471f7 | ||
![]() |
8e6268ff84 | ||
![]() |
81f3a5cce0 | ||
![]() |
828f2586b1 | ||
![]() |
dd6051b645 | ||
![]() |
6426f9e532 | ||
![]() |
48896fdae2 | ||
![]() |
1ebe61028f | ||
![]() |
5e4102cd21 | ||
![]() |
b35e27a44b | ||
![]() |
72b089c0cd | ||
![]() |
8b636f533b | ||
![]() |
c1dcebbd04 | ||
![]() |
3e7a3f250b | ||
![]() |
ee04589599 | ||
![]() |
f2cfab749e | ||
![]() |
42ba7924b9 | ||
![]() |
d1dff0553d | ||
![]() |
43e1e6d22b | ||
![]() |
a67c8906ee | ||
![]() |
37d9b5bfc2 | ||
![]() |
9c683b55e0 | ||
![]() |
c84db3ce3d | ||
![]() |
0968fe8bbc | ||
![]() |
29f283b35e | ||
![]() |
6ad0f99ca4 | ||
![]() |
d3d9a526fd | ||
![]() |
bbfb8bec01 | ||
![]() |
8bdd2d293f | ||
![]() |
6483eb2c30 | ||
![]() |
38d7412569 | ||
![]() |
0f1b16cbeb | ||
![]() |
244608aa5c | ||
![]() |
fb1ff05757 | ||
![]() |
15493e2f69 | ||
![]() |
ffdc7b32c5 | ||
![]() |
5723fcbdc0 | ||
![]() |
5b37101bb9 | ||
![]() |
3df0286ec8 | ||
![]() |
fcfdff7fbd | ||
![]() |
4717d6f758 | ||
![]() |
2db6c96d57 | ||
![]() |
f8eb8e1cae | ||
![]() |
2ff5b7370c | ||
![]() |
f5e09c5f8d | ||
![]() |
23b5d52623 | ||
![]() |
97c90cfd9e | ||
![]() |
138fccf711 | ||
![]() |
d9ed91df05 | ||
![]() |
fb66b5abd6 | ||
![]() |
23eeee3d16 | ||
![]() |
a525c6fe3e | ||
![]() |
877af98c4b | ||
![]() |
bd477765c0 | ||
![]() |
74a0820271 | ||
![]() |
ae4b68f1bb | ||
![]() |
220b30bea7 | ||
![]() |
172f7e527f | ||
![]() |
d2fa8cda6a | ||
![]() |
d71c16879e | ||
![]() |
85f95112b3 | ||
![]() |
efaf1d47da | ||
![]() |
d38b16eb48 | ||
![]() |
1d0df844c3 | ||
![]() |
fad1a7ade4 | ||
![]() |
e7b02778cf | ||
![]() |
8a93bef98c | ||
![]() |
9c780200b2 | ||
![]() |
78d5116cdb | ||
![]() |
2f0f69710e | ||
![]() |
d9b0eebc18 | ||
![]() |
aee76913aa | ||
![]() |
d1c91b8bc2 | ||
![]() |
7f450320b6 | ||
![]() |
d7fe120245 | ||
![]() |
f01c58e84d | ||
![]() |
7a2b1b2068 | ||
![]() |
1bc8111117 | ||
![]() |
8b1a2d0a0e | ||
![]() |
6af872bf9f | ||
![]() |
2445a6bd8a | ||
![]() |
d5198659a9 | ||
![]() |
2c3329b7c0 | ||
![]() |
e12da0fd0e | ||
![]() |
d0ccb59424 | ||
![]() |
f0f8f163fa | ||
![]() |
47098ca4ca | ||
![]() |
edeea00c75 | ||
![]() |
5a5c7cc43b | ||
![]() |
5f72865e42 | ||
![]() |
055ed9ba6e | ||
![]() |
d54754f78a | ||
![]() |
f466d0b67c | ||
![]() |
724f1fe4d3 | ||
![]() |
8c52f2abed | ||
![]() |
2e6a1c21ea | ||
![]() |
aee6060fef | ||
![]() |
8e25a02fde | ||
![]() |
9ca04b4b63 | ||
![]() |
3e202a67f1 | ||
![]() |
709764c8af | ||
![]() |
c0d91da6e2 | ||
![]() |
6c8f816fb2 | ||
![]() |
99ea73f9f6 | ||
![]() |
bf31c76c88 | ||
![]() |
e04dd9e183 | ||
![]() |
b878f28db6 | ||
![]() |
af7d99a987 | ||
![]() |
11a86c3756 | ||
![]() |
8dd0b49e27 | ||
![]() |
0894ba0166 | ||
![]() |
92f58f0e8a | ||
![]() |
053063d0f4 | ||
![]() |
98a5076366 | ||
![]() |
190f245635 | ||
![]() |
82a8da6028 | ||
![]() |
2ca91fd331 | ||
![]() |
a4a0482d88 | ||
![]() |
e8f7a9e3a1 | ||
![]() |
008dee60c1 | ||
![]() |
0c6994ba14 | ||
![]() |
8218ed595a | ||
![]() |
12a561d0a0 | ||
![]() |
ba2444768e | ||
![]() |
ba8b27e611 | ||
![]() |
d5dec7582a | ||
![]() |
7906770e8e | ||
![]() |
30ae91b206 | ||
![]() |
ba4d652806 | ||
![]() |
f1378b870b | ||
![]() |
10d5f3d0af | ||
![]() |
0559e1ebc1 | ||
![]() |
30cbcbb7c8 | ||
![]() |
8e4247c2ac | ||
![]() |
be83037739 | ||
![]() |
69a3a1ec08 | ||
![]() |
698795299d | ||
![]() |
4f4dbffde8 | ||
![]() |
3d7e61f57f | ||
![]() |
0272f9a5a8 | ||
![]() |
388c08b9a1 | ||
![]() |
e2c51710ea | ||
![]() |
bd1881fc9a | ||
![]() |
da7cb11bcb | ||
![]() |
43d78c695c | ||
![]() |
1a95d0c571 | ||
![]() |
10c6b03c40 | ||
![]() |
a1b27a5fb3 | ||
![]() |
c0efbbd07b | ||
![]() |
78cf3e1bfc | ||
![]() |
b93e0bf003 | ||
![]() |
536cb62cc0 | ||
![]() |
b4340e0b91 | ||
![]() |
691c6ff2d8 | ||
![]() |
2fc2897a36 | ||
![]() |
270e003328 | ||
![]() |
4be1b57db3 | ||
![]() |
9f73f4ad2d | ||
![]() |
21b61fc0e2 | ||
![]() |
d7372bcdf3 | ||
![]() |
8c8d3e71a8 | ||
![]() |
93d9b87db1 | ||
![]() |
58bc42671c | ||
![]() |
f276756c3a | ||
![]() |
d4efd85cc5 | ||
![]() |
b318d7281a | ||
![]() |
a6a10200d2 | ||
![]() |
11c844d973 | ||
![]() |
39d1fc235e | ||
![]() |
6ff80700f3 | ||
![]() |
22fbcbebfa | ||
![]() |
d523e1e94a | ||
![]() |
0cf46d0ac6 | ||
![]() |
ee0b76cb72 | ||
![]() |
9a8dfc229f | ||
![]() |
4abdea5f62 | ||
![]() |
dff343f62e | ||
![]() |
14fb379419 | ||
![]() |
6f4b0ad6b1 | ||
![]() |
84b63a443f | ||
![]() |
6c7da1cc5d | ||
![]() |
b4d2f063c6 | ||
![]() |
f3d4754d5b | ||
![]() |
d332296da8 | ||
![]() |
134a808fba | ||
![]() |
377e27b305 | ||
![]() |
67976299de | ||
![]() |
959f826d64 | ||
![]() |
8e5c4a73dc | ||
![]() |
bb50e2bbdc | ||
![]() |
558f8f51fb | ||
![]() |
84d8a61f83 | ||
![]() |
6808eec3a4 | ||
![]() |
fe8bbddac2 | ||
![]() |
a6897e9a6d | ||
![]() |
bd9f70acc8 | ||
![]() |
ff1175cd6f | ||
![]() |
c306dfd309 | ||
![]() |
e6bc199932 | ||
![]() |
f5b7bea3ec | ||
![]() |
6675b61f81 | ||
![]() |
cc34e27c20 | ||
![]() |
9ddd75dbdf | ||
![]() |
e8ff0fbf36 | ||
![]() |
b382a88c2f | ||
![]() |
540ce4d7c4 | ||
![]() |
b1c7728a96 | ||
![]() |
0f0847c069 | ||
![]() |
fbacebb439 | ||
![]() |
cf12fb22ee | ||
![]() |
3221621e6c | ||
![]() |
f3aa2d47a6 | ||
![]() |
4449960c0d | ||
![]() |
c914b42de2 | ||
![]() |
64c0fff370 | ||
![]() |
e31fc562c5 | ||
![]() |
7b5b795954 | ||
![]() |
628732b932 | ||
![]() |
9da66a5cfd | ||
![]() |
5f74446bf5 | ||
![]() |
b279b97c37 | ||
![]() |
4bf10c880a | ||
![]() |
5455c79563 | ||
![]() |
079c79bb42 | ||
![]() |
35d4561d53 | ||
![]() |
723e1e1278 | ||
![]() |
52d72766ca | ||
![]() |
195ab41aac | ||
![]() |
8c6e3b0c1f | ||
![]() |
3924a82048 | ||
![]() |
c2f2cb5b3a | ||
![]() |
581ed432f9 | ||
![]() |
c10e660e0b | ||
![]() |
d67cfaa278 | ||
![]() |
fbfe55db35 | ||
![]() |
6d531db20c | ||
![]() |
7e3613fa9d | ||
![]() |
06fef61f02 | ||
![]() |
cd1808d981 | ||
![]() |
40cb6a18be | ||
![]() |
681ee6f816 | ||
![]() |
a088641e5c | ||
![]() |
ed24204f89 | ||
![]() |
301863fb80 | ||
![]() |
e9da5f0616 | ||
![]() |
2d326d1f46 | ||
![]() |
508fa76e45 | ||
![]() |
77c19d9fb1 | ||
![]() |
c233927c29 | ||
![]() |
57eb6da97a | ||
![]() |
9ab022c225 | ||
![]() |
74cd70d860 | ||
![]() |
548a5ccb79 | ||
![]() |
091d0fccf7 | ||
![]() |
2e3dc97e51 | ||
![]() |
325d7cc9e8 | ||
![]() |
f44bdc9c77 | ||
![]() |
8c08e5384a | ||
![]() |
f4cedeb576 | ||
![]() |
f944fbba37 | ||
![]() |
f159590187 | ||
![]() |
130b0fad76 | ||
![]() |
9439a51c5d | ||
![]() |
c21ab0a86f | ||
![]() |
efedd10d9c | ||
![]() |
c066bc9d54 | ||
![]() |
89eb4e3cb2 | ||
![]() |
13662e336d | ||
![]() |
7b19ba7be2 | ||
![]() |
78a81cbb4b | ||
![]() |
06f3b68048 | ||
![]() |
3a45ecf578 | ||
![]() |
f19daf54cb | ||
![]() |
bd4dbcf9ad | ||
![]() |
5aaa4ef371 | ||
![]() |
27d3c58d00 | ||
![]() |
983769cf59 | ||
![]() |
6b9f6bf767 | ||
![]() |
dc3120234d | ||
![]() |
c042a5cf1a | ||
![]() |
ef9c42804c | ||
![]() |
2895cfe083 | ||
![]() |
d98e44185c | ||
![]() |
a94f729faa | ||
![]() |
5e27741483 | ||
![]() |
3647292b8f | ||
![]() |
3d9100f2d1 | ||
![]() |
2a90214778 | ||
![]() |
90a1f25ba9 | ||
![]() |
8ec5d11fcc | ||
![]() |
0a2cc98524 | ||
![]() |
2a84c42531 | ||
![]() |
a5c300aebd | ||
![]() |
835eb73e0e | ||
![]() |
da7c980ab1 | ||
![]() |
09f3dddde4 | ||
![]() |
b1d33c83a6 | ||
![]() |
fe1be27d49 | ||
![]() |
ea297d1296 | ||
![]() |
bb242d99a6 | ||
![]() |
14b053b704 | ||
![]() |
03bf4befab | ||
![]() |
c89adf4f81 | ||
![]() |
3ee09834b1 | ||
![]() |
496853671e | ||
![]() |
a80cae8fb5 | ||
![]() |
b83c218bf1 | ||
![]() |
94f52721d4 | ||
![]() |
0dbbe6cb79 | ||
![]() |
53b883cb42 | ||
![]() |
2e6b1cc4ef | ||
![]() |
702f9cd4db | ||
![]() |
6e7a8a992c | ||
![]() |
618f03c8ca | ||
![]() |
222c220c56 | ||
![]() |
08b271095f | ||
![]() |
99dd9d2de9 | ||
![]() |
7008afd05f | ||
![]() |
18e7de81d9 | ||
![]() |
6152b30425 | ||
![]() |
b6dc8a8579 | ||
![]() |
051b17e0e4 | ||
![]() |
36f6110e58 | ||
![]() |
e037d87084 | ||
![]() |
41a265f755 | ||
![]() |
0ceeeaf33f | ||
![]() |
d6da065068 | ||
![]() |
ee4da3f541 | ||
![]() |
1ba642719d | ||
![]() |
6adc9a1742 | ||
![]() |
4f83eaa53d | ||
![]() |
7f7ed17d6e | ||
![]() |
e0fb0e14a3 | ||
![]() |
b1605e095a | ||
![]() |
9de002120d | ||
![]() |
cc86ac5086 | ||
![]() |
41e4e87061 | ||
![]() |
1b9a85bde7 | ||
![]() |
b5f85c207c | ||
![]() |
73b2c0b29f | ||
![]() |
e0c3a22466 | ||
![]() |
4847fc6f7a | ||
![]() |
cefe1bfda3 | ||
![]() |
d9f6386b11 | ||
![]() |
b1f3b785e1 | ||
![]() |
e336660cdd | ||
![]() |
d8ee1f55f1 | ||
![]() |
0bf095a1d9 | ||
![]() |
4c2a7a10c7 | ||
![]() |
290a89909e | ||
![]() |
ade9533f4c | ||
![]() |
559691be0e | ||
![]() |
43d5bf372b | ||
![]() |
3e02f22f47 | ||
![]() |
fc7997d8b8 | ||
![]() |
8c8fad75fa | ||
![]() |
8ce1552bb1 | ||
![]() |
7b27251cf2 | ||
![]() |
88ba37e527 | ||
![]() |
80b90524b6 | ||
![]() |
38df774c9c | ||
![]() |
fef1ba9663 | ||
![]() |
187cdd7ae2 | ||
![]() |
f0d0cb5930 | ||
![]() |
7a876c0276 | ||
![]() |
3da2b3c0ef | ||
![]() |
1752b1afd4 | ||
![]() |
d6147e5236 | ||
![]() |
3fcb1138e2 | ||
![]() |
f4efe00671 | ||
![]() |
548ccf8b90 | ||
![]() |
e986f10e21 | ||
![]() |
a8515faa90 | ||
![]() |
f73fbc270f | ||
![]() |
8136826c6d | ||
![]() |
17782b80cd | ||
![]() |
d972036736 | ||
![]() |
d8f367ce9c | ||
![]() |
b7bd6ef709 | ||
![]() |
113703ff6b | ||
![]() |
4ed6ccebff | ||
![]() |
84f1fcbb35 | ||
![]() |
72fad0a6c9 | ||
![]() |
0f22978b2e | ||
![]() |
5761698a0d | ||
![]() |
585ef37243 | ||
![]() |
6d855caa33 | ||
![]() |
83acd1f4b4 | ||
![]() |
29fe2ef954 | ||
![]() |
d705de1b4f | ||
![]() |
6deba31828 | ||
![]() |
8c3ec98db3 | ||
![]() |
0327f1d856 | ||
![]() |
2eb91add4d | ||
![]() |
643e75a838 | ||
![]() |
59681ea54d | ||
![]() |
4c10721e3a | ||
![]() |
5fb237d905 | ||
![]() |
859ffb5cdc | ||
![]() |
d21ce38011 | ||
![]() |
4e7cad9e17 | ||
![]() |
7410141d3f | ||
![]() |
05d73abbe2 | ||
![]() |
b829335ba5 | ||
![]() |
1ba3a0572b | ||
![]() |
93ac1957c5 | ||
![]() |
4469918640 | ||
![]() |
ff5ccf30ee | ||
![]() |
fb45f5f807 | ||
![]() |
a1f4d7d7b6 | ||
![]() |
dc6fa35483 | ||
![]() |
a3034dd5f8 | ||
![]() |
59b417d3f4 | ||
![]() |
afbd16d38d | ||
![]() |
afc147507c | ||
![]() |
4ab9f7086b | ||
![]() |
3590582832 | ||
![]() |
751ce12f97 | ||
![]() |
24e6cdd3ec | ||
![]() |
f301be3eb2 | ||
![]() |
6892489156 | ||
![]() |
8740eaf218 | ||
![]() |
521b7d4db8 | ||
![]() |
24cc3fb76e | ||
![]() |
5b33c49ccc | ||
![]() |
bb8775a8f0 | ||
![]() |
0ffdda26dc | ||
![]() |
b5881a0ae9 | ||
![]() |
7fbec71002 | ||
![]() |
0fbcf84125 | ||
![]() |
9cc158230f | ||
![]() |
792a614631 | ||
![]() |
b00a0f5be9 | ||
![]() |
1ddeeed081 | ||
![]() |
057b54a667 | ||
![]() |
6c5ae4972e | ||
![]() |
af9b4a292e | ||
![]() |
690554d103 | ||
![]() |
81087d3a2c | ||
![]() |
f04f73edfa | ||
![]() |
4ff68da423 | ||
![]() |
b86c467a1f | ||
![]() |
9f6616a5ce | ||
![]() |
26f9c7e40f | ||
![]() |
a2aa436c1d | ||
![]() |
3851884225 | ||
![]() |
153a53f118 | ||
![]() |
918493ecb3 | ||
![]() |
43dd508b10 | ||
![]() |
e14760a29b | ||
![]() |
0c47298194 | ||
![]() |
46a73e9c1b | ||
![]() |
3a7ab491bf | ||
![]() |
b2a9c4f456 | ||
![]() |
a49c8cad99 | ||
![]() |
ebfef74adb | ||
![]() |
d0ccec9d0e | ||
![]() |
943e1b4eef | ||
![]() |
3588643731 | ||
![]() |
ee705f0ccf | ||
![]() |
b4042e712d | ||
![]() |
80c3416214 | ||
![]() |
081e44521a | ||
![]() |
b31fdf0be6 | ||
![]() |
2f336ff8de | ||
![]() |
e426c1a4ef | ||
![]() |
83444fc9c2 | ||
![]() |
aa4d56e2cf | ||
![]() |
58df43b852 | ||
![]() |
5011ec672c | ||
![]() |
56d60820a5 | ||
![]() |
2d48c6369b | ||
![]() |
3b5829160b | ||
![]() |
2030b29ddc | ||
![]() |
21431f8111 | ||
![]() |
4f87bab78c | ||
![]() |
daca70e6cb | ||
![]() |
385b72862e | ||
![]() |
06f95da018 | ||
![]() |
f1d675bbe2 | ||
![]() |
d60e358766 | ||
![]() |
be484b1249 | ||
![]() |
b63fa5f375 | ||
![]() |
f4e95946dc | ||
![]() |
faec78a12e | ||
![]() |
50d36231aa | ||
![]() |
ebd8cbaaae | ||
![]() |
e4657b7d51 | ||
![]() |
a6bad9f142 | ||
![]() |
6983b40136 | ||
![]() |
12518dcc86 | ||
![]() |
22da2f7160 | ||
![]() |
762bdafe5e | ||
![]() |
f561ff8f35 | ||
![]() |
787c99bcde | ||
![]() |
694fa39a6e | ||
![]() |
673d056554 | ||
![]() |
42097b7802 | ||
![]() |
2326a2596f | ||
![]() |
7fb9c8a38a | ||
![]() |
1c2d96ce43 | ||
![]() |
1ca8529440 | ||
![]() |
6e77140591 | ||
![]() |
6493b62e6a | ||
![]() |
22686d52da | ||
![]() |
9d1991eec1 | ||
![]() |
293692f1d2 | ||
![]() |
e2cf97f8c1 | ||
![]() |
6d1b9f3fa4 | ||
![]() |
61ace6f831 | ||
![]() |
371bd072b3 | ||
![]() |
72dbb0fdef | ||
![]() |
1e7ede015b | ||
![]() |
441eac2bf4 | ||
![]() |
7720f38364 | ||
![]() |
c72ab68b65 | ||
![]() |
f2ecef8499 | ||
![]() |
79cb51b2c1 | ||
![]() |
48e95e262d | ||
![]() |
d38ba9cf0e | ||
![]() |
aa7c644e6a | ||
![]() |
934c23a550 | ||
![]() |
1ae3c183d4 | ||
![]() |
c9d261e68b | ||
![]() |
3a2123f569 | ||
![]() |
7d0891f9f6 | ||
![]() |
83155062cf | ||
![]() |
2513f91a1a | ||
![]() |
5c27dca3d7 | ||
![]() |
0090088cb3 | ||
![]() |
4cf1feef07 | ||
![]() |
599e8a777e | ||
![]() |
f5d18edd06 | ||
![]() |
376788ea2e | ||
![]() |
1d58910d70 | ||
![]() |
eaa54dfcaf | ||
![]() |
b8496df6aa | ||
![]() |
e80e56d78b | ||
![]() |
1ed3b9244f | ||
![]() |
00c5636c88 | ||
![]() |
8264872f38 | ||
![]() |
a2bd3be23f | ||
![]() |
019ef75804 | ||
![]() |
8bb73b3188 | ||
![]() |
8d867a7a93 | ||
![]() |
d7977aba97 | ||
![]() |
07ee16aa8d | ||
![]() |
e9f4d4574a | ||
![]() |
d79dcbae73 | ||
![]() |
ed998f41ce | ||
![]() |
92f5c6f427 | ||
![]() |
200e95a390 | ||
![]() |
1b46303539 | ||
![]() |
ec3f7736d4 | ||
![]() |
5398c06242 | ||
![]() |
af23a3a8e3 | ||
![]() |
e3fe80013c | ||
![]() |
0a4f027129 | ||
![]() |
d2871ea8a0 | ||
![]() |
ab78df2e68 | ||
![]() |
c1a1d1a20e | ||
![]() |
feb2d09d5a | ||
![]() |
55fcab1700 | ||
![]() |
efe1d1085a | ||
![]() |
1c12977347 | ||
![]() |
eff5f1b81a | ||
![]() |
5e726f8916 | ||
![]() |
64dd2e6344 | ||
![]() |
74ca23ec83 | ||
![]() |
17afdfa34b | ||
![]() |
553002406f | ||
![]() |
4f14d66400 | ||
![]() |
b13f7cdf64 | ||
![]() |
f063b15fb4 | ||
![]() |
718db3466d | ||
![]() |
3c2f3d071f | ||
![]() |
5ccfeccb42 | ||
![]() |
008e089e62 | ||
![]() |
7844a939ca | ||
![]() |
9e03faac54 | ||
![]() |
6078ca9e8a | ||
![]() |
bbec2fd038 | ||
![]() |
98da08ead0 | ||
![]() |
e47b42bc89 | ||
![]() |
938bf33ad2 | ||
![]() |
1d00b431ac | ||
![]() |
9a2b885501 | ||
![]() |
742922dba0 | ||
![]() |
0121e6d895 | ||
![]() |
e2668cdf97 | ||
![]() |
b015f682b4 | ||
![]() |
eeda26e122 | ||
![]() |
1d69e1581a | ||
![]() |
e1beb61525 | ||
![]() |
e4e973bbef | ||
![]() |
458fe3c680 | ||
![]() |
7edc1c1036 | ||
![]() |
b1077dad31 | ||
![]() |
b3c65f59a4 | ||
![]() |
e8dda89f19 | ||
![]() |
827aa1f045 | ||
![]() |
3faf244259 | ||
![]() |
c6ecc0cbd4 | ||
![]() |
fbeaec1a54 | ||
![]() |
3a6c2a4a8d | ||
![]() |
0a889f67b6 | ||
![]() |
7cedb9415f | ||
![]() |
c294ddf565 | ||
![]() |
2ff7ea43cf | ||
![]() |
99e83b3e70 | ||
![]() |
3a2f15d1ef | ||
![]() |
36b4d08779 | ||
![]() |
666ffda1df | ||
![]() |
eccd67d131 | ||
![]() |
a475fa10be | ||
![]() |
906c26bbe4 | ||
![]() |
1f2897664a | ||
![]() |
d7b38b2a78 | ||
![]() |
d49ae535a1 | ||
![]() |
69342e7f69 | ||
![]() |
85562679a2 | ||
![]() |
a27a27905f | ||
![]() |
4682507b25 | ||
![]() |
7ac4fbc387 | ||
![]() |
ff98a9bcd8 | ||
![]() |
7abcea1d03 | ||
![]() |
ab0ff30886 | ||
![]() |
5351ba6c55 | ||
![]() |
a4679ca7e5 | ||
![]() |
6114337660 | ||
![]() |
660a6dbd56 | ||
![]() |
6523b02913 | ||
![]() |
4e0a0a0105 | ||
![]() |
f790d29355 | ||
![]() |
bcb27f666a | ||
![]() |
35a9e7cdc9 | ||
![]() |
4ba64fdfcc | ||
![]() |
de7fcb30da | ||
![]() |
cb982d6552 | ||
![]() |
c3d71cbdd6 | ||
![]() |
7926277acd | ||
![]() |
e135b014be | ||
![]() |
9fdac08c67 | ||
![]() |
9979d8664d | ||
![]() |
3fd4be9929 | ||
![]() |
2451bbbd34 | ||
![]() |
d6402fbaf8 | ||
![]() |
c2b56c1fa4 | ||
![]() |
8949e7cc27 | ||
![]() |
95ed5087d3 | ||
![]() |
cceea734b3 | ||
![]() |
ba15b28c7c | ||
![]() |
e96954cf60 | ||
![]() |
86e084bf05 | ||
![]() |
7eaa50949d | ||
![]() |
2340164394 |
@@ -1,17 +0,0 @@
|
||||
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
|
||||
# For additional information regarding the format and rule options, please see:
|
||||
# https://github.com/browserslist/browserslist#queries
|
||||
|
||||
# For the full list of supported browsers by the Angular framework, please see:
|
||||
# https://angular.io/guide/browser-support
|
||||
|
||||
# You can see what browsers were selected by your queries by running:
|
||||
# npx browserslist
|
||||
|
||||
last 1 Chrome version
|
||||
last 1 Firefox version
|
||||
last 2 Edge major versions
|
||||
last 2 Safari major versions
|
||||
last 2 iOS major versions
|
||||
Firefox ESR
|
||||
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.
|
@@ -15,3 +15,6 @@ trim_trailing_whitespace = false
|
||||
|
||||
[*.ts]
|
||||
quote_type = single
|
||||
|
||||
[*.json5]
|
||||
ij_json_keep_blank_lines_in_code = 3
|
||||
|
@@ -7,7 +7,8 @@
|
||||
"eslint-plugin-jsdoc",
|
||||
"eslint-plugin-deprecation",
|
||||
"unused-imports",
|
||||
"eslint-plugin-lodash"
|
||||
"eslint-plugin-lodash",
|
||||
"eslint-plugin-jsonc"
|
||||
],
|
||||
"overrides": [
|
||||
{
|
||||
@@ -224,6 +225,42 @@
|
||||
"@angular-eslint/template/no-negated-async": "off",
|
||||
"@angular-eslint/template/eqeqeq": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": [
|
||||
"*.json5"
|
||||
],
|
||||
"extends": [
|
||||
"plugin:jsonc/recommended-with-jsonc"
|
||||
],
|
||||
"rules": {
|
||||
"no-irregular-whitespace": "error",
|
||||
"no-trailing-spaces": "error",
|
||||
"jsonc/comma-dangle": [
|
||||
"error",
|
||||
"always-multiline"
|
||||
],
|
||||
"jsonc/indent": [
|
||||
"error",
|
||||
2
|
||||
],
|
||||
"jsonc/key-spacing": [
|
||||
"error",
|
||||
{
|
||||
"beforeColon": false,
|
||||
"afterColon": true,
|
||||
"mode": "strict"
|
||||
}
|
||||
],
|
||||
"jsonc/no-dupe-keys": "off",
|
||||
"jsonc/quotes": [
|
||||
"error",
|
||||
"double",
|
||||
{
|
||||
"avoidEscape": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@@ -1,26 +0,0 @@
|
||||
# This workflow runs whenever a new pull request is created
|
||||
# TEMPORARILY DISABLED. Unfortunately this doesn't work for PRs created from forked repositories (which is how we tend to create PRs).
|
||||
# There is no known workaround yet. See https://github.community/t/how-to-use-github-token-for-prs-from-forks/16818
|
||||
name: Pull Request opened
|
||||
|
||||
# Only run for newly opened PRs against the "main" branch
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened]
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
automation:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# Assign the PR to whomever created it. This is useful for visualizing assignments on project boards
|
||||
# See https://github.com/marketplace/actions/pull-request-assigner
|
||||
- name: Assign PR to creator
|
||||
uses: thomaseizinger/assign-pr-creator-action@v1.0.0
|
||||
# Note, this authentication token is created automatically
|
||||
# See: https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
# Ignore errors. It is possible the PR was created by someone who cannot be assigned
|
||||
continue-on-error: true
|
88
.github/workflows/build.yml
vendored
88
.github/workflows/build.yml
vendored
@@ -15,15 +15,26 @@ jobs:
|
||||
env:
|
||||
# The ci step will test the dspace-angular code against DSpace REST.
|
||||
# Direct that step to utilize a DSpace REST service that has been started in docker.
|
||||
# NOTE: These settings should be kept in sync with those in [src]/docker/docker-compose-ci.yml
|
||||
DSPACE_REST_HOST: 127.0.0.1
|
||||
DSPACE_REST_PORT: 8080
|
||||
DSPACE_REST_NAMESPACE: '/server'
|
||||
DSPACE_REST_SSL: false
|
||||
# Spin up UI on 127.0.0.1 to avoid host resolution issues in e2e tests with Node 18+
|
||||
DSPACE_UI_HOST: 127.0.0.1
|
||||
DSPACE_UI_PORT: 4000
|
||||
# Ensure all SSR caching is disabled in test environment
|
||||
DSPACE_CACHE_SERVERSIDE_BOTCACHE_MAX: 0
|
||||
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
|
||||
# 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"
|
||||
# Bump Node heap size (OOM in CI after upgrading to Angular 15)
|
||||
NODE_OPTIONS: '--max-old-space-size=4096'
|
||||
# Project name to use when running "docker compose" prior to e2e tests
|
||||
COMPOSE_PROJECT_NAME: 'ci'
|
||||
strategy:
|
||||
# Create a matrix of Node versions to test against (in parallel)
|
||||
matrix:
|
||||
@@ -34,11 +45,11 @@ jobs:
|
||||
steps:
|
||||
# https://github.com/actions/checkout
|
||||
- name: Checkout codebase
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# https://github.com/actions/setup-node
|
||||
- name: Install Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
|
||||
@@ -61,9 +72,9 @@ jobs:
|
||||
# https://github.com/actions/cache/blob/main/examples.md#node---yarn
|
||||
- name: Get Yarn cache directory
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
|
||||
- name: Cache Yarn dependencies
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
# Cache entire Yarn cache directory (see previous step)
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
@@ -86,30 +97,33 @@ jobs:
|
||||
- name: Run specs (unit tests)
|
||||
run: yarn 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)
|
||||
# NOTE: Angular CLI only supports code coverage for specs. See https://github.com/angular/angular-cli/issues/6286
|
||||
# Upload coverage reports to Codecov (for one version of Node only)
|
||||
# https://github.com/codecov/codecov-action
|
||||
- name: Upload coverage to Codecov.io
|
||||
uses: codecov/codecov-action@v3
|
||||
if: matrix.node-version == '16.x'
|
||||
- name: Upload code coverage report to Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
if: matrix.node-version == '18.x'
|
||||
with:
|
||||
name: coverage-report-${{ matrix.node-version }}
|
||||
path: 'coverage/dspace-angular/lcov.info'
|
||||
retention-days: 14
|
||||
|
||||
# Using docker-compose start backend using CI configuration
|
||||
# Using "docker compose" start backend using CI configuration
|
||||
# and load assetstore from a cached copy
|
||||
- name: Start DSpace REST Backend via Docker (for e2e tests)
|
||||
run: |
|
||||
docker-compose -f ./docker/docker-compose-ci.yml up -d
|
||||
docker-compose -f ./docker/cli.yml -f ./docker/cli.assetstore.yml run --rm dspace-cli
|
||||
docker compose -f ./docker/docker-compose-ci.yml up -d
|
||||
docker compose -f ./docker/cli.yml -f ./docker/cli.assetstore.yml run --rm dspace-cli
|
||||
docker container ls
|
||||
|
||||
# Run integration tests via Cypress.io
|
||||
# https://github.com/cypress-io/github-action
|
||||
# (NOTE: to run these e2e tests locally, just use 'ng e2e')
|
||||
- name: Run e2e tests (integration tests)
|
||||
uses: cypress-io/github-action@v4
|
||||
uses: cypress-io/github-action@v6
|
||||
with:
|
||||
# Run tests in Chrome, headless mode
|
||||
# Run tests in Chrome, headless mode (default)
|
||||
browser: chrome
|
||||
headless: true
|
||||
# Start app before running tests (will be stopped automatically after tests finish)
|
||||
start: yarn run serve:ssr
|
||||
# Wait for backend & frontend to be available
|
||||
@@ -121,19 +135,19 @@ jobs:
|
||||
# Cypress always creates a video of all e2e tests (whether they succeeded or failed)
|
||||
# Save those in an Artifact
|
||||
- name: Upload e2e test videos to Artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
if: always()
|
||||
with:
|
||||
name: e2e-test-videos
|
||||
name: e2e-test-videos-${{ matrix.node-version }}
|
||||
path: cypress/videos
|
||||
|
||||
# If e2e tests fail, Cypress creates a screenshot of what happened
|
||||
# Save those in an Artifact
|
||||
- name: Upload e2e test failure screenshots to Artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
if: failure()
|
||||
with:
|
||||
name: e2e-test-screenshots
|
||||
name: e2e-test-screenshots-${{ matrix.node-version }}
|
||||
path: cypress/screenshots
|
||||
|
||||
- name: Stop app (in case it stays up after e2e tests)
|
||||
@@ -168,4 +182,38 @@ jobs:
|
||||
run: kill -9 $(lsof -t -i:4000)
|
||||
|
||||
- name: Shutdown Docker containers
|
||||
run: docker-compose -f ./docker/docker-compose-ci.yml down
|
||||
run: docker compose -f ./docker/docker-compose-ci.yml down
|
||||
|
||||
# Codecov upload is a separate job in order to allow us to restart this separate from the entire build/test
|
||||
# job above. This is necessary because Codecov uploads seem to randomly fail at times.
|
||||
# See https://community.codecov.com/t/upload-issues-unable-to-locate-build-via-github-actions-api/3954
|
||||
codecov:
|
||||
# Must run after 'tests' job above
|
||||
needs: tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Download artifacts from previous 'tests' job
|
||||
- name: Download coverage artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
|
||||
# Now attempt upload to Codecov using its action.
|
||||
# NOTE: We use a retry action to retry the Codecov upload if it fails the first time.
|
||||
#
|
||||
# Retry action: https://github.com/marketplace/actions/retry-action
|
||||
# Codecov action: https://github.com/codecov/codecov-action
|
||||
- name: Upload coverage to Codecov.io
|
||||
uses: Wandalen/wretry.action@v1.3.0
|
||||
with:
|
||||
action: codecov/codecov-action@v4
|
||||
# Ensure codecov-action throws an error when it fails to upload
|
||||
# This allows us to auto-restart the action if an error is thrown
|
||||
with: |
|
||||
fail_ci_if_error: true
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
# Try re-running action 5 times max
|
||||
attempt_limit: 5
|
||||
# Run again in 30 seconds
|
||||
attempt_delay: 30000
|
||||
|
12
.github/workflows/codescan.yml
vendored
12
.github/workflows/codescan.yml
vendored
@@ -5,12 +5,16 @@
|
||||
# because CodeQL requires a fresh build with all tests *disabled*.
|
||||
name: "Code Scanning"
|
||||
|
||||
# Run this code scan for all pushes / PRs to main branch. Also run once a week.
|
||||
# Run this code scan for all pushes / PRs to main or maintenance branches. Also run once a week.
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
branches:
|
||||
- main
|
||||
- 'dspace-**'
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
branches:
|
||||
- main
|
||||
- 'dspace-**'
|
||||
# Don't run if PR is only updating static documentation
|
||||
paths-ignore:
|
||||
- '**/*.md'
|
||||
@@ -31,7 +35,7 @@ jobs:
|
||||
steps:
|
||||
# https://github.com/actions/checkout
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
# https://github.com/github/codeql-action
|
||||
|
107
.github/workflows/docker.yml
vendored
107
.github/workflows/docker.yml
vendored
@@ -3,6 +3,9 @@ name: Docker images
|
||||
|
||||
# Run this Build for all pushes to 'main' or maintenance branches, or tagged releases.
|
||||
# Also run for PRs to ensure PR doesn't break Docker build process
|
||||
# NOTE: uses "reusable-docker-build.yml" in DSpace/DSpace to actually build each of the Docker images
|
||||
# https://github.com/DSpace/DSpace/blob/dspace-7_x/.github/workflows/reusable-docker-build.yml
|
||||
#
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
@@ -16,75 +19,41 @@ permissions:
|
||||
contents: read # to fetch code (actions/checkout)
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
#############################################################
|
||||
# Build/Push the 'dspace/dspace-angular' image
|
||||
#############################################################
|
||||
dspace-angular:
|
||||
# Ensure this job never runs on forked repos. It's only executed for 'dspace/dspace-angular'
|
||||
if: github.repository == 'dspace/dspace-angular'
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
# Define tags to use for Docker images based on Git tags/branches (for docker/metadata-action)
|
||||
# For a new commit on default branch (main), use the literal tag 'dspace-7_x' on Docker image.
|
||||
# For a new commit on other branches, use the branch name as the tag for Docker image.
|
||||
# For a new tag, copy that tag name as the tag for Docker image.
|
||||
IMAGE_TAGS: |
|
||||
type=raw,value=dspace-7_x,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }}
|
||||
type=ref,event=branch,enable=${{ !endsWith(github.ref, github.event.repository.default_branch) }}
|
||||
type=ref,event=tag
|
||||
# Define default tag "flavor" for docker/metadata-action per
|
||||
# https://github.com/docker/metadata-action#flavor-input
|
||||
# We turn off 'latest' tag by default.
|
||||
TAGS_FLAVOR: |
|
||||
latest=false
|
||||
# Architectures / Platforms for which we will build Docker images
|
||||
# If this is a PR, we ONLY build for AMD64. For PRs we only do a sanity check test to ensure Docker builds work.
|
||||
# If this is NOT a PR (e.g. a tag or merge commit), also build for ARM64.
|
||||
PLATFORMS: linux/amd64${{ github.event_name != 'pull_request' && ', linux/arm64' || '' }}
|
||||
# Use the reusable-docker-build.yml script from DSpace/DSpace repo to build our Docker image
|
||||
uses: DSpace/DSpace/.github/workflows/reusable-docker-build.yml@dspace-7_x
|
||||
with:
|
||||
build_id: dspace-angular-dev
|
||||
image_name: dspace/dspace-angular
|
||||
dockerfile_path: ./Dockerfile
|
||||
secrets:
|
||||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
||||
DOCKER_ACCESS_TOKEN: ${{ secrets.DOCKER_ACCESS_TOKEN }}
|
||||
|
||||
steps:
|
||||
# https://github.com/actions/checkout
|
||||
- name: Checkout codebase
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# https://github.com/docker/setup-buildx-action
|
||||
- name: Setup Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
# https://github.com/docker/setup-qemu-action
|
||||
- name: Set up QEMU emulation to build for multiple architectures
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
# https://github.com/docker/login-action
|
||||
- name: Login to DockerHub
|
||||
# Only login if not a PR, as PRs only trigger a Docker build and not a push
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
|
||||
|
||||
###############################################
|
||||
# Build/Push the 'dspace/dspace-angular' image
|
||||
###############################################
|
||||
# https://github.com/docker/metadata-action
|
||||
# Get Metadata for docker_build step below
|
||||
- name: Sync metadata (tags, labels) from GitHub to Docker for 'dspace-angular' image
|
||||
id: meta_build
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: dspace/dspace-angular
|
||||
tags: ${{ env.IMAGE_TAGS }}
|
||||
flavor: ${{ env.TAGS_FLAVOR }}
|
||||
|
||||
# https://github.com/docker/build-push-action
|
||||
- name: Build and push 'dspace-angular' image
|
||||
id: docker_build
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
platforms: ${{ env.PLATFORMS }}
|
||||
# For pull requests, we run the Docker build (to ensure no PR changes break the build),
|
||||
# but we ONLY do an image push to DockerHub if it's NOT a PR
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
# Use tags / labels provided by 'docker/metadata-action' above
|
||||
tags: ${{ steps.meta_build.outputs.tags }}
|
||||
labels: ${{ steps.meta_build.outputs.labels }}
|
||||
#############################################################
|
||||
# Build/Push the 'dspace/dspace-angular' image ('-dist' tag)
|
||||
#############################################################
|
||||
dspace-angular-dist:
|
||||
# Ensure this job never runs on forked repos. It's only executed for 'dspace/dspace-angular'
|
||||
if: github.repository == 'dspace/dspace-angular'
|
||||
# Use the reusable-docker-build.yml script from DSpace/DSpace repo to build our Docker image
|
||||
uses: DSpace/DSpace/.github/workflows/reusable-docker-build.yml@dspace-7_x
|
||||
with:
|
||||
build_id: dspace-angular-dist
|
||||
image_name: dspace/dspace-angular
|
||||
dockerfile_path: ./Dockerfile.dist
|
||||
# As this is a "dist" image, its tags are all suffixed with "-dist". Otherwise, it uses the same
|
||||
# tagging logic as the primary 'dspace/dspace-angular' image above.
|
||||
tags_flavor: suffix=-dist
|
||||
secrets:
|
||||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
||||
DOCKER_ACCESS_TOKEN: ${{ secrets.DOCKER_ACCESS_TOKEN }}
|
||||
# Enable redeploy of sandbox & demo if the branch for this image matches the deployment branch of
|
||||
# these sites as specified in reusable-docker-build.xml
|
||||
REDEPLOY_SANDBOX_URL: ${{ secrets.REDEPLOY_SANDBOX_URL }}
|
||||
REDEPLOY_DEMO_URL: ${{ secrets.REDEPLOY_DEMO_URL }}
|
2
.github/workflows/issue_opened.yml
vendored
2
.github/workflows/issue_opened.yml
vendored
@@ -16,7 +16,7 @@ jobs:
|
||||
# Only add to project board if issue is flagged as "needs triage" or has no labels
|
||||
# NOTE: By default we flag new issues as "needs triage" in our issue template
|
||||
if: (contains(github.event.issue.labels.*.name, 'needs triage') || join(github.event.issue.labels.*.name) == '')
|
||||
uses: actions/add-to-project@v0.3.0
|
||||
uses: actions/add-to-project@v1.0.0
|
||||
# Note, the authentication token below is an ORG level Secret.
|
||||
# It must be created/recreated manually via a personal access token with admin:org, project, public_repo permissions
|
||||
# See: https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token#permissions-for-the-github_token
|
||||
|
11
.github/workflows/label_merge_conflicts.yml
vendored
11
.github/workflows/label_merge_conflicts.yml
vendored
@@ -1,11 +1,12 @@
|
||||
# This workflow checks open PRs for merge conflicts and labels them when conflicts are found
|
||||
name: Check for merge conflicts
|
||||
|
||||
# Run whenever the "main" branch is updated
|
||||
# NOTE: This means merge conflicts are only checked for when a PR is merged to main.
|
||||
# Run this for all pushes (i.e. merges) to 'main' or maintenance branches
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
branches:
|
||||
- main
|
||||
- 'dspace-**'
|
||||
# So that the `conflict_label_name` is removed if conflicts are resolved,
|
||||
# we allow this to run for `pull_request_target` so that github secrets are available.
|
||||
pull_request_target:
|
||||
@@ -23,7 +24,9 @@ jobs:
|
||||
steps:
|
||||
# See: https://github.com/prince-chrismc/label-merge-conflicts-action
|
||||
- name: Auto-label PRs with merge conflicts
|
||||
uses: prince-chrismc/label-merge-conflicts-action@v2
|
||||
uses: prince-chrismc/label-merge-conflicts-action@v3
|
||||
# Ignore any failures -- may occur (randomly?) for older, outdated PRs.
|
||||
continue-on-error: true
|
||||
# Add "merge conflict" label if a merge conflict is detected. Remove it when resolved.
|
||||
# Note, the authentication token is created automatically
|
||||
# See: https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token
|
||||
|
46
.github/workflows/port_merged_pull_request.yml
vendored
Normal file
46
.github/workflows/port_merged_pull_request.yml
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
# This workflow will attempt to port a merged pull request to
|
||||
# the branch specified in a "port to" label (if exists)
|
||||
name: Port merged Pull Request
|
||||
|
||||
# Only run for merged PRs against the "main" or maintenance branches
|
||||
# We allow this to run for `pull_request_target` so that github secrets are available
|
||||
# (This is required when the PR comes from a forked repo)
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [ closed ]
|
||||
branches:
|
||||
- main
|
||||
- 'dspace-**'
|
||||
|
||||
permissions:
|
||||
contents: write # so action can add comments
|
||||
pull-requests: write # so action can create pull requests
|
||||
|
||||
jobs:
|
||||
port_pr:
|
||||
runs-on: ubuntu-latest
|
||||
# Don't run on closed *unmerged* pull requests
|
||||
if: github.event.pull_request.merged
|
||||
steps:
|
||||
# Checkout code
|
||||
- uses: actions/checkout@v4
|
||||
# Port PR to other branch (ONLY if labeled with "port to")
|
||||
# See https://github.com/korthout/backport-action
|
||||
- name: Create backport pull requests
|
||||
uses: korthout/backport-action@v2
|
||||
with:
|
||||
# Trigger based on a "port to [branch]" label on PR
|
||||
# (This label must specify the branch name to port to)
|
||||
label_pattern: '^port to ([^ ]+)$'
|
||||
# Title to add to the (newly created) port PR
|
||||
pull_title: '[Port ${target_branch}] ${pull_title}'
|
||||
# Description to add to the (newly created) port PR
|
||||
pull_description: 'Port of #${pull_number} by @${pull_author} to `${target_branch}`.'
|
||||
# Copy all labels from original PR to (newly created) port PR
|
||||
# NOTE: The labels matching 'label_pattern' are automatically excluded
|
||||
copy_labels_pattern: '.*'
|
||||
# Skip any merge commits in the ported PR. This means only non-merge commits are cherry-picked to the new PR
|
||||
merge_commits: 'skip'
|
||||
# Use a personal access token (PAT) to create PR as 'dspace-bot' user.
|
||||
# A PAT is required in order for the new PR to trigger its own actions (for CI checks)
|
||||
github_token: ${{ secrets.PR_PORT_TOKEN }}
|
24
.github/workflows/pull_request_opened.yml
vendored
Normal file
24
.github/workflows/pull_request_opened.yml
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
# This workflow runs whenever a new pull request is created
|
||||
name: Pull Request opened
|
||||
|
||||
# Only run for newly opened PRs against the "main" or maintenance branches
|
||||
# We allow this to run for `pull_request_target` so that github secrets are available
|
||||
# (This is required to assign a PR back to the creator when the PR comes from a forked repo)
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [ opened ]
|
||||
branches:
|
||||
- main
|
||||
- 'dspace-**'
|
||||
|
||||
permissions:
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
automation:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# Assign the PR to whomever created it. This is useful for visualizing assignments on project boards
|
||||
# See https://github.com/toshimaru/auto-author-assign
|
||||
- name: Assign PR to creator
|
||||
uses: toshimaru/auto-author-assign@v2.1.0
|
2
.gitignore
vendored
2
.gitignore
vendored
@@ -39,3 +39,5 @@ package-lock.json
|
||||
/nbproject/
|
||||
|
||||
junit.xml
|
||||
|
||||
/src/mirador-viewer/config.local.js
|
||||
|
15
Dockerfile
15
Dockerfile
@@ -2,20 +2,27 @@
|
||||
# See https://github.com/DSpace/dspace-angular/tree/main/docker for usage details
|
||||
|
||||
FROM node:18-alpine
|
||||
WORKDIR /app
|
||||
ADD . /app/
|
||||
EXPOSE 4000
|
||||
|
||||
# Ensure Python and other build tools are available
|
||||
# These are needed to install some node modules, especially on linux/arm64
|
||||
RUN apk add --update python3 make g++ && rm -rf /var/cache/apk/*
|
||||
|
||||
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
|
||||
|
||||
# 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.
|
||||
# See Docker environment var precedence: https://docs.docker.com/compose/environment-variables/envvars-precedence/
|
||||
ENV NODE_OPTIONS="--max_old_space_size=4096"
|
||||
|
||||
# On startup, run in DEVELOPMENT mode (this defaults to live reloading enabled, etc).
|
||||
# Listen / accept connections from all IP addresses.
|
||||
# NOTE: At this time it is only possible to run Docker container in Production mode
|
||||
# if you have a public IP. See https://github.com/DSpace/dspace-angular/issues/1485
|
||||
# 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
|
||||
|
31
Dockerfile.dist
Normal file
31
Dockerfile.dist
Normal file
@@ -0,0 +1,31 @@
|
||||
# This image will be published as dspace/dspace-angular:$DSPACE_VERSION-dist
|
||||
# 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-7_x-dist .
|
||||
|
||||
FROM node:18-alpine as build
|
||||
|
||||
# Ensure Python and other build tools are available
|
||||
# These are needed to install some node modules, especially on linux/arm64
|
||||
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
|
||||
|
||||
ADD . /app/
|
||||
RUN yarn build:prod
|
||||
|
||||
FROM node:18-alpine
|
||||
RUN npm install --global pm2
|
||||
|
||||
COPY --chown=node:node --from=build /app/dist /app/dist
|
||||
COPY --chown=node:node config /app/config
|
||||
COPY --chown=node:node docker/dspace-ui.json /app/dspace-ui.json
|
||||
|
||||
WORKDIR /app
|
||||
USER node
|
||||
ENV NODE_ENV production
|
||||
EXPOSE 4000
|
||||
CMD pm2-runtime start dspace-ui.json --json
|
@@ -157,8 +157,8 @@ DSPACE_UI_SSL => DSPACE_SSL
|
||||
|
||||
The same settings can also be overwritten by setting system environment variables instead, E.g.:
|
||||
```bash
|
||||
export DSPACE_HOST=api7.dspace.org
|
||||
export DSPACE_UI_PORT=4200
|
||||
export DSPACE_HOST=demo.dspace.org
|
||||
export DSPACE_UI_PORT=4000
|
||||
```
|
||||
|
||||
The priority works as follows: **environment variable** overrides **variable in `.env` file** overrides external config set by `DSPACE_APP_CONFIG_PATH` overrides **`config.(prod or dev).yml`**
|
||||
@@ -288,7 +288,7 @@ E2E tests (aka integration tests) use [Cypress.io](https://www.cypress.io/). Con
|
||||
The test files can be found in the `./cypress/integration/` folder.
|
||||
|
||||
Before you can run e2e tests, two things are REQUIRED:
|
||||
1. You MUST be running the DSpace backend (i.e. REST API) locally. The e2e tests will *NOT* succeed if run against our demo REST API (https://api7.dspace.org/server/), as that server is uncontrolled and may have content added/removed at any time.
|
||||
1. You MUST be running the DSpace backend (i.e. REST API) locally. The e2e tests will *NOT* succeed if run against our demo/sandbox REST API (https://demo.dspace.org/server/ or https://sandbox.dspace.org/server/), as those sites may have content added/removed at any time.
|
||||
* After starting up your backend on localhost, make sure either your `config.prod.yml` or `config.dev.yml` has its `rest` settings defined to use that localhost backend.
|
||||
* If you'd prefer, you may instead use environment variables as described at [Configuring](#configuring). For example:
|
||||
```
|
||||
@@ -413,8 +413,7 @@ dspace-angular
|
||||
│ ├── merge-i18n-files.ts *
|
||||
│ ├── serve.ts *
|
||||
│ ├── sync-i18n-files.ts *
|
||||
│ ├── test-rest.ts *
|
||||
│ └── webpack.js *
|
||||
│ └── test-rest.ts *
|
||||
├── src * The source of the application
|
||||
│ ├── app * The source code of the application, subdivided by module/page.
|
||||
│ ├── assets * Folder for static resources
|
||||
|
16
angular.json
16
angular.json
@@ -266,16 +266,26 @@
|
||||
"options": {
|
||||
"lintFilePatterns": [
|
||||
"src/**/*.ts",
|
||||
"src/**/*.html"
|
||||
"src/**/*.html",
|
||||
"src/**/*.json5"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"defaultProject": "dspace-angular",
|
||||
"cli": {
|
||||
"analytics": false,
|
||||
"defaultCollection": "@angular-eslint/schematics"
|
||||
"schematicCollections": [
|
||||
"@angular-eslint/schematics"
|
||||
]
|
||||
},
|
||||
"schematics": {
|
||||
"@angular-eslint/schematics:application": {
|
||||
"setParserOptionsProject": true
|
||||
},
|
||||
"@angular-eslint/schematics:library": {
|
||||
"setParserOptionsProject": true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -17,12 +17,19 @@ ui:
|
||||
# Trust X-FORWARDED-* headers from proxies (default = true)
|
||||
useProxies: true
|
||||
|
||||
universal:
|
||||
# Whether to inline "critical" styles into the server-side rendered HTML.
|
||||
# Determining which styles are critical is a relatively expensive operation;
|
||||
# this option can be disabled to boost server performance at the expense of
|
||||
# loading smoothness. For improved SSR performance, DSpace defaults this to false (disabled).
|
||||
inlineCriticalCss: false
|
||||
|
||||
# The REST API server settings
|
||||
# NOTE: these settings define which (publicly available) REST API to use. They are usually
|
||||
# 'synced' with the 'dspace.server.url' setting in your backend's local.cfg.
|
||||
rest:
|
||||
ssl: true
|
||||
host: api7.dspace.org
|
||||
host: demo.dspace.org
|
||||
port: 443
|
||||
# NOTE: Space is capitalized because 'namespace' is a reserved string in TypeScript
|
||||
nameSpace: /server
|
||||
@@ -169,6 +176,12 @@ languages:
|
||||
- code: en
|
||||
label: English
|
||||
active: true
|
||||
- code: ar
|
||||
label: العربية
|
||||
active: true
|
||||
- code: bn
|
||||
label: বাংলা
|
||||
active: true
|
||||
- code: ca
|
||||
label: Català
|
||||
active: true
|
||||
@@ -178,21 +191,36 @@ languages:
|
||||
- code: de
|
||||
label: Deutsch
|
||||
active: true
|
||||
- code: el
|
||||
label: Ελληνικά
|
||||
active: true
|
||||
- code: es
|
||||
label: Español
|
||||
active: true
|
||||
- code: fi
|
||||
label: Suomi
|
||||
active: true
|
||||
- code: fr
|
||||
label: Français
|
||||
active: true
|
||||
- code: gd
|
||||
label: Gàidhlig
|
||||
active: true
|
||||
- code: lv
|
||||
label: Latviešu
|
||||
- code: hi
|
||||
label: हिंदी
|
||||
active: true
|
||||
- code: hu
|
||||
label: Magyar
|
||||
active: true
|
||||
- code: it
|
||||
label: Italiano
|
||||
active: true
|
||||
- code: kk
|
||||
label: Қазақ
|
||||
active: true
|
||||
- code: lv
|
||||
label: Latviešu
|
||||
active: true
|
||||
- code: nl
|
||||
label: Nederlands
|
||||
active: true
|
||||
@@ -205,8 +233,11 @@ languages:
|
||||
- code: pt-BR
|
||||
label: Português do Brasil
|
||||
active: true
|
||||
- code: fi
|
||||
label: Suomi
|
||||
- code: sr-lat
|
||||
label: Srpski (lat)
|
||||
active: true
|
||||
- code: sr-cyr
|
||||
label: Српски
|
||||
active: true
|
||||
- code: sv
|
||||
label: Svenska
|
||||
@@ -214,21 +245,12 @@ languages:
|
||||
- code: tr
|
||||
label: Türkçe
|
||||
active: true
|
||||
- code: kk
|
||||
label: Қазақ
|
||||
active: true
|
||||
- code: bn
|
||||
label: বাংলা
|
||||
active: true
|
||||
- code: hi
|
||||
label: हिंदी
|
||||
active: true
|
||||
- code: el
|
||||
label: Ελληνικά
|
||||
active: true
|
||||
- code: uk
|
||||
label: Yкраї́нська
|
||||
active: true
|
||||
- code: vi
|
||||
label: Tiếng Việt
|
||||
active: true
|
||||
|
||||
|
||||
# Browse-By Pages
|
||||
@@ -286,33 +308,33 @@ themes:
|
||||
#
|
||||
# # A theme with a handle property will match the community, collection or item with the given
|
||||
# # handle, and all collections and/or items within it
|
||||
# - name: 'custom',
|
||||
# handle: '10673/1233'
|
||||
# - name: custom
|
||||
# handle: 10673/1233
|
||||
#
|
||||
# # A theme with a regex property will match the route using a regular expression. If it
|
||||
# # matches the route for a community or collection it will also apply to all collections
|
||||
# # and/or items within it
|
||||
# - name: 'custom',
|
||||
# regex: 'collections\/e8043bc2.*'
|
||||
# - name: custom
|
||||
# regex: collections\/e8043bc2.*
|
||||
#
|
||||
# # A theme with a uuid property will match the community, collection or item with the given
|
||||
# # ID, and all collections and/or items within it
|
||||
# - name: 'custom',
|
||||
# uuid: '0958c910-2037-42a9-81c7-dca80e3892b4'
|
||||
# - name: custom
|
||||
# uuid: 0958c910-2037-42a9-81c7-dca80e3892b4
|
||||
#
|
||||
# # The extends property specifies an ancestor theme (by name). Whenever a themed component is not found
|
||||
# # in the current theme, its ancestor theme(s) will be checked recursively before falling back to default.
|
||||
# - name: 'custom-A',
|
||||
# extends: 'custom-B',
|
||||
# - name: custom-A
|
||||
# extends: custom-B
|
||||
# # Any of the matching properties above can be used
|
||||
# handle: '10673/34'
|
||||
# handle: 10673/34
|
||||
#
|
||||
# - name: 'custom-B',
|
||||
# extends: 'custom',
|
||||
# handle: '10673/12'
|
||||
# - name: custom-B
|
||||
# extends: custom
|
||||
# handle: 10673/12
|
||||
#
|
||||
# # A theme with only a name will match every route
|
||||
# name: 'custom'
|
||||
# name: custom
|
||||
#
|
||||
# # This theme will use the default bootstrap styling for DSpace components
|
||||
# - name: BASE_THEME_NAME
|
||||
@@ -369,3 +391,8 @@ vocabularies:
|
||||
- filter: 'subject'
|
||||
vocabulary: 'srsc'
|
||||
enabled: true
|
||||
|
||||
# Default collection/community sorting order at Advanced search, Create/update community and collection when there are not a query.
|
||||
comcolSelectionSort:
|
||||
sortField: 'dc.title'
|
||||
sortDirection: 'ASC'
|
||||
|
@@ -1,5 +1,5 @@
|
||||
rest:
|
||||
ssl: true
|
||||
host: api7.dspace.org
|
||||
host: demo.dspace.org
|
||||
port: 443
|
||||
nameSpace: /server
|
||||
|
47
cypress.config.ts
Normal file
47
cypress.config.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import { defineConfig } from 'cypress';
|
||||
|
||||
export default defineConfig({
|
||||
videosFolder: 'cypress/videos',
|
||||
screenshotsFolder: 'cypress/screenshots',
|
||||
fixturesFolder: 'cypress/fixtures',
|
||||
retries: {
|
||||
runMode: 2,
|
||||
openMode: 0,
|
||||
},
|
||||
env: {
|
||||
// Global DSpace environment variables used in all our Cypress e2e tests
|
||||
// May be modified in this config, or overridden in a variety of ways.
|
||||
// See Cypress environment variable docs: https://docs.cypress.io/guides/guides/environment-variables
|
||||
// Default values listed here are all valid for the Demo Entities Data set available at
|
||||
// https://github.com/DSpace-Labs/AIP-Files/releases/tag/demo-entities-data
|
||||
// (This is the data set used in our CI environment)
|
||||
|
||||
// Admin account used for administrative tests
|
||||
DSPACE_TEST_ADMIN_USER: 'dspacedemo+admin@gmail.com',
|
||||
DSPACE_TEST_ADMIN_PASSWORD: 'dspace',
|
||||
// Community/collection/publication used for view/edit tests
|
||||
DSPACE_TEST_COMMUNITY: '0958c910-2037-42a9-81c7-dca80e3892b4',
|
||||
DSPACE_TEST_COLLECTION: '282164f5-d325-4740-8dd1-fa4d6d3e7200',
|
||||
DSPACE_TEST_ENTITY_PUBLICATION: '6160810f-1e53-40db-81ef-f6621a727398',
|
||||
// Search term (should return results) used in search tests
|
||||
DSPACE_TEST_SEARCH_TERM: 'test',
|
||||
// Main Collection used for submission tests. Should be able to accept normal Item objects
|
||||
DSPACE_TEST_SUBMIT_COLLECTION_NAME: 'Sample Collection',
|
||||
DSPACE_TEST_SUBMIT_COLLECTION_UUID: '9d8334e9-25d3-4a67-9cea-3dffdef80144',
|
||||
// Collection used for Person entity submission tests. MUST be configured with EntityType=Person.
|
||||
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_PASSWORD: 'dspace',
|
||||
},
|
||||
e2e: {
|
||||
// Setup our plugins for e2e tests
|
||||
setupNodeEvents(on, config) {
|
||||
return require('./cypress/plugins/index.ts')(on, config);
|
||||
},
|
||||
// This is the base URL that Cypress will run all tests against
|
||||
// It can be overridden via the CYPRESS_BASE_URL environment variable
|
||||
// (By default we set this to a value which should work in most development environments)
|
||||
baseUrl: 'http://localhost:4000',
|
||||
},
|
||||
});
|
25
cypress.json
25
cypress.json
@@ -1,25 +0,0 @@
|
||||
{
|
||||
"integrationFolder": "cypress/integration",
|
||||
"supportFile": "cypress/support/index.ts",
|
||||
"videosFolder": "cypress/videos",
|
||||
"screenshotsFolder": "cypress/screenshots",
|
||||
"pluginsFile": "cypress/plugins/index.ts",
|
||||
"fixturesFolder": "cypress/fixtures",
|
||||
"baseUrl": "http://127.0.0.1:4000",
|
||||
"retries": {
|
||||
"runMode": 2,
|
||||
"openMode": 0
|
||||
},
|
||||
"env": {
|
||||
"DSPACE_TEST_ADMIN_USER": "dspacedemo+admin@gmail.com",
|
||||
"DSPACE_TEST_ADMIN_PASSWORD": "dspace",
|
||||
"DSPACE_TEST_COMMUNITY": "0958c910-2037-42a9-81c7-dca80e3892b4",
|
||||
"DSPACE_TEST_COLLECTION": "282164f5-d325-4740-8dd1-fa4d6d3e7200",
|
||||
"DSPACE_TEST_ENTITY_PUBLICATION": "e98b0f27-5c19-49a0-960d-eb6ad5287067",
|
||||
"DSPACE_TEST_SEARCH_TERM": "test",
|
||||
"DSPACE_TEST_SUBMIT_COLLECTION_NAME": "Sample Collection",
|
||||
"DSPACE_TEST_SUBMIT_COLLECTION_UUID": "9d8334e9-25d3-4a67-9cea-3dffdef80144",
|
||||
"DSPACE_TEST_SUBMIT_USER": "dspacedemo+submit@gmail.com",
|
||||
"DSPACE_TEST_SUBMIT_USER_PASSWORD": "dspace"
|
||||
}
|
||||
}
|
28
cypress/e2e/admin-sidebar.cy.ts
Normal file
28
cypress/e2e/admin-sidebar.cy.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { Options } from 'cypress-axe';
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('Admin Sidebar', () => {
|
||||
beforeEach(() => {
|
||||
// Must login as an Admin for sidebar to appear
|
||||
cy.visit('/login');
|
||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||
});
|
||||
|
||||
it('should be pinnable and pass accessibility tests', () => {
|
||||
// Pin the sidebar open
|
||||
cy.get('#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);
|
||||
});
|
||||
});
|
@@ -1,10 +1,9 @@
|
||||
import { TEST_ENTITY_PUBLICATION } from 'cypress/support';
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('Breadcrumbs', () => {
|
||||
it('should pass accessibility tests', () => {
|
||||
// Visit an Item, as those have more breadcrumbs
|
||||
cy.visit('/entities/publication/' + TEST_ENTITY_PUBLICATION);
|
||||
cy.visit('/entities/publication/'.concat(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION')));
|
||||
|
||||
// Wait for breadcrumbs to be visible
|
||||
cy.get('ds-breadcrumbs').should('be.visible');
|
128
cypress/e2e/collection-edit.cy.ts
Normal file
128
cypress/e2e/collection-edit.cy.ts
Normal file
@@ -0,0 +1,128 @@
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
const COLLECTION_EDIT_PAGE = '/collections/'.concat(Cypress.env('DSPACE_TEST_COLLECTION')).concat('/edit');
|
||||
|
||||
beforeEach(() => {
|
||||
// All tests start with visiting the Edit Collection Page
|
||||
cy.visit(COLLECTION_EDIT_PAGE);
|
||||
|
||||
// This page is restricted, so we will be shown the login form. Fill it out & submit.
|
||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||
});
|
||||
|
||||
describe('Edit Collection > Edit Metadata tab', () => {
|
||||
it('should pass accessibility tests', () => {
|
||||
// <ds-edit-collection> tag must be loaded
|
||||
cy.get('ds-edit-collection').should('be.visible');
|
||||
|
||||
// Analyze <ds-edit-collection> for accessibility issues
|
||||
testA11y('ds-edit-collection');
|
||||
});
|
||||
});
|
||||
|
||||
describe('Edit Collection > Assign Roles tab', () => {
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
cy.get('a[data-test="roles"]').click();
|
||||
|
||||
// <ds-collection-roles> tag must be loaded
|
||||
cy.get('ds-collection-roles').should('be.visible');
|
||||
|
||||
// Analyze for accessibility issues
|
||||
testA11y('ds-collection-roles');
|
||||
});
|
||||
});
|
||||
|
||||
describe('Edit Collection > Content Source tab', () => {
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
cy.get('a[data-test="source"]').click();
|
||||
|
||||
// <ds-collection-source> tag must be loaded
|
||||
cy.get('ds-collection-source').should('be.visible');
|
||||
|
||||
// Check the external source checkbox (to display all fields on the page)
|
||||
cy.get('#externalSourceCheck').check();
|
||||
|
||||
// Wait for the source controls to appear
|
||||
// cy.get('ds-collection-source-controls').should('be.visible');
|
||||
|
||||
// Analyze entire page for accessibility issues
|
||||
testA11y('ds-collection-source');
|
||||
});
|
||||
});
|
||||
|
||||
describe('Edit Collection > Curate tab', () => {
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
cy.get('a[data-test="curate"]').click();
|
||||
|
||||
// <ds-collection-curate> tag must be loaded
|
||||
cy.get('ds-collection-curate').should('be.visible');
|
||||
|
||||
// Analyze for accessibility issues
|
||||
testA11y('ds-collection-curate');
|
||||
});
|
||||
});
|
||||
|
||||
describe('Edit Collection > Access Control tab', () => {
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
cy.get('a[data-test="access-control"]').click();
|
||||
|
||||
// <ds-collection-access-control> tag must be loaded
|
||||
cy.get('ds-collection-access-control').should('be.visible');
|
||||
|
||||
// Analyze for accessibility issues
|
||||
testA11y('ds-collection-access-control');
|
||||
});
|
||||
});
|
||||
|
||||
describe('Edit Collection > Authorizations tab', () => {
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
cy.get('a[data-test="authorizations"]').click();
|
||||
|
||||
// <ds-collection-authorizations> tag must be loaded
|
||||
cy.get('ds-collection-authorizations').should('be.visible');
|
||||
|
||||
// Analyze for accessibility issues
|
||||
testA11y('ds-collection-authorizations');
|
||||
});
|
||||
});
|
||||
|
||||
describe('Edit Collection > Item Mapper tab', () => {
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
cy.get('a[data-test="mapper"]').click();
|
||||
|
||||
// <ds-collection-item-mapper> tag must be loaded
|
||||
cy.get('ds-collection-item-mapper').should('be.visible');
|
||||
|
||||
// Analyze entire page for accessibility issues
|
||||
testA11y('ds-collection-item-mapper');
|
||||
|
||||
// Click on the "Map new Items" tab
|
||||
cy.get('li[data-test="mapTab"] a').click();
|
||||
|
||||
// Make sure search form is now visible
|
||||
cy.get('ds-search-form').should('be.visible');
|
||||
|
||||
// Analyze entire page (again) for accessibility issues
|
||||
testA11y('ds-collection-item-mapper');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
describe('Edit Collection > Delete page', () => {
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
cy.get('a[data-test="delete-button"]').click();
|
||||
|
||||
// <ds-delete-collection> tag must be loaded
|
||||
cy.get('ds-delete-collection').should('be.visible');
|
||||
|
||||
// Analyze for accessibility issues
|
||||
testA11y('ds-delete-collection');
|
||||
});
|
||||
});
|
@@ -1,13 +1,12 @@
|
||||
import { TEST_COLLECTION } from 'cypress/support';
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('Collection Page', () => {
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
cy.visit('/collections/' + TEST_COLLECTION);
|
||||
cy.visit('/collections/'.concat(Cypress.env('DSPACE_TEST_COLLECTION')));
|
||||
|
||||
// <ds-collection-page> tag must be loaded
|
||||
cy.get('ds-collection-page').should('exist');
|
||||
cy.get('ds-collection-page').should('be.visible');
|
||||
|
||||
// Analyze <ds-collection-page> for accessibility issues
|
||||
testA11y('ds-collection-page');
|
37
cypress/e2e/collection-statistics.cy.ts
Normal file
37
cypress/e2e/collection-statistics.cy.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import { REGEX_MATCH_NON_EMPTY_TEXT } from 'cypress/support/e2e';
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('Collection Statistics Page', () => {
|
||||
const COLLECTIONSTATISTICSPAGE = '/statistics/collections/'.concat(Cypress.env('DSPACE_TEST_COLLECTION'));
|
||||
|
||||
it('should load if you click on "Statistics" from a Collection page', () => {
|
||||
cy.visit('/collections/'.concat(Cypress.env('DSPACE_TEST_COLLECTION')));
|
||||
cy.get('ds-navbar ds-link-menu-item a[data-test="link-menu-item.menu.section.statistics"]').click();
|
||||
cy.location('pathname').should('eq', COLLECTIONSTATISTICSPAGE);
|
||||
});
|
||||
|
||||
it('should contain a "Total visits" section', () => {
|
||||
cy.visit(COLLECTIONSTATISTICSPAGE);
|
||||
cy.get('table[data-test="TotalVisits"]').should('be.visible');
|
||||
});
|
||||
|
||||
it('should contain a "Total visits per month" section', () => {
|
||||
cy.visit(COLLECTIONSTATISTICSPAGE);
|
||||
// Check just for existence because this table is empty in CI environment as it's historical data
|
||||
cy.get('.'.concat(Cypress.env('DSPACE_TEST_COLLECTION')).concat('_TotalVisitsPerMonth')).should('exist');
|
||||
});
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
cy.visit(COLLECTIONSTATISTICSPAGE);
|
||||
|
||||
// <ds-collection-statistics-page> tag must be loaded
|
||||
cy.get('ds-collection-statistics-page').should('be.visible');
|
||||
|
||||
// Verify / wait until "Total Visits" table's label is non-empty
|
||||
// (This table loads these labels asynchronously, so we want to wait for them before analyzing page)
|
||||
cy.get('table[data-test="TotalVisits"] th[data-test="statistics-label"]').contains(REGEX_MATCH_NON_EMPTY_TEXT);
|
||||
|
||||
// Analyze <ds-collection-statistics-page> for accessibility issues
|
||||
testA11y('ds-collection-statistics-page');
|
||||
});
|
||||
});
|
86
cypress/e2e/community-edit.cy.ts
Normal file
86
cypress/e2e/community-edit.cy.ts
Normal file
@@ -0,0 +1,86 @@
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
const COMMUNITY_EDIT_PAGE = '/communities/'.concat(Cypress.env('DSPACE_TEST_COMMUNITY')).concat('/edit');
|
||||
|
||||
beforeEach(() => {
|
||||
// All tests start with visiting the Edit Community Page
|
||||
cy.visit(COMMUNITY_EDIT_PAGE);
|
||||
|
||||
// This page is restricted, so we will be shown the login form. Fill it out & submit.
|
||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||
});
|
||||
|
||||
describe('Edit Community > Edit Metadata tab', () => {
|
||||
it('should pass accessibility tests', () => {
|
||||
// <ds-edit-community> tag must be loaded
|
||||
cy.get('ds-edit-community').should('be.visible');
|
||||
|
||||
// Analyze <ds-edit-community> for accessibility issues
|
||||
testA11y('ds-edit-community');
|
||||
});
|
||||
});
|
||||
|
||||
describe('Edit Community > Assign Roles tab', () => {
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
cy.get('a[data-test="roles"]').click();
|
||||
|
||||
// <ds-community-roles> tag must be loaded
|
||||
cy.get('ds-community-roles').should('be.visible');
|
||||
|
||||
// Analyze for accessibility issues
|
||||
testA11y('ds-community-roles');
|
||||
});
|
||||
});
|
||||
|
||||
describe('Edit Community > Curate tab', () => {
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
cy.get('a[data-test="curate"]').click();
|
||||
|
||||
// <ds-community-curate> tag must be loaded
|
||||
cy.get('ds-community-curate').should('be.visible');
|
||||
|
||||
// Analyze for accessibility issues
|
||||
testA11y('ds-community-curate');
|
||||
});
|
||||
});
|
||||
|
||||
describe('Edit Community > Access Control tab', () => {
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
cy.get('a[data-test="access-control"]').click();
|
||||
|
||||
// <ds-community-access-control> tag must be loaded
|
||||
cy.get('ds-community-access-control').should('be.visible');
|
||||
|
||||
// Analyze for accessibility issues
|
||||
testA11y('ds-community-access-control');
|
||||
});
|
||||
});
|
||||
|
||||
describe('Edit Community > Authorizations tab', () => {
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
cy.get('a[data-test="authorizations"]').click();
|
||||
|
||||
// <ds-community-authorizations> tag must be loaded
|
||||
cy.get('ds-community-authorizations').should('be.visible');
|
||||
|
||||
// Analyze for accessibility issues
|
||||
testA11y('ds-community-authorizations');
|
||||
});
|
||||
});
|
||||
|
||||
describe('Edit Community > Delete page', () => {
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
cy.get('a[data-test="delete-button"]').click();
|
||||
|
||||
// <ds-delete-community> tag must be loaded
|
||||
cy.get('ds-delete-community').should('be.visible');
|
||||
|
||||
// Analyze for accessibility issues
|
||||
testA11y('ds-delete-community');
|
||||
});
|
||||
});
|
17
cypress/e2e/community-list.cy.ts
Normal file
17
cypress/e2e/community-list.cy.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('Community List Page', () => {
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
cy.visit('/community-list');
|
||||
|
||||
// <ds-community-list-page> tag must be loaded
|
||||
cy.get('ds-community-list-page').should('be.visible');
|
||||
|
||||
// Open every expand button on page, so that we can scan sub-elements as well
|
||||
cy.get('[data-test="expand-button"]').click({ multiple: true });
|
||||
|
||||
// Analyze <ds-community-list-page> for accessibility issues
|
||||
testA11y('ds-community-list-page');
|
||||
});
|
||||
});
|
@@ -1,15 +1,14 @@
|
||||
import { TEST_COMMUNITY } from 'cypress/support';
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('Community Page', () => {
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
cy.visit('/communities/' + TEST_COMMUNITY);
|
||||
cy.visit('/communities/'.concat(Cypress.env('DSPACE_TEST_COMMUNITY')));
|
||||
|
||||
// <ds-community-page> tag must be loaded
|
||||
cy.get('ds-community-page').should('exist');
|
||||
cy.get('ds-community-page').should('be.visible');
|
||||
|
||||
// Analyze <ds-community-page> for accessibility issues
|
||||
testA11y('ds-community-page',);
|
||||
testA11y('ds-community-page');
|
||||
});
|
||||
});
|
37
cypress/e2e/community-statistics.cy.ts
Normal file
37
cypress/e2e/community-statistics.cy.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import { REGEX_MATCH_NON_EMPTY_TEXT } from 'cypress/support/e2e';
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('Community Statistics Page', () => {
|
||||
const COMMUNITYSTATISTICSPAGE = '/statistics/communities/'.concat(Cypress.env('DSPACE_TEST_COMMUNITY'));
|
||||
|
||||
it('should load if you click on "Statistics" from a Community page', () => {
|
||||
cy.visit('/communities/'.concat(Cypress.env('DSPACE_TEST_COMMUNITY')));
|
||||
cy.get('ds-navbar ds-link-menu-item a[data-test="link-menu-item.menu.section.statistics"]').click();
|
||||
cy.location('pathname').should('eq', COMMUNITYSTATISTICSPAGE);
|
||||
});
|
||||
|
||||
it('should contain a "Total visits" section', () => {
|
||||
cy.visit(COMMUNITYSTATISTICSPAGE);
|
||||
cy.get('table[data-test="TotalVisits"]').should('be.visible');
|
||||
});
|
||||
|
||||
it('should contain a "Total visits per month" section', () => {
|
||||
cy.visit(COMMUNITYSTATISTICSPAGE);
|
||||
// Check just for existence because this table is empty in CI environment as it's historical data
|
||||
cy.get('.'.concat(Cypress.env('DSPACE_TEST_COMMUNITY')).concat('_TotalVisitsPerMonth')).should('exist');
|
||||
});
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
cy.visit(COMMUNITYSTATISTICSPAGE);
|
||||
|
||||
// <ds-community-statistics-page> tag must be loaded
|
||||
cy.get('ds-community-statistics-page').should('be.visible');
|
||||
|
||||
// Verify / wait until "Total Visits" table's label is non-empty
|
||||
// (This table loads these labels asynchronously, so we want to wait for them before analyzing page)
|
||||
cy.get('table[data-test="TotalVisits"] th[data-test="statistics-label"]').contains(REGEX_MATCH_NON_EMPTY_TEXT);
|
||||
|
||||
// Analyze <ds-community-statistics-page> for accessibility issues
|
||||
testA11y('ds-community-statistics-page');
|
||||
});
|
||||
});
|
13
cypress/e2e/header.cy.ts
Normal file
13
cypress/e2e/header.cy.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('Header', () => {
|
||||
it('should pass accessibility tests', () => {
|
||||
cy.visit('/');
|
||||
|
||||
// Header must first be visible
|
||||
cy.get('ds-header').should('be.visible');
|
||||
|
||||
// Analyze <ds-header> for accessibility
|
||||
testA11y('ds-header');
|
||||
});
|
||||
});
|
31
cypress/e2e/homepage-statistics.cy.ts
Normal file
31
cypress/e2e/homepage-statistics.cy.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { REGEX_MATCH_NON_EMPTY_TEXT } from 'cypress/support/e2e';
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
import '../support/commands';
|
||||
|
||||
describe('Site Statistics Page', () => {
|
||||
it('should load if you click on "Statistics" from homepage', () => {
|
||||
cy.visit('/');
|
||||
cy.get('ds-navbar ds-link-menu-item a[data-test="link-menu-item.menu.section.statistics"]').click();
|
||||
cy.location('pathname').should('eq', '/statistics');
|
||||
});
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
// generate 2 view events on an Item's page
|
||||
cy.generateViewEvent(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION'), 'item');
|
||||
cy.generateViewEvent(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION'), 'item');
|
||||
|
||||
cy.visit('/statistics');
|
||||
|
||||
// <ds-site-statistics-page> tag must be visable
|
||||
cy.get('ds-site-statistics-page').should('be.visible');
|
||||
|
||||
// Verify / wait until "Total Visits" table's *last* label is non-empty
|
||||
// (This table loads these labels asynchronously, so we want to wait for them before analyzing page)
|
||||
cy.get('table[data-test="TotalVisits"] th[data-test="statistics-label"]').last().contains(REGEX_MATCH_NON_EMPTY_TEXT);
|
||||
// Wait an extra 500ms, just so all entries in Total Visits have loaded.
|
||||
cy.wait(500);
|
||||
|
||||
// Analyze <ds-site-statistics-page> for accessibility issues
|
||||
testA11y('ds-site-statistics-page');
|
||||
});
|
||||
});
|
@@ -6,8 +6,8 @@ describe('Homepage', () => {
|
||||
cy.visit('/');
|
||||
});
|
||||
|
||||
it('should display translated title "DSpace Angular :: Home"', () => {
|
||||
cy.title().should('eq', 'DSpace Angular :: Home');
|
||||
it('should display translated title "DSpace Repository :: Home"', () => {
|
||||
cy.title().should('eq', 'DSpace Repository :: Home');
|
||||
});
|
||||
|
||||
it('should contain a news section', () => {
|
140
cypress/e2e/item-edit.cy.ts
Normal file
140
cypress/e2e/item-edit.cy.ts
Normal file
@@ -0,0 +1,140 @@
|
||||
import { Options } from 'cypress-axe';
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
const ITEM_EDIT_PAGE = '/items/'.concat(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION')).concat('/edit');
|
||||
|
||||
beforeEach(() => {
|
||||
// All tests start with visiting the Edit Item Page
|
||||
cy.visit(ITEM_EDIT_PAGE);
|
||||
|
||||
// This page is restricted, so we will be shown the login form. Fill it out & submit.
|
||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||
});
|
||||
|
||||
describe('Edit Item > Edit Metadata tab', () => {
|
||||
it('should pass accessibility tests', () => {
|
||||
cy.get('a[data-test="metadata"]').click();
|
||||
|
||||
// <ds-edit-item-page> tag must be loaded
|
||||
cy.get('ds-edit-item-page').should('be.visible');
|
||||
|
||||
// wait for all the ds-dso-edit-metadata-value components to be rendered
|
||||
cy.get('ds-dso-edit-metadata-value div[role="row"]').each(($row: HTMLDivElement) => {
|
||||
cy.wrap($row).find('div[role="cell"]').should('be.visible');
|
||||
});
|
||||
|
||||
// Analyze <ds-edit-item-page> for accessibility issues
|
||||
testA11y('ds-edit-item-page');
|
||||
});
|
||||
});
|
||||
|
||||
describe('Edit Item > Status tab', () => {
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
cy.get('a[data-test="status"]').click();
|
||||
|
||||
// <ds-item-status> tag must be loaded
|
||||
cy.get('ds-item-status').should('be.visible');
|
||||
|
||||
// Analyze for accessibility issues
|
||||
testA11y('ds-item-status');
|
||||
});
|
||||
});
|
||||
|
||||
describe('Edit Item > Bitstreams tab', () => {
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
cy.get('a[data-test="bitstreams"]').click();
|
||||
|
||||
// <ds-item-bitstreams> tag must be loaded
|
||||
cy.get('ds-item-bitstreams').should('be.visible');
|
||||
|
||||
// Table of item bitstreams must also be loaded
|
||||
cy.get('div.item-bitstreams').should('be.visible');
|
||||
|
||||
// Analyze for accessibility issues
|
||||
testA11y('ds-item-bitstreams',
|
||||
{
|
||||
rules: {
|
||||
// Currently Bitstreams page loads a pagination component per Bundle
|
||||
// and they all use the same 'id="p-dad"'.
|
||||
'duplicate-id': { enabled: false },
|
||||
}
|
||||
} as Options
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Edit Item > Curate tab', () => {
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
cy.get('a[data-test="curate"]').click();
|
||||
|
||||
// <ds-item-curate> tag must be loaded
|
||||
cy.get('ds-item-curate').should('be.visible');
|
||||
|
||||
// Analyze for accessibility issues
|
||||
testA11y('ds-item-curate');
|
||||
});
|
||||
});
|
||||
|
||||
describe('Edit Item > Relationships tab', () => {
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
cy.get('a[data-test="relationships"]').click();
|
||||
|
||||
// <ds-item-relationships> tag must be loaded
|
||||
cy.get('ds-item-relationships').should('be.visible');
|
||||
|
||||
// Analyze for accessibility issues
|
||||
testA11y('ds-item-relationships');
|
||||
});
|
||||
});
|
||||
|
||||
describe('Edit Item > Version History tab', () => {
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
cy.get('a[data-test="versionhistory"]').click();
|
||||
|
||||
// <ds-item-version-history> tag must be loaded
|
||||
cy.get('ds-item-version-history').should('be.visible');
|
||||
|
||||
// Analyze for accessibility issues
|
||||
testA11y('ds-item-version-history');
|
||||
});
|
||||
});
|
||||
|
||||
describe('Edit Item > Access Control tab', () => {
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
cy.get('a[data-test="access-control"]').click();
|
||||
|
||||
// <ds-item-access-control> tag must be loaded
|
||||
cy.get('ds-item-access-control').should('be.visible');
|
||||
|
||||
// Analyze for accessibility issues
|
||||
testA11y('ds-item-access-control');
|
||||
});
|
||||
});
|
||||
|
||||
describe('Edit Item > Collection Mapper tab', () => {
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
cy.get('a[data-test="mapper"]').click();
|
||||
|
||||
// <ds-item-collection-mapper> tag must be loaded
|
||||
cy.get('ds-item-collection-mapper').should('be.visible');
|
||||
|
||||
// Analyze entire page for accessibility issues
|
||||
testA11y('ds-item-collection-mapper');
|
||||
|
||||
// Click on the "Map new collections" tab
|
||||
cy.get('li[data-test="mapTab"] a').click();
|
||||
|
||||
// Make sure search form is now visible
|
||||
cy.get('ds-search-form').should('be.visible');
|
||||
|
||||
// Analyze entire page (again) for accessibility issues
|
||||
testA11y('ds-item-collection-mapper');
|
||||
});
|
||||
});
|
32
cypress/e2e/item-page.cy.ts
Normal file
32
cypress/e2e/item-page.cy.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('Item Page', () => {
|
||||
const ITEMPAGE = '/items/'.concat(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION'));
|
||||
const ENTITYPAGE = '/entities/publication/'.concat(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION'));
|
||||
|
||||
// Test that entities will redirect to /entities/[type]/[uuid] when accessed via /items/[uuid]
|
||||
it('should redirect to the entity page when navigating to an item page', () => {
|
||||
cy.visit(ITEMPAGE);
|
||||
cy.location('pathname').should('eq', ENTITYPAGE);
|
||||
});
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
cy.visit(ENTITYPAGE);
|
||||
|
||||
// <ds-item-page> tag must be loaded
|
||||
cy.get('ds-item-page').should('be.visible');
|
||||
|
||||
// Analyze <ds-item-page> for accessibility issues
|
||||
testA11y('ds-item-page');
|
||||
});
|
||||
|
||||
it('should pass accessibility tests on full item page', () => {
|
||||
cy.visit(ENTITYPAGE + '/full');
|
||||
|
||||
// <ds-full-item-page> tag must be loaded
|
||||
cy.get('ds-full-item-page').should('be.visible');
|
||||
|
||||
// Analyze <ds-full-item-page> for accessibility issues
|
||||
testA11y('ds-full-item-page');
|
||||
});
|
||||
});
|
43
cypress/e2e/item-statistics.cy.ts
Normal file
43
cypress/e2e/item-statistics.cy.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import { REGEX_MATCH_NON_EMPTY_TEXT } from 'cypress/support/e2e';
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('Item Statistics Page', () => {
|
||||
const ITEMSTATISTICSPAGE = '/statistics/items/'.concat(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION'));
|
||||
|
||||
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);
|
||||
});
|
||||
|
||||
it('should contain element ds-item-statistics-page when navigating to an item statistics page', () => {
|
||||
cy.visit(ITEMSTATISTICSPAGE);
|
||||
cy.get('ds-item-statistics-page').should('be.visible');
|
||||
cy.get('ds-item-page').should('not.exist');
|
||||
});
|
||||
|
||||
it('should contain a "Total visits" section', () => {
|
||||
cy.visit(ITEMSTATISTICSPAGE);
|
||||
cy.get('table[data-test="TotalVisits"]').should('be.visible');
|
||||
});
|
||||
|
||||
it('should contain a "Total visits per month" section', () => {
|
||||
cy.visit(ITEMSTATISTICSPAGE);
|
||||
// Check just for existence because this table is empty in CI environment as it's historical data
|
||||
cy.get('.'.concat(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION')).concat('_TotalVisitsPerMonth')).should('exist');
|
||||
});
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
cy.visit(ITEMSTATISTICSPAGE);
|
||||
|
||||
// <ds-item-statistics-page> tag must be loaded
|
||||
cy.get('ds-item-statistics-page').should('be.visible');
|
||||
|
||||
// Verify / wait until "Total Visits" table's label is non-empty
|
||||
// (This table loads these labels asynchronously, so we want to wait for them before analyzing page)
|
||||
cy.get('table[data-test="TotalVisits"] th[data-test="statistics-label"]').contains(REGEX_MATCH_NON_EMPTY_TEXT);
|
||||
|
||||
// Analyze <ds-item-statistics-page> for accessibility issues
|
||||
testA11y('ds-item-statistics-page');
|
||||
});
|
||||
});
|
@@ -1,33 +1,33 @@
|
||||
import { TEST_ADMIN_PASSWORD, TEST_ADMIN_USER, TEST_ENTITY_PUBLICATION } from 'cypress/support';
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
const page = {
|
||||
openLoginMenu() {
|
||||
// Click the "Log In" dropdown menu in header
|
||||
cy.get('ds-themed-navbar [data-test="login-menu"]').click();
|
||||
cy.get('ds-themed-header [data-test="login-menu"]').click();
|
||||
},
|
||||
openUserMenu() {
|
||||
// Once logged in, click the User menu in header
|
||||
cy.get('ds-themed-navbar [data-test="user-menu"]').click();
|
||||
cy.get('ds-themed-header [data-test="user-menu"]').click();
|
||||
},
|
||||
submitLoginAndPasswordByPressingButton(email, password) {
|
||||
// Enter email
|
||||
cy.get('ds-themed-navbar [data-test="email"]').type(email);
|
||||
cy.get('ds-themed-header [data-test="email"]').type(email);
|
||||
// Enter password
|
||||
cy.get('ds-themed-navbar [data-test="password"]').type(password);
|
||||
cy.get('ds-themed-header [data-test="password"]').type(password);
|
||||
// Click login button
|
||||
cy.get('ds-themed-navbar [data-test="login-button"]').click();
|
||||
cy.get('ds-themed-header [data-test="login-button"]').click();
|
||||
},
|
||||
submitLoginAndPasswordByPressingEnter(email, password) {
|
||||
// In opened Login modal, fill out email & password, then click Enter
|
||||
cy.get('ds-themed-navbar [data-test="email"]').type(email);
|
||||
cy.get('ds-themed-navbar [data-test="password"]').type(password);
|
||||
cy.get('ds-themed-navbar [data-test="password"]').type('{enter}');
|
||||
cy.get('ds-themed-header [data-test="email"]').type(email);
|
||||
cy.get('ds-themed-header [data-test="password"]').type(password);
|
||||
cy.get('ds-themed-header [data-test="password"]').type('{enter}');
|
||||
},
|
||||
submitLogoutByPressingButton() {
|
||||
// This is the POST command that will actually log us out
|
||||
cy.intercept('POST', '/server/api/authn/logout').as('logout');
|
||||
// Click logout button
|
||||
cy.get('ds-themed-navbar [data-test="logout-button"]').click();
|
||||
cy.get('ds-themed-header [data-test="logout-button"]').click();
|
||||
// Wait until above POST command responds before continuing
|
||||
// (This ensures next action waits until logout completes)
|
||||
cy.wait('@logout');
|
||||
@@ -36,7 +36,7 @@ const page = {
|
||||
|
||||
describe('Login Modal', () => {
|
||||
it('should login when clicking button & stay on same page', () => {
|
||||
const ENTITYPAGE = '/entities/publication/' + TEST_ENTITY_PUBLICATION;
|
||||
const ENTITYPAGE = '/entities/publication/'.concat(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION'));
|
||||
cy.visit(ENTITYPAGE);
|
||||
|
||||
// Login menu should exist
|
||||
@@ -46,7 +46,7 @@ describe('Login Modal', () => {
|
||||
page.openLoginMenu();
|
||||
cy.get('.form-login').should('be.visible');
|
||||
|
||||
page.submitLoginAndPasswordByPressingButton(TEST_ADMIN_USER, TEST_ADMIN_PASSWORD);
|
||||
page.submitLoginAndPasswordByPressingButton(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||
cy.get('ds-log-in').should('not.exist');
|
||||
|
||||
// Verify we are still on the same page
|
||||
@@ -66,7 +66,7 @@ describe('Login Modal', () => {
|
||||
cy.get('.form-login').should('be.visible');
|
||||
|
||||
// Login, and the <ds-log-in> tag should no longer exist
|
||||
page.submitLoginAndPasswordByPressingEnter(TEST_ADMIN_USER, TEST_ADMIN_PASSWORD);
|
||||
page.submitLoginAndPasswordByPressingEnter(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||
cy.get('.form-login').should('not.exist');
|
||||
|
||||
// Verify we are still on homepage
|
||||
@@ -80,7 +80,7 @@ describe('Login Modal', () => {
|
||||
|
||||
it('should support logout', () => {
|
||||
// First authenticate & access homepage
|
||||
cy.login(TEST_ADMIN_USER, TEST_ADMIN_PASSWORD);
|
||||
cy.login(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||
cy.visit('/');
|
||||
|
||||
// Verify ds-log-in tag doesn't exist, but ds-log-out tag does exist
|
||||
@@ -102,12 +102,15 @@ describe('Login Modal', () => {
|
||||
page.openLoginMenu();
|
||||
|
||||
// Registration link should be visible
|
||||
cy.get('ds-themed-navbar [data-test="register"]').should('be.visible');
|
||||
cy.get('ds-themed-header [data-test="register"]').should('be.visible');
|
||||
|
||||
// Click registration link & you should go to registration page
|
||||
cy.get('ds-themed-navbar [data-test="register"]').click();
|
||||
cy.get('ds-themed-header [data-test="register"]').click();
|
||||
cy.location('pathname').should('eq', '/register');
|
||||
cy.get('ds-register-email').should('exist');
|
||||
|
||||
// Test accessibility of this page
|
||||
testA11y('ds-register-email');
|
||||
});
|
||||
|
||||
it('should allow forgot password', () => {
|
||||
@@ -116,11 +119,32 @@ describe('Login Modal', () => {
|
||||
page.openLoginMenu();
|
||||
|
||||
// Forgot password link should be visible
|
||||
cy.get('ds-themed-navbar [data-test="forgot"]').should('be.visible');
|
||||
cy.get('ds-themed-header [data-test="forgot"]').should('be.visible');
|
||||
|
||||
// Click link & you should go to Forgot Password page
|
||||
cy.get('ds-themed-navbar [data-test="forgot"]').click();
|
||||
cy.get('ds-themed-header [data-test="forgot"]').click();
|
||||
cy.location('pathname').should('eq', '/forgot');
|
||||
cy.get('ds-forgot-email').should('exist');
|
||||
|
||||
// Test accessibility of this page
|
||||
testA11y('ds-forgot-email');
|
||||
});
|
||||
|
||||
it('should pass accessibility tests in menus', () => {
|
||||
cy.visit('/');
|
||||
|
||||
// Open login menu & verify accessibility
|
||||
page.openLoginMenu();
|
||||
cy.get('ds-log-in').should('exist');
|
||||
testA11y('ds-log-in');
|
||||
|
||||
// Now login
|
||||
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
|
||||
page.openUserMenu();
|
||||
cy.get('ds-user-menu').should('be.visible');
|
||||
testA11y('ds-user-menu');
|
||||
});
|
||||
});
|
@@ -1,5 +1,3 @@
|
||||
import { Options } from 'cypress-axe';
|
||||
import { TEST_SUBMIT_USER, TEST_SUBMIT_USER_PASSWORD, TEST_SUBMIT_COLLECTION_NAME } from 'cypress/support';
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('My DSpace page', () => {
|
||||
@@ -7,9 +5,9 @@ describe('My DSpace page', () => {
|
||||
cy.visit('/mydspace');
|
||||
|
||||
// This page is restricted, so we will be shown the login form. Fill it out & submit.
|
||||
cy.loginViaForm(TEST_SUBMIT_USER, TEST_SUBMIT_USER_PASSWORD);
|
||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_SUBMIT_USER'), Cypress.env('DSPACE_TEST_SUBMIT_USER_PASSWORD'));
|
||||
|
||||
cy.get('ds-my-dspace-page').should('exist');
|
||||
cy.get('ds-my-dspace-page').should('be.visible');
|
||||
|
||||
// At least one recent submission should be displayed
|
||||
cy.get('[data-test="list-object"]').should('be.visible');
|
||||
@@ -19,46 +17,24 @@ describe('My DSpace page', () => {
|
||||
cy.get('.filter-toggle').click({ multiple: true });
|
||||
|
||||
// Analyze <ds-my-dspace-page> for accessibility issues
|
||||
testA11y(
|
||||
{
|
||||
include: ['ds-my-dspace-page'],
|
||||
exclude: [
|
||||
['nouislider'] // Date filter slider is missing ARIA labels. Will be fixed by #1175
|
||||
],
|
||||
},
|
||||
{
|
||||
rules: {
|
||||
// Search filters fail these two "moderate" impact rules
|
||||
'heading-order': { enabled: false },
|
||||
'landmark-unique': { enabled: false }
|
||||
}
|
||||
} as Options
|
||||
);
|
||||
testA11y('ds-my-dspace-page');
|
||||
});
|
||||
|
||||
it('should have a working detailed view that passes accessibility tests', () => {
|
||||
cy.visit('/mydspace');
|
||||
|
||||
// This page is restricted, so we will be shown the login form. Fill it out & submit.
|
||||
cy.loginViaForm(TEST_SUBMIT_USER, TEST_SUBMIT_USER_PASSWORD);
|
||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_SUBMIT_USER'), Cypress.env('DSPACE_TEST_SUBMIT_USER_PASSWORD'));
|
||||
|
||||
cy.get('ds-my-dspace-page').should('exist');
|
||||
cy.get('ds-my-dspace-page').should('be.visible');
|
||||
|
||||
// Click button in sidebar to display detailed view
|
||||
cy.get('ds-search-sidebar [data-test="detail-view"]').click();
|
||||
|
||||
cy.get('ds-object-detail').should('exist');
|
||||
cy.get('ds-object-detail').should('be.visible');
|
||||
|
||||
// Analyze <ds-search-page> for accessibility issues
|
||||
testA11y('ds-my-dspace-page',
|
||||
{
|
||||
rules: {
|
||||
// Search filters fail these two "moderate" impact rules
|
||||
'heading-order': { enabled: false },
|
||||
'landmark-unique': { enabled: false }
|
||||
}
|
||||
} as Options
|
||||
);
|
||||
// Analyze <ds-my-dspace-page> for accessibility issues
|
||||
testA11y('ds-my-dspace-page');
|
||||
});
|
||||
|
||||
// NOTE: Deleting existing submissions is exercised by submission.spec.ts
|
||||
@@ -66,7 +42,7 @@ describe('My DSpace page', () => {
|
||||
cy.visit('/mydspace');
|
||||
|
||||
// This page is restricted, so we will be shown the login form. Fill it out & submit.
|
||||
cy.loginViaForm(TEST_SUBMIT_USER, TEST_SUBMIT_USER_PASSWORD);
|
||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_SUBMIT_USER'), Cypress.env('DSPACE_TEST_SUBMIT_USER_PASSWORD'));
|
||||
|
||||
// Open the New Submission dropdown
|
||||
cy.get('button[data-test="submission-dropdown"]').click();
|
||||
@@ -77,10 +53,10 @@ describe('My DSpace page', () => {
|
||||
cy.get('ds-create-item-parent-selector').should('be.visible');
|
||||
|
||||
// Type in a known Collection name in the search box
|
||||
cy.get('ds-authorized-collection-selector input[type="search"]').type(TEST_SUBMIT_COLLECTION_NAME);
|
||||
cy.get('ds-authorized-collection-selector input[type="search"]').type(Cypress.env('DSPACE_TEST_SUBMIT_COLLECTION_NAME'));
|
||||
|
||||
// Click on the button matching that known Collection name
|
||||
cy.get('ds-authorized-collection-selector button[title="' + TEST_SUBMIT_COLLECTION_NAME + '"]').click();
|
||||
cy.get('ds-authorized-collection-selector button[title="'.concat(Cypress.env('DSPACE_TEST_SUBMIT_COLLECTION_NAME')).concat('"]')).click();
|
||||
|
||||
// New URL should include /workspaceitems, as we've started a new submission
|
||||
cy.url().should('include', '/workspaceitems');
|
||||
@@ -89,7 +65,7 @@ describe('My DSpace page', () => {
|
||||
cy.get('ds-submission-edit').should('be.visible');
|
||||
|
||||
// A Collection menu button should exist & its value should be the selected collection
|
||||
cy.get('#collectionControlsMenuButton span').should('have.text', TEST_SUBMIT_COLLECTION_NAME);
|
||||
cy.get('#collectionControlsMenuButton span').should('have.text', Cypress.env('DSPACE_TEST_SUBMIT_COLLECTION_NAME'));
|
||||
|
||||
// Now that we've created a submission, we'll test that we can go back and Edit it.
|
||||
// Get our Submission URL, to parse out the ID of this new submission
|
||||
@@ -138,7 +114,7 @@ describe('My DSpace page', () => {
|
||||
cy.visit('/mydspace');
|
||||
|
||||
// This page is restricted, so we will be shown the login form. Fill it out & submit.
|
||||
cy.loginViaForm(TEST_SUBMIT_USER, TEST_SUBMIT_USER_PASSWORD);
|
||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_SUBMIT_USER'), Cypress.env('DSPACE_TEST_SUBMIT_USER_PASSWORD'));
|
||||
|
||||
// Open the New Import dropdown
|
||||
cy.get('button[data-test="import-dropdown"]').click();
|
||||
@@ -150,6 +126,9 @@ describe('My DSpace page', () => {
|
||||
|
||||
// The external import searchbox should be visible
|
||||
cy.get('ds-submission-import-external-searchbar').should('be.visible');
|
||||
|
||||
// Test for accessibility issues
|
||||
testA11y('ds-submission-import-external');
|
||||
});
|
||||
|
||||
});
|
@@ -1,8 +1,13 @@
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('PageNotFound', () => {
|
||||
it('should contain element ds-pagenotfound when navigating to page that doesnt 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('exist');
|
||||
cy.get('ds-pagenotfound').should('be.visible');
|
||||
|
||||
// Analyze <ds-pagenotfound> for accessibility issues
|
||||
testA11y('ds-pagenotfound');
|
||||
});
|
||||
|
||||
it('should not contain element ds-pagenotfound when navigating to existing page', () => {
|
@@ -1,23 +1,21 @@
|
||||
import { TEST_SEARCH_TERM } from 'cypress/support';
|
||||
|
||||
const page = {
|
||||
fillOutQueryInNavBar(query) {
|
||||
// Click the magnifying glass
|
||||
cy.get('ds-themed-navbar [data-test="header-search-icon"]').click();
|
||||
cy.get('ds-themed-header [data-test="header-search-icon"]').click();
|
||||
// Fill out a query in input that appears
|
||||
cy.get('ds-themed-navbar [data-test="header-search-box"]').type(query);
|
||||
cy.get('ds-themed-header [data-test="header-search-box"]').type(query);
|
||||
},
|
||||
submitQueryByPressingEnter() {
|
||||
cy.get('ds-themed-navbar [data-test="header-search-box"]').type('{enter}');
|
||||
cy.get('ds-themed-header [data-test="header-search-box"]').type('{enter}');
|
||||
},
|
||||
submitQueryByPressingIcon() {
|
||||
cy.get('ds-themed-navbar [data-test="header-search-icon"]').click();
|
||||
cy.get('ds-themed-header [data-test="header-search-icon"]').click();
|
||||
}
|
||||
};
|
||||
|
||||
describe('Search from Navigation Bar', () => {
|
||||
// NOTE: these tests currently assume this query will return results!
|
||||
const query = TEST_SEARCH_TERM;
|
||||
const query = Cypress.env('DSPACE_TEST_SEARCH_TERM');
|
||||
|
||||
it('should go to search page with correct query if submitted (from home)', () => {
|
||||
cy.visit('/');
|
||||
@@ -27,7 +25,7 @@ describe('Search from Navigation Bar', () => {
|
||||
page.fillOutQueryInNavBar(query);
|
||||
page.submitQueryByPressingEnter();
|
||||
// New URL should include query param
|
||||
cy.url().should('include', 'query=' + query);
|
||||
cy.url().should('include', 'query='.concat(query));
|
||||
// Wait for search results to come back from the above GET command
|
||||
cy.wait('@search-results');
|
||||
// At least one search result should be displayed
|
||||
@@ -42,7 +40,7 @@ describe('Search from Navigation Bar', () => {
|
||||
page.fillOutQueryInNavBar(query);
|
||||
page.submitQueryByPressingEnter();
|
||||
// New URL should include query param
|
||||
cy.url().should('include', 'query=' + query);
|
||||
cy.url().should('include', 'query='.concat(query));
|
||||
// Wait for search results to come back from the above GET command
|
||||
cy.wait('@search-results');
|
||||
// At least one search result should be displayed
|
||||
@@ -57,7 +55,7 @@ describe('Search from Navigation Bar', () => {
|
||||
page.fillOutQueryInNavBar(query);
|
||||
page.submitQueryByPressingIcon();
|
||||
// New URL should include query param
|
||||
cy.url().should('include', 'query=' + query);
|
||||
cy.url().should('include', 'query='.concat(query));
|
||||
// Wait for search results to come back from the above GET command
|
||||
cy.wait('@search-results');
|
||||
// At least one search result should be displayed
|
@@ -1,8 +1,10 @@
|
||||
import { Options } from 'cypress-axe';
|
||||
import { TEST_SEARCH_TERM } from 'cypress/support';
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('Search Page', () => {
|
||||
// NOTE: these tests currently assume this query will return results!
|
||||
const query = Cypress.env('DSPACE_TEST_SEARCH_TERM');
|
||||
|
||||
it('should redirect to the correct url when query was set and submit button was triggered', () => {
|
||||
const queryString = 'Another interesting query string';
|
||||
cy.visit('/search');
|
||||
@@ -13,11 +15,11 @@ describe('Search Page', () => {
|
||||
});
|
||||
|
||||
it('should load results and pass accessibility tests', () => {
|
||||
cy.visit('/search?query=' + TEST_SEARCH_TERM);
|
||||
cy.get('[data-test="search-box"]').should('have.value', TEST_SEARCH_TERM);
|
||||
cy.visit('/search?query='.concat(query));
|
||||
cy.get('[data-test="search-box"]').should('have.value', query);
|
||||
|
||||
// <ds-search-page> tag must be loaded
|
||||
cy.get('ds-search-page').should('exist');
|
||||
cy.get('ds-search-page').should('be.visible');
|
||||
|
||||
// At least one search result should be displayed
|
||||
cy.get('[data-test="list-object"]').should('be.visible');
|
||||
@@ -27,31 +29,17 @@ describe('Search Page', () => {
|
||||
cy.get('[data-test="filter-toggle"]').click({ multiple: true });
|
||||
|
||||
// Analyze <ds-search-page> for accessibility issues
|
||||
testA11y(
|
||||
{
|
||||
include: ['ds-search-page'],
|
||||
exclude: [
|
||||
['nouislider'] // Date filter slider is missing ARIA labels. Will be fixed by #1175
|
||||
],
|
||||
},
|
||||
{
|
||||
rules: {
|
||||
// Search filters fail these two "moderate" impact rules
|
||||
'heading-order': { enabled: false },
|
||||
'landmark-unique': { enabled: false }
|
||||
}
|
||||
} as Options
|
||||
);
|
||||
testA11y('ds-search-page');
|
||||
});
|
||||
|
||||
it('should have a working grid view that passes accessibility tests', () => {
|
||||
cy.visit('/search?query=' + TEST_SEARCH_TERM);
|
||||
cy.visit('/search?query='.concat(query));
|
||||
|
||||
// Click button in sidebar to display grid view
|
||||
cy.get('ds-search-sidebar [data-test="grid-view"]').click();
|
||||
|
||||
// <ds-search-page> tag must be loaded
|
||||
cy.get('ds-search-page').should('exist');
|
||||
cy.get('ds-search-page').should('be.visible');
|
||||
|
||||
// At least one grid object (card) should be displayed
|
||||
cy.get('[data-test="grid-object"]').should('be.visible');
|
||||
@@ -60,9 +48,8 @@ describe('Search Page', () => {
|
||||
testA11y('ds-search-page',
|
||||
{
|
||||
rules: {
|
||||
// Search filters fail these two "moderate" impact rules
|
||||
'heading-order': { enabled: false },
|
||||
'landmark-unique': { enabled: false }
|
||||
// Card titles fail this test currently
|
||||
'heading-order': { enabled: false }
|
||||
}
|
||||
} as Options
|
||||
);
|
@@ -1,16 +1,16 @@
|
||||
import { Options } from 'cypress-axe';
|
||||
import { TEST_SUBMIT_USER, TEST_SUBMIT_USER_PASSWORD, TEST_SUBMIT_COLLECTION_NAME, TEST_SUBMIT_COLLECTION_UUID } from 'cypress/support';
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
//import { TEST_SUBMIT_USER, TEST_SUBMIT_USER_PASSWORD, TEST_SUBMIT_COLLECTION_NAME, TEST_SUBMIT_COLLECTION_UUID, TEST_ADMIN_USER, TEST_ADMIN_PASSWORD } from 'cypress/support/e2e';
|
||||
import { Options } from 'cypress-axe';
|
||||
|
||||
describe('New Submission page', () => {
|
||||
// NOTE: We already test that new submissions can be started from MyDSpace in my-dspace.spec.ts
|
||||
|
||||
// NOTE: We already test that new Item submissions can be started from MyDSpace in my-dspace.spec.ts
|
||||
it('should create a new submission when using /submit path & pass accessibility', () => {
|
||||
// Test that calling /submit with collection & entityType will create a new submission
|
||||
cy.visit('/submit?collection=' + TEST_SUBMIT_COLLECTION_UUID + '&entityType=none');
|
||||
cy.visit('/submit?collection='.concat(Cypress.env('DSPACE_TEST_SUBMIT_COLLECTION_UUID')).concat('&entityType=none'));
|
||||
|
||||
// This page is restricted, so we will be shown the login form. Fill it out & submit.
|
||||
cy.loginViaForm(TEST_SUBMIT_USER, TEST_SUBMIT_USER_PASSWORD);
|
||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_SUBMIT_USER'), Cypress.env('DSPACE_TEST_SUBMIT_USER_PASSWORD'));
|
||||
|
||||
// Should redirect to /workspaceitems, as we've started a new submission
|
||||
cy.url().should('include', '/workspaceitems');
|
||||
@@ -19,7 +19,7 @@ describe('New Submission page', () => {
|
||||
cy.get('ds-submission-edit').should('be.visible');
|
||||
|
||||
// A Collection menu button should exist & it's value should be the selected collection
|
||||
cy.get('#collectionControlsMenuButton span').should('have.text', TEST_SUBMIT_COLLECTION_NAME);
|
||||
cy.get('#collectionControlsMenuButton span').should('have.text', Cypress.env('DSPACE_TEST_SUBMIT_COLLECTION_NAME'));
|
||||
|
||||
// 4 sections should be visible by default
|
||||
cy.get('div#section_traditionalpageone').should('be.visible');
|
||||
@@ -27,6 +27,25 @@ describe('New Submission page', () => {
|
||||
cy.get('div#section_upload').should('be.visible');
|
||||
cy.get('div#section_license').should('be.visible');
|
||||
|
||||
// Test entire page for accessibility
|
||||
testA11y('ds-submission-edit',
|
||||
{
|
||||
rules: {
|
||||
// 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".
|
||||
// Seem to require updating ng-bootstrap and https://github.com/DSpace/dspace-angular/issues/2216
|
||||
'aria-required-children': { enabled: false },
|
||||
'nested-interactive': { enabled: false },
|
||||
// All select boxes fail to have a name / aria-label.
|
||||
// This is a bug in ng-dynamic-forms and may require https://github.com/DSpace/dspace-angular/issues/2216
|
||||
'select-name': { enabled: false },
|
||||
}
|
||||
|
||||
} as Options
|
||||
);
|
||||
|
||||
// Discard button should work
|
||||
// Clicking it will display a confirmation, which we will confirm with another click
|
||||
cy.get('button#discard').click();
|
||||
@@ -35,10 +54,10 @@ describe('New Submission page', () => {
|
||||
|
||||
it('should block submission & show errors if required fields are missing', () => {
|
||||
// Create a new submission
|
||||
cy.visit('/submit?collection=' + TEST_SUBMIT_COLLECTION_UUID + '&entityType=none');
|
||||
cy.visit('/submit?collection='.concat(Cypress.env('DSPACE_TEST_SUBMIT_COLLECTION_UUID')).concat('&entityType=none'));
|
||||
|
||||
// This page is restricted, so we will be shown the login form. Fill it out & submit.
|
||||
cy.loginViaForm(TEST_SUBMIT_USER, TEST_SUBMIT_USER_PASSWORD);
|
||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_SUBMIT_USER'), Cypress.env('DSPACE_TEST_SUBMIT_USER_PASSWORD'));
|
||||
|
||||
// Attempt an immediate deposit without filling out any fields
|
||||
cy.get('button#deposit').click();
|
||||
@@ -95,10 +114,10 @@ describe('New Submission page', () => {
|
||||
|
||||
it('should allow for deposit if all required fields completed & file uploaded', () => {
|
||||
// Create a new submission
|
||||
cy.visit('/submit?collection=' + TEST_SUBMIT_COLLECTION_UUID + '&entityType=none');
|
||||
cy.visit('/submit?collection='.concat(Cypress.env('DSPACE_TEST_SUBMIT_COLLECTION_UUID')).concat('&entityType=none'));
|
||||
|
||||
// This page is restricted, so we will be shown the login form. Fill it out & submit.
|
||||
cy.loginViaForm(TEST_SUBMIT_USER, TEST_SUBMIT_USER_PASSWORD);
|
||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_SUBMIT_USER'), Cypress.env('DSPACE_TEST_SUBMIT_USER_PASSWORD'));
|
||||
|
||||
// Fill out all required fields (Title, Date)
|
||||
cy.get('input#dc_title').type('DSpace logo uploaded via e2e tests');
|
||||
@@ -118,14 +137,12 @@ describe('New Submission page', () => {
|
||||
|
||||
// Upload our DSpace logo via drag & drop onto submission form
|
||||
// cy.get('div#section_upload')
|
||||
cy.get('div.ds-document-drop-zone').selectFile('src/assets/images/dspace-logo.png', {
|
||||
cy.get('div.ds-document-drop-zone').selectFile('src/assets/images/dspace-logo.svg', {
|
||||
action: 'drag-drop'
|
||||
});
|
||||
|
||||
// Wait for upload to complete before proceeding
|
||||
cy.wait('@upload');
|
||||
// Close the upload success notice
|
||||
cy.get('[data-dismiss="alert"]').click({multiple: true});
|
||||
|
||||
// Wait for deposit button to not be disabled & click it.
|
||||
cy.get('button#deposit').should('not.be.disabled').click();
|
||||
@@ -135,4 +152,76 @@ describe('New Submission page', () => {
|
||||
cy.get('ds-notification div.alert-success').should('be.visible');
|
||||
});
|
||||
|
||||
it('is possible to submit a new "Person" and that form passes accessibility', () => {
|
||||
// To submit a different entity type, we'll start from MyDSpace
|
||||
cy.visit('/mydspace');
|
||||
|
||||
// This page is restricted, so we will be shown the login form. Fill it out & submit.
|
||||
// NOTE: At this time, we MUST login as admin to submit Person objects
|
||||
cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
|
||||
|
||||
// Open the New Submission dropdown
|
||||
cy.get('button[data-test="submission-dropdown"]').click();
|
||||
// Click on the "Person" type in that dropdown
|
||||
cy.get('#entityControlsDropdownMenu button[title="Person"]').click();
|
||||
|
||||
// This should display the <ds-create-item-parent-selector> (popup window)
|
||||
cy.get('ds-create-item-parent-selector').should('be.visible');
|
||||
|
||||
// Type in a known Collection name in the search box
|
||||
cy.get('ds-authorized-collection-selector input[type="search"]').type(Cypress.env('DSPACE_TEST_SUBMIT_PERSON_COLLECTION_NAME'));
|
||||
|
||||
// Click on the button matching that known Collection name
|
||||
cy.get('ds-authorized-collection-selector button[title="'.concat(Cypress.env('DSPACE_TEST_SUBMIT_PERSON_COLLECTION_NAME')).concat('"]')).click();
|
||||
|
||||
// New URL should include /workspaceitems, as we've started a new submission
|
||||
cy.url().should('include', '/workspaceitems');
|
||||
|
||||
// The Submission edit form tag should be visible
|
||||
cy.get('ds-submission-edit').should('be.visible');
|
||||
|
||||
// A Collection menu button should exist & its value should be the selected collection
|
||||
cy.get('#collectionControlsMenuButton span').should('have.text', Cypress.env('DSPACE_TEST_SUBMIT_PERSON_COLLECTION_NAME'));
|
||||
|
||||
// 3 sections should be visible by default
|
||||
cy.get('div#section_personStep').should('be.visible');
|
||||
cy.get('div#section_upload').should('be.visible');
|
||||
cy.get('div#section_license').should('be.visible');
|
||||
|
||||
// Test entire page for accessibility
|
||||
testA11y('ds-submission-edit',
|
||||
{
|
||||
rules: {
|
||||
// All panels are accordians & 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 },
|
||||
}
|
||||
|
||||
} as Options
|
||||
);
|
||||
|
||||
// Click the lookup button next to "Publication" field
|
||||
cy.get('button[data-test="lookup-button"]').click();
|
||||
|
||||
// A popup modal window should be visible
|
||||
cy.get('ds-dynamic-lookup-relation-modal').should('be.visible');
|
||||
|
||||
// Popup modal should also pass accessibility tests
|
||||
//testA11y('ds-dynamic-lookup-relation-modal');
|
||||
testA11y({
|
||||
include: ['ds-dynamic-lookup-relation-modal'],
|
||||
exclude: [
|
||||
['ul.nav-tabs'] // Tabs at top of model have several issues which seem to be caused by ng-bootstrap
|
||||
],
|
||||
});
|
||||
|
||||
// Close popup window
|
||||
cy.get('ds-dynamic-lookup-relation-modal button.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
|
||||
cy.get('button#discard').click();
|
||||
cy.get('button#discard_submit').click();
|
||||
});
|
||||
});
|
@@ -1,32 +0,0 @@
|
||||
import { TEST_COLLECTION } from 'cypress/support';
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('Collection Statistics Page', () => {
|
||||
const COLLECTIONSTATISTICSPAGE = '/statistics/collections/' + TEST_COLLECTION;
|
||||
|
||||
it('should load if you click on "Statistics" from a Collection page', () => {
|
||||
cy.visit('/collections/' + TEST_COLLECTION);
|
||||
cy.get('ds-navbar ds-link-menu-item a[title="Statistics"]').click();
|
||||
cy.location('pathname').should('eq', COLLECTIONSTATISTICSPAGE);
|
||||
});
|
||||
|
||||
it('should contain a "Total visits" section', () => {
|
||||
cy.visit(COLLECTIONSTATISTICSPAGE);
|
||||
cy.get('.' + TEST_COLLECTION + '_TotalVisits').should('exist');
|
||||
});
|
||||
|
||||
it('should contain a "Total visits per month" section', () => {
|
||||
cy.visit(COLLECTIONSTATISTICSPAGE);
|
||||
cy.get('.' + TEST_COLLECTION + '_TotalVisitsPerMonth').should('exist');
|
||||
});
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
cy.visit(COLLECTIONSTATISTICSPAGE);
|
||||
|
||||
// <ds-collection-statistics-page> tag must be loaded
|
||||
cy.get('ds-collection-statistics-page').should('exist');
|
||||
|
||||
// Analyze <ds-collection-statistics-page> for accessibility issues
|
||||
testA11y('ds-collection-statistics-page');
|
||||
});
|
||||
});
|
@@ -1,25 +0,0 @@
|
||||
import { Options } from 'cypress-axe';
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('Community List Page', () => {
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
cy.visit('/community-list');
|
||||
|
||||
// <ds-community-list-page> tag must be loaded
|
||||
cy.get('ds-community-list-page').should('exist');
|
||||
|
||||
// Open first Community (to show Collections)...that way we scan sub-elements as well
|
||||
cy.get('ds-community-list :nth-child(1) > .btn-group > .btn').click();
|
||||
|
||||
// Analyze <ds-community-list-page> for accessibility issues
|
||||
// Disable heading-order checks until it is fixed
|
||||
testA11y('ds-community-list-page',
|
||||
{
|
||||
rules: {
|
||||
'heading-order': { enabled: false }
|
||||
}
|
||||
} as Options
|
||||
);
|
||||
});
|
||||
});
|
@@ -1,32 +0,0 @@
|
||||
import { TEST_COMMUNITY } from 'cypress/support';
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('Community Statistics Page', () => {
|
||||
const COMMUNITYSTATISTICSPAGE = '/statistics/communities/' + TEST_COMMUNITY;
|
||||
|
||||
it('should load if you click on "Statistics" from a Community page', () => {
|
||||
cy.visit('/communities/' + TEST_COMMUNITY);
|
||||
cy.get('ds-navbar ds-link-menu-item a[title="Statistics"]').click();
|
||||
cy.location('pathname').should('eq', COMMUNITYSTATISTICSPAGE);
|
||||
});
|
||||
|
||||
it('should contain a "Total visits" section', () => {
|
||||
cy.visit(COMMUNITYSTATISTICSPAGE);
|
||||
cy.get('.' + TEST_COMMUNITY + '_TotalVisits').should('exist');
|
||||
});
|
||||
|
||||
it('should contain a "Total visits per month" section', () => {
|
||||
cy.visit(COMMUNITYSTATISTICSPAGE);
|
||||
cy.get('.' + TEST_COMMUNITY + '_TotalVisitsPerMonth').should('exist');
|
||||
});
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
cy.visit(COMMUNITYSTATISTICSPAGE);
|
||||
|
||||
// <ds-community-statistics-page> tag must be loaded
|
||||
cy.get('ds-community-statistics-page').should('exist');
|
||||
|
||||
// Analyze <ds-community-statistics-page> for accessibility issues
|
||||
testA11y('ds-community-statistics-page');
|
||||
});
|
||||
});
|
@@ -1,19 +0,0 @@
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('Header', () => {
|
||||
it('should pass accessibility tests', () => {
|
||||
cy.visit('/');
|
||||
|
||||
// Header must first be visible
|
||||
cy.get('ds-header').should('be.visible');
|
||||
|
||||
// Analyze <ds-header> for accessibility
|
||||
testA11y({
|
||||
include: ['ds-header'],
|
||||
exclude: [
|
||||
['#search-navbar-container'], // search in navbar has duplicative ID. Will be fixed in #1174
|
||||
['.dropdownLogin'] // "Log in" link has color contrast issues. Will be fixed in #1149
|
||||
],
|
||||
});
|
||||
});
|
||||
});
|
@@ -1,19 +0,0 @@
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('Site Statistics Page', () => {
|
||||
it('should load if you click on "Statistics" from homepage', () => {
|
||||
cy.visit('/');
|
||||
cy.get('ds-navbar ds-link-menu-item a[title="Statistics"]').click();
|
||||
cy.location('pathname').should('eq', '/statistics');
|
||||
});
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
cy.visit('/statistics');
|
||||
|
||||
// <ds-site-statistics-page> tag must be loaded
|
||||
cy.get('ds-site-statistics-page').should('exist');
|
||||
|
||||
// Analyze <ds-site-statistics-page> for accessibility issues
|
||||
testA11y('ds-site-statistics-page');
|
||||
});
|
||||
});
|
@@ -1,31 +0,0 @@
|
||||
import { Options } from 'cypress-axe';
|
||||
import { TEST_ENTITY_PUBLICATION } from 'cypress/support';
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('Item Page', () => {
|
||||
const ITEMPAGE = '/items/' + TEST_ENTITY_PUBLICATION;
|
||||
const ENTITYPAGE = '/entities/publication/' + TEST_ENTITY_PUBLICATION;
|
||||
|
||||
// Test that entities will redirect to /entities/[type]/[uuid] when accessed via /items/[uuid]
|
||||
it('should redirect to the entity page when navigating to an item page', () => {
|
||||
cy.visit(ITEMPAGE);
|
||||
cy.location('pathname').should('eq', ENTITYPAGE);
|
||||
});
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
cy.visit(ENTITYPAGE);
|
||||
|
||||
// <ds-item-page> tag must be loaded
|
||||
cy.get('ds-item-page').should('exist');
|
||||
|
||||
// Analyze <ds-item-page> for accessibility issues
|
||||
// Disable heading-order checks until it is fixed
|
||||
testA11y('ds-item-page',
|
||||
{
|
||||
rules: {
|
||||
'heading-order': { enabled: false }
|
||||
}
|
||||
} as Options
|
||||
);
|
||||
});
|
||||
});
|
@@ -1,38 +0,0 @@
|
||||
import { TEST_ENTITY_PUBLICATION } from 'cypress/support';
|
||||
import { testA11y } from 'cypress/support/utils';
|
||||
|
||||
describe('Item Statistics Page', () => {
|
||||
const ITEMSTATISTICSPAGE = '/statistics/items/' + TEST_ENTITY_PUBLICATION;
|
||||
|
||||
it('should load if you click on "Statistics" from an Item/Entity page', () => {
|
||||
cy.visit('/entities/publication/' + TEST_ENTITY_PUBLICATION);
|
||||
cy.get('ds-navbar ds-link-menu-item a[title="Statistics"]').click();
|
||||
cy.location('pathname').should('eq', ITEMSTATISTICSPAGE);
|
||||
});
|
||||
|
||||
it('should contain element ds-item-statistics-page when navigating to an item statistics page', () => {
|
||||
cy.visit(ITEMSTATISTICSPAGE);
|
||||
cy.get('ds-item-statistics-page').should('exist');
|
||||
cy.get('ds-item-page').should('not.exist');
|
||||
});
|
||||
|
||||
it('should contain a "Total visits" section', () => {
|
||||
cy.visit(ITEMSTATISTICSPAGE);
|
||||
cy.get('.' + TEST_ENTITY_PUBLICATION + '_TotalVisits').should('exist');
|
||||
});
|
||||
|
||||
it('should contain a "Total visits per month" section', () => {
|
||||
cy.visit(ITEMSTATISTICSPAGE);
|
||||
cy.get('.' + TEST_ENTITY_PUBLICATION + '_TotalVisitsPerMonth').should('exist');
|
||||
});
|
||||
|
||||
it('should pass accessibility tests', () => {
|
||||
cy.visit(ITEMSTATISTICSPAGE);
|
||||
|
||||
// <ds-item-statistics-page> tag must be loaded
|
||||
cy.get('ds-item-statistics-page').should('exist');
|
||||
|
||||
// Analyze <ds-item-statistics-page> for accessibility issues
|
||||
testA11y('ds-item-statistics-page');
|
||||
});
|
||||
});
|
@@ -1,5 +1,11 @@
|
||||
const fs = require('fs');
|
||||
|
||||
// These two global variables are used to store information about the REST API used
|
||||
// by these e2e tests. They are filled out prior to running any tests in the before()
|
||||
// method of e2e.ts. They can then be accessed by any tests via the getters below.
|
||||
let REST_BASE_URL: string;
|
||||
let REST_DOMAIN: string;
|
||||
|
||||
// Plugins enable you to tap into, modify, or extend the internal behavior of Cypress
|
||||
// For more info, visit https://on.cypress.io/plugins-api
|
||||
module.exports = (on, config) => {
|
||||
@@ -30,6 +36,24 @@ module.exports = (on, config) => {
|
||||
}
|
||||
|
||||
return null;
|
||||
},
|
||||
// Save value of REST Base URL, looked up before all tests.
|
||||
// This allows other tests to use it easily via getRestBaseURL() below.
|
||||
saveRestBaseURL(url: string) {
|
||||
return (REST_BASE_URL = url);
|
||||
},
|
||||
// Retrieve currently saved value of REST Base URL
|
||||
getRestBaseURL() {
|
||||
return REST_BASE_URL ;
|
||||
},
|
||||
// Save value of REST Domain, looked up before all tests.
|
||||
// This allows other tests to use it easily via getRestBaseDomain() below.
|
||||
saveRestBaseDomain(domain: string) {
|
||||
return (REST_DOMAIN = domain);
|
||||
},
|
||||
// Retrieve currently saved value of REST Domain
|
||||
getRestBaseDomain() {
|
||||
return REST_DOMAIN ;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
@@ -4,12 +4,13 @@
|
||||
// ***********************************************
|
||||
|
||||
import { AuthTokenInfo, TOKENITEM } from 'src/app/core/auth/models/auth-token-info.model';
|
||||
import { FALLBACK_TEST_REST_BASE_URL } from '.';
|
||||
import { DSPACE_XSRF_COOKIE, XSRF_REQUEST_HEADER } from 'src/app/core/xsrf/xsrf.constants';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
// Declare Cypress namespace to help with Intellisense & code completion in IDEs
|
||||
// ALL custom commands MUST be listed here for code completion to work
|
||||
// tslint:disable-next-line:no-namespace
|
||||
declare global {
|
||||
// eslint-disable-next-line @typescript-eslint/no-namespace
|
||||
namespace Cypress {
|
||||
interface Chainable<Subject = any> {
|
||||
/**
|
||||
@@ -27,6 +28,22 @@ declare global {
|
||||
* @param password password to login as
|
||||
*/
|
||||
loginViaForm(email: string, password: string): typeof loginViaForm;
|
||||
|
||||
/**
|
||||
* Generate view event for given object. Useful for testing statistics pages with
|
||||
* pre-generated statistics. This just generates a single "hit", but can be called multiple times to
|
||||
* generate multiple hits.
|
||||
* @param uuid UUID of object
|
||||
* @param dsoType type of DSpace Object (e.g. "item", "collection", "community")
|
||||
*/
|
||||
generateViewEvent(uuid: string, dsoType: string): typeof generateViewEvent;
|
||||
|
||||
/**
|
||||
* Create a new CSRF token and add to required Cookie. CSRF Token is returned
|
||||
* in chainable in order to allow it to be sent also in required CSRF header.
|
||||
* @returns Chainable reference to allow CSRF token to also be sent in header.
|
||||
*/
|
||||
createCSRFCookie(): Chainable<any>;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -40,35 +57,15 @@ declare global {
|
||||
* @param password password to login as
|
||||
*/
|
||||
function login(email: string, password: string): void {
|
||||
// Cypress doesn't have access to the running application in Node.js.
|
||||
// So, it's not possible to inject or load the AppConfig or environment of the Angular UI.
|
||||
// Instead, we'll read our running application's config.json, which contains the configs &
|
||||
// is regenerated at runtime each time the Angular UI application starts up.
|
||||
cy.task('readUIConfig').then((str: string) => {
|
||||
// Parse config into a JSON object
|
||||
const config = JSON.parse(str);
|
||||
|
||||
// Find the URL of our REST API. Have a fallback ready, just in case 'rest.baseUrl' cannot be found.
|
||||
let baseRestUrl = FALLBACK_TEST_REST_BASE_URL;
|
||||
if (!config.rest.baseUrl) {
|
||||
console.warn("Could not load 'rest.baseUrl' from config.json. Falling back to " + FALLBACK_TEST_REST_BASE_URL);
|
||||
} else {
|
||||
console.log("Found 'rest.baseUrl' in config.json. Using this REST API for login: " + config.rest.baseUrl);
|
||||
baseRestUrl = config.rest.baseUrl;
|
||||
}
|
||||
|
||||
// To login via REST, first we have to do a GET to obtain a valid CSRF token
|
||||
cy.request( baseRestUrl + '/api/authn/status' )
|
||||
.then((response) => {
|
||||
// We should receive a CSRF token returned in a response header
|
||||
expect(response.headers).to.have.property('dspace-xsrf-token');
|
||||
const csrfToken = response.headers['dspace-xsrf-token'];
|
||||
|
||||
// Create a fake CSRF cookie/token to use in POST
|
||||
cy.createCSRFCookie().then((csrfToken: string) => {
|
||||
// get our REST API's base URL, also needed for POST
|
||||
cy.task('getRestBaseURL').then((baseRestUrl: string) => {
|
||||
// Now, send login POST request including that CSRF token
|
||||
cy.request({
|
||||
method: 'POST',
|
||||
url: baseRestUrl + '/api/authn/login',
|
||||
headers: { 'X-XSRF-TOKEN' : csrfToken},
|
||||
headers: { [XSRF_REQUEST_HEADER]: csrfToken},
|
||||
form: true, // indicates the body should be form urlencoded
|
||||
body: { user: email, password: password }
|
||||
}).then((resp) => {
|
||||
@@ -86,19 +83,17 @@ function login(email: string, password: string): void {
|
||||
cy.setCookie(TOKENITEM, JSON.stringify(authinfo));
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
// Add as a Cypress command (i.e. assign to 'cy.login')
|
||||
Cypress.Commands.add('login', login);
|
||||
|
||||
|
||||
/**
|
||||
* Login user via displayed login form
|
||||
* @param email email to login as
|
||||
* @param password password to login as
|
||||
*/
|
||||
function loginViaForm(email: string, password: string): void {
|
||||
function loginViaForm(email: string, password: string): void {
|
||||
// Enter email
|
||||
cy.get('ds-log-in [data-test="email"]').type(email);
|
||||
// Enter password
|
||||
@@ -107,4 +102,68 @@ Cypress.Commands.add('login', login);
|
||||
cy.get('ds-log-in [data-test="login-button"]').click();
|
||||
}
|
||||
// Add as a Cypress command (i.e. assign to 'cy.loginViaForm')
|
||||
Cypress.Commands.add('loginViaForm', loginViaForm);
|
||||
Cypress.Commands.add('loginViaForm', loginViaForm);
|
||||
|
||||
|
||||
/**
|
||||
* Generate statistic view event for given object. Useful for testing statistics pages with
|
||||
* pre-generated statistics. This just generates a single "hit", but can be called multiple times to
|
||||
* generate multiple hits.
|
||||
*
|
||||
* NOTE: This requires that "solr-statistics.autoCommit=false" be set on the DSpace backend
|
||||
* (as it is in our docker-compose-ci.yml used in CI).
|
||||
* Otherwise, by default, new statistical events won't be saved until Solr's autocommit next triggers.
|
||||
* @param uuid UUID of object
|
||||
* @param dsoType type of DSpace Object (e.g. "item", "collection", "community")
|
||||
*/
|
||||
function generateViewEvent(uuid: string, dsoType: string): void {
|
||||
// Create a fake CSRF cookie/token to use in POST
|
||||
cy.createCSRFCookie().then((csrfToken: string) => {
|
||||
// get our REST API's base URL, also needed for POST
|
||||
cy.task('getRestBaseURL').then((baseRestUrl: string) => {
|
||||
// Now, send 'statistics/viewevents' POST request including that fake CSRF token in required header
|
||||
cy.request({
|
||||
method: 'POST',
|
||||
url: baseRestUrl + '/api/statistics/viewevents',
|
||||
headers: {
|
||||
[XSRF_REQUEST_HEADER] : csrfToken,
|
||||
// use a known public IP address to avoid being seen as a "bot"
|
||||
'X-Forwarded-For': '1.1.1.1',
|
||||
// Use a user-agent of a Firefox browser on Windows. This again avoids being seen as a "bot"
|
||||
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/119.0',
|
||||
},
|
||||
//form: true, // indicates the body should be form urlencoded
|
||||
body: { targetId: uuid, targetType: dsoType },
|
||||
}).then((resp) => {
|
||||
// We expect a 201 (which means statistics event was created)
|
||||
expect(resp.status).to.eq(201);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
// Add as a Cypress command (i.e. assign to 'cy.generateViewEvent')
|
||||
Cypress.Commands.add('generateViewEvent', generateViewEvent);
|
||||
|
||||
|
||||
/**
|
||||
* Can be used by tests to generate a random XSRF/CSRF token and save it to
|
||||
* the required XSRF/CSRF cookie for usage when sending POST requests or similar.
|
||||
* The generated CSRF token is returned in a Chainable to allow it to be also sent
|
||||
* in the CSRF HTTP Header.
|
||||
* @returns a Cypress Chainable which can be used to get the generated CSRF Token
|
||||
*/
|
||||
function createCSRFCookie(): Cypress.Chainable {
|
||||
// Generate a new token which is a random UUID
|
||||
const csrfToken: string = uuidv4();
|
||||
|
||||
// Save it to our required cookie
|
||||
cy.task('getRestBaseDomain').then((baseDomain: string) => {
|
||||
// Create a fake CSRF Token. Set it in the required server-side cookie
|
||||
cy.setCookie(DSPACE_XSRF_COOKIE, csrfToken, { 'domain': baseDomain });
|
||||
});
|
||||
|
||||
// return the generated token wrapped in a chainable
|
||||
return cy.wrap(csrfToken);
|
||||
}
|
||||
// Add as a Cypress command (i.e. assign to 'cy.createCSRFCookie')
|
||||
Cypress.Commands.add('createCSRFCookie', createCSRFCookie);
|
||||
|
75
cypress/support/e2e.ts
Normal file
75
cypress/support/e2e.ts
Normal file
@@ -0,0 +1,75 @@
|
||||
// ***********************************************************
|
||||
// This example support/index.js is processed and
|
||||
// loaded automatically before your test files.
|
||||
//
|
||||
// This is a great place to put global configuration and
|
||||
// behavior that modifies Cypress.
|
||||
//
|
||||
// You can change the location of this file or turn off
|
||||
// automatically serving support files with the
|
||||
// 'supportFile' configuration option.
|
||||
//
|
||||
// You can read more here:
|
||||
// https://on.cypress.io/configuration
|
||||
// ***********************************************************
|
||||
|
||||
// Import all custom Commands (from commands.ts) for all tests
|
||||
import './commands';
|
||||
|
||||
// Import Cypress Axe tools for all tests
|
||||
// https://github.com/component-driven/cypress-axe
|
||||
import 'cypress-axe';
|
||||
import { DSPACE_XSRF_COOKIE } from 'src/app/core/xsrf/xsrf.constants';
|
||||
|
||||
|
||||
// Runs once before all tests
|
||||
before(() => {
|
||||
// Cypress doesn't have access to the running application in Node.js.
|
||||
// So, it's not possible to inject or load the AppConfig or environment of the Angular UI.
|
||||
// Instead, we'll read our running application's config.json, which contains the configs &
|
||||
// is regenerated at runtime each time the Angular UI application starts up.
|
||||
cy.task('readUIConfig').then((str: string) => {
|
||||
// Parse config into a JSON object
|
||||
const config = JSON.parse(str);
|
||||
|
||||
// Find URL of our REST API & save to global variable via task
|
||||
let baseRestUrl = FALLBACK_TEST_REST_BASE_URL;
|
||||
if (!config.rest.baseUrl) {
|
||||
console.warn("Could not load 'rest.baseUrl' from config.json. Falling back to " + FALLBACK_TEST_REST_BASE_URL);
|
||||
} else {
|
||||
baseRestUrl = config.rest.baseUrl;
|
||||
}
|
||||
cy.task('saveRestBaseURL', baseRestUrl);
|
||||
|
||||
// Find domain of our REST API & save to global variable via task.
|
||||
let baseDomain = FALLBACK_TEST_REST_DOMAIN;
|
||||
if (!config.rest.host) {
|
||||
console.warn("Could not load 'rest.host' from config.json. Falling back to " + FALLBACK_TEST_REST_DOMAIN);
|
||||
} else {
|
||||
baseDomain = config.rest.host;
|
||||
}
|
||||
cy.task('saveRestBaseDomain', baseDomain);
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
// Runs once before the first test in each "block"
|
||||
beforeEach(() => {
|
||||
// Pre-agree to all Klaro cookies by setting the klaro-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}');
|
||||
|
||||
// Remove any CSRF cookies saved from prior tests
|
||||
cy.clearCookie(DSPACE_XSRF_COOKIE);
|
||||
});
|
||||
|
||||
// NOTE: FALLBACK_TEST_REST_BASE_URL is only used if Cypress cannot read the REST API BaseURL
|
||||
// from the Angular UI's config.json. See 'before()' above.
|
||||
const FALLBACK_TEST_REST_BASE_URL = 'http://localhost:8080/server';
|
||||
const FALLBACK_TEST_REST_DOMAIN = 'localhost';
|
||||
|
||||
// USEFUL REGEX for testing
|
||||
|
||||
// Match any string that contains at least one non-space character
|
||||
// Can be used with "contains()" to determine if an element has a non-empty text value
|
||||
export const REGEX_MATCH_NON_EMPTY_TEXT = /^(?!\s*$).+/;
|
@@ -1,63 +0,0 @@
|
||||
// ***********************************************************
|
||||
// This example support/index.js is processed and
|
||||
// loaded automatically before your test files.
|
||||
//
|
||||
// This is a great place to put global configuration and
|
||||
// behavior that modifies Cypress.
|
||||
//
|
||||
// You can change the location of this file or turn off
|
||||
// automatically serving support files with the
|
||||
// 'supportFile' configuration option.
|
||||
//
|
||||
// You can read more here:
|
||||
// https://on.cypress.io/configuration
|
||||
// ***********************************************************
|
||||
|
||||
// Import all custom Commands (from commands.ts) for all tests
|
||||
import './commands';
|
||||
|
||||
// Import Cypress Axe tools for all tests
|
||||
// https://github.com/component-driven/cypress-axe
|
||||
import 'cypress-axe';
|
||||
|
||||
// Runs once before the first test in each "block"
|
||||
beforeEach(() => {
|
||||
// Pre-agree to all Klaro cookies by setting the klaro-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}');
|
||||
});
|
||||
|
||||
// For better stability between tests, we visit "about:blank" (i.e. blank page) after each test.
|
||||
// This ensures any remaining/outstanding XHR requests are killed, so they don't affect the next test.
|
||||
// Borrowed from: https://glebbahmutov.com/blog/visit-blank-page-between-tests/
|
||||
afterEach(() => {
|
||||
cy.window().then((win) => {
|
||||
win.location.href = 'about:blank';
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
// Global constants used in tests
|
||||
// May be overridden in our cypress.json config file using specified environment variables.
|
||||
// Default values listed here are all valid for the Demo Entities Data set available at
|
||||
// https://github.com/DSpace-Labs/AIP-Files/releases/tag/demo-entities-data
|
||||
// (This is the data set used in our CI environment)
|
||||
|
||||
// NOTE: FALLBACK_TEST_REST_BASE_URL is only used if Cypress cannot read the REST API BaseURL
|
||||
// from the Angular UI's config.json. See 'getBaseRESTUrl()' in commands.ts
|
||||
export const FALLBACK_TEST_REST_BASE_URL = 'http://localhost:8080/server';
|
||||
|
||||
// Admin account used for administrative tests
|
||||
export const TEST_ADMIN_USER = Cypress.env('DSPACE_TEST_ADMIN_USER') || 'dspacedemo+admin@gmail.com';
|
||||
export const TEST_ADMIN_PASSWORD = Cypress.env('DSPACE_TEST_ADMIN_PASSWORD') || 'dspace';
|
||||
// Community/collection/publication used for view/edit tests
|
||||
export const TEST_COLLECTION = Cypress.env('DSPACE_TEST_COLLECTION') || '282164f5-d325-4740-8dd1-fa4d6d3e7200';
|
||||
export const TEST_COMMUNITY = Cypress.env('DSPACE_TEST_COMMUNITY') || '0958c910-2037-42a9-81c7-dca80e3892b4';
|
||||
export const TEST_ENTITY_PUBLICATION = Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION') || 'e98b0f27-5c19-49a0-960d-eb6ad5287067';
|
||||
// Search term (should return results) used in search tests
|
||||
export const TEST_SEARCH_TERM = Cypress.env('DSPACE_TEST_SEARCH_TERM') || 'test';
|
||||
// Collection used for submission tests
|
||||
export const TEST_SUBMIT_COLLECTION_NAME = Cypress.env('DSPACE_TEST_SUBMIT_COLLECTION_NAME') || 'Sample Collection';
|
||||
export const TEST_SUBMIT_COLLECTION_UUID = Cypress.env('DSPACE_TEST_SUBMIT_COLLECTION_UUID') || '9d8334e9-25d3-4a67-9cea-3dffdef80144';
|
||||
export const TEST_SUBMIT_USER = Cypress.env('DSPACE_TEST_SUBMIT_USER') || 'dspacedemo+submit@gmail.com';
|
||||
export const TEST_SUBMIT_USER_PASSWORD = Cypress.env('DSPACE_TEST_SUBMIT_USER_PASSWORD') || 'dspace';
|
@@ -6,7 +6,20 @@
|
||||
If you wish to run DSpace on Docker in production, we recommend building your own Docker images. You are welcome to borrow ideas/concepts from the below images in doing so. But, the below images should not be used "as is" in any production scenario.
|
||||
***
|
||||
|
||||
## 'Dockerfile' in root directory
|
||||
## Overview
|
||||
The scripts in this directory can be used to start the DSpace User Interface (frontend) in Docker.
|
||||
Optionally, the backend (REST API) might also be started in Docker.
|
||||
|
||||
For additional options/settings in starting the backend (REST API) in Docker, see the Docker Compose
|
||||
documentation for the backend: https://github.com/DSpace/DSpace/blob/main/dspace/src/main/docker-compose/README.md
|
||||
|
||||
## Root directory
|
||||
|
||||
The root directory of this project contains all the Dockerfiles which may be referenced by
|
||||
the Docker compose scripts in this 'docker' folder.
|
||||
|
||||
### Dockerfile
|
||||
|
||||
This Dockerfile is used to build a *development* DSpace 7 Angular UI image, published as 'dspace/dspace-angular'
|
||||
|
||||
```
|
||||
@@ -20,7 +33,18 @@ Admins to our DockerHub repo can manually publish with the following command.
|
||||
docker push dspace/dspace-angular:dspace-7_x
|
||||
```
|
||||
|
||||
## docker directory
|
||||
### Dockerfile.dist
|
||||
|
||||
The `Dockerfile.dist` is used to generate a *production* build and runtime environment.
|
||||
|
||||
```bash
|
||||
# build the latest image
|
||||
docker build -f Dockerfile.dist -t dspace/dspace-angular:dspace-7_x-dist .
|
||||
```
|
||||
|
||||
A default/demo version of this image is built *automatically*.
|
||||
|
||||
## 'docker' directory
|
||||
- docker-compose.yml
|
||||
- Starts DSpace Angular with Docker Compose from the current branch. This file assumes that a DSpace 7 REST instance will also be started in Docker.
|
||||
- docker-compose-rest.yml
|
||||
@@ -45,23 +69,47 @@ docker-compose -f docker/docker-compose.yml build
|
||||
|
||||
## To start DSpace (REST and Angular) from your branch
|
||||
|
||||
This command provides a quick way to start both the frontend & backend from this single codebase
|
||||
```
|
||||
docker-compose -p d7 -f docker/docker-compose.yml -f docker/docker-compose-rest.yml up -d
|
||||
```
|
||||
|
||||
Keep in mind, you may also start the backend by cloning the 'DSpace/DSpace' GitHub repository separately. See the next section.
|
||||
|
||||
|
||||
## Run DSpace REST and DSpace Angular from local branches.
|
||||
|
||||
This section assumes that you have clones *both* the 'DSpace/DSpace' and 'DSpace/dspace-angular' GitHub
|
||||
repositories. When both are available locally, you can spin up both in Docker and have them work together.
|
||||
|
||||
_The system will be started in 2 steps. Each step shares the same docker network._
|
||||
|
||||
From DSpace/DSpace (build as needed)
|
||||
From 'DSpace/DSpace' clone (build first as needed):
|
||||
```
|
||||
docker-compose -p d7 up -d
|
||||
```
|
||||
|
||||
From DSpace/DSpace-angular
|
||||
NOTE: More detailed instructions on starting the backend via Docker can be found in the [Docker Compose instructions for the Backend](https://github.com/DSpace/DSpace/blob/main/dspace/src/main/docker-compose/README.md).
|
||||
|
||||
From 'DSpace/dspace-angular' clone (build first as needed)
|
||||
```
|
||||
docker-compose -p d7 -f docker/docker-compose.yml up -d
|
||||
```
|
||||
|
||||
At this point, you should be able to access the UI from http://localhost:4000,
|
||||
and the backend at http://localhost:8080/server/
|
||||
|
||||
## Run DSpace Angular dist build with DSpace Demo site backend
|
||||
|
||||
This allows you to run the Angular UI in *production* mode, pointing it at the demo or sandbox backend
|
||||
(https://demo.dspace.org/server/ or https://sandbox.dspace.org/server/).
|
||||
|
||||
```
|
||||
docker-compose -f docker/docker-compose-dist.yml pull
|
||||
docker-compose -f docker/docker-compose-dist.yml build
|
||||
docker-compose -p d7 -f docker/docker-compose-dist.yml up -d
|
||||
```
|
||||
|
||||
## Ingest test data from AIPDIR
|
||||
|
||||
Create an administrator
|
||||
@@ -87,9 +135,10 @@ Load assetstore content and trigger a re-index of the repository
|
||||
docker-compose -p d7 -f docker/cli.yml -f docker/cli.assetstore.yml run --rm dspace-cli
|
||||
```
|
||||
|
||||
## End to end testing of the rest api (runs in travis).
|
||||
_In this instance, only the REST api runs in Docker using the Entities dataset. Travis will perform CI testing of Angular using Node to drive the tests._
|
||||
## End to end testing of the REST API (runs in GitHub Actions CI).
|
||||
_In this instance, only the REST api runs in Docker using the Entities dataset. GitHub Actions will perform CI testing of Angular using Node to drive the tests. See `.github/workflows/build.yml` for more details._
|
||||
|
||||
This command is only really useful for testing our Continuous Integration process.
|
||||
```
|
||||
docker-compose -p d7ci -f docker/docker-compose-travis.yml up -d
|
||||
docker-compose -p d7ci -f docker/docker-compose-ci.yml up -d
|
||||
```
|
||||
|
@@ -12,15 +12,8 @@
|
||||
# https://github.com/DSpace/DSpace/blob/main/dspace/src/main/docker-compose/cli.assetstore.yml
|
||||
#
|
||||
# Therefore, it should be kept in sync with that file
|
||||
version: "3.7"
|
||||
|
||||
networks:
|
||||
dspacenet:
|
||||
|
||||
services:
|
||||
dspace-cli:
|
||||
networks:
|
||||
dspacenet: {}
|
||||
environment:
|
||||
# This assetstore zip is available from https://github.com/DSpace-Labs/AIP-Files/releases/tag/demo-entities-data
|
||||
- LOADASSETS=https://github.com/DSpace-Labs/AIP-Files/releases/download/demo-entities-data/assetstore.tar.gz
|
||||
|
@@ -12,8 +12,6 @@
|
||||
# https://github.com/DSpace/DSpace/blob/main/dspace/src/main/docker-compose/cli.ingest.yml
|
||||
#
|
||||
# Therefore, it should be kept in sync with that file
|
||||
version: "3.7"
|
||||
|
||||
services:
|
||||
dspace-cli:
|
||||
environment:
|
||||
|
@@ -12,8 +12,13 @@
|
||||
# https://github.com/DSpace/DSpace/blob/main/docker-compose-cli.yml
|
||||
#
|
||||
# Therefore, it should be kept in sync with that file
|
||||
version: "3.7"
|
||||
|
||||
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 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_OWNER:-dspace}/dspace-cli:${DSPACE_VER:-dspace-7_x}"
|
||||
@@ -30,16 +35,12 @@ services:
|
||||
# solr.server: Ensure we are using the 'dspacesolr' image for Solr
|
||||
solr__P__server: http://dspacesolr:8983/solr
|
||||
volumes:
|
||||
- "assetstore:/dspace/assetstore"
|
||||
# Keep DSpace assetstore directory between reboots
|
||||
- assetstore:/dspace/assetstore
|
||||
entrypoint: /dspace/bin/dspace
|
||||
command: help
|
||||
networks:
|
||||
- dspacenet
|
||||
tty: true
|
||||
stdin_open: true
|
||||
|
||||
volumes:
|
||||
assetstore:
|
||||
|
||||
networks:
|
||||
dspacenet:
|
||||
|
@@ -12,8 +12,6 @@
|
||||
# https://github.com/DSpace/DSpace/blob/main/dspace/src/main/docker-compose/db.entities.yml
|
||||
#
|
||||
# # Therefore, it should be kept in sync with that file
|
||||
version: "3.7"
|
||||
|
||||
services:
|
||||
dspacedb:
|
||||
image: dspace/dspace-postgres-pgcrypto:loadsql
|
||||
|
@@ -10,7 +10,6 @@
|
||||
# This is used by our GitHub CI at .github/workflows/build.yml
|
||||
# It is based heavily on the Backend's Docker Compose:
|
||||
# https://github.com/DSpace/DSpace/blob/main/docker-compose.yml
|
||||
version: '3.7'
|
||||
networks:
|
||||
dspacenet:
|
||||
services:
|
||||
@@ -30,11 +29,15 @@ services:
|
||||
db__P__url: 'jdbc:postgresql://dspacedb:5432/dspace'
|
||||
# solr.server: Ensure we are using the 'dspacesolr' image for Solr
|
||||
solr__P__server: http://dspacesolr:8983/solr
|
||||
# Tell Statistics to commit all views immediately instead of waiting on Solr's autocommit.
|
||||
# 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_OWNER:-dspace}/dspace:${DSPACE_VER:-dspace-7_x-test}"
|
||||
depends_on:
|
||||
- dspacedb
|
||||
image: dspace/dspace:dspace-7_x-test
|
||||
networks:
|
||||
dspacenet:
|
||||
- dspacenet
|
||||
ports:
|
||||
- published: 8080
|
||||
target: 8080
|
||||
@@ -42,8 +45,6 @@ services:
|
||||
tty: true
|
||||
volumes:
|
||||
- assetstore:/dspace/assetstore
|
||||
# Mount DSpace's solr configs to a volume, so that we can share to 'dspacesolr' container (see below)
|
||||
- solr_configs:/dspace/solr
|
||||
# Ensure that the database is ready BEFORE starting tomcat
|
||||
# 1. While a TCP connection to dspacedb port 5432 is not available, continue to sleep
|
||||
# 2. Then, run database migration to init database tables (including any out-of-order ignored migrations, if any)
|
||||
@@ -59,29 +60,30 @@ 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_OWNER:-dspace}/dspace-postgres-pgcrypto:${DSPACE_VER:-dspace-7_x-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
|
||||
LOADSQL: https://github.com/DSpace-Labs/AIP-Files/releases/download/demo-entities-data/dspace7-entities-data.sql
|
||||
PGDATA: /pgdata
|
||||
image: dspace/dspace-postgres-pgcrypto:loadsql
|
||||
POSTGRES_PASSWORD: dspace
|
||||
networks:
|
||||
dspacenet:
|
||||
- dspacenet
|
||||
ports:
|
||||
- published: 5432
|
||||
target: 5432
|
||||
stdin_open: true
|
||||
tty: true
|
||||
volumes:
|
||||
# Keep Postgres data directory between reboots
|
||||
- pgdata:/pgdata
|
||||
# DSpace Solr container
|
||||
dspacesolr:
|
||||
container_name: dspacesolr
|
||||
# Uses official Solr image at https://hub.docker.com/_/solr/
|
||||
image: solr:8.11-slim
|
||||
# Needs main 'dspace' container to start first to guarantee access to solr_configs
|
||||
depends_on:
|
||||
- dspace
|
||||
image: "${DOCKER_OWNER:-dspace}/dspace-solr:${DSPACE_VER:-dspace-7_x}"
|
||||
networks:
|
||||
dspacenet:
|
||||
- dspacenet
|
||||
ports:
|
||||
- published: 8983
|
||||
target: 8983
|
||||
@@ -89,9 +91,6 @@ services:
|
||||
tty: true
|
||||
working_dir: /var/solr/data
|
||||
volumes:
|
||||
# Mount our "solr_configs" volume available under the Solr's configsets folder (in a 'dspace' subfolder)
|
||||
# This copies the Solr configs from main 'dspace' container into 'dspacesolr' via that volume
|
||||
- solr_configs:/opt/solr/server/solr/configsets/dspace
|
||||
# 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
|
||||
@@ -100,14 +99,16 @@ services:
|
||||
- '-c'
|
||||
- |
|
||||
init-var-solr
|
||||
precreate-core authority /opt/solr/server/solr/configsets/dspace/authority
|
||||
precreate-core oai /opt/solr/server/solr/configsets/dspace/oai
|
||||
precreate-core search /opt/solr/server/solr/configsets/dspace/search
|
||||
precreate-core statistics /opt/solr/server/solr/configsets/dspace/statistics
|
||||
precreate-core authority /opt/solr/server/solr/configsets/authority
|
||||
cp -r /opt/solr/server/solr/configsets/authority/* authority
|
||||
precreate-core oai /opt/solr/server/solr/configsets/oai
|
||||
cp -r /opt/solr/server/solr/configsets/oai/* oai
|
||||
precreate-core search /opt/solr/server/solr/configsets/search
|
||||
cp -r /opt/solr/server/solr/configsets/search/* search
|
||||
precreate-core statistics /opt/solr/server/solr/configsets/statistics
|
||||
cp -r /opt/solr/server/solr/configsets/statistics/* statistics
|
||||
exec solr -f
|
||||
volumes:
|
||||
assetstore:
|
||||
pgdata:
|
||||
solr_data:
|
||||
# Special volume used to share Solr configs from 'dspace' to 'dspacesolr' container (see above)
|
||||
solr_configs:
|
39
docker/docker-compose-dist.yml
Normal file
39
docker/docker-compose-dist.yml
Normal file
@@ -0,0 +1,39 @@
|
||||
#
|
||||
# The contents of this file are subject to the license and copyright
|
||||
# detailed in the LICENSE and NOTICE files at the root of the source
|
||||
# tree and available online at
|
||||
#
|
||||
# http://www.dspace.org/license/
|
||||
#
|
||||
|
||||
# Docker Compose for running the DSpace Angular UI dist build
|
||||
# for previewing with the DSpace Demo site backend
|
||||
networks:
|
||||
dspacenet:
|
||||
services:
|
||||
dspace-angular:
|
||||
container_name: dspace-angular
|
||||
environment:
|
||||
DSPACE_UI_SSL: 'false'
|
||||
DSPACE_UI_HOST: dspace-angular
|
||||
DSPACE_UI_PORT: '4000'
|
||||
DSPACE_UI_NAMESPACE: /
|
||||
# NOTE: When running the UI in production mode (which the -dist image does),
|
||||
# these DSPACE_REST_* variables MUST point at a public, HTTPS URL.
|
||||
# This is because Server Side Rendering (SSR) currently requires a public URL,
|
||||
# see this bug: https://github.com/DSpace/dspace-angular/issues/1485
|
||||
DSPACE_REST_SSL: 'true'
|
||||
DSPACE_REST_HOST: demo.dspace.org
|
||||
DSPACE_REST_PORT: 443
|
||||
DSPACE_REST_NAMESPACE: /server
|
||||
image: dspace/dspace-angular:dspace-7_x-dist
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: Dockerfile.dist
|
||||
networks:
|
||||
dspacenet:
|
||||
ports:
|
||||
- published: 4000
|
||||
target: 4000
|
||||
stdin_open: true
|
||||
tty: true
|
@@ -10,7 +10,6 @@
|
||||
# This is based heavily on the docker-compose.yml that is available in the DSpace/DSpace
|
||||
# (Backend) at:
|
||||
# https://github.com/DSpace/DSpace/blob/main/docker-compose.yml
|
||||
version: '3.7'
|
||||
networks:
|
||||
dspacenet:
|
||||
ipam:
|
||||
@@ -29,8 +28,9 @@ services:
|
||||
# __D__ => "-" (e.g. google__D__metadata => google-metadata)
|
||||
# dspace.dir, dspace.server.url, dspace.ui.url and dspace.name
|
||||
dspace__P__dir: /dspace
|
||||
dspace__P__server__P__url: http://localhost:8080/server
|
||||
dspace__P__ui__P__url: http://localhost:4000
|
||||
# Uncomment to set a non-default value for dspace.server.url or dspace.ui.url
|
||||
# dspace__P__server__P__url: http://localhost:8080/server
|
||||
# dspace__P__ui__P__url: http://localhost:4000
|
||||
dspace__P__name: 'DSpace Started with Docker Compose'
|
||||
# db.url: Ensure we are using the 'dspacedb' image for our database
|
||||
db__P__url: 'jdbc:postgresql://dspacedb:5432/dspace'
|
||||
@@ -39,11 +39,12 @@ services:
|
||||
# proxies.trusted.ipranges: This setting is required for a REST API running in Docker to trust requests
|
||||
# from the host machine. This IP range MUST correspond to the 'dspacenet' subnet defined above.
|
||||
proxies__P__trusted__P__ipranges: '172.23.0'
|
||||
image: dspace/dspace:dspace-7_x-test
|
||||
LOGGING_CONFIG: /dspace/config/log4j2-container.xml
|
||||
image: "${DOCKER_OWNER:-dspace}/dspace:${DSPACE_VER:-dspace-7_x-test}"
|
||||
depends_on:
|
||||
- dspacedb
|
||||
networks:
|
||||
dspacenet:
|
||||
- dspacenet
|
||||
ports:
|
||||
- published: 8080
|
||||
target: 8080
|
||||
@@ -51,8 +52,6 @@ services:
|
||||
tty: true
|
||||
volumes:
|
||||
- assetstore:/dspace/assetstore
|
||||
# Mount DSpace's solr configs to a volume, so that we can share to 'dspacesolr' container (see below)
|
||||
- solr_configs:/dspace/solr
|
||||
# Ensure that the database is ready BEFORE starting tomcat
|
||||
# 1. While a TCP connection to dspacedb port 5432 is not available, continue to sleep
|
||||
# 2. Then, run database migration to init database tables
|
||||
@@ -67,28 +66,27 @@ services:
|
||||
# DSpace database container
|
||||
dspacedb:
|
||||
container_name: dspacedb
|
||||
# Uses a custom Postgres image with pgcrypto installed
|
||||
image: "${DOCKER_OWNER:-dspace}/dspace-postgres-pgcrypto:${DSPACE_VER:-dspace-7_x}"
|
||||
environment:
|
||||
PGDATA: /pgdata
|
||||
image: dspace/dspace-postgres-pgcrypto
|
||||
POSTGRES_PASSWORD: dspace
|
||||
networks:
|
||||
dspacenet:
|
||||
- dspacenet
|
||||
ports:
|
||||
- published: 5432
|
||||
target: 5432
|
||||
stdin_open: true
|
||||
tty: true
|
||||
volumes:
|
||||
# Keep Postgres data directory between reboots
|
||||
- pgdata:/pgdata
|
||||
# DSpace Solr container
|
||||
dspacesolr:
|
||||
container_name: dspacesolr
|
||||
# Uses official Solr image at https://hub.docker.com/_/solr/
|
||||
image: solr:8.11-slim
|
||||
# Needs main 'dspace' container to start first to guarantee access to solr_configs
|
||||
depends_on:
|
||||
- dspace
|
||||
image: "${DOCKER_OWNER:-dspace}/dspace-solr:${DSPACE_VER:-dspace-7_x}"
|
||||
networks:
|
||||
dspacenet:
|
||||
- dspacenet
|
||||
ports:
|
||||
- published: 8983
|
||||
target: 8983
|
||||
@@ -96,32 +94,28 @@ services:
|
||||
tty: true
|
||||
working_dir: /var/solr/data
|
||||
volumes:
|
||||
# Mount our "solr_configs" volume available under the Solr's configsets folder (in a 'dspace' subfolder)
|
||||
# This copies the Solr configs from main 'dspace' container into 'dspacesolr' via that volume
|
||||
- solr_configs:/opt/solr/server/solr/configsets/dspace
|
||||
# Keep Solr data directory between reboots
|
||||
- solr_data:/var/solr/data
|
||||
# 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 updated configs from mounted configsets to this core. If it already existed, this updates core
|
||||
# to the latest configs. If it's a newly created core, 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`
|
||||
entrypoint:
|
||||
- /bin/bash
|
||||
- '-c'
|
||||
- |
|
||||
init-var-solr
|
||||
precreate-core authority /opt/solr/server/solr/configsets/dspace/authority
|
||||
cp -r -u /opt/solr/server/solr/configsets/dspace/authority/* authority
|
||||
precreate-core oai /opt/solr/server/solr/configsets/dspace/oai
|
||||
cp -r -u /opt/solr/server/solr/configsets/dspace/oai/* oai
|
||||
precreate-core search /opt/solr/server/solr/configsets/dspace/search
|
||||
cp -r -u /opt/solr/server/solr/configsets/dspace/search/* search
|
||||
precreate-core statistics /opt/solr/server/solr/configsets/dspace/statistics
|
||||
cp -r -u /opt/solr/server/solr/configsets/dspace/statistics/* statistics
|
||||
precreate-core authority /opt/solr/server/solr/configsets/authority
|
||||
cp -r /opt/solr/server/solr/configsets/authority/* authority
|
||||
precreate-core oai /opt/solr/server/solr/configsets/oai
|
||||
cp -r /opt/solr/server/solr/configsets/oai/* oai
|
||||
precreate-core search /opt/solr/server/solr/configsets/search
|
||||
cp -r /opt/solr/server/solr/configsets/search/* search
|
||||
precreate-core statistics /opt/solr/server/solr/configsets/statistics
|
||||
cp -r /opt/solr/server/solr/configsets/statistics/* statistics
|
||||
exec solr -f
|
||||
volumes:
|
||||
assetstore:
|
||||
pgdata:
|
||||
solr_data:
|
||||
# Special volume used to share Solr configs from 'dspace' to 'dspacesolr' container (see above)
|
||||
solr_configs:
|
||||
|
@@ -9,7 +9,6 @@
|
||||
# Docker Compose for running the DSpace Angular UI for testing/development
|
||||
# Requires also running a REST API backend (either locally or remotely),
|
||||
# for example via 'docker-compose-rest.yml'
|
||||
version: '3.7'
|
||||
networks:
|
||||
dspacenet:
|
||||
services:
|
||||
|
11
docker/dspace-ui.json
Normal file
11
docker/dspace-ui.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"apps": [
|
||||
{
|
||||
"name": "dspace-ui",
|
||||
"cwd": "/app",
|
||||
"script": "dist/server/main.js",
|
||||
"instances": "max",
|
||||
"exec_mode": "cluster"
|
||||
}
|
||||
]
|
||||
}
|
@@ -48,7 +48,7 @@ dspace-angular connects to your DSpace installation by using its REST endpoint.
|
||||
```yaml
|
||||
rest:
|
||||
ssl: true
|
||||
host: api7.dspace.org
|
||||
host: demo.dspace.org
|
||||
port: 443
|
||||
nameSpace: /server
|
||||
}
|
||||
@@ -57,7 +57,7 @@ rest:
|
||||
Alternately you can set the following environment variables. If any of these are set, it will override all configuration files:
|
||||
```
|
||||
DSPACE_REST_SSL=true
|
||||
DSPACE_REST_HOST=api7.dspace.org
|
||||
DSPACE_REST_HOST=demo.dspace.org
|
||||
DSPACE_REST_PORT=443
|
||||
DSPACE_REST_NAMESPACE=/server
|
||||
```
|
||||
|
180
package.json
180
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "dspace-angular",
|
||||
"version": "7.5.0",
|
||||
"version": "7.6.2",
|
||||
"scripts": {
|
||||
"ng": "ng",
|
||||
"config:watch": "nodemon",
|
||||
@@ -15,14 +15,14 @@
|
||||
"analyze": "webpack-bundle-analyzer dist/browser/stats.json",
|
||||
"build": "ng build --configuration development",
|
||||
"build:stats": "ng build --stats-json",
|
||||
"build:prod": "yarn run build:ssr",
|
||||
"build:prod": "cross-env NODE_ENV=production yarn run build:ssr",
|
||||
"build:ssr": "ng build --configuration production && ng run dspace-angular:server:production",
|
||||
"test": "ng test --sourceMap=true --watch=false --configuration test",
|
||||
"test:watch": "nodemon --exec \"ng test --sourceMap=true --watch=true --configuration test\"",
|
||||
"test:headless": "ng test --sourceMap=true --watch=false --configuration test --browsers=ChromeHeadless --code-coverage",
|
||||
"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",
|
||||
"lint": "ng lint",
|
||||
"lint-fix": "ng lint --fix=true",
|
||||
"e2e": "ng e2e",
|
||||
"e2e": "cross-env NODE_ENV=production ng e2e",
|
||||
"clean:dev:config": "rimraf src/assets/config.json",
|
||||
"clean:coverage": "rimraf coverage",
|
||||
"clean:dist": "rimraf dist",
|
||||
@@ -55,135 +55,137 @@
|
||||
"ts-node": "10.2.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@angular/animations": "~13.3.12",
|
||||
"@angular/cdk": "^13.2.6",
|
||||
"@angular/common": "~13.3.12",
|
||||
"@angular/compiler": "~13.3.12",
|
||||
"@angular/core": "~13.3.12",
|
||||
"@angular/forms": "~13.3.12",
|
||||
"@angular/localize": "13.3.12",
|
||||
"@angular/platform-browser": "~13.3.12",
|
||||
"@angular/platform-browser-dynamic": "~13.3.12",
|
||||
"@angular/platform-server": "~13.3.12",
|
||||
"@angular/router": "~13.3.12",
|
||||
"@babel/runtime": "7.17.2",
|
||||
"@angular/animations": "^15.2.8",
|
||||
"@angular/cdk": "^15.2.8",
|
||||
"@angular/common": "^15.2.8",
|
||||
"@angular/compiler": "^15.2.8",
|
||||
"@angular/core": "^15.2.8",
|
||||
"@angular/forms": "^15.2.8",
|
||||
"@angular/localize": "15.2.8",
|
||||
"@angular/platform-browser": "^15.2.8",
|
||||
"@angular/platform-browser-dynamic": "^15.2.8",
|
||||
"@angular/platform-server": "^15.2.8",
|
||||
"@angular/router": "^15.2.8",
|
||||
"@babel/runtime": "7.21.0",
|
||||
"@kolkov/ngx-gallery": "^2.0.1",
|
||||
"@material-ui/core": "^4.11.0",
|
||||
"@material-ui/icons": "^4.9.1",
|
||||
"@material-ui/icons": "^4.11.3",
|
||||
"@ng-bootstrap/ng-bootstrap": "^11.0.0",
|
||||
"@ng-dynamic-forms/core": "^15.0.0",
|
||||
"@ng-dynamic-forms/ui-ng-bootstrap": "^15.0.0",
|
||||
"@ngrx/effects": "^13.0.2",
|
||||
"@ngrx/router-store": "^13.0.2",
|
||||
"@ngrx/store": "^13.0.2",
|
||||
"@nguniversal/express-engine": "^13.0.2",
|
||||
"@ngx-translate/core": "^13.0.0",
|
||||
"@nicky-lenaers/ngx-scroll-to": "^13.0.0",
|
||||
"@ngrx/effects": "^15.4.0",
|
||||
"@ngrx/router-store": "^15.4.0",
|
||||
"@ngrx/store": "^15.4.0",
|
||||
"@nguniversal/express-engine": "^15.2.1",
|
||||
"@ngx-translate/core": "^14.0.0",
|
||||
"@nicky-lenaers/ngx-scroll-to": "^14.0.0",
|
||||
"@types/grecaptcha": "^3.0.4",
|
||||
"angular-idle-preload": "3.0.0",
|
||||
"angulartics2": "^12.0.0",
|
||||
"axios": "^0.27.2",
|
||||
"angulartics2": "^12.2.0",
|
||||
"axios": "^1.6.0",
|
||||
"bootstrap": "^4.6.1",
|
||||
"cerialize": "0.1.18",
|
||||
"cli-progress": "^3.8.0",
|
||||
"cli-progress": "^3.12.0",
|
||||
"colors": "^1.4.0",
|
||||
"compression": "^1.7.4",
|
||||
"cookie-parser": "1.4.5",
|
||||
"core-js": "^3.7.0",
|
||||
"cookie-parser": "1.4.6",
|
||||
"core-js": "^3.30.1",
|
||||
"date-fns": "^2.29.3",
|
||||
"date-fns-tz": "^1.3.7",
|
||||
"deepmerge": "^4.2.2",
|
||||
"ejs": "^3.1.8",
|
||||
"express": "^4.17.1",
|
||||
"deepmerge": "^4.3.1",
|
||||
"ejs": "^3.1.10",
|
||||
"express": "^4.19.2",
|
||||
"express-rate-limit": "^5.1.3",
|
||||
"fast-json-patch": "^3.0.0-1",
|
||||
"fast-json-patch": "^3.1.1",
|
||||
"filesize": "^6.1.0",
|
||||
"http-proxy-middleware": "^1.0.5",
|
||||
"isbot": "^3.6.5",
|
||||
"http-terminator": "^3.2.0",
|
||||
"isbot": "^3.6.10",
|
||||
"js-cookie": "2.2.1",
|
||||
"js-yaml": "^4.1.0",
|
||||
"json5": "^2.2.2",
|
||||
"jsonschema": "1.4.0",
|
||||
"json5": "^2.2.3",
|
||||
"jsonschema": "1.4.1",
|
||||
"jwt-decode": "^3.1.2",
|
||||
"klaro": "^0.7.18",
|
||||
"lodash": "^4.17.21",
|
||||
"lru-cache": "^7.14.1",
|
||||
"markdown-it": "^13.0.1",
|
||||
"markdown-it-mathjax3": "^4.3.1",
|
||||
"markdown-it-mathjax3": "^4.3.2",
|
||||
"mirador": "^3.3.0",
|
||||
"mirador-dl-plugin": "^0.13.0",
|
||||
"mirador-share-plugin": "^0.11.0",
|
||||
"morgan": "^1.10.0",
|
||||
"ng-mocks": "^13.1.1",
|
||||
"ng-mocks": "^14.10.0",
|
||||
"ng2-file-upload": "1.4.0",
|
||||
"ng2-nouislider": "^1.8.3",
|
||||
"ngx-infinite-scroll": "^10.0.1",
|
||||
"ngx-pagination": "5.0.0",
|
||||
"ng2-nouislider": "^2.0.0",
|
||||
"ngx-infinite-scroll": "^15.0.0",
|
||||
"ngx-pagination": "6.0.3",
|
||||
"ngx-sortablejs": "^11.1.0",
|
||||
"ngx-ui-switch": "^13.0.2",
|
||||
"nouislider": "^14.6.3",
|
||||
"pem": "1.14.4",
|
||||
"prop-types": "^15.7.2",
|
||||
"react-copy-to-clipboard": "^5.0.1",
|
||||
"ngx-ui-switch": "^14.1.0",
|
||||
"nouislider": "^15.7.1",
|
||||
"pem": "1.14.7",
|
||||
"prop-types": "^15.8.1",
|
||||
"react-copy-to-clipboard": "^5.1.0",
|
||||
"reflect-metadata": "^0.1.13",
|
||||
"rxjs": "^7.5.5",
|
||||
"sanitize-html": "^2.7.2",
|
||||
"sortablejs": "1.13.0",
|
||||
"rxjs": "^7.8.0",
|
||||
"sanitize-html": "^2.12.1",
|
||||
"sortablejs": "1.15.0",
|
||||
"uuid": "^8.3.2",
|
||||
"webfontloader": "1.6.28",
|
||||
"zone.js": "~0.11.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-builders/custom-webpack": "~13.1.0",
|
||||
"@angular-devkit/build-angular": "~13.3.10",
|
||||
"@angular-eslint/builder": "13.1.0",
|
||||
"@angular-eslint/eslint-plugin": "13.1.0",
|
||||
"@angular-eslint/eslint-plugin-template": "13.1.0",
|
||||
"@angular-eslint/schematics": "13.1.0",
|
||||
"@angular-eslint/template-parser": "13.1.0",
|
||||
"@angular/cli": "~13.3.10",
|
||||
"@angular/compiler-cli": "~13.3.12",
|
||||
"@angular/language-service": "~13.3.12",
|
||||
"@angular-builders/custom-webpack": "~15.0.0",
|
||||
"@angular-devkit/build-angular": "^15.2.6",
|
||||
"@angular-eslint/builder": "15.2.1",
|
||||
"@angular-eslint/eslint-plugin": "15.2.1",
|
||||
"@angular-eslint/eslint-plugin-template": "15.2.1",
|
||||
"@angular-eslint/schematics": "15.2.1",
|
||||
"@angular-eslint/template-parser": "15.2.1",
|
||||
"@angular/cli": "^16.0.4",
|
||||
"@angular/compiler-cli": "^15.2.8",
|
||||
"@angular/language-service": "^15.2.8",
|
||||
"@cypress/schematic": "^1.5.0",
|
||||
"@fortawesome/fontawesome-free": "^6.2.1",
|
||||
"@ngrx/store-devtools": "^13.0.2",
|
||||
"@ngtools/webpack": "^13.2.6",
|
||||
"@nguniversal/builders": "^13.1.1",
|
||||
"@fortawesome/fontawesome-free": "^6.4.0",
|
||||
"@ngrx/store-devtools": "^15.4.0",
|
||||
"@ngtools/webpack": "^15.2.6",
|
||||
"@nguniversal/builders": "^15.2.1",
|
||||
"@types/deep-freeze": "0.1.2",
|
||||
"@types/ejs": "^3.1.1",
|
||||
"@types/express": "^4.17.9",
|
||||
"@types/ejs": "^3.1.2",
|
||||
"@types/express": "^4.17.17",
|
||||
"@types/jasmine": "~3.6.0",
|
||||
"@types/js-cookie": "2.2.6",
|
||||
"@types/lodash": "^4.14.165",
|
||||
"@types/lodash": "^4.14.194",
|
||||
"@types/node": "^14.14.9",
|
||||
"@types/sanitize-html": "^2.6.2",
|
||||
"@typescript-eslint/eslint-plugin": "5.11.0",
|
||||
"@typescript-eslint/parser": "5.11.0",
|
||||
"axe-core": "^4.4.3",
|
||||
"@types/sanitize-html": "^2.9.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.59.1",
|
||||
"@typescript-eslint/parser": "^5.59.1",
|
||||
"axe-core": "^4.7.2",
|
||||
"compression-webpack-plugin": "^9.2.0",
|
||||
"copy-webpack-plugin": "^6.4.1",
|
||||
"cross-env": "^7.0.3",
|
||||
"cypress": "9.7.0",
|
||||
"cypress-axe": "^0.14.0",
|
||||
"cypress": "12.17.4",
|
||||
"cypress-axe": "^1.4.0",
|
||||
"deep-freeze": "0.0.1",
|
||||
"eslint": "^8.2.0",
|
||||
"eslint-plugin-deprecation": "^1.3.2",
|
||||
"eslint-plugin-import": "^2.25.4",
|
||||
"eslint-plugin-jsdoc": "^39.6.4",
|
||||
"eslint": "^8.39.0",
|
||||
"eslint-plugin-deprecation": "^1.4.1",
|
||||
"eslint-plugin-import": "^2.27.5",
|
||||
"eslint-plugin-jsdoc": "^45.0.0",
|
||||
"eslint-plugin-jsonc": "^2.6.0",
|
||||
"eslint-plugin-lodash": "^7.4.0",
|
||||
"eslint-plugin-unused-imports": "^2.0.0",
|
||||
"express-static-gzip": "^2.1.5",
|
||||
"express-static-gzip": "^2.1.7",
|
||||
"jasmine-core": "^3.8.0",
|
||||
"jasmine-marbles": "0.9.2",
|
||||
"karma": "^6.3.14",
|
||||
"karma-chrome-launcher": "~3.1.0",
|
||||
"karma-coverage-istanbul-reporter": "~3.0.2",
|
||||
"karma": "^6.4.2",
|
||||
"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",
|
||||
"ngx-mask": "^13.1.7",
|
||||
"nodemon": "^2.0.20",
|
||||
"postcss": "^8.1",
|
||||
"nodemon": "^2.0.22",
|
||||
"postcss": "^8.4",
|
||||
"postcss-apply": "0.12.0",
|
||||
"postcss-import": "^14.0.0",
|
||||
"postcss-loader": "^4.0.3",
|
||||
@@ -193,14 +195,14 @@
|
||||
"react-dom": "^16.14.0",
|
||||
"rimraf": "^3.0.2",
|
||||
"rxjs-spy": "^8.0.2",
|
||||
"sass": "~1.33.0",
|
||||
"sass": "~1.62.0",
|
||||
"sass-loader": "^12.6.0",
|
||||
"sass-resources-loader": "^2.1.1",
|
||||
"sass-resources-loader": "^2.2.5",
|
||||
"ts-node": "^8.10.2",
|
||||
"typescript": "~4.5.5",
|
||||
"webpack": "^5.69.1",
|
||||
"webpack-bundle-analyzer": "^4.4.0",
|
||||
"typescript": "~4.8.4",
|
||||
"webpack": "5.76.1",
|
||||
"webpack-bundle-analyzer": "^4.8.0",
|
||||
"webpack-cli": "^4.2.0",
|
||||
"webpack-dev-server": "^4.5.0"
|
||||
"webpack-dev-server": "^4.13.3"
|
||||
}
|
||||
}
|
||||
|
@@ -1,13 +0,0 @@
|
||||
const path = require('path');
|
||||
const child_process = require('child_process');
|
||||
|
||||
const heapSize = 4096;
|
||||
const webpackPath = path.join('node_modules', 'webpack', 'bin', 'webpack.js');
|
||||
|
||||
const params = [
|
||||
'--max_old_space_size=' + heapSize,
|
||||
webpackPath,
|
||||
...process.argv.slice(2)
|
||||
];
|
||||
|
||||
child_process.spawn('node', params, { stdio:'inherit' });
|
102
server.ts
102
server.ts
@@ -26,15 +26,15 @@ import * as ejs from 'ejs';
|
||||
import * as compression from 'compression';
|
||||
import * as expressStaticGzip from 'express-static-gzip';
|
||||
/* eslint-enable import/no-namespace */
|
||||
|
||||
import axios from 'axios';
|
||||
import LRU from 'lru-cache';
|
||||
import isbot from 'isbot';
|
||||
import { createCertificate } from 'pem';
|
||||
import { createServer } from 'https';
|
||||
import { json } from 'body-parser';
|
||||
import { createHttpTerminator } from 'http-terminator';
|
||||
|
||||
import { existsSync, readFileSync } from 'fs';
|
||||
import { readFileSync } from 'fs';
|
||||
import { join } from 'path';
|
||||
|
||||
import { enableProdMode } from '@angular/core';
|
||||
@@ -54,7 +54,7 @@ import { buildAppConfig } from './src/config/config.server';
|
||||
import { APP_CONFIG, AppConfig } from './src/config/app-config.interface';
|
||||
import { extendEnvironmentWithAppConfig } from './src/config/config.util';
|
||||
import { logStartupMessage } from './startup-message';
|
||||
import { TOKENITEM } from 'src/app/core/auth/models/auth-token-info.model';
|
||||
import { TOKENITEM } from './src/app/core/auth/models/auth-token-info.model';
|
||||
|
||||
|
||||
/*
|
||||
@@ -131,6 +131,7 @@ export function app() {
|
||||
server.engine('html', (_, options, callback) =>
|
||||
ngExpressEngine({
|
||||
bootstrap: ServerAppModule,
|
||||
inlineCriticalCss: environment.universal.inlineCriticalCss,
|
||||
providers: [
|
||||
{
|
||||
provide: REQUEST,
|
||||
@@ -180,6 +181,15 @@ export function app() {
|
||||
changeOrigin: true
|
||||
}));
|
||||
|
||||
/**
|
||||
* Proxy the linksets
|
||||
*/
|
||||
router.use('/signposting**', createProxyMiddleware({
|
||||
target: `${environment.rest.baseUrl}`,
|
||||
pathRewrite: path => path.replace(environment.ui.nameSpace, '/'),
|
||||
changeOrigin: true
|
||||
}));
|
||||
|
||||
/**
|
||||
* Checks if the rateLimiter property is present
|
||||
* When it is present, the rateLimiter will be enabled. When it is undefined, the rateLimiter will be disabled.
|
||||
@@ -312,22 +322,23 @@ function initCache() {
|
||||
if (botCacheEnabled()) {
|
||||
// Initialize a new "least-recently-used" item cache (where least recently used pages are removed first)
|
||||
// See https://www.npmjs.com/package/lru-cache
|
||||
// When enabled, each page defaults to expiring after 1 day
|
||||
// When enabled, each page defaults to expiring after 1 day (defined in default-app-config.ts)
|
||||
botCache = new LRU( {
|
||||
max: environment.cache.serverSide.botCache.max,
|
||||
ttl: environment.cache.serverSide.botCache.timeToLive || 24 * 60 * 60 * 1000, // 1 day
|
||||
allowStale: environment.cache.serverSide.botCache.allowStale ?? true // if object is stale, return stale value before deleting
|
||||
ttl: environment.cache.serverSide.botCache.timeToLive,
|
||||
allowStale: environment.cache.serverSide.botCache.allowStale
|
||||
});
|
||||
}
|
||||
|
||||
if (anonymousCacheEnabled()) {
|
||||
// NOTE: While caches may share SSR pages, this cache must be kept separately because the timeToLive
|
||||
// may expire pages more frequently.
|
||||
// When enabled, each page defaults to expiring after 10 seconds (to minimize anonymous users seeing out-of-date content)
|
||||
// When enabled, each page defaults to expiring after 10 seconds (defined in default-app-config.ts)
|
||||
// to minimize anonymous users seeing out-of-date content
|
||||
anonymousCache = new LRU( {
|
||||
max: environment.cache.serverSide.anonymousCache.max,
|
||||
ttl: environment.cache.serverSide.anonymousCache.timeToLive || 10 * 1000, // 10 seconds
|
||||
allowStale: environment.cache.serverSide.anonymousCache.allowStale ?? true // if object is stale, return stale value before deleting
|
||||
ttl: environment.cache.serverSide.anonymousCache.timeToLive,
|
||||
allowStale: environment.cache.serverSide.anonymousCache.allowStale
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -366,9 +377,19 @@ function cacheCheck(req, res, next) {
|
||||
}
|
||||
|
||||
// If cached copy exists, return it to the user.
|
||||
if (cachedCopy) {
|
||||
if (cachedCopy && cachedCopy.page) {
|
||||
if (cachedCopy.headers) {
|
||||
Object.keys(cachedCopy.headers).forEach((header) => {
|
||||
if (cachedCopy.headers[header]) {
|
||||
if (environment.cache.serverSide.debug) {
|
||||
console.log(`Restore cached ${header} header`);
|
||||
}
|
||||
res.setHeader(header, cachedCopy.headers[header]);
|
||||
}
|
||||
});
|
||||
}
|
||||
res.locals.ssr = true; // mark response as SSR-generated (enables text compression)
|
||||
res.send(cachedCopy);
|
||||
res.send(cachedCopy.page);
|
||||
|
||||
// Tell Express to skip all other handlers for this path
|
||||
// This ensures we don't try to re-render the page since we've already returned the cached copy
|
||||
@@ -443,22 +464,50 @@ function saveToCache(req, page: any) {
|
||||
const key = getCacheKey(req);
|
||||
// Avoid caching "/reload/[random]" paths (these are hard refreshes after logout)
|
||||
if (key.startsWith('/reload')) { return; }
|
||||
// Avoid caching not successful responses (status code different from 2XX status)
|
||||
if (hasNotSucceeded(req.res.statusCode)) { return; }
|
||||
|
||||
// Retrieve response headers to save, if any
|
||||
const headers = retrieveHeaders(req.res);
|
||||
// If bot cache is enabled, save it to that cache if it doesn't exist or is expired
|
||||
// (NOTE: has() will return false if page is expired in cache)
|
||||
if (botCacheEnabled() && !botCache.has(key)) {
|
||||
botCache.set(key, page);
|
||||
botCache.set(key, { page, headers });
|
||||
if (environment.cache.serverSide.debug) { console.log(`CACHE SAVE FOR ${key} in bot cache.`); }
|
||||
}
|
||||
|
||||
// If anonymous cache is enabled, save it to that cache if it doesn't exist or is expired
|
||||
if (anonymousCacheEnabled() && !anonymousCache.has(key)) {
|
||||
anonymousCache.set(key, page);
|
||||
anonymousCache.set(key, { page, headers });
|
||||
if (environment.cache.serverSide.debug) { console.log(`CACHE SAVE FOR ${key} in anonymous cache.`); }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if status code is different from 2XX
|
||||
* @param statusCode
|
||||
*/
|
||||
function hasNotSucceeded(statusCode) {
|
||||
const rgx = new RegExp(/^20+/);
|
||||
return !rgx.test(statusCode);
|
||||
}
|
||||
|
||||
function retrieveHeaders(response) {
|
||||
const headers = Object.create({});
|
||||
if (Array.isArray(environment.cache.serverSide.headers) && environment.cache.serverSide.headers.length > 0) {
|
||||
environment.cache.serverSide.headers.forEach((header) => {
|
||||
if (response.hasHeader(header)) {
|
||||
if (environment.cache.serverSide.debug) {
|
||||
console.log(`Save ${header} header to cache`);
|
||||
}
|
||||
headers[header] = response.getHeader(header);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return headers;
|
||||
}
|
||||
/**
|
||||
* Whether a user is authenticated or not
|
||||
*/
|
||||
@@ -479,23 +528,46 @@ function serverStarted() {
|
||||
* @param keys SSL credentials
|
||||
*/
|
||||
function createHttpsServer(keys) {
|
||||
createServer({
|
||||
const listener = createServer({
|
||||
key: keys.serviceKey,
|
||||
cert: keys.certificate
|
||||
}, app).listen(environment.ui.port, environment.ui.host, () => {
|
||||
serverStarted();
|
||||
});
|
||||
|
||||
// Graceful shutdown when signalled
|
||||
const terminator = createHttpTerminator({server: listener});
|
||||
process.on('SIGINT', () => {
|
||||
void (async ()=> {
|
||||
console.debug('Closing HTTPS server on signal');
|
||||
await terminator.terminate().catch(e => { console.error(e); });
|
||||
console.debug('HTTPS server closed');
|
||||
})();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an HTTP server with the configured port and host.
|
||||
*/
|
||||
function run() {
|
||||
const port = environment.ui.port || 4000;
|
||||
const host = environment.ui.host || '/';
|
||||
|
||||
// Start up the Node server
|
||||
const server = app();
|
||||
server.listen(port, host, () => {
|
||||
const listener = server.listen(port, host, () => {
|
||||
serverStarted();
|
||||
});
|
||||
|
||||
// Graceful shutdown when signalled
|
||||
const terminator = createHttpTerminator({server: listener});
|
||||
process.on('SIGINT', () => {
|
||||
void (async () => {
|
||||
console.debug('Closing HTTP server on signal');
|
||||
await terminator.terminate().catch(e => { console.error(e); });
|
||||
console.debug('HTTP server closed.');return undefined;
|
||||
})();
|
||||
});
|
||||
}
|
||||
|
||||
function start() {
|
||||
|
@@ -1,12 +1,22 @@
|
||||
import { URLCombiner } from '../core/url-combiner/url-combiner';
|
||||
import { getAccessControlModuleRoute } from '../app-routing-paths';
|
||||
|
||||
export const GROUP_EDIT_PATH = 'groups';
|
||||
export const EPERSON_PATH = 'epeople';
|
||||
|
||||
export function getEPersonsRoute(): string {
|
||||
return new URLCombiner(getAccessControlModuleRoute(), EPERSON_PATH).toString();
|
||||
}
|
||||
|
||||
export function getEPersonEditRoute(id: string): string {
|
||||
return new URLCombiner(getEPersonsRoute(), id, 'edit').toString();
|
||||
}
|
||||
|
||||
export const GROUP_PATH = 'groups';
|
||||
|
||||
export function getGroupsRoute() {
|
||||
return new URLCombiner(getAccessControlModuleRoute(), GROUP_EDIT_PATH).toString();
|
||||
return new URLCombiner(getAccessControlModuleRoute(), GROUP_PATH).toString();
|
||||
}
|
||||
|
||||
export function getGroupEditRoute(id: string) {
|
||||
return new URLCombiner(getAccessControlModuleRoute(), GROUP_EDIT_PATH, id).toString();
|
||||
return new URLCombiner(getGroupsRoute(), id, 'edit').toString();
|
||||
}
|
||||
|
@@ -3,17 +3,24 @@ import { RouterModule } from '@angular/router';
|
||||
import { EPeopleRegistryComponent } from './epeople-registry/epeople-registry.component';
|
||||
import { GroupFormComponent } from './group-registry/group-form/group-form.component';
|
||||
import { GroupsRegistryComponent } from './group-registry/groups-registry.component';
|
||||
import { GROUP_EDIT_PATH } from './access-control-routing-paths';
|
||||
import { EPERSON_PATH, GROUP_PATH } from './access-control-routing-paths';
|
||||
import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver';
|
||||
import { GroupPageGuard } from './group-registry/group-page.guard';
|
||||
import { GroupAdministratorGuard } from '../core/data/feature-authorization/feature-authorization-guard/group-administrator.guard';
|
||||
import { SiteAdministratorGuard } from '../core/data/feature-authorization/feature-authorization-guard/site-administrator.guard';
|
||||
import {
|
||||
GroupAdministratorGuard
|
||||
} from '../core/data/feature-authorization/feature-authorization-guard/group-administrator.guard';
|
||||
import {
|
||||
SiteAdministratorGuard
|
||||
} from '../core/data/feature-authorization/feature-authorization-guard/site-administrator.guard';
|
||||
import { BulkAccessComponent } from './bulk-access/bulk-access.component';
|
||||
import { EPersonFormComponent } from './epeople-registry/eperson-form/eperson-form.component';
|
||||
import { EPersonResolver } from './epeople-registry/eperson-resolver.service';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
RouterModule.forChild([
|
||||
{
|
||||
path: 'epeople',
|
||||
path: EPERSON_PATH,
|
||||
component: EPeopleRegistryComponent,
|
||||
resolve: {
|
||||
breadcrumb: I18nBreadcrumbResolver
|
||||
@@ -22,7 +29,26 @@ import { SiteAdministratorGuard } from '../core/data/feature-authorization/featu
|
||||
canActivate: [SiteAdministratorGuard]
|
||||
},
|
||||
{
|
||||
path: GROUP_EDIT_PATH,
|
||||
path: `${EPERSON_PATH}/create`,
|
||||
component: EPersonFormComponent,
|
||||
resolve: {
|
||||
breadcrumb: I18nBreadcrumbResolver,
|
||||
},
|
||||
data: { title: 'admin.access-control.epeople.add.title', breadcrumbKey: 'admin.access-control.epeople.add' },
|
||||
canActivate: [SiteAdministratorGuard],
|
||||
},
|
||||
{
|
||||
path: `${EPERSON_PATH}/:id/edit`,
|
||||
component: EPersonFormComponent,
|
||||
resolve: {
|
||||
breadcrumb: I18nBreadcrumbResolver,
|
||||
ePerson: EPersonResolver,
|
||||
},
|
||||
data: { title: 'admin.access-control.epeople.edit.title', breadcrumbKey: 'admin.access-control.epeople.edit' },
|
||||
canActivate: [SiteAdministratorGuard],
|
||||
},
|
||||
{
|
||||
path: GROUP_PATH,
|
||||
component: GroupsRegistryComponent,
|
||||
resolve: {
|
||||
breadcrumb: I18nBreadcrumbResolver
|
||||
@@ -31,7 +57,7 @@ import { SiteAdministratorGuard } from '../core/data/feature-authorization/featu
|
||||
canActivate: [GroupAdministratorGuard]
|
||||
},
|
||||
{
|
||||
path: `${GROUP_EDIT_PATH}/newGroup`,
|
||||
path: `${GROUP_PATH}/create`,
|
||||
component: GroupFormComponent,
|
||||
resolve: {
|
||||
breadcrumb: I18nBreadcrumbResolver
|
||||
@@ -40,14 +66,23 @@ import { SiteAdministratorGuard } from '../core/data/feature-authorization/featu
|
||||
canActivate: [GroupAdministratorGuard]
|
||||
},
|
||||
{
|
||||
path: `${GROUP_EDIT_PATH}/:groupId`,
|
||||
path: `${GROUP_PATH}/:groupId/edit`,
|
||||
component: GroupFormComponent,
|
||||
resolve: {
|
||||
breadcrumb: I18nBreadcrumbResolver
|
||||
},
|
||||
data: { title: 'admin.access-control.groups.title.singleGroup', breadcrumbKey: 'admin.access-control.groups.singleGroup' },
|
||||
canActivate: [GroupPageGuard]
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'bulk-access',
|
||||
component: BulkAccessComponent,
|
||||
resolve: {
|
||||
breadcrumb: I18nBreadcrumbResolver
|
||||
},
|
||||
data: { title: 'admin.access-control.bulk-access.title', breadcrumbKey: 'admin.access-control.bulk-access' },
|
||||
canActivate: [SiteAdministratorGuard]
|
||||
},
|
||||
])
|
||||
]
|
||||
})
|
||||
|
@@ -12,6 +12,12 @@ import { GroupsRegistryComponent } from './group-registry/groups-registry.compon
|
||||
import { FormModule } from '../shared/form/form.module';
|
||||
import { DYNAMIC_ERROR_MESSAGES_MATCHER, DynamicErrorMessagesMatcher } from '@ng-dynamic-forms/core';
|
||||
import { AbstractControl } from '@angular/forms';
|
||||
import { BulkAccessComponent } from './bulk-access/bulk-access.component';
|
||||
import { NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { BulkAccessBrowseComponent } from './bulk-access/browse/bulk-access-browse.component';
|
||||
import { BulkAccessSettingsComponent } from './bulk-access/settings/bulk-access-settings.component';
|
||||
import { SearchModule } from '../shared/search/search.module';
|
||||
import { AccessControlFormModule } from '../shared/access-control-form-container/access-control-form.module';
|
||||
|
||||
/**
|
||||
* Condition for displaying error messages on email form field
|
||||
@@ -28,6 +34,9 @@ export const ValidateEmailErrorStateMatcher: DynamicErrorMessagesMatcher =
|
||||
RouterModule,
|
||||
AccessControlRoutingModule,
|
||||
FormModule,
|
||||
NgbAccordionModule,
|
||||
SearchModule,
|
||||
AccessControlFormModule,
|
||||
],
|
||||
exports: [
|
||||
MembersListComponent,
|
||||
@@ -39,6 +48,9 @@ export const ValidateEmailErrorStateMatcher: DynamicErrorMessagesMatcher =
|
||||
GroupFormComponent,
|
||||
SubgroupsListComponent,
|
||||
MembersListComponent,
|
||||
BulkAccessComponent,
|
||||
BulkAccessBrowseComponent,
|
||||
BulkAccessSettingsComponent,
|
||||
],
|
||||
providers: [
|
||||
{
|
||||
|
@@ -0,0 +1,68 @@
|
||||
<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">
|
||||
<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">
|
||||
{{ '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>
|
||||
<div id="bulk-access-browse-panel-content">
|
||||
<ul ngbNav #nav="ngbNav" [(activeId)]="activateId" class="nav-pills">
|
||||
<li [ngbNavItem]="'search'" role="presentation">
|
||||
<a ngbNavLink>{{'admin.access-control.bulk-access-browse.search.header' | translate}}</a>
|
||||
<ng-template ngbNavContent>
|
||||
<div class="mx-n3">
|
||||
<ds-themed-search [configuration]="'administrativeBulkAccess'"
|
||||
[selectable]="true"
|
||||
[selectionConfig]="{ repeatable: true, listId: listId }"
|
||||
[showThumbnails]="false"></ds-themed-search>
|
||||
</div>
|
||||
</ng-template>
|
||||
</li>
|
||||
<li [ngbNavItem]="'selected'" role="presentation">
|
||||
<a ngbNavLink>
|
||||
{{'admin.access-control.bulk-access-browse.selected.header' | translate: {number: ((objectsSelected$ | async)?.payload?.totalElements) ? (objectsSelected$ | async)?.payload?.totalElements : '0'} }}
|
||||
</a>
|
||||
<ng-template ngbNavContent>
|
||||
<ds-pagination
|
||||
[paginationOptions]="(paginationOptions$ | async)"
|
||||
[collectionSize]="(objectsSelected$|async)?.payload?.totalElements"
|
||||
[objects]="(objectsSelected$|async)"
|
||||
[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>
|
||||
</ds-pagination>
|
||||
</ng-template>
|
||||
</li>
|
||||
</ul>
|
||||
<div [ngbNavOutlet]="nav" class="mt-5"></div>
|
||||
</div>
|
||||
</ng-template>
|
||||
</ngb-panel>
|
||||
</ngb-accordion>
|
@@ -0,0 +1,82 @@
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
|
||||
import { of } from 'rxjs';
|
||||
import { NgbAccordionModule, NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
import { BulkAccessBrowseComponent } from './bulk-access-browse.component';
|
||||
import { SelectableListService } from '../../../shared/object-list/selectable-list/selectable-list.service';
|
||||
import { SelectableObject } from '../../../shared/object-list/selectable-list/selectable-list.service.spec';
|
||||
import { PageInfo } from '../../../core/shared/page-info.model';
|
||||
import { buildPaginatedList } from '../../../core/data/paginated-list.model';
|
||||
import { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.utils';
|
||||
|
||||
describe('BulkAccessBrowseComponent', () => {
|
||||
let component: BulkAccessBrowseComponent;
|
||||
let fixture: ComponentFixture<BulkAccessBrowseComponent>;
|
||||
|
||||
const listID1 = 'id1';
|
||||
const value1 = 'Selected object';
|
||||
const value2 = 'Another selected object';
|
||||
|
||||
const selected1 = new SelectableObject(value1);
|
||||
const selected2 = new SelectableObject(value2);
|
||||
|
||||
const testSelection = { id: listID1, selection: [selected1, selected2] } ;
|
||||
|
||||
const selectableListService = jasmine.createSpyObj('SelectableListService', ['getSelectableList', 'deselectAll']);
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
NgbAccordionModule,
|
||||
NgbNavModule,
|
||||
TranslateModule.forRoot()
|
||||
],
|
||||
declarations: [BulkAccessBrowseComponent],
|
||||
providers: [ { provide: SelectableListService, useValue: selectableListService }, ],
|
||||
schemas: [
|
||||
NO_ERRORS_SCHEMA
|
||||
]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(BulkAccessBrowseComponent);
|
||||
component = fixture.componentInstance;
|
||||
(component as any).selectableListService.getSelectableList.and.returnValue(of(testSelection));
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
fixture.destroy();
|
||||
component = null;
|
||||
});
|
||||
|
||||
it('should create the component', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should have an initial active nav id of "search"', () => {
|
||||
expect(component.activateId).toEqual('search');
|
||||
});
|
||||
|
||||
it('should have an initial pagination options object with default values', () => {
|
||||
expect(component.paginationOptions$.getValue().id).toEqual('bas');
|
||||
expect(component.paginationOptions$.getValue().pageSize).toEqual(5);
|
||||
expect(component.paginationOptions$.getValue().currentPage).toEqual(1);
|
||||
});
|
||||
|
||||
it('should have an initial remote data with a paginated list as value', () => {
|
||||
const list = buildPaginatedList(new PageInfo({
|
||||
'elementsPerPage': 5,
|
||||
'totalElements': 2,
|
||||
'totalPages': 1,
|
||||
'currentPage': 1
|
||||
}), [selected1, selected2]) ;
|
||||
const rd = createSuccessfulRemoteDataObject(list);
|
||||
|
||||
expect(component.objectsSelected$.value).toEqual(rd);
|
||||
});
|
||||
|
||||
});
|
@@ -0,0 +1,119 @@
|
||||
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
|
||||
|
||||
import { BehaviorSubject, Subscription } from 'rxjs';
|
||||
import { distinctUntilChanged, map } from 'rxjs/operators';
|
||||
|
||||
import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-page.component';
|
||||
import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service';
|
||||
import { SelectableListService } from '../../../shared/object-list/selectable-list/selectable-list.service';
|
||||
import { SelectableListState } from '../../../shared/object-list/selectable-list/selectable-list.reducer';
|
||||
import { RemoteData } from '../../../core/data/remote-data';
|
||||
import { buildPaginatedList, PaginatedList } from '../../../core/data/paginated-list.model';
|
||||
import { ListableObject } from '../../../shared/object-collection/shared/listable-object.model';
|
||||
import { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.utils';
|
||||
import { PageInfo } from '../../../core/shared/page-info.model';
|
||||
import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model';
|
||||
import { hasValue } from '../../../shared/empty.util';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-bulk-access-browse',
|
||||
templateUrl: 'bulk-access-browse.component.html',
|
||||
styleUrls: ['./bulk-access-browse.component.scss'],
|
||||
providers: [
|
||||
{
|
||||
provide: SEARCH_CONFIG_SERVICE,
|
||||
useClass: SearchConfigurationService
|
||||
}
|
||||
]
|
||||
})
|
||||
export class BulkAccessBrowseComponent implements OnInit, OnDestroy {
|
||||
|
||||
/**
|
||||
* The selection list id
|
||||
*/
|
||||
@Input() listId!: string;
|
||||
|
||||
/**
|
||||
* The active nav id
|
||||
*/
|
||||
activateId = 'search';
|
||||
|
||||
/**
|
||||
* The list of the objects already selected
|
||||
*/
|
||||
objectsSelected$: BehaviorSubject<RemoteData<PaginatedList<ListableObject>>> = new BehaviorSubject<RemoteData<PaginatedList<ListableObject>>>(null);
|
||||
|
||||
/**
|
||||
* The pagination options object used for the list of selected elements
|
||||
*/
|
||||
paginationOptions$: BehaviorSubject<PaginationComponentOptions> = new BehaviorSubject<PaginationComponentOptions>(Object.assign(new PaginationComponentOptions(), {
|
||||
id: 'bas',
|
||||
pageSize: 5,
|
||||
currentPage: 1
|
||||
}));
|
||||
|
||||
/**
|
||||
* Array to track all subscriptions and unsubscribe them onDestroy
|
||||
*/
|
||||
private subs: Subscription[] = [];
|
||||
|
||||
constructor(private selectableListService: SelectableListService) {}
|
||||
|
||||
/**
|
||||
* Subscribe to selectable list updates
|
||||
*/
|
||||
ngOnInit(): void {
|
||||
|
||||
this.subs.push(
|
||||
this.selectableListService.getSelectableList(this.listId).pipe(
|
||||
distinctUntilChanged(),
|
||||
map((list: SelectableListState) => this.generatePaginatedListBySelectedElements(list))
|
||||
).subscribe(this.objectsSelected$)
|
||||
);
|
||||
}
|
||||
|
||||
pageNext() {
|
||||
this.paginationOptions$.next(Object.assign(new PaginationComponentOptions(), this.paginationOptions$.value, {
|
||||
currentPage: this.paginationOptions$.value.currentPage + 1
|
||||
}));
|
||||
}
|
||||
|
||||
pagePrev() {
|
||||
this.paginationOptions$.next(Object.assign(new PaginationComponentOptions(), this.paginationOptions$.value, {
|
||||
currentPage: this.paginationOptions$.value.currentPage - 1
|
||||
}));
|
||||
}
|
||||
|
||||
private calculatePageCount(pageSize, totalCount = 0) {
|
||||
// we suppose that if we have 0 items we want 1 empty page
|
||||
return totalCount < pageSize ? 1 : Math.ceil(totalCount / pageSize);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate The RemoteData object containing the list of the selected elements
|
||||
* @param list
|
||||
* @private
|
||||
*/
|
||||
private generatePaginatedListBySelectedElements(list: SelectableListState): RemoteData<PaginatedList<ListableObject>> {
|
||||
const pageInfo = new PageInfo({
|
||||
elementsPerPage: this.paginationOptions$.value.pageSize,
|
||||
totalElements: list?.selection.length,
|
||||
totalPages: this.calculatePageCount(this.paginationOptions$.value.pageSize, list?.selection.length),
|
||||
currentPage: this.paginationOptions$.value.currentPage
|
||||
});
|
||||
if (pageInfo.currentPage > pageInfo.totalPages) {
|
||||
pageInfo.currentPage = pageInfo.totalPages;
|
||||
this.paginationOptions$.next(Object.assign(new PaginationComponentOptions(), this.paginationOptions$.value, {
|
||||
currentPage: pageInfo.currentPage
|
||||
}));
|
||||
}
|
||||
return createSuccessfulRemoteDataObject(buildPaginatedList(pageInfo, list?.selection || []));
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
this.subs
|
||||
.filter((sub) => hasValue(sub))
|
||||
.forEach((sub) => sub.unsubscribe());
|
||||
this.selectableListService.deselectAll(this.listId);
|
||||
}
|
||||
}
|
@@ -0,0 +1,20 @@
|
||||
<div class="container">
|
||||
<h1>{{ 'admin.access-control.bulk-access.title' | translate }}</h1>
|
||||
<ds-bulk-access-browse [listId]="listId"></ds-bulk-access-browse>
|
||||
<div class="clearfix mb-3"></div>
|
||||
<ds-bulk-access-settings #dsBulkSettings ></ds-bulk-access-settings>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="d-flex justify-content-end">
|
||||
<button class="btn btn-outline-primary mr-3" (click)="reset()">
|
||||
{{ 'access-control-cancel' | translate }}
|
||||
</button>
|
||||
<button class="btn btn-primary" [disabled]="!canExport()" (click)="submit()">
|
||||
{{ 'access-control-execute' | translate }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
158
src/app/access-control/bulk-access/bulk-access.component.spec.ts
Normal file
158
src/app/access-control/bulk-access/bulk-access.component.spec.ts
Normal file
@@ -0,0 +1,158 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { of } from 'rxjs';
|
||||
|
||||
import { BulkAccessComponent } from './bulk-access.component';
|
||||
import { BulkAccessControlService } from '../../shared/access-control-form-container/bulk-access-control.service';
|
||||
import { SelectableListService } from '../../shared/object-list/selectable-list/selectable-list.service';
|
||||
import { SelectableListState } from '../../shared/object-list/selectable-list/selectable-list.reducer';
|
||||
import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
|
||||
import { Process } from '../../process-page/processes/process.model';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||
import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub';
|
||||
|
||||
describe('BulkAccessComponent', () => {
|
||||
let component: BulkAccessComponent;
|
||||
let fixture: ComponentFixture<BulkAccessComponent>;
|
||||
let bulkAccessControlService: any;
|
||||
let selectableListService: any;
|
||||
|
||||
const selectableListServiceMock = jasmine.createSpyObj('SelectableListService', ['getSelectableList', 'deselectAll']);
|
||||
const bulkAccessControlServiceMock = jasmine.createSpyObj('bulkAccessControlService', ['createPayloadFile', 'executeScript']);
|
||||
|
||||
const mockFormState = {
|
||||
'bitstream': [],
|
||||
'item': [
|
||||
{
|
||||
'name': 'embargo',
|
||||
'startDate': {
|
||||
'year': 2026,
|
||||
'month': 5,
|
||||
'day': 31
|
||||
},
|
||||
'endDate': null
|
||||
}
|
||||
],
|
||||
'state': {
|
||||
'item': {
|
||||
'toggleStatus': true,
|
||||
'accessMode': 'replace'
|
||||
},
|
||||
'bitstream': {
|
||||
'toggleStatus': false,
|
||||
'accessMode': '',
|
||||
'changesLimit': '',
|
||||
'selectedBitstreams': []
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const mockFile = {
|
||||
'uuids': [
|
||||
'1234', '5678'
|
||||
],
|
||||
'file': { }
|
||||
};
|
||||
|
||||
const mockSettings: any = jasmine.createSpyObj('AccessControlFormContainerComponent', {
|
||||
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'];
|
||||
|
||||
const selectableListStateEmpty: SelectableListState = { id: 'test', selection: [] };
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [
|
||||
RouterTestingModule,
|
||||
TranslateModule.forRoot()
|
||||
],
|
||||
declarations: [ BulkAccessComponent ],
|
||||
providers: [
|
||||
{ provide: BulkAccessControlService, useValue: bulkAccessControlServiceMock },
|
||||
{ provide: NotificationsService, useValue: NotificationsServiceStub },
|
||||
{ provide: SelectableListService, useValue: selectableListServiceMock }
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(BulkAccessComponent);
|
||||
component = fixture.componentInstance;
|
||||
bulkAccessControlService = TestBed.inject(BulkAccessControlService);
|
||||
selectableListService = TestBed.inject(SelectableListService);
|
||||
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
fixture.destroy();
|
||||
});
|
||||
|
||||
describe('when there are no elements selected', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
(component as any).selectableListService.getSelectableList.and.returnValue(of(selectableListStateEmpty));
|
||||
fixture.detectChanges();
|
||||
component.settings = mockSettings;
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should generate the id list by selected elements', () => {
|
||||
expect(component.objectsSelected$.value).toEqual([]);
|
||||
});
|
||||
|
||||
it('should disable the execute button when there are no objects selected', () => {
|
||||
expect(component.canExport()).toBe(false);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('when there are elements selected', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
(component as any).selectableListService.getSelectableList.and.returnValue(of(selectableListState));
|
||||
fixture.detectChanges();
|
||||
component.settings = mockSettings;
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should generate the id list by selected elements', () => {
|
||||
expect(component.objectsSelected$.value).toEqual(expectedIdList);
|
||||
});
|
||||
|
||||
it('should enable the execute button when there are objects selected', () => {
|
||||
component.objectsSelected$.next(['1234']);
|
||||
expect(component.canExport()).toBe(true);
|
||||
});
|
||||
|
||||
it('should call the settings reset method when reset is called', () => {
|
||||
component.reset();
|
||||
expect(component.settings.reset).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should call the bulkAccessControlService executeScript method when submit is called', () => {
|
||||
(component.settings as any).getValue.and.returnValue(mockFormState);
|
||||
bulkAccessControlService.createPayloadFile.and.returnValue(mockFile);
|
||||
bulkAccessControlService.executeScript.and.returnValue(createSuccessfulRemoteDataObject$(new Process()));
|
||||
component.objectsSelected$.next(['1234']);
|
||||
component.submit();
|
||||
expect(bulkAccessControlService.executeScript).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
});
|
94
src/app/access-control/bulk-access/bulk-access.component.ts
Normal file
94
src/app/access-control/bulk-access/bulk-access.component.ts
Normal file
@@ -0,0 +1,94 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
|
||||
import { BehaviorSubject, Subscription } from 'rxjs';
|
||||
import { distinctUntilChanged, map } from 'rxjs/operators';
|
||||
|
||||
import { BulkAccessSettingsComponent } from './settings/bulk-access-settings.component';
|
||||
import { BulkAccessControlService } from '../../shared/access-control-form-container/bulk-access-control.service';
|
||||
import { SelectableListState } from '../../shared/object-list/selectable-list/selectable-list.reducer';
|
||||
import { SelectableListService } from '../../shared/object-list/selectable-list/selectable-list.service';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-bulk-access',
|
||||
templateUrl: './bulk-access.component.html',
|
||||
styleUrls: ['./bulk-access.component.scss']
|
||||
})
|
||||
export class BulkAccessComponent implements OnInit {
|
||||
|
||||
/**
|
||||
* The selection list id
|
||||
*/
|
||||
listId = 'bulk-access-list';
|
||||
|
||||
/**
|
||||
* The list of the objects already selected
|
||||
*/
|
||||
objectsSelected$: BehaviorSubject<string[]> = new BehaviorSubject<string[]>([]);
|
||||
|
||||
/**
|
||||
* Array to track all subscriptions and unsubscribe them onDestroy
|
||||
*/
|
||||
private subs: Subscription[] = [];
|
||||
|
||||
/**
|
||||
* The SectionsDirective reference
|
||||
*/
|
||||
@ViewChild('dsBulkSettings') settings: BulkAccessSettingsComponent;
|
||||
|
||||
constructor(
|
||||
private bulkAccessControlService: BulkAccessControlService,
|
||||
private selectableListService: SelectableListService
|
||||
) {
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.subs.push(
|
||||
this.selectableListService.getSelectableList(this.listId).pipe(
|
||||
distinctUntilChanged(),
|
||||
map((list: SelectableListState) => this.generateIdListBySelectedElements(list))
|
||||
).subscribe(this.objectsSelected$)
|
||||
);
|
||||
}
|
||||
|
||||
canExport(): boolean {
|
||||
return this.objectsSelected$.value?.length > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset the form to its initial state
|
||||
* This will also reset the state of the child components (bitstream and item access)
|
||||
*/
|
||||
reset(): void {
|
||||
this.settings.reset();
|
||||
}
|
||||
|
||||
/**
|
||||
* Submit the form
|
||||
* This will create a payload file and execute the script
|
||||
*/
|
||||
submit(): void {
|
||||
const settings = this.settings.getValue();
|
||||
const bitstreamAccess = settings.bitstream;
|
||||
const itemAccess = settings.item;
|
||||
|
||||
const { file } = this.bulkAccessControlService.createPayloadFile({
|
||||
bitstreamAccess,
|
||||
itemAccess,
|
||||
state: settings.state
|
||||
});
|
||||
|
||||
this.bulkAccessControlService.executeScript(
|
||||
this.objectsSelected$.value || [],
|
||||
file
|
||||
).subscribe();
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate The RemoteData object containing the list of the selected elements
|
||||
* @param list
|
||||
* @private
|
||||
*/
|
||||
private generateIdListBySelectedElements(list: SelectableListState): string[] {
|
||||
return list?.selection?.map((entry: any) => entry.indexableObject.uuid);
|
||||
}
|
||||
}
|
@@ -0,0 +1,21 @@
|
||||
<ngb-accordion #acc="ngbAccordion" [activeIds]="'settings'">
|
||||
<ngb-panel [id]="'settings'">
|
||||
<ng-template ngbPanelHeader>
|
||||
<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>
|
||||
<ds-access-control-form-container id="bulk-access-settings-panel-content" #dsAccessControlForm [showSubmit]="false"></ds-access-control-form-container>
|
||||
</ng-template>
|
||||
</ngb-panel>
|
||||
</ngb-accordion>
|
@@ -0,0 +1,81 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { BulkAccessSettingsComponent } from './bulk-access-settings.component';
|
||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
|
||||
describe('BulkAccessSettingsComponent', () => {
|
||||
let component: BulkAccessSettingsComponent;
|
||||
let fixture: ComponentFixture<BulkAccessSettingsComponent>;
|
||||
const mockFormState = {
|
||||
'bitstream': [],
|
||||
'item': [
|
||||
{
|
||||
'name': 'embargo',
|
||||
'startDate': {
|
||||
'year': 2026,
|
||||
'month': 5,
|
||||
'day': 31
|
||||
},
|
||||
'endDate': null
|
||||
}
|
||||
],
|
||||
'state': {
|
||||
'item': {
|
||||
'toggleStatus': true,
|
||||
'accessMode': 'replace'
|
||||
},
|
||||
'bitstream': {
|
||||
'toggleStatus': false,
|
||||
'accessMode': '',
|
||||
'changesLimit': '',
|
||||
'selectedBitstreams': []
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const mockControl: any = jasmine.createSpyObj('AccessControlFormContainerComponent', {
|
||||
getFormValue: jasmine.createSpy('getFormValue'),
|
||||
reset: jasmine.createSpy('reset')
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [NgbAccordionModule, TranslateModule.forRoot()],
|
||||
declarations: [BulkAccessSettingsComponent],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
}).compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(BulkAccessSettingsComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
component.controlForm = mockControl;
|
||||
});
|
||||
|
||||
it('should create the component', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should have a method to get the form value', () => {
|
||||
expect(component.getValue).toBeDefined();
|
||||
});
|
||||
|
||||
it('should have a method to reset the form', () => {
|
||||
expect(component.reset).toBeDefined();
|
||||
});
|
||||
|
||||
it('should return the correct form value', () => {
|
||||
const expectedValue = mockFormState;
|
||||
(component.controlForm as any).getFormValue.and.returnValue(mockFormState);
|
||||
const actualValue = component.getValue();
|
||||
// @ts-ignore
|
||||
expect(actualValue).toEqual(expectedValue);
|
||||
});
|
||||
|
||||
it('should call reset on the control form', () => {
|
||||
component.reset();
|
||||
expect(component.controlForm.reset).toHaveBeenCalled();
|
||||
});
|
||||
});
|
@@ -0,0 +1,34 @@
|
||||
import { Component, ViewChild } from '@angular/core';
|
||||
import {
|
||||
AccessControlFormContainerComponent
|
||||
} from '../../../shared/access-control-form-container/access-control-form-container.component';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-bulk-access-settings',
|
||||
templateUrl: 'bulk-access-settings.component.html',
|
||||
styleUrls: ['./bulk-access-settings.component.scss'],
|
||||
exportAs: 'dsBulkSettings'
|
||||
})
|
||||
export class BulkAccessSettingsComponent {
|
||||
|
||||
/**
|
||||
* The SectionsDirective reference
|
||||
*/
|
||||
@ViewChild('dsAccessControlForm') controlForm: AccessControlFormContainerComponent<any>;
|
||||
|
||||
/**
|
||||
* Will be used from a parent component to read the value of the form
|
||||
*/
|
||||
getValue() {
|
||||
return this.controlForm.getFormValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset the form to its initial state
|
||||
* This will also reset the state of the child components (bitstream and item access)
|
||||
*/
|
||||
reset() {
|
||||
this.controlForm.reset();
|
||||
}
|
||||
|
||||
}
|
@@ -2,98 +2,92 @@
|
||||
<div class="epeople-registry row">
|
||||
<div class="col-12">
|
||||
<div class="d-flex justify-content-between border-bottom mb-3">
|
||||
<h2 id="header" class="pb-2">{{labelPrefix + 'head' | translate}}</h2>
|
||||
<h1 id="header" class="pb-2">{{labelPrefix + 'head' | translate}}</h1>
|
||||
|
||||
<div *ngIf="!isEPersonFormShown">
|
||||
<div>
|
||||
<button class="mr-auto btn btn-success addEPerson-button"
|
||||
(click)="isEPersonFormShown = true">
|
||||
[routerLink]="'create'">
|
||||
<i class="fas fa-plus"></i>
|
||||
<span class="d-none d-sm-inline">{{labelPrefix + 'button.add' | translate}}</span>
|
||||
<span class="d-none d-sm-inline ml-1">{{labelPrefix + 'button.add' | translate}}</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ds-eperson-form *ngIf="isEPersonFormShown" (submitForm)="reset()"
|
||||
(cancelForm)="isEPersonFormShown = false"></ds-eperson-form>
|
||||
|
||||
<div *ngIf="!isEPersonFormShown">
|
||||
<h3 id="search" class="border-bottom pb-2">{{labelPrefix + 'search.head' | translate}}
|
||||
|
||||
</h3>
|
||||
<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">
|
||||
<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">
|
||||
<input type="text" name="query" id="query" formControlName="query"
|
||||
class="form-control" attr.aria-label="{{labelPrefix + 'search.placeholder' | translate}}"
|
||||
[placeholder]="(labelPrefix + 'search.placeholder' | translate)">
|
||||
<span class="input-group-append">
|
||||
<h2 id="search" class="border-bottom pb-2">
|
||||
{{labelPrefix + 'search.head' | translate}}
|
||||
</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">
|
||||
<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">
|
||||
<input type="text" name="query" id="query" formControlName="query"
|
||||
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>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<button (click)="clearFormAndResetResult();"
|
||||
class="search-button btn btn-secondary">{{labelPrefix + 'button.see-all' | translate}}</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<ds-themed-loading *ngIf="searching$ | async"></ds-themed-loading>
|
||||
<ds-pagination
|
||||
*ngIf="(pageInfoState$ | async)?.totalElements > 0 && !(searching$ | async)"
|
||||
[paginationOptions]="config"
|
||||
[pageInfoState]="pageInfoState$"
|
||||
[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' : isActive(epersonDto.eperson) | async}">
|
||||
<td>{{epersonDto.eperson.id}}</td>
|
||||
<td>{{epersonDto.eperson.name}}</td>
|
||||
<td>{{epersonDto.eperson.email}}</td>
|
||||
<td>
|
||||
<div class="btn-group edit-field">
|
||||
<button class="delete-button" (click)="toggleEditEPerson(epersonDto.eperson)"
|
||||
class="btn btn-outline-primary btn-sm access-control-editEPersonButton"
|
||||
title="{{labelPrefix + 'table.edit.buttons.edit' | translate: {name: epersonDto.eperson.name} }}">
|
||||
<i class="fas fa-edit fa-fw"></i>
|
||||
</button>
|
||||
<button [disabled]="!epersonDto.ableToDelete" (click)="deleteEPerson(epersonDto.eperson)"
|
||||
class="btn btn-outline-danger btn-sm access-control-deleteEPersonButton"
|
||||
title="{{labelPrefix + 'table.edit.buttons.remove' | translate: {name: epersonDto.eperson.name} }}">
|
||||
<i class="fas fa-trash-alt fa-fw"></i>
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</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>
|
||||
<button (click)="clearFormAndResetResult();"
|
||||
class="search-button btn btn-secondary">{{labelPrefix + 'button.see-all' | translate}}</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<ds-themed-loading *ngIf="searching$ | async"></ds-themed-loading>
|
||||
<ds-pagination
|
||||
*ngIf="(pageInfoState$ | async)?.totalElements > 0 && !(searching$ | async)"
|
||||
[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' : isActive(epersonDto.eperson) | async}">
|
||||
<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>
|
||||
</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>
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import { Router } from '@angular/router';
|
||||
import { Observable, of as observableOf } from 'rxjs';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { DebugElement, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { ComponentFixture, fakeAsync, TestBed, tick, waitForAsync } from '@angular/core/testing';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { BrowserModule, By } from '@angular/platform-browser';
|
||||
@@ -42,6 +42,7 @@ describe('EPeopleRegistryComponent', () => {
|
||||
let paginationService;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
jasmine.getEnv().allowRespy(true);
|
||||
mockEPeople = [EPersonMock, EPersonMock2];
|
||||
ePersonDataServiceStub = {
|
||||
activeEPerson: null,
|
||||
@@ -98,7 +99,7 @@ describe('EPeopleRegistryComponent', () => {
|
||||
deleteEPerson(ePerson: EPerson): Observable<boolean> {
|
||||
this.allEpeople = this.allEpeople.filter((ePerson2: EPerson) => {
|
||||
return (ePerson2.uuid !== ePerson.uuid);
|
||||
});
|
||||
});
|
||||
return observableOf(true);
|
||||
},
|
||||
editEPerson(ePerson: EPerson) {
|
||||
@@ -202,36 +203,6 @@ describe('EPeopleRegistryComponent', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('toggleEditEPerson', () => {
|
||||
describe('when you click on first edit eperson button', () => {
|
||||
beforeEach(fakeAsync(() => {
|
||||
const editButtons = fixture.debugElement.queryAll(By.css('.access-control-editEPersonButton'));
|
||||
editButtons[0].triggerEventHandler('click', {
|
||||
preventDefault: () => {/**/
|
||||
}
|
||||
});
|
||||
tick();
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('editEPerson form is toggled', () => {
|
||||
const ePeopleIds = fixture.debugElement.queryAll(By.css('#epeople tr td:first-child'));
|
||||
ePersonDataServiceStub.getActiveEPerson().subscribe((activeEPerson: EPerson) => {
|
||||
if (ePeopleIds[0] && activeEPerson === ePeopleIds[0].nativeElement.textContent) {
|
||||
expect(component.isEPersonFormShown).toEqual(false);
|
||||
} else {
|
||||
expect(component.isEPersonFormShown).toEqual(true);
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
it('EPerson search section is hidden', () => {
|
||||
expect(fixture.debugElement.query(By.css('#search'))).toBeNull();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('deleteEPerson', () => {
|
||||
describe('when you click on first delete eperson button', () => {
|
||||
let ePeopleIdsFoundBeforeDelete;
|
||||
@@ -260,17 +231,16 @@ describe('EPeopleRegistryComponent', () => {
|
||||
describe('delete EPerson button when the isAuthorized returns false', () => {
|
||||
let ePeopleDeleteButton;
|
||||
beforeEach(() => {
|
||||
authorizationService = jasmine.createSpyObj('authorizationService', {
|
||||
isAuthorized: observableOf(false)
|
||||
});
|
||||
spyOn(authorizationService, 'isAuthorized').and.returnValue(observableOf(false));
|
||||
component.initialisePage();
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should be disabled', () => {
|
||||
ePeopleDeleteButton = fixture.debugElement.queryAll(By.css('#epeople tr td div button.delete-button'));
|
||||
ePeopleDeleteButton.forEach((deleteButton) => {
|
||||
ePeopleDeleteButton.forEach((deleteButton: DebugElement) => {
|
||||
expect(deleteButton.nativeElement.disabled).toBe(true);
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||
import { FormBuilder } from '@angular/forms';
|
||||
import { UntypedFormBuilder } from '@angular/forms';
|
||||
import { Router } from '@angular/router';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { BehaviorSubject, combineLatest, Observable, Subscription } from 'rxjs';
|
||||
@@ -21,6 +21,8 @@ import { RequestService } from '../../core/data/request.service';
|
||||
import { PageInfo } from '../../core/shared/page-info.model';
|
||||
import { NoContent } from '../../core/shared/NoContent.model';
|
||||
import { PaginationService } from '../../core/pagination/pagination.service';
|
||||
import { DSONameService } from '../../core/breadcrumbs/dso-name.service';
|
||||
import { getEPersonEditRoute, getEPersonsRoute } from '../access-control-routing-paths';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-epeople-registry',
|
||||
@@ -63,11 +65,6 @@ export class EPeopleRegistryComponent implements OnInit, OnDestroy {
|
||||
currentPage: 1
|
||||
});
|
||||
|
||||
/**
|
||||
* Whether or not to show the EPerson form
|
||||
*/
|
||||
isEPersonFormShown: boolean;
|
||||
|
||||
// The search form
|
||||
searchForm;
|
||||
|
||||
@@ -89,11 +86,13 @@ export class EPeopleRegistryComponent implements OnInit, OnDestroy {
|
||||
private translateService: TranslateService,
|
||||
private notificationsService: NotificationsService,
|
||||
private authorizationService: AuthorizationDataService,
|
||||
private formBuilder: FormBuilder,
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private router: Router,
|
||||
private modalService: NgbModal,
|
||||
private paginationService: PaginationService,
|
||||
public requestService: RequestService) {
|
||||
public requestService: RequestService,
|
||||
public dsoNameService: DSONameService,
|
||||
) {
|
||||
this.currentSearchQuery = '';
|
||||
this.currentSearchScope = 'metadata';
|
||||
this.searchForm = this.formBuilder.group(({
|
||||
@@ -111,17 +110,11 @@ export class EPeopleRegistryComponent implements OnInit, OnDestroy {
|
||||
*/
|
||||
initialisePage() {
|
||||
this.searching$.next(true);
|
||||
this.isEPersonFormShown = false;
|
||||
this.search({scope: this.currentSearchScope, query: this.currentSearchQuery});
|
||||
this.subs.push(this.epersonService.getActiveEPerson().subscribe((eperson: EPerson) => {
|
||||
if (eperson != null && eperson.id) {
|
||||
this.isEPersonFormShown = true;
|
||||
}
|
||||
}));
|
||||
this.subs.push(this.ePeople$.pipe(
|
||||
switchMap((epeople: PaginatedList<EPerson>) => {
|
||||
if (epeople.pageInfo.totalElements > 0) {
|
||||
return combineLatest(...epeople.page.map((eperson) => {
|
||||
return combineLatest(epeople.page.map((eperson: EPerson) => {
|
||||
return this.authorizationService.isAuthorized(FeatureID.CanDelete, hasValue(eperson) ? eperson.self : undefined).pipe(
|
||||
map((authorized) => {
|
||||
const epersonDtoModel: EpersonDtoModel = new EpersonDtoModel();
|
||||
@@ -157,14 +150,14 @@ export class EPeopleRegistryComponent implements OnInit, OnDestroy {
|
||||
const query: string = data.query;
|
||||
const scope: string = data.scope;
|
||||
if (query != null && this.currentSearchQuery !== query) {
|
||||
this.router.navigate([this.epersonService.getEPeoplePageRouterLink()], {
|
||||
void this.router.navigate([getEPersonsRoute()], {
|
||||
queryParamsHandling: 'merge'
|
||||
});
|
||||
this.currentSearchQuery = query;
|
||||
this.paginationService.resetPage(this.config.id);
|
||||
}
|
||||
if (scope != null && this.currentSearchScope !== scope) {
|
||||
this.router.navigate([this.epersonService.getEPeoplePageRouterLink()], {
|
||||
void this.router.navigate([getEPersonsRoute()], {
|
||||
queryParamsHandling: 'merge'
|
||||
});
|
||||
this.currentSearchScope = scope;
|
||||
@@ -202,23 +195,6 @@ export class EPeopleRegistryComponent implements OnInit, OnDestroy {
|
||||
return this.epersonService.getActiveEPerson();
|
||||
}
|
||||
|
||||
/**
|
||||
* Start editing the selected EPerson
|
||||
* @param ePerson
|
||||
*/
|
||||
toggleEditEPerson(ePerson: EPerson) {
|
||||
this.getActiveEPerson().pipe(take(1)).subscribe((activeEPerson: EPerson) => {
|
||||
if (ePerson === activeEPerson) {
|
||||
this.epersonService.cancelEditEPerson();
|
||||
this.isEPersonFormShown = false;
|
||||
} else {
|
||||
this.epersonService.editEPerson(ePerson);
|
||||
this.isEPersonFormShown = true;
|
||||
}
|
||||
});
|
||||
this.scrollToTop();
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes EPerson, show notification on success/failure & updates EPeople list
|
||||
*/
|
||||
@@ -237,9 +213,9 @@ export class EPeopleRegistryComponent implements OnInit, OnDestroy {
|
||||
if (hasValue(ePerson.id)) {
|
||||
this.epersonService.deleteEPerson(ePerson).pipe(getFirstCompletedRemoteData()).subscribe((restResponse: RemoteData<NoContent>) => {
|
||||
if (restResponse.hasSucceeded) {
|
||||
this.notificationsService.success(this.translateService.get(this.labelPrefix + 'notification.deleted.success', {name: ePerson.name}));
|
||||
this.notificationsService.success(this.translateService.get(this.labelPrefix + 'notification.deleted.success', {name: this.dsoNameService.getName(ePerson)}));
|
||||
} else {
|
||||
this.notificationsService.error('Error occured when trying to delete EPerson with id: ' + ePerson.id + ' with code: ' + restResponse.statusCode + ' and message: ' + restResponse.errorMessage);
|
||||
this.notificationsService.error(this.translateService.get(this.labelPrefix + 'notification.deleted.success', { id: ePerson.id, statusCode: restResponse.statusCode, errorMessage: restResponse.errorMessage }));
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -261,16 +237,6 @@ export class EPeopleRegistryComponent implements OnInit, OnDestroy {
|
||||
this.subs.filter((sub) => hasValue(sub)).forEach((sub) => sub.unsubscribe());
|
||||
}
|
||||
|
||||
scrollToTop() {
|
||||
(function smoothscroll() {
|
||||
const currentScroll = document.documentElement.scrollTop || document.body.scrollTop;
|
||||
if (currentScroll > 0) {
|
||||
window.requestAnimationFrame(smoothscroll);
|
||||
window.scrollTo(0, currentScroll - (currentScroll / 8));
|
||||
}
|
||||
})();
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset all input-fields to be empty and search all search
|
||||
*/
|
||||
@@ -281,17 +247,7 @@ export class EPeopleRegistryComponent implements OnInit, OnDestroy {
|
||||
this.search({query: ''});
|
||||
}
|
||||
|
||||
/**
|
||||
* This method will set everything to stale, which will cause the lists on this page to update.
|
||||
*/
|
||||
reset() {
|
||||
this.epersonService.getBrowseEndpoint().pipe(
|
||||
take(1)
|
||||
).subscribe((href: string) => {
|
||||
this.requestService.setStaleByHrefSubstring(href).pipe(take(1)).subscribe(() => {
|
||||
this.epersonService.cancelEditEPerson();
|
||||
this.isEPersonFormShown = false;
|
||||
});
|
||||
});
|
||||
getEditEPeoplePage(id: string): string {
|
||||
return getEPersonEditRoute(id);
|
||||
}
|
||||
}
|
||||
|
@@ -1,84 +1,96 @@
|
||||
<div *ngIf="epersonService.getActiveEPerson() | async; then editheader; else createHeader"></div>
|
||||
<div class="container">
|
||||
<div class="group-form row">
|
||||
<div class="col-12">
|
||||
|
||||
<ng-template #createHeader>
|
||||
<h4>{{messagePrefix + '.create' | translate}}</h4>
|
||||
</ng-template>
|
||||
<div *ngIf="epersonService.getActiveEPerson() | async; then editHeader; else createHeader"></div>
|
||||
|
||||
<ng-template #editheader>
|
||||
<h4>{{messagePrefix + '.edit' | translate}}</h4>
|
||||
</ng-template>
|
||||
<ng-template #createHeader>
|
||||
<h1 class="border-bottom pb-2">{{messagePrefix + '.create' | translate}}</h1>
|
||||
</ng-template>
|
||||
|
||||
<ds-form [formId]="formId"
|
||||
[formModel]="formModel"
|
||||
[formGroup]="formGroup"
|
||||
[formLayout]="formLayout"
|
||||
[displayCancel]="false"
|
||||
(submitForm)="onSubmit()">
|
||||
<div before class="btn-group">
|
||||
<button (click)="onCancel()"
|
||||
class="btn btn-outline-secondary"><i class="fas fa-arrow-left"></i> {{messagePrefix + '.return' | translate}}</button>
|
||||
</div>
|
||||
<div between class="btn-group">
|
||||
<button class="btn btn-primary" [disabled]="!(canReset$ | async)" (click)="resetPassword()">
|
||||
<i class="fa fa-key"></i> {{'admin.access-control.epeople.actions.reset' | translate}}
|
||||
</button>
|
||||
</div>
|
||||
<div between class="btn-group ml-1">
|
||||
<button *ngIf="!isImpersonated" class="btn btn-primary" [ngClass]="{'d-none' : !(canImpersonate$ | async)}" (click)="impersonate()">
|
||||
<i class="fa fa-user-secret"></i> {{'admin.access-control.epeople.actions.impersonate' | translate}}
|
||||
</button>
|
||||
<button *ngIf="isImpersonated" class="btn btn-primary" (click)="stopImpersonating()">
|
||||
<i class="fa fa-user-secret"></i> {{'admin.access-control.epeople.actions.stop-impersonating' | translate}}
|
||||
</button>
|
||||
</div>
|
||||
<button after class="btn btn-danger delete-button" [disabled]="!(canDelete$ | async)" (click)="delete()">
|
||||
<i class="fas fa-trash"></i> {{'admin.access-control.epeople.actions.delete' | translate}}
|
||||
</button>
|
||||
</ds-form>
|
||||
<ng-template #editHeader>
|
||||
<h1 class="border-bottom pb-2">{{messagePrefix + '.edit' | translate}}</h1>
|
||||
</ng-template>
|
||||
|
||||
<ds-themed-loading [showMessage]="false" *ngIf="!formGroup"></ds-themed-loading>
|
||||
<ds-form [formId]="formId"
|
||||
[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" [disabled]="!(canReset$ | async)" type="button" (click)="resetPassword()">
|
||||
<i class="fa fa-key"></i> {{'admin.access-control.epeople.actions.reset' | 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>
|
||||
|
||||
<div *ngIf="epersonService.getActiveEPerson() | async">
|
||||
<h5>{{messagePrefix + '.groupsEPersonIsMemberOf' | translate}}</h5>
|
||||
<ds-themed-loading [showMessage]="false" *ngIf="!formGroup"></ds-themed-loading>
|
||||
|
||||
<ds-themed-loading [showMessage]="false" *ngIf="!(groups | async)"></ds-themed-loading>
|
||||
<div *ngIf="epersonService.getActiveEPerson() | async">
|
||||
<h2>{{messagePrefix + '.groupsEPersonIsMemberOf' | translate}}</h2>
|
||||
|
||||
<ds-pagination
|
||||
*ngIf="(groups | async)?.payload?.totalElements > 0"
|
||||
[paginationOptions]="config"
|
||||
[pageInfoState]="(groups | async)?.payload"
|
||||
[collectionSize]="(groups | async)?.payload?.totalElements"
|
||||
[hideGear]="true"
|
||||
[hidePagerWhenSinglePage]="true"
|
||||
(pageChange)="onPageChange($event)">
|
||||
<ds-themed-loading [showMessage]="false" *ngIf="!(groups | async)"></ds-themed-loading>
|
||||
|
||||
<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)]">{{group.name}}</a></td>
|
||||
<td class="align-middle">{{(group.object | async)?.payload?.name}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<ds-pagination
|
||||
*ngIf="(groups | async)?.payload?.totalElements > 0"
|
||||
[paginationOptions]="config"
|
||||
[collectionSize]="(groups | async)?.payload?.totalElements"
|
||||
[hideGear]="true"
|
||||
[hidePagerWhenSinglePage]="true"
|
||||
(pageChange)="onPageChange($event)">
|
||||
|
||||
</ds-pagination>
|
||||
<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(undefined) }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<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>
|
||||
</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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -2,7 +2,7 @@ import { Observable, of as observableOf } from 'rxjs';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms';
|
||||
import { UntypedFormControl, UntypedFormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms';
|
||||
import { BrowserModule, By } from '@angular/platform-browser';
|
||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||
@@ -31,6 +31,10 @@ import { PaginationServiceStub } from '../../../shared/testing/pagination-servic
|
||||
import { FindListOptions } from '../../../core/data/find-list-options.model';
|
||||
import { ValidateEmailNotTaken } from './validators/email-taken.validator';
|
||||
import { EpersonRegistrationService } from '../../../core/data/eperson-registration.service';
|
||||
import { FollowLinkConfig } from '../../../shared/utils/follow-link-config.model';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { RouterStub } from '../../../shared/testing/router.stub';
|
||||
import { ActivatedRouteStub } from '../../../shared/testing/active-router.stub';
|
||||
|
||||
describe('EPersonFormComponent', () => {
|
||||
let component: EPersonFormComponent;
|
||||
@@ -43,6 +47,8 @@ describe('EPersonFormComponent', () => {
|
||||
let authorizationService: AuthorizationDataService;
|
||||
let groupsDataService: GroupDataService;
|
||||
let epersonRegistrationService: EpersonRegistrationService;
|
||||
let route: ActivatedRouteStub;
|
||||
let router: RouterStub;
|
||||
|
||||
let paginationService;
|
||||
|
||||
@@ -106,6 +112,9 @@ describe('EPersonFormComponent', () => {
|
||||
},
|
||||
getEPersonByEmail(email): Observable<RemoteData<EPerson>> {
|
||||
return createSuccessfulRemoteDataObject$(null);
|
||||
},
|
||||
findById(_id: string, _useCachedVersionIfAvailable = true, _reRequestOnStale = true, ..._linksToFollow: FollowLinkConfig<EPerson>[]): Observable<RemoteData<EPerson>> {
|
||||
return createSuccessfulRemoteDataObject$(null);
|
||||
}
|
||||
};
|
||||
builderService = Object.assign(getMockFormBuilderService(),{
|
||||
@@ -116,9 +125,9 @@ describe('EPersonFormComponent', () => {
|
||||
const controlModel = model;
|
||||
const controlState = { value: controlModel.value, disabled: controlModel.disabled };
|
||||
const controlOptions = this.createAbstractControlOptions(controlModel.validators, controlModel.asyncValidators, controlModel.updateOn);
|
||||
controls[model.id] = new FormControl(controlState, controlOptions);
|
||||
controls[model.id] = new UntypedFormControl(controlState, controlOptions);
|
||||
});
|
||||
return new FormGroup(controls, options);
|
||||
return new UntypedFormGroup(controls, options);
|
||||
},
|
||||
createAbstractControlOptions(validatorsConfig = null, asyncValidatorsConfig = null, updateOn = null) {
|
||||
return {
|
||||
@@ -182,6 +191,8 @@ describe('EPersonFormComponent', () => {
|
||||
});
|
||||
|
||||
paginationService = new PaginationServiceStub();
|
||||
route = new ActivatedRouteStub();
|
||||
router = new RouterStub();
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule,
|
||||
TranslateModule.forRoot({
|
||||
@@ -202,6 +213,8 @@ describe('EPersonFormComponent', () => {
|
||||
{ provide: PaginationService, useValue: paginationService },
|
||||
{ provide: RequestService, useValue: jasmine.createSpyObj('requestService', ['removeByHrefSubstring'])},
|
||||
{ provide: EpersonRegistrationService, useValue: epersonRegistrationService },
|
||||
{ provide: ActivatedRoute, useValue: route },
|
||||
{ provide: Router, useValue: router },
|
||||
EPeopleRegistryComponent
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
@@ -263,24 +276,18 @@ describe('EPersonFormComponent', () => {
|
||||
fixture.detectChanges();
|
||||
});
|
||||
describe('firstName, lastName and email should be required', () => {
|
||||
it('form should be invalid because the firstName is required', waitForAsync(() => {
|
||||
fixture.whenStable().then(() => {
|
||||
expect(component.formGroup.controls.firstName.valid).toBeFalse();
|
||||
expect(component.formGroup.controls.firstName.errors.required).toBeTrue();
|
||||
});
|
||||
}));
|
||||
it('form should be invalid because the lastName is required', waitForAsync(() => {
|
||||
fixture.whenStable().then(() => {
|
||||
expect(component.formGroup.controls.lastName.valid).toBeFalse();
|
||||
expect(component.formGroup.controls.lastName.errors.required).toBeTrue();
|
||||
});
|
||||
}));
|
||||
it('form should be invalid because the email is required', waitForAsync(() => {
|
||||
fixture.whenStable().then(() => {
|
||||
expect(component.formGroup.controls.email.valid).toBeFalse();
|
||||
expect(component.formGroup.controls.email.errors.required).toBeTrue();
|
||||
});
|
||||
}));
|
||||
it('form should be invalid because the firstName is required', () => {
|
||||
expect(component.formGroup.controls.firstName.valid).toBeFalse();
|
||||
expect(component.formGroup.controls.firstName.errors.required).toBeTrue();
|
||||
});
|
||||
it('form should be invalid because the lastName is required', () => {
|
||||
expect(component.formGroup.controls.lastName.valid).toBeFalse();
|
||||
expect(component.formGroup.controls.lastName.errors.required).toBeTrue();
|
||||
});
|
||||
it('form should be invalid because the email is required', () => {
|
||||
expect(component.formGroup.controls.email.valid).toBeFalse();
|
||||
expect(component.formGroup.controls.email.errors.required).toBeTrue();
|
||||
});
|
||||
});
|
||||
|
||||
describe('after inserting information firstName,lastName and email not required', () => {
|
||||
@@ -290,24 +297,18 @@ describe('EPersonFormComponent', () => {
|
||||
component.formGroup.controls.email.setValue('test@test.com');
|
||||
fixture.detectChanges();
|
||||
});
|
||||
it('firstName should be valid because the firstName is set', waitForAsync(() => {
|
||||
fixture.whenStable().then(() => {
|
||||
it('firstName should be valid because the firstName is set', () => {
|
||||
expect(component.formGroup.controls.firstName.valid).toBeTrue();
|
||||
expect(component.formGroup.controls.firstName.errors).toBeNull();
|
||||
});
|
||||
}));
|
||||
it('lastName should be valid because the lastName is set', waitForAsync(() => {
|
||||
fixture.whenStable().then(() => {
|
||||
});
|
||||
it('lastName should be valid because the lastName is set', () => {
|
||||
expect(component.formGroup.controls.lastName.valid).toBeTrue();
|
||||
expect(component.formGroup.controls.lastName.errors).toBeNull();
|
||||
});
|
||||
}));
|
||||
it('email should be valid because the email is set', waitForAsync(() => {
|
||||
fixture.whenStable().then(() => {
|
||||
});
|
||||
it('email should be valid because the email is set', () => {
|
||||
expect(component.formGroup.controls.email.valid).toBeTrue();
|
||||
expect(component.formGroup.controls.email.errors).toBeNull();
|
||||
});
|
||||
}));
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -316,12 +317,10 @@ describe('EPersonFormComponent', () => {
|
||||
component.formGroup.controls.email.setValue('test@test');
|
||||
fixture.detectChanges();
|
||||
});
|
||||
it('email should not be valid because the email pattern', waitForAsync(() => {
|
||||
fixture.whenStable().then(() => {
|
||||
it('email should not be valid because the email pattern', () => {
|
||||
expect(component.formGroup.controls.email.valid).toBeFalse();
|
||||
expect(component.formGroup.controls.email.errors.pattern).toBeTruthy();
|
||||
});
|
||||
}));
|
||||
});
|
||||
});
|
||||
|
||||
describe('after already utilized email', () => {
|
||||
@@ -336,12 +335,10 @@ describe('EPersonFormComponent', () => {
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('email should not be valid because email is already taken', waitForAsync(() => {
|
||||
fixture.whenStable().then(() => {
|
||||
it('email should not be valid because email is already taken', () => {
|
||||
expect(component.formGroup.controls.email.valid).toBeFalse();
|
||||
expect(component.formGroup.controls.email.errors.emailTaken).toBeTruthy();
|
||||
});
|
||||
}));
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -393,11 +390,9 @@ describe('EPersonFormComponent', () => {
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should emit a new eperson using the correct values', waitForAsync(() => {
|
||||
fixture.whenStable().then(() => {
|
||||
expect(component.submitForm.emit).toHaveBeenCalledWith(expected);
|
||||
});
|
||||
}));
|
||||
it('should emit a new eperson using the correct values', () => {
|
||||
expect(component.submitForm.emit).toHaveBeenCalledWith(expected);
|
||||
});
|
||||
});
|
||||
|
||||
describe('with an active eperson', () => {
|
||||
@@ -428,11 +423,9 @@ describe('EPersonFormComponent', () => {
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should emit the existing eperson using the correct values', waitForAsync(() => {
|
||||
fixture.whenStable().then(() => {
|
||||
expect(component.submitForm.emit).toHaveBeenCalledWith(expectedWithId);
|
||||
});
|
||||
}));
|
||||
it('should emit the existing eperson using the correct values', () => {
|
||||
expect(component.submitForm.emit).toHaveBeenCalledWith(expectedWithId);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -491,16 +484,16 @@ describe('EPersonFormComponent', () => {
|
||||
|
||||
});
|
||||
|
||||
it('the delete button should be active if the eperson can be deleted', () => {
|
||||
it('the delete button should be visible if the ePerson can be deleted', () => {
|
||||
const deleteButton = fixture.debugElement.query(By.css('.delete-button'));
|
||||
expect(deleteButton.nativeElement.disabled).toBe(false);
|
||||
expect(deleteButton).not.toBeNull();
|
||||
});
|
||||
|
||||
it('the delete button should be disabled if the eperson cannot be deleted', () => {
|
||||
it('the delete button should be hidden if the ePerson cannot be deleted', () => {
|
||||
component.canDelete$ = observableOf(false);
|
||||
fixture.detectChanges();
|
||||
const deleteButton = fixture.debugElement.query(By.css('.delete-button'));
|
||||
expect(deleteButton.nativeElement.disabled).toBe(true);
|
||||
expect(deleteButton).toBeNull();
|
||||
});
|
||||
|
||||
it('should call the epersonFormComponent delete when clicked on the button', () => {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { ChangeDetectorRef, Component, EventEmitter, OnDestroy, OnInit, Output } from '@angular/core';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { UntypedFormGroup } from '@angular/forms';
|
||||
import {
|
||||
DynamicCheckboxModel,
|
||||
DynamicFormControlModel,
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
} from '@ng-dynamic-forms/core';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { combineLatest as observableCombineLatest, Observable, of as observableOf, Subscription } from 'rxjs';
|
||||
import { debounceTime, switchMap, take } from 'rxjs/operators';
|
||||
import { debounceTime, finalize, map, switchMap, take } from 'rxjs/operators';
|
||||
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
||||
import { RemoteData } from '../../../core/data/remote-data';
|
||||
import { EPersonDataService } from '../../../core/eperson/eperson-data.service';
|
||||
@@ -37,6 +37,9 @@ import { ValidateEmailNotTaken } from './validators/email-taken.validator';
|
||||
import { Registration } from '../../../core/shared/registration.model';
|
||||
import { EpersonRegistrationService } from '../../../core/data/eperson-registration.service';
|
||||
import { TYPE_REQUEST_FORGOT } from '../../../register-email-form/register-email-form.component';
|
||||
import { DSONameService } from '../../../core/breadcrumbs/dso-name.service';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { getEPersonsRoute } from '../../access-control-routing-paths';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-eperson-form',
|
||||
@@ -108,7 +111,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
||||
/**
|
||||
* A FormGroup that combines all inputs
|
||||
*/
|
||||
formGroup: FormGroup;
|
||||
formGroup: UntypedFormGroup;
|
||||
|
||||
/**
|
||||
* An EventEmitter that's fired whenever the form is being submitted
|
||||
@@ -165,6 +168,15 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
||||
*/
|
||||
isImpersonated = false;
|
||||
|
||||
/**
|
||||
* A boolean that indicate if to display EPersonForm's Rest password button
|
||||
*/
|
||||
displayResetPassword = false;
|
||||
|
||||
/**
|
||||
* A string that indicate the label of Submit button
|
||||
*/
|
||||
submitLabel = 'form.create';
|
||||
/**
|
||||
* Subscription to email field value change
|
||||
*/
|
||||
@@ -183,11 +195,16 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
||||
private paginationService: PaginationService,
|
||||
public requestService: RequestService,
|
||||
private epersonRegistrationService: EpersonRegistrationService,
|
||||
public dsoNameService: DSONameService,
|
||||
protected route: ActivatedRoute,
|
||||
protected router: Router,
|
||||
) {
|
||||
this.subs.push(this.epersonService.getActiveEPerson().subscribe((eperson: EPerson) => {
|
||||
this.epersonInitial = eperson;
|
||||
if (hasValue(eperson)) {
|
||||
this.isImpersonated = this.authService.isImpersonatingUser(eperson.id);
|
||||
this.displayResetPassword = true;
|
||||
this.submitLabel = 'form.submit';
|
||||
}
|
||||
}));
|
||||
}
|
||||
@@ -200,15 +217,17 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
||||
* This method will initialise the page
|
||||
*/
|
||||
initialisePage() {
|
||||
|
||||
observableCombineLatest(
|
||||
this.subs.push(this.epersonService.findById(this.route.snapshot.params.id).subscribe((ePersonRD: RemoteData<EPerson>) => {
|
||||
this.epersonService.editEPerson(ePersonRD.payload);
|
||||
}));
|
||||
observableCombineLatest([
|
||||
this.translateService.get(`${this.messagePrefix}.firstName`),
|
||||
this.translateService.get(`${this.messagePrefix}.lastName`),
|
||||
this.translateService.get(`${this.messagePrefix}.email`),
|
||||
this.translateService.get(`${this.messagePrefix}.canLogIn`),
|
||||
this.translateService.get(`${this.messagePrefix}.requireCertificate`),
|
||||
this.translateService.get(`${this.messagePrefix}.emailHint`),
|
||||
).subscribe(([firstName, lastName, email, canLogIn, requireCertificate, emailHint]) => {
|
||||
]).subscribe(([firstName, lastName, email, canLogIn, requireCertificate, emailHint]) => {
|
||||
this.firstName = new DynamicInputModel({
|
||||
id: 'firstName',
|
||||
label: firstName,
|
||||
@@ -326,6 +345,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
||||
onCancel() {
|
||||
this.epersonService.cancelEditEPerson();
|
||||
this.cancelForm.emit();
|
||||
void this.router.navigate([getEPersonsRoute()]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -375,10 +395,12 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
||||
getFirstCompletedRemoteData()
|
||||
).subscribe((rd: RemoteData<EPerson>) => {
|
||||
if (rd.hasSucceeded) {
|
||||
this.notificationsService.success(this.translateService.get(this.labelPrefix + 'notification.created.success', { name: ePersonToCreate.name }));
|
||||
this.notificationsService.success(this.translateService.get(this.labelPrefix + 'notification.created.success', { name: this.dsoNameService.getName(ePersonToCreate) }));
|
||||
this.submitForm.emit(ePersonToCreate);
|
||||
this.epersonService.clearEPersonRequests();
|
||||
void this.router.navigateByUrl(getEPersonsRoute());
|
||||
} else {
|
||||
this.notificationsService.error(this.translateService.get(this.labelPrefix + 'notification.created.failure', { name: ePersonToCreate.name }));
|
||||
this.notificationsService.error(this.translateService.get(this.labelPrefix + 'notification.created.failure', { name: this.dsoNameService.getName(ePersonToCreate) }));
|
||||
this.cancelForm.emit();
|
||||
}
|
||||
});
|
||||
@@ -414,10 +436,11 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
||||
const response = this.epersonService.updateEPerson(editedEperson);
|
||||
response.pipe(getFirstCompletedRemoteData()).subscribe((rd: RemoteData<EPerson>) => {
|
||||
if (rd.hasSucceeded) {
|
||||
this.notificationsService.success(this.translateService.get(this.labelPrefix + 'notification.edited.success', { name: editedEperson.name }));
|
||||
this.notificationsService.success(this.translateService.get(this.labelPrefix + 'notification.edited.success', { name: this.dsoNameService.getName(editedEperson) }));
|
||||
this.submitForm.emit(editedEperson);
|
||||
void this.router.navigateByUrl(getEPersonsRoute());
|
||||
} else {
|
||||
this.notificationsService.error(this.translateService.get(this.labelPrefix + 'notification.edited.failure', { name: editedEperson.name }));
|
||||
this.notificationsService.error(this.translateService.get(this.labelPrefix + 'notification.edited.failure', { name: this.dsoNameService.getName(editedEperson) }));
|
||||
this.cancelForm.emit();
|
||||
}
|
||||
});
|
||||
@@ -450,31 +473,43 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
||||
* Deletes the EPerson from the Repository. The EPerson will be the only that this form is showing.
|
||||
* It'll either show a success or error message depending on whether the delete was successful or not.
|
||||
*/
|
||||
delete() {
|
||||
this.epersonService.getActiveEPerson().pipe(take(1)).subscribe((eperson: EPerson) => {
|
||||
const modalRef = this.modalService.open(ConfirmationModalComponent);
|
||||
modalRef.componentInstance.dso = eperson;
|
||||
modalRef.componentInstance.headerLabel = 'confirmation-modal.delete-eperson.header';
|
||||
modalRef.componentInstance.infoLabel = 'confirmation-modal.delete-eperson.info';
|
||||
modalRef.componentInstance.cancelLabel = 'confirmation-modal.delete-eperson.cancel';
|
||||
modalRef.componentInstance.confirmLabel = 'confirmation-modal.delete-eperson.confirm';
|
||||
modalRef.componentInstance.brandColor = 'danger';
|
||||
modalRef.componentInstance.confirmIcon = 'fas fa-trash';
|
||||
modalRef.componentInstance.response.pipe(take(1)).subscribe((confirm: boolean) => {
|
||||
if (confirm) {
|
||||
if (hasValue(eperson.id)) {
|
||||
this.epersonService.deleteEPerson(eperson).pipe(getFirstCompletedRemoteData()).subscribe((restResponse: RemoteData<NoContent>) => {
|
||||
if (restResponse.hasSucceeded) {
|
||||
this.notificationsService.success(this.translateService.get(this.labelPrefix + 'notification.deleted.success', { name: eperson.name }));
|
||||
this.submitForm.emit();
|
||||
} else {
|
||||
this.notificationsService.error('Error occured when trying to delete EPerson with id: ' + eperson.id + ' with code: ' + restResponse.statusCode + ' and message: ' + restResponse.errorMessage);
|
||||
}
|
||||
this.cancelForm.emit();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
delete(): void {
|
||||
this.epersonService.getActiveEPerson().pipe(
|
||||
take(1),
|
||||
switchMap((eperson: EPerson) => {
|
||||
const modalRef = this.modalService.open(ConfirmationModalComponent);
|
||||
modalRef.componentInstance.dso = eperson;
|
||||
modalRef.componentInstance.headerLabel = 'confirmation-modal.delete-eperson.header';
|
||||
modalRef.componentInstance.infoLabel = 'confirmation-modal.delete-eperson.info';
|
||||
modalRef.componentInstance.cancelLabel = 'confirmation-modal.delete-eperson.cancel';
|
||||
modalRef.componentInstance.confirmLabel = 'confirmation-modal.delete-eperson.confirm';
|
||||
modalRef.componentInstance.brandColor = 'danger';
|
||||
modalRef.componentInstance.confirmIcon = 'fas fa-trash';
|
||||
|
||||
return modalRef.componentInstance.response.pipe(
|
||||
take(1),
|
||||
switchMap((confirm: boolean) => {
|
||||
if (confirm && hasValue(eperson.id)) {
|
||||
this.canDelete$ = observableOf(false);
|
||||
return this.epersonService.deleteEPerson(eperson).pipe(
|
||||
getFirstCompletedRemoteData(),
|
||||
map((restResponse: RemoteData<NoContent>) => ({ restResponse, eperson }))
|
||||
);
|
||||
} else {
|
||||
return observableOf(null);
|
||||
}
|
||||
}),
|
||||
finalize(() => this.canDelete$ = observableOf(true))
|
||||
);
|
||||
})
|
||||
).subscribe(({ restResponse, eperson }: { restResponse: RemoteData<NoContent> | null, eperson: EPerson }) => {
|
||||
if (restResponse?.hasSucceeded) {
|
||||
this.notificationsService.success(this.translateService.get(this.labelPrefix + 'notification.deleted.success', { name: this.dsoNameService.getName(eperson) }));
|
||||
void this.router.navigate([getEPersonsRoute()]);
|
||||
} else {
|
||||
this.notificationsService.error(`Error occurred when trying to delete EPerson with id: ${eperson?.id} with code: ${restResponse?.statusCode} and message: ${restResponse?.errorMessage}`);
|
||||
}
|
||||
this.cancelForm.emit();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -510,7 +545,6 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
||||
* Cancel the current edit when component is destroyed & unsub all subscriptions
|
||||
*/
|
||||
ngOnDestroy(): void {
|
||||
this.onCancel();
|
||||
this.subs.filter((sub) => hasValue(sub)).forEach((sub) => sub.unsubscribe());
|
||||
this.paginationService.clearPagination(this.config.id);
|
||||
if (hasValue(this.emailValueChangeSubscribe)) {
|
||||
@@ -518,16 +552,6 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method will ensure that the page gets reset and that the cache is cleared
|
||||
*/
|
||||
reset() {
|
||||
this.epersonService.getActiveEPerson().pipe(take(1)).subscribe((eperson: EPerson) => {
|
||||
this.requestService.removeByHrefSubstring(eperson.self);
|
||||
});
|
||||
this.initialisePage();
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks for the given ePerson if there is already an ePerson in the system with that email
|
||||
* and shows notification if this is the case
|
||||
@@ -543,7 +567,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
||||
.subscribe((list: PaginatedList<EPerson>) => {
|
||||
if (list.totalElements > 0) {
|
||||
this.notificationsService.error(this.translateService.get(this.labelPrefix + 'notification.' + notificationSection + '.failure.emailInUse', {
|
||||
name: ePerson.name,
|
||||
name: this.dsoNameService.getName(ePerson),
|
||||
email: ePerson.email
|
||||
}));
|
||||
}
|
||||
|
@@ -0,0 +1,53 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
|
||||
import { Observable } from 'rxjs';
|
||||
import { EPerson } from '../../core/eperson/models/eperson.model';
|
||||
import { RemoteData } from '../../core/data/remote-data';
|
||||
import { getFirstCompletedRemoteData } from '../../core/shared/operators';
|
||||
import { ResolvedAction } from '../../core/resolving/resolver.actions';
|
||||
import { EPersonDataService } from '../../core/eperson/eperson-data.service';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { followLink, FollowLinkConfig } from '../../shared/utils/follow-link-config.model';
|
||||
|
||||
export const EPERSON_EDIT_FOLLOW_LINKS: FollowLinkConfig<EPerson>[] = [
|
||||
followLink('groups'),
|
||||
];
|
||||
|
||||
/**
|
||||
* This class represents a resolver that requests a specific {@link EPerson} before the route is activated
|
||||
*/
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class EPersonResolver implements Resolve<RemoteData<EPerson>> {
|
||||
|
||||
constructor(
|
||||
protected ePersonService: EPersonDataService,
|
||||
protected store: Store<any>,
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Method for resolving a {@link EPerson} based on the parameters in the current route
|
||||
* @param {ActivatedRouteSnapshot} route The current ActivatedRouteSnapshot
|
||||
* @param {RouterStateSnapshot} state The current RouterStateSnapshot
|
||||
* @returns `Observable<<RemoteData<EPerson>>` Emits the found {@link EPerson} based on the parameters in the current
|
||||
* route, or an error if something went wrong
|
||||
*/
|
||||
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<RemoteData<EPerson>> {
|
||||
const ePersonRD$: Observable<RemoteData<EPerson>> = this.ePersonService.findById(route.params.id,
|
||||
true,
|
||||
false,
|
||||
...EPERSON_EDIT_FOLLOW_LINKS,
|
||||
).pipe(
|
||||
getFirstCompletedRemoteData(),
|
||||
);
|
||||
|
||||
ePersonRD$.subscribe((ePersonRD: RemoteData<EPerson>) => {
|
||||
this.store.dispatch(new ResolvedAction(state.url, ePersonRD.payload));
|
||||
});
|
||||
|
||||
return ePersonRD$;
|
||||
}
|
||||
|
||||
}
|
@@ -2,14 +2,14 @@
|
||||
<div class="group-form row">
|
||||
<div class="col-12">
|
||||
|
||||
<div *ngIf="groupDataService.getActiveGroup() | async; then editheader; else createHeader"></div>
|
||||
<div *ngIf="groupDataService.getActiveGroup() | async; then editHeader; else createHeader"></div>
|
||||
|
||||
<ng-template #createHeader>
|
||||
<h2 class="border-bottom pb-2">{{messagePrefix + '.head.create' | translate}}</h2>
|
||||
<h1 class="border-bottom pb-2">{{messagePrefix + '.head.create' | translate}}</h1>
|
||||
</ng-template>
|
||||
|
||||
<ng-template #editheader>
|
||||
<h2 class="border-bottom pb-2">
|
||||
<ng-template #editHeader>
|
||||
<h1 class="border-bottom pb-2">
|
||||
<span
|
||||
*dsContextHelp="{
|
||||
content: 'admin.access-control.groups.form.tooltip.editGroupPage',
|
||||
@@ -20,13 +20,13 @@
|
||||
>
|
||||
{{messagePrefix + '.head.edit' | translate}}
|
||||
</span>
|
||||
</h2>
|
||||
</h1>
|
||||
</ng-template>
|
||||
|
||||
<ds-alert *ngIf="groupBeingEdited?.permanent" [type]="AlertTypeEnum.Warning"
|
||||
[content]="messagePrefix + '.alert.permanent'"></ds-alert>
|
||||
<ds-alert *ngIf="!(canEdit$ | async) && (groupDataService.getActiveGroup() | async)" [type]="AlertTypeEnum.Warning"
|
||||
[content]="(messagePrefix + '.alert.workflowGroup' | translate:{ name: (getLinkedDSO(groupBeingEdited) | async)?.payload?.name, comcol: (getLinkedDSO(groupBeingEdited) | async)?.payload?.type, comcolEditRolesRoute: (getLinkedEditRolesRoute(groupBeingEdited) | async) })">
|
||||
[content]="(messagePrefix + '.alert.workflowGroup' | translate:{ name: dsoNameService.getName((getLinkedDSO(groupBeingEdited) | async)?.payload), comcol: (getLinkedDSO(groupBeingEdited) | async)?.payload?.type, comcolEditRolesRoute: (getLinkedEditRolesRoute(groupBeingEdited) | async) })">
|
||||
</ds-alert>
|
||||
|
||||
<ds-form [formId]="formId"
|
||||
@@ -36,12 +36,11 @@
|
||||
[displayCancel]="false"
|
||||
(submitForm)="onSubmit()">
|
||||
<div before class="btn-group">
|
||||
<button (click)="onCancel()"
|
||||
<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="groupBeingEdited != null" class="btn-group">
|
||||
<button class="btn btn-danger delete-button" [disabled]="!(canEdit$ | async) || groupBeingEdited.permanent"
|
||||
(click)="delete()">
|
||||
<div after *ngIf="(canEdit$ | async) && !groupBeingEdited?.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>
|
||||
|
@@ -2,7 +2,7 @@ import { CommonModule } from '@angular/common';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms';
|
||||
import { UntypedFormControl, UntypedFormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms';
|
||||
import { BrowserModule, By } from '@angular/platform-browser';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
@@ -23,6 +23,7 @@ import { DSpaceObject } from '../../../core/shared/dspace-object.model';
|
||||
import { HALEndpointService } from '../../../core/shared/hal-endpoint.service';
|
||||
import { PageInfo } from '../../../core/shared/page-info.model';
|
||||
import { UUIDService } from '../../../core/shared/uuid.service';
|
||||
import { XSRFService } from '../../../core/xsrf/xsrf.service';
|
||||
import { FormBuilderService } from '../../../shared/form/builder/form-builder.service';
|
||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||
import { GroupMock, GroupMock2 } from '../../../shared/testing/group-mock';
|
||||
@@ -36,6 +37,8 @@ import { NotificationsServiceStub } from '../../../shared/testing/notifications-
|
||||
import { Operation } from 'fast-json-patch';
|
||||
import { ValidateGroupExists } from './validators/group-exists.validator';
|
||||
import { NoContent } from '../../../core/shared/NoContent.model';
|
||||
import { DSONameService } from '../../../core/breadcrumbs/dso-name.service';
|
||||
import { DSONameServiceMock } from '../../../shared/mocks/dso-name.service.mock';
|
||||
|
||||
describe('GroupFormComponent', () => {
|
||||
let component: GroupFormComponent;
|
||||
@@ -130,9 +133,9 @@ describe('GroupFormComponent', () => {
|
||||
const controlModel = model;
|
||||
const controlState = { value: controlModel.value, disabled: controlModel.disabled };
|
||||
const controlOptions = this.createAbstractControlOptions(controlModel.validators, controlModel.asyncValidators, controlModel.updateOn);
|
||||
controls[model.id] = new FormControl(controlState, controlOptions);
|
||||
controls[model.id] = new UntypedFormControl(controlState, controlOptions);
|
||||
});
|
||||
return new FormGroup(controls, options);
|
||||
return new UntypedFormGroup(controls, options);
|
||||
},
|
||||
createAbstractControlOptions(validatorsConfig = null, asyncValidatorsConfig = null, updateOn = null) {
|
||||
return {
|
||||
@@ -188,7 +191,7 @@ describe('GroupFormComponent', () => {
|
||||
translateService = getMockTranslateService();
|
||||
router = new RouterMock();
|
||||
notificationService = new NotificationsServiceStub();
|
||||
TestBed.configureTestingModule({
|
||||
return TestBed.configureTestingModule({
|
||||
imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule,
|
||||
TranslateModule.forRoot({
|
||||
loader: {
|
||||
@@ -198,7 +201,8 @@ describe('GroupFormComponent', () => {
|
||||
}),
|
||||
],
|
||||
declarations: [GroupFormComponent],
|
||||
providers: [GroupFormComponent,
|
||||
providers: [
|
||||
{ provide: DSONameService, useValue: new DSONameServiceMock() },
|
||||
{ provide: EPersonDataService, useValue: ePersonDataServiceStub },
|
||||
{ provide: GroupDataService, useValue: groupsDataServiceStub },
|
||||
{ provide: DSpaceObjectDataService, useValue: dsoDataServiceStub },
|
||||
@@ -208,6 +212,7 @@ describe('GroupFormComponent', () => {
|
||||
{ provide: HttpClient, useValue: {} },
|
||||
{ provide: ObjectCacheService, useValue: {} },
|
||||
{ provide: UUIDService, useValue: {} },
|
||||
{ provide: XSRFService, useValue: {} },
|
||||
{ provide: Store, useValue: {} },
|
||||
{ provide: RemoteDataBuildService, useValue: {} },
|
||||
{ provide: HALEndpointService, useValue: {} },
|
||||
@@ -240,8 +245,8 @@ describe('GroupFormComponent', () => {
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should emit a new group using the correct values', waitForAsync(() => {
|
||||
fixture.whenStable().then(() => {
|
||||
it('should emit a new group using the correct values', (async () => {
|
||||
await fixture.whenStable().then(() => {
|
||||
expect(component.submitForm.emit).toHaveBeenCalledWith(expected);
|
||||
});
|
||||
}));
|
||||
@@ -303,8 +308,8 @@ describe('GroupFormComponent', () => {
|
||||
expect(groupsDataServiceStub.patch).toHaveBeenCalledWith(expected, operations);
|
||||
});
|
||||
|
||||
it('should emit the existing group using the correct new values', waitForAsync(() => {
|
||||
fixture.whenStable().then(() => {
|
||||
it('should emit the existing group using the correct new values', (async () => {
|
||||
await fixture.whenStable().then(() => {
|
||||
expect(component.submitForm.emit).toHaveBeenCalledWith(expected2);
|
||||
});
|
||||
}));
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { Component, EventEmitter, HostListener, OnDestroy, OnInit, Output, ChangeDetectorRef } from '@angular/core';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { UntypedFormGroup } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import {
|
||||
@@ -10,7 +10,6 @@ import {
|
||||
} from '@ng-dynamic-forms/core';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import {
|
||||
ObservedValueOf,
|
||||
combineLatest as observableCombineLatest,
|
||||
Observable,
|
||||
of as observableOf,
|
||||
@@ -37,7 +36,7 @@ import {
|
||||
getFirstCompletedRemoteData,
|
||||
getFirstSucceededRemoteDataPayload
|
||||
} from '../../../core/shared/operators';
|
||||
import { AlertType } from '../../../shared/alert/aletr-type';
|
||||
import { AlertType } from '../../../shared/alert/alert-type';
|
||||
import { ConfirmationModalComponent } from '../../../shared/confirmation-modal/confirmation-modal.component';
|
||||
import { hasValue, isNotEmpty, hasValueOperator } from '../../../shared/empty.util';
|
||||
import { FormBuilderService } from '../../../shared/form/builder/form-builder.service';
|
||||
@@ -46,7 +45,9 @@ import { followLink } from '../../../shared/utils/follow-link-config.model';
|
||||
import { NoContent } from '../../../core/shared/NoContent.model';
|
||||
import { Operation } from 'fast-json-patch';
|
||||
import { ValidateGroupExists } from './validators/group-exists.validator';
|
||||
import { DSONameService } from '../../../core/breadcrumbs/dso-name.service';
|
||||
import { environment } from '../../../../environments/environment';
|
||||
import { getGroupEditRoute, getGroupsRoute } from '../../access-control-routing-paths';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-group-form',
|
||||
@@ -95,7 +96,7 @@ export class GroupFormComponent implements OnInit, OnDestroy {
|
||||
/**
|
||||
* A FormGroup that combines all inputs
|
||||
*/
|
||||
formGroup: FormGroup;
|
||||
formGroup: UntypedFormGroup;
|
||||
|
||||
/**
|
||||
* An EventEmitter that's fired whenever the form is being submitted
|
||||
@@ -134,7 +135,8 @@ export class GroupFormComponent implements OnInit, OnDestroy {
|
||||
groupNameValueChangeSubscribe: Subscription;
|
||||
|
||||
|
||||
constructor(public groupDataService: GroupDataService,
|
||||
constructor(
|
||||
public groupDataService: GroupDataService,
|
||||
private ePersonDataService: EPersonDataService,
|
||||
private dSpaceObjectDataService: DSpaceObjectDataService,
|
||||
private formBuilderService: FormBuilderService,
|
||||
@@ -145,7 +147,9 @@ export class GroupFormComponent implements OnInit, OnDestroy {
|
||||
private authorizationService: AuthorizationDataService,
|
||||
private modalService: NgbModal,
|
||||
public requestService: RequestService,
|
||||
protected changeDetectorRef: ChangeDetectorRef) {
|
||||
protected changeDetectorRef: ChangeDetectorRef,
|
||||
public dsoNameService: DSONameService,
|
||||
) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -161,19 +165,19 @@ export class GroupFormComponent implements OnInit, OnDestroy {
|
||||
this.canEdit$ = this.groupDataService.getActiveGroup().pipe(
|
||||
hasValueOperator(),
|
||||
switchMap((group: Group) => {
|
||||
return observableCombineLatest(
|
||||
return observableCombineLatest([
|
||||
this.authorizationService.isAuthorized(FeatureID.CanDelete, isNotEmpty(group) ? group.self : undefined),
|
||||
this.hasLinkedDSO(group),
|
||||
(isAuthorized: ObservedValueOf<Observable<boolean>>, hasLinkedDSO: ObservedValueOf<Observable<boolean>>) => {
|
||||
return isAuthorized && !hasLinkedDSO;
|
||||
});
|
||||
})
|
||||
]).pipe(
|
||||
map(([isAuthorized, hasLinkedDSO]: [boolean, boolean]) => isAuthorized && !hasLinkedDSO),
|
||||
);
|
||||
}),
|
||||
);
|
||||
observableCombineLatest(
|
||||
observableCombineLatest([
|
||||
this.translateService.get(`${this.messagePrefix}.groupName`),
|
||||
this.translateService.get(`${this.messagePrefix}.groupCommunity`),
|
||||
this.translateService.get(`${this.messagePrefix}.groupDescription`)
|
||||
).subscribe(([groupName, groupCommunity, groupDescription]) => {
|
||||
]).subscribe(([groupName, groupCommunity, groupDescription]) => {
|
||||
this.groupName = new DynamicInputModel({
|
||||
id: 'groupName',
|
||||
label: groupName,
|
||||
@@ -211,12 +215,12 @@ export class GroupFormComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
this.subs.push(
|
||||
observableCombineLatest(
|
||||
observableCombineLatest([
|
||||
this.groupDataService.getActiveGroup(),
|
||||
this.canEdit$,
|
||||
this.groupDataService.getActiveGroup()
|
||||
.pipe(filter((activeGroup) => hasValue(activeGroup)),switchMap((activeGroup) => this.getLinkedDSO(activeGroup).pipe(getFirstSucceededRemoteDataPayload())))
|
||||
).subscribe(([activeGroup, canEdit, linkedObject]) => {
|
||||
]).subscribe(([activeGroup, canEdit, linkedObject]) => {
|
||||
|
||||
if (activeGroup != null) {
|
||||
|
||||
@@ -226,12 +230,14 @@ export class GroupFormComponent implements OnInit, OnDestroy {
|
||||
this.groupBeingEdited = activeGroup;
|
||||
|
||||
if (linkedObject?.name) {
|
||||
this.formBuilderService.insertFormGroupControl(1, this.formGroup, this.formModel, this.groupCommunity);
|
||||
this.formGroup.patchValue({
|
||||
groupName: activeGroup.name,
|
||||
groupCommunity: linkedObject?.name ?? '',
|
||||
groupDescription: activeGroup.firstMetadataValue('dc.description'),
|
||||
});
|
||||
if (!this.formGroup.controls.groupCommunity) {
|
||||
this.formBuilderService.insertFormGroupControl(1, this.formGroup, this.formModel, this.groupCommunity);
|
||||
this.formGroup.patchValue({
|
||||
groupName: activeGroup.name,
|
||||
groupCommunity: linkedObject?.name ?? '',
|
||||
groupDescription: activeGroup.firstMetadataValue('dc.description'),
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.formModel = [
|
||||
this.groupName,
|
||||
@@ -259,7 +265,7 @@ export class GroupFormComponent implements OnInit, OnDestroy {
|
||||
onCancel() {
|
||||
this.groupDataService.cancelEditGroup();
|
||||
this.cancelForm.emit();
|
||||
this.router.navigate([this.groupDataService.getGroupRegistryRouterLink()]);
|
||||
void this.router.navigate([getGroupsRoute()]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -306,7 +312,7 @@ export class GroupFormComponent implements OnInit, OnDestroy {
|
||||
const groupSelfLink = rd.payload._links.self.href;
|
||||
this.setActiveGroupWithLink(groupSelfLink);
|
||||
this.groupDataService.clearGroupsRequests();
|
||||
this.router.navigateByUrl(this.groupDataService.getGroupEditPageRouterLinkWithID(rd.payload.uuid));
|
||||
void this.router.navigateByUrl(getGroupEditRoute(rd.payload.uuid));
|
||||
}
|
||||
} else {
|
||||
this.notificationsService.error(this.translateService.get(this.messagePrefix + '.notification.created.failure', { name: groupToCreate.name }));
|
||||
@@ -331,7 +337,7 @@ export class GroupFormComponent implements OnInit, OnDestroy {
|
||||
.subscribe((list: PaginatedList<Group>) => {
|
||||
if (list.totalElements > 0) {
|
||||
this.notificationsService.error(this.translateService.get(this.messagePrefix + '.notification.' + notificationSection + '.failure.groupNameInUse', {
|
||||
name: group.name
|
||||
name: this.dsoNameService.getName(group),
|
||||
}));
|
||||
}
|
||||
}));
|
||||
@@ -364,10 +370,10 @@ export class GroupFormComponent implements OnInit, OnDestroy {
|
||||
getFirstCompletedRemoteData()
|
||||
).subscribe((rd: RemoteData<Group>) => {
|
||||
if (rd.hasSucceeded) {
|
||||
this.notificationsService.success(this.translateService.get(this.messagePrefix + '.notification.edited.success', { name: rd.payload.name }));
|
||||
this.notificationsService.success(this.translateService.get(this.messagePrefix + '.notification.edited.success', { name: this.dsoNameService.getName(rd.payload) }));
|
||||
this.submitForm.emit(rd.payload);
|
||||
} else {
|
||||
this.notificationsService.error(this.translateService.get(this.messagePrefix + '.notification.edited.failure', { name: group.name }));
|
||||
this.notificationsService.error(this.translateService.get(this.messagePrefix + '.notification.edited.failure', { name: this.dsoNameService.getName(group) }));
|
||||
this.cancelForm.emit();
|
||||
}
|
||||
});
|
||||
@@ -427,11 +433,11 @@ export class GroupFormComponent implements OnInit, OnDestroy {
|
||||
this.groupDataService.delete(group.id).pipe(getFirstCompletedRemoteData())
|
||||
.subscribe((rd: RemoteData<NoContent>) => {
|
||||
if (rd.hasSucceeded) {
|
||||
this.notificationsService.success(this.translateService.get(this.messagePrefix + '.notification.deleted.success', { name: group.name }));
|
||||
this.notificationsService.success(this.translateService.get(this.messagePrefix + '.notification.deleted.success', { name: this.dsoNameService.getName(group) }));
|
||||
this.onCancel();
|
||||
} else {
|
||||
this.notificationsService.error(
|
||||
this.translateService.get(this.messagePrefix + '.notification.deleted.failure.title', { name: group.name }),
|
||||
this.translateService.get(this.messagePrefix + '.notification.deleted.failure.title', { name: this.dsoNameService.getName(group) }),
|
||||
this.translateService.get(this.messagePrefix + '.notification.deleted.failure.content', { cause: rd.errorMessage }));
|
||||
}
|
||||
});
|
||||
|
@@ -1,106 +1,11 @@
|
||||
<ng-container>
|
||||
<h3 class="border-bottom pb-2">{{messagePrefix + '.head' | translate}}</h3>
|
||||
<h2 class="border-bottom pb-2">{{messagePrefix + '.head' | translate}}</h2>
|
||||
|
||||
<h4 id="search" class="border-bottom pb-2">
|
||||
<span
|
||||
*dsContextHelp="{
|
||||
content: 'admin.access-control.groups.form.tooltip.editGroup.addEpeople',
|
||||
id: 'edit-group-add-epeople',
|
||||
iconPlacement: 'right',
|
||||
tooltipPlacement: ['top', 'right', 'bottom']
|
||||
}"
|
||||
>
|
||||
{{messagePrefix + '.search.head' | translate}}
|
||||
</span>
|
||||
</h4>
|
||||
<h3>{{messagePrefix + '.headMembers' | translate}}</h3>
|
||||
|
||||
<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">
|
||||
<option value="metadata">{{messagePrefix + '.search.scope.metadata' | translate}}</option>
|
||||
<option value="email">{{messagePrefix + '.search.scope.email' | translate}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="flex-grow-1 mr-3 ml-3">
|
||||
<div class="form-group input-group">
|
||||
<input type="text" name="query" id="query" formControlName="query"
|
||||
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>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<button (click)="clearFormAndResetResult();"
|
||||
class="btn btn-secondary">{{messagePrefix + '.button.see-all' | translate}}</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<ds-pagination *ngIf="(ePeopleSearchDtos | async)?.totalElements > 0"
|
||||
[paginationOptions]="configSearch"
|
||||
[pageInfoState]="(ePeopleSearchDtos | async)"
|
||||
[collectionSize]="(ePeopleSearchDtos | 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>
|
||||
<tr *ngFor="let ePerson of (ePeopleSearchDtos | async)?.page">
|
||||
<td class="align-middle">{{ePerson.eperson.id}}</td>
|
||||
<td class="align-middle"><a (click)="ePersonDataService.startEditingNewEPerson(ePerson.eperson)"
|
||||
[routerLink]="[ePersonDataService.getEPeoplePageRouterLink()]">{{ePerson.eperson.name}}</a></td>
|
||||
<td class="align-middle">
|
||||
{{messagePrefix + '.table.email' | translate}}: {{ ePerson.eperson.email ? ePerson.eperson.email : '-' }}<br/>
|
||||
{{messagePrefix + '.table.netid' | translate}}: {{ ePerson.eperson.netid ? ePerson.eperson.netid : '-' }}
|
||||
</td>
|
||||
<td class="align-middle">
|
||||
<div class="btn-group edit-field">
|
||||
<button *ngIf="ePerson.memberOfGroup"
|
||||
(click)="deleteMemberFromGroup(ePerson)"
|
||||
[disabled]="actionConfig.remove.disabled"
|
||||
[ngClass]="['btn btn-sm', actionConfig.remove.css]"
|
||||
title="{{messagePrefix + '.table.edit.buttons.remove' | translate: {name: ePerson.eperson.name} }}">
|
||||
<i [ngClass]="actionConfig.remove.icon"></i>
|
||||
</button>
|
||||
|
||||
<button *ngIf="!ePerson.memberOfGroup"
|
||||
(click)="addMemberToGroup(ePerson)"
|
||||
[disabled]="actionConfig.add.disabled"
|
||||
[ngClass]="['btn btn-sm', actionConfig.add.css]"
|
||||
title="{{messagePrefix + '.table.edit.buttons.add' | translate: {name: ePerson.eperson.name} }}">
|
||||
<i [ngClass]="actionConfig.add.icon"></i>
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</ds-pagination>
|
||||
|
||||
<div *ngIf="(ePeopleSearchDtos | async)?.totalElements == 0 && searchDone"
|
||||
class="alert alert-info w-100 mb-2"
|
||||
role="alert">
|
||||
{{messagePrefix + '.no-items' | translate}}
|
||||
</div>
|
||||
|
||||
<h4>{{messagePrefix + '.headMembers' | translate}}</h4>
|
||||
|
||||
<ds-pagination *ngIf="(ePeopleMembersOfGroupDtos | async)?.totalElements > 0"
|
||||
<ds-pagination *ngIf="(ePeopleMembersOfGroup | async)?.totalElements > 0"
|
||||
[paginationOptions]="config"
|
||||
[pageInfoState]="(ePeopleMembersOfGroupDtos | async)"
|
||||
[collectionSize]="(ePeopleMembersOfGroupDtos | async)?.totalElements"
|
||||
[collectionSize]="(ePeopleMembersOfGroup | async)?.totalElements"
|
||||
[hideGear]="true"
|
||||
[hidePagerWhenSinglePage]="true">
|
||||
|
||||
@@ -115,28 +20,103 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let ePerson of (ePeopleMembersOfGroupDtos | async)?.page">
|
||||
<td class="align-middle">{{ePerson.eperson.id}}</td>
|
||||
<td class="align-middle"><a (click)="ePersonDataService.startEditingNewEPerson(ePerson.eperson)"
|
||||
[routerLink]="[ePersonDataService.getEPeoplePageRouterLink()]">{{ePerson.eperson.name}}</a></td>
|
||||
<tr *ngFor="let eperson of (ePeopleMembersOfGroup | async)?.page">
|
||||
<td class="align-middle">{{eperson.id}}</td>
|
||||
<td class="align-middle">
|
||||
{{messagePrefix + '.table.email' | translate}}: {{ ePerson.eperson.email ? ePerson.eperson.email : '-' }}<br/>
|
||||
{{messagePrefix + '.table.netid' | translate}}: {{ ePerson.eperson.netid ? ePerson.eperson.netid : '-' }}
|
||||
<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 *ngIf="ePerson.memberOfGroup"
|
||||
(click)="deleteMemberFromGroup(ePerson)"
|
||||
<button (click)="deleteMemberFromGroup(eperson)"
|
||||
[disabled]="actionConfig.remove.disabled"
|
||||
[ngClass]="['btn btn-sm', actionConfig.remove.css]"
|
||||
title="{{messagePrefix + '.table.edit.buttons.remove' | translate: {name: ePerson.eperson.name} }}">
|
||||
title="{{messagePrefix + '.table.edit.buttons.remove' | translate: { name: dsoNameService.getName(eperson) } }}">
|
||||
<i [ngClass]="actionConfig.remove.icon"></i>
|
||||
</button>
|
||||
<button *ngIf="!ePerson.memberOfGroup"
|
||||
(click)="addMemberToGroup(ePerson)"
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</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
|
||||
*dsContextHelp="{
|
||||
content: 'admin.access-control.groups.form.tooltip.editGroup.addEpeople',
|
||||
id: 'edit-group-add-epeople',
|
||||
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">
|
||||
<input type="text" name="query" id="query" formControlName="query"
|
||||
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>
|
||||
</div>
|
||||
</div>
|
||||
<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">
|
||||
|
||||
<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)"
|
||||
[disabled]="actionConfig.add.disabled"
|
||||
[ngClass]="['btn btn-sm', actionConfig.add.css]"
|
||||
title="{{messagePrefix + '.table.edit.buttons.add' | translate: {name: ePerson.eperson.name} }}">
|
||||
title="{{messagePrefix + '.table.edit.buttons.add' | translate: { name: dsoNameService.getName(eperson) } }}">
|
||||
<i [ngClass]="actionConfig.add.icon"></i>
|
||||
</button>
|
||||
</div>
|
||||
@@ -148,9 +128,10 @@
|
||||
|
||||
</ds-pagination>
|
||||
|
||||
<div *ngIf="(ePeopleMembersOfGroupDtos | async) == undefined || (ePeopleMembersOfGroupDtos | async)?.totalElements == 0" class="alert alert-info w-100 mb-2"
|
||||
<div *ngIf="(ePeopleSearch | async)?.totalElements == 0 && searchDone"
|
||||
class="alert alert-info w-100 mb-2"
|
||||
role="alert">
|
||||
{{messagePrefix + '.no-members-yet' | translate}}
|
||||
{{messagePrefix + '.no-items' | translate}}
|
||||
</div>
|
||||
|
||||
</ng-container>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { DebugElement, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { ComponentFixture, fakeAsync, flush, inject, TestBed, tick, waitForAsync } from '@angular/core/testing';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { BrowserModule, By } from '@angular/platform-browser';
|
||||
@@ -17,7 +17,7 @@ import { Group } from '../../../../core/eperson/models/group.model';
|
||||
import { PageInfo } from '../../../../core/shared/page-info.model';
|
||||
import { FormBuilderService } from '../../../../shared/form/builder/form-builder.service';
|
||||
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
||||
import { GroupMock, GroupMock2 } from '../../../../shared/testing/group-mock';
|
||||
import { GroupMock } from '../../../../shared/testing/group-mock';
|
||||
import { MembersListComponent } from './members-list.component';
|
||||
import { EPersonMock, EPersonMock2 } from '../../../../shared/testing/eperson.mock';
|
||||
import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils';
|
||||
@@ -28,6 +28,8 @@ import { NotificationsServiceStub } from '../../../../shared/testing/notificatio
|
||||
import { RouterMock } from '../../../../shared/mocks/router.mock';
|
||||
import { PaginationService } from '../../../../core/pagination/pagination.service';
|
||||
import { PaginationServiceStub } from '../../../../shared/testing/pagination-service.stub';
|
||||
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
||||
import { DSONameServiceMock } from '../../../../shared/mocks/dso-name.service.mock';
|
||||
|
||||
describe('MembersListComponent', () => {
|
||||
let component: MembersListComponent;
|
||||
@@ -37,28 +39,26 @@ describe('MembersListComponent', () => {
|
||||
let ePersonDataServiceStub: any;
|
||||
let groupsDataServiceStub: any;
|
||||
let activeGroup;
|
||||
let allEPersons;
|
||||
let allGroups;
|
||||
let epersonMembers;
|
||||
let subgroupMembers;
|
||||
let epersonMembers: EPerson[];
|
||||
let epersonNonMembers: EPerson[];
|
||||
let paginationService;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
activeGroup = GroupMock;
|
||||
epersonMembers = [EPersonMock2];
|
||||
subgroupMembers = [GroupMock2];
|
||||
allEPersons = [EPersonMock, EPersonMock2];
|
||||
allGroups = [GroupMock, GroupMock2];
|
||||
epersonNonMembers = [EPersonMock];
|
||||
ePersonDataServiceStub = {
|
||||
activeGroup: activeGroup,
|
||||
epersonMembers: epersonMembers,
|
||||
subgroupMembers: subgroupMembers,
|
||||
findListByHref(href: string): Observable<RemoteData<PaginatedList<EPerson>>> {
|
||||
epersonNonMembers: epersonNonMembers,
|
||||
// This method is used to get all the current members
|
||||
findListByHref(_href: string): Observable<RemoteData<PaginatedList<EPerson>>> {
|
||||
return createSuccessfulRemoteDataObject$(buildPaginatedList<EPerson>(new PageInfo(), groupsDataServiceStub.getEPersonMembers()));
|
||||
},
|
||||
searchByScope(scope: string, query: string): Observable<RemoteData<PaginatedList<EPerson>>> {
|
||||
// This method is used to search across *non-members*
|
||||
searchNonMembers(query: string, group: string): Observable<RemoteData<PaginatedList<EPerson>>> {
|
||||
if (query === '') {
|
||||
return createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), allEPersons));
|
||||
return createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), epersonNonMembers));
|
||||
}
|
||||
return createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), []));
|
||||
},
|
||||
@@ -68,29 +68,26 @@ describe('MembersListComponent', () => {
|
||||
clearLinkRequests() {
|
||||
// empty
|
||||
},
|
||||
getEPeoplePageRouterLink(): string {
|
||||
return '/access-control/epeople';
|
||||
}
|
||||
};
|
||||
groupsDataServiceStub = {
|
||||
activeGroup: activeGroup,
|
||||
epersonMembers: epersonMembers,
|
||||
subgroupMembers: subgroupMembers,
|
||||
allGroups: allGroups,
|
||||
epersonNonMembers: epersonNonMembers,
|
||||
getActiveGroup(): Observable<Group> {
|
||||
return observableOf(activeGroup);
|
||||
},
|
||||
getEPersonMembers() {
|
||||
return this.epersonMembers;
|
||||
},
|
||||
searchGroups(query: string): Observable<RemoteData<PaginatedList<Group>>> {
|
||||
if (query === '') {
|
||||
return createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), this.allGroups));
|
||||
}
|
||||
return createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), []));
|
||||
},
|
||||
addMemberToGroup(parentGroup, eperson: EPerson): Observable<RestResponse> {
|
||||
this.epersonMembers = [...this.epersonMembers, eperson];
|
||||
addMemberToGroup(parentGroup, epersonToAdd: EPerson): Observable<RestResponse> {
|
||||
// Add eperson to list of members
|
||||
this.epersonMembers = [...this.epersonMembers, epersonToAdd];
|
||||
// Remove eperson from list of non-members
|
||||
this.epersonNonMembers.forEach( (eperson: EPerson, index: number) => {
|
||||
if (eperson.id === epersonToAdd.id) {
|
||||
this.epersonNonMembers.splice(index, 1);
|
||||
}
|
||||
});
|
||||
return observableOf(new RestResponse(true, 200, 'Success'));
|
||||
},
|
||||
clearGroupsRequests() {
|
||||
@@ -103,14 +100,14 @@ describe('MembersListComponent', () => {
|
||||
return '/access-control/groups/' + group.id;
|
||||
},
|
||||
deleteMemberFromGroup(parentGroup, epersonToDelete: EPerson): Observable<RestResponse> {
|
||||
this.epersonMembers = this.epersonMembers.find((eperson: EPerson) => {
|
||||
if (eperson.id !== epersonToDelete.id) {
|
||||
return eperson;
|
||||
// Remove eperson from list of members
|
||||
this.epersonMembers.forEach( (eperson: EPerson, index: number) => {
|
||||
if (eperson.id === epersonToDelete.id) {
|
||||
this.epersonMembers.splice(index, 1);
|
||||
}
|
||||
});
|
||||
if (this.epersonMembers === undefined) {
|
||||
this.epersonMembers = [];
|
||||
}
|
||||
// Add eperson to list of non-members
|
||||
this.epersonNonMembers = [...this.epersonNonMembers, epersonToDelete];
|
||||
return observableOf(new RestResponse(true, 200, 'Success'));
|
||||
}
|
||||
};
|
||||
@@ -118,7 +115,7 @@ describe('MembersListComponent', () => {
|
||||
translateService = getMockTranslateService();
|
||||
|
||||
paginationService = new PaginationServiceStub();
|
||||
TestBed.configureTestingModule({
|
||||
return TestBed.configureTestingModule({
|
||||
imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule,
|
||||
TranslateModule.forRoot({
|
||||
loader: {
|
||||
@@ -135,6 +132,7 @@ describe('MembersListComponent', () => {
|
||||
{ provide: FormBuilderService, useValue: builderService },
|
||||
{ provide: Router, useValue: new RouterMock() },
|
||||
{ provide: PaginationService, useValue: paginationService },
|
||||
{ provide: DSONameService, useValue: new DSONameServiceMock() },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
}).compileComponents();
|
||||
@@ -147,6 +145,7 @@ describe('MembersListComponent', () => {
|
||||
});
|
||||
afterEach(fakeAsync(() => {
|
||||
fixture.destroy();
|
||||
fixture.debugElement.nativeElement.remove();
|
||||
flush();
|
||||
component = null;
|
||||
fixture.debugElement.nativeElement.remove();
|
||||
@@ -156,19 +155,43 @@ describe('MembersListComponent', () => {
|
||||
expect(comp).toBeDefined();
|
||||
}));
|
||||
|
||||
it('should show list of eperson members of current active group', () => {
|
||||
const epersonIdsFound = fixture.debugElement.queryAll(By.css('#ePeopleMembersOfGroup tr td:first-child'));
|
||||
expect(epersonIdsFound.length).toEqual(1);
|
||||
epersonMembers.map((eperson: EPerson) => {
|
||||
expect(epersonIdsFound.find((foundEl) => {
|
||||
return (foundEl.nativeElement.textContent.trim() === eperson.uuid);
|
||||
})).toBeTruthy();
|
||||
describe('current members list', () => {
|
||||
it('should show list of eperson members of current active group', () => {
|
||||
const epersonIdsFound = fixture.debugElement.queryAll(By.css('#ePeopleMembersOfGroup tr td:first-child'));
|
||||
expect(epersonIdsFound.length).toEqual(1);
|
||||
epersonMembers.map((eperson: EPerson) => {
|
||||
expect(epersonIdsFound.find((foundEl) => {
|
||||
return (foundEl.nativeElement.textContent.trim() === eperson.uuid);
|
||||
})).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
it('should show a delete button next to each member', () => {
|
||||
const epersonsFound = fixture.debugElement.queryAll(By.css('#ePeopleMembersOfGroup tbody tr'));
|
||||
epersonsFound.map((foundEPersonRowElement: DebugElement) => {
|
||||
const addButton: DebugElement = foundEPersonRowElement.query(By.css('td:last-child .fa-plus'));
|
||||
const deleteButton: DebugElement = foundEPersonRowElement.query(By.css('td:last-child .fa-trash-alt'));
|
||||
expect(addButton).toBeNull();
|
||||
expect(deleteButton).not.toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
describe('if first delete button is pressed', () => {
|
||||
beforeEach(() => {
|
||||
const deleteButton: DebugElement = fixture.debugElement.query(By.css('#ePeopleMembersOfGroup tbody .fa-trash-alt'));
|
||||
deleteButton.nativeElement.click();
|
||||
fixture.detectChanges();
|
||||
});
|
||||
it('then no ePerson remains as a member of the active group.', () => {
|
||||
const epersonsFound = fixture.debugElement.queryAll(By.css('#ePeopleMembersOfGroup tbody tr'));
|
||||
expect(epersonsFound.length).toEqual(0);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('search', () => {
|
||||
describe('when searching without query', () => {
|
||||
let epersonsFound;
|
||||
let epersonsFound: DebugElement[];
|
||||
beforeEach(fakeAsync(() => {
|
||||
component.search({ scope: 'metadata', query: '' });
|
||||
tick();
|
||||
@@ -176,69 +199,34 @@ describe('MembersListComponent', () => {
|
||||
epersonsFound = fixture.debugElement.queryAll(By.css('#epersonsSearch tbody tr'));
|
||||
}));
|
||||
|
||||
it('should display all epersons', () => {
|
||||
expect(epersonsFound.length).toEqual(2);
|
||||
it('should display only non-members of the group', () => {
|
||||
const epersonIdsFound = fixture.debugElement.queryAll(By.css('#epersonsSearch tbody tr td:first-child'));
|
||||
expect(epersonIdsFound.length).toEqual(1);
|
||||
epersonNonMembers.map((eperson: EPerson) => {
|
||||
expect(epersonIdsFound.find((foundEl) => {
|
||||
return (foundEl.nativeElement.textContent.trim() === eperson.uuid);
|
||||
})).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
describe('if eperson is already a eperson', () => {
|
||||
it('should have delete button, else it should have add button', () => {
|
||||
activeGroup.epersons.map((eperson: EPerson) => {
|
||||
epersonsFound.map((foundEPersonRowElement) => {
|
||||
if (foundEPersonRowElement.debugElement !== undefined) {
|
||||
const epersonId = foundEPersonRowElement.debugElement.query(By.css('td:first-child'));
|
||||
const addButton = foundEPersonRowElement.debugElement.query(By.css('td:last-child .fa-plus'));
|
||||
const deleteButton = foundEPersonRowElement.debugElement.query(By.css('td:last-child .fa-trash-alt'));
|
||||
if (epersonId.nativeElement.textContent === eperson.id) {
|
||||
expect(addButton).toBeUndefined();
|
||||
expect(deleteButton).toBeDefined();
|
||||
} else {
|
||||
expect(deleteButton).toBeUndefined();
|
||||
expect(addButton).toBeDefined();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
it('should display an add button next to non-members, not a delete button', () => {
|
||||
epersonsFound.map((foundEPersonRowElement: DebugElement) => {
|
||||
const addButton: DebugElement = foundEPersonRowElement.query(By.css('td:last-child .fa-plus'));
|
||||
const deleteButton: DebugElement = foundEPersonRowElement.query(By.css('td:last-child .fa-trash-alt'));
|
||||
expect(addButton).not.toBeNull();
|
||||
expect(deleteButton).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
describe('if first add button is pressed', () => {
|
||||
beforeEach(fakeAsync(() => {
|
||||
const addButton = fixture.debugElement.query(By.css('#epersonsSearch tbody .fa-plus'));
|
||||
beforeEach(() => {
|
||||
const addButton: DebugElement = fixture.debugElement.query(By.css('#epersonsSearch tbody .fa-plus'));
|
||||
addButton.nativeElement.click();
|
||||
tick();
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
it('all groups in search member of selected group', () => {
|
||||
epersonsFound = fixture.debugElement.queryAll(By.css('#epersonsSearch tbody tr'));
|
||||
expect(epersonsFound.length).toEqual(2);
|
||||
epersonsFound.map((foundEPersonRowElement) => {
|
||||
if (foundEPersonRowElement.debugElement !== undefined) {
|
||||
const addButton = foundEPersonRowElement.debugElement.query(By.css('td:last-child .fa-plus'));
|
||||
const deleteButton = foundEPersonRowElement.debugElement.query(By.css('td:last-child .fa-trash-alt'));
|
||||
expect(addButton).toBeUndefined();
|
||||
expect(deleteButton).toBeDefined();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('if first delete button is pressed', () => {
|
||||
beforeEach(fakeAsync(() => {
|
||||
const addButton = fixture.debugElement.query(By.css('#epersonsSearch tbody .fa-trash-alt'));
|
||||
addButton.nativeElement.click();
|
||||
tick();
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
it('first eperson in search delete button, because now member', () => {
|
||||
it('then all (two) ePersons are member of the active group. No non-members left', () => {
|
||||
epersonsFound = fixture.debugElement.queryAll(By.css('#epersonsSearch tbody tr'));
|
||||
epersonsFound.map((foundEPersonRowElement) => {
|
||||
if (foundEPersonRowElement.debugElement !== undefined) {
|
||||
const addButton = foundEPersonRowElement.debugElement.query(By.css('td:last-child .fa-plus'));
|
||||
const deleteButton = foundEPersonRowElement.debugElement.query(By.css('td:last-child .fa-trash-alt'));
|
||||
expect(deleteButton).toBeUndefined();
|
||||
expect(addButton).toBeDefined();
|
||||
}
|
||||
});
|
||||
expect(epersonsFound.length).toEqual(0);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -1,40 +1,37 @@
|
||||
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
|
||||
import { FormBuilder } from '@angular/forms';
|
||||
import { UntypedFormBuilder } from '@angular/forms';
|
||||
import { Router } from '@angular/router';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import {
|
||||
Observable,
|
||||
of as observableOf,
|
||||
Subscription,
|
||||
BehaviorSubject,
|
||||
combineLatest as observableCombineLatest,
|
||||
ObservedValueOf,
|
||||
BehaviorSubject
|
||||
} from 'rxjs';
|
||||
import { defaultIfEmpty, map, mergeMap, switchMap, take } from 'rxjs/operators';
|
||||
import { buildPaginatedList, PaginatedList } from '../../../../core/data/paginated-list.model';
|
||||
import { map, switchMap, take } from 'rxjs/operators';
|
||||
import { PaginatedList } from '../../../../core/data/paginated-list.model';
|
||||
import { RemoteData } from '../../../../core/data/remote-data';
|
||||
import { EPersonDataService } from '../../../../core/eperson/eperson-data.service';
|
||||
import { GroupDataService } from '../../../../core/eperson/group-data.service';
|
||||
import { EPerson } from '../../../../core/eperson/models/eperson.model';
|
||||
import { Group } from '../../../../core/eperson/models/group.model';
|
||||
import {
|
||||
getFirstSucceededRemoteData,
|
||||
getFirstCompletedRemoteData,
|
||||
getAllCompletedRemoteData,
|
||||
getRemoteDataPayload
|
||||
} from '../../../../core/shared/operators';
|
||||
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
||||
import { PaginationComponentOptions } from '../../../../shared/pagination/pagination-component-options.model';
|
||||
import { EpersonDtoModel } from '../../../../core/eperson/models/eperson-dto.model';
|
||||
import { PaginationService } from '../../../../core/pagination/pagination.service';
|
||||
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
||||
import { getEPersonEditRoute } from '../../../access-control-routing-paths';
|
||||
|
||||
/**
|
||||
* Keys to keep track of specific subscriptions
|
||||
*/
|
||||
enum SubKey {
|
||||
ActiveGroup,
|
||||
MembersDTO,
|
||||
SearchResultsDTO,
|
||||
Members,
|
||||
SearchResults,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -95,11 +92,11 @@ export class MembersListComponent implements OnInit, OnDestroy {
|
||||
/**
|
||||
* EPeople being displayed in search result, initially all members, after search result of search
|
||||
*/
|
||||
ePeopleSearchDtos: BehaviorSubject<PaginatedList<EpersonDtoModel>> = new BehaviorSubject<PaginatedList<EpersonDtoModel>>(undefined);
|
||||
ePeopleSearch: BehaviorSubject<PaginatedList<EPerson>> = new BehaviorSubject<PaginatedList<EPerson>>(undefined);
|
||||
/**
|
||||
* List of EPeople members of currently active group being edited
|
||||
*/
|
||||
ePeopleMembersOfGroupDtos: BehaviorSubject<PaginatedList<EpersonDtoModel>> = new BehaviorSubject<PaginatedList<EpersonDtoModel>>(undefined);
|
||||
ePeopleMembersOfGroup: BehaviorSubject<PaginatedList<EPerson>> = new BehaviorSubject<PaginatedList<EPerson>>(undefined);
|
||||
|
||||
/**
|
||||
* Pagination config used to display the list of EPeople that are result of EPeople search
|
||||
@@ -128,7 +125,6 @@ export class MembersListComponent implements OnInit, OnDestroy {
|
||||
|
||||
// Current search in edit group - epeople search form
|
||||
currentSearchQuery: string;
|
||||
currentSearchScope: string;
|
||||
|
||||
// Whether or not user has done a EPeople search yet
|
||||
searchDone: boolean;
|
||||
@@ -136,28 +132,30 @@ export class MembersListComponent implements OnInit, OnDestroy {
|
||||
// current active group being edited
|
||||
groupBeingEdited: Group;
|
||||
|
||||
readonly getEPersonEditRoute = getEPersonEditRoute;
|
||||
|
||||
constructor(
|
||||
protected groupDataService: GroupDataService,
|
||||
public ePersonDataService: EPersonDataService,
|
||||
protected translateService: TranslateService,
|
||||
protected notificationsService: NotificationsService,
|
||||
protected formBuilder: FormBuilder,
|
||||
protected formBuilder: UntypedFormBuilder,
|
||||
protected paginationService: PaginationService,
|
||||
private router: Router
|
||||
protected router: Router,
|
||||
public dsoNameService: DSONameService,
|
||||
) {
|
||||
this.currentSearchQuery = '';
|
||||
this.currentSearchScope = 'metadata';
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.searchForm = this.formBuilder.group(({
|
||||
scope: 'metadata',
|
||||
query: '',
|
||||
}));
|
||||
this.subs.set(SubKey.ActiveGroup, this.groupDataService.getActiveGroup().subscribe((activeGroup: Group) => {
|
||||
if (activeGroup != null) {
|
||||
this.groupBeingEdited = activeGroup;
|
||||
this.retrieveMembers(this.config.currentPage);
|
||||
this.search({query: ''});
|
||||
}
|
||||
}));
|
||||
}
|
||||
@@ -169,8 +167,8 @@ export class MembersListComponent implements OnInit, OnDestroy {
|
||||
* @private
|
||||
*/
|
||||
retrieveMembers(page: number): void {
|
||||
this.unsubFrom(SubKey.MembersDTO);
|
||||
this.subs.set(SubKey.MembersDTO,
|
||||
this.unsubFrom(SubKey.Members);
|
||||
this.subs.set(SubKey.Members,
|
||||
this.paginationService.getCurrentPagination(this.config.id, this.config).pipe(
|
||||
switchMap((currentPagination) => {
|
||||
return this.ePersonDataService.findListByHref(this.groupBeingEdited._links.epersons.href, {
|
||||
@@ -187,49 +185,12 @@ export class MembersListComponent implements OnInit, OnDestroy {
|
||||
return rd;
|
||||
}
|
||||
}),
|
||||
switchMap((epersonListRD: RemoteData<PaginatedList<EPerson>>) => {
|
||||
const dtos$ = observableCombineLatest([...epersonListRD.payload.page.map((member: EPerson) => {
|
||||
const dto$: Observable<EpersonDtoModel> = observableCombineLatest(
|
||||
this.isMemberOfGroup(member), (isMember: ObservedValueOf<Observable<boolean>>) => {
|
||||
const epersonDtoModel: EpersonDtoModel = new EpersonDtoModel();
|
||||
epersonDtoModel.eperson = member;
|
||||
epersonDtoModel.memberOfGroup = isMember;
|
||||
return epersonDtoModel;
|
||||
});
|
||||
return dto$;
|
||||
})]);
|
||||
return dtos$.pipe(defaultIfEmpty([]), map((dtos: EpersonDtoModel[]) => {
|
||||
return buildPaginatedList(epersonListRD.payload.pageInfo, dtos);
|
||||
}));
|
||||
}))
|
||||
.subscribe((paginatedListOfDTOs: PaginatedList<EpersonDtoModel>) => {
|
||||
this.ePeopleMembersOfGroupDtos.next(paginatedListOfDTOs);
|
||||
getRemoteDataPayload())
|
||||
.subscribe((paginatedListOfEPersons: PaginatedList<EPerson>) => {
|
||||
this.ePeopleMembersOfGroup.next(paginatedListOfEPersons);
|
||||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the given ePerson is a member of the group currently being edited
|
||||
* @param possibleMember EPerson that is a possible member (being tested) of the group currently being edited
|
||||
*/
|
||||
isMemberOfGroup(possibleMember: EPerson): Observable<boolean> {
|
||||
return this.groupDataService.getActiveGroup().pipe(take(1),
|
||||
mergeMap((group: Group) => {
|
||||
if (group != null) {
|
||||
return this.ePersonDataService.findListByHref(group._links.epersons.href, {
|
||||
currentPage: 1,
|
||||
elementsPerPage: 9999
|
||||
})
|
||||
.pipe(
|
||||
getFirstSucceededRemoteData(),
|
||||
getRemoteDataPayload(),
|
||||
map((listEPeopleInGroup: PaginatedList<EPerson>) => listEPeopleInGroup.page.filter((ePersonInList: EPerson) => ePersonInList.id === possibleMember.id)),
|
||||
map((epeople: EPerson[]) => epeople.length > 0));
|
||||
} else {
|
||||
return observableOf(false);
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsubscribe from a subscription if it's still subscribed, and remove it from the map of
|
||||
* active subscriptions
|
||||
@@ -246,13 +207,18 @@ export class MembersListComponent implements OnInit, OnDestroy {
|
||||
|
||||
/**
|
||||
* Deletes a given EPerson from the members list of the group currently being edited
|
||||
* @param ePerson EPerson we want to delete as member from group that is currently being edited
|
||||
* @param eperson EPerson we want to delete as member from group that is currently being edited
|
||||
*/
|
||||
deleteMemberFromGroup(ePerson: EpersonDtoModel) {
|
||||
deleteMemberFromGroup(eperson: EPerson) {
|
||||
this.groupDataService.getActiveGroup().pipe(take(1)).subscribe((activeGroup: Group) => {
|
||||
if (activeGroup != null) {
|
||||
const response = this.groupDataService.deleteMemberFromGroup(activeGroup, ePerson.eperson);
|
||||
this.showNotifications('deleteMember', response, ePerson.eperson.name, activeGroup);
|
||||
const response = this.groupDataService.deleteMemberFromGroup(activeGroup, eperson);
|
||||
this.showNotifications('deleteMember', response, this.dsoNameService.getName(eperson), activeGroup);
|
||||
// Reload search results (if there is an active query).
|
||||
// This will potentially add this deleted subgroup into the list of search results.
|
||||
if (this.currentSearchQuery != null) {
|
||||
this.search({query: this.currentSearchQuery});
|
||||
}
|
||||
} else {
|
||||
this.notificationsService.error(this.translateService.get(this.messagePrefix + '.notification.failure.noActiveGroup'));
|
||||
}
|
||||
@@ -261,14 +227,18 @@ export class MembersListComponent implements OnInit, OnDestroy {
|
||||
|
||||
/**
|
||||
* Adds a given EPerson to the members list of the group currently being edited
|
||||
* @param ePerson EPerson we want to add as member to group that is currently being edited
|
||||
* @param eperson EPerson we want to add as member to group that is currently being edited
|
||||
*/
|
||||
addMemberToGroup(ePerson: EpersonDtoModel) {
|
||||
ePerson.memberOfGroup = true;
|
||||
addMemberToGroup(eperson: EPerson) {
|
||||
this.groupDataService.getActiveGroup().pipe(take(1)).subscribe((activeGroup: Group) => {
|
||||
if (activeGroup != null) {
|
||||
const response = this.groupDataService.addMemberToGroup(activeGroup, ePerson.eperson);
|
||||
this.showNotifications('addMember', response, ePerson.eperson.name, activeGroup);
|
||||
const response = this.groupDataService.addMemberToGroup(activeGroup, eperson);
|
||||
this.showNotifications('addMember', response, this.dsoNameService.getName(eperson), activeGroup);
|
||||
// Reload search results (if there is an active query).
|
||||
// This will potentially add this deleted subgroup into the list of search results.
|
||||
if (this.currentSearchQuery != null) {
|
||||
this.search({query: this.currentSearchQuery});
|
||||
}
|
||||
} else {
|
||||
this.notificationsService.error(this.translateService.get(this.messagePrefix + '.notification.failure.noActiveGroup'));
|
||||
}
|
||||
@@ -276,37 +246,25 @@ export class MembersListComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
/**
|
||||
* Search in the EPeople by name, email or metadata
|
||||
* @param data Contains scope and query param
|
||||
* Search all EPeople who are NOT a member of the current group by name, email or metadata
|
||||
* @param data Contains query param
|
||||
*/
|
||||
search(data: any) {
|
||||
this.unsubFrom(SubKey.SearchResultsDTO);
|
||||
this.subs.set(SubKey.SearchResultsDTO,
|
||||
this.unsubFrom(SubKey.SearchResults);
|
||||
this.subs.set(SubKey.SearchResults,
|
||||
this.paginationService.getCurrentPagination(this.configSearch.id, this.configSearch).pipe(
|
||||
switchMap((paginationOptions) => {
|
||||
|
||||
const query: string = data.query;
|
||||
const scope: string = data.scope;
|
||||
if (query != null && this.currentSearchQuery !== query && this.groupBeingEdited) {
|
||||
this.router.navigate([], {
|
||||
queryParamsHandling: 'merge'
|
||||
});
|
||||
this.currentSearchQuery = query;
|
||||
this.paginationService.resetPage(this.configSearch.id);
|
||||
}
|
||||
if (scope != null && this.currentSearchScope !== scope && this.groupBeingEdited) {
|
||||
this.router.navigate([], {
|
||||
queryParamsHandling: 'merge'
|
||||
});
|
||||
this.currentSearchScope = scope;
|
||||
this.paginationService.resetPage(this.configSearch.id);
|
||||
}
|
||||
this.searchDone = true;
|
||||
|
||||
return this.ePersonDataService.searchByScope(this.currentSearchScope, this.currentSearchQuery, {
|
||||
return this.ePersonDataService.searchNonMembers(this.currentSearchQuery, this.groupBeingEdited.id, {
|
||||
currentPage: paginationOptions.currentPage,
|
||||
elementsPerPage: paginationOptions.pageSize
|
||||
});
|
||||
}, false, true);
|
||||
}),
|
||||
getAllCompletedRemoteData(),
|
||||
map((rd: RemoteData<any>) => {
|
||||
@@ -316,23 +274,9 @@ export class MembersListComponent implements OnInit, OnDestroy {
|
||||
return rd;
|
||||
}
|
||||
}),
|
||||
switchMap((epersonListRD: RemoteData<PaginatedList<EPerson>>) => {
|
||||
const dtos$ = observableCombineLatest([...epersonListRD.payload.page.map((member: EPerson) => {
|
||||
const dto$: Observable<EpersonDtoModel> = observableCombineLatest(
|
||||
this.isMemberOfGroup(member), (isMember: ObservedValueOf<Observable<boolean>>) => {
|
||||
const epersonDtoModel: EpersonDtoModel = new EpersonDtoModel();
|
||||
epersonDtoModel.eperson = member;
|
||||
epersonDtoModel.memberOfGroup = isMember;
|
||||
return epersonDtoModel;
|
||||
});
|
||||
return dto$;
|
||||
})]);
|
||||
return dtos$.pipe(defaultIfEmpty([]), map((dtos: EpersonDtoModel[]) => {
|
||||
return buildPaginatedList(epersonListRD.payload.pageInfo, dtos);
|
||||
}));
|
||||
}))
|
||||
.subscribe((paginatedListOfDTOs: PaginatedList<EpersonDtoModel>) => {
|
||||
this.ePeopleSearchDtos.next(paginatedListOfDTOs);
|
||||
getRemoteDataPayload())
|
||||
.subscribe((paginatedListOfEPersons: PaginatedList<EPerson>) => {
|
||||
this.ePeopleSearch.next(paginatedListOfEPersons);
|
||||
}));
|
||||
}
|
||||
|
||||
|
@@ -1,6 +1,54 @@
|
||||
<ng-container>
|
||||
<h3 class="border-bottom pb-2">{{messagePrefix + '.head' | translate}}</h3>
|
||||
|
||||
<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)"
|
||||
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>
|
||||
|
||||
<div *ngIf="(subGroups$ | async)?.payload?.totalElements == 0" 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="{
|
||||
content: 'admin.access-control.groups.form.tooltip.editGroup.addSubgroups',
|
||||
@@ -35,7 +83,6 @@
|
||||
|
||||
<ds-pagination *ngIf="(searchResults$ | async)?.payload?.totalElements > 0"
|
||||
[paginationOptions]="configSearch"
|
||||
[pageInfoState]="(searchResults$ | async)?.payload"
|
||||
[collectionSize]="(searchResults$ | async)?.payload?.totalElements"
|
||||
[hideGear]="true"
|
||||
[hidePagerWhenSinglePage]="true">
|
||||
@@ -53,24 +100,18 @@
|
||||
<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)]">{{group.name}}</a></td>
|
||||
<td class="align-middle">{{(group.object | async)?.payload?.name}}</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 *ngIf="(isSubgroupOfGroup(group) | async) && !(isActiveGroup(group) | async)"
|
||||
(click)="deleteSubgroupFromGroup(group)"
|
||||
class="btn btn-outline-danger btn-sm deleteButton"
|
||||
title="{{messagePrefix + '.table.edit.buttons.remove' | translate: {name: group.name} }}">
|
||||
<i class="fas fa-trash-alt fa-fw"></i>
|
||||
</button>
|
||||
|
||||
<p *ngIf="(isActiveGroup(group) | async)">{{ messagePrefix + '.table.edit.currentGroup' | translate }}</p>
|
||||
|
||||
<button *ngIf="!(isSubgroupOfGroup(group) | async) && !(isActiveGroup(group) | async)"
|
||||
(click)="addSubgroupToGroup(group)"
|
||||
<button (click)="addSubgroupToGroup(group)"
|
||||
class="btn btn-outline-primary btn-sm addButton"
|
||||
title="{{messagePrefix + '.table.edit.buttons.add' | translate: {name: group.name} }}">
|
||||
title="{{messagePrefix + '.table.edit.buttons.add' | translate: { name: dsoNameService.getName(group) } }}">
|
||||
<i class="fas fa-plus fa-fw"></i>
|
||||
</button>
|
||||
</div>
|
||||
@@ -86,49 +127,4 @@
|
||||
{{messagePrefix + '.no-items' | translate}}
|
||||
</div>
|
||||
|
||||
<h4>{{messagePrefix + '.headSubgroups' | translate}}</h4>
|
||||
|
||||
<ds-pagination *ngIf="(subGroups$ | async)?.payload?.totalElements > 0"
|
||||
[paginationOptions]="config"
|
||||
[pageInfoState]="(subGroups$ | async)?.payload"
|
||||
[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)]">{{group.name}}</a></td>
|
||||
<td class="align-middle">{{(group.object | async)?.payload?.name}}</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: group.name} }}">
|
||||
<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>
|
||||
|
||||
</ng-container>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user