Compare commits
252 Commits
v1.10.0-be
...
juliushaer
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f0a73054b4 | ||
|
|
58ed490c7d | ||
|
|
372878b318 | ||
|
|
d055b44fa2 | ||
|
|
deb63d4a9a | ||
|
|
66fda2265d | ||
|
|
44037cfd18 | ||
|
|
b450d96d4b | ||
|
|
9f1597a2f3 | ||
|
|
a0a929bdec | ||
|
|
deffd3adaa | ||
|
|
cd7ade1eaf | ||
|
|
e568d79bbe | ||
|
|
1ddb3cdac9 | ||
|
|
a982a0dbed | ||
|
|
bebbb046ea | ||
|
|
37f305aba2 | ||
|
|
dcc42f7613 | ||
|
|
bea851009c | ||
|
|
6a5e72bf6d | ||
|
|
b5c6b54fab | ||
|
|
61a801502b | ||
|
|
54c5cbbef1 | ||
|
|
6956551e3c | ||
|
|
62a54481e5 | ||
|
|
9d9b333152 | ||
|
|
0179b99f24 | ||
|
|
342003ea2e | ||
|
|
20d4476843 | ||
|
|
cc1b30be54 | ||
|
|
c1e52fd168 | ||
|
|
81d8748e96 | ||
|
|
06e3272b79 | ||
|
|
b71d8e2090 | ||
|
|
302ec1c44e | ||
|
|
28c031a68e | ||
|
|
b938c3b2bf | ||
|
|
78fea30e39 | ||
|
|
fcbc0cf092 | ||
|
|
dbdbb00fd5 | ||
|
|
dcccd63864 | ||
|
|
cf52359e7a | ||
|
|
cf7f231047 | ||
|
|
8449d91656 | ||
|
|
4126e4dd43 | ||
|
|
566778be58 | ||
|
|
063c4cbfef | ||
|
|
8d03a03b27 | ||
|
|
46f76f2dbc | ||
|
|
9f68a58407 | ||
|
|
58a5275e78 | ||
|
|
c644fc9680 | ||
|
|
7eb078d0a8 | ||
|
|
6126cc53a2 | ||
|
|
38344cee55 | ||
|
|
3e0baf9330 | ||
|
|
2899927efe | ||
|
|
4ce2265f5e | ||
|
|
2872cd39d9 | ||
|
|
73752472ac | ||
|
|
508ded19ba | ||
|
|
57e8698f3b | ||
|
|
abf00984f4 | ||
|
|
b53c10c47d | ||
|
|
5e2d8ac24a | ||
|
|
5db87329ac | ||
|
|
d12ccc0208 | ||
|
|
d67b1e4ba9 | ||
|
|
81c0e37ba0 | ||
|
|
f44eb87d77 | ||
|
|
55b75e16a0 | ||
|
|
020b16a33d | ||
|
|
fef75fa169 | ||
|
|
4547e1ae3d | ||
|
|
0e0ff7e16c | ||
|
|
6329da3d4d | ||
|
|
c37cae0a5c | ||
|
|
9d852b93ce | ||
|
|
5035be90f0 | ||
|
|
6a07581508 | ||
|
|
84b1de5308 | ||
|
|
3533388c37 | ||
|
|
43fa69aa65 | ||
|
|
ab051171ed | ||
|
|
72de3f257a | ||
|
|
186fc572b3 | ||
|
|
ea95fcaaf3 | ||
|
|
e4e474235e | ||
|
|
64f406355e | ||
|
|
d523e4f64e | ||
|
|
81f8423218 | ||
|
|
2d1f39eb82 | ||
|
|
d601b0300b | ||
|
|
eb8b94328f | ||
|
|
e29fc0f320 | ||
|
|
165c8ebc1c | ||
|
|
527be16719 | ||
|
|
cc86209179 | ||
|
|
c7de8c4590 | ||
|
|
68acd38421 | ||
|
|
54e298d00f | ||
|
|
ba20c1a9eb | ||
|
|
49cb27d576 | ||
|
|
7320a48dce | ||
|
|
3c834b79f5 | ||
|
|
4637024240 | ||
|
|
440f2710f0 | ||
|
|
0ebd55890c | ||
|
|
3409a9f13f | ||
|
|
7fae8e0928 | ||
|
|
609c975de4 | ||
|
|
64615a3e14 | ||
|
|
fb72a0f24d | ||
|
|
54c5a7f963 | ||
|
|
8d46fbbd04 | ||
|
|
0d787f9989 | ||
|
|
f19f22737a | ||
|
|
687f5c933c | ||
|
|
fd95e77d4e | ||
|
|
fba52536d0 | ||
|
|
cfcbc94006 | ||
|
|
9643f0581e | ||
|
|
c02a24f85b | ||
|
|
728c7916be | ||
|
|
1af1c7f581 | ||
|
|
87439dbaad | ||
|
|
c79ec72b79 | ||
|
|
beff26500a | ||
|
|
6df2e2b755 | ||
|
|
4b793d3738 | ||
|
|
399a85ce9f | ||
|
|
673222d37e | ||
|
|
eced4dd2d3 | ||
|
|
293f241aa6 | ||
|
|
5a79c61732 | ||
|
|
c28a877d0b | ||
|
|
484b9df8c9 | ||
|
|
db7403acc0 | ||
|
|
8c8788eab3 | ||
|
|
0f4ad52ca9 | ||
|
|
8b156958f8 | ||
|
|
88ba778e55 | ||
|
|
192314fb02 | ||
|
|
0bfb983a1c | ||
|
|
c3a8f797d1 | ||
|
|
b67ed2057c | ||
|
|
234ba20eba | ||
|
|
88097f98e8 | ||
|
|
4c3c483011 | ||
|
|
5a9cba00ed | ||
|
|
8f822cfd84 | ||
|
|
45c19c1c2d | ||
|
|
369749bb46 | ||
|
|
5ec04ac670 | ||
|
|
69b8ed2486 | ||
|
|
74d8fba022 | ||
|
|
2ca8863b5d | ||
|
|
63e57f2667 | ||
|
|
165ef3adf6 | ||
|
|
8ccdc6a2ed | ||
|
|
a04f2004bd | ||
|
|
ad00818bd1 | ||
|
|
138087b296 | ||
|
|
cd5500ee50 | ||
|
|
cda8a40607 | ||
|
|
84e6679704 | ||
|
|
7d8bc27d73 | ||
|
|
566de0f9e7 | ||
|
|
146fbbcb6f | ||
|
|
d2dd0d2914 | ||
|
|
6010e839d0 | ||
|
|
2895f563cd | ||
|
|
7663a4a346 | ||
|
|
864272c1a2 | ||
|
|
4f75064ba4 | ||
|
|
ffd6d4dedc | ||
|
|
891139f682 | ||
|
|
496304c896 | ||
|
|
9cfde4d80c | ||
|
|
eba4453728 | ||
|
|
f36a2a11a6 | ||
|
|
6c9af9cc12 | ||
|
|
de6604ad5f | ||
|
|
d4ebfc7ab1 | ||
|
|
2a2f578c13 | ||
|
|
f04cf33c78 | ||
|
|
6d89bbacf7 | ||
|
|
0010255391 | ||
|
|
50de5610b9 | ||
|
|
8def56fd8b | ||
|
|
bdbcb236a1 | ||
|
|
70fa18f186 | ||
|
|
43a7255c2a | ||
|
|
8c24def8d8 | ||
|
|
937f285689 | ||
|
|
a66c960b21 | ||
|
|
81d922c8bd | ||
|
|
347364543d | ||
|
|
6bc703a9b0 | ||
|
|
ee99a768f4 | ||
|
|
beee212fcb | ||
|
|
33145e377b | ||
|
|
5552a9d538 | ||
|
|
4fcdb6f304 | ||
|
|
0e4d345fc1 | ||
|
|
ee0092e7ca | ||
|
|
c3f0a1edc4 | ||
|
|
a8b46ad10f | ||
|
|
daa65b40fb | ||
|
|
fa6027f7ba | ||
|
|
f26a085b13 | ||
|
|
9d09916c17 | ||
|
|
f250d9956b | ||
|
|
93994bb39c | ||
|
|
17f7d19624 | ||
|
|
7e0c1a8024 | ||
|
|
f6dc22c545 | ||
|
|
d196956519 | ||
|
|
4769c69ba7 | ||
|
|
f322b6191e | ||
|
|
e076c76b3f | ||
|
|
df8257a18f | ||
|
|
e7f22ca0d3 | ||
|
|
a9921ecdf0 | ||
|
|
a5da643513 | ||
|
|
8c68b7ce83 | ||
|
|
a4137a4edd | ||
|
|
cb5a181993 | ||
|
|
46972646d8 | ||
|
|
8549d4a13f | ||
|
|
47077af838 | ||
|
|
6cc589539b | ||
|
|
2237745c09 | ||
|
|
b74569abef | ||
|
|
de67847ef1 | ||
|
|
a430eaf41f | ||
|
|
31b68ae5e5 | ||
|
|
fa1877ef7b | ||
|
|
5851c4a5f1 | ||
|
|
4fadb9a633 | ||
|
|
d021559d7c | ||
|
|
7f22925063 | ||
|
|
e65fa778cb | ||
|
|
003ee7a926 | ||
|
|
8b344a653f | ||
|
|
7403aafe16 | ||
|
|
f7b6e8a3bc | ||
|
|
ad051c5e0e | ||
|
|
7ceb23f7a2 | ||
|
|
9760c838aa | ||
|
|
8002cecda4 | ||
|
|
27b1c6a2f2 |
@@ -9,6 +9,6 @@ module.exports = {
|
||||
'jsdoc/check-param-names': ['off'],
|
||||
'jsdoc/no-undefined-types': ['off'],
|
||||
'jsdoc/require-property-description': ['off'],
|
||||
'import/no-named-as-default-member': ['off'],
|
||||
'import/no-named-as-default-member': ['off']
|
||||
},
|
||||
}
|
||||
|
||||
37
.github/dependabot.yml
vendored
37
.github/dependabot.yml
vendored
@@ -2,7 +2,7 @@ version: 2
|
||||
updates:
|
||||
- package-ecosystem: npm
|
||||
directory: "/"
|
||||
target-branch: "main"
|
||||
target-branch: "master"
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: saturday
|
||||
@@ -11,41 +11,6 @@ updates:
|
||||
open-pull-requests-limit: 10
|
||||
reviewers:
|
||||
- juliushaertl
|
||||
|
||||
- package-ecosystem: npm
|
||||
target-branch: stable25
|
||||
versioning-strategy: lockfile-only
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: saturday
|
||||
time: "03:00"
|
||||
timezone: Europe/Paris
|
||||
ignore:
|
||||
- dependency-name: "*"
|
||||
update-types: ["version-update:semver-major"]
|
||||
open-pull-requests-limit: 30
|
||||
labels:
|
||||
- 3. to review
|
||||
- dependencies
|
||||
|
||||
- package-ecosystem: npm
|
||||
target-branch: stable24
|
||||
versioning-strategy: lockfile-only
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: saturday
|
||||
time: "03:00"
|
||||
timezone: Europe/Paris
|
||||
ignore:
|
||||
- dependency-name: "*"
|
||||
update-types: ["version-update:semver-major"]
|
||||
open-pull-requests-limit: 30
|
||||
labels:
|
||||
- 3. to review
|
||||
- dependencies
|
||||
|
||||
- package-ecosystem: composer
|
||||
directory: "/"
|
||||
schedule:
|
||||
|
||||
2
.github/pull_request_template.md
vendored
2
.github/pull_request_template.md
vendored
@@ -1,6 +1,6 @@
|
||||
|
||||
* Resolves: # <!-- related github issue -->
|
||||
* Target version: main
|
||||
* Target version: master
|
||||
|
||||
### Summary
|
||||
|
||||
|
||||
8
.github/workflows/appbuild.yml
vendored
8
.github/workflows/appbuild.yml
vendored
@@ -13,7 +13,7 @@ jobs:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [16.x]
|
||||
node-version: [14.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
@@ -24,14 +24,14 @@ jobs:
|
||||
- name: Set up npm7
|
||||
run: npm i -g npm@7
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@2.25.1
|
||||
uses: shivammathur/setup-php@2.21.2
|
||||
with:
|
||||
php-version: '7.4'
|
||||
tools: composer
|
||||
- name: install dependencies
|
||||
run: |
|
||||
wget https://github.com/ChristophWurst/krankerl/releases/download/v0.14.0/krankerl_0.14.0_amd64.deb
|
||||
sudo dpkg -i krankerl_0.14.0_amd64.deb
|
||||
wget https://github.com/ChristophWurst/krankerl/releases/download/v0.12.2/krankerl_0.12.2_amd64.deb
|
||||
sudo dpkg -i krankerl_0.12.2_amd64.deb
|
||||
- name: package
|
||||
run: |
|
||||
uname -a
|
||||
|
||||
53
.github/workflows/appstore-build-publish.yml
vendored
53
.github/workflows/appstore-build-publish.yml
vendored
@@ -10,7 +10,7 @@ on:
|
||||
types: [published]
|
||||
|
||||
env:
|
||||
PHP_VERSION: 8.1
|
||||
PHP_VERSION: 7.4
|
||||
|
||||
jobs:
|
||||
build_and_publish:
|
||||
@@ -21,42 +21,42 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Check actor permission
|
||||
uses: skjnldsv/check-actor-permission@e591dbfe838300c007028e1219ca82cc26e8d7c5 # v2.1
|
||||
uses: skjnldsv/check-actor-permission@v2
|
||||
with:
|
||||
require: write
|
||||
|
||||
- name: Set app env
|
||||
run: |
|
||||
# Split and keep last
|
||||
# Split and keep last
|
||||
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
|
||||
echo "APP_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
path: ${{ env.APP_NAME }}
|
||||
|
||||
- name: Get appinfo data
|
||||
id: appinfo
|
||||
uses: skjnldsv/xpath-action@7e6a7c379d0e9abc8acaef43df403ab4fc4f770c # master
|
||||
uses: skjnldsv/xpath-action@master
|
||||
with:
|
||||
filename: ${{ env.APP_NAME }}/appinfo/info.xml
|
||||
expression: "//info//dependencies//nextcloud/@min-version"
|
||||
|
||||
- name: Read package.json node and npm engines version
|
||||
uses: skjnldsv/read-package-engines-version-actions@0ce2ed60f6df073a62a77c0a4958dd0fc68e32e7 # v2.1
|
||||
uses: skjnldsv/read-package-engines-version-actions@v1.2
|
||||
id: versions
|
||||
# Continue if no package.json
|
||||
continue-on-error: true
|
||||
with:
|
||||
path: ${{ env.APP_NAME }}
|
||||
fallbackNode: "^16"
|
||||
fallbackNpm: "^7"
|
||||
fallbackNode: "^12"
|
||||
fallbackNpm: "^6"
|
||||
|
||||
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
|
||||
# Skip if no package.json
|
||||
if: ${{ steps.versions.outputs.nodeVersion }}
|
||||
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ steps.versions.outputs.nodeVersion }}
|
||||
|
||||
@@ -66,16 +66,14 @@ jobs:
|
||||
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
|
||||
|
||||
- name: Set up php ${{ env.PHP_VERSION }}
|
||||
uses: shivammathur/setup-php@2.25.1 # v2
|
||||
uses: shivammathur/setup-php@2.21.2
|
||||
with:
|
||||
php-version: ${{ env.PHP_VERSION }}
|
||||
coverage: none
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Check composer.json
|
||||
id: check_composer
|
||||
uses: andstor/file-existence-action@20b4d2e596410855db8f9ca21e96fbe18e12930b # v2
|
||||
uses: andstor/file-existence-action@v1
|
||||
with:
|
||||
files: "${{ env.APP_NAME }}/composer.json"
|
||||
|
||||
@@ -93,29 +91,16 @@ jobs:
|
||||
npm ci
|
||||
npm run build
|
||||
|
||||
- name: Check Krankerl config
|
||||
id: krankerl
|
||||
uses: andstor/file-existence-action@20b4d2e596410855db8f9ca21e96fbe18e12930b # v2
|
||||
with:
|
||||
files: ${{ env.APP_NAME }}/krankerl.toml
|
||||
|
||||
- name: Install Krankerl
|
||||
if: steps.krankerl.outputs.files_exists == 'true'
|
||||
run: |
|
||||
wget https://github.com/ChristophWurst/krankerl/releases/download/v0.14.0/krankerl_0.14.0_amd64.deb
|
||||
sudo dpkg -i krankerl_0.14.0_amd64.deb
|
||||
wget https://github.com/ChristophWurst/krankerl/releases/download/v0.13.0/krankerl_0.13.0_amd64.deb
|
||||
sudo dpkg -i krankerl_0.13.0_amd64.deb
|
||||
|
||||
- name: Package ${{ env.APP_NAME }} ${{ env.APP_VERSION }} with krankerl
|
||||
if: steps.krankerl.outputs.files_exists == 'true'
|
||||
- name: Package ${{ env.APP_NAME }} ${{ env.APP_VERSION }}
|
||||
# Try krankerl, fallback to makefile
|
||||
run: |
|
||||
cd ${{ env.APP_NAME }}
|
||||
krankerl package
|
||||
|
||||
- name: Package ${{ env.APP_NAME }} ${{ env.APP_VERSION }} with makefile
|
||||
if: steps.krankerl.outputs.files_exists != 'true'
|
||||
run: |
|
||||
cd ${{ env.APP_NAME }}
|
||||
make appstore
|
||||
krankerl package || make appstore
|
||||
|
||||
- name: Checkout server ${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}
|
||||
continue-on-error: true
|
||||
@@ -126,7 +111,7 @@ jobs:
|
||||
unzip latest-$NCVERSION.zip
|
||||
|
||||
- name: Checkout server master fallback
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
|
||||
uses: actions/checkout@v3
|
||||
if: ${{ steps.server-checkout.outcome != 'success' }}
|
||||
with:
|
||||
repository: nextcloud/server
|
||||
@@ -148,7 +133,7 @@ jobs:
|
||||
tar -zcvf ${{ env.APP_NAME }}.tar.gz ${{ env.APP_NAME }}
|
||||
|
||||
- name: Attach tarball to github release
|
||||
uses: svenstaro/upload-release-action@7319e4733ec7a184d739a6f412c40ffc339b69c7 # v2
|
||||
uses: svenstaro/upload-release-action@v2
|
||||
id: attach_to_release
|
||||
with:
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -158,7 +143,7 @@ jobs:
|
||||
overwrite: true
|
||||
|
||||
- name: Upload app to Nextcloud appstore
|
||||
uses: nextcloud-releases/nextcloud-appstore-push-action@a011fe619bcf6e77ddebc96f9908e1af4071b9c1 # v1
|
||||
uses: nextcloud-releases/nextcloud-appstore-push-action@v1
|
||||
with:
|
||||
app_name: ${{ env.APP_NAME }}
|
||||
appstore_token: ${{ secrets.APPSTORE_TOKEN }}
|
||||
|
||||
12
.github/workflows/command-rebase.yml
vendored
12
.github/workflows/command-rebase.yml
vendored
@@ -9,8 +9,8 @@ on:
|
||||
issue_comment:
|
||||
types: created
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
rebase:
|
||||
@@ -23,7 +23,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Add reaction on start
|
||||
uses: peter-evans/create-or-update-comment@ca08ebd5dc95aa0cd97021e9708fcd6b87138c9b # v3.0.1
|
||||
uses: peter-evans/create-or-update-comment@v2
|
||||
with:
|
||||
token: ${{ secrets.COMMAND_BOT_PAT }}
|
||||
repository: ${{ github.event.repository.full_name }}
|
||||
@@ -31,18 +31,18 @@ jobs:
|
||||
reaction-type: "+1"
|
||||
|
||||
- name: Checkout the latest code
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.COMMAND_BOT_PAT }}
|
||||
|
||||
- name: Automatic Rebase
|
||||
uses: cirrus-actions/rebase@6e572f08c244e2f04f9beb85a943eb618218714d # 1.7
|
||||
uses: cirrus-actions/rebase@1.7
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.COMMAND_BOT_PAT }}
|
||||
|
||||
- name: Add reaction on failure
|
||||
uses: peter-evans/create-or-update-comment@ca08ebd5dc95aa0cd97021e9708fcd6b87138c9b # v3.0.1
|
||||
uses: peter-evans/create-or-update-comment@v2
|
||||
if: failure()
|
||||
with:
|
||||
token: ${{ secrets.COMMAND_BOT_PAT }}
|
||||
|
||||
26
.github/workflows/cypress.yml
vendored
26
.github/workflows/cypress.yml
vendored
@@ -4,7 +4,7 @@ on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
- stable*
|
||||
|
||||
env:
|
||||
@@ -21,9 +21,9 @@ jobs:
|
||||
matrix:
|
||||
node-version: [14.x]
|
||||
# containers: [1, 2, 3]
|
||||
php-versions: [ '8.0' ]
|
||||
php-versions: [ '7.4' ]
|
||||
databases: [ 'sqlite' ]
|
||||
server-versions: [ 'master' ]
|
||||
server-versions: [ 'stable25' ]
|
||||
|
||||
steps:
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
@@ -33,11 +33,6 @@ jobs:
|
||||
- name: Set up npm7
|
||||
run: npm i -g npm@7
|
||||
|
||||
- name: Register text Git reference
|
||||
run: |
|
||||
text_app_ref="$(if [ "${{ matrix.server-versions }}" = "master" ]; then echo -n "main"; else echo -n "${{ matrix.server-versions }}"; fi)"
|
||||
echo "text_app_ref=$text_app_ref" >> $GITHUB_ENV
|
||||
|
||||
- name: Checkout server
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
@@ -56,15 +51,8 @@ jobs:
|
||||
with:
|
||||
path: apps/${{ env.APP_NAME }}
|
||||
|
||||
- name: Checkout text
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: nextcloud/text
|
||||
ref: ${{ env.text_app_ref }}
|
||||
path: apps/text
|
||||
|
||||
- name: Set up php ${{ matrix.php-versions }}
|
||||
uses: shivammathur/setup-php@2.25.1
|
||||
uses: shivammathur/setup-php@2.21.2
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
extensions: mbstring, iconv, fileinfo, intl, sqlite, pdo_sqlite, zip, gd, apcu
|
||||
@@ -96,7 +84,7 @@ jobs:
|
||||
curl -v http://localhost:8081/index.php/login
|
||||
|
||||
- name: Cypress run
|
||||
uses: cypress-io/github-action@v5
|
||||
uses: cypress-io/github-action@v4
|
||||
with:
|
||||
record: true
|
||||
parallel: false
|
||||
@@ -108,7 +96,7 @@ jobs:
|
||||
npm_package_name: ${{ env.APP_NAME }}
|
||||
|
||||
- name: Upload test failure screenshots
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: Upload screenshots
|
||||
@@ -116,7 +104,7 @@ jobs:
|
||||
retention-days: 5
|
||||
|
||||
- name: Upload nextcloud logs
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: Upload nextcloud log
|
||||
|
||||
10
.github/workflows/dependabot-approve-merge.yml
vendored
10
.github/workflows/dependabot-approve-merge.yml
vendored
@@ -15,26 +15,22 @@ on:
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: dependabot-approve-merge-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
auto-approve-merge:
|
||||
if: github.actor == 'dependabot[bot]'
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
# for hmarr/auto-approve-action to approve PRs
|
||||
pull-requests: write
|
||||
pull-requests: write
|
||||
|
||||
steps:
|
||||
# Github actions bot approve
|
||||
- uses: hmarr/auto-approve-action@b40d6c9ed2fa10c9a2749eca7eb004418a705501 # v2
|
||||
- uses: hmarr/auto-approve-action@v2
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
# Nextcloud bot approve and merge request
|
||||
- uses: ahmadnassri/action-dependabot-auto-merge@45fc124d949b19b6b8bf6645b6c9d55f4f9ac61a # v2
|
||||
- uses: ahmadnassri/action-dependabot-auto-merge@v2
|
||||
with:
|
||||
target: minor
|
||||
github-token: ${{ secrets.DEPENDABOT_AUTOMERGE_TOKEN }}
|
||||
|
||||
31
.github/workflows/fixup.yml
vendored
31
.github/workflows/fixup.yml
vendored
@@ -5,29 +5,16 @@
|
||||
|
||||
name: Pull request checks
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, ready_for_review, reopened, synchronize]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: fixup-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
on: pull_request
|
||||
|
||||
jobs:
|
||||
commit-message-check:
|
||||
if: github.event.pull_request.draft == false
|
||||
commit-message-check:
|
||||
name: Block fixup and squash commits
|
||||
|
||||
permissions:
|
||||
pull-requests: write
|
||||
name: Block fixup and squash commits
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Run check
|
||||
uses: xt0rted/block-autosquash-commits-action@79880c36b4811fe549cfffe20233df88876024e7 # v2
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
steps:
|
||||
- name: Run check
|
||||
uses: xt0rted/block-autosquash-commits-action@v2
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
68
.github/workflows/integration.yml
vendored
68
.github/workflows/integration.yml
vendored
@@ -12,7 +12,6 @@ on:
|
||||
- 'composer.lock'
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
- stable*
|
||||
|
||||
@@ -26,9 +25,9 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
php-versions: ['8.1']
|
||||
php-versions: ['7.4']
|
||||
databases: ['sqlite', 'mysql', 'pgsql']
|
||||
server-versions: ['master']
|
||||
server-versions: ['stable25']
|
||||
|
||||
name: php${{ matrix.php-versions }}-${{ matrix.databases }}-${{ matrix.server-versions }}
|
||||
|
||||
@@ -71,17 +70,16 @@ jobs:
|
||||
path: apps/${{ env.APP_NAME }}
|
||||
|
||||
- name: Set up php ${{ matrix.php-versions }}
|
||||
uses: shivammathur/setup-php@2.25.1
|
||||
uses: shivammathur/setup-php@2.21.2
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
extensions: mbstring, iconv, fileinfo, intl, sqlite, pdo_sqlite, mysql, pdo_mysql, pgsql, pdo_pgsql, apcu
|
||||
ini-values:
|
||||
apc.enable_cli=on
|
||||
tools: phpunit
|
||||
extensions: mbstring, iconv, fileinfo, intl, sqlite, pdo_sqlite, mysql, pdo_mysql, pgsql, pdo_pgsql,
|
||||
coverage: none
|
||||
|
||||
- name: Set up dependencies
|
||||
- name: Set up PHPUnit
|
||||
working-directory: apps/${{ env.APP_NAME }}
|
||||
run: composer i --no-dev
|
||||
run: composer i
|
||||
|
||||
- name: Set up Nextcloud
|
||||
run: |
|
||||
@@ -92,63 +90,11 @@ jobs:
|
||||
fi
|
||||
mkdir data
|
||||
./occ maintenance:install --verbose --database=${{ matrix.databases }} --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin
|
||||
./occ config:system:set hashing_default_password --value=true --type=boolean
|
||||
./occ config:system:set memcache.local --value="\\OC\\Memcache\\APCu"
|
||||
./occ config:system:set memcache.distributed --value="\\OC\\Memcache\\APCu"
|
||||
cat config/config.php
|
||||
./occ user:list
|
||||
./occ app:enable --force ${{ env.APP_NAME }}
|
||||
./occ config:system:set query_log_file --value '/home/runner/work/${{ env.APP_NAME }}/${{ env.APP_NAME }}/query.log'
|
||||
php -S localhost:8080 &
|
||||
|
||||
- name: Run behat
|
||||
working-directory: apps/${{ env.APP_NAME }}/tests/integration
|
||||
run: ./run.sh
|
||||
|
||||
- name: Query count
|
||||
if: ${{ matrix.databases == 'mysql' }}
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||
script: |
|
||||
let myOutput = ''
|
||||
let myError = ''
|
||||
|
||||
const options = {}
|
||||
options.listeners = {
|
||||
stdout: (data) => {
|
||||
myOutput += data.toString()
|
||||
},
|
||||
stderr: (data) => {
|
||||
myError += data.toString()
|
||||
}
|
||||
}
|
||||
await exec.exec(`/bin/bash -c "cat /home/runner/work/${{ env.APP_NAME }}/${{ env.APP_NAME }}/query.log | wc -l"`, [], options)
|
||||
msg = myOutput
|
||||
const queryCount = parseInt(myOutput, 10)
|
||||
|
||||
myOutput = ''
|
||||
await exec.exec('cat', ['/home/runner/work/${{ env.APP_NAME }}/${{ env.APP_NAME }}/apps/${{ env.APP_NAME }}/tests/integration/base-query-count.txt'], options)
|
||||
const baseCount = parseInt(myOutput, 10)
|
||||
|
||||
const absoluteIncrease = queryCount - baseCount
|
||||
const relativeIncrease = baseCount <= 0 ? 100 : (parseInt((absoluteIncrease / baseCount * 10000), 10) / 100)
|
||||
|
||||
if (absoluteIncrease >= 100 || relativeIncrease > 5) {
|
||||
const comment = `🐢 Performance warning.\nIt looks like the query count of the integration tests increased with this PR.\nDatabase query count is now ` + queryCount + ' was ' + baseCount + ' (+' + relativeIncrease + '%)\nPlease check your code again. If you added a new test this can be expected and the base value in tests/integration/base-query-count.txt can be increased.'
|
||||
github.rest.issues.createComment({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: comment
|
||||
})
|
||||
}
|
||||
if (queryCount < 100) {
|
||||
const comment = `🐈 Performance messuring seems broken. Failed to get query count.`
|
||||
github.rest.issues.createComment({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: comment
|
||||
})
|
||||
}
|
||||
62
.github/workflows/lint-eslint.yml
vendored
62
.github/workflows/lint-eslint.yml
vendored
@@ -1,62 +0,0 @@
|
||||
# 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
|
||||
#
|
||||
# Use lint-eslint together with lint-eslint-when-unrelated to make eslint a required check for GitHub actions
|
||||
# https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
|
||||
|
||||
name: Lint
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/**'
|
||||
- 'src/**'
|
||||
- 'appinfo/info.xml'
|
||||
- 'package.json'
|
||||
- 'package-lock.json'
|
||||
- 'tsconfig.json'
|
||||
- '.eslintrc.*'
|
||||
- '.eslintignore'
|
||||
- '**.js'
|
||||
- '**.ts'
|
||||
- '**.vue'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: lint-eslint-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
name: eslint
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
|
||||
|
||||
- name: Read package.json node and npm engines version
|
||||
uses: skjnldsv/read-package-engines-version-actions@0ce2ed60f6df073a62a77c0a4958dd0fc68e32e7 # v2.1
|
||||
id: versions
|
||||
with:
|
||||
fallbackNode: '^16'
|
||||
fallbackNpm: '^7'
|
||||
|
||||
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
|
||||
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3
|
||||
with:
|
||||
node-version: ${{ steps.versions.outputs.nodeVersion }}
|
||||
|
||||
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
|
||||
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Lint
|
||||
run: npm run lint
|
||||
39
.github/workflows/lint-php-cs.yml
vendored
39
.github/workflows/lint-php-cs.yml
vendored
@@ -1,39 +0,0 @@
|
||||
# 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: Lint
|
||||
|
||||
on: pull_request
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: lint-php-cs-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
name: php-cs
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
|
||||
|
||||
- name: Set up php
|
||||
uses: shivammathur/setup-php@2.25.1 # v2
|
||||
with:
|
||||
php-version: 8.1
|
||||
coverage: none
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: composer i
|
||||
|
||||
- name: Lint
|
||||
run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 )
|
||||
59
.github/workflows/lint-php.yml
vendored
59
.github/workflows/lint-php.yml
vendored
@@ -1,59 +0,0 @@
|
||||
# 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: Lint
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
- stable*
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: lint-php-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
php-lint:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
php-versions: [ "8.0", "8.1", "8.2" ]
|
||||
|
||||
name: php-lint
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
|
||||
|
||||
- name: Set up php ${{ matrix.php-versions }}
|
||||
uses: shivammathur/setup-php@2.25.1 # v2
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
coverage: none
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Lint
|
||||
run: composer run lint
|
||||
|
||||
summary:
|
||||
permissions:
|
||||
contents: none
|
||||
runs-on: ubuntu-latest
|
||||
needs: php-lint
|
||||
|
||||
if: always()
|
||||
|
||||
name: php-lint-summary
|
||||
|
||||
steps:
|
||||
- name: Summary status
|
||||
run: if ${{ needs.php-lint.result != 'success' && needs.php-lint.result != 'skipped' }}; then exit 1; fi
|
||||
46
.github/workflows/lint-stylelint.yml
vendored
46
.github/workflows/lint-stylelint.yml
vendored
@@ -1,46 +0,0 @@
|
||||
# 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: Lint
|
||||
|
||||
on: pull_request
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: lint-stylelint-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
name: stylelint
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
|
||||
|
||||
- name: Read package.json node and npm engines version
|
||||
uses: skjnldsv/read-package-engines-version-actions@0ce2ed60f6df073a62a77c0a4958dd0fc68e32e7 # v2.1
|
||||
id: versions
|
||||
with:
|
||||
fallbackNode: '^16'
|
||||
fallbackNpm: '^7'
|
||||
|
||||
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
|
||||
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3
|
||||
with:
|
||||
node-version: ${{ steps.versions.outputs.nodeVersion }}
|
||||
|
||||
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
|
||||
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Lint
|
||||
run: npm run stylelint
|
||||
88
.github/workflows/lint.yml
vendored
Normal file
88
.github/workflows/lint.yml
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
name: Lint
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- stable*
|
||||
|
||||
jobs:
|
||||
php:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
php-versions: ['7.4', '8.0', '8.1']
|
||||
|
||||
name: php${{ matrix.php-versions }} lint
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up php${{ matrix.php-versions }}
|
||||
uses: shivammathur/setup-php@2.21.2
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
coverage: none
|
||||
- name: Lint
|
||||
run: composer run lint
|
||||
|
||||
php-cs-fixer:
|
||||
name: php-cs check
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Set up php
|
||||
uses: shivammathur/setup-php@2.21.2
|
||||
with:
|
||||
php-version: 7.4
|
||||
coverage: none
|
||||
- name: Install dependencies
|
||||
run: composer i
|
||||
- name: Run coding standards check
|
||||
run: composer run cs:check
|
||||
|
||||
node:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [14.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Use node ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- name: Set up npm7
|
||||
run: npm i -g npm@7
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: ESLint
|
||||
run: npm run lint
|
||||
|
||||
stylelint:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [14.x]
|
||||
|
||||
name: stylelint node${{ matrix.node-version }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up node ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
|
||||
- name: Set up npm7
|
||||
run: npm i -g npm@7
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Lint
|
||||
run: npm run stylelint
|
||||
6
.github/workflows/nightly.yml
vendored
6
.github/workflows/nightly.yml
vendored
@@ -25,7 +25,7 @@ jobs:
|
||||
- name: Set up npm7
|
||||
run: npm i -g npm@7
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@2.25.1
|
||||
uses: shivammathur/setup-php@2.21.2
|
||||
with:
|
||||
php-version: '7.4'
|
||||
tools: composer
|
||||
@@ -44,14 +44,14 @@ jobs:
|
||||
git config --local user.name "GitHub Action"
|
||||
git tag -f nightly
|
||||
- name: Push tag
|
||||
uses: juliushaertl/github-push-action@main
|
||||
uses: juliushaertl/github-push-action@master
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
tags: true
|
||||
force: true
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
uses: juliushaertl/action-release@main
|
||||
uses: juliushaertl/action-release@master
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
tag: nightly
|
||||
|
||||
71
.github/workflows/npm-audit-fix.yml
vendored
71
.github/workflows/npm-audit-fix.yml
vendored
@@ -1,71 +0,0 @@
|
||||
# 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: npm audit fix and compile
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
# At 2:30 on Sundays
|
||||
- cron: '30 2 * * 0'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
branches: ["main", "master", "stable26", "stable25", "stable24"]
|
||||
|
||||
name: npm-audit-fix-${{ matrix.branches }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
|
||||
with:
|
||||
ref: ${{ matrix.branches }}
|
||||
|
||||
- name: Read package.json node and npm engines version
|
||||
uses: skjnldsv/read-package-engines-version-actions@0ce2ed60f6df073a62a77c0a4958dd0fc68e32e7 # v2.1
|
||||
id: versions
|
||||
with:
|
||||
fallbackNode: '^16'
|
||||
fallbackNpm: '^7'
|
||||
|
||||
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
|
||||
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3
|
||||
with:
|
||||
node-version: ${{ steps.versions.outputs.nodeVersion }}
|
||||
|
||||
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
|
||||
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
|
||||
|
||||
- name: Fix npm audit
|
||||
run: |
|
||||
npm audit fix
|
||||
|
||||
- name: Run npm ci and npm run build
|
||||
if: always()
|
||||
run: |
|
||||
npm ci
|
||||
npm run build --if-present
|
||||
|
||||
- name: Create Pull Request
|
||||
if: always()
|
||||
uses: peter-evans/create-pull-request@284f54f989303d2699d373481a0cfa13ad5a6666 # v3
|
||||
with:
|
||||
token: ${{ secrets.COMMAND_BOT_PAT }}
|
||||
commit-message: "chore(deps): fix npm audit"
|
||||
committer: GitHub <noreply@github.com>
|
||||
author: nextcloud-command <nextcloud-command@users.noreply.github.com>
|
||||
signoff: true
|
||||
branch: automated/noid/${{ matrix.branches }}-fix-npm-audit
|
||||
title: "[${{ matrix.branches }}] Fix npm audit"
|
||||
body: |
|
||||
Auto-generated fix of npm audit
|
||||
labels: |
|
||||
dependencies
|
||||
3. to review
|
||||
6
.github/workflows/phpunit.yml
vendored
6
.github/workflows/phpunit.yml
vendored
@@ -26,9 +26,9 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
php-versions: ['8.0', '8.1']
|
||||
php-versions: ['7.4', '8.0', '8.1']
|
||||
databases: ['sqlite', 'mysql', 'pgsql']
|
||||
server-versions: ['master']
|
||||
server-versions: ['stable25']
|
||||
|
||||
name: php${{ matrix.php-versions }}-${{ matrix.databases }}-${{ matrix.server-versions }}
|
||||
|
||||
@@ -70,7 +70,7 @@ jobs:
|
||||
path: apps/${{ env.APP_NAME }}
|
||||
|
||||
- name: Set up php ${{ matrix.php-versions }}
|
||||
uses: shivammathur/setup-php@2.25.1
|
||||
uses: shivammathur/setup-php@2.21.2
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
tools: phpunit
|
||||
|
||||
12
.github/workflows/psalm.yml
vendored
12
.github/workflows/psalm.yml
vendored
@@ -13,10 +13,6 @@ on:
|
||||
- main
|
||||
- stable*
|
||||
|
||||
concurrency:
|
||||
group: psalm-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
static-analysis:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -24,15 +20,13 @@ jobs:
|
||||
name: Nextcloud
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up php
|
||||
uses: shivammathur/setup-php@2.25.1 # v2
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: 8.1
|
||||
php-version: 7.4
|
||||
coverage: none
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: composer i
|
||||
|
||||
19
.github/workflows/update-nextcloud-ocp.yml
vendored
19
.github/workflows/update-nextcloud-ocp.yml
vendored
@@ -17,24 +17,22 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
branches: ["master", "stable26", "stable25", "stable24"]
|
||||
branches: ["master", "stable25", "stable24", "stable23"]
|
||||
|
||||
name: update-nextcloud-ocp-${{ matrix.branches }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: ${{ matrix.branches }}
|
||||
submodules: true
|
||||
|
||||
- name: Set up php8.1
|
||||
uses: shivammathur/setup-php@2.25.1 # v2
|
||||
- name: Set up php7.4
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: 8.1
|
||||
php-version: 7.4
|
||||
extensions: ctype,curl,dom,fileinfo,gd,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip
|
||||
coverage: none
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Composer install
|
||||
run: composer install
|
||||
@@ -47,15 +45,14 @@ jobs:
|
||||
run: |
|
||||
git clean -f 3rdparty
|
||||
git clean -f vendor
|
||||
git clean -f vendor-bin
|
||||
git checkout 3rdparty vendor vendor-bin
|
||||
git checkout 3rdparty vendor
|
||||
continue-on-error: true
|
||||
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@284f54f989303d2699d373481a0cfa13ad5a6666 # v3
|
||||
uses: peter-evans/create-pull-request@v3
|
||||
with:
|
||||
token: ${{ secrets.COMMAND_BOT_PAT }}
|
||||
commit-message: "chore(dev-deps): Bump nextcloud/ocp package"
|
||||
commit-message: Update psalm baseline
|
||||
committer: GitHub <noreply@github.com>
|
||||
author: nextcloud-command <nextcloud-command@users.noreply.github.com>
|
||||
signoff: true
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -3,11 +3,9 @@ js/
|
||||
build/
|
||||
css/style.css
|
||||
css/vendor.css
|
||||
cypress/videos/
|
||||
tests/integration/vendor/
|
||||
tests/integration/composer.lock
|
||||
tests/.phpunit.result.cache
|
||||
vendor/
|
||||
.php_cs.cache
|
||||
\.idea/
|
||||
settings.json
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[main]
|
||||
host = https://www.transifex.com
|
||||
lang_map = hu_HU: hu, nb_NO: nb, sk_SK: sk, th_TH: th, ja_JP: ja, bg_BG: bg, cs_CZ: cs, fi_FI: fi
|
||||
lang_map = bg_BG: bg, cs_CZ: cs, fi_FI: fi, hu_HU: hu, nb_NO: nb, sk_SK: sk, th_TH: th, ja_JP: ja
|
||||
|
||||
[o:nextcloud:p:nextcloud:r:deck]
|
||||
file_filter = translationfiles/<lang>/deck.po
|
||||
|
||||
102
CHANGELOG.md
102
CHANGELOG.md
@@ -1,65 +1,33 @@
|
||||
# Changelog
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
## 1.10.0-beta.1
|
||||
|
||||
### Added
|
||||
|
||||
- Compatibility with Nextcloud 27
|
||||
## 1.8.3
|
||||
|
||||
### Fixed
|
||||
|
||||
- fix(references): Mute NoPermissionException as it is expected to happen for references @juliushaertl [#4514](https://github.com/nextcloud/deck/pull/4514)
|
||||
- fix(cards): Fix card sizing by limiting too wide style rules @juliushaertl [#4512](https://github.com/nextcloud/deck/pull/4512)
|
||||
- fix: Adapt NcEmptyContent usages to new slots @juliushaertl [#4561](https://github.com/nextcloud/deck/pull/4561)
|
||||
- Gracefully handle not found card for a share @mejo- [#4566](https://github.com/nextcloud/deck/pull/4566)
|
||||
- Prevent tag itself being edit button if user lacks permissions @joshtrichards [#4574](https://github.com/nextcloud/deck/pull/4574)
|
||||
- chore: Remove unused @nextcloud/vue-dashboard @juliushaertl [#4586](https://github.com/nextcloud/deck/pull/4586)
|
||||
- Update Description.vue: Fixes the issue of hidden text by menu bar @pschopen [#4617](https://github.com/nextcloud/deck/pull/4617)
|
||||
- allow user to toggle visibility of the calendar for a deck board @schiessle [#4622](https://github.com/nextcloud/deck/pull/4622)
|
||||
- fix: Append datetime picker to body to avoid cut off @juliushaertl [#4643](https://github.com/nextcloud/deck/pull/4643)
|
||||
- fix: Bring back overdue column by removing faulty condition @juliushaertl [#4660](https://github.com/nextcloud/deck/pull/4660)
|
||||
- fix(sessions): Do not send close request without token @juliushaertl [#4510](https://github.com/nextcloud/deck/pull/4510)
|
||||
- tests(integration): Add test for multiple board shares to the same user @juliushaertl [#4494](https://github.com/nextcloud/deck/pull/4494)
|
||||
- fix(API): Fix board API details parameter to work as expected @nickvergessen [#4518](https://github.com/nextcloud/deck/pull/4518)
|
||||
- Fix : Overlapping expiry dates on tags @Jerome-Herbinet [#4535](https://github.com/nextcloud/deck/pull/4535)
|
||||
- Fix consistency of a "Create card" wording with its equivalent for Notes ("New card") @Jerome-Herbinet [#4534](https://github.com/nextcloud/deck/pull/4534)
|
||||
- tests(integration): Add integration tests for due dates @juliushaertl [#4489](https://github.com/nextcloud/deck/pull/4489)
|
||||
- Better display of card dates (creation and change dates) @Jerome-Herbinet [#4604](https://github.com/nextcloud/deck/pull/4604)
|
||||
- Refactors lib\Activity\DeckProvider.php to improve code readability. @fsamapoor [#4648](https://github.com/nextcloud/deck/pull/4648)
|
||||
- Converts 'strpos()' calls to improve code readability. @fsamapoor [#4657](https://github.com/nextcloud/deck/pull/4657)
|
||||
|
||||
|
||||
## 1.9.0-beta.1
|
||||
|
||||
### Added
|
||||
|
||||
- Export Board @david-loe [#3065](https://github.com/nextcloud/deck/pull/3065)
|
||||
- basic notify_push usage with session handling @alangecker [#3876](https://github.com/nextcloud/deck/pull/3876)
|
||||
- feat(Description): Use text as editor if available @juliushaertl [#4399](https://github.com/nextcloud/deck/pull/4399)
|
||||
- Improve reference provider and add reference widgets @julien-nc [#4422](https://github.com/nextcloud/deck/pull/4422)
|
||||
- live updates 🎉 @alangecker [#4273](https://github.com/nextcloud/deck/pull/4273)
|
||||
- Tag creation from card view @juliushaertl [#4344](https://github.com/nextcloud/deck/pull/4344)
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix component renaming so that acl works on shares again @small1 [#4315](https://github.com/nextcloud/deck/pull/4315)
|
||||
- fix(Sidebar): Only close sidebar on v-click-outside for specific targets @juliushaertl [#4350](https://github.com/nextcloud/deck/pull/4350)
|
||||
- add basic e2e tests for stack title @shoetten [#4206](https://github.com/nextcloud/deck/pull/4206)
|
||||
- App metadata: add links to user and developer documentation @p-bo [#4356](https://github.com/nextcloud/deck/pull/4356)
|
||||
- Update signature of Entity::markFieldUpdated @nickvergessen [#4398](https://github.com/nextcloud/deck/pull/4398)
|
||||
- Remove updated nightly information @xf- [#4419](https://github.com/nextcloud/deck/pull/4419)
|
||||
- perf: Register notifier and resource listener lazy @juliushaertl [#4439](https://github.com/nextcloud/deck/pull/4439)
|
||||
- perf: Lazy load dashboard components @juliushaertl [#4440](https://github.com/nextcloud/deck/pull/4440)
|
||||
- Optimise upcomming overview creation @Raudius [#3793](https://github.com/nextcloud/deck/pull/3793)
|
||||
- Performance boost @juliushaertl [#4452](https://github.com/nextcloud/deck/pull/4452)
|
||||
|
||||
### Other
|
||||
- Fix component renaming so that acl works on shares again [#4328](https://github.com/nextcloud/deck/pull/4328)
|
||||
- Permanently delete deck cards marked as deleted after 5 min in a cron job [#4301](https://github.com/nextcloud/deck/pull/4301)
|
||||
- Dependency updates
|
||||
|
||||
|
||||
## 1.8.0-beta.1
|
||||
### Enhancements
|
||||
## 1.8.2
|
||||
|
||||
### Fixed
|
||||
|
||||
- minor style fixes [#4201](https://github.com/nextcloud/deck/pull/4201)
|
||||
- feat: add validators to check values in services [#4174](https://github.com/nextcloud/deck/pull/4174)
|
||||
- Add integration test for attachment handling on cards [#4179](https://github.com/nextcloud/deck/pull/4179)
|
||||
- Add missing userId property [#4198](https://github.com/nextcloud/deck/pull/4198)
|
||||
|
||||
## 1.8.1
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix Duedate activity @nickvergessen [#4155](https://github.com/nextcloud/deck/pull/4155)
|
||||
|
||||
## 1.8.0
|
||||
|
||||
### Added
|
||||
|
||||
- Nextcloud 25 compatibility
|
||||
- Performance improvements
|
||||
@@ -71,10 +39,26 @@ All notable changes to this project will be documented in this file.
|
||||
- Improve filter popover accessibility @juliushaertl [#3820](https://github.com/nextcloud/deck/pull/3820)
|
||||
- Set ids to skip to content/navigation @juliushaertl [#3924](https://github.com/nextcloud/deck/pull/3924)
|
||||
- Invert icons properly in dark mode @juliushaertl [#3939](https://github.com/nextcloud/deck/pull/3939)
|
||||
- Bump dependencies
|
||||
- Implement card reference widget @eneiluj [#4031](https://github.com/nextcloud/deck/pull/4031)
|
||||
- Implement new dashboard widget interfaces @eneiluj [#4033](https://github.com/nextcloud/deck/pull/4033)
|
||||
- Add related resources panel to board sharing tab sidebar @Pytal [#4000](https://github.com/nextcloud/deck/pull/4000)
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix sorting stacks [#4116](https://github.com/nextcloud/deck/pull/4116)
|
||||
- Fix issue with duedate format [#4140](https://github.com/nextcloud/deck/pull/4140)
|
||||
- Fix missing icon for activity rendering [#4090](https://github.com/nextcloud/deck/pull/4090)
|
||||
- disables autocomplete on card creation [#4142](https://github.com/nextcloud/deck/pull/4142)
|
||||
- Set event link also for notifications that get emitted from activities [#4117](https://github.com/nextcloud/deck/pull/4117)
|
||||
- Fix attachment creator name: show display name @eneiluj [#4036](https://github.com/nextcloud/deck/pull/4036)
|
||||
- Fix reference provider when caching @eneiluj [#4056](https://github.com/nextcloud/deck/pull/4056)
|
||||
- Use global import for nextcloud-vue [#4072](https://github.com/nextcloud/deck/pull/4072)
|
||||
- Disable Create card button while no stack is chosen @icewind1991 [#4014](https://github.com/nextcloud/deck/pull/4014)
|
||||
- Adjust testing matrix for Nextcloud 25 on stable25 @nickvergessen [#4068](https://github.com/nextcloud/deck/pull/4068)
|
||||
- Fix Card menu not displaying when description is not set @marcelklehr [#4105](https://github.com/nextcloud/deck/pull/4105)
|
||||
- Reference widget adjustments for Text [#4075](https://github.com/nextcloud/deck/pull/4075)
|
||||
- use OCP\Collaboration\Reference\Reference [#4078](https://github.com/nextcloud/deck/pull/4078)
|
||||
- Cache user membership for circles [#4141](https://github.com/nextcloud/deck/pull/4141)
|
||||
- set last modified when the card was found. Fixes #3763 @ylebre [#3796](https://github.com/nextcloud/deck/pull/3796)
|
||||
- Increase file count after sharing @luka-nextcloud [#3682](https://github.com/nextcloud/deck/pull/3682)
|
||||
- Align Duedate-delete icon properly - fixes nextcloud/deck#3791 @Ben-Ro [#3811](https://github.com/nextcloud/deck/pull/3811)
|
||||
@@ -519,7 +503,7 @@ Android app team for helping to improve our REST API:
|
||||
- Fix comment activities on Nextcloud 15
|
||||
- Fix issues with Edge
|
||||
- API: Fix numeric types that were returned as strings
|
||||
- API: Fix If-Modified-Since header parsing
|
||||
- API: Fix If-Modified-Since header parsing
|
||||
|
||||
|
||||
## 0.5.1 - 2018-12-05
|
||||
@@ -646,7 +630,7 @@ Android app team for helping to improve our REST API:
|
||||
### Fixed
|
||||
- Various frontend fixes
|
||||
- Fix sidebar drag issues
|
||||
- Improvements for IE11
|
||||
- Improvements for IE11
|
||||
- Fix bug when draging a card to an empty stack
|
||||
|
||||
## 0.2.1 - 2017-07-04
|
||||
@@ -720,7 +704,7 @@ Android app team for helping to improve our REST API:
|
||||
|
||||
### Fixed
|
||||
- Various styling improvements
|
||||
- Fix problems with MySQL and PostgreSQL
|
||||
- Fix problems with MySQL and PostgreSQL
|
||||
- Select first color by default when creating boards
|
||||
- Fix error when changing board permissions
|
||||
|
||||
@@ -728,9 +712,9 @@ Android app team for helping to improve our REST API:
|
||||
|
||||
### Added
|
||||
- Sharing boards with other users
|
||||
- Create and manage boards
|
||||
- Create and manage boards
|
||||
- Sort cards on stacks by drag-and-drop
|
||||
- Assign labels
|
||||
- Markdown notes for each card
|
||||
- Archive cards
|
||||
- Archive cards
|
||||
|
||||
|
||||
10
Makefile
10
Makefile
@@ -30,16 +30,6 @@ build: clean-dist install-deps build-js
|
||||
|
||||
release: clean-dist install-deps-nodev build-js
|
||||
|
||||
lint: lint-js lint-php
|
||||
|
||||
lint-js:
|
||||
npm run lint
|
||||
npm run stylelint
|
||||
|
||||
lint-php:
|
||||
composer run lint 1>/dev/null
|
||||
composer run cs:check
|
||||
|
||||
build-js: install-deps-js
|
||||
npm run build
|
||||
|
||||
|
||||
14
README.md
14
README.md
@@ -1,6 +1,6 @@
|
||||
# Deck
|
||||
|
||||
[](https://travis-ci.org/nextcloud/deck) [](https://codecov.io/github/nextcloud/deck) [](https://www.codacy.com/app/juliushaertl/deck?utm_source=github.com&utm_medium=referral&utm_content=nextcloud/deck&utm_campaign=Badge_Grade) [](https://scrutinizer-ci.com/g/nextcloud/deck/?branch=main) [](https://webchat.freenode.net/?channels=nextcloud-deck)
|
||||
[](https://travis-ci.org/nextcloud/deck) [](https://codecov.io/github/nextcloud/deck) [](https://www.codacy.com/app/juliushaertl/deck?utm_source=github.com&utm_medium=referral&utm_content=nextcloud/deck&utm_campaign=Badge_Grade) [](https://scrutinizer-ci.com/g/nextcloud/deck/?branch=master) [](https://webchat.freenode.net/?channels=nextcloud-deck)
|
||||
|
||||
|
||||
Deck is a kanban style organization tool aimed at personal planning and project organization for teams integrated with Nextcloud.
|
||||
@@ -20,7 +20,6 @@ Deck is a kanban style organization tool aimed at personal planning and project
|
||||
### Mobile apps
|
||||
|
||||
- [Nextcloud Deck app for Android](https://github.com/stefan-niedermann/nextcloud-deck) - It is available in [F-Droid](https://f-droid.org/de/packages/it.niedermann.nextcloud.deck/) and the [Google Play Store](https://play.google.com/store/apps/details?id=it.niedermann.nextcloud.deck.play)
|
||||
- [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
|
||||
|
||||
@@ -49,6 +48,10 @@ make build
|
||||
|
||||
Please make sure you have installed the following dependencies: `make, which, tar, npm, curl, composer`
|
||||
|
||||
### Install the nightly builds
|
||||
|
||||
Instead of setting everything up manually, you can just [download the nightly build](https://github.com/nextcloud/deck/releases/tag/nightly) instead. These builds are updated every 24 hours, and are pre-configured with all the needed dependencies.
|
||||
|
||||
## Performance limitations
|
||||
|
||||
Deck is not yet ready for intensive usage.
|
||||
@@ -62,18 +65,13 @@ Improvements on Nextcloud server and Deck itself will improve the situation.
|
||||
|
||||
## Developing
|
||||
|
||||
### Nextcloud environment
|
||||
|
||||
You need to setup a [development environment](https://docs.nextcloud.com/server/latest/developer_manual//getting_started/devenv.html) of the current nextcloud version. You can also alternatively install & run the [nextcloud docker container](https://github.com/juliushaertl/nextcloud-docker-dev).
|
||||
After the finished installation, you can clone the deck project directly in the `/[nextcloud-docker-dev-dir]/workspace/server/apps/` folder.
|
||||
|
||||
### PHP
|
||||
|
||||
Nothing to prepare, just dig into the code.
|
||||
|
||||
### JavaScript
|
||||
|
||||
This requires at least Node 16 and npm 7 to be installed.
|
||||
This requires at least Node 14 and npm 7 to be installed.
|
||||
|
||||
Deck requires running a `make build-js` to install npm dependencies and build the JavaScript code using webpack. While developing you can also use `make watch` to rebuild everytime the code changes.
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ Your report should include:
|
||||
- Reproduction steps
|
||||
|
||||
A member of the security team will confirm the vulnerability, determine its impact, and develop a fix.
|
||||
The fix will be applied to the main branch, tested, and packaged in the next security release.
|
||||
The fix will be applied to the master branch, tested, and packaged in the next security release.
|
||||
The vulnerability will be publicly announced after the release. Finally, your name will be added
|
||||
to the [hall of fame](https://hackerone.com/nextcloud/thanks) as a thank you from the entire Nextcloud community. Note our
|
||||
[threat model](https://nextcloud.com/security/threat-model) to know what is expected behavior.
|
||||
|
||||
@@ -16,13 +16,9 @@
|
||||
- 🚀 Get your project organized
|
||||
|
||||
</description>
|
||||
<version>1.10.0-beta.1</version>
|
||||
<version>1.8.3</version>
|
||||
<licence>agpl</licence>
|
||||
<author>Julius Härtl</author>
|
||||
<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/>
|
||||
@@ -38,19 +34,13 @@
|
||||
<database min-version="9.4">pgsql</database>
|
||||
<database>sqlite</database>
|
||||
<database min-version="8.0">mysql</database>
|
||||
<nextcloud min-version="27" max-version="27"/>
|
||||
<nextcloud min-version="25" max-version="25"/>
|
||||
</dependencies>
|
||||
<background-jobs>
|
||||
<job>OCA\Deck\Cron\DeleteCron</job>
|
||||
<job>OCA\Deck\Cron\ScheduledNotifications</job>
|
||||
<job>OCA\Deck\Cron\CardDescriptionActivity</job>
|
||||
<job>OCA\Deck\Cron\SessionsCleanup</job>
|
||||
</background-jobs>
|
||||
<repair-steps>
|
||||
<live-migration>
|
||||
<step>OCA\Deck\Migration\DeletedCircleCleanup</step>
|
||||
</live-migration>
|
||||
</repair-steps>
|
||||
<commands>
|
||||
<command>OCA\Deck\Command\UserExport</command>
|
||||
<command>OCA\Deck\Command\BoardImport</command>
|
||||
|
||||
@@ -40,7 +40,6 @@ return [
|
||||
['name' => 'board#deleteAcl', 'url' => '/boards/{boardId}/acl/{aclId}', 'verb' => 'DELETE'],
|
||||
['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'],
|
||||
|
||||
// stacks
|
||||
['name' => 'stack#index', 'url' => '/stacks/{boardId}', 'verb' => 'GET'],
|
||||
@@ -150,10 +149,5 @@ return [
|
||||
['name' => 'overview_api#upcomingCards', 'url' => '/api/v{apiVersion}/overview/upcoming', 'verb' => 'GET'],
|
||||
|
||||
['name' => 'search#search', 'url' => '/api/v{apiVersion}/search', 'verb' => 'GET'],
|
||||
|
||||
// sessions
|
||||
['name' => 'Session#create', 'url' => '/api/v{apiVersion}/session/create', 'verb' => 'PUT'],
|
||||
['name' => 'Session#sync', 'url' => '/api/v{apiVersion}/session/sync', 'verb' => 'POST'],
|
||||
['name' => 'Session#close', 'url' => '/api/v{apiVersion}/session/close', 'verb' => 'POST'],
|
||||
]
|
||||
];
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
"phpunit/phpunit": "^9",
|
||||
"nextcloud/coding-standard": "^1.0.0",
|
||||
"symfony/event-dispatcher": "^4.0",
|
||||
"vimeo/psalm": "^5.4",
|
||||
"vimeo/psalm": "^4.3",
|
||||
"php-parallel-lint/php-parallel-lint": "^1.2",
|
||||
"nextcloud/ocp": "dev-master"
|
||||
"nextcloud/ocp": "dev-stable25"
|
||||
},
|
||||
"config": {
|
||||
"optimize-autoloader": true,
|
||||
@@ -28,7 +28,7 @@
|
||||
"composer/package-versions-deprecated": true
|
||||
},
|
||||
"platform": {
|
||||
"php": "8.0"
|
||||
"php": "7.4"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
@@ -42,8 +42,8 @@
|
||||
"@test:unit",
|
||||
"@test:integration"
|
||||
],
|
||||
"test:unit": "vendor/bin/phpunit -c tests/phpunit.xml",
|
||||
"test:integration": "vendor/bin/phpunit -c tests/phpunit.integration.xml && cd tests/integration && ./run.sh"
|
||||
"test:unit": "phpunit -c tests/phpunit.xml",
|
||||
"test:integration": "phpunit -c tests/phpunit.integration.xml && cd tests/integration && ./run.sh"
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
|
||||
851
composer.lock
generated
851
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -1,16 +1,17 @@
|
||||
const { defineConfig } = require('cypress')
|
||||
|
||||
module.exports = defineConfig({
|
||||
projectId: '1s7wkc',
|
||||
viewportWidth: 1280,
|
||||
viewportHeight: 720,
|
||||
e2e: {
|
||||
// We've imported your old cypress plugins here.
|
||||
// You may want to clean this up later by importing these.
|
||||
setupNodeEvents(on, config) {
|
||||
return require('./cypress/plugins/index.js')(on, config)
|
||||
},
|
||||
baseUrl: 'http://nextcloud.local/index.php',
|
||||
specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx}',
|
||||
},
|
||||
projectId: '1s7wkc',
|
||||
viewportWidth: 1280,
|
||||
viewportHeight: 720,
|
||||
e2e: {
|
||||
// We've imported your old cypress plugins here.
|
||||
// You may want to clean this up later by importing these.
|
||||
setupNodeEvents(on, config) {
|
||||
return require('./cypress/plugins/index.js')(on, config)
|
||||
},
|
||||
baseUrl: 'http://nextcloud.local/index.php',
|
||||
experimentalSessionAndOrigin: true,
|
||||
specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx}',
|
||||
},
|
||||
})
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
module.exports = {
|
||||
extends: [
|
||||
'plugin:cypress/recommended',
|
||||
],
|
||||
}
|
||||
@@ -1,17 +1,15 @@
|
||||
import { randUser } from '../utils/index.js'
|
||||
const user = randUser()
|
||||
const recipient = randUser()
|
||||
import { randHash } from '../utils'
|
||||
const randUser = randHash()
|
||||
|
||||
describe('Board', function() {
|
||||
const password = 'pass123'
|
||||
|
||||
before(function() {
|
||||
cy.createUser(user)
|
||||
cy.createUser(recipient)
|
||||
cy.nextcloudCreateUser(randUser, password)
|
||||
})
|
||||
|
||||
beforeEach(function() {
|
||||
cy.login(user)
|
||||
cy.visit('/apps/deck')
|
||||
cy.login(randUser, password)
|
||||
})
|
||||
|
||||
it('Can create a board', function() {
|
||||
@@ -23,6 +21,7 @@ describe('Board', function() {
|
||||
}).as('createBoardRequest')
|
||||
|
||||
// Click "Add board"
|
||||
cy.openLeftSidebar()
|
||||
cy.get('#app-navigation-vue .app-navigation__list .app-navigation-entry')
|
||||
.eq(3).find('a').first().click({ force: true })
|
||||
|
||||
@@ -39,18 +38,4 @@ describe('Board', function() {
|
||||
cy.get('.app-navigation__list .app-navigation-entry__children .app-navigation-entry')
|
||||
.contains(board).should('be.visible')
|
||||
})
|
||||
|
||||
it('Shows and hides the navigation', () => {
|
||||
cy.get('#app-navigation-vue .app-navigation__list .app-navigation-entry')
|
||||
.contains('Upcoming cards')
|
||||
.should('be.visible')
|
||||
cy.openLeftSidebar()
|
||||
cy.get('#app-navigation-vue .app-navigation__list .app-navigation-entry')
|
||||
.contains('Upcoming cards')
|
||||
.should('not.be.visible')
|
||||
cy.openLeftSidebar()
|
||||
cy.get('#app-navigation-vue .app-navigation__list .app-navigation-entry')
|
||||
.contains('Upcoming cards')
|
||||
.should('be.visible')
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,47 +1,53 @@
|
||||
import { randUser } from '../utils/index.js'
|
||||
import { sampleBoard } from '../utils/sampleBoard'
|
||||
import { randHash } from '../utils'
|
||||
const randUser = randHash()
|
||||
|
||||
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)
|
||||
})
|
||||
const testBoardData = {
|
||||
title: 'MyBoardTest',
|
||||
color: '00ff00',
|
||||
stacks: [
|
||||
{
|
||||
title: 'TestList',
|
||||
cards: [
|
||||
{
|
||||
title: 'Hello world',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
describe('Card', function() {
|
||||
let boardId
|
||||
before(function() {
|
||||
cy.createUser(user)
|
||||
cy.login(user)
|
||||
cy.nextcloudCreateUser(randUser, randUser)
|
||||
cy.createExampleBoard({
|
||||
user,
|
||||
board: boardData,
|
||||
}).then((board) => {
|
||||
boardId = board.id
|
||||
user: randUser,
|
||||
password: randUser,
|
||||
board: testBoardData,
|
||||
})
|
||||
})
|
||||
|
||||
beforeEach(function() {
|
||||
cy.login(user)
|
||||
cy.login(randUser, randUser)
|
||||
})
|
||||
|
||||
it('Can show card details modal', function() {
|
||||
cy.openLeftSidebar()
|
||||
cy.getNavigationEntry(testBoardData.title)
|
||||
.first().click({ force: true })
|
||||
|
||||
cy.get('.board .stack').eq(0).within(() => {
|
||||
cy.get('.card:contains("Hello world")').should('be.visible').click()
|
||||
})
|
||||
|
||||
cy.get('.modal__card').should('be.visible')
|
||||
cy.get('.app-sidebar-header__maintitle').contains('Hello world')
|
||||
})
|
||||
|
||||
it('Can add a card', function() {
|
||||
cy.visit(`/apps/deck/#/board/${boardId}`)
|
||||
const newCardTitle = 'Write some cypress tests'
|
||||
|
||||
cy.getNavigationEntry(boardData.title)
|
||||
cy.openLeftSidebar()
|
||||
cy.getNavigationEntry(testBoardData.title)
|
||||
.first().click({ force: true })
|
||||
|
||||
cy.get('.board .stack').eq(0).within(() => {
|
||||
@@ -58,72 +64,4 @@ describe('Card', function() {
|
||||
})
|
||||
})
|
||||
|
||||
describe('Modal', () => {
|
||||
beforeEach(function() {
|
||||
cy.login(user)
|
||||
useModal(true).then(() => {
|
||||
cy.visit(`/apps/deck/#/board/${boardId}`)
|
||||
})
|
||||
})
|
||||
|
||||
it('Can show card details modal', function() {
|
||||
cy.getNavigationEntry(boardData.title)
|
||||
.first().click({ force: true })
|
||||
|
||||
cy.get('.board .stack').eq(0).within(() => {
|
||||
cy.get('.card:contains("Hello world")').should('be.visible').click()
|
||||
})
|
||||
|
||||
cy.get('.modal__card').should('be.visible')
|
||||
cy.get('.app-sidebar-header__maintitle').contains('Hello world')
|
||||
})
|
||||
|
||||
it('Attachment from files app', () => {
|
||||
cy.get('.card:contains("Hello world")').should('be.visible').click()
|
||||
cy.get('.modal__card').should('be.visible')
|
||||
cy.get('.app-sidebar-tabs__tab [data-id="attachments"]').click()
|
||||
cy.get('button.icon-upload').should('be.visible')
|
||||
cy.get('button.icon-folder').should('be.visible')
|
||||
.click()
|
||||
cy.get('.oc-dialog #picker-filestable tr[data-entryname="welcome.txt"] td.filename').should('be.visible')
|
||||
.click()
|
||||
cy.get('.oc-dialog button.primary').click()
|
||||
cy.get('.attachment-list .basename').contains('welcome.txt')
|
||||
})
|
||||
|
||||
it('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')
|
||||
cy.get('.app-sidebar-header__maintitle').contains('Hello world')
|
||||
cy.get('.modal__card .ProseMirror h1').contains('Hello world').should('be.visible')
|
||||
cy.get('.modal__card .ProseMirror h1')
|
||||
.click()
|
||||
.type(' writing more text{enter}- List item{enter}with entries{enter}{enter}Paragraph')
|
||||
cy.wait('@save', { timeout: 7000 })
|
||||
|
||||
cy.reload()
|
||||
cy.get('.modal__card').should('be.visible')
|
||||
cy.get('.modal__card .ProseMirror h1').contains('Hello world writing more text').should('be.visible')
|
||||
cy.get('.modal__card .ProseMirror li').eq(0).contains('List item').should('be.visible')
|
||||
cy.get('.modal__card .ProseMirror li').eq(1).contains('with entries').should('be.visible')
|
||||
cy.get('.modal__card .ProseMirror p').contains('Paragraph').should('be.visible')
|
||||
})
|
||||
})
|
||||
|
||||
describe('Sidebar', () => {
|
||||
beforeEach(function() {
|
||||
cy.login(user)
|
||||
useModal(false).then(() => {
|
||||
cy.visit(`/apps/deck/#/board/${boardId}`)
|
||||
})
|
||||
})
|
||||
|
||||
it('Show the sidebar', () => {
|
||||
cy.get('.card:contains("Hello world")').should('be.visible').click()
|
||||
cy.get('#app-sidebar-vue')
|
||||
.find('.ProseMirror h1').contains('Hello world writing more text').should('be.visible')
|
||||
})
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
@@ -1,25 +1,27 @@
|
||||
import { randUser } from '../utils/index.js'
|
||||
const user = randUser()
|
||||
import { randHash } from '../utils'
|
||||
const randUser = randHash()
|
||||
|
||||
describe('Deck dashboard', function() {
|
||||
const password = 'pass123'
|
||||
|
||||
before(function() {
|
||||
cy.createUser(user)
|
||||
cy.nextcloudCreateUser(randUser, password)
|
||||
})
|
||||
|
||||
beforeEach(function() {
|
||||
cy.login(user)
|
||||
cy.visit('/apps/deck')
|
||||
cy.login(randUser, password)
|
||||
})
|
||||
|
||||
it('Can show the right title on the dashboard', function() {
|
||||
cy.get('.board-title h2')
|
||||
.should('have.length', 1).first()
|
||||
.should('have.text', 'Upcoming cards')
|
||||
.should('have.length', 1).first()
|
||||
.should('have.text', 'Upcoming cards')
|
||||
})
|
||||
|
||||
it('Can see the default "Personal Board" created for user by default', function() {
|
||||
const defaultBoard = 'Personal'
|
||||
|
||||
cy.openLeftSidebar()
|
||||
cy.get('.app-navigation-entry-wrapper[icon=icon-deck]')
|
||||
.find('ul.app-navigation-entry__children .app-navigation-entry:contains(' + defaultBoard + ')')
|
||||
.first()
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
import { randUser } from '../utils/index.js'
|
||||
import { sampleBoard } from '../utils/sampleBoard'
|
||||
const user = randUser()
|
||||
const recipient = randUser()
|
||||
|
||||
describe('Board', function() {
|
||||
before(function() {
|
||||
cy.createUser(user)
|
||||
cy.createUser(recipient)
|
||||
})
|
||||
|
||||
beforeEach(function() {
|
||||
cy.login(user)
|
||||
})
|
||||
|
||||
it('Share a board to a user', function() {
|
||||
const board = sampleBoard('Read only board')
|
||||
cy.createExampleBoard({ user, board }).then((board) => {
|
||||
const boardId = board.id
|
||||
cy.visit(`/apps/deck/#/board/${boardId}`)
|
||||
cy.get('.board-title').contains(board.title)
|
||||
|
||||
cy.shareBoardWithUi(recipient.userId)
|
||||
|
||||
cy.login(recipient)
|
||||
cy.visit(`/apps/deck/#/board/${boardId}`)
|
||||
cy.get('.board-title').contains(board.title)
|
||||
cy.get('.button-vue[aria-label*="Add card"]')
|
||||
.should('not.exist')
|
||||
})
|
||||
})
|
||||
|
||||
it('Share a board to a user as writable', function() {
|
||||
const board = sampleBoard('Editable board')
|
||||
cy.createExampleBoard({ user, board }).then((board) => {
|
||||
const boardId = board.id
|
||||
cy.visit(`/apps/deck/#/board/${boardId}`)
|
||||
cy.get('.board-title').contains(board.title)
|
||||
|
||||
cy.shareBoardWithUi(recipient.userId)
|
||||
cy.get(`[data-cy="acl-participant:${recipient.userId}"]`).find('[data-cy="action:permission-edit"]').click()
|
||||
|
||||
cy.login(recipient)
|
||||
cy.visit(`/apps/deck/#/board/${boardId}`)
|
||||
cy.get('.board-title').contains(board.title)
|
||||
cy.get('.button-vue[aria-label*="Add card"]')
|
||||
.first().click()
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -1,68 +1,30 @@
|
||||
import { randUser } from '../utils/index.js'
|
||||
const user = randUser()
|
||||
|
||||
const boardTitle = 'TestBoard'
|
||||
const testBoardData = {
|
||||
title: boardTitle,
|
||||
stacks: [
|
||||
{ title: 'Existing Stack1' },
|
||||
{ title: 'Existing Stack2' },
|
||||
],
|
||||
}
|
||||
import { randHash } from '../utils'
|
||||
const randUser = randHash()
|
||||
|
||||
describe('Stack', function() {
|
||||
const board = 'TestBoard'
|
||||
const password = 'pass123'
|
||||
const stack = 'List 1'
|
||||
|
||||
before(function() {
|
||||
cy.createUser(user)
|
||||
cy.login(user)
|
||||
cy.createExampleBoard({
|
||||
user,
|
||||
board: testBoardData,
|
||||
})
|
||||
cy.nextcloudCreateUser(randUser, password)
|
||||
cy.deckCreateBoard({ user: randUser, password }, board)
|
||||
})
|
||||
|
||||
beforeEach(function() {
|
||||
cy.login(user)
|
||||
cy.visit('/apps/deck')
|
||||
|
||||
cy.openLeftSidebar()
|
||||
cy.getNavigationEntry(boardTitle)
|
||||
.click({ force: true })
|
||||
cy.logout()
|
||||
cy.login(randUser, password)
|
||||
})
|
||||
|
||||
it('Can create a stack', function() {
|
||||
cy.openLeftSidebar()
|
||||
cy.getNavigationEntry(board)
|
||||
.click({ force: true })
|
||||
|
||||
cy.get('#stack-add button').first().click()
|
||||
cy.focused().type('List 1')
|
||||
cy.get('#stack-add form input#new-stack-input-main').type(stack)
|
||||
cy.get('#stack-add form input[type=submit]').first().click()
|
||||
|
||||
cy.contains('List 1').should('be.visible')
|
||||
})
|
||||
|
||||
it('Can edit a stack title', function() {
|
||||
cy.contains('Existing Stack1')
|
||||
cy.get('[data-cy-stack="Existing Stack1"]').within(() => {
|
||||
cy.contains('Existing Stack1').click()
|
||||
cy.focused().type(' renamed')
|
||||
cy.get('[data-cy="editStackTitleForm"] input[type="submit"]').click()
|
||||
})
|
||||
cy.contains('Existing Stack1 renamed').should('be.visible')
|
||||
})
|
||||
|
||||
it('Can abort a stack title edit via esc', function() {
|
||||
cy.contains('Existing Stack2').click()
|
||||
cy.focused().type(' with a new title, maybe?')
|
||||
cy.focused().type('{esc}')
|
||||
|
||||
cy.contains('Existing Stack2').should('be.visible')
|
||||
cy.contains('Existing Stack2 with a new title, maybe?').should('not.exist')
|
||||
})
|
||||
|
||||
it('Can abort a stack title edit via click outside', function() {
|
||||
cy.contains('Existing Stack2').click()
|
||||
cy.focused().type(' with a new title, maybe?')
|
||||
cy.get('[data-cy-stack="Existing Stack2"]').click('bottom')
|
||||
|
||||
cy.contains('Existing Stack2').should('be.visible')
|
||||
cy.contains('Existing Stack2 with a new title, maybe?').should('not.exist')
|
||||
cy.get('.board .stack').eq(0).contains(stack).should('be.visible')
|
||||
})
|
||||
})
|
||||
|
||||
@@ -20,13 +20,61 @@
|
||||
*
|
||||
*/
|
||||
|
||||
import { addCommands } from '@nextcloud/cypress'
|
||||
|
||||
addCommands()
|
||||
|
||||
const url = Cypress.config('baseUrl').replace(/\/index.php\/?$/g, '')
|
||||
Cypress.env('baseUrl', url)
|
||||
|
||||
Cypress.Commands.add('login', (user, password, route = '/apps/deck/') => {
|
||||
const session = `${user}-${Date.now()}`
|
||||
cy.session(session, function() {
|
||||
cy.visit(route)
|
||||
cy.get('input[name=user]').type(user)
|
||||
cy.get('input[name=password]').type(password)
|
||||
cy.get('form[name=login] [type=submit]').click()
|
||||
cy.url().should('include', route)
|
||||
})
|
||||
cy.visit(route)
|
||||
})
|
||||
|
||||
Cypress.Commands.add('logout', (route = '/') => {
|
||||
cy.session('_guest', function() {})
|
||||
})
|
||||
|
||||
Cypress.Commands.add('nextcloudCreateUser', (user, password) => {
|
||||
cy.clearCookies()
|
||||
cy.request({
|
||||
method: 'POST',
|
||||
url: `${Cypress.env('baseUrl')}/ocs/v1.php/cloud/users?format=json`,
|
||||
form: true,
|
||||
body: {
|
||||
userid: user,
|
||||
password,
|
||||
},
|
||||
auth: { user: 'admin', pass: 'admin' },
|
||||
headers: {
|
||||
'OCS-ApiRequest': 'true',
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
},
|
||||
}).then((response) => {
|
||||
cy.log(`Created user ${user}`, response.status)
|
||||
})
|
||||
})
|
||||
|
||||
Cypress.Commands.add('nextcloudUpdateUser', (user, password, key, value) => {
|
||||
cy.request({
|
||||
method: 'PUT',
|
||||
url: `${Cypress.env('baseUrl')}/ocs/v2.php/cloud/users/${user}`,
|
||||
form: true,
|
||||
body: { key, value },
|
||||
auth: { user, pass: password },
|
||||
headers: {
|
||||
'OCS-ApiRequest': 'true',
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
},
|
||||
}).then((response) => {
|
||||
cy.log(`Updated user ${user} ${key} to ${value}`, response.status)
|
||||
})
|
||||
})
|
||||
|
||||
Cypress.Commands.add('openLeftSidebar', () => {
|
||||
cy.get('.app-navigation button.app-navigation-toggle').click()
|
||||
})
|
||||
@@ -63,15 +111,14 @@ Cypress.Commands.add('deckCreateList', ({ user, password }, title) => {
|
||||
cy.get('#stack-add form input[type=submit]').first().click()
|
||||
})
|
||||
|
||||
Cypress.Commands.add('createExampleBoard', ({ user, board }) => {
|
||||
const auth = {
|
||||
user: user.userId,
|
||||
password: user.password,
|
||||
}
|
||||
Cypress.Commands.add('createExampleBoard', ({ user, password, board }) => {
|
||||
cy.request({
|
||||
method: 'POST',
|
||||
url: `${Cypress.env('baseUrl')}/index.php/apps/deck/api/v1.0/boards`,
|
||||
auth,
|
||||
auth: {
|
||||
user,
|
||||
password,
|
||||
},
|
||||
body: { title: board.title, color: board.color ?? 'ff0000' },
|
||||
}).then((boardResponse) => {
|
||||
expect(boardResponse.status).to.eq(200)
|
||||
@@ -81,7 +128,10 @@ Cypress.Commands.add('createExampleBoard', ({ user, board }) => {
|
||||
cy.request({
|
||||
method: 'POST',
|
||||
url: `${Cypress.env('baseUrl')}/index.php/apps/deck/api/v1.0/boards/${boardData.id}/stacks`,
|
||||
auth,
|
||||
auth: {
|
||||
user,
|
||||
password,
|
||||
},
|
||||
body: { title: stack.title, order: 0 },
|
||||
}).then((stackResponse) => {
|
||||
const stackData = stackResponse.body
|
||||
@@ -90,13 +140,15 @@ Cypress.Commands.add('createExampleBoard', ({ user, board }) => {
|
||||
cy.request({
|
||||
method: 'POST',
|
||||
url: `${Cypress.env('baseUrl')}/index.php/apps/deck/api/v1.0/boards/${boardData.id}/stacks/${stackData.id}/cards`,
|
||||
auth,
|
||||
body: { title: card.title, description: card.description ?? '' },
|
||||
auth: {
|
||||
user,
|
||||
password,
|
||||
},
|
||||
body: { title: card.title },
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
cy.wrap(boardData)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -105,13 +157,3 @@ Cypress.Commands.add('getNavigationEntry', (boardTitle) => {
|
||||
.find('ul.app-navigation-entry__children .app-navigation-entry:contains(' + boardTitle + ')')
|
||||
.find('a.app-navigation-entry-link')
|
||||
})
|
||||
|
||||
Cypress.Commands.add('shareBoardWithUi', (userId) => {
|
||||
cy.get('[aria-label="Open details"]').click()
|
||||
cy.get('.app-sidebar').should('be.visible')
|
||||
cy.get('.multiselect__input').type(`${userId}`)
|
||||
cy.get('.multiselect__content .multiselect__element').first().contains(userId)
|
||||
cy.get('.multiselect__input').type('{enter}')
|
||||
|
||||
cy.get('.shareWithList').contains(userId)
|
||||
})
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<title>Components App</title>
|
||||
</head>
|
||||
<body>
|
||||
<div data-cy-root></div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,27 +0,0 @@
|
||||
// ***********************************************************
|
||||
// This example support/component.js is processed and
|
||||
// loaded automatically before your test files.
|
||||
//
|
||||
// This is a great place to put global configuration and
|
||||
// behavior that modifies Cypress.
|
||||
//
|
||||
// You can change the location of this file or turn off
|
||||
// automatically serving support files with the
|
||||
// 'supportFile' configuration option.
|
||||
//
|
||||
// You can read more here:
|
||||
// https://on.cypress.io/configuration
|
||||
// ***********************************************************
|
||||
|
||||
// Import commands.js using ES2015 syntax:
|
||||
import './commands'
|
||||
|
||||
// Alternatively you can use CommonJS syntax:
|
||||
// require('./commands')
|
||||
|
||||
import { mount } from 'cypress/vue2'
|
||||
|
||||
Cypress.Commands.add('mount', mount)
|
||||
|
||||
// Example use:
|
||||
// cy.mount(MyComponent)
|
||||
@@ -14,7 +14,7 @@
|
||||
// ***********************************************************
|
||||
|
||||
// Import commands.js using ES2015 syntax:
|
||||
import './commands.js'
|
||||
import './commands'
|
||||
|
||||
// Alternatively you can use CommonJS syntax:
|
||||
// require('./commands')
|
||||
|
||||
@@ -1,4 +1 @@
|
||||
import { User } from '@nextcloud/cypress'
|
||||
|
||||
export const randHash = () => Math.random().toString(36).replace(/[^a-z]+/g, '').slice(0, 10)
|
||||
export const randUser = () => new User(randHash(), randHash())
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
/*
|
||||
* @copyright Copyright (c) 2022 Julius Härtl <jus@bitgrid.net>
|
||||
*
|
||||
* @author Julius Härtl <jus@bitgrid.net>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
export const sampleBoard = (title = 'MyTestBoard') => {
|
||||
return {
|
||||
title: title,
|
||||
color: '00ff00',
|
||||
stacks: [
|
||||
{
|
||||
title: 'TestList',
|
||||
cards: [
|
||||
{
|
||||
title: 'Hello world',
|
||||
description: '# Hello world',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
}
|
||||
110
docs/API.md
110
docs/API.md
@@ -1066,7 +1066,6 @@ Deck stores user and app configuration values globally and per board. The GET en
|
||||
| --- | --- |
|
||||
| calendar | Determines if the calendar/tasks integration through the CalDAV backend is enabled for the user (boolean) |
|
||||
| cardDetailsInModal | Determines if the bigger view is used (boolean) |
|
||||
| cardIdBadge | Determines if the ID badges are displayed on cards (boolean) |
|
||||
| groupLimit | Determines if creating new boards is limited to certain groups of the instance. The resulting output is an array of group objects with the id and the displayname (Admin only)|
|
||||
|
||||
```
|
||||
@@ -1080,7 +1079,6 @@ Deck stores user and app configuration values globally and per board. The GET en
|
||||
"data": {
|
||||
"calendar": true,
|
||||
"cardDetailsInModal": true,
|
||||
"cardIdBadge": true,
|
||||
"groupLimit": [
|
||||
{
|
||||
"id": "admin",
|
||||
@@ -1111,7 +1109,6 @@ Deck stores user and app configuration values globally and per board. The GET en
|
||||
| notify-due | `off`, `assigned` or `all` |
|
||||
| calendar | Boolean |
|
||||
| cardDetailsInModal | Boolean |
|
||||
| cardIdBadge | Boolean |
|
||||
|
||||
#### Example request
|
||||
|
||||
@@ -1394,110 +1391,3 @@ A bad request response is returned if invalid input values are provided. The res
|
||||
A not found response might be returned if:
|
||||
- The card for the given cardId could not be found
|
||||
- The comment could not be found
|
||||
|
||||
|
||||
## Sessions
|
||||
|
||||
### PUT /session/create - creates a new session
|
||||
|
||||
#### Request parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ------- | ---------------------------------------------------- |
|
||||
| boardId | Integer | The id of the opened board |
|
||||
|
||||
```
|
||||
curl -X PUT 'https://admin:admin@nextcloud/ocs/v2.php/apps/deck/api/v1.0/session/create' \
|
||||
-H 'Accept: application/json' -H 'OCS-APIRequest: true' \
|
||||
-H 'Content-Type: application/json;charset=utf-8' \
|
||||
--data '{"boardId":1}'
|
||||
```
|
||||
|
||||
#### Response
|
||||
|
||||
##### 200 Success
|
||||
|
||||
```json
|
||||
{
|
||||
"ocs": {
|
||||
"meta": {
|
||||
"status": "ok",
|
||||
"statuscode": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"data": {
|
||||
"token": "+zcJHf4rC6dobVSbuNa3delkCSfTW8OvYWTyLFvSpIv80FjtgLIj0ARlxspsazNQ"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### POST /session/sync - notifies the server, that the session is still open
|
||||
|
||||
#### Request body
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ------- | ---------------------------------------------------- |
|
||||
| boardId | Integer | The id of the opened board |
|
||||
| token | String | The session token from the /sessions/create response |
|
||||
|
||||
|
||||
```
|
||||
curl -X POST 'https://admin:admin@nextcloud/ocs/v2.php/apps/deck/api/v1.0/session/create' \
|
||||
-H 'Accept: application/json' -H 'OCS-APIRequest: true' \
|
||||
-H 'Content-Type: application/json;charset=utf-8' \
|
||||
--data '{"boardId":1, "token":"X3DyyoFslArF0t0NBZXzZXzcy8feoX/OEytSNXZtPg9TpUgO5wrkJ38IW3T/FfpV"}'
|
||||
```
|
||||
|
||||
#### Response
|
||||
|
||||
##### 200 Success
|
||||
```json
|
||||
{
|
||||
"ocs": {
|
||||
"meta": {
|
||||
"status": "ok",
|
||||
"statuscode": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"data": []
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
##### 404 Not Found
|
||||
the provided token is invalid or expired
|
||||
|
||||
|
||||
### POST /session/close - closes the session
|
||||
|
||||
#### Request body
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ------- | ---------------------------------------------------- |
|
||||
| boardId | Integer | The id of the opened board |
|
||||
| token | String | The session token from the /sessions/create response |
|
||||
|
||||
```
|
||||
curl -X POST 'https://admin:admin@nextcloud/ocs/v2.php/apps/deck/api/v1.0/session/close' \
|
||||
-H 'Accept: application/json' -H 'OCS-APIRequest: true' \
|
||||
-H 'Content-Type: application/json;charset=utf-8' \
|
||||
--data '{"boardId":1, "token":"X3DyyoFslArF0t0NBZXzZXzcy8feoX/OEytSNXZtPg9TpUgO5wrkJ38IW3T/FfpV"}'
|
||||
```
|
||||
|
||||
#### Response
|
||||
|
||||
##### 200 Success
|
||||
```json
|
||||
{
|
||||
"ocs": {
|
||||
"meta": {
|
||||
"status": "ok",
|
||||
"statuscode": 200,
|
||||
"message": "OK"
|
||||
},
|
||||
"data": []
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -90,7 +90,7 @@ Steps:
|
||||
* 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 import `Trello JSON`
|
||||
Create the configuration file respecting the [JSON Schema](https://github.com/nextcloud/deck/blob/master/lib/Service/Importer/fixtures/config-trelloJson-schema.json) for import `Trello JSON`
|
||||
|
||||
Example configuration file:
|
||||
```json
|
||||
@@ -120,7 +120,7 @@ https://api.trello.com/1/members/me/boards?key={yourKey}&token={yourToken}&field
|
||||
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`
|
||||
Create the configuration file respecting the [JSON Schema](https://github.com/nextcloud/deck/blob/master/lib/Service/Importer/fixtures/config-trelloApi-schema.json) for import `Trello JSON`
|
||||
|
||||
Example configuration file:
|
||||
```json
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" style="height: 240px; width: 240px;" viewBox="0 0 24 24">
|
||||
<path fill="currentColor" d="M12,15H10V13H12V15M18,15H14V13H18V15M8,11H6V9H8V11M18,11H10V9H18V11M20,20H4A2,2 0 0,1 2,18V6A2,2 0 0,1 4,4H20A2,2 0 0,1 22,6V18A2,2 0 0,1 20,20M4,6V18H20V6H4Z" />
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 298 B |
@@ -175,7 +175,6 @@ OC.L10N.register(
|
||||
"Owner" : "Proprietario",
|
||||
"Delete" : "Elimina",
|
||||
"Failed to create share with {displayName}" : "Creazione della condivisione con {displayName} non riuscita",
|
||||
"Transfer the board." : "Trasferisci la bacheca.",
|
||||
"Transfer" : "Trasferisci",
|
||||
"Archive all cards" : "Archivia tutte le schede",
|
||||
"Delete list" : "Elimina elenco",
|
||||
@@ -291,8 +290,6 @@ OC.L10N.register(
|
||||
"Share with a Deck card" : "Condividi con una scheda di Deck",
|
||||
"Share {file} with a Deck card" : "Condividi {file} con una scheda di Deck",
|
||||
"Share" : "Condividi",
|
||||
"Transfer the board for {user} successfully" : "Trasferimento della bacheca per {user} avvenuta con successo.",
|
||||
"Failed to transfer the board for {user}" : "Trasferimento della bacheca per {user} fallito",
|
||||
"Add a new list" : "Aggiungi un nuovo elenco",
|
||||
"Are you sure you want to delete the board {title}? This will delete all the data of this board." : "Sei sicuro di voler eliminare la lavagna {title}? Questo eliminerà tutti i dati di questa lavagna?"
|
||||
},
|
||||
|
||||
@@ -173,7 +173,6 @@
|
||||
"Owner" : "Proprietario",
|
||||
"Delete" : "Elimina",
|
||||
"Failed to create share with {displayName}" : "Creazione della condivisione con {displayName} non riuscita",
|
||||
"Transfer the board." : "Trasferisci la bacheca.",
|
||||
"Transfer" : "Trasferisci",
|
||||
"Archive all cards" : "Archivia tutte le schede",
|
||||
"Delete list" : "Elimina elenco",
|
||||
@@ -289,8 +288,6 @@
|
||||
"Share with a Deck card" : "Condividi con una scheda di Deck",
|
||||
"Share {file} with a Deck card" : "Condividi {file} con una scheda di Deck",
|
||||
"Share" : "Condividi",
|
||||
"Transfer the board for {user} successfully" : "Trasferimento della bacheca per {user} avvenuta con successo.",
|
||||
"Failed to transfer the board for {user}" : "Trasferimento della bacheca per {user} fallito",
|
||||
"Add a new list" : "Aggiungi un nuovo elenco",
|
||||
"Are you sure you want to delete the board {title}? This will delete all the data of this board." : "Sei sicuro di voler eliminare la lavagna {title}? Questo eliminerà tutti i dati di questa lavagna?"
|
||||
},"pluralForm" :"nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;"
|
||||
|
||||
@@ -128,7 +128,7 @@ OC.L10N.register(
|
||||
"Create card" : "Kart ekle",
|
||||
"Select a card" : "Bir kart seçin",
|
||||
"Select the card to link to a project" : "Bir proje ile ilişkilendirilecek kart bağlantısını seçin",
|
||||
"Link to card" : "Kart bağlantısı",
|
||||
"Link to card" : "Kart ile ilişkilendir",
|
||||
"File already exists" : "Dosya zaten var",
|
||||
"A file with the name {filename} already exists." : "{filename} adlı bir dosya zaten var.",
|
||||
"Do you want to overwrite it?" : "Üzerine yazmak ister misiniz?",
|
||||
@@ -305,8 +305,8 @@ OC.L10N.register(
|
||||
"upcoming cards" : "yaklaşan kartlar",
|
||||
"New card" : "Kart ekle",
|
||||
"Due on {date}" : "{date} tarihinde bitecek",
|
||||
"Link to a board" : "Bir pano bağlantısı",
|
||||
"Link to a card" : "Bir kart bağlantısı",
|
||||
"Link to a board" : "Bir pano ile ilişkilendir",
|
||||
"Link to a card" : "Bir kart ile ilişkilendir",
|
||||
"Create a card" : "Bir kart ekle",
|
||||
"Message from {author} in {conversationName}" : "{conversationName} görüşmesinde {author} iletisi",
|
||||
"Something went wrong" : "Bir şeyler ters gitti",
|
||||
|
||||
@@ -126,7 +126,7 @@
|
||||
"Create card" : "Kart ekle",
|
||||
"Select a card" : "Bir kart seçin",
|
||||
"Select the card to link to a project" : "Bir proje ile ilişkilendirilecek kart bağlantısını seçin",
|
||||
"Link to card" : "Kart bağlantısı",
|
||||
"Link to card" : "Kart ile ilişkilendir",
|
||||
"File already exists" : "Dosya zaten var",
|
||||
"A file with the name {filename} already exists." : "{filename} adlı bir dosya zaten var.",
|
||||
"Do you want to overwrite it?" : "Üzerine yazmak ister misiniz?",
|
||||
@@ -303,8 +303,8 @@
|
||||
"upcoming cards" : "yaklaşan kartlar",
|
||||
"New card" : "Kart ekle",
|
||||
"Due on {date}" : "{date} tarihinde bitecek",
|
||||
"Link to a board" : "Bir pano bağlantısı",
|
||||
"Link to a card" : "Bir kart bağlantısı",
|
||||
"Link to a board" : "Bir pano ile ilişkilendir",
|
||||
"Link to a card" : "Bir kart ile ilişkilendir",
|
||||
"Create a card" : "Bir kart ekle",
|
||||
"Message from {author} in {conversationName}" : "{conversationName} görüşmesinde {author} iletisi",
|
||||
"Something went wrong" : "Bir şeyler ters gitti",
|
||||
|
||||
17
l10n/uk.js
17
l10n/uk.js
@@ -34,7 +34,6 @@ OC.L10N.register(
|
||||
"You have updated the description of card {card} in list {stack} on board {board}" : "Ви оновили опис картки {card} у списку {stack} на дошці {board}",
|
||||
"Deck" : "Колода",
|
||||
"Changes in the <strong>Deck app</strong>" : "Зміни у застосунку <strong>Колода</strong>",
|
||||
"Upcoming cards" : "Очікують на виконання",
|
||||
"Load more" : "Більше",
|
||||
"Personal" : "Особисте",
|
||||
"Deck board" : "Дошка Deck",
|
||||
@@ -65,10 +64,8 @@ OC.L10N.register(
|
||||
"Select the board to link to a project" : "Виберіть дошку для прив'зки до проєкту",
|
||||
"Search by board title" : "Шукати за назвою дошки",
|
||||
"Select board" : "Вибрати дошку",
|
||||
"Create a new card" : "Створити нову картку",
|
||||
"Select a board" : "Вибрати дошку",
|
||||
"Select a list" : "Виберіть список",
|
||||
"Card title" : "Заголовок картки",
|
||||
"Cancel" : "Скасувати",
|
||||
"Close" : "закрити",
|
||||
"Select a card" : "Вибрати картку",
|
||||
@@ -100,7 +97,6 @@ OC.L10N.register(
|
||||
"Toggle compact mode" : "Перемкнути компактний вигляд",
|
||||
"Details" : "Деталі",
|
||||
"Loading board" : "Завантаження дошки",
|
||||
"Create a new list to add cards to this board" : "Створіть список щоб додати картки на цю дошку",
|
||||
"Board not found" : "Дошку не знайдено",
|
||||
"Sharing" : "Поділитися",
|
||||
"Tags" : "Теги",
|
||||
@@ -124,7 +120,6 @@ OC.L10N.register(
|
||||
"Edit" : "Редагувати",
|
||||
"Add a new tag" : "Додати нову позначку",
|
||||
"title and color value must be provided" : "потрібно зазначити назву та колір",
|
||||
"Board name" : "Назва дошки",
|
||||
"Members" : "Учасники",
|
||||
"Upload new files" : "Додати файл",
|
||||
"Share from Files" : "Відкрити Файли",
|
||||
@@ -138,7 +133,6 @@ OC.L10N.register(
|
||||
"Comments" : "Коментарі",
|
||||
"Modified" : "Змінено",
|
||||
"Created" : "Створено",
|
||||
"No comments yet. Begin the discussion!" : "Коментарів немає, почніть обговорення!",
|
||||
"Assign a tag to this card…" : "Додати позначку до цієї картки",
|
||||
"Assign to users" : "Призначити користувачам",
|
||||
"Assign to users/groups/circles" : "Призначити користувачам/групам/колам",
|
||||
@@ -163,11 +157,9 @@ OC.L10N.register(
|
||||
"Edit description" : "Редагувати опис",
|
||||
"View description" : "Переглянути опис",
|
||||
"Add Attachment" : "Долучити вкладення",
|
||||
"Write a description …" : "Додайте опис ...",
|
||||
"Choose attachment" : "Вибрати вкладення",
|
||||
"(group)" : "(група)",
|
||||
"Todo items" : "Пункти завдань",
|
||||
"Edit card title" : "Редагувати заголовок картки",
|
||||
"Assign to me" : "Призначити мені",
|
||||
"Move card" : "Пересунути картку",
|
||||
"Card details" : "Деталі картки",
|
||||
@@ -179,19 +171,13 @@ OC.L10N.register(
|
||||
"All boards" : "Усі дошки",
|
||||
"Archived boards" : "Архівні дошки",
|
||||
"Shared with you" : "Вам надано доступ",
|
||||
"Deck settings" : "Налаштування колоди",
|
||||
"Use bigger card view" : "Режим перегляду зі збільшеними картками",
|
||||
"Show boards in calendar/tasks" : "Показувати дошки в календарі та завданнях",
|
||||
"Limit deck usage of groups" : "Обмежити доступ до колоди для груп",
|
||||
"Limiting Deck will block users not part of those groups from creating their own boards. Users will still be able to work on boards that have been shared with them." : "Створення власних робочих дощок користувачам, які не входять у задані групи, буде заблоковано. Проте, такі користувачі зможуть продовжити працювати зі спільними дошками, до яких у них є доступ.",
|
||||
"Board details" : "Деталі дошки",
|
||||
"Edit board" : "Редагувати дошку",
|
||||
"Clone board" : "Копіювати дошку",
|
||||
"Unarchive board" : "Розархівувати дошку",
|
||||
"Archive board" : "Архівувати дошку",
|
||||
"Turn on due date reminders" : "Нагадування про термін виконання",
|
||||
"Turn off due date reminders" : "Вимкнути нагадування про терміни виконання",
|
||||
"Due date reminders" : "Нагадування про терміни виконання",
|
||||
"No notifications" : "Немає сповіщень",
|
||||
"Delete board" : "Вилучити дошку",
|
||||
"Board {0} deleted" : "Дошку {0} вилучено",
|
||||
@@ -199,9 +185,6 @@ OC.L10N.register(
|
||||
"An error occurred" : "Виникла помилка",
|
||||
"Are you sure you want to delete the board {title}? This will delete all the data of this board including archived cards." : "Ви впевнені, що хочете вилучити дошку {title}? Це призведе до видалення всіх даних цієї дошки, включаючи архівні картки.",
|
||||
"Delete the board?" : "Вилучити дошку?",
|
||||
"No due" : "Без призначеної дати",
|
||||
"No upcoming cards" : "Немає майбутніх завдань",
|
||||
"upcoming cards" : "очікують на виконання",
|
||||
"Due on {date}" : "До {date}",
|
||||
"Link to a board" : "Прив'язати до дошки",
|
||||
"Link to a card" : "Прив'язати до картки",
|
||||
|
||||
17
l10n/uk.json
17
l10n/uk.json
@@ -32,7 +32,6 @@
|
||||
"You have updated the description of card {card} in list {stack} on board {board}" : "Ви оновили опис картки {card} у списку {stack} на дошці {board}",
|
||||
"Deck" : "Колода",
|
||||
"Changes in the <strong>Deck app</strong>" : "Зміни у застосунку <strong>Колода</strong>",
|
||||
"Upcoming cards" : "Очікують на виконання",
|
||||
"Load more" : "Більше",
|
||||
"Personal" : "Особисте",
|
||||
"Deck board" : "Дошка Deck",
|
||||
@@ -63,10 +62,8 @@
|
||||
"Select the board to link to a project" : "Виберіть дошку для прив'зки до проєкту",
|
||||
"Search by board title" : "Шукати за назвою дошки",
|
||||
"Select board" : "Вибрати дошку",
|
||||
"Create a new card" : "Створити нову картку",
|
||||
"Select a board" : "Вибрати дошку",
|
||||
"Select a list" : "Виберіть список",
|
||||
"Card title" : "Заголовок картки",
|
||||
"Cancel" : "Скасувати",
|
||||
"Close" : "закрити",
|
||||
"Select a card" : "Вибрати картку",
|
||||
@@ -98,7 +95,6 @@
|
||||
"Toggle compact mode" : "Перемкнути компактний вигляд",
|
||||
"Details" : "Деталі",
|
||||
"Loading board" : "Завантаження дошки",
|
||||
"Create a new list to add cards to this board" : "Створіть список щоб додати картки на цю дошку",
|
||||
"Board not found" : "Дошку не знайдено",
|
||||
"Sharing" : "Поділитися",
|
||||
"Tags" : "Теги",
|
||||
@@ -122,7 +118,6 @@
|
||||
"Edit" : "Редагувати",
|
||||
"Add a new tag" : "Додати нову позначку",
|
||||
"title and color value must be provided" : "потрібно зазначити назву та колір",
|
||||
"Board name" : "Назва дошки",
|
||||
"Members" : "Учасники",
|
||||
"Upload new files" : "Додати файл",
|
||||
"Share from Files" : "Відкрити Файли",
|
||||
@@ -136,7 +131,6 @@
|
||||
"Comments" : "Коментарі",
|
||||
"Modified" : "Змінено",
|
||||
"Created" : "Створено",
|
||||
"No comments yet. Begin the discussion!" : "Коментарів немає, почніть обговорення!",
|
||||
"Assign a tag to this card…" : "Додати позначку до цієї картки",
|
||||
"Assign to users" : "Призначити користувачам",
|
||||
"Assign to users/groups/circles" : "Призначити користувачам/групам/колам",
|
||||
@@ -161,11 +155,9 @@
|
||||
"Edit description" : "Редагувати опис",
|
||||
"View description" : "Переглянути опис",
|
||||
"Add Attachment" : "Долучити вкладення",
|
||||
"Write a description …" : "Додайте опис ...",
|
||||
"Choose attachment" : "Вибрати вкладення",
|
||||
"(group)" : "(група)",
|
||||
"Todo items" : "Пункти завдань",
|
||||
"Edit card title" : "Редагувати заголовок картки",
|
||||
"Assign to me" : "Призначити мені",
|
||||
"Move card" : "Пересунути картку",
|
||||
"Card details" : "Деталі картки",
|
||||
@@ -177,19 +169,13 @@
|
||||
"All boards" : "Усі дошки",
|
||||
"Archived boards" : "Архівні дошки",
|
||||
"Shared with you" : "Вам надано доступ",
|
||||
"Deck settings" : "Налаштування колоди",
|
||||
"Use bigger card view" : "Режим перегляду зі збільшеними картками",
|
||||
"Show boards in calendar/tasks" : "Показувати дошки в календарі та завданнях",
|
||||
"Limit deck usage of groups" : "Обмежити доступ до колоди для груп",
|
||||
"Limiting Deck will block users not part of those groups from creating their own boards. Users will still be able to work on boards that have been shared with them." : "Створення власних робочих дощок користувачам, які не входять у задані групи, буде заблоковано. Проте, такі користувачі зможуть продовжити працювати зі спільними дошками, до яких у них є доступ.",
|
||||
"Board details" : "Деталі дошки",
|
||||
"Edit board" : "Редагувати дошку",
|
||||
"Clone board" : "Копіювати дошку",
|
||||
"Unarchive board" : "Розархівувати дошку",
|
||||
"Archive board" : "Архівувати дошку",
|
||||
"Turn on due date reminders" : "Нагадування про термін виконання",
|
||||
"Turn off due date reminders" : "Вимкнути нагадування про терміни виконання",
|
||||
"Due date reminders" : "Нагадування про терміни виконання",
|
||||
"No notifications" : "Немає сповіщень",
|
||||
"Delete board" : "Вилучити дошку",
|
||||
"Board {0} deleted" : "Дошку {0} вилучено",
|
||||
@@ -197,9 +183,6 @@
|
||||
"An error occurred" : "Виникла помилка",
|
||||
"Are you sure you want to delete the board {title}? This will delete all the data of this board including archived cards." : "Ви впевнені, що хочете вилучити дошку {title}? Це призведе до видалення всіх даних цієї дошки, включаючи архівні картки.",
|
||||
"Delete the board?" : "Вилучити дошку?",
|
||||
"No due" : "Без призначеної дати",
|
||||
"No upcoming cards" : "Немає майбутніх завдань",
|
||||
"upcoming cards" : "очікують на виконання",
|
||||
"Due on {date}" : "До {date}",
|
||||
"Link to a board" : "Прив'язати до дошки",
|
||||
"Link to a card" : "Прив'язати до картки",
|
||||
|
||||
@@ -325,6 +325,7 @@ class ActivityManager {
|
||||
*/
|
||||
$eventType = 'deck';
|
||||
$subjectParams = [];
|
||||
$message = null;
|
||||
switch ($subject) {
|
||||
// No need to enhance parameters since entity already contains the required data
|
||||
case self::SUBJECT_BOARD_CREATE:
|
||||
@@ -433,6 +434,10 @@ class ActivityManager {
|
||||
->setSubject($subject, $subjectParams)
|
||||
->setTimestamp(time());
|
||||
|
||||
if ($message !== null) {
|
||||
$event->setMessage($message);
|
||||
}
|
||||
|
||||
// FIXME: We currently require activities for comments even if they are disabled though settings
|
||||
// Get rid of this once the frontend fetches comments/activity individually
|
||||
if ($eventType === 'deck_comment') {
|
||||
|
||||
@@ -77,7 +77,7 @@ class DeckProvider implements IProvider {
|
||||
* @throws \InvalidArgumentException Should be thrown if your provider does not know this event
|
||||
* @since 11.0.0
|
||||
*/
|
||||
public function parse($language, IEvent $event, IEvent $previousEvent = null): IEvent {
|
||||
public function parse($language, IEvent $event, IEvent $previousEvent = null) {
|
||||
if ($event->getApp() !== 'deck') {
|
||||
throw new \InvalidArgumentException();
|
||||
}
|
||||
@@ -186,28 +186,28 @@ class DeckProvider implements IProvider {
|
||||
|
||||
private function getIcon(IEvent $event) {
|
||||
$event->setIcon($this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('deck', 'deck-dark.svg')));
|
||||
if (str_contains($event->getSubject(), '_update')) {
|
||||
if (strpos($event->getSubject(), '_update') !== false) {
|
||||
$event->setIcon($this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('files', 'change.svg')));
|
||||
}
|
||||
if (str_contains($event->getSubject(), '_create')) {
|
||||
if (strpos($event->getSubject(), '_create') !== false) {
|
||||
$event->setIcon($this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('files', 'add-color.svg')));
|
||||
}
|
||||
if (str_contains($event->getSubject(), '_delete')) {
|
||||
if (strpos($event->getSubject(), '_delete') !== false) {
|
||||
$event->setIcon($this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('files', 'delete-color.svg')));
|
||||
}
|
||||
if (str_contains($event->getSubject(), 'archive')) {
|
||||
if (strpos($event->getSubject(), 'archive') !== false) {
|
||||
$event->setIcon($this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('deck', 'archive.svg')));
|
||||
}
|
||||
if (str_contains($event->getSubject(), '_restore')) {
|
||||
if (strpos($event->getSubject(), '_restore') !== false) {
|
||||
$event->setIcon($this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'actions/history.svg')));
|
||||
}
|
||||
if (str_contains($event->getSubject(), 'attachment_')) {
|
||||
if (strpos($event->getSubject(), 'attachment_') !== false) {
|
||||
$event->setIcon($this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'places/files.svg')));
|
||||
}
|
||||
if (str_contains($event->getSubject(), 'comment_')) {
|
||||
if (strpos($event->getSubject(), 'comment_') !== false) {
|
||||
$event->setIcon($this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'actions/comment.svg')));
|
||||
}
|
||||
if (str_contains($event->getSubject(), 'label_')) {
|
||||
if (strpos($event->getSubject(), 'label_') !== false) {
|
||||
$event->setIcon($this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'actions/tag.svg')));
|
||||
}
|
||||
return $event;
|
||||
@@ -294,7 +294,7 @@ class DeckProvider implements IProvider {
|
||||
if (array_key_exists('comment', $subjectParams)) {
|
||||
/** @var IComment $comment */
|
||||
try {
|
||||
$comment = $this->commentsManager->get($subjectParams['comment']);
|
||||
$comment = $this->commentsManager->get((int)$subjectParams['comment']);
|
||||
$event->setParsedMessage($comment->getMessage());
|
||||
$params['comment'] = [
|
||||
'type' => 'highlight',
|
||||
|
||||
@@ -29,7 +29,7 @@ class DescriptionSetting extends Setting {
|
||||
* @return string Lowercase a-z and underscore only identifier
|
||||
* @since 11.0.0
|
||||
*/
|
||||
public function getIdentifier(): string {
|
||||
public function getIdentifier() {
|
||||
return 'deck_card_description';
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ class DescriptionSetting extends Setting {
|
||||
* @return string A translated string
|
||||
* @since 11.0.0
|
||||
*/
|
||||
public function getName(): string {
|
||||
public function getName() {
|
||||
return $this->l->t('A <strong>card description</strong> inside the Deck app has been changed');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ class Filter implements \OCP\Activity\IFilter {
|
||||
* @return string Lowercase a-z and underscore only identifier
|
||||
* @since 11.0.0
|
||||
*/
|
||||
public function getIdentifier(): string {
|
||||
public function getIdentifier() {
|
||||
return 'deck';
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ class Filter implements \OCP\Activity\IFilter {
|
||||
* @return string A translated string
|
||||
* @since 11.0.0
|
||||
*/
|
||||
public function getName(): string {
|
||||
public function getName() {
|
||||
return $this->l10n->t('Deck');
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ class Filter implements \OCP\Activity\IFilter {
|
||||
* priority values. It is required to return a value between 0 and 100.
|
||||
* @since 11.0.0
|
||||
*/
|
||||
public function getPriority(): int {
|
||||
public function getPriority() {
|
||||
return 90;
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ class Filter implements \OCP\Activity\IFilter {
|
||||
* @return string Full URL to an icon, empty string when none is given
|
||||
* @since 11.0.0
|
||||
*/
|
||||
public function getIcon(): string {
|
||||
public function getIcon() {
|
||||
return $this->urlGenerator->imagePath('deck', 'deck-dark.svg');
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ class Filter implements \OCP\Activity\IFilter {
|
||||
* @return string[] An array of allowed apps from which activities should be displayed
|
||||
* @since 11.0.0
|
||||
*/
|
||||
public function filterTypes(array $types): array {
|
||||
public function filterTypes(array $types) {
|
||||
return array_merge($types, ['deck_comment']);
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ class Filter implements \OCP\Activity\IFilter {
|
||||
* @return string[] An array of allowed apps from which activities should be displayed
|
||||
* @since 11.0.0
|
||||
*/
|
||||
public function allowedApps(): array {
|
||||
public function allowedApps() {
|
||||
return ['deck'];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ class Setting implements \OCP\Activity\ISetting {
|
||||
* @return string Lowercase a-z and underscore only identifier
|
||||
* @since 11.0.0
|
||||
*/
|
||||
public function getIdentifier(): string {
|
||||
public function getIdentifier() {
|
||||
return 'deck';
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ class Setting implements \OCP\Activity\ISetting {
|
||||
* @return string A translated string
|
||||
* @since 11.0.0
|
||||
*/
|
||||
public function getName(): string {
|
||||
public function getName() {
|
||||
return $this->l->t('Changes in the <strong>Deck app</strong>');
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ class Setting implements \OCP\Activity\ISetting {
|
||||
* priority values. It is required to return a value between 0 and 100.
|
||||
* @since 11.0.0
|
||||
*/
|
||||
public function getPriority(): int {
|
||||
public function getPriority() {
|
||||
return 90;
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ class Setting implements \OCP\Activity\ISetting {
|
||||
* @return bool True when the option can be changed for the stream
|
||||
* @since 11.0.0
|
||||
*/
|
||||
public function canChangeStream(): bool {
|
||||
public function canChangeStream() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ class Setting implements \OCP\Activity\ISetting {
|
||||
* @return bool True when the option can be changed for the stream
|
||||
* @since 11.0.0
|
||||
*/
|
||||
public function isDefaultEnabledStream(): bool {
|
||||
public function isDefaultEnabledStream() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ class Setting implements \OCP\Activity\ISetting {
|
||||
* @return bool True when the option can be changed for the mail
|
||||
* @since 11.0.0
|
||||
*/
|
||||
public function canChangeMail(): bool {
|
||||
public function canChangeMail() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ class Setting implements \OCP\Activity\ISetting {
|
||||
* @return bool True when the option can be changed for the stream
|
||||
* @since 11.0.0
|
||||
*/
|
||||
public function isDefaultEnabledMail(): bool {
|
||||
public function isDefaultEnabledMail() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ class SettingComment extends Setting {
|
||||
* @return string Lowercase a-z and underscore only identifier
|
||||
* @since 11.0.0
|
||||
*/
|
||||
public function getIdentifier(): string {
|
||||
public function getIdentifier() {
|
||||
return 'deck_comment';
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ class SettingComment extends Setting {
|
||||
* @return string A translated string
|
||||
* @since 11.0.0
|
||||
*/
|
||||
public function getName(): string {
|
||||
public function getName() {
|
||||
return $this->l->t('A <strong>comment</strong> was created on a card');
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ class SettingComment extends Setting {
|
||||
* @return bool True when the option can be changed for the stream
|
||||
* @since 11.0.0
|
||||
*/
|
||||
public function canChangeStream(): bool {
|
||||
public function canChangeStream() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,35 +25,29 @@ namespace OCA\Deck\AppInfo;
|
||||
|
||||
use Closure;
|
||||
use Exception;
|
||||
use OCA\Circles\Events\CircleDestroyedEvent;
|
||||
use OC\EventDispatcher\SymfonyAdapter;
|
||||
use OCA\Deck\Activity\CommentEventHandler;
|
||||
use OCA\Deck\Capabilities;
|
||||
use OCA\Deck\Collaboration\Resources\ResourceProvider;
|
||||
use OCA\Deck\Collaboration\Resources\ResourceProviderCard;
|
||||
use OCA\Deck\Dashboard\DeckWidget;
|
||||
use OCA\Deck\Db\Acl;
|
||||
use OCA\Deck\Db\AclMapper;
|
||||
use OCA\Deck\Db\AssignmentMapper;
|
||||
use OCA\Deck\Db\BoardMapper;
|
||||
use OCA\Deck\Db\CardMapper;
|
||||
use OCA\Deck\Event\AclCreatedEvent;
|
||||
use OCA\Deck\Event\AclDeletedEvent;
|
||||
use OCA\Deck\Event\AclUpdatedEvent;
|
||||
use OCA\Deck\Event\BoardUpdatedEvent;
|
||||
use OCA\Deck\Event\CardCreatedEvent;
|
||||
use OCA\Deck\Event\CardDeletedEvent;
|
||||
use OCA\Deck\Event\CardUpdatedEvent;
|
||||
use OCA\Deck\Event\SessionClosedEvent;
|
||||
use OCA\Deck\Event\SessionCreatedEvent;
|
||||
use OCA\Deck\Listeners\BeforeTemplateRenderedListener;
|
||||
use OCA\Deck\Listeners\ParticipantCleanupListener;
|
||||
use OCA\Deck\Listeners\FullTextSearchEventListener;
|
||||
use OCA\Deck\Listeners\ResourceAdditionalScriptsListener;
|
||||
use OCA\Deck\Listeners\ResourceListener;
|
||||
use OCA\Deck\Listeners\LiveUpdateListener;
|
||||
use OCA\Deck\Middleware\DefaultBoardMiddleware;
|
||||
use OCA\Deck\Middleware\ExceptionMiddleware;
|
||||
use OCA\Deck\Notification\Notifier;
|
||||
use OCA\Deck\Reference\BoardReferenceProvider;
|
||||
use OCA\Deck\Reference\CardReferenceProvider;
|
||||
use OCA\Deck\Reference\CommentReferenceProvider;
|
||||
use OCA\Deck\Search\CardCommentProvider;
|
||||
use OCA\Deck\Search\DeckProvider;
|
||||
use OCA\Deck\Service\PermissionService;
|
||||
@@ -66,13 +60,18 @@ use OCP\AppFramework\Bootstrap\IRegistrationContext;
|
||||
use OCP\AppFramework\Http\Events\BeforeTemplateRenderedEvent;
|
||||
use OCP\Collaboration\Reference\RenderReferenceEvent;
|
||||
use OCP\Collaboration\Resources\IProviderManager;
|
||||
use OCP\Collaboration\Resources\LoadAdditionalScriptsEvent;
|
||||
use OCP\Comments\CommentsEntityEvent;
|
||||
use OCP\Comments\ICommentsManager;
|
||||
use OCP\EventDispatcher\Event;
|
||||
use OCP\EventDispatcher\IEventDispatcher;
|
||||
use OCP\Group\Events\GroupDeletedEvent;
|
||||
use OCP\IConfig;
|
||||
use OCP\IDBConnection;
|
||||
use OCP\IGroupManager;
|
||||
use OCP\IRequest;
|
||||
use OCP\Server;
|
||||
use OCP\IUserManager;
|
||||
use OCP\Notification\IManager as NotificationManager;
|
||||
use OCP\Share\IManager;
|
||||
use OCP\User\Events\UserDeletedEvent;
|
||||
use OCP\Util;
|
||||
@@ -91,13 +90,15 @@ class Application extends App implements IBootstrap {
|
||||
$container = $this->getContainer();
|
||||
$eventDispatcher = $container->get(IEventDispatcher::class);
|
||||
$eventDispatcher->addListener(RenderReferenceEvent::class, function () {
|
||||
Util::addScript(self::APP_ID, self::APP_ID . '-reference');
|
||||
Util::addScript(self::APP_ID, self::APP_ID . '-card-reference');
|
||||
});
|
||||
}
|
||||
|
||||
public function boot(IBootContext $context): void {
|
||||
$context->injectFn(Closure::fromCallable([$this, 'registerUserGroupHooks']));
|
||||
$context->injectFn(Closure::fromCallable([$this, 'registerCommentsEntity']));
|
||||
$context->injectFn(Closure::fromCallable([$this, 'registerCommentsEventHandler']));
|
||||
$context->injectFn(Closure::fromCallable([$this, 'registerNotifications']));
|
||||
$context->injectFn(Closure::fromCallable([$this, 'registerCollaborationResources']));
|
||||
|
||||
$context->injectFn(function (IManager $shareManager) {
|
||||
@@ -131,8 +132,7 @@ class Application extends App implements IBootstrap {
|
||||
|
||||
// reference widget
|
||||
$context->registerReferenceProvider(CardReferenceProvider::class);
|
||||
$context->registerReferenceProvider(BoardReferenceProvider::class);
|
||||
$context->registerReferenceProvider(CommentReferenceProvider::class);
|
||||
// $context->registerEventListener(RenderReferenceEvent::class, CardReferenceListener::class);
|
||||
|
||||
$context->registerEventListener(BeforeTemplateRenderedEvent::class, BeforeTemplateRenderedListener::class);
|
||||
|
||||
@@ -143,28 +143,57 @@ class Application extends App implements IBootstrap {
|
||||
$context->registerEventListener(AclCreatedEvent::class, FullTextSearchEventListener::class);
|
||||
$context->registerEventListener(AclUpdatedEvent::class, FullTextSearchEventListener::class);
|
||||
$context->registerEventListener(AclDeletedEvent::class, FullTextSearchEventListener::class);
|
||||
}
|
||||
|
||||
// Handling cache invalidation for collections
|
||||
$context->registerEventListener(AclCreatedEvent::class, ResourceListener::class);
|
||||
$context->registerEventListener(AclDeletedEvent::class, ResourceListener::class);
|
||||
public function registerNotifications(NotificationManager $notificationManager): void {
|
||||
$notificationManager->registerNotifierService(Notifier::class);
|
||||
}
|
||||
|
||||
$context->registerEventListener(UserDeletedEvent::class, ParticipantCleanupListener::class);
|
||||
$context->registerEventListener(GroupDeletedEvent::class, ParticipantCleanupListener::class);
|
||||
$context->registerEventListener(CircleDestroyedEvent::class, ParticipantCleanupListener::class);
|
||||
private function registerUserGroupHooks(IUserManager $userManager, IGroupManager $groupManager): void {
|
||||
$container = $this->getContainer();
|
||||
/** @var IEventDispatcher $eventDispatcher */
|
||||
$eventDispatcher = $container->get(IEventDispatcher::class);
|
||||
// Delete user/group acl entries when they get deleted
|
||||
$eventDispatcher->addListener(UserDeletedEvent::class, static function (Event $event) use ($container): void {
|
||||
if (!($event instanceof UserDeletedEvent)) {
|
||||
return;
|
||||
}
|
||||
$user = $event->getUser();
|
||||
// delete existing acl entries for deleted user
|
||||
/** @var AclMapper $aclMapper */
|
||||
$aclMapper = $container->get(AclMapper::class);
|
||||
$acls = $aclMapper->findByParticipant(Acl::PERMISSION_TYPE_USER, $user->getUID());
|
||||
foreach ($acls as $acl) {
|
||||
$aclMapper->delete($acl);
|
||||
}
|
||||
// delete existing user assignments
|
||||
$assignmentMapper = $container->get(AssignmentMapper::class);
|
||||
$assignments = $assignmentMapper->findByParticipant($user->getUID());
|
||||
foreach ($assignments as $assignment) {
|
||||
$assignmentMapper->delete($assignment);
|
||||
}
|
||||
|
||||
// Event listening for realtime updates via notify_push
|
||||
$context->registerEventListener(SessionCreatedEvent::class, LiveUpdateListener::class);
|
||||
$context->registerEventListener(SessionClosedEvent::class, LiveUpdateListener::class);
|
||||
$context->registerEventListener(BoardUpdatedEvent::class, LiveUpdateListener::class);
|
||||
$context->registerEventListener(CardCreatedEvent::class, LiveUpdateListener::class);
|
||||
$context->registerEventListener(CardUpdatedEvent::class, LiveUpdateListener::class);
|
||||
$context->registerEventListener(CardDeletedEvent::class, LiveUpdateListener::class);
|
||||
$context->registerEventListener(AclCreatedEvent::class, LiveUpdateListener::class);
|
||||
$context->registerEventListener(AclUpdatedEvent::class, LiveUpdateListener::class);
|
||||
$context->registerEventListener(AclDeletedEvent::class, LiveUpdateListener::class);
|
||||
/** @var BoardMapper $boardMapper */
|
||||
$boardMapper = $container->get(BoardMapper::class);
|
||||
$boards = $boardMapper->findAllByOwner($user->getUID());
|
||||
foreach ($boards as $board) {
|
||||
$boardMapper->delete($board);
|
||||
}
|
||||
});
|
||||
|
||||
$context->registerNotifierService(Notifier::class);
|
||||
$context->registerEventListener(LoadAdditionalScriptsEvent::class, ResourceAdditionalScriptsListener::class);
|
||||
$eventDispatcher->addListener(GroupDeletedEvent::class, static function (Event $event) use ($container): void {
|
||||
if (!($event instanceof GroupDeletedEvent)) {
|
||||
return;
|
||||
}
|
||||
$group = $event->getGroup();
|
||||
/** @var AclMapper $aclMapper */
|
||||
$aclMapper = $container->get(AclMapper::class);
|
||||
$aclMapper->findByParticipant(Acl::PERMISSION_TYPE_GROUP, $group->getGID());
|
||||
$acls = $aclMapper->findByParticipant(Acl::PERMISSION_TYPE_GROUP, $group->getGID());
|
||||
foreach ($acls as $acl) {
|
||||
$aclMapper->delete($acl);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public function registerCommentsEntity(IEventDispatcher $eventDispatcher): void {
|
||||
@@ -190,8 +219,16 @@ class Application extends App implements IBootstrap {
|
||||
});
|
||||
}
|
||||
|
||||
protected function registerCollaborationResources(IProviderManager $resourceManager): void {
|
||||
protected function registerCollaborationResources(IProviderManager $resourceManager, SymfonyAdapter $symfonyAdapter): void {
|
||||
$resourceManager->registerResourceProvider(ResourceProvider::class);
|
||||
$resourceManager->registerResourceProvider(ResourceProviderCard::class);
|
||||
|
||||
$symfonyAdapter->addListener('\OCP\Collaboration\Resources::loadAdditionalScripts', static function () {
|
||||
if (strpos(Server::get(IRequest::class)->getPathInfo(), '/call/') === 0) {
|
||||
// Talk integration has its own entrypoint which already includes collections handling
|
||||
return;
|
||||
}
|
||||
Util::addScript('deck', 'deck-collections');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ class AttachmentController extends Controller {
|
||||
* @throws \OCA\Deck\NotFoundException
|
||||
*/
|
||||
public function display($cardId, $attachmentId) {
|
||||
if (!str_contains($attachmentId, ':')) {
|
||||
if (strpos($attachmentId, ':') === false) {
|
||||
$type = 'deck_file';
|
||||
} else {
|
||||
[$type, $attachmentId] = explode(':', $attachmentId);
|
||||
@@ -76,7 +76,7 @@ class AttachmentController extends Controller {
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
public function update($cardId, $attachmentId) {
|
||||
if (!str_contains($attachmentId, ':')) {
|
||||
if (strpos($attachmentId, ':') === false) {
|
||||
$type = 'deck_file';
|
||||
} else {
|
||||
[$type, $attachmentId] = explode(':', $attachmentId);
|
||||
@@ -88,7 +88,7 @@ class AttachmentController extends Controller {
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
public function delete($cardId, $attachmentId) {
|
||||
if (!str_contains($attachmentId, ':')) {
|
||||
if (strpos($attachmentId, ':') === false) {
|
||||
$type = 'deck_file';
|
||||
} else {
|
||||
[$type, $attachmentId] = explode(':', $attachmentId);
|
||||
@@ -100,7 +100,7 @@ class AttachmentController extends Controller {
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
public function restore($cardId, $attachmentId) {
|
||||
if (!str_contains($attachmentId, ':')) {
|
||||
if (strpos($attachmentId, ':') === false) {
|
||||
$type = 'deck_file';
|
||||
} else {
|
||||
[$type, $attachmentId] = explode(':', $attachmentId);
|
||||
|
||||
@@ -60,14 +60,12 @@ class BoardApiController extends ApiController {
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
* Return all of the boards that the current user has access to.
|
||||
*
|
||||
* @param bool $details
|
||||
* @throws StatusException
|
||||
*/
|
||||
public function index(bool $details = false) {
|
||||
public function index($details = null) {
|
||||
$modified = $this->request->getHeader('If-Modified-Since');
|
||||
if ($modified === null || $modified === '') {
|
||||
$boards = $this->boardService->findAll(0, $details === true);
|
||||
$boards = $this->boardService->findAll(0, $details);
|
||||
} else {
|
||||
$date = Util::parseHTTPDate($modified);
|
||||
if (!$date) {
|
||||
|
||||
@@ -169,15 +169,4 @@ class BoardController extends ApiController {
|
||||
|
||||
return new DataResponse([], HTTP::STATUS_UNAUTHORIZED);
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @param $boardId
|
||||
* @return Board
|
||||
* @throws \OCP\AppFramework\Db\DoesNotExistException
|
||||
* @throws \OCP\AppFramework\Db\MultipleObjectsReturnedException
|
||||
*/
|
||||
public function export($boardId) {
|
||||
return $this->boardService->export($boardId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@ use OCA\Deck\AppInfo\Application;
|
||||
use OCA\Deck\Service\ConfigService;
|
||||
use OCA\Deck\Service\PermissionService;
|
||||
use OCA\Files\Event\LoadSidebar;
|
||||
use OCA\Text\Event\LoadEditor;
|
||||
use OCA\Viewer\Event\LoadViewer;
|
||||
use OCP\AppFramework\Http\ContentSecurityPolicy;
|
||||
use OCP\Collaboration\Resources\LoadAdditionalScriptsEvent as CollaborationResourcesEvent;
|
||||
@@ -91,9 +90,6 @@ class PageController extends Controller {
|
||||
|
||||
$this->eventDispatcher->dispatchTyped(new LoadSidebar());
|
||||
$this->eventDispatcher->dispatchTyped(new CollaborationResourcesEvent());
|
||||
if (class_exists(LoadEditor::class)) {
|
||||
$this->eventDispatcher->dispatchTyped(new LoadEditor());
|
||||
}
|
||||
if (class_exists(LoadViewer::class)) {
|
||||
$this->eventDispatcher->dispatchTyped(new LoadViewer());
|
||||
}
|
||||
|
||||
@@ -1,91 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2022, chandi Langecker (git@chandi.it)
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace OCA\Deck\Controller;
|
||||
|
||||
use OCA\Deck\Service\SessionService;
|
||||
use OCA\Deck\Service\PermissionService;
|
||||
use OCA\Deck\Db\BoardMapper;
|
||||
use OCP\AppFramework\Db\DoesNotExistException;
|
||||
use OCP\AppFramework\Http\DataResponse;
|
||||
use OCP\AppFramework\OCSController;
|
||||
use OCP\IRequest;
|
||||
use OCA\Deck\Db\Acl;
|
||||
|
||||
class SessionController extends OCSController {
|
||||
private SessionService $sessionService;
|
||||
private PermissionService $permissionService;
|
||||
private BoardMapper $boardMapper;
|
||||
|
||||
public function __construct($appName,
|
||||
IRequest $request,
|
||||
SessionService $sessionService,
|
||||
PermissionService $permissionService,
|
||||
BoardMapper $boardMapper
|
||||
) {
|
||||
parent::__construct($appName, $request);
|
||||
$this->sessionService = $sessionService;
|
||||
$this->permissionService = $permissionService;
|
||||
$this->boardMapper = $boardMapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
public function create(int $boardId): DataResponse {
|
||||
$this->permissionService->checkPermission($this->boardMapper, $boardId, Acl::PERMISSION_READ);
|
||||
|
||||
$session = $this->sessionService->initSession($boardId);
|
||||
return new DataResponse([
|
||||
'token' => $session->getToken(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* notifies the server that the session is still active
|
||||
* @NoAdminRequired
|
||||
* @param $boardId
|
||||
*/
|
||||
public function sync(int $boardId, string $token): DataResponse {
|
||||
$this->permissionService->checkPermission($this->boardMapper, $boardId, Acl::PERMISSION_READ);
|
||||
try {
|
||||
$this->sessionService->syncSession($boardId, $token);
|
||||
return new DataResponse([]);
|
||||
} catch (DoesNotExistException $e) {
|
||||
return new DataResponse([], 404);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* delete a session if existing
|
||||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
* @param $boardId
|
||||
*/
|
||||
public function close(int $boardId, string $token) {
|
||||
$this->permissionService->checkPermission($this->boardMapper, $boardId, Acl::PERMISSION_READ);
|
||||
$this->sessionService->closeSession($boardId, $token);
|
||||
return new DataResponse();
|
||||
}
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2022, chandi Langecker (git@chandi.it)
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
namespace OCA\Deck\Cron;
|
||||
|
||||
use OCA\Deck\Service\SessionService;
|
||||
use OCP\AppFramework\Utility\ITimeFactory;
|
||||
use OCP\BackgroundJob\TimedJob;
|
||||
use OCP\ILogger;
|
||||
|
||||
class SessionsCleanup extends TimedJob {
|
||||
private $sessionService;
|
||||
private $documentService;
|
||||
private $logger;
|
||||
private $imageService;
|
||||
|
||||
|
||||
public function __construct(ITimeFactory $time,
|
||||
SessionService $sessionService,
|
||||
ILogger $logger) {
|
||||
parent::__construct($time);
|
||||
$this->sessionService = $sessionService;
|
||||
$this->logger = $logger;
|
||||
$this->setInterval(SessionService::SESSION_VALID_TIME);
|
||||
}
|
||||
|
||||
protected function run($argument) {
|
||||
$this->logger->debug('Run cleanup job for deck sessions');
|
||||
|
||||
$removedSessions = $this->sessionService->removeInactiveSessions();
|
||||
$this->logger->debug('Removed ' . $removedSessions . ' inactive sessions');
|
||||
}
|
||||
}
|
||||
@@ -59,21 +59,20 @@ class Calendar extends ExternalCalendar {
|
||||
}
|
||||
|
||||
public function getACL() {
|
||||
// the calendar should always have the read and the write-properties permissions
|
||||
// write-properties is needed to allow the user to toggle the visibility of shared deck calendars
|
||||
$acl = [
|
||||
[
|
||||
'privilege' => '{DAV:}read',
|
||||
'principal' => $this->getOwner(),
|
||||
'protected' => true,
|
||||
],
|
||||
[
|
||||
]
|
||||
];
|
||||
if ($this->backend->checkBoardPermission($this->board->getId(), Acl::PERMISSION_MANAGE)) {
|
||||
$acl[] = [
|
||||
'privilege' => '{DAV:}write-properties',
|
||||
'principal' => $this->getOwner(),
|
||||
'protected' => true,
|
||||
]
|
||||
];
|
||||
|
||||
];
|
||||
}
|
||||
return $acl;
|
||||
}
|
||||
|
||||
@@ -188,18 +187,12 @@ class Calendar extends ExternalCalendar {
|
||||
foreach ($properties as $key => $value) {
|
||||
switch ($key) {
|
||||
case '{DAV:}displayname':
|
||||
if (!$this->backend->checkBoardPermission($this->board->getId(), Acl::PERMISSION_MANAGE)) {
|
||||
throw new Forbidden('no permission to change the displayname');
|
||||
}
|
||||
if (mb_strpos($value, 'Deck: ') === 0) {
|
||||
$value = mb_substr($value, strlen('Deck: '));
|
||||
}
|
||||
$this->board->setTitle($value);
|
||||
break;
|
||||
case '{http://apple.com/ns/ical/}calendar-color':
|
||||
if (!$this->backend->checkBoardPermission($this->board->getId(), Acl::PERMISSION_MANAGE)) {
|
||||
throw new Forbidden('no permission to change the calendar color');
|
||||
}
|
||||
$color = substr($value, 1, 6);
|
||||
if (!preg_match('/[a-f0-9]{6}/i', $color)) {
|
||||
throw new InvalidDataException('No valid color provided');
|
||||
|
||||
@@ -59,7 +59,7 @@ class DeckCalendarBackend {
|
||||
}
|
||||
|
||||
public function getBoards(): array {
|
||||
return $this->boardService->findAll(-1, false, false);
|
||||
return $this->boardService->findAll(-1, null, false);
|
||||
}
|
||||
|
||||
public function getBoard(int $id): Board {
|
||||
|
||||
@@ -117,7 +117,7 @@ class DeckWidget implements IAPIWidget, IButtonWidget, IIconWidget {
|
||||
$nowTimestamp = (new Datetime())->getTimestamp();
|
||||
$sinceTimestamp = $since !== null ? (new Datetime($since))->getTimestamp() : null;
|
||||
$upcomingCards = array_filter($upcomingCards, static function (array $card) use ($nowTimestamp, $sinceTimestamp) {
|
||||
if (isset($card['duedate'])) {
|
||||
if ($card['duedate']) {
|
||||
$ts = (new Datetime($card['duedate']))->getTimestamp();
|
||||
return $ts > $nowTimestamp && ($sinceTimestamp === null || $ts > $sinceTimestamp);
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@ use OCP\AppFramework\Db\MultipleObjectsReturnedException;
|
||||
use OCP\DB\QueryBuilder\IQueryBuilder;
|
||||
use OCP\IDBConnection;
|
||||
|
||||
/** @template-extends DeckMapper<Acl> */
|
||||
class AclMapper extends DeckMapper implements IPermissionMapper {
|
||||
public function __construct(IDBConnection $db) {
|
||||
parent::__construct($db, 'deck_board_acl', Acl::class);
|
||||
@@ -52,20 +51,6 @@ class AclMapper extends DeckMapper implements IPermissionMapper {
|
||||
return $this->findEntities($qb);
|
||||
}
|
||||
|
||||
public function findIn(array $boardIds, ?int $limit = null, ?int $offset = null): array {
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
$qb->select('id', 'board_id', 'type', 'participant', 'permission_edit', 'permission_share', 'permission_manage')
|
||||
->from('deck_board_acl')
|
||||
->where($qb->expr()->in('board_id', $qb->createParameter('boardIds')))
|
||||
->setMaxResults($limit)
|
||||
->setFirstResult($offset);
|
||||
|
||||
return iterator_to_array($this->chunkQuery($boardIds, function (array $ids) use ($qb) {
|
||||
$qb->setParameter('boardIds', $ids, IQueryBuilder::PARAM_INT_ARRAY);
|
||||
return $this->findEntities($qb);
|
||||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param numeric $userId
|
||||
* @param numeric $id
|
||||
@@ -125,12 +110,4 @@ class AclMapper extends DeckMapper implements IPermissionMapper {
|
||||
->andWhere($qb->expr()->eq('board_id', $qb->createNamedParameter($boardId, IQueryBuilder::PARAM_INT)));
|
||||
$qb->executeStatement();
|
||||
}
|
||||
|
||||
public function findByType(int $type): array {
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
$qb->select('*')
|
||||
->from('deck_board_acl')
|
||||
->where($qb->expr()->eq('type', $qb->createNamedParameter($type, IQueryBuilder::PARAM_INT)));
|
||||
return $this->findEntities($qb);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,13 +28,14 @@ namespace OCA\Deck\Db;
|
||||
use OCA\Deck\NotFoundException;
|
||||
use OCA\Deck\Service\CirclesService;
|
||||
use OCP\AppFramework\Db\Entity;
|
||||
use OCP\AppFramework\Db\QBMapper;
|
||||
use OCP\DB\QueryBuilder\IQueryBuilder;
|
||||
use OCP\IDBConnection;
|
||||
use OCP\IGroupManager;
|
||||
use OCP\IUserManager;
|
||||
use PDO;
|
||||
|
||||
/** @template-extends DeckMapper<Assignment> */
|
||||
class AssignmentMapper extends DeckMapper implements IPermissionMapper {
|
||||
class AssignmentMapper extends QBMapper implements IPermissionMapper {
|
||||
|
||||
/** @var CardMapper */
|
||||
private $cardMapper;
|
||||
@@ -58,7 +59,7 @@ class AssignmentMapper extends DeckMapper implements IPermissionMapper {
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
$qb->select('*')
|
||||
->from('deck_assigned_users')
|
||||
->where($qb->expr()->eq('card_id', $qb->createNamedParameter($cardId, IQueryBuilder::PARAM_INT)));
|
||||
->where($qb->expr()->eq('card_id', $qb->createNamedParameter($cardId, PDO::PARAM_INT)));
|
||||
$users = $this->findEntities($qb);
|
||||
foreach ($users as $user) {
|
||||
$this->mapParticipant($user);
|
||||
@@ -66,29 +67,12 @@ class AssignmentMapper extends DeckMapper implements IPermissionMapper {
|
||||
return $users;
|
||||
}
|
||||
|
||||
public function findIn(array $cardIds): array {
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
$qb->select('*')
|
||||
->from('deck_assigned_users')
|
||||
->where($qb->expr()->in('card_id', $qb->createParameter('cardIds')));
|
||||
|
||||
$users = iterator_to_array($this->chunkQuery($cardIds, function (array $ids) use ($qb) {
|
||||
$qb->setParameter('cardIds', $ids, IQueryBuilder::PARAM_INT_ARRAY);
|
||||
return $this->findEntities($qb);
|
||||
}));
|
||||
|
||||
foreach ($users as $user) {
|
||||
$this->mapParticipant($user);
|
||||
}
|
||||
return $users;
|
||||
}
|
||||
|
||||
public function findByParticipant(string $participant, $type = Assignment::TYPE_USER): array {
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
$qb->select('*')
|
||||
->from('deck_assigned_users')
|
||||
->where($qb->expr()->eq('participant', $qb->createNamedParameter($participant, IQueryBuilder::PARAM_STR)))
|
||||
->andWhere($qb->expr()->eq('type', $qb->createNamedParameter($type, IQueryBuilder::PARAM_INT)));
|
||||
->where($qb->expr()->eq('participant', $qb->createNamedParameter($participant, PDO::PARAM_STR)))
|
||||
->andWhere($qb->expr()->eq('type', $qb->createNamedParameter($type, PDO::PARAM_INT)));
|
||||
return $this->findEntities($qb);
|
||||
}
|
||||
|
||||
@@ -147,8 +131,8 @@ class AssignmentMapper extends DeckMapper implements IPermissionMapper {
|
||||
|
||||
private function getOrigin(Assignment $assignment) {
|
||||
if ($assignment->getType() === Assignment::TYPE_USER) {
|
||||
$origin = $this->userManager->userExists($assignment->getParticipant());
|
||||
return $origin ? new User($assignment->getParticipant(), $this->userManager) : null;
|
||||
$origin = $this->userManager->get($assignment->getParticipant());
|
||||
return $origin ? new User($origin) : null;
|
||||
}
|
||||
if ($assignment->getType() === Assignment::TYPE_GROUP) {
|
||||
$origin = $this->groupManager->get($assignment->getParticipant());
|
||||
|
||||
@@ -31,7 +31,6 @@ use OCP\DB\QueryBuilder\IQueryBuilder;
|
||||
use OCP\IDBConnection;
|
||||
use OCP\IUserManager;
|
||||
|
||||
/** @template-extends DeckMapper<Attachment> */
|
||||
class AttachmentMapper extends DeckMapper implements IPermissionMapper {
|
||||
private $cardMapper;
|
||||
private $userManager;
|
||||
|
||||
@@ -44,7 +44,6 @@ class Board extends RelationalEntity {
|
||||
protected $users = [];
|
||||
protected $shared;
|
||||
protected $stacks = [];
|
||||
protected $activeSessions = [];
|
||||
protected $deletedAt = 0;
|
||||
protected $lastModified = 0;
|
||||
|
||||
@@ -60,7 +59,6 @@ class Board extends RelationalEntity {
|
||||
$this->addRelation('acl');
|
||||
$this->addRelation('shared');
|
||||
$this->addRelation('users');
|
||||
$this->addRelation('activeSessions');
|
||||
$this->addRelation('permissions');
|
||||
$this->addRelation('stacks');
|
||||
$this->addRelation('settings');
|
||||
|
||||
@@ -33,7 +33,6 @@ use OCP\IUserManager;
|
||||
use OCP\IGroupManager;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
/** @template-extends QBMapper<Board> */
|
||||
class BoardMapper extends QBMapper implements IPermissionMapper {
|
||||
private $labelMapper;
|
||||
private $aclMapper;
|
||||
@@ -90,6 +89,9 @@ class BoardMapper extends QBMapper implements IPermissionMapper {
|
||||
$this->boardCache[$id] = $this->findEntity($qb);
|
||||
}
|
||||
|
||||
// FIXME is this necessary? it was NOT done with the old mapper
|
||||
// $this->mapOwner($board);
|
||||
|
||||
// Add labels
|
||||
if ($withLabels && $this->boardCache[$id]->getLabels() === null) {
|
||||
$labels = $this->labelMapper->findAll($id);
|
||||
@@ -156,21 +158,7 @@ class BoardMapper extends QBMapper implements IPermissionMapper {
|
||||
$userBoards = $this->findAllByUser($userId, null, null, $since, $includeArchived, $before, $term);
|
||||
$groupBoards = $this->findAllByGroups($userId, $groups, null, null, $since, $includeArchived, $before, $term);
|
||||
$circleBoards = $this->findAllByCircles($userId, null, null, $since, $includeArchived, $before, $term);
|
||||
$allBoards = array_values(array_unique(array_merge($userBoards, $groupBoards, $circleBoards)));
|
||||
|
||||
// Could be moved outside
|
||||
$acls = $this->aclMapper->findIn(array_map(function ($board) {
|
||||
return $board->getId();
|
||||
}, $allBoards));
|
||||
|
||||
/* @var Board $entry */
|
||||
foreach ($allBoards as $entry) {
|
||||
$boardAcls = array_values(array_filter($acls, function ($acl) use ($entry) {
|
||||
return $acl->getBoardId() === $entry->getId();
|
||||
}));
|
||||
$entry->setAcl($boardAcls);
|
||||
}
|
||||
|
||||
$allBoards = array_unique(array_merge($userBoards, $groupBoards, $circleBoards));
|
||||
foreach ($allBoards as $board) {
|
||||
$this->boardCache[$board->getId()] = $board;
|
||||
}
|
||||
@@ -270,7 +258,11 @@ class BoardMapper extends QBMapper implements IPermissionMapper {
|
||||
$entry->setShared(1);
|
||||
}
|
||||
$entries = array_merge($entries, $sharedEntries);
|
||||
|
||||
/* @var Board $entry */
|
||||
foreach ($entries as $entry) {
|
||||
$acl = $this->aclMapper->findAll($entry->id);
|
||||
$entry->setAcl($acl);
|
||||
}
|
||||
return $entries;
|
||||
}
|
||||
|
||||
@@ -343,6 +335,11 @@ class BoardMapper extends QBMapper implements IPermissionMapper {
|
||||
foreach ($entries as $entry) {
|
||||
$entry->setShared(2);
|
||||
}
|
||||
/* @var Board $entry */
|
||||
foreach ($entries as $entry) {
|
||||
$acl = $this->aclMapper->findAll($entry->id);
|
||||
$entry->setAcl($acl);
|
||||
}
|
||||
return $entries;
|
||||
}
|
||||
|
||||
@@ -399,6 +396,11 @@ class BoardMapper extends QBMapper implements IPermissionMapper {
|
||||
foreach ($entries as $entry) {
|
||||
$entry->setShared(2);
|
||||
}
|
||||
/* @var Board $entry */
|
||||
foreach ($entries as $entry) {
|
||||
$acl = $this->aclMapper->findAll($entry->id);
|
||||
$entry->setAcl($acl);
|
||||
}
|
||||
return $entries;
|
||||
}
|
||||
|
||||
@@ -452,11 +454,13 @@ class BoardMapper extends QBMapper implements IPermissionMapper {
|
||||
}
|
||||
|
||||
public function mapAcl(Acl &$acl) {
|
||||
$userManager = $this->userManager;
|
||||
$groupManager = $this->groupManager;
|
||||
$acl->resolveRelation('participant', function ($participant) use (&$acl, &$userManager, &$groupManager) {
|
||||
if ($acl->getType() === Acl::PERMISSION_TYPE_USER) {
|
||||
if ($this->userManager->userExists($acl->getParticipant())) {
|
||||
return new User($acl->getParticipant(), $this->userManager);
|
||||
$user = $userManager->get($participant);
|
||||
if ($user !== null) {
|
||||
return new User($user);
|
||||
}
|
||||
$this->logger->debug('User ' . $acl->getId() . ' not found when mapping acl ' . $acl->getParticipant());
|
||||
return null;
|
||||
@@ -494,8 +498,9 @@ class BoardMapper extends QBMapper implements IPermissionMapper {
|
||||
public function mapOwner(Board &$board) {
|
||||
$userManager = $this->userManager;
|
||||
$board->resolveRelation('owner', function ($owner) use (&$userManager) {
|
||||
if ($this->userManager->userExists($owner)) {
|
||||
return new User($owner, $userManager);
|
||||
$user = $userManager->get($owner);
|
||||
if ($user !== null) {
|
||||
return new User($user);
|
||||
}
|
||||
return null;
|
||||
});
|
||||
|
||||
@@ -158,21 +158,6 @@ class Card extends RelationalEntity {
|
||||
return $calendar;
|
||||
}
|
||||
|
||||
public function getDaysUntilDue(): ?int {
|
||||
if ($this->getDuedate() === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$today = new DateTime();
|
||||
$today->setTime(0, 0);
|
||||
|
||||
$matchDate = DateTime::createFromInterface($this->getDuedate());
|
||||
$matchDate->setTime(0, 0);
|
||||
|
||||
$diff = $today->diff($matchDate);
|
||||
return (int) $diff->format('%R%a'); // Extract days count in interval
|
||||
}
|
||||
|
||||
public function getCalendarPrefix(): string {
|
||||
return 'card';
|
||||
}
|
||||
|
||||
@@ -38,7 +38,6 @@ use OCP\IUser;
|
||||
use OCP\IUserManager;
|
||||
use OCP\Notification\IManager;
|
||||
|
||||
/** @template-extends QBMapper<Card> */
|
||||
class CardMapper extends QBMapper implements IPermissionMapper {
|
||||
|
||||
/** @var LabelMapper */
|
||||
@@ -254,13 +253,13 @@ class CardMapper extends QBMapper implements IPermissionMapper {
|
||||
return $this->findEntities($qb);
|
||||
}
|
||||
|
||||
public function findAllWithDue(array $boardIds) {
|
||||
public function findAllWithDue($boardId) {
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
$qb->select('c.*')
|
||||
->from('deck_cards', 'c')
|
||||
->innerJoin('c', 'deck_stacks', 's', 's.id = c.stack_id')
|
||||
->innerJoin('s', 'deck_boards', 'b', 'b.id = s.board_id')
|
||||
->where($qb->expr()->in('s.board_id', $qb->createNamedParameter($boardIds, IQueryBuilder::PARAM_INT_ARRAY)))
|
||||
->where($qb->expr()->eq('s.board_id', $qb->createNamedParameter($boardId, IQueryBuilder::PARAM_INT)))
|
||||
->andWhere($qb->expr()->isNotNull('c.duedate'))
|
||||
->andWhere($qb->expr()->eq('c.archived', $qb->createNamedParameter(false, IQueryBuilder::PARAM_BOOL)))
|
||||
->andWhere($qb->expr()->eq('c.deleted_at', $qb->createNamedParameter(0, IQueryBuilder::PARAM_INT)))
|
||||
@@ -270,14 +269,14 @@ class CardMapper extends QBMapper implements IPermissionMapper {
|
||||
return $this->findEntities($qb);
|
||||
}
|
||||
|
||||
public function findToMeOrNotAssignedCards(array $boardIds, string $username) {
|
||||
public function findToMeOrNotAssignedCards($boardId, $username) {
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
$qb->select('c.*')
|
||||
->from('deck_cards', 'c')
|
||||
->innerJoin('c', 'deck_stacks', 's', 's.id = c.stack_id')
|
||||
->innerJoin('s', 'deck_boards', 'b', 'b.id = s.board_id')
|
||||
->leftJoin('c', 'deck_assigned_users', 'u', 'c.id = u.card_id')
|
||||
->where($qb->expr()->in('s.board_id', $qb->createNamedParameter($boardIds, IQueryBuilder::PARAM_INT_ARRAY)))
|
||||
->where($qb->expr()->eq('s.board_id', $qb->createNamedParameter($boardId, IQueryBuilder::PARAM_INT)))
|
||||
->andWhere($qb->expr()->orX(
|
||||
$qb->expr()->eq('u.participant', $qb->createNamedParameter($username, IQueryBuilder::PARAM_STR)),
|
||||
$qb->expr()->isNull('u.participant'))
|
||||
@@ -607,8 +606,9 @@ class CardMapper extends QBMapper implements IPermissionMapper {
|
||||
public function mapOwner(Card &$card) {
|
||||
$userManager = $this->userManager;
|
||||
$card->resolveRelation('owner', function ($owner) use (&$userManager) {
|
||||
if ($userManager->userExists($owner)) {
|
||||
return new User($owner, $this->userManager);
|
||||
$user = $userManager->get($owner);
|
||||
if ($user !== null) {
|
||||
return new User($user);
|
||||
}
|
||||
return null;
|
||||
});
|
||||
|
||||
@@ -23,20 +23,19 @@
|
||||
|
||||
namespace OCA\Deck\Db;
|
||||
|
||||
use Generator;
|
||||
use OCP\AppFramework\Db\Entity;
|
||||
use OCP\AppFramework\Db\QBMapper;
|
||||
use OCP\DB\QueryBuilder\IQueryBuilder;
|
||||
|
||||
/**
|
||||
* @template T of Entity
|
||||
* @template-extends QBMapper<T>
|
||||
* Class DeckMapper
|
||||
*
|
||||
* @package OCA\Deck\Db
|
||||
*/
|
||||
abstract class DeckMapper extends QBMapper {
|
||||
class DeckMapper extends QBMapper {
|
||||
|
||||
/**
|
||||
* @param $id
|
||||
* @return T
|
||||
* @return \OCP\AppFramework\Db\Entity if not found
|
||||
* @throws \OCP\AppFramework\Db\MultipleObjectsReturnedException
|
||||
* @throws \OCP\AppFramework\Db\DoesNotExistException
|
||||
*/
|
||||
@@ -48,21 +47,4 @@ abstract class DeckMapper extends QBMapper {
|
||||
|
||||
return $this->findEntity($qb);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to split passed array into chunks of 1000 elements and
|
||||
* call a given callback for fetching query results
|
||||
*
|
||||
* Can be useful to limit to 1000 results per query for oracle compatiblity
|
||||
* but still iterate over all results
|
||||
*/
|
||||
public function chunkQuery(array $ids, callable $callback): Generator {
|
||||
$limit = 1000;
|
||||
while (!empty($ids)) {
|
||||
$slice = array_splice($ids, 0, $limit);
|
||||
foreach ($callback($slice) as $item) {
|
||||
yield $item;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@ use OCP\AppFramework\Db\MultipleObjectsReturnedException;
|
||||
use OCP\DB\QueryBuilder\IQueryBuilder;
|
||||
use OCP\IDBConnection;
|
||||
|
||||
/** @template-extends DeckMapper<Label> */
|
||||
class LabelMapper extends DeckMapper implements IPermissionMapper {
|
||||
public function __construct(IDBConnection $db) {
|
||||
parent::__construct($db, 'deck_labels', Label::class);
|
||||
@@ -52,6 +51,11 @@ class LabelMapper extends DeckMapper implements IPermissionMapper {
|
||||
return $this->findEntities($qb);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Entity $entity
|
||||
* @return Entity
|
||||
* @throws \OCP\DB\Exception
|
||||
*/
|
||||
public function delete(Entity $entity): Entity {
|
||||
// delete assigned labels
|
||||
$this->deleteLabelAssignments($entity->getId());
|
||||
@@ -79,19 +83,6 @@ class LabelMapper extends DeckMapper implements IPermissionMapper {
|
||||
return $this->findEntities($qb);
|
||||
}
|
||||
|
||||
public function findAssignedLabelsForCards($cardIds, $limit = null, $offset = null): array {
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
$qb->select('l.*', 'card_id')
|
||||
->from($this->getTableName(), 'l')
|
||||
->innerJoin('l', 'deck_assigned_labels', 'al', 'l.id = al.label_id')
|
||||
->where($qb->expr()->in('card_id', $qb->createNamedParameter($cardIds, IQueryBuilder::PARAM_INT_ARRAY)))
|
||||
->orderBy('l.id')
|
||||
->setMaxResults($limit)
|
||||
->setFirstResult($offset);
|
||||
|
||||
return $this->findEntities($qb);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param numeric $boardId
|
||||
* @param int|null $limit
|
||||
@@ -114,12 +105,23 @@ class LabelMapper extends DeckMapper implements IPermissionMapper {
|
||||
return $this->findEntities($qb);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Entity $entity
|
||||
* @return Entity
|
||||
* @throws \OCP\DB\Exception
|
||||
*/
|
||||
public function insert(Entity $entity): Entity {
|
||||
$entity->setLastModified(time());
|
||||
return parent::insert($entity);
|
||||
}
|
||||
|
||||
public function update(Entity $entity, bool $updateModified = true): Entity {
|
||||
/**
|
||||
* @param Entity $entity
|
||||
* @param bool $updateModified
|
||||
* @return Entity
|
||||
* @throws \OCP\DB\Exception
|
||||
*/
|
||||
public function update(Entity $entity, $updateModified = true): Entity {
|
||||
if ($updateModified) {
|
||||
$entity->setLastModified(time());
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ class RelationalEntity extends Entity implements \JsonSerializable {
|
||||
* @param string $attribute the name of the attribute
|
||||
* @since 7.0.0
|
||||
*/
|
||||
protected function markFieldUpdated(string $attribute): void {
|
||||
protected function markFieldUpdated($attribute) {
|
||||
if (!in_array($attribute, $this->_relations, true)) {
|
||||
parent::markFieldUpdated($attribute);
|
||||
}
|
||||
@@ -68,7 +68,7 @@ class RelationalEntity extends Entity implements \JsonSerializable {
|
||||
$reflection = new \ReflectionClass($this);
|
||||
$json = [];
|
||||
foreach ($properties as $property => $value) {
|
||||
if (!str_starts_with($property, '_') && $reflection->hasProperty($property)) {
|
||||
if (strpos($property, '_') !== 0 && $reflection->hasProperty($property)) {
|
||||
$propertyReflection = $reflection->getProperty($property);
|
||||
if (!$propertyReflection->isPrivate() && !in_array($property, $this->_resolvedProperties, true)) {
|
||||
$json[$property] = $this->getter($property);
|
||||
@@ -127,9 +127,9 @@ class RelationalEntity extends Entity implements \JsonSerializable {
|
||||
}
|
||||
}
|
||||
|
||||
public function __call(string $methodName, array $args) {
|
||||
public function __call($methodName, $args) {
|
||||
$attr = lcfirst(substr($methodName, 7));
|
||||
if (array_key_exists($attr, $this->_resolvedProperties) && str_starts_with($methodName, 'resolve')) {
|
||||
if (array_key_exists($attr, $this->_resolvedProperties) && strpos($methodName, 'resolve') === 0) {
|
||||
if ($this->_resolvedProperties[$attr] !== null) {
|
||||
return $this->_resolvedProperties[$attr];
|
||||
}
|
||||
@@ -137,7 +137,7 @@ class RelationalEntity extends Entity implements \JsonSerializable {
|
||||
}
|
||||
|
||||
$attr = lcfirst(substr($methodName, 3));
|
||||
if (array_key_exists($attr, $this->_resolvedProperties) && str_starts_with($methodName, 'set')) {
|
||||
if (array_key_exists($attr, $this->_resolvedProperties) && strpos($methodName, 'set') === 0) {
|
||||
if (!is_scalar($args[0])) {
|
||||
$args[0] = $args[0]['primaryKey'];
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ class RelationalObject implements JsonSerializable {
|
||||
* RelationalObject constructor.
|
||||
*
|
||||
* @param $primaryKey string
|
||||
* @param callable|mixed $object
|
||||
* @param $object
|
||||
*/
|
||||
public function __construct($primaryKey, $object) {
|
||||
$this->primaryKey = $primaryKey;
|
||||
@@ -47,24 +47,16 @@ class RelationalObject implements JsonSerializable {
|
||||
);
|
||||
}
|
||||
|
||||
public function getObject() {
|
||||
if (is_callable($this->object)) {
|
||||
$this->object = call_user_func($this->object, $this);
|
||||
}
|
||||
|
||||
return $this->object;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method should be overwritten if object doesn't implement \JsonSerializable
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function getObjectSerialization() {
|
||||
if ($this->getObject() instanceof JsonSerializable) {
|
||||
return $this->getObject()->jsonSerialize();
|
||||
if ($this->object instanceof JsonSerializable) {
|
||||
return $this->object->jsonSerialize();
|
||||
} else {
|
||||
throw new \Exception('jsonSerialize is not implemented on ' . get_class($this->getObject()));
|
||||
throw new \Exception('jsonSerialize is not implemented on ' . get_class($this));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2022, chandi Langecker (git@chandi.it)
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace OCA\Deck\Db;
|
||||
|
||||
use OCP\AppFramework\Db\Entity;
|
||||
|
||||
class Session extends Entity implements \JsonSerializable {
|
||||
public $id;
|
||||
protected $userId;
|
||||
protected $token;
|
||||
protected $lastContact;
|
||||
protected $boardId;
|
||||
|
||||
public function __construct() {
|
||||
$this->addType('id', 'integer');
|
||||
$this->addType('boardId', 'integer');
|
||||
$this->addType('lastContact', 'integer');
|
||||
}
|
||||
|
||||
public function jsonSerialize(): array {
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'userId' => $this->userId,
|
||||
'token' => $this->token,
|
||||
'lastContact' => $this->lastContact,
|
||||
'boardId' => $this->boardId,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2022, chandi Langecker (git@chandi.it)
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace OCA\Deck\Db;
|
||||
|
||||
use OCA\Deck\Service\SessionService;
|
||||
use OCP\AppFramework\Db\DoesNotExistException;
|
||||
use OCP\AppFramework\Db\QBMapper;
|
||||
use OCP\IDBConnection;
|
||||
|
||||
/** @template-extends QBMapper<Session> */
|
||||
class SessionMapper extends QBMapper {
|
||||
public function __construct(IDBConnection $db) {
|
||||
parent::__construct($db, 'deck_sessions', Session::class);
|
||||
}
|
||||
|
||||
public function find(int $boardId, string $userId, string $token): Session {
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
$result = $qb->select('*')
|
||||
->from($this->getTableName())
|
||||
->where($qb->expr()->eq('token', $qb->createNamedParameter($token)))
|
||||
->andWhere($qb->expr()->gt('last_contact', $qb->createNamedParameter(time() - SessionService::SESSION_VALID_TIME)))
|
||||
->executeQuery();
|
||||
|
||||
$data = $result->fetch();
|
||||
$result->closeCursor();
|
||||
if ($data === false) {
|
||||
throw new DoesNotExistException('Session is invalid');
|
||||
}
|
||||
$session = Session::fromRow($data);
|
||||
if ($session->getUserId() != $userId || $session->getBoardId() != $boardId) {
|
||||
throw new DoesNotExistException('Session is invalid');
|
||||
}
|
||||
return $session;
|
||||
}
|
||||
|
||||
public function findAllActive($boardId) {
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
$qb->select('id', 'board_id', 'last_contact', 'user_id', 'token')
|
||||
->from($this->getTableName())
|
||||
->where($qb->expr()->eq('board_id', $qb->createNamedParameter($boardId)))
|
||||
->andWhere($qb->expr()->gt('last_contact', $qb->createNamedParameter(time() - SessionService::SESSION_VALID_TIME)))
|
||||
->executeQuery();
|
||||
|
||||
return $this->findEntities($qb);
|
||||
}
|
||||
public function deleteInactive(): int {
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
$qb->delete($this->getTableName())
|
||||
->where($qb->expr()->lt('last_contact', $qb->createNamedParameter(time() - SessionService::SESSION_VALID_TIME)));
|
||||
return $qb->executeStatement();
|
||||
}
|
||||
}
|
||||
@@ -26,27 +26,15 @@ namespace OCA\Deck\Db;
|
||||
use OCP\AppFramework\Db\DoesNotExistException;
|
||||
use OCP\AppFramework\Db\Entity;
|
||||
use OCP\AppFramework\Db\MultipleObjectsReturnedException;
|
||||
use OCP\Cache\CappedMemoryCache;
|
||||
use OCP\DB\QueryBuilder\IQueryBuilder;
|
||||
use OCP\IDBConnection;
|
||||
use OCP\ICache;
|
||||
use OCP\ICacheFactory;
|
||||
|
||||
/** @template-extends DeckMapper<Stack> */
|
||||
class StackMapper extends DeckMapper implements IPermissionMapper {
|
||||
private CappedMemoryCache $stackCache;
|
||||
private CardMapper $cardMapper;
|
||||
private ICache $cache;
|
||||
private $cardMapper;
|
||||
|
||||
public function __construct(
|
||||
IDBConnection $db,
|
||||
CardMapper $cardMapper,
|
||||
ICacheFactory $cacheFactory
|
||||
) {
|
||||
public function __construct(IDBConnection $db, CardMapper $cardMapper) {
|
||||
parent::__construct($db, 'deck_stacks', Stack::class);
|
||||
$this->cardMapper = $cardMapper;
|
||||
$this->stackCache = new CappedMemoryCache();
|
||||
$this->cache = $cacheFactory->createDistributed('deck-stackMapper');
|
||||
}
|
||||
|
||||
|
||||
@@ -58,17 +46,12 @@ class StackMapper extends DeckMapper implements IPermissionMapper {
|
||||
* @throws \OCP\DB\Exception
|
||||
*/
|
||||
public function find($id): Stack {
|
||||
if (isset($this->stackCache[(string)$id])) {
|
||||
return $this->stackCache[(string)$id];
|
||||
}
|
||||
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
$qb->select('*')
|
||||
->from($this->getTableName())
|
||||
->where($qb->expr()->eq('id', $qb->createNamedParameter($id, IQueryBuilder::PARAM_INT)));
|
||||
|
||||
$this->stackCache[(string)$id] = $this->findEntity($qb);
|
||||
return $this->stackCache[(string)$id];
|
||||
return $this->findEntity($qb);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -129,16 +112,14 @@ class StackMapper extends DeckMapper implements IPermissionMapper {
|
||||
return $this->findEntities($qb);
|
||||
}
|
||||
|
||||
public function update(Entity $entity): Entity {
|
||||
$result = parent::update($entity);
|
||||
$this->stackCache[(string)$entity->getId()] = $result;
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Entity $entity
|
||||
* @return Entity
|
||||
* @throws \OCP\DB\Exception
|
||||
*/
|
||||
public function delete(Entity $entity): Entity {
|
||||
// delete cards on stack
|
||||
$this->cardMapper->deleteByStack($entity->getId());
|
||||
unset($this->stackCache[(string)$entity->getId()]);
|
||||
return parent::delete($entity);
|
||||
}
|
||||
|
||||
@@ -165,19 +146,12 @@ class StackMapper extends DeckMapper implements IPermissionMapper {
|
||||
* @throws \OCP\DB\Exception
|
||||
*/
|
||||
public function findBoardId($id): ?int {
|
||||
$result = $this->cache->get('findBoardId:' . $id);
|
||||
if ($result !== null) {
|
||||
return $result !== false ? $result : null;
|
||||
}
|
||||
try {
|
||||
$entity = $this->find($id);
|
||||
$result = $entity->getBoardId();
|
||||
return $entity->getBoardId();
|
||||
} catch (DoesNotExistException $e) {
|
||||
$result = false;
|
||||
} catch (MultipleObjectsReturnedException $e) {
|
||||
}
|
||||
$this->cache->set('findBoardId:' . $id, $result);
|
||||
|
||||
return $result !== false ? $result : null;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,30 +23,27 @@
|
||||
|
||||
namespace OCA\Deck\Db;
|
||||
|
||||
use OCP\IUserManager;
|
||||
use OCP\IUser;
|
||||
|
||||
class User extends RelationalObject {
|
||||
private IUserManager $userManager;
|
||||
public function __construct($uid, IUserManager $userManager) {
|
||||
$this->userManager = $userManager;
|
||||
parent::__construct($uid, function ($object) {
|
||||
return $this->userManager->get($object->getPrimaryKey());
|
||||
});
|
||||
public function __construct(IUser $user) {
|
||||
$primaryKey = $user->getUID();
|
||||
parent::__construct($primaryKey, $user);
|
||||
}
|
||||
|
||||
public function getObjectSerialization() {
|
||||
return [
|
||||
'uid' => $this->getObject()->getUID(),
|
||||
'displayname' => $this->getObject()->getDisplayName(),
|
||||
'type' => Acl::PERMISSION_TYPE_USER
|
||||
'uid' => $this->object->getUID(),
|
||||
'displayname' => $this->object->getDisplayName(),
|
||||
'type' => 0
|
||||
];
|
||||
}
|
||||
|
||||
public function getUID() {
|
||||
return $this->getPrimaryKey();
|
||||
return $this->object->getUID();
|
||||
}
|
||||
|
||||
public function getDisplayName() {
|
||||
return $this->userManager->getDisplayName($this->getPrimaryKey());
|
||||
return $this->object->getDisplayName();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ use OCP\EventDispatcher\Event;
|
||||
|
||||
abstract class AAclEvent extends Event {
|
||||
private $acl;
|
||||
|
||||
|
||||
public function __construct(Acl $acl) {
|
||||
parent::__construct();
|
||||
|
||||
@@ -41,8 +41,4 @@ abstract class AAclEvent extends Event {
|
||||
public function getAcl(): Acl {
|
||||
return $this->acl;
|
||||
}
|
||||
|
||||
public function getBoardId(): int {
|
||||
return $this->acl->getBoardId();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* @copyright Copyright (c) 2022 chandi Langecker <git@chandi.it>
|
||||
*
|
||||
* @author chandi Langecker <git@chandi.it>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
|
||||
namespace OCA\Deck\Event;
|
||||
|
||||
use OCP\EventDispatcher\Event;
|
||||
|
||||
class BoardUpdatedEvent extends Event {
|
||||
private $boardId;
|
||||
|
||||
public function __construct(int $boardId) {
|
||||
parent::__construct();
|
||||
|
||||
$this->boardId = $boardId;
|
||||
}
|
||||
|
||||
public function getBoardId(): int {
|
||||
return $this->boardId;
|
||||
}
|
||||
}
|
||||
@@ -26,17 +26,5 @@ declare(strict_types=1);
|
||||
|
||||
namespace OCA\Deck\Event;
|
||||
|
||||
use OCA\Deck\Db\Card;
|
||||
|
||||
class CardUpdatedEvent extends ACardEvent {
|
||||
private $cardBefore;
|
||||
|
||||
public function __construct(Card $card, Card $before = null) {
|
||||
parent::__construct($card);
|
||||
$this->cardBefore = $before;
|
||||
}
|
||||
|
||||
public function getCardBefore() {
|
||||
return $this->cardBefore;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2022, chandi Langecker (git@chandi.it)
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
|
||||
namespace OCA\Deck\Event;
|
||||
|
||||
use OCP\EventDispatcher\Event;
|
||||
|
||||
class SessionClosedEvent extends Event {
|
||||
private $boardId;
|
||||
private $userId;
|
||||
|
||||
public function __construct(int $boardId, string $userId) {
|
||||
parent::__construct();
|
||||
|
||||
$this->boardId = $boardId;
|
||||
$this->userId = $userId;
|
||||
}
|
||||
|
||||
public function getBoardId(): int {
|
||||
return $this->boardId;
|
||||
}
|
||||
public function getUserId(): string {
|
||||
return $this->userId;
|
||||
}
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2022, chandi Langecker (git@chandi.it)
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
|
||||
namespace OCA\Deck\Event;
|
||||
|
||||
use OCP\EventDispatcher\Event;
|
||||
|
||||
class SessionCreatedEvent extends Event {
|
||||
private $boardId;
|
||||
private $userId;
|
||||
|
||||
public function __construct(int $boardId, string $userId) {
|
||||
parent::__construct();
|
||||
|
||||
$this->boardId = $boardId;
|
||||
$this->userId = $userId;
|
||||
}
|
||||
|
||||
public function getBoardId(): int {
|
||||
return $this->boardId;
|
||||
}
|
||||
public function getUserId(): string {
|
||||
return $this->userId;
|
||||
}
|
||||
}
|
||||
@@ -32,7 +32,6 @@ use OCP\EventDispatcher\IEventListener;
|
||||
use OCP\IRequest;
|
||||
use OCP\Util;
|
||||
|
||||
/** @template-implements IEventListener<Event|BeforeTemplateRenderedEvent> */
|
||||
class BeforeTemplateRenderedListener implements IEventListener {
|
||||
private $request;
|
||||
|
||||
@@ -51,11 +50,11 @@ class BeforeTemplateRenderedListener implements IEventListener {
|
||||
Util::addStyle('deck', 'deck');
|
||||
|
||||
$pathInfo = $this->request->getPathInfo();
|
||||
if (str_starts_with($pathInfo, '/apps/calendar')) {
|
||||
if (strpos($pathInfo, '/apps/calendar') === 0) {
|
||||
Util::addScript('deck', 'deck-calendar');
|
||||
}
|
||||
|
||||
if (str_starts_with($pathInfo, '/call/') || str_starts_with($pathInfo, '/apps/spreed')) {
|
||||
if (strpos($pathInfo, '/call/') === 0 || strpos($pathInfo, '/apps/spreed') === 0) {
|
||||
Util::addScript('deck', 'deck-talk');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,9 +42,8 @@ use OCP\FullTextSearch\Model\IIndex;
|
||||
use Psr\Container\ContainerInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
/** @template-implements IEventListener<Event|ACardEvent|AAclEvent> */
|
||||
class FullTextSearchEventListener implements IEventListener {
|
||||
|
||||
|
||||
/** @var string|null */
|
||||
private $userId;
|
||||
/** @var IFullTextSearchManager|null */
|
||||
@@ -53,7 +52,7 @@ class FullTextSearchEventListener implements IEventListener {
|
||||
private $service;
|
||||
/** @var LoggerInterface */
|
||||
private $logger;
|
||||
|
||||
|
||||
public function __construct(ContainerInterface $container, $userId) {
|
||||
$this->userId = $userId;
|
||||
$this->logger = $container->get(LoggerInterface::class);
|
||||
@@ -69,7 +68,7 @@ class FullTextSearchEventListener implements IEventListener {
|
||||
if (!$event instanceof ACardEvent && !$event instanceof AAclEvent) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
if ($event instanceof CardCreatedEvent) {
|
||||
$this->manager->createIndex(
|
||||
|
||||
@@ -1,115 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* @copyright Copyright (c) 2021 Julius Härtl <jus@bitgrid.net>
|
||||
*
|
||||
* @author Julius Härtl <jus@bitgrid.net>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
|
||||
namespace OCA\Deck\Listeners;
|
||||
|
||||
use OCA\Deck\Db\StackMapper;
|
||||
use OCA\Deck\NotifyPushEvents;
|
||||
use OCA\Deck\Event\AAclEvent;
|
||||
use OCA\Deck\Event\ACardEvent;
|
||||
use OCA\Deck\Event\BoardUpdatedEvent;
|
||||
use OCA\Deck\Event\CardUpdatedEvent;
|
||||
use OCA\Deck\Event\SessionClosedEvent;
|
||||
use OCA\Deck\Event\SessionCreatedEvent;
|
||||
use OCA\Deck\Service\SessionService;
|
||||
use OCA\NotifyPush\Queue\IQueue;
|
||||
use OCP\EventDispatcher\Event;
|
||||
use OCP\EventDispatcher\IEventListener;
|
||||
use OCP\IRequest;
|
||||
use Psr\Container\ContainerInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
/** @template-implements IEventListener<Event|SessionCreatedEvent|SessionClosedEvent|AAclEvent|ACardEvent|CardUpdatedEvent|BoardUpdatedEvent> */
|
||||
class LiveUpdateListener implements IEventListener {
|
||||
private LoggerInterface $logger;
|
||||
private SessionService $sessionService;
|
||||
private IRequest $request;
|
||||
private StackMapper $stackMapper;
|
||||
private $queue;
|
||||
|
||||
public function __construct(
|
||||
ContainerInterface $container,
|
||||
IRequest $request,
|
||||
LoggerInterface $logger,
|
||||
SessionService $sessionService,
|
||||
StackMapper $stackMapper
|
||||
) {
|
||||
try {
|
||||
$this->queue = $container->get(IQueue::class);
|
||||
} catch (\Exception $e) {
|
||||
// most likely notify_push is not installed.
|
||||
return;
|
||||
}
|
||||
$this->logger = $logger;
|
||||
$this->sessionService = $sessionService;
|
||||
$this->request = $request;
|
||||
$this->stackMapper = $stackMapper;
|
||||
}
|
||||
|
||||
public function handle(Event $event): void {
|
||||
if (!$this->queue) {
|
||||
// notify_push is not active
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
// the web frontend is adding the Session-ID as a header
|
||||
// TODO: verify the token! this currently allows to spoof a token from someone
|
||||
// else, preventing this person from getting updates
|
||||
$causingSessionToken = $this->request->getHeader('x-nc-deck-session');
|
||||
if (
|
||||
$event instanceof SessionCreatedEvent ||
|
||||
$event instanceof SessionClosedEvent ||
|
||||
$event instanceof BoardUpdatedEvent ||
|
||||
$event instanceof AAclEvent
|
||||
) {
|
||||
$this->sessionService->notifyAllSessions($this->queue, $event->getBoardId(), NotifyPushEvents::DeckBoardUpdate, [
|
||||
'id' => $event->getBoardId()
|
||||
], $causingSessionToken);
|
||||
} elseif ($event instanceof ACardEvent) {
|
||||
$boardId = $this->stackMapper->findBoardId($event->getCard()->getStackId());
|
||||
$this->sessionService->notifyAllSessions($this->queue, $boardId, NotifyPushEvents::DeckCardUpdate, [
|
||||
'boardId' => $boardId,
|
||||
'cardId' => $event->getCard()->getId()
|
||||
], $causingSessionToken);
|
||||
|
||||
// if card got moved to a diferent board, we should notify
|
||||
// also sessions active on the previous board
|
||||
if ($event instanceof CardUpdatedEvent && $event->getCardBefore()) {
|
||||
$previousBoardId = $this->stackMapper->findBoardId($event->getCardBefore()->getStackId());
|
||||
if ($boardId !== $previousBoardId) {
|
||||
$this->sessionService->notifyAllSessions($this->queue, $previousBoardId, NotifyPushEvents::DeckCardUpdate, [
|
||||
'boardId' => $boardId,
|
||||
'cardId' => $event->getCard()->getId()
|
||||
], $causingSessionToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
$this->logger->error('Error when handling live update event', ['exception' => $e]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace OCA\Deck\Listeners;
|
||||
|
||||
use OCA\Circles\Events\CircleDestroyedEvent;
|
||||
use OCA\Deck\Db\Acl;
|
||||
use OCA\Deck\Db\AclMapper;
|
||||
use OCA\Deck\Db\AssignmentMapper;
|
||||
use OCA\Deck\Db\BoardMapper;
|
||||
use OCP\EventDispatcher\Event;
|
||||
use OCP\EventDispatcher\IEventListener;
|
||||
use OCP\Group\Events\GroupDeletedEvent;
|
||||
use OCP\User\Events\UserDeletedEvent;
|
||||
|
||||
/** @template-implements IEventListener<Event|UserDeletedEvent|GroupDeletedEvent|CircleDestroyedEvent> */
|
||||
class ParticipantCleanupListener implements IEventListener {
|
||||
private AclMapper $aclMapper;
|
||||
private AssignmentMapper $assignmentMapper;
|
||||
private BoardMapper $boardMapper;
|
||||
|
||||
public function __construct(AclMapper $aclMapper, AssignmentMapper $assignmentMapper, BoardMapper $boardMapper) {
|
||||
$this->aclMapper = $aclMapper;
|
||||
$this->assignmentMapper = $assignmentMapper;
|
||||
$this->boardMapper = $boardMapper;
|
||||
}
|
||||
|
||||
public function handle(Event $event): void {
|
||||
if ($event instanceof UserDeletedEvent) {
|
||||
$boards = $this->boardMapper->findAllByOwner($event->getUser()->getUID());
|
||||
foreach ($boards as $board) {
|
||||
$this->boardMapper->delete($board);
|
||||
}
|
||||
|
||||
$this->cleanupByParticipant(Acl::PERMISSION_TYPE_USER, $event->getUser()->getUID());
|
||||
}
|
||||
|
||||
if ($event instanceof GroupDeletedEvent) {
|
||||
$this->cleanupByParticipant(Acl::PERMISSION_TYPE_GROUP, $event->getGroup()->getGID());
|
||||
}
|
||||
|
||||
if ($event instanceof CircleDestroyedEvent) {
|
||||
$circleId = $event->getCircle()->getSingleId();
|
||||
$this->cleanupByParticipant(Acl::PERMISSION_TYPE_CIRCLE, $circleId);
|
||||
}
|
||||
}
|
||||
|
||||
private function cleanupByParticipant(int $type, string $participant): void {
|
||||
$acls = $this->aclMapper->findByParticipant($type, $participant);
|
||||
foreach ($acls as $acl) {
|
||||
$this->aclMapper->delete($acl);
|
||||
}
|
||||
|
||||
$assignments = $this->assignmentMapper->findByParticipant($participant, $type);
|
||||
foreach ($assignments as $assignment) {
|
||||
$this->assignmentMapper->delete($assignment);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace OCA\Deck\Listeners;
|
||||
|
||||
use OCP\Collaboration\Resources\LoadAdditionalScriptsEvent;
|
||||
use OCP\EventDispatcher\Event;
|
||||
use OCP\EventDispatcher\IEventListener;
|
||||
use OCP\IRequest;
|
||||
use OCP\Util;
|
||||
|
||||
/** @template-implements IEventListener<Event|LoadAdditionalScriptsEvent> */
|
||||
class ResourceAdditionalScriptsListener implements IEventListener {
|
||||
private IRequest $request;
|
||||
|
||||
public function __construct(IRequest $request) {
|
||||
$this->request = $request;
|
||||
}
|
||||
|
||||
public function handle(Event $event): void {
|
||||
if (!$event instanceof LoadAdditionalScriptsEvent) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (str_starts_with($this->request->getPathInfo(), '/call/')) {
|
||||
// Talk integration has its own entrypoint which already includes collections handling
|
||||
return;
|
||||
}
|
||||
|
||||
Util::addScript('deck', 'deck-collections');
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace OCA\Deck\Listeners;
|
||||
|
||||
use OCA\Deck\Collaboration\Resources\ResourceProvider;
|
||||
use OCA\Deck\Collaboration\Resources\ResourceProviderCard;
|
||||
use OCA\Deck\Event\AclCreatedEvent;
|
||||
use OCA\Deck\Event\AclDeletedEvent;
|
||||
use OCP\Collaboration\Resources\IManager;
|
||||
use OCP\Collaboration\Resources\ResourceException;
|
||||
use OCP\EventDispatcher\Event;
|
||||
use OCP\EventDispatcher\IEventListener;
|
||||
|
||||
/** @template-implements IEventListener<Event|AclDeletedEvent|AclCreatedEvent> */
|
||||
class ResourceListener implements IEventListener {
|
||||
|
||||
/** @var IManager */
|
||||
private $resourceManager;
|
||||
/** @var ResourceProviderCard */
|
||||
private $resourceProviderCard;
|
||||
|
||||
public function __construct(IManager $resourceManager, ResourceProviderCard $resourceProviderCard) {
|
||||
$this->resourceManager = $resourceManager;
|
||||
$this->resourceProviderCard = $resourceProviderCard;
|
||||
}
|
||||
|
||||
public function handle(Event $event): void {
|
||||
if (!$event instanceof AclDeletedEvent && !$event instanceof AclCreatedEvent) {
|
||||
return;
|
||||
}
|
||||
|
||||
$boardId = $event->getAcl()->getBoardId();
|
||||
|
||||
$this->resourceManager->invalidateAccessCacheForProvider($this->resourceProviderCard);
|
||||
|
||||
try {
|
||||
$resource = $this->resourceManager->getResourceForUser(ResourceProvider::RESOURCE_TYPE, $boardId, null);
|
||||
$this->resourceManager->invalidateAccessCacheForResource($resource);
|
||||
} catch (ResourceException $e) {
|
||||
// If there is no resource we don't need to invalidate anything, but this should not happen anyways
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -33,6 +33,7 @@ use OCP\AppFramework\OCS\OCSException;
|
||||
use OCP\AppFramework\OCSController;
|
||||
use OCP\ILogger;
|
||||
use OCP\IRequest;
|
||||
use OCP\Util;
|
||||
use OCP\IConfig;
|
||||
|
||||
class ExceptionMiddleware extends Middleware {
|
||||
@@ -84,9 +85,9 @@ class ExceptionMiddleware extends Middleware {
|
||||
'message' => 'Permission denied'
|
||||
], 403);
|
||||
}
|
||||
|
||||
|
||||
if ($exception instanceof StatusException) {
|
||||
if ($this->config->getSystemValue('loglevel', ILogger::WARN) === ILogger::DEBUG) {
|
||||
if ($this->config->getSystemValue('loglevel', Util::WARN) === Util::DEBUG) {
|
||||
$this->logger->logException($exception);
|
||||
}
|
||||
|
||||
@@ -109,7 +110,7 @@ class ExceptionMiddleware extends Middleware {
|
||||
], $exception->getStatus());
|
||||
}
|
||||
|
||||
if (str_starts_with(get_class($controller), 'OCA\\Deck\\Controller\\')) {
|
||||
if (strpos(get_class($controller), 'OCA\\Deck\\Controller\\') === 0) {
|
||||
$response = [
|
||||
'status' => 500,
|
||||
'message' => $exceptionMessage,
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace OCA\Deck\Migration;
|
||||
|
||||
use OCA\Deck\Db\Acl;
|
||||
use OCA\Deck\Db\AclMapper;
|
||||
use OCA\Deck\Service\CirclesService;
|
||||
use OCP\Migration\IOutput;
|
||||
use OCP\Migration\IRepairStep;
|
||||
|
||||
class DeletedCircleCleanup implements IRepairStep {
|
||||
private AclMapper $aclMapper;
|
||||
private CirclesService $circleService;
|
||||
|
||||
public function __construct(AclMapper $aclMapper, CirclesService $circlesService) {
|
||||
$this->aclMapper = $aclMapper;
|
||||
$this->circleService = $circlesService;
|
||||
}
|
||||
|
||||
public function getName() {
|
||||
return 'Cleanup Deck ACL entries for circles which have been already deleted';
|
||||
}
|
||||
|
||||
public function run(IOutput $output) {
|
||||
if (!$this->circleService->isCirclesEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($this->aclMapper->findByType(Acl::PERMISSION_TYPE_CIRCLE) as $acl) {
|
||||
if ($this->circleService->getCircle($acl->getParticipant()) === null) {
|
||||
$this->aclMapper->delete($acl);
|
||||
$output->info('Removed circle with id ' . $acl->getParticipant());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2022, chandi Langecker (git@chandi.it)
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
|
||||
namespace OCA\Deck\Migration;
|
||||
|
||||
use Closure;
|
||||
use OCP\DB\ISchemaWrapper;
|
||||
use OCP\DB\Types;
|
||||
use OCP\Migration\IOutput;
|
||||
use OCP\Migration\SimpleMigrationStep;
|
||||
|
||||
class Version10900Date202206151724222 extends SimpleMigrationStep {
|
||||
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
|
||||
$schema = $schemaClosure();
|
||||
|
||||
if (!$schema->hasTable('deck_sessions')) {
|
||||
$table = $schema->createTable('deck_sessions');
|
||||
$table->addColumn('id', Types::INTEGER, [
|
||||
'autoincrement' => true,
|
||||
'notnull' => true,
|
||||
'unsigned' => true,
|
||||
]);
|
||||
$table->addColumn('user_id', Types::STRING, [
|
||||
'notnull' => false,
|
||||
'length' => 64,
|
||||
]);
|
||||
$table->addColumn('board_id', Types::INTEGER, [
|
||||
'notnull' => false,
|
||||
]);
|
||||
$table->addColumn('token', Types::STRING, [
|
||||
'notnull' => true,
|
||||
'length' => 64,
|
||||
]);
|
||||
$table->addColumn('last_contact', Types::INTEGER, [
|
||||
'notnull' => true,
|
||||
'length' => 20,
|
||||
'unsigned' => true,
|
||||
]);
|
||||
$table->setPrimaryKey(['id']);
|
||||
$table->addIndex(['board_id'], 'deck_session_board_id_idx');
|
||||
$table->addIndex(['token'], 'deck_session_token_idx');
|
||||
$table->addIndex(['last_contact'], 'deck_session_last_contact_idx');
|
||||
}
|
||||
return $schema;
|
||||
}
|
||||
}
|
||||
@@ -39,10 +39,6 @@ class BoardSummary extends Board {
|
||||
];
|
||||
}
|
||||
|
||||
protected function getter(string $name): mixed {
|
||||
return $this->board->getter($name);
|
||||
}
|
||||
|
||||
public function __call($name, $arguments) {
|
||||
return $this->board->__call($name, $arguments);
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
*/
|
||||
namespace OCA\Deck\Model;
|
||||
|
||||
use DateTime;
|
||||
use OCA\Deck\Db\Board;
|
||||
use OCA\Deck\Db\Card;
|
||||
|
||||
@@ -40,14 +41,6 @@ class CardDetails extends Card {
|
||||
}
|
||||
|
||||
public function jsonSerialize(array $extras = []): array {
|
||||
$array = parent::jsonSerialize();
|
||||
$array['overdue'] = $this->getDueStatus();
|
||||
|
||||
unset($array['notified']);
|
||||
unset($array['descriptionPrev']);
|
||||
unset($array['relatedStack']);
|
||||
unset($array['relatedBoard']);
|
||||
|
||||
$array = $this->card->jsonSerialize();
|
||||
unset($array['notified'], $array['descriptionPrev'], $array['relatedStack'], $array['relatedBoard']);
|
||||
|
||||
@@ -58,18 +51,30 @@ class CardDetails extends Card {
|
||||
}
|
||||
|
||||
private function getDueStatus(): int {
|
||||
$diffDays = $this->getDaysUntilDue();
|
||||
if ($diffDays === null || $diffDays > 1) {
|
||||
return static::DUEDATE_FUTURE;
|
||||
$today = new DateTime();
|
||||
$today->setTime(0, 0);
|
||||
|
||||
$match_date = $this->card->getDuedate();
|
||||
if (!$match_date) {
|
||||
return Card::DUEDATE_FUTURE;
|
||||
}
|
||||
$match_date->setTime(0, 0);
|
||||
|
||||
$diff = $today->diff($match_date);
|
||||
$diffDays = (int) $diff->format('%R%a'); // Extract days count in interval
|
||||
|
||||
|
||||
if ($diffDays === 1) {
|
||||
return static::DUEDATE_NEXT;
|
||||
return Card::DUEDATE_NEXT;
|
||||
}
|
||||
if ($diffDays === 0) {
|
||||
return static::DUEDATE_NOW;
|
||||
return Card::DUEDATE_NOW;
|
||||
}
|
||||
if ($diffDays < 0) {
|
||||
return Card::DUEDATE_OVERDUE;
|
||||
}
|
||||
|
||||
return static::DUEDATE_OVERDUE;
|
||||
return Card::DUEDATE_FUTURE;
|
||||
}
|
||||
|
||||
private function appendBoardDetails(&$array): void {
|
||||
@@ -81,11 +86,7 @@ class CardDetails extends Card {
|
||||
$array['board'] = (new BoardSummary($this->board))->jsonSerialize();
|
||||
}
|
||||
|
||||
protected function getter(string $name): mixed {
|
||||
return $this->card->getter($name);
|
||||
}
|
||||
|
||||
public function __call(string $methodName, array $args) {
|
||||
return $this->card->__call($methodName, $args);
|
||||
public function __call($name, $arguments) {
|
||||
return $this->card->__call($name, $arguments);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2022, chandi Langecker (git@chandi.it)
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace OCA\Deck;
|
||||
|
||||
class NotifyPushEvents {
|
||||
public const DeckBoardUpdate = 'deck_board_update';
|
||||
public const DeckCardUpdate = 'deck_card_update';
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user