Compare commits
515 Commits
improve-cy
...
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",
|
||||
|
||||
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
@@ -1,2 +0,0 @@
|
||||
# App maintainers
|
||||
* @luka-nextcloud @grnd-alt @elzody
|
||||
18
.github/dependabot.yml
vendored
18
.github/dependabot.yml
vendored
@@ -14,13 +14,13 @@ updates:
|
||||
- luka-nextcloud
|
||||
|
||||
- package-ecosystem: npm
|
||||
target-branch: stable32
|
||||
target-branch: stable29
|
||||
versioning-strategy: lockfile-only
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: saturday
|
||||
time: "03:15"
|
||||
time: "03:00"
|
||||
timezone: Europe/Paris
|
||||
ignore:
|
||||
- dependency-name: "*"
|
||||
@@ -31,13 +31,13 @@ updates:
|
||||
- dependencies
|
||||
|
||||
- package-ecosystem: npm
|
||||
target-branch: stable31
|
||||
target-branch: stable28
|
||||
versioning-strategy: lockfile-only
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: saturday
|
||||
time: "03:15"
|
||||
time: "03:00"
|
||||
timezone: Europe/Paris
|
||||
ignore:
|
||||
- dependency-name: "*"
|
||||
@@ -48,13 +48,13 @@ updates:
|
||||
- dependencies
|
||||
|
||||
- package-ecosystem: npm
|
||||
target-branch: stable30
|
||||
target-branch: stable27
|
||||
versioning-strategy: lockfile-only
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: saturday
|
||||
time: "03:30"
|
||||
time: "03:00"
|
||||
timezone: Europe/Paris
|
||||
ignore:
|
||||
- dependency-name: "*"
|
||||
@@ -69,7 +69,7 @@ updates:
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: saturday
|
||||
time: "03:45"
|
||||
time: "03:00"
|
||||
timezone: Europe/Paris
|
||||
open-pull-requests-limit: 10
|
||||
reviewers:
|
||||
@@ -81,7 +81,7 @@ updates:
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: saturday
|
||||
time: "04:00"
|
||||
time: "03:00"
|
||||
timezone: Europe/Paris
|
||||
open-pull-requests-limit: 10
|
||||
reviewers:
|
||||
@@ -93,7 +93,7 @@ updates:
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: saturday
|
||||
time: "04:15"
|
||||
time: "03:00"
|
||||
timezone: Europe/Paris
|
||||
open-pull-requests-limit: 10
|
||||
reviewers:
|
||||
|
||||
6
.github/workflows/appbuild.yml
vendored
6
.github/workflows/appbuild.yml
vendored
@@ -16,15 +16,15 @@ 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
|
||||
|
||||
10
.github/workflows/appstore-build-publish.yml
vendored
10
.github/workflows/appstore-build-publish.yml
vendored
@@ -35,7 +35,7 @@ jobs:
|
||||
echo "APP_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
with:
|
||||
persist-credentials: false
|
||||
path: ${{ env.APP_NAME }}
|
||||
@@ -71,7 +71,7 @@ jobs:
|
||||
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
|
||||
# Skip if no package.json
|
||||
if: ${{ steps.versions.outputs.nodeVersion }}
|
||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.1.0
|
||||
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
|
||||
with:
|
||||
node-version: ${{ steps.versions.outputs.nodeVersion }}
|
||||
|
||||
@@ -87,7 +87,7 @@ jobs:
|
||||
filename: ${{ env.APP_NAME }}/appinfo/info.xml
|
||||
|
||||
- name: Set up php ${{ steps.php-versions.outputs.php-min }}
|
||||
uses: shivammathur/setup-php@0f7f1d08e3e32076e51cae65eb0b0c871405b16e # v2.34.1
|
||||
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
|
||||
with:
|
||||
php-version: ${{ steps.php-versions.outputs.php-min }}
|
||||
coverage: none
|
||||
@@ -149,7 +149,7 @@ jobs:
|
||||
unzip latest-$NCVERSION.zip
|
||||
|
||||
- name: Checkout server master fallback
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
if: ${{ steps.server-checkout.outcome != 'success' }}
|
||||
with:
|
||||
persist-credentials: false
|
||||
@@ -173,7 +173,7 @@ jobs:
|
||||
tar -zcvf ${{ env.APP_NAME }}.tar.gz ${{ env.APP_NAME }}
|
||||
|
||||
- name: Attach tarball to github release
|
||||
uses: svenstaro/upload-release-action@81c65b7cd4de9b2570615ce3aad67a41de5b1a13 # v2
|
||||
uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # v2
|
||||
id: attach_to_release
|
||||
with:
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
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"
|
||||
30
.github/workflows/cypress-e2e.yml
vendored
30
.github/workflows/cypress-e2e.yml
vendored
@@ -20,11 +20,9 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node-version: [20.x]
|
||||
containers: [1, 2, 3]
|
||||
# containers: [1, 2, 3]
|
||||
php-versions: [ '8.2' ]
|
||||
server-versions: [ 'master' ]
|
||||
|
||||
name: runner ${{ matrix.containers }}
|
||||
server-versions: [ 'stable30' ]
|
||||
|
||||
env:
|
||||
extensions: mbstring, iconv, fileinfo, intl, sqlite, pdo_sqlite, zip, gd, apcu
|
||||
@@ -43,7 +41,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- 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 }}
|
||||
|
||||
@@ -53,7 +51,7 @@ jobs:
|
||||
echo "text_app_ref=$text_app_ref" >> $GITHUB_ENV
|
||||
|
||||
- name: Checkout server
|
||||
uses: actions/checkout@v4.2.2
|
||||
uses: actions/checkout@v4.1.7
|
||||
with:
|
||||
repository: nextcloud/server
|
||||
ref: ${{ matrix.server-versions }}
|
||||
@@ -66,12 +64,12 @@ jobs:
|
||||
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.2.2
|
||||
uses: actions/checkout@v4.1.7
|
||||
with:
|
||||
path: apps/${{ env.APP_NAME }}
|
||||
|
||||
- name: Checkout text
|
||||
uses: actions/checkout@v4.2.2
|
||||
uses: actions/checkout@v4.1.7
|
||||
with:
|
||||
repository: nextcloud/text
|
||||
ref: ${{ env.text_app_ref }}
|
||||
@@ -93,7 +91,7 @@ jobs:
|
||||
restore-keys: ${{ steps.extcache.outputs.key }}
|
||||
|
||||
- name: Set up php ${{ matrix.php-versions }}
|
||||
uses: shivammathur/setup-php@2.34.1
|
||||
uses: shivammathur/setup-php@2.31.1
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
extensions: ${{ env.extensions }}
|
||||
@@ -137,8 +135,6 @@ jobs:
|
||||
env:
|
||||
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
|
||||
npm_package_name: ${{ env.APP_NAME }}
|
||||
SPLIT: ${{ strategy.job-total }}
|
||||
SPLIT_INDEX: ${{ strategy.job-index }}
|
||||
|
||||
- name: Upload test failure screenshots
|
||||
uses: actions/upload-artifact@v4
|
||||
@@ -155,15 +151,3 @@ jobs:
|
||||
name: Upload nextcloud log
|
||||
path: data/nextcloud.log
|
||||
retention-days: 5
|
||||
|
||||
summary:
|
||||
runs-on: ubuntu-latest-low
|
||||
needs: [ cypress ]
|
||||
|
||||
if: always()
|
||||
|
||||
name: cypress-summary
|
||||
|
||||
steps:
|
||||
- name: Summary status
|
||||
run: if ${{ needs.cypress.result != 'success' && needs.cypress.result != 'skipped' }}; then exit 1; fi
|
||||
|
||||
14
.github/workflows/integration.yml
vendored
14
.github/workflows/integration.yml
vendored
@@ -28,7 +28,7 @@ jobs:
|
||||
matrix:
|
||||
php-versions: ['8.1']
|
||||
databases: ['sqlite', 'mysql', 'pgsql']
|
||||
server-versions: ['master']
|
||||
server-versions: ['stable30']
|
||||
|
||||
name: php${{ matrix.php-versions }}-${{ matrix.databases }}-${{ matrix.server-versions }}
|
||||
|
||||
@@ -52,7 +52,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout server
|
||||
uses: actions/checkout@v4.2.2
|
||||
uses: actions/checkout@v4.1.7
|
||||
with:
|
||||
repository: nextcloud/server
|
||||
ref: ${{ matrix.server-versions }}
|
||||
@@ -66,19 +66,19 @@ jobs:
|
||||
cd build/integration && composer require --dev phpunit/phpunit:~9
|
||||
|
||||
- name: Checkout app
|
||||
uses: actions/checkout@v4.2.2
|
||||
uses: actions/checkout@v4.1.7
|
||||
with:
|
||||
path: apps/${{ env.APP_NAME }}
|
||||
|
||||
- name: Checkout activity
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
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.34.1
|
||||
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
|
||||
@@ -112,10 +112,6 @@ jobs:
|
||||
working-directory: apps/${{ env.APP_NAME }}/tests/integration
|
||||
run: ./run.sh
|
||||
|
||||
- name: Print log
|
||||
if: always()
|
||||
run: cat data/nextcloud.log
|
||||
|
||||
- name: Query count
|
||||
if: ${{ matrix.databases == 'mysql' }}
|
||||
uses: actions/github-script@v7
|
||||
|
||||
6
.github/workflows/lint-eslint.yml
vendored
6
.github/workflows/lint-eslint.yml
vendored
@@ -56,9 +56,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
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
|
||||
@@ -68,7 +66,7 @@ jobs:
|
||||
fallbackNpm: '^10'
|
||||
|
||||
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
|
||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.1.0
|
||||
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
|
||||
with:
|
||||
node-version: ${{ steps.versions.outputs.nodeVersion }}
|
||||
|
||||
|
||||
8
.github/workflows/lint-php-cs.yml
vendored
8
.github/workflows/lint-php-cs.yml
vendored
@@ -25,16 +25,14 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
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-min }}
|
||||
uses: shivammathur/setup-php@0f7f1d08e3e32076e51cae65eb0b0c871405b16e # v2.34.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
|
||||
|
||||
11
.github/workflows/lint-php.yml
vendored
11
.github/workflows/lint-php.yml
vendored
@@ -24,10 +24,7 @@ jobs:
|
||||
php-versions: ${{ steps.versions.outputs.php-versions }}
|
||||
steps:
|
||||
- name: Checkout app
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
- name: Get version matrix
|
||||
id: versions
|
||||
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.0.0
|
||||
@@ -43,12 +40,10 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
|
||||
- name: Set up php ${{ matrix.php-versions }}
|
||||
uses: shivammathur/setup-php@0f7f1d08e3e32076e51cae65eb0b0c871405b16e # v2.34.1
|
||||
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
|
||||
|
||||
6
.github/workflows/lint-stylelint.yml
vendored
6
.github/workflows/lint-stylelint.yml
vendored
@@ -25,9 +25,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
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
|
||||
@@ -37,7 +35,7 @@ jobs:
|
||||
fallbackNpm: '^10'
|
||||
|
||||
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
|
||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.1.0
|
||||
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
|
||||
with:
|
||||
node-version: ${{ steps.versions.outputs.nodeVersion }}
|
||||
|
||||
|
||||
4
.github/workflows/nodejs.yml
vendored
4
.github/workflows/nodejs.yml
vendored
@@ -12,9 +12,9 @@ jobs:
|
||||
node-version: [14.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
|
||||
|
||||
20
.github/workflows/npm-audit-fix.yml
vendored
20
.github/workflows/npm-audit-fix.yml
vendored
@@ -14,9 +14,6 @@ on:
|
||||
# At 2:30 on Sundays
|
||||
- cron: '30 2 * * 0'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -24,18 +21,15 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
branches: ['main', 'master', 'stable32', 'stable31', 'stable30']
|
||||
branches: ['main', 'master', 'stable29', 'stable28', 'stable27']
|
||||
|
||||
name: npm-audit-fix-${{ matrix.branches }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
id: checkout
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
with:
|
||||
persist-credentials: false
|
||||
ref: ${{ matrix.branches }}
|
||||
continue-on-error: true
|
||||
|
||||
- name: Read package.json node and npm engines version
|
||||
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
|
||||
@@ -45,7 +39,7 @@ jobs:
|
||||
fallbackNpm: '^10'
|
||||
|
||||
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
|
||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.1.0
|
||||
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
|
||||
with:
|
||||
node-version: ${{ steps.versions.outputs.nodeVersion }}
|
||||
|
||||
@@ -54,10 +48,10 @@ jobs:
|
||||
|
||||
- name: Fix npm audit
|
||||
id: npm-audit
|
||||
uses: nextcloud-libraries/npm-audit-action@1b1728b2b4a7a78d69de65608efcf4db0e3e42d0 # v0.2.0
|
||||
uses: nextcloud-libraries/npm-audit-action@2a60bd2e79cc77f2cc4d9a3fe40f1a69896f3a87 # v0.1.0
|
||||
|
||||
- name: Run npm ci and npm run build
|
||||
if: steps.checkout.outcome == 'success'
|
||||
if: always()
|
||||
env:
|
||||
CYPRESS_INSTALL_BINARY: 0
|
||||
run: |
|
||||
@@ -65,8 +59,8 @@ jobs:
|
||||
npm run build --if-present
|
||||
|
||||
- name: Create Pull Request
|
||||
if: steps.checkout.outcome == 'success'
|
||||
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
|
||||
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'
|
||||
|
||||
10
.github/workflows/phpunit-mysql.yml
vendored
10
.github/workflows/phpunit-mysql.yml
vendored
@@ -24,9 +24,7 @@ jobs:
|
||||
matrix: ${{ steps.versions.outputs.sparse-matrix }}
|
||||
steps:
|
||||
- name: Checkout app
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
|
||||
- name: Get version matrix
|
||||
id: versions
|
||||
@@ -89,7 +87,7 @@ jobs:
|
||||
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
|
||||
|
||||
- name: Checkout server
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
with:
|
||||
persist-credentials: false
|
||||
submodules: true
|
||||
@@ -97,13 +95,13 @@ jobs:
|
||||
ref: ${{ matrix.server-versions }}
|
||||
|
||||
- name: Checkout app
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
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@0f7f1d08e3e32076e51cae65eb0b0c871405b16e # v2.34.1
|
||||
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
|
||||
|
||||
10
.github/workflows/phpunit-pgsql.yml
vendored
10
.github/workflows/phpunit-pgsql.yml
vendored
@@ -25,9 +25,7 @@ jobs:
|
||||
server-max: ${{ steps.versions.outputs.branches-max-list }}
|
||||
steps:
|
||||
- name: Checkout app
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
|
||||
- name: Get version matrix
|
||||
id: versions
|
||||
@@ -92,7 +90,7 @@ jobs:
|
||||
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
|
||||
|
||||
- name: Checkout server
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
with:
|
||||
persist-credentials: false
|
||||
submodules: true
|
||||
@@ -100,13 +98,13 @@ jobs:
|
||||
ref: ${{ matrix.server-versions }}
|
||||
|
||||
- name: Checkout app
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
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@0f7f1d08e3e32076e51cae65eb0b0c871405b16e # v2.34.1
|
||||
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
|
||||
|
||||
10
.github/workflows/phpunit-sqlite.yml
vendored
10
.github/workflows/phpunit-sqlite.yml
vendored
@@ -25,9 +25,7 @@ jobs:
|
||||
server-max: ${{ steps.versions.outputs.branches-max-list }}
|
||||
steps:
|
||||
- name: Checkout app
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
|
||||
- name: Get version matrix
|
||||
id: versions
|
||||
@@ -81,7 +79,7 @@ jobs:
|
||||
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
|
||||
|
||||
- name: Checkout server
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
with:
|
||||
persist-credentials: false
|
||||
submodules: true
|
||||
@@ -89,13 +87,13 @@ jobs:
|
||||
ref: ${{ matrix.server-versions }}
|
||||
|
||||
- name: Checkout app
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
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@0f7f1d08e3e32076e51cae65eb0b0c871405b16e # v2.34.1
|
||||
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
|
||||
|
||||
7
.github/workflows/pr-feedback.yml
vendored
7
.github/workflows/pr-feedback.yml
vendored
@@ -15,17 +15,12 @@ on:
|
||||
schedule:
|
||||
- cron: '30 1 * * *'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
pr-feedback:
|
||||
if: ${{ github.repository_owner == 'nextcloud' }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: The get-github-handles-from-website action
|
||||
uses: marcelklehr/get-github-handles-from-website-action@06b2239db0a48fe1484ba0bfd966a3ab81a08308 # v1.0.1
|
||||
uses: marcelklehr/get-github-handles-from-website-action@a739600f6b91da4957f51db0792697afbb2f143c # v1.0.0
|
||||
id: scrape
|
||||
with:
|
||||
website: 'https://nextcloud.com/team/'
|
||||
|
||||
8
.github/workflows/psalm.yml
vendored
8
.github/workflows/psalm.yml
vendored
@@ -24,9 +24,7 @@ jobs:
|
||||
name: static-psalm-analysis
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
|
||||
- name: Get php version
|
||||
id: versions
|
||||
@@ -35,8 +33,8 @@ jobs:
|
||||
- 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-min }}
|
||||
uses: shivammathur/setup-php@0f7f1d08e3e32076e51cae65eb0b0c871405b16e # v2.34.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
|
||||
|
||||
8
.github/workflows/reuse.yml
vendored
8
.github/workflows/reuse.yml
vendored
@@ -16,12 +16,10 @@ permissions:
|
||||
|
||||
jobs:
|
||||
reuse-compliance-check:
|
||||
runs-on: ubuntu-latest-low
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
|
||||
- name: REUSE Compliance Check
|
||||
uses: fsfe/reuse-action@bb774aa972c2a89ff34781233d275075cbddf542 # v5.0.0
|
||||
uses: fsfe/reuse-action@3ae3c6bdf1257ab19397fab11fd3312144692083 # v4.0.0
|
||||
|
||||
8
.github/workflows/update-nextcloud-ocp.yml
vendored
8
.github/workflows/update-nextcloud-ocp.yml
vendored
@@ -23,13 +23,13 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
branches: ['main', 'master', 'stable32', 'stable31', 'stable30']
|
||||
branches: ['main', 'master', 'stable29', 'stable28', 'stable27']
|
||||
|
||||
name: update-nextcloud-ocp-${{ matrix.branches }}
|
||||
|
||||
steps:
|
||||
- id: checkout
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
with:
|
||||
persist-credentials: false
|
||||
ref: ${{ matrix.branches }}
|
||||
@@ -38,7 +38,7 @@ jobs:
|
||||
|
||||
- name: Set up php8.2
|
||||
if: steps.checkout.outcome == 'success'
|
||||
uses: shivammathur/setup-php@0f7f1d08e3e32076e51cae65eb0b0c871405b16e # v2.34.1
|
||||
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
|
||||
@@ -107,7 +107,7 @@ jobs:
|
||||
|
||||
- name: Create Pull Request
|
||||
if: steps.checkout.outcome == 'success'
|
||||
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
|
||||
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'
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ Deck is a kanban style organization tool aimed at personal planning and project
|
||||
|
||||
- [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](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;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
const { defineConfig } = require('cypress')
|
||||
const cypressSplit = require('cypress-split')
|
||||
|
||||
module.exports = defineConfig({
|
||||
projectId: '1s7wkc',
|
||||
@@ -9,12 +8,9 @@ module.exports = defineConfig({
|
||||
// We've imported your old cypress plugins here.
|
||||
// You may want to clean this up later by importing these.
|
||||
setupNodeEvents(on, config) {
|
||||
cypressSplit(on, config)
|
||||
require('./cypress/plugins/index.js')(on, config)
|
||||
return config
|
||||
return require('./cypress/plugins/index.js')(on, config)
|
||||
},
|
||||
baseUrl: 'http://nextcloud.local/index.php',
|
||||
specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx}',
|
||||
experimentalMemoryManagement: true,
|
||||
},
|
||||
})
|
||||
|
||||
@@ -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')
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,103 +0,0 @@
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
import { randUser } from '../utils/index.js'
|
||||
import { sampleBoard } from '../utils/sampleBoard'
|
||||
|
||||
const user = randUser()
|
||||
const boardData = sampleBoard()
|
||||
|
||||
const auth = {
|
||||
user: user.userId,
|
||||
password: user.password,
|
||||
}
|
||||
|
||||
const useModal = (useModal) => {
|
||||
return cy.request({
|
||||
method: 'POST',
|
||||
url: `${Cypress.env('baseUrl')}/ocs/v2.php/apps/deck/api/v1.0/config/cardDetailsInModal?format=json`,
|
||||
auth,
|
||||
body: { value: useModal },
|
||||
}).then((response) => {
|
||||
expect(response.status).to.eq(200)
|
||||
})
|
||||
}
|
||||
|
||||
describe('Card actions', function () {
|
||||
let boardId
|
||||
before(function () {
|
||||
cy.createUser(user)
|
||||
cy.login(user)
|
||||
cy.createExampleBoard({
|
||||
user,
|
||||
board: boardData,
|
||||
}).then((board) => {
|
||||
boardId = board.id
|
||||
})
|
||||
})
|
||||
|
||||
beforeEach(function () {
|
||||
cy.login(user)
|
||||
useModal(false).then(() => {
|
||||
cy.visit(`/apps/deck/#/board/${boardId}`)
|
||||
})
|
||||
})
|
||||
|
||||
it('Custom card actions', () => {
|
||||
const myAction = {
|
||||
label: 'Test action',
|
||||
icon: 'icon-user',
|
||||
callback(card) {
|
||||
console.log('Called callback', card)
|
||||
},
|
||||
}
|
||||
cy.spy(myAction, 'callback').as('myAction.callback')
|
||||
|
||||
cy.window().then(win => {
|
||||
win.OCA.Deck.registerCardAction(myAction)
|
||||
})
|
||||
|
||||
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("Test action")').click()
|
||||
|
||||
cy.get('@myAction.callback')
|
||||
.should('be.called')
|
||||
.its('firstCall.args.0')
|
||||
.as('args')
|
||||
|
||||
cy.url().then(url => {
|
||||
const cardId = url.split('/').pop()
|
||||
cy.get('@args').should('have.property', 'name', 'Hello world')
|
||||
cy.get('@args').should('have.property', 'stackname', 'TestList')
|
||||
cy.get('@args').should('have.property', 'boardname', 'MyTestBoard')
|
||||
cy.get('@args').its('link').then((url) => {
|
||||
expect(url.split('/').pop() === cardId).to.be.true
|
||||
cy.visit(url)
|
||||
cy.get('#app-sidebar-vue')
|
||||
.find('.ProseMirror h1').contains('Hello world').should('be.visible')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
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.wait(3000) // wait for select component to load stacks
|
||||
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)
|
||||
})
|
||||
})
|
||||
@@ -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()
|
||||
@@ -321,4 +250,53 @@ describe('Card', function () {
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
describe('Card actions', () => {
|
||||
beforeEach(function() {
|
||||
cy.login(user)
|
||||
useModal(false).then(() => {
|
||||
cy.visit(`/apps/deck/#/board/${boardId}`)
|
||||
})
|
||||
})
|
||||
|
||||
it('Custom card actions', () => {
|
||||
const myAction = {
|
||||
label: 'Test action',
|
||||
icon: 'icon-user',
|
||||
callback(card) {
|
||||
console.log('Called callback', card)
|
||||
},
|
||||
}
|
||||
cy.spy(myAction, 'callback').as('myAction.callback')
|
||||
|
||||
cy.window().then(win => {
|
||||
win.OCA.Deck.registerCardAction(myAction)
|
||||
})
|
||||
|
||||
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("Test action")').click()
|
||||
|
||||
cy.get('@myAction.callback')
|
||||
.should('be.called')
|
||||
.its('firstCall.args.0')
|
||||
.as('args')
|
||||
|
||||
cy.url().then(url => {
|
||||
const cardId = url.split('/').pop()
|
||||
cy.get('@args').should('have.property', 'name', 'Hello world')
|
||||
cy.get('@args').should('have.property', 'stackname', 'TestList')
|
||||
cy.get('@args').should('have.property', 'boardname', 'MyTestBoard')
|
||||
cy.get('@args').its('link').then((url) => {
|
||||
expect(url.split('/').pop() === cardId).to.be.true
|
||||
cy.visit(url)
|
||||
cy.get('#app-sidebar-vue')
|
||||
.find('.ProseMirror h1').contains('Hello world').should('be.visible')
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -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 |
@@ -373,6 +373,7 @@ OC.L10N.register(
|
||||
"Note: Only the JSON format is supported for importing back into the Deck app." : "Megjegyzés: Csak a JSON formátum támogatott a Kártyák alkalmazásba való importáláskor.",
|
||||
"Export" : "Exportálás",
|
||||
"Loading filtered view" : "Szűrt nézet betöltése",
|
||||
"Search for {searchQuery} in other boards" : "Keresés a(z) {searchQuery} kifejezésre a többi táblában",
|
||||
"Search for {searchQuery} in all boards" : "Keresés a(z) {searchQuery} kifejezésre az összes táblában",
|
||||
"No results found" : "Nincs találat",
|
||||
"Deck board {name}\n* Last modified on {lastMod}" : "{name} kártyatábla\n* Legutóbb módosítva: {lastMod}",
|
||||
|
||||
@@ -371,6 +371,7 @@
|
||||
"Note: Only the JSON format is supported for importing back into the Deck app." : "Megjegyzés: Csak a JSON formátum támogatott a Kártyák alkalmazásba való importáláskor.",
|
||||
"Export" : "Exportálás",
|
||||
"Loading filtered view" : "Szűrt nézet betöltése",
|
||||
"Search for {searchQuery} in other boards" : "Keresés a(z) {searchQuery} kifejezésre a többi táblában",
|
||||
"Search for {searchQuery} in all boards" : "Keresés a(z) {searchQuery} kifejezésre az összes táblában",
|
||||
"No results found" : "Nincs találat",
|
||||
"Deck board {name}\n* Last modified on {lastMod}" : "{name} kártyatábla\n* Legutóbb módosítva: {lastMod}",
|
||||
|
||||
19
l10n/mk.js
19
l10n/mk.js
@@ -81,10 +81,14 @@ OC.L10N.register(
|
||||
"Could not write file to disk" : "Неможе да се запишува на дискот",
|
||||
"A PHP extension stopped the file upload" : "PHP додаток го стопираше прикачувањето на датотеката",
|
||||
"No file uploaded or file size exceeds maximum of %s" : "Нема прикачена дадотека или големината го надмминува максимумот од %s",
|
||||
"Invalid file type. Only JSON files are allowed." : "Невалиден тип на датотека. Дозволени се само JSON датотеки.",
|
||||
"Invalid JSON data" : "Невалидни JSON податоци",
|
||||
"Failed to import board" : "Неуспешен увоз на табла",
|
||||
"Cards due today" : "Картици со рок до денес",
|
||||
"Cards due tomorrow" : "Картици со рок до утре",
|
||||
"Upcoming cards" : "Престојни картици",
|
||||
"Load more" : "Вчитај повеќе",
|
||||
"Welcome to Nextcloud Deck!" : "Добредојдовте во Nextcloud Deck!",
|
||||
"The card \"%s\" on \"%s\" has been assigned to you by %s." : "Картицата \"%s\" на \"%s\" ти е доделена од %s.",
|
||||
"{user} has assigned the card {deck-card} on {deck-board} to you." : "{user} ти ја додели картицата {deck-card} на {deck-board}.",
|
||||
"The card \"%s\" on \"%s\" has reached its due date." : "Картицата \"%s\" на \"%s\" го достигна датумот на истекување.",
|
||||
@@ -108,9 +112,15 @@ OC.L10N.register(
|
||||
"Later" : "Покасно",
|
||||
"copy" : "копирај",
|
||||
"Read more inside" : "Прочитај повеќе",
|
||||
"Custom lists - click to rename!" : "Прилагодени листи – кликнете за преименување!",
|
||||
"To Do" : "За правење",
|
||||
"In Progress" : "Во тек",
|
||||
"Done" : "Готово",
|
||||
"1. Open to learn more about boards and cards" : "1. Отворете за да дознаете повеќе за таблите и картичките",
|
||||
"2. Drag cards left and right, up and down" : "2. Влечете ги картичките лево и десно, горе и долу",
|
||||
"3. Apply rich formatting and link content" : "3. Применете богато форматирање и поврзете содржина",
|
||||
"4. Share, comment and collaborate!" : "4. Споделувајте, коментирајте и соработувајте!",
|
||||
"Create your first card!" : "Креирајте ја вашата прва картичка!",
|
||||
"This comment has more than %s characters.\nAdded as an attachment to the card with name %s.\nAccessible on URL: %s." : "Коментарот има повеќе од %s карактери.\nДодаден е како пролог на картицата со име %s.\nДостапен е на линк: %s.",
|
||||
"Attachments" : "Прилози",
|
||||
"File" : "Датотека",
|
||||
@@ -152,6 +162,7 @@ OC.L10N.register(
|
||||
"Filter by assigned user" : "Филтрирај по назначени корисници",
|
||||
"Unassigned" : "Неназначени",
|
||||
"Filter by status" : "Филтрирај по статус",
|
||||
"Open and completed" : "Отворени и завршени",
|
||||
"Open" : "Отвори",
|
||||
"Completed" : "Завршено",
|
||||
"Filter by due date" : "Филтрирај по краен рок",
|
||||
@@ -294,7 +305,9 @@ OC.L10N.register(
|
||||
"Action" : "Акција",
|
||||
"Shift" : "Shift",
|
||||
"Scroll" : "Scroll",
|
||||
"Scroll sideways" : "Лизгај странично",
|
||||
"Navigate between cards" : "Навигација помеѓу картиците",
|
||||
"Esc" : "Esc",
|
||||
"Close card details" : "Затвори детали на картица",
|
||||
"Ctrl" : "Ctrl",
|
||||
"Search" : "Барај",
|
||||
@@ -342,6 +355,9 @@ OC.L10N.register(
|
||||
"Assigned cards" : "Доделени картици",
|
||||
"No notifications" : "Нема известувања",
|
||||
"Delete board" : "Избриши табла",
|
||||
"Importing board..." : "Увезување табла...",
|
||||
"Board imported successfully" : "Таблата е успешно увезена",
|
||||
"Import board" : "Увези табла",
|
||||
"Clone {boardTitle}" : "Клонирај {boardTitle}",
|
||||
"Clone cards" : "Клинирај картици",
|
||||
"Clone assignments" : "Клонирај задачи",
|
||||
@@ -352,6 +368,9 @@ OC.L10N.register(
|
||||
"Restore archived cards" : "Врати архивирани картици",
|
||||
"Clone" : "Клонирај",
|
||||
"Export {boardTitle}" : "Извези {boardTitle}",
|
||||
"Export as JSON" : "Извези како JSON",
|
||||
"Export as CSV" : "Извези како CSV",
|
||||
"Note: Only the JSON format is supported for importing back into the Deck app." : "Забелешка: Поддржан е само JSON формат за увоз назад во апликацијата Deck.",
|
||||
"Export" : "Извези",
|
||||
"Loading filtered view" : "Вчитување на филтриран поглед",
|
||||
"Search for {searchQuery} in other boards" : "Барај {searchQuery} во други табли",
|
||||
|
||||
19
l10n/mk.json
19
l10n/mk.json
@@ -79,10 +79,14 @@
|
||||
"Could not write file to disk" : "Неможе да се запишува на дискот",
|
||||
"A PHP extension stopped the file upload" : "PHP додаток го стопираше прикачувањето на датотеката",
|
||||
"No file uploaded or file size exceeds maximum of %s" : "Нема прикачена дадотека или големината го надмминува максимумот од %s",
|
||||
"Invalid file type. Only JSON files are allowed." : "Невалиден тип на датотека. Дозволени се само JSON датотеки.",
|
||||
"Invalid JSON data" : "Невалидни JSON податоци",
|
||||
"Failed to import board" : "Неуспешен увоз на табла",
|
||||
"Cards due today" : "Картици со рок до денес",
|
||||
"Cards due tomorrow" : "Картици со рок до утре",
|
||||
"Upcoming cards" : "Престојни картици",
|
||||
"Load more" : "Вчитај повеќе",
|
||||
"Welcome to Nextcloud Deck!" : "Добредојдовте во Nextcloud Deck!",
|
||||
"The card \"%s\" on \"%s\" has been assigned to you by %s." : "Картицата \"%s\" на \"%s\" ти е доделена од %s.",
|
||||
"{user} has assigned the card {deck-card} on {deck-board} to you." : "{user} ти ја додели картицата {deck-card} на {deck-board}.",
|
||||
"The card \"%s\" on \"%s\" has reached its due date." : "Картицата \"%s\" на \"%s\" го достигна датумот на истекување.",
|
||||
@@ -106,9 +110,15 @@
|
||||
"Later" : "Покасно",
|
||||
"copy" : "копирај",
|
||||
"Read more inside" : "Прочитај повеќе",
|
||||
"Custom lists - click to rename!" : "Прилагодени листи – кликнете за преименување!",
|
||||
"To Do" : "За правење",
|
||||
"In Progress" : "Во тек",
|
||||
"Done" : "Готово",
|
||||
"1. Open to learn more about boards and cards" : "1. Отворете за да дознаете повеќе за таблите и картичките",
|
||||
"2. Drag cards left and right, up and down" : "2. Влечете ги картичките лево и десно, горе и долу",
|
||||
"3. Apply rich formatting and link content" : "3. Применете богато форматирање и поврзете содржина",
|
||||
"4. Share, comment and collaborate!" : "4. Споделувајте, коментирајте и соработувајте!",
|
||||
"Create your first card!" : "Креирајте ја вашата прва картичка!",
|
||||
"This comment has more than %s characters.\nAdded as an attachment to the card with name %s.\nAccessible on URL: %s." : "Коментарот има повеќе од %s карактери.\nДодаден е како пролог на картицата со име %s.\nДостапен е на линк: %s.",
|
||||
"Attachments" : "Прилози",
|
||||
"File" : "Датотека",
|
||||
@@ -150,6 +160,7 @@
|
||||
"Filter by assigned user" : "Филтрирај по назначени корисници",
|
||||
"Unassigned" : "Неназначени",
|
||||
"Filter by status" : "Филтрирај по статус",
|
||||
"Open and completed" : "Отворени и завршени",
|
||||
"Open" : "Отвори",
|
||||
"Completed" : "Завршено",
|
||||
"Filter by due date" : "Филтрирај по краен рок",
|
||||
@@ -292,7 +303,9 @@
|
||||
"Action" : "Акција",
|
||||
"Shift" : "Shift",
|
||||
"Scroll" : "Scroll",
|
||||
"Scroll sideways" : "Лизгај странично",
|
||||
"Navigate between cards" : "Навигација помеѓу картиците",
|
||||
"Esc" : "Esc",
|
||||
"Close card details" : "Затвори детали на картица",
|
||||
"Ctrl" : "Ctrl",
|
||||
"Search" : "Барај",
|
||||
@@ -340,6 +353,9 @@
|
||||
"Assigned cards" : "Доделени картици",
|
||||
"No notifications" : "Нема известувања",
|
||||
"Delete board" : "Избриши табла",
|
||||
"Importing board..." : "Увезување табла...",
|
||||
"Board imported successfully" : "Таблата е успешно увезена",
|
||||
"Import board" : "Увези табла",
|
||||
"Clone {boardTitle}" : "Клонирај {boardTitle}",
|
||||
"Clone cards" : "Клинирај картици",
|
||||
"Clone assignments" : "Клонирај задачи",
|
||||
@@ -350,6 +366,9 @@
|
||||
"Restore archived cards" : "Врати архивирани картици",
|
||||
"Clone" : "Клонирај",
|
||||
"Export {boardTitle}" : "Извези {boardTitle}",
|
||||
"Export as JSON" : "Извези како JSON",
|
||||
"Export as CSV" : "Извези како CSV",
|
||||
"Note: Only the JSON format is supported for importing back into the Deck app." : "Забелешка: Поддржан е само JSON формат за увоз назад во апликацијата Deck.",
|
||||
"Export" : "Извези",
|
||||
"Loading filtered view" : "Вчитување на филтриран поглед",
|
||||
"Search for {searchQuery} in other boards" : "Барај {searchQuery} во други табли",
|
||||
|
||||
@@ -266,6 +266,7 @@ OC.L10N.register(
|
||||
"{count} comments, {unread} unread" : "{count} reacties, {unread} ongelezen",
|
||||
"Todo items" : "Te doen onderwerpen",
|
||||
"Edit card title" : "Wijzig de titel van de kaart",
|
||||
"Open link" : "Open link",
|
||||
"Card deleted" : "Kaart verwijderd",
|
||||
"Edit title" : "Titel bewerken",
|
||||
"Assign to me" : "Aan mij toewijzen",
|
||||
@@ -279,6 +280,7 @@ OC.L10N.register(
|
||||
"Shift" : "Shift",
|
||||
"Ctrl" : "Ctrl",
|
||||
"Search" : "Zoeken",
|
||||
"Enter" : "Enter",
|
||||
"All boards" : "Alle borden",
|
||||
"Archived boards" : "Gearchiveerde borden",
|
||||
"Shared with you" : "Deelde met jou",
|
||||
|
||||
@@ -264,6 +264,7 @@
|
||||
"{count} comments, {unread} unread" : "{count} reacties, {unread} ongelezen",
|
||||
"Todo items" : "Te doen onderwerpen",
|
||||
"Edit card title" : "Wijzig de titel van de kaart",
|
||||
"Open link" : "Open link",
|
||||
"Card deleted" : "Kaart verwijderd",
|
||||
"Edit title" : "Titel bewerken",
|
||||
"Assign to me" : "Aan mij toewijzen",
|
||||
@@ -277,6 +278,7 @@
|
||||
"Shift" : "Shift",
|
||||
"Ctrl" : "Ctrl",
|
||||
"Search" : "Zoeken",
|
||||
"Enter" : "Enter",
|
||||
"All boards" : "Alle borden",
|
||||
"Archived boards" : "Gearchiveerde borden",
|
||||
"Shared with you" : "Deelde met jou",
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
@@ -36,11 +35,13 @@ class AttachmentMapper extends DeckMapper implements IPermissionMapper {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @return Attachment
|
||||
* @throws DoesNotExistException
|
||||
* @throws MultipleObjectsReturnedException
|
||||
* @throws \OCP\DB\Exception
|
||||
*/
|
||||
public function find(int $id): Attachment {
|
||||
public function find($id) {
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
$qb->select('*')
|
||||
->from($this->getTableName())
|
||||
@@ -50,25 +51,29 @@ class AttachmentMapper extends DeckMapper implements IPermissionMapper {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $cardId
|
||||
* @param string $data
|
||||
* @return Attachment
|
||||
* @throws DoesNotExistException
|
||||
* @throws MultipleObjectsReturnedException
|
||||
* @throws \OCP\DB\Exception
|
||||
*/
|
||||
public function findByData(int $cardId, string $data): Attachment {
|
||||
public function findByData($cardId, $data) {
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
$qb->select('*')
|
||||
->from($this->getTableName())
|
||||
->where($qb->expr()->eq('card_id', $qb->createNamedParameter($cardId, IQueryBuilder::PARAM_INT)))
|
||||
->andWhere($qb->expr()->eq('data', $qb->createNamedParameter($data, IQueryBuilder::PARAM_STR)));
|
||||
->from($this->getTableName())
|
||||
->where($qb->expr()->eq('card_id', $qb->createNamedParameter($cardId, IQueryBuilder::PARAM_INT)))
|
||||
->andWhere($qb->expr()->eq('data', $qb->createNamedParameter($data, IQueryBuilder::PARAM_STR)));
|
||||
|
||||
return $this->findEntity($qb);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $cardId
|
||||
* @return Entity[]
|
||||
* @throws \OCP\DB\Exception
|
||||
*/
|
||||
public function findAll(int $cardId): array {
|
||||
public function findAll($cardId) {
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
$qb->select('*')
|
||||
->from($this->getTableName())
|
||||
@@ -80,9 +85,11 @@ class AttachmentMapper extends DeckMapper implements IPermissionMapper {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Attachment[]
|
||||
* @param null $cardId
|
||||
* @param bool $withOffset
|
||||
* @return array
|
||||
*/
|
||||
public function findToDelete(?int $cardId = null, bool $withOffset = true): array {
|
||||
public function findToDelete($cardId = null, $withOffset = true) {
|
||||
// add buffer of 5 min
|
||||
$timeLimit = time() - (60 * 5);
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
@@ -104,8 +111,12 @@ class AttachmentMapper extends DeckMapper implements IPermissionMapper {
|
||||
|
||||
/**
|
||||
* Check if $userId is owner of Entity with $id
|
||||
*
|
||||
* @param $userId string userId
|
||||
* @param $id int|string unique entity identifier
|
||||
* @return boolean
|
||||
*/
|
||||
public function isOwner(string $userId, int $id): bool {
|
||||
public function isOwner($userId, $id): bool {
|
||||
try {
|
||||
$attachment = $this->find($id);
|
||||
return $this->cardMapper->isOwner($userId, $attachment->getCardId());
|
||||
@@ -118,10 +129,10 @@ class AttachmentMapper extends DeckMapper implements IPermissionMapper {
|
||||
/**
|
||||
* Query boardId for Entity of given $id
|
||||
*
|
||||
* @param $id int unique entity identifier
|
||||
* @param $id int|string unique entity identifier
|
||||
* @return int|null id of Board
|
||||
*/
|
||||
public function findBoardId(int $id): ?int {
|
||||
public function findBoardId($id): ?int {
|
||||
try {
|
||||
$attachment = $this->find($id);
|
||||
} catch (\Exception $e) {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user