Compare commits
125
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1b233449c5 | ||
|
|
3ad5797307 | ||
|
|
1cc3f3c7fe | ||
|
|
ac91e942a5 | ||
|
|
29b9001078 | ||
|
|
a9f1a3a8c5 | ||
|
|
7d2ef17369 | ||
|
|
d53164d196 | ||
|
|
af11a6527f | ||
|
|
0472acac98 | ||
|
|
d0c85e844c | ||
|
|
b1f06f8ff6 | ||
|
|
bdc721a93a | ||
|
|
685992383d | ||
|
|
8b6a84733b | ||
|
|
0b20754de7 | ||
|
|
aee9126806 | ||
|
|
5eebfb3371 | ||
|
|
d50572c544 | ||
|
|
302424b047 | ||
|
|
cda8155de4 | ||
|
|
38964ace04 | ||
|
|
21af73ff93 | ||
|
|
92b90013ab | ||
|
|
3e9c41cfc6 | ||
|
|
a88124cfce | ||
|
|
e22fb1e73e | ||
|
|
a015a4f3af | ||
|
|
9cf18a2efa | ||
|
|
8832b9de29 | ||
|
|
a4a52f4747 | ||
|
|
9219f7032e | ||
|
|
35a463c984 | ||
|
|
8ab387396d | ||
|
|
ab03a8bb2c | ||
|
|
de09bb779f | ||
|
|
7e69200483 | ||
|
|
e124d09738 | ||
|
|
12894c4619 | ||
|
|
841cf10545 | ||
|
|
b31e95d439 | ||
|
|
3efa9577c7 | ||
|
|
e21138e1c7 | ||
|
|
2b44b5f7cd | ||
|
|
07faa1b1b3 | ||
|
|
9dcbfb0514 | ||
|
|
2e67a42021 | ||
|
|
cb9e84908f | ||
|
|
8a003db3af | ||
|
|
de110b37be | ||
|
|
f10e8dc30f | ||
|
|
3b7f78eaa5 | ||
|
|
7070c88894 | ||
|
|
d657a853fa | ||
|
|
d81f2db6ef | ||
|
|
425f6378c6 | ||
|
|
b6806acda0 | ||
|
|
fa873f5540 | ||
|
|
faff1040dc | ||
|
|
4c74a3f859 | ||
|
|
b6e22cba7d | ||
|
|
3271a935c5 | ||
|
|
8be3321efd | ||
|
|
80d22d5060 | ||
|
|
1eaeb8d003 | ||
|
|
8d05b5cb01 | ||
|
|
754d56ca82 | ||
|
|
d22bc79d3c | ||
|
|
3855e179a9 | ||
|
|
1fe5e9cc55 | ||
|
|
5478acfc09 | ||
|
|
287d4f7de2 | ||
|
|
14a3156465 | ||
|
|
daa7ad053c | ||
|
|
6a94c39ea8 | ||
|
|
ca048d07f9 | ||
|
|
3ce477e1d1 | ||
|
|
9f9b00144b | ||
|
|
308e634c71 | ||
|
|
54994a1671 | ||
|
|
ca967782e8 | ||
|
|
84dbc5fd84 | ||
|
|
4d8c957f75 | ||
|
|
654f375d39 | ||
|
|
bdb3df8395 | ||
|
|
df41a96148 | ||
|
|
892b8ad89a | ||
|
|
b4ac1adacb | ||
|
|
0706ca60b5 | ||
|
|
15d95f16da | ||
|
|
f7f1b1638b | ||
|
|
2ece97fc2b | ||
|
|
71901a62f2 | ||
|
|
cda0848b2a | ||
|
|
261c6e6c9e | ||
|
|
204dccf08b | ||
|
|
c85cfcce6a | ||
|
|
c35c70e71f | ||
|
|
dea123dbea | ||
|
|
5643027454 | ||
|
|
b9cdc9fbe5 | ||
|
|
003db05b66 | ||
|
|
c5a97ef0a3 | ||
|
|
8776465fa2 | ||
|
|
51bdbba286 | ||
|
|
3c70bd630d | ||
|
|
2d5e2f70b9 | ||
|
|
2c8ca629de | ||
|
|
a61ac5ac32 | ||
|
|
8c9d75e9a4 | ||
|
|
28f208542f | ||
|
|
6a2a78d014 | ||
|
|
2c791e6dd2 | ||
|
|
4d2021997a | ||
|
|
732902919b | ||
|
|
31ae716ab2 | ||
|
|
207b88a286 | ||
|
|
50a0674835 | ||
|
|
8181829c9e | ||
|
|
83aeb90376 | ||
|
|
e4584109df | ||
|
|
6d7748988a | ||
|
|
363da6c80f | ||
|
|
3f1d0f390b | ||
|
|
edf206aba6 |
+168
-120
@@ -40,7 +40,6 @@ volumes:
|
||||
- name: tmp-postgres-migration
|
||||
temp:
|
||||
medium: memory
|
||||
|
||||
|
||||
services:
|
||||
- name: test-mysql-unit
|
||||
@@ -161,7 +160,7 @@ steps:
|
||||
- name: test-migration-sqlite
|
||||
image: vikunja/golang-build:latest
|
||||
pull: always
|
||||
depends_on:
|
||||
depends_on:
|
||||
- test-migration-prepare
|
||||
- api-build
|
||||
environment:
|
||||
@@ -444,7 +443,7 @@ steps:
|
||||
depends_on:
|
||||
- frontend-build-prod
|
||||
- test-api-run
|
||||
|
||||
|
||||
- name: frontend-deploy-preview
|
||||
image: williamjackson/netlify-cli
|
||||
pull: always
|
||||
@@ -499,7 +498,7 @@ steps:
|
||||
environment:
|
||||
GOPROXY: 'https://goproxy.kolaente.de'
|
||||
commands:
|
||||
- mage do-the-swag
|
||||
- mage generate:swagger-docs
|
||||
|
||||
- name: push
|
||||
pull: always
|
||||
@@ -579,6 +578,53 @@ steps:
|
||||
when:
|
||||
event: [ push, tag, pull_request ]
|
||||
|
||||
- name: generate-config-yaml
|
||||
image: vikunja/golang-build:latest
|
||||
pull: always
|
||||
commands:
|
||||
- ./mage-static generate:config-yaml 1
|
||||
depends_on: [ mage ]
|
||||
|
||||
- name: upload-config-yaml-unstable
|
||||
image: plugins/s3
|
||||
pull: always
|
||||
settings:
|
||||
bucket: vikunja
|
||||
access_key:
|
||||
from_secret: hetzner_access_key_id
|
||||
secret_key:
|
||||
from_secret: hetzner_secret_access_key
|
||||
endpoint: https://fsn1.your-objectstorage.com
|
||||
region: fsn1
|
||||
path_style: true
|
||||
source: config.yml.sample
|
||||
target: /vikunja/unstable/
|
||||
when:
|
||||
branch:
|
||||
- main
|
||||
event:
|
||||
- push
|
||||
depends_on: [ generate-config-yaml ]
|
||||
|
||||
- name: upload-config-yaml-version
|
||||
image: plugins/s3
|
||||
pull: always
|
||||
settings:
|
||||
bucket: vikunja
|
||||
access_key:
|
||||
from_secret: hetzner_access_key_id
|
||||
secret_key:
|
||||
from_secret: hetzner_secret_access_key
|
||||
endpoint: https://fsn1.your-objectstorage.com
|
||||
region: fsn1
|
||||
path_style: true
|
||||
source: config.yml.sample
|
||||
target: /vikunja/${DRONE_TAG##v}/
|
||||
when:
|
||||
event:
|
||||
- tag
|
||||
depends_on: [ generate-config-yaml ]
|
||||
|
||||
- name: before-static-build
|
||||
image: techknowlogick/xgo:latest
|
||||
pull: always
|
||||
@@ -653,6 +699,7 @@ steps:
|
||||
- after-build-compress
|
||||
commands:
|
||||
- go install github.com/magefile/mage
|
||||
- ./mage-static generate:config-yaml 1
|
||||
- ./mage-static release:copy
|
||||
- ./mage-static release:check
|
||||
- ./mage-static release:os-package
|
||||
@@ -676,13 +723,13 @@ steps:
|
||||
image: plugins/s3
|
||||
pull: always
|
||||
settings:
|
||||
bucket: vikunja-releases
|
||||
bucket: vikunja
|
||||
access_key:
|
||||
from_secret: aws_access_key_id
|
||||
from_secret: hetzner_access_key_id
|
||||
secret_key:
|
||||
from_secret: aws_secret_access_key
|
||||
endpoint: https://s3.fr-par.scw.cloud
|
||||
region: fr-par
|
||||
from_secret: hetzner_secret_access_key
|
||||
endpoint: https://fsn1.your-objectstorage.com
|
||||
region: fsn1
|
||||
path_style: true
|
||||
strip_prefix: dist/zip/
|
||||
source: dist/zip/*
|
||||
@@ -698,13 +745,13 @@ steps:
|
||||
image: plugins/s3
|
||||
pull: always
|
||||
settings:
|
||||
bucket: vikunja-releases
|
||||
bucket: vikunja
|
||||
access_key:
|
||||
from_secret: aws_access_key_id
|
||||
from_secret: hetzner_access_key_id
|
||||
secret_key:
|
||||
from_secret: aws_secret_access_key
|
||||
endpoint: https://s3.fr-par.scw.cloud
|
||||
region: fr-par
|
||||
from_secret: hetzner_secret_access_key
|
||||
endpoint: https://fsn1.your-objectstorage.com
|
||||
region: fsn1
|
||||
path_style: true
|
||||
strip_prefix: dist/zip/
|
||||
source: dist/zip/*
|
||||
@@ -750,13 +797,13 @@ steps:
|
||||
image: plugins/s3
|
||||
pull: always
|
||||
settings:
|
||||
bucket: vikunja-releases
|
||||
bucket: vikunja
|
||||
access_key:
|
||||
from_secret: aws_access_key_id
|
||||
from_secret: hetzner_access_key_id
|
||||
secret_key:
|
||||
from_secret: aws_secret_access_key
|
||||
endpoint: https://s3.fr-par.scw.cloud
|
||||
region: fr-par
|
||||
from_secret: hetzner_secret_access_key
|
||||
endpoint: https://fsn1.your-objectstorage.com
|
||||
region: fsn1
|
||||
path_style: true
|
||||
strip_prefix: dist/os-packages/
|
||||
source: dist/os-packages/*
|
||||
@@ -772,13 +819,13 @@ steps:
|
||||
image: plugins/s3
|
||||
pull: always
|
||||
settings:
|
||||
bucket: vikunja-releases
|
||||
bucket: vikunja
|
||||
access_key:
|
||||
from_secret: aws_access_key_id
|
||||
from_secret: hetzner_access_key_id
|
||||
secret_key:
|
||||
from_secret: aws_secret_access_key
|
||||
endpoint: https://s3.fr-par.scw.cloud
|
||||
region: fr-par
|
||||
from_secret: hetzner_secret_access_key
|
||||
endpoint: https://fsn1.your-objectstorage.com
|
||||
region: fsn1
|
||||
path_style: true
|
||||
strip_prefix: dist/os-packages/
|
||||
source: dist/os-packages/*
|
||||
@@ -797,7 +844,7 @@ steps:
|
||||
base_url: https://kolaente.dev
|
||||
files: dist/zip/*
|
||||
prerelease: true
|
||||
title: ${DRONE_TAG##v}
|
||||
title: ${DRONE_TAG##v}
|
||||
when:
|
||||
event:
|
||||
- tag
|
||||
@@ -899,7 +946,7 @@ steps:
|
||||
image: docker:git
|
||||
commands:
|
||||
- git fetch --tags
|
||||
|
||||
|
||||
- name: build
|
||||
image: node:20.16.0-alpine
|
||||
pull: always
|
||||
@@ -931,13 +978,13 @@ steps:
|
||||
image: plugins/s3
|
||||
pull: always
|
||||
settings:
|
||||
bucket: vikunja-releases
|
||||
bucket: vikunja
|
||||
access_key:
|
||||
from_secret: aws_access_key_id
|
||||
from_secret: hetzner_access_key_id
|
||||
secret_key:
|
||||
from_secret: aws_secret_access_key
|
||||
endpoint: https://s3.fr-par.scw.cloud
|
||||
region: fr-par
|
||||
from_secret: hetzner_secret_access_key
|
||||
endpoint: https://fsn1.your-objectstorage.com
|
||||
region: fsn1
|
||||
path_style: true
|
||||
source: frontend/vikunja-frontend-unstable.zip
|
||||
target: /
|
||||
@@ -960,7 +1007,7 @@ steps:
|
||||
image: docker:git
|
||||
commands:
|
||||
- git fetch --tags
|
||||
|
||||
|
||||
- name: build
|
||||
image: node:20.16.0-alpine
|
||||
pull: always
|
||||
@@ -990,13 +1037,13 @@ steps:
|
||||
image: plugins/s3
|
||||
pull: always
|
||||
settings:
|
||||
bucket: vikunja-releases
|
||||
bucket: vikunja
|
||||
access_key:
|
||||
from_secret: aws_access_key_id
|
||||
from_secret: hetzner_access_key_id
|
||||
secret_key:
|
||||
from_secret: aws_secret_access_key
|
||||
endpoint: https://s3.fr-par.scw.cloud
|
||||
region: fr-par
|
||||
from_secret: hetzner_secret_access_key
|
||||
endpoint: https://fsn1.your-objectstorage.com
|
||||
region: fsn1
|
||||
path_style: true
|
||||
source: frontend/vikunja-frontend-${DRONE_TAG##v}.zip
|
||||
target: /
|
||||
@@ -1083,33 +1130,33 @@ steps:
|
||||
image: docker:git
|
||||
commands:
|
||||
- git fetch --tags
|
||||
#
|
||||
# - name: restore-cache
|
||||
# image: meltwater/drone-cache:dev
|
||||
# pull: true
|
||||
# environment:
|
||||
# AWS_ACCESS_KEY_ID:
|
||||
# from_secret: cache_aws_access_key_id
|
||||
# AWS_SECRET_ACCESS_KEY:
|
||||
# from_secret: cache_aws_secret_access_key
|
||||
# settings:
|
||||
# restore: true
|
||||
# bucket: kolaente.dev-drone-dependency-cache
|
||||
# endpoint: https://s3.fr-par.scw.cloud
|
||||
# region: fr-par
|
||||
# path_style: true
|
||||
# cache_key: '{{ .Repo.Name }}_{{ checksum "desktop/yarn.lock" }}_{{ arch }}_{{ os }}'
|
||||
# mount:
|
||||
# - '.cache'
|
||||
#
|
||||
# - name: restore-cache
|
||||
# image: meltwater/drone-cache:dev
|
||||
# pull: true
|
||||
# environment:
|
||||
# AWS_ACCESS_KEY_ID:
|
||||
# from_secret: cache_aws_access_key_id
|
||||
# AWS_SECRET_ACCESS_KEY:
|
||||
# from_secret: cache_aws_secret_access_key
|
||||
# settings:
|
||||
# restore: true
|
||||
# bucket: kolaente.dev-drone-dependency-cache
|
||||
# endpoint: https://fsn1.your-objectstorage.com
|
||||
# region: fsn1
|
||||
# path_style: true
|
||||
# cache_key: '{{ .Repo.Name }}_{{ checksum "desktop/yarn.lock" }}_{{ arch }}_{{ os }}'
|
||||
# mount:
|
||||
# - '.cache'
|
||||
|
||||
- name: build
|
||||
image: electronuserland/builder:wine-mono
|
||||
pull: true
|
||||
environment:
|
||||
YARN_CACHE_FOLDER: .cache/yarn/
|
||||
PNPM_CACHE_FOLDER: .cache/pnpm
|
||||
depends_on:
|
||||
- fetch-tags
|
||||
# - restore-cache
|
||||
# - restore-cache
|
||||
commands:
|
||||
- cd desktop
|
||||
- export VERSION=${DRONE_TAG##v}
|
||||
@@ -1119,8 +1166,9 @@ steps:
|
||||
- unzip vikunja-frontend-$$VERSION.zip -d frontend
|
||||
- sed -i 's/\\/api\\/v1//g' frontend/index.html
|
||||
- ./bumpp.sh
|
||||
- yarn install
|
||||
- yarn dist --linux zip
|
||||
- corepack enable && pnpm config set store-dir .cache/pnpm
|
||||
- pnpm install --fetch-timeout 100000
|
||||
- pnpm dist --linux zip
|
||||
|
||||
# - name: rebuild-cache
|
||||
# image: meltwater/drone-cache:dev
|
||||
@@ -1133,8 +1181,8 @@ steps:
|
||||
# settings:
|
||||
# rebuild: true
|
||||
# bucket: kolaente.dev-drone-dependency-cache
|
||||
# endpoint: https://s3.fr-par.scw.cloud
|
||||
# region: fr-par
|
||||
# endpoint: https://fsn1.your-objectstorage.com
|
||||
# region: fsn1
|
||||
# path_style: true
|
||||
# cache_key: '{{ .Repo.Name }}_{{ checksum "desktop/yarn.lock" }}_{{ arch }}_{{ os }}'
|
||||
# mount:
|
||||
@@ -1164,33 +1212,33 @@ steps:
|
||||
image: docker:git
|
||||
commands:
|
||||
- git fetch --tags
|
||||
|
||||
# - name: restore-cache
|
||||
# image: meltwater/drone-cache:dev
|
||||
# pull: true
|
||||
# environment:
|
||||
# AWS_ACCESS_KEY_ID:
|
||||
# from_secret: cache_aws_access_key_id
|
||||
# AWS_SECRET_ACCESS_KEY:
|
||||
# from_secret: cache_aws_secret_access_key
|
||||
# settings:
|
||||
# restore: true
|
||||
# bucket: kolaente.dev-drone-dependency-cache
|
||||
# endpoint: https://s3.fr-par.scw.cloud
|
||||
# region: fr-par
|
||||
# path_style: true
|
||||
# cache_key: '{{ .Repo.Name }}_{{ checksum "desktop/yarn.lock" }}_{{ arch }}_{{ os }}'
|
||||
# mount:
|
||||
# - '.cache'
|
||||
|
||||
# - name: restore-cache
|
||||
# image: meltwater/drone-cache:dev
|
||||
# pull: true
|
||||
# environment:
|
||||
# AWS_ACCESS_KEY_ID:
|
||||
# from_secret: cache_aws_access_key_id
|
||||
# AWS_SECRET_ACCESS_KEY:
|
||||
# from_secret: cache_aws_secret_access_key
|
||||
# settings:
|
||||
# restore: true
|
||||
# bucket: kolaente.dev-drone-dependency-cache
|
||||
# endpoint: https://fsn1.your-objectstorage.com
|
||||
# region: fsn1
|
||||
# path_style: true
|
||||
# cache_key: '{{ .Repo.Name }}_{{ checksum "desktop/yarn.lock" }}_{{ arch }}_{{ os }}'
|
||||
# mount:
|
||||
# - '.cache'
|
||||
|
||||
- name: build
|
||||
image: electronuserland/builder:wine-mono
|
||||
pull: true
|
||||
environment:
|
||||
YARN_CACHE_FOLDER: .cache/yarn/
|
||||
PNPM_CACHE_FOLDER: .cache/pnpm
|
||||
depends_on:
|
||||
- fetch-tags
|
||||
# - restore-cache
|
||||
# - restore-cache
|
||||
commands:
|
||||
- cd desktop
|
||||
- export VERSION=${DRONE_TAG##v}
|
||||
@@ -1200,30 +1248,30 @@ steps:
|
||||
- unzip vikunja-frontend-$$VERSION.zip -d frontend
|
||||
- sed -i 's/\\/api\\/v1//g' frontend/index.html
|
||||
- ./bumpp.sh
|
||||
- yarn install
|
||||
- cat package.json
|
||||
- yarn dist --linux --windows
|
||||
|
||||
# - name: rebuild-cache
|
||||
# image: meltwater/drone-cache:dev
|
||||
# pull: true
|
||||
# environment:
|
||||
# AWS_ACCESS_KEY_ID:
|
||||
# from_secret: cache_aws_access_key_id
|
||||
# AWS_SECRET_ACCESS_KEY:
|
||||
# from_secret: cache_aws_secret_access_key
|
||||
# settings:
|
||||
# rebuild: true
|
||||
# bucket: kolaente.dev-drone-dependency-cache
|
||||
# endpoint: https://s3.fr-par.scw.cloud
|
||||
# region: fr-par
|
||||
# path_style: true
|
||||
# cache_key: '{{ .Repo.Name }}_{{ checksum "desktop/yarn.lock" }}_{{ arch }}_{{ os }}'
|
||||
# mount:
|
||||
# - '.cache'
|
||||
# depends_on:
|
||||
# - build
|
||||
- corepack enable && pnpm config set store-dir .cache/pnpm
|
||||
- pnpm install --fetch-timeout 100000
|
||||
- pnpm dist --linux --windows
|
||||
|
||||
# - name: rebuild-cache
|
||||
# image: meltwater/drone-cache:dev
|
||||
# pull: true
|
||||
# environment:
|
||||
# AWS_ACCESS_KEY_ID:
|
||||
# from_secret: cache_aws_access_key_id
|
||||
# AWS_SECRET_ACCESS_KEY:
|
||||
# from_secret: cache_aws_secret_access_key
|
||||
# settings:
|
||||
# rebuild: true
|
||||
# bucket: kolaente.dev-drone-dependency-cache
|
||||
# endpoint: https://fsn1.your-objectstorage.com
|
||||
# region: fsn1
|
||||
# path_style: true
|
||||
# cache_key: '{{ .Repo.Name }}_{{ checksum "desktop/yarn.lock" }}_{{ arch }}_{{ os }}'
|
||||
# mount:
|
||||
# - '.cache'
|
||||
# depends_on:
|
||||
# - build
|
||||
|
||||
- name: rename-unstable
|
||||
image: bash
|
||||
pull: true
|
||||
@@ -1241,13 +1289,13 @@ steps:
|
||||
image: plugins/s3
|
||||
pull: true
|
||||
settings:
|
||||
bucket: vikunja-releases
|
||||
bucket: vikunja
|
||||
access_key:
|
||||
from_secret: aws_access_key_id
|
||||
from_secret: hetzner_access_key_id
|
||||
secret_key:
|
||||
from_secret: aws_secret_access_key
|
||||
endpoint: https://s3.fr-par.scw.cloud
|
||||
region: fr-par
|
||||
from_secret: hetzner_secret_access_key
|
||||
endpoint: https://fsn1.your-objectstorage.com
|
||||
region: fsn1
|
||||
path_style: true
|
||||
strip_prefix: desktop/dist/
|
||||
source: desktop/dist/Vikunja-Desktop*
|
||||
@@ -1263,13 +1311,13 @@ steps:
|
||||
image: plugins/s3
|
||||
pull: true
|
||||
settings:
|
||||
bucket: vikunja-releases
|
||||
bucket: vikunja
|
||||
access_key:
|
||||
from_secret: aws_access_key_id
|
||||
from_secret: hetzner_access_key_id
|
||||
secret_key:
|
||||
from_secret: aws_secret_access_key
|
||||
endpoint: https://s3.fr-par.scw.cloud
|
||||
region: fr-par
|
||||
from_secret: hetzner_secret_access_key
|
||||
endpoint: https://fsn1.your-objectstorage.com
|
||||
region: fsn1
|
||||
path_style: true
|
||||
strip_prefix: desktop/dist/
|
||||
source: desktop/dist/*
|
||||
@@ -1298,9 +1346,9 @@ steps:
|
||||
# - name: build
|
||||
# environment:
|
||||
# ACCESS_KEY:
|
||||
# from_secret: aws_access_key_id
|
||||
# from_secret: hetzner_access_key_id
|
||||
# SECRET_KEY:
|
||||
# from_secret: aws_secret_access_key
|
||||
# from_secret: hetzner_secret_access_key
|
||||
# commands:
|
||||
# - git fetch --tags
|
||||
# - export VERSION=${DRONE_TAG##v}
|
||||
@@ -1313,9 +1361,9 @@ steps:
|
||||
# - sed -i '' "s/\$${version}/$$VERSION/g" package.json
|
||||
# - yarn install
|
||||
# - yarn dist --mac
|
||||
# - mc config host add scw-fr-par https://s3.fr-par.scw.cloud $ACCESS_KEY $SECRET_KEY --api S3v4
|
||||
# - mc cp ./dist/*.dmg scw-fr-par/vikunja-releases/desktop/$VERSION/
|
||||
# - mc cp ./dist/*.dmg.blockmap scw-fr-par/vikunja-releases/desktop/$VERSION/
|
||||
# - mc config host add scw-fsn1 https://fsn1.your-objectstorage.com $ACCESS_KEY $SECRET_KEY --api S3v4
|
||||
# - mc cp ./dist/*.dmg scw-fsn1/vikunja/desktop/$VERSION/
|
||||
# - mc cp ./dist/*.dmg.blockmap scw-fsn1/vikunja/desktop/$VERSION/
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
@@ -1352,6 +1400,6 @@ steps:
|
||||
- failure
|
||||
---
|
||||
kind: signature
|
||||
hmac: eff6e40dc763fa1395078daaabcbef2aaa74fe0a36818a87e89015dbc4e9dae4
|
||||
hmac: ba0652aeee2f07af2f861ea281d156db7ddd4803672dae0101ebb1f8111ec580
|
||||
|
||||
...
|
||||
|
||||
+227
@@ -7,6 +7,233 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
All releases can be found on https://code.vikunja.io/vikunja/releases.
|
||||
|
||||
## [0.24.4] - 2024-09-29
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* *(attachment)* Do not use image previews
|
||||
* *(checkbox)* Use sibling css selector instead of has
|
||||
* *(files)* Only use service rootpath for files when the files path is not absolute
|
||||
* *(filters)* Explicitly search in json when using postgres
|
||||
* *(task)* Paginate task comments
|
||||
* *(task)* Do not show close button when the task was not opened via modal
|
||||
* *(task)* Improve task delete modal on mobile
|
||||
* *(test)* Use correct selector for modal header
|
||||
* Partial fix to allow list tasks in ios reminders app (#2717)
|
||||
* *(attachments)* Revert "chore(attachments): refactor building image preview"
|
||||
|
||||
### Dependencies
|
||||
|
||||
* *(deps)* Update desktop lockfile
|
||||
* *(deps)* Update dependency vue to v3.5.7
|
||||
* *(deps)* Update dev-dependencies
|
||||
* *(deps)* Update dependency vue-i18n to v10.0.2
|
||||
* *(deps)* Update dev-dependencies
|
||||
* *(deps)* Update dependency vue to v3.5.8
|
||||
* *(deps)* Update dependency @intlify/unplugin-vue-i18n to v5.1.0
|
||||
* *(deps)* Update dependency vue-i18n to v10.0.3
|
||||
* *(deps)* Update dependency @intlify/unplugin-vue-i18n to v5.2.0
|
||||
* *(deps)* Update dependency @sentry/vue to v8.31.0
|
||||
* *(deps)* Update dependency tailwindcss to v3.4.13
|
||||
* *(deps)* Update dev-dependencies
|
||||
* *(deps)* Update dev-dependencies
|
||||
* *(deps)* Update dependency @sentry/vue to v8.32.0
|
||||
* *(deps)* Update tiptap to v2.7.3
|
||||
* *(deps)* Update dev-dependencies
|
||||
* *(deps)* Update dependency vue to v3.5.9
|
||||
* *(deps)* Update dependency dompurify to v3.1.7
|
||||
* *(deps)* Update tiptap to v2.7.4
|
||||
* *(deps)* Update dependency vue to v3.5.10
|
||||
* *(deps)* Update dev-dependencies
|
||||
|
||||
## [0.24.3] - 2024-09-20
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* *(a11y)* Hide unfocusable buttons
|
||||
* *(api)* Return 404 response when using a token and the route does not exist
|
||||
* *(auth)* Restrict max password length to 72 bytes
|
||||
* *(caldav)* Make sure colors are correctly saved and returned
|
||||
* *(caldav)* Reject invalid project id with error 400
|
||||
* *(editor)* Restore the current value, not the one from a previous task
|
||||
* *(files)* Use absolute path everywhere
|
||||
* *(filter)* Do not replace labels keyword when the value is 'label'
|
||||
* *(filter)* Make sure tasks are in a correct bucket and position when they are part of a date filter
|
||||
* *(filters)* Immediately propagate changes
|
||||
* *(filters)* Do not replace filter or project values when the id value resolves to undefined
|
||||
* *(filters)* Correctly transform and populate saved filter when creating and editing
|
||||
* *(home)* Explicitly use filter for tasks on home page when one is set
|
||||
* *(kanban)* Save updated position to store
|
||||
* *(kanban)* Make task creation loading spinner actually visible
|
||||
* *(kanban)* Make kanban full width on mobile
|
||||
* *(kanban)* Do not mark first bucked as done bucket in filter bucket mode
|
||||
* *(kanban)* Correctly paginate filtered kanban buckets
|
||||
* *(label)* Ignore existing ID during creation
|
||||
* *(labels)* Trigger task.updated event when removing a label from a task
|
||||
* *(labels)* Test error assertion
|
||||
* *(labels)* Remove input interactivity when label edit is disabled
|
||||
* *(labels)* Trigger task updated for bulk label task update
|
||||
* *(modal)* Make sure modal and its content scrolls properly on mobile
|
||||
* *(modal)* Do not prevent scrolling on mobile
|
||||
* *(modal)* Make scrolling on iOS Safari work
|
||||
* *(multiselect)* Make selectPlaceholder optional
|
||||
* *(notifications)* Only add project subscription as task subscription when the user is not already subscribed to the task
|
||||
* *(password)* Validate password before sending request to api
|
||||
* *(project)* Show description in title attribute without html
|
||||
* *(project)* Reset id before creating
|
||||
* *(projects)* Do not hide 6th project on project overview
|
||||
* *(projects)* Description not visible on mobile
|
||||
* *(reminders)* Notify subscribed users as well
|
||||
* *(service worker)* Use correct workbox version
|
||||
* *(subscription)* Always return task subscription when subscribed to task and project
|
||||
* *(subscriptions)* Ignore task subscription when the user is subscribed to the project
|
||||
* *(subscriptions)* Correctly inherit subscriptions
|
||||
* *(subscriptions)* Cleanup and simplify fetching subscribers for tasks and projects logic
|
||||
* *(subscriptions)* Do not panic when a task does not have a subscription
|
||||
* *(table)* Make sorting for two-word properties work
|
||||
* *(task)* Set done at date when moving a task to the done bucket
|
||||
* *(task)* Specify task index when creating multiple tasks at once
|
||||
* *(task)* Cyclomatic complexity
|
||||
* *(task)* Make print styles work when printing task detail view from kanban
|
||||
* *(task)* Multiple overlapping defer due date popups
|
||||
* *(task)* Align task title on mobile popup
|
||||
* *(task)* Dragging and dropping on mobile
|
||||
* *(task)* Add task to filter view after it was updated
|
||||
* *(task)* Cleanup old task positions and task buckets when adding an updated or created task to filter
|
||||
* *(task)* Mark related task as done from the task detail view
|
||||
* *(task)* Open focused task when pressing enter
|
||||
* *(test)* Cypress test selector
|
||||
* *(typesense)* Only fail silently when a project was not found during indexing
|
||||
* *(typesense)* Add new tasks to typesense properly
|
||||
* *(typesense)* Make sure task positions are recreated properly when updating them
|
||||
* *(typesense)* Use emplace instead of upsert to update documents
|
||||
* *(typesense)* Index tasks one by one
|
||||
* *(typesense)* Force position to always be float instead of auto-inferring
|
||||
* *(typesense)* Use typesense bulk insert, log all errors
|
||||
* *(user)* Do not create user with existing id
|
||||
* *(view)* Do not crash when saving a view
|
||||
* *(view)* Correctly resolve label for filtered views or buckets
|
||||
* *(view)* Correctly resolve bucket filter when paginating
|
||||
* *(view)* Correctly get paginated task results
|
||||
* *(views)* Add migration for filtered kanban buckets* Lint ([53d62d3](53d62d35f4488940a96d755de93ded64b8ac34a3))
|
||||
* Reset id before creating ([93f7dd6](93f7dd611ad288a149f5da5463867d224334815f))
|
||||
* Test selector ([063aa7a](063aa7afec717c3ed05be9d2ca73bde3d0bd8d35))
|
||||
|
||||
### Dependencies
|
||||
|
||||
* *(deps)* Update dependency @intlify/unplugin-vue-i18n to v5
|
||||
* *(deps)* Update dependency @kyvg/vue3-notification to v3.3.0
|
||||
* *(deps)* Update dependency @sentry/vue to v8.28.0
|
||||
* *(deps)* Update dependency @sentry/vue to v8.29.0
|
||||
* *(deps)* Update dependency @sentry/vue to v8.30.0
|
||||
* *(deps)* Update dependency axios to v1.7.7
|
||||
* *(deps)* Update dependency date-fns to v4
|
||||
* *(deps)* Update dependency dayjs to v1.11.13
|
||||
* *(deps)* Update dependency express to v4.20.0
|
||||
* *(deps)* Update dependency express to v4.21.0
|
||||
* *(deps)* Update dependency go to v1.23.1
|
||||
* *(deps)* Update dependency pinia to v2.2.2
|
||||
* *(deps)* Update dependency sortablejs to v1.15.3
|
||||
* *(deps)* Update dependency tailwindcss to v3.4.10
|
||||
* *(deps)* Update dependency tailwindcss to v3.4.11
|
||||
* *(deps)* Update dependency tailwindcss to v3.4.12
|
||||
* *(deps)* Update dependency vue to v3.5.3
|
||||
* *(deps)* Update dependency vue to v3.5.4
|
||||
* *(deps)* Update dependency vue to v3.5.5
|
||||
* *(deps)* Update dependency vue to v3.5.6
|
||||
* *(deps)* Update dependency vue-i18n to v10
|
||||
* *(deps)* Update dependency vue-i18n to v10.0.1
|
||||
* *(deps)* Update dependency vue-i18n to v9.14.0
|
||||
* *(deps)* Update dependency vue-router to v4.4.3
|
||||
* *(deps)* Update dependency vue-router to v4.4.4
|
||||
* *(deps)* Update dependency vue-router to v4.4.5
|
||||
* *(deps)* Update dependency vuemoji-picker to v0.3.1* Chore(deps): update goreleaser/nfpm docker tag to v2.40.0 (#2647)
|
||||
* *(deps)* Update dev-dependencies
|
||||
* *(deps)* Update dev-dependencies
|
||||
* *(deps)* Update dev-dependencies
|
||||
* *(deps)* Update dev-dependencies
|
||||
* *(deps)* Update dev-dependencies
|
||||
* *(deps)* Update dev-dependencies
|
||||
* *(deps)* Update github.com/wneessen/go-mail to v0.4.4
|
||||
* *(deps)* Update golangci
|
||||
* *(deps)* Update module dario.cat/mergo to v1.0.1
|
||||
* *(deps)* Update module github.com/gabriel-vasile/mimetype to v1.4.5
|
||||
* *(deps)* Update module github.com/getsentry/sentry-go to v0.29.0
|
||||
* *(deps)* Update module github.com/mattn/go-sqlite3 to v1.14.23
|
||||
* *(deps)* Update module github.com/prometheus/client_golang to v1.20.3
|
||||
* *(deps)* Update module github.com/prometheus/client_golang to v1.20.4
|
||||
* *(deps)* Update module github.com/redis/go-redis/v9 to v9.6.1
|
||||
* *(deps)* Update module github.com/threedotslabs/watermill to v1.3.7
|
||||
* *(deps)* Update module github.com/typesense/typesense-go to v2
|
||||
* *(deps)* Update module github.com/typesense/typesense-go to v2
|
||||
* *(deps)* Update module golang.org/x/crypto to v0.27.0
|
||||
* *(deps)* Update module golang.org/x/image to v0.20.0
|
||||
* *(deps)* Update module golang.org/x/oauth2 to v0.23.0
|
||||
* *(deps)* Update module golang.org/x/term to v0.24.0
|
||||
* *(deps)* Update module golang.org/x/text to v0.18.0
|
||||
* *(deps)* Update pnpm to v9.10.0
|
||||
* *(deps)* Update tiptap to 2.6.6
|
||||
* *(deps)* Update tiptap to v2.7.0
|
||||
* *(deps)* Update tiptap to v2.7.1
|
||||
* *(deps)* Update tiptap to v2.7.2
|
||||
* *(deps)* Update vueuse to v11
|
||||
* *(deps)* Update vueuse to v11.1.0
|
||||
* *(deps)*: update dependency flexsearch to v0.7.43 (#2095)
|
||||
* *(deps)*: update golangci/golangci-lint docker tag to v1.61.0 (#2678)
|
||||
|
||||
### Documentation
|
||||
|
||||
* *(api)* Use correct return type for the /user endpoint
|
||||
|
||||
### Features
|
||||
|
||||
* *(event)* Simplify dispatching task updated event from only a task id
|
||||
* *(navigation)* Use focus-visible for nav items
|
||||
* *(task)* Use focus-visible for task focus styles
|
||||
|
||||
### Miscellaneous Tasks
|
||||
|
||||
* *(attachments)* Refactor building image preview
|
||||
* *(devenv)* Do not install cypress on darwin
|
||||
* *(docker)* Use new env format
|
||||
* *(docs)* Clarify usage of related model creation
|
||||
* *(errors)* Always add internal error to echo error
|
||||
* *(files)* Use absolute file path to retrieve and save files
|
||||
* *(i18n)* Update translations via Crowdin
|
||||
* *(i18n)* Update translations via Crowdin
|
||||
* *(i18n)* Update translations via Crowdin
|
||||
* *(i18n)* Update translations via Crowdin
|
||||
* *(i18n)* Update translations via Crowdin
|
||||
* *(i18n)* Update translations via Crowdin
|
||||
* *(i18n)* Update translations via Crowdin
|
||||
* *(i18n)* Update translations via Crowdin
|
||||
* *(i18n)* Update translations via Crowdin
|
||||
* *(i18n)* Update translations via Crowdin
|
||||
* *(i18n)* Update translations via Crowdin
|
||||
* *(i18n)* Update translations via Crowdin
|
||||
* *(logging)* Simplify log template string
|
||||
* *(magefile)* Use tx.Sync instead of Sync2
|
||||
* *(subscription)* Return subscription entity type using json Marshaler
|
||||
* *(tasks)* Move drag options to direct attributes instead of v-bind
|
||||
* *(typesense)* Add more debug logging
|
||||
* *(web)* Move web handler package to Vikunja
|
||||
* *(web)* Remove unused echo context
|
||||
* *(web)* Use errors.As instead of type assertion
|
||||
* *(web)* Remove redundant use of fmt.Sprintf
|
||||
* *(web)* Directly use new db session
|
||||
* *(web)* Use config directly
|
||||
* *(web)* Use web auth factory directly
|
||||
* *(web)* Use logger directly
|
||||
* *(web)* Always set internal error* Remove console.log ([40105ee](40105ee4ced980f52565baec4c3219b0ddd4f6ec))
|
||||
* Fix comment ([1df4a4e](1df4a4ea2e2ca4332347468e8973a2dcbab06ed7))
|
||||
* Add go and direnv to recommended vscode extensions ([6ab12b9](6ab12b9dd133b52ed7267b6e9334081c2f9719ca))
|
||||
* Remove console.log ([1e7d9c9](1e7d9c982d3d472e9b4082991b41e6567556f2b2))
|
||||
* Rearrange cron registers ([4857bfb](4857bfbbdb8401b6ef02b1dc8de93f2a09e8bc3a))
|
||||
|
||||
### Other
|
||||
|
||||
* *(other)* [skip ci] Updated swagger docs
|
||||
|
||||
## [0.24.2] - 2024-08-12
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
[](https://drone.kolaente.de/vikunja/vikunja)
|
||||
[](LICENSE)
|
||||
[](https://vikunja.io/docs/installing)
|
||||
[](https://vikunja.io/docs/installing)
|
||||
[](https://hub.docker.com/r/vikunja/vikunja/)
|
||||
[](https://try.vikunja.io/api/v1/docs)
|
||||
[](https://goreportcard.com/report/kolaente.dev/vikunja/vikunja)
|
||||
|
||||
+833
@@ -0,0 +1,833 @@
|
||||
{
|
||||
"children": [
|
||||
{
|
||||
"key": "service",
|
||||
"children": [
|
||||
{
|
||||
"key": "JWTSecret",
|
||||
"default_value": "\u003cjwt-secret\u003e",
|
||||
"comment": "This token is used to verify issued JWT tokens.\nDefault is a random token which will be generated at each startup of Vikunja.\n(This means all already issued tokens will be invalid once you restart Vikunja)"
|
||||
},
|
||||
{
|
||||
"key": "jwtttl",
|
||||
"default_value": "259200",
|
||||
"comment": "The duration of the issued JWT tokens in seconds.\nThe default is 259200 seconds (3 Days)."
|
||||
},
|
||||
{
|
||||
"key": "jwtttllong",
|
||||
"default_value": "2592000",
|
||||
"comment": "The duration of the \"remember me\" time in seconds. When the login request is made with\nthe long param set, the token returned will be valid for this period.\nThe default is 2592000 seconds (30 Days)."
|
||||
},
|
||||
{
|
||||
"key": "interface",
|
||||
"default_value": ":3456",
|
||||
"comment": "The interface on which to run the webserver"
|
||||
},
|
||||
{
|
||||
"key": "unixsocket",
|
||||
"default_value": "",
|
||||
"comment": "Path to Unix socket. If set, it will be created and used instead of tcp"
|
||||
},
|
||||
{
|
||||
"key": "unixsocketmode",
|
||||
"default_value": "",
|
||||
"comment": "Permission bits for the Unix socket. Note that octal values must be prefixed by \"0o\", e.g. 0o660"
|
||||
},
|
||||
{
|
||||
"key": "publicurl",
|
||||
"default_value": "",
|
||||
"comment": "The public facing URL where your users can reach Vikunja. Used in emails and for the communication between api and frontend."
|
||||
},
|
||||
{
|
||||
"key": "rootpath",
|
||||
"default_value": "\u003crootpath\u003e",
|
||||
"comment": "The base path on the file system where the binary and assets are.\nVikunja will also look in this path for a config file, so you could provide only this variable to point to a folder\nwith a config file which will then be used."
|
||||
},
|
||||
{
|
||||
"key": "maxitemsperpage",
|
||||
"default_value": "50",
|
||||
"comment": "The max number of items which can be returned per page"
|
||||
},
|
||||
{
|
||||
"key": "enablecaldav",
|
||||
"default_value": "true",
|
||||
"comment": "Enable the caldav endpoint, see the docs for more details"
|
||||
},
|
||||
{
|
||||
"key": "motd",
|
||||
"default_value": "",
|
||||
"comment": "Set the motd message, available from the /info endpoint"
|
||||
},
|
||||
{
|
||||
"key": "enablelinksharing",
|
||||
"default_value": "true",
|
||||
"comment": "Enable sharing of project via a link"
|
||||
},
|
||||
{
|
||||
"key": "enableregistration",
|
||||
"default_value": "true",
|
||||
"comment": "Whether to let new users registering themselves or not"
|
||||
},
|
||||
{
|
||||
"key": "enabletaskattachments",
|
||||
"default_value": "true",
|
||||
"comment": "Whether to enable task attachments or not"
|
||||
},
|
||||
{
|
||||
"key": "timezone",
|
||||
"default_value": "GMT",
|
||||
"comment": "The time zone all timestamps are in. Please note that time zones have to use [the official tz database names](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). UTC or GMT offsets won't work."
|
||||
},
|
||||
{
|
||||
"key": "enabletaskcomments",
|
||||
"default_value": "true",
|
||||
"comment": "Whether task comments should be enabled or not"
|
||||
},
|
||||
{
|
||||
"key": "enabletotp",
|
||||
"default_value": "true",
|
||||
"comment": "Whether totp is enabled. In most cases you want to leave that enabled."
|
||||
},
|
||||
{
|
||||
"key": "testingtoken",
|
||||
"default_value": "",
|
||||
"comment": "If not empty, this will enable `/test/{table}` endpoints which allow to put any content in the database.\nUsed to reset the db before frontend tests. Because this is quite a dangerous feature allowing for lots of harm,\neach request made to this endpoint needs to provide an `Authorization: \u003ctoken\u003e` header with the token from below. \u003cbr/\u003e\n**You should never use this unless you know exactly what you're doing**"
|
||||
},
|
||||
{
|
||||
"key": "enableemailreminders",
|
||||
"default_value": "true",
|
||||
"comment": "If enabled, Vikunja will send an email to everyone who is either assigned to a task or created it when a task reminder\nis due."
|
||||
},
|
||||
{
|
||||
"key": "enableuserdeletion",
|
||||
"default_value": "true",
|
||||
"comment": "If true, will allow users to request the complete deletion of their account. When using external authentication methods\nit may be required to coordinate with them in order to delete the account. This setting will not affect the cli commands\nfor user deletion."
|
||||
},
|
||||
{
|
||||
"key": "maxavatarsize",
|
||||
"default_value": "1024",
|
||||
"comment": "The maximum size clients will be able to request for user avatars.\nIf clients request a size bigger than this, it will be changed on the fly."
|
||||
},
|
||||
{
|
||||
"key": "demomode",
|
||||
"default_value": "false",
|
||||
"comment": "If set to true, the frontend will show a big red warning not to use this instance for real data as it will be cleared out.\nYou probably don't need to set this value, it was created specifically for usage on [try](https://try.vikunja.io)."
|
||||
},
|
||||
{
|
||||
"key": "allowiconchanges",
|
||||
"default_value": "true",
|
||||
"comment": "Allow changing the logo and other icons based on various occasions throughout the year."
|
||||
},
|
||||
{
|
||||
"key": "customlogourl",
|
||||
"default_value": "",
|
||||
"comment": "Allow using a custom logo via external URL."
|
||||
},
|
||||
{
|
||||
"key": "enablepublicteams",
|
||||
"default_value": "false",
|
||||
"comment": "Enables the public team feature. If enabled, it is possible to configure teams to be public, which makes them\ndiscoverable when sharing a project, therefore not only showing teams the user is member of."
|
||||
},
|
||||
{
|
||||
"key": "bcryptrounds",
|
||||
"default_value": "11",
|
||||
"comment": "The number of bcrypt rounds to use during registration. Each increment of this number doubles the computational cost. You probably don't need to change this value."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "sentry",
|
||||
"children": [
|
||||
{
|
||||
"key": "enabled",
|
||||
"default_value": "false",
|
||||
"comment": "If set to true, enables anonymous error tracking of api errors via Sentry. This allows us to gather more\ninformation about errors in order to debug and fix it."
|
||||
},
|
||||
{
|
||||
"key": "dsn",
|
||||
"default_value": "https://440eedc957d545a795c17bbaf477497c@o1047380.ingest.sentry.io/4504254983634944",
|
||||
"comment": "Configure the Sentry dsn used for api error tracking. Only used when Sentry is enabled for the api."
|
||||
},
|
||||
{
|
||||
"key": "frontendenabled",
|
||||
"default_value": "false",
|
||||
"comment": "If set to true, enables anonymous error tracking of frontend errors via Sentry. This allows us to gather more\ninformation about errors in order to debug and fix it."
|
||||
},
|
||||
{
|
||||
"key": "frontenddsn",
|
||||
"default_value": "https://85694a2d757547cbbc90cd4b55c5a18d@o1047380.ingest.sentry.io/6024480",
|
||||
"comment": "Configure the Sentry dsn used for frontend error tracking. Only used when Sentry is enabled for the frontend."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "database",
|
||||
"children": [
|
||||
{
|
||||
"key": "type",
|
||||
"default_value": "sqlite",
|
||||
"comment": "Database type to use. Supported values are mysql, postgres and sqlite. Vikunja is able to run with MySQL 8.0+, Mariadb 10.2+, PostgreSQL 12+, and sqlite."
|
||||
},
|
||||
{
|
||||
"key": "user",
|
||||
"default_value": "vikunja",
|
||||
"comment": "Database user which is used to connect to the database."
|
||||
},
|
||||
{
|
||||
"key": "password",
|
||||
"default_value": "",
|
||||
"comment": "Database password"
|
||||
},
|
||||
{
|
||||
"key": "host",
|
||||
"default_value": "localhost",
|
||||
"comment": "Database host"
|
||||
},
|
||||
{
|
||||
"key": "database",
|
||||
"default_value": "vikunja",
|
||||
"comment": "Database to use"
|
||||
},
|
||||
{
|
||||
"key": "path",
|
||||
"default_value": "./vikunja.db",
|
||||
"comment": "When using sqlite, this is the path where to store the data"
|
||||
},
|
||||
{
|
||||
"key": "maxopenconnections",
|
||||
"default_value": "100",
|
||||
"comment": "Sets the max open connections to the database. Only used when using mysql and postgres."
|
||||
},
|
||||
{
|
||||
"key": "maxidleconnections",
|
||||
"default_value": "50",
|
||||
"comment": "Sets the maximum number of idle connections to the db."
|
||||
},
|
||||
{
|
||||
"key": "maxconnectionlifetime",
|
||||
"default_value": "10000",
|
||||
"comment": "The maximum lifetime of a single db connection in milliseconds."
|
||||
},
|
||||
{
|
||||
"key": "sslmode",
|
||||
"default_value": "disable",
|
||||
"comment": "Secure connection mode. Only used with postgres.\n(see https://pkg.go.dev/github.com/lib/pq?tab=doc#hdr-Connection_String_Parameters)"
|
||||
},
|
||||
{
|
||||
"key": "sslcert",
|
||||
"default_value": "",
|
||||
"comment": "The path to the client cert. Only used with postgres."
|
||||
},
|
||||
{
|
||||
"key": "sslkey",
|
||||
"default_value": "",
|
||||
"comment": "The path to the client key. Only used with postgres."
|
||||
},
|
||||
{
|
||||
"key": "sslrootcert",
|
||||
"default_value": "",
|
||||
"comment": "The path to the ca cert. Only used with postgres."
|
||||
},
|
||||
{
|
||||
"key": "tls",
|
||||
"default_value": "false",
|
||||
"comment": "Enable SSL/TLS for mysql connections. Options: false, true, skip-verify, preferred"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "typesense",
|
||||
"children": [
|
||||
{
|
||||
"key": "enabled",
|
||||
"default_value": "false",
|
||||
"comment": "Whether to enable the Typesense integration. If true, all tasks will be synced to the configured Typesense\ninstance and all search and filtering will run through Typesense instead of only through the database.\nTypesense allows fast fulltext search including fuzzy matching support. It may return different results than\nwhat you'd get with a database-only search."
|
||||
},
|
||||
{
|
||||
"key": "url",
|
||||
"default_value": "",
|
||||
"comment": "The url to the Typesense instance you want to use. Can be hosted locally or in Typesense Cloud as long\nas Vikunja is able to reach it."
|
||||
},
|
||||
{
|
||||
"key": "apikey",
|
||||
"default_value": "",
|
||||
"comment": "The Typesense API key you want to use."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "redis",
|
||||
"children": [
|
||||
{
|
||||
"key": "enabled",
|
||||
"default_value": "false",
|
||||
"comment": "Whether to enable redis or not"
|
||||
},
|
||||
{
|
||||
"key": "host",
|
||||
"default_value": "localhost:6379",
|
||||
"comment": "The host of the redis server including its port."
|
||||
},
|
||||
{
|
||||
"key": "password",
|
||||
"default_value": "",
|
||||
"comment": "The password used to authenticate against the redis server"
|
||||
},
|
||||
{
|
||||
"key": "db",
|
||||
"default_value": "0",
|
||||
"comment": "0 means default database"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "cors",
|
||||
"children": [
|
||||
{
|
||||
"key": "enable",
|
||||
"default_value": "false",
|
||||
"comment": "Whether to enable or disable cors headers.\nNote: If you want to put the frontend and the api on separate domains or ports, you will need to enable this.\nOtherwise the frontend won't be able to make requests to the api through the browser."
|
||||
},
|
||||
{
|
||||
"key": "origins",
|
||||
"comment": "A list of origins which may access the api. These need to include the protocol (`http://` or `https://`) and port, if any.",
|
||||
"children": [
|
||||
{
|
||||
"default_value": "*"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "maxage",
|
||||
"default_value": "0",
|
||||
"comment": "How long (in seconds) the results of a preflight request can be cached."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "mailer",
|
||||
"children": [
|
||||
{
|
||||
"key": "enabled",
|
||||
"default_value": "false",
|
||||
"comment": "Whether to enable the mailer or not. If it is disabled, all users are enabled right away and password reset is not possible."
|
||||
},
|
||||
{
|
||||
"key": "host",
|
||||
"default_value": "",
|
||||
"comment": "SMTP Host"
|
||||
},
|
||||
{
|
||||
"key": "port",
|
||||
"default_value": "587",
|
||||
"comment": "SMTP Host port.\n**NOTE:** If you're unable to send mail and the only error you see in the logs is an `EOF`, try setting the port to `25`."
|
||||
},
|
||||
{
|
||||
"key": "authtype",
|
||||
"default_value": "plain",
|
||||
"comment": "SMTP Auth Type. Can be either `plain`, `login` or `cram-md5`."
|
||||
},
|
||||
{
|
||||
"key": "username",
|
||||
"default_value": "user",
|
||||
"comment": "SMTP username"
|
||||
},
|
||||
{
|
||||
"key": "password",
|
||||
"default_value": "",
|
||||
"comment": "SMTP password"
|
||||
},
|
||||
{
|
||||
"key": "skiptlsverify",
|
||||
"default_value": "false",
|
||||
"comment": "Whether to skip verification of the tls certificate on the server"
|
||||
},
|
||||
{
|
||||
"key": "fromemail",
|
||||
"default_value": "mail@vikunja",
|
||||
"comment": "The default from address when sending emails"
|
||||
},
|
||||
{
|
||||
"key": "queuelength",
|
||||
"default_value": "100",
|
||||
"comment": "The length of the mail queue."
|
||||
},
|
||||
{
|
||||
"key": "queuetimeout",
|
||||
"default_value": "30",
|
||||
"comment": "The timeout in seconds after which the current open connection to the mailserver will be closed."
|
||||
},
|
||||
{
|
||||
"key": "forcessl",
|
||||
"default_value": "false",
|
||||
"comment": "By default, Vikunja will try to connect with starttls, use this option to force it to use ssl."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "log",
|
||||
"children": [
|
||||
{
|
||||
"key": "path",
|
||||
"default_value": "\u003crootpath\u003elogs",
|
||||
"comment": "A folder where all the logfiles should go."
|
||||
},
|
||||
{
|
||||
"key": "enabled",
|
||||
"default_value": "true",
|
||||
"comment": "Whether to show any logging at all or none"
|
||||
},
|
||||
{
|
||||
"key": "standard",
|
||||
"default_value": "stdout",
|
||||
"comment": "Where the normal log should go. Possible values are stdout, stderr, file or off to disable standard logging."
|
||||
},
|
||||
{
|
||||
"key": "level",
|
||||
"default_value": "INFO",
|
||||
"comment": "Change the log level. Possible values (case-insensitive) are CRITICAL, ERROR, WARNING, NOTICE, INFO, DEBUG."
|
||||
},
|
||||
{
|
||||
"key": "database",
|
||||
"default_value": "off",
|
||||
"comment": "Whether or not to log database queries. Useful for debugging. Possible values are stdout, stderr, file or off to disable database logging."
|
||||
},
|
||||
{
|
||||
"key": "databaselevel",
|
||||
"default_value": "WARNING",
|
||||
"comment": "The log level for database log messages. Possible values (case-insensitive) are CRITICAL, ERROR, WARNING, NOTICE, INFO, DEBUG."
|
||||
},
|
||||
{
|
||||
"key": "http",
|
||||
"default_value": "stdout",
|
||||
"comment": "Whether to log http requests or not. Possible values are stdout, stderr, file or off to disable http logging."
|
||||
},
|
||||
{
|
||||
"key": "echo",
|
||||
"default_value": "off",
|
||||
"comment": "Echo has its own logging which usually is unnecessary, which is why it is disabled by default. Possible values are stdout, stderr, file or off to disable standard logging."
|
||||
},
|
||||
{
|
||||
"key": "events",
|
||||
"default_value": "off",
|
||||
"comment": "Whether or not to log events. Useful for debugging. Possible values are stdout, stderr, file or off to disable events logging."
|
||||
},
|
||||
{
|
||||
"key": "eventslevel",
|
||||
"default_value": "info",
|
||||
"comment": "The log level for event log messages. Possible values (case-insensitive) are ERROR, INFO, DEBUG."
|
||||
},
|
||||
{
|
||||
"key": "mail",
|
||||
"default_value": "off",
|
||||
"comment": "Whether or not to log mail log messages. This will not log mail contents. Possible values are stdout, stderr, file or off to disable mail-related logging."
|
||||
},
|
||||
{
|
||||
"key": "maillevel",
|
||||
"default_value": "info",
|
||||
"comment": "The log level for mail log messages. Possible values (case-insensitive) are ERROR, WARNING, INFO, DEBUG."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "ratelimit",
|
||||
"children": [
|
||||
{
|
||||
"key": "enabled",
|
||||
"default_value": "false",
|
||||
"comment": "whether or not to enable the rate limit"
|
||||
},
|
||||
{
|
||||
"key": "kind",
|
||||
"default_value": "user",
|
||||
"comment": "The kind on which rates are based. Can be either \"user\" for a rate limit per user or \"ip\" for an ip-based rate limit."
|
||||
},
|
||||
{
|
||||
"key": "period",
|
||||
"default_value": "60",
|
||||
"comment": "The time period in seconds for the limit"
|
||||
},
|
||||
{
|
||||
"key": "limit",
|
||||
"default_value": "100",
|
||||
"comment": "The max number of requests a user is allowed to do in the configured time period"
|
||||
},
|
||||
{
|
||||
"key": "store",
|
||||
"default_value": "keyvalue",
|
||||
"comment": "The store where the limit counter for each user is stored.\nPossible values are \"keyvalue\", \"memory\" or \"redis\".\nWhen choosing \"keyvalue\" this setting follows the one configured in the \"keyvalue\" section."
|
||||
},
|
||||
{
|
||||
"key": "noauthlimit",
|
||||
"default_value": "10",
|
||||
"comment": "The number of requests a user can make from the same IP to all unauthenticated routes (login, register,\npassword confirmation, email verification, password reset request) per minute. This limit cannot be disabled.\nYou should only change this if you know what you're doing."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "files",
|
||||
"children": [
|
||||
{
|
||||
"key": "basepath",
|
||||
"default_value": "./files",
|
||||
"comment": "The path where files are stored"
|
||||
},
|
||||
{
|
||||
"key": "maxsize",
|
||||
"default_value": "20MB",
|
||||
"comment": "The maximum size of a file, as a human-readable string.\nWarning: The max size is limited 2^64-1 bytes due to the underlying datatype"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "migration",
|
||||
"comment": "To use any of the available migrators, you usually need to configure credentials for the appropriate service and enable it. Find instructions below on how to do this for the provided migrators.",
|
||||
"children": [
|
||||
{
|
||||
"key": "todoist",
|
||||
"children": [
|
||||
{
|
||||
"key": "enable",
|
||||
"default_value": "false",
|
||||
"comment": "Wheter to enable the Todoist migrator."
|
||||
},
|
||||
{
|
||||
"key": "clientid",
|
||||
"default_value": "",
|
||||
"comment": "The client id, required for making requests to the Todoist api\nYou need to register your Vikunja instance at https://developer.todoist.com/appconsole.html to get this."
|
||||
},
|
||||
{
|
||||
"key": "clientsecret",
|
||||
"default_value": "",
|
||||
"comment": "The client secret, also required for making requests to the Todoist api. Obtain it at https://developer.todoist.com/appconsole.html after registering your Vikunja instance."
|
||||
},
|
||||
{
|
||||
"key": "redirecturl",
|
||||
"default_value": "\u003cservice.publicurl\u003e/migrate/todoist",
|
||||
"comment": "The url where clients are redirected after they authorized Vikunja to access their Todoist items.\nIn Todoist, this is called `OAuth redirect URL` and it needs to match the url you entered when registering\nyour Vikunja instance at the Todoist developer console.\nWhen using the official Vikunja frontend, set this to `\u003cservice.publicurl\u003e/migrate/todoist` (the default value).\nOtherwise, set this to an url which then makes a request to /api/v1/migration/todoist/migrate\nwith the code obtained from the Todoist api."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "trello",
|
||||
"children": [
|
||||
{
|
||||
"key": "enable",
|
||||
"default_value": "false",
|
||||
"comment": "Whether to enable the Trello migrator."
|
||||
},
|
||||
{
|
||||
"key": "key",
|
||||
"default_value": "",
|
||||
"comment": "The client id, required for making requests to the trello api.\nYou need to register your Vikunja instance at https://trello.com/app-key (log in before you visit that link) to get one. Copy the `Personal Key` and set it as the client id. Add your Vikunja domain to the Allowed Origins list."
|
||||
},
|
||||
{
|
||||
"key": "redirecturl",
|
||||
"default_value": "\u003cfrontend url\u003e/migrate/trello",
|
||||
"comment": "The url where clients are redirected after they authorized Vikunja to access their trello cards.\nThis needs to match the url you entered when registering your Vikunja instance at trello.\nWhen using the official Vikunja frontend, set this to `\u003cservice.publicurl\u003e/migrate/trello` (the default value).\nOtherwise, set this to an url which then makes a request to /api/v1/migration/trello/migrate\nwith the code obtained from the Trello api."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "microsofttodo",
|
||||
"children": [
|
||||
{
|
||||
"key": "enable",
|
||||
"default_value": "false",
|
||||
"comment": "Wheter to enable the Microsoft Todo migrator."
|
||||
},
|
||||
{
|
||||
"key": "clientid",
|
||||
"default_value": "",
|
||||
"comment": "The client id, required for making requests to the Microsoft graph api.\nSee https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app#register-an-application\nfor information about how to register your Vikunja instance."
|
||||
},
|
||||
{
|
||||
"key": "clientsecret",
|
||||
"default_value": "",
|
||||
"comment": "The client secret, also required for making requests to the Microsoft graph api"
|
||||
},
|
||||
{
|
||||
"key": "redirecturl",
|
||||
"default_value": "\u003cfrontend url\u003e/migrate/microsoft-todo",
|
||||
"comment": "The url where clients are redirected after they authorized Vikunja to access their Microsoft todo tasks.\nThis needs to match the url you entered when registering your Vikunja instance at Microsoft.\nWhen using the official Vikunja frontend, set this to `\u003cservice.publicurl\u003e/migrate/microsoft-todo` (the default value).\nOtherwise, set this to an url which then makes a request to /api/v1/migration/microsoft-todo/migrate\nwith the code obtained from the Microsoft Todo api."
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "avatar",
|
||||
"children": [
|
||||
{
|
||||
"key": "gravatarexpiration",
|
||||
"default_value": "3600",
|
||||
"comment": "When using gravatar, this is the duration in seconds until a cached gravatar user avatar expires"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "backgrounds",
|
||||
"children": [
|
||||
{
|
||||
"key": "enabled",
|
||||
"default_value": "true",
|
||||
"comment": "Whether to enable backgrounds for projects at all."
|
||||
},
|
||||
{
|
||||
"key": "providers",
|
||||
"children": [
|
||||
{
|
||||
"key": "upload",
|
||||
"children": [
|
||||
{
|
||||
"key": "enabled",
|
||||
"default_value": "true",
|
||||
"comment": "Whether to enable uploaded project backgrounds"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "unsplash",
|
||||
"children": [
|
||||
{
|
||||
"key": "enabled",
|
||||
"default_value": "false",
|
||||
"comment": "Whether to enable setting backgrounds from unsplash as project backgrounds"
|
||||
},
|
||||
{
|
||||
"key": "accesstoken",
|
||||
"default_value": "",
|
||||
"comment": "You need to create an application for your installation at https://unsplash.com/oauth/applications/new\nand set the access token below."
|
||||
},
|
||||
{
|
||||
"key": "applicationid",
|
||||
"default_value": "",
|
||||
"comment": "The unsplash application id is only used for pingback and required as per their api guidelines.\nYou can find the Application ID in the dashboard for your API application. It should be a numeric ID.\nIt will only show in the UI if your application has been approved for Enterprise usage, therefore if\nyou’re in Demo mode, you can also find the ID in the URL at the end: https://unsplash.com/oauth/applications/:application_id"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "legal",
|
||||
"comment": "Legal urls\nWill be shown in the frontend if configured here",
|
||||
"children": [
|
||||
{
|
||||
"key": "imprinturl",
|
||||
"default_value": ""
|
||||
},
|
||||
{
|
||||
"key": "privacyurl",
|
||||
"default_value": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "keyvalue",
|
||||
"comment": "Key Value Storage settings\nThe Key Value Storage is used for different kinds of things like metrics and a few cache systems.",
|
||||
"children": [
|
||||
{
|
||||
"key": "type",
|
||||
"default_value": "memory",
|
||||
"comment": "The type of the storage backend. Can be either \"memory\" or \"redis\". If \"redis\" is chosen it needs to be configured separately."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "auth",
|
||||
"children": [
|
||||
{
|
||||
"key": "local",
|
||||
"comment": "Local authentication will let users log in and register (if enabled) through the db.\nThis is the default auth mechanism and does not require any additional configuration.",
|
||||
"children": [
|
||||
{
|
||||
"key": "enabled",
|
||||
"default_value": "true",
|
||||
"comment": "Enable or disable local authentication"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "openid",
|
||||
"comment": "OpenID configuration will allow users to authenticate through a third-party OpenID Connect compatible provider.\u003cbr/\u003e\nThe provider needs to support the `openid`, `profile` and `email` scopes.\u003cbr/\u003e\n**Note:** Some openid providers (like Gitlab) only make the email of the user available through OpenID if they have set it to be publicly visible.\nIf the email is not public in those cases, authenticating will fail.\u003cbr/\u003e\n**Note 2:** The frontend expects the third party to redirect the user \u003cfrontend-url\u003e/auth/openid/\u003cauth key\u003e after authentication. Please make sure to configure the redirect url in your third party auth service accordingly if you're using the default Vikunja frontend.\nThe frontend will automatically provide the API with the redirect url, composed from the current url where it's hosted.\nIf you want to use the desktop client with OpenID, make sure to allow redirects to `127.0.0.1`.",
|
||||
"children": [
|
||||
{
|
||||
"key": "enabled",
|
||||
"default_value": "false",
|
||||
"comment": "Enable or disable OpenID Connect authentication"
|
||||
},
|
||||
{
|
||||
"key": "providers",
|
||||
"comment": "A list of enabled providers. This expects an array, which means you cannot use enviroment variables.",
|
||||
"children": [
|
||||
{
|
||||
"children": [
|
||||
{
|
||||
"key": "name",
|
||||
"default_value": "",
|
||||
"comment": "The name of the provider as it will appear in the frontend."
|
||||
},
|
||||
{
|
||||
"key": "authurl",
|
||||
"default_value": "",
|
||||
"comment": "The auth url to send users to if they want to authenticate using OpenID Connect."
|
||||
},
|
||||
{
|
||||
"key": "logouturl",
|
||||
"default_value": "",
|
||||
"comment": "The oidc logouturl that users will be redirected to on logout.\nLeave empty or delete key, if you do not want to be redirected."
|
||||
},
|
||||
{
|
||||
"key": "clientid",
|
||||
"default_value": "",
|
||||
"comment": "The client ID used to authenticate Vikunja at the OpenID Connect provider."
|
||||
},
|
||||
{
|
||||
"key": "clientsecret",
|
||||
"default_value": "",
|
||||
"comment": "The client secret used to authenticate Vikunja at the OpenID Connect provider."
|
||||
},
|
||||
{
|
||||
"key": "scope",
|
||||
"default_value": "openid email profile",
|
||||
"comment": "The scope necessary to use oidc.\nIf you want to use the Feature to create and assign to Vikunja teams via oidc, you have to add the custom \"vikunja_scope\" and check [openid.md](https://vikunja.io/docs/openid/).\ne.g. scope: openid email profile vikunja_scope"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "metrics",
|
||||
"comment": "Prometheus metrics endpoint",
|
||||
"children": [
|
||||
{
|
||||
"key": "enabled",
|
||||
"default_value": "false",
|
||||
"comment": "If set to true, enables a /metrics endpoint for prometheus to collect metrics about Vikunja. You can query it from `/api/v1/metrics`."
|
||||
},
|
||||
{
|
||||
"key": "username",
|
||||
"default_value": "",
|
||||
"comment": "If set to a non-empty value the /metrics endpoint will require this as a username via basic auth in combination with the password below."
|
||||
},
|
||||
{
|
||||
"key": "password",
|
||||
"default_value": "",
|
||||
"comment": "If set to a non-empty value the /metrics endpoint will require this as a password via basic auth in combination with the username below."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "defaultsettings",
|
||||
"comment": "Provide default settings for new users. When a new user is created, these settings will automatically be set for the user. If you change them in the config file afterwards they will not be changed back for existing users.",
|
||||
"children": [
|
||||
{
|
||||
"key": "avatar_provider",
|
||||
"default_value": "initials",
|
||||
"comment": "The avatar source for the user. Can be `gravatar`, `initials`, `upload` or `marble`. If you set this to `upload` you'll also need to specify `defaultsettings.avatar_file_id`."
|
||||
},
|
||||
{
|
||||
"key": "avatar_file_id",
|
||||
"default_value": "0",
|
||||
"comment": "The id of the file used as avatar."
|
||||
},
|
||||
{
|
||||
"key": "email_reminders_enabled",
|
||||
"default_value": "false",
|
||||
"comment": "If set to true users will get task reminders via email."
|
||||
},
|
||||
{
|
||||
"key": "discoverable_by_name",
|
||||
"default_value": "false",
|
||||
"comment": "If set to true will allow other users to find this user when searching for parts of their name."
|
||||
},
|
||||
{
|
||||
"key": "discoverable_by_email",
|
||||
"default_value": "false",
|
||||
"comment": "If set to true will allow other users to find this user when searching for their exact email."
|
||||
},
|
||||
{
|
||||
"key": "overdue_tasks_reminders_enabled",
|
||||
"default_value": "true",
|
||||
"comment": "If set to true will send an email every day with all overdue tasks at a configured time."
|
||||
},
|
||||
{
|
||||
"key": "overdue_tasks_reminders_time",
|
||||
"default_value": "9:00",
|
||||
"comment": "When to send the overdue task reminder email."
|
||||
},
|
||||
{
|
||||
"key": "default_project_id",
|
||||
"default_value": "0",
|
||||
"comment": "The id of the default project. Make sure users actually have access to this project when setting this value."
|
||||
},
|
||||
{
|
||||
"key": "week_start",
|
||||
"default_value": "0",
|
||||
"comment": "Start of the week for the user. `0` is sunday, `1` is monday and so on."
|
||||
},
|
||||
{
|
||||
"key": "language",
|
||||
"default_value": "\u003cunset\u003e",
|
||||
"comment": "The language of the user interface. Must be an ISO 639-1 language code followed by an ISO 3166-1 alpha-2 country code. Check https://kolaente.dev/vikunja/vikunja/frontend/src/branch/main/src/i18n/lang for a list of possible languages. Will default to the browser language the user uses when signing up."
|
||||
},
|
||||
{
|
||||
"key": "timezone",
|
||||
"default_value": "\u003ctime zone set at service.timezone\u003e",
|
||||
"comment": "The time zone of each individual user. This will affect when users get reminders and overdue task emails."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "webhooks",
|
||||
"children": [
|
||||
{
|
||||
"key": "enabled",
|
||||
"default_value": "true",
|
||||
"comment": "Whether to enable support for webhooks"
|
||||
},
|
||||
{
|
||||
"key": "timeoutseconds",
|
||||
"default_value": "30",
|
||||
"comment": "The timeout in seconds until a webhook request fails when no response has been received."
|
||||
},
|
||||
{
|
||||
"key": "proxyurl",
|
||||
"default_value": "",
|
||||
"comment": "The URL of [a mole instance](https://github.com/frain-dev/mole) to use to proxy outgoing webhook requests. You should use this and configure appropriately if you're not the only one using your Vikunja instance. More info about why: https://webhooks.fyi/best-practices/webhook-providers#implement-security-on-egress-communication. Must be used in combination with `webhooks.password` (see below)."
|
||||
},
|
||||
{
|
||||
"key": "proxypassword",
|
||||
"default_value": "",
|
||||
"comment": "The proxy password to use when authenticating against the proxy."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "autotls",
|
||||
"children": [
|
||||
{
|
||||
"key": "enabled",
|
||||
"default_value": "false",
|
||||
"comment": "If set to true, Vikunja will automatically request a TLS certificate from Let's Encrypt and use it to serve Vikunja over TLS. By enabling this option, you agree to Let's Encrypt's TOS.\nYou must configure a `service.publicurl` with a valid TLD where Vikunja is reachable to make this work. Furthermore, it is reccomened to set `service.interface` to `:443` if you're using this."
|
||||
},
|
||||
{
|
||||
"key": "email",
|
||||
"default_value": "",
|
||||
"comment": "A valid email address which will be used to register certificates with Let's Encrypt. You must provide this value in order to use autotls."
|
||||
},
|
||||
{
|
||||
"key": "renewbefore",
|
||||
"default_value": "30d",
|
||||
"comment": "A duration when certificates should be renewed before they expire. Valid time units are `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`."
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,377 +0,0 @@
|
||||
service:
|
||||
# This token is used to verify issued JWT tokens.
|
||||
# Default is a random token which will be generated at each startup of Vikunja.
|
||||
# (This means all already issued tokens will be invalid once you restart Vikunja)
|
||||
JWTSecret: "<jwt-secret>"
|
||||
# The duration of the issued JWT tokens in seconds.
|
||||
# The default is 259200 seconds (3 Days).
|
||||
jwtttl: 259200
|
||||
# The duration of the "remember me" time in seconds. When the login request is made with
|
||||
# the long param set, the token returned will be valid for this period.
|
||||
# The default is 2592000 seconds (30 Days).
|
||||
jwtttllong: 2592000
|
||||
# The interface on which to run the webserver
|
||||
interface: ":3456"
|
||||
# Path to Unix socket. If set, it will be created and used instead of tcp
|
||||
unixsocket:
|
||||
# Permission bits for the Unix socket. Note that octal values must be prefixed by "0o", e.g. 0o660
|
||||
unixsocketmode:
|
||||
# The public facing URL where your users can reach Vikunja. Used in emails and for the communication between api and frontend.
|
||||
publicurl: ""
|
||||
# The base path on the file system where the binary and assets are.
|
||||
# Vikunja will also look in this path for a config file, so you could provide only this variable to point to a folder
|
||||
# with a config file which will then be used.
|
||||
rootpath: <rootpath>
|
||||
# The max number of items which can be returned per page
|
||||
maxitemsperpage: 50
|
||||
# Enable the caldav endpoint, see the docs for more details
|
||||
enablecaldav: true
|
||||
# Set the motd message, available from the /info endpoint
|
||||
motd: ""
|
||||
# Enable sharing of project via a link
|
||||
enablelinksharing: true
|
||||
# Whether to let new users registering themselves or not
|
||||
enableregistration: true
|
||||
# Whether to enable task attachments or not
|
||||
enabletaskattachments: true
|
||||
# The time zone all timestamps are in. Please note that time zones have to use [the official tz database names](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). UTC or GMT offsets won't work.
|
||||
timezone: GMT
|
||||
# Whether task comments should be enabled or not
|
||||
enabletaskcomments: true
|
||||
# Whether totp is enabled. In most cases you want to leave that enabled.
|
||||
enabletotp: true
|
||||
# If not empty, this will enable `/test/{table}` endpoints which allow to put any content in the database.
|
||||
# Used to reset the db before frontend tests. Because this is quite a dangerous feature allowing for lots of harm,
|
||||
# each request made to this endpoint needs to provide an `Authorization: <token>` header with the token from below. <br/>
|
||||
# **You should never use this unless you know exactly what you're doing**
|
||||
testingtoken: ''
|
||||
# If enabled, Vikunja will send an email to everyone who is either assigned to a task or created it when a task reminder
|
||||
# is due.
|
||||
enableemailreminders: true
|
||||
# If true, will allow users to request the complete deletion of their account. When using external authentication methods
|
||||
# it may be required to coordinate with them in order to delete the account. This setting will not affect the cli commands
|
||||
# for user deletion.
|
||||
enableuserdeletion: true
|
||||
# The maximum size clients will be able to request for user avatars.
|
||||
# If clients request a size bigger than this, it will be changed on the fly.
|
||||
maxavatarsize: 1024
|
||||
# If set to true, the frontend will show a big red warning not to use this instance for real data as it will be cleared out.
|
||||
# You probably don't need to set this value, it was created specifically for usage on [try](https://try.vikunja.io).
|
||||
demomode: false
|
||||
# Allow changing the logo and other icons based on various occasions throughout the year.
|
||||
allowiconchanges: true
|
||||
# Allow using a custom logo via external URL.
|
||||
customlogourl: ''
|
||||
# Enables the public team feature. If enabled, it is possible to configure teams to be public, which makes them
|
||||
# discoverable when sharing a project, therefore not only showing teams the user is member of.
|
||||
enablepublicteams: false
|
||||
|
||||
sentry:
|
||||
# If set to true, enables anonymous error tracking of api errors via Sentry. This allows us to gather more
|
||||
# information about errors in order to debug and fix it.
|
||||
enabled: false
|
||||
# Configure the Sentry dsn used for api error tracking. Only used when Sentry is enabled for the api.
|
||||
dsn: "https://440eedc957d545a795c17bbaf477497c@o1047380.ingest.sentry.io/4504254983634944"
|
||||
# If set to true, enables anonymous error tracking of frontend errors via Sentry. This allows us to gather more
|
||||
# information about errors in order to debug and fix it.
|
||||
frontendenabled: false
|
||||
# Configure the Sentry dsn used for frontend error tracking. Only used when Sentry is enabled for the frontend.
|
||||
frontenddsn: "https://85694a2d757547cbbc90cd4b55c5a18d@o1047380.ingest.sentry.io/6024480"
|
||||
|
||||
database:
|
||||
# Database type to use. Supported values are mysql, postgres and sqlite. Vikunja is able to run with MySQL 8.0+, Mariadb 10.2+, PostgreSQL 12+, and sqlite.
|
||||
type: "sqlite"
|
||||
# Database user which is used to connect to the database.
|
||||
user: "vikunja"
|
||||
# Database password
|
||||
password: ""
|
||||
# Database host
|
||||
host: "localhost"
|
||||
# Database to use
|
||||
database: "vikunja"
|
||||
# When using sqlite, this is the path where to store the data
|
||||
path: "./vikunja.db"
|
||||
# Sets the max open connections to the database. Only used when using mysql and postgres.
|
||||
maxopenconnections: 100
|
||||
# Sets the maximum number of idle connections to the db.
|
||||
maxidleconnections: 50
|
||||
# The maximum lifetime of a single db connection in milliseconds.
|
||||
maxconnectionlifetime: 10000
|
||||
# Secure connection mode. Only used with postgres.
|
||||
# (see https://pkg.go.dev/github.com/lib/pq?tab=doc#hdr-Connection_String_Parameters)
|
||||
sslmode: disable
|
||||
# The path to the client cert. Only used with postgres.
|
||||
sslcert: ""
|
||||
# The path to the client key. Only used with postgres.
|
||||
sslkey: ""
|
||||
# The path to the ca cert. Only used with postgres.
|
||||
sslrootcert: ""
|
||||
# Enable SSL/TLS for mysql connections. Options: false, true, skip-verify, preferred
|
||||
tls: false
|
||||
|
||||
typesense:
|
||||
# Whether to enable the Typesense integration. If true, all tasks will be synced to the configured Typesense
|
||||
# instance and all search and filtering will run through Typesense instead of only through the database.
|
||||
# Typesense allows fast fulltext search including fuzzy matching support. It may return different results than
|
||||
# what you'd get with a database-only search.
|
||||
enabled: false
|
||||
# The url to the Typesense instance you want to use. Can be hosted locally or in Typesense Cloud as long
|
||||
# as Vikunja is able to reach it.
|
||||
url: ''
|
||||
# The Typesense API key you want to use.
|
||||
apikey: ''
|
||||
|
||||
redis:
|
||||
# Whether to enable redis or not
|
||||
enabled: false
|
||||
# The host of the redis server including its port.
|
||||
host: 'localhost:6379'
|
||||
# The password used to authenticate against the redis server
|
||||
password: ''
|
||||
# 0 means default database
|
||||
db: 0
|
||||
|
||||
cors:
|
||||
# Whether to enable or disable cors headers.
|
||||
# Note: If you want to put the frontend and the api on separate domains or ports, you will need to enable this.
|
||||
# Otherwise the frontend won't be able to make requests to the api through the browser.
|
||||
enable: false
|
||||
# A list of origins which may access the api. These need to include the protocol (`http://` or `https://`) and port, if any.
|
||||
origins:
|
||||
- "*"
|
||||
# How long (in seconds) the results of a preflight request can be cached.
|
||||
maxage: 0
|
||||
|
||||
mailer:
|
||||
# Whether to enable the mailer or not. If it is disabled, all users are enabled right away and password reset is not possible.
|
||||
enabled: false
|
||||
# SMTP Host
|
||||
host: ""
|
||||
# SMTP Host port.
|
||||
# **NOTE:** If you're unable to send mail and the only error you see in the logs is an `EOF`, try setting the port to `25`.
|
||||
port: 587
|
||||
# SMTP Auth Type. Can be either `plain`, `login` or `cram-md5`.
|
||||
authtype: "plain"
|
||||
# SMTP username
|
||||
username: "user"
|
||||
# SMTP password
|
||||
password: ""
|
||||
# Whether to skip verification of the tls certificate on the server
|
||||
skiptlsverify: false
|
||||
# The default from address when sending emails
|
||||
fromemail: "mail@vikunja"
|
||||
# The length of the mail queue.
|
||||
queuelength: 100
|
||||
# The timeout in seconds after which the current open connection to the mailserver will be closed.
|
||||
queuetimeout: 30
|
||||
# By default, Vikunja will try to connect with starttls, use this option to force it to use ssl.
|
||||
forcessl: false
|
||||
|
||||
log:
|
||||
# A folder where all the logfiles should go.
|
||||
path: <rootpath>logs
|
||||
# Whether to show any logging at all or none
|
||||
enabled: true
|
||||
# Where the normal log should go. Possible values are stdout, stderr, file or off to disable standard logging.
|
||||
standard: "stdout"
|
||||
# Change the log level. Possible values (case-insensitive) are CRITICAL, ERROR, WARNING, NOTICE, INFO, DEBUG.
|
||||
level: "INFO"
|
||||
# Whether or not to log database queries. Useful for debugging. Possible values are stdout, stderr, file or off to disable database logging.
|
||||
database: "off"
|
||||
# The log level for database log messages. Possible values (case-insensitive) are CRITICAL, ERROR, WARNING, NOTICE, INFO, DEBUG.
|
||||
databaselevel: "WARNING"
|
||||
# Whether to log http requests or not. Possible values are stdout, stderr, file or off to disable http logging.
|
||||
http: "stdout"
|
||||
# Echo has its own logging which usually is unnecessary, which is why it is disabled by default. Possible values are stdout, stderr, file or off to disable standard logging.
|
||||
echo: "off"
|
||||
# Whether or not to log events. Useful for debugging. Possible values are stdout, stderr, file or off to disable events logging.
|
||||
events: "off"
|
||||
# The log level for event log messages. Possible values (case-insensitive) are ERROR, INFO, DEBUG.
|
||||
eventslevel: "info"
|
||||
# Whether or not to log mail log messages. This will not log mail contents. Possible values are stdout, stderr, file or off to disable mail-related logging.
|
||||
mail: "off"
|
||||
# The log level for mail log messages. Possible values (case-insensitive) are ERROR, WARNING, INFO, DEBUG.
|
||||
maillevel: "info"
|
||||
|
||||
ratelimit:
|
||||
# whether or not to enable the rate limit
|
||||
enabled: false
|
||||
# The kind on which rates are based. Can be either "user" for a rate limit per user or "ip" for an ip-based rate limit.
|
||||
kind: user
|
||||
# The time period in seconds for the limit
|
||||
period: 60
|
||||
# The max number of requests a user is allowed to do in the configured time period
|
||||
limit: 100
|
||||
# The store where the limit counter for each user is stored.
|
||||
# Possible values are "keyvalue", "memory" or "redis".
|
||||
# When choosing "keyvalue" this setting follows the one configured in the "keyvalue" section.
|
||||
store: keyvalue
|
||||
# The number of requests a user can make from the same IP to all unauthenticated routes (login, register,
|
||||
# password confirmation, email verification, password reset request) per minute. This limit cannot be disabled.
|
||||
# You should only change this if you know what you're doing.
|
||||
noauthlimit: 10
|
||||
|
||||
files:
|
||||
# The path where files are stored
|
||||
basepath: ./files # relative to the binary
|
||||
# The maximum size of a file, as a human-readable string.
|
||||
# Warning: The max size is limited 2^64-1 bytes due to the underlying datatype
|
||||
maxsize: 20MB
|
||||
|
||||
migration:
|
||||
todoist:
|
||||
# Wheter to enable the todoist migrator or not
|
||||
enable: false
|
||||
# The client id, required for making requests to the todoist api
|
||||
# You need to register your Vikunja instance at https://developer.todoist.com/appconsole.html to get this
|
||||
clientid:
|
||||
# The client secret, also required for making requests to the todoist api
|
||||
clientsecret:
|
||||
# The url where clients are redirected after they authorized Vikunja to access their Todoist items.
|
||||
# In Todoist, this is called `OAuth redirect URL` and it needs to match the url you entered when registering
|
||||
# your Vikunja instance at the Todoist developer console.
|
||||
# When using the official Vikunja frontend, set this to <service.publicurl>/migrate/todoist.
|
||||
# Otherwise, set this to an url which then makes a request to /api/v1/migration/todoist/migrate
|
||||
# with the code obtained from the todoist api.
|
||||
redirecturl: <service.publicurl>/migrate/todoist
|
||||
trello:
|
||||
# Whether to enable the trello migrator or not
|
||||
enable: false
|
||||
# The client id, required for making requests to the trello api
|
||||
# You need to register your Vikunja instance at https://trello.com/app-key (log in before you visit that link) to get this
|
||||
key:
|
||||
# The url where clients are redirected after they authorized Vikunja to access their trello cards.
|
||||
# This needs to match the url you entered when registering your Vikunja instance at trello.
|
||||
# This is usually the frontend url where the frontend then makes a request to /migration/trello/migrate
|
||||
# with the code obtained from the trello api.
|
||||
# Note that the Vikunja frontend expects this to end on /migrate/trello.
|
||||
redirecturl: <frontend url>/migrate/trello
|
||||
microsofttodo:
|
||||
# Wheter to enable the microsoft todo migrator or not
|
||||
enable: false
|
||||
# The client id, required for making requests to the microsoft graph api
|
||||
# See https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app#register-an-application
|
||||
# for information about how to register your Vikunja instance.
|
||||
clientid:
|
||||
# The client secret, also required for making requests to the microsoft graph api
|
||||
clientsecret:
|
||||
# The url where clients are redirected after they authorized Vikunja to access their microsoft todo tasks.
|
||||
# This needs to match the url you entered when registering your Vikunja instance at microsoft.
|
||||
# This is usually the frontend url where the frontend then makes a request to /migration/microsoft-todo/migrate
|
||||
# with the code obtained from the microsoft graph api.
|
||||
# Note that the Vikunja frontend expects this to be /migrate/microsoft-todo
|
||||
redirecturl: <frontend url>/migrate/microsoft-todo
|
||||
|
||||
avatar:
|
||||
# When using gravatar, this is the duration in seconds until a cached gravatar user avatar expires
|
||||
gravatarexpiration: 3600
|
||||
|
||||
backgrounds:
|
||||
# Whether to enable backgrounds for projects at all.
|
||||
enabled: true
|
||||
providers:
|
||||
upload:
|
||||
# Whether to enable uploaded project backgrounds
|
||||
enabled: true
|
||||
unsplash:
|
||||
# Whether to enable setting backgrounds from unsplash as project backgrounds
|
||||
enabled: false
|
||||
# You need to create an application for your installation at https://unsplash.com/oauth/applications/new
|
||||
# and set the access token below.
|
||||
accesstoken:
|
||||
# The unsplash application id is only used for pingback and required as per their api guidelines.
|
||||
# You can find the Application ID in the dashboard for your API application. It should be a numeric ID.
|
||||
# It will only show in the UI if your application has been approved for Enterprise usage, therefore if
|
||||
# you’re in Demo mode, you can also find the ID in the URL at the end: https://unsplash.com/oauth/applications/:application_id
|
||||
applicationid:
|
||||
|
||||
# Legal urls
|
||||
# Will be shown in the frontend if configured here
|
||||
legal:
|
||||
imprinturl:
|
||||
privacyurl:
|
||||
|
||||
# Key Value Storage settings
|
||||
# The Key Value Storage is used for different kinds of things like metrics and a few cache systems.
|
||||
keyvalue:
|
||||
# The type of the storage backend. Can be either "memory" or "redis". If "redis" is chosen it needs to be configured separately.
|
||||
type: "memory"
|
||||
|
||||
auth:
|
||||
# Local authentication will let users log in and register (if enabled) through the db.
|
||||
# This is the default auth mechanism and does not require any additional configuration.
|
||||
local:
|
||||
# Enable or disable local authentication
|
||||
enabled: true
|
||||
# OpenID configuration will allow users to authenticate through a third-party OpenID Connect compatible provider.<br/>
|
||||
# The provider needs to support the `openid`, `profile` and `email` scopes.<br/>
|
||||
# **Note:** Some openid providers (like Gitlab) only make the email of the user available through OpenID if they have set it to be publicly visible.
|
||||
# If the email is not public in those cases, authenticating will fail.
|
||||
# +**Note 2:** The frontend expects the third party to redirect the user <frontend-url>/auth/openid/<auth key> after authentication. Please make sure to configure the redirect url in your third party auth service accordingly if you're using the default Vikunja frontend.
|
||||
# The frontend will automatically provide the API with the redirect url, composed from the current url where it's hosted.
|
||||
# If you want to use the desktop client with OpenID, make sure to allow redirects to `127.0.0.1`.
|
||||
# Take a look at the [default config file](https://kolaente.dev/vikunja/vikunja/src/branch/main/config.yml.sample) for more information about how to configure openid authentication.
|
||||
openid:
|
||||
# Enable or disable OpenID Connect authentication
|
||||
enabled: false
|
||||
# A list of enabled providers
|
||||
providers:
|
||||
# The name of the provider as it will appear in the frontend.
|
||||
- name:
|
||||
# The auth url to send users to if they want to authenticate using OpenID Connect.
|
||||
authurl:
|
||||
# The oidc logouturl that users will be redirected to on logout.
|
||||
# Leave empty or delete key, if you do not want to be redirected.
|
||||
logouturl:
|
||||
# The client ID used to authenticate Vikunja at the OpenID Connect provider.
|
||||
clientid:
|
||||
# The client secret used to authenticate Vikunja at the OpenID Connect provider.
|
||||
clientsecret:
|
||||
# The scope necessary to use oidc.
|
||||
# If you want to use the Feature to create and assign to Vikunja teams via oidc, you have to add the custom "vikunja_scope" and check [openid.md](https://vikunja.io/docs/openid/).
|
||||
# e.g. scope: openid email profile vikunja_scope
|
||||
scope: openid email profile
|
||||
|
||||
# Prometheus metrics endpoint
|
||||
metrics:
|
||||
# If set to true, enables a /metrics endpoint for prometheus to collect metrics about Vikunja. You can query it from `/api/v1/metrics`.
|
||||
enabled: false
|
||||
# If set to a non-empty value the /metrics endpoint will require this as a username via basic auth in combination with the password below.
|
||||
username:
|
||||
# If set to a non-empty value the /metrics endpoint will require this as a password via basic auth in combination with the username below.
|
||||
password:
|
||||
|
||||
# Provide default settings for new users. When a new user is created, these settings will automatically be set for the user. If you change them in the config file afterwards they will not be changed back for existing users.
|
||||
defaultsettings:
|
||||
# The avatar source for the user. Can be `gravatar`, `initials`, `upload` or `marble`. If you set this to `upload` you'll also need to specify `defaultsettings.avatar_file_id`.
|
||||
avatar_provider: initials
|
||||
# The id of the file used as avatar.
|
||||
avatar_file_id: 0
|
||||
# If set to true users will get task reminders via email.
|
||||
email_reminders_enabled: false
|
||||
# If set to true will allow other users to find this user when searching for parts of their name.
|
||||
discoverable_by_name: false
|
||||
# If set to true will allow other users to find this user when searching for their exact email.
|
||||
discoverable_by_email: false
|
||||
# If set to true will send an email every day with all overdue tasks at a configured time.
|
||||
overdue_tasks_reminders_enabled: true
|
||||
# When to send the overdue task reminder email.
|
||||
overdue_tasks_reminders_time: 9:00
|
||||
# The id of the default project. Make sure users actually have access to this project when setting this value.
|
||||
default_project_id: 0
|
||||
# Start of the week for the user. `0` is sunday, `1` is monday and so on.
|
||||
week_start: 0
|
||||
# The language of the user interface. Must be an ISO 639-1 language code followed by an ISO 3166-1 alpha-2 country code. Check https://kolaente.dev/vikunja/vikunja/frontend/src/branch/main/src/i18n/lang for a list of possible languages. Will default to the browser language the user uses when signing up.
|
||||
language: <unset>
|
||||
# The time zone of each individual user. This will affect when users get reminders and overdue task emails.
|
||||
timezone: <time zone set at service.timezone>
|
||||
|
||||
webhooks:
|
||||
# Whether to enable support for webhooks
|
||||
enabled: true
|
||||
# The timeout in seconds until a webhook request fails when no response has been received.
|
||||
timeoutseconds: 30
|
||||
# The URL of [a mole instance](https://github.com/frain-dev/mole) to use to proxy outgoing webhook requests. You should use this and configure appropriately if you're not the only one using your Vikunja instance. More info about why: https://webhooks.fyi/best-practices/webhook-providers#implement-security-on-egress-communication. Must be used in combination with `webhooks.password` (see below).
|
||||
proxyurl:
|
||||
# The proxy password to use when authenticating against the proxy.
|
||||
proxypassword:
|
||||
@@ -56,6 +56,6 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"connect-history-api-fallback": "2.0.0",
|
||||
"express": "4.21.0"
|
||||
"express": "4.21.1"
|
||||
}
|
||||
}
|
||||
|
||||
Generated
+1544
-1243
File diff suppressed because it is too large
Load Diff
@@ -148,7 +148,7 @@ describe('Project View Kanban', () => {
|
||||
cy.get('.kanban .bucket .bucket-header .dropdown.options .dropdown-menu .dropdown-item')
|
||||
.contains('Delete')
|
||||
.click()
|
||||
cy.get('.modal-mask .modal-container .modal-content .header')
|
||||
cy.get('.modal-mask .modal-container .modal-content .modal-header')
|
||||
.should('contain', 'Delete the bucket')
|
||||
cy.get('.modal-mask .modal-container .modal-content .actions .button')
|
||||
.contains('Do it!')
|
||||
@@ -251,7 +251,7 @@ describe('Project View Kanban', () => {
|
||||
.should('be.visible')
|
||||
.contains('Delete')
|
||||
.click()
|
||||
cy.get('.modal-mask .modal-container .modal-content .header')
|
||||
cy.get('.modal-mask .modal-container .modal-content .modal-header')
|
||||
.should('contain', 'Delete this task')
|
||||
cy.get('.modal-mask .modal-container .modal-content .actions .button')
|
||||
.contains('Do it!')
|
||||
|
||||
@@ -356,7 +356,7 @@ describe('Task', () => {
|
||||
.should('be.visible')
|
||||
.contains('Delete')
|
||||
.click()
|
||||
cy.get('.modal-mask .modal-container .modal-content .header')
|
||||
cy.get('.modal-mask .modal-container .modal-content .modal-header')
|
||||
.should('contain', 'Delete this task')
|
||||
cy.get('.modal-mask .modal-container .modal-content .actions .button')
|
||||
.contains('Do it!')
|
||||
|
||||
+54
-54
@@ -13,7 +13,7 @@
|
||||
},
|
||||
"homepage": "https://vikunja.io/",
|
||||
"funding": "https://opencollective.com/vikunja",
|
||||
"packageManager": "pnpm@9.10.0",
|
||||
"packageManager": "pnpm@9.12.2",
|
||||
"keywords": [
|
||||
"todo",
|
||||
"productivity",
|
||||
@@ -56,44 +56,44 @@
|
||||
"@fortawesome/vue-fontawesome": "3.0.8",
|
||||
"@github/hotkey": "3.1.1",
|
||||
"@infectoone/vue-ganttastic": "2.3.2",
|
||||
"@intlify/unplugin-vue-i18n": "5.0.0",
|
||||
"@kyvg/vue3-notification": "3.3.0",
|
||||
"@intlify/unplugin-vue-i18n": "5.2.0",
|
||||
"@kyvg/vue3-notification": "3.4.0",
|
||||
"@sentry/tracing": "7.114.0",
|
||||
"@sentry/vue": "8.30.0",
|
||||
"@tiptap/core": "2.7.2",
|
||||
"@tiptap/extension-blockquote": "2.7.2",
|
||||
"@tiptap/extension-bold": "2.7.2",
|
||||
"@tiptap/extension-bullet-list": "2.7.2",
|
||||
"@tiptap/extension-code": "2.7.2",
|
||||
"@tiptap/extension-code-block": "2.7.2",
|
||||
"@tiptap/extension-code-block-lowlight": "2.7.2",
|
||||
"@tiptap/extension-document": "2.7.2",
|
||||
"@tiptap/extension-dropcursor": "2.7.2",
|
||||
"@tiptap/extension-gapcursor": "2.7.2",
|
||||
"@tiptap/extension-hard-break": "2.7.2",
|
||||
"@tiptap/extension-heading": "2.7.2",
|
||||
"@tiptap/extension-history": "2.7.2",
|
||||
"@tiptap/extension-horizontal-rule": "2.7.2",
|
||||
"@tiptap/extension-image": "2.7.2",
|
||||
"@tiptap/extension-italic": "2.7.2",
|
||||
"@tiptap/extension-link": "2.7.2",
|
||||
"@tiptap/extension-list-item": "2.7.2",
|
||||
"@tiptap/extension-ordered-list": "2.7.2",
|
||||
"@tiptap/extension-paragraph": "2.7.2",
|
||||
"@tiptap/extension-placeholder": "2.7.2",
|
||||
"@tiptap/extension-strike": "2.7.2",
|
||||
"@tiptap/extension-table": "2.7.2",
|
||||
"@tiptap/extension-table-cell": "2.7.2",
|
||||
"@tiptap/extension-table-header": "2.7.2",
|
||||
"@tiptap/extension-table-row": "2.7.2",
|
||||
"@tiptap/extension-task-item": "2.7.2",
|
||||
"@tiptap/extension-task-list": "2.7.2",
|
||||
"@tiptap/extension-text": "2.7.2",
|
||||
"@tiptap/extension-typography": "2.7.2",
|
||||
"@tiptap/extension-underline": "2.7.2",
|
||||
"@tiptap/pm": "2.7.2",
|
||||
"@tiptap/suggestion": "2.7.2",
|
||||
"@tiptap/vue-3": "2.7.2",
|
||||
"@sentry/vue": "8.34.0",
|
||||
"@tiptap/core": "2.8.0",
|
||||
"@tiptap/extension-blockquote": "2.8.0",
|
||||
"@tiptap/extension-bold": "2.8.0",
|
||||
"@tiptap/extension-bullet-list": "2.8.0",
|
||||
"@tiptap/extension-code": "2.8.0",
|
||||
"@tiptap/extension-code-block": "2.8.0",
|
||||
"@tiptap/extension-code-block-lowlight": "2.8.0",
|
||||
"@tiptap/extension-document": "2.8.0",
|
||||
"@tiptap/extension-dropcursor": "2.8.0",
|
||||
"@tiptap/extension-gapcursor": "2.8.0",
|
||||
"@tiptap/extension-hard-break": "2.8.0",
|
||||
"@tiptap/extension-heading": "2.8.0",
|
||||
"@tiptap/extension-history": "2.8.0",
|
||||
"@tiptap/extension-horizontal-rule": "2.8.0",
|
||||
"@tiptap/extension-image": "2.8.0",
|
||||
"@tiptap/extension-italic": "2.8.0",
|
||||
"@tiptap/extension-link": "2.8.0",
|
||||
"@tiptap/extension-list-item": "2.8.0",
|
||||
"@tiptap/extension-ordered-list": "2.8.0",
|
||||
"@tiptap/extension-paragraph": "2.8.0",
|
||||
"@tiptap/extension-placeholder": "2.8.0",
|
||||
"@tiptap/extension-strike": "2.8.0",
|
||||
"@tiptap/extension-table": "2.8.0",
|
||||
"@tiptap/extension-table-cell": "2.8.0",
|
||||
"@tiptap/extension-table-header": "2.8.0",
|
||||
"@tiptap/extension-table-row": "2.8.0",
|
||||
"@tiptap/extension-task-item": "2.8.0",
|
||||
"@tiptap/extension-task-list": "2.8.0",
|
||||
"@tiptap/extension-text": "2.8.0",
|
||||
"@tiptap/extension-typography": "2.8.0",
|
||||
"@tiptap/extension-underline": "2.8.0",
|
||||
"@tiptap/pm": "2.8.0",
|
||||
"@tiptap/suggestion": "2.8.0",
|
||||
"@tiptap/vue-3": "2.8.0",
|
||||
"@vueuse/core": "11.1.0",
|
||||
"@vueuse/router": "11.1.0",
|
||||
"axios": "1.7.7",
|
||||
@@ -102,7 +102,7 @@
|
||||
"change-case": "5.4.4",
|
||||
"date-fns": "4.1.0",
|
||||
"dayjs": "1.11.13",
|
||||
"dompurify": "3.1.6",
|
||||
"dompurify": "3.1.7",
|
||||
"fast-deep-equal": "3.1.3",
|
||||
"flatpickr": "4.6.13",
|
||||
"flexsearch": "0.7.43",
|
||||
@@ -110,18 +110,18 @@
|
||||
"is-touch-device": "1.0.1",
|
||||
"klona": "2.0.6",
|
||||
"lowlight": "2.9.0",
|
||||
"pinia": "2.2.2",
|
||||
"pinia": "2.2.4",
|
||||
"register-service-worker": "1.7.2",
|
||||
"sortablejs": "1.15.3",
|
||||
"tailwindcss": "3.4.12",
|
||||
"tailwindcss": "3.4.14",
|
||||
"tippy.js": "6.3.7",
|
||||
"ufo": "1.5.4",
|
||||
"vue": "3.5.6",
|
||||
"vue": "3.5.12",
|
||||
"vue-advanced-cropper": "2.8.9",
|
||||
"vue-flatpickr-component": "11.0.5",
|
||||
"vue-i18n": "10.0.1",
|
||||
"vue-i18n": "10.0.4",
|
||||
"vue-router": "4.4.5",
|
||||
"vuemoji-picker": "0.2.1",
|
||||
"vuemoji-picker": "0.3.1",
|
||||
"workbox-precaching": "7.1.0",
|
||||
"zhyswan-vuedraggable": "4.1.3"
|
||||
},
|
||||
@@ -137,9 +137,9 @@
|
||||
"@types/codemirror": "5.60.15",
|
||||
"@types/dompurify": "3.0.5",
|
||||
"@types/flexsearch": "0.7.6",
|
||||
"@types/is-touch-device": "1.0.2",
|
||||
"@types/is-touch-device": "1.0.3",
|
||||
"@types/lodash.clonedeep": "4.5.9",
|
||||
"@types/node": "20.16.5",
|
||||
"@types/node": "20.16.11",
|
||||
"@types/sortablejs": "1.15.8",
|
||||
"@typescript-eslint/eslint-plugin": "7.18.0",
|
||||
"@typescript-eslint/parser": "7.18.0",
|
||||
@@ -149,11 +149,11 @@
|
||||
"@vue/test-utils": "2.4.6",
|
||||
"@vue/tsconfig": "0.5.1",
|
||||
"autoprefixer": "10.4.20",
|
||||
"browserslist": "4.23.3",
|
||||
"caniuse-lite": "1.0.30001660",
|
||||
"browserslist": "4.24.0",
|
||||
"caniuse-lite": "1.0.30001667",
|
||||
"csstype": "3.1.3",
|
||||
"cypress": "13.14.2",
|
||||
"esbuild": "0.23.1",
|
||||
"cypress": "13.15.0",
|
||||
"esbuild": "0.24.0",
|
||||
"eslint": "8.57.1",
|
||||
"eslint-plugin-vue": "9.28.0",
|
||||
"happy-dom": "14.12.3",
|
||||
@@ -162,13 +162,13 @@
|
||||
"postcss-easing-gradients": "3.0.1",
|
||||
"postcss-easings": "4.0.0",
|
||||
"postcss-preset-env": "9.6.0",
|
||||
"rollup": "4.21.3",
|
||||
"rollup": "4.24.0",
|
||||
"rollup-plugin-visualizer": "5.12.0",
|
||||
"sass": "1.79.1",
|
||||
"sass": "1.79.4",
|
||||
"start-server-and-test": "2.0.8",
|
||||
"typescript": "5.6.2",
|
||||
"typescript": "5.6.3",
|
||||
"unplugin-inject-preload": "2.0.5",
|
||||
"vite": "5.4.6",
|
||||
"vite": "5.4.8",
|
||||
"vite-plugin-pwa": "0.20.5",
|
||||
"vite-plugin-sentry": "1.4.0",
|
||||
"vite-svg-loader": "5.1.0",
|
||||
|
||||
Generated
+874
-873
File diff suppressed because it is too large
Load Diff
@@ -3,33 +3,22 @@
|
||||
v-cy="'checkbox'"
|
||||
class="base-checkbox"
|
||||
>
|
||||
<input
|
||||
:id="checkboxId"
|
||||
type="checkbox"
|
||||
class="is-sr-only"
|
||||
:checked="modelValue"
|
||||
:disabled="disabled || undefined"
|
||||
@change="(event) => emit('update:modelValue', (event.target as HTMLInputElement).checked)"
|
||||
<label
|
||||
class="base-checkbox__label"
|
||||
>
|
||||
|
||||
<slot
|
||||
name="label"
|
||||
:checkbox-id="checkboxId"
|
||||
>
|
||||
<label
|
||||
:for="checkboxId"
|
||||
class="base-checkbox__label"
|
||||
<input
|
||||
type="checkbox"
|
||||
class="is-sr-only"
|
||||
:checked="modelValue"
|
||||
:disabled="disabled || undefined"
|
||||
@change="(event) => emit('update:modelValue', (event.target as HTMLInputElement).checked)"
|
||||
>
|
||||
<slot />
|
||||
</label>
|
||||
</slot>
|
||||
<slot />
|
||||
</label>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {ref} from 'vue'
|
||||
import {createRandomID} from '@/helpers/randomId'
|
||||
|
||||
withDefaults(defineProps<{
|
||||
modelValue?: boolean,
|
||||
disabled: boolean,
|
||||
@@ -38,10 +27,8 @@ withDefaults(defineProps<{
|
||||
})
|
||||
|
||||
const emit = defineEmits<{
|
||||
(event: 'update:modelValue', value: boolean): void
|
||||
(event: 'update:modelValue', value: boolean): void
|
||||
}>()
|
||||
|
||||
const checkboxId = ref(`checkbox_${createRandomID()}`)
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@@ -53,7 +40,7 @@ const checkboxId = ref(`checkbox_${createRandomID()}`)
|
||||
}
|
||||
|
||||
.base-checkbox:has(input:disabled) .base-checkbox__label {
|
||||
cursor:not-allowed;
|
||||
cursor: not-allowed;
|
||||
pointer-events: none;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,97 @@
|
||||
<template>
|
||||
<nav
|
||||
v-if="totalPages > 1"
|
||||
aria-label="pagination"
|
||||
class="pagination is-centered p-4"
|
||||
role="navigation"
|
||||
>
|
||||
<slot
|
||||
name="previous"
|
||||
:disabled="currentPage === 1"
|
||||
>
|
||||
{{ $t('misc.previous') }}
|
||||
</slot>
|
||||
<slot
|
||||
name="next"
|
||||
:disabled="currentPage === totalPages"
|
||||
>
|
||||
{{ $t('misc.next') }}
|
||||
</slot>
|
||||
<ul class="pagination-list">
|
||||
<li
|
||||
v-for="(p, i) in pages"
|
||||
:key="`page-${i}`"
|
||||
>
|
||||
<span
|
||||
v-if="p.isEllipsis"
|
||||
class="pagination-ellipsis"
|
||||
>…</span>
|
||||
<slot
|
||||
v-else
|
||||
name="page-link"
|
||||
:page="p"
|
||||
:is-current="p.number === currentPage"
|
||||
>
|
||||
{{ p.number }}
|
||||
</slot>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {computed} from 'vue'
|
||||
|
||||
const props = defineProps<{
|
||||
totalPages: number,
|
||||
currentPage: number
|
||||
}>()
|
||||
|
||||
function createPagination(totalPages: number, currentPage: number) {
|
||||
const pages = []
|
||||
for (let i = 0; i < totalPages; i++) {
|
||||
if (
|
||||
i > 0 &&
|
||||
(i + 1) < totalPages &&
|
||||
((i + 1) > currentPage + 1 || (i + 1) < currentPage - 1)
|
||||
) {
|
||||
if (pages[i - 1] && !pages[i - 1].isEllipsis) {
|
||||
pages.push({
|
||||
number: 0,
|
||||
isEllipsis: true,
|
||||
})
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
pages.push({
|
||||
number: i + 1,
|
||||
isEllipsis: false,
|
||||
})
|
||||
}
|
||||
return pages
|
||||
}
|
||||
|
||||
const pages = computed(() => createPagination(props.totalPages, props.currentPage))
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.pagination {
|
||||
padding-bottom: 1rem;
|
||||
}
|
||||
|
||||
.pagination-previous,
|
||||
.pagination-next {
|
||||
&:not(:disabled):hover {
|
||||
background: $scheme-main;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.pagination-list {
|
||||
&, & li {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
</h1>
|
||||
<div class="box has-text-left view">
|
||||
<RouterView />
|
||||
<PoweredByLink />
|
||||
<PoweredByLink utm-medium="link_share" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -109,7 +109,10 @@
|
||||
</nav>
|
||||
</template>
|
||||
|
||||
<PoweredByLink class="mt-auto" />
|
||||
<PoweredByLink
|
||||
class="mt-auto"
|
||||
utm-medium="navigation"
|
||||
/>
|
||||
</aside>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<BaseButton
|
||||
class="menu-bottom-link"
|
||||
:href="poweredByUrl"
|
||||
:href="computedUrl"
|
||||
target="_blank"
|
||||
>
|
||||
{{ $t('misc.poweredBy') }}
|
||||
@@ -9,8 +9,15 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {computed, defineProps} from 'vue'
|
||||
import BaseButton from '@/components/base/BaseButton.vue'
|
||||
import {POWERED_BY as poweredByUrl} from '@/urls'
|
||||
|
||||
const props = defineProps<{
|
||||
utmMedium: string;
|
||||
}>()
|
||||
|
||||
const computedUrl = computed(() => `${poweredByUrl}&utm_medium=${props.utmMedium}`)
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
/>
|
||||
<div
|
||||
class="color-bubble-handle-wrapper"
|
||||
:class="{'is-draggable': project.id > 0}"
|
||||
:class="{'is-draggable': project.id > 0 && project.maxRight > RIGHTS.READ}"
|
||||
>
|
||||
<ColorBubble
|
||||
v-if="project.hexColor !== ''"
|
||||
@@ -38,7 +38,7 @@
|
||||
<Icon icon="filter" />
|
||||
</span>
|
||||
<span
|
||||
v-if="project.id > 0"
|
||||
v-if="project.id > 0 && project.maxRight > RIGHTS.READ"
|
||||
class="icon menu-item-icon handle"
|
||||
:class="{'has-color-bubble': project.hexColor !== ''}"
|
||||
>
|
||||
@@ -48,7 +48,7 @@
|
||||
<span class="project-menu-title">{{ getProjectTitle(project) }}</span>
|
||||
</BaseButton>
|
||||
<BaseButton
|
||||
v-if="project.id > 0"
|
||||
v-if="project.id > 0 && project.maxRight > RIGHTS.READ"
|
||||
class="favorite"
|
||||
:class="{'is-favorite': project.isFavorite}"
|
||||
@click="projectStore.toggleProjectFavorite(project)"
|
||||
@@ -56,6 +56,7 @@
|
||||
<Icon :icon="project.isFavorite ? 'star' : ['far', 'star']" />
|
||||
</BaseButton>
|
||||
<ProjectSettingsDropdown
|
||||
v-if="project.maxRight > RIGHTS.READ"
|
||||
class="menu-list-dropdown"
|
||||
:project="project"
|
||||
>
|
||||
@@ -94,6 +95,7 @@ import ProjectSettingsDropdown from '@/components/project/ProjectSettingsDropdow
|
||||
import {getProjectTitle} from '@/helpers/getProjectTitle'
|
||||
import ColorBubble from '@/components/misc/ColorBubble.vue'
|
||||
import ProjectsNavigation from '@/components/home/ProjectsNavigation.vue'
|
||||
import {RIGHTS} from '@/constants/rights'
|
||||
|
||||
const props = defineProps<{
|
||||
project: IProject,
|
||||
|
||||
@@ -38,7 +38,6 @@ const emit = defineEmits<{
|
||||
}>()
|
||||
</script>
|
||||
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.fancy-checkbox {
|
||||
display: inline-block;
|
||||
@@ -70,8 +69,8 @@ const emit = defineEmits<{
|
||||
}
|
||||
}
|
||||
|
||||
.fancy-checkbox:not(:has(input:disabled)):hover .fancy-checkbox__icon,
|
||||
.fancy-checkbox:has(input:checked) .fancy-checkbox__icon {
|
||||
.fancy-checkbox:hover input:not(:disabled) + .fancy-checkbox__icon,
|
||||
.fancy-checkbox input:checked + .fancy-checkbox__icon {
|
||||
--stroke-color: var(--primary);
|
||||
}
|
||||
</style>
|
||||
@@ -80,13 +79,13 @@ const emit = defineEmits<{
|
||||
// Since css-has-pseudo doesn't work with deep classes,
|
||||
// the following rules can't be scoped
|
||||
|
||||
.fancy-checkbox:has(:not(input:checked)) .fancy-checkbox__icon {
|
||||
.fancy-checkbox :not(input:checked) + .fancy-checkbox__icon {
|
||||
path {
|
||||
transition-delay: 0.05s;
|
||||
}
|
||||
}
|
||||
|
||||
.fancy-checkbox:has(input:checked) .fancy-checkbox__icon {
|
||||
.fancy-checkbox input:checked + .fancy-checkbox__icon {
|
||||
path {
|
||||
stroke-dashoffset: 60;
|
||||
}
|
||||
|
||||
@@ -495,7 +495,8 @@ watch(
|
||||
)
|
||||
|
||||
function bubbleNow() {
|
||||
if (editor.value?.getHTML() === modelValue) {
|
||||
if (editor.value?.getHTML() === modelValue ||
|
||||
(editor.value?.getHTML() === '<p></p>') && modelValue === '') {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
}"
|
||||
>
|
||||
<slot>
|
||||
<div class="header">
|
||||
<div class="modal-header">
|
||||
<slot name="header" />
|
||||
</div>
|
||||
<div class="content">
|
||||
@@ -140,7 +140,7 @@ $modal-width: 1024px;
|
||||
transform: none;
|
||||
}
|
||||
|
||||
.header {
|
||||
.modal-header {
|
||||
font-size: 2rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
@@ -241,6 +241,14 @@ $modal-width: 1024px;
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
.modal-content:has(.modal-header) {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
padding: 0 1rem;
|
||||
min-height: 100vh
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
@@ -1,89 +1,49 @@
|
||||
<template>
|
||||
<nav
|
||||
v-if="totalPages > 1"
|
||||
aria-label="pagination"
|
||||
class="pagination is-centered p-4"
|
||||
role="navigation"
|
||||
<BasePagination
|
||||
:total-pages="totalPages"
|
||||
:current-page="currentPage"
|
||||
>
|
||||
<RouterLink
|
||||
:disabled="currentPage === 1 || undefined"
|
||||
:to="getRouteForPagination(currentPage - 1)"
|
||||
class="pagination-previous"
|
||||
>
|
||||
{{ $t('misc.previous') }}
|
||||
</RouterLink>
|
||||
<RouterLink
|
||||
:disabled="currentPage === totalPages || undefined"
|
||||
:to="getRouteForPagination(currentPage + 1)"
|
||||
class="pagination-next"
|
||||
>
|
||||
{{ $t('misc.next') }}
|
||||
</RouterLink>
|
||||
<ul class="pagination-list">
|
||||
<li
|
||||
v-for="(p, i) in pages"
|
||||
:key="`page-${i}`"
|
||||
<template #previous="{ disabled }">
|
||||
<RouterLink
|
||||
:disabled="disabled || undefined"
|
||||
:to="getRouteForPagination(currentPage - 1)"
|
||||
class="pagination-previous"
|
||||
>
|
||||
<span
|
||||
v-if="p.isEllipsis"
|
||||
class="pagination-ellipsis"
|
||||
>…</span>
|
||||
<RouterLink
|
||||
v-else
|
||||
class="pagination-link"
|
||||
:aria-label="'Goto page ' + p.number"
|
||||
:class="{ 'is-current': p.number === currentPage }"
|
||||
:to="getRouteForPagination(p.number)"
|
||||
>
|
||||
{{ p.number }}
|
||||
</RouterLink>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
{{ $t('misc.previous') }}
|
||||
</RouterLink>
|
||||
</template>
|
||||
<template #next="{ disabled }">
|
||||
<RouterLink
|
||||
:disabled="disabled || undefined"
|
||||
:to="getRouteForPagination(currentPage + 1)"
|
||||
class="pagination-next"
|
||||
>
|
||||
{{ $t('misc.next') }}
|
||||
</RouterLink>
|
||||
</template>
|
||||
<template #page-link="{ page, isCurrent }">
|
||||
<RouterLink
|
||||
class="pagination-link"
|
||||
:aria-label="'Goto page ' + page.number"
|
||||
:class="{ 'is-current': isCurrent }"
|
||||
:to="getRouteForPagination(page.number)"
|
||||
>
|
||||
{{ page.number }}
|
||||
</RouterLink>
|
||||
</template>
|
||||
</BasePagination>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {computed} from 'vue'
|
||||
import BasePagination from '@/components/base/BasePagination.vue'
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
withDefaults(defineProps<{
|
||||
totalPages: number,
|
||||
currentPage?: number
|
||||
}>(), {
|
||||
currentPage: 0,
|
||||
})
|
||||
|
||||
function createPagination(totalPages: number, currentPage: number) {
|
||||
const pages = []
|
||||
for (let i = 0; i < totalPages; i++) {
|
||||
|
||||
// Show ellipsis instead of all pages
|
||||
if (
|
||||
i > 0 && // Always at least the first page
|
||||
(i + 1) < totalPages && // And the last page
|
||||
(
|
||||
// And the current with current + 1 and current - 1
|
||||
(i + 1) > currentPage + 1 ||
|
||||
(i + 1) < currentPage - 1
|
||||
)
|
||||
) {
|
||||
// Only add an ellipsis if the last page isn't already one
|
||||
if (pages[i - 1] && !pages[i - 1].isEllipsis) {
|
||||
pages.push({
|
||||
number: 0,
|
||||
isEllipsis: true,
|
||||
})
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
pages.push({
|
||||
number: i + 1,
|
||||
isEllipsis: false,
|
||||
})
|
||||
}
|
||||
return pages
|
||||
}
|
||||
|
||||
function getRouteForPagination(page = 1, type = null) {
|
||||
return {
|
||||
name: type,
|
||||
@@ -95,20 +55,4 @@ function getRouteForPagination(page = 1, type = null) {
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
const pages = computed(() => createPagination(props.totalPages, props.currentPage))
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.pagination {
|
||||
padding-bottom: 1rem;
|
||||
}
|
||||
|
||||
.pagination-previous,
|
||||
.pagination-next {
|
||||
&:not(:disabled):hover {
|
||||
background: $scheme-main;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</script>
|
||||
@@ -0,0 +1,55 @@
|
||||
<template>
|
||||
<BasePagination
|
||||
:total-pages="totalPages"
|
||||
:current-page="currentPage"
|
||||
>
|
||||
<template #previous="{ disabled }">
|
||||
<BaseButton
|
||||
:disabled="disabled"
|
||||
class="pagination-previous"
|
||||
@click="changePage(currentPage - 1)"
|
||||
>
|
||||
{{ $t('misc.previous') }}
|
||||
</BaseButton>
|
||||
</template>
|
||||
<template #next="{ disabled }">
|
||||
<BaseButton
|
||||
:disabled="disabled"
|
||||
class="pagination-next"
|
||||
@click="changePage(currentPage + 1)"
|
||||
>
|
||||
{{ $t('misc.next') }}
|
||||
</BaseButton>
|
||||
</template>
|
||||
<template #page-link="{ page, isCurrent }">
|
||||
<BaseButton
|
||||
class="pagination-link"
|
||||
:aria-label="'Goto page ' + page.number"
|
||||
:class="{ 'is-current': isCurrent }"
|
||||
@click="changePage(page.number)"
|
||||
>
|
||||
{{ page.number }}
|
||||
</BaseButton>
|
||||
</template>
|
||||
</BasePagination>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import BasePagination from '@/components/base/BasePagination.vue'
|
||||
import BaseButton from '@/components/base/BaseButton.vue'
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
totalPages: number,
|
||||
currentPage: number
|
||||
}>(), {
|
||||
currentPage: 1,
|
||||
})
|
||||
|
||||
const emit = defineEmits(['pageChanged'])
|
||||
|
||||
function changePage(page: number) {
|
||||
if (page >= 1 && page <= props.totalPages) {
|
||||
emit('pageChanged', page)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -124,15 +124,20 @@ let interval: ReturnType<typeof setInterval>
|
||||
onMounted(() => {
|
||||
loadNotifications()
|
||||
document.addEventListener('click', hidePopup)
|
||||
document.addEventListener('visibilitychange', loadNotifications)
|
||||
interval = setInterval(loadNotifications, LOAD_NOTIFICATIONS_INTERVAL)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
document.removeEventListener('click', hidePopup)
|
||||
document.removeEventListener('visibilitychange', loadNotifications)
|
||||
clearInterval(interval)
|
||||
})
|
||||
|
||||
async function loadNotifications() {
|
||||
if (document.visibilityState !== 'visible') {
|
||||
return
|
||||
}
|
||||
// We're recreating the notification service here to make sure it uses the latest api user token
|
||||
const notificationService = new NotificationService()
|
||||
allNotifications.value = await notificationService.getAll()
|
||||
|
||||
@@ -109,6 +109,7 @@
|
||||
{{ $t('menu.createProject') }}
|
||||
</DropdownItem>
|
||||
<DropdownItem
|
||||
v-if="project.maxRight === RIGHTS.ADMIN"
|
||||
v-tooltip="isDefaultProject ? $t('menu.cantDeleteIsDefault') : ''"
|
||||
:to="{ name: 'project.settings.delete', params: { projectId: project.id } }"
|
||||
icon="trash-alt"
|
||||
@@ -135,6 +136,7 @@ import {isSavedFilter} from '@/services/savedFilter'
|
||||
import {useConfigStore} from '@/stores/config'
|
||||
import {useProjectStore} from '@/stores/projects'
|
||||
import {useAuthStore} from '@/stores/auth'
|
||||
import {RIGHTS} from '@/constants/rights'
|
||||
|
||||
const props = defineProps<{
|
||||
project: IProject
|
||||
|
||||
@@ -30,6 +30,9 @@ const showDocs = ref(false)
|
||||
<li><code>assignees</code>: {{ $t('filters.query.help.fields.assignees') }}</li>
|
||||
<li><code>labels</code>: {{ $t('filters.query.help.fields.labels') }}</li>
|
||||
<li><code>project</code>: {{ $t('filters.query.help.fields.project') }}</li>
|
||||
<li><code>reminders</code>: {{ $t('filters.query.help.fields.reminders') }}</li>
|
||||
<li><code>created</code>: {{ $t('filters.query.help.fields.created') }}</li>
|
||||
<li><code>updated</code>: {{ $t('filters.query.help.fields.updated') }}</li>
|
||||
</ul>
|
||||
<p>{{ $t('filters.query.help.canUseDatemath') }}</p>
|
||||
<p>{{ $t('filters.query.help.operators.intro') }}</p>
|
||||
|
||||
@@ -104,7 +104,7 @@ const GanttChart = createAsyncComponent(() => import('@/components/tasks/GanttCh
|
||||
const baseStore = useBaseStore()
|
||||
const canWrite = computed(() => baseStore.currentProject?.maxRight > RIGHTS.READ)
|
||||
|
||||
const {route} = toRefs(props)
|
||||
const {route, viewId} = toRefs(props)
|
||||
const {
|
||||
filters,
|
||||
hasDefaultFilters,
|
||||
@@ -113,7 +113,7 @@ const {
|
||||
isLoading,
|
||||
addTask,
|
||||
updateTask,
|
||||
} = useGanttFilters(route, props.viewId)
|
||||
} = useGanttFilters(route, viewId)
|
||||
|
||||
const DEFAULT_DATE_RANGE_DAYS = 7
|
||||
|
||||
@@ -218,4 +218,4 @@ const flatPickerConfig = computed<Options>(() => ({
|
||||
font-size: .9rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<template>
|
||||
<div
|
||||
v-if="enabled"
|
||||
class="content details"
|
||||
ref="commentsRef"
|
||||
class="content details comments-container"
|
||||
>
|
||||
<h3
|
||||
v-if="canWrite || comments.length > 0"
|
||||
@@ -15,7 +16,7 @@
|
||||
<div class="comments">
|
||||
<span
|
||||
v-if="taskCommentService.loading && saving === null && !creating"
|
||||
class="is-inline-flex is-align-items-center"
|
||||
class="is-flex is-align-items-center my-4 ml-2"
|
||||
>
|
||||
<span class="loader is-inline-block mr-2" />
|
||||
{{ $t('task.comment.loading') }}
|
||||
@@ -115,6 +116,14 @@
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<PaginationEmit
|
||||
v-if="taskCommentService.totalPages > 1"
|
||||
:total-pages="taskCommentService.totalPages"
|
||||
:current-page="currentPage"
|
||||
@pageChanged="changePage"
|
||||
/>
|
||||
|
||||
<div
|
||||
v-if="canWrite"
|
||||
class="media comment d-print-none"
|
||||
@@ -168,6 +177,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<Modal
|
||||
:enabled="showDeleteModal"
|
||||
@close="showDeleteModal = false"
|
||||
@@ -193,6 +203,7 @@ import {useI18n} from 'vue-i18n'
|
||||
|
||||
import CustomTransition from '@/components/misc/CustomTransition.vue'
|
||||
import Editor from '@/components/input/AsyncEditor'
|
||||
import PaginationEmit from '@/components/misc/PaginationEmit.vue'
|
||||
|
||||
import TaskCommentService from '@/services/taskComment'
|
||||
import TaskCommentModel from '@/models/taskComment'
|
||||
@@ -255,6 +266,10 @@ const actions = computed(() => {
|
||||
|
||||
const frontendUrl = computed(() => configStore.frontendUrl)
|
||||
|
||||
const currentPage = ref(1)
|
||||
|
||||
const commentsRef = ref<HTMLElement | null>(null)
|
||||
|
||||
async function attachmentUpload(files: File[] | FileList): (Promise<string[]>) {
|
||||
|
||||
const uploadPromises: Promise<string>[] = []
|
||||
@@ -280,12 +295,21 @@ async function loadComments(taskId: ITask['id']) {
|
||||
newComment.taskId = taskId
|
||||
commentEdit.taskId = taskId
|
||||
commentToDelete.taskId = taskId
|
||||
comments.value = await taskCommentService.getAll({taskId})
|
||||
comments.value = await taskCommentService.getAll({taskId}, {}, currentPage.value)
|
||||
}
|
||||
|
||||
async function changePage(page: number) {
|
||||
commentsRef.value?.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'nearest' })
|
||||
currentPage.value = page
|
||||
await loadComments(props.taskId)
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.taskId,
|
||||
loadComments,
|
||||
() => {
|
||||
currentPage.value = 1 // Reset to first page when task changes
|
||||
loadComments(props.taskId)
|
||||
},
|
||||
{immediate: true},
|
||||
)
|
||||
|
||||
@@ -434,4 +458,8 @@ function getCommentUrl(commentId: string) {
|
||||
.media-content {
|
||||
width: calc(100% - 48px - 2rem);
|
||||
}
|
||||
|
||||
.comments-container {
|
||||
scroll-margin-top: 4rem;
|
||||
}
|
||||
</style>
|
||||
@@ -16,6 +16,7 @@
|
||||
:is-done="task.done"
|
||||
/>
|
||||
<BaseButton
|
||||
v-if="hasClose"
|
||||
class="close"
|
||||
@click="$emit('close')"
|
||||
>
|
||||
@@ -29,10 +30,12 @@
|
||||
:spellcheck="false"
|
||||
@blur="save(($event.target as HTMLInputElement).textContent as string)"
|
||||
@keydown.enter.prevent.stop="($event.target as HTMLInputElement).blur()"
|
||||
@keydown.esc.prevent.stop="cancel($event.target as HTMLInputElement)"
|
||||
>
|
||||
{{ task.title.trim() }}
|
||||
</h1>
|
||||
<BaseButton
|
||||
v-if="hasClose"
|
||||
class="close"
|
||||
@click="$emit('close')"
|
||||
>
|
||||
@@ -78,8 +81,10 @@ import {getHexColor, getTaskIdentifier} from '@/models/task'
|
||||
const props = withDefaults(defineProps<{
|
||||
task: ITask,
|
||||
canWrite: boolean | undefined,
|
||||
hasClose: boolean | undefined,
|
||||
}>(), {
|
||||
canWrite: false,
|
||||
hasClose: false,
|
||||
})
|
||||
|
||||
const emit = defineEmits<{
|
||||
@@ -129,6 +134,11 @@ async function save(title: string) {
|
||||
saving.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function cancel(element: HTMLInputElement) {
|
||||
element.textContent = props.task.title
|
||||
element.blur()
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -6,6 +6,8 @@ export const DATE_FIELDS = [
|
||||
'endDate',
|
||||
'doneAt',
|
||||
'reminders',
|
||||
'created',
|
||||
'updated',
|
||||
]
|
||||
|
||||
export const ASSIGNEE_FIELDS = [
|
||||
|
||||
@@ -458,7 +458,10 @@
|
||||
"doneAt": "The date and time when the task was completed",
|
||||
"assignees": "The assignees of the task",
|
||||
"labels": "The labels associated with the task",
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)"
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)",
|
||||
"reminders": "The reminders of the task as a date field, will return all tasks with at least one reminder matching the query",
|
||||
"created": "The time and date when the task was created",
|
||||
"updated": "The time and date when the task was last changed"
|
||||
},
|
||||
"operators": {
|
||||
"intro": "The available operators for filtering include:",
|
||||
|
||||
@@ -458,7 +458,10 @@
|
||||
"doneAt": "The date and time when the task was completed",
|
||||
"assignees": "The assignees of the task",
|
||||
"labels": "The labels associated with the task",
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)"
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)",
|
||||
"reminders": "The reminders of the task as a date field, will return all tasks with at least one reminder matching the query",
|
||||
"created": "The time and date when the task was created",
|
||||
"updated": "The time and date when the task was last changed"
|
||||
},
|
||||
"operators": {
|
||||
"intro": "The available operators for filtering include:",
|
||||
|
||||
@@ -458,7 +458,10 @@
|
||||
"doneAt": "Datum a čas, kdy byl úkol dokončen",
|
||||
"assignees": "Přiřazení uživatelé",
|
||||
"labels": "Štítky přiřazené úkolu",
|
||||
"project": "Projekt, do kterého úkol patří (k dispozici pouze pro uložené filtry, ne na úrovni projektu)"
|
||||
"project": "Projekt, do kterého úkol patří (k dispozici pouze pro uložené filtry, ne na úrovni projektu)",
|
||||
"reminders": "The reminders of the task as a date field, will return all tasks with at least one reminder matching the query",
|
||||
"created": "The time and date when the task was created",
|
||||
"updated": "The time and date when the task was last changed"
|
||||
},
|
||||
"operators": {
|
||||
"intro": "Dostupné operátory pro filtrování zahrnují:",
|
||||
|
||||
@@ -458,7 +458,10 @@
|
||||
"doneAt": "The date and time when the task was completed",
|
||||
"assignees": "The assignees of the task",
|
||||
"labels": "The labels associated with the task",
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)"
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)",
|
||||
"reminders": "The reminders of the task as a date field, will return all tasks with at least one reminder matching the query",
|
||||
"created": "The time and date when the task was created",
|
||||
"updated": "The time and date when the task was last changed"
|
||||
},
|
||||
"operators": {
|
||||
"intro": "The available operators for filtering include:",
|
||||
|
||||
@@ -458,7 +458,10 @@
|
||||
"doneAt": "Datum und Uhrzeit, an dem die Aufgabe als erledigt markiert wurde",
|
||||
"assignees": "Die der Aufgabe Zugewiesenen",
|
||||
"labels": "Die der Aufgabe zugeordneten Labels",
|
||||
"project": "Das Projekt, zu dem die Aufgabe gehört (nur verfügbar für gespeicherte Filter, nicht auf Projektebene)"
|
||||
"project": "Das Projekt, zu dem die Aufgabe gehört (nur verfügbar für gespeicherte Filter, nicht auf Projektebene)",
|
||||
"reminders": "Die Erinnerungen einer Aufgabe als Datumsfeld, gibt alle Aufgaben mit mindestens einer Erinnerung zurück, die dem Filter entspricht",
|
||||
"created": "Datum und Uhrzeit, an dem die Aufgabe erstellt wurde",
|
||||
"updated": "Datum und Uhrzeit, an dem die Aufgabe zuletzt geändert wurde"
|
||||
},
|
||||
"operators": {
|
||||
"intro": "Die verfügbaren Operatoren für die Filterung sind:",
|
||||
|
||||
@@ -458,7 +458,10 @@
|
||||
"doneAt": "Datum und Uhrzeit, an dem die Aufgabe als erledigt markiert wurde",
|
||||
"assignees": "Die der Aufgabe Zugewiesenen",
|
||||
"labels": "Die der Aufgabe zugeordneten Labels",
|
||||
"project": "Das Projekt, zu dem die Aufgabe gehört (nur verfügbar für gespeicherte Filter, nicht auf Projektebene)"
|
||||
"project": "Das Projekt, zu dem die Aufgabe gehört (nur verfügbar für gespeicherte Filter, nicht auf Projektebene)",
|
||||
"reminders": "Die Erinnerungen einer Aufgabe als Datumsfeld, gibt alle Aufgaben mit mindestens einer Erinnerung zurück, die dem Filter entspricht",
|
||||
"created": "Datum und Uhrzeit, an dem die Aufgabe erstellt wurde",
|
||||
"updated": "Datum und Uhrzeit, an dem die Aufgabe zuletzt geändert wurde"
|
||||
},
|
||||
"operators": {
|
||||
"intro": "Die verfügbaren Operatoren für die Filterung sind:",
|
||||
|
||||
@@ -458,7 +458,10 @@
|
||||
"doneAt": "The date and time when the task was completed",
|
||||
"assignees": "The assignees of the task",
|
||||
"labels": "The labels associated with the task",
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)"
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)",
|
||||
"reminders": "The reminders of the task as a date field, will return all tasks with at least one reminder matching the query",
|
||||
"created": "The time and date when the task was created",
|
||||
"updated": "The time and date when the task was last changed"
|
||||
},
|
||||
"operators": {
|
||||
"intro": "The available operators for filtering include:",
|
||||
|
||||
@@ -458,7 +458,10 @@
|
||||
"doneAt": "The date and time when the task was completed",
|
||||
"assignees": "The assignees of the task",
|
||||
"labels": "The labels associated with the task",
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)"
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)",
|
||||
"reminders": "The reminders of the task as a date field, will return all tasks with at least one reminder matching the query",
|
||||
"created": "The time and date when the task was created",
|
||||
"updated": "The time and date when the task was last changed"
|
||||
},
|
||||
"operators": {
|
||||
"intro": "The available operators for filtering include:",
|
||||
|
||||
@@ -458,7 +458,10 @@
|
||||
"doneAt": "The date and time when the task was completed",
|
||||
"assignees": "The assignees of the task",
|
||||
"labels": "The labels associated with the task",
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)"
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)",
|
||||
"reminders": "The reminders of the task as a date field, will return all tasks with at least one reminder matching the query",
|
||||
"created": "The time and date when the task was created",
|
||||
"updated": "The time and date when the task was last changed"
|
||||
},
|
||||
"operators": {
|
||||
"intro": "The available operators for filtering include:",
|
||||
|
||||
@@ -458,7 +458,10 @@
|
||||
"doneAt": "The date and time when the task was completed",
|
||||
"assignees": "The assignees of the task",
|
||||
"labels": "The labels associated with the task",
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)"
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)",
|
||||
"reminders": "The reminders of the task as a date field, will return all tasks with at least one reminder matching the query",
|
||||
"created": "The time and date when the task was created",
|
||||
"updated": "The time and date when the task was last changed"
|
||||
},
|
||||
"operators": {
|
||||
"intro": "The available operators for filtering include:",
|
||||
|
||||
@@ -458,7 +458,10 @@
|
||||
"doneAt": "The date and time when the task was completed",
|
||||
"assignees": "The assignees of the task",
|
||||
"labels": "The labels associated with the task",
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)"
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)",
|
||||
"reminders": "The reminders of the task as a date field, will return all tasks with at least one reminder matching the query",
|
||||
"created": "The time and date when the task was created",
|
||||
"updated": "The time and date when the task was last changed"
|
||||
},
|
||||
"operators": {
|
||||
"intro": "The available operators for filtering include:",
|
||||
|
||||
@@ -458,7 +458,10 @@
|
||||
"doneAt": "A feladat befejezésének dátuma és időpontja",
|
||||
"assignees": "A feladattal megbízottak",
|
||||
"labels": "A feladathoz társított címkék",
|
||||
"project": "A projekt, amelyhez a feladat tartozik (csak a mentett szűrőkhöz érhető el, projekt szinten nem)"
|
||||
"project": "A projekt, amelyhez a feladat tartozik (csak a mentett szűrőkhöz érhető el, projekt szinten nem)",
|
||||
"reminders": "The reminders of the task as a date field, will return all tasks with at least one reminder matching the query",
|
||||
"created": "The time and date when the task was created",
|
||||
"updated": "The time and date when the task was last changed"
|
||||
},
|
||||
"operators": {
|
||||
"intro": "A szűréshez elérhető operátorok a következők:",
|
||||
|
||||
@@ -458,7 +458,10 @@
|
||||
"doneAt": "The date and time when the task was completed",
|
||||
"assignees": "The assignees of the task",
|
||||
"labels": "The labels associated with the task",
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)"
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)",
|
||||
"reminders": "The reminders of the task as a date field, will return all tasks with at least one reminder matching the query",
|
||||
"created": "The time and date when the task was created",
|
||||
"updated": "The time and date when the task was last changed"
|
||||
},
|
||||
"operators": {
|
||||
"intro": "The available operators for filtering include:",
|
||||
|
||||
@@ -458,7 +458,10 @@
|
||||
"doneAt": "The date and time when the task was completed",
|
||||
"assignees": "The assignees of the task",
|
||||
"labels": "The labels associated with the task",
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)"
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)",
|
||||
"reminders": "The reminders of the task as a date field, will return all tasks with at least one reminder matching the query",
|
||||
"created": "The time and date when the task was created",
|
||||
"updated": "The time and date when the task was last changed"
|
||||
},
|
||||
"operators": {
|
||||
"intro": "The available operators for filtering include:",
|
||||
|
||||
@@ -458,7 +458,10 @@
|
||||
"doneAt": "The date and time when the task was completed",
|
||||
"assignees": "The assignees of the task",
|
||||
"labels": "The labels associated with the task",
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)"
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)",
|
||||
"reminders": "The reminders of the task as a date field, will return all tasks with at least one reminder matching the query",
|
||||
"created": "The time and date when the task was created",
|
||||
"updated": "The time and date when the task was last changed"
|
||||
},
|
||||
"operators": {
|
||||
"intro": "The available operators for filtering include:",
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
"usernameMustNotLookLikeUrl": "Vartotojo vardas negali atrodyti kaip nuoroda.",
|
||||
"passwordRequired": "Please provide a password.",
|
||||
"passwordNotMin": "Password must have at least 8 characters.",
|
||||
"passwordNotMax": "Password must have at most 72 characters.",
|
||||
"passwordNotMax": "Slaptažodis gali būti daugiausiai 72 simbolių.",
|
||||
"showPassword": "Show the password",
|
||||
"hidePassword": "Hide the password",
|
||||
"noAccountYet": "Don't have an account yet?",
|
||||
@@ -183,7 +183,7 @@
|
||||
},
|
||||
"deletion": {
|
||||
"title": "Delete your Vikunja Account",
|
||||
"text1": "The deletion of your account is permanent and cannot be undone. We will delete all your projects, tasks and everything associated with it.",
|
||||
"text1": "Profilio ištrynimas yra neatšaukiamas. Visi projektai, užduotys ir kita susijusi informacijas bus pašalinta.",
|
||||
"text2": "Norėdama -s tęsti, įvesk savo slaptažodį. Gausi email'ą su tolimesnėmis instrukcijomis.",
|
||||
"text3": "To proceed, please press the button below. You will receive an email with further instructions.",
|
||||
"confirm": "Delete my account",
|
||||
@@ -401,7 +401,7 @@
|
||||
"titleRequired": "Please provide a title.",
|
||||
"delete": "Ištrinti šį atvaizdavimą",
|
||||
"deleteText": "Are you sure you want to remove this view? It will no longer be possible to use it to view tasks in this project. This action won't delete any tasks. This cannot be undone!",
|
||||
"deleteSuccess": "The view was deleted successfully.",
|
||||
"deleteSuccess": "Atvaizdavimas buvo sėkmingai ištrintas.",
|
||||
"onlyAdminsCanEdit": "Tik projekto administratoriai gali keisti atvaizdavimą.",
|
||||
"updateSuccess": "Atvaizdavimas buvo sėkmingai atnaujintas."
|
||||
}
|
||||
@@ -458,7 +458,10 @@
|
||||
"doneAt": "Data ir laikas, kada užduotis buvo atlikta",
|
||||
"assignees": "Užduočiai priskirti vartotojai",
|
||||
"labels": "Etiketės sietinos su užduotimi",
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)"
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)",
|
||||
"reminders": "The reminders of the task as a date field, will return all tasks with at least one reminder matching the query",
|
||||
"created": "The time and date when the task was created",
|
||||
"updated": "The time and date when the task was last changed"
|
||||
},
|
||||
"operators": {
|
||||
"intro": "The available operators for filtering include:",
|
||||
@@ -489,7 +492,7 @@
|
||||
}
|
||||
},
|
||||
"migrate": {
|
||||
"title": "Import from other services",
|
||||
"title": "Importuoti iš kitų paslaugų tiekėjų",
|
||||
"titleService": "Importuoti duomenis iš {name} į Vikunja",
|
||||
"import": "Import your data into Vikunja",
|
||||
"description": "Paspauskite ant trečiosios šalies logotipo norint pradėti.",
|
||||
@@ -534,14 +537,14 @@
|
||||
"sharing": {
|
||||
"authenticating": "Authenticating…",
|
||||
"passwordRequired": "Šis pasidalintas projektas reikalauja slaptažodžio. Įveskite jį žemiau:",
|
||||
"error": "An error occurred.",
|
||||
"error": "Įvyko klaida.",
|
||||
"invalidPassword": "Slaptažodis neteisingas."
|
||||
},
|
||||
"navigation": {
|
||||
"overview": "Apžvalga",
|
||||
"upcoming": "Upcoming",
|
||||
"upcoming": "Būsimos",
|
||||
"settings": "Nustatymai",
|
||||
"imprint": "Imprint",
|
||||
"imprint": "Įspaudas",
|
||||
"privacy": "Privacy Policy"
|
||||
},
|
||||
"misc": {
|
||||
@@ -554,16 +557,16 @@
|
||||
"disable": "Išjungti",
|
||||
"copy": "Kopijuoti į iškarpinę",
|
||||
"copyError": "Copy to clipboard failed",
|
||||
"search": "Search",
|
||||
"searchPlaceholder": "Type to search…",
|
||||
"previous": "Previous",
|
||||
"next": "Next",
|
||||
"poweredBy": "Powered by Vikunja",
|
||||
"search": "Paieška",
|
||||
"searchPlaceholder": "Rašykite čia norėdami ieškoti…",
|
||||
"previous": "Ankstesnis",
|
||||
"next": "Toliau",
|
||||
"poweredBy": "Sukurta Vikunja",
|
||||
"info": "Info",
|
||||
"create": "Create",
|
||||
"doit": "Do it!",
|
||||
"saving": "Saving…",
|
||||
"saved": "Saved!",
|
||||
"create": "Sukurti",
|
||||
"doit": "Atlikt!",
|
||||
"saving": "Išsaugoma…",
|
||||
"saved": "Išsaugota!",
|
||||
"default": "Default",
|
||||
"close": "Uždaryti",
|
||||
"download": "Atsisiųsti",
|
||||
@@ -619,7 +622,7 @@
|
||||
"imageTooltip": "Upload an image from your computer.",
|
||||
"horizontalRule": "Horizontal Rule",
|
||||
"horizontalRuleTooltip": "Divide a section.",
|
||||
"sideBySide": "Side By Side",
|
||||
"sideBySide": "Vienas šalia kito",
|
||||
"guide": "Guide",
|
||||
"text": "Text",
|
||||
"textTooltip": "Just start typing with plain text.",
|
||||
@@ -636,7 +639,7 @@
|
||||
"deleteColumn": "Delete column",
|
||||
"addRowBefore": "Add row before",
|
||||
"addRowAfter": "Add row after",
|
||||
"deleteRow": "Delete row",
|
||||
"deleteRow": "Ištrinti eilutę",
|
||||
"deleteTable": "Delete table",
|
||||
"mergeCells": "Merge cells",
|
||||
"splitCell": "Split cell",
|
||||
@@ -662,28 +665,28 @@
|
||||
"restOfThisWeek": "The Rest of This Week",
|
||||
"nextWeek": "Next Week",
|
||||
"next7Days": "Next 7 Days",
|
||||
"lastWeek": "Last Week",
|
||||
"thisMonth": "This Month",
|
||||
"restOfThisMonth": "The Rest of This Month",
|
||||
"nextMonth": "Next Month",
|
||||
"next30Days": "Next 30 Days",
|
||||
"lastMonth": "Last Month",
|
||||
"thisYear": "This Year",
|
||||
"restOfThisYear": "The Rest of This Year"
|
||||
"lastWeek": "Praeitą savaitę",
|
||||
"thisMonth": "Šį mėnesį",
|
||||
"restOfThisMonth": "Šį mėnesį",
|
||||
"nextMonth": "Kitą mėnesį",
|
||||
"next30Days": "Kitas 30 dienų",
|
||||
"lastMonth": "Praeitą mėnesį",
|
||||
"thisYear": "Šiais metais",
|
||||
"restOfThisYear": "Likusią metų dalį"
|
||||
},
|
||||
"values": {
|
||||
"now": "Now",
|
||||
"startOfToday": "Start of today",
|
||||
"endOfToday": "End of today",
|
||||
"beginningOflastWeek": "Beginning of last week",
|
||||
"now": "Dabar",
|
||||
"startOfToday": "Pradedant šiandien",
|
||||
"endOfToday": "Iki dienos pabaigos",
|
||||
"beginningOflastWeek": "Praeitos savaitės pradžios",
|
||||
"endOfLastWeek": "End of last week",
|
||||
"beginningOfThisWeek": "Beginning of this week",
|
||||
"endOfThisWeek": "End of this week",
|
||||
"startOfNextWeek": "Start of next week",
|
||||
"endOfNextWeek": "End of next week",
|
||||
"in7Days": "In 7 days",
|
||||
"endOfNextWeek": "Iki kitos savaitės pabaigos",
|
||||
"in7Days": "Už 7 dienų",
|
||||
"beginningOfLastMonth": "Beginning of last month",
|
||||
"endOfLastMonth": "End of last month",
|
||||
"endOfLastMonth": "Kito mėnesio pabaaigos",
|
||||
"startOfThisMonth": "Start of this month",
|
||||
"endOfThisMonth": "End of this month",
|
||||
"startOfNextMonth": "Start of next month",
|
||||
|
||||
@@ -458,7 +458,10 @@
|
||||
"doneAt": "The date and time when the task was completed",
|
||||
"assignees": "The assignees of the task",
|
||||
"labels": "The labels associated with the task",
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)"
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)",
|
||||
"reminders": "The reminders of the task as a date field, will return all tasks with at least one reminder matching the query",
|
||||
"created": "The time and date when the task was created",
|
||||
"updated": "The time and date when the task was last changed"
|
||||
},
|
||||
"operators": {
|
||||
"intro": "The available operators for filtering include:",
|
||||
|
||||
@@ -458,7 +458,10 @@
|
||||
"doneAt": "The date and time when the task was completed",
|
||||
"assignees": "The assignees of the task",
|
||||
"labels": "The labels associated with the task",
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)"
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)",
|
||||
"reminders": "The reminders of the task as a date field, will return all tasks with at least one reminder matching the query",
|
||||
"created": "The time and date when the task was created",
|
||||
"updated": "The time and date when the task was last changed"
|
||||
},
|
||||
"operators": {
|
||||
"intro": "The available operators for filtering include:",
|
||||
|
||||
@@ -458,7 +458,10 @@
|
||||
"doneAt": "Data i czas ukończenia zadania",
|
||||
"assignees": "Osoby przypisane do zadania",
|
||||
"labels": "Etykiety przypisane do zadania",
|
||||
"project": "Projekt, do którego należy zadanie (dostępne tylko dla zapisanych filtrów, nie na poziomie projektu)"
|
||||
"project": "Projekt, do którego należy zadanie (dostępne tylko dla zapisanych filtrów, nie na poziomie projektu)",
|
||||
"reminders": "The reminders of the task as a date field, will return all tasks with at least one reminder matching the query",
|
||||
"created": "The time and date when the task was created",
|
||||
"updated": "The time and date when the task was last changed"
|
||||
},
|
||||
"operators": {
|
||||
"intro": "Dostępne operatory do filtrowania to:",
|
||||
|
||||
@@ -458,7 +458,10 @@
|
||||
"doneAt": "The date and time when the task was completed",
|
||||
"assignees": "The assignees of the task",
|
||||
"labels": "The labels associated with the task",
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)"
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)",
|
||||
"reminders": "The reminders of the task as a date field, will return all tasks with at least one reminder matching the query",
|
||||
"created": "The time and date when the task was created",
|
||||
"updated": "The time and date when the task was last changed"
|
||||
},
|
||||
"operators": {
|
||||
"intro": "The available operators for filtering include:",
|
||||
|
||||
@@ -458,7 +458,10 @@
|
||||
"doneAt": "The date and time when the task was completed",
|
||||
"assignees": "The assignees of the task",
|
||||
"labels": "The labels associated with the task",
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)"
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)",
|
||||
"reminders": "The reminders of the task as a date field, will return all tasks with at least one reminder matching the query",
|
||||
"created": "The time and date when the task was created",
|
||||
"updated": "The time and date when the task was last changed"
|
||||
},
|
||||
"operators": {
|
||||
"intro": "The available operators for filtering include:",
|
||||
|
||||
@@ -458,7 +458,10 @@
|
||||
"doneAt": "The date and time when the task was completed",
|
||||
"assignees": "The assignees of the task",
|
||||
"labels": "The labels associated with the task",
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)"
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)",
|
||||
"reminders": "The reminders of the task as a date field, will return all tasks with at least one reminder matching the query",
|
||||
"created": "The time and date when the task was created",
|
||||
"updated": "The time and date when the task was last changed"
|
||||
},
|
||||
"operators": {
|
||||
"intro": "The available operators for filtering include:",
|
||||
|
||||
@@ -458,7 +458,10 @@
|
||||
"doneAt": "Дата и время, когда задача была завершена",
|
||||
"assignees": "Пользователи, которым назначена задача",
|
||||
"labels": "Метки, связанные с задачей",
|
||||
"project": "Проект, в котором находится задача (только для сохранённых фильтров, не на уровне проекта)"
|
||||
"project": "Проект, в котором находится задача (только для сохранённых фильтров, не на уровне проекта)",
|
||||
"reminders": "The reminders of the task as a date field, will return all tasks with at least one reminder matching the query",
|
||||
"created": "The time and date when the task was created",
|
||||
"updated": "The time and date when the task was last changed"
|
||||
},
|
||||
"operators": {
|
||||
"intro": "Доступны следующие операторы:",
|
||||
|
||||
@@ -458,7 +458,10 @@
|
||||
"doneAt": "The date and time when the task was completed",
|
||||
"assignees": "The assignees of the task",
|
||||
"labels": "The labels associated with the task",
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)"
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)",
|
||||
"reminders": "The reminders of the task as a date field, will return all tasks with at least one reminder matching the query",
|
||||
"created": "The time and date when the task was created",
|
||||
"updated": "The time and date when the task was last changed"
|
||||
},
|
||||
"operators": {
|
||||
"intro": "The available operators for filtering include:",
|
||||
|
||||
@@ -458,7 +458,10 @@
|
||||
"doneAt": "Datum in čas, ko je bila naloga opravljena",
|
||||
"assignees": "Dodeljeni k nalogi",
|
||||
"labels": "Oznake, povezane z opravilom",
|
||||
"project": "Projekt, ki mu naloga pripada (na voljo samo za shranjene filtre, ne na ravni projekta)"
|
||||
"project": "Projekt, ki mu naloga pripada (na voljo samo za shranjene filtre, ne na ravni projekta)",
|
||||
"reminders": "The reminders of the task as a date field, will return all tasks with at least one reminder matching the query",
|
||||
"created": "The time and date when the task was created",
|
||||
"updated": "The time and date when the task was last changed"
|
||||
},
|
||||
"operators": {
|
||||
"intro": "Razpoložljivi operaterji za filtriranje vključujejo:",
|
||||
|
||||
@@ -458,7 +458,10 @@
|
||||
"doneAt": "The date and time when the task was completed",
|
||||
"assignees": "The assignees of the task",
|
||||
"labels": "The labels associated with the task",
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)"
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)",
|
||||
"reminders": "The reminders of the task as a date field, will return all tasks with at least one reminder matching the query",
|
||||
"created": "The time and date when the task was created",
|
||||
"updated": "The time and date when the task was last changed"
|
||||
},
|
||||
"operators": {
|
||||
"intro": "The available operators for filtering include:",
|
||||
|
||||
@@ -458,7 +458,10 @@
|
||||
"doneAt": "The date and time when the task was completed",
|
||||
"assignees": "The assignees of the task",
|
||||
"labels": "The labels associated with the task",
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)"
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)",
|
||||
"reminders": "The reminders of the task as a date field, will return all tasks with at least one reminder matching the query",
|
||||
"created": "The time and date when the task was created",
|
||||
"updated": "The time and date when the task was last changed"
|
||||
},
|
||||
"operators": {
|
||||
"intro": "The available operators for filtering include:",
|
||||
|
||||
@@ -458,7 +458,10 @@
|
||||
"doneAt": "The date and time when the task was completed",
|
||||
"assignees": "The assignees of the task",
|
||||
"labels": "The labels associated with the task",
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)"
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)",
|
||||
"reminders": "The reminders of the task as a date field, will return all tasks with at least one reminder matching the query",
|
||||
"created": "The time and date when the task was created",
|
||||
"updated": "The time and date when the task was last changed"
|
||||
},
|
||||
"operators": {
|
||||
"intro": "The available operators for filtering include:",
|
||||
|
||||
@@ -458,7 +458,10 @@
|
||||
"doneAt": "День та час закінчення",
|
||||
"assignees": "Виконавці",
|
||||
"labels": "Позначки",
|
||||
"project": "Справа, якій це завдання належить (доступно тільки для постійних вибірок, а не на рівні справи)"
|
||||
"project": "Справа, якій це завдання належить (доступно тільки для постійних вибірок, а не на рівні справи)",
|
||||
"reminders": "The reminders of the task as a date field, will return all tasks with at least one reminder matching the query",
|
||||
"created": "The time and date when the task was created",
|
||||
"updated": "The time and date when the task was last changed"
|
||||
},
|
||||
"operators": {
|
||||
"intro": "Доступні оператори для вибірки такі:",
|
||||
|
||||
@@ -458,7 +458,10 @@
|
||||
"doneAt": "The date and time when the task was completed",
|
||||
"assignees": "The assignees of the task",
|
||||
"labels": "The labels associated with the task",
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)"
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)",
|
||||
"reminders": "The reminders of the task as a date field, will return all tasks with at least one reminder matching the query",
|
||||
"created": "The time and date when the task was created",
|
||||
"updated": "The time and date when the task was last changed"
|
||||
},
|
||||
"operators": {
|
||||
"intro": "The available operators for filtering include:",
|
||||
|
||||
@@ -458,7 +458,10 @@
|
||||
"doneAt": "任务完成的日期和时间",
|
||||
"assignees": "任务的指派人",
|
||||
"labels": "与任务相关的标签",
|
||||
"project": "任务属于的项目 (仅适用于保存的过滤器,不适用于项目级别)"
|
||||
"project": "任务属于的项目 (仅适用于保存的过滤器,不适用于项目级别)",
|
||||
"reminders": "The reminders of the task as a date field, will return all tasks with at least one reminder matching the query",
|
||||
"created": "The time and date when the task was created",
|
||||
"updated": "The time and date when the task was last changed"
|
||||
},
|
||||
"operators": {
|
||||
"intro": "可用的过滤操作员包括:",
|
||||
|
||||
@@ -458,7 +458,10 @@
|
||||
"doneAt": "The date and time when the task was completed",
|
||||
"assignees": "The assignees of the task",
|
||||
"labels": "The labels associated with the task",
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)"
|
||||
"project": "The project the task belongs to (only available for saved filters, not on a project level)",
|
||||
"reminders": "The reminders of the task as a date field, will return all tasks with at least one reminder matching the query",
|
||||
"created": "The time and date when the task was created",
|
||||
"updated": "The time and date when the task was last changed"
|
||||
},
|
||||
"operators": {
|
||||
"intro": "The available operators for filtering include:",
|
||||
|
||||
@@ -77,8 +77,12 @@ export const useConfigStore = defineStore('config', () => {
|
||||
|
||||
const migratorsEnabled = computed(() => state.availableMigrators?.length > 0)
|
||||
const apiBase = computed(() => {
|
||||
const {host, protocol} = parseURL(window.API_URL)
|
||||
return protocol + '//' + host
|
||||
const {host, protocol, href} = parseURL(window.API_URL)
|
||||
|
||||
const cleanHref = href ? (href.endsWith('/')
|
||||
? href.slice(0, -1)
|
||||
: href) : ''
|
||||
return `${protocol}//${host}${cleanHref ? `/${cleanHref}` : ''}`
|
||||
})
|
||||
|
||||
function setConfig(config: ConfigState) {
|
||||
@@ -88,11 +92,11 @@ export const useConfigStore = defineStore('config', () => {
|
||||
async function update(): Promise<boolean> {
|
||||
const HTTP = HTTPFactory()
|
||||
const {data: config} = await HTTP.get('info')
|
||||
|
||||
|
||||
if (typeof config.version === 'undefined') {
|
||||
throw new InvalidApiUrlProvidedError()
|
||||
}
|
||||
|
||||
|
||||
setConfig(objectToCamelCase(config))
|
||||
return !!config
|
||||
}
|
||||
@@ -110,5 +114,5 @@ export const useConfigStore = defineStore('config', () => {
|
||||
|
||||
// support hot reloading
|
||||
if (import.meta.hot) {
|
||||
import.meta.hot.accept(acceptHMRUpdate(useConfigStore, import.meta.hot))
|
||||
import.meta.hot.accept(acceptHMRUpdate(useConfigStore, import.meta.hot))
|
||||
}
|
||||
@@ -185,7 +185,7 @@ export const useProjectStore = defineStore('project', () => {
|
||||
let page = 1
|
||||
try {
|
||||
do {
|
||||
const newProjects = await projectService.getAll({}, {is_archived: true}, page) as IProject[]
|
||||
const newProjects = await projectService.getAll({}, {is_archived: true, expand: 'rights'}, page) as IProject[]
|
||||
loadedProjects.push(...newProjects)
|
||||
page++
|
||||
} while (page <= projectService.totalPages)
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
export const POWERED_BY = 'https://vikunja.io'
|
||||
export const POWERED_BY = 'https://vikunja.io/?utm_source=powered_by'
|
||||
export const CALDAV_DOCS = 'https://vikunja.io/docs/caldav/'
|
||||
|
||||
@@ -94,7 +94,7 @@ export type UseGanttFiltersReturn =
|
||||
ReturnType<typeof useRouteFilters<GanttFilters>> &
|
||||
ReturnType<typeof useGanttTaskList<GanttFilters>>
|
||||
|
||||
export function useGanttFilters(route: Ref<RouteLocationNormalized>, viewId: IProjectView['id']): UseGanttFiltersReturn {
|
||||
export function useGanttFilters(route: Ref<RouteLocationNormalized>, viewId: Ref<IProjectView['id']>): UseGanttFiltersReturn {
|
||||
const {
|
||||
filters,
|
||||
hasDefaultFilters,
|
||||
@@ -128,4 +128,4 @@ export function useGanttFilters(route: Ref<RouteLocationNormalized>, viewId: IPr
|
||||
addTask,
|
||||
updateTask,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ import type {IProjectView} from '@/modelTypes/IProjectView'
|
||||
export function useGanttTaskList<F extends Filters>(
|
||||
filters: Ref<F>,
|
||||
filterToApiParams: (filters: F) => TaskFilterParams,
|
||||
viewId: IProjectView['id'],
|
||||
viewId: Ref<IProjectView['id']>,
|
||||
loadAll: boolean = true,
|
||||
) {
|
||||
const taskCollectionService = shallowReactive(new TaskCollectionService())
|
||||
@@ -33,7 +33,7 @@ export function useGanttTaskList<F extends Filters>(
|
||||
params.filter_timezone = authStore.settings.timezone
|
||||
}
|
||||
|
||||
const tasks = await taskCollectionService.getAll({projectId: filters.value.projectId, viewId}, params, page) as ITask[]
|
||||
const tasks = await taskCollectionService.getAll({projectId: filters.value.projectId, viewId: viewId.value}, params, page) as ITask[]
|
||||
if (loadAll && page < taskCollectionService.totalPages) {
|
||||
const nextTasks = await fetchTasks(params, page + 1)
|
||||
return tasks.concat(nextTasks)
|
||||
@@ -105,4 +105,4 @@ export function useGanttTaskList<F extends Filters>(
|
||||
addTask,
|
||||
updateTask,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
:title="$t('project.edit.header')"
|
||||
primary-icon=""
|
||||
:primary-label="$t('misc.save')"
|
||||
:tertiary="$t('misc.delete')"
|
||||
:tertiary="project.maxRight === RIGHTS.ADMIN ? $t('misc.delete') : undefined"
|
||||
@primary="save"
|
||||
@tertiary="$router.push({ name: 'project.settings.delete', params: { id: projectId } })"
|
||||
>
|
||||
@@ -99,6 +99,7 @@ import {useProjectStore} from '@/stores/projects'
|
||||
import {useProject} from '@/stores/projects'
|
||||
|
||||
import {useTitle} from '@/composables/useTitle'
|
||||
import {RIGHTS} from '@/constants/rights'
|
||||
|
||||
const props = defineProps<{
|
||||
projectId: IProject['id'],
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
ref="heading"
|
||||
:task="task"
|
||||
:can-write="canWrite"
|
||||
:has-close="isModal"
|
||||
@update:task="Object.assign(task, $event)"
|
||||
@close="$emit('close')"
|
||||
/>
|
||||
@@ -572,8 +573,10 @@
|
||||
</template>
|
||||
|
||||
<template #text>
|
||||
<p>
|
||||
{{ $t('task.detail.delete.text1') }}<br>
|
||||
<p class="tw-text-balance !tw-mb-0">
|
||||
{{ $t('task.detail.delete.text1') }}
|
||||
</p>
|
||||
<p class="tw-text-balance">
|
||||
{{ $t('task.detail.delete.text2') }}
|
||||
</p>
|
||||
</template>
|
||||
|
||||
@@ -29,9 +29,9 @@ require (
|
||||
github.com/d4l3k/messagediff v1.2.1
|
||||
github.com/disintegration/imaging v1.6.2
|
||||
github.com/dustinkirkland/golang-petname v0.0.0-20240422154211-76c06c4bde6b
|
||||
github.com/gabriel-vasile/mimetype v1.4.5
|
||||
github.com/gabriel-vasile/mimetype v1.4.6
|
||||
github.com/ganigeorgiev/fexpr v0.4.1
|
||||
github.com/getsentry/sentry-go v0.29.0
|
||||
github.com/getsentry/sentry-go v0.29.1
|
||||
github.com/go-sql-driver/mysql v1.8.1
|
||||
github.com/go-testfixtures/testfixtures/v3 v3.11.0
|
||||
github.com/gocarina/gocsv v0.0.0-20231116093920-b87c2d0e983a
|
||||
@@ -49,13 +49,13 @@ require (
|
||||
github.com/labstack/gommon v0.4.2
|
||||
github.com/lib/pq v1.10.9
|
||||
github.com/magefile/mage v1.15.0
|
||||
github.com/mattn/go-sqlite3 v1.14.23
|
||||
github.com/mattn/go-sqlite3 v1.14.24
|
||||
github.com/microcosm-cc/bluemonday v1.0.27
|
||||
github.com/olekukonko/tablewriter v0.0.5
|
||||
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7
|
||||
github.com/pquerna/otp v1.4.0
|
||||
github.com/prometheus/client_golang v1.20.4
|
||||
github.com/redis/go-redis/v9 v9.6.1
|
||||
github.com/prometheus/client_golang v1.20.5
|
||||
github.com/redis/go-redis/v9 v9.7.0
|
||||
github.com/robfig/cron/v3 v3.0.1
|
||||
github.com/samedi/caldav-go v3.0.0+incompatible
|
||||
github.com/spf13/afero v1.11.0
|
||||
@@ -66,15 +66,15 @@ require (
|
||||
github.com/tkuchiki/go-timezone v0.2.3
|
||||
github.com/typesense/typesense-go/v2 v2.0.0
|
||||
github.com/ulule/limiter/v3 v3.11.2
|
||||
github.com/wneessen/go-mail v0.4.4
|
||||
github.com/yuin/goldmark v1.7.4
|
||||
golang.org/x/crypto v0.27.0
|
||||
golang.org/x/image v0.20.0
|
||||
github.com/wneessen/go-mail v0.5.1
|
||||
github.com/yuin/goldmark v1.7.8
|
||||
golang.org/x/crypto v0.28.0
|
||||
golang.org/x/image v0.21.0
|
||||
golang.org/x/oauth2 v0.23.0
|
||||
golang.org/x/sync v0.8.0
|
||||
golang.org/x/sys v0.25.0
|
||||
golang.org/x/term v0.24.0
|
||||
golang.org/x/text v0.18.0
|
||||
golang.org/x/sys v0.26.0
|
||||
golang.org/x/term v0.25.0
|
||||
golang.org/x/text v0.19.0
|
||||
gopkg.in/d4l3k/messagediff.v1 v1.2.1
|
||||
gopkg.in/yaml.v3 v3.0.1
|
||||
mvdan.cc/xurls/v2 v2.5.0
|
||||
@@ -166,7 +166,7 @@ require (
|
||||
go.uber.org/multierr v1.11.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
|
||||
golang.org/x/mod v0.17.0 // indirect
|
||||
golang.org/x/net v0.27.0 // indirect
|
||||
golang.org/x/net v0.30.0 // indirect
|
||||
golang.org/x/time v0.5.0 // indirect
|
||||
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
|
||||
google.golang.org/protobuf v1.34.2 // indirect
|
||||
@@ -179,4 +179,4 @@ replace github.com/samedi/caldav-go => github.com/kolaente/caldav-go v3.0.1-0.20
|
||||
|
||||
go 1.22
|
||||
|
||||
toolchain go1.23.1
|
||||
toolchain go1.23.2
|
||||
|
||||
@@ -93,10 +93,14 @@ github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nos
|
||||
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
|
||||
github.com/gabriel-vasile/mimetype v1.4.5 h1:J7wGKdGu33ocBOhGy0z653k/lFKLFDPJMG8Gql0kxn4=
|
||||
github.com/gabriel-vasile/mimetype v1.4.5/go.mod h1:ibHel+/kbxn9x2407k1izTA1S81ku1z/DlgOW2QE0M4=
|
||||
github.com/gabriel-vasile/mimetype v1.4.6 h1:3+PzJTKLkvgjeTbts6msPJt4DixhT4YtFNf1gtGe3zc=
|
||||
github.com/gabriel-vasile/mimetype v1.4.6/go.mod h1:JX1qVKqZd40hUPpAfiNTe0Sne7hdfKSbOqqmkq8GCXc=
|
||||
github.com/ganigeorgiev/fexpr v0.4.1 h1:hpUgbUEEWIZhSDBtf4M9aUNfQQ0BZkGRaMePy7Gcx5k=
|
||||
github.com/ganigeorgiev/fexpr v0.4.1/go.mod h1:RyGiGqmeXhEQ6+mlGdnUleLHgtzzu/VGO2WtJkF5drE=
|
||||
github.com/getsentry/sentry-go v0.29.0 h1:YtWluuCFg9OfcqnaujpY918N/AhCCwarIDWOYSBAjCA=
|
||||
github.com/getsentry/sentry-go v0.29.0/go.mod h1:jhPesDAL0Q0W2+2YEuVOvdWmVtdsr1+jtBrlDEVWwLY=
|
||||
github.com/getsentry/sentry-go v0.29.1 h1:DyZuChN8Hz3ARxGVV8ePaNXh1dQ7d76AiB117xcREwA=
|
||||
github.com/getsentry/sentry-go v0.29.1/go.mod h1:x3AtIzN01d6SiWkderzaH28Tm0lgkafpJ5Bm3li39O0=
|
||||
github.com/go-chi/chi/v5 v5.1.0 h1:acVI1TYaD+hhedDJ3r54HyA6sExp3HfXq7QWEEY/xMw=
|
||||
github.com/go-chi/chi/v5 v5.1.0/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
|
||||
github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=
|
||||
@@ -331,6 +335,8 @@ github.com/mattn/go-sqlite3 v1.14.15/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S
|
||||
github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg=
|
||||
github.com/mattn/go-sqlite3 v1.14.23 h1:gbShiuAP1W5j9UOksQ06aiiqPMxYecovVGwmTxWtuw0=
|
||||
github.com/mattn/go-sqlite3 v1.14.23/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
|
||||
github.com/mattn/go-sqlite3 v1.14.24 h1:tpSp2G2KyMnnQu99ngJ47EIkWVmliIizyZBfPrBWDRM=
|
||||
github.com/mattn/go-sqlite3 v1.14.24/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
|
||||
github.com/microcosm-cc/bluemonday v1.0.27 h1:MpEUotklkwCSLeH+Qdx1VJgNqLlpY2KXwXFM08ygZfk=
|
||||
github.com/microcosm-cc/bluemonday v1.0.27/go.mod h1:jFi9vgW+H7c3V0lb6nR74Ib/DIB5OBs92Dimizgw2cA=
|
||||
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
|
||||
@@ -387,6 +393,8 @@ github.com/pquerna/otp v1.4.0 h1:wZvl1TIVxKRThZIBiwOOHOGP/1+nZyWBil9Y2XNEDzg=
|
||||
github.com/pquerna/otp v1.4.0/go.mod h1:dkJfzwRKNiegxyNb54X/3fLwhCynbMspSyWKnvi1AEg=
|
||||
github.com/prometheus/client_golang v1.20.4 h1:Tgh3Yr67PaOv/uTqloMsCEdeuFTatm5zIq5+qNN23vI=
|
||||
github.com/prometheus/client_golang v1.20.4/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
|
||||
github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y=
|
||||
github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
|
||||
github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
|
||||
github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=
|
||||
github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc=
|
||||
@@ -395,6 +403,10 @@ github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0leargg
|
||||
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
|
||||
github.com/redis/go-redis/v9 v9.6.1 h1:HHDteefn6ZkTtY5fGUE8tj8uy85AHk6zP7CpzIAM0y4=
|
||||
github.com/redis/go-redis/v9 v9.6.1/go.mod h1:0C0c6ycQsdpVNQpxb1njEQIqkx5UcsM8FJCQLgE9+RA=
|
||||
github.com/redis/go-redis/v9 v9.6.2 h1:w0uvkRbc9KpgD98zcvo5IrVUsn0lXpRMuhNgiHDJzdk=
|
||||
github.com/redis/go-redis/v9 v9.6.2/go.mod h1:0C0c6ycQsdpVNQpxb1njEQIqkx5UcsM8FJCQLgE9+RA=
|
||||
github.com/redis/go-redis/v9 v9.7.0 h1:HhLSs+B6O021gwzl+locl0zEDnyNkxMtf/Z3NNBMa9E=
|
||||
github.com/redis/go-redis/v9 v9.7.0/go.mod h1:f6zhXITC7JUJIlPEiBOTXxJgPLdZcA93GewI7inzyWw=
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 h1:OdAsTTz6OkFY5QxjkYwrChwuRruF69c169dPK26NUlk=
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
|
||||
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
||||
@@ -483,6 +495,8 @@ github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQ
|
||||
github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
|
||||
github.com/wneessen/go-mail v0.4.4 h1:rI8wJzPYymUpUth87vFV3k313bmnid4v+FwhBAYYLFM=
|
||||
github.com/wneessen/go-mail v0.4.4/go.mod h1:zxOlafWCP/r6FEhAaRgH4IC1vg2YXxO0Nar9u0IScZ8=
|
||||
github.com/wneessen/go-mail v0.5.1 h1:3XIiVt4N3oZzHmACyLsp1OTq5/yQuSZWtHliPMD3KsI=
|
||||
github.com/wneessen/go-mail v0.5.1/go.mod h1:kRroJvEq2hOSEPFRiKjN7Csrz0G1w+RpiGR3b6yo+Ck=
|
||||
github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=
|
||||
github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g=
|
||||
github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8=
|
||||
@@ -494,6 +508,14 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec
|
||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
github.com/yuin/goldmark v1.7.4 h1:BDXOHExt+A7gwPCJgPIIq7ENvceR7we7rOS9TNoLZeg=
|
||||
github.com/yuin/goldmark v1.7.4/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E=
|
||||
github.com/yuin/goldmark v1.7.5 h1:ekTA+pa72CEE23b+Cr+9Z7Xq8/rpKdRMqqyauGO5RNE=
|
||||
github.com/yuin/goldmark v1.7.5/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E=
|
||||
github.com/yuin/goldmark v1.7.6 h1:cZgJxVh5mL5cu8KOnwxvFJy5TFB0BHUskZZyq7TYbDg=
|
||||
github.com/yuin/goldmark v1.7.6/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E=
|
||||
github.com/yuin/goldmark v1.7.7 h1:5m9rrB1sW3JUMToKFQfb+FGt1U7r57IHu5GrYrG2nqU=
|
||||
github.com/yuin/goldmark v1.7.7/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E=
|
||||
github.com/yuin/goldmark v1.7.8 h1:iERMLn0/QJeHFhxSt3p6PeN9mGnvIKSpG9YYorDMnic=
|
||||
github.com/yuin/goldmark v1.7.8/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E=
|
||||
github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q=
|
||||
github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0=
|
||||
go.mongodb.org/mongo-driver v1.11.4/go.mod h1:PTSz5yu21bkT/wXpkS7WR5f0ddqw5quethTUn9WM+2g=
|
||||
@@ -529,19 +551,29 @@ golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5y
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=
|
||||
golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
|
||||
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
|
||||
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
|
||||
golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A=
|
||||
golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70=
|
||||
golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw=
|
||||
golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U=
|
||||
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g=
|
||||
golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k=
|
||||
golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/image v0.20.0 h1:7cVCUjQwfL18gyBJOmYvptfSHS8Fb3YUDtfLIZ7Nbpw=
|
||||
golang.org/x/image v0.20.0/go.mod h1:0a88To4CYVBAHp5FXJm8o7QbUl37Vd85ply1vyD8auM=
|
||||
golang.org/x/image v0.21.0 h1:c5qV36ajHpdj4Qi0GnE0jUc/yuo33OLFaa0d+crTD5s=
|
||||
golang.org/x/image v0.21.0/go.mod h1:vUbsLavqK/W303ZroQQVKQ+Af3Yl6Uz1Ppu5J/cLz78=
|
||||
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
|
||||
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
||||
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
||||
golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA=
|
||||
golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
@@ -559,8 +591,14 @@ golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qx
|
||||
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
|
||||
golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
|
||||
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
|
||||
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
|
||||
golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
|
||||
golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
|
||||
golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4=
|
||||
golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU=
|
||||
golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs=
|
||||
golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
@@ -569,6 +607,10 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ
|
||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
|
||||
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
|
||||
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
@@ -598,14 +640,27 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc
|
||||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34=
|
||||
golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo=
|
||||
golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=
|
||||
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
||||
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
|
||||
golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
|
||||
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
|
||||
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
|
||||
golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM=
|
||||
golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8=
|
||||
golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24=
|
||||
golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
@@ -613,8 +668,14 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224=
|
||||
golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
|
||||
golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM=
|
||||
golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
|
||||
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
|
||||
golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
|
||||
@@ -633,6 +694,8 @@ golang.org/x/tools v0.0.0-20201124115921-2c860bdd6e78/go.mod h1:emZCQorbCU4vsT4f
|
||||
golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
|
||||
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
|
||||
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg=
|
||||
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
|
||||
golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
|
||||
+116
-161
@@ -24,12 +24,15 @@ import (
|
||||
"bytes"
|
||||
"context"
|
||||
"crypto/sha256"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"math"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -37,7 +40,6 @@ import (
|
||||
|
||||
"github.com/magefile/mage/mg"
|
||||
"golang.org/x/sync/errgroup"
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -63,7 +65,6 @@ var (
|
||||
// Aliases are mage aliases of targets
|
||||
Aliases = map[string]interface{}{
|
||||
"build": Build.Build,
|
||||
"do-the-swag": DoTheSwag,
|
||||
"check:got-swag": Check.GotSwag,
|
||||
"release": Release.Release,
|
||||
"release:os-package": Release.OsPackage,
|
||||
@@ -71,9 +72,10 @@ var (
|
||||
"dev:make-event": Dev.MakeEvent,
|
||||
"dev:make-listener": Dev.MakeListener,
|
||||
"dev:make-notification": Dev.MakeNotification,
|
||||
"generate-docs": GenerateDocs,
|
||||
"lint": Check.Golangci,
|
||||
"lint:fix": Check.GolangciFix,
|
||||
"generate:config-yaml": Generate.ConfigYAML,
|
||||
"generate:swagger-docs": Generate.SwaggerDocs,
|
||||
}
|
||||
)
|
||||
|
||||
@@ -343,16 +345,6 @@ func Fmt() {
|
||||
runAndStreamOutput("gofmt", args...)
|
||||
}
|
||||
|
||||
const swaggerDocsFolderLocation = `./pkg/swagger/`
|
||||
|
||||
// Generates the swagger docs from the code annotations
|
||||
func DoTheSwag() {
|
||||
mg.Deps(initVars)
|
||||
|
||||
checkAndInstallGoTool("swag", "github.com/swaggo/swag/cmd/swag")
|
||||
runAndStreamOutput("swag", "init", "-g", "./pkg/routes/routes.go", "--parseDependency", "-d", RootPath, "-o", RootPath+"/pkg/swagger")
|
||||
}
|
||||
|
||||
type Test mg.Namespace
|
||||
|
||||
// Runs all tests except integration tests
|
||||
@@ -395,7 +387,7 @@ func (Check) GotSwag() {
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
DoTheSwag()
|
||||
(Generate{}).SwaggerDocs()
|
||||
|
||||
newHash, err := calculateSha256FileHash(RootPath + "/pkg/swagger/swagger.json")
|
||||
if err != nil {
|
||||
@@ -405,7 +397,7 @@ func (Check) GotSwag() {
|
||||
|
||||
if oldHash != newHash {
|
||||
fmt.Println("Swagger docs are not up to date.")
|
||||
fmt.Println("Please run 'mage do-the-swag' and commit the result.")
|
||||
fmt.Println("Please run 'mage generate:swagger-docs' and commit the result.")
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
@@ -676,6 +668,8 @@ func (Release) OsPackage() error {
|
||||
return err
|
||||
}
|
||||
|
||||
generateConfigYAMLFromJSON(RootPath+"/"+DefaultConfigYAMLSamplePath, true)
|
||||
|
||||
for path, info := range bins {
|
||||
folder := p + info.Name() + "-full/"
|
||||
if err := os.Mkdir(folder, 0755); err != nil {
|
||||
@@ -687,7 +681,7 @@ func (Release) OsPackage() error {
|
||||
if err := moveFile(path, folder+info.Name()); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := copyFile(RootPath+"/config.yml.sample", folder+"config.yml.sample"); err != nil {
|
||||
if err := copyFile(RootPath+"/"+DefaultConfigYAMLSamplePath, folder+DefaultConfigYAMLSamplePath); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := copyFile(RootPath+"/LICENSE", folder+"LICENSE"); err != nil {
|
||||
@@ -759,6 +753,8 @@ func (Release) Packages() error {
|
||||
return err
|
||||
}
|
||||
|
||||
generateConfigYAMLFromJSON(DefaultConfigYAMLSamplePath, true)
|
||||
|
||||
runAndStreamOutput(binpath, "pkg", "--packager", "deb", "--target", releasePath)
|
||||
runAndStreamOutput(binpath, "pkg", "--packager", "rpm", "--target", releasePath)
|
||||
runAndStreamOutput(binpath, "pkg", "--packager", "apk", "--target", releasePath)
|
||||
@@ -992,183 +988,142 @@ func (n *` + name + `) Name() string {
|
||||
return nil
|
||||
}
|
||||
|
||||
type configOption struct {
|
||||
key string
|
||||
description string
|
||||
defaultValue string
|
||||
type Generate mg.Namespace
|
||||
|
||||
children []*configOption
|
||||
const DefaultConfigYAMLSamplePath = "config.yml.sample"
|
||||
|
||||
// Generates the swagger docs from the code annotations
|
||||
func (Generate) SwaggerDocs() {
|
||||
mg.Deps(initVars)
|
||||
|
||||
checkAndInstallGoTool("swag", "github.com/swaggo/swag/cmd/swag")
|
||||
runAndStreamOutput("swag", "init", "-g", "./pkg/routes/routes.go", "--parseDependency", "-d", RootPath, "-o", RootPath+"/pkg/swagger")
|
||||
}
|
||||
|
||||
func parseYamlConfigNode(node *yaml.Node) (config *configOption) {
|
||||
config = &configOption{
|
||||
key: node.Value,
|
||||
description: strings.ReplaceAll(node.HeadComment, "# ", ""),
|
||||
type ConfigNode struct {
|
||||
Key string `json:"key,omitempty"`
|
||||
Value interface{} `json:"default_value,omitempty"`
|
||||
Comment string `json:"comment,omitempty"`
|
||||
Children []*ConfigNode `json:"children,omitempty"`
|
||||
}
|
||||
|
||||
func convertConfigJSONToYAML(node *ConfigNode, indent int, isTopLevel bool, parentKey string, commentOut bool) string {
|
||||
var result strings.Builder
|
||||
|
||||
writeComment := func(comment string, indent int) {
|
||||
indent = int(math.Max(float64(indent), 0))
|
||||
if comment != "" {
|
||||
commentLines := strings.Split(comment, "\n")
|
||||
for _, line := range commentLines {
|
||||
result.WriteString(strings.Repeat(" ", indent))
|
||||
result.WriteString("# " + line + "\n")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
valMap := make(map[string]*configOption)
|
||||
|
||||
var lastOption *configOption
|
||||
|
||||
for i, n2 := range node.Content {
|
||||
coo := &configOption{
|
||||
key: n2.Value,
|
||||
description: strings.ReplaceAll(n2.HeadComment, "# ", ""),
|
||||
}
|
||||
|
||||
// If there's a key in valMap for the current key we should use that to append etc
|
||||
// Else we just create a new configobject
|
||||
co, exists := valMap[n2.Value]
|
||||
if exists {
|
||||
co.description = coo.description
|
||||
writeLine := func(line string, indent int) {
|
||||
indent = int(math.Max(float64(indent), 0))
|
||||
if commentOut {
|
||||
result.WriteString(strings.Repeat(" ", indent) + "# " + line + "\n")
|
||||
} else {
|
||||
valMap[n2.Value] = coo
|
||||
config.children = append(config.children, coo)
|
||||
result.WriteString(strings.Repeat(" ", indent) + line + "\n")
|
||||
}
|
||||
}
|
||||
|
||||
// fmt.Println(i, coo.key, coo.description, n2.Value)
|
||||
if isTopLevel {
|
||||
writeComment(node.Comment, indent)
|
||||
}
|
||||
|
||||
if i%2 == 0 {
|
||||
lastOption = coo
|
||||
continue
|
||||
} else {
|
||||
lastOption.defaultValue = n2.Value
|
||||
if node.Key != "" {
|
||||
if !isTopLevel {
|
||||
writeComment(node.Comment, indent)
|
||||
}
|
||||
|
||||
if i-1 >= 0 && i-1 <= len(node.Content) && node.Content[i-1].Value != "" {
|
||||
coo.defaultValue = n2.Value
|
||||
coo.key = node.Content[i-1].Value
|
||||
line := node.Key + ":"
|
||||
if node.Value != nil {
|
||||
value := node.Value
|
||||
if value == nil {
|
||||
value = node.Value
|
||||
}
|
||||
line += " " + formatValue(value)
|
||||
}
|
||||
writeLine(line, indent)
|
||||
}
|
||||
|
||||
if len(n2.Content) > 0 {
|
||||
for _, n := range n2.Content {
|
||||
coo.children = append(coo.children, parseYamlConfigNode(n))
|
||||
if len(node.Children) > 0 {
|
||||
isProviders := node.Key == "providers" && parentKey == "openid"
|
||||
isArray := len(node.Children) > 0 && node.Children[0].Key == ""
|
||||
for i, child := range node.Children {
|
||||
if isProviders {
|
||||
writeComment(child.Comment, indent+1)
|
||||
writeLine("-", indent+1)
|
||||
result.WriteString(convertConfigJSONToYAML(child, indent+1, false, node.Key, commentOut))
|
||||
} else if isArray {
|
||||
writeComment(child.Comment, indent+1)
|
||||
writeLine("- "+formatValue(child.Value), indent+1)
|
||||
} else {
|
||||
result.WriteString(convertConfigJSONToYAML(child, indent+1, false, node.Key, commentOut))
|
||||
}
|
||||
if i == len(node.Children)-1 && !isProviders && !isArray {
|
||||
writeLine("", indent)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return config
|
||||
return result.String()
|
||||
}
|
||||
|
||||
func printConfig(config []*configOption, level int, parent string) (rendered string) {
|
||||
|
||||
// Keep track of what we already printed to prevent printing things twice
|
||||
printed := make(map[string]bool)
|
||||
|
||||
for _, option := range config {
|
||||
|
||||
// FIXME: Not a good solution. Ideally this would work without the level check, but since generating config
|
||||
// for more than two levels is currently broken anyway, I'll fix this after moving the config generation
|
||||
// to a better format than yaml.
|
||||
if level == 0 && option.key != "" {
|
||||
parent = option.key
|
||||
func formatValue(value interface{}) string {
|
||||
switch v := value.(type) {
|
||||
case string:
|
||||
if intValue, err := strconv.Atoi(v); err == nil {
|
||||
return fmt.Sprintf("%d", intValue)
|
||||
}
|
||||
|
||||
if option.key != "" {
|
||||
|
||||
// Filter out all config objects where the default value == key
|
||||
// Yaml is weired: It gives you a slice with an entry each for the key and their value.
|
||||
if printed[option.key] {
|
||||
continue
|
||||
}
|
||||
|
||||
if level == 0 {
|
||||
rendered += "---\n\n"
|
||||
}
|
||||
|
||||
rendered += "#"
|
||||
for i := 0; i <= level; i++ {
|
||||
rendered += "#"
|
||||
}
|
||||
rendered += " " + option.key + "\n\n"
|
||||
|
||||
if option.description != "" {
|
||||
rendered += option.description + "\n\n"
|
||||
}
|
||||
|
||||
// Top level config values never have a default value
|
||||
if level > 0 {
|
||||
rendered += "Default: `" + option.defaultValue
|
||||
if option.defaultValue == "" {
|
||||
rendered += "<empty>"
|
||||
}
|
||||
rendered += "`\n\n"
|
||||
|
||||
fullPath := parent + "." + option.key
|
||||
|
||||
rendered += "Full path: `" + fullPath + "`\n\n"
|
||||
rendered += "Environment path: `VIKUNJA_" + strcase.ToScreamingSnake(strings.ToUpper(fullPath)) + "`\n\n"
|
||||
}
|
||||
if floatValue, err := strconv.ParseFloat(v, 64); err == nil {
|
||||
return fmt.Sprintf("%g", floatValue)
|
||||
}
|
||||
|
||||
printed[option.key] = true
|
||||
rendered += "\n" + printConfig(option.children, level+1, parent)
|
||||
if boolValue, err := strconv.ParseBool(v); err == nil {
|
||||
return fmt.Sprintf("%v", boolValue)
|
||||
}
|
||||
return fmt.Sprintf("%q", v)
|
||||
case float64:
|
||||
return fmt.Sprintf("%g", v)
|
||||
case int:
|
||||
return fmt.Sprintf("%d", v)
|
||||
case bool:
|
||||
return fmt.Sprintf("%v", v)
|
||||
case nil:
|
||||
return ""
|
||||
default:
|
||||
return fmt.Sprintf("%v", v)
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
const (
|
||||
configDocPath = `docs/content/doc/setup/config.md`
|
||||
configInjectComment = `<!-- Generated config will be injected here -->`
|
||||
)
|
||||
|
||||
// Generates the config docs from a commented config.yml.sample file in the repo root.
|
||||
func GenerateDocs() error {
|
||||
|
||||
config, err := os.ReadFile("config.yml.sample")
|
||||
func generateConfigYAMLFromJSON(yamlPath string, commented bool) {
|
||||
jsonData, err := os.ReadFile("config-raw.json")
|
||||
if err != nil {
|
||||
return err
|
||||
fmt.Println("Error reading JSON file:", err)
|
||||
return
|
||||
}
|
||||
|
||||
var d yaml.Node
|
||||
err = yaml.Unmarshal(config, &d)
|
||||
var root ConfigNode
|
||||
err = json.Unmarshal(jsonData, &root)
|
||||
if err != nil {
|
||||
return err
|
||||
fmt.Println("Error parsing JSON:", err)
|
||||
return
|
||||
}
|
||||
|
||||
conf := []*configOption{}
|
||||
yamlData := convertConfigJSONToYAML(&root, -1, true, "", commented)
|
||||
|
||||
for _, node := range d.Content {
|
||||
for _, n := range node.Content {
|
||||
co := parseYamlConfigNode(n)
|
||||
conf = append(conf, co)
|
||||
}
|
||||
}
|
||||
|
||||
renderedConfig := printConfig(conf, 0, "")
|
||||
|
||||
// Rebuild the config
|
||||
file, err := os.OpenFile(configDocPath, os.O_RDWR, 0)
|
||||
err = os.WriteFile(yamlPath, []byte(yamlData), 0644)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer file.Close()
|
||||
|
||||
// We read the config doc up until the marker, then stop and append our generated config
|
||||
fullConfig := ""
|
||||
|
||||
scanner := bufio.NewScanner(file)
|
||||
for scanner.Scan() {
|
||||
t := scanner.Text()
|
||||
fullConfig += t + "\n"
|
||||
|
||||
if t == configInjectComment {
|
||||
break
|
||||
}
|
||||
fmt.Println("Error writing YAML file:", err)
|
||||
return
|
||||
}
|
||||
|
||||
if err := scanner.Err(); err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Println("Successfully generated " + yamlPath)
|
||||
}
|
||||
|
||||
fullConfig += "\n" + renderedConfig
|
||||
|
||||
// We write the full file to prevent old content leftovers at the end
|
||||
// I know, there are probably better ways to do this.
|
||||
if err := os.WriteFile(configDocPath, []byte(fullConfig), 0); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
// Create a yaml config file from the config-raw.json definition
|
||||
func (Generate) ConfigYAML(commented bool) {
|
||||
generateConfigYAMLFromJSON(DefaultConfigYAMLSamplePath, commented)
|
||||
}
|
||||
|
||||
+60
-2
@@ -19,8 +19,11 @@ package cmd
|
||||
import (
|
||||
"context"
|
||||
"net"
|
||||
"net/url"
|
||||
"os"
|
||||
"os/signal"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"code.vikunja.io/api/pkg/config"
|
||||
@@ -33,6 +36,7 @@ import (
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/spf13/cobra"
|
||||
"golang.org/x/crypto/acme/autocert"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -64,6 +68,52 @@ func setupUnixSocket(e *echo.Echo) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func setupAutoTLS(e *echo.Echo) {
|
||||
if config.ServiceUnixSocket.GetString() != "" {
|
||||
log.Warning("Auto tls is enabled but listening on a unix socket is enabled as well. The latter will be ignored.")
|
||||
}
|
||||
if config.ServicePublicURL.GetString() == "" {
|
||||
log.Fatal("You must configure a publicurl to use autotls.")
|
||||
}
|
||||
parsed, err := url.Parse(config.ServicePublicURL.GetString())
|
||||
if err != nil {
|
||||
log.Fatalf("Could not parse hostname from publicurl: %s", err)
|
||||
}
|
||||
domain := parsed.Hostname()
|
||||
if domain == "" {
|
||||
log.Fatalf("The hostname cannot be empty. Please make sure the configured publicurl contains a hostname.")
|
||||
}
|
||||
if !strings.Contains(domain, ".") {
|
||||
log.Fatalf("The hostname must be a valid TLD. Please make sure the configured publicurl contains a valid TLD.")
|
||||
}
|
||||
renew, err := time.ParseDuration(config.AutoTLSRenewBefore.GetString())
|
||||
if err != nil {
|
||||
log.Fatalf("autotls.renewbefore must be a valid duration: %s", err)
|
||||
}
|
||||
if config.AutoTLSEmail.GetString() == "" {
|
||||
log.Fatalf("You must provide an email address to use autotls.")
|
||||
}
|
||||
e.AutoTLSManager = autocert.Manager{
|
||||
Prompt: autocert.AcceptTOS,
|
||||
Cache: autocert.DirCache(filepath.Join(
|
||||
config.FilesBasePath.GetString(),
|
||||
".certs",
|
||||
)),
|
||||
HostPolicy: autocert.HostWhitelist(domain),
|
||||
RenewBefore: renew,
|
||||
Email: config.AutoTLSEmail.GetString(),
|
||||
}
|
||||
|
||||
if config.ServiceInterface.GetString() != ":443" {
|
||||
log.Warningf("Vikunja's interface is set to %s, with tls it is recommended to set this to :443", config.ServiceInterface.GetString())
|
||||
}
|
||||
|
||||
err = e.StartAutoTLS(config.ServiceInterface.GetString())
|
||||
if err != nil {
|
||||
e.Logger.Info("shutting down...")
|
||||
}
|
||||
}
|
||||
|
||||
var webCmd = &cobra.Command{
|
||||
Use: "web",
|
||||
Short: "Starts the rest api web server",
|
||||
@@ -80,18 +130,26 @@ var webCmd = &cobra.Command{
|
||||
routes.RegisterRoutes(e)
|
||||
// Start server
|
||||
go func() {
|
||||
if config.AutoTLSEnabled.GetBool() {
|
||||
setupAutoTLS(e)
|
||||
return
|
||||
}
|
||||
|
||||
// Listen unix socket if needed (ServiceInterface will be ignored)
|
||||
if config.ServiceUnixSocket.GetString() != "" {
|
||||
if err := setupUnixSocket(e); err != nil {
|
||||
e.Logger.Fatal(err)
|
||||
}
|
||||
return
|
||||
}
|
||||
if err := e.Start(config.ServiceInterface.GetString()); err != nil {
|
||||
|
||||
err := e.Start(config.ServiceInterface.GetString())
|
||||
if err != nil {
|
||||
e.Logger.Info("shutting down...")
|
||||
}
|
||||
}()
|
||||
|
||||
// Wait for interrupt signal to gracefully shutdown the server with
|
||||
// Wait for interrupt signal to gracefully shut down the server with
|
||||
// a timeout of 10 seconds.
|
||||
quit := make(chan os.Signal, 1)
|
||||
signal.Notify(quit, os.Interrupt)
|
||||
|
||||
@@ -65,6 +65,7 @@ const (
|
||||
ServiceAllowIconChanges Key = `service.allowiconchanges`
|
||||
ServiceCustomLogoURL Key = `service.customlogourl`
|
||||
ServiceEnablePublicTeams Key = `service.enablepublicteams`
|
||||
ServiceBcryptRounds Key = `service.bcryptrounds`
|
||||
|
||||
SentryEnabled Key = `sentry.enabled`
|
||||
SentryDsn Key = `sentry.dsn`
|
||||
@@ -183,6 +184,10 @@ const (
|
||||
WebhooksTimeoutSeconds Key = `webhooks.timeoutseconds`
|
||||
WebhooksProxyURL Key = `webhooks.proxyurl`
|
||||
WebhooksProxyPassword Key = `webhooks.proxypassword`
|
||||
|
||||
AutoTLSEnabled Key = `autotls.enabled`
|
||||
AutoTLSEmail Key = `autotls.email`
|
||||
AutoTLSRenewBefore Key = `autotls.renewbefore`
|
||||
)
|
||||
|
||||
// GetString returns a string config value
|
||||
@@ -314,6 +319,7 @@ func InitDefaultConfig() {
|
||||
ServiceDemoMode.setDefault(false)
|
||||
ServiceAllowIconChanges.setDefault(true)
|
||||
ServiceEnablePublicTeams.setDefault(false)
|
||||
ServiceBcryptRounds.setDefault(11)
|
||||
|
||||
// Sentry
|
||||
SentryDsn.setDefault("https://440eedc957d545a795c17bbaf477497c@o1047380.ingest.sentry.io/4504254983634944")
|
||||
@@ -407,6 +413,8 @@ func InitDefaultConfig() {
|
||||
// Webhook
|
||||
WebhooksEnabled.setDefault(true)
|
||||
WebhooksTimeoutSeconds.setDefault(30)
|
||||
// AutoTLS
|
||||
AutoTLSRenewBefore.setDefault("720h") // 30days in hours
|
||||
}
|
||||
|
||||
// InitConfig initializes the config, sets defaults etc.
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
hash: testWithPassword
|
||||
project_id: 1
|
||||
right: 0
|
||||
password: '$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.' # 1234
|
||||
password: '$2a$04$X4aRMEt0ytgPwMIgv36cI..7X9.nhY/.tYwxpqSi0ykRHx2CwQ0S6' # 12345678
|
||||
sharing_type: 2
|
||||
shared_by_id: 1
|
||||
created: 2018-12-01 15:13:12
|
||||
|
||||
+16
-16
@@ -1,7 +1,7 @@
|
||||
-
|
||||
id: 1
|
||||
username: 'user1'
|
||||
password: '$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.' # 1234
|
||||
password: '$2a$04$X4aRMEt0ytgPwMIgv36cI..7X9.nhY/.tYwxpqSi0ykRHx2CwQ0S6' # 12345678
|
||||
email: 'user1@example.com'
|
||||
issuer: local
|
||||
updated: 2018-12-02 15:13:12
|
||||
@@ -9,7 +9,7 @@
|
||||
-
|
||||
id: 2
|
||||
username: 'user2'
|
||||
password: '$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.' # 1234
|
||||
password: '$2a$04$X4aRMEt0ytgPwMIgv36cI..7X9.nhY/.tYwxpqSi0ykRHx2CwQ0S6' # 12345678
|
||||
email: 'user2@example.com'
|
||||
issuer: local
|
||||
default_project_id: 4
|
||||
@@ -18,7 +18,7 @@
|
||||
-
|
||||
id: 3
|
||||
username: 'user3'
|
||||
password: '$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.' # 1234
|
||||
password: '$2a$04$X4aRMEt0ytgPwMIgv36cI..7X9.nhY/.tYwxpqSi0ykRHx2CwQ0S6' # 12345678
|
||||
email: 'user3@example.com'
|
||||
issuer: local
|
||||
default_project_id: 4
|
||||
@@ -27,7 +27,7 @@
|
||||
-
|
||||
id: 4
|
||||
username: 'user4'
|
||||
password: '$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.' # 1234
|
||||
password: '$2a$04$X4aRMEt0ytgPwMIgv36cI..7X9.nhY/.tYwxpqSi0ykRHx2CwQ0S6' # 12345678
|
||||
email: 'user4@example.com'
|
||||
status: 1
|
||||
issuer: local
|
||||
@@ -36,7 +36,7 @@
|
||||
-
|
||||
id: 5
|
||||
username: 'user5'
|
||||
password: '$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.' # 1234
|
||||
password: '$2a$04$X4aRMEt0ytgPwMIgv36cI..7X9.nhY/.tYwxpqSi0ykRHx2CwQ0S6' # 12345678
|
||||
email: 'user5@example.com'
|
||||
status: 1
|
||||
issuer: local
|
||||
@@ -45,14 +45,14 @@
|
||||
# This use is used to create a whole bunch of projects which are then shared directly with a user
|
||||
- id: 6
|
||||
username: 'user6'
|
||||
password: '$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.' # 1234
|
||||
password: '$2a$04$X4aRMEt0ytgPwMIgv36cI..7X9.nhY/.tYwxpqSi0ykRHx2CwQ0S6' # 12345678
|
||||
email: 'user6@example.com'
|
||||
issuer: local
|
||||
updated: 2018-12-02 15:13:12
|
||||
created: 2018-12-01 15:13:12
|
||||
- id: 7
|
||||
username: 'user7'
|
||||
password: '$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.' # 1234
|
||||
password: '$2a$04$X4aRMEt0ytgPwMIgv36cI..7X9.nhY/.tYwxpqSi0ykRHx2CwQ0S6' # 12345678
|
||||
email: 'user7@example.com'
|
||||
issuer: local
|
||||
discoverable_by_email: true
|
||||
@@ -60,21 +60,21 @@
|
||||
created: 2018-12-01 15:13:12
|
||||
- id: 8
|
||||
username: 'user8'
|
||||
password: '$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.' # 1234
|
||||
password: '$2a$04$X4aRMEt0ytgPwMIgv36cI..7X9.nhY/.tYwxpqSi0ykRHx2CwQ0S6' # 12345678
|
||||
email: 'user8@example.com'
|
||||
issuer: local
|
||||
updated: 2018-12-02 15:13:12
|
||||
created: 2018-12-01 15:13:12
|
||||
- id: 9
|
||||
username: 'user9'
|
||||
password: '$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.' # 1234
|
||||
password: '$2a$04$X4aRMEt0ytgPwMIgv36cI..7X9.nhY/.tYwxpqSi0ykRHx2CwQ0S6' # 12345678
|
||||
email: 'user9@example.com'
|
||||
issuer: local
|
||||
updated: 2018-12-02 15:13:12
|
||||
created: 2018-12-01 15:13:12
|
||||
- id: 10
|
||||
username: 'user10'
|
||||
password: '$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.' # 1234
|
||||
password: '$2a$04$X4aRMEt0ytgPwMIgv36cI..7X9.nhY/.tYwxpqSi0ykRHx2CwQ0S6' # 12345678
|
||||
email: 'user10@example.com'
|
||||
issuer: local
|
||||
updated: 2018-12-02 15:13:12
|
||||
@@ -82,7 +82,7 @@
|
||||
- id: 11
|
||||
username: 'user11'
|
||||
name: 'Some one else'
|
||||
password: '$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.' # 1234
|
||||
password: '$2a$04$X4aRMEt0ytgPwMIgv36cI..7X9.nhY/.tYwxpqSi0ykRHx2CwQ0S6' # 12345678
|
||||
email: 'user11@example.com'
|
||||
issuer: local
|
||||
updated: 2018-12-02 15:13:12
|
||||
@@ -90,7 +90,7 @@
|
||||
- id: 12
|
||||
username: 'user12'
|
||||
name: 'Name with spaces'
|
||||
password: '$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.' # 1234
|
||||
password: '$2a$04$X4aRMEt0ytgPwMIgv36cI..7X9.nhY/.tYwxpqSi0ykRHx2CwQ0S6' # 12345678
|
||||
email: 'user12@example.com'
|
||||
issuer: local
|
||||
discoverable_by_name: true
|
||||
@@ -98,14 +98,14 @@
|
||||
created: 2018-12-01 15:13:12
|
||||
- id: 13
|
||||
username: 'user13'
|
||||
password: '$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.' # 1234
|
||||
password: '$2a$04$X4aRMEt0ytgPwMIgv36cI..7X9.nhY/.tYwxpqSi0ykRHx2CwQ0S6' # 12345678
|
||||
email: 'user14@example.com'
|
||||
issuer: local
|
||||
updated: 2018-12-02 15:13:12
|
||||
created: 2018-12-01 15:13:12
|
||||
- id: 14
|
||||
username: 'user14'
|
||||
password: '$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.' # 1234
|
||||
password: '$2a$04$X4aRMEt0ytgPwMIgv36cI..7X9.nhY/.tYwxpqSi0ykRHx2CwQ0S6' # 12345678
|
||||
email: 'user15@some.service.com'
|
||||
issuer: 'https://some.service.com'
|
||||
subject: '12345'
|
||||
@@ -113,14 +113,14 @@
|
||||
created: 2018-12-01 15:13:12
|
||||
- id: 15
|
||||
username: 'user15'
|
||||
password: '$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.' # 1234
|
||||
password: '$2a$04$X4aRMEt0ytgPwMIgv36cI..7X9.nhY/.tYwxpqSi0ykRHx2CwQ0S6' # 12345678
|
||||
email: 'user15@example.com'
|
||||
issuer: local
|
||||
updated: 2018-12-02 15:13:12
|
||||
created: 2018-12-01 15:13:12
|
||||
- id: 16
|
||||
username: 'user16'
|
||||
password: '$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.' # 1234
|
||||
password: '$2a$04$X4aRMEt0ytgPwMIgv36cI..7X9.nhY/.tYwxpqSi0ykRHx2CwQ0S6' # 12345678
|
||||
email: 'user16@example.com'
|
||||
issuer: local
|
||||
default_project_id: 37
|
||||
|
||||
@@ -18,8 +18,11 @@ package files
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"code.vikunja.io/api/pkg/config"
|
||||
"code.vikunja.io/api/pkg/db"
|
||||
"code.vikunja.io/api/pkg/log"
|
||||
"code.vikunja.io/api/pkg/modules/keyvalue"
|
||||
@@ -32,16 +35,27 @@ import (
|
||||
var fs afero.Fs
|
||||
var afs *afero.Afero
|
||||
|
||||
func setDefaultConfig() {
|
||||
if !strings.HasPrefix(config.FilesBasePath.GetString(), "/") {
|
||||
config.FilesBasePath.Set(filepath.Join(
|
||||
config.ServiceRootpath.GetString(),
|
||||
config.FilesBasePath.GetString(),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
// InitFileHandler creates a new file handler for the file backend we want to use
|
||||
func InitFileHandler() {
|
||||
fs = afero.NewOsFs()
|
||||
afs = &afero.Afero{Fs: fs}
|
||||
setDefaultConfig()
|
||||
}
|
||||
|
||||
// InitTestFileHandler initializes a new memory file system for testing
|
||||
func InitTestFileHandler() {
|
||||
fs = afero.NewMemMapFs()
|
||||
afs = &afero.Afero{Fs: fs}
|
||||
setDefaultConfig()
|
||||
}
|
||||
|
||||
func initFixtures(t *testing.T) {
|
||||
|
||||
@@ -59,7 +59,6 @@ func (*File) TableName() string {
|
||||
|
||||
func (f *File) getAbsoluteFilePath() string {
|
||||
return filepath.Join(
|
||||
config.ServiceRootpath.GetString(),
|
||||
config.FilesBasePath.GetString(),
|
||||
strconv.FormatInt(f.ID, 10),
|
||||
)
|
||||
|
||||
@@ -160,7 +160,7 @@ func newCaldavTestRequestWithUser(t *testing.T, e *echo.Echo, method string, han
|
||||
c, rec = createRequest(e, method, payload, queryParams, urlParams)
|
||||
c.Request().Header.Set(echo.HeaderContentType, echo.MIMETextPlain)
|
||||
|
||||
result, _ := caldav.BasicAuth(user.Username, "1234", c)
|
||||
result, _ := caldav.BasicAuth(user.Username, "12345678", c)
|
||||
if !result {
|
||||
t.Error("BasicAuth for caldav failed")
|
||||
t.FailNow()
|
||||
|
||||
@@ -48,7 +48,7 @@ func TestLinkSharingAuth(t *testing.T) {
|
||||
assertHandlerErrorCode(t, err, models.ErrCodeLinkSharePasswordRequired)
|
||||
})
|
||||
t.Run("With Password, Password Provided", func(t *testing.T) {
|
||||
rec, err := newTestRequest(t, http.MethodPost, apiv1.AuthenticateLinkShare, `{"password":"1234"}`, nil, map[string]string{"share": "testWithPassword"})
|
||||
rec, err := newTestRequest(t, http.MethodPost, apiv1.AuthenticateLinkShare, `{"password":"12345678"}`, nil, map[string]string{"share": "testWithPassword"})
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, http.StatusOK, rec.Code)
|
||||
assert.Contains(t, rec.Body.String(), `"token":"`)
|
||||
|
||||
@@ -31,7 +31,7 @@ func TestLogin(t *testing.T) {
|
||||
t.Run("Normal login", func(t *testing.T) {
|
||||
rec, err := newTestRequest(t, http.MethodPost, apiv1.Login, `{
|
||||
"username": "user1",
|
||||
"password": "1234"
|
||||
"password": "12345678"
|
||||
}`, nil, nil)
|
||||
require.NoError(t, err)
|
||||
assert.Contains(t, rec.Body.String(), "token")
|
||||
@@ -44,7 +44,7 @@ func TestLogin(t *testing.T) {
|
||||
t.Run("Not existing user", func(t *testing.T) {
|
||||
_, err := newTestRequest(t, http.MethodPost, apiv1.Login, `{
|
||||
"username": "userWichDoesNotExist",
|
||||
"password": "1234"
|
||||
"password": "12345678"
|
||||
}`, nil, nil)
|
||||
require.Error(t, err)
|
||||
assertHandlerErrorCode(t, err, user.ErrCodeWrongUsernameOrPassword)
|
||||
@@ -60,7 +60,7 @@ func TestLogin(t *testing.T) {
|
||||
t.Run("user with unconfirmed email", func(t *testing.T) {
|
||||
_, err := newTestRequest(t, http.MethodPost, apiv1.Login, `{
|
||||
"username": "user5",
|
||||
"password": "1234"
|
||||
"password": "12345678"
|
||||
}`, nil, nil)
|
||||
require.Error(t, err)
|
||||
assertHandlerErrorCode(t, err, user.ErrCodeEmailNotConfirmed)
|
||||
|
||||
@@ -30,8 +30,8 @@ import (
|
||||
func TestUserChangePassword(t *testing.T) {
|
||||
t.Run("Normal test", func(t *testing.T) {
|
||||
rec, err := newTestRequestWithUser(t, http.MethodPost, apiv1.UserChangePassword, &testuser1, `{
|
||||
"new_password": "12345",
|
||||
"old_password": "1234"
|
||||
"new_password": "123456789",
|
||||
"old_password": "12345678"
|
||||
}`, nil, nil)
|
||||
require.NoError(t, err)
|
||||
assert.Contains(t, rec.Body.String(), `The password was updated successfully.`)
|
||||
@@ -55,7 +55,7 @@ func TestUserChangePassword(t *testing.T) {
|
||||
t.Run("Empty new password", func(t *testing.T) {
|
||||
_, err := newTestRequestWithUser(t, http.MethodPost, apiv1.UserChangePassword, &testuser1, `{
|
||||
"new_password": "",
|
||||
"old_password": "1234"
|
||||
"old_password": "12345678"
|
||||
}`, nil, nil)
|
||||
require.Error(t, err)
|
||||
assertHandlerErrorCode(t, err, user.ErrCodeEmptyNewPassword)
|
||||
|
||||
@@ -31,7 +31,7 @@ import (
|
||||
func TestUserPasswordReset(t *testing.T) {
|
||||
t.Run("Normal password reset test", func(t *testing.T) {
|
||||
rec, err := newTestRequest(t, http.MethodPost, apiv1.UserResetPassword, `{
|
||||
"new_password": "1234",
|
||||
"new_password": "12345678",
|
||||
"token": "passwordresettesttoken"
|
||||
}`, nil, nil)
|
||||
require.NoError(t, err)
|
||||
@@ -52,7 +52,7 @@ func TestUserPasswordReset(t *testing.T) {
|
||||
})
|
||||
t.Run("Invalid password reset token", func(t *testing.T) {
|
||||
_, err := newTestRequest(t, http.MethodPost, apiv1.UserResetPassword, `{
|
||||
"new_password": "1234",
|
||||
"new_password": "12345678",
|
||||
"token": "invalidtoken"
|
||||
}`, nil, nil)
|
||||
require.Error(t, err)
|
||||
|
||||
+3
-3
@@ -26,13 +26,13 @@ import (
|
||||
)
|
||||
|
||||
// ErrFmt holds the format for all the console logging
|
||||
const ErrFmt = `${time_rfc3339_nano}: ${level} ` + "\t" + `▶ ${prefix} ${short_file}:${line}`
|
||||
const ErrFmt = `${time_rfc3339}: ${level} ` + "\t" + `▶ ${prefix} ${short_file}:${line}`
|
||||
|
||||
// WebFmt holds the format for all logging related to web requests
|
||||
const WebFmt = `${time_rfc3339_nano}: WEB ` + "\t" + `▶ ${remote_ip} ${id} ${method} ${status} ${uri} ${latency_human} - ${user_agent}`
|
||||
const WebFmt = `${time_rfc3339}: WEB ` + "\t" + `▶ ${remote_ip} ${id} ${method} ${status} ${uri} ${latency_human} - ${user_agent}`
|
||||
|
||||
// Fmt is the general log format
|
||||
const Fmt = `%{color}%{time:` + time.RFC3339Nano + `}: %{level}` + "\t" + `▶ %{shortpkg}/%{shortfunc} %{id:03x}%{color:reset} %{message}`
|
||||
const Fmt = `%{color}%{time:` + time.RFC3339 + `}: %{level}` + "\t" + `▶ %{id:03x}%{color:reset} %{message}`
|
||||
|
||||
const logModule = `vikunja`
|
||||
|
||||
|
||||
@@ -120,8 +120,7 @@ func CollectRoutesForAPITokenUsage(route echo.Route, middlewares []echo.Middlewa
|
||||
|
||||
routeGroupName, routeParts := getRouteGroupName(route.Path)
|
||||
|
||||
if routeGroupName == "user" ||
|
||||
routeGroupName == "tokenTest" ||
|
||||
if routeGroupName == "tokenTest" ||
|
||||
routeGroupName == "subscriptions" ||
|
||||
routeGroupName == "tokens" ||
|
||||
routeGroupName == "*" ||
|
||||
@@ -230,6 +229,10 @@ func CanDoAPIRoute(c echo.Context, token *APIToken) (can bool) {
|
||||
|
||||
routeGroupName = strings.TrimSuffix(routeGroupName, "_bulk")
|
||||
|
||||
if routeGroupName == "user" {
|
||||
routeGroupName = "other"
|
||||
}
|
||||
|
||||
group, hasGroup := token.Permissions[routeGroupName]
|
||||
if !hasGroup {
|
||||
group, hasGroup = token.Permissions[routeParts[0]]
|
||||
|
||||
@@ -121,6 +121,34 @@ func InvalidFieldError(fields []string) error {
|
||||
}
|
||||
}
|
||||
|
||||
// ErrInvalidTimezone represents a "InvalidTimezone" kind of error.
|
||||
type ErrInvalidTimezone struct {
|
||||
Name string
|
||||
LoadError error
|
||||
}
|
||||
|
||||
// IsErrInvalidTimezone checks if an error is a ErrInvalidTimezone.
|
||||
func IsErrInvalidTimezone(err error) bool {
|
||||
_, ok := err.(ErrInvalidTimezone)
|
||||
return ok
|
||||
}
|
||||
|
||||
func (err ErrInvalidTimezone) Error() string {
|
||||
return fmt.Sprintf("invalid timezone: %s, err: %v", err.Name, err.LoadError)
|
||||
}
|
||||
|
||||
// ErrCodeInvalidTimezone holds the unique world-error code of this error
|
||||
const ErrCodeInvalidTimezone = 2003
|
||||
|
||||
// HTTPError holds the http error description
|
||||
func (err ErrInvalidTimezone) HTTPError() web.HTTPError {
|
||||
return web.HTTPError{
|
||||
HTTPCode: http.StatusBadRequest,
|
||||
Code: ErrCodeInvalidTimezone,
|
||||
Message: fmt.Sprintf("The timezone '%s' is invalid", err.Name),
|
||||
}
|
||||
}
|
||||
|
||||
// ===========
|
||||
// Project errors
|
||||
// ===========
|
||||
|
||||
@@ -226,9 +226,9 @@ func GetTasksInBucketsForView(s *xorm.Session, view *ProjectView, projects []*Pr
|
||||
originalFilter := opts.filter
|
||||
for id, bucket := range bucketMap {
|
||||
|
||||
if !strings.Contains(originalFilter, "bucket_id") {
|
||||
if !strings.Contains(originalFilter, taskPropertyBucketID) {
|
||||
|
||||
var bucketFilter = "bucket_id = " + strconv.FormatInt(id, 10)
|
||||
var bucketFilter = taskPropertyBucketID + " = " + strconv.FormatInt(id, 10)
|
||||
if view.BucketConfigurationMode == BucketConfigurationModeFilter {
|
||||
bucketFilter = "(" + view.BucketConfiguration[id].Filter + ")"
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ func TestLabelTask_ReadAll(t *testing.T) {
|
||||
CreatedBy: &user.User{
|
||||
ID: 2,
|
||||
Username: "user2",
|
||||
Password: "$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.",
|
||||
Password: "$2a$04$X4aRMEt0ytgPwMIgv36cI..7X9.nhY/.tYwxpqSi0ykRHx2CwQ0S6",
|
||||
Issuer: "local",
|
||||
EmailRemindersEnabled: true,
|
||||
OverdueTasksRemindersEnabled: true,
|
||||
|
||||
@@ -50,7 +50,7 @@ func TestLabel_ReadAll(t *testing.T) {
|
||||
user1 := &user.User{
|
||||
ID: 1,
|
||||
Username: "user1",
|
||||
Password: "$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.",
|
||||
Password: "$2a$04$X4aRMEt0ytgPwMIgv36cI..7X9.nhY/.tYwxpqSi0ykRHx2CwQ0S6",
|
||||
Issuer: "local",
|
||||
EmailRemindersEnabled: true,
|
||||
OverdueTasksRemindersEnabled: true,
|
||||
@@ -101,7 +101,7 @@ func TestLabel_ReadAll(t *testing.T) {
|
||||
CreatedBy: &user.User{
|
||||
ID: 2,
|
||||
Username: "user2",
|
||||
Password: "$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.",
|
||||
Password: "$2a$04$X4aRMEt0ytgPwMIgv36cI..7X9.nhY/.tYwxpqSi0ykRHx2CwQ0S6",
|
||||
Issuer: "local",
|
||||
EmailRemindersEnabled: true,
|
||||
OverdueTasksRemindersEnabled: true,
|
||||
@@ -170,7 +170,7 @@ func TestLabel_ReadOne(t *testing.T) {
|
||||
user1 := &user.User{
|
||||
ID: 1,
|
||||
Username: "user1",
|
||||
Password: "$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.",
|
||||
Password: "$2a$04$X4aRMEt0ytgPwMIgv36cI..7X9.nhY/.tYwxpqSi0ykRHx2CwQ0S6",
|
||||
Issuer: "local",
|
||||
EmailRemindersEnabled: true,
|
||||
OverdueTasksRemindersEnabled: true,
|
||||
@@ -232,7 +232,7 @@ func TestLabel_ReadOne(t *testing.T) {
|
||||
CreatedBy: &user.User{
|
||||
ID: 2,
|
||||
Username: "user2",
|
||||
Password: "$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.",
|
||||
Password: "$2a$04$X4aRMEt0ytgPwMIgv36cI..7X9.nhY/.tYwxpqSi0ykRHx2CwQ0S6",
|
||||
Issuer: "local",
|
||||
EmailRemindersEnabled: true,
|
||||
OverdueTasksRemindersEnabled: true,
|
||||
|
||||
+5
-30
@@ -539,36 +539,6 @@ func (l *AddTaskToTypesense) Handle(msg *message.Message) (err error) {
|
||||
return reindexTasksInTypesense(s, task)
|
||||
}
|
||||
|
||||
func getPositionsForTask(s *xorm.Session, event *TaskCreatedEvent) (positionsMap map[int64][]*TaskPositionWithView, err error) {
|
||||
positions := []*TaskPositionWithView{}
|
||||
err = s.
|
||||
Table("project_views").
|
||||
Where("project_views.project_id = ?", event.Task.ProjectID).
|
||||
Join("LEFT", "task_positions", "project_views.id = task_positions.project_view_id AND task_positions.task_id = ?", event.Task.ID).
|
||||
Find(&positions)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
positionsMap = make(map[int64][]*TaskPositionWithView, 1)
|
||||
positionsMap[event.Task.ID] = positions
|
||||
return
|
||||
}
|
||||
|
||||
func getBucketsForTask(s *xorm.Session, event *TaskCreatedEvent) (bucketsMap map[int64][]*TaskBucket, err error) {
|
||||
buckets := []*TaskBucket{}
|
||||
err = s.
|
||||
Where("task_id = ?", event.Task.ID).
|
||||
Find(&buckets)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
bucketsMap = make(map[int64][]*TaskBucket, 1)
|
||||
bucketsMap[event.Task.ID] = buckets
|
||||
return
|
||||
}
|
||||
|
||||
// UpdateTaskInTypesense represents a listener
|
||||
type UpdateTaskInTypesense struct {
|
||||
}
|
||||
@@ -757,6 +727,11 @@ func (l *UpdateTaskInSavedFilterViews) Handle(msg *message.Message) (err error)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
task := make(map[int64]*Task, 1)
|
||||
task[event.Task.ID] = event.Task // Will be filled with all data by the Typesense connector
|
||||
|
||||
return reindexTasksInTypesense(s, task)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
@@ -77,6 +77,9 @@ type Project struct {
|
||||
|
||||
Views []*ProjectView `xorm:"-" json:"views"`
|
||||
|
||||
Expand ProjectExpandable `xorm:"-" json:"-" query:"expand"`
|
||||
MaxRight Right `xorm:"-" json:"max_right"`
|
||||
|
||||
// A timestamp when this project was created. You cannot change this value.
|
||||
Created time.Time `xorm:"created not null" json:"created"`
|
||||
// A timestamp when this project was last updated. You cannot change this value.
|
||||
@@ -86,6 +89,10 @@ type Project struct {
|
||||
web.Rights `xorm:"-" json:"-"`
|
||||
}
|
||||
|
||||
type ProjectExpandable string
|
||||
|
||||
const ProjectExpandableRights = `rights`
|
||||
|
||||
type ProjectWithTasksAndBuckets struct {
|
||||
Project
|
||||
ChildProjects []*ProjectWithTasksAndBuckets `xorm:"-" json:"child_projects"`
|
||||
@@ -161,6 +168,7 @@ var FavoritesPseudoProject = Project{
|
||||
// @Param per_page query int false "The maximum number of items per page. Note this parameter is limited by the configured maximum of items per page."
|
||||
// @Param s query string false "Search projects by title."
|
||||
// @Param is_archived query bool false "If true, also returns all archived projects."
|
||||
// @Param expand query string false "If set to `rights`, Vikunja will return the max right the current user has on this project. You can currently only set this to `rights`."
|
||||
// @Security JWTKeyAuth
|
||||
// @Success 200 {array} models.Project "The projects"
|
||||
// @Failure 403 {object} web.HTTPError "The user does not have access to the project"
|
||||
@@ -219,6 +227,17 @@ func (p *Project) ReadAll(s *xorm.Session, a web.Auth, search string, page int,
|
||||
return
|
||||
}
|
||||
|
||||
if p.Expand == ProjectExpandableRights {
|
||||
err = addMaxRightToProjects(s, prs, a)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
} else {
|
||||
for _, pr := range prs {
|
||||
pr.MaxRight = RightUnknown
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////
|
||||
// Putting it all together
|
||||
|
||||
@@ -719,6 +738,31 @@ func addProjectDetails(s *xorm.Session, projects []*Project, a web.Auth) (err er
|
||||
return
|
||||
}
|
||||
|
||||
func addMaxRightToProjects(s *xorm.Session, projects []*Project, a web.Auth) (err error) {
|
||||
projectIDs := make([]int64, 0, len(projects))
|
||||
for _, project := range projects {
|
||||
if getSavedFilterIDFromProjectID(project.ID) > 0 {
|
||||
project.MaxRight = RightAdmin
|
||||
continue
|
||||
}
|
||||
projectIDs = append(projectIDs, project.ID)
|
||||
}
|
||||
|
||||
rights, err := checkRightsForProjects(s, a, projectIDs)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, project := range projects {
|
||||
right, has := rights[project.ID]
|
||||
if has {
|
||||
project.MaxRight = right.MaxRight
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// CheckIsArchived returns an ErrProjectIsArchived if the project or any of its parent projects is archived.
|
||||
func (p *Project) CheckIsArchived(s *xorm.Session) (err error) {
|
||||
if p.ParentProjectID > 0 {
|
||||
|
||||
@@ -20,8 +20,8 @@ import (
|
||||
"errors"
|
||||
|
||||
"code.vikunja.io/api/pkg/user"
|
||||
"code.vikunja.io/api/pkg/utils"
|
||||
"code.vikunja.io/api/pkg/web"
|
||||
"xorm.io/builder"
|
||||
"xorm.io/xorm"
|
||||
)
|
||||
|
||||
@@ -105,9 +105,6 @@ func (p *Project) CanRead(s *xorm.Session, a web.Auth) (bool, int, error) {
|
||||
(shareAuth.Right == RightRead || shareAuth.Right == RightWrite || shareAuth.Right == RightAdmin), int(shareAuth.Right), nil
|
||||
}
|
||||
|
||||
if p.isOwner(&user.User{ID: a.GetID()}) {
|
||||
return true, int(RightAdmin), nil
|
||||
}
|
||||
return p.checkRight(s, a, RightRead, RightWrite, RightAdmin)
|
||||
}
|
||||
|
||||
@@ -211,66 +208,86 @@ func (p *Project) isOwner(u *user.User) bool {
|
||||
|
||||
// Checks n different rights for any given user
|
||||
func (p *Project) checkRight(s *xorm.Session, a web.Auth, rights ...Right) (bool, int, error) {
|
||||
projectRights, err := checkRightsForProjects(s, a, []int64{p.ID})
|
||||
if err != nil {
|
||||
return false, 0, err
|
||||
}
|
||||
right, has := projectRights[p.ID]
|
||||
if !has {
|
||||
return false, 0, nil
|
||||
}
|
||||
|
||||
var conds []builder.Cond
|
||||
for _, r := range rights {
|
||||
// User conditions
|
||||
// If the project was shared directly with the user and the user has the right
|
||||
conds = append(conds, builder.And(
|
||||
builder.Eq{"ul.user_id": a.GetID()},
|
||||
builder.Eq{"ul.right": r},
|
||||
))
|
||||
|
||||
// Team rights
|
||||
// If the project was shared directly with the team and the team has the right
|
||||
conds = append(conds, builder.And(
|
||||
builder.Eq{"tm2.user_id": a.GetID()},
|
||||
builder.Eq{"tl.right": r},
|
||||
))
|
||||
}
|
||||
|
||||
type allProjectRights struct {
|
||||
UserProject *ProjectUser `xorm:"extends"`
|
||||
TeamProject *TeamProject `xorm:"extends"`
|
||||
}
|
||||
|
||||
r := &allProjectRights{}
|
||||
var maxRight = 0
|
||||
exists, err := s.
|
||||
Select("p.*, ul.right, tl.right").
|
||||
Table("projects").
|
||||
Alias("p").
|
||||
// User stuff
|
||||
Join("LEFT", []string{"users_projects", "ul"}, "ul.project_id = p.id").
|
||||
// Team stuff
|
||||
Join("LEFT", []string{"team_projects", "tl"}, "p.id = tl.project_id").
|
||||
Join("LEFT", []string{"team_members", "tm2"}, "tm2.team_id = tl.team_id").
|
||||
// The actual condition
|
||||
Where(builder.And(
|
||||
builder.Or(
|
||||
conds...,
|
||||
),
|
||||
builder.Eq{"p.id": p.ID},
|
||||
)).
|
||||
Get(r)
|
||||
|
||||
// If there's noting shared for this project, and it has a parent, go up the tree
|
||||
if !exists && p.ParentProjectID > 0 {
|
||||
parent, err := GetProjectSimpleByID(s, p.ParentProjectID)
|
||||
if err != nil {
|
||||
return false, 0, err
|
||||
if r == right.MaxRight {
|
||||
return true, int(right.MaxRight), nil
|
||||
}
|
||||
|
||||
return parent.checkRight(s, a, rights...)
|
||||
}
|
||||
|
||||
// Figure out the max right and return it
|
||||
if int(r.UserProject.Right) > maxRight {
|
||||
maxRight = int(r.UserProject.Right)
|
||||
return false, 0, nil
|
||||
}
|
||||
|
||||
type projectRight struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
MaxRight Right
|
||||
}
|
||||
|
||||
func checkRightsForProjects(s *xorm.Session, a web.Auth, projectIDs []int64) (projectRightMap map[int64]*projectRight, err error) {
|
||||
projectRightMap = make(map[int64]*projectRight)
|
||||
args := []interface{}{
|
||||
a.GetID(),
|
||||
a.GetID(),
|
||||
a.GetID(),
|
||||
a.GetID(),
|
||||
a.GetID(),
|
||||
}
|
||||
if int(r.TeamProject.Right) > maxRight {
|
||||
maxRight = int(r.TeamProject.Right)
|
||||
}
|
||||
|
||||
err = s.SQL(`
|
||||
WITH RECURSIVE
|
||||
project_hierarchy AS (
|
||||
-- Base case: Start with the specified projects
|
||||
SELECT id,
|
||||
parent_project_id,
|
||||
0 AS level,
|
||||
id AS original_project_id
|
||||
FROM projects
|
||||
WHERE id IN (`+utils.JoinInt64Slice(projectIDs, ", ")+`)
|
||||
|
||||
UNION ALL
|
||||
|
||||
-- Recursive case: Traverse up the hierarchy
|
||||
SELECT p.id,
|
||||
p.parent_project_id,
|
||||
ph.level + 1,
|
||||
ph.original_project_id
|
||||
FROM projects p
|
||||
INNER JOIN project_hierarchy ph ON p.id = ph.parent_project_id),
|
||||
|
||||
project_permissions AS (SELECT ph.id,
|
||||
ph.original_project_id,
|
||||
CASE
|
||||
WHEN p.owner_id = 1 THEN 2
|
||||
WHEN COALESCE(ul.right, 0) > COALESCE(tl.right, 0) THEN ul.right
|
||||
ELSE COALESCE(tl.right, 0)
|
||||
END AS project_right,
|
||||
CASE
|
||||
WHEN p.owner_id = 1 THEN 1 -- Direct project ownership
|
||||
ELSE ph.level + 1 -- Derived from parent project
|
||||
END AS priority
|
||||
FROM project_hierarchy ph
|
||||
LEFT JOIN projects p
|
||||
ON ph.id = p.id
|
||||
LEFT JOIN users_projects ul ON ul.project_id = ph.id AND ul.user_id = ?
|
||||
LEFT JOIN team_projects tl ON tl.project_id = ph.id
|
||||
LEFT JOIN team_members tm ON tm.team_id = tl.team_id AND tm.user_id = ?
|
||||
WHERE p.owner_id = ? OR ul.user_id = ? OR tm.user_id = ?)
|
||||
|
||||
return exists, maxRight, err
|
||||
SELECT ph.original_project_id AS id,
|
||||
COALESCE(MAX(pp.project_right), -1) AS max_right
|
||||
FROM project_hierarchy ph
|
||||
LEFT JOIN (SELECT *,
|
||||
ROW_NUMBER() OVER (PARTITION BY original_project_id ORDER BY priority) AS rn
|
||||
FROM project_permissions) pp ON ph.id = pp.id AND pp.rn = 1
|
||||
GROUP BY ph.original_project_id`, args...).
|
||||
Find(&projectRightMap)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ func TestProjectUser_ReadAll(t *testing.T) {
|
||||
User: user.User{
|
||||
ID: 1,
|
||||
Username: "user1",
|
||||
Password: "$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.",
|
||||
Password: "$2a$04$X4aRMEt0ytgPwMIgv36cI..7X9.nhY/.tYwxpqSi0ykRHx2CwQ0S6",
|
||||
Issuer: "local",
|
||||
EmailRemindersEnabled: true,
|
||||
OverdueTasksRemindersEnabled: true,
|
||||
@@ -162,7 +162,7 @@ func TestProjectUser_ReadAll(t *testing.T) {
|
||||
User: user.User{
|
||||
ID: 2,
|
||||
Username: "user2",
|
||||
Password: "$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.",
|
||||
Password: "$2a$04$X4aRMEt0ytgPwMIgv36cI..7X9.nhY/.tYwxpqSi0ykRHx2CwQ0S6",
|
||||
Issuer: "local",
|
||||
EmailRemindersEnabled: true,
|
||||
OverdueTasksRemindersEnabled: true,
|
||||
|
||||
+37
-5
@@ -16,18 +16,20 @@
|
||||
|
||||
package models
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// Right defines the rights users/teams can have for projects
|
||||
type Right int
|
||||
|
||||
// define unknown right
|
||||
const (
|
||||
RightUnknown = -1
|
||||
)
|
||||
|
||||
// Enumerate all the team rights
|
||||
const (
|
||||
// Can read projects in a
|
||||
RightRead Right = iota
|
||||
RightRead Right = iota - 1
|
||||
// Can write in a like projects and tasks. Cannot create new projects.
|
||||
RightWrite
|
||||
// Can manage a project, can do everything
|
||||
@@ -41,3 +43,33 @@ func (r Right) isValid() error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalJSON marshals the enum as a quoted json string
|
||||
func (r Right) MarshalJSON() ([]byte, error) {
|
||||
if r == RightUnknown {
|
||||
return []byte(`null`), nil
|
||||
}
|
||||
return []byte(strconv.Itoa(int(r))), nil
|
||||
}
|
||||
|
||||
// UnmarshalJSON unmarshals a quoted json string to the enum value
|
||||
func (r *Right) UnmarshalJSON(data []byte) error {
|
||||
var s int
|
||||
if err := json.Unmarshal(data, &s); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
switch s {
|
||||
case -1:
|
||||
*r = RightUnknown
|
||||
case 0:
|
||||
*r = RightRead
|
||||
case 1:
|
||||
*r = RightWrite
|
||||
case 2:
|
||||
*r = RightAdmin
|
||||
default:
|
||||
return fmt.Errorf("invalid Right %q", s)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
+89
-33
@@ -19,6 +19,8 @@ package models
|
||||
import (
|
||||
"time"
|
||||
|
||||
"code.vikunja.io/api/pkg/config"
|
||||
|
||||
"code.vikunja.io/api/pkg/cron"
|
||||
"code.vikunja.io/api/pkg/db"
|
||||
"code.vikunja.io/api/pkg/log"
|
||||
@@ -330,21 +332,40 @@ func addTaskToFilter(s *xorm.Session, filter *SavedFilter, view *ProjectView, fa
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
bucketID, err := getDefaultBucketID(s, view)
|
||||
taskHasBucketInView, err := s.Where(builder.And(
|
||||
builder.Eq{"task_id": task.ID},
|
||||
builder.Eq{"project_view_id": view.ID},
|
||||
)).Exist(&TaskBucket{})
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
if !taskHasBucketInView {
|
||||
bucketID, err := getDefaultBucketID(s, view)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
taskBucket = &TaskBucket{
|
||||
BucketID: bucketID,
|
||||
TaskID: task.ID,
|
||||
ProjectViewID: view.ID,
|
||||
taskBucket = &TaskBucket{
|
||||
BucketID: bucketID,
|
||||
TaskID: task.ID,
|
||||
ProjectViewID: view.ID,
|
||||
}
|
||||
}
|
||||
|
||||
taskPosition = &TaskPosition{
|
||||
TaskID: task.ID,
|
||||
ProjectViewID: view.ID,
|
||||
Position: calculateDefaultPosition(task.Index, task.Position),
|
||||
// Check if a position for this task already exists
|
||||
existingTaskPosition, err := s.Where(builder.And(
|
||||
builder.Eq{"task_id": task.ID},
|
||||
builder.Eq{"project_view_id": view.ID},
|
||||
)).Exist(&TaskPosition{})
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
if !existingTaskPosition {
|
||||
taskPosition = &TaskPosition{
|
||||
TaskID: task.ID,
|
||||
ProjectViewID: view.ID,
|
||||
Position: calculateDefaultPosition(task.Index, task.Position),
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
@@ -358,8 +379,13 @@ func RegisterAddTaskToFilterViewCron() {
|
||||
defer s.Close()
|
||||
|
||||
// Get all filters with a date clause and a manual kanban view
|
||||
where := "filters LIKE '%_date%'"
|
||||
if db.GetDialect() == builder.POSTGRES {
|
||||
where = "filters::jsonb ?| array['due_date', 'start_date', 'end_date']"
|
||||
}
|
||||
|
||||
filters := map[int64]*SavedFilter{}
|
||||
err := s.Where("filters LIKE '%_date%'").Find(&filters)
|
||||
err := s.Where(where).Find(&filters)
|
||||
if err != nil {
|
||||
log.Errorf("%sError fetching filters: %s", logPrefix, err)
|
||||
return
|
||||
@@ -396,6 +422,7 @@ func RegisterAddTaskToFilterViewCron() {
|
||||
newTaskBuckets := []*TaskBucket{}
|
||||
newTaskPositions := []*TaskPosition{}
|
||||
deleteCond := []builder.Cond{}
|
||||
taskIDsToRemove := []int64{}
|
||||
for _, view := range kanbanFilterViews {
|
||||
filterID := getSavedFilterIDFromProjectID(view.ProjectID)
|
||||
filter, exists := filters[filterID]
|
||||
@@ -480,35 +507,64 @@ func RegisterAddTaskToFilterViewCron() {
|
||||
builder.Eq{"task_id": taskID},
|
||||
builder.Eq{"project_view_id": view.ID},
|
||||
))
|
||||
taskIDsToRemove = append(taskIDsToRemove, taskID)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if len(newTaskBuckets) > 0 {
|
||||
_, err = s.Insert(newTaskBuckets)
|
||||
if err != nil {
|
||||
log.Errorf("%sError inserting task buckets: %s", logPrefix, err)
|
||||
}
|
||||
}
|
||||
if len(newTaskPositions) > 0 {
|
||||
_, err = s.Insert(newTaskPositions)
|
||||
if err != nil {
|
||||
log.Errorf("%sError inserting task positions: %s", logPrefix, err)
|
||||
}
|
||||
}
|
||||
|
||||
if len(deleteCond) > 0 {
|
||||
_, err = s.Where(builder.Or(deleteCond...)).Delete(&TaskBucket{})
|
||||
if err != nil {
|
||||
log.Errorf("%sError deleting task buckets: %s", logPrefix, err)
|
||||
}
|
||||
_, err = s.Where(builder.Or(deleteCond...)).Delete(&TaskPosition{})
|
||||
if err != nil {
|
||||
log.Errorf("%sError deleting task positions: %s", logPrefix, err)
|
||||
}
|
||||
}
|
||||
upsertRelatedTaskProperties(s, logPrefix, newTaskBuckets, newTaskPositions, deleteCond, taskIDsToRemove)
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatalf("Could register add task to filter view cron: %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
func upsertRelatedTaskProperties(s *xorm.Session, logPrefix string, newTaskBuckets []*TaskBucket, newTaskPositions []*TaskPosition, deleteCond []builder.Cond, taskIDsToRemove []int64) {
|
||||
var err error
|
||||
if len(newTaskBuckets) > 0 {
|
||||
_, err = s.Insert(newTaskBuckets)
|
||||
if err != nil {
|
||||
log.Errorf("%sError inserting task buckets: %s", logPrefix, err)
|
||||
}
|
||||
}
|
||||
if len(newTaskPositions) > 0 {
|
||||
_, err = s.Insert(newTaskPositions)
|
||||
if err != nil {
|
||||
log.Errorf("%sError inserting task positions: %s", logPrefix, err)
|
||||
}
|
||||
}
|
||||
|
||||
if len(deleteCond) > 0 {
|
||||
_, err = s.Where(builder.Or(deleteCond...)).Delete(&TaskBucket{})
|
||||
if err != nil {
|
||||
log.Errorf("%sError deleting task buckets: %s", logPrefix, err)
|
||||
}
|
||||
_, err = s.Where(builder.Or(deleteCond...)).Delete(&TaskPosition{})
|
||||
if err != nil {
|
||||
log.Errorf("%sError deleting task positions: %s", logPrefix, err)
|
||||
}
|
||||
}
|
||||
|
||||
if config.TypesenseEnabled.GetBool() && (len(newTaskPositions) > 0 || len(taskIDsToRemove) > 0) {
|
||||
taskIDs := []int64{}
|
||||
for _, position := range newTaskPositions {
|
||||
taskIDs = append(taskIDs, position.TaskID)
|
||||
}
|
||||
taskIDs = append(taskIDs, taskIDsToRemove...)
|
||||
tasks, err := GetTasksSimpleByIDs(s, taskIDs)
|
||||
if err != nil {
|
||||
log.Errorf("%sError fetching tasks: %s", logPrefix, err)
|
||||
return
|
||||
}
|
||||
taskMap := make(map[int64]*Task)
|
||||
for _, t := range tasks {
|
||||
taskMap[t.ID] = t
|
||||
}
|
||||
|
||||
err = reindexTasksInTypesense(s, taskMap)
|
||||
if err != nil {
|
||||
log.Errorf("%sError reindexing tasks into Typesense: %s", logPrefix, err)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ func TestTaskAttachment_ReadOne(t *testing.T) {
|
||||
// Load the actual attachment file and check its content
|
||||
err = ta.File.LoadFileByID()
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, filepath.Join(config.ServiceRootpath.GetString(), config.FilesBasePath.GetString(), "/1"), ta.File.File.Name())
|
||||
assert.Equal(t, filepath.Join(config.ServiceRootpath.GetString(), "files", "1"), ta.File.File.Name())
|
||||
content := make([]byte, 9)
|
||||
read, err := ta.File.File.Read(content)
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -142,7 +142,7 @@ func getTaskOrTasksInBuckets(s *xorm.Session, a web.Auth, projects []*Project, v
|
||||
return getTasksForProjects(s, projects, a, opts, view)
|
||||
}
|
||||
|
||||
if view != nil && !strings.Contains(opts.filter, "bucket_id") {
|
||||
if view != nil && !strings.Contains(opts.filter, taskPropertyBucketID) {
|
||||
if view.BucketConfigurationMode != BucketConfigurationModeNone {
|
||||
tasksInBuckets, err := GetTasksInBucketsForView(s, view, projects, opts, a)
|
||||
return tasksInBuckets, len(tasksInBuckets), int64(len(tasksInBuckets)), err
|
||||
@@ -262,6 +262,10 @@ func (tf *TaskCollection) ReadAll(s *xorm.Session, a web.Auth, search string, pa
|
||||
tc.ProjectID = tf.ProjectID
|
||||
tc.isSavedFilter = true
|
||||
|
||||
if tf.Filter != "" {
|
||||
tc.Filter = "(" + tf.Filter + ") && (" + tc.Filter + ")"
|
||||
}
|
||||
|
||||
return tc.ReadAll(s, a, search, page, perPage)
|
||||
}
|
||||
|
||||
@@ -281,11 +285,13 @@ func (tf *TaskCollection) ReadAll(s *xorm.Session, a web.Auth, search string, pa
|
||||
}
|
||||
}
|
||||
|
||||
if view.BucketConfigurationMode == BucketConfigurationModeFilter && strings.Contains(tf.Filter, "bucket_id") {
|
||||
if strings.Contains(tf.Filter, taskPropertyBucketID) {
|
||||
filteringForBucket = true
|
||||
tf.Filter, err = getFilterValueForBucketFilter(tf.Filter, view)
|
||||
if err != nil {
|
||||
return nil, 0, 0, err
|
||||
if view.BucketConfigurationMode == BucketConfigurationModeFilter {
|
||||
tf.Filter, err = getFilterValueForBucketFilter(tf.Filter, view)
|
||||
if err != nil {
|
||||
return nil, 0, 0, err
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,10 +25,12 @@ import (
|
||||
"time"
|
||||
|
||||
"code.vikunja.io/api/pkg/config"
|
||||
"code.vikunja.io/api/pkg/db"
|
||||
|
||||
"github.com/ganigeorgiev/fexpr"
|
||||
"github.com/iancoleman/strcase"
|
||||
"github.com/jszwedko/go-datemath"
|
||||
"xorm.io/builder"
|
||||
"xorm.io/xorm/schemas"
|
||||
)
|
||||
|
||||
@@ -190,7 +192,10 @@ func getTaskFiltersFromFilterString(filter string, filterTimezone string) (filte
|
||||
if filterTimezone != "" {
|
||||
loc, err = time.LoadLocation(filterTimezone)
|
||||
if err != nil {
|
||||
return
|
||||
return nil, &ErrInvalidTimezone{
|
||||
Name: filterTimezone,
|
||||
LoadError: err,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -270,12 +275,22 @@ func getValueForField(field reflect.StructField, rawValue string, loc *time.Loca
|
||||
case reflect.Struct:
|
||||
if field.Type == schemas.TimeType {
|
||||
var t datemath.Expression
|
||||
var tt time.Time
|
||||
t, err = datemath.Parse(rawValue)
|
||||
if err == nil {
|
||||
value = t.Time(datemath.WithLocation(config.GetTimeZone())).In(loc)
|
||||
tt = t.Time(datemath.WithLocation(config.GetTimeZone())).In(loc)
|
||||
} else {
|
||||
value, err = parseTimeFromUserInput(rawValue)
|
||||
tt, err = parseTimeFromUserInput(rawValue)
|
||||
}
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
// Mysql/Mariadb does not support date values where the year < 1. To make this edge-case work,
|
||||
// we're setting the year to 1 in that case.
|
||||
if db.GetDialect() == builder.MYSQL && tt.Year() < 1 {
|
||||
tt = tt.AddDate(1-tt.Year(), 0, 0)
|
||||
}
|
||||
value = tt
|
||||
}
|
||||
case reflect.Slice:
|
||||
// If this is a slice of pointers we're dealing with some property which is a relation
|
||||
|
||||
@@ -20,8 +20,11 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"code.vikunja.io/api/pkg/db"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"xorm.io/builder"
|
||||
)
|
||||
|
||||
func TestParseFilter(t *testing.T) {
|
||||
@@ -255,4 +258,16 @@ func TestParseFilter(t *testing.T) {
|
||||
sevenDaysAgo := time.Now().Add(-7 * 24 * time.Hour)
|
||||
assert.Equal(t, sevenDaysAgo.Unix(), result[0].value.(time.Time).Unix())
|
||||
})
|
||||
t.Run("date filter with 0000-01-01", func(t *testing.T) {
|
||||
result, err := getTaskFiltersFromFilterString("due_date > 0000-01-01", "UTC")
|
||||
|
||||
require.NoError(t, err)
|
||||
require.Len(t, result, 1)
|
||||
date := result[0].value.(time.Time)
|
||||
if db.GetDialect() == builder.MYSQL {
|
||||
assert.Equal(t, 1, date.Year())
|
||||
} else {
|
||||
assert.Equal(t, 0, date.Year())
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
|
||||
user1 := &user.User{
|
||||
ID: 1,
|
||||
Username: "user1",
|
||||
Password: "$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.",
|
||||
Password: "$2a$04$X4aRMEt0ytgPwMIgv36cI..7X9.nhY/.tYwxpqSi0ykRHx2CwQ0S6",
|
||||
Issuer: "local",
|
||||
EmailRemindersEnabled: true,
|
||||
OverdueTasksRemindersEnabled: true,
|
||||
@@ -47,7 +47,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
|
||||
user2 := &user.User{
|
||||
ID: 2,
|
||||
Username: "user2",
|
||||
Password: "$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.",
|
||||
Password: "$2a$04$X4aRMEt0ytgPwMIgv36cI..7X9.nhY/.tYwxpqSi0ykRHx2CwQ0S6",
|
||||
Issuer: "local",
|
||||
EmailRemindersEnabled: true,
|
||||
OverdueTasksRemindersEnabled: true,
|
||||
@@ -59,7 +59,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
|
||||
user6 := &user.User{
|
||||
ID: 6,
|
||||
Username: "user6",
|
||||
Password: "$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.",
|
||||
Password: "$2a$04$X4aRMEt0ytgPwMIgv36cI..7X9.nhY/.tYwxpqSi0ykRHx2CwQ0S6",
|
||||
Issuer: "local",
|
||||
EmailRemindersEnabled: true,
|
||||
OverdueTasksRemindersEnabled: true,
|
||||
|
||||
@@ -18,6 +18,7 @@ package models
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -178,6 +179,11 @@ func convertFiltersToDBFilterCond(rawFilters []*taskFilter, includeNulls bool) (
|
||||
continue
|
||||
}
|
||||
|
||||
if f.field == taskPropertyBucketID {
|
||||
f.field = "task_buckets.`bucket_id`"
|
||||
} else {
|
||||
f.field = "tasks.`" + f.field + "`"
|
||||
}
|
||||
filter, err := getFilterCond(f, includeNulls)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -205,6 +211,22 @@ func convertFiltersToDBFilterCond(rawFilters []*taskFilter, includeNulls bool) (
|
||||
return filterCond, nil
|
||||
}
|
||||
|
||||
func hasBucketIDInParsedFilter(filters []*taskFilter) bool {
|
||||
for _, filter := range filters {
|
||||
if subfilters, is := filter.value.([]*taskFilter); is {
|
||||
has := hasBucketIDInParsedFilter(subfilters)
|
||||
if has {
|
||||
return true
|
||||
}
|
||||
}
|
||||
if filter.field == taskPropertyBucketID {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
//nolint:gocyclo
|
||||
func (d *dbTaskSearcher) Search(opts *taskSearchOptions) (tasks []*Task, totalCount int64, err error) {
|
||||
|
||||
@@ -213,13 +235,7 @@ func (d *dbTaskSearcher) Search(opts *taskSearchOptions) (tasks []*Task, totalCo
|
||||
return nil, 0, err
|
||||
}
|
||||
|
||||
var joinTaskBuckets bool
|
||||
for _, filter := range opts.parsedFilters {
|
||||
if filter.field == taskPropertyBucketID {
|
||||
joinTaskBuckets = true
|
||||
break
|
||||
}
|
||||
}
|
||||
joinTaskBuckets := hasBucketIDInParsedFilter(opts.parsedFilters)
|
||||
|
||||
filterCond, err := convertFiltersToDBFilterCond(opts.parsedFilters, opts.filterIncludeNulls)
|
||||
if err != nil {
|
||||
@@ -300,7 +316,8 @@ func (d *dbTaskSearcher) Search(opts *taskSearchOptions) (tasks []*Task, totalCo
|
||||
OrderBy(orderby).
|
||||
Find(&tasks)
|
||||
if err != nil {
|
||||
return nil, totalCount, err
|
||||
sql, vals := query.LastSQL()
|
||||
return nil, 0, fmt.Errorf("could not fetch tasks, error was '%w', sql: '%v', values: %v", err, sql, vals)
|
||||
}
|
||||
|
||||
// fetch subtasks when expanding
|
||||
@@ -363,6 +380,10 @@ func (d *dbTaskSearcher) Search(opts *taskSearchOptions) (tasks []*Task, totalCo
|
||||
totalCount, err = queryCount.
|
||||
Select("count(DISTINCT tasks.id)").
|
||||
Count(&Task{})
|
||||
if err != nil {
|
||||
sql, vals := queryCount.LastSQL()
|
||||
return nil, 0, fmt.Errorf("could not fetch task count, error was '%w', sql: '%v', values: %v", err, sql, vals)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@@ -444,7 +465,7 @@ func convertParsedFilterToTypesense(rawFilters []*taskFilter) (filterBy string,
|
||||
f.field = "project_id"
|
||||
}
|
||||
|
||||
if f.field == "bucket_id" {
|
||||
if f.field == taskPropertyBucketID {
|
||||
f.field = "buckets"
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user