Compare commits
515 Commits
mod-2
...
automated/
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b904cc45b5 | ||
|
|
f044267a50 | ||
|
|
23b062a846 | ||
|
|
189aa8210f | ||
|
|
8450682c44 | ||
|
|
6a1ff4e81a | ||
|
|
189b96d594 | ||
|
|
ac22d7867a | ||
|
|
5fede57c51 | ||
|
|
0b0bf1d4df | ||
|
|
6cb1acbbab | ||
|
|
70f2d860b5 | ||
|
|
0ac2d9b2d5 | ||
|
|
30118ba1ee | ||
|
|
e385e1af39 | ||
|
|
dad2a865e5 | ||
|
|
cc2693ebe4 | ||
|
|
a535fd5bb0 | ||
|
|
44e0f65dea | ||
|
|
f8cb55b094 | ||
|
|
4594d5f0d2 | ||
|
|
cbe9d89163 | ||
|
|
b3ce230dd2 | ||
|
|
c158a5aa6a | ||
|
|
9ded00b7bb | ||
|
|
55ea67d081 | ||
|
|
779ff6f31f | ||
|
|
f47dd0f7dd | ||
|
|
c8e72e45f1 | ||
|
|
012b8a2aad | ||
|
|
7a3bb0fa2c | ||
|
|
b42ad7a32f | ||
|
|
125fb5b0d6 | ||
|
|
64d6c7e78c | ||
|
|
d5f6b389df | ||
|
|
9545b0dee3 | ||
|
|
5fc1c82baa | ||
|
|
1e102faae5 | ||
|
|
607c89739e | ||
|
|
bac68412c5 | ||
|
|
dbed20ce9a | ||
|
|
dc8a1b799f | ||
|
|
c6c583ecbd | ||
|
|
c5bba36224 | ||
|
|
03528362a4 | ||
|
|
0a36e5f5c3 | ||
|
|
121bcdd79d | ||
|
|
d24bb74be0 | ||
|
|
d40562cf2e | ||
|
|
36e56e5738 | ||
|
|
40c086180e | ||
|
|
ebdf4c01b1 | ||
|
|
34a3490912 | ||
|
|
ab445537bf | ||
|
|
c072c2c0f2 | ||
|
|
0cbfa61f26 | ||
|
|
adb82eb333 | ||
|
|
99e7f86849 | ||
|
|
66d94dd9df | ||
|
|
0c9ad4aaa0 | ||
|
|
9f6d33e337 | ||
|
|
9218e449cf | ||
|
|
9f0b439702 | ||
|
|
5efb894ed6 | ||
|
|
298e46f12b | ||
|
|
ede59e85ac | ||
|
|
1467164692 | ||
|
|
37a7c7b73a | ||
|
|
ea00c9cb88 | ||
|
|
24955a06d6 | ||
|
|
c266b1b3df | ||
|
|
115ca045fc | ||
|
|
79275848d7 | ||
|
|
2e05254ef7 | ||
|
|
6f4683e674 | ||
|
|
821060bccd | ||
|
|
56efe29aaa | ||
|
|
976b817c64 | ||
|
|
ef1390ac15 | ||
|
|
538882b414 | ||
|
|
418a86dad3 | ||
|
|
178ab996c6 | ||
|
|
f194252b18 | ||
|
|
5ab8b170a1 | ||
|
|
a2a5cd4f25 | ||
|
|
47a450e8cb | ||
|
|
846336ca7f | ||
|
|
8ccb29c183 | ||
|
|
0b61d118b6 | ||
|
|
304b0c2c17 | ||
|
|
4d29f91d35 | ||
|
|
b77c81223d | ||
|
|
c0b3266ba9 | ||
|
|
54e4252499 | ||
|
|
043cff03d8 | ||
|
|
6a82964a4c | ||
|
|
e1851c408d | ||
|
|
28f39e55ba | ||
|
|
c14f7d11a5 | ||
|
|
70ca2dbe40 | ||
|
|
23245a1e28 | ||
|
|
878334d3b5 | ||
|
|
891d7dee43 | ||
|
|
3bd4504001 | ||
|
|
d6d502e9fb | ||
|
|
f60e8677cb | ||
|
|
9badf91391 | ||
|
|
5422c73c35 | ||
|
|
09174f6ad0 | ||
|
|
784f327e67 | ||
|
|
f1962a7454 | ||
|
|
03938578c4 | ||
|
|
82fdbcefa1 | ||
|
|
caf6ac193d | ||
|
|
03ed276241 | ||
|
|
38d3660b77 | ||
|
|
0bffb5db6a | ||
|
|
27eeec7ba3 | ||
|
|
011c4db1be | ||
|
|
01622b1f50 | ||
|
|
70931d0d56 | ||
|
|
c75bfa41ec | ||
|
|
7c22020316 | ||
|
|
5113a4c7b9 | ||
|
|
43a471c897 | ||
|
|
774ae86b79 | ||
|
|
223a06b79a | ||
|
|
211182e5ee | ||
|
|
7f28cd730c | ||
|
|
dadd92a378 | ||
|
|
8d14a6571c | ||
|
|
e57f106dcf | ||
|
|
b57cf8e4fe | ||
|
|
d0740cf0ae | ||
|
|
886bbc9a4c | ||
|
|
18265357e6 | ||
|
|
495bd0a55d | ||
|
|
1a6e66aabf | ||
|
|
456726251a | ||
|
|
98d0c35789 | ||
|
|
23343c5514 | ||
|
|
b5aa9c3ed3 | ||
|
|
540f35a22c | ||
|
|
c8ae989380 | ||
|
|
9a610f5d6f | ||
|
|
16930c5e7a | ||
|
|
6ecb740508 | ||
|
|
ea46f02833 | ||
|
|
315987f888 | ||
|
|
0b0724d833 | ||
|
|
053556d554 | ||
|
|
cd0cef7494 | ||
|
|
eef27c4fb3 | ||
|
|
051aa2afd6 | ||
|
|
5b1c9f8b4e | ||
|
|
8bd61286b6 | ||
|
|
640be2d26a | ||
|
|
e8cd367334 | ||
|
|
cf4aa5926a | ||
|
|
4fe7079c09 | ||
|
|
a6cc83fcf0 | ||
|
|
cfe346503c | ||
|
|
de9d9e5e68 | ||
|
|
2fde8eaf2e | ||
|
|
508cf46909 | ||
|
|
3c9403bef3 | ||
|
|
4b17dc9813 | ||
|
|
1fb221e5d3 | ||
|
|
c465d15fb2 | ||
|
|
07d4184d47 | ||
|
|
039992dfe5 | ||
|
|
fe2bcda335 | ||
|
|
7bd65078be | ||
|
|
7a80acb77f | ||
|
|
445942e1c9 | ||
|
|
24539a6a1c | ||
|
|
56ceb4d889 | ||
|
|
69442f217b | ||
|
|
0764bd9724 | ||
|
|
7318c3291d | ||
|
|
835e7fa69e | ||
|
|
1ac098b418 | ||
|
|
fa8af18f82 | ||
|
|
20aff5bbc3 | ||
|
|
18efab07a2 | ||
|
|
8f698a29f6 | ||
|
|
dd0818382a | ||
|
|
a14e5685a3 | ||
|
|
9af4c58506 | ||
|
|
28de118ee2 | ||
|
|
c163a608a6 | ||
|
|
6f1352d018 | ||
|
|
a6b2d207ee | ||
|
|
2dfb3d6379 | ||
|
|
83922f26b3 | ||
|
|
2d96431bdc | ||
|
|
6f5df944ad | ||
|
|
021e9e3bfd | ||
|
|
e3de1ed923 | ||
|
|
734964e77a | ||
|
|
a5f8a73f6b | ||
|
|
7e54d0d6c8 | ||
|
|
e1fc729275 | ||
|
|
032029357b | ||
|
|
07f04be59d | ||
|
|
21d26a4536 | ||
|
|
697ef8d187 | ||
|
|
87f4117164 | ||
|
|
c2b08b7e2f | ||
|
|
74ea201db0 | ||
|
|
65c3404d39 | ||
|
|
2742273f5c | ||
|
|
72917dfa28 | ||
|
|
e83cc8f6e2 | ||
|
|
adefe30352 | ||
|
|
9314e3a2c3 | ||
|
|
5812050f10 | ||
|
|
09f6a39e7c | ||
|
|
b840d9b1e0 | ||
|
|
ac347e8a84 | ||
|
|
67e297084d | ||
|
|
135a1a007b | ||
|
|
7de5b241d2 | ||
|
|
62e1839485 | ||
|
|
035e45735c | ||
|
|
c3394ed72d | ||
|
|
5aaa5903dd | ||
|
|
08fc1d1f21 | ||
|
|
1a8591a1f3 | ||
|
|
a74a6badbe | ||
|
|
7a32e1ff61 | ||
|
|
a782fe63c6 | ||
|
|
4b59fbdda7 | ||
|
|
b2f36b1687 | ||
|
|
d900537f7d | ||
|
|
20752f53cd | ||
|
|
5cde5f834f | ||
|
|
6f45de6bde | ||
|
|
6034cc3838 | ||
|
|
bf71460c62 | ||
|
|
fb59063e1c | ||
|
|
a4e40ec11e | ||
|
|
a0da308164 | ||
|
|
2fdbf7dd01 | ||
|
|
bc5fd69969 | ||
|
|
f1c0b03d58 | ||
|
|
1555c6c277 | ||
|
|
609ecb8d78 | ||
|
|
838d29093a | ||
|
|
1e44b744a5 | ||
|
|
3059fa42ca | ||
|
|
8741ac0728 | ||
|
|
724ed2e78d | ||
|
|
cdc51e7d94 | ||
|
|
8fc2e02e29 | ||
|
|
b0f58331af | ||
|
|
136cbdf2cb | ||
|
|
9852a3ccf8 | ||
|
|
c2787f2500 | ||
|
|
81a67e84b3 | ||
|
|
44d6981ec6 | ||
|
|
ba841069e5 | ||
|
|
39867846a7 | ||
|
|
17bd927f85 | ||
|
|
ecec14bf53 | ||
|
|
c94e8d9199 | ||
|
|
95970a2f94 | ||
|
|
5cb1afac84 | ||
|
|
4bf0f33234 | ||
|
|
c22181cc2e | ||
|
|
b6bf1ced09 | ||
|
|
5a45a1cd4c | ||
|
|
1bc35e8f4e | ||
|
|
986abc2e49 | ||
|
|
50234f35bf | ||
|
|
4fda41741d | ||
|
|
54df23741b | ||
|
|
bcbcd191a1 | ||
|
|
75b0c568cc | ||
|
|
acc16b57c8 | ||
|
|
3fb15c5fc5 | ||
|
|
e78f70302d | ||
|
|
5e6596a949 | ||
|
|
6672844704 | ||
|
|
43cff1c3f6 | ||
|
|
4d59da0513 | ||
|
|
3d8cfbab85 | ||
|
|
c4ed5198a9 | ||
|
|
5cf65cfed7 | ||
|
|
7af03f1a1d | ||
|
|
70a1d52fd3 | ||
|
|
229c6dd752 | ||
|
|
1d84ceed4e | ||
|
|
633c60592f | ||
|
|
5126de1719 | ||
|
|
0407d2109c | ||
|
|
4819771561 | ||
|
|
df064d07da | ||
|
|
b9a013d364 | ||
|
|
c7b30b0df2 | ||
|
|
5d109684fc | ||
|
|
dfdc148593 | ||
|
|
c76545e410 | ||
|
|
bd169f9229 | ||
|
|
54568805cb | ||
|
|
6c16c307a7 | ||
|
|
6114626e29 | ||
|
|
016f471516 | ||
|
|
8535f7fe98 | ||
|
|
06eb2cf20d | ||
|
|
ed9896ca79 | ||
|
|
eb21f79323 | ||
|
|
dfc472fb0e | ||
|
|
b022d4a007 | ||
|
|
6bf3104419 | ||
|
|
562a491f2e | ||
|
|
3b07fbcaac | ||
|
|
c4f1abd3e2 | ||
|
|
7ad37067bc | ||
|
|
81bd5e279a | ||
|
|
9be1a0ed90 | ||
|
|
22470ee050 | ||
|
|
f76f8e54d7 | ||
|
|
9608b6ac48 | ||
|
|
06c2a4da3b | ||
|
|
25d9206c38 | ||
|
|
f16aa05258 | ||
|
|
e7c5306b59 | ||
|
|
438f741eca | ||
|
|
147b3facfd | ||
|
|
46ca498bd1 | ||
|
|
fb9b9b37be | ||
|
|
9d4f9ad55e | ||
|
|
cdd806910c | ||
|
|
b348d63e9b | ||
|
|
905efa307c | ||
|
|
e70e31c843 | ||
|
|
c9570631e6 | ||
|
|
68a6cf7eb5 | ||
|
|
d446bb528f | ||
|
|
450f60730e | ||
|
|
8ff3839de3 | ||
|
|
c30c0ea10f | ||
|
|
d4572e3c0b | ||
|
|
8ce6adf276 | ||
|
|
f95252e8a6 | ||
|
|
048ba91ca7 | ||
|
|
ba983d6fbf | ||
|
|
b1249aa364 | ||
|
|
ae775a4a7f | ||
|
|
819a5c4715 | ||
|
|
f29cd18c1e | ||
|
|
6d4097ed93 | ||
|
|
98a0dc82f3 | ||
|
|
8ad36025c9 | ||
|
|
3150ba9fe3 | ||
|
|
ee73876d2e | ||
|
|
4efc819f31 | ||
|
|
6fdd55993c | ||
|
|
f1cae1d706 | ||
|
|
e0abc77943 | ||
|
|
2aa082ea57 | ||
|
|
395889331a | ||
|
|
c61f361e47 | ||
|
|
30743a31d9 | ||
|
|
a392507cc5 | ||
|
|
fc96100022 | ||
|
|
9cc4be0dbb | ||
|
|
7274ae23e6 | ||
|
|
7d9362ef50 | ||
|
|
667be29233 | ||
|
|
c438a665ae | ||
|
|
b6bba78541 | ||
|
|
3a5c865bbb | ||
|
|
14503d2f3d | ||
|
|
2c49c4e1ea | ||
|
|
847fc3bd32 | ||
|
|
3cd0e8c324 | ||
|
|
ba8fe8ba1f | ||
|
|
34566c6542 | ||
|
|
835d61985a | ||
|
|
03cfe95073 | ||
|
|
37b0c376ed | ||
|
|
4e954fce21 | ||
|
|
814ad66f4a | ||
|
|
519f92c7e7 | ||
|
|
c1f7d7dd44 | ||
|
|
09973e01b4 | ||
|
|
c899278c23 | ||
|
|
16627c17eb | ||
|
|
4d607987d2 | ||
|
|
af6a588f10 | ||
|
|
caadc7959a | ||
|
|
69d480f0c0 | ||
|
|
a5995ffa84 | ||
|
|
6eaac5d5a2 | ||
|
|
19d37ab123 | ||
|
|
b56f161484 | ||
|
|
9175ec7a19 | ||
|
|
46b07513a7 | ||
|
|
8c27b7341f | ||
|
|
e11a4a646f | ||
|
|
c46659e9ee | ||
|
|
fb8127b449 | ||
|
|
b030b0fc28 | ||
|
|
bd45b525b8 | ||
|
|
b207755e37 | ||
|
|
7a429d8ffb | ||
|
|
c8ec8828b0 | ||
|
|
94eda67f70 | ||
|
|
aa33327fd7 | ||
|
|
97c326c340 | ||
|
|
633f14ccce | ||
|
|
d4e93e8317 | ||
|
|
511ad4238e | ||
|
|
d086ef50b1 | ||
|
|
f61f2a667c | ||
|
|
45718d6bd9 | ||
|
|
422ee80946 | ||
|
|
9eacfa07e5 | ||
|
|
8714ef3a88 | ||
|
|
f3bafd9b44 | ||
|
|
a18da4b2d5 | ||
|
|
d9c468229c | ||
|
|
80224267cc | ||
|
|
23ad6b3e65 | ||
|
|
360c07af58 | ||
|
|
df38d09840 | ||
|
|
0ab6d7ccd3 | ||
|
|
70054ec65e | ||
|
|
9a57c891ca | ||
|
|
e4135337d7 | ||
|
|
bb9d539813 | ||
|
|
9e04f88a1d | ||
|
|
4873735ab2 | ||
|
|
818e8e9eb7 | ||
|
|
b490633a3d | ||
|
|
fad889db15 | ||
|
|
94d0225f52 | ||
|
|
f26bc92612 | ||
|
|
e8f536fbb5 | ||
|
|
8ec5def76f | ||
|
|
1e8ce54361 | ||
|
|
bbc4b80d56 | ||
|
|
4fc8ea196d | ||
|
|
07b0716d33 | ||
|
|
aca6b9d969 | ||
|
|
16592324a0 | ||
|
|
6b315f95a7 | ||
|
|
500662f8ce | ||
|
|
b8e05284eb | ||
|
|
c665cfb03d | ||
|
|
dc7a41ee35 | ||
|
|
90664cf869 | ||
|
|
c0084a6b5b | ||
|
|
9227f9e9a1 | ||
|
|
95117be03a | ||
|
|
80c428e114 | ||
|
|
03c712c965 | ||
|
|
4f59de7498 | ||
|
|
5f7709af93 | ||
|
|
79497b061a | ||
|
|
f402181db6 | ||
|
|
0275ecf3ad | ||
|
|
ba8294bdce | ||
|
|
80ed3c5e87 | ||
|
|
9efc73ce41 | ||
|
|
0c4d366950 | ||
|
|
c624b4cda0 | ||
|
|
b3b9b0d18f | ||
|
|
c846880a1e | ||
|
|
acaaccda05 | ||
|
|
67b378fda5 | ||
|
|
827b7da7c2 | ||
|
|
e01149cd81 | ||
|
|
4b594be8f0 | ||
|
|
b570dd8880 | ||
|
|
afc92908fd | ||
|
|
58bc1a87b1 | ||
|
|
7936dd6b56 | ||
|
|
dbbd57e443 | ||
|
|
0d42750d19 | ||
|
|
c56170f76f | ||
|
|
c56aeba3d3 | ||
|
|
ca4e0c122b | ||
|
|
05939792a1 | ||
|
|
5cbd91649b | ||
|
|
61d58fb4eb | ||
|
|
5aa2428e2d | ||
|
|
d35d8e5a50 | ||
|
|
71fe340fad | ||
|
|
6f3f391a04 | ||
|
|
50dea78147 | ||
|
|
3f3b1a11d7 | ||
|
|
c29686feec | ||
|
|
086617563d | ||
|
|
c7d7f2e5fe | ||
|
|
ac19f517c5 | ||
|
|
9a738ee7ac | ||
|
|
b81c249164 | ||
|
|
20f74812ea | ||
|
|
63709be9ad | ||
|
|
a94efb4905 | ||
|
|
412a5d183e | ||
|
|
e144303e26 | ||
|
|
fdb3a29256 | ||
|
|
de760ac6fa | ||
|
|
1e20832cd6 | ||
|
|
8e77849027 | ||
|
|
147dadd1ab | ||
|
|
bd39df04f6 | ||
|
|
12f30e946e | ||
|
|
01a6f93730 | ||
|
|
c72bec7220 | ||
|
|
c9a5f9e79b |
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"image": "ghcr.io/juliusknorr/nextcloud-dev-php81:latest",
|
||||
"image": "ghcr.io/juliushaertl/nextcloud-dev-php81:latest",
|
||||
"forwardPorts": [80],
|
||||
"containerEnv": {
|
||||
"NEXTCLOUD_AUTOINSTALL_APPS": "deck",
|
||||
|
||||
120
.github/ISSUE_TEMPLATE/Bug_report.md
vendored
Normal file
120
.github/ISSUE_TEMPLATE/Bug_report.md
vendored
Normal file
@@ -0,0 +1,120 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
Thanks for reporting issues back!
|
||||
|
||||
Guidelines for submitting issues:
|
||||
|
||||
* Please search the existing issues first, it's likely that your issue was already reported or even fixed.
|
||||
|
||||
* SECURITY: Report any potential security bug to us via our HackerOne page (https://hackerone.com/nextcloud) following our security policy (https://nextcloud.com/security/) instead of filing an issue in our bug tracker.
|
||||
|
||||
* The issues in other components should be reported in their respective repositories: You will find them in our GitHub Organization (https://github.com/nextcloud/)
|
||||
|
||||
* You can also use the Issue Template app to prefill most of the required information: https://apps.nextcloud.com/apps/issuetemplate
|
||||
-->
|
||||
|
||||
<!--- Please keep this note for other contributors -->
|
||||
|
||||
### How to use GitHub
|
||||
|
||||
* Please use the 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to show that you are affected by the same issue.
|
||||
* Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
|
||||
* Subscribe to receive notifications on status change and new comments.
|
||||
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Client details:**
|
||||
- OS: [e.g. iOS]
|
||||
- Browser [e.g. chrome, safari]
|
||||
- Version [e.g. 22]
|
||||
- Device: [e.g. iPhone6, desktop]
|
||||
|
||||
<details>
|
||||
<summary>Server details</summary>
|
||||
<!--
|
||||
You can use the Issue Template application to prefill most of the required information: https://apps.nextcloud.com/apps/issuetemplate
|
||||
-->
|
||||
|
||||
**Operating system**:
|
||||
|
||||
**Web server:**
|
||||
|
||||
**Database:**
|
||||
|
||||
**PHP version:**
|
||||
|
||||
**Nextcloud version:** (see Nextcloud admin page)
|
||||
|
||||
**Where did you install Nextcloud from:**
|
||||
|
||||
**Signing status:**
|
||||
|
||||
```
|
||||
Login as admin user into your Nextcloud and access
|
||||
http://example.com/index.php/settings/integrity/failed
|
||||
paste the results here.
|
||||
```
|
||||
|
||||
**List of activated apps:**
|
||||
|
||||
```
|
||||
If you have access to your command line run e.g.:
|
||||
sudo -u www-data php occ app:list
|
||||
from within your Nextcloud installation folder
|
||||
```
|
||||
|
||||
**Nextcloud configuration:**
|
||||
|
||||
```
|
||||
If you have access to your command line run e.g.:
|
||||
sudo -u www-data php occ config:list system
|
||||
from within your Nextcloud installation folder
|
||||
|
||||
or
|
||||
|
||||
Insert your config.php content here
|
||||
Make sure to remove all sensitive content such as passwords. (e.g. database password, passwordsalt, secret, smtp password, …)
|
||||
```
|
||||
|
||||
**Are you using an external user-backend, if yes which one:** LDAP/ActiveDirectory/Webdav/...
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>Logs</summary>
|
||||
|
||||
#### Nextcloud log (data/nextcloud.log)
|
||||
```
|
||||
Insert your Nextcloud log here
|
||||
```
|
||||
|
||||
#### Browser log
|
||||
```
|
||||
Insert your browser log here, this could for example include:
|
||||
|
||||
a) The javascript console log
|
||||
b) The network log
|
||||
c) ...
|
||||
```
|
||||
|
||||
</details>
|
||||
39
.github/ISSUE_TEMPLATE/Feature_request.md
vendored
Normal file
39
.github/ISSUE_TEMPLATE/Feature_request.md
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
Thanks for reporting issues back!
|
||||
|
||||
Guidelines for submitting issues:
|
||||
|
||||
* Please search the existing issues first, it's likely that your issue was already reported or even fixed.
|
||||
|
||||
* SECURITY: Report any potential security bug to us via our HackerOne page (https://hackerone.com/nextcloud) following our security policy (https://nextcloud.com/security/) instead of filing an issue in our bug tracker.
|
||||
|
||||
* The issues in other components should be reported in their respective repositories: You will find them in our GitHub Organization (https://github.com/nextcloud/)
|
||||
|
||||
* You can also use the Issue Template app to prefill most of the required information: https://apps.nextcloud.com/apps/issuetemplate
|
||||
-->
|
||||
|
||||
<!--- Please keep this note for other contributors -->
|
||||
|
||||
### How to use GitHub
|
||||
|
||||
* Please use the 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to show that you are affected by the same issue.
|
||||
* Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
|
||||
* Subscribe to receive notifications on status change and new comments.
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
101
.github/dependabot.yml
vendored
Normal file
101
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,101 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: npm
|
||||
directory: "/"
|
||||
target-branch: "main"
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: saturday
|
||||
time: "03:00"
|
||||
timezone: Europe/Paris
|
||||
open-pull-requests-limit: 10
|
||||
reviewers:
|
||||
- juliushaertl
|
||||
- luka-nextcloud
|
||||
|
||||
- package-ecosystem: npm
|
||||
target-branch: stable29
|
||||
versioning-strategy: lockfile-only
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: saturday
|
||||
time: "03:00"
|
||||
timezone: Europe/Paris
|
||||
ignore:
|
||||
- dependency-name: "*"
|
||||
update-types: ["version-update:semver-major"]
|
||||
open-pull-requests-limit: 30
|
||||
labels:
|
||||
- 3. to review
|
||||
- dependencies
|
||||
|
||||
- package-ecosystem: npm
|
||||
target-branch: stable28
|
||||
versioning-strategy: lockfile-only
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: saturday
|
||||
time: "03:00"
|
||||
timezone: Europe/Paris
|
||||
ignore:
|
||||
- dependency-name: "*"
|
||||
update-types: ["version-update:semver-major"]
|
||||
open-pull-requests-limit: 30
|
||||
labels:
|
||||
- 3. to review
|
||||
- dependencies
|
||||
|
||||
- package-ecosystem: npm
|
||||
target-branch: stable27
|
||||
versioning-strategy: lockfile-only
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: saturday
|
||||
time: "03:00"
|
||||
timezone: Europe/Paris
|
||||
ignore:
|
||||
- dependency-name: "*"
|
||||
update-types: ["version-update:semver-major"]
|
||||
open-pull-requests-limit: 30
|
||||
labels:
|
||||
- 3. to review
|
||||
- dependencies
|
||||
|
||||
- package-ecosystem: composer
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: saturday
|
||||
time: "03:00"
|
||||
timezone: Europe/Paris
|
||||
open-pull-requests-limit: 10
|
||||
reviewers:
|
||||
- juliushaertl
|
||||
- luka-nextcloud
|
||||
|
||||
- package-ecosystem: composer
|
||||
directory: "/tests/integration"
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: saturday
|
||||
time: "03:00"
|
||||
timezone: Europe/Paris
|
||||
open-pull-requests-limit: 10
|
||||
reviewers:
|
||||
- juliushaertl
|
||||
- luka-nextcloud
|
||||
|
||||
- package-ecosystem: github-actions
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: saturday
|
||||
time: "03:00"
|
||||
timezone: Europe/Paris
|
||||
open-pull-requests-limit: 10
|
||||
reviewers:
|
||||
- juliushaertl
|
||||
- luka-nextcloud
|
||||
17
.github/pull_request_template.md
vendored
Normal file
17
.github/pull_request_template.md
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
* Resolves: # <!-- related github issue -->
|
||||
* Target version: main
|
||||
|
||||
### Summary
|
||||
|
||||
|
||||
### TODO
|
||||
|
||||
- [ ] ...
|
||||
|
||||
### Checklist
|
||||
|
||||
- [ ] Code is properly formatted
|
||||
- [ ] Sign-off message is added to all commits
|
||||
- [ ] Tests (unit, integration, api and/or acceptance) are included
|
||||
- [ ] Documentation (manuals or wiki) has been updated or is not required
|
||||
@@ -2,11 +2,10 @@ name: Package build
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'mod*'
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
- stable*
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -17,37 +16,28 @@ jobs:
|
||||
node-version: [16.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4.2.2
|
||||
- uses: actions/checkout@v4.1.7
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v4.4.0
|
||||
uses: actions/setup-node@v4.0.3
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- name: Set up npm7
|
||||
run: npm i -g npm@7
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@2.34.1
|
||||
uses: shivammathur/setup-php@2.31.1
|
||||
with:
|
||||
php-version: '7.4'
|
||||
tools: composer
|
||||
- name: install dependencies
|
||||
run: |
|
||||
wget https://github.com/ChristophWurst/krankerl/releases/download/v0.13.3/krankerl_0.13.3_amd64.deb
|
||||
sudo dpkg -i krankerl_0.13.3_amd64.deb
|
||||
wget https://github.com/ChristophWurst/krankerl/releases/download/v0.14.0/krankerl_0.14.0_amd64.deb
|
||||
sudo dpkg -i krankerl_0.14.0_amd64.deb
|
||||
- name: package
|
||||
run: |
|
||||
uname -a
|
||||
RUST_BACKTRACE=1 krankerl --version
|
||||
RUST_BACKTRACE=1 krankerl package
|
||||
- uses: https://data.forgejo.org/forgejo/upload-artifact@v4
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Deck app tarball
|
||||
path: build/artifacts/deck.tar.gz
|
||||
- name: Attach tarball to release
|
||||
uses: svenstaro/upload-release-action@81c65b7cd4de9b2570615ce3aad67a41de5b1a13 # v2
|
||||
id: attach_to_release
|
||||
with:
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
file: build/artifacts/deck.tar.gz
|
||||
asset_name: deck.tar.gz
|
||||
tag: ${{ github.ref }}
|
||||
overwrite: true
|
||||
191
.github/workflows/appstore-build-publish.yml
vendored
Normal file
191
.github/workflows/appstore-build-publish.yml
vendored
Normal file
@@ -0,0 +1,191 @@
|
||||
# This workflow is provided via the organization template repository
|
||||
#
|
||||
# https://github.com/nextcloud/.github
|
||||
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: Build and publish app release
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
build_and_publish:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
# Only allowed to be run on nextcloud-releases repositories
|
||||
if: ${{ github.repository_owner == 'nextcloud-releases' }}
|
||||
|
||||
steps:
|
||||
- name: Check actor permission
|
||||
uses: skjnldsv/check-actor-permission@69e92a3c4711150929bca9fcf34448c5bf5526e7 # v3.0
|
||||
with:
|
||||
require: write
|
||||
|
||||
- name: Set app env
|
||||
run: |
|
||||
# Split and keep last
|
||||
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
|
||||
echo "APP_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
with:
|
||||
persist-credentials: false
|
||||
path: ${{ env.APP_NAME }}
|
||||
|
||||
- name: Get app version number
|
||||
id: app-version
|
||||
uses: skjnldsv/xpath-action@f5b036e9d973f42c86324833fd00be90665fbf77 # master
|
||||
with:
|
||||
filename: ${{ env.APP_NAME }}/appinfo/info.xml
|
||||
expression: "//info//version/text()"
|
||||
|
||||
- name: Validate app version against tag
|
||||
run: |
|
||||
[ "${{ env.APP_VERSION }}" = "v${{ fromJSON(steps.app-version.outputs.result).version }}" ]
|
||||
|
||||
- name: Get appinfo data
|
||||
id: appinfo
|
||||
uses: skjnldsv/xpath-action@f5b036e9d973f42c86324833fd00be90665fbf77 # master
|
||||
with:
|
||||
filename: ${{ env.APP_NAME }}/appinfo/info.xml
|
||||
expression: "//info//dependencies//nextcloud/@min-version"
|
||||
|
||||
- name: Read package.json node and npm engines version
|
||||
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
|
||||
id: versions
|
||||
# Continue if no package.json
|
||||
continue-on-error: true
|
||||
with:
|
||||
path: ${{ env.APP_NAME }}
|
||||
fallbackNode: '^20'
|
||||
fallbackNpm: '^10'
|
||||
|
||||
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
|
||||
# Skip if no package.json
|
||||
if: ${{ steps.versions.outputs.nodeVersion }}
|
||||
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
|
||||
with:
|
||||
node-version: ${{ steps.versions.outputs.nodeVersion }}
|
||||
|
||||
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
|
||||
# Skip if no package.json
|
||||
if: ${{ steps.versions.outputs.npmVersion }}
|
||||
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
|
||||
|
||||
- name: Get php version
|
||||
id: php-versions
|
||||
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1
|
||||
with:
|
||||
filename: ${{ env.APP_NAME }}/appinfo/info.xml
|
||||
|
||||
- name: Set up php ${{ steps.php-versions.outputs.php-min }}
|
||||
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
|
||||
with:
|
||||
php-version: ${{ steps.php-versions.outputs.php-min }}
|
||||
coverage: none
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Check composer.json
|
||||
id: check_composer
|
||||
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0
|
||||
with:
|
||||
files: "${{ env.APP_NAME }}/composer.json"
|
||||
|
||||
- name: Install composer dependencies
|
||||
if: steps.check_composer.outputs.files_exists == 'true'
|
||||
run: |
|
||||
cd ${{ env.APP_NAME }}
|
||||
composer install --no-dev
|
||||
|
||||
- name: Build ${{ env.APP_NAME }}
|
||||
# Skip if no package.json
|
||||
if: ${{ steps.versions.outputs.nodeVersion }}
|
||||
env:
|
||||
CYPRESS_INSTALL_BINARY: 0
|
||||
run: |
|
||||
cd ${{ env.APP_NAME }}
|
||||
npm ci
|
||||
npm run build --if-present
|
||||
|
||||
- name: Check Krankerl config
|
||||
id: krankerl
|
||||
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0
|
||||
with:
|
||||
files: ${{ env.APP_NAME }}/krankerl.toml
|
||||
|
||||
- name: Install Krankerl
|
||||
if: steps.krankerl.outputs.files_exists == 'true'
|
||||
run: |
|
||||
wget https://github.com/ChristophWurst/krankerl/releases/download/v0.14.0/krankerl_0.14.0_amd64.deb
|
||||
sudo dpkg -i krankerl_0.14.0_amd64.deb
|
||||
|
||||
- name: Package ${{ env.APP_NAME }} ${{ env.APP_VERSION }} with krankerl
|
||||
if: steps.krankerl.outputs.files_exists == 'true'
|
||||
run: |
|
||||
cd ${{ env.APP_NAME }}
|
||||
krankerl package
|
||||
|
||||
- name: Package ${{ env.APP_NAME }} ${{ env.APP_VERSION }} with makefile
|
||||
if: steps.krankerl.outputs.files_exists != 'true'
|
||||
run: |
|
||||
cd ${{ env.APP_NAME }}
|
||||
make appstore
|
||||
|
||||
- name: Checkout server ${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}
|
||||
continue-on-error: true
|
||||
id: server-checkout
|
||||
run: |
|
||||
NCVERSION='${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}'
|
||||
wget --quiet https://download.nextcloud.com/server/releases/latest-$NCVERSION.zip
|
||||
unzip latest-$NCVERSION.zip
|
||||
|
||||
- name: Checkout server master fallback
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
if: ${{ steps.server-checkout.outcome != 'success' }}
|
||||
with:
|
||||
persist-credentials: false
|
||||
submodules: true
|
||||
repository: nextcloud/server
|
||||
path: nextcloud
|
||||
|
||||
- name: Sign app
|
||||
run: |
|
||||
# Extracting release
|
||||
cd ${{ env.APP_NAME }}/build/artifacts
|
||||
tar -xvf ${{ env.APP_NAME }}.tar.gz
|
||||
cd ../../../
|
||||
# Setting up keys
|
||||
echo '${{ secrets.APP_PRIVATE_KEY }}' > ${{ env.APP_NAME }}.key
|
||||
wget --quiet "https://github.com/nextcloud/app-certificate-requests/raw/master/${{ env.APP_NAME }}/${{ env.APP_NAME }}.crt"
|
||||
# Signing
|
||||
php nextcloud/occ integrity:sign-app --privateKey=../${{ env.APP_NAME }}.key --certificate=../${{ env.APP_NAME }}.crt --path=../${{ env.APP_NAME }}/build/artifacts/${{ env.APP_NAME }}
|
||||
# Rebuilding archive
|
||||
cd ${{ env.APP_NAME }}/build/artifacts
|
||||
tar -zcvf ${{ env.APP_NAME }}.tar.gz ${{ env.APP_NAME }}
|
||||
|
||||
- name: Attach tarball to github release
|
||||
uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # v2
|
||||
id: attach_to_release
|
||||
with:
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
file: ${{ env.APP_NAME }}/build/artifacts/${{ env.APP_NAME }}.tar.gz
|
||||
asset_name: ${{ env.APP_NAME }}-${{ env.APP_VERSION }}.tar.gz
|
||||
tag: ${{ github.ref }}
|
||||
overwrite: true
|
||||
|
||||
- name: Upload app to Nextcloud appstore
|
||||
uses: nextcloud-releases/nextcloud-appstore-push-action@a011fe619bcf6e77ddebc96f9908e1af4071b9c1 # v1
|
||||
with:
|
||||
app_name: ${{ env.APP_NAME }}
|
||||
appstore_token: ${{ secrets.APPSTORE_TOKEN }}
|
||||
download_url: ${{ steps.attach_to_release.outputs.browser_download_url }}
|
||||
app_private_key: ${{ secrets.APP_PRIVATE_KEY }}
|
||||
51
.github/workflows/command-rebase.yml
vendored
Normal file
51
.github/workflows/command-rebase.yml
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
# This workflow is provided via the organization template repository
|
||||
#
|
||||
# https://github.com/nextcloud/.github
|
||||
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
|
||||
|
||||
name: Rebase command
|
||||
|
||||
on:
|
||||
issue_comment:
|
||||
types: created
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
rebase:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: none
|
||||
|
||||
# On pull requests and if the comment starts with `/rebase`
|
||||
if: github.event.issue.pull_request != '' && startsWith(github.event.comment.body, '/rebase')
|
||||
|
||||
steps:
|
||||
- name: Add reaction on start
|
||||
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
|
||||
with:
|
||||
token: ${{ secrets.COMMAND_BOT_PAT }}
|
||||
repository: ${{ github.event.repository.full_name }}
|
||||
comment-id: ${{ github.event.comment.id }}
|
||||
reaction-type: "+1"
|
||||
|
||||
- name: Checkout the latest code
|
||||
uses: actions/checkout@v4.1.7 # v3.5.2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.COMMAND_BOT_PAT }}
|
||||
|
||||
- name: Automatic Rebase
|
||||
uses: cirrus-actions/rebase@b87d48154a87a85666003575337e27b8cd65f691 # 1.8
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.COMMAND_BOT_PAT }}
|
||||
|
||||
- name: Add reaction on failure
|
||||
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
|
||||
if: failure()
|
||||
with:
|
||||
token: ${{ secrets.COMMAND_BOT_PAT }}
|
||||
repository: ${{ github.event.repository.full_name }}
|
||||
comment-id: ${{ github.event.comment.id }}
|
||||
reaction-type: "-1"
|
||||
153
.github/workflows/cypress-e2e.yml
vendored
Normal file
153
.github/workflows/cypress-e2e.yml
vendored
Normal file
@@ -0,0 +1,153 @@
|
||||
name: Cypress
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- stable*
|
||||
|
||||
env:
|
||||
APP_NAME: deck
|
||||
CYPRESS_baseUrl: http://localhost:8081/index.php
|
||||
|
||||
jobs:
|
||||
cypress:
|
||||
|
||||
runs-on: 'ubuntu-latest'
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node-version: [20.x]
|
||||
# containers: [1, 2, 3]
|
||||
php-versions: [ '8.2' ]
|
||||
server-versions: [ 'stable30' ]
|
||||
|
||||
env:
|
||||
extensions: mbstring, iconv, fileinfo, intl, sqlite, pdo_sqlite, zip, gd, apcu
|
||||
key: cache-v1
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: ghcr.io/nextcloud/continuous-integration-postgres-14:latest
|
||||
ports:
|
||||
- 4444:5432/tcp
|
||||
env:
|
||||
POSTGRES_USER: root
|
||||
POSTGRES_PASSWORD: rootpassword
|
||||
POSTGRES_DB: nextcloud
|
||||
options: --health-cmd pg_isready --health-interval 5s --health-timeout 2s --health-retries 5
|
||||
|
||||
steps:
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v4.0.3
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
|
||||
- name: Register text Git reference
|
||||
run: |
|
||||
text_app_ref="$(if [ "${{ matrix.server-versions }}" = "master" ]; then echo -n "main"; else echo -n "${{ matrix.server-versions }}"; fi)"
|
||||
echo "text_app_ref=$text_app_ref" >> $GITHUB_ENV
|
||||
|
||||
- name: Checkout server
|
||||
uses: actions/checkout@v4.1.7
|
||||
with:
|
||||
repository: nextcloud/server
|
||||
ref: ${{ matrix.server-versions }}
|
||||
|
||||
- name: Checkout submodules
|
||||
shell: bash
|
||||
run: |
|
||||
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
|
||||
git submodule sync --recursive
|
||||
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
|
||||
|
||||
- name: Checkout ${{ env.APP_NAME }}
|
||||
uses: actions/checkout@v4.1.7
|
||||
with:
|
||||
path: apps/${{ env.APP_NAME }}
|
||||
|
||||
- name: Checkout text
|
||||
uses: actions/checkout@v4.1.7
|
||||
with:
|
||||
repository: nextcloud/text
|
||||
ref: ${{ env.text_app_ref }}
|
||||
path: apps/text
|
||||
|
||||
- name: Setup cache environment
|
||||
id: extcache
|
||||
uses: shivammathur/cache-extensions@v1
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
extensions: ${{ env.extensions }}
|
||||
key: ${{ env.key }}
|
||||
|
||||
- name: Cache extensions
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ steps.extcache.outputs.dir }}
|
||||
key: ${{ steps.extcache.outputs.key }}
|
||||
restore-keys: ${{ steps.extcache.outputs.key }}
|
||||
|
||||
- name: Set up php ${{ matrix.php-versions }}
|
||||
uses: shivammathur/setup-php@2.31.1
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
extensions: ${{ env.extensions }}
|
||||
ini-values:
|
||||
apc.enable_cli=on
|
||||
coverage: none
|
||||
|
||||
- name: Install composer dependencies
|
||||
working-directory: apps/${{ env.APP_NAME }}
|
||||
run: |
|
||||
composer install --no-dev
|
||||
|
||||
- name: Set up Nextcloud
|
||||
env:
|
||||
DB_PORT: 4444
|
||||
PHP_CLI_SERVER_WORKERS: 20
|
||||
run: |
|
||||
mkdir data
|
||||
echo '<?php $CONFIG=["memcache.local"=>"\OC\Memcache\APCu","hashing_default_password"=>true];' > config/config.php
|
||||
php occ maintenance:install --verbose --database=pgsql --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin
|
||||
php occ background:cron
|
||||
php -f index.php
|
||||
php -S 0.0.0.0:8081 &
|
||||
export OC_PASS=1234561
|
||||
php occ user:add --password-from-env user1
|
||||
php occ user:add --password-from-env user2
|
||||
php occ app:enable deck
|
||||
php occ app:list
|
||||
curl -v http://localhost:8081/index.php/login
|
||||
|
||||
- name: Cypress run
|
||||
uses: cypress-io/github-action@v6
|
||||
with:
|
||||
build: npm run dev
|
||||
record: false
|
||||
parallel: false
|
||||
browser: chrome
|
||||
wait-on: '${{ env.CYPRESS_baseUrl }}'
|
||||
working-directory: 'apps/${{ env.APP_NAME }}'
|
||||
config: defaultCommandTimeout=10000,video=false
|
||||
env:
|
||||
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
|
||||
npm_package_name: ${{ env.APP_NAME }}
|
||||
|
||||
- name: Upload test failure screenshots
|
||||
uses: actions/upload-artifact@v4
|
||||
if: failure()
|
||||
with:
|
||||
name: Upload screenshots
|
||||
path: apps/${{ env.APP_NAME }}/cypress/screenshots/
|
||||
retention-days: 5
|
||||
|
||||
- name: Upload nextcloud logs
|
||||
uses: actions/upload-artifact@v4
|
||||
if: failure()
|
||||
with:
|
||||
name: Upload nextcloud log
|
||||
path: data/nextcloud.log
|
||||
retention-days: 5
|
||||
49
.github/workflows/dependabot-approve-merge.yml
vendored
Normal file
49
.github/workflows/dependabot-approve-merge.yml
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
# This workflow is provided via the organization template repository
|
||||
#
|
||||
# https://github.com/nextcloud/.github
|
||||
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: Dependabot
|
||||
|
||||
on:
|
||||
pull_request_target: # zizmor: ignore[dangerous-triggers]
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
- stable*
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: dependabot-approve-merge-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
auto-approve-merge:
|
||||
if: github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'renovate[bot]'
|
||||
runs-on: ubuntu-latest-low
|
||||
permissions:
|
||||
# for hmarr/auto-approve-action to approve PRs
|
||||
pull-requests: write
|
||||
|
||||
steps:
|
||||
- name: Disabled on forks
|
||||
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
|
||||
run: |
|
||||
echo 'Can not approve PRs from forks'
|
||||
exit 1
|
||||
|
||||
# GitHub actions bot approve
|
||||
- uses: hmarr/auto-approve-action@b40d6c9ed2fa10c9a2749eca7eb004418a705501 # v2
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
# Nextcloud bot approve and merge request
|
||||
- uses: ahmadnassri/action-dependabot-auto-merge@45fc124d949b19b6b8bf6645b6c9d55f4f9ac61a # v2
|
||||
with:
|
||||
target: minor
|
||||
github-token: ${{ secrets.DEPENDABOT_AUTOMERGE_TOKEN }}
|
||||
36
.github/workflows/fixup.yml
vendored
Normal file
36
.github/workflows/fixup.yml
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
# This workflow is provided via the organization template repository
|
||||
#
|
||||
# https://github.com/nextcloud/.github
|
||||
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: Block fixup and squash commits
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, ready_for_review, reopened, synchronize]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: fixup-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
commit-message-check:
|
||||
if: github.event.pull_request.draft == false
|
||||
|
||||
permissions:
|
||||
pull-requests: write
|
||||
name: Block fixup and squash commits
|
||||
|
||||
runs-on: ubuntu-latest-low
|
||||
|
||||
steps:
|
||||
- name: Run check
|
||||
uses: skjnldsv/block-fixup-merge-action@c138ea99e45e186567b64cf065ce90f7158c236a # v2
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
161
.github/workflows/integration.yml
vendored
Normal file
161
.github/workflows/integration.yml
vendored
Normal file
@@ -0,0 +1,161 @@
|
||||
name: Integration tests
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/integration.yml'
|
||||
- 'appinfo/**'
|
||||
- 'lib/**'
|
||||
- 'templates/**'
|
||||
- 'tests/**'
|
||||
- 'composer.json'
|
||||
- 'composer.lock'
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
- stable*
|
||||
|
||||
env:
|
||||
APP_NAME: deck
|
||||
|
||||
jobs:
|
||||
integration:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
php-versions: ['8.1']
|
||||
databases: ['sqlite', 'mysql', 'pgsql']
|
||||
server-versions: ['stable30']
|
||||
|
||||
name: php${{ matrix.php-versions }}-${{ matrix.databases }}-${{ matrix.server-versions }}
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:14
|
||||
ports:
|
||||
- 4445:5432/tcp
|
||||
env:
|
||||
POSTGRES_USER: root
|
||||
POSTGRES_PASSWORD: rootpassword
|
||||
POSTGRES_DB: nextcloud
|
||||
options: --health-cmd pg_isready --health-interval 5s --health-timeout 2s --health-retries 5
|
||||
mysql:
|
||||
image: mariadb:10.5
|
||||
ports:
|
||||
- 4444:3306/tcp
|
||||
env:
|
||||
MYSQL_ROOT_PASSWORD: rootpassword
|
||||
options: --health-cmd="mysqladmin ping" --health-interval 5s --health-timeout 2s --health-retries 5
|
||||
|
||||
steps:
|
||||
- name: Checkout server
|
||||
uses: actions/checkout@v4.1.7
|
||||
with:
|
||||
repository: nextcloud/server
|
||||
ref: ${{ matrix.server-versions }}
|
||||
|
||||
- name: Checkout submodules
|
||||
shell: bash
|
||||
run: |
|
||||
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
|
||||
git submodule sync --recursive
|
||||
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
|
||||
cd build/integration && composer require --dev phpunit/phpunit:~9
|
||||
|
||||
- name: Checkout app
|
||||
uses: actions/checkout@v4.1.7
|
||||
with:
|
||||
path: apps/${{ env.APP_NAME }}
|
||||
|
||||
- name: Checkout activity
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
with:
|
||||
repository: nextcloud/activity
|
||||
ref: ${{ matrix.server-versions }}
|
||||
path: apps/activity
|
||||
|
||||
- name: Set up php ${{ matrix.php-versions }}
|
||||
uses: shivammathur/setup-php@2.31.1
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
extensions: mbstring, iconv, fileinfo, intl, sqlite, pdo_sqlite, mysql, pdo_mysql, pgsql, pdo_pgsql, apcu, gd
|
||||
ini-values:
|
||||
apc.enable_cli=on
|
||||
coverage: none
|
||||
|
||||
- name: Set up dependencies
|
||||
working-directory: apps/${{ env.APP_NAME }}
|
||||
run: composer i --no-dev
|
||||
|
||||
- name: Set up Nextcloud
|
||||
run: |
|
||||
if [ "${{ matrix.databases }}" = "mysql" ]; then
|
||||
export DB_PORT=4444
|
||||
elif [ "${{ matrix.databases }}" = "pgsql" ]; then
|
||||
export DB_PORT=4445
|
||||
fi
|
||||
mkdir data
|
||||
./occ maintenance:install --verbose --database=${{ matrix.databases }} --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin
|
||||
./occ config:system:set hashing_default_password --value=true --type=boolean
|
||||
./occ config:system:set memcache.local --value="\\OC\\Memcache\\APCu"
|
||||
./occ config:system:set memcache.distributed --value="\\OC\\Memcache\\APCu"
|
||||
cat config/config.php
|
||||
./occ user:list
|
||||
./occ app:enable --force ${{ env.APP_NAME }}
|
||||
./occ config:system:set query_log_file --value "$PWD/query.log"
|
||||
php -S localhost:8080 &
|
||||
|
||||
- name: Run behat
|
||||
working-directory: apps/${{ env.APP_NAME }}/tests/integration
|
||||
run: ./run.sh
|
||||
|
||||
- name: Query count
|
||||
if: ${{ matrix.databases == 'mysql' }}
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||
script: |
|
||||
let myOutput = ''
|
||||
let myError = ''
|
||||
|
||||
const options = {}
|
||||
options.listeners = {
|
||||
stdout: (data) => {
|
||||
myOutput += data.toString()
|
||||
},
|
||||
stderr: (data) => {
|
||||
myError += data.toString()
|
||||
}
|
||||
}
|
||||
await exec.exec(`/bin/bash -c "cat query.log | wc -l"`, [], options)
|
||||
msg = myOutput
|
||||
const queryCount = parseInt(myOutput, 10)
|
||||
|
||||
myOutput = ''
|
||||
await exec.exec('cat', ['apps/${{ env.APP_NAME }}/tests/integration/base-query-count.txt'], options)
|
||||
const baseCount = parseInt(myOutput, 10)
|
||||
|
||||
const absoluteIncrease = queryCount - baseCount
|
||||
const relativeIncrease = baseCount <= 0 ? 100 : (parseInt((absoluteIncrease / baseCount * 10000), 10) / 100)
|
||||
|
||||
if (absoluteIncrease >= 100 || relativeIncrease > 5) {
|
||||
const comment = `🐢 Performance warning.\nIt looks like the query count of the integration tests increased with this PR.\nDatabase query count is now ` + queryCount + ' was ' + baseCount + ' (+' + relativeIncrease + '%)\nPlease check your code again. If you added a new test this can be expected and the base value in tests/integration/base-query-count.txt can be increased.'
|
||||
github.rest.issues.createComment({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: comment
|
||||
})
|
||||
}
|
||||
if (queryCount < 100) {
|
||||
const comment = `🐈 Performance messuring seems broken. Failed to get query count.`
|
||||
github.rest.issues.createComment({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: comment
|
||||
})
|
||||
}
|
||||
98
.github/workflows/lint-eslint.yml
vendored
Normal file
98
.github/workflows/lint-eslint.yml
vendored
Normal file
@@ -0,0 +1,98 @@
|
||||
# This workflow is provided via the organization template repository
|
||||
#
|
||||
# https://github.com/nextcloud/.github
|
||||
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: Lint eslint
|
||||
|
||||
on: pull_request
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: lint-eslint-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
changes:
|
||||
runs-on: ubuntu-latest-low
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: read
|
||||
|
||||
outputs:
|
||||
src: ${{ steps.changes.outputs.src}}
|
||||
|
||||
steps:
|
||||
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
|
||||
id: changes
|
||||
continue-on-error: true
|
||||
with:
|
||||
filters: |
|
||||
src:
|
||||
- '.github/workflows/**'
|
||||
- 'src/**'
|
||||
- 'appinfo/info.xml'
|
||||
- 'package.json'
|
||||
- 'package-lock.json'
|
||||
- 'tsconfig.json'
|
||||
- '.eslintrc.*'
|
||||
- '.eslintignore'
|
||||
- '**.js'
|
||||
- '**.ts'
|
||||
- '**.vue'
|
||||
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
needs: changes
|
||||
if: needs.changes.outputs.src != 'false'
|
||||
|
||||
name: NPM lint
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
|
||||
- name: Read package.json node and npm engines version
|
||||
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
|
||||
id: versions
|
||||
with:
|
||||
fallbackNode: '^20'
|
||||
fallbackNpm: '^10'
|
||||
|
||||
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
|
||||
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
|
||||
with:
|
||||
node-version: ${{ steps.versions.outputs.nodeVersion }}
|
||||
|
||||
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
|
||||
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
|
||||
|
||||
- name: Install dependencies
|
||||
env:
|
||||
CYPRESS_INSTALL_BINARY: 0
|
||||
PUPPETEER_SKIP_DOWNLOAD: true
|
||||
run: npm ci
|
||||
|
||||
- name: Lint
|
||||
run: npm run lint
|
||||
|
||||
summary:
|
||||
permissions:
|
||||
contents: none
|
||||
runs-on: ubuntu-latest-low
|
||||
needs: [changes, lint]
|
||||
|
||||
if: always()
|
||||
|
||||
# This is the summary, we just avoid to rename it so that branch protection rules still match
|
||||
name: eslint
|
||||
|
||||
steps:
|
||||
- name: Summary status
|
||||
run: if ${{ needs.changes.outputs.src != 'false' && needs.lint.result != 'success' }}; then exit 1; fi
|
||||
50
.github/workflows/lint-php-cs.yml
vendored
Normal file
50
.github/workflows/lint-php-cs.yml
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
# This workflow is provided via the organization template repository
|
||||
#
|
||||
# https://github.com/nextcloud/.github
|
||||
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: Lint php-cs
|
||||
|
||||
on: pull_request
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: lint-php-cs-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
name: php-cs
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
|
||||
- name: Get php version
|
||||
id: versions
|
||||
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1
|
||||
|
||||
- name: Set up php${{ steps.versions.outputs.php-available }}
|
||||
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
|
||||
with:
|
||||
php-version: ${{ steps.versions.outputs.php-min }}
|
||||
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
|
||||
coverage: none
|
||||
ini-file: development
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
composer remove nextcloud/ocp --dev
|
||||
composer i
|
||||
|
||||
- name: Lint
|
||||
run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 )
|
||||
70
.github/workflows/lint-php.yml
vendored
Normal file
70
.github/workflows/lint-php.yml
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
# This workflow is provided via the organization template repository
|
||||
#
|
||||
# https://github.com/nextcloud/.github
|
||||
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: Lint php
|
||||
|
||||
on: pull_request
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: lint-php-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
matrix:
|
||||
runs-on: ubuntu-latest-low
|
||||
outputs:
|
||||
php-versions: ${{ steps.versions.outputs.php-versions }}
|
||||
steps:
|
||||
- name: Checkout app
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
- name: Get version matrix
|
||||
id: versions
|
||||
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.0.0
|
||||
|
||||
php-lint:
|
||||
runs-on: ubuntu-latest
|
||||
needs: matrix
|
||||
strategy:
|
||||
matrix:
|
||||
php-versions: ${{fromJson(needs.matrix.outputs.php-versions)}}
|
||||
|
||||
name: php-lint
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
|
||||
- name: Set up php ${{ matrix.php-versions }}
|
||||
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
|
||||
coverage: none
|
||||
ini-file: development
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Lint
|
||||
run: composer run lint
|
||||
|
||||
summary:
|
||||
permissions:
|
||||
contents: none
|
||||
runs-on: ubuntu-latest-low
|
||||
needs: php-lint
|
||||
|
||||
if: always()
|
||||
|
||||
name: php-lint-summary
|
||||
|
||||
steps:
|
||||
- name: Summary status
|
||||
run: if ${{ needs.php-lint.result != 'success' && needs.php-lint.result != 'skipped' }}; then exit 1; fi
|
||||
51
.github/workflows/lint-stylelint.yml
vendored
Normal file
51
.github/workflows/lint-stylelint.yml
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
# This workflow is provided via the organization template repository
|
||||
#
|
||||
# https://github.com/nextcloud/.github
|
||||
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: Lint stylelint
|
||||
|
||||
on: pull_request
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: lint-stylelint-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
name: stylelint
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
|
||||
- name: Read package.json node and npm engines version
|
||||
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
|
||||
id: versions
|
||||
with:
|
||||
fallbackNode: '^20'
|
||||
fallbackNpm: '^10'
|
||||
|
||||
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
|
||||
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
|
||||
with:
|
||||
node-version: ${{ steps.versions.outputs.nodeVersion }}
|
||||
|
||||
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
|
||||
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
|
||||
|
||||
- name: Install dependencies
|
||||
env:
|
||||
CYPRESS_INSTALL_BINARY: 0
|
||||
run: npm ci
|
||||
|
||||
- name: Lint
|
||||
run: npm run stylelint
|
||||
34
.github/workflows/nodejs.yml
vendored
Normal file
34
.github/workflows/nodejs.yml
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
name: Node CI
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [14.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4.1.7
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v4.0.3
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- name: Set up npm7
|
||||
run: npm i -g npm@7
|
||||
- name: install dependencies
|
||||
run: |
|
||||
npm ci
|
||||
- name: build
|
||||
env:
|
||||
RELATIVE_CI_KEY: ${{ secrets.RELATIVE_CI_KEY }}
|
||||
RELATIVE_CI_SLUG: nextcloud/deck
|
||||
run: |
|
||||
mkdir -p js
|
||||
npm run build --if-present -- --profile --json | tail -n +6 > js/webpack-stats.json
|
||||
npx relative-ci-agent
|
||||
|
||||
|
||||
75
.github/workflows/npm-audit-fix.yml
vendored
Normal file
75
.github/workflows/npm-audit-fix.yml
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
# This workflow is provided via the organization template repository
|
||||
#
|
||||
# https://github.com/nextcloud/.github
|
||||
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: Npm audit fix and compile
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
# At 2:30 on Sundays
|
||||
- cron: '30 2 * * 0'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
branches: ['main', 'master', 'stable29', 'stable28', 'stable27']
|
||||
|
||||
name: npm-audit-fix-${{ matrix.branches }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
with:
|
||||
ref: ${{ matrix.branches }}
|
||||
|
||||
- name: Read package.json node and npm engines version
|
||||
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
|
||||
id: versions
|
||||
with:
|
||||
fallbackNode: '^20'
|
||||
fallbackNpm: '^10'
|
||||
|
||||
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
|
||||
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
|
||||
with:
|
||||
node-version: ${{ steps.versions.outputs.nodeVersion }}
|
||||
|
||||
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
|
||||
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
|
||||
|
||||
- name: Fix npm audit
|
||||
id: npm-audit
|
||||
uses: nextcloud-libraries/npm-audit-action@2a60bd2e79cc77f2cc4d9a3fe40f1a69896f3a87 # v0.1.0
|
||||
|
||||
- name: Run npm ci and npm run build
|
||||
if: always()
|
||||
env:
|
||||
CYPRESS_INSTALL_BINARY: 0
|
||||
run: |
|
||||
npm ci
|
||||
npm run build --if-present
|
||||
|
||||
- name: Create Pull Request
|
||||
if: always()
|
||||
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6.1.0
|
||||
with:
|
||||
token: ${{ secrets.COMMAND_BOT_PAT }}
|
||||
commit-message: 'fix(deps): Fix npm audit'
|
||||
committer: GitHub <noreply@github.com>
|
||||
author: nextcloud-command <nextcloud-command@users.noreply.github.com>
|
||||
signoff: true
|
||||
branch: automated/noid/${{ matrix.branches }}-fix-npm-audit
|
||||
title: '[${{ matrix.branches }}] Fix npm audit'
|
||||
body: ${{ steps.npm-audit.outputs.markdown }}
|
||||
labels: |
|
||||
dependencies
|
||||
3. to review
|
||||
198
.github/workflows/phpunit-mysql.yml
vendored
Normal file
198
.github/workflows/phpunit-mysql.yml
vendored
Normal file
@@ -0,0 +1,198 @@
|
||||
# This workflow is provided via the organization template repository
|
||||
#
|
||||
# https://github.com/nextcloud/.github
|
||||
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: PHPUnit MySQL
|
||||
|
||||
on: pull_request
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: phpunit-mysql-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
matrix:
|
||||
runs-on: ubuntu-latest-low
|
||||
outputs:
|
||||
matrix: ${{ steps.versions.outputs.sparse-matrix }}
|
||||
steps:
|
||||
- name: Checkout app
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
|
||||
- name: Get version matrix
|
||||
id: versions
|
||||
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1
|
||||
with:
|
||||
matrix: '{"mysql-versions": ["8.4"]}'
|
||||
|
||||
changes:
|
||||
runs-on: ubuntu-latest-low
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: read
|
||||
|
||||
outputs:
|
||||
src: ${{ steps.changes.outputs.src}}
|
||||
|
||||
steps:
|
||||
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
|
||||
id: changes
|
||||
continue-on-error: true
|
||||
with:
|
||||
filters: |
|
||||
src:
|
||||
- '.github/workflows/**'
|
||||
- 'appinfo/**'
|
||||
- 'lib/**'
|
||||
- 'templates/**'
|
||||
- 'tests/**'
|
||||
- 'vendor/**'
|
||||
- 'vendor-bin/**'
|
||||
- '.php-cs-fixer.dist.php'
|
||||
- 'composer.json'
|
||||
- 'composer.lock'
|
||||
|
||||
phpunit-mysql:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
needs: [changes, matrix]
|
||||
if: needs.changes.outputs.src != 'false'
|
||||
|
||||
strategy:
|
||||
matrix: ${{ fromJson(needs.matrix.outputs.matrix) }}
|
||||
|
||||
name: MySQL ${{ matrix.mysql-versions }} PHP ${{ matrix.php-versions }} Nextcloud ${{ matrix.server-versions }}
|
||||
|
||||
services:
|
||||
mysql:
|
||||
image: ghcr.io/nextcloud/continuous-integration-mysql-${{ matrix.mysql-versions }}:latest
|
||||
ports:
|
||||
- 4444:3306/tcp
|
||||
env:
|
||||
MYSQL_ROOT_PASSWORD: rootpassword
|
||||
options: --health-cmd="mysqladmin ping" --health-interval 5s --health-timeout 2s --health-retries 10
|
||||
|
||||
steps:
|
||||
- name: Set app env
|
||||
if: ${{ env.APP_NAME == '' }}
|
||||
run: |
|
||||
# Split and keep last
|
||||
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
|
||||
|
||||
- name: Checkout server
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
with:
|
||||
persist-credentials: false
|
||||
submodules: true
|
||||
repository: nextcloud/server
|
||||
ref: ${{ matrix.server-versions }}
|
||||
|
||||
- name: Checkout app
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
with:
|
||||
persist-credentials: false
|
||||
path: apps/${{ env.APP_NAME }}
|
||||
|
||||
- name: Set up php ${{ matrix.php-versions }}
|
||||
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
|
||||
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, mysql, pdo_mysql
|
||||
coverage: none
|
||||
ini-file: development
|
||||
# Temporary workaround for missing pcntl_* in PHP 8.3
|
||||
ini-values: disable_functions=
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Enable ONLY_FULL_GROUP_BY MySQL option
|
||||
run: |
|
||||
echo "SET GLOBAL sql_mode=(SELECT CONCAT(@@sql_mode,',ONLY_FULL_GROUP_BY'));" | mysql -h 127.0.0.1 -P 4444 -u root -prootpassword
|
||||
echo 'SELECT @@sql_mode;' | mysql -h 127.0.0.1 -P 4444 -u root -prootpassword
|
||||
|
||||
- name: Check composer file existence
|
||||
id: check_composer
|
||||
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0
|
||||
with:
|
||||
files: apps/${{ env.APP_NAME }}/composer.json
|
||||
|
||||
- name: Set up dependencies
|
||||
# Only run if phpunit config file exists
|
||||
if: steps.check_composer.outputs.files_exists == 'true'
|
||||
working-directory: apps/${{ env.APP_NAME }}
|
||||
run: |
|
||||
composer remove nextcloud/ocp --dev
|
||||
composer i
|
||||
|
||||
- name: Set up Nextcloud
|
||||
env:
|
||||
DB_PORT: 4444
|
||||
run: |
|
||||
mkdir data
|
||||
./occ maintenance:install --verbose --database=mysql --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin
|
||||
./occ app:enable --force ${{ env.APP_NAME }}
|
||||
|
||||
- name: Check PHPUnit script is defined
|
||||
id: check_phpunit
|
||||
continue-on-error: true
|
||||
working-directory: apps/${{ env.APP_NAME }}
|
||||
run: |
|
||||
composer run --list | grep '^ test:unit ' | wc -l | grep 1
|
||||
|
||||
- name: PHPUnit
|
||||
# Only run if phpunit config file exists
|
||||
if: steps.check_phpunit.outcome == 'success'
|
||||
working-directory: apps/${{ env.APP_NAME }}
|
||||
run: composer run test:unit
|
||||
|
||||
- name: Check PHPUnit integration script is defined
|
||||
id: check_integration
|
||||
continue-on-error: true
|
||||
working-directory: apps/${{ env.APP_NAME }}
|
||||
run: |
|
||||
composer run --list | grep '^ test:integration ' | wc -l | grep 1
|
||||
|
||||
- name: Run Nextcloud
|
||||
# Only run if phpunit integration config file exists
|
||||
if: steps.check_integration.outcome == 'success'
|
||||
run: php -S localhost:8080 &
|
||||
|
||||
- name: PHPUnit integration
|
||||
# Only run if phpunit integration config file exists
|
||||
if: steps.check_integration.outcome == 'success'
|
||||
working-directory: apps/${{ env.APP_NAME }}
|
||||
run: composer run test:integration
|
||||
|
||||
- name: Print logs
|
||||
if: always()
|
||||
run: |
|
||||
cat data/nextcloud.log
|
||||
|
||||
- name: Skipped
|
||||
# Fail the action when neither unit nor integration tests ran
|
||||
if: steps.check_phpunit.outcome == 'failure' && steps.check_integration.outcome == 'failure'
|
||||
run: |
|
||||
echo 'Neither PHPUnit nor PHPUnit integration tests are specified in composer.json scripts'
|
||||
exit 1
|
||||
|
||||
summary:
|
||||
permissions:
|
||||
contents: none
|
||||
runs-on: ubuntu-latest-low
|
||||
needs: [changes, phpunit-mysql]
|
||||
|
||||
if: always()
|
||||
|
||||
name: phpunit-mysql-summary
|
||||
|
||||
steps:
|
||||
- name: Summary status
|
||||
run: if ${{ needs.changes.outputs.src != 'false' && needs.phpunit-mysql.result != 'success' }}; then exit 1; fi
|
||||
196
.github/workflows/phpunit-pgsql.yml
vendored
Normal file
196
.github/workflows/phpunit-pgsql.yml
vendored
Normal file
@@ -0,0 +1,196 @@
|
||||
# This workflow is provided via the organization template repository
|
||||
#
|
||||
# https://github.com/nextcloud/.github
|
||||
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: PHPUnit PostgreSQL
|
||||
|
||||
on: pull_request
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: phpunit-pgsql-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
matrix:
|
||||
runs-on: ubuntu-latest-low
|
||||
outputs:
|
||||
php-version: ${{ steps.versions.outputs.php-available-list }}
|
||||
server-max: ${{ steps.versions.outputs.branches-max-list }}
|
||||
steps:
|
||||
- name: Checkout app
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
|
||||
- name: Get version matrix
|
||||
id: versions
|
||||
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1
|
||||
|
||||
changes:
|
||||
runs-on: ubuntu-latest-low
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: read
|
||||
|
||||
outputs:
|
||||
src: ${{ steps.changes.outputs.src }}
|
||||
|
||||
steps:
|
||||
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
|
||||
id: changes
|
||||
continue-on-error: true
|
||||
with:
|
||||
filters: |
|
||||
src:
|
||||
- '.github/workflows/**'
|
||||
- 'appinfo/**'
|
||||
- 'lib/**'
|
||||
- 'templates/**'
|
||||
- 'tests/**'
|
||||
- 'vendor/**'
|
||||
- 'vendor-bin/**'
|
||||
- '.php-cs-fixer.dist.php'
|
||||
- 'composer.json'
|
||||
- 'composer.lock'
|
||||
|
||||
phpunit-pgsql:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
needs: [changes, matrix]
|
||||
if: needs.changes.outputs.src != 'false'
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
php-versions: ${{ fromJson(needs.matrix.outputs.php-version) }}
|
||||
server-versions: ${{ fromJson(needs.matrix.outputs.server-max) }}
|
||||
|
||||
name: PostgreSQL PHP ${{ matrix.php-versions }} Nextcloud ${{ matrix.server-versions }}
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: ghcr.io/nextcloud/continuous-integration-postgres-14:latest
|
||||
ports:
|
||||
- 4444:5432/tcp
|
||||
env:
|
||||
POSTGRES_USER: root
|
||||
POSTGRES_PASSWORD: rootpassword
|
||||
POSTGRES_DB: nextcloud
|
||||
options: --health-cmd pg_isready --health-interval 5s --health-timeout 2s --health-retries 5
|
||||
|
||||
steps:
|
||||
- name: Set app env
|
||||
if: ${{ env.APP_NAME == '' }}
|
||||
run: |
|
||||
# Split and keep last
|
||||
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
|
||||
|
||||
- name: Checkout server
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
with:
|
||||
persist-credentials: false
|
||||
submodules: true
|
||||
repository: nextcloud/server
|
||||
ref: ${{ matrix.server-versions }}
|
||||
|
||||
- name: Checkout app
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
with:
|
||||
persist-credentials: false
|
||||
path: apps/${{ env.APP_NAME }}
|
||||
|
||||
- name: Set up php ${{ matrix.php-versions }}
|
||||
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
|
||||
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, pgsql, pdo_pgsql
|
||||
coverage: none
|
||||
ini-file: development
|
||||
# Temporary workaround for missing pcntl_* in PHP 8.3
|
||||
ini-values: disable_functions=
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Check composer file existence
|
||||
id: check_composer
|
||||
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0
|
||||
with:
|
||||
files: apps/${{ env.APP_NAME }}/composer.json
|
||||
|
||||
- name: Set up dependencies
|
||||
# Only run if phpunit config file exists
|
||||
if: steps.check_composer.outputs.files_exists == 'true'
|
||||
working-directory: apps/${{ env.APP_NAME }}
|
||||
run: |
|
||||
composer remove nextcloud/ocp --dev
|
||||
composer i
|
||||
|
||||
- name: Set up Nextcloud
|
||||
env:
|
||||
DB_PORT: 4444
|
||||
run: |
|
||||
mkdir data
|
||||
./occ maintenance:install --verbose --database=pgsql --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin
|
||||
./occ app:enable --force ${{ env.APP_NAME }}
|
||||
|
||||
- name: Check PHPUnit script is defined
|
||||
id: check_phpunit
|
||||
continue-on-error: true
|
||||
working-directory: apps/${{ env.APP_NAME }}
|
||||
run: |
|
||||
composer run --list | grep '^ test:unit ' | wc -l | grep 1
|
||||
|
||||
- name: PHPUnit
|
||||
# Only run if phpunit config file exists
|
||||
if: steps.check_phpunit.outcome == 'success'
|
||||
working-directory: apps/${{ env.APP_NAME }}
|
||||
run: composer run test:unit
|
||||
|
||||
- name: Check PHPUnit integration script is defined
|
||||
id: check_integration
|
||||
continue-on-error: true
|
||||
working-directory: apps/${{ env.APP_NAME }}
|
||||
run: |
|
||||
composer run --list | grep '^ test:integration ' | wc -l | grep 1
|
||||
|
||||
- name: Run Nextcloud
|
||||
# Only run if phpunit integration config file exists
|
||||
if: steps.check_integration.outcome == 'success'
|
||||
run: php -S localhost:8080 &
|
||||
|
||||
- name: PHPUnit integration
|
||||
# Only run if phpunit integration config file exists
|
||||
if: steps.check_integration.outcome == 'success'
|
||||
working-directory: apps/${{ env.APP_NAME }}
|
||||
run: composer run test:integration
|
||||
|
||||
- name: Print logs
|
||||
if: always()
|
||||
run: |
|
||||
cat data/nextcloud.log
|
||||
|
||||
- name: Skipped
|
||||
# Fail the action when neither unit nor integration tests ran
|
||||
if: steps.check_phpunit.outcome == 'failure' && steps.check_integration.outcome == 'failure'
|
||||
run: |
|
||||
echo 'Neither PHPUnit nor PHPUnit integration tests are specified in composer.json scripts'
|
||||
exit 1
|
||||
|
||||
summary:
|
||||
permissions:
|
||||
contents: none
|
||||
runs-on: ubuntu-latest-low
|
||||
needs: [changes, phpunit-pgsql]
|
||||
|
||||
if: always()
|
||||
|
||||
name: phpunit-pgsql-summary
|
||||
|
||||
steps:
|
||||
- name: Summary status
|
||||
run: if ${{ needs.changes.outputs.src != 'false' && needs.phpunit-pgsql.result != 'success' }}; then exit 1; fi
|
||||
185
.github/workflows/phpunit-sqlite.yml
vendored
Normal file
185
.github/workflows/phpunit-sqlite.yml
vendored
Normal file
@@ -0,0 +1,185 @@
|
||||
# This workflow is provided via the organization template repository
|
||||
#
|
||||
# https://github.com/nextcloud/.github
|
||||
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: PHPUnit SQLite
|
||||
|
||||
on: pull_request
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: phpunit-sqlite-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
matrix:
|
||||
runs-on: ubuntu-latest-low
|
||||
outputs:
|
||||
php-version: ${{ steps.versions.outputs.php-available-list }}
|
||||
server-max: ${{ steps.versions.outputs.branches-max-list }}
|
||||
steps:
|
||||
- name: Checkout app
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
|
||||
- name: Get version matrix
|
||||
id: versions
|
||||
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1
|
||||
|
||||
changes:
|
||||
runs-on: ubuntu-latest-low
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: read
|
||||
|
||||
outputs:
|
||||
src: ${{ steps.changes.outputs.src}}
|
||||
|
||||
steps:
|
||||
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
|
||||
id: changes
|
||||
continue-on-error: true
|
||||
with:
|
||||
filters: |
|
||||
src:
|
||||
- '.github/workflows/**'
|
||||
- 'appinfo/**'
|
||||
- 'lib/**'
|
||||
- 'templates/**'
|
||||
- 'tests/**'
|
||||
- 'vendor/**'
|
||||
- 'vendor-bin/**'
|
||||
- '.php-cs-fixer.dist.php'
|
||||
- 'composer.json'
|
||||
- 'composer.lock'
|
||||
|
||||
phpunit-sqlite:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
needs: [changes, matrix]
|
||||
if: needs.changes.outputs.src != 'false'
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
php-versions: ${{ fromJson(needs.matrix.outputs.php-version) }}
|
||||
server-versions: ${{ fromJson(needs.matrix.outputs.server-max) }}
|
||||
|
||||
name: SQLite PHP ${{ matrix.php-versions }} Nextcloud ${{ matrix.server-versions }}
|
||||
|
||||
steps:
|
||||
- name: Set app env
|
||||
if: ${{ env.APP_NAME == '' }}
|
||||
run: |
|
||||
# Split and keep last
|
||||
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
|
||||
|
||||
- name: Checkout server
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
with:
|
||||
persist-credentials: false
|
||||
submodules: true
|
||||
repository: nextcloud/server
|
||||
ref: ${{ matrix.server-versions }}
|
||||
|
||||
- name: Checkout app
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
with:
|
||||
persist-credentials: false
|
||||
path: apps/${{ env.APP_NAME }}
|
||||
|
||||
- name: Set up php ${{ matrix.php-versions }}
|
||||
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
|
||||
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
|
||||
coverage: none
|
||||
ini-file: development
|
||||
# Temporary workaround for missing pcntl_* in PHP 8.3
|
||||
ini-values: disable_functions=
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Check composer file existence
|
||||
id: check_composer
|
||||
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0
|
||||
with:
|
||||
files: apps/${{ env.APP_NAME }}/composer.json
|
||||
|
||||
- name: Set up dependencies
|
||||
# Only run if phpunit config file exists
|
||||
if: steps.check_composer.outputs.files_exists == 'true'
|
||||
working-directory: apps/${{ env.APP_NAME }}
|
||||
run: |
|
||||
composer remove nextcloud/ocp --dev
|
||||
composer i
|
||||
|
||||
- name: Set up Nextcloud
|
||||
env:
|
||||
DB_PORT: 4444
|
||||
run: |
|
||||
mkdir data
|
||||
./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin
|
||||
./occ app:enable --force ${{ env.APP_NAME }}
|
||||
|
||||
- name: Check PHPUnit script is defined
|
||||
id: check_phpunit
|
||||
continue-on-error: true
|
||||
working-directory: apps/${{ env.APP_NAME }}
|
||||
run: |
|
||||
composer run --list | grep '^ test:unit ' | wc -l | grep 1
|
||||
|
||||
- name: PHPUnit
|
||||
# Only run if phpunit config file exists
|
||||
if: steps.check_phpunit.outcome == 'success'
|
||||
working-directory: apps/${{ env.APP_NAME }}
|
||||
run: composer run test:unit
|
||||
|
||||
- name: Check PHPUnit integration script is defined
|
||||
id: check_integration
|
||||
continue-on-error: true
|
||||
working-directory: apps/${{ env.APP_NAME }}
|
||||
run: |
|
||||
composer run --list | grep '^ test:integration ' | wc -l | grep 1
|
||||
|
||||
- name: Run Nextcloud
|
||||
# Only run if phpunit integration config file exists
|
||||
if: steps.check_integration.outcome == 'success'
|
||||
run: php -S localhost:8080 &
|
||||
|
||||
- name: PHPUnit integration
|
||||
# Only run if phpunit integration config file exists
|
||||
if: steps.check_integration.outcome == 'success'
|
||||
working-directory: apps/${{ env.APP_NAME }}
|
||||
run: composer run test:integration
|
||||
|
||||
- name: Print logs
|
||||
if: always()
|
||||
run: |
|
||||
cat data/nextcloud.log
|
||||
|
||||
- name: Skipped
|
||||
# Fail the action when neither unit nor integration tests ran
|
||||
if: steps.check_phpunit.outcome == 'failure' && steps.check_integration.outcome == 'failure'
|
||||
run: |
|
||||
echo 'Neither PHPUnit nor PHPUnit integration tests are specified in composer.json scripts'
|
||||
exit 1
|
||||
|
||||
summary:
|
||||
permissions:
|
||||
contents: none
|
||||
runs-on: ubuntu-latest-low
|
||||
needs: [changes, phpunit-sqlite]
|
||||
|
||||
if: always()
|
||||
|
||||
name: phpunit-sqlite-summary
|
||||
|
||||
steps:
|
||||
- name: Summary status
|
||||
run: if ${{ needs.changes.outputs.src != 'false' && needs.phpunit-sqlite.result != 'success' }}; then exit 1; fi
|
||||
50
.github/workflows/pr-feedback.yml
vendored
Normal file
50
.github/workflows/pr-feedback.yml
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
# This workflow is provided via the organization template repository
|
||||
#
|
||||
# https://github.com/nextcloud/.github
|
||||
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
|
||||
|
||||
# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors
|
||||
# SPDX-FileCopyrightText: 2023 Marcel Klehr <mklehr@gmx.net>
|
||||
# SPDX-FileCopyrightText: 2023 Joas Schilling <213943+nickvergessen@users.noreply.github.com>
|
||||
# SPDX-FileCopyrightText: 2023 Daniel Kesselberg <mail@danielkesselberg.de>
|
||||
# SPDX-FileCopyrightText: 2023 Florian Steffens <florian.steffens@nextcloud.com>
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: 'Ask for feedback on PRs'
|
||||
on:
|
||||
schedule:
|
||||
- cron: '30 1 * * *'
|
||||
|
||||
jobs:
|
||||
pr-feedback:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: The get-github-handles-from-website action
|
||||
uses: marcelklehr/get-github-handles-from-website-action@a739600f6b91da4957f51db0792697afbb2f143c # v1.0.0
|
||||
id: scrape
|
||||
with:
|
||||
website: 'https://nextcloud.com/team/'
|
||||
|
||||
- name: Get blocklist
|
||||
id: blocklist
|
||||
run: |
|
||||
blocklist=$(curl https://raw.githubusercontent.com/nextcloud/.github/master/non-community-usernames.txt | paste -s -d, -)
|
||||
echo "blocklist=$blocklist" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- uses: nextcloud/pr-feedback-action@1883b38a033fb16f576875e0cf45f98b857655c4 # main
|
||||
with:
|
||||
feedback-message: |
|
||||
Hello there,
|
||||
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.
|
||||
|
||||
We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.
|
||||
|
||||
Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6
|
||||
|
||||
Thank you for contributing to Nextcloud and we hope to hear from you soon!
|
||||
|
||||
(If you believe you should not receive this message, you can add yourself to the [blocklist](https://github.com/nextcloud/.github/blob/master/non-community-usernames.txt).)
|
||||
days-before-feedback: 14
|
||||
start-date: '2024-04-30'
|
||||
exempt-authors: '${{ steps.blocklist.outputs.blocklist }},${{ steps.scrape.outputs.users }}'
|
||||
exempt-bots: true
|
||||
57
.github/workflows/psalm.yml
vendored
Normal file
57
.github/workflows/psalm.yml
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
# This workflow is provided via the organization template repository
|
||||
#
|
||||
# https://github.com/nextcloud/.github
|
||||
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: Static analysis
|
||||
|
||||
on: pull_request
|
||||
|
||||
concurrency:
|
||||
group: psalm-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
static-analysis:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
name: static-psalm-analysis
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
|
||||
- name: Get php version
|
||||
id: versions
|
||||
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1
|
||||
|
||||
- name: Check enforcement of minimum PHP version ${{ steps.versions.outputs.php-min }} in psalm.xml
|
||||
run: grep 'phpVersion="${{ steps.versions.outputs.php-min }}' psalm.xml
|
||||
|
||||
- name: Set up php${{ steps.versions.outputs.php-available }}
|
||||
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
|
||||
with:
|
||||
php-version: ${{ steps.versions.outputs.php-min }}
|
||||
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
|
||||
coverage: none
|
||||
ini-file: development
|
||||
# Temporary workaround for missing pcntl_* in PHP 8.3
|
||||
ini-values: disable_functions=
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
composer remove nextcloud/ocp --dev
|
||||
composer i
|
||||
|
||||
- name: Install nextcloud/ocp
|
||||
run: composer require --dev nextcloud/ocp:dev-${{ steps.versions.outputs.branches-max }} --ignore-platform-reqs --with-dependencies
|
||||
|
||||
- name: Run coding standards check
|
||||
run: composer run psalm -- --threads=1 --monochrome --no-progress --output-format=github
|
||||
25
.github/workflows/reuse.yml
vendored
Normal file
25
.github/workflows/reuse.yml
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
# This workflow is provided via the organization template repository
|
||||
#
|
||||
# https://github.com/nextcloud/.github
|
||||
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
|
||||
|
||||
# SPDX-FileCopyrightText: 2022 Free Software Foundation Europe e.V. <https://fsfe.org>
|
||||
#
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
name: REUSE Compliance Check
|
||||
|
||||
on: [pull_request]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
reuse-compliance-check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
|
||||
- name: REUSE Compliance Check
|
||||
uses: fsfe/reuse-action@3ae3c6bdf1257ab19397fab11fd3312144692083 # v4.0.0
|
||||
58
.github/workflows/update-nextcloud-ocp-approve-merge.yml
vendored
Normal file
58
.github/workflows/update-nextcloud-ocp-approve-merge.yml
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
# This workflow is provided via the organization template repository
|
||||
#
|
||||
# https://github.com/nextcloud/.github
|
||||
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: Auto approve nextcloud/ocp
|
||||
|
||||
on:
|
||||
pull_request_target: # zizmor: ignore[dangerous-triggers]
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
- stable*
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: update-nextcloud-ocp-approve-merge-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
auto-approve-merge:
|
||||
if: github.actor == 'nextcloud-command'
|
||||
runs-on: ubuntu-latest-low
|
||||
permissions:
|
||||
# for hmarr/auto-approve-action to approve PRs
|
||||
pull-requests: write
|
||||
# for alexwilson/enable-github-automerge-action to approve PRs
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- name: Disabled on forks
|
||||
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
|
||||
run: |
|
||||
echo 'Can not approve PRs from forks'
|
||||
exit 1
|
||||
|
||||
- uses: mdecoleman/pr-branch-name@55795d86b4566d300d237883103f052125cc7508 # v3.0.0
|
||||
id: branchname
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
# GitHub actions bot approve
|
||||
- uses: hmarr/auto-approve-action@b40d6c9ed2fa10c9a2749eca7eb004418a705501 # v2
|
||||
if: startsWith(steps.branchname.outputs.branch, 'automated/noid/') && endsWith(steps.branchname.outputs.branch, 'update-nextcloud-ocp')
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
# Enable GitHub auto merge
|
||||
- name: Auto merge
|
||||
uses: alexwilson/enable-github-automerge-action@56e3117d1ae1540309dc8f7a9f2825bc3c5f06ff # v2.0.0
|
||||
if: startsWith(steps.branchname.outputs.branch, 'automated/noid/') && endsWith(steps.branchname.outputs.branch, 'update-nextcloud-ocp')
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
123
.github/workflows/update-nextcloud-ocp.yml
vendored
Normal file
123
.github/workflows/update-nextcloud-ocp.yml
vendored
Normal file
@@ -0,0 +1,123 @@
|
||||
# This workflow is provided via the organization template repository
|
||||
#
|
||||
# https://github.com/nextcloud/.github
|
||||
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: Update nextcloud/ocp
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: "5 2 * * 0"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
update-nextcloud-ocp:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
branches: ['main', 'master', 'stable29', 'stable28', 'stable27']
|
||||
|
||||
name: update-nextcloud-ocp-${{ matrix.branches }}
|
||||
|
||||
steps:
|
||||
- id: checkout
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
with:
|
||||
persist-credentials: false
|
||||
ref: ${{ matrix.branches }}
|
||||
submodules: true
|
||||
continue-on-error: true
|
||||
|
||||
- name: Set up php8.2
|
||||
if: steps.checkout.outcome == 'success'
|
||||
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
|
||||
with:
|
||||
php-version: 8.2
|
||||
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
|
||||
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
|
||||
coverage: none
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Read codeowners
|
||||
if: steps.checkout.outcome == 'success'
|
||||
id: codeowners
|
||||
run: |
|
||||
grep '/appinfo/info.xml' .github/CODEOWNERS | cut -f 2- -d ' ' | xargs | awk '{ print "codeowners="$0 }' >> $GITHUB_OUTPUT
|
||||
continue-on-error: true
|
||||
|
||||
- name: Composer install
|
||||
if: steps.checkout.outcome == 'success'
|
||||
run: composer install
|
||||
|
||||
- name: Composer update nextcloud/ocp
|
||||
id: update_branch
|
||||
if: ${{ steps.checkout.outcome == 'success' && matrix.branches != 'main' }}
|
||||
run: composer require --dev 'nextcloud/ocp:dev-${{ matrix.branches }}'
|
||||
|
||||
- name: Raise on issue on failure
|
||||
uses: dacbd/create-issue-action@cdb57ab6ff8862aa09fee2be6ba77a59581921c2 # v2.0.0
|
||||
if: ${{ steps.checkout.outcome == 'success' && failure() && steps.update_branch.conclusion == 'failure' }}
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
title: 'Failed to update nextcloud/ocp package on branch ${{ matrix.branches }}'
|
||||
body: 'Please check the output of the GitHub action and manually resolve the issues<br>${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}<br>${{ steps.codeowners.outputs.codeowners }}'
|
||||
|
||||
- name: Composer update nextcloud/ocp
|
||||
id: update_main
|
||||
if: ${{ steps.checkout.outcome == 'success' && matrix.branches == 'main' }}
|
||||
run: composer require --dev nextcloud/ocp:dev-master
|
||||
|
||||
- name: Raise on issue on failure
|
||||
uses: dacbd/create-issue-action@cdb57ab6ff8862aa09fee2be6ba77a59581921c2 # v2.0.0
|
||||
if: ${{ steps.checkout.outcome == 'success' && failure() && steps.update_main.conclusion == 'failure' }}
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
title: 'Failed to update nextcloud/ocp package on branch ${{ matrix.branches }}'
|
||||
body: 'Please check the output of the GitHub action and manually resolve the issues<br>${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}<br>${{ steps.codeowners.outputs.codeowners }}'
|
||||
|
||||
- name: Reset checkout 3rdparty
|
||||
if: steps.checkout.outcome == 'success'
|
||||
run: |
|
||||
git clean -f 3rdparty
|
||||
git checkout 3rdparty
|
||||
continue-on-error: true
|
||||
|
||||
- name: Reset checkout vendor
|
||||
if: steps.checkout.outcome == 'success'
|
||||
run: |
|
||||
git clean -f vendor
|
||||
git checkout vendor
|
||||
continue-on-error: true
|
||||
|
||||
- name: Reset checkout vendor-bin
|
||||
if: steps.checkout.outcome == 'success'
|
||||
run: |
|
||||
git clean -f vendor-bin
|
||||
git checkout vendor-bin
|
||||
continue-on-error: true
|
||||
|
||||
- name: Create Pull Request
|
||||
if: steps.checkout.outcome == 'success'
|
||||
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6.1.0
|
||||
with:
|
||||
token: ${{ secrets.COMMAND_BOT_PAT }}
|
||||
commit-message: 'chore(dev-deps): Bump nextcloud/ocp package'
|
||||
committer: GitHub <noreply@github.com>
|
||||
author: nextcloud-command <nextcloud-command@users.noreply.github.com>
|
||||
signoff: true
|
||||
branch: 'automated/noid/${{ matrix.branches }}-update-nextcloud-ocp'
|
||||
title: '[${{ matrix.branches }}] Update nextcloud/ocp dependency'
|
||||
body: |
|
||||
Auto-generated update of [nextcloud/ocp](https://github.com/nextcloud-deps/ocp/) dependency
|
||||
labels: |
|
||||
dependencies
|
||||
3. to review
|
||||
@@ -7,7 +7,7 @@
|
||||
/.editorconfig
|
||||
/.eslintrc.js
|
||||
/.nextcloudignore
|
||||
/webpack.js
|
||||
/webpack.*.js
|
||||
/.codecov.yml
|
||||
/composer.json
|
||||
/composer.lock
|
||||
@@ -26,10 +26,3 @@
|
||||
/package-lock.json
|
||||
/node_modules/
|
||||
/src/
|
||||
/cypress/
|
||||
/cypress.config.js
|
||||
/.devcontainer/
|
||||
/.php-cs-fixer.dist.php
|
||||
/psalm.xml
|
||||
/relativeci.config.js
|
||||
/stylelint.config.js
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
- Adrian Missy <adrian.missy@onewavestudios.com>
|
||||
- Alexandru Puiu <alexpuiu20@yahoo.com>
|
||||
- Arne Bartelt <arne.bartelt@gmail.com>
|
||||
- Chandi Langecker <git@chandi.it>
|
||||
- Christoph Wurst <christoph@winzerhof-wurst.at>
|
||||
- Gary Kim <gary@garykim.dev>
|
||||
|
||||
98
CHANGELOG.md
98
CHANGELOG.md
@@ -5,31 +5,83 @@
|
||||
# Changelog
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
## 1.16.0-beta.1
|
||||
## 1.14.6
|
||||
### Fixed
|
||||
* [stable30] fix: update DeleteCron to remove deleted lists by @backportbot[bot] in https://github.com/nextcloud/deck/pull/7028
|
||||
* [stable30] fix: not show Share with a Deck card for unauthorized users by @backportbot[bot] in https://github.com/nextcloud/deck/pull/7060
|
||||
* [stable30] fix: add retry and show warning on description saving error by @backportbot[bot] in https://github.com/nextcloud/deck/pull/7090
|
||||
* [stable30] fix: styling for new stack input field by @backportbot[bot] in https://github.com/nextcloud/deck/pull/7112
|
||||
* [stable30] fix:allow foreign label deletion by @backportbot[bot] in https://github.com/nextcloud/deck/pull/7129
|
||||
* [stable30] fix: acl check when delete, update board acl by @backportbot[bot] in https://github.com/nextcloud/deck/pull/7133
|
||||
|
||||
## 1.14.5
|
||||
### Fixed
|
||||
* [stable30] Clear selected stack when selected board changed by @backportbot in https://github.com/nextcloud/deck/pull/6914
|
||||
* [stable30] perf: Skip doing a query just to check if a board is deleted by @backportbot in https://github.com/nextcloud/deck/pull/6895
|
||||
* [stable30] fix: only delete assignments on unshared board by @grnd-alt in https://github.com/nextcloud/deck/pull/6935
|
||||
* [stable30] fix: Limit label actions to labels of the cards board by @backportbot in https://github.com/nextcloud/deck/pull/6953
|
||||
|
||||
### Maintenance
|
||||
* Chore(deps): Bump @babel/runtime from 7.26.10 to 7.27.0 by @dependabot in https://github.com/nextcloud/deck/pull/6866
|
||||
* Chore(deps): Bump dompurify from 3.2.4 to 3.2.5 by @dependabot in https://github.com/nextcloud/deck/pull/6881
|
||||
* Chore(deps): Bump @nextcloud/vue from 8.23.1 to 8.24.0 by @dependabot in https://github.com/nextcloud/deck/pull/6882
|
||||
* [stable30] Fix npm audit by @nextcloud-command in https://github.com/nextcloud/deck/pull/6887
|
||||
* Chore(deps-dev): Bump @nextcloud/webpack-vue-config from 6.2.0 to 6.3.0 by @dependabot in https://github.com/nextcloud/deck/pull/6909
|
||||
* [stable30] Fix npm audit by @nextcloud-command in https://github.com/nextcloud/deck/pull/6911
|
||||
* Chore(deps): Bump @nextcloud/vue from 8.24.0 to 8.25.1 by @dependabot in https://github.com/nextcloud/deck/pull/6923
|
||||
* [stable30] chore: update workflows from templates by @backportbot in https://github.com/nextcloud/deck/pull/6921
|
||||
* Chore(deps): Bump @nextcloud/vue from 8.25.1 to 8.26.0 by @dependabot in https://github.com/nextcloud/deck/pull/6939
|
||||
* [stable30] Fix npm audit by @nextcloud-command in https://github.com/nextcloud/deck/pull/6948
|
||||
|
||||
## 1.14.4
|
||||
### Fixed
|
||||
- fix: skip exporting a deleted card #6722
|
||||
- fix: Properly show attachment extension #6673
|
||||
|
||||
### Maintenance
|
||||
- Update nextcloud/ocp dependency #6769
|
||||
- Update nextcloud/ocp dependency #6718
|
||||
- Update nextcloud/ocp dependency #6700
|
||||
- Update nextcloud/ocp dependency #6656
|
||||
|
||||
## 1.14.3
|
||||
### Fixed
|
||||
- fix: two close buttons on card modal @app/backportbot [#6659](https://github.com/nextcloud/deck/pull/6659)
|
||||
- fix: Catch not found card @app/backportbot [#6652](https://github.com/nextcloud/deck/pull/6652)
|
||||
- fix: close modal after deleting card @app/backportbot [#6619](https://github.com/nextcloud/deck/pull/6619)
|
||||
- fix: Use new query builder @app/backportbot [#6612](https://github.com/nextcloud/deck/pull/6612)
|
||||
- fix: new card input spacing @app/backportbot [#6576](https://github.com/nextcloud/deck/pull/6576)
|
||||
- fix(sharing): list accounts with matches in email @app/backportbot [#6524](https://github.com/nextcloud/deck/pull/6524)
|
||||
|
||||
## 1.14.2
|
||||
### Fixed
|
||||
|
||||
- fix: board bubble preview widget [#6477](https://github.com/nextcloud/deck/pull/6477)
|
||||
|
||||
### Dependencies
|
||||
|
||||
- Update nextcloud/ocp dependency @nextcloud-command [#6470](https://github.com/nextcloud/deck/pull/6470)
|
||||
- Fix npm audit @nextcloud-command [#6450](https://github.com/nextcloud/deck/pull/6450)
|
||||
|
||||
## 1.14.1
|
||||
### Fixed
|
||||
- fix: Load archived card if URL is opened directly #6326
|
||||
- Update nextcloud/ocp dependency #6322
|
||||
|
||||
## 1.14.0
|
||||
|
||||
### Added
|
||||
- feat: update default content @luka-nextcloud [#6740](https://github.com/nextcloud/deck/pull/6740)
|
||||
- feat: add board import and export @luka-nextcloud [#6872](https://github.com/nextcloud/deck/pull/6872)
|
||||
- feat: use outline icons @luka-nextcloud [#7114](https://github.com/nextcloud/deck/pull/7114)
|
||||
- Add OCC commands for global calendar feature opt-in and opt-out in Deck @Fledermaus-20 [#7080](https://github.com/nextcloud/deck/pull/7080)
|
||||
|
||||
### Fixed
|
||||
- CSV export fixes @gidan80 [#6800](https://github.com/nextcloud/deck/pull/6800)
|
||||
|
||||
## 1.15.0-beta.1
|
||||
### Fixed
|
||||
- fix: Catch not found card @juliusknorr [#6646](https://github.com/nextcloud/deck/pull/6646)
|
||||
- fix: Avoid failing on public dav URLs @juliusknorr [#6642](https://github.com/nextcloud/deck/pull/6642)
|
||||
- fix: Proper rich object formats @juliusknorr [#6641](https://github.com/nextcloud/deck/pull/6641)
|
||||
- fix(notifications): Notifier::prepare() threw \InvalidArgumentExcepti… @nickvergessen [#6623](https://github.com/nextcloud/deck/pull/6623)
|
||||
- fix: close modal after deleting card @ludij [#6617](https://github.com/nextcloud/deck/pull/6617)
|
||||
- fix: Use new query builder @juliusknorr [#6611](https://github.com/nextcloud/deck/pull/6611)
|
||||
- fix: new card input spacing @luka-nextcloud [#6574](https://github.com/nextcloud/deck/pull/6574)
|
||||
|
||||
## 1.14.0-beta.1
|
||||
- export json data of commments @grnd-alt [#6119](https://github.com/nextcloud/deck/pull/6119)
|
||||
|
||||
### Fixed
|
||||
|
||||
- fix: losing focus while editing title field @luka-nextcloud [#6140](https://github.com/nextcloud/deck/pull/6140)
|
||||
- Fix UI with the new compact design [#6258](https://github.com/nextcloud/deck/pull/6258)
|
||||
- Translation call fix [#6261](https://github.com/nextcloud/deck/pull/6261)
|
||||
- fix: 30 design issues [#6265](https://github.com/nextcloud/deck/pull/6265)
|
||||
- copy labels when moving cards between boards [#6289](https://github.com/nextcloud/deck/pull/6289)
|
||||
- Bug fix collection [#6307](https://github.com/nextcloud/deck/pull/6307)
|
||||
- fix: card details focus issue with screen reader @luka-nextcloud [#5858](https://github.com/nextcloud/deck/pull/5858)
|
||||
- Cleaning up unused indicies @mintsoft [#5612](https://github.com/nextcloud/deck/pull/5612)
|
||||
- Change import command's config default argument @JimMadge [#5722](https://github.com/nextcloud/deck/pull/5722)
|
||||
@@ -42,12 +94,17 @@ All notable changes to this project will be documented in this file.
|
||||
- fix: remove redundant log @luka-nextcloud [#6115](https://github.com/nextcloud/deck/pull/6115)
|
||||
- fix: Adjust dependencies to fix filepicker @susnux [#5964](https://github.com/nextcloud/deck/pull/5964)
|
||||
- fix: Remove bindParam usage with simpler query @juliushaertl [#6065](https://github.com/nextcloud/deck/pull/6065)
|
||||
- add Order when cloning board @grnd-alt [#6117](https://github.com/nextcloud/deck/pull/6117)
|
||||
- use deleted_users for users that do not exist @grnd-alt [#6201](https://github.com/nextcloud/deck/pull/6201)
|
||||
- chore: Clean up permission service @juliushaertl [#6011](https://github.com/nextcloud/deck/pull/6011)
|
||||
|
||||
### Other
|
||||
|
||||
- fix(files): fix appstore-build-publish.yml @JuliaKirschenheuter [#6142](https://github.com/nextcloud/deck/pull/6142)
|
||||
- tests: Add environment variable and document commands to run behat tests locally @juliushaertl [#6137](https://github.com/nextcloud/deck/pull/6137)
|
||||
- chore(CI): Adjust testing matrix for Nextcloud 30 on stable30 @nickvergessen [#6205](https://github.com/nextcloud/deck/pull/6205)
|
||||
- Adds link to Nextcloud Deck for iOS in README.md file @StCyr [#5886](https://github.com/nextcloud/deck/pull/5886)
|
||||
- choir(i18n): Change filter title @rakekniven [#5957](https://github.com/nextcloud/deck/pull/5957)
|
||||
- chore: Clean up permission service @juliushaertl [#6011](https://github.com/nextcloud/deck/pull/6011)
|
||||
- Update User_documentation_en.md @StCyr [#6029](https://github.com/nextcloud/deck/pull/6029)
|
||||
- chore: Move comments event handler to use proper event dispatcher @juliushaertl [#6008](https://github.com/nextcloud/deck/pull/6008)
|
||||
- Migrate REUSE to TOML format @AndyScherzinger [#6084](https://github.com/nextcloud/deck/pull/6084)
|
||||
@@ -883,4 +940,3 @@ Android app team for helping to improve our REST API:
|
||||
- Assign labels
|
||||
- Markdown notes for each card
|
||||
- Archive cards
|
||||
|
||||
|
||||
@@ -24,7 +24,8 @@ Deck is a kanban style organization tool aimed at personal planning and project
|
||||
### Mobile apps
|
||||
|
||||
- [Nextcloud Deck app for Android](https://github.com/stefan-niedermann/nextcloud-deck) - It is available in [F-Droid](https://f-droid.org/de/packages/it.niedermann.nextcloud.deck/) and the [Google Play Store](https://play.google.com/store/apps/details?id=it.niedermann.nextcloud.deck.play)
|
||||
- Nextcloud Deck app for iOS - It is available in [Apple App store](https://apps.apple.com/de/app/next-deck/id6752478755)
|
||||
- [Nextcloud Deck app for iOS](https://github.com/StCyr/deck-react-native) - It is available in [Apple App store](https://apps.apple.com/ml/app/nextcloud-deck/id1570892788)
|
||||
- [deck NG for Android and iOS](https://github.com/meltzow/deck-ng) - It is available in [Google Play Store](https://play.google.com/store/apps/details?id=net.meltzow.deckng) and [Apple App Store](https://apps.apple.com/us/app/deck-ng/id6443334702)
|
||||
|
||||
### 3rd-Party Integrations
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ SPDX-FileCopyrightText = "none"
|
||||
SPDX-License-Identifier = "CC0-1.0"
|
||||
|
||||
[[annotations]]
|
||||
path = ["l10n/**.js", "l10n/**.json", "js/**.js.map", "js/**.js", "js/**.mjs", "js/**.mjs.map", "js/templates/**.handlebars", "lib/Service/Importer/fixtures/config-deckJson-schema.json", "lib/Service/Importer/fixtures/config-trelloApi-schema.json", "lib/Service/Importer/fixtures/config-trelloJson-schema.json", "lib/Service/fixtures/default-board.json", "screenshots/screenshot1.png", "src/assets/file-placeholder.svg", "img/favicon.ico", "img/favicon.png", "img/favicon.svg", "img/activity.svg", "img/activity-dark.svg", "img/deck.svg", "img/deck-current.svg", "img/deck-dark.svg", "img/details-white.svg", "img/card.svg", "img/sample-image.jpg"]
|
||||
path = ["l10n/**.js", "l10n/**.json", "js/**.js.map", "js/**.js", "js/**.mjs", "js/**.mjs.map", "js/templates/**.handlebars", "lib/Service/Importer/fixtures/config-deckJson-schema.json", "lib/Service/Importer/fixtures/config-trelloApi-schema.json", "lib/Service/Importer/fixtures/config-trelloJson-schema.json", "screenshots/screenshot1.png", "src/assets/file-placeholder.svg", "img/favicon.ico", "img/favicon.png", "img/favicon.svg", "img/activity.svg", "img/activity-dark.svg", "img/deck.svg", "img/deck-current.svg", "img/deck-dark.svg", "img/details-white.svg", "img/card.svg"]
|
||||
precedence = "aggregate"
|
||||
SPDX-FileCopyrightText = "2019 Nextcloud GmbH and Nextcloud contributors"
|
||||
SPDX-License-Identifier = "AGPL-3.0-or-later"
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
@@ -20,17 +20,17 @@
|
||||
- 🚀 Get your project organized
|
||||
|
||||
</description>
|
||||
<version>2.0.0-dev.0</version>
|
||||
<version>1.14.6</version>
|
||||
<licence>agpl</licence>
|
||||
<author>Julius Härtl</author>
|
||||
<namespace>Deck</namespace>
|
||||
<types>
|
||||
<dav/>
|
||||
</types>
|
||||
<documentation>
|
||||
<user>https://deck.readthedocs.io/en/latest/User_documentation_en/</user>
|
||||
<developer>https://deck.readthedocs.io/en/latest/API/</developer>
|
||||
</documentation>
|
||||
<namespace>Deck</namespace>
|
||||
<types>
|
||||
<dav/>
|
||||
</types>
|
||||
<category>organization</category>
|
||||
<category>office</category>
|
||||
<website>https://github.com/nextcloud/deck</website>
|
||||
@@ -42,7 +42,7 @@
|
||||
<database min-version="9.4">pgsql</database>
|
||||
<database>sqlite</database>
|
||||
<database min-version="8.0">mysql</database>
|
||||
<nextcloud min-version="33" max-version="33"/>
|
||||
<nextcloud min-version="30" max-version="30"/>
|
||||
</dependencies>
|
||||
<background-jobs>
|
||||
<job>OCA\Deck\Cron\DeleteCron</job>
|
||||
@@ -54,15 +54,11 @@
|
||||
<live-migration>
|
||||
<step>OCA\Deck\Migration\DeletedCircleCleanup</step>
|
||||
</live-migration>
|
||||
<post-migration>
|
||||
<step>OCA\Deck\Migration\LabelMismatchCleanup</step>
|
||||
</post-migration>
|
||||
</repair-steps>
|
||||
<commands>
|
||||
<command>OCA\Deck\Command\UserExport</command>
|
||||
<command>OCA\Deck\Command\BoardImport</command>
|
||||
<command>OCA\Deck\Command\TransferOwnership</command>
|
||||
<command>OCA\Deck\Command\CalendarToggle</command>
|
||||
</commands>
|
||||
<activity>
|
||||
<settings>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -29,7 +28,6 @@ return [
|
||||
['name' => 'board#clone', 'url' => '/boards/{boardId}/clone', 'verb' => 'POST'],
|
||||
['name' => 'board#transferOwner', 'url' => '/boards/{boardId}/transferOwner', 'verb' => 'PUT'],
|
||||
['name' => 'board#export', 'url' => '/boards/{boardId}/export', 'verb' => 'GET'],
|
||||
['name' => 'board#import', 'url' => '/boards/import', 'verb' => 'POST'],
|
||||
|
||||
// stacks
|
||||
['name' => 'stack#index', 'url' => '/stacks/{boardId}', 'verb' => 'GET'],
|
||||
@@ -104,8 +102,6 @@ return [
|
||||
['name' => 'card_api#assignUser', 'url' => '/api/v{apiVersion}/boards/{boardId}/stacks/{stackId}/cards/{cardId}/assignUser', 'verb' => 'PUT'],
|
||||
['name' => 'card_api#unassignUser', 'url' => '/api/v{apiVersion}/boards/{boardId}/stacks/{stackId}/cards/{cardId}/unassignUser', 'verb' => 'PUT'],
|
||||
['name' => 'card_api#reorder', 'url' => '/api/v{apiVersion}/boards/{boardId}/stacks/{stackId}/cards/{cardId}/reorder', 'verb' => 'PUT'],
|
||||
['name' => 'card_api#archive', 'url' => '/api/v{apiVersion}/boards/{boardId}/stacks/{stackId}/cards/{cardId}/archive', 'verb' => 'PUT'],
|
||||
['name' => 'card_api#unarchive', 'url' => '/api/v{apiVersion}/boards/{boardId}/stacks/{stackId}/cards/{cardId}/unarchive', 'verb' => 'PUT'],
|
||||
['name' => 'card_api#delete', 'url' => '/api/v{apiVersion}/boards/{boardId}/stacks/{stackId}/cards/{cardId}', 'verb' => 'DELETE'],
|
||||
|
||||
['name' => 'card_api#findAllWithDue', 'url' => '/api/v{apiVersion}/dashboard/due', 'verb' => 'GET'],
|
||||
@@ -140,8 +136,6 @@ return [
|
||||
['name' => 'comments_api#update', 'url' => '/api/v{apiVersion}/cards/{cardId}/comments/{commentId}', 'verb' => 'PUT'],
|
||||
['name' => 'comments_api#delete', 'url' => '/api/v{apiVersion}/cards/{cardId}/comments/{commentId}', 'verb' => 'DELETE'],
|
||||
|
||||
['name' => 'card#clone', 'url' => '/api/v{apiVersion}/cards/{cardId}/clone', 'verb' => 'POST'],
|
||||
|
||||
['name' => 'overview_api#upcomingCards', 'url' => '/api/v{apiVersion}/overview/upcoming', 'verb' => 'GET'],
|
||||
|
||||
['name' => 'search#search', 'url' => '/api/v{apiVersion}/search', 'verb' => 'GET'],
|
||||
|
||||
@@ -9,35 +9,31 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"justinrainbow/json-schema": "^6.0",
|
||||
"bamarni/composer-bin-plugin": "^1.8"
|
||||
"justinrainbow/json-schema": "^6.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"roave/security-advisories": "dev-master",
|
||||
"phpunit/phpunit": "^9",
|
||||
"nextcloud/coding-standard": "^1.1",
|
||||
"nextcloud/ocp": "dev-master"
|
||||
"nextcloud/ocp": "dev-stable30",
|
||||
"psalm/phar": "^5.13"
|
||||
},
|
||||
"config": {
|
||||
"optimize-autoloader": true,
|
||||
"allow-plugins": {
|
||||
"composer/package-versions-deprecated": true,
|
||||
"bamarni/composer-bin-plugin": true
|
||||
"composer/package-versions-deprecated": true
|
||||
},
|
||||
"platform": {
|
||||
"php": "8.1"
|
||||
"php": "8.0"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"post-install-cmd": [
|
||||
"@composer bin all install --ansi"
|
||||
],
|
||||
"lint": "find . -name \\*.php -not -path './vendor/*' -print0 | xargs -0 -n1 php -l",
|
||||
"cs:check": "php-cs-fixer fix --dry-run --diff",
|
||||
"cs:fix": "php-cs-fixer fix",
|
||||
"psalm": "psalm",
|
||||
"psalm:update-baseline": "psalm --threads=$(nproc) --no-cache --update-baseline",
|
||||
"psalm:fix": "psalm --alter --issues=InvalidReturnType,InvalidNullableReturnType,MismatchingDocblockParamType,MismatchingDocblockReturnType,MissingParamType,InvalidFalsableReturnType",
|
||||
"psalm": "psalm.phar",
|
||||
"psalm:update-baseline": "psalm.phar --update-baseline",
|
||||
"psalm:fix": "psalm.phar --alter --issues=InvalidReturnType,InvalidNullableReturnType,MismatchingDocblockParamType,MismatchingDocblockReturnType,MissingParamType,InvalidFalsableReturnType",
|
||||
"test": [
|
||||
"@test:unit",
|
||||
"@test:integration"
|
||||
|
||||
918
composer.lock
generated
918
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -14,7 +14,6 @@
|
||||
|
||||
input[type=submit].icon-confirm {
|
||||
border-color: var(--color-border-maxcontrast) !important;
|
||||
border-style: solid;
|
||||
border-left: none;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
import { randUser } from '../utils/index.js'
|
||||
const user = randUser()
|
||||
const recipient = randUser()
|
||||
import { sampleBoard } from '../utils/sampleBoard'
|
||||
|
||||
describe('Board', function() {
|
||||
|
||||
@@ -59,151 +58,3 @@ describe('Board', function() {
|
||||
.should('be.visible')
|
||||
})
|
||||
})
|
||||
|
||||
describe('Board cloning', function() {
|
||||
before(function() {
|
||||
cy.createUser(user)
|
||||
})
|
||||
|
||||
it('Clones a board without cards', function() {
|
||||
const boardName = 'Clone board original'
|
||||
const board = sampleBoard(boardName)
|
||||
cy.createExampleBoard({ user, board }).then((board) => {
|
||||
const boardId = board.id
|
||||
cy.visit(`/apps/deck/board/${boardId}`)
|
||||
cy.get('.app-navigation__list .app-navigation-entry:contains("' + boardName + '")')
|
||||
.parent()
|
||||
.find('button[aria-label="Actions"]')
|
||||
.click()
|
||||
cy.get('button:contains("Clone board")')
|
||||
.click()
|
||||
|
||||
cy.get('.modal-container button:contains("Clone")')
|
||||
.click()
|
||||
|
||||
cy.get('.app-navigation__list .app-navigation-entry:contains("' + boardName + '")')
|
||||
.should('be.visible')
|
||||
|
||||
cy.get('.app-navigation__list .app-navigation-entry:contains("' + boardName + ' (copy)")')
|
||||
.should('be.visible')
|
||||
|
||||
cy.get('.board-title h2').contains(boardName + ' (copy)')
|
||||
|
||||
cy.get('h3[aria-label="TestList"]')
|
||||
.should('be.visible')
|
||||
})
|
||||
})
|
||||
|
||||
it('Clones a board with cards', function() {
|
||||
const boardName = 'Clone with cards'
|
||||
const board = sampleBoard(boardName)
|
||||
cy.createExampleBoard({ user, board }).then((board) => {
|
||||
const boardId = board.id
|
||||
cy.visit(`/apps/deck/board/${boardId}`)
|
||||
cy.get('.app-navigation__list .app-navigation-entry:contains("' + boardName + '")')
|
||||
.parent()
|
||||
.find('button[aria-label="Actions"]')
|
||||
.click()
|
||||
cy.get('button:contains("Clone board")')
|
||||
.click()
|
||||
|
||||
cy.get('.checkbox-content__text:contains("Clone cards")')
|
||||
.click()
|
||||
|
||||
cy.get('.modal-container button:contains("Clone")')
|
||||
.click()
|
||||
|
||||
cy.get('.app-navigation__list .app-navigation-entry:contains("' + boardName + '")')
|
||||
.should('be.visible')
|
||||
|
||||
cy.get('.app-navigation__list .app-navigation-entry:contains("' + boardName + ' (copy)")')
|
||||
.should('be.visible')
|
||||
|
||||
cy.get('.board-title h2').contains(boardName + ' (copy)')
|
||||
|
||||
cy.get('h3[aria-label="TestList"]')
|
||||
.should('be.visible')
|
||||
|
||||
cy.get('.card:contains("Hello world")')
|
||||
.should('be.visible')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('Board export', function() {
|
||||
before(function() {
|
||||
cy.createUser(user)
|
||||
})
|
||||
|
||||
it('Exports a board as JSON', function() {
|
||||
const boardName = 'Export JSON board'
|
||||
const board = sampleBoard(boardName)
|
||||
cy.createExampleBoard({ user, board }).then((board) => {
|
||||
const boardId = board.id
|
||||
cy.visit(`/apps/deck/board/${boardId}`)
|
||||
cy.get('.app-navigation__list .app-navigation-entry:contains("' + boardName + '")')
|
||||
.parent()
|
||||
.find('button[aria-label="Actions"]')
|
||||
.click()
|
||||
cy.get('button:contains("Export board")')
|
||||
.click()
|
||||
cy.get('.modal-container .checkbox-radio-switch__text:contains("Export as JSON")')
|
||||
.click()
|
||||
cy.get('.modal-container button:contains("Export")')
|
||||
.click()
|
||||
|
||||
const downloadsFolder = Cypress.config('downloadsFolder')
|
||||
cy.readFile(`${downloadsFolder}/${boardName}.json`)
|
||||
})
|
||||
})
|
||||
|
||||
it('Exports a board as CSV', function() {
|
||||
const boardName = 'Export CSV board'
|
||||
const board = sampleBoard(boardName)
|
||||
cy.createExampleBoard({ user, board }).then((board) => {
|
||||
const boardId = board.id
|
||||
cy.visit(`/apps/deck/board/${boardId}`)
|
||||
cy.get('.app-navigation__list .app-navigation-entry:contains("' + boardName + '")')
|
||||
.parent()
|
||||
.find('button[aria-label="Actions"]')
|
||||
.click()
|
||||
cy.get('button:contains("Export board")')
|
||||
.click()
|
||||
cy.get('.modal-container .checkbox-radio-switch__text:contains("Export as CSV")')
|
||||
.click()
|
||||
cy.get('.modal-container button:contains("Export")')
|
||||
.click()
|
||||
|
||||
const downloadsFolder = Cypress.config('downloadsFolder')
|
||||
cy.readFile(`${downloadsFolder}/${boardName}.csv`)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('Board import', function() {
|
||||
before(function () {
|
||||
cy.createUser(user)
|
||||
})
|
||||
beforeEach(function() {
|
||||
cy.login(user)
|
||||
cy.visit('/apps/deck')
|
||||
})
|
||||
|
||||
it('Imports a board from JSON', function() {
|
||||
cy.get('#app-navigation-vue .app-navigation__list .app-navigation-entry:contains("Import board")')
|
||||
.should('be.visible')
|
||||
.click()
|
||||
|
||||
// Upload a JSON file
|
||||
cy.get('input[type="file"]')
|
||||
.selectFile([
|
||||
{
|
||||
contents: 'cypress/fixtures/import-board.json',
|
||||
fileName: 'import-board.json',
|
||||
},
|
||||
], { force: true })
|
||||
|
||||
cy.get('.app-navigation__list .app-navigation-entry:contains("Imported board")')
|
||||
.should('be.visible')
|
||||
})
|
||||
})
|
||||
|
||||
@@ -25,9 +25,9 @@ const useModal = (useModal) => {
|
||||
})
|
||||
}
|
||||
|
||||
describe('Card', function () {
|
||||
describe('Card', function() {
|
||||
let boardId
|
||||
before(function () {
|
||||
before(function() {
|
||||
cy.createUser(user)
|
||||
cy.login(user)
|
||||
cy.createExampleBoard({
|
||||
@@ -38,11 +38,11 @@ describe('Card', function () {
|
||||
})
|
||||
})
|
||||
|
||||
beforeEach(function () {
|
||||
beforeEach(function() {
|
||||
cy.login(user)
|
||||
})
|
||||
|
||||
it('Can add a card', function () {
|
||||
it('Can add a card', function() {
|
||||
cy.visit(`/apps/deck/#/board/${boardId}`)
|
||||
const newCardTitle = 'Write some cypress tests'
|
||||
|
||||
@@ -63,7 +63,7 @@ describe('Card', function () {
|
||||
})
|
||||
})
|
||||
|
||||
it('Create card from overview', function () {
|
||||
it('Create card from overview', function() {
|
||||
cy.visit(`/apps/deck/#/`)
|
||||
const newCardTitle = 'Test create from overview'
|
||||
cy.intercept({ method: 'POST', url: '**/apps/deck/cards' }).as('save')
|
||||
@@ -71,10 +71,6 @@ describe('Card', function () {
|
||||
|
||||
cy.get('.button-vue[aria-label*="Add card"]')
|
||||
.first().click()
|
||||
|
||||
// Somehow this avoids the electron crash
|
||||
cy.wait(2000)
|
||||
|
||||
cy.get('.modal-mask.card-selector .card-title').should('be.visible').click().type(newCardTitle)
|
||||
cy.get('.modal-mask.card-selector .multiselect-board').should('be.visible').click()
|
||||
cy.get('.vs__dropdown-menu [data-cy="board-select-title"]:contains("' + boardData.title + '")').should('be.visible').click()
|
||||
@@ -87,85 +83,22 @@ describe('Card', function () {
|
||||
cy.get('.modal-mask.card-selector button.button-vue--vue-primary').should('be.visible').click()
|
||||
cy.wait('@save', { timeout: 7000 })
|
||||
|
||||
cy.reload()
|
||||
cy.visit(`/apps/deck/#/board/${boardId}`)
|
||||
cy.reload()
|
||||
cy.get('.board .stack').eq(0).within(() => {
|
||||
cy.get(`.card:contains("${newCardTitle}")`).should('be.visible')
|
||||
})
|
||||
})
|
||||
|
||||
it('Card with link reference', () => {
|
||||
cy.visit(`/apps/deck/#/board/${boardId}`)
|
||||
const absoluteUrl = `https://example.com`
|
||||
cy.get('.board .stack').eq(0).within(() => {
|
||||
cy.get('.button-vue[aria-label*="Add card"]')
|
||||
.first().click()
|
||||
|
||||
cy.get('.stack__card-add form input#new-stack-input-main')
|
||||
.type(absoluteUrl)
|
||||
cy.get('.stack__card-add form input[type=submit]')
|
||||
.first().click()
|
||||
cy.get('.card:contains("Example Domain")')
|
||||
.should('be.visible')
|
||||
.click()
|
||||
})
|
||||
|
||||
cy.get('.app-sidebar-header', { timeout: 10000 })
|
||||
.should('be.visible')
|
||||
.find('h2').contains('Example Domain').should('be.visible')
|
||||
})
|
||||
|
||||
it('Rename card with link', () => {
|
||||
cy.visit(`/apps/deck/#/board/${boardId}`)
|
||||
const absoluteUrl = `https://example.com`
|
||||
const plainTitle = 'New title'
|
||||
cy.get('.board .stack').eq(0).within(() => {
|
||||
cy.get('.button-vue[aria-label*="Add card"]')
|
||||
.first().click()
|
||||
|
||||
cy.get('.stack__card-add form input#new-stack-input-main')
|
||||
.type(absoluteUrl)
|
||||
cy.get('.stack__card-add form input[type=submit]')
|
||||
.first().click()
|
||||
cy.get('.card:contains("Example Domain")')
|
||||
.should('be.visible')
|
||||
})
|
||||
|
||||
// Rename link to plain title
|
||||
cy.get('.card:contains("Example Domain")')
|
||||
.last() // A duplicate card might be created in other test case, so we select the last one
|
||||
.find('.action-item__menutoggle')
|
||||
.click()
|
||||
cy.get('.v-popper__popper button:contains("Edit title")')
|
||||
.click()
|
||||
cy.get(`h4:contains("${absoluteUrl}") span[contenteditable="true"]`)
|
||||
.type(`{selectAll}${plainTitle}{enter}`)
|
||||
cy.get(`.card:contains("${plainTitle}")`)
|
||||
.should('be.visible')
|
||||
|
||||
// Rename plain title to link
|
||||
cy.get('.card:contains("New title")')
|
||||
.find('.action-item__menutoggle')
|
||||
.click()
|
||||
cy.get('.v-popper__popper button:contains("Edit title")')
|
||||
.click()
|
||||
cy.get('h4:contains("New title") span[contenteditable="true"]')
|
||||
.type(`{selectAll}${absoluteUrl}{enter}`)
|
||||
cy.get('.board').click()
|
||||
cy.get('.card:contains("Example Domain")')
|
||||
.should('be.visible')
|
||||
|
||||
})
|
||||
|
||||
describe('Modal', () => {
|
||||
beforeEach(function () {
|
||||
beforeEach(function() {
|
||||
cy.login(user)
|
||||
useModal(true).then(() => {
|
||||
cy.visit(`/apps/deck/#/board/${boardId}`)
|
||||
})
|
||||
})
|
||||
|
||||
it('Can show card details modal', function () {
|
||||
it('Can show card details modal', function() {
|
||||
cy.getNavigationEntry(boardData.title)
|
||||
.first().click({ force: true })
|
||||
|
||||
@@ -188,11 +121,10 @@ describe('Card', function () {
|
||||
cy.get('.file-picker__main [data-filename="welcome.txt"]', { timeout: 30000 }).should('be.visible')
|
||||
.click()
|
||||
cy.get('.dialog__actions button.button-vue--vue-primary').click()
|
||||
cy.get('.attachment-list .filename').contains('welcome')
|
||||
cy.get('.attachment-list .filename .extension').contains('txt')
|
||||
cy.get('.attachment-list .basename').contains('welcome.txt')
|
||||
})
|
||||
|
||||
it('Shows the modal with the editor', () => {
|
||||
it.only('Shows the modal with the editor', () => {
|
||||
cy.get('.card:contains("Hello world")').should('be.visible').click()
|
||||
cy.intercept({ method: 'PUT', url: '**/apps/deck/cards/*' }).as('save')
|
||||
cy.get('.modal__card').should('be.visible')
|
||||
@@ -229,9 +161,9 @@ describe('Card', function () {
|
||||
cy.get('.reference-picker-modal--content .reference-picker .multiselect-list').should('be.visible').contains(boardData.stacks[0].title)
|
||||
cy.get('.reference-picker-modal--content .reference-picker button.button-vue--vue-primary').should('be.visible').click()
|
||||
cy.wait('@save', { timeout: 7000 })
|
||||
cy.get('.modal__card .ProseMirror').contains('/index.php/apps/deck/card/').should('have.length', 1)
|
||||
cy.get('.modal__card .ProseMirror').contains('/index.php/apps/deck/card/').should('be.visible')
|
||||
|
||||
cy.visit(`/apps/deck/board/${boardId}`)
|
||||
cy.visit(`/apps/deck/#/board/${boardId}`)
|
||||
cy.reload()
|
||||
cy.get('.board .stack').eq(0).within(() => {
|
||||
cy.get(`.card:contains("${newCardTitle}")`).should('be.visible')
|
||||
@@ -240,7 +172,7 @@ describe('Card', function () {
|
||||
})
|
||||
|
||||
describe('Sidebar', () => {
|
||||
beforeEach(function () {
|
||||
beforeEach(function() {
|
||||
cy.login(user)
|
||||
useModal(false).then(() => {
|
||||
cy.visit(`/apps/deck/#/board/${boardId}`)
|
||||
@@ -253,7 +185,7 @@ describe('Card', function () {
|
||||
.find('.ProseMirror h1').contains('Hello world writing more text').should('be.visible')
|
||||
})
|
||||
|
||||
it('Set a due date', function () {
|
||||
it('Set a due date', function() {
|
||||
const newCardTitle = 'Card with a due date'
|
||||
|
||||
cy.get('.button-vue[aria-label*="Add card"]')
|
||||
@@ -291,7 +223,7 @@ describe('Card', function () {
|
||||
cy.get(`.card:contains("${newCardTitle}")`).find('[data-due-state]').should('not.exist')
|
||||
})
|
||||
|
||||
it('Add a label', function () {
|
||||
it('Add a label', function() {
|
||||
const newCardTitle = 'Card with labels'
|
||||
|
||||
cy.get('.button-vue[aria-label*="Add card"]')
|
||||
@@ -302,9 +234,6 @@ describe('Card', function () {
|
||||
.first().click()
|
||||
cy.get(`.card:contains("${newCardTitle}")`).should('be.visible').click()
|
||||
|
||||
// Add delay to ensure the events are bound
|
||||
cy.wait(1000)
|
||||
|
||||
cy.get('#app-sidebar-vue [data-test="tag-selector"] .vs__dropdown-toggle').should('be.visible').click()
|
||||
cy.get('.vs__dropdown-menu .tag:contains("Action needed")').should('be.visible').click()
|
||||
cy.get('.vs__dropdown-menu .tag:contains("Later")').should('be.visible').click()
|
||||
@@ -323,7 +252,7 @@ describe('Card', function () {
|
||||
})
|
||||
|
||||
describe('Card actions', () => {
|
||||
beforeEach(function () {
|
||||
beforeEach(function() {
|
||||
cy.login(user)
|
||||
useModal(false).then(() => {
|
||||
cy.visit(`/apps/deck/#/board/${boardId}`)
|
||||
@@ -369,21 +298,5 @@ describe('Card', function () {
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
it('clone card', () => {
|
||||
cy.intercept({ method: 'POST', url: '**/apps/deck/**/cards/*/clone' }).as('clone')
|
||||
cy.get('.card:contains("Hello world")').should('be.visible').click()
|
||||
cy.get('#app-sidebar-vue')
|
||||
.find('.ProseMirror h1').contains('Hello world').should('be.visible')
|
||||
|
||||
cy.get('.app-sidebar-header .action-item__menutoggle').click()
|
||||
cy.get('.v-popper__popper button:contains("Move/copy card")').click()
|
||||
cy.get('.vs__dropdown-menu span[title="MyTestBoard"]').should('be.visible').click()
|
||||
cy.get('[data-cy="select-stack"] .vs__dropdown-toggle').should('be.visible').click()
|
||||
cy.get('.vs__dropdown-menu span[title="TestList"]').should('be.visible').click()
|
||||
cy.get('.modal-container button:contains("Copy card")').click()
|
||||
cy.wait('@clone', { timeout: 7000 })
|
||||
cy.get('.card:contains("Hello world")').should('have.length', 2)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -22,10 +22,10 @@ describe('Deck dashboard', function() {
|
||||
.should($el => expect($el.text().trim()).to.equal('Upcoming cards'))
|
||||
})
|
||||
|
||||
it('Can see the default "Welcome Board" created for user by default', function() {
|
||||
it('Can see the default "Personal Board" created for user by default', function() {
|
||||
cy.visit('/apps/deck')
|
||||
|
||||
const defaultBoard = 'Welcome to Nextcloud Deck!'
|
||||
const defaultBoard = 'Personal'
|
||||
|
||||
cy.get('.app-navigation-entry-wrapper[icon=icon-deck]')
|
||||
.find('ul.app-navigation-entry__children .app-navigation-entry:contains(' + defaultBoard + ')')
|
||||
|
||||
@@ -1,102 +0,0 @@
|
||||
{
|
||||
"boards": [
|
||||
{
|
||||
"id": 70,
|
||||
"title": "Imported board",
|
||||
"owner": "unvjrmwuag",
|
||||
"color": "00ff00",
|
||||
"archived": false,
|
||||
"labels": [
|
||||
{
|
||||
"id": 293,
|
||||
"title": "Finished",
|
||||
"color": "31CC7C",
|
||||
"boardId": 70,
|
||||
"cardId": null,
|
||||
"lastModified": 0,
|
||||
"ETag": "cfcd208495d565ef66e7dff9f98764da"
|
||||
},
|
||||
{
|
||||
"id": 294,
|
||||
"title": "To review",
|
||||
"color": "317CCC",
|
||||
"boardId": 70,
|
||||
"cardId": null,
|
||||
"lastModified": 0,
|
||||
"ETag": "cfcd208495d565ef66e7dff9f98764da"
|
||||
},
|
||||
{
|
||||
"id": 295,
|
||||
"title": "Action needed",
|
||||
"color": "FF7A66",
|
||||
"boardId": 70,
|
||||
"cardId": null,
|
||||
"lastModified": 0,
|
||||
"ETag": "cfcd208495d565ef66e7dff9f98764da"
|
||||
},
|
||||
{
|
||||
"id": 296,
|
||||
"title": "Later",
|
||||
"color": "F1DB50",
|
||||
"boardId": 70,
|
||||
"cardId": null,
|
||||
"lastModified": 0,
|
||||
"ETag": "cfcd208495d565ef66e7dff9f98764da"
|
||||
}
|
||||
],
|
||||
"acl": [],
|
||||
"permissions": [],
|
||||
"users": [],
|
||||
"stacks": {
|
||||
"114": {
|
||||
"id": 114,
|
||||
"title": "TestList",
|
||||
"boardId": 70,
|
||||
"deletedAt": 0,
|
||||
"lastModified": 1743495533,
|
||||
"cards": [
|
||||
{
|
||||
"id": 124,
|
||||
"title": "Hello world",
|
||||
"description": "# Hello world",
|
||||
"descriptionPrev": null,
|
||||
"stackId": 114,
|
||||
"type": "plain",
|
||||
"lastModified": 1743495533,
|
||||
"lastEditor": null,
|
||||
"createdAt": 1743495533,
|
||||
"labels": [],
|
||||
"assignedUsers": null,
|
||||
"attachments": null,
|
||||
"attachmentCount": null,
|
||||
"owner": {
|
||||
"primaryKey": "unvjrmwuag",
|
||||
"uid": "unvjrmwuag",
|
||||
"displayname": "unvjrmwuag",
|
||||
"type": 0
|
||||
},
|
||||
"order": 999,
|
||||
"archived": false,
|
||||
"done": null,
|
||||
"duedate": null,
|
||||
"notified": false,
|
||||
"deletedAt": 0,
|
||||
"commentsUnread": 0,
|
||||
"commentsCount": 0,
|
||||
"relatedStack": null,
|
||||
"relatedBoard": null,
|
||||
"ETag": "aa85bb973089e7fbc0bbf122e926c23f"
|
||||
}
|
||||
],
|
||||
"order": 0,
|
||||
"ETag": "aa85bb973089e7fbc0bbf122e926c23f"
|
||||
}
|
||||
},
|
||||
"activeSessions": [],
|
||||
"deletedAt": 0,
|
||||
"lastModified": 1743495533,
|
||||
"settings": [],
|
||||
"ETag": "aa85bb973089e7fbc0bbf122e926c23f"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -102,11 +102,7 @@ Cypress.Commands.add('shareBoardWithUi', (query, userId=query) => {
|
||||
cy.intercept({ method: 'GET', url: `**/ocs/v2.php/apps/files_sharing/api/v1/sharees?search=${query}*` }).as('fetchRecipients')
|
||||
cy.get('[aria-label="Open details"]').click()
|
||||
cy.get('.app-sidebar').should('be.visible')
|
||||
|
||||
// Add delay to ensure the events are bound
|
||||
cy.wait(1000)
|
||||
|
||||
cy.get('.select input').click().type(`${query}`)
|
||||
cy.get('.select input').type(`${query}`)
|
||||
cy.wait('@fetchRecipients', { timeout: 7000 })
|
||||
|
||||
cy.get('.vs__dropdown-menu .option').first().contains(query)
|
||||
|
||||
71
docs/API.md
71
docs/API.md
@@ -6,7 +6,7 @@ The REST API provides access for authenticated users to their data inside the De
|
||||
|
||||
# Prerequisites
|
||||
|
||||
- All requests require a `OCS-APIRequest` HTTP header to be set to `true` and a `Content-Type` of `application/json`. This does not apply to the endpoint for uploading attachments, which consumes `multipart/form-data`.
|
||||
- All requests require a `OCS-APIRequest` HTTP header to be set to `true` and a `Content-Type` of `application/json`.
|
||||
- The API is located at https://nextcloud.local/index.php/apps/deck/api/v1.0
|
||||
- All request parameters are required, unless otherwise specified
|
||||
|
||||
@@ -347,34 +347,6 @@ A 403 response might be returned if the users ability to create new boards has b
|
||||
|
||||
##### 200 Success
|
||||
|
||||
### PUT /boards/{boardId}/stacks/{stackId}/cards/{cardId}/archive - Archive a card
|
||||
|
||||
#### Request parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ------- | --------------------------------------- |
|
||||
| boardId | Integer | The id of the board the card belongs to |
|
||||
| stackId | Integer | The id of the stack the card belongs to |
|
||||
| cardId | Integer | The id of the card |
|
||||
|
||||
#### Response
|
||||
|
||||
##### 200 Success
|
||||
|
||||
### PUT /boards/{boardId}/stacks/{stackId}/cards/{cardId}/unarchive - Unarchive a card
|
||||
|
||||
#### Request parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ------- | --------------------------------------- |
|
||||
| boardId | Integer | The id of the board the card belongs to |
|
||||
| stackId | Integer | The id of the stack the card belongs to |
|
||||
| cardId | Integer | The id of the card |
|
||||
|
||||
#### Response
|
||||
|
||||
##### 200 Success
|
||||
|
||||
### DELETE /boards/{boardId} - Delete a board
|
||||
|
||||
#### Request parameters
|
||||
@@ -451,25 +423,6 @@ A 403 response might be returned if the users ability to create new boards has b
|
||||
|
||||
##### 200 Success
|
||||
|
||||
### POST /boards/{boardId}/clone - Clone a board
|
||||
|
||||
Creates a copy of the board.
|
||||
|
||||
#### Request body
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ------ | ---------------------------------------------------- |
|
||||
| withCards | Bool | Setting if the cards should be copied (Default: false) |
|
||||
| withAssignments | Bool | Setting if the card assignments should be cloned (Default: false) |
|
||||
| withLabels | Bool | Setting if the card labels should be cloned (Default: false) |
|
||||
| withDueDate | Bool | Setting if the card due dates should be cloned (Default: false) |
|
||||
| moveCardsToLeftStack | Bool | Setting if all cards should be moved to the most left column (useful for To-Do / Doing / Done boards) (Default: false) |
|
||||
| restoreArchivedCards | Bool | Setting if the archived cards should be unarchived (Default: false) |
|
||||
|
||||
#### Response
|
||||
|
||||
##### 200 Success
|
||||
|
||||
### DELETE /boards/{boardId}/acl/{aclId} - Delete an acl rule
|
||||
|
||||
#### Response
|
||||
@@ -733,7 +686,6 @@ The board list endpoint supports setting an `If-Modified-Since` header to limit
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ------- | --------------------------------------- |
|
||||
| labelId | Integer | The label id to assign to the card |
|
||||
|
||||
#### Response
|
||||
|
||||
##### 200 Success
|
||||
@@ -998,12 +950,10 @@ The request can fail with a bad request response for the following reasons:
|
||||
|
||||
#### Request data
|
||||
|
||||
The request is performed as `multipart/form-data`.
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ------- | ----------------------------------------------------------------------------------------------- |
|
||||
| type | String | The type of the attachement. Use `file` or `deck_file`. |
|
||||
| file | Binary | File data to add as an attachment together with the `filename` parameter according to RFC 7578. |
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ------- | --------------------------------------------- |
|
||||
| type | String | The type of the attachement |
|
||||
| file | Binary | File data to add as an attachment |
|
||||
|
||||
- Prior to Deck version v1.3.0 (API v1.0), attachments were stored within deck. For this type of attachments `deck_file` was used as the default type of attachments
|
||||
- Starting with Deck version 1.3.0 (API v1.1) files are stored within the users regular Nextcloud files and the type `file` has been introduced for that
|
||||
@@ -1025,13 +975,12 @@ The request is performed as `multipart/form-data`.
|
||||
|
||||
#### Request data
|
||||
|
||||
The request is performed as `multipart/form-data`.
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ------- | ----------------------------------------------------------------------------------------------- |
|
||||
| type | String | The type of the attachement. For now only `deck_file` is supported as an attachment type. |
|
||||
| file | Binary | File data to add as an attachment together with the `filename` parameter according to RFC 7578. |
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ------- | --------------------------------------------- |
|
||||
| type | String | The type of the attachement |
|
||||
| file | Binary | File data to add as an attachment |
|
||||
|
||||
For now only `deck_file` is supported as an attachment type.
|
||||
|
||||
#### Response
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ The Deck application plugin uses the [markdown-it](https://github.com/markdown-i
|
||||
|
||||
## Supported Markdown
|
||||
|
||||
Markdown comes in many flavors. The best way to learn markdown and understand how to use it, is simply to [try it](https://markdown-it.github.io) on the original script official playground.
|
||||
Markdown comes in may flavors. The best way to learn markdown and understand how to use it, is simply to [try it](https://markdown-it.github.io) on the original script official playground.
|
||||
That same link offers also a comprehensive list of what is supported, and what is not - rendering it unnecessary to duplicate that content in here.
|
||||
|
||||
[CommonMark Markdown Reference](http://commonmark.org/help/)
|
||||
|
||||
@@ -105,21 +105,17 @@ It is possible to import from the following sources:
|
||||
|
||||
#### Trello JSON
|
||||
|
||||
**Limitations:**
|
||||
* Comments with more than 1000 characters are placed as attached files to the card.
|
||||
Steps:
|
||||
* Create the data file
|
||||
* Access Trello
|
||||
* go to the board you want to export
|
||||
* Follow the steps in [Trello documentation](https://help.trello.com/article/747-exporting-data-from-trello-1) and export as JSON
|
||||
* Create the configuration file
|
||||
* Execute the import informing the import file path, data file and source as `Trello JSON`
|
||||
|
||||
**Steps:**
|
||||
1. Create the data file:
|
||||
* Access Trello.
|
||||
* Go to the board you want to export.
|
||||
* Follow the steps in [Trello documentation](https://help.trello.com/article/747-exporting-data-from-trello-1) and export as JSON.
|
||||
2. Create the configuration file.
|
||||
3. Execute the import, specifying the import file path, data file, and source as `Trello JSON`.
|
||||
|
||||
Create the configuration file respecting the [JSON Schema](https://github.com/nextcloud/deck/blob/main/lib/Service/Importer/fixtures/config-trelloJson-schema.json) for importing `Trello JSON`.
|
||||
Create the configuration file respecting the [JSON Schema](https://github.com/nextcloud/deck/blob/main/lib/Service/Importer/fixtures/config-trelloJson-schema.json) for import `Trello JSON`
|
||||
|
||||
Example configuration file:
|
||||
|
||||
```json
|
||||
{
|
||||
"owner": "admin",
|
||||
@@ -130,22 +126,26 @@ Example configuration file:
|
||||
}
|
||||
```
|
||||
|
||||
**Additional Limitations**:
|
||||
* Importing from a JSON file imports up to 1000 actions. To find out how many actions the board to be imported has, check the number of actions in the JSON.
|
||||
**Limitations**:
|
||||
|
||||
Importing from a JSON file imports up to 1000 actions. To find out how many actions the board to be imported has, identify how many actions the JSON has.
|
||||
|
||||
#### Trello API
|
||||
|
||||
Importing via API is recommended for boards with more than 1000 actions. Trello allows attaching links to a card, but Deck does not support this feature. Attachment links are instead added in a markdown table at the end of the description for each imported card.
|
||||
Import using API is recommended for boards with more than 1000 actions.
|
||||
|
||||
1. Get the API Key and Token [here](https://developer.atlassian.com/cloud/trello/guides/rest-api/api-introduction/#authentication-and-authorization).
|
||||
2. Obtain the ID of the board you want to import by making a request to:
|
||||
```
|
||||
https://api.trello.com/1/members/me/boards?key={yourKey}&token={yourToken}&fields=id,name
|
||||
```
|
||||
3. Create the configuration file, ensuring it follows the [JSON Schema](https://github.com/nextcloud/deck/blob/main/lib/Service/Importer/fixtures/config-trelloApi-schema.json) for `Trello JSON`.
|
||||
Trello makes it possible to attach links to a card. Deck does not have this feature. Attachments and attachment links are added in a markdown table at the end of the description for every imported card that has attachments in Trello.
|
||||
|
||||
* Get the API Key and API Token [here](https://developer.atlassian.com/cloud/trello/guides/rest-api/api-introduction/#authentication-and-authorization)
|
||||
* Get the ID of the board you want to import by making a request to:
|
||||
https://api.trello.com/1/members/me/boards?key={yourKey}&token={yourToken}&fields=id,name
|
||||
|
||||
This ID you will use in the configuration file in the `board` property
|
||||
* Create the configuration file
|
||||
|
||||
Create the configuration file respecting the [JSON Schema](https://github.com/nextcloud/deck/blob/main/lib/Service/Importer/fixtures/config-trelloApi-schema.json) for import `Trello JSON`
|
||||
|
||||
Example configuration file:
|
||||
|
||||
```json
|
||||
{
|
||||
"owner": "admin",
|
||||
|
||||
@@ -4,19 +4,18 @@
|
||||
-->
|
||||
## Export
|
||||
|
||||
Deck currently supports exporting all boards a user owns in a single JSON file. The format is based on the database schema that Deck uses. It can be used to re-import boards on the same or other instances.
|
||||
Deck currently supports exporting all boards a user owns in a single JSON file. The format is based on the database schema that deck uses. It can be used to re-import boards on the same or other instances.
|
||||
|
||||
The export currently has some known limitations in terms of specific data not included:
|
||||
The export currently has some kown limitations in terms of specific data not included:
|
||||
- Activity information
|
||||
- File attachments to Deck cards
|
||||
- File attachments to deck cards
|
||||
- Comments
|
||||
|
||||
-
|
||||
```
|
||||
occ deck:export userid > userid-deck-export.json
|
||||
occ deck:export > my-file.json
|
||||
```
|
||||
*(`userid` = username as seen in the admin user accounts page)*
|
||||
|
||||
## Import Boards
|
||||
## Import boards
|
||||
|
||||
Importing can be done using the API or the `occ` `deck:import` command.
|
||||
|
||||
@@ -24,57 +23,39 @@ It is possible to import from the following sources:
|
||||
|
||||
### Deck JSON
|
||||
|
||||
A JSON file that has been obtained from the above-described `occ deck:export [userid] > userid-deck-export.json` command can be imported.
|
||||
A json file that has been obtained from the above described `occ deck:export [userid]` command can be imported.
|
||||
|
||||
```
|
||||
occ deck:import userid-deck-export.json
|
||||
occ deck:import my-file.json
|
||||
```
|
||||
|
||||
You will be asked to provide a path to a config file.
|
||||
In case you are importing from a different instance you may use an additional config file to provide custom user id mapping in case users have different identifiers.
|
||||
|
||||
To know what to put in there:
|
||||
- Have a look at your `userid-deck-export.json`
|
||||
- Near the top, you will see `"uid"` with a username.
|
||||
- Search for additional `"uid"` entries to find all the usernames involved and note them.
|
||||
- Search for `"acl"`, where `"uid"`s of groups are also present; note them too.
|
||||
|
||||
If you are importing from a different instance, you must provide custom user ID mapping in case users have different identifiers.
|
||||
|
||||
Create a config file, e.g., `deck-import-config-file-userid.json`, and adjust the content of this example as described above. User IDs on the new instance can be seen in the admin user accounts page.
|
||||
|
||||
```json
|
||||
```
|
||||
{
|
||||
"owner": "useridofnewownerofallboards",
|
||||
"owner": "admin",
|
||||
"uidRelation": {
|
||||
"userid1onoldinstance": "userid1onnewinstance",
|
||||
"userid2onoldinstance": "userid2onnewinstance",
|
||||
"groupid1onoldinstance": "groupid1onnewinstance"
|
||||
"johndoe": "test-user-1"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
After pressing enter, everything will be imported.
|
||||
|
||||
Additional info:
|
||||
- If you export a user’s boards, all boards that the user has access to will be exported (including those shared with that user).
|
||||
|
||||
#### Trello JSON
|
||||
|
||||
**Limitations:**
|
||||
Limitations:
|
||||
* Comments with more than 1000 characters are placed as attached files to the card.
|
||||
|
||||
**Steps:**
|
||||
1. Create the data file:
|
||||
* Access Trello.
|
||||
* Go to the board you want to export.
|
||||
* Follow the steps in [Trello documentation](https://help.trello.com/article/747-exporting-data-from-trello-1) and export as JSON.
|
||||
2. Create the configuration file.
|
||||
3. Execute the import, specifying the import file path, data file, and source as `Trello JSON`.
|
||||
Steps:
|
||||
* Create the data file
|
||||
* Access Trello
|
||||
* go to the board you want to export
|
||||
* Follow the steps in [Trello documentation](https://help.trello.com/article/747-exporting-data-from-trello-1) and export as JSON
|
||||
* Create the configuration file
|
||||
* Execute the import informing the import file path, data file and source as `Trello JSON`
|
||||
|
||||
Create the configuration file respecting the [JSON Schema](https://github.com/nextcloud/deck/blob/main/lib/Service/Importer/fixtures/config-trelloJson-schema.json) for importing `Trello JSON`.
|
||||
Create the configuration file respecting the [JSON Schema](https://github.com/nextcloud/deck/blob/main/lib/Service/Importer/fixtures/config-trelloJson-schema.json) for import `Trello JSON`
|
||||
|
||||
Example configuration file:
|
||||
|
||||
```json
|
||||
{
|
||||
"owner": "admin",
|
||||
@@ -85,22 +66,26 @@ Example configuration file:
|
||||
}
|
||||
```
|
||||
|
||||
**Additional Limitations**:
|
||||
* Importing from a JSON file imports up to 1000 actions. To find out how many actions the board to be imported has, check the number of actions in the JSON.
|
||||
**Limitations**:
|
||||
|
||||
Importing from a JSON file imports up to 1000 actions. To find out how many actions the board to be imported has, identify how many actions the JSON has.
|
||||
|
||||
#### Trello API
|
||||
|
||||
Importing via API is recommended for boards with more than 1000 actions. Trello allows attaching links to a card, but Deck does not support this feature. Attachment links are instead added in a markdown table at the end of the description for each imported card.
|
||||
Import using API is recommended for boards with more than 1000 actions.
|
||||
|
||||
1. Get the API Key and Token [here](https://developer.atlassian.com/cloud/trello/guides/rest-api/api-introduction/#authentication-and-authorization).
|
||||
2. Obtain the ID of the board you want to import by making a request to:
|
||||
```
|
||||
https://api.trello.com/1/members/me/boards?key={yourKey}&token={yourToken}&fields=id,name
|
||||
```
|
||||
3. Create the configuration file, ensuring it follows the [JSON Schema](https://github.com/nextcloud/deck/blob/main/lib/Service/Importer/fixtures/config-trelloApi-schema.json) for `Trello JSON`.
|
||||
Trello makes it possible to attach links to a card. Deck does not have this feature. Attachments and attachment links are added in a markdown table at the end of the description for every imported card that has attachments in Trello.
|
||||
|
||||
* Get the API Key and API Token [here](https://developer.atlassian.com/cloud/trello/guides/rest-api/api-introduction/#authentication-and-authorization)
|
||||
* Get the ID of the board you want to import by making a request to:
|
||||
https://api.trello.com/1/members/me/boards?key={yourKey}&token={yourToken}&fields=id,name
|
||||
|
||||
This ID you will use in the configuration file in the `board` property
|
||||
* Create the configuration file
|
||||
|
||||
Create the configuration file respecting the [JSON Schema](https://github.com/nextcloud/deck/blob/main/lib/Service/Importer/fixtures/config-trelloApi-schema.json) for import `Trello JSON`
|
||||
|
||||
Example configuration file:
|
||||
|
||||
```json
|
||||
{
|
||||
"owner": "admin",
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 188 KiB |
@@ -84,9 +84,6 @@ OC.L10N.register(
|
||||
"Failed to upload {name}" : "Не ўдалося запампаваць {name}",
|
||||
"Share" : "Абагуліць",
|
||||
"Personal" : "Асабістыя",
|
||||
"Example Task 3" : "Прыклад задання 3",
|
||||
"Example Task 2" : "Прыклад задання 2",
|
||||
"Example Task 1" : "Прыклад задання 1",
|
||||
"Today" : "Сёння",
|
||||
"Tomorrow" : "Заўтра"
|
||||
},
|
||||
|
||||
@@ -82,9 +82,6 @@
|
||||
"Failed to upload {name}" : "Не ўдалося запампаваць {name}",
|
||||
"Share" : "Абагуліць",
|
||||
"Personal" : "Асабістыя",
|
||||
"Example Task 3" : "Прыклад задання 3",
|
||||
"Example Task 2" : "Прыклад задання 2",
|
||||
"Example Task 1" : "Прыклад задання 1",
|
||||
"Today" : "Сёння",
|
||||
"Tomorrow" : "Заўтра"
|
||||
},"pluralForm" :"nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);"
|
||||
|
||||
@@ -288,7 +288,7 @@ OC.L10N.register(
|
||||
"Create a new tag:" : "Направи нова ознака:",
|
||||
"(group)" : "(group)",
|
||||
"{count} comments, {unread} unread" : "{count} коментари, {unread} непрочитани",
|
||||
"Todo items" : "Задачи",
|
||||
"Todo items" : "Работи за правење",
|
||||
"Edit card title" : "Измени наслов на картица",
|
||||
"Open link" : "Отвори линк",
|
||||
"Card deleted" : "Картицата е избришана",
|
||||
|
||||
@@ -286,7 +286,7 @@
|
||||
"Create a new tag:" : "Направи нова ознака:",
|
||||
"(group)" : "(group)",
|
||||
"{count} comments, {unread} unread" : "{count} коментари, {unread} непрочитани",
|
||||
"Todo items" : "Задачи",
|
||||
"Todo items" : "Работи за правење",
|
||||
"Edit card title" : "Измени наслов на картица",
|
||||
"Open link" : "Отвори линк",
|
||||
"Card deleted" : "Картицата е избришана",
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -101,7 +100,7 @@ class ActivityManager {
|
||||
StackMapper $stackMapper,
|
||||
AclMapper $aclMapper,
|
||||
IFactory $l10nFactory,
|
||||
?string $userId,
|
||||
?string $userId
|
||||
) {
|
||||
$this->manager = $manager;
|
||||
$this->permissionService = $permissionsService;
|
||||
@@ -485,7 +484,7 @@ class ActivityManager {
|
||||
$objectId = $entity->getObjectId();
|
||||
break;
|
||||
default:
|
||||
throw new InvalidArgumentException('No entity relation present for ' . $className . ' to ' . $objectType);
|
||||
throw new InvalidArgumentException('No entity relation present for '. $className . ' to ' . $objectType);
|
||||
}
|
||||
return $this->cardMapper->find($objectId);
|
||||
}
|
||||
@@ -500,11 +499,11 @@ class ActivityManager {
|
||||
$objectId = $entity->getBoardId();
|
||||
break;
|
||||
default:
|
||||
throw new InvalidArgumentException('No entity relation present for ' . $className . ' to ' . $objectType);
|
||||
throw new InvalidArgumentException('No entity relation present for '. $className . ' to ' . $objectType);
|
||||
}
|
||||
return $this->boardMapper->find($objectId);
|
||||
}
|
||||
throw new InvalidArgumentException('No entity relation present for ' . $className . ' to ' . $objectType);
|
||||
throw new InvalidArgumentException('No entity relation present for '. $className . ' to ' . $objectType);
|
||||
}
|
||||
|
||||
private function findDetailsForStack($stackId) {
|
||||
@@ -516,7 +515,7 @@ class ActivityManager {
|
||||
];
|
||||
}
|
||||
|
||||
private function findDetailsForCard(int $cardId, ?string $subject = null): array {
|
||||
private function findDetailsForCard($cardId, $subject = null) {
|
||||
$card = $this->cardMapper->find($cardId);
|
||||
$stack = $this->stackMapper->find($card->getStackId());
|
||||
$board = $this->boardMapper->find($stack->getBoardId());
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -109,7 +108,7 @@ class DeckProvider implements IProvider {
|
||||
}
|
||||
$board = [
|
||||
'type' => 'highlight',
|
||||
'id' => (string)$event->getObjectId(),
|
||||
'id' => $event->getObjectId(),
|
||||
'name' => $event->getObjectName(),
|
||||
'link' => $this->deckUrl('/board/' . $event->getObjectId()),
|
||||
];
|
||||
@@ -126,12 +125,12 @@ class DeckProvider implements IProvider {
|
||||
}
|
||||
$card = [
|
||||
'type' => 'highlight',
|
||||
'id' => (string)$event->getObjectId(),
|
||||
'id' => $event->getObjectId(),
|
||||
'name' => $event->getObjectName(),
|
||||
];
|
||||
|
||||
if (array_key_exists('board', $subjectParams)) {
|
||||
$card['link'] = $this->cardService->getCardUrl($event->getObjectId());
|
||||
$card['link'] = $this->cardService->getRedirectUrlForCard($event->getObjectId());
|
||||
$event->setLink($card['link']);
|
||||
}
|
||||
$params['card'] = $card;
|
||||
@@ -213,7 +212,7 @@ class DeckProvider implements IProvider {
|
||||
if (array_key_exists($paramName, $subjectParams)) {
|
||||
$params[$paramName] = [
|
||||
'type' => 'highlight',
|
||||
'id' => (string)$subjectParams[$paramName]['id'],
|
||||
'id' => $subjectParams[$paramName]['id'],
|
||||
'name' => $subjectParams[$paramName]['title'],
|
||||
'link' => $this->deckUrl('/board/' . $subjectParams[$paramName]['id'] . '/'),
|
||||
];
|
||||
@@ -224,7 +223,7 @@ class DeckProvider implements IProvider {
|
||||
if (array_key_exists($paramName, $subjectParams)) {
|
||||
$params[$paramName] = [
|
||||
'type' => 'highlight',
|
||||
'id' => (string)$subjectParams[$paramName]['id'],
|
||||
'id' => $subjectParams[$paramName]['id'],
|
||||
'name' => $subjectParams[$paramName]['title'],
|
||||
];
|
||||
}
|
||||
@@ -235,7 +234,7 @@ class DeckProvider implements IProvider {
|
||||
if (array_key_exists($paramName, $subjectParams)) {
|
||||
$params[$paramName] = [
|
||||
'type' => 'highlight',
|
||||
'id' => (string)$subjectParams[$paramName]['id'],
|
||||
'id' => $subjectParams[$paramName]['id'],
|
||||
'name' => $subjectParams[$paramName]['data'],
|
||||
'link' => $this->urlGenerator->linkToRoute('deck.attachment.display', ['cardId' => $subjectParams['card']['id'], 'attachmentId' => $subjectParams['attachment']['id']]),
|
||||
];
|
||||
@@ -259,7 +258,7 @@ class DeckProvider implements IProvider {
|
||||
if (array_key_exists('label', $subjectParams)) {
|
||||
$params['label'] = [
|
||||
'type' => 'highlight',
|
||||
'id' => (string)$subjectParams['label']['id'],
|
||||
'id' => $subjectParams['label']['id'],
|
||||
'name' => $subjectParams['label']['title']
|
||||
];
|
||||
}
|
||||
@@ -278,7 +277,7 @@ class DeckProvider implements IProvider {
|
||||
} else {
|
||||
$params['acl'] = [
|
||||
'type' => 'highlight',
|
||||
'id' => (string)$subjectParams['acl']['participant'],
|
||||
'id' => $subjectParams['acl']['participant'],
|
||||
'name' => $subjectParams['acl']['participant']
|
||||
];
|
||||
}
|
||||
@@ -294,7 +293,7 @@ class DeckProvider implements IProvider {
|
||||
$event->setParsedMessage($comment->getMessage());
|
||||
$params['comment'] = [
|
||||
'type' => 'highlight',
|
||||
'id' => (string)$subjectParams['comment'],
|
||||
'id' => $subjectParams['comment'],
|
||||
'name' => $comment->getMessage()
|
||||
];
|
||||
} catch (NotFoundException $e) {
|
||||
@@ -343,28 +342,28 @@ class DeckProvider implements IProvider {
|
||||
if (array_key_exists('before', $subjectParams)) {
|
||||
$params['before'] = [
|
||||
'type' => 'highlight',
|
||||
'id' => (string)$subjectParams['before'],
|
||||
'name' => $subjectParams['before'] ?? ''
|
||||
'id' => $subjectParams['before'],
|
||||
'name' => $subjectParams['before']
|
||||
];
|
||||
}
|
||||
if (array_key_exists('after', $subjectParams)) {
|
||||
$params['after'] = [
|
||||
'type' => 'highlight',
|
||||
'id' => (string)$subjectParams['after'],
|
||||
'name' => $subjectParams['after'] ?? ''
|
||||
'id' => $subjectParams['after'],
|
||||
'name' => $subjectParams['after']
|
||||
];
|
||||
}
|
||||
if (array_key_exists('card', $subjectParams) && $event->getSubject() === ActivityManager::SUBJECT_CARD_UPDATE_TITLE) {
|
||||
$params['card'] = [
|
||||
'type' => 'highlight',
|
||||
'id' => (string)$subjectParams['after'],
|
||||
'name' => $subjectParams['after'] ?? ''
|
||||
'id' => $subjectParams['after'],
|
||||
'name' => $subjectParams['after']
|
||||
];
|
||||
}
|
||||
return $params;
|
||||
}
|
||||
|
||||
public function deckUrl($endpoint) {
|
||||
return $this->urlGenerator->linkToRouteAbsolute('deck.page.index') . trim($endpoint, '/');
|
||||
return $this->urlGenerator->linkToRouteAbsolute('deck.page.index') . '#' . $endpoint;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -16,7 +15,7 @@ class Filter implements \OCP\Activity\IFilter {
|
||||
|
||||
public function __construct(
|
||||
IL10N $l10n,
|
||||
IURLGenerator $urlGenerator,
|
||||
IURLGenerator $urlGenerator
|
||||
) {
|
||||
$this->l10n = $l10n;
|
||||
$this->urlGenerator = $urlGenerator;
|
||||
@@ -40,8 +39,8 @@ class Filter implements \OCP\Activity\IFilter {
|
||||
|
||||
/**
|
||||
* @return int whether the filter should be rather on the top or bottom of
|
||||
* the admin section. The filters are arranged in ascending order of the
|
||||
* priority values. It is required to return a value between 0 and 100.
|
||||
* the admin section. The filters are arranged in ascending order of the
|
||||
* priority values. It is required to return a value between 0 and 100.
|
||||
* @since 11.0.0
|
||||
*/
|
||||
public function getPriority(): int {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -48,8 +47,8 @@ abstract class SettingBase extends ActivitySettings {
|
||||
|
||||
/**
|
||||
* @return int whether the filter should be rather on the top or bottom of
|
||||
* the admin section. The filters are arranged in ascending order of the
|
||||
* priority values. It is required to return a value between 0 and 100.
|
||||
* the admin section. The filters are arranged in ascending order of the
|
||||
* priority values. It is required to return a value between 0 and 100.
|
||||
* @since 11.0.0
|
||||
*/
|
||||
public function getPriority(): int {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -26,8 +25,8 @@ class SettingChanges extends SettingBase {
|
||||
|
||||
/**
|
||||
* @return int whether the filter should be rather on the top or bottom of
|
||||
* the admin section. The filters are arranged in ascending order of the
|
||||
* priority values. It is required to return a value between 0 and 100.
|
||||
* the admin section. The filters are arranged in ascending order of the
|
||||
* priority values. It is required to return a value between 0 and 100.
|
||||
* @since 11.0.0
|
||||
*/
|
||||
public function getPriority(): int {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -7,9 +6,6 @@
|
||||
|
||||
namespace OCA\Deck\Activity;
|
||||
|
||||
/**
|
||||
* @psalm-api SettingComment
|
||||
*/
|
||||
class SettingComment extends SettingBase {
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -177,7 +176,7 @@ class Application extends App implements IBootstrap {
|
||||
$permissionService = $this->getContainer()->get(PermissionService::class);
|
||||
|
||||
try {
|
||||
return $permissionService->checkPermission($cardMapper, (int)$name, Acl::PERMISSION_READ);
|
||||
return $permissionService->checkPermission($cardMapper, (int) $name, Acl::PERMISSION_READ);
|
||||
} catch (\Exception $e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -15,7 +14,7 @@ class Capabilities implements ICapability {
|
||||
|
||||
/** @var IAppManager */
|
||||
private $appManager;
|
||||
/** @var PermissionService */
|
||||
/** @var PermissionService */
|
||||
private $permissionService;
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -57,7 +56,7 @@ class ResourceProvider implements IProvider {
|
||||
*/
|
||||
public function getResourceRichObject(IResource $resource): array {
|
||||
$board = $this->getBoard($resource);
|
||||
$link = $this->urlGenerator->linkToRoute('deck.page.indexBoard', ['boardId' => $resource->getId()]);
|
||||
$link = $this->urlGenerator->linkToRoute('deck.page.index') . '#/board/' . $resource->getId();
|
||||
|
||||
return [
|
||||
'type' => self::RESOURCE_TYPE,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -66,10 +65,7 @@ class ResourceProviderCard implements IProvider {
|
||||
throw new ResourceException('No unique card found for resource, this should never happen');
|
||||
}
|
||||
|
||||
$link = $this->urlGenerator->linkToRoute('deck.page.indexCard', [
|
||||
'boardId' => $board->getId(),
|
||||
'cardId' => $card->getId()
|
||||
]);
|
||||
$link = $this->urlGenerator->linkToRoute('deck.page.index') . '#/board/' . $board->getId() . '/card/' . $resource->getId();
|
||||
|
||||
return [
|
||||
'type' => self::RESOURCE_TYPE,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -16,7 +15,7 @@ use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
class BoardImport extends Command {
|
||||
public function __construct(
|
||||
private BoardImportCommandService $boardImportCommandService,
|
||||
private BoardImportCommandService $boardImportCommandService
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
namespace OCA\Deck\Command;
|
||||
|
||||
use OCP\IConfig;
|
||||
use OCP\IUserManager;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
class CalendarToggle extends Command {
|
||||
private IUserManager $userManager;
|
||||
private IConfig $config;
|
||||
|
||||
public function __construct(IUserManager $userManager, IConfig $config) {
|
||||
parent::__construct();
|
||||
$this->userManager = $userManager;
|
||||
$this->config = $config;
|
||||
}
|
||||
|
||||
protected function configure() {
|
||||
$this
|
||||
->setName('deck:calendar-toggle')
|
||||
->setDescription('Enable or disable Deck calendar/tasks integration for all existing users. Users can still change their own setting afterwards. Only affects users that already exist at the time of execution.')
|
||||
->addOption(
|
||||
'on',
|
||||
null,
|
||||
InputOption::VALUE_NONE,
|
||||
'Enable calendar/tasks integration for all existing users (users can opt-out later)'
|
||||
)
|
||||
->addOption(
|
||||
'off',
|
||||
null,
|
||||
InputOption::VALUE_NONE,
|
||||
'Disable calendar/tasks integration for all existing users (users can opt-in later)'
|
||||
);
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int {
|
||||
$enable = $input->getOption('on');
|
||||
$disable = $input->getOption('off');
|
||||
if ($enable && $disable) {
|
||||
$output->writeln('<error>Cannot use --on and --off together.</error>');
|
||||
return 1;
|
||||
}
|
||||
if (!$enable && !$disable) {
|
||||
$output->writeln('<error>Please specify either --on or --off.</error>');
|
||||
return 1;
|
||||
}
|
||||
$value = $enable ? 'yes' : '';
|
||||
$users = $this->userManager->search('');
|
||||
$count = 0;
|
||||
foreach ($users as $user) {
|
||||
$uid = $user->getUID();
|
||||
$this->config->setUserValue($uid, 'deck', 'calendar', $value);
|
||||
$output->writeln("Set calendar integration to '" . ($enable ? 'on' : 'off') . "' for user: $uid");
|
||||
$count++;
|
||||
}
|
||||
$output->writeln("Done. Updated $count existing users.");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -73,17 +72,17 @@ final class TransferOwnership extends Command {
|
||||
try {
|
||||
$board = $boardId ? $this->boardMapper->find($boardId) : null;
|
||||
} catch (\Exception $e) {
|
||||
$output->writeln('Could not find a board for the provided id.');
|
||||
$output->writeln("Could not find a board for the provided id.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ($boardId !== null && $board->getOwner() !== $owner) {
|
||||
$output->writeln("$owner is not the owner of the board $boardId (" . $board->getTitle() . ')');
|
||||
$output->writeln("$owner is not the owner of the board $boardId (" . $board->getTitle() . ")");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ($boardId) {
|
||||
$output->writeln('Transfer board ' . $board->getTitle() . ' from ' . $board->getOwner() . " to $newOwner");
|
||||
$output->writeln("Transfer board " . $board->getTitle() . " from ". $board->getOwner() ." to $newOwner");
|
||||
} else {
|
||||
$output->writeln("Transfer all boards from $owner to $newOwner");
|
||||
}
|
||||
@@ -95,12 +94,12 @@ final class TransferOwnership extends Command {
|
||||
|
||||
if ($boardId) {
|
||||
$this->boardService->transferBoardOwnership($boardId, $newOwner, $remapAssignment);
|
||||
$output->writeln('<info>Board ' . $board->getTitle() . ' from ' . $board->getOwner() . " transferred to $newOwner completed</info>");
|
||||
$output->writeln("<info>Board " . $board->getTitle() . " from ". $board->getOwner() ." transferred to $newOwner completed</info>");
|
||||
return 0;
|
||||
}
|
||||
|
||||
foreach ($this->boardService->transferOwnership($owner, $newOwner, $remapAssignment) as $board) {
|
||||
$output->writeln(' - ' . $board->getTitle() . ' transferred');
|
||||
$output->writeln(" - " . $board->getTitle() . " transferred");
|
||||
}
|
||||
$output->writeln("<info>All boards from $owner to $newOwner transferred</info>");
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
@@ -1,18 +1,13 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
namespace OCA\Deck\Controller;
|
||||
|
||||
use OCA\Deck\Db\Attachment;
|
||||
use OCA\Deck\Service\AttachmentService;
|
||||
use OCP\AppFramework\ApiController;
|
||||
use OCP\AppFramework\Http;
|
||||
use OCP\AppFramework\Http\Attribute\CORS;
|
||||
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
|
||||
use OCP\AppFramework\Http\Attribute\NoCSRFRequired;
|
||||
use OCP\AppFramework\Http\DataResponse;
|
||||
use OCP\IRequest;
|
||||
|
||||
@@ -25,52 +20,72 @@ class AttachmentApiController extends ApiController {
|
||||
parent::__construct($appName, $request);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
#[CORS]
|
||||
#[NoCSRFRequired]
|
||||
public function getAll(string $apiVersion): DataResponse {
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @CORS
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
*/
|
||||
public function getAll($apiVersion) {
|
||||
$attachment = $this->attachmentService->findAll($this->request->getParam('cardId'), true);
|
||||
if ($apiVersion === '1.0') {
|
||||
$attachment = array_filter($attachment, fn (Attachment $attachment): bool => $attachment->getType() === 'deck_file');
|
||||
$attachment = array_filter($attachment, function ($attachment) {
|
||||
return $attachment->getType() === 'deck_file';
|
||||
});
|
||||
}
|
||||
return new DataResponse($attachment, HTTP::STATUS_OK);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
#[CORS]
|
||||
#[NoCSRFRequired]
|
||||
public function display(int $cardId, int $attachmentId, string $type = 'deck_file') {
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @CORS
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
*/
|
||||
public function display($cardId, $attachmentId, $type = 'deck_file') {
|
||||
return $this->attachmentService->display($cardId, $attachmentId, $type);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
#[CORS]
|
||||
#[NoCSRFRequired]
|
||||
public function create(int $cardId, string $type, string $data): DataResponse {
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @CORS
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
*/
|
||||
public function create($cardId, $type, $data) {
|
||||
$attachment = $this->attachmentService->create($cardId, $type, $data);
|
||||
return new DataResponse($attachment, HTTP::STATUS_OK);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
#[CORS]
|
||||
#[NoCSRFRequired]
|
||||
public function update(int $cardId, int $attachmentId, string $data, string $type = 'deck_file'): DataResponse {
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @CORS
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
*/
|
||||
public function update($cardId, $attachmentId, $data, $type = 'deck_file') {
|
||||
$attachment = $this->attachmentService->update($cardId, $attachmentId, $data, $type);
|
||||
return new DataResponse($attachment, HTTP::STATUS_OK);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
#[CORS]
|
||||
#[NoCSRFRequired]
|
||||
public function delete(int $cardId, int $attachmentId, string $type = 'deck_file'): DataResponse {
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @CORS
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
*/
|
||||
public function delete($cardId, $attachmentId, $type = 'deck_file') {
|
||||
$attachment = $this->attachmentService->delete($cardId, $attachmentId, $type);
|
||||
return new DataResponse($attachment, HTTP::STATUS_OK);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
#[CORS]
|
||||
#[NoCSRFRequired]
|
||||
public function restore(int $cardId, int $attachmentId, string $type = 'deck_file'): DataResponse {
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @CORS
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
*/
|
||||
public function restore($cardId, $attachmentId, $type = 'deck_file') {
|
||||
$attachment = $this->attachmentService->restore($cardId, $attachmentId, $type);
|
||||
return new DataResponse($attachment, HTTP::STATUS_OK);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -7,13 +6,8 @@
|
||||
|
||||
namespace OCA\Deck\Controller;
|
||||
|
||||
use OCA\Deck\BadRequestException;
|
||||
use OCA\Deck\Db\Attachment;
|
||||
use OCA\Deck\Service\AttachmentService;
|
||||
use OCP\AppFramework\Controller;
|
||||
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
|
||||
use OCP\AppFramework\Http\Attribute\NoCSRFRequired;
|
||||
use OCP\AppFramework\Http\Response;
|
||||
use OCP\IRequest;
|
||||
|
||||
class AttachmentController extends Controller {
|
||||
@@ -25,66 +19,74 @@ class AttachmentController extends Controller {
|
||||
parent::__construct($appName, $request);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
public function getAll(int $cardId): array {
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
public function getAll($cardId) {
|
||||
return $this->attachmentService->findAll($cardId, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $cardId
|
||||
* @param $attachmentId
|
||||
* @NoCSRFRequired
|
||||
* @NoAdminRequired
|
||||
* @return \OCP\AppFramework\Http\Response
|
||||
* @throws \OCA\Deck\NotFoundException
|
||||
*/
|
||||
#[NoAdminRequired]
|
||||
#[NoCSRFRequired]
|
||||
public function display(int $cardId, string $attachmentId): Response {
|
||||
['type' => $type, 'attachmentId' => $attachmentId] = $this->extractTypeAndAttachmentId($attachmentId);
|
||||
return $this->attachmentService->display($cardId, $attachmentId, $type);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
public function create(int $cardId): Attachment {
|
||||
return $this->attachmentService->create(
|
||||
$cardId,
|
||||
$this->request->getParam('type'),
|
||||
$this->request->getParam('data') ?? '',
|
||||
);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
public function update(int $cardId, string $attachmentId): Attachment {
|
||||
['type' => $type, 'attachmentId' => $attachmentId] = $this->extractTypeAndAttachmentId($attachmentId);
|
||||
return $this->attachmentService->update($cardId, $attachmentId, $this->request->getParam('data') ?? '', $type);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
public function delete(int $cardId, string $attachmentId): Attachment {
|
||||
['type' => $type, 'attachmentId' => $attachmentId] = $this->extractTypeAndAttachmentId($attachmentId);
|
||||
return $this->attachmentService->delete($cardId, $attachmentId, $type);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
public function restore(int $cardId, string $attachmentId): Attachment {
|
||||
['type' => $type, 'attachmentId' => $attachmentId] = $this->extractTypeAndAttachmentId($attachmentId);
|
||||
return $this->attachmentService->restore($cardId, $attachmentId, $type);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array{type: string, attachmentId: int}
|
||||
* @throws BadRequestException
|
||||
*/
|
||||
private function extractTypeAndAttachmentId(string $attachmentId): array {
|
||||
public function display($cardId, $attachmentId) {
|
||||
if (!str_contains($attachmentId, ':')) {
|
||||
$type = 'deck_file';
|
||||
} else {
|
||||
[$type, $attachmentId] = [...explode(':', $attachmentId), '', ''];
|
||||
[$type, $attachmentId] = explode(':', $attachmentId);
|
||||
}
|
||||
return $this->attachmentService->display($cardId, $attachmentId, $type);
|
||||
}
|
||||
|
||||
if ($type === '' || !is_numeric($attachmentId)) {
|
||||
throw new BadRequestException('Invalid attachment id');
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
public function create($cardId) {
|
||||
return $this->attachmentService->create(
|
||||
$cardId,
|
||||
$this->request->getParam('type'),
|
||||
$this->request->getParam('data')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
public function update($cardId, $attachmentId) {
|
||||
if (!str_contains($attachmentId, ':')) {
|
||||
$type = 'deck_file';
|
||||
} else {
|
||||
[$type, $attachmentId] = explode(':', $attachmentId);
|
||||
}
|
||||
return $this->attachmentService->update($cardId, $attachmentId, $this->request->getParam('data'), $type);
|
||||
}
|
||||
|
||||
return [
|
||||
'type' => $type,
|
||||
'attachmentId' => (int)$attachmentId,
|
||||
];
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
public function delete($cardId, $attachmentId) {
|
||||
if (!str_contains($attachmentId, ':')) {
|
||||
$type = 'deck_file';
|
||||
} else {
|
||||
[$type, $attachmentId] = explode(':', $attachmentId);
|
||||
}
|
||||
return $this->attachmentService->delete($cardId, $attachmentId, $type);
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
public function restore($cardId, $attachmentId) {
|
||||
if (!str_contains($attachmentId, ':')) {
|
||||
$type = 'deck_file';
|
||||
} else {
|
||||
[$type, $attachmentId] = explode(':', $attachmentId);
|
||||
}
|
||||
return $this->attachmentService->restore($cardId, $attachmentId, $type);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -12,13 +11,10 @@ use OCA\Deck\Service\BoardService;
|
||||
use OCA\Deck\StatusException;
|
||||
use OCP\AppFramework\ApiController;
|
||||
use OCP\AppFramework\Http;
|
||||
use OCP\AppFramework\Http\Attribute\CORS;
|
||||
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
|
||||
use OCP\AppFramework\Http\Attribute\NoCSRFRequired;
|
||||
use OCP\AppFramework\Http\DataResponse;
|
||||
use OCP\IRequest;
|
||||
|
||||
use function Sabre\HTTP\parseDate;
|
||||
use OCP\IRequest;
|
||||
use Sabre\HTTP\Util;
|
||||
|
||||
/**
|
||||
* Class BoardApiController
|
||||
@@ -39,18 +35,21 @@ class BoardApiController extends ApiController {
|
||||
}
|
||||
|
||||
/**
|
||||
* Return all the boards that the current user has access to.
|
||||
* @NoAdminRequired
|
||||
* @CORS
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
* Return all of the boards that the current user has access to.
|
||||
*
|
||||
* @param bool $details
|
||||
* @throws StatusException
|
||||
*/
|
||||
#[NoAdminRequired]
|
||||
#[NoCSRFRequired]
|
||||
#[CORS]
|
||||
public function index(bool $details = false): DataResponse {
|
||||
public function index(bool $details = false) {
|
||||
$modified = $this->request->getHeader('If-Modified-Since');
|
||||
if ($modified === '') {
|
||||
if ($modified === null || $modified === '') {
|
||||
$boards = $this->boardService->findAll(0, $details === true);
|
||||
} else {
|
||||
$date = parseDate($modified);
|
||||
$date = Util::parseHTTPDate($modified);
|
||||
if (!$date) {
|
||||
throw new StatusException('Invalid If-Modified-Since header provided.');
|
||||
}
|
||||
@@ -64,12 +63,14 @@ class BoardApiController extends ApiController {
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @CORS
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
*
|
||||
* Return the board specified by $this->request->getParam('boardId').
|
||||
*/
|
||||
#[NoAdminRequired]
|
||||
#[NoCSRFRequired]
|
||||
#[CORS]
|
||||
public function get(): DataResponse {
|
||||
public function get() {
|
||||
$board = $this->boardService->find($this->request->getParam('boardId'));
|
||||
$response = new DataResponse($board, HTTP::STATUS_OK);
|
||||
$response->setETag($board->getEtag());
|
||||
@@ -77,53 +78,68 @@ class BoardApiController extends ApiController {
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @CORS
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
* @params $title
|
||||
* @params $color
|
||||
*
|
||||
* Create a board with the specified title and color.
|
||||
*/
|
||||
#[NoAdminRequired]
|
||||
#[NoCSRFRequired]
|
||||
#[CORS]
|
||||
public function create(string $title, string $color): DataResponse {
|
||||
public function create($title, $color) {
|
||||
$board = $this->boardService->create($title, $this->userId, $color);
|
||||
return new DataResponse($board, HTTP::STATUS_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @CORS
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
* @params $title
|
||||
* @params $color
|
||||
* @params $archived
|
||||
*
|
||||
* Update a board with the specified boardId, title and color, and archived state.
|
||||
*/
|
||||
#[NoAdminRequired]
|
||||
#[NoCSRFRequired]
|
||||
#[CORS]
|
||||
public function update(string $title, string $color, bool $archived = false): DataResponse {
|
||||
public function update($title, $color, $archived = false) {
|
||||
$board = $this->boardService->update($this->request->getParam('boardId'), $title, $color, $archived);
|
||||
return new DataResponse($board, HTTP::STATUS_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @CORS
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
*
|
||||
* Delete the board specified by $boardId. Return the board that was deleted.
|
||||
*/
|
||||
#[NoAdminRequired]
|
||||
#[NoCSRFRequired]
|
||||
#[CORS]
|
||||
public function delete(): DataResponse {
|
||||
public function delete() {
|
||||
$board = $this->boardService->delete($this->request->getParam('boardId'));
|
||||
return new DataResponse($board, HTTP::STATUS_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @CORS
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
*
|
||||
* Undo the deletion of the board specified by $boardId.
|
||||
*/
|
||||
#[NoAdminRequired]
|
||||
#[NoCSRFRequired]
|
||||
#[CORS]
|
||||
public function undoDelete(): DataResponse {
|
||||
public function undoDelete() {
|
||||
$board = $this->boardService->deleteUndo($this->request->getParam('boardId'));
|
||||
return new DataResponse($board, HTTP::STATUS_OK);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
#[NoCSRFRequired]
|
||||
#[CORS]
|
||||
public function addAcl(int $boardId, $type, $participant, $permissionEdit, $permissionShare, $permissionManage) {
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @CORS
|
||||
* @NoCSRFRequired
|
||||
*/
|
||||
public function addAcl($boardId, $type, $participant, $permissionEdit, $permissionShare, $permissionManage) {
|
||||
$acl = $this->boardService->addAcl($boardId, $type, $participant, $permissionEdit, $permissionShare, $permissionManage);
|
||||
return new DataResponse($acl, HTTP::STATUS_OK);
|
||||
}
|
||||
@@ -147,13 +163,4 @@ class BoardApiController extends ApiController {
|
||||
$acl = $this->boardService->deleteAcl($aclId);
|
||||
return new DataResponse($acl, HTTP::STATUS_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
public function clone(int $boardId, bool $withCards = false, bool $withAssignments = false, bool $withLabels = false, bool $withDueDate = false, bool $moveCardsToLeftStack = false, bool $restoreArchivedCards = false): DataResponse {
|
||||
return new DataResponse(
|
||||
$this->boardService->clone($boardId, $this->userId, $withCards, $withAssignments, $withLabels, $withDueDate, $moveCardsToLeftStack, $restoreArchivedCards)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -10,13 +9,10 @@ namespace OCA\Deck\Controller;
|
||||
use OCA\Deck\Db\Acl;
|
||||
use OCA\Deck\Db\Board;
|
||||
use OCA\Deck\Service\BoardService;
|
||||
use OCA\Deck\Service\Importer\BoardImportService;
|
||||
use OCA\Deck\Service\PermissionService;
|
||||
use OCP\AppFramework\ApiController;
|
||||
use OCP\AppFramework\Http;
|
||||
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
|
||||
use OCP\AppFramework\Http\DataResponse;
|
||||
use OCP\IL10N;
|
||||
use OCP\IRequest;
|
||||
|
||||
class BoardController extends ApiController {
|
||||
@@ -25,45 +21,73 @@ class BoardController extends ApiController {
|
||||
IRequest $request,
|
||||
private BoardService $boardService,
|
||||
private PermissionService $permissionService,
|
||||
private BoardImportService $boardImportService,
|
||||
private IL10N $l10n,
|
||||
private $userId,
|
||||
) {
|
||||
parent::__construct($appName, $request);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
public function index() {
|
||||
return $this->boardService->findAll();
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
public function read(int $boardId): Board {
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @param $boardId
|
||||
* @return \OCP\AppFramework\Db\Entity
|
||||
*/
|
||||
public function read(int $boardId) {
|
||||
return $this->boardService->find($boardId);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
public function create(string $title, string $color): Board {
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @param $title
|
||||
* @param $color
|
||||
* @return \OCP\AppFramework\Db\Entity
|
||||
*/
|
||||
public function create($title, $color) {
|
||||
return $this->boardService->create($title, $this->userId, $color);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
public function update(int $id, string $title, string $color, bool $archived): Board {
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @param $id
|
||||
* @param $title
|
||||
* @param $color
|
||||
* @param $archived
|
||||
* @return \OCP\AppFramework\Db\Entity
|
||||
*/
|
||||
public function update($id, $title, $color, $archived) {
|
||||
return $this->boardService->update($id, $title, $color, $archived);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
public function delete(int $boardId): Board {
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @param $boardId
|
||||
* @return \OCP\AppFramework\Db\Entity
|
||||
*/
|
||||
public function delete($boardId) {
|
||||
return $this->boardService->delete($boardId);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
public function deleteUndo(int $boardId): Board {
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @param $boardId
|
||||
* @return \OCP\AppFramework\Db\Entity
|
||||
*/
|
||||
public function deleteUndo($boardId) {
|
||||
return $this->boardService->deleteUndo($boardId);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
public function getUserPermissions(int $boardId): array {
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @param $boardId
|
||||
* @return array|bool
|
||||
* @internal param $userId
|
||||
*/
|
||||
public function getUserPermissions($boardId) {
|
||||
$permissions = $this->permissionService->getPermissions($boardId);
|
||||
return [
|
||||
'PERMISSION_READ' => $permissions[Acl::PERMISSION_READ],
|
||||
@@ -74,10 +98,16 @@ class BoardController extends ApiController {
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @param $boardId
|
||||
* @param $type
|
||||
* @param $participant
|
||||
* @param $permissionEdit
|
||||
* @param $permissionShare
|
||||
* @param $permissionManage
|
||||
* @return \OCP\AppFramework\Db\Entity
|
||||
*/
|
||||
#[NoAdminRequired]
|
||||
public function addAcl(int $boardId, int $type, $participant, bool $permissionEdit, bool $permissionShare, bool $permissionManage): Acl {
|
||||
public function addAcl($boardId, $type, $participant, $permissionEdit, $permissionShare, $permissionManage) {
|
||||
return $this->boardService->addAcl($boardId, $type, $participant, $permissionEdit, $permissionShare, $permissionManage);
|
||||
}
|
||||
|
||||
@@ -104,11 +134,11 @@ class BoardController extends ApiController {
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @param $boardId
|
||||
* @return Board
|
||||
*/
|
||||
public function clone(int $boardId, bool $withCards = false, bool $withAssignments = false, bool $withLabels = false, bool $withDueDate = false, bool $moveCardsToLeftStack = false, bool $restoreArchivedCards = false): DataResponse {
|
||||
return new DataResponse(
|
||||
$this->boardService->clone($boardId, $this->userId, $withCards, $withAssignments, $withLabels, $withDueDate, $moveCardsToLeftStack, $restoreArchivedCards)
|
||||
);
|
||||
public function clone($boardId) {
|
||||
return $this->boardService->clone($boardId, $this->userId);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -132,62 +162,4 @@ class BoardController extends ApiController {
|
||||
public function export($boardId) {
|
||||
return $this->boardService->export($boardId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
public function import(): DataResponse {
|
||||
$file = $this->request->getUploadedFile('file');
|
||||
$error = null;
|
||||
$phpFileUploadErrors = [
|
||||
UPLOAD_ERR_OK => $this->l10n->t('The file was uploaded'),
|
||||
UPLOAD_ERR_INI_SIZE => $this->l10n->t('The uploaded file exceeds the upload_max_filesize directive in php.ini'),
|
||||
UPLOAD_ERR_FORM_SIZE => $this->l10n->t('The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form'),
|
||||
UPLOAD_ERR_PARTIAL => $this->l10n->t('The file was only partially uploaded'),
|
||||
UPLOAD_ERR_NO_FILE => $this->l10n->t('No file was uploaded'),
|
||||
UPLOAD_ERR_NO_TMP_DIR => $this->l10n->t('Missing a temporary folder'),
|
||||
UPLOAD_ERR_CANT_WRITE => $this->l10n->t('Could not write file to disk'),
|
||||
UPLOAD_ERR_EXTENSION => $this->l10n->t('A PHP extension stopped the file upload'),
|
||||
];
|
||||
|
||||
if (empty($file)) {
|
||||
$error = $this->l10n->t('No file uploaded or file size exceeds maximum of %s', [\OCP\Util::humanFileSize(\OCP\Util::uploadLimit())]);
|
||||
}
|
||||
if (!empty($file) && array_key_exists('error', $file) && $file['error'] !== UPLOAD_ERR_OK) {
|
||||
$error = $phpFileUploadErrors[$file['error']];
|
||||
}
|
||||
if (!empty($file) && $file['error'] === UPLOAD_ERR_OK && !in_array($file['type'], ['application/json', 'text/plain'])) {
|
||||
$error = $this->l10n->t('Invalid file type. Only JSON files are allowed.');
|
||||
}
|
||||
if ($error !== null) {
|
||||
return new DataResponse([
|
||||
'status' => 'error',
|
||||
'message' => $error,
|
||||
], Http::STATUS_BAD_REQUEST);
|
||||
}
|
||||
|
||||
try {
|
||||
$fileContent = file_get_contents($file['tmp_name']);
|
||||
$this->boardImportService->setSystem('DeckJson');
|
||||
$config = new \stdClass();
|
||||
$config->owner = $this->userId;
|
||||
$this->boardImportService->setConfigInstance($config);
|
||||
$this->boardImportService->setData(json_decode($fileContent));
|
||||
$this->boardImportService->import();
|
||||
$importedBoard = $this->boardImportService->getBoard();
|
||||
$board = $this->boardService->find($importedBoard->getId());
|
||||
|
||||
return new DataResponse($board, Http::STATUS_OK);
|
||||
} catch (\TypeError $e) {
|
||||
return new DataResponse([
|
||||
'status' => 'error',
|
||||
'message' => $this->l10n->t('Invalid JSON data'),
|
||||
], Http::STATUS_BAD_REQUEST);
|
||||
} catch (\Exception $e) {
|
||||
return new DataResponse([
|
||||
'status' => 'error',
|
||||
'message' => $this->l10n->t('Failed to import board'),
|
||||
], Http::STATUS_BAD_REQUEST);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -9,9 +8,6 @@ namespace OCA\Deck\Controller;
|
||||
|
||||
use OCA\Deck\Service\Importer\BoardImportService;
|
||||
use OCP\AppFramework\Http;
|
||||
use OCP\AppFramework\Http\Attribute\CORS;
|
||||
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
|
||||
use OCP\AppFramework\Http\Attribute\NoCSRFRequired;
|
||||
use OCP\AppFramework\Http\DataResponse;
|
||||
use OCP\AppFramework\OCSController;
|
||||
use OCP\IRequest;
|
||||
@@ -26,9 +22,11 @@ class BoardImportApiController extends OCSController {
|
||||
parent::__construct($appName, $request);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
#[CORS]
|
||||
#[NoCSRFRequired]
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @CORS
|
||||
* @NoCSRFRequired
|
||||
*/
|
||||
public function import(string $system, array $config, array $data): DataResponse {
|
||||
$this->boardImportService->setSystem($system);
|
||||
$config = json_decode(json_encode($config));
|
||||
@@ -39,17 +37,21 @@ class BoardImportApiController extends OCSController {
|
||||
return new DataResponse($this->boardImportService->getBoard(), Http::STATUS_OK);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
#[CORS]
|
||||
#[NoCSRFRequired]
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @CORS
|
||||
* @NoCSRFRequired
|
||||
*/
|
||||
public function getAllowedSystems(): DataResponse {
|
||||
$allowedSystems = $this->boardImportService->getAllowedImportSystems();
|
||||
return new DataResponse($allowedSystems, Http::STATUS_OK);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
#[CORS]
|
||||
#[NoCSRFRequired]
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @CORS
|
||||
* @NoCSRFRequired
|
||||
*/
|
||||
public function getConfigSchema(string $name): DataResponse {
|
||||
$this->boardImportService->setSystem($name);
|
||||
$this->boardImportService->validateSystem();
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -12,9 +11,6 @@ use OCA\Deck\Service\AssignmentService;
|
||||
use OCA\Deck\Service\CardService;
|
||||
use OCP\AppFramework\ApiController;
|
||||
use OCP\AppFramework\Http;
|
||||
use OCP\AppFramework\Http\Attribute\CORS;
|
||||
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
|
||||
use OCP\AppFramework\Http\Attribute\NoCSRFRequired;
|
||||
use OCP\AppFramework\Http\DataResponse;
|
||||
use OCP\IRequest;
|
||||
|
||||
@@ -30,7 +26,7 @@ class CardApiController extends ApiController {
|
||||
* @param IRequest $request
|
||||
* @param CardService $cardService
|
||||
* @param AssignmentService $assignmentService
|
||||
* @param string $userId
|
||||
* @param $userId
|
||||
*/
|
||||
public function __construct(
|
||||
string $appName,
|
||||
@@ -83,102 +79,88 @@ class CardApiController extends ApiController {
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @CORS
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
*
|
||||
* Update a card
|
||||
*/
|
||||
#[NoAdminRequired]
|
||||
#[CORS]
|
||||
#[NoCSRFRequired]
|
||||
public function update(string $title, $type, string $owner, string $description = '', int $order = 0, $duedate = null, $archived = null): DataResponse {
|
||||
public function update($title, $type, $owner, $description = '', $order = 0, $duedate = null, $archived = null) {
|
||||
$done = array_key_exists('done', $this->request->getParams()) ? new OptionalNullableValue($this->request->getParam('done', null)) : null;
|
||||
$card = $this->cardService->update($this->request->getParam('cardId'), $title, $this->request->getParam('stackId'), $type, $owner, $description, $order, $duedate, 0, $archived, $done);
|
||||
return new DataResponse($card, HTTP::STATUS_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @CORS
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
* Delete a specific card.
|
||||
*/
|
||||
#[NoAdminRequired]
|
||||
#[CORS]
|
||||
#[NoCSRFRequired]
|
||||
public function delete(): DataResponse {
|
||||
public function delete() {
|
||||
$card = $this->cardService->delete($this->request->getParam('cardId'));
|
||||
return new DataResponse($card, HTTP::STATUS_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @CORS
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
* Assign a label to a card.
|
||||
*/
|
||||
#[NoAdminRequired]
|
||||
#[CORS]
|
||||
#[NoCSRFRequired]
|
||||
public function assignLabel(int $labelId): DataResponse {
|
||||
public function assignLabel($labelId) {
|
||||
$card = $this->cardService->assignLabel($this->request->getParam('cardId'), $labelId);
|
||||
return new DataResponse($card, HTTP::STATUS_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @CORS
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
* Assign a label to a card.
|
||||
*/
|
||||
#[NoAdminRequired]
|
||||
#[CORS]
|
||||
#[NoCSRFRequired]
|
||||
public function removeLabel(int $labelId): DataResponse {
|
||||
public function removeLabel($labelId) {
|
||||
$card = $this->cardService->removeLabel($this->request->getParam('cardId'), $labelId);
|
||||
return new DataResponse($card, HTTP::STATUS_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @CORS
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
* Assign a user to a card
|
||||
*/
|
||||
#[NoAdminRequired]
|
||||
#[CORS]
|
||||
#[NoCSRFRequired]
|
||||
public function assignUser(int $cardId, string $userId, int $type = 0): DataResponse {
|
||||
public function assignUser($cardId, $userId, $type = 0) {
|
||||
$card = $this->assignmentService->assignUser($cardId, $userId, $type);
|
||||
return new DataResponse($card, HTTP::STATUS_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @CORS
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
* Unassign a user from a card
|
||||
*/
|
||||
#[NoAdminRequired]
|
||||
#[CORS]
|
||||
#[NoCSRFRequired]
|
||||
public function unassignUser(int $cardId, string $userId, int $type = 0): DataResponse {
|
||||
public function unassignUser($cardId, $userId, $type = 0) {
|
||||
$card = $this->assignmentService->unassignUser($cardId, $userId, $type);
|
||||
return new DataResponse($card, HTTP::STATUS_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* Archive card
|
||||
*/
|
||||
#[NoAdminRequired]
|
||||
#[CORS]
|
||||
#[NoCSRFRequired]
|
||||
public function archive(int $cardId): DataResponse {
|
||||
$card = $this->cardService->archive($cardId);
|
||||
return new DataResponse($card, HTTP::STATUS_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unarchive card
|
||||
*/
|
||||
#[NoAdminRequired]
|
||||
#[CORS]
|
||||
#[NoCSRFRequired]
|
||||
public function unarchive(int $cardId): DataResponse {
|
||||
$card = $this->cardService->unarchive($cardId);
|
||||
return new DataResponse($card, HTTP::STATUS_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @CORS
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
* Reorder cards
|
||||
*/
|
||||
#[NoAdminRequired]
|
||||
#[CORS]
|
||||
#[NoCSRFRequired]
|
||||
public function reorder(int $stackId, int $order): DataResponse {
|
||||
$card = $this->cardService->reorder((int)$this->request->getParam('cardId'), $stackId, $order);
|
||||
public function reorder($stackId, $order) {
|
||||
$card = $this->cardService->reorder($this->request->getParam('cardId'), $stackId, $order);
|
||||
return new DataResponse($card, HTTP::STATUS_OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -7,12 +6,9 @@
|
||||
|
||||
namespace OCA\Deck\Controller;
|
||||
|
||||
use OCA\Deck\Db\Assignment;
|
||||
use OCA\Deck\Db\Card;
|
||||
use OCA\Deck\Service\AssignmentService;
|
||||
use OCA\Deck\Service\CardService;
|
||||
use OCP\AppFramework\Controller;
|
||||
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
|
||||
use OCP\IRequest;
|
||||
|
||||
class CardController extends Controller {
|
||||
@@ -26,26 +22,45 @@ class CardController extends Controller {
|
||||
parent::__construct($appName, $request);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
public function read(int $cardId): Card {
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @param $cardId
|
||||
* @return \OCP\AppFramework\Db\Entity
|
||||
*/
|
||||
public function read($cardId) {
|
||||
return $this->cardService->find($cardId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Card[]
|
||||
* @NoAdminRequired
|
||||
* @param $cardId
|
||||
* @param $stackId
|
||||
* @param $order
|
||||
* @return array
|
||||
*/
|
||||
#[NoAdminRequired]
|
||||
public function reorder(int $cardId, int $stackId, int $order): array {
|
||||
return $this->cardService->reorder($cardId, $stackId, $order);
|
||||
public function reorder($cardId, $stackId, $order) {
|
||||
return $this->cardService->reorder((int)$cardId, (int)$stackId, (int)$order);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
public function rename(int $cardId, string $title): Card {
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @param $cardId
|
||||
* @param $title
|
||||
* @return \OCP\AppFramework\Db\Entity
|
||||
*/
|
||||
public function rename($cardId, $title) {
|
||||
return $this->cardService->rename($cardId, $title);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
public function create(string $title, int $stackId, string $type = 'plain', int $order = 999, string $description = '', $duedate = null, array $labels = [], array $users = []): Card {
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @param $title
|
||||
* @param $stackId
|
||||
* @param $type
|
||||
* @param int $order
|
||||
* @return \OCP\AppFramework\Db\Entity
|
||||
*/
|
||||
public function create($title, $stackId, $type = 'plain', $order = 999, string $description = '', $duedate = null, $labels = [], $users = []) {
|
||||
$card = $this->cardService->create($title, $stackId, $type, $order, $this->userId, $description, $duedate);
|
||||
|
||||
foreach ($labels as $label) {
|
||||
@@ -60,68 +75,104 @@ class CardController extends Controller {
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @param $id
|
||||
* @param $title
|
||||
* @param $stackId
|
||||
* @param $type
|
||||
* @param $order
|
||||
* @param $description
|
||||
* @param $duedate
|
||||
* @param $deletedAt
|
||||
* @return \OCP\AppFramework\Db\Entity
|
||||
*/
|
||||
#[NoAdminRequired]
|
||||
public function update(int $id, string $title, int $stackId, string $type, int $order, string $description, $duedate, $deletedAt): Card {
|
||||
public function update($id, $title, $stackId, $type, $order, $description, $duedate, $deletedAt) {
|
||||
return $this->cardService->update($id, $title, $stackId, $type, $this->userId, $description, $order, $duedate, $deletedAt);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
public function clone(int $cardId, ?int $targetStackId = null): Card {
|
||||
return $this->cardService->cloneCard($cardId, $targetStackId);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
public function delete(int $cardId): Card {
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @param $cardId
|
||||
* @return \OCP\AppFramework\Db\Entity
|
||||
*/
|
||||
public function delete($cardId) {
|
||||
return $this->cardService->delete($cardId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Card[]
|
||||
* @NoAdminRequired
|
||||
* @param $boardId
|
||||
* @return \OCP\AppFramework\Db\Entity
|
||||
*/
|
||||
#[NoAdminRequired]
|
||||
public function deleted(int $boardId): array {
|
||||
public function deleted($boardId) {
|
||||
return $this->cardService->fetchDeleted($boardId);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @param $cardId
|
||||
* @return \OCP\AppFramework\Db\Entity
|
||||
*/
|
||||
public function archive($cardId) {
|
||||
return $this->cardService->archive($cardId);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
public function unarchive(int $cardId): Card {
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @param $cardId
|
||||
* @return \OCP\AppFramework\Db\Entity
|
||||
*/
|
||||
public function unarchive($cardId) {
|
||||
return $this->cardService->unarchive($cardId);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
public function done(int $cardId): Card {
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @param $cardId
|
||||
* @return \OCP\AppFramework\Db\Entity
|
||||
*/
|
||||
public function done(int $cardId) {
|
||||
return $this->cardService->done($cardId);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
public function undone(int $cardId): Card {
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @param $cardId
|
||||
* @return \OCP\AppFramework\Db\Entity
|
||||
*/
|
||||
public function undone(int $cardId) {
|
||||
return $this->cardService->undone($cardId);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
public function assignLabel(int $cardId, int $labelId): void {
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @param $cardId
|
||||
* @param $labelId
|
||||
*/
|
||||
public function assignLabel($cardId, $labelId) {
|
||||
$this->cardService->assignLabel($cardId, $labelId);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
public function removeLabel(int $cardId, int $labelId): void {
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @param $cardId
|
||||
* @param $labelId
|
||||
*/
|
||||
public function removeLabel($cardId, $labelId) {
|
||||
$this->cardService->removeLabel($cardId, $labelId);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
public function assignUser(int $cardId, string $userId, int $type = 0): Assignment {
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
public function assignUser($cardId, $userId, $type = 0) {
|
||||
return $this->assignmentService->assignUser($cardId, $userId, $type);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
public function unassignUser(int $cardId, string $userId, int $type = 0): Assignment {
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
public function unassignUser($cardId, $userId, $type = 0) {
|
||||
return $this->assignmentService->unassignUser($cardId, $userId, $type);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -9,15 +8,11 @@ namespace OCA\Deck\Controller;
|
||||
|
||||
use OCA\Deck\Service\CommentService;
|
||||
use OCA\Deck\StatusException;
|
||||
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
|
||||
use OCP\AppFramework\Http\DataResponse;
|
||||
|
||||
use OCP\AppFramework\OCSController;
|
||||
use OCP\IRequest;
|
||||
|
||||
/**
|
||||
* @psalm-api
|
||||
*/
|
||||
class CommentsApiController extends OCSController {
|
||||
public function __construct(
|
||||
string $appName,
|
||||
@@ -31,33 +26,33 @@ class CommentsApiController extends OCSController {
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @throws StatusException
|
||||
*/
|
||||
#[NoAdminRequired]
|
||||
public function list(int $cardId, int $limit = 20, int $offset = 0): DataResponse {
|
||||
public function list(string $cardId, int $limit = 20, int $offset = 0): DataResponse {
|
||||
return $this->commentService->list($cardId, $limit, $offset);
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @throws StatusException
|
||||
*/
|
||||
#[NoAdminRequired]
|
||||
public function create(int $cardId, string $message, int $parentId = 0): DataResponse {
|
||||
return $this->commentService->create($cardId, $message, $parentId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @throws StatusException
|
||||
*/
|
||||
#[NoAdminRequired]
|
||||
public function update(int $cardId, int $commentId, string $message): DataResponse {
|
||||
return $this->commentService->update($cardId, $commentId, $message);
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @throws StatusException
|
||||
*/
|
||||
#[NoAdminRequired]
|
||||
public function delete(int $cardId, int $commentId): DataResponse {
|
||||
return $this->commentService->delete($cardId, $commentId);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -8,8 +7,6 @@
|
||||
namespace OCA\Deck\Controller;
|
||||
|
||||
use OCA\Deck\Service\ConfigService;
|
||||
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
|
||||
use OCP\AppFramework\Http\Attribute\NoCSRFRequired;
|
||||
use OCP\AppFramework\Http\DataResponse;
|
||||
use OCP\AppFramework\Http\NotFoundResponse;
|
||||
use OCP\AppFramework\OCSController;
|
||||
@@ -24,15 +21,19 @@ class ConfigController extends OCSController {
|
||||
parent::__construct($AppName, $request);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
#[NoCSRFRequired]
|
||||
/**
|
||||
* @NoCSRFRequired
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
public function get(): DataResponse {
|
||||
return new DataResponse($this->configService->getAll());
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
#[NoCSRFRequired]
|
||||
public function setValue(string $key, mixed $value): DataResponse|NotFoundResponse {
|
||||
/**
|
||||
* @NoCSRFRequired
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
public function setValue(string $key, $value) {
|
||||
$result = $this->configService->set($key, $value);
|
||||
if ($result === null) {
|
||||
return new NotFoundResponse();
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -10,9 +9,6 @@ namespace OCA\Deck\Controller;
|
||||
use OCA\Deck\Service\LabelService;
|
||||
use OCP\AppFramework\ApiController;
|
||||
use OCP\AppFramework\Http;
|
||||
use OCP\AppFramework\Http\Attribute\CORS;
|
||||
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
|
||||
use OCP\AppFramework\Http\Attribute\NoCSRFRequired;
|
||||
use OCP\AppFramework\Http\DataResponse;
|
||||
use OCP\IRequest;
|
||||
|
||||
@@ -29,50 +25,59 @@ class LabelApiController extends ApiController {
|
||||
$appName,
|
||||
IRequest $request,
|
||||
private LabelService $labelService,
|
||||
private $userId,
|
||||
) {
|
||||
parent::__construct($appName, $request);
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @CORS
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
* Get a specific label.
|
||||
*/
|
||||
#[NoAdminRequired]
|
||||
#[NoCSRFRequired]
|
||||
#[CORS]
|
||||
public function get(): DataResponse {
|
||||
public function get() {
|
||||
$label = $this->labelService->find($this->request->getParam('labelId'));
|
||||
return new DataResponse($label, HTTP::STATUS_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @CORS
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
* @params $title
|
||||
* @params $color
|
||||
* Create a new label
|
||||
*/
|
||||
#[NoAdminRequired]
|
||||
#[NoCSRFRequired]
|
||||
#[CORS]
|
||||
public function create(string $title, string $color): DataResponse {
|
||||
public function create($title, $color) {
|
||||
$label = $this->labelService->create($title, $color, $this->request->getParam('boardId'));
|
||||
return new DataResponse($label, HTTP::STATUS_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @CORS
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
* @params $title
|
||||
* @params $color
|
||||
* Update a specific label
|
||||
*/
|
||||
#[NoAdminRequired]
|
||||
#[NoCSRFRequired]
|
||||
#[CORS]
|
||||
public function update(string $title, string $color): DataResponse {
|
||||
public function update($title, $color) {
|
||||
$label = $this->labelService->update($this->request->getParam('labelId'), $title, $color);
|
||||
return new DataResponse($label, HTTP::STATUS_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @CORS
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
* Delete a specific label
|
||||
*/
|
||||
#[NoAdminRequired]
|
||||
#[NoCSRFRequired]
|
||||
#[CORS]
|
||||
public function delete(): DataResponse {
|
||||
public function delete() {
|
||||
$label = $this->labelService->delete($this->request->getParam('labelId'));
|
||||
return new DataResponse($label, HTTP::STATUS_OK);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -7,10 +6,8 @@
|
||||
|
||||
namespace OCA\Deck\Controller;
|
||||
|
||||
use OCA\Deck\Db\Label;
|
||||
use OCA\Deck\Service\LabelService;
|
||||
use OCP\AppFramework\Controller;
|
||||
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
|
||||
use OCP\IRequest;
|
||||
|
||||
class LabelController extends Controller {
|
||||
@@ -22,18 +19,34 @@ class LabelController extends Controller {
|
||||
parent::__construct($appName, $request);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
public function create(string $title, string $color, int $boardId): Label {
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @param $title
|
||||
* @param $color
|
||||
* @param $boardId
|
||||
* @return \OCP\AppFramework\Db\Entity
|
||||
*/
|
||||
public function create($title, $color, $boardId) {
|
||||
return $this->labelService->create($title, $color, $boardId);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
public function update(int $id, string $title, string $color): Label {
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @param $id
|
||||
* @param $title
|
||||
* @param $color
|
||||
* @return \OCP\AppFramework\Db\Entity
|
||||
*/
|
||||
public function update($id, $title, $color) {
|
||||
return $this->labelService->update($id, $title, $color);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
public function delete(int $labelId): Label {
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @param $labelId
|
||||
* @return \OCP\AppFramework\Db\Entity
|
||||
*/
|
||||
public function delete($labelId) {
|
||||
return $this->labelService->delete($labelId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ declare(strict_types=1);
|
||||
namespace OCA\Deck\Controller;
|
||||
|
||||
use OCA\Deck\Service\OverviewService;
|
||||
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
|
||||
use OCP\AppFramework\Http\DataResponse;
|
||||
use OCP\AppFramework\OCSController;
|
||||
use OCP\IRequest;
|
||||
@@ -25,7 +24,9 @@ class OverviewApiController extends OCSController {
|
||||
parent::__construct($appName, $request);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
public function upcomingCards(): DataResponse {
|
||||
return new DataResponse($this->dashboardService->findUpcomingCards($this->userId));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -13,7 +12,6 @@ namespace OCA\Deck\Controller;
|
||||
use OCA\Deck\Db\Card;
|
||||
use OCA\Deck\Model\CardDetails;
|
||||
use OCA\Deck\Service\SearchService;
|
||||
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
|
||||
use OCP\AppFramework\Http\DataResponse;
|
||||
use OCP\AppFramework\OCSController;
|
||||
use OCP\IRequest;
|
||||
@@ -27,7 +25,9 @@ class SearchController extends OCSController {
|
||||
parent::__construct($appName, $request);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
public function search(string $term, ?int $limit = null, ?int $cursor = null): DataResponse {
|
||||
$cards = $this->searchService->searchCards($term, $limit, $cursor);
|
||||
return new DataResponse(array_map(function (Card $card) {
|
||||
|
||||
@@ -21,8 +21,7 @@ use OCP\AppFramework\OCSController;
|
||||
use OCP\IRequest;
|
||||
|
||||
class SessionController extends OCSController {
|
||||
public function __construct(
|
||||
$appName,
|
||||
public function __construct($appName,
|
||||
IRequest $request,
|
||||
private SessionService $sessionService,
|
||||
private PermissionService $permissionService,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -7,16 +6,14 @@
|
||||
|
||||
namespace OCA\Deck\Controller;
|
||||
|
||||
use OCA\Deck\Service\BoardService;
|
||||
use OCA\Deck\Service\StackService;
|
||||
use OCA\Deck\StatusException;
|
||||
use OCP\AppFramework\ApiController;
|
||||
use OCP\AppFramework\Http;
|
||||
use OCP\AppFramework\Http\Attribute\CORS;
|
||||
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
|
||||
use OCP\AppFramework\Http\Attribute\NoCSRFRequired;
|
||||
use OCP\AppFramework\Http\DataResponse;
|
||||
use OCP\IRequest;
|
||||
use function Sabre\HTTP\parseDate;
|
||||
use Sabre\HTTP\Util;
|
||||
|
||||
/**
|
||||
* Class StackApiController
|
||||
@@ -31,21 +28,23 @@ class StackApiController extends ApiController {
|
||||
$appName,
|
||||
IRequest $request,
|
||||
private StackService $stackService,
|
||||
private BoardService $boardService,
|
||||
) {
|
||||
parent::__construct($appName, $request);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return all the stacks in the specified board.
|
||||
* @NoAdminRequired
|
||||
* @CORS
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
* Return all of the stacks in the specified board.
|
||||
*/
|
||||
#[NoAdminRequired]
|
||||
#[CORS]
|
||||
#[NoCSRFRequired]
|
||||
public function index(): DataResponse {
|
||||
public function index() {
|
||||
$since = 0;
|
||||
$modified = $this->request->getHeader('If-Modified-Since');
|
||||
if ($modified !== '') {
|
||||
$date = parseDate($modified);
|
||||
if ($modified !== null && $modified !== '') {
|
||||
$date = Util::parseHTTPDate($modified);
|
||||
if (!$date) {
|
||||
throw new StatusException('Invalid If-Modified-Since header provided.');
|
||||
}
|
||||
@@ -56,12 +55,13 @@ class StackApiController extends ApiController {
|
||||
}
|
||||
|
||||
/**
|
||||
* Return all the stacks in the specified board.
|
||||
* @NoAdminRequired
|
||||
* @CORS
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
* Return all of the stacks in the specified board.
|
||||
*/
|
||||
#[NoAdminRequired]
|
||||
#[CORS]
|
||||
#[NoCSRFRequired]
|
||||
public function get(): DataResponse {
|
||||
public function get() {
|
||||
$stack = $this->stackService->find($this->request->getParam('stackId'));
|
||||
$response = new DataResponse($stack, HTTP::STATUS_OK);
|
||||
$response->setETag($stack->getETag());
|
||||
@@ -69,45 +69,55 @@ class StackApiController extends ApiController {
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @CORS
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
* @params $title
|
||||
* @params $order
|
||||
*
|
||||
* Create a stack with the specified title and order.
|
||||
*/
|
||||
#[NoAdminRequired]
|
||||
#[CORS]
|
||||
#[NoCSRFRequired]
|
||||
public function create(string $title, int $order): DataResponse {
|
||||
public function create($title, $order) {
|
||||
$stack = $this->stackService->create($title, $this->request->getParam('boardId'), $order);
|
||||
return new DataResponse($stack, HTTP::STATUS_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @CORS
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
* @params $title
|
||||
* @params $order
|
||||
*
|
||||
* Update a stack by the specified stackId and boardId with the values that were put.
|
||||
*/
|
||||
#[NoAdminRequired]
|
||||
#[CORS]
|
||||
#[NoCSRFRequired]
|
||||
public function update(string $title, int $order) {
|
||||
public function update($title, $order) {
|
||||
$stack = $this->stackService->update($this->request->getParam('stackId'), $title, $this->request->getParam('boardId'), $order, 0);
|
||||
return new DataResponse($stack, HTTP::STATUS_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @CORS
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
* Delete the stack specified by $this->request->getParam('stackId').
|
||||
*/
|
||||
#[NoAdminRequired]
|
||||
#[CORS]
|
||||
#[NoCSRFRequired]
|
||||
public function delete(): DataResponse {
|
||||
public function delete() {
|
||||
$stack = $this->stackService->delete($this->request->getParam('stackId'));
|
||||
return new DataResponse($stack, HTTP::STATUS_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the stacks that have been archived.
|
||||
* @NoAdminRequired
|
||||
* @CORS
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
* get the stacks that have been archived.
|
||||
*/
|
||||
#[NoAdminRequired]
|
||||
#[CORS]
|
||||
#[NoCSRFRequired]
|
||||
public function getArchived(): DataResponse {
|
||||
public function getArchived() {
|
||||
$stacks = $this->stackService->findAllArchived($this->request->getParam('boardId'));
|
||||
return new DataResponse($stacks, HTTP::STATUS_OK);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -7,12 +6,10 @@
|
||||
|
||||
namespace OCA\Deck\Controller;
|
||||
|
||||
use OCA\Deck\Db\Stack;
|
||||
use OCA\Deck\Service\StackService;
|
||||
|
||||
use OCP\AppFramework\Controller;
|
||||
|
||||
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
|
||||
use OCP\IRequest;
|
||||
|
||||
class StackController extends Controller {
|
||||
@@ -20,54 +17,78 @@ class StackController extends Controller {
|
||||
string $appName,
|
||||
IRequest $request,
|
||||
private StackService $stackService,
|
||||
private $userId,
|
||||
) {
|
||||
parent::__construct($appName, $request);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Stack[]
|
||||
* @NoAdminRequired
|
||||
* @param $boardId
|
||||
* @return array
|
||||
*/
|
||||
#[NoAdminRequired]
|
||||
public function index(int $boardId): array {
|
||||
public function index($boardId) {
|
||||
return $this->stackService->findAll($boardId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Stack[]
|
||||
* @NoAdminRequired
|
||||
* @param $boardId
|
||||
* @return array
|
||||
*/
|
||||
#[NoAdminRequired]
|
||||
public function archived(int $boardId): array {
|
||||
public function archived($boardId) {
|
||||
return $this->stackService->findAllArchived($boardId);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
public function create(string $title, int $boardId, int $order = 999): Stack {
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @param $title
|
||||
* @param $boardId
|
||||
* @param int $order
|
||||
* @return \OCP\AppFramework\Db\Entity
|
||||
*/
|
||||
public function create($title, $boardId, $order = 999) {
|
||||
return $this->stackService->create($title, $boardId, $order);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
public function update(int $id, string $title, int $boardId, int $order, ?int $deletedAt = null): Stack {
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @param $id
|
||||
* @param $title
|
||||
* @param $boardId
|
||||
* @param $order
|
||||
* @param $deletedAt
|
||||
* @return \OCP\AppFramework\Db\Entity
|
||||
*/
|
||||
public function update($id, $title, $boardId, $order, $deletedAt) {
|
||||
return $this->stackService->update($id, $title, $boardId, $order, $deletedAt);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<int, Stack>
|
||||
* @NoAdminRequired
|
||||
* @param $stackId
|
||||
* @param $order
|
||||
* @return array
|
||||
*/
|
||||
#[NoAdminRequired]
|
||||
public function reorder(int $stackId, int $order): array {
|
||||
return $this->stackService->reorder($stackId, $order);
|
||||
public function reorder($stackId, $order) {
|
||||
return $this->stackService->reorder((int)$stackId, (int)$order);
|
||||
}
|
||||
|
||||
#[NoAdminRequired]
|
||||
public function delete(int $stackId): Stack {
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @param $stackId
|
||||
* @return \OCP\AppFramework\Db\Entity
|
||||
*/
|
||||
public function delete($stackId) {
|
||||
return $this->stackService->delete($stackId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Stack[]
|
||||
* @NoAdminRequired
|
||||
* @param $boardId
|
||||
* @return \OCP\AppFramework\Db\Entity
|
||||
*/
|
||||
#[NoAdminRequired]
|
||||
public function deleted(int $boardId): array {
|
||||
public function deleted($boardId) {
|
||||
return $this->stackService->fetchDeleted($boardId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -13,17 +12,27 @@ use OCA\Deck\Notification\NotificationHelper;
|
||||
use OCP\AppFramework\Db\DoesNotExistException;
|
||||
use OCP\AppFramework\Utility\ITimeFactory;
|
||||
use OCP\BackgroundJob\Job;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use OCP\ILogger;
|
||||
|
||||
class ScheduledNotifications extends Job {
|
||||
|
||||
/** @var CardMapper */
|
||||
protected $cardMapper;
|
||||
/** @var NotificationHelper */
|
||||
protected $notificationHelper;
|
||||
/** @var ILogger */
|
||||
protected $logger;
|
||||
|
||||
public function __construct(
|
||||
ITimeFactory $time,
|
||||
protected CardMapper $cardMapper,
|
||||
protected NotificationHelper $notificationHelper,
|
||||
protected LoggerInterface $logger,
|
||||
CardMapper $cardMapper,
|
||||
NotificationHelper $notificationHelper,
|
||||
ILogger $logger
|
||||
) {
|
||||
parent::__construct($time);
|
||||
$this->cardMapper = $cardMapper;
|
||||
$this->notificationHelper = $notificationHelper;
|
||||
$this->logger = $logger;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -14,19 +14,21 @@ namespace OCA\Deck\Cron;
|
||||
use OCA\Deck\Service\SessionService;
|
||||
use OCP\AppFramework\Utility\ITimeFactory;
|
||||
use OCP\BackgroundJob\TimedJob;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use OCP\ILogger;
|
||||
|
||||
class SessionsCleanup extends TimedJob {
|
||||
private $sessionService;
|
||||
private $documentService;
|
||||
private $logger;
|
||||
private $imageService;
|
||||
|
||||
|
||||
public function __construct(
|
||||
ITimeFactory $time,
|
||||
private SessionService $sessionService,
|
||||
private LoggerInterface $logger,
|
||||
) {
|
||||
public function __construct(ITimeFactory $time,
|
||||
SessionService $sessionService,
|
||||
ILogger $logger) {
|
||||
parent::__construct($time);
|
||||
$this->sessionService = $sessionService;
|
||||
$this->logger = $logger;
|
||||
$this->setInterval(SessionService::SESSION_VALID_TIME);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -26,7 +25,7 @@ class Calendar extends ExternalCalendar {
|
||||
private $children;
|
||||
/** @var DeckCalendarBackend */
|
||||
private $backend;
|
||||
/** @var Board */
|
||||
/** @var Board */
|
||||
private $board;
|
||||
|
||||
public function __construct(string $principalUri, string $calendarUri, Board $board, DeckCalendarBackend $backend) {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -33,7 +32,7 @@ class DeckCalendarBackend {
|
||||
|
||||
public function __construct(
|
||||
BoardService $boardService, StackService $stackService, CardService $cardService, PermissionService $permissionService,
|
||||
BoardMapper $boardMapper,
|
||||
BoardMapper $boardMapper
|
||||
) {
|
||||
$this->boardService = $boardService;
|
||||
$this->stackService = $stackService;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -7,20 +6,6 @@
|
||||
|
||||
namespace OCA\Deck\Db;
|
||||
|
||||
/**
|
||||
* @method int getBoardId()
|
||||
* @method bool isPermissionEdit()
|
||||
* @method void setPermissionEdit(bool $permissionEdit)
|
||||
* @method bool isPermissionShare()
|
||||
* @method void setPermissionShare(bool $permissionShare)
|
||||
* @method bool isPermissionManage()
|
||||
* @method void setPermissionManage(bool $permissionManage)
|
||||
* @method int getType()
|
||||
* @method void setType(int $type)
|
||||
* @method bool isOwner()
|
||||
* @method void setOwner(int $owner)
|
||||
*
|
||||
*/
|
||||
class Acl extends RelationalEntity {
|
||||
public const PERMISSION_READ = 0;
|
||||
public const PERMISSION_EDIT = 1;
|
||||
@@ -51,13 +36,17 @@ class Acl extends RelationalEntity {
|
||||
$this->addResolvable('participant');
|
||||
}
|
||||
|
||||
public function getPermission(int $permission): bool {
|
||||
return match ($permission) {
|
||||
self::PERMISSION_READ => true,
|
||||
self::PERMISSION_EDIT => $this->getPermissionEdit(),
|
||||
self::PERMISSION_SHARE => $this->getPermissionShare(),
|
||||
self::PERMISSION_MANAGE => $this->getPermissionManage(),
|
||||
default => false,
|
||||
};
|
||||
public function getPermission($permission) {
|
||||
switch ($permission) {
|
||||
case self::PERMISSION_READ:
|
||||
return true;
|
||||
case self::PERMISSION_EDIT:
|
||||
return $this->getPermissionEdit();
|
||||
case self::PERMISSION_SHARE:
|
||||
return $this->getPermissionShare();
|
||||
case self::PERMISSION_MANAGE:
|
||||
return $this->getPermissionManage();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -19,10 +18,13 @@ class AclMapper extends DeckMapper implements IPermissionMapper {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param numeric $boardId
|
||||
* @param int|null $limit
|
||||
* @param int|null $offset
|
||||
* @return Acl[]
|
||||
* @throws \OCP\DB\Exception
|
||||
*/
|
||||
public function findAll(int $boardId, ?int $limit = null, ?int $offset = null) {
|
||||
public function findAll($boardId, $limit = null, $offset = null) {
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
$qb->select('id', 'board_id', 'type', 'participant', 'permission_edit', 'permission_share', 'permission_manage')
|
||||
->from('deck_board_acl')
|
||||
@@ -48,9 +50,12 @@ class AclMapper extends DeckMapper implements IPermissionMapper {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param numeric $userId
|
||||
* @param numeric $id
|
||||
* @return bool
|
||||
* @throws \OCP\DB\Exception
|
||||
*/
|
||||
public function isOwner(string $userId, int $id): bool {
|
||||
public function isOwner($userId, $id): bool {
|
||||
$aclId = $id;
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
$qb->select('acl.id')
|
||||
@@ -62,11 +67,15 @@ class AclMapper extends DeckMapper implements IPermissionMapper {
|
||||
return count($qb->executeQuery()->fetchAll()) > 0;
|
||||
}
|
||||
|
||||
public function findBoardId(int $id): ?int {
|
||||
/**
|
||||
* @param numeric $id
|
||||
* @return int|null
|
||||
*/
|
||||
public function findBoardId($id): ?int {
|
||||
try {
|
||||
$entity = $this->find($id);
|
||||
return $entity->getBoardId();
|
||||
} catch (DoesNotExistException|MultipleObjectsReturnedException $e) {
|
||||
} catch (DoesNotExistException | MultipleObjectsReturnedException $e) {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -77,7 +86,7 @@ class AclMapper extends DeckMapper implements IPermissionMapper {
|
||||
* @return Acl[]
|
||||
* @throws \OCP\DB\Exception
|
||||
*/
|
||||
public function findByParticipant(int $type, string $participant): array {
|
||||
public function findByParticipant($type, $participant): array {
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
|
||||
$qb->select('*')
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -77,41 +76,26 @@ class AssignmentMapper extends DeckMapper implements IPermissionMapper {
|
||||
}
|
||||
|
||||
public function deleteByParticipantOnBoard(string $participant, int $boardId, $type = Assignment::TYPE_USER) {
|
||||
// Step 1: Get all card IDs for the board that have assignments for this participant
|
||||
// This avoids MySQL Error 1093 by separating the SELECT from the DELETE operation
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
$cardIdQuery = $this->db->getQueryBuilder();
|
||||
$cardIdQuery->select('a.card_id')
|
||||
->from('deck_assigned_users', 'a')
|
||||
->innerJoin('a', 'deck_cards', 'c', 'c.id = a.card_id')
|
||||
->innerJoin('c', 'deck_stacks', 's', 's.id = c.stack_id')
|
||||
->where($cardIdQuery->expr()->eq('a.participant', $cardIdQuery->createNamedParameter($participant, IQueryBuilder::PARAM_STR)))
|
||||
->andWhere($cardIdQuery->expr()->eq('s.board_id', $cardIdQuery->createNamedParameter($boardId, IQueryBuilder::PARAM_INT)))
|
||||
->andWhere($cardIdQuery->expr()->eq('a.type', $cardIdQuery->createNamedParameter($type, IQueryBuilder::PARAM_INT)));
|
||||
|
||||
$result = $cardIdQuery->executeQuery();
|
||||
$cardIds = [];
|
||||
while ($row = $result->fetch()) {
|
||||
$cardIds[] = $row['card_id'];
|
||||
}
|
||||
$result->closeCursor();
|
||||
|
||||
// Step 2: If we have card IDs, delete the assignments
|
||||
if (!empty($cardIds)) {
|
||||
$deleteQuery = $this->db->getQueryBuilder();
|
||||
$deleteQuery->delete('deck_assigned_users')
|
||||
->where($deleteQuery->expr()->eq('participant', $deleteQuery->createNamedParameter($participant, IQueryBuilder::PARAM_STR)))
|
||||
->andWhere($deleteQuery->expr()->eq('type', $deleteQuery->createNamedParameter($type, IQueryBuilder::PARAM_INT)))
|
||||
->andWhere($deleteQuery->expr()->in('card_id', $deleteQuery->createNamedParameter($cardIds, IQueryBuilder::PARAM_INT_ARRAY)));
|
||||
$deleteQuery->executeStatement();
|
||||
}
|
||||
->where($cardIdQuery->expr()->eq('a.participant', $qb->createNamedParameter($participant, IQueryBuilder::PARAM_STR)))
|
||||
->andWhere($cardIdQuery->expr()->eq('s.board_id', $qb->createNamedParameter($boardId, IQueryBuilder::PARAM_INT)))
|
||||
->andWhere($cardIdQuery->expr()->eq('a.type', $qb->createNamedParameter($type, IQueryBuilder::PARAM_INT)));
|
||||
$qb->delete('deck_assigned_users')
|
||||
->where($qb->expr()->in('card_id', $qb->createFunction($cardIdQuery->getSQL()), IQueryBuilder::PARAM_INT_ARRAY));
|
||||
$qb->executeStatement();
|
||||
}
|
||||
|
||||
|
||||
public function isOwner(string $userId, int $id): bool {
|
||||
public function isOwner($userId, $id): bool {
|
||||
return $this->cardMapper->isOwner($userId, $id);
|
||||
}
|
||||
|
||||
public function findBoardId(int $id): ?int {
|
||||
public function findBoardId($id): ?int {
|
||||
return $this->cardMapper->findBoardId($id);
|
||||
}
|
||||
|
||||
@@ -123,9 +107,6 @@ class AssignmentMapper extends DeckMapper implements IPermissionMapper {
|
||||
* @throws NotFoundException
|
||||
*/
|
||||
public function insert(Entity $entity): Entity {
|
||||
if (!($entity instanceof Assignment)) {
|
||||
throw new \LogicException('Trying to insert a ' . get_class($entity) . ' in the assignment mapper');
|
||||
}
|
||||
$origin = $this->getOrigin($entity);
|
||||
if ($origin === null) {
|
||||
throw new NotFoundException('No origin found for assignment');
|
||||
@@ -144,7 +125,7 @@ class AssignmentMapper extends DeckMapper implements IPermissionMapper {
|
||||
});
|
||||
}
|
||||
|
||||
public function isUserAssigned(int $cardId, string $userId): bool {
|
||||
public function isUserAssigned($cardId, $userId): bool {
|
||||
$assignments = $this->findAll($cardId);
|
||||
foreach ($assignments as $assignment) {
|
||||
$origin = $this->getOrigin($assignment);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user