Merge branch 'main' into feature/ganttastic
# Conflicts: # src/main.ts # yarn.lock
This commit is contained in:
commit
879dfb74b6
204 changed files with 16045 additions and 15522 deletions
174
.drone.yml
174
.drone.yml
|
@ -29,26 +29,91 @@ steps:
|
||||||
# AWS_SECRET_ACCESS_KEY:
|
# AWS_SECRET_ACCESS_KEY:
|
||||||
# from_secret: cache_aws_secret_access_key
|
# from_secret: cache_aws_secret_access_key
|
||||||
# settings:
|
# settings:
|
||||||
|
# debug: true
|
||||||
# restore: true
|
# restore: true
|
||||||
# bucket: kolaente.dev-drone-dependency-cache
|
# bucket: kolaente.dev-drone-dependency-cache
|
||||||
# endpoint: https://s3.fr-par.scw.cloud
|
# endpoint: https://s3.fr-par.scw.cloud
|
||||||
# region: fr-par
|
# region: fr-par
|
||||||
# path_style: true
|
# path_style: true
|
||||||
# cache_key: '{{ .Repo.Name }}_{{ checksum "yarn.lock" }}_{{ arch }}_{{ os }}'
|
# cache_key: '{{ .Repo.Name }}_{{ checksum "pnpm-lock.yaml" }}_{{ arch }}_{{ os }}'
|
||||||
# mount:
|
# mount:
|
||||||
# - '.cache'
|
# - .cache
|
||||||
|
|
||||||
- name: dependencies
|
- name: dependencies
|
||||||
image: node:18
|
image: node:18-alpine
|
||||||
pull: true
|
pull: true
|
||||||
environment:
|
environment:
|
||||||
YARN_CACHE_FOLDER: .cache/yarn/
|
PNPM_CACHE_FOLDER: .cache/pnpm
|
||||||
CYPRESS_CACHE_FOLDER: .cache/cypress/
|
CYPRESS_CACHE_FOLDER: .cache/cypress
|
||||||
commands:
|
commands:
|
||||||
- yarn --frozen-lockfile --network-timeout 100000
|
- corepack enable && corepack prepare pnpm@7.9.3 --activate && pnpm config set store-dir .cache/pnpm
|
||||||
|
- pnpm install --fetch-timeout 100000
|
||||||
# depends_on:
|
# depends_on:
|
||||||
# - restore-cache
|
# - restore-cache
|
||||||
|
|
||||||
|
- name: lint
|
||||||
|
image: node:18-alpine
|
||||||
|
pull: true
|
||||||
|
environment:
|
||||||
|
PNPM_CACHE_FOLDER: .cache/pnpm
|
||||||
|
commands:
|
||||||
|
- corepack enable && corepack prepare pnpm@7.9.3 --activate && pnpm config set store-dir .cache/pnpm
|
||||||
|
- pnpm run lint
|
||||||
|
depends_on:
|
||||||
|
- dependencies
|
||||||
|
|
||||||
|
- name: build-prod
|
||||||
|
image: node:18-alpine
|
||||||
|
pull: true
|
||||||
|
environment:
|
||||||
|
PNPM_CACHE_FOLDER: .cache/pnpm
|
||||||
|
commands:
|
||||||
|
- corepack enable && corepack prepare pnpm@7.9.3 --activate && pnpm config set store-dir .cache/pnpm
|
||||||
|
- pnpm run build
|
||||||
|
depends_on:
|
||||||
|
- dependencies
|
||||||
|
|
||||||
|
- name: test-unit
|
||||||
|
image: node:18-alpine
|
||||||
|
pull: true
|
||||||
|
commands:
|
||||||
|
- corepack enable && corepack prepare pnpm@7.9.3 --activate && pnpm config set store-dir .cache/pnpm
|
||||||
|
- pnpm run test:unit
|
||||||
|
depends_on:
|
||||||
|
- dependencies
|
||||||
|
|
||||||
|
- name: typecheck
|
||||||
|
failure: ignore
|
||||||
|
image: node:18-alpine
|
||||||
|
pull: true
|
||||||
|
environment:
|
||||||
|
PNPM_CACHE_FOLDER: .cache/pnpm
|
||||||
|
commands:
|
||||||
|
- corepack enable && corepack prepare pnpm@7.9.3 --activate && pnpm config set store-dir .cache/pnpm
|
||||||
|
- pnpm run typecheck
|
||||||
|
depends_on:
|
||||||
|
- dependencies
|
||||||
|
|
||||||
|
- name: test-frontend
|
||||||
|
image: cypress/browsers:node16.14.0-chrome99-ff97
|
||||||
|
pull: true
|
||||||
|
environment:
|
||||||
|
CYPRESS_API_URL: http://api:3456/api/v1
|
||||||
|
CYPRESS_TEST_SECRET: averyLongSecretToSe33dtheDB
|
||||||
|
PNPM_CACHE_FOLDER: .cache/pnpm
|
||||||
|
CYPRESS_CACHE_FOLDER: .cache/cypress
|
||||||
|
CYPRESS_DEFAULT_COMMAND_TIMEOUT: 60000
|
||||||
|
CYPRESS_RECORD_KEY:
|
||||||
|
from_secret: cypress_project_key
|
||||||
|
commands:
|
||||||
|
- sed -i 's/localhost/api/g' dist/index.html
|
||||||
|
- corepack enable && corepack prepare pnpm@7.9.3 --activate && pnpm config set store-dir .cache/pnpm
|
||||||
|
- pnpm cypress install
|
||||||
|
- pnpm run serve:dist & npx wait-on http://localhost:4173
|
||||||
|
- pnpm run test:frontend --browser chrome --record
|
||||||
|
depends_on:
|
||||||
|
- build-prod
|
||||||
|
|
||||||
# - name: rebuild-cache
|
# - name: rebuild-cache
|
||||||
# image: meltwater/drone-cache:dev
|
# image: meltwater/drone-cache:dev
|
||||||
# pull: true
|
# pull: true
|
||||||
|
@ -63,70 +128,14 @@ steps:
|
||||||
# endpoint: https://s3.fr-par.scw.cloud
|
# endpoint: https://s3.fr-par.scw.cloud
|
||||||
# region: fr-par
|
# region: fr-par
|
||||||
# path_style: true
|
# path_style: true
|
||||||
# cache_key: '{{ .Repo.Name }}_{{ checksum "yarn.lock" }}_{{ arch }}_{{ os }}'
|
# cache_key: '{{ .Repo.Name }}_{{ checksum "pnpm-lock.yaml" }}_{{ arch }}_{{ os }}'
|
||||||
# mount:
|
# mount:
|
||||||
# - '.cache'
|
# - .cache
|
||||||
# depends_on:
|
# depends_on:
|
||||||
# - dependencies
|
# - dependencies
|
||||||
|
|
||||||
- name: lint
|
|
||||||
image: node:18
|
|
||||||
pull: true
|
|
||||||
environment:
|
|
||||||
YARN_CACHE_FOLDER: .cache/yarn/
|
|
||||||
CYPRESS_CACHE_FOLDER: .cache/cypress/
|
|
||||||
commands:
|
|
||||||
- yarn run lint
|
|
||||||
depends_on:
|
|
||||||
- dependencies
|
|
||||||
|
|
||||||
- name: build-prod
|
|
||||||
image: node:18
|
|
||||||
pull: true
|
|
||||||
environment:
|
|
||||||
YARN_CACHE_FOLDER: .cache/yarn/
|
|
||||||
commands:
|
|
||||||
- yarn build
|
|
||||||
depends_on:
|
|
||||||
- dependencies
|
|
||||||
|
|
||||||
- name: test-unit
|
|
||||||
image: node:18
|
|
||||||
pull: true
|
|
||||||
commands:
|
|
||||||
- yarn test:unit
|
|
||||||
depends_on:
|
|
||||||
- dependencies
|
|
||||||
|
|
||||||
- name: typecheck
|
|
||||||
failure: ignore
|
|
||||||
image: node:18
|
|
||||||
pull: true
|
|
||||||
commands:
|
|
||||||
- yarn typecheck
|
|
||||||
depends_on:
|
|
||||||
- dependencies
|
|
||||||
|
|
||||||
- name: test-frontend
|
|
||||||
image: cypress/browsers:node16.14.0-chrome99-ff97
|
|
||||||
pull: true
|
|
||||||
environment:
|
|
||||||
CYPRESS_API_URL: http://api:3456/api/v1
|
|
||||||
CYPRESS_TEST_SECRET: averyLongSecretToSe33dtheDB
|
|
||||||
YARN_CACHE_FOLDER: .cache/yarn/
|
|
||||||
CYPRESS_CACHE_FOLDER: .cache/cypress/
|
|
||||||
CYPRESS_DEFAULT_COMMAND_TIMEOUT: 60000
|
|
||||||
CYPRESS_RECORD_KEY:
|
|
||||||
from_secret: cypress_project_key
|
|
||||||
commands:
|
|
||||||
- sed -i 's/localhost/api/g' dist/index.html
|
|
||||||
- yarn serve:dist & npx wait-on http://localhost:4173
|
|
||||||
- yarn test:frontend --browser chrome --record
|
|
||||||
depends_on:
|
|
||||||
- build-prod
|
|
||||||
|
|
||||||
- name: deploy-preview
|
- name: deploy-preview
|
||||||
image: node:18
|
image: node:18-alpine
|
||||||
pull: true
|
pull: true
|
||||||
environment:
|
environment:
|
||||||
NETLIFY_AUTH_TOKEN:
|
NETLIFY_AUTH_TOKEN:
|
||||||
|
@ -138,7 +147,8 @@ steps:
|
||||||
commands:
|
commands:
|
||||||
- cp -r dist dist-preview
|
- cp -r dist dist-preview
|
||||||
# Override the default api url used for preview
|
# Override the default api url used for preview
|
||||||
- sed -i 's|localhost:3456|try.vikunja.io|g' dist-preview/index.html
|
- sed -i 's|http://localhost:3456|https://try.vikunja.io|g' dist-preview/index.html
|
||||||
|
- apk add --no-cache perl-utils
|
||||||
- shasum -a 384 -c ./scripts/deploy-preview-netlify.js.sha384
|
- shasum -a 384 -c ./scripts/deploy-preview-netlify.js.sha384
|
||||||
- node ./scripts/deploy-preview-netlify.js
|
- node ./scripts/deploy-preview-netlify.js
|
||||||
depends_on:
|
depends_on:
|
||||||
|
@ -181,21 +191,22 @@ steps:
|
||||||
# endpoint: https://s3.fr-par.scw.cloud
|
# endpoint: https://s3.fr-par.scw.cloud
|
||||||
# region: fr-par
|
# region: fr-par
|
||||||
# path_style: true
|
# path_style: true
|
||||||
# cache_key: '{{ .Repo.Name }}_{{ checksum "yarn.lock" }}_{{ arch }}_{{ os }}'
|
# cache_key: '{{ .Repo.Name }}_{{ checksum "pnpm-lock.yaml" }}_{{ arch }}_{{ os }}'
|
||||||
# mount:
|
# mount:
|
||||||
# - '.cache'
|
# - .cache
|
||||||
|
|
||||||
- name: build
|
- name: build
|
||||||
image: node:18
|
image: node:18-alpine
|
||||||
pull: true
|
pull: true
|
||||||
group: build-static
|
group: build-static
|
||||||
environment:
|
environment:
|
||||||
YARN_CACHE_FOLDER: .cache/yarn/
|
PNPM_CACHE_FOLDER: .cache/pnpm
|
||||||
commands:
|
commands:
|
||||||
- yarn --frozen-lockfile --network-timeout 100000
|
- corepack enable && corepack prepare pnpm@7.9.3 --activate && pnpm config set store-dir .cache/.pnp
|
||||||
- yarn run lint
|
- pnpm install --fetch-timeout 100000
|
||||||
|
- pnpm run lint
|
||||||
- "echo '{\"VERSION\": \"'$(git describe --tags --always --abbrev=10 | sed 's/-/+/' | sed 's/^v//' | sed 's/-g/-/')'\"}' > src/version.json"
|
- "echo '{\"VERSION\": \"'$(git describe --tags --always --abbrev=10 | sed 's/-/+/' | sed 's/^v//' | sed 's/-g/-/')'\"}' > src/version.json"
|
||||||
- yarn run build
|
- pnpm run build
|
||||||
- sed -i 's/http\:\\/\\/localhost\\:3456\\/api\\/v1/\\/api\\/v1/g' dist/index.html # Override the default api url used for developing
|
- sed -i 's/http\:\\/\\/localhost\\:3456\\/api\\/v1/\\/api\\/v1/g' dist/index.html # Override the default api url used for developing
|
||||||
# depends_on:
|
# depends_on:
|
||||||
# - restore-cache
|
# - restore-cache
|
||||||
|
@ -256,21 +267,22 @@ steps:
|
||||||
# endpoint: https://s3.fr-par.scw.cloud
|
# endpoint: https://s3.fr-par.scw.cloud
|
||||||
# region: fr-par
|
# region: fr-par
|
||||||
# path_style: true
|
# path_style: true
|
||||||
# cache_key: '{{ .Repo.Name }}_{{ checksum "yarn.lock" }}_{{ arch }}_{{ os }}'
|
# cache_key: '{{ .Repo.Name }}_{{ checksum "pnpm-lock.yaml" }}_{{ arch }}_{{ os }}'
|
||||||
# mount:
|
# mount:
|
||||||
# - '.cache'
|
# - .cache
|
||||||
|
|
||||||
- name: build
|
- name: build
|
||||||
image: node:18
|
image: node:18-alpine
|
||||||
pull: true
|
pull: true
|
||||||
group: build-static
|
group: build-static
|
||||||
environment:
|
environment:
|
||||||
YARN_CACHE_FOLDER: .cache/yarn/
|
PNPM_CACHE_FOLDER: .cache/pnpm
|
||||||
commands:
|
commands:
|
||||||
- yarn --frozen-lockfile --network-timeout 100000
|
- corepack enable && corepack prepare pnpm@7.9.3 --activate && pnpm config set store-dir .cache/pnpm
|
||||||
- yarn run lint
|
- pnpm install --fetch-timeout 100000
|
||||||
|
- pnpm run lint
|
||||||
- "echo '{\"VERSION\": \"'$(git describe --tags --always --abbrev=10 | sed 's/-/+/' | sed 's/^v//' | sed 's/-g/-/')'\"}' > src/version.json"
|
- "echo '{\"VERSION\": \"'$(git describe --tags --always --abbrev=10 | sed 's/-/+/' | sed 's/^v//' | sed 's/-g/-/')'\"}' > src/version.json"
|
||||||
- yarn run build
|
- pnpm run build
|
||||||
- sed -i 's/http\:\\/\\/localhost\\:3456\\/api\\/v1/\\/api\\/v1/g' dist/index.html # Override the default api url used for developing
|
- sed -i 's/http\:\\/\\/localhost\\:3456\\/api\\/v1/\\/api\\/v1/g' dist/index.html # Override the default api url used for developing
|
||||||
# depends_on:
|
# depends_on:
|
||||||
# - restore-cache
|
# - restore-cache
|
||||||
|
@ -647,6 +659,6 @@ steps:
|
||||||
from_secret: crowdin_key
|
from_secret: crowdin_key
|
||||||
---
|
---
|
||||||
kind: signature
|
kind: signature
|
||||||
hmac: 997e1badebe484ac29557c4af356e63db4d3d57f3d32e92d482f117f8cec64da
|
hmac: 9eccb4a9999236be0f772c4cbe7ccce2875faa57f32de179bd75cf0df4124d00
|
||||||
|
|
||||||
...
|
...
|
||||||
|
|
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -8,10 +8,14 @@ node_modules
|
||||||
.env.*.local
|
.env.*.local
|
||||||
|
|
||||||
# Log files
|
# Log files
|
||||||
|
logs
|
||||||
|
*.log
|
||||||
npm-debug.log*
|
npm-debug.log*
|
||||||
yarn-debug.log*
|
yarn-debug.log*
|
||||||
yarn-error.log*
|
yarn-error.log*
|
||||||
stats.html
|
stats.html
|
||||||
|
pnpm-debug.log*
|
||||||
|
lerna-debug.log*
|
||||||
|
|
||||||
# Editor directories and files
|
# Editor directories and files
|
||||||
.idea
|
.idea
|
||||||
|
|
2
.npmrc
Normal file
2
.npmrc
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
auto-install-peers=true
|
||||||
|
fetch-timeout=100000
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"eslint.packageManager": "yarn",
|
"eslint.packageManager": "pnpm",
|
||||||
"editor.formatOnSave": false,
|
"editor.formatOnSave": false,
|
||||||
"editor.codeActionsOnSave": {
|
"editor.codeActionsOnSave": {
|
||||||
"source.fixAll": true
|
"source.fixAll": true
|
||||||
|
|
39
Dockerfile
39
Dockerfile
|
@ -1,28 +1,41 @@
|
||||||
# Stage 1: Build application
|
# Stage 1: Build application
|
||||||
FROM node:18 AS compile-image
|
FROM node:18-alpine AS compile-image
|
||||||
|
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
|
|
||||||
ARG USE_RELEASE=false
|
ARG USE_RELEASE=false
|
||||||
ARG RELEASE_VERSION=main
|
ARG RELEASE_VERSION=main
|
||||||
|
|
||||||
ENV YARN_CACHE_FOLDER .cache/yarn/
|
|
||||||
COPY . ./
|
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
if [ $USE_RELEASE = true ]; then \
|
if [ $USE_RELEASE = true ]; then \
|
||||||
rm -rf dist/ && \
|
|
||||||
wget https://dl.vikunja.io/frontend/vikunja-frontend-$RELEASE_VERSION.zip -O frontend-release.zip && \
|
wget https://dl.vikunja.io/frontend/vikunja-frontend-$RELEASE_VERSION.zip -O frontend-release.zip && \
|
||||||
unzip frontend-release.zip -d dist/ && \
|
unzip frontend-release.zip -d dist/ && \
|
||||||
exit 0; \
|
exit 0; \
|
||||||
fi && \
|
fi
|
||||||
|
|
||||||
|
ENV PNPM_CACHE_FOLDER .cache/pnpm/
|
||||||
|
|
||||||
|
# pnpm fetch does require only lockfile
|
||||||
|
COPY pnpm-lock.yaml ./
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
# https://pnpm.io/installation#using-corepack
|
||||||
|
corepack enable && \
|
||||||
|
corepack prepare pnpm@7.9.3 --activate && \
|
||||||
# Build the frontend
|
# Build the frontend
|
||||||
yarn install --frozen-lockfile --network-timeout 100000 && \
|
pnpm fetch
|
||||||
echo '{"VERSION": "'$(git describe --tags --always --abbrev=10 | sed 's/-/+/' | sed 's/^v//' | sed 's/-g/-/')'"}' > src/version.json && \
|
|
||||||
yarn run build
|
ADD . ./
|
||||||
|
|
||||||
|
RUN apk add --no-cache git
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
pnpm install --offline && \
|
||||||
|
echo '{"VERSION": "'$(git describe --tags --always --abbrev=10 | sed 's/-/+/' | sed 's/^v//' | sed 's/-g/-/')'"}' > src/version.json && \
|
||||||
|
pnpm run build
|
||||||
|
|
||||||
# Stage 2: copy
|
# Stage 2: copy
|
||||||
FROM nginx
|
FROM nginx:alpine
|
||||||
|
|
||||||
COPY nginx.conf /etc/nginx/nginx.conf
|
COPY nginx.conf /etc/nginx/nginx.conf
|
||||||
COPY run.sh /run.sh
|
COPY run.sh /run.sh
|
||||||
|
@ -36,4 +49,10 @@ ENV PGID 1000
|
||||||
|
|
||||||
LABEL maintainer="maintainers@vikunja.io"
|
LABEL maintainer="maintainers@vikunja.io"
|
||||||
|
|
||||||
|
RUN apk add --no-cache \
|
||||||
|
# for sh file
|
||||||
|
bash \
|
||||||
|
# installs usermod and groupmod
|
||||||
|
shadow
|
||||||
|
|
||||||
CMD "/run.sh"
|
CMD "/run.sh"
|
||||||
|
|
|
@ -22,25 +22,25 @@ There is a [docker image available](https://hub.docker.com/r/vikunja/api) with s
|
||||||
## Project setup
|
## Project setup
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
yarn install
|
pnpm install
|
||||||
```
|
```
|
||||||
|
|
||||||
### Compiles and hot-reloads for development
|
### Compiles and hot-reloads for development
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
yarn run serve
|
pnpm run serve
|
||||||
```
|
```
|
||||||
|
|
||||||
### Compiles and minifies for production
|
### Compiles and minifies for production
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
yarn run build
|
pnpm run build
|
||||||
```
|
```
|
||||||
|
|
||||||
### Lints and fixes files
|
### Lints and fixes files
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
yarn run lint
|
pnpm run lint
|
||||||
```
|
```
|
||||||
|
|
||||||
## Sponsors
|
## Sponsors
|
||||||
|
|
|
@ -36,7 +36,7 @@ to get a shell inside the cypress container.
|
||||||
In that shell you can then execute the tests with
|
In that shell you can then execute the tests with
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
yarn test:frontend
|
pnpm run test:frontend
|
||||||
```
|
```
|
||||||
|
|
||||||
### Using The Cypress Dashboard
|
### Using The Cypress Dashboard
|
||||||
|
@ -44,5 +44,5 @@ yarn test:frontend
|
||||||
To open the Cypress Dashboard and run tests from there, run
|
To open the Cypress Dashboard and run tests from there, run
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
yarn cypress:open
|
pnpm run cypress:open
|
||||||
```
|
```
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[build]
|
[build]
|
||||||
command = "yarn build"
|
command = "pnpm run build"
|
||||||
publish = "dist-preview"
|
publish = "dist-preview"
|
||||||
|
|
||||||
[[redirects]]
|
[[redirects]]
|
||||||
|
|
64
package.json
64
package.json
|
@ -11,7 +11,7 @@
|
||||||
"build:dev": "vite build -m development --outDir dist-dev/",
|
"build:dev": "vite build -m development --outDir dist-dev/",
|
||||||
"lint": "eslint --ignore-pattern '*.test.*' ./src --ext .vue,.js,.ts",
|
"lint": "eslint --ignore-pattern '*.test.*' ./src --ext .vue,.js,.ts",
|
||||||
"cypress:open": "cypress open",
|
"cypress:open": "cypress open",
|
||||||
"test:unit": "vitest",
|
"test:unit": "vitest --run",
|
||||||
"test:unit-watch": "vitest watch",
|
"test:unit-watch": "vitest watch",
|
||||||
"test:frontend": "cypress run",
|
"test:frontend": "cypress run",
|
||||||
"typecheck": "vue-tsc --noEmit && vue-tsc --noEmit -p tsconfig.vitest.json --composite false",
|
"typecheck": "vue-tsc --noEmit && vue-tsc --noEmit -p tsconfig.vitest.json --composite false",
|
||||||
|
@ -25,20 +25,21 @@
|
||||||
"@github/hotkey": "2.0.1",
|
"@github/hotkey": "2.0.1",
|
||||||
"@infectoone/vue-ganttastic": "^2.0.4",
|
"@infectoone/vue-ganttastic": "^2.0.4",
|
||||||
"@kyvg/vue3-notification": "2.4.1",
|
"@kyvg/vue3-notification": "2.4.1",
|
||||||
"@sentry/tracing": "7.12.1",
|
"@sentry/tracing": "7.13.0",
|
||||||
"@sentry/vue": "7.12.1",
|
"@sentry/vue": "7.13.0",
|
||||||
"@types/is-touch-device": "1.0.0",
|
"@types/is-touch-device": "1.0.0",
|
||||||
"@types/lodash.clonedeep": "4.5.7",
|
"@types/lodash.clonedeep": "4.5.7",
|
||||||
"@types/sortablejs": "1.13.0",
|
"@types/sortablejs": "1.15.0",
|
||||||
"@vueuse/core": "9.2.0",
|
"@vueuse/core": "9.3.0",
|
||||||
"@vueuse/router": "9.2.0",
|
"@vueuse/router": "9.3.0",
|
||||||
"axios": "0.27.2",
|
"axios": "0.27.2",
|
||||||
"blurhash": "1.1.5",
|
"blurhash": "2.0.1",
|
||||||
"bulma-css-variables": "0.9.33",
|
"bulma-css-variables": "0.9.33",
|
||||||
"camel-case": "4.1.2",
|
"camel-case": "4.1.2",
|
||||||
"date-fns": "2.29.2",
|
"codemirror": "5.65.9",
|
||||||
|
"date-fns": "2.29.3",
|
||||||
"dompurify": "2.4.0",
|
"dompurify": "2.4.0",
|
||||||
"easymde": "2.17.0",
|
"easymde": "2.18.0",
|
||||||
"flatpickr": "4.6.13",
|
"flatpickr": "4.6.13",
|
||||||
"flexsearch": "0.7.21",
|
"flexsearch": "0.7.21",
|
||||||
"highlight.js": "11.6.0",
|
"highlight.js": "11.6.0",
|
||||||
|
@ -47,8 +48,10 @@
|
||||||
"lodash.debounce": "4.0.8",
|
"lodash.debounce": "4.0.8",
|
||||||
"marked": "4.1.0",
|
"marked": "4.1.0",
|
||||||
"minimist": "1.2.6",
|
"minimist": "1.2.6",
|
||||||
|
"pinia": "2.0.22",
|
||||||
"register-service-worker": "1.7.2",
|
"register-service-worker": "1.7.2",
|
||||||
"snake-case": "3.0.4",
|
"snake-case": "3.0.4",
|
||||||
|
"sortablejs": "1.15.0",
|
||||||
"ufo": "0.8.5",
|
"ufo": "0.8.5",
|
||||||
"v-tooltip": "4.0.0-beta.17",
|
"v-tooltip": "4.0.0-beta.17",
|
||||||
"vue": "3.2.39",
|
"vue": "3.2.39",
|
||||||
|
@ -65,34 +68,35 @@
|
||||||
"@cypress/vite-dev-server": "3.1.1",
|
"@cypress/vite-dev-server": "3.1.1",
|
||||||
"@cypress/vue": "4.2.0",
|
"@cypress/vue": "4.2.0",
|
||||||
"@faker-js/faker": "7.5.0",
|
"@faker-js/faker": "7.5.0",
|
||||||
|
"@types/dompurify": "2.3.4",
|
||||||
"@types/flexsearch": "0.7.3",
|
"@types/flexsearch": "0.7.3",
|
||||||
"@typescript-eslint/eslint-plugin": "5.36.2",
|
"@typescript-eslint/eslint-plugin": "5.38.1",
|
||||||
"@typescript-eslint/parser": "5.36.2",
|
"@typescript-eslint/parser": "5.38.1",
|
||||||
"@vitejs/plugin-legacy": "2.1.0",
|
"@vitejs/plugin-legacy": "2.2.0",
|
||||||
"@vitejs/plugin-vue": "3.1.0",
|
"@vitejs/plugin-vue": "3.1.0",
|
||||||
"@vue/eslint-config-typescript": "11.0.1",
|
"@vue/eslint-config-typescript": "11.0.2",
|
||||||
"@vue/test-utils": "2.0.2",
|
"@vue/test-utils": "2.0.2",
|
||||||
"@vue/tsconfig": "0.1.3",
|
"@vue/tsconfig": "0.1.3",
|
||||||
"autoprefixer": "10.4.8",
|
"autoprefixer": "10.4.12",
|
||||||
"browserslist": "4.21.3",
|
"browserslist": "4.21.4",
|
||||||
"caniuse-lite": "1.0.30001390",
|
"caniuse-lite": "1.0.30001412",
|
||||||
"cypress": "10.7.0",
|
"cypress": "10.8.0",
|
||||||
"esbuild": "0.15.7",
|
"esbuild": "0.15.9",
|
||||||
"eslint": "8.23.0",
|
"eslint": "8.24.0",
|
||||||
"eslint-plugin-vue": "9.4.0",
|
"eslint-plugin-vue": "9.5.1",
|
||||||
"express": "4.18.1",
|
"express": "4.18.1",
|
||||||
"happy-dom": "6.0.4",
|
"happy-dom": "6.0.4",
|
||||||
"netlify-cli": "11.5.1",
|
"netlify-cli": "11.8.3",
|
||||||
"postcss": "8.4.16",
|
"postcss": "8.4.16",
|
||||||
"postcss-preset-env": "7.8.1",
|
"postcss-preset-env": "7.8.2",
|
||||||
"rollup": "2.79.0",
|
"rollup": "2.79.1",
|
||||||
"rollup-plugin-visualizer": "5.8.1",
|
"rollup-plugin-visualizer": "5.8.2",
|
||||||
"sass": "1.54.9",
|
"sass": "1.55.0",
|
||||||
"typescript": "4.8.2",
|
"typescript": "4.8.3",
|
||||||
"vite": "3.1.0",
|
"vite": "3.1.3",
|
||||||
"vite-plugin-pwa": "0.12.7",
|
"vite-plugin-pwa": "0.13.1",
|
||||||
"vite-svg-loader": "3.6.0",
|
"vite-svg-loader": "3.6.0",
|
||||||
"vitest": "0.23.1",
|
"vitest": "0.23.4",
|
||||||
"vue-tsc": "0.40.13",
|
"vue-tsc": "0.40.13",
|
||||||
"wait-on": "6.0.1",
|
"wait-on": "6.0.1",
|
||||||
"workbox-cli": "6.5.4"
|
"workbox-cli": "6.5.4"
|
||||||
|
@ -103,5 +107,5 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
"packageManager": "yarn@1.22.19"
|
"packageManager": "pnpm@7.12.2"
|
||||||
}
|
}
|
||||||
|
|
13243
pnpm-lock.yaml
generated
Normal file
13243
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load diff
|
@ -85,7 +85,7 @@ import DatemathHelp from '@/components/date/datemathHelp.vue'
|
||||||
const store = useStore()
|
const store = useStore()
|
||||||
const {t} = useI18n({useScope: 'global'})
|
const {t} = useI18n({useScope: 'global'})
|
||||||
|
|
||||||
const emit = defineEmits(['dateChanged', 'update:modelValue'])
|
const emit = defineEmits(['update:modelValue'])
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
modelValue: {
|
modelValue: {
|
||||||
required: false,
|
required: false,
|
||||||
|
@ -118,7 +118,13 @@ watch(
|
||||||
newValue => {
|
newValue => {
|
||||||
from.value = newValue.dateFrom
|
from.value = newValue.dateFrom
|
||||||
to.value = newValue.dateTo
|
to.value = newValue.dateTo
|
||||||
flatpickrRange.value = `${from.value} to ${to.value}`
|
// Only set the date back to flatpickr when it's an actual date.
|
||||||
|
// Otherwise flatpickr runs in an endless loop and slows down the browser.
|
||||||
|
const dateFrom = new Date(from.value)
|
||||||
|
const dateTo = new Date(to.value)
|
||||||
|
if (dateTo.getTime() === dateTo.getTime() && dateFrom.getTime() === dateFrom.getTime()) {
|
||||||
|
flatpickrRange.value = `${from.value} to ${to.value}`
|
||||||
|
}
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -127,7 +133,6 @@ function emitChanged() {
|
||||||
dateFrom: from.value === '' ? null : from.value,
|
dateFrom: from.value === '' ? null : from.value,
|
||||||
dateTo: to.value === '' ? null : to.value,
|
dateTo: to.value === '' ? null : to.value,
|
||||||
}
|
}
|
||||||
emit('dateChanged', args)
|
|
||||||
emit('update:modelValue', args)
|
emit('update:modelValue', args)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,10 @@
|
||||||
{{ currentList.title === '' ? $t('misc.loading') : getListTitle(currentList) }}
|
{{ currentList.title === '' ? $t('misc.loading') : getListTitle(currentList) }}
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
|
<BaseButton :to="{name: 'list.info', params: {listId: currentList.id}}" class="info-button">
|
||||||
|
<icon icon="circle-info"/>
|
||||||
|
</BaseButton>
|
||||||
|
|
||||||
<list-settings-dropdown v-if="canWriteCurrentList && currentList.id !== -1" :list="currentList"/>
|
<list-settings-dropdown v-if="canWriteCurrentList && currentList.id !== -1" :list="currentList"/>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
|
@ -104,15 +108,17 @@ import BaseButton from '@/components/base/BaseButton.vue'
|
||||||
import MenuButton from '@/components/home/MenuButton.vue'
|
import MenuButton from '@/components/home/MenuButton.vue'
|
||||||
|
|
||||||
import {getListTitle} from '@/helpers/getListTitle'
|
import {getListTitle} from '@/helpers/getListTitle'
|
||||||
|
import {useConfigStore} from '@/stores/config'
|
||||||
|
|
||||||
const store = useStore()
|
const store = useStore()
|
||||||
|
const configStore = useConfigStore()
|
||||||
|
|
||||||
const userInfo = computed(() => store.state.auth.info)
|
const userInfo = computed(() => store.state.auth.info)
|
||||||
const userAvatar = computed(() => store.state.auth.avatarUrl)
|
const userAvatar = computed(() => store.state.auth.avatarUrl)
|
||||||
const currentList = computed(() => store.state.currentList)
|
const currentList = computed(() => store.state.currentList)
|
||||||
const background = computed(() => store.state.background)
|
const background = computed(() => store.state.background)
|
||||||
const imprintUrl = computed(() => store.state.config.legal.imprintUrl)
|
const imprintUrl = computed(() => configStore.legal.imprintUrl)
|
||||||
const privacyPolicyUrl = computed(() => store.state.config.legal.privacyPolicyUrl)
|
const privacyPolicyUrl = computed(() => configStore.legal.privacyPolicyUrl)
|
||||||
const canWriteCurrentList = computed(() => store.state.currentList.maxRight > Rights.READ)
|
const canWriteCurrentList = computed(() => store.state.currentList.maxRight > Rights.READ)
|
||||||
const menuActive = computed(() => store.state.menuActive)
|
const menuActive = computed(() => store.state.menuActive)
|
||||||
|
|
||||||
|
@ -284,10 +290,21 @@ $hamburger-menu-icon-width: 28px;
|
||||||
|
|
||||||
:deep(.dropdown-trigger) {
|
:deep(.dropdown-trigger) {
|
||||||
color: var(--grey-400);
|
color: var(--grey-400);
|
||||||
margin-left: 1rem;
|
margin-left: .5rem;
|
||||||
height: 1rem;
|
height: 1rem;
|
||||||
width: 1rem;
|
width: 1rem;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.info-button {
|
||||||
|
text-align: center;
|
||||||
|
height: 1.25rem;
|
||||||
|
line-height: 1.25rem;
|
||||||
|
width: 2rem;
|
||||||
|
margin-top: .25rem;
|
||||||
|
padding: 0 .5rem;
|
||||||
|
color: var(--grey-400);
|
||||||
|
margin-left: .5rem;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
|
@ -66,6 +66,7 @@ import {useRoute, useRouter} from 'vue-router'
|
||||||
import {useEventListener} from '@vueuse/core'
|
import {useEventListener} from '@vueuse/core'
|
||||||
|
|
||||||
import {CURRENT_LIST, KEYBOARD_SHORTCUTS_ACTIVE, MENU_ACTIVE} from '@/store/mutation-types'
|
import {CURRENT_LIST, KEYBOARD_SHORTCUTS_ACTIVE, MENU_ACTIVE} from '@/store/mutation-types'
|
||||||
|
import {useLabelStore} from '@/stores/labels'
|
||||||
import Navigation from '@/components/home/navigation.vue'
|
import Navigation from '@/components/home/navigation.vue'
|
||||||
import QuickActions from '@/components/quick-actions/quick-actions.vue'
|
import QuickActions from '@/components/quick-actions/quick-actions.vue'
|
||||||
import BaseButton from '@/components/base/BaseButton.vue'
|
import BaseButton from '@/components/base/BaseButton.vue'
|
||||||
|
@ -197,7 +198,8 @@ function useRenewTokenOnFocus() {
|
||||||
}
|
}
|
||||||
|
|
||||||
useRenewTokenOnFocus()
|
useRenewTokenOnFocus()
|
||||||
store.dispatch('labels/loadAllLabels')
|
const labelStore = useLabelStore()
|
||||||
|
labelStore.loadAllLabels()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
@ -56,10 +56,10 @@
|
||||||
class="menu-label"
|
class="menu-label"
|
||||||
v-tooltip="namespaceTitles[nk]"
|
v-tooltip="namespaceTitles[nk]"
|
||||||
>
|
>
|
||||||
<span
|
<ColorBubble
|
||||||
v-if="n.hexColor !== ''"
|
v-if="n.hexColor !== ''"
|
||||||
:style="{ backgroundColor: n.hexColor }"
|
:color="n.hexColor"
|
||||||
class="color-bubble"
|
class="mr-1"
|
||||||
/>
|
/>
|
||||||
<span class="name">{{ namespaceTitles[nk] }}</span>
|
<span class="name">{{ namespaceTitles[nk] }}</span>
|
||||||
<div
|
<div
|
||||||
|
@ -114,17 +114,17 @@
|
||||||
<span class="icon handle">
|
<span class="icon handle">
|
||||||
<icon icon="grip-lines"/>
|
<icon icon="grip-lines"/>
|
||||||
</span>
|
</span>
|
||||||
<span
|
<ColorBubble
|
||||||
:style="{ backgroundColor: l.hexColor }"
|
v-if="l.hexColor !== ''"
|
||||||
class="color-bubble"
|
:color="l.hexColor"
|
||||||
v-if="l.hexColor !== ''">
|
class="mr-1"
|
||||||
</span>
|
/>
|
||||||
<span class="list-menu-title">{{ getListTitle(l) }}</span>
|
<span class="list-menu-title">{{ getListTitle(l) }}</span>
|
||||||
</BaseButton>
|
</BaseButton>
|
||||||
<BaseButton
|
<BaseButton
|
||||||
class="favorite"
|
class="favorite"
|
||||||
:class="{'is-favorite': l.isFavorite}"
|
:class="{'is-favorite': l.isFavorite}"
|
||||||
@click="toggleFavoriteList(l)"
|
@click="listStore.toggleListFavorite(l)"
|
||||||
>
|
>
|
||||||
<icon :icon="l.isFavorite ? 'star' : ['far', 'star']"/>
|
<icon :icon="l.isFavorite ? 'star' : ['far', 'star']"/>
|
||||||
</BaseButton>
|
</BaseButton>
|
||||||
|
@ -156,8 +156,11 @@ import {calculateItemPosition} from '@/helpers/calculateItemPosition'
|
||||||
import {getNamespaceTitle} from '@/helpers/getNamespaceTitle'
|
import {getNamespaceTitle} from '@/helpers/getNamespaceTitle'
|
||||||
import {getListTitle} from '@/helpers/getListTitle'
|
import {getListTitle} from '@/helpers/getListTitle'
|
||||||
import {useEventListener} from '@vueuse/core'
|
import {useEventListener} from '@vueuse/core'
|
||||||
import type { IList } from '@/models/list'
|
import type {IList} from '@/modelTypes/IList'
|
||||||
import type { INamespace } from '@/models/namespace'
|
import type {INamespace} from '@/modelTypes/INamespace'
|
||||||
|
import ColorBubble from '@/components/misc/colorBubble.vue'
|
||||||
|
import {useListStore} from '@/stores/lists'
|
||||||
|
import {useNamespaceStore} from '@/stores/namespaces'
|
||||||
|
|
||||||
const drag = ref(false)
|
const drag = ref(false)
|
||||||
const dragOptions = {
|
const dragOptions = {
|
||||||
|
@ -166,13 +169,14 @@ const dragOptions = {
|
||||||
}
|
}
|
||||||
|
|
||||||
const store = useStore()
|
const store = useStore()
|
||||||
|
const namespaceStore = useNamespaceStore()
|
||||||
const currentList = computed(() => store.state.currentList)
|
const currentList = computed(() => store.state.currentList)
|
||||||
const menuActive = computed(() => store.state.menuActive)
|
const menuActive = computed(() => store.state.menuActive)
|
||||||
const loading = computed(() => store.state.loading && store.state.loadingModule === 'namespaces')
|
const loading = computed(() => namespaceStore.isLoading)
|
||||||
|
|
||||||
|
|
||||||
const namespaces = computed(() => {
|
const namespaces = computed(() => {
|
||||||
return (store.state.namespaces.namespaces as INamespace[]).filter(n => !n.isArchived)
|
return namespaceStore.namespaces.filter(n => !n.isArchived)
|
||||||
})
|
})
|
||||||
const activeLists = computed(() => {
|
const activeLists = computed(() => {
|
||||||
return namespaces.value.map(({lists}) => {
|
return namespaces.value.map(({lists}) => {
|
||||||
|
@ -194,15 +198,7 @@ const namespaceListsCount = computed(() => {
|
||||||
useEventListener('resize', resize)
|
useEventListener('resize', resize)
|
||||||
onMounted(() => resize())
|
onMounted(() => resize())
|
||||||
|
|
||||||
|
const listStore = useListStore()
|
||||||
function toggleFavoriteList(list: IList) {
|
|
||||||
// The favorites pseudo list is always favorite
|
|
||||||
// Archived lists cannot be marked favorite
|
|
||||||
if (list.id === -1 || list.isArchived) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
store.dispatch('lists/toggleListFavorite', list)
|
|
||||||
}
|
|
||||||
|
|
||||||
function resize() {
|
function resize() {
|
||||||
// Hide the menu by default on mobile
|
// Hide the menu by default on mobile
|
||||||
|
@ -216,7 +212,7 @@ function toggleLists(namespaceId: INamespace['id']) {
|
||||||
const listsVisible = ref<{ [id: INamespace['id']]: boolean }>({})
|
const listsVisible = ref<{ [id: INamespace['id']]: boolean }>({})
|
||||||
// FIXME: async action will be unfinished when component mounts
|
// FIXME: async action will be unfinished when component mounts
|
||||||
onBeforeMount(async () => {
|
onBeforeMount(async () => {
|
||||||
const namespaces = await store.dispatch('namespaces/loadNamespaces') as INamespace[]
|
const namespaces = await namespaceStore.loadNamespaces()
|
||||||
namespaces.forEach(n => {
|
namespaces.forEach(n => {
|
||||||
if (typeof listsVisible.value[n.id] === 'undefined') {
|
if (typeof listsVisible.value[n.id] === 'undefined') {
|
||||||
listsVisible.value[n.id] = true
|
listsVisible.value[n.id] = true
|
||||||
|
@ -235,7 +231,7 @@ function updateActiveLists(namespace: INamespace, activeLists: IList[]) {
|
||||||
...namespace.lists.filter(l => l.isArchived),
|
...namespace.lists.filter(l => l.isArchived),
|
||||||
]
|
]
|
||||||
|
|
||||||
store.commit('namespaces/setNamespaceById', {
|
namespaceStore.setNamespaceById({
|
||||||
...namespace,
|
...namespace,
|
||||||
lists,
|
lists,
|
||||||
})
|
})
|
||||||
|
@ -267,7 +263,7 @@ async function saveListPosition(e: SortableEvent) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// create a copy of the list in order to not violate vuex mutations
|
// create a copy of the list in order to not violate vuex mutations
|
||||||
await store.dispatch('lists/updateList', {
|
await listStore.updateList({
|
||||||
...list,
|
...list,
|
||||||
position,
|
position,
|
||||||
namespaceId,
|
namespaceId,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="update-notification" v-if="updateAvailable">
|
<div class="update-notification" v-if="updateAvailable">
|
||||||
<p>{{ $t('update.available') }}</p>
|
<p>{{ $t('update.available') }}</p>
|
||||||
<x-button @click="refreshApp()" :shadow="false">
|
<x-button @click="refreshApp()" :shadow="false" class="has-no-text-wrap">
|
||||||
{{ $t('update.do') }}
|
{{ $t('update.do') }}
|
||||||
</x-button>
|
</x-button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -43,24 +43,19 @@ function refreshApp() {
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.update-notification {
|
.update-notification {
|
||||||
margin: .5rem;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
background: $warning;
|
background: $warning;
|
||||||
padding: 0 .25rem;
|
padding: .5rem;
|
||||||
border-radius: $radius;
|
border-radius: $radius;
|
||||||
font-size: .9rem;
|
font-size: .9rem;
|
||||||
color: var(--grey-900);
|
color: var(--grey-900);
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
||||||
@media screen and (max-width: $desktop) {
|
position: fixed;
|
||||||
position: fixed;
|
bottom: 1rem;
|
||||||
bottom: 1rem;
|
width: 450px;
|
||||||
margin: 0;
|
left: calc(50vw - 225px);
|
||||||
width: 450px;
|
|
||||||
left: calc(50vw - 225px);
|
|
||||||
padding: .5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media screen and (max-width: $tablet) {
|
@media screen and (max-width: $tablet) {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
|
|
@ -9,9 +9,16 @@
|
||||||
}
|
}
|
||||||
]"
|
]"
|
||||||
>
|
>
|
||||||
<icon :icon="icon" v-if="showIconOnly"/>
|
<icon
|
||||||
|
v-if="showIconOnly"
|
||||||
|
:icon="icon"
|
||||||
|
:style="{'color': iconColor !== '' ? iconColor : false}"
|
||||||
|
/>
|
||||||
<span class="icon is-small" v-else-if="icon !== ''">
|
<span class="icon is-small" v-else-if="icon !== ''">
|
||||||
<icon :icon="icon"/>
|
<icon
|
||||||
|
:icon="icon"
|
||||||
|
:style="{'color': iconColor !== '' ? iconColor : false}"
|
||||||
|
/>
|
||||||
</span>
|
</span>
|
||||||
<slot />
|
<slot />
|
||||||
</BaseButton>
|
</BaseButton>
|
||||||
|
@ -42,6 +49,10 @@ const props = defineProps({
|
||||||
type: [String, Array],
|
type: [String, Array],
|
||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
|
iconColor: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
loading: {
|
loading: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
|
|
|
@ -68,7 +68,7 @@ export default defineComponent({
|
||||||
default: 'top',
|
default: 'top',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
emits: ['update:modelValue', 'change'],
|
emits: ['update:modelValue'],
|
||||||
watch: {
|
watch: {
|
||||||
modelValue: {
|
modelValue: {
|
||||||
handler(modelValue) {
|
handler(modelValue) {
|
||||||
|
@ -98,7 +98,6 @@ export default defineComponent({
|
||||||
|
|
||||||
this.lastChangeTimeout = setTimeout(() => {
|
this.lastChangeTimeout = setTimeout(() => {
|
||||||
this.$emit('update:modelValue', this.color)
|
this.$emit('update:modelValue', this.color)
|
||||||
this.$emit('change')
|
|
||||||
}, 500)
|
}, 500)
|
||||||
},
|
},
|
||||||
reset() {
|
reset() {
|
||||||
|
|
|
@ -131,7 +131,7 @@ export default defineComponent({
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
emits: ['update:modelValue', 'change', 'close', 'close-on-change'],
|
emits: ['update:modelValue', 'close', 'close-on-change'],
|
||||||
mounted() {
|
mounted() {
|
||||||
document.addEventListener('click', this.hideDatePopup)
|
document.addEventListener('click', this.hideDatePopup)
|
||||||
},
|
},
|
||||||
|
@ -186,7 +186,6 @@ export default defineComponent({
|
||||||
updateData() {
|
updateData() {
|
||||||
this.changed = true
|
this.changed = true
|
||||||
this.$emit('update:modelValue', this.date)
|
this.$emit('update:modelValue', this.date)
|
||||||
this.$emit('change', this.date)
|
|
||||||
},
|
},
|
||||||
toggleDatePopup() {
|
toggleDatePopup() {
|
||||||
if (this.disabled) {
|
if (this.disabled) {
|
||||||
|
|
|
@ -72,7 +72,7 @@ import {defineComponent} from 'vue'
|
||||||
import VueEasymde from './vue-easymde.vue'
|
import VueEasymde from './vue-easymde.vue'
|
||||||
import {marked} from 'marked'
|
import {marked} from 'marked'
|
||||||
import DOMPurify from 'dompurify'
|
import DOMPurify from 'dompurify'
|
||||||
import hljs from 'highlight.js/lib/common'
|
import {setupMarkdownRenderer} from '@/helpers/markdownRenderer'
|
||||||
|
|
||||||
import {createEasyMDEConfig} from './editorConfig'
|
import {createEasyMDEConfig} from './editorConfig'
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@ export default defineComponent({
|
||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
emits: ['update:modelValue', 'change'],
|
emits: ['update:modelValue'],
|
||||||
computed: {
|
computed: {
|
||||||
showPreviewText() {
|
showPreviewText() {
|
||||||
return this.isPreviewActive && this.text === '' && this.emptyText !== ''
|
return this.isPreviewActive && this.text === '' && this.emptyText !== ''
|
||||||
|
@ -212,7 +212,6 @@ export default defineComponent({
|
||||||
|
|
||||||
this.changeTimeout = setTimeout(() => {
|
this.changeTimeout = setTimeout(() => {
|
||||||
this.$emit('update:modelValue', this.text)
|
this.$emit('update:modelValue', this.text)
|
||||||
this.$emit('change', this.text)
|
|
||||||
}, timeout)
|
}, timeout)
|
||||||
},
|
},
|
||||||
replaceAt(str, index, replacement) {
|
replaceAt(str, index, replacement) {
|
||||||
|
@ -223,43 +222,7 @@ export default defineComponent({
|
||||||
return checkboxes[n]
|
return checkboxes[n]
|
||||||
},
|
},
|
||||||
renderPreview() {
|
renderPreview() {
|
||||||
const renderer = new marked.Renderer()
|
setupMarkdownRenderer(this.checkboxId)
|
||||||
const linkRenderer = renderer.link
|
|
||||||
|
|
||||||
let checkboxNum = -1
|
|
||||||
marked.use({
|
|
||||||
renderer: {
|
|
||||||
image: (src, title, text) => {
|
|
||||||
|
|
||||||
title = title ? ` title="${title}` : ''
|
|
||||||
|
|
||||||
// If the url starts with the api url, the image is likely an attachment and
|
|
||||||
// we'll need to download and parse it properly.
|
|
||||||
if (src.substr(0, window.API_URL.length + 7) === `${window.API_URL}/tasks/`) {
|
|
||||||
return `<img data-src="${src}" alt="${text}" ${title} class="attachment-image"/>`
|
|
||||||
}
|
|
||||||
|
|
||||||
return `<img src="${src}" alt="${text}" ${title}/>`
|
|
||||||
},
|
|
||||||
checkbox: (checked) => {
|
|
||||||
if (checked) {
|
|
||||||
checked = ' checked="checked"'
|
|
||||||
}
|
|
||||||
|
|
||||||
checkboxNum++
|
|
||||||
return `<input type="checkbox" data-checkbox-num="${checkboxNum}" ${checked} class="text-checkbox-${this.checkboxId}"/>`
|
|
||||||
},
|
|
||||||
link: (href, title, text) => {
|
|
||||||
const isLocal = href.startsWith(`${location.protocol}//${location.hostname}`)
|
|
||||||
const html = linkRenderer.call(renderer, href, title, text)
|
|
||||||
return isLocal ? html : html.replace(/^<a /, '<a target="_blank" rel="noreferrer noopener nofollow" ')
|
|
||||||
},
|
|
||||||
},
|
|
||||||
highlight: function (code, language) {
|
|
||||||
const validLanguage = hljs.getLanguage(language) ? language : 'plaintext'
|
|
||||||
return hljs.highlight(code, {language: validLanguage}).value
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
this.preview = DOMPurify.sanitize(marked(this.text), {ADD_ATTR: ['target']})
|
this.preview = DOMPurify.sanitize(marked(this.text), {ADD_ATTR: ['target']})
|
||||||
|
|
||||||
|
|
|
@ -60,8 +60,8 @@
|
||||||
:is-button="false"
|
:is-button="false"
|
||||||
entity="list"
|
entity="list"
|
||||||
:entity-id="list.id"
|
:entity-id="list.id"
|
||||||
:subscription="list.subscription"
|
:model-value="list.subscription"
|
||||||
@change="sub => subscription = sub"
|
@update:model-value="sub => subscription = sub"
|
||||||
type="dropdown"
|
type="dropdown"
|
||||||
/>
|
/>
|
||||||
<dropdown-item
|
<dropdown-item
|
||||||
|
@ -77,14 +77,14 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {ref, computed, watchEffect, type PropType} from 'vue'
|
import {ref, computed, watchEffect, type PropType} from 'vue'
|
||||||
import {useStore} from '@/store'
|
|
||||||
|
|
||||||
import {getSavedFilterIdFromListId} from '@/helpers/savedFilter'
|
import {getSavedFilterIdFromListId} from '@/helpers/savedFilter'
|
||||||
import Dropdown from '@/components/misc/dropdown.vue'
|
import Dropdown from '@/components/misc/dropdown.vue'
|
||||||
import DropdownItem from '@/components/misc/dropdown-item.vue'
|
import DropdownItem from '@/components/misc/dropdown-item.vue'
|
||||||
import TaskSubscription from '@/components/misc/subscription.vue'
|
import TaskSubscription from '@/components/misc/subscription.vue'
|
||||||
import type {IList} from '@/models/list'
|
import type {IList} from '@/modelTypes/IList'
|
||||||
import type { ISubscription } from '@/models/subscription'
|
import type {ISubscription} from '@/modelTypes/ISubscription'
|
||||||
|
import {useConfigStore} from '@/stores/config'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
list: {
|
list: {
|
||||||
|
@ -98,7 +98,7 @@ watchEffect(() => {
|
||||||
subscription.value = props.list.subscription ?? null
|
subscription.value = props.list.subscription ?? null
|
||||||
})
|
})
|
||||||
|
|
||||||
const store = useStore()
|
const configStore = useConfigStore()
|
||||||
const backgroundsEnabled = computed(() => store.state.config.enabledBackgroundProviders?.length > 0)
|
const backgroundsEnabled = computed(() => configStore.enabledBackgroundProviders?.length > 0)
|
||||||
const isSavedFilter = computed(() => getSavedFilterIdFromListId(props.list.id) > 0)
|
const isSavedFilter = computed(() => getSavedFilterIdFromListId(props.list.id) > 0)
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -29,72 +29,60 @@
|
||||||
</modal>
|
</modal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script setup lang="ts">
|
||||||
import {defineComponent, ref} from 'vue'
|
import {computed, ref, watch} from 'vue'
|
||||||
|
|
||||||
import Filters from '@/components/list/partials/filters.vue'
|
import Filters from '@/components/list/partials/filters.vue'
|
||||||
|
|
||||||
import {getDefaultParams} from '@/composables/taskList'
|
import {getDefaultParams} from '@/composables/taskList'
|
||||||
|
|
||||||
export default defineComponent({
|
const props = defineProps({
|
||||||
name: 'filter-popup',
|
modelValue: {
|
||||||
components: {
|
required: true,
|
||||||
Filters,
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
modelValue: {
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
emits: ['update:modelValue'],
|
|
||||||
computed: {
|
|
||||||
value: {
|
|
||||||
get() {
|
|
||||||
return this.modelValue
|
|
||||||
},
|
|
||||||
set(value) {
|
|
||||||
this.$emit('update:modelValue', value)
|
|
||||||
},
|
|
||||||
},
|
|
||||||
hasFilters() {
|
|
||||||
// this.value also contains the page parameter which we don't want to include in filters
|
|
||||||
// eslint-disable-next-line no-unused-vars
|
|
||||||
const {filter_by, filter_value, filter_comparator, filter_concat, s} = this.value
|
|
||||||
const def = {...getDefaultParams()}
|
|
||||||
|
|
||||||
const params = {filter_by, filter_value, filter_comparator, filter_concat, s}
|
|
||||||
const defaultParams = {
|
|
||||||
filter_by: def.filter_by,
|
|
||||||
filter_value: def.filter_value,
|
|
||||||
filter_comparator: def.filter_comparator,
|
|
||||||
filter_concat: def.filter_concat,
|
|
||||||
s: s ? def.s : undefined,
|
|
||||||
}
|
|
||||||
|
|
||||||
return JSON.stringify(params) !== JSON.stringify(defaultParams)
|
|
||||||
},
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
modelValue: {
|
|
||||||
handler(value) {
|
|
||||||
this.value = value
|
|
||||||
},
|
|
||||||
immediate: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
setup() {
|
|
||||||
const modalOpen = ref(false)
|
|
||||||
|
|
||||||
return {
|
|
||||||
modalOpen,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
clearFilters() {
|
|
||||||
this.value = {...getDefaultParams()}
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
const emit = defineEmits(['update:modelValue'])
|
||||||
|
|
||||||
|
const value = computed({
|
||||||
|
get() {
|
||||||
|
return props.modelValue
|
||||||
|
},
|
||||||
|
set(value) {
|
||||||
|
emit('update:modelValue', value)
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.modelValue,
|
||||||
|
(modelValue) => {
|
||||||
|
value.value = modelValue
|
||||||
|
},
|
||||||
|
{immediate: true},
|
||||||
|
)
|
||||||
|
|
||||||
|
const hasFilters = computed(() => {
|
||||||
|
// this.value also contains the page parameter which we don't want to include in filters
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
|
const {filter_by, filter_value, filter_comparator, filter_concat, s} = value.value
|
||||||
|
const def = {...getDefaultParams()}
|
||||||
|
|
||||||
|
const params = {filter_by, filter_value, filter_comparator, filter_concat, s}
|
||||||
|
const defaultParams = {
|
||||||
|
filter_by: def.filter_by,
|
||||||
|
filter_value: def.filter_value,
|
||||||
|
filter_comparator: def.filter_comparator,
|
||||||
|
filter_concat: def.filter_concat,
|
||||||
|
s: s ? def.s : undefined,
|
||||||
|
}
|
||||||
|
|
||||||
|
return JSON.stringify(params) !== JSON.stringify(defaultParams)
|
||||||
|
})
|
||||||
|
|
||||||
|
const modalOpen = ref(false)
|
||||||
|
|
||||||
|
function clearFilters() {
|
||||||
|
value.value = {...getDefaultParams()}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
<priority-select
|
<priority-select
|
||||||
:disabled="!filters.usePriority || undefined"
|
:disabled="!filters.usePriority || undefined"
|
||||||
v-model.number="filters.priority"
|
v-model.number="filters.priority"
|
||||||
@change="setPriority"
|
@update:model-value="setPriority"
|
||||||
/>
|
/>
|
||||||
<fancycheckbox
|
<fancycheckbox
|
||||||
v-model="filters.usePriority"
|
v-model="filters.usePriority"
|
||||||
|
@ -53,7 +53,7 @@
|
||||||
<div class="control single-value-control">
|
<div class="control single-value-control">
|
||||||
<percent-done-select
|
<percent-done-select
|
||||||
v-model.number="filters.percentDone"
|
v-model.number="filters.percentDone"
|
||||||
@change="setPercentDoneFilter"
|
@update:model-value="setPercentDoneFilter"
|
||||||
:disabled="!filters.usePercentDone || undefined"
|
:disabled="!filters.usePercentDone || undefined"
|
||||||
/>
|
/>
|
||||||
<fancycheckbox
|
<fancycheckbox
|
||||||
|
@ -68,8 +68,9 @@
|
||||||
<label class="label">{{ $t('task.attributes.dueDate') }}</label>
|
<label class="label">{{ $t('task.attributes.dueDate') }}</label>
|
||||||
<div class="control">
|
<div class="control">
|
||||||
<datepicker-with-range
|
<datepicker-with-range
|
||||||
@dateChanged="values => setDateFilter('due_date', values)"
|
v-model="filters.dueDate"
|
||||||
v-model="filters.dueDate">
|
@update:model-value="values => setDateFilter('due_date', values)"
|
||||||
|
>
|
||||||
<template #trigger="{toggle, buttonText}">
|
<template #trigger="{toggle, buttonText}">
|
||||||
<x-button @click.prevent.stop="toggle()" variant="secondary" :shadow="false" class="mb-2">
|
<x-button @click.prevent.stop="toggle()" variant="secondary" :shadow="false" class="mb-2">
|
||||||
{{ buttonText }}
|
{{ buttonText }}
|
||||||
|
@ -82,8 +83,9 @@
|
||||||
<label class="label">{{ $t('task.attributes.startDate') }}</label>
|
<label class="label">{{ $t('task.attributes.startDate') }}</label>
|
||||||
<div class="control">
|
<div class="control">
|
||||||
<datepicker-with-range
|
<datepicker-with-range
|
||||||
@dateChanged="values => setDateFilter('start_date', values)"
|
v-model="filters.startDate"
|
||||||
v-model="filters.startDate">
|
@update:model-value="values => setDateFilter('start_date', values)"
|
||||||
|
>
|
||||||
<template #trigger="{toggle, buttonText}">
|
<template #trigger="{toggle, buttonText}">
|
||||||
<x-button @click.prevent.stop="toggle()" variant="secondary" :shadow="false" class="mb-2">
|
<x-button @click.prevent.stop="toggle()" variant="secondary" :shadow="false" class="mb-2">
|
||||||
{{ buttonText }}
|
{{ buttonText }}
|
||||||
|
@ -96,8 +98,9 @@
|
||||||
<label class="label">{{ $t('task.attributes.endDate') }}</label>
|
<label class="label">{{ $t('task.attributes.endDate') }}</label>
|
||||||
<div class="control">
|
<div class="control">
|
||||||
<datepicker-with-range
|
<datepicker-with-range
|
||||||
@dateChanged="values => setDateFilter('end_date', values)"
|
v-model="filters.endDate"
|
||||||
v-model="filters.endDate">
|
@update:model-value="values => setDateFilter('end_date', values)"
|
||||||
|
>
|
||||||
<template #trigger="{toggle, buttonText}">
|
<template #trigger="{toggle, buttonText}">
|
||||||
<x-button @click.prevent.stop="toggle()" variant="secondary" :shadow="false" class="mb-2">
|
<x-button @click.prevent.stop="toggle()" variant="secondary" :shadow="false" class="mb-2">
|
||||||
{{ buttonText }}
|
{{ buttonText }}
|
||||||
|
@ -110,8 +113,9 @@
|
||||||
<label class="label">{{ $t('task.attributes.reminders') }}</label>
|
<label class="label">{{ $t('task.attributes.reminders') }}</label>
|
||||||
<div class="control">
|
<div class="control">
|
||||||
<datepicker-with-range
|
<datepicker-with-range
|
||||||
@dateChanged="values => setDateFilter('reminders', values)"
|
v-model="filters.reminders"
|
||||||
v-model="filters.reminders">
|
@update:model-value="values => setDateFilter('reminders', values)"
|
||||||
|
>
|
||||||
<template #trigger="{toggle, buttonText}">
|
<template #trigger="{toggle, buttonText}">
|
||||||
<x-button @click.prevent.stop="toggle()" variant="secondary" :shadow="false" class="mb-2">
|
<x-button @click.prevent.stop="toggle()" variant="secondary" :shadow="false" class="mb-2">
|
||||||
{{ buttonText }}
|
{{ buttonText }}
|
||||||
|
@ -141,7 +145,7 @@
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label class="label">{{ $t('task.attributes.labels') }}</label>
|
<label class="label">{{ $t('task.attributes.labels') }}</label>
|
||||||
<div class="control labels-list">
|
<div class="control labels-list">
|
||||||
<edit-labels v-model="labels" @change="changeLabelFilter"/>
|
<edit-labels v-model="labels" @update:model-value="changeLabelFilter"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -186,6 +190,8 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {defineComponent} from 'vue'
|
import {defineComponent} from 'vue'
|
||||||
|
|
||||||
|
import {useLabelStore} from '@/stores/labels'
|
||||||
|
|
||||||
import DatepickerWithRange from '@/components/date/datepickerWithRange.vue'
|
import DatepickerWithRange from '@/components/date/datepickerWithRange.vue'
|
||||||
import Fancycheckbox from '@/components/input/fancycheckbox.vue'
|
import Fancycheckbox from '@/components/input/fancycheckbox.vue'
|
||||||
|
|
||||||
|
@ -278,7 +284,7 @@ export default defineComponent({
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
emits: ['update:modelValue', 'change'],
|
emits: ['update:modelValue'],
|
||||||
watch: {
|
watch: {
|
||||||
modelValue: {
|
modelValue: {
|
||||||
handler(value) {
|
handler(value) {
|
||||||
|
@ -303,8 +309,10 @@ export default defineComponent({
|
||||||
this.change()
|
this.change()
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
foundLabels() {
|
foundLabels() {
|
||||||
return this.$store.getters['labels/filterLabelsByQuery'](this.labels, this.query)
|
const labelStore = useLabelStore()
|
||||||
|
return labelStore.filterLabelsByQuery(this.labels, this.labelQuery)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -312,7 +320,6 @@ export default defineComponent({
|
||||||
const params = {...this.params}
|
const params = {...this.params}
|
||||||
params.filter_value = params.filter_value.map(v => v instanceof Date ? v.toISOString() : v)
|
params.filter_value = params.filter_value.map(v => v instanceof Date ? v.toISOString() : v)
|
||||||
this.$emit('update:modelValue', params)
|
this.$emit('update:modelValue', params)
|
||||||
this.$emit('change', params)
|
|
||||||
},
|
},
|
||||||
prepareFilters() {
|
prepareFilters() {
|
||||||
this.prepareDone()
|
this.prepareDone()
|
||||||
|
@ -333,7 +340,8 @@ export default defineComponent({
|
||||||
: ''
|
: ''
|
||||||
const labelIds = labels.split(',').map(i => parseInt(i))
|
const labelIds = labels.split(',').map(i => parseInt(i))
|
||||||
|
|
||||||
this.labels = this.$store.getters['labels/getLabelsByIds'](labelIds)
|
const labelStore = useLabelStore()
|
||||||
|
this.labels = labelStore.getLabelsByIds(labelIds)
|
||||||
},
|
},
|
||||||
removePropertyFromFilter(propertyName) {
|
removePropertyFromFilter(propertyName) {
|
||||||
// Because of the way arrays work, we can only ever remove one element at once.
|
// Because of the way arrays work, we can only ever remove one element at once.
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<router-link
|
<router-link
|
||||||
:class="{
|
:class="{
|
||||||
'has-light-text': !colorIsDark(list.hexColor),
|
'has-light-text': !colorIsDark(list.hexColor) || background !== null,
|
||||||
'has-background': blurHashUrl !== ''
|
'has-background': blurHashUrl !== '' || background !== null,
|
||||||
}"
|
}"
|
||||||
:style="{
|
:style="{
|
||||||
'background-color': list.hexColor,
|
'background-color': list.hexColor,
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
<BaseButton
|
<BaseButton
|
||||||
v-else
|
v-else
|
||||||
:class="{'is-favorite': list.isFavorite}"
|
:class="{'is-favorite': list.isFavorite}"
|
||||||
@click.stop="toggleFavoriteList(list)"
|
@click.stop="listStore.toggleListFavorite(list)"
|
||||||
class="favorite"
|
class="favorite"
|
||||||
>
|
>
|
||||||
<icon :icon="list.isFavorite ? 'star' : ['far', 'star']"/>
|
<icon :icon="list.isFavorite ? 'star' : ['far', 'star']"/>
|
||||||
|
@ -37,7 +37,6 @@
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import {type PropType, ref, watch} from 'vue'
|
import {type PropType, ref, watch} from 'vue'
|
||||||
import {useStore} from '@/store'
|
|
||||||
|
|
||||||
import ListService from '@/services/list'
|
import ListService from '@/services/list'
|
||||||
import {getBlobFromBlurHash} from '@/helpers/getBlobFromBlurHash'
|
import {getBlobFromBlurHash} from '@/helpers/getBlobFromBlurHash'
|
||||||
|
@ -45,7 +44,8 @@ import {getBlobFromBlurHash} from '@/helpers/getBlobFromBlurHash'
|
||||||
import {colorIsDark} from '@/helpers/color/colorIsDark'
|
import {colorIsDark} from '@/helpers/color/colorIsDark'
|
||||||
|
|
||||||
import BaseButton from '@/components/base/BaseButton.vue'
|
import BaseButton from '@/components/base/BaseButton.vue'
|
||||||
import type { IList } from '@/models/list'
|
import type {IList} from '@/modelTypes/IList'
|
||||||
|
import {useListStore} from '@/stores/lists'
|
||||||
|
|
||||||
const background = ref<string | null>(null)
|
const background = ref<string | null>(null)
|
||||||
const backgroundLoading = ref(false)
|
const backgroundLoading = ref(false)
|
||||||
|
@ -84,16 +84,7 @@ async function loadBackground() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const store = useStore()
|
const listStore = useListStore()
|
||||||
|
|
||||||
function toggleFavoriteList(list: IList) {
|
|
||||||
// The favorites pseudo list is always favorite
|
|
||||||
// Archived lists cannot be marked favorite
|
|
||||||
if (list.id === -1 || list.isArchived) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
store.dispatch('lists/toggleListFavorite', list)
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@ -110,7 +101,7 @@ function toggleFavoriteList(list: IList) {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
&.has-light-text .title {
|
&.has-light-text .title {
|
||||||
color: var(--grey-100);
|
color: var(--grey-100) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.has-background,
|
&.has-background,
|
||||||
|
|
|
@ -11,16 +11,17 @@ import {
|
||||||
faCheckDouble,
|
faCheckDouble,
|
||||||
faChessKnight,
|
faChessKnight,
|
||||||
faChevronDown,
|
faChevronDown,
|
||||||
|
faCircleInfo,
|
||||||
faCloudDownloadAlt,
|
faCloudDownloadAlt,
|
||||||
faCloudUploadAlt,
|
faCloudUploadAlt,
|
||||||
faCocktail,
|
faCocktail,
|
||||||
faCoffee,
|
faCoffee,
|
||||||
faCog,
|
faCog,
|
||||||
faEye,
|
|
||||||
faEyeSlash,
|
|
||||||
faEllipsisH,
|
faEllipsisH,
|
||||||
faEllipsisV,
|
faEllipsisV,
|
||||||
faExclamation,
|
faExclamation,
|
||||||
|
faEye,
|
||||||
|
faEyeSlash,
|
||||||
faFillDrip,
|
faFillDrip,
|
||||||
faFilter,
|
faFilter,
|
||||||
faForward,
|
faForward,
|
||||||
|
@ -82,6 +83,7 @@ library.add(faCheck)
|
||||||
library.add(faCheckDouble)
|
library.add(faCheckDouble)
|
||||||
library.add(faChessKnight)
|
library.add(faChessKnight)
|
||||||
library.add(faChevronDown)
|
library.add(faChevronDown)
|
||||||
|
library.add(faCircleInfo)
|
||||||
library.add(faClock)
|
library.add(faClock)
|
||||||
library.add(faCloudDownloadAlt)
|
library.add(faCloudDownloadAlt)
|
||||||
library.add(faCloudUploadAlt)
|
library.add(faCloudUploadAlt)
|
||||||
|
@ -89,11 +91,11 @@ library.add(faCocktail)
|
||||||
library.add(faCoffee)
|
library.add(faCoffee)
|
||||||
library.add(faCog)
|
library.add(faCog)
|
||||||
library.add(faComments)
|
library.add(faComments)
|
||||||
library.add(faEye)
|
|
||||||
library.add(faEyeSlash)
|
|
||||||
library.add(faEllipsisH)
|
library.add(faEllipsisH)
|
||||||
library.add(faEllipsisV)
|
library.add(faEllipsisV)
|
||||||
library.add(faExclamation)
|
library.add(faExclamation)
|
||||||
|
library.add(faEye)
|
||||||
|
library.add(faEyeSlash)
|
||||||
library.add(faFillDrip)
|
library.add(faFillDrip)
|
||||||
library.add(faFilter)
|
library.add(faFilter)
|
||||||
library.add(faForward)
|
library.add(faForward)
|
24
src/components/misc/colorBubble.vue
Normal file
24
src/components/misc/colorBubble.vue
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
<template>
|
||||||
|
<span
|
||||||
|
:style="{backgroundColor: color }"
|
||||||
|
class="color-bubble"
|
||||||
|
></span>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import type { Color } from 'csstype'
|
||||||
|
|
||||||
|
defineProps< {
|
||||||
|
color: Color,
|
||||||
|
}>()
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.color-bubble {
|
||||||
|
display: inline-block;
|
||||||
|
border-radius: 100%;
|
||||||
|
height: 10px;
|
||||||
|
width: 10px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -8,14 +8,13 @@
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import {computed} from 'vue'
|
import {computed} from 'vue'
|
||||||
import {useStore} from '@/store'
|
|
||||||
|
|
||||||
import BaseButton from '@/components/base/BaseButton.vue'
|
import BaseButton from '@/components/base/BaseButton.vue'
|
||||||
|
import {useConfigStore} from '@/stores/config'
|
||||||
|
|
||||||
const store = useStore()
|
const configStore = useConfigStore()
|
||||||
|
|
||||||
const imprintUrl = computed(() => store.state.config.legal.imprintUrl)
|
const imprintUrl = computed(() => configStore.legal.imprintUrl)
|
||||||
const privacyPolicyUrl = computed(() => store.state.config.legal.privacyPolicyUrl)
|
const privacyPolicyUrl = computed(() => configStore.legal.privacyPolicyUrl)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
@ -26,22 +26,23 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
import {computed} from 'vue'
|
||||||
|
import {useRoute} from 'vue-router'
|
||||||
|
import {useI18n} from 'vue-i18n'
|
||||||
|
|
||||||
import Logo from '@/components/home/Logo.vue'
|
import Logo from '@/components/home/Logo.vue'
|
||||||
import Message from '@/components/misc/message.vue'
|
import Message from '@/components/misc/message.vue'
|
||||||
import Legal from '@/components/misc/legal.vue'
|
import Legal from '@/components/misc/legal.vue'
|
||||||
import ApiConfig from '@/components/misc/api-config.vue'
|
import ApiConfig from '@/components/misc/api-config.vue'
|
||||||
import {useStore} from '@/store'
|
|
||||||
import {computed} from 'vue'
|
|
||||||
import {useRoute} from 'vue-router'
|
|
||||||
import {useI18n} from 'vue-i18n'
|
|
||||||
import {useTitle} from '@/composables/useTitle'
|
import {useTitle} from '@/composables/useTitle'
|
||||||
|
import {useConfigStore} from '@/stores/config'
|
||||||
|
|
||||||
|
const configStore = useConfigStore()
|
||||||
|
const motd = computed(() => configStore.motd)
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const store = useStore()
|
|
||||||
const {t} = useI18n({useScope: 'global'})
|
const {t} = useI18n({useScope: 'global'})
|
||||||
|
|
||||||
const motd = computed(() => store.state.config.motd)
|
|
||||||
|
|
||||||
const title = computed(() => t(route.meta?.title as string || ''))
|
const title = computed(() => t(route.meta?.title as string || ''))
|
||||||
useTitle(() => title.value)
|
useTitle(() => title.value)
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
:icon="iconName"
|
:icon="iconName"
|
||||||
v-tooltip="tooltipText"
|
v-tooltip="tooltipText"
|
||||||
@click="changeSubscription"
|
@click="changeSubscription"
|
||||||
:disabled="disabled || undefined"
|
:disabled="disabled"
|
||||||
>
|
>
|
||||||
{{ buttonText }}
|
{{ buttonText }}
|
||||||
</x-button>
|
</x-button>
|
||||||
|
@ -23,6 +23,7 @@
|
||||||
v-tooltip="tooltipText"
|
v-tooltip="tooltipText"
|
||||||
@click="changeSubscription"
|
@click="changeSubscription"
|
||||||
:class="{'is-disabled': disabled}"
|
:class="{'is-disabled': disabled}"
|
||||||
|
:disabled="disabled"
|
||||||
>
|
>
|
||||||
<span class="icon">
|
<span class="icon">
|
||||||
<icon :icon="iconName"/>
|
<icon :icon="iconName"/>
|
||||||
|
@ -39,7 +40,8 @@ import BaseButton from '@/components/base/BaseButton.vue'
|
||||||
import DropdownItem from '@/components/misc/dropdown-item.vue'
|
import DropdownItem from '@/components/misc/dropdown-item.vue'
|
||||||
|
|
||||||
import SubscriptionService from '@/services/subscription'
|
import SubscriptionService from '@/services/subscription'
|
||||||
import SubscriptionModel, { type ISubscription } from '@/models/subscription'
|
import SubscriptionModel from '@/models/subscription'
|
||||||
|
import type {ISubscription} from '@/modelTypes/ISubscription'
|
||||||
|
|
||||||
import {success} from '@/message'
|
import {success} from '@/message'
|
||||||
|
|
||||||
|
@ -50,7 +52,7 @@ const props = defineProps({
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true,
|
default: true,
|
||||||
},
|
},
|
||||||
subscription: {
|
modelValue: {
|
||||||
type: Object as PropType<ISubscription>,
|
type: Object as PropType<ISubscription>,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
|
@ -60,9 +62,9 @@ const props = defineProps({
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const subscriptionEntity = computed<string | null>(() => props.subscription?.entity ?? null)
|
const subscriptionEntity = computed<string | null>(() => props.modelValue?.entity ?? null)
|
||||||
|
|
||||||
const emit = defineEmits(['change'])
|
const emit = defineEmits(['update:modelValue'])
|
||||||
|
|
||||||
const subscriptionService = shallowRef(new SubscriptionService())
|
const subscriptionService = shallowRef(new SubscriptionService())
|
||||||
|
|
||||||
|
@ -75,27 +77,21 @@ const tooltipText = computed(() => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
return props.subscription !== null ?
|
return props.modelValue !== null ?
|
||||||
t('task.subscription.subscribed', {entity: props.entity}) :
|
t('task.subscription.subscribed', {entity: props.entity}) :
|
||||||
t('task.subscription.notSubscribed', {entity: props.entity})
|
t('task.subscription.notSubscribed', {entity: props.entity})
|
||||||
})
|
})
|
||||||
|
|
||||||
const buttonText = computed(() => props.subscription !== null ? t('task.subscription.unsubscribe') : t('task.subscription.subscribe'))
|
const buttonText = computed(() => props.modelValue ? t('task.subscription.unsubscribe') : t('task.subscription.subscribe'))
|
||||||
const iconName = computed(() => props.subscription !== null ? ['far', 'bell-slash'] : 'bell')
|
const iconName = computed(() => props.modelValue ? ['far', 'bell-slash'] : 'bell')
|
||||||
const disabled = computed(() => {
|
const disabled = computed(() => props.modelValue && subscriptionEntity.value !== props.entity)
|
||||||
if (props.subscription === null) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
return subscriptionEntity.value !== props.entity
|
|
||||||
})
|
|
||||||
|
|
||||||
function changeSubscription() {
|
function changeSubscription() {
|
||||||
if (disabled.value) {
|
if (disabled.value) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (props.subscription === null) {
|
if (props.modelValue === null) {
|
||||||
subscribe()
|
subscribe()
|
||||||
} else {
|
} else {
|
||||||
unsubscribe()
|
unsubscribe()
|
||||||
|
@ -108,7 +104,7 @@ async function subscribe() {
|
||||||
entityId: props.entityId,
|
entityId: props.entityId,
|
||||||
})
|
})
|
||||||
await subscriptionService.value.create(subscription)
|
await subscriptionService.value.create(subscription)
|
||||||
emit('change', subscription)
|
emit('update:modelValue', subscription)
|
||||||
success({message: t('task.subscription.subscribeSuccess', {entity: props.entity})})
|
success({message: t('task.subscription.subscribeSuccess', {entity: props.entity})})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,7 +114,7 @@ async function unsubscribe() {
|
||||||
entityId: props.entityId,
|
entityId: props.entityId,
|
||||||
})
|
})
|
||||||
await subscriptionService.value.delete(subscription)
|
await subscriptionService.value.delete(subscription)
|
||||||
emit('change', null)
|
emit('update:modelValue', null)
|
||||||
success({message: t('task.subscription.unsubscribeSuccess', {entity: props.entity})})
|
success({message: t('task.subscription.unsubscribeSuccess', {entity: props.entity})})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -34,12 +34,13 @@
|
||||||
{{ $t('menu.archive') }}
|
{{ $t('menu.archive') }}
|
||||||
</dropdown-item>
|
</dropdown-item>
|
||||||
<task-subscription
|
<task-subscription
|
||||||
|
v-if="subscription"
|
||||||
class="has-no-shadow"
|
class="has-no-shadow"
|
||||||
:is-button="false"
|
:is-button="false"
|
||||||
entity="namespace"
|
entity="namespace"
|
||||||
:entity-id="namespace.id"
|
:entity-id="namespace.id"
|
||||||
:subscription="subscription"
|
:model-value="subscription"
|
||||||
@change="sub => subscription = sub"
|
@update:model-value="sub => subscription = sub"
|
||||||
type="dropdown"
|
type="dropdown"
|
||||||
/>
|
/>
|
||||||
<dropdown-item
|
<dropdown-item
|
||||||
|
@ -59,7 +60,8 @@ import {ref, onMounted, type PropType} from 'vue'
|
||||||
import Dropdown from '@/components/misc/dropdown.vue'
|
import Dropdown from '@/components/misc/dropdown.vue'
|
||||||
import DropdownItem from '@/components/misc/dropdown-item.vue'
|
import DropdownItem from '@/components/misc/dropdown-item.vue'
|
||||||
import TaskSubscription from '@/components/misc/subscription.vue'
|
import TaskSubscription from '@/components/misc/subscription.vue'
|
||||||
import type { INamespace } from '@/models/namespace'
|
import type {INamespace} from '@/modelTypes/INamespace'
|
||||||
|
import type {ISubscription} from '@/modelTypes/ISubscription'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
namespace: {
|
namespace: {
|
||||||
|
@ -68,7 +70,7 @@ const props = defineProps({
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const subscription = ref(null)
|
const subscription = ref<ISubscription | null>(null)
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
subscription.value = props.namespace.subscription
|
subscription.value = props.namespace.subscription
|
||||||
})
|
})
|
||||||
|
|
|
@ -70,6 +70,9 @@ import {getHistory} from '@/modules/listHistory'
|
||||||
import {parseTaskText, PrefixMode} from '@/modules/parseTaskText'
|
import {parseTaskText, PrefixMode} from '@/modules/parseTaskText'
|
||||||
import {getQuickAddMagicMode} from '@/helpers/quickAddMagicMode'
|
import {getQuickAddMagicMode} from '@/helpers/quickAddMagicMode'
|
||||||
import {PREFIXES} from '@/modules/parseTaskText'
|
import {PREFIXES} from '@/modules/parseTaskText'
|
||||||
|
import {useListStore} from '@/stores/lists'
|
||||||
|
import {useNamespaceStore} from '@/stores/namespaces'
|
||||||
|
import {useLabelStore} from '@/stores/labels'
|
||||||
|
|
||||||
const TYPE_LIST = 'list'
|
const TYPE_LIST = 'list'
|
||||||
const TYPE_TASK = 'task'
|
const TYPE_TASK = 'task'
|
||||||
|
@ -116,6 +119,8 @@ export default defineComponent({
|
||||||
},
|
},
|
||||||
results() {
|
results() {
|
||||||
let lists = []
|
let lists = []
|
||||||
|
const listStore = useListStore()
|
||||||
|
|
||||||
if (this.searchMode === SEARCH_MODE_ALL || this.searchMode === SEARCH_MODE_LISTS) {
|
if (this.searchMode === SEARCH_MODE_ALL || this.searchMode === SEARCH_MODE_LISTS) {
|
||||||
const {list} = this.parsedQuery
|
const {list} = this.parsedQuery
|
||||||
|
|
||||||
|
@ -126,10 +131,8 @@ export default defineComponent({
|
||||||
const history = getHistory()
|
const history = getHistory()
|
||||||
// Puts recently visited lists at the top
|
// Puts recently visited lists at the top
|
||||||
const allLists = [...new Set([
|
const allLists = [...new Set([
|
||||||
...history.map(l => {
|
...history.map(l => listStore.getListById(l.id)),
|
||||||
return this.$store.getters['lists/getListById'](l.id)
|
...listStore.searchList(list),
|
||||||
}),
|
|
||||||
...this.$store.getters['lists/searchList'](list),
|
|
||||||
])]
|
])]
|
||||||
|
|
||||||
lists = allLists.filter(l => {
|
lists = allLists.filter(l => {
|
||||||
|
@ -138,7 +141,7 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof ncache[l.namespaceId] === 'undefined') {
|
if (typeof ncache[l.namespaceId] === 'undefined') {
|
||||||
ncache[l.namespaceId] = this.$store.getters['namespaces/getNamespaceById'](l.namespaceId)
|
ncache[l.namespaceId] = useNamespaceStore().getNamespaceById(l.namespaceId)
|
||||||
}
|
}
|
||||||
|
|
||||||
return !ncache[l.namespaceId].isArchived
|
return !ncache[l.namespaceId].isArchived
|
||||||
|
@ -205,7 +208,7 @@ export default defineComponent({
|
||||||
case CMD_NEW_TASK:
|
case CMD_NEW_TASK:
|
||||||
return this.$t('quickActions.createTask', {title: this.currentList.title})
|
return this.$t('quickActions.createTask', {title: this.currentList.title})
|
||||||
case CMD_NEW_LIST:
|
case CMD_NEW_LIST:
|
||||||
namespace = this.$store.getters['namespaces/getNamespaceById'](this.currentList.namespaceId)
|
namespace = useNamespaceStore().getNamespaceById(this.currentList.namespaceId)
|
||||||
return this.$t('quickActions.createList', {title: namespace.title})
|
return this.$t('quickActions.createList', {title: namespace.title})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -296,8 +299,10 @@ export default defineComponent({
|
||||||
filter_comparator: [],
|
filter_comparator: [],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const listStore = useListStore()
|
||||||
|
|
||||||
if (list !== null) {
|
if (list !== null) {
|
||||||
const l = this.$store.getters['lists/findListByExactname'](list)
|
const l = listStore.findListByExactname(list)
|
||||||
if (l !== null) {
|
if (l !== null) {
|
||||||
params.filter_by.push('list_id')
|
params.filter_by.push('list_id')
|
||||||
params.filter_value.push(l.id)
|
params.filter_value.push(l.id)
|
||||||
|
@ -306,7 +311,7 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (labels.length > 0) {
|
if (labels.length > 0) {
|
||||||
const labelIds = this.$store.getters['labels/getLabelsByExactTitles'](labels).map(l => l.id)
|
const labelIds = useLabelStore().getLabelsByExactTitles(labels).map(l => l.id)
|
||||||
if (labelIds.length > 0) {
|
if (labelIds.length > 0) {
|
||||||
params.filter_by.push('labels')
|
params.filter_by.push('labels')
|
||||||
params.filter_value.push(labelIds.join())
|
params.filter_value.push(labelIds.join())
|
||||||
|
@ -318,7 +323,7 @@ export default defineComponent({
|
||||||
const r = await this.taskService.getAll({}, params)
|
const r = await this.taskService.getAll({}, params)
|
||||||
this.foundTasks = r.map(t => {
|
this.foundTasks = r.map(t => {
|
||||||
t.type = TYPE_TASK
|
t.type = TYPE_TASK
|
||||||
const list = this.$store.getters['lists/getListById'](t.listId)
|
const list = listStore.getListById(t.listId)
|
||||||
if (list !== null) {
|
if (list !== null) {
|
||||||
t.title = `${t.title} (${list.title})`
|
t.title = `${t.title} (${list.title})`
|
||||||
}
|
}
|
||||||
|
@ -424,7 +429,8 @@ export default defineComponent({
|
||||||
title: this.query,
|
title: this.query,
|
||||||
namespaceId: this.currentList.namespaceId,
|
namespaceId: this.currentList.namespaceId,
|
||||||
})
|
})
|
||||||
const list = await this.$store.dispatch('lists/createList', newList)
|
const listStore = useListStore()
|
||||||
|
const list = await listStore.createList(newList)
|
||||||
this.$message.success({message: this.$t('list.create.createdSuccess')})
|
this.$message.success({message: this.$t('list.create.createdSuccess')})
|
||||||
this.$router.push({name: 'list.index', params: {listId: list.id}})
|
this.$router.push({name: 'list.index', params: {listId: list.id}})
|
||||||
this.closeQuickActions()
|
this.closeQuickActions()
|
||||||
|
@ -432,7 +438,7 @@ export default defineComponent({
|
||||||
async newNamespace() {
|
async newNamespace() {
|
||||||
const newNamespace = new NamespaceModel({title: this.query})
|
const newNamespace = new NamespaceModel({title: this.query})
|
||||||
|
|
||||||
await this.$store.dispatch('namespaces/createNamespace', newNamespace)
|
await useNamespaceStore().createNamespace(newNamespace)
|
||||||
this.$message.success({message: this.$t('namespace.create.success')})
|
this.$message.success({message: this.$t('namespace.create.success')})
|
||||||
this.closeQuickActions()
|
this.closeQuickActions()
|
||||||
},
|
},
|
||||||
|
|
|
@ -79,30 +79,59 @@
|
||||||
>
|
>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{{ $t('list.share.attributes.link') }}</th>
|
<th></th>
|
||||||
<th>{{ $t('list.share.attributes.name') }}</th>
|
<th>{{ $t('list.share.links.view') }}</th>
|
||||||
<th>{{ $t('list.share.attributes.sharedBy') }}</th>
|
|
||||||
<th>{{ $t('list.share.attributes.right') }}</th>
|
|
||||||
<th>{{ $t('list.share.attributes.delete') }}</th>
|
<th>{{ $t('list.share.attributes.delete') }}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr :key="s.id" v-for="s in linkShares">
|
<tr :key="s.id" v-for="s in linkShares">
|
||||||
<td>
|
<td>
|
||||||
|
<p class="mb-2 is-italic" v-if="s.name !== ''">
|
||||||
|
{{ s.name }}
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p class="mb-2">
|
||||||
|
<i18n-t keypath="list.share.links.sharedBy">
|
||||||
|
<strong>{{ s.sharedBy.getDisplayName() }}</strong>
|
||||||
|
</i18n-t>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p class="mb-2">
|
||||||
|
<template v-if="s.right === RIGHTS.ADMIN">
|
||||||
|
<span class="icon is-small">
|
||||||
|
<icon icon="lock"/>
|
||||||
|
</span>
|
||||||
|
{{ $t('list.share.right.admin') }}
|
||||||
|
</template>
|
||||||
|
<template v-else-if="s.right === RIGHTS.READ_WRITE">
|
||||||
|
<span class="icon is-small">
|
||||||
|
<icon icon="pen"/>
|
||||||
|
</span>
|
||||||
|
{{ $t('list.share.right.readWrite') }}
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<span class="icon is-small">
|
||||||
|
<icon icon="users"/>
|
||||||
|
</span>
|
||||||
|
{{ $t('list.share.right.read') }}
|
||||||
|
</template>
|
||||||
|
</p>
|
||||||
|
|
||||||
<div class="field has-addons no-input-mobile">
|
<div class="field has-addons no-input-mobile">
|
||||||
<div class="control">
|
<div class="control">
|
||||||
<input
|
<input
|
||||||
:value="getShareLink(s.hash)"
|
:value="getShareLink(s.hash, selectedView[s.id])"
|
||||||
class="input"
|
class="input"
|
||||||
readonly
|
readonly
|
||||||
type="text"
|
type="text"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="control">
|
<div class="control">
|
||||||
<x-button
|
<x-button
|
||||||
@click="copy(getShareLink(s.hash))"
|
@click="copy(getShareLink(s.hash, selectedView[s.id]))"
|
||||||
:shadow="false"
|
:shadow="false"
|
||||||
v-tooltip="$t('misc.copy')"
|
v-tooltip="$t('misc.copy')"
|
||||||
>
|
>
|
||||||
<span class="icon">
|
<span class="icon">
|
||||||
<icon icon="paste"/>
|
<icon icon="paste"/>
|
||||||
|
@ -112,33 +141,16 @@
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<template v-if="s.name !== ''">
|
<div class="select">
|
||||||
{{ s.name }}
|
<select v-model="selectedView[s.id]">
|
||||||
</template>
|
<option
|
||||||
<i v-else>{{ $t('list.share.links.noName') }}</i>
|
v-for="(title, key) in availableViews"
|
||||||
</td>
|
:value="key"
|
||||||
<td>
|
:key="key">
|
||||||
{{ s.sharedBy.getDisplayName() }}
|
{{ title }}
|
||||||
</td>
|
</option>
|
||||||
<td class="type">
|
</select>
|
||||||
<template v-if="s.right === RIGHTS.ADMIN">
|
</div>
|
||||||
<span class="icon is-small">
|
|
||||||
<icon icon="lock"/>
|
|
||||||
</span>
|
|
||||||
{{ $t('list.share.right.admin') }}
|
|
||||||
</template>
|
|
||||||
<template v-else-if="s.right === RIGHTS.READ_WRITE">
|
|
||||||
<span class="icon is-small">
|
|
||||||
<icon icon="pen"/>
|
|
||||||
</span>
|
|
||||||
{{ $t('list.share.right.readWrite') }}
|
|
||||||
</template>
|
|
||||||
<template v-else>
|
|
||||||
<span class="icon is-small">
|
|
||||||
<icon icon="users"/>
|
|
||||||
</span>
|
|
||||||
{{ $t('list.share.right.read') }}
|
|
||||||
</template>
|
|
||||||
</td>
|
</td>
|
||||||
<td class="actions">
|
<td class="actions">
|
||||||
<x-button
|
<x-button
|
||||||
|
@ -166,7 +178,7 @@
|
||||||
<template #header>
|
<template #header>
|
||||||
<span>{{ $t('list.share.links.remove') }}</span>
|
<span>{{ $t('list.share.links.remove') }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #text>
|
<template #text>
|
||||||
<p>{{ $t('list.share.links.removeText') }}</p>
|
<p>{{ $t('list.share.links.removeText') }}</p>
|
||||||
</template>
|
</template>
|
||||||
|
@ -177,17 +189,21 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {ref, watch, computed, shallowReactive} from 'vue'
|
import {ref, watch, computed, shallowReactive} from 'vue'
|
||||||
import {useStore} from '@/store'
|
|
||||||
import {useI18n} from 'vue-i18n'
|
import {useI18n} from 'vue-i18n'
|
||||||
|
|
||||||
import {RIGHTS} from '@/constants/rights'
|
import {RIGHTS} from '@/constants/rights'
|
||||||
import LinkShareModel, { type ILinkShare } from '@/models/linkShare'
|
import LinkShareModel from '@/models/linkShare'
|
||||||
|
|
||||||
|
import type {ILinkShare} from '@/modelTypes/ILinkShare'
|
||||||
|
import type {IList} from '@/modelTypes/IList'
|
||||||
|
|
||||||
import LinkShareService from '@/services/linkShare'
|
import LinkShareService from '@/services/linkShare'
|
||||||
|
|
||||||
import {useCopyToClipboard} from '@/composables/useCopyToClipboard'
|
import {useCopyToClipboard} from '@/composables/useCopyToClipboard'
|
||||||
import {success} from '@/message'
|
import {success} from '@/message'
|
||||||
import type { IList } from '@/models/list'
|
import type {ListView} from '@/types/ListView'
|
||||||
|
import {LIST_VIEWS} from '@/types/ListView'
|
||||||
|
import {useConfigStore} from '@/stores/config'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
listId: {
|
listId: {
|
||||||
|
@ -207,6 +223,17 @@ const showDeleteModal = ref(false)
|
||||||
const linkIdToDelete = ref(0)
|
const linkIdToDelete = ref(0)
|
||||||
const showNewForm = ref(false)
|
const showNewForm = ref(false)
|
||||||
|
|
||||||
|
type SelectedViewMapper = Record<IList['id'], ListView>
|
||||||
|
|
||||||
|
const selectedView = ref<SelectedViewMapper>({})
|
||||||
|
|
||||||
|
const availableViews = computed<Record<ListView, string>>(() => ({
|
||||||
|
list: t('list.list.title'),
|
||||||
|
gantt: t('list.gantt.title'),
|
||||||
|
table: t('list.table.title'),
|
||||||
|
kanban: t('list.kanban.title'),
|
||||||
|
}))
|
||||||
|
|
||||||
const copy = useCopyToClipboard()
|
const copy = useCopyToClipboard()
|
||||||
watch(
|
watch(
|
||||||
() => props.listId,
|
() => props.listId,
|
||||||
|
@ -214,8 +241,8 @@ watch(
|
||||||
{immediate: true},
|
{immediate: true},
|
||||||
)
|
)
|
||||||
|
|
||||||
const store = useStore()
|
const configStore = useConfigStore()
|
||||||
const frontendUrl = computed(() => store.state.config.frontendUrl)
|
const frontendUrl = computed(() => configStore.frontendUrl)
|
||||||
|
|
||||||
async function load(listId: IList['id']) {
|
async function load(listId: IList['id']) {
|
||||||
// If listId == 0 the list on the calling component wasn't already loaded, so we just bail out here
|
// If listId == 0 the list on the calling component wasn't already loaded, so we just bail out here
|
||||||
|
@ -223,7 +250,11 @@ async function load(listId: IList['id']) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
linkShares.value = await linkShareService.getAll({listId})
|
const links = await linkShareService.getAll({listId})
|
||||||
|
links.forEach((l: ILinkShare) => {
|
||||||
|
selectedView.value[l.id] = 'list'
|
||||||
|
})
|
||||||
|
linkShares.value = links
|
||||||
}
|
}
|
||||||
|
|
||||||
async function add(listId: IList['id']) {
|
async function add(listId: IList['id']) {
|
||||||
|
@ -255,15 +286,15 @@ async function remove(listId: IList['id']) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getShareLink(hash: string) {
|
function getShareLink(hash: string, view: ListView = LIST_VIEWS.LIST) {
|
||||||
return frontendUrl.value + 'share/' + hash + '/auth'
|
return frontendUrl.value + 'share/' + hash + '/auth?view=' + view
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
// FIXME: I think this is not needed
|
// FIXME: I think this is not needed
|
||||||
.sharables-list:not(.card-content) {
|
.sharables-list:not(.card-content) {
|
||||||
overflow-y: auto
|
overflow-y: auto
|
||||||
}
|
}
|
||||||
|
|
||||||
@include modal-transition();
|
@include modal-transition();
|
||||||
|
|
|
@ -143,22 +143,29 @@ import {useStore} from '@/store'
|
||||||
import {useI18n} from 'vue-i18n'
|
import {useI18n} from 'vue-i18n'
|
||||||
|
|
||||||
import UserNamespaceService from '@/services/userNamespace'
|
import UserNamespaceService from '@/services/userNamespace'
|
||||||
import UserNamespaceModel, { type IUserNamespace } from '@/models/userNamespace'
|
import UserNamespaceModel from '@/models/userNamespace'
|
||||||
|
import type {IUserNamespace} from '@/modelTypes/IUserNamespace'
|
||||||
|
|
||||||
import UserListService from '@/services/userList'
|
import UserListService from '@/services/userList'
|
||||||
import UserListModel, { type IUserList } from '@/models/userList'
|
import UserListModel from '@/models/userList'
|
||||||
|
import type {IUserList} from '@/modelTypes/IUserList'
|
||||||
|
|
||||||
import UserService from '@/services/user'
|
import UserService from '@/services/user'
|
||||||
import UserModel, { type IUser } from '@/models/user'
|
import UserModel from '@/models/user'
|
||||||
|
import type {IUser} from '@/modelTypes/IUser'
|
||||||
|
|
||||||
import TeamNamespaceService from '@/services/teamNamespace'
|
import TeamNamespaceService from '@/services/teamNamespace'
|
||||||
import TeamNamespaceModel, { type ITeamNamespace } from '@/models/teamNamespace'
|
import TeamNamespaceModel from '@/models/teamNamespace'
|
||||||
|
import type { ITeamNamespace } from '@/modelTypes/ITeamNamespace'
|
||||||
|
|
||||||
import TeamListService from '@/services/teamList'
|
import TeamListService from '@/services/teamList'
|
||||||
import TeamListModel, { type ITeamList } from '@/models/teamList'
|
import TeamListModel from '@/models/teamList'
|
||||||
|
import type { ITeamList } from '@/modelTypes/ITeamList'
|
||||||
|
|
||||||
import TeamService from '@/services/team'
|
import TeamService from '@/services/team'
|
||||||
import TeamModel, { type ITeam } from '@/models/team'
|
import TeamModel from '@/models/team'
|
||||||
|
import type {ITeam} from '@/modelTypes/ITeam'
|
||||||
|
|
||||||
|
|
||||||
import {RIGHTS} from '@/constants/rights'
|
import {RIGHTS} from '@/constants/rights'
|
||||||
import Multiselect from '@/components/input/multiselect.vue'
|
import Multiselect from '@/components/input/multiselect.vue'
|
||||||
|
@ -235,6 +242,7 @@ const sharableName = computed(() => {
|
||||||
|
|
||||||
if (props.shareType === 'user') {
|
if (props.shareType === 'user') {
|
||||||
searchService = shallowReactive(new UserService())
|
searchService = shallowReactive(new UserService())
|
||||||
|
// eslint-disable-next-line vue/no-ref-as-operand
|
||||||
sharable = ref(new UserModel())
|
sharable = ref(new UserModel())
|
||||||
searchLabel.value = 'username'
|
searchLabel.value = 'username'
|
||||||
|
|
||||||
|
@ -251,6 +259,7 @@ if (props.shareType === 'user') {
|
||||||
}
|
}
|
||||||
} else if (props.shareType === 'team') {
|
} else if (props.shareType === 'team') {
|
||||||
searchService = new TeamService()
|
searchService = new TeamService()
|
||||||
|
// eslint-disable-next-line vue/no-ref-as-operand
|
||||||
sharable = ref(new TeamModel())
|
sharable = ref(new TeamModel())
|
||||||
searchLabel.value = 'name'
|
searchLabel.value = 'name'
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<div class="field is-grouped">
|
<div class="field is-grouped">
|
||||||
<p class="control has-icons-left is-expanded">
|
<p class="control has-icons-left is-expanded">
|
||||||
<textarea
|
<textarea
|
||||||
:disabled="taskService.loading || undefined"
|
:disabled="loading || undefined"
|
||||||
class="add-task-textarea input"
|
class="add-task-textarea input"
|
||||||
:class="{'textarea-empty': newTaskTitle === ''}"
|
:class="{'textarea-empty': newTaskTitle === ''}"
|
||||||
:placeholder="$t('list.list.addPlaceholder')"
|
:placeholder="$t('list.list.addPlaceholder')"
|
||||||
|
@ -21,10 +21,10 @@
|
||||||
<p class="control">
|
<p class="control">
|
||||||
<x-button
|
<x-button
|
||||||
class="add-task-button"
|
class="add-task-button"
|
||||||
:disabled="newTaskTitle === '' || taskService.loading || undefined"
|
:disabled="newTaskTitle === '' || loading || undefined"
|
||||||
@click="addTask()"
|
@click="addTask()"
|
||||||
icon="plus"
|
icon="plus"
|
||||||
:loading="taskService.loading"
|
:loading="loading"
|
||||||
:aria-label="$t('list.list.add')"
|
:aria-label="$t('list.list.add')"
|
||||||
>
|
>
|
||||||
<span class="button-text">
|
<span class="button-text">
|
||||||
|
@ -41,13 +41,13 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {ref, watch, unref, shallowReactive} from 'vue'
|
import {ref, watch, unref, computed} from 'vue'
|
||||||
import {useI18n} from 'vue-i18n'
|
import {useI18n} from 'vue-i18n'
|
||||||
import {useStore} from '@/store'
|
import {useStore} from '@/store'
|
||||||
import {tryOnMounted, debouncedWatch, useWindowSize, type MaybeRef} from '@vueuse/core'
|
import {tryOnMounted, debouncedWatch, useWindowSize, type MaybeRef} from '@vueuse/core'
|
||||||
|
|
||||||
import TaskService from '@/services/task'
|
|
||||||
import QuickAddMagic from '@/components/tasks/partials/quick-add-magic.vue'
|
import QuickAddMagic from '@/components/tasks/partials/quick-add-magic.vue'
|
||||||
|
import {LOADING, LOADING_MODULE} from '@/store/mutation-types'
|
||||||
|
|
||||||
function cleanupTitle(title: string) {
|
function cleanupTitle(title: string) {
|
||||||
return title.replace(/^((\* |\+ |- )(\[ \] )?)/g, '')
|
return title.replace(/^((\* |\+ |- )(\[ \] )?)/g, '')
|
||||||
|
@ -136,7 +136,6 @@ const newTaskInput = useAutoHeightTextarea(newTaskTitle)
|
||||||
const {t} = useI18n({useScope: 'global'})
|
const {t} = useI18n({useScope: 'global'})
|
||||||
const store = useStore()
|
const store = useStore()
|
||||||
|
|
||||||
const taskService = shallowReactive(new TaskService())
|
|
||||||
const errorMessage = ref('')
|
const errorMessage = ref('')
|
||||||
|
|
||||||
function resetEmptyTitleError(e) {
|
function resetEmptyTitleError(e) {
|
||||||
|
@ -148,6 +147,7 @@ function resetEmptyTitleError(e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const loading = computed(() => store.state[LOADING] && store.state[LOADING_MODULE] === 'tasks')
|
||||||
async function addTask() {
|
async function addTask() {
|
||||||
if (newTaskTitle.value === '') {
|
if (newTaskTitle.value === '') {
|
||||||
errorMessage.value = t('list.create.addTitleRequired')
|
errorMessage.value = t('list.create.addTitleRequired')
|
||||||
|
@ -155,7 +155,7 @@ async function addTask() {
|
||||||
}
|
}
|
||||||
errorMessage.value = ''
|
errorMessage.value = ''
|
||||||
|
|
||||||
if (taskService.loading) {
|
if (loading.value) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -214,7 +214,7 @@ defineExpose({
|
||||||
}
|
}
|
||||||
|
|
||||||
.add-task-button {
|
.add-task-button {
|
||||||
height: 2.5rem;
|
height: 100% !important;
|
||||||
|
|
||||||
@media screen and (max-width: $mobile) {
|
@media screen and (max-width: $mobile) {
|
||||||
.button-text {
|
.button-text {
|
||||||
|
|
|
@ -36,8 +36,8 @@
|
||||||
|
|
||||||
<strong>{{ $t('task.attributes.reminders') }}</strong>
|
<strong>{{ $t('task.attributes.reminders') }}</strong>
|
||||||
<reminders
|
<reminders
|
||||||
@change="editTaskSubmit()"
|
|
||||||
v-model="taskEditTask.reminderDates"
|
v-model="taskEditTask.reminderDates"
|
||||||
|
@update:model-value="editTaskSubmit()"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div class="field">
|
<div class="field">
|
||||||
|
@ -83,7 +83,8 @@ import {useI18n} from 'vue-i18n'
|
||||||
import Editor from '@/components/input/AsyncEditor'
|
import Editor from '@/components/input/AsyncEditor'
|
||||||
|
|
||||||
import TaskService from '@/services/task'
|
import TaskService from '@/services/task'
|
||||||
import TaskModel, { type ITask } from '@/models/task'
|
import TaskModel from '@/models/task'
|
||||||
|
import type {ITask} from '@/modelTypes/ITask'
|
||||||
import EditLabels from './partials/editLabels.vue'
|
import EditLabels from './partials/editLabels.vue'
|
||||||
import Reminders from './partials/reminders.vue'
|
import Reminders from './partials/reminders.vue'
|
||||||
import ColorPicker from '../input/colorPicker.vue'
|
import ColorPicker from '../input/colorPicker.vue'
|
||||||
|
|
|
@ -8,19 +8,19 @@
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
<input
|
<input
|
||||||
|
v-if="editEnabled"
|
||||||
:disabled="attachmentService.loading || undefined"
|
:disabled="attachmentService.loading || undefined"
|
||||||
@change="uploadNewAttachment()"
|
@change="uploadNewAttachment()"
|
||||||
id="files"
|
id="files"
|
||||||
multiple
|
multiple
|
||||||
ref="files"
|
ref="filesRef"
|
||||||
type="file"
|
type="file"
|
||||||
v-if="editEnabled"
|
|
||||||
/>
|
/>
|
||||||
<progress
|
<progress
|
||||||
|
v-if="attachmentService.uploadProgress > 0"
|
||||||
:value="attachmentService.uploadProgress"
|
:value="attachmentService.uploadProgress"
|
||||||
class="progress is-primary"
|
class="progress is-primary"
|
||||||
max="100"
|
max="100"
|
||||||
v-if="attachmentService.uploadProgress > 0"
|
|
||||||
>
|
>
|
||||||
{{ attachmentService.uploadProgress }}%
|
{{ attachmentService.uploadProgress }}%
|
||||||
</progress>
|
</progress>
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
<span v-tooltip="formatDateLong(a.created)">
|
<span v-tooltip="formatDateLong(a.created)">
|
||||||
{{ formatDateSince(a.created) }}
|
{{ formatDateSince(a.created) }}
|
||||||
</span>
|
</span>
|
||||||
<user
|
<User
|
||||||
:avatar-size="24"
|
:avatar-size="24"
|
||||||
:user="a.createdBy"
|
:user="a.createdBy"
|
||||||
:is-inline="true"
|
:is-inline="true"
|
||||||
|
@ -73,7 +73,7 @@
|
||||||
<BaseButton
|
<BaseButton
|
||||||
v-if="editEnabled"
|
v-if="editEnabled"
|
||||||
class="attachment-info-meta-button"
|
class="attachment-info-meta-button"
|
||||||
@click.prevent.stop="() => {attachmentToDelete = a; showDeleteModal = true}"
|
@click.prevent.stop="setAttachmentToDelete(a)"
|
||||||
v-tooltip="$t('task.attachment.deleteTooltip')"
|
v-tooltip="$t('task.attachment.deleteTooltip')"
|
||||||
>
|
>
|
||||||
{{ $t('misc.delete') }}
|
{{ $t('misc.delete') }}
|
||||||
|
@ -86,7 +86,7 @@
|
||||||
<x-button
|
<x-button
|
||||||
v-if="editEnabled"
|
v-if="editEnabled"
|
||||||
:disabled="attachmentService.loading"
|
:disabled="attachmentService.loading"
|
||||||
@click="$refs.files.click()"
|
@click="filesRef?.click()"
|
||||||
class="mb-4"
|
class="mb-4"
|
||||||
icon="cloud-upload-alt"
|
icon="cloud-upload-alt"
|
||||||
variant="secondary"
|
variant="secondary"
|
||||||
|
@ -97,7 +97,7 @@
|
||||||
|
|
||||||
<!-- Dropzone -->
|
<!-- Dropzone -->
|
||||||
<div
|
<div
|
||||||
:class="{ hidden: !showDropzone }"
|
:class="{ hidden: !isOverDropZone }"
|
||||||
class="dropzone"
|
class="dropzone"
|
||||||
v-if="editEnabled"
|
v-if="editEnabled"
|
||||||
>
|
>
|
||||||
|
@ -110,269 +110,229 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Delete modal -->
|
<!-- Delete modal -->
|
||||||
<transition name="modal">
|
<modal
|
||||||
<modal
|
v-if="attachmentToDelete !== null"
|
||||||
@close="showDeleteModal = false"
|
@close="setAttachmentToDelete(null)"
|
||||||
v-if="showDeleteModal"
|
@submit="deleteAttachment()"
|
||||||
@submit="deleteAttachment()"
|
>
|
||||||
>
|
<template #header>
|
||||||
<template #header><span>{{ $t('task.attachment.delete') }}</span></template>
|
<span>{{ $t('task.attachment.delete') }}</span>
|
||||||
|
</template>
|
||||||
<template #text>
|
|
||||||
<p>
|
<template #text>
|
||||||
{{ $t('task.attachment.deleteText1', {filename: attachmentToDelete.file.name}) }}<br/>
|
<p>
|
||||||
<strong class="has-text-white">{{ $t('misc.cannotBeUndone') }}</strong>
|
{{ $t('task.attachment.deleteText1', {filename: attachmentToDelete.file.name}) }}<br/>
|
||||||
</p>
|
<strong class="has-text-white">{{ $t('misc.cannotBeUndone') }}</strong>
|
||||||
</template>
|
</p>
|
||||||
</modal>
|
</template>
|
||||||
</transition>
|
</modal>
|
||||||
|
|
||||||
<transition name="modal">
|
<!-- Attachment image modal -->
|
||||||
<modal
|
<modal
|
||||||
@close="
|
v-if="attachmentImageBlobUrl !== null"
|
||||||
() => {
|
@close="attachmentImageBlobUrl = null"
|
||||||
showImageModal = false
|
>
|
||||||
attachmentImageBlobUrl = null
|
<img :src="attachmentImageBlobUrl" alt=""/>
|
||||||
}
|
</modal>
|
||||||
"
|
|
||||||
v-if="showImageModal"
|
|
||||||
>
|
|
||||||
<img :src="attachmentImageBlobUrl" alt=""/>
|
|
||||||
</modal>
|
|
||||||
</transition>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script setup lang="ts">
|
||||||
import {defineComponent} from 'vue'
|
import {ref, shallowReactive, computed, type PropType} from 'vue'
|
||||||
|
import {useDropZone} from '@vueuse/core'
|
||||||
|
|
||||||
import AttachmentService from '../../../services/attachment'
|
|
||||||
import AttachmentModel, { type IAttachment } from '@/models/attachment'
|
|
||||||
import User from '@/components/misc/user.vue'
|
import User from '@/components/misc/user.vue'
|
||||||
import {mapState} from 'vuex'
|
import BaseButton from '@/components/base/BaseButton.vue'
|
||||||
|
|
||||||
import { useCopyToClipboard } from '@/composables/useCopyToClipboard'
|
import AttachmentService from '@/services/attachment'
|
||||||
import { uploadFiles, generateAttachmentUrl } from '@/helpers/attachments'
|
import type AttachmentModel from '@/models/attachment'
|
||||||
import {formatDate, formatDateSince, formatDateLong} from '@/helpers/time/formatDate'
|
import type {IAttachment} from '@/modelTypes/IAttachment'
|
||||||
|
import type {ITask} from '@/modelTypes/ITask'
|
||||||
|
|
||||||
import BaseButton from '@/components/base/BaseButton'
|
import {useAttachmentStore} from '@/stores/attachments'
|
||||||
import type { IFile } from '@/models/file'
|
import {formatDateSince, formatDateLong} from '@/helpers/time/formatDate'
|
||||||
import { getHumanSize } from '@/helpers/getHumanSize'
|
import {uploadFiles, generateAttachmentUrl} from '@/helpers/attachments'
|
||||||
|
import {getHumanSize} from '@/helpers/getHumanSize'
|
||||||
|
import {useCopyToClipboard} from '@/composables/useCopyToClipboard'
|
||||||
|
import {error, success} from '@/message'
|
||||||
|
|
||||||
export default defineComponent({
|
const props = defineProps({
|
||||||
name: 'attachments',
|
taskId: {
|
||||||
components: {
|
type: Number as PropType<ITask['id']>,
|
||||||
BaseButton,
|
required: true,
|
||||||
User,
|
|
||||||
},
|
},
|
||||||
data() {
|
initialAttachments: {
|
||||||
return {
|
type: Array,
|
||||||
attachmentService: new AttachmentService(),
|
|
||||||
showDropzone: false,
|
|
||||||
|
|
||||||
showDeleteModal: false,
|
|
||||||
attachmentToDelete: AttachmentModel,
|
|
||||||
|
|
||||||
showImageModal: false,
|
|
||||||
attachmentImageBlobUrl: null,
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
props: {
|
editEnabled: {
|
||||||
taskId: {
|
default: true,
|
||||||
required: true,
|
|
||||||
type: Number,
|
|
||||||
},
|
|
||||||
initialAttachments: {
|
|
||||||
type: Array,
|
|
||||||
},
|
|
||||||
editEnabled: {
|
|
||||||
default: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
setup(props) {
|
|
||||||
const copy = useCopyToClipboard()
|
|
||||||
|
|
||||||
function copyUrl(attachment: IAttachment) {
|
|
||||||
copy(generateAttachmentUrl(props.taskId, attachment.id))
|
|
||||||
}
|
|
||||||
|
|
||||||
return { copyUrl }
|
|
||||||
},
|
|
||||||
|
|
||||||
computed: mapState({
|
|
||||||
attachments: (state) => state.attachments.attachments,
|
|
||||||
}),
|
|
||||||
mounted() {
|
|
||||||
document.addEventListener('dragenter', (e) => {
|
|
||||||
e.stopPropagation()
|
|
||||||
e.preventDefault()
|
|
||||||
this.showDropzone = true
|
|
||||||
})
|
|
||||||
|
|
||||||
window.addEventListener('dragleave', (e) => {
|
|
||||||
e.stopPropagation()
|
|
||||||
e.preventDefault()
|
|
||||||
this.showDropzone = false
|
|
||||||
})
|
|
||||||
|
|
||||||
document.addEventListener('dragover', (e) => {
|
|
||||||
e.stopPropagation()
|
|
||||||
e.preventDefault()
|
|
||||||
this.showDropzone = true
|
|
||||||
})
|
|
||||||
|
|
||||||
document.addEventListener('drop', (e) => {
|
|
||||||
e.stopPropagation()
|
|
||||||
e.preventDefault()
|
|
||||||
|
|
||||||
let files = e.dataTransfer.files
|
|
||||||
this.uploadFiles(files)
|
|
||||||
this.showDropzone = false
|
|
||||||
})
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getHumanSize,
|
|
||||||
formatDate,
|
|
||||||
formatDateSince,
|
|
||||||
formatDateLong,
|
|
||||||
|
|
||||||
downloadAttachment(attachment: IAttachment) {
|
|
||||||
this.attachmentService.download(attachment)
|
|
||||||
},
|
|
||||||
uploadNewAttachment() {
|
|
||||||
if (this.$refs.files.files.length === 0) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
this.uploadFiles(this.$refs.files.files)
|
|
||||||
},
|
|
||||||
uploadFiles(files: IFile[]) {
|
|
||||||
uploadFiles(this.attachmentService, this.taskId, files)
|
|
||||||
},
|
|
||||||
async deleteAttachment() {
|
|
||||||
try {
|
|
||||||
const r = await this.attachmentService.delete(this.attachmentToDelete)
|
|
||||||
this.$store.commit(
|
|
||||||
'attachments/removeById',
|
|
||||||
this.attachmentToDelete.id,
|
|
||||||
)
|
|
||||||
this.$message.success(r)
|
|
||||||
} finally{
|
|
||||||
this.showDeleteModal = false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async viewOrDownload(attachment) {
|
|
||||||
if (
|
|
||||||
attachment.file.name.endsWith('.jpg') ||
|
|
||||||
attachment.file.name.endsWith('.png') ||
|
|
||||||
attachment.file.name.endsWith('.bmp') ||
|
|
||||||
attachment.file.name.endsWith('.gif')
|
|
||||||
) {
|
|
||||||
this.showImageModal = true
|
|
||||||
this.attachmentImageBlobUrl = await this.attachmentService.getBlobUrl(attachment)
|
|
||||||
} else {
|
|
||||||
this.downloadAttachment(attachment)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const attachmentService = shallowReactive(new AttachmentService())
|
||||||
|
|
||||||
|
const attachmentStore = useAttachmentStore()
|
||||||
|
const attachments = computed(() => attachmentStore.attachments)
|
||||||
|
|
||||||
|
function onDrop(files: File[] | null) {
|
||||||
|
if (files && files.length !== 0) {
|
||||||
|
uploadFilesToTask(files)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const { isOverDropZone } = useDropZone(document, onDrop)
|
||||||
|
|
||||||
|
function downloadAttachment(attachment: IAttachment) {
|
||||||
|
attachmentService.download(attachment)
|
||||||
|
}
|
||||||
|
|
||||||
|
const filesRef = ref<HTMLInputElement | null>(null)
|
||||||
|
function uploadNewAttachment() {
|
||||||
|
const files = filesRef.value?.files
|
||||||
|
|
||||||
|
if (!files || files.length === 0) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
uploadFilesToTask(files)
|
||||||
|
}
|
||||||
|
|
||||||
|
function uploadFilesToTask(files: File[] | FileList) {
|
||||||
|
uploadFiles(attachmentService, props.taskId, files)
|
||||||
|
}
|
||||||
|
|
||||||
|
const attachmentToDelete = ref<AttachmentModel | null>(null)
|
||||||
|
|
||||||
|
function setAttachmentToDelete(attachment: AttachmentModel | null) {
|
||||||
|
attachmentToDelete.value = attachment
|
||||||
|
}
|
||||||
|
|
||||||
|
async function deleteAttachment() {
|
||||||
|
if (attachmentToDelete.value === null) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const r = await attachmentService.delete(attachmentToDelete.value)
|
||||||
|
attachmentStore.removeById(this.attachmentToDelete.id)
|
||||||
|
success(r)
|
||||||
|
setAttachmentToDelete(null)
|
||||||
|
} catch(e) {
|
||||||
|
error(e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const attachmentImageBlobUrl = ref<string | null>(null)
|
||||||
|
const SUPPORTED_SUFFIX = ['.jpg', '.png', '.bmp', '.gif']
|
||||||
|
|
||||||
|
async function viewOrDownload(attachment: AttachmentModel) {
|
||||||
|
if (SUPPORTED_SUFFIX.some((suffix) => attachment.file.name.endsWith(suffix)) ) {
|
||||||
|
attachmentImageBlobUrl.value = await attachmentService.getBlobUrl(attachment)
|
||||||
|
} else {
|
||||||
|
downloadAttachment(attachment)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const copy = useCopyToClipboard()
|
||||||
|
function copyUrl(attachment: IAttachment) {
|
||||||
|
copy(generateAttachmentUrl(props.taskId, attachment.id))
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.attachments {
|
.attachments {
|
||||||
input[type=file] {
|
input[type=file] {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.files {
|
@media screen and (max-width: $tablet) {
|
||||||
margin-bottom: 1rem;
|
.button {
|
||||||
|
width: 100%;
|
||||||
.attachment {
|
|
||||||
margin-bottom: .5rem;
|
|
||||||
display: block;
|
|
||||||
transition: background-color $transition;
|
|
||||||
border-radius: $radius;
|
|
||||||
padding: .5rem;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
background-color: var(--grey-200);
|
|
||||||
}
|
|
||||||
|
|
||||||
.filename {
|
|
||||||
font-weight: bold;
|
|
||||||
margin-bottom: .25rem;
|
|
||||||
color: var(--text);
|
|
||||||
}
|
|
||||||
|
|
||||||
.info {
|
|
||||||
color: var(--grey-500);
|
|
||||||
font-size: .9rem;
|
|
||||||
|
|
||||||
p {
|
|
||||||
margin-bottom: 0;
|
|
||||||
display: flex;
|
|
||||||
|
|
||||||
> span:not(:last-child):after,
|
|
||||||
> button:not(:last-child):after {
|
|
||||||
content: '·';
|
|
||||||
padding: 0 .25rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media screen and (max-width: $tablet) {
|
|
||||||
.button {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.dropzone {
|
|
||||||
position: fixed;
|
|
||||||
background: rgba(250, 250, 250, 0.8);
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
bottom: 0;
|
|
||||||
right: 0;
|
|
||||||
z-index: 100;
|
|
||||||
text-align: center;
|
|
||||||
|
|
||||||
&.hidden {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.drop-hint {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
|
|
||||||
.icon {
|
|
||||||
width: 100%;
|
|
||||||
font-size: 5rem;
|
|
||||||
height: auto;
|
|
||||||
text-shadow: var(--shadow-md);
|
|
||||||
animation: bounce 2s infinite;
|
|
||||||
|
|
||||||
@media (prefers-reduced-motion: reduce) {
|
|
||||||
animation: none;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.hint {
|
.files {
|
||||||
margin: .5rem auto 2rem;
|
margin-bottom: 1rem;
|
||||||
border-radius: 2px;
|
}
|
||||||
box-shadow: var(--shadow-md);
|
|
||||||
background: var(--primary);
|
.attachment {
|
||||||
padding: 1rem;
|
margin-bottom: .5rem;
|
||||||
color: var(--white);
|
display: block;
|
||||||
width: 100%;
|
transition: background-color $transition;
|
||||||
max-width: 300px;
|
border-radius: $radius;
|
||||||
}
|
padding: .5rem;
|
||||||
}
|
|
||||||
}
|
&:hover {
|
||||||
|
background-color: var(--grey-200);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.filename {
|
||||||
|
font-weight: bold;
|
||||||
|
margin-bottom: .25rem;
|
||||||
|
color: var(--text);
|
||||||
|
}
|
||||||
|
|
||||||
|
.info {
|
||||||
|
color: var(--grey-500);
|
||||||
|
font-size: .9rem;
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin-bottom: 0;
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
> span:not(:last-child):after,
|
||||||
|
> button:not(:last-child):after {
|
||||||
|
content: '·';
|
||||||
|
padding: 0 .25rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropzone {
|
||||||
|
position: fixed;
|
||||||
|
background: rgba(250, 250, 250, 0.8);
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
bottom: 0;
|
||||||
|
right: 0;
|
||||||
|
z-index: 100;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
&.hidden {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.drop-hint {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
width: 100%;
|
||||||
|
font-size: 5rem;
|
||||||
|
height: auto;
|
||||||
|
text-shadow: var(--shadow-md);
|
||||||
|
animation: bounce 2s infinite;
|
||||||
|
|
||||||
|
@media (prefers-reduced-motion: reduce) {
|
||||||
|
animation: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.hint {
|
||||||
|
margin: .5rem auto 2rem;
|
||||||
|
border-radius: 2px;
|
||||||
|
box-shadow: var(--shadow-md);
|
||||||
|
background: var(--primary);
|
||||||
|
padding: 1rem;
|
||||||
|
color: var(--white);
|
||||||
|
width: 100%;
|
||||||
|
max-width: 300px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.attachment-info-meta {
|
.attachment-info-meta {
|
||||||
|
@ -409,29 +369,29 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes bounce {
|
@keyframes bounce {
|
||||||
from,
|
from,
|
||||||
20%,
|
20%,
|
||||||
53%,
|
53%,
|
||||||
80%,
|
80%,
|
||||||
to {
|
to {
|
||||||
animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
|
animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
|
||||||
transform: translate3d(0, 0, 0);
|
transform: translate3d(0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
40%,
|
40%,
|
||||||
43% {
|
43% {
|
||||||
animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
|
animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
|
||||||
transform: translate3d(0, -30px, 0);
|
transform: translate3d(0, -30px, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
70% {
|
70% {
|
||||||
animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
|
animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
|
||||||
transform: translate3d(0, -15px, 0);
|
transform: translate3d(0, -15px, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
90% {
|
90% {
|
||||||
transform: translate3d(0, -4px, 0);
|
transform: translate3d(0, -4px, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@include modal-transition();
|
@include modal-transition();
|
||||||
|
|
|
@ -14,7 +14,7 @@ import {computed, type PropType} from 'vue'
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
|
|
||||||
import {getChecklistStatistics} from '@/helpers/checklistFromText'
|
import {getChecklistStatistics} from '@/helpers/checklistFromText'
|
||||||
import type {ITask} from '@/models/task'
|
import type {ITask} from '@/modelTypes/ITask'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
task: {
|
task: {
|
||||||
|
|
|
@ -70,13 +70,13 @@
|
||||||
:is-edit-enabled="canWrite && c.author.id === currentUserId"
|
:is-edit-enabled="canWrite && c.author.id === currentUserId"
|
||||||
:upload-callback="attachmentUpload"
|
:upload-callback="attachmentUpload"
|
||||||
:upload-enabled="true"
|
:upload-enabled="true"
|
||||||
@change="
|
v-model="c.comment"
|
||||||
|
@update:model-value="
|
||||||
() => {
|
() => {
|
||||||
toggleEdit(c)
|
toggleEdit(c)
|
||||||
editComment()
|
editComment()
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
v-model="c.comment"
|
|
||||||
:bottom-actions="actions[c.id]"
|
:bottom-actions="actions[c.id]"
|
||||||
:show-save="true"
|
:show-save="true"
|
||||||
/>
|
/>
|
||||||
|
@ -159,12 +159,16 @@ import {useI18n} from 'vue-i18n'
|
||||||
import Editor from '@/components/input/AsyncEditor'
|
import Editor from '@/components/input/AsyncEditor'
|
||||||
|
|
||||||
import TaskCommentService from '@/services/taskComment'
|
import TaskCommentService from '@/services/taskComment'
|
||||||
import TaskCommentModel, { type ITaskComment } from '@/models/taskComment'
|
import TaskCommentModel from '@/models/taskComment'
|
||||||
|
|
||||||
|
import type {ITaskComment} from '@/modelTypes/ITaskComment'
|
||||||
|
import type {ITask} from '@/modelTypes/ITask'
|
||||||
|
|
||||||
import {uploadFile} from '@/helpers/attachments'
|
import {uploadFile} from '@/helpers/attachments'
|
||||||
import {success} from '@/message'
|
import {success} from '@/message'
|
||||||
import {formatDateLong, formatDateSince} from '@/helpers/time/formatDate'
|
import {formatDateLong, formatDateSince} from '@/helpers/time/formatDate'
|
||||||
|
import {useConfigStore} from '@/stores/config'
|
||||||
|
|
||||||
import type { ITask } from '@/models/task'
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
taskId: {
|
taskId: {
|
||||||
type: Number,
|
type: Number,
|
||||||
|
@ -177,6 +181,7 @@ const props = defineProps({
|
||||||
|
|
||||||
const {t} = useI18n({useScope: 'global'})
|
const {t} = useI18n({useScope: 'global'})
|
||||||
const store = useStore()
|
const store = useStore()
|
||||||
|
const configStore = useConfigStore()
|
||||||
|
|
||||||
const comments = ref<ITaskComment[]>([])
|
const comments = ref<ITaskComment[]>([])
|
||||||
|
|
||||||
|
@ -193,7 +198,7 @@ const saving = ref<ITask['id'] | null>(null)
|
||||||
|
|
||||||
const userAvatar = computed(() => store.state.auth.info.getAvatarUrl(48))
|
const userAvatar = computed(() => store.state.auth.info.getAvatarUrl(48))
|
||||||
const currentUserId = computed(() => store.state.auth.info.id)
|
const currentUserId = computed(() => store.state.auth.info.id)
|
||||||
const enabled = computed(() => store.state.config.taskCommentsEnabled)
|
const enabled = computed(() => configStore.taskCommentsEnabled)
|
||||||
const actions = computed(() => {
|
const actions = computed(() => {
|
||||||
if (!props.canWrite) {
|
if (!props.canWrite) {
|
||||||
return {}
|
return {}
|
||||||
|
@ -209,8 +214,13 @@ const actions = computed(() => {
|
||||||
])))
|
])))
|
||||||
})
|
})
|
||||||
|
|
||||||
function attachmentUpload(...args) {
|
function attachmentUpload(
|
||||||
return uploadFile(props.taskId, ...args)
|
file: File,
|
||||||
|
onSuccess: (url: string) => void,
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
|
onError: (error: string) => void,
|
||||||
|
) {
|
||||||
|
return uploadFile(props.taskId, file, onSuccess)
|
||||||
}
|
}
|
||||||
|
|
||||||
const taskCommentService = shallowReactive(new TaskCommentService())
|
const taskCommentService = shallowReactive(new TaskCommentService())
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import {computed, toRefs, type PropType} from 'vue'
|
import {computed, toRefs, type PropType} from 'vue'
|
||||||
import type { ITask } from '@/models/task'
|
import type {ITask} from '@/modelTypes/ITask'
|
||||||
import {formatISO, formatDateLong, formatDateSince} from '@/helpers/time/formatDate'
|
import {formatISO, formatDateLong, formatDateSince} from '@/helpers/time/formatDate'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|
|
@ -44,7 +44,7 @@ import {useI18n} from 'vue-i18n'
|
||||||
import flatPickr from 'vue-flatpickr-component'
|
import flatPickr from 'vue-flatpickr-component'
|
||||||
|
|
||||||
import TaskService from '@/services/task'
|
import TaskService from '@/services/task'
|
||||||
import { type ITask } from '@/models/task'
|
import type {ITask} from '@/modelTypes/ITask'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
modelValue: {
|
modelValue: {
|
||||||
|
|
|
@ -20,12 +20,12 @@
|
||||||
:is-edit-enabled="canWrite"
|
:is-edit-enabled="canWrite"
|
||||||
:upload-callback="attachmentUpload"
|
:upload-callback="attachmentUpload"
|
||||||
:upload-enabled="true"
|
:upload-enabled="true"
|
||||||
@change="save"
|
|
||||||
:placeholder="$t('task.description.placeholder')"
|
:placeholder="$t('task.description.placeholder')"
|
||||||
:empty-text="$t('task.description.empty')"
|
:empty-text="$t('task.description.empty')"
|
||||||
:show-save="true"
|
:show-save="true"
|
||||||
edit-shortcut="e"
|
edit-shortcut="e"
|
||||||
v-model="task.description"
|
v-model="task.description"
|
||||||
|
@update:model-value="save"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -36,7 +36,7 @@ import {useStore} from '@/store'
|
||||||
|
|
||||||
import Editor from '@/components/input/AsyncEditor'
|
import Editor from '@/components/input/AsyncEditor'
|
||||||
|
|
||||||
import type { ITask } from '@/models/task'
|
import type {ITask} from '@/modelTypes/ITask'
|
||||||
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|
|
@ -50,6 +50,7 @@ import {success} from '@/message'
|
||||||
import BaseButton from '@/components/base/BaseButton.vue'
|
import BaseButton from '@/components/base/BaseButton.vue'
|
||||||
import Multiselect from '@/components/input/multiselect.vue'
|
import Multiselect from '@/components/input/multiselect.vue'
|
||||||
import type { ILabel } from '@/modelTypes/ILabel'
|
import type { ILabel } from '@/modelTypes/ILabel'
|
||||||
|
import { useLabelStore } from '@/stores/labels'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
modelValue: {
|
modelValue: {
|
||||||
|
@ -66,7 +67,7 @@ const props = defineProps({
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const emit = defineEmits(['update:modelValue', 'change'])
|
const emit = defineEmits(['update:modelValue'])
|
||||||
|
|
||||||
const store = useStore()
|
const store = useStore()
|
||||||
const {t} = useI18n({useScope: 'global'})
|
const {t} = useI18n({useScope: 'global'})
|
||||||
|
@ -86,8 +87,10 @@ watch(
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
const foundLabels = computed(() => store.getters['labels/filterLabelsByQuery'](labels.value, query.value))
|
const labelStore = useLabelStore()
|
||||||
const loading = computed(() => labelTaskService.loading || (store.state.loading && store.state.loadingModule === 'labels'))
|
|
||||||
|
const foundLabels = computed(() => labelStore.filterLabelsByQuery(labels.value, query.value))
|
||||||
|
const loading = computed(() => labelTaskService.loading || labelStore.isLoading)
|
||||||
|
|
||||||
function findLabel(newQuery: string) {
|
function findLabel(newQuery: string) {
|
||||||
query.value = newQuery
|
query.value = newQuery
|
||||||
|
@ -96,7 +99,6 @@ function findLabel(newQuery: string) {
|
||||||
async function addLabel(label: ILabel, showNotification = true) {
|
async function addLabel(label: ILabel, showNotification = true) {
|
||||||
const bubble = () => {
|
const bubble = () => {
|
||||||
emit('update:modelValue', labels.value)
|
emit('update:modelValue', labels.value)
|
||||||
emit('change', labels.value)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (props.taskId === 0) {
|
if (props.taskId === 0) {
|
||||||
|
@ -122,7 +124,6 @@ async function removeLabel(label: ILabel) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
emit('update:modelValue', labels.value)
|
emit('update:modelValue', labels.value)
|
||||||
emit('change', labels.value)
|
|
||||||
success({message: t('task.label.removeSuccess')})
|
success({message: t('task.label.removeSuccess')})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,7 +132,8 @@ async function createAndAddLabel(title: string) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const newLabel = await store.dispatch('labels/createLabel', new LabelModel({title}))
|
const labelStore = useLabelStore()
|
||||||
|
const newLabel = await labelStore.createLabel(new LabelModel({title}))
|
||||||
addLabel(newLabel, false)
|
addLabel(newLabel, false)
|
||||||
labels.value.push(newLabel)
|
labels.value.push(newLabel)
|
||||||
success({message: t('task.label.addCreateSuccess')})
|
success({message: t('task.label.addCreateSuccess')})
|
||||||
|
|
|
@ -1,7 +1,12 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="heading">
|
<div class="heading">
|
||||||
<BaseButton @click="copyUrl"><h1 class="title task-id">{{ textIdentifier }}</h1></BaseButton>
|
<BaseButton @click="copyUrl"><h1 class="title task-id">{{ textIdentifier }}</h1></BaseButton>
|
||||||
<Done class="heading__done" :is-done="task.done" />
|
<Done class="heading__done" :is-done="task.done"/>
|
||||||
|
<ColorBubble
|
||||||
|
v-if="task.hexColor !== ''"
|
||||||
|
:color="task.getHexColor()"
|
||||||
|
class="mt-1 ml-2"
|
||||||
|
/>
|
||||||
<h1
|
<h1
|
||||||
class="title input"
|
class="title input"
|
||||||
:class="{'disabled': !canWrite}"
|
:class="{'disabled': !canWrite}"
|
||||||
|
@ -34,12 +39,15 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {ref, computed, type PropType} from 'vue'
|
import {ref, computed, type PropType} from 'vue'
|
||||||
import {useStore} from '@/store'
|
import {useStore} from '@/store'
|
||||||
|
import {useRouter} from 'vue-router'
|
||||||
|
|
||||||
import BaseButton from '@/components/base/BaseButton.vue'
|
import BaseButton from '@/components/base/BaseButton.vue'
|
||||||
import Done from '@/components/misc/Done.vue'
|
import Done from '@/components/misc/Done.vue'
|
||||||
import type {ITask} from '@/models/task'
|
|
||||||
import { useRouter } from 'vue-router'
|
import {useCopyToClipboard} from '@/composables/useCopyToClipboard'
|
||||||
import { useCopyToClipboard } from '@/composables/useCopyToClipboard'
|
|
||||||
|
import type {ITask} from '@/modelTypes/ITask'
|
||||||
|
import ColorBubble from '@/components/misc/colorBubble.vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
task: {
|
task: {
|
||||||
|
@ -56,10 +64,11 @@ const emit = defineEmits(['update:task'])
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const copy = useCopyToClipboard()
|
const copy = useCopyToClipboard()
|
||||||
|
|
||||||
async function copyUrl() {
|
async function copyUrl() {
|
||||||
const route = router.resolve({ name: 'task.detail', query: { taskId: props.task.id}})
|
const route = router.resolve({name: 'task.detail', query: {taskId: props.task.id}})
|
||||||
const absoluteURL = new URL(route.href, window.location.href).href
|
const absoluteURL = new URL(route.href, window.location.href).href
|
||||||
|
|
||||||
await copy(absoluteURL)
|
await copy(absoluteURL)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,8 +102,7 @@ async function save(title: string) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
showSavedMessage.value = false
|
showSavedMessage.value = false
|
||||||
}, 2000)
|
}, 2000)
|
||||||
}
|
} finally {
|
||||||
finally {
|
|
||||||
saving.value = false
|
saving.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -104,4 +112,9 @@ async function save(title: string) {
|
||||||
.heading__done {
|
.heading__done {
|
||||||
margin-left: .5rem;
|
margin-left: .5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.color-bubble {
|
||||||
|
height: .75rem;
|
||||||
|
width: .75rem;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
|
@ -68,13 +68,13 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {defineComponent, type PropType} from 'vue'
|
import {defineComponent, type PropType} from 'vue'
|
||||||
|
|
||||||
import {playPop} from '../../../helpers/playPop'
|
|
||||||
import PriorityLabel from '../../../components/tasks/partials/priorityLabel.vue'
|
import PriorityLabel from '../../../components/tasks/partials/priorityLabel.vue'
|
||||||
import User from '../../../components/misc/user.vue'
|
import User from '../../../components/misc/user.vue'
|
||||||
import Done from '@/components/misc/Done.vue'
|
import Done from '@/components/misc/Done.vue'
|
||||||
import Labels from '../../../components/tasks/partials/labels.vue'
|
import Labels from '../../../components/tasks/partials/labels.vue'
|
||||||
import ChecklistSummary from './checklist-summary.vue'
|
import ChecklistSummary from './checklist-summary.vue'
|
||||||
import {TASK_DEFAULT_COLOR, type ITask} from '@/models/task'
|
import {TASK_DEFAULT_COLOR} from '@/models/task'
|
||||||
|
import type {ITask} from '@/modelTypes/ITask'
|
||||||
|
|
||||||
import {formatDateLong, formatISO, formatDateSince} from '@/helpers/time/formatDate'
|
import {formatDateLong, formatISO, formatDateSince} from '@/helpers/time/formatDate'
|
||||||
import {colorIsDark} from '@/helpers/color/colorIsDark'
|
import {colorIsDark} from '@/helpers/color/colorIsDark'
|
||||||
|
@ -125,9 +125,6 @@ export default defineComponent({
|
||||||
...task,
|
...task,
|
||||||
done,
|
done,
|
||||||
})
|
})
|
||||||
if (done) {
|
|
||||||
playPop()
|
|
||||||
}
|
|
||||||
} finally {
|
} finally {
|
||||||
this.loadingInternal = false
|
this.loadingInternal = false
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,8 +11,8 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { PropType } from 'vue'
|
import type {PropType} from 'vue'
|
||||||
import type { ILabel } from '@/models/label'
|
import type {ILabel} from '@/modelTypes/ILabel'
|
||||||
|
|
||||||
defineProps({
|
defineProps({
|
||||||
labels: {
|
labels: {
|
||||||
|
|
|
@ -19,10 +19,12 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import {reactive, ref, watch} from 'vue'
|
import {reactive, ref, watch} from 'vue'
|
||||||
import type {PropType} from 'vue'
|
import type {PropType} from 'vue'
|
||||||
import {useStore} from '@/store'
|
|
||||||
import {useI18n} from 'vue-i18n'
|
import {useI18n} from 'vue-i18n'
|
||||||
import ListModel, { type IList } from '@/models/list'
|
import ListModel from '@/models/list'
|
||||||
|
import type {IList} from '@/modelTypes/IList'
|
||||||
import Multiselect from '@/components/input/multiselect.vue'
|
import Multiselect from '@/components/input/multiselect.vue'
|
||||||
|
import {useListStore} from '@/stores/lists'
|
||||||
|
import {useNamespaceStore} from '@/stores/namespaces'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
modelValue: {
|
modelValue: {
|
||||||
|
@ -32,7 +34,6 @@ const props = defineProps({
|
||||||
})
|
})
|
||||||
const emit = defineEmits(['update:modelValue'])
|
const emit = defineEmits(['update:modelValue'])
|
||||||
|
|
||||||
const store = useStore()
|
|
||||||
const {t} = useI18n({useScope: 'global'})
|
const {t} = useI18n({useScope: 'global'})
|
||||||
|
|
||||||
const list: IList = reactive(new ListModel())
|
const list: IList = reactive(new ListModel())
|
||||||
|
@ -46,12 +47,14 @@ watch(
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
const foundLists = ref([])
|
const listStore = useListStore()
|
||||||
|
const namespaceStore = useNamespaceStore()
|
||||||
|
const foundLists = ref<IList[]>([])
|
||||||
function findLists(query: string) {
|
function findLists(query: string) {
|
||||||
if (query === '') {
|
if (query === '') {
|
||||||
select(null)
|
select(null)
|
||||||
}
|
}
|
||||||
foundLists.value = store.getters['lists/searchList'](query)
|
foundLists.value = listStore.searchList(query)
|
||||||
}
|
}
|
||||||
|
|
||||||
function select(l: IList | null) {
|
function select(l: IList | null) {
|
||||||
|
@ -63,7 +66,7 @@ function select(l: IList | null) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function namespace(namespaceId: number) {
|
function namespace(namespaceId: number) {
|
||||||
const namespace = store.getters['namespaces/getNamespaceById'](namespaceId)
|
const namespace = namespaceStore.getNamespaceById(namespaceId)
|
||||||
return namespace !== null
|
return namespace !== null
|
||||||
? namespace.title
|
? namespace.title
|
||||||
: t('list.shared')
|
: t('list.shared')
|
||||||
|
|
|
@ -32,13 +32,12 @@ const props = defineProps({
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const emit = defineEmits(['update:modelValue', 'change'])
|
const emit = defineEmits(['update:modelValue'])
|
||||||
|
|
||||||
const percentDone = computed({
|
const percentDone = computed({
|
||||||
get: () => props.modelValue,
|
get: () => props.modelValue,
|
||||||
set(percentDone) {
|
set(percentDone) {
|
||||||
emit('update:modelValue', percentDone)
|
emit('update:modelValue', percentDone)
|
||||||
emit('change')
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -19,19 +19,19 @@
|
||||||
import {ref, watch} from 'vue'
|
import {ref, watch} from 'vue'
|
||||||
import {PRIORITIES} from '@/constants/priorities'
|
import {PRIORITIES} from '@/constants/priorities'
|
||||||
|
|
||||||
const priority = ref(0)
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
modelValue: {
|
modelValue: {
|
||||||
default: 0,
|
|
||||||
type: Number,
|
type: Number,
|
||||||
|
default: 0,
|
||||||
},
|
},
|
||||||
disabled: {
|
disabled: {
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const emit = defineEmits(['update:modelValue', 'change'])
|
const emit = defineEmits(['update:modelValue'])
|
||||||
|
|
||||||
|
const priority = ref(0)
|
||||||
|
|
||||||
// FIXME: store value outside
|
// FIXME: store value outside
|
||||||
// Set the priority to the :value every time it changes from the outside
|
// Set the priority to the :value every time it changes from the outside
|
||||||
|
@ -45,6 +45,5 @@ watch(
|
||||||
|
|
||||||
function updateData() {
|
function updateData() {
|
||||||
emit('update:modelValue', priority.value)
|
emit('update:modelValue', priority.value)
|
||||||
emit('change')
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -25,49 +25,48 @@
|
||||||
</transition>
|
</transition>
|
||||||
</label>
|
</label>
|
||||||
<div class="field" key="field-search">
|
<div class="field" key="field-search">
|
||||||
<multiselect
|
<Multiselect
|
||||||
:placeholder="$t('task.relation.searchPlaceholder')"
|
:placeholder="$t('task.relation.searchPlaceholder')"
|
||||||
@search="findTasks"
|
@search="findTasks"
|
||||||
:loading="taskService.loading"
|
:loading="taskService.loading"
|
||||||
:search-results="mappedFoundTasks"
|
:search-results="mappedFoundTasks"
|
||||||
label="title"
|
label="title"
|
||||||
v-model="newTaskRelationTask"
|
v-model="newTaskRelation.task"
|
||||||
:creatable="true"
|
:creatable="true"
|
||||||
:create-placeholder="$t('task.relation.createPlaceholder')"
|
:create-placeholder="$t('task.relation.createPlaceholder')"
|
||||||
@create="createAndRelateTask"
|
@create="createAndRelateTask"
|
||||||
@select="addTaskRelation"
|
|
||||||
>
|
>
|
||||||
<template #searchResult="props">
|
<template #searchResult="{option: task}">
|
||||||
<span v-if="typeof props.option !== 'string'" class="search-result">
|
<span v-if="typeof task !== 'string'" class="search-result">
|
||||||
<span
|
<span
|
||||||
class="different-list"
|
class="different-list"
|
||||||
v-if="props.option.listId !== listId"
|
v-if="task.listId !== listId"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
v-if="props.option.differentNamespace !== null"
|
v-if="task.differentNamespace !== null"
|
||||||
v-tooltip="$t('task.relation.differentNamespace')">
|
v-tooltip="$t('task.relation.differentNamespace')">
|
||||||
{{ props.option.differentNamespace }} >
|
{{ task.differentNamespace }} >
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
v-if="props.option.differentList !== null"
|
v-if="task.differentList !== null"
|
||||||
v-tooltip="$t('task.relation.differentList')">
|
v-tooltip="$t('task.relation.differentList')">
|
||||||
{{ props.option.differentList }} >
|
{{ task.differentList }} >
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
{{ props.option.title }}
|
{{ task.title }}
|
||||||
</span>
|
</span>
|
||||||
<span class="search-result" v-else>
|
<span class="search-result" v-else>
|
||||||
{{ props.option }}
|
{{ task }}
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</multiselect>
|
</Multiselect>
|
||||||
</div>
|
</div>
|
||||||
<div class="field has-addons mb-4" key="field-kind">
|
<div class="field has-addons mb-4" key="field-kind">
|
||||||
<div class="control is-expanded">
|
<div class="control is-expanded">
|
||||||
<div class="select is-fullwidth has-defaults">
|
<div class="select is-fullwidth has-defaults">
|
||||||
<select v-model="newTaskRelationKind">
|
<select v-model="newTaskRelation.kind">
|
||||||
<option value="unset">{{ $t('task.relation.select') }}</option>
|
<option value="unset">{{ $t('task.relation.select') }}</option>
|
||||||
<option :key="rk" :value="rk" v-for="rk in relationKinds">
|
<option :key="`option_${rk}`" :value="rk" v-for="rk in RELATION_KINDS">
|
||||||
{{ $tc(`task.relation.kinds.${rk}`, 1) }}
|
{{ $tc(`task.relation.kinds.${rk}`, 1) }}
|
||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
|
@ -84,29 +83,40 @@
|
||||||
<span class="title">{{ rts.title }}</span>
|
<span class="title">{{ rts.title }}</span>
|
||||||
<div class="tasks">
|
<div class="tasks">
|
||||||
<div :key="t.id" class="task" v-for="t in rts.tasks">
|
<div :key="t.id" class="task" v-for="t in rts.tasks">
|
||||||
<router-link
|
<div class="is-flex is-align-items-center">
|
||||||
:to="{ name: $route.name, params: { id: t.id } }"
|
<Fancycheckbox
|
||||||
:class="{ 'is-strikethrough': t.done}">
|
class="task-done-checkbox"
|
||||||
<span
|
v-model="t.done"
|
||||||
class="different-list"
|
@update:model-value="toggleTaskDone(t)"
|
||||||
v-if="t.listId !== listId"
|
/>
|
||||||
|
<router-link
|
||||||
|
:to="{ name: route.name as string, params: { id: t.id } }"
|
||||||
|
:class="{ 'is-strikethrough': t.done}"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
v-if="t.differentNamespace !== null"
|
class="different-list"
|
||||||
v-tooltip="$t('task.relation.differentNamespace')">
|
v-if="t.listId !== listId"
|
||||||
{{ t.differentNamespace }} >
|
>
|
||||||
|
<span
|
||||||
|
v-if="t.differentNamespace !== null"
|
||||||
|
v-tooltip="$t('task.relation.differentNamespace')">
|
||||||
|
{{ t.differentNamespace }} >
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
v-if="t.differentList !== null"
|
||||||
|
v-tooltip="$t('task.relation.differentList')">
|
||||||
|
{{ t.differentList }} >
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<span
|
{{ t.title }}
|
||||||
v-if="t.differentList !== null"
|
</router-link>
|
||||||
v-tooltip="$t('task.relation.differentList')">
|
</div>
|
||||||
{{ t.differentList }} >
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
{{ t.title }}
|
|
||||||
</router-link>
|
|
||||||
<BaseButton
|
<BaseButton
|
||||||
v-if="editEnabled"
|
v-if="editEnabled"
|
||||||
@click="() => {showDeleteModal = true; relationToDelete = {relationKind: rts.kind, otherTaskId: t.id}}"
|
@click="setRelationToDelete({
|
||||||
|
relationKind: rts.kind,
|
||||||
|
otherTaskId: t.id
|
||||||
|
})"
|
||||||
class="remove"
|
class="remove"
|
||||||
>
|
>
|
||||||
<icon icon="trash-alt"/>
|
<icon icon="trash-alt"/>
|
||||||
|
@ -118,204 +128,237 @@
|
||||||
{{ $t('task.relation.noneYet') }}
|
{{ $t('task.relation.noneYet') }}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<!-- Delete modal -->
|
<modal
|
||||||
<transition name="modal">
|
v-if="relationToDelete !== undefined"
|
||||||
<modal
|
@close="relationToDelete = undefined"
|
||||||
@close="showDeleteModal = false"
|
@submit="removeTaskRelation()"
|
||||||
@submit="removeTaskRelation()"
|
>
|
||||||
v-if="showDeleteModal"
|
<template #header><span>{{ $t('task.relation.delete') }}</span></template>
|
||||||
>
|
|
||||||
<template #header><span>{{ $t('task.relation.delete') }}</span></template>
|
|
||||||
|
|
||||||
<template #text>
|
<template #text>
|
||||||
<p>
|
<p>
|
||||||
{{ $t('task.relation.deleteText1') }}<br/>
|
{{ $t('task.relation.deleteText1') }}<br/>
|
||||||
<strong class="has-text-white">{{ $t('misc.cannotBeUndone') }}</strong>
|
<strong class="has-text-white">{{ $t('misc.cannotBeUndone') }}</strong>
|
||||||
</p>
|
</p>
|
||||||
</template>
|
</template>
|
||||||
</modal>
|
</modal>
|
||||||
</transition>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script setup lang="ts">
|
||||||
import {defineComponent} from 'vue'
|
import {ref, reactive, shallowReactive, watch, computed, type PropType} from 'vue'
|
||||||
|
import {useI18n} from 'vue-i18n'
|
||||||
|
import {useRoute} from 'vue-router'
|
||||||
|
import {useStore} from '@/store'
|
||||||
|
|
||||||
import TaskService from '../../../services/task'
|
import TaskService from '@/services/task'
|
||||||
import TaskModel from '../../../models/task'
|
import TaskModel from '@/models/task'
|
||||||
import TaskRelationService from '../../../services/taskRelation'
|
import type {ITask} from '@/modelTypes/ITask'
|
||||||
|
import type {ITaskRelation} from '@/modelTypes/ITaskRelation'
|
||||||
|
import {RELATION_KINDS, RELATION_KIND, type IRelationKind} from '@/types/IRelationKind'
|
||||||
|
|
||||||
|
import TaskRelationService from '@/services/taskRelation'
|
||||||
import TaskRelationModel from '@/models/taskRelation'
|
import TaskRelationModel from '@/models/taskRelation'
|
||||||
import { RELATION_KIND, RELATION_KINDS } from '@/types/IRelationKind'
|
|
||||||
|
|
||||||
import BaseButton from '@/components/base/BaseButton.vue'
|
import BaseButton from '@/components/base/BaseButton.vue'
|
||||||
import Multiselect from '@/components/input/multiselect.vue'
|
import Multiselect from '@/components/input/multiselect.vue'
|
||||||
|
import Fancycheckbox from '@/components/input/fancycheckbox.vue'
|
||||||
|
|
||||||
export default defineComponent({
|
import {useNamespaceStore} from '@/stores/namespaces'
|
||||||
name: 'relatedTasks',
|
|
||||||
data() {
|
import {error, success} from '@/message'
|
||||||
return {
|
|
||||||
relatedTasks: {},
|
const props = defineProps({
|
||||||
taskService: new TaskService(),
|
taskId: {
|
||||||
foundTasks: [],
|
type: Number,
|
||||||
relationKinds: RELATION_KINDS,
|
required: true,
|
||||||
newTaskRelationTask: new TaskModel(),
|
|
||||||
newTaskRelationKind: RELATION_KIND.RELATED,
|
|
||||||
taskRelationService: new TaskRelationService(),
|
|
||||||
showDeleteModal: false,
|
|
||||||
relationToDelete: {},
|
|
||||||
saved: false,
|
|
||||||
showNewRelationForm: false,
|
|
||||||
query: '',
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
components: {
|
initialRelatedTasks: {
|
||||||
BaseButton,
|
type: Object as PropType<ITask['relatedTasks']>,
|
||||||
Multiselect,
|
default: () => ({}),
|
||||||
},
|
},
|
||||||
props: {
|
showNoRelationsNotice: {
|
||||||
taskId: {
|
type: Boolean,
|
||||||
type: Number,
|
default: false,
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
initialRelatedTasks: {
|
|
||||||
type: Object,
|
|
||||||
default: () => {
|
|
||||||
},
|
|
||||||
},
|
|
||||||
showNoRelationsNotice: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
listId: {
|
|
||||||
type: Number,
|
|
||||||
default: 0,
|
|
||||||
},
|
|
||||||
editEnabled: {
|
|
||||||
default: true,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
watch: {
|
listId: {
|
||||||
initialRelatedTasks: {
|
type: Number,
|
||||||
handler(value) {
|
default: 0,
|
||||||
this.relatedTasks = value
|
|
||||||
},
|
|
||||||
immediate: true,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
computed: {
|
editEnabled: {
|
||||||
showCreate() {
|
default: true,
|
||||||
return Object.keys(this.relatedTasks).length === 0 || this.showNewRelationForm
|
|
||||||
},
|
|
||||||
namespace() {
|
|
||||||
return this.$store.getters['namespaces/getListAndNamespaceById'](this.listId, true)?.namespace
|
|
||||||
},
|
|
||||||
mappedRelatedTasks() {
|
|
||||||
return Object.entries(this.relatedTasks).map(([kind, tasks]) => ({
|
|
||||||
title: this.$tc(`task.relation.kinds.${kind}`, tasks.length),
|
|
||||||
tasks: this.mapRelatedTasks(tasks),
|
|
||||||
kind,
|
|
||||||
}))
|
|
||||||
},
|
|
||||||
mappedFoundTasks() {
|
|
||||||
return this.mapRelatedTasks(this.foundTasks.filter(t => t.id !== this.taskId))
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
async findTasks(query: string) {
|
|
||||||
this.query = query
|
|
||||||
this.foundTasks = await this.taskService.getAll({}, {s: query})
|
|
||||||
},
|
|
||||||
|
|
||||||
async addTaskRelation() {
|
|
||||||
if (this.newTaskRelationTask.id === 0 && this.query !== '') {
|
|
||||||
return this.createAndRelateTask(this.query)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.newTaskRelationTask.id === 0) {
|
|
||||||
this.$message.error({message: this.$t('task.relation.taskRequired')})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
const rel = new TaskRelationModel({
|
|
||||||
taskId: this.taskId,
|
|
||||||
otherTaskId: this.newTaskRelationTask.id,
|
|
||||||
relationKind: this.newTaskRelationKind,
|
|
||||||
})
|
|
||||||
await this.taskRelationService.create(rel)
|
|
||||||
if (!this.relatedTasks[this.newTaskRelationKind]) {
|
|
||||||
this.relatedTasks[this.newTaskRelationKind] = []
|
|
||||||
}
|
|
||||||
this.relatedTasks[this.newTaskRelationKind].push(this.newTaskRelationTask)
|
|
||||||
this.newTaskRelationTask = null
|
|
||||||
this.saved = true
|
|
||||||
this.showNewRelationForm = false
|
|
||||||
setTimeout(() => {
|
|
||||||
this.saved = false
|
|
||||||
}, 2000)
|
|
||||||
},
|
|
||||||
|
|
||||||
async removeTaskRelation() {
|
|
||||||
const rel = new TaskRelationModel({
|
|
||||||
relationKind: this.relationToDelete.relationKind,
|
|
||||||
taskId: this.taskId,
|
|
||||||
otherTaskId: this.relationToDelete.otherTaskId,
|
|
||||||
})
|
|
||||||
try {
|
|
||||||
await this.taskRelationService.delete(rel)
|
|
||||||
|
|
||||||
const kind = this.relationToDelete.relationKind
|
|
||||||
for (const t in this.relatedTasks[kind]) {
|
|
||||||
if (this.relatedTasks[kind][t].id === this.relationToDelete.otherTaskId) {
|
|
||||||
this.relatedTasks[kind].splice(t, 1)
|
|
||||||
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.saved = true
|
|
||||||
setTimeout(() => {
|
|
||||||
this.saved = false
|
|
||||||
}, 2000)
|
|
||||||
} finally {
|
|
||||||
this.showDeleteModal = false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
async createAndRelateTask(title) {
|
|
||||||
const newTask = new TaskModel({title: title, listId: this.listId})
|
|
||||||
this.newTaskRelationTask = await this.taskService.create(newTask)
|
|
||||||
await this.addTaskRelation()
|
|
||||||
},
|
|
||||||
|
|
||||||
relationKindTitle(kind, length) {
|
|
||||||
return this.$tc(`task.relation.kinds.${kind}`, length)
|
|
||||||
},
|
|
||||||
|
|
||||||
mapRelatedTasks(tasks) {
|
|
||||||
return tasks
|
|
||||||
.map(task => {
|
|
||||||
// by doing this here once we can save a lot of duplicate calls in the template
|
|
||||||
const listAndNamespace = this.$store.getters['namespaces/getListAndNamespaceById'](task.listId, true)
|
|
||||||
const {
|
|
||||||
list,
|
|
||||||
namespace,
|
|
||||||
} = listAndNamespace === null ? {list: null, namespace: null} : listAndNamespace
|
|
||||||
|
|
||||||
return {
|
|
||||||
...task,
|
|
||||||
differentNamespace:
|
|
||||||
(namespace !== null &&
|
|
||||||
namespace.id !== this.namespace.id &&
|
|
||||||
namespace?.title) || null,
|
|
||||||
differentList:
|
|
||||||
(list !== null &&
|
|
||||||
task.listId !== this.listId &&
|
|
||||||
list?.title) || null,
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const store = useStore()
|
||||||
|
const namespaceStore = useNamespaceStore()
|
||||||
|
const route = useRoute()
|
||||||
|
const {t} = useI18n({useScope: 'global'})
|
||||||
|
|
||||||
|
type TaskRelation = {kind: IRelationKind, task: ITask}
|
||||||
|
|
||||||
|
const taskService = shallowReactive(new TaskService())
|
||||||
|
|
||||||
|
const relatedTasks = ref<ITask['relatedTasks']>({})
|
||||||
|
|
||||||
|
const newTaskRelation: TaskRelation = reactive({
|
||||||
|
kind: RELATION_KIND.RELATED,
|
||||||
|
task: new TaskModel(),
|
||||||
|
})
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.initialRelatedTasks,
|
||||||
|
(value) => {
|
||||||
|
relatedTasks.value = value
|
||||||
|
},
|
||||||
|
{immediate: true},
|
||||||
|
)
|
||||||
|
|
||||||
|
const showNewRelationForm = ref(false)
|
||||||
|
const showCreate = computed(() => Object.keys(relatedTasks.value).length === 0 || showNewRelationForm.value)
|
||||||
|
|
||||||
|
const query = ref('')
|
||||||
|
const foundTasks = ref<ITask[]>([])
|
||||||
|
|
||||||
|
async function findTasks(newQuery: string) {
|
||||||
|
query.value = newQuery
|
||||||
|
foundTasks.value = await taskService.getAll({}, {s: newQuery})
|
||||||
|
}
|
||||||
|
|
||||||
|
const getListAndNamespaceById = (listId: number) => namespaceStore.getListAndNamespaceById(listId, true)
|
||||||
|
|
||||||
|
const namespace = computed(() => getListAndNamespaceById(props.listId)?.namespace)
|
||||||
|
|
||||||
|
function mapRelatedTasks(tasks: ITask[]) {
|
||||||
|
return tasks.map(task => {
|
||||||
|
// by doing this here once we can save a lot of duplicate calls in the template
|
||||||
|
const {
|
||||||
|
list,
|
||||||
|
namespace: taskNamespace,
|
||||||
|
} = getListAndNamespaceById(task.listId) || {list: null, namespace: null}
|
||||||
|
|
||||||
|
return {
|
||||||
|
...task,
|
||||||
|
differentNamespace:
|
||||||
|
(taskNamespace !== null &&
|
||||||
|
taskNamespace.id !== namespace.value.id &&
|
||||||
|
taskNamespace?.title) || null,
|
||||||
|
differentList:
|
||||||
|
(list !== null &&
|
||||||
|
task.listId !== props.listId &&
|
||||||
|
list?.title) || null,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const mapRelationKindsTitleGetter = computed(() => ({
|
||||||
|
'subtask': (count: number) => t('task.relation.kinds.subtask', count),
|
||||||
|
'parenttask': (count: number) => t('task.relation.kinds.parenttask', count),
|
||||||
|
'related': (count: number) => t('task.relation.kinds.related', count),
|
||||||
|
'duplicateof': (count: number) => t('task.relation.kinds.duplicateof', count),
|
||||||
|
'duplicates': (count: number) => t('task.relation.kinds.duplicates', count),
|
||||||
|
'blocking': (count: number) => t('task.relation.kinds.blocking', count),
|
||||||
|
'blocked': (count: number) => t('task.relation.kinds.blocked', count),
|
||||||
|
'precedes': (count: number) => t('task.relation.kinds.precedes', count),
|
||||||
|
'follows': (count: number) => t('task.relation.kinds.follows', count),
|
||||||
|
'copiedfrom': (count: number) => t('task.relation.kinds.copiedfrom', count),
|
||||||
|
'copiedto': (count: number) => t('task.relation.kinds.copiedto', count),
|
||||||
|
}))
|
||||||
|
|
||||||
|
const mappedRelatedTasks = computed(() => Object.entries(relatedTasks.value).map(
|
||||||
|
([kind, tasks]) => ({
|
||||||
|
title: mapRelationKindsTitleGetter.value[kind as IRelationKind](tasks.length),
|
||||||
|
tasks: mapRelatedTasks(tasks),
|
||||||
|
kind: kind as IRelationKind,
|
||||||
|
}),
|
||||||
|
))
|
||||||
|
const mappedFoundTasks = computed(() => mapRelatedTasks(foundTasks.value.filter(t => t.id !== props.taskId)))
|
||||||
|
|
||||||
|
const taskRelationService = shallowReactive(new TaskRelationService())
|
||||||
|
const saved = ref(false)
|
||||||
|
|
||||||
|
async function addTaskRelation() {
|
||||||
|
if (newTaskRelation.task.id === 0 && query.value !== '') {
|
||||||
|
return createAndRelateTask(query.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (newTaskRelation.task.id === 0) {
|
||||||
|
error({message: t('task.relation.taskRequired')})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
await taskRelationService.create(new TaskRelationModel({
|
||||||
|
taskId: props.taskId,
|
||||||
|
otherTaskId: newTaskRelation.task.id,
|
||||||
|
relationKind: newTaskRelation.kind,
|
||||||
|
}))
|
||||||
|
relatedTasks.value[newTaskRelation.kind] = [
|
||||||
|
...(relatedTasks.value[newTaskRelation.kind] || []),
|
||||||
|
newTaskRelation.task,
|
||||||
|
]
|
||||||
|
newTaskRelation.task = new TaskModel()
|
||||||
|
saved.value = true
|
||||||
|
showNewRelationForm.value = false
|
||||||
|
setTimeout(() => {
|
||||||
|
saved.value = false
|
||||||
|
}, 2000)
|
||||||
|
}
|
||||||
|
|
||||||
|
const relationToDelete = ref<Partial<ITaskRelation>>()
|
||||||
|
|
||||||
|
function setRelationToDelete(relation: Partial<ITaskRelation>) {
|
||||||
|
relationToDelete.value = relation
|
||||||
|
}
|
||||||
|
|
||||||
|
async function removeTaskRelation() {
|
||||||
|
const relation = relationToDelete.value
|
||||||
|
if (!relation || !relation.relationKind || !relation.otherTaskId) {
|
||||||
|
relationToDelete.value = undefined
|
||||||
|
return
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
const relationKind = relation.relationKind
|
||||||
|
await taskRelationService.delete(new TaskRelationModel({
|
||||||
|
relationKind,
|
||||||
|
taskId: props.taskId,
|
||||||
|
otherTaskId: relation.otherTaskId,
|
||||||
|
}))
|
||||||
|
|
||||||
|
relatedTasks.value[relationKind] = relatedTasks.value[relationKind]?.filter(
|
||||||
|
({id}) => id !== relation.otherTaskId,
|
||||||
|
)
|
||||||
|
|
||||||
|
saved.value = true
|
||||||
|
setTimeout(() => {
|
||||||
|
saved.value = false
|
||||||
|
}, 2000)
|
||||||
|
} finally {
|
||||||
|
relationToDelete.value = undefined
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function createAndRelateTask(title: string) {
|
||||||
|
const newTask = await taskService.create(new TaskModel({title, listId: props.listId}))
|
||||||
|
newTaskRelation.task = newTask
|
||||||
|
await addTaskRelation()
|
||||||
|
}
|
||||||
|
|
||||||
|
async function toggleTaskDone(task: ITask) {
|
||||||
|
await store.dispatch('tasks/update', task)
|
||||||
|
|
||||||
|
// Find the task in the list and update it so that it is correctly strike through
|
||||||
|
Object.entries(relatedTasks.value).some(([kind, tasks]) => {
|
||||||
|
return tasks.some((t, key) => {
|
||||||
|
const found = t.id === task.id
|
||||||
|
if (found) {
|
||||||
|
relatedTasks.value[kind as IRelationKind]![key] = task
|
||||||
|
}
|
||||||
|
return found
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
success({message: t('task.detail.updateSuccess')})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@ -366,15 +409,16 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.remove {
|
|
||||||
text-align: center;
|
|
||||||
color: var(--danger);
|
|
||||||
opacity: 0;
|
|
||||||
transition: opacity $transition;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.related-tasks:hover .tasks .task .remove {
|
.remove {
|
||||||
|
text-align: center;
|
||||||
|
color: var(--danger);
|
||||||
|
opacity: 0;
|
||||||
|
transition: opacity $transition;
|
||||||
|
}
|
||||||
|
|
||||||
|
.task:hover .remove {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -387,5 +431,13 @@ export default defineComponent({
|
||||||
padding: 0.5rem;
|
padding: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FIXME: The height of the actual checkbox in the <Fancycheckbox/> component is too much resulting in a
|
||||||
|
// weired positioning of the checkbox. Setting the height here is a workaround until we fix the styling
|
||||||
|
// of the component.
|
||||||
|
.task-done-checkbox {
|
||||||
|
padding: 0;
|
||||||
|
height: 18px; // The exact height of the checkbox in the container
|
||||||
|
}
|
||||||
|
|
||||||
@include modal-transition();
|
@include modal-transition();
|
||||||
</style>
|
</style>
|
|
@ -63,7 +63,7 @@ const props = defineProps({
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const emit = defineEmits(['update:modelValue', 'change'])
|
const emit = defineEmits(['update:modelValue'])
|
||||||
|
|
||||||
const reminders = ref<Reminder[]>([])
|
const reminders = ref<Reminder[]>([])
|
||||||
|
|
||||||
|
@ -86,7 +86,6 @@ watch(
|
||||||
|
|
||||||
function updateData() {
|
function updateData() {
|
||||||
emit('update:modelValue', reminders.value)
|
emit('update:modelValue', reminders.value)
|
||||||
emit('change')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const newReminder = ref(null)
|
const newReminder = ref(null)
|
||||||
|
|
|
@ -85,7 +85,7 @@ const props = defineProps({
|
||||||
|
|
||||||
const {t} = useI18n({useScope: 'global'})
|
const {t} = useI18n({useScope: 'global'})
|
||||||
|
|
||||||
const emit = defineEmits(['update:modelValue', 'change'])
|
const emit = defineEmits(['update:modelValue'])
|
||||||
|
|
||||||
const task = ref<ITask>()
|
const task = ref<ITask>()
|
||||||
const repeatAfter = reactive({
|
const repeatAfter = reactive({
|
||||||
|
@ -116,7 +116,6 @@ function updateData() {
|
||||||
|
|
||||||
Object.assign(task.value.repeatAfter, repeatAfter)
|
Object.assign(task.value.repeatAfter, repeatAfter)
|
||||||
emit('update:modelValue', task.value)
|
emit('update:modelValue', task.value)
|
||||||
emit('change')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function setRepeatAfter(amount: number, type: IRepeatAfter['type']) {
|
function setRepeatAfter(amount: number, type: IRepeatAfter['type']) {
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="{'is-loading': taskService.loading}" class="task loader-container">
|
<div :class="{'is-loading': taskService.loading}" class="task loader-container">
|
||||||
<fancycheckbox :disabled="(isArchived || disabled) && !canMarkAsDone" @change="markAsDone" v-model="task.done"/>
|
<fancycheckbox :disabled="(isArchived || disabled) && !canMarkAsDone" @change="markAsDone" v-model="task.done"/>
|
||||||
<span
|
<ColorBubble
|
||||||
v-if="showListColor && listColor !== ''"
|
v-if="showListColor && listColor !== ''"
|
||||||
:style="{backgroundColor: listColor }"
|
:color="listColor"
|
||||||
class="color-bubble"
|
class="mr-1"
|
||||||
>
|
/>
|
||||||
</span>
|
|
||||||
<router-link
|
<router-link
|
||||||
:to="taskDetailRoute"
|
:to="taskDetailRoute"
|
||||||
:class="{ 'done': task.done}"
|
:class="{ 'done': task.done}"
|
||||||
|
@ -15,11 +14,17 @@
|
||||||
<router-link
|
<router-link
|
||||||
:to="{ name: 'list.list', params: { listId: task.listId } }"
|
:to="{ name: 'list.list', params: { listId: task.listId } }"
|
||||||
class="task-list"
|
class="task-list"
|
||||||
v-if="showList && $store.getters['lists/getListById'](task.listId) !== null"
|
:class="{'mr-2': task.hexColor !== ''}"
|
||||||
v-tooltip="$t('task.detail.belongsToList', {list: $store.getters['lists/getListById'](task.listId).title})">
|
v-if="showList && getListById(task.listId) !== null"
|
||||||
{{ $store.getters['lists/getListById'](task.listId).title }}
|
v-tooltip="$t('task.detail.belongsToList', {list: getListById(task.listId).title})">
|
||||||
|
{{ getListById(task.listId).title }}
|
||||||
</router-link>
|
</router-link>
|
||||||
|
|
||||||
|
<ColorBubble
|
||||||
|
v-if="task.hexColor !== ''"
|
||||||
|
:color="task.getHexColor()"
|
||||||
|
class="mr-1"
|
||||||
|
/>
|
||||||
<!-- Show any parent tasks to make it clear this task is a sub task of something -->
|
<!-- Show any parent tasks to make it clear this task is a sub task of something -->
|
||||||
<span class="parent-tasks" v-if="typeof task.relatedTasks.parenttask !== 'undefined'">
|
<span class="parent-tasks" v-if="typeof task.relatedTasks.parenttask !== 'undefined'">
|
||||||
<template v-for="(pt, i) in task.relatedTasks.parenttask">
|
<template v-for="(pt, i) in task.relatedTasks.parenttask">
|
||||||
|
@ -30,7 +35,7 @@
|
||||||
{{ task.title }}
|
{{ task.title }}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<labels class="labels ml-2 mr-1" :labels="task.labels" v-if="task.labels.length > 0" />
|
<labels class="labels ml-2 mr-1" :labels="task.labels" v-if="task.labels.length > 0"/>
|
||||||
<user
|
<user
|
||||||
:avatar-size="27"
|
:avatar-size="27"
|
||||||
:is-inline="true"
|
:is-inline="true"
|
||||||
|
@ -80,9 +85,9 @@
|
||||||
<router-link
|
<router-link
|
||||||
:to="{ name: 'list.list', params: { listId: task.listId } }"
|
:to="{ name: 'list.list', params: { listId: task.listId } }"
|
||||||
class="task-list"
|
class="task-list"
|
||||||
v-if="!showList && currentList.id !== task.listId && $store.getters['lists/getListById'](task.listId) !== null"
|
v-if="!showList && currentList.id !== task.listId && getListById(task.listId) !== null"
|
||||||
v-tooltip="$t('task.detail.belongsToList', {list: $store.getters['lists/getListById'](task.listId).title})">
|
v-tooltip="$t('task.detail.belongsToList', {list: getListById(task.listId).title})">
|
||||||
{{ $store.getters['lists/getListById'](task.listId).title }}
|
{{ getListById(task.listId).title }}
|
||||||
</router-link>
|
</router-link>
|
||||||
<BaseButton
|
<BaseButton
|
||||||
:class="{'is-favorite': task.isFavorite}"
|
:class="{'is-favorite': task.isFavorite}"
|
||||||
|
@ -97,8 +102,10 @@
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {defineComponent, type PropType} from 'vue'
|
import {defineComponent, type PropType} from 'vue'
|
||||||
|
import {mapState} from 'pinia'
|
||||||
|
|
||||||
import TaskModel, { type ITask } from '../../../models/task'
|
import TaskModel from '@/models/task'
|
||||||
|
import type {ITask} from '@/modelTypes/ITask'
|
||||||
import PriorityLabel from './priorityLabel.vue'
|
import PriorityLabel from './priorityLabel.vue'
|
||||||
import TaskService from '../../../services/task'
|
import TaskService from '../../../services/task'
|
||||||
import Labels from '@/components/tasks/partials/labels.vue'
|
import Labels from '@/components/tasks/partials/labels.vue'
|
||||||
|
@ -107,9 +114,11 @@ import BaseButton from '@/components/base/BaseButton.vue'
|
||||||
import Fancycheckbox from '../../input/fancycheckbox.vue'
|
import Fancycheckbox from '../../input/fancycheckbox.vue'
|
||||||
import DeferTask from './defer-task.vue'
|
import DeferTask from './defer-task.vue'
|
||||||
import {closeWhenClickedOutside} from '@/helpers/closeWhenClickedOutside'
|
import {closeWhenClickedOutside} from '@/helpers/closeWhenClickedOutside'
|
||||||
import {playPop} from '@/helpers/playPop'
|
|
||||||
import ChecklistSummary from './checklist-summary.vue'
|
import ChecklistSummary from './checklist-summary.vue'
|
||||||
import {formatDateSince, formatISO, formatDateLong} from '@/helpers/time/formatDate'
|
import {formatDateSince, formatISO, formatDateLong} from '@/helpers/time/formatDate'
|
||||||
|
import ColorBubble from '@/components/misc/colorBubble.vue'
|
||||||
|
import {useListStore} from '@/stores/lists'
|
||||||
|
import {useNamespaceStore} from '@/stores/namespaces'
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'singleTaskInList',
|
name: 'singleTaskInList',
|
||||||
|
@ -121,6 +130,7 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
|
ColorBubble,
|
||||||
BaseButton,
|
BaseButton,
|
||||||
ChecklistSummary,
|
ChecklistSummary,
|
||||||
DeferTask,
|
DeferTask,
|
||||||
|
@ -169,8 +179,11 @@ export default defineComponent({
|
||||||
document.removeEventListener('click', this.hideDeferDueDatePopup)
|
document.removeEventListener('click', this.hideDeferDueDatePopup)
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
...mapState(useListStore, {
|
||||||
|
getListById: 'getListById',
|
||||||
|
}),
|
||||||
listColor() {
|
listColor() {
|
||||||
const list = this.$store.getters['lists/getListById'](this.task.listId)
|
const list = this.getListById(this.task.listId)
|
||||||
return list !== null ? list.hexColor : ''
|
return list !== null ? list.hexColor : ''
|
||||||
},
|
},
|
||||||
currentList() {
|
currentList() {
|
||||||
|
@ -195,10 +208,7 @@ export default defineComponent({
|
||||||
|
|
||||||
async markAsDone(checked: boolean) {
|
async markAsDone(checked: boolean) {
|
||||||
const updateFunc = async () => {
|
const updateFunc = async () => {
|
||||||
const task = await this.taskService.update(this.task)
|
const task = await this.$store.dispatch('tasks/update', this.task)
|
||||||
if (this.task.done) {
|
|
||||||
playPop()
|
|
||||||
}
|
|
||||||
this.task = task
|
this.task = task
|
||||||
this.$emit('task-updated', task)
|
this.$emit('task-updated', task)
|
||||||
this.$message.success({
|
this.$message.success({
|
||||||
|
@ -227,7 +237,8 @@ export default defineComponent({
|
||||||
this.task.isFavorite = !this.task.isFavorite
|
this.task.isFavorite = !this.task.isFavorite
|
||||||
this.task = await this.taskService.update(this.task)
|
this.task = await this.taskService.update(this.task)
|
||||||
this.$emit('task-updated', this.task)
|
this.$emit('task-updated', this.task)
|
||||||
this.$store.dispatch('namespaces/loadNamespacesIfFavoritesDontExist')
|
const namespaceStore = useNamespaceStore()
|
||||||
|
namespaceStore.loadNamespacesIfFavoritesDontExist()
|
||||||
},
|
},
|
||||||
hideDeferDueDatePopup(e) {
|
hideDeferDueDatePopup(e) {
|
||||||
if (!this.showDefer) {
|
if (!this.showDefer) {
|
||||||
|
@ -281,11 +292,6 @@ export default defineComponent({
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.color-bubble {
|
|
||||||
height: 10px;
|
|
||||||
flex: 0 0 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.avatar {
|
.avatar {
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
vertical-align: bottom;
|
vertical-align: bottom;
|
||||||
|
|
|
@ -3,11 +3,42 @@ import {useI18n} from 'vue-i18n'
|
||||||
|
|
||||||
export function useCopyToClipboard() {
|
export function useCopyToClipboard() {
|
||||||
const {t} = useI18n({useScope: 'global'})
|
const {t} = useI18n({useScope: 'global'})
|
||||||
|
|
||||||
|
function fallbackCopyTextToClipboard(text: string) {
|
||||||
|
const textArea = document.createElement('textarea')
|
||||||
|
textArea.value = text
|
||||||
|
|
||||||
|
// Avoid scrolling to bottom
|
||||||
|
textArea.style.top = '0'
|
||||||
|
textArea.style.left = '0'
|
||||||
|
textArea.style.position = 'fixed'
|
||||||
|
|
||||||
|
document.body.appendChild(textArea)
|
||||||
|
textArea.focus()
|
||||||
|
textArea.select()
|
||||||
|
|
||||||
|
try {
|
||||||
|
// NOTE: the execCommand is deprecated but as of 2022_09
|
||||||
|
// widely supported and works without https
|
||||||
|
const successful = document.execCommand('copy')
|
||||||
|
if (!successful) {
|
||||||
|
throw new Error()
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
error(t('misc.copyError'))
|
||||||
|
}
|
||||||
|
|
||||||
|
document.body.removeChild(textArea)
|
||||||
|
}
|
||||||
|
|
||||||
return async (text: string) => {
|
return async (text: string) => {
|
||||||
|
if (!navigator.clipboard) {
|
||||||
|
fallbackCopyTextToClipboard(text)
|
||||||
|
return
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
await navigator.clipboard.writeText(text)
|
await navigator.clipboard.writeText(text)
|
||||||
} catch {
|
} catch(e) {
|
||||||
error(t('misc.copyError'))
|
error(t('misc.copyError'))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,37 +0,0 @@
|
||||||
import {watch, reactive, shallowReactive, unref, toRefs, readonly} from 'vue'
|
|
||||||
import type {MaybeRef} from '@vueuse/core'
|
|
||||||
import {useStore} from '@/store'
|
|
||||||
|
|
||||||
import ListService from '@/services/list'
|
|
||||||
import ListModel from '@/models/list'
|
|
||||||
import { success } from '@/message'
|
|
||||||
import {useI18n} from 'vue-i18n'
|
|
||||||
|
|
||||||
export function useList(listId: MaybeRef<ListModel['id']>) {
|
|
||||||
const listService = shallowReactive(new ListService())
|
|
||||||
const {loading: isLoading} = toRefs(listService)
|
|
||||||
const list : ListModel = reactive(new ListModel({}))
|
|
||||||
const {t} = useI18n()
|
|
||||||
|
|
||||||
watch(
|
|
||||||
() => unref(listId),
|
|
||||||
async (listId) => {
|
|
||||||
const loadedList = await listService.get(new ListModel({id: listId}))
|
|
||||||
Object.assign(list, loadedList)
|
|
||||||
},
|
|
||||||
{immediate: true},
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
const store = useStore()
|
|
||||||
async function save() {
|
|
||||||
await store.dispatch('lists/updateList', list)
|
|
||||||
success({message: t('list.edit.success')})
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
isLoading: readonly(isLoading),
|
|
||||||
list,
|
|
||||||
save,
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,11 +1,11 @@
|
||||||
import {ref, computed} from 'vue'
|
import {ref, computed} from 'vue'
|
||||||
import {useStore} from '@/store'
|
import {useNamespaceStore} from '@/stores/namespaces'
|
||||||
|
|
||||||
export function useNameSpaceSearch() {
|
export function useNamespaceSearch() {
|
||||||
const query = ref('')
|
const query = ref('')
|
||||||
|
|
||||||
const store = useStore()
|
const namespaceStore = useNamespaceStore()
|
||||||
const namespaces = computed(() => store.getters['namespaces/searchNamespace'](query.value))
|
const namespaces = computed(() => namespaceStore.searchNamespace(query.value))
|
||||||
|
|
||||||
function findNamespaces(newQuery: string) {
|
function findNamespaces(newQuery: string) {
|
||||||
query.value = newQuery
|
query.value = newQuery
|
||||||
|
|
|
@ -1,12 +1,21 @@
|
||||||
import { computed, watchEffect } from 'vue'
|
import { computed } from 'vue'
|
||||||
import type { ComputedGetter } from 'vue'
|
import type { Ref } from 'vue'
|
||||||
|
|
||||||
import { setTitle } from '@/helpers/setTitle'
|
import {useTitle as useTitleVueUse, resolveRef} from '@vueuse/core'
|
||||||
|
|
||||||
export function useTitle(titleGetter: ComputedGetter<string>) {
|
type UseTitleParameters = Parameters<typeof useTitleVueUse>
|
||||||
const titleRef = computed(titleGetter)
|
|
||||||
|
|
||||||
watchEffect(() => setTitle(titleRef.value))
|
export function useTitle(...args: UseTitleParameters) {
|
||||||
|
|
||||||
return titleRef
|
const [newTitle, ...restArgs] = args
|
||||||
|
|
||||||
|
const pageTitle = resolveRef(newTitle) as Ref<string>
|
||||||
|
|
||||||
|
const completeTitle = computed(() =>
|
||||||
|
(typeof pageTitle.value === 'undefined' || pageTitle.value === '')
|
||||||
|
? 'Vikunja'
|
||||||
|
: `${pageTitle.value} | Vikunja`,
|
||||||
|
)
|
||||||
|
|
||||||
|
return useTitleVueUse(completeTitle, ...restArgs)
|
||||||
}
|
}
|
|
@ -1,10 +1,10 @@
|
||||||
import AttachmentModel, { type IAttachment } from '@/models/attachment'
|
import AttachmentModel from '@/models/attachment'
|
||||||
import type {IFile} from '@/models/file'
|
import type {IAttachment} from '@/modelTypes/IAttachment'
|
||||||
|
|
||||||
import AttachmentService from '@/services/attachment'
|
import AttachmentService from '@/services/attachment'
|
||||||
import { store } from '@/store'
|
import { store } from '@/store'
|
||||||
|
|
||||||
export function uploadFile(taskId: number, file: IFile, onSuccess: () => Function) {
|
export function uploadFile(taskId: number, file: File, onSuccess: (url: string) => void) {
|
||||||
const attachmentService = new AttachmentService()
|
const attachmentService = new AttachmentService()
|
||||||
const files = [file]
|
const files = [file]
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ export function uploadFile(taskId: number, file: IFile, onSuccess: () => Functio
|
||||||
export async function uploadFiles(
|
export async function uploadFiles(
|
||||||
attachmentService: AttachmentService,
|
attachmentService: AttachmentService,
|
||||||
taskId: number,
|
taskId: number,
|
||||||
files: IFile[],
|
files: File[] | FileList,
|
||||||
onSuccess: Function = () => {},
|
onSuccess: Function = () => {},
|
||||||
) {
|
) {
|
||||||
const attachmentModel = new AttachmentModel({taskId})
|
const attachmentModel = new AttachmentModel({taskId})
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
import {store} from '@/store'
|
import {useConfigStore} from '@/stores/config'
|
||||||
|
|
||||||
const API_DEFAULT_PORT = '3456'
|
const API_DEFAULT_PORT = '3456'
|
||||||
|
|
||||||
export const ERROR_NO_API_URL = 'noApiUrlProvided'
|
export const ERROR_NO_API_URL = 'noApiUrlProvided'
|
||||||
|
|
||||||
const updateConfig = () => store.dispatch('config/update')
|
|
||||||
|
|
||||||
export const checkAndSetApiUrl = (url: string): Promise<string> => {
|
export const checkAndSetApiUrl = (url: string): Promise<string> => {
|
||||||
if(url.startsWith('/')) {
|
if(url.startsWith('/')) {
|
||||||
|
@ -25,6 +24,9 @@ export const checkAndSetApiUrl = (url: string): Promise<string> => {
|
||||||
const oldUrl = window.API_URL
|
const oldUrl = window.API_URL
|
||||||
window.API_URL = urlToCheck.toString()
|
window.API_URL = urlToCheck.toString()
|
||||||
|
|
||||||
|
const configStore = useConfigStore()
|
||||||
|
const updateConfig = () => configStore.update()
|
||||||
|
|
||||||
// Check if the api is reachable at the provided url
|
// Check if the api is reachable at the provided url
|
||||||
return updateConfig()
|
return updateConfig()
|
||||||
.catch(e => {
|
.catch(e => {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import {i18n} from '@/i18n'
|
import {i18n} from '@/i18n'
|
||||||
import type { IList } from '@/models/list'
|
import type {IList} from '@/modelTypes/IList'
|
||||||
|
|
||||||
export function getListTitle(l: IList) {
|
export function getListTitle(l: IList) {
|
||||||
if (l.id === -1) {
|
if (l.id === -1) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import {i18n} from '@/i18n'
|
import {i18n} from '@/i18n'
|
||||||
import type {INamespace} from '@/models/namespace'
|
import type {INamespace} from '@/modelTypes/INamespace'
|
||||||
|
|
||||||
export const getNamespaceTitle = (n: INamespace) => {
|
export const getNamespaceTitle = (n: INamespace) => {
|
||||||
if (n.id === -1) {
|
if (n.id === -1) {
|
||||||
|
|
|
@ -1,47 +0,0 @@
|
||||||
import {describe, it, expect} from 'vitest'
|
|
||||||
|
|
||||||
import {filterLabelsByQuery} from './labels'
|
|
||||||
import {createNewIndexer} from '../indexes'
|
|
||||||
|
|
||||||
const {add} = createNewIndexer('labels', ['title', 'description'])
|
|
||||||
|
|
||||||
describe('filter labels', () => {
|
|
||||||
const state = {
|
|
||||||
labels: {
|
|
||||||
1: {id: 1, title: 'label1'},
|
|
||||||
2: {id: 2, title: 'label2'},
|
|
||||||
3: {id: 3, title: 'label3'},
|
|
||||||
4: {id: 4, title: 'label4'},
|
|
||||||
5: {id: 5, title: 'label5'},
|
|
||||||
6: {id: 6, title: 'label6'},
|
|
||||||
7: {id: 7, title: 'label7'},
|
|
||||||
8: {id: 8, title: 'label8'},
|
|
||||||
9: {id: 9, title: 'label9'},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
Object.values(state.labels).forEach(add)
|
|
||||||
|
|
||||||
it('should return an empty array for an empty query', () => {
|
|
||||||
const labels = filterLabelsByQuery(state, [], '')
|
|
||||||
|
|
||||||
expect(labels).toHaveLength(0)
|
|
||||||
})
|
|
||||||
it('should return labels for a query', () => {
|
|
||||||
const labels = filterLabelsByQuery(state, [], 'label2')
|
|
||||||
|
|
||||||
expect(labels).toHaveLength(1)
|
|
||||||
expect(labels[0].title).toBe('label2')
|
|
||||||
})
|
|
||||||
it('should not return found but hidden labels', () => {
|
|
||||||
interface label {
|
|
||||||
id: number,
|
|
||||||
title: string,
|
|
||||||
}
|
|
||||||
|
|
||||||
const labelsToHide: label[] = [{id: 1, title: 'label1'}]
|
|
||||||
const labels = filterLabelsByQuery(state, labelsToHide, 'label1')
|
|
||||||
|
|
||||||
expect(labels).toHaveLength(0)
|
|
||||||
})
|
|
||||||
})
|
|
|
@ -1,33 +0,0 @@
|
||||||
import {createNewIndexer} from '../indexes'
|
|
||||||
|
|
||||||
import type {LabelState} from '@/store/types'
|
|
||||||
import type {ILabel} from '@/models/label'
|
|
||||||
|
|
||||||
const {search} = createNewIndexer('labels', ['title', 'description'])
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if a list of labels is available in the store and filters them then query
|
|
||||||
* @param {Object} state
|
|
||||||
* @param {Array} labelsToHide
|
|
||||||
* @param {String} query
|
|
||||||
* @returns {Array}
|
|
||||||
*/
|
|
||||||
export function filterLabelsByQuery(state: LabelState, labelsToHide: ILabel[], query: string) {
|
|
||||||
const labelIdsToHide: number[] = labelsToHide.map(({id}) => id)
|
|
||||||
|
|
||||||
return search(query)
|
|
||||||
?.filter(value => !labelIdsToHide.includes(value))
|
|
||||||
.map(id => state.labels[id])
|
|
||||||
|| []
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the labels by id if found
|
|
||||||
* @param {Object} state
|
|
||||||
* @param {Array} ids
|
|
||||||
* @returns {Array}
|
|
||||||
*/
|
|
||||||
export function getLabelsByIds(state: LabelState, ids: ILabel['id'][]) {
|
|
||||||
return Object.values(state.labels).filter(({id}) => ids.includes(id))
|
|
||||||
}
|
|
44
src/helpers/markdownRenderer.ts
Normal file
44
src/helpers/markdownRenderer.ts
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
import {marked} from 'marked'
|
||||||
|
import hljs from 'highlight.js/lib/common'
|
||||||
|
|
||||||
|
export function setupMarkdownRenderer(checkboxId: string) {
|
||||||
|
const renderer = new marked.Renderer()
|
||||||
|
const linkRenderer = renderer.link
|
||||||
|
|
||||||
|
let checkboxNum = -1
|
||||||
|
marked.use({
|
||||||
|
renderer: {
|
||||||
|
image: (src, title, text) => {
|
||||||
|
|
||||||
|
title = title ? ` title="${title}` : ''
|
||||||
|
|
||||||
|
// If the url starts with the api url, the image is likely an attachment and
|
||||||
|
// we'll need to download and parse it properly.
|
||||||
|
if (src.substr(0, window.API_URL.length + 7) === `${window.API_URL}/tasks/`) {
|
||||||
|
return `<img data-src="${src}" alt="${text}" ${title} class="attachment-image"/>`
|
||||||
|
}
|
||||||
|
|
||||||
|
return `<img src="${src}" alt="${text}" ${title}/>`
|
||||||
|
},
|
||||||
|
checkbox: (checked) => {
|
||||||
|
if (checked) {
|
||||||
|
checked = ' checked="checked"'
|
||||||
|
}
|
||||||
|
|
||||||
|
checkboxNum++
|
||||||
|
return `<input type="checkbox" data-checkbox-num="${checkboxNum}" ${checked} class="text-checkbox-${checkboxId}"/>`
|
||||||
|
},
|
||||||
|
link: (href, title, text) => {
|
||||||
|
const isLocal = href.startsWith(`${location.protocol}//${location.hostname}`)
|
||||||
|
const html = linkRenderer.call(renderer, href, title, text)
|
||||||
|
return isLocal ? html : html.replace(/^<a /, '<a target="_blank" rel="noreferrer noopener nofollow" ')
|
||||||
|
},
|
||||||
|
},
|
||||||
|
highlight: function (code, language) {
|
||||||
|
const validLanguage = hljs.getLanguage(language) ? language : 'plaintext'
|
||||||
|
return hljs.highlight(code, {language: validLanguage}).value
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
return renderer
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
import type {IList} from '@/models/list'
|
import type {IList} from '@/modelTypes/IList'
|
||||||
|
|
||||||
const key = 'collapsedBuckets'
|
const key = 'collapsedBuckets'
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import type {IList} from '@/models/list'
|
import type {IList} from '@/modelTypes/IList'
|
||||||
|
|
||||||
export function getSavedFilterIdFromListId(listId: IList['id']) {
|
export function getSavedFilterIdFromListId(listId: IList['id']) {
|
||||||
let filterId = listId * -1 - 1
|
let filterId = listId * -1 - 1
|
||||||
|
|
|
@ -12,7 +12,9 @@ interface dateFoundResult {
|
||||||
date: Date | null,
|
date: Date | null,
|
||||||
}
|
}
|
||||||
|
|
||||||
export const parseDate = (text: string): dateParseResult => {
|
const monthsRegexGroup = '(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)'
|
||||||
|
|
||||||
|
export const parseDate = (text: string, now: Date = new Date()): dateParseResult => {
|
||||||
const lowerText: string = text.toLowerCase()
|
const lowerText: string = text.toLowerCase()
|
||||||
|
|
||||||
if (lowerText.includes('today')) {
|
if (lowerText.includes('today')) {
|
||||||
|
@ -62,39 +64,44 @@ export const parseDate = (text: string): dateParseResult => {
|
||||||
}
|
}
|
||||||
|
|
||||||
parsed = getDayFromText(text)
|
parsed = getDayFromText(text)
|
||||||
|
if (parsed.date !== null) {
|
||||||
|
const month = getMonthFromText(text, parsed.date)
|
||||||
|
return addTimeToDate(text, month.date, parsed.foundText)
|
||||||
|
}
|
||||||
|
|
||||||
|
parsed = getDateFromTextIn(text, now)
|
||||||
if (parsed.date !== null) {
|
if (parsed.date !== null) {
|
||||||
return addTimeToDate(text, parsed.date, parsed.foundText)
|
return addTimeToDate(text, parsed.date, parsed.foundText)
|
||||||
}
|
}
|
||||||
|
|
||||||
parsed = getDateFromTextIn(text)
|
parsed = getDateFromText(text)
|
||||||
if (parsed.date !== null) {
|
|
||||||
|
if (parsed.date === null) {
|
||||||
return {
|
return {
|
||||||
newText: replaceAll(text, parsed.foundText, ''),
|
newText: replaceAll(text, parsed.foundText, ''),
|
||||||
date: parsed.date,
|
date: parsed.date,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
parsed = getDateFromText(text)
|
return addTimeToDate(text, parsed.date, parsed.foundText)
|
||||||
|
|
||||||
return {
|
|
||||||
newText: replaceAll(text, parsed.foundText, ''),
|
|
||||||
date: parsed.date,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const addTimeToDate = (text: string, date: Date, match: string | null): dateParseResult => {
|
const addTimeToDate = (text: string, date: Date, previousMatch: string | null): dateParseResult => {
|
||||||
if (match === null) {
|
previousMatch = previousMatch?.trim() || ''
|
||||||
|
text = replaceAll(text, previousMatch, '')
|
||||||
|
if (previousMatch === null) {
|
||||||
return {
|
return {
|
||||||
newText: text,
|
newText: text,
|
||||||
date: null,
|
date: null,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const matcher = new RegExp(`(${match} (at|@) )([0-9][0-9]?(:[0-9][0-9]?)?( ?(a|p)m)?)`, 'ig')
|
const timeRegex = ' (at|@) ([0-9][0-9]?(:[0-9][0-9]?)?( ?(a|p)m)?)'
|
||||||
|
const matcher = new RegExp(timeRegex, 'ig')
|
||||||
const results = matcher.exec(text)
|
const results = matcher.exec(text)
|
||||||
|
|
||||||
if (results !== null) {
|
if (results !== null) {
|
||||||
const time = results[3]
|
const time = results[2]
|
||||||
const parts = time.split(':')
|
const parts = time.split(':')
|
||||||
let hours = parseInt(parts[0])
|
let hours = parseInt(parts[0])
|
||||||
let minutes = 0
|
let minutes = 0
|
||||||
|
@ -110,7 +117,7 @@ const addTimeToDate = (text: string, date: Date, match: string | null): datePars
|
||||||
date.setSeconds(0)
|
date.setSeconds(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
const replace = results !== null ? results[0] : match
|
const replace = results !== null ? results[0] : previousMatch
|
||||||
return {
|
return {
|
||||||
newText: replaceAll(text, replace, ''),
|
newText: replaceAll(text, replace, ''),
|
||||||
date: date,
|
date: date,
|
||||||
|
@ -118,7 +125,7 @@ const addTimeToDate = (text: string, date: Date, match: string | null): datePars
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getDateFromText = (text: string, now: Date = new Date()) => {
|
export const getDateFromText = (text: string, now: Date = new Date()) => {
|
||||||
const fullDateRegex: RegExp = /([0-9][0-9]?\/[0-9][0-9]?\/[0-9][0-9]([0-9][0-9])?|[0-9][0-9][0-9][0-9]\/[0-9][0-9]?\/[0-9][0-9]?|[0-9][0-9][0-9][0-9]-[0-9][0-9]?-[0-9][0-9]?)/ig
|
const fullDateRegex: RegExp = / ([0-9][0-9]?\/[0-9][0-9]?\/[0-9][0-9]([0-9][0-9])?|[0-9][0-9][0-9][0-9]\/[0-9][0-9]?\/[0-9][0-9]?|[0-9][0-9][0-9][0-9]-[0-9][0-9]?-[0-9][0-9]?)/ig
|
||||||
|
|
||||||
// 1. Try parsing the text as a "usual" date, like 2021-06-24 or 06/24/2021
|
// 1. Try parsing the text as a "usual" date, like 2021-06-24 or 06/24/2021
|
||||||
let results: string[] | null = fullDateRegex.exec(text)
|
let results: string[] | null = fullDateRegex.exec(text)
|
||||||
|
@ -127,15 +134,15 @@ export const getDateFromText = (text: string, now: Date = new Date()) => {
|
||||||
let containsYear: boolean = true
|
let containsYear: boolean = true
|
||||||
if (result === null) {
|
if (result === null) {
|
||||||
// 2. Try parsing the date as something like "jan 21" or "21 jan"
|
// 2. Try parsing the date as something like "jan 21" or "21 jan"
|
||||||
const monthRegex: RegExp = /((jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec) [0-9][0-9]?|[0-9][0-9]? (jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))/ig
|
const monthRegex: RegExp = new RegExp(` (${monthsRegexGroup} [0-9][0-9]?|[0-9][0-9]? ${monthsRegexGroup})`, 'ig')
|
||||||
results = monthRegex.exec(text)
|
results = monthRegex.exec(text)
|
||||||
result = results === null ? null : `${results[0]} ${now.getFullYear()}`
|
result = results === null ? null : `${results[0]} ${now.getFullYear()}`.trim()
|
||||||
foundText = results === null ? '' : results[0]
|
foundText = results === null ? '' : results[0].trim()
|
||||||
containsYear = false
|
containsYear = false
|
||||||
|
|
||||||
if (result === null) {
|
if (result === null) {
|
||||||
// 3. Try parsing the date as "27/01" or "01/27"
|
// 3. Try parsing the date as "27/01" or "01/27"
|
||||||
const monthNumericRegex: RegExp = /([0-9][0-9]?\/[0-9][0-9]?)/ig
|
const monthNumericRegex: RegExp = / ([0-9][0-9]?\/[0-9][0-9]?)/ig
|
||||||
results = monthNumericRegex.exec(text)
|
results = monthNumericRegex.exec(text)
|
||||||
|
|
||||||
// Put the year before or after the date, depending on what works
|
// Put the year before or after the date, depending on what works
|
||||||
|
@ -309,7 +316,7 @@ const getDayFromText = (text: string) => {
|
||||||
while (date < now) {
|
while (date < now) {
|
||||||
date.setMonth(date.getMonth() + 1)
|
date.setMonth(date.getMonth() + 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (date.getDate() !== day) {
|
if (date.getDate() !== day) {
|
||||||
date.setDate(day)
|
date.setDate(day)
|
||||||
}
|
}
|
||||||
|
@ -320,6 +327,25 @@ const getDayFromText = (text: string) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getMonthFromText = (text: string, date: Date) => {
|
||||||
|
const matcher = new RegExp(monthsRegexGroup, 'ig')
|
||||||
|
const results = matcher.exec(text)
|
||||||
|
|
||||||
|
if (results === null) {
|
||||||
|
return {
|
||||||
|
newText: text,
|
||||||
|
date,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const fullDate = new Date(`${results[0]} 1 ${(new Date()).getFullYear()}`)
|
||||||
|
date.setMonth(fullDate.getMonth())
|
||||||
|
return {
|
||||||
|
newText: replaceAll(text, results[0], ''),
|
||||||
|
date,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const getDateFromInterval = (interval: number): Date => {
|
const getDateFromInterval = (interval: number): Date => {
|
||||||
const newDate = new Date()
|
const newDate = new Date()
|
||||||
newDate.setDate(newDate.getDate() + interval)
|
newDate.setDate(newDate.getDate() + interval)
|
||||||
|
|
|
@ -172,6 +172,7 @@
|
||||||
"search": "Type to search for a list…",
|
"search": "Type to search for a list…",
|
||||||
"searchSelect": "Click or press enter to select this list",
|
"searchSelect": "Click or press enter to select this list",
|
||||||
"shared": "Shared Lists",
|
"shared": "Shared Lists",
|
||||||
|
"noDescriptionAvailable": "No list description is available.",
|
||||||
"create": {
|
"create": {
|
||||||
"header": "New list",
|
"header": "New list",
|
||||||
"titlePlaceholder": "The list's title goes here…",
|
"titlePlaceholder": "The list's title goes here…",
|
||||||
|
@ -242,7 +243,9 @@
|
||||||
"remove": "Remove a link share",
|
"remove": "Remove a link share",
|
||||||
"removeText": "Are you sure you want to remove this link share? It will no longer be possible to access this list with this link share. This cannot be undone!",
|
"removeText": "Are you sure you want to remove this link share? It will no longer be possible to access this list with this link share. This cannot be undone!",
|
||||||
"createSuccess": "The link share was successfully created.",
|
"createSuccess": "The link share was successfully created.",
|
||||||
"deleteSuccess": "The link share was successfully deleted"
|
"deleteSuccess": "The link share was successfully deleted",
|
||||||
|
"view": "View",
|
||||||
|
"sharedBy": "Shared by {0}"
|
||||||
},
|
},
|
||||||
"userTeam": {
|
"userTeam": {
|
||||||
"typeUser": "user | users",
|
"typeUser": "user | users",
|
||||||
|
@ -264,9 +267,6 @@
|
||||||
},
|
},
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"link": "Link",
|
"link": "Link",
|
||||||
"name": "Name",
|
|
||||||
"sharedBy": "Shared by",
|
|
||||||
"right": "Right",
|
|
||||||
"delete": "Delete"
|
"delete": "Delete"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -870,7 +870,8 @@
|
||||||
"related": "Modify related tasks of this task",
|
"related": "Modify related tasks of this task",
|
||||||
"color": "Change the color of this task",
|
"color": "Change the color of this task",
|
||||||
"move": "Move this task to another list",
|
"move": "Move this task to another list",
|
||||||
"reminder": "Manage reminders of this task"
|
"reminder": "Manage reminders of this task",
|
||||||
|
"description": "Toggle editing of the task description"
|
||||||
},
|
},
|
||||||
"list": {
|
"list": {
|
||||||
"title": "List Views",
|
"title": "List Views",
|
||||||
|
|
|
@ -172,6 +172,7 @@
|
||||||
"search": "Začni psát pro vyhledání seznamu…",
|
"search": "Začni psát pro vyhledání seznamu…",
|
||||||
"searchSelect": "Klikněte nebo stiskněte Enter pro výběr tohoto seznamu",
|
"searchSelect": "Klikněte nebo stiskněte Enter pro výběr tohoto seznamu",
|
||||||
"shared": "Sdílené seznamy",
|
"shared": "Sdílené seznamy",
|
||||||
|
"noDescriptionAvailable": "No list description is available.",
|
||||||
"create": {
|
"create": {
|
||||||
"header": "Nový seznam",
|
"header": "Nový seznam",
|
||||||
"titlePlaceholder": "Název seznamu přijde sem…",
|
"titlePlaceholder": "Název seznamu přijde sem…",
|
||||||
|
@ -242,7 +243,9 @@
|
||||||
"remove": "Odstranit sdílený odkaz",
|
"remove": "Odstranit sdílený odkaz",
|
||||||
"removeText": "Jste si jisti, že chcete odstranit tento sdílený odkaz? K tomuto seznamu již nebude možné přistupovat s tímto sdíleným odkazem. Tuto akci nelze vrátit zpět!",
|
"removeText": "Jste si jisti, že chcete odstranit tento sdílený odkaz? K tomuto seznamu již nebude možné přistupovat s tímto sdíleným odkazem. Tuto akci nelze vrátit zpět!",
|
||||||
"createSuccess": "Sdílený odkaz byl úspěšně vytvořen.",
|
"createSuccess": "Sdílený odkaz byl úspěšně vytvořen.",
|
||||||
"deleteSuccess": "Sdílený odkaz byl úspěšně smazán"
|
"deleteSuccess": "Sdílený odkaz byl úspěšně smazán",
|
||||||
|
"view": "View",
|
||||||
|
"sharedBy": "Shared by {0}"
|
||||||
},
|
},
|
||||||
"userTeam": {
|
"userTeam": {
|
||||||
"typeUser": "uživatel | uživatelé",
|
"typeUser": "uživatel | uživatelé",
|
||||||
|
@ -264,9 +267,6 @@
|
||||||
},
|
},
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"link": "Odkaz",
|
"link": "Odkaz",
|
||||||
"name": "Název",
|
|
||||||
"sharedBy": "Sdíleno od",
|
|
||||||
"right": "Právo",
|
|
||||||
"delete": "Smazat"
|
"delete": "Smazat"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -870,7 +870,8 @@
|
||||||
"related": "Upravit související úkoly tohoto úkolu",
|
"related": "Upravit související úkoly tohoto úkolu",
|
||||||
"color": "Změnit barvu tohoto úkolu",
|
"color": "Změnit barvu tohoto úkolu",
|
||||||
"move": "Přesunout tento úkol do jiného seznamu",
|
"move": "Přesunout tento úkol do jiného seznamu",
|
||||||
"reminder": "Manage reminders of this task"
|
"reminder": "Manage reminders of this task",
|
||||||
|
"description": "Toggle editing of the task description"
|
||||||
},
|
},
|
||||||
"list": {
|
"list": {
|
||||||
"title": "Zobrazení seznamů",
|
"title": "Zobrazení seznamů",
|
||||||
|
|
|
@ -172,6 +172,7 @@
|
||||||
"search": "Tippe, um nach einer Liste zu suchen…",
|
"search": "Tippe, um nach einer Liste zu suchen…",
|
||||||
"searchSelect": "Klicke auf oder drücke die Eingabetaste, um diese Liste auszuwählen",
|
"searchSelect": "Klicke auf oder drücke die Eingabetaste, um diese Liste auszuwählen",
|
||||||
"shared": "Geteilte Listen",
|
"shared": "Geteilte Listen",
|
||||||
|
"noDescriptionAvailable": "Keine Listenbeschreibung verfügbar.",
|
||||||
"create": {
|
"create": {
|
||||||
"header": "Neue Liste",
|
"header": "Neue Liste",
|
||||||
"titlePlaceholder": "Der Titel der Liste steht hier…",
|
"titlePlaceholder": "Der Titel der Liste steht hier…",
|
||||||
|
@ -242,7 +243,9 @@
|
||||||
"remove": "Eine Linkfreigabe löschen",
|
"remove": "Eine Linkfreigabe löschen",
|
||||||
"removeText": "Bist du sicher, dass du diese Linkfreigabe unwiderruflich löschen möchtest? Über die Linkfreigabe ist danach der Zugriff auf die Liste nicht mehr möglich!",
|
"removeText": "Bist du sicher, dass du diese Linkfreigabe unwiderruflich löschen möchtest? Über die Linkfreigabe ist danach der Zugriff auf die Liste nicht mehr möglich!",
|
||||||
"createSuccess": "Die Linkfreigabe wurde erfolgreich erstellt.",
|
"createSuccess": "Die Linkfreigabe wurde erfolgreich erstellt.",
|
||||||
"deleteSuccess": "Die Linkfreigabe wurde erfolgreich gelöscht"
|
"deleteSuccess": "Die Linkfreigabe wurde erfolgreich gelöscht",
|
||||||
|
"view": "Ansicht",
|
||||||
|
"sharedBy": "Von {0} geteilt"
|
||||||
},
|
},
|
||||||
"userTeam": {
|
"userTeam": {
|
||||||
"typeUser": "Benutzer:in | Benutzer:innen",
|
"typeUser": "Benutzer:in | Benutzer:innen",
|
||||||
|
@ -264,9 +267,6 @@
|
||||||
},
|
},
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"link": "Link",
|
"link": "Link",
|
||||||
"name": "Name",
|
|
||||||
"sharedBy": "Geteilt von",
|
|
||||||
"right": "Berechtigungen",
|
|
||||||
"delete": "Löschen"
|
"delete": "Löschen"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -870,7 +870,8 @@
|
||||||
"related": "Ändere die Abhängigen Aufgaben dieser Aufgabe",
|
"related": "Ändere die Abhängigen Aufgaben dieser Aufgabe",
|
||||||
"color": "Die Farbe dieser Aufgabe ändern",
|
"color": "Die Farbe dieser Aufgabe ändern",
|
||||||
"move": "Diese Aufgabe in eine andere Liste verschieben",
|
"move": "Diese Aufgabe in eine andere Liste verschieben",
|
||||||
"reminder": "Erinnerungen für diese Aufgabe verwalten"
|
"reminder": "Erinnerungen für diese Aufgabe verwalten",
|
||||||
|
"description": "Aufgabenbeschreibung bearbeiten"
|
||||||
},
|
},
|
||||||
"list": {
|
"list": {
|
||||||
"title": "Listenansicht",
|
"title": "Listenansicht",
|
||||||
|
|
|
@ -172,6 +172,7 @@
|
||||||
"search": "Schriib, um nachere Liste z'sueche…",
|
"search": "Schriib, um nachere Liste z'sueche…",
|
||||||
"searchSelect": "Druck uf Enter um die Liste uuszwähle",
|
"searchSelect": "Druck uf Enter um die Liste uuszwähle",
|
||||||
"shared": "Teilti Liste",
|
"shared": "Teilti Liste",
|
||||||
|
"noDescriptionAvailable": "Keine Listenbeschreibung verfügbar.",
|
||||||
"create": {
|
"create": {
|
||||||
"header": "Neue Liste",
|
"header": "Neue Liste",
|
||||||
"titlePlaceholder": "Listetitl da ahgeh…",
|
"titlePlaceholder": "Listetitl da ahgeh…",
|
||||||
|
@ -242,7 +243,9 @@
|
||||||
"remove": "Linkfreigab lösche",
|
"remove": "Linkfreigab lösche",
|
||||||
"removeText": "Bisch du sicher, dass du die Freigab lösche wetsch? Es wird nüme möglich sii, die Liste mit dem Link z'erreiche. Das chann nid rückgängig gmacht werde!",
|
"removeText": "Bisch du sicher, dass du die Freigab lösche wetsch? Es wird nüme möglich sii, die Liste mit dem Link z'erreiche. Das chann nid rückgängig gmacht werde!",
|
||||||
"createSuccess": "De Freigabelink isch erfolgriich erstellt wore.",
|
"createSuccess": "De Freigabelink isch erfolgriich erstellt wore.",
|
||||||
"deleteSuccess": "De g'teilti Link isch erfolgriich g'chüblet wore"
|
"deleteSuccess": "De g'teilti Link isch erfolgriich g'chüblet wore",
|
||||||
|
"view": "Ansicht",
|
||||||
|
"sharedBy": "Von {0} geteilt"
|
||||||
},
|
},
|
||||||
"userTeam": {
|
"userTeam": {
|
||||||
"typeUser": "Benutzer | Benutzer",
|
"typeUser": "Benutzer | Benutzer",
|
||||||
|
@ -264,9 +267,6 @@
|
||||||
},
|
},
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"link": "Link",
|
"link": "Link",
|
||||||
"name": "Namä",
|
|
||||||
"sharedBy": "Teilt vo",
|
|
||||||
"right": "Rechts",
|
|
||||||
"delete": "Chüble"
|
"delete": "Chüble"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -870,7 +870,8 @@
|
||||||
"related": "Beziehige vo dere Uufgab bearbeite",
|
"related": "Beziehige vo dere Uufgab bearbeite",
|
||||||
"color": "Die Farbe dieser Aufgabe ändern",
|
"color": "Die Farbe dieser Aufgabe ändern",
|
||||||
"move": "Diese Aufgabe in eine andere Liste verschieben",
|
"move": "Diese Aufgabe in eine andere Liste verschieben",
|
||||||
"reminder": "Erinnerungen für diese Aufgabe verwalten"
|
"reminder": "Erinnerungen für diese Aufgabe verwalten",
|
||||||
|
"description": "Aufgabenbeschreibung bearbeiten"
|
||||||
},
|
},
|
||||||
"list": {
|
"list": {
|
||||||
"title": "Listenansicht",
|
"title": "Listenansicht",
|
||||||
|
|
|
@ -172,6 +172,7 @@
|
||||||
"search": "Type to search for a list…",
|
"search": "Type to search for a list…",
|
||||||
"searchSelect": "Click or press enter to select this list",
|
"searchSelect": "Click or press enter to select this list",
|
||||||
"shared": "Shared Lists",
|
"shared": "Shared Lists",
|
||||||
|
"noDescriptionAvailable": "No list description is available.",
|
||||||
"create": {
|
"create": {
|
||||||
"header": "New list",
|
"header": "New list",
|
||||||
"titlePlaceholder": "The list's title goes here…",
|
"titlePlaceholder": "The list's title goes here…",
|
||||||
|
@ -242,7 +243,9 @@
|
||||||
"remove": "Remove a link share",
|
"remove": "Remove a link share",
|
||||||
"removeText": "Are you sure you want to remove this link share? It will no longer be possible to access this list with this link share. This cannot be undone!",
|
"removeText": "Are you sure you want to remove this link share? It will no longer be possible to access this list with this link share. This cannot be undone!",
|
||||||
"createSuccess": "The link share was successfully created.",
|
"createSuccess": "The link share was successfully created.",
|
||||||
"deleteSuccess": "The link share was successfully deleted"
|
"deleteSuccess": "The link share was successfully deleted",
|
||||||
|
"view": "View",
|
||||||
|
"sharedBy": "Shared by {0}"
|
||||||
},
|
},
|
||||||
"userTeam": {
|
"userTeam": {
|
||||||
"typeUser": "user | users",
|
"typeUser": "user | users",
|
||||||
|
@ -264,9 +267,6 @@
|
||||||
},
|
},
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"link": "Link",
|
"link": "Link",
|
||||||
"name": "Name",
|
|
||||||
"sharedBy": "Shared by",
|
|
||||||
"right": "Right",
|
|
||||||
"delete": "Delete"
|
"delete": "Delete"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -172,6 +172,7 @@
|
||||||
"search": "Type to search for a list…",
|
"search": "Type to search for a list…",
|
||||||
"searchSelect": "Click or press enter to select this list",
|
"searchSelect": "Click or press enter to select this list",
|
||||||
"shared": "Shared Lists",
|
"shared": "Shared Lists",
|
||||||
|
"noDescriptionAvailable": "No list description is available.",
|
||||||
"create": {
|
"create": {
|
||||||
"header": "New list",
|
"header": "New list",
|
||||||
"titlePlaceholder": "The list's title goes here…",
|
"titlePlaceholder": "The list's title goes here…",
|
||||||
|
@ -242,7 +243,9 @@
|
||||||
"remove": "Remove a link share",
|
"remove": "Remove a link share",
|
||||||
"removeText": "Are you sure you want to remove this link share? It will no longer be possible to access this list with this link share. This cannot be undone!",
|
"removeText": "Are you sure you want to remove this link share? It will no longer be possible to access this list with this link share. This cannot be undone!",
|
||||||
"createSuccess": "The link share was successfully created.",
|
"createSuccess": "The link share was successfully created.",
|
||||||
"deleteSuccess": "The link share was successfully deleted"
|
"deleteSuccess": "The link share was successfully deleted",
|
||||||
|
"view": "View",
|
||||||
|
"sharedBy": "Shared by {0}"
|
||||||
},
|
},
|
||||||
"userTeam": {
|
"userTeam": {
|
||||||
"typeUser": "user | users",
|
"typeUser": "user | users",
|
||||||
|
@ -264,9 +267,6 @@
|
||||||
},
|
},
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"link": "Link",
|
"link": "Link",
|
||||||
"name": "Name",
|
|
||||||
"sharedBy": "Shared by",
|
|
||||||
"right": "Right",
|
|
||||||
"delete": "Delete"
|
"delete": "Delete"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -870,7 +870,8 @@
|
||||||
"related": "Modify related tasks of this task",
|
"related": "Modify related tasks of this task",
|
||||||
"color": "Change the color of this task",
|
"color": "Change the color of this task",
|
||||||
"move": "Move this task to another list",
|
"move": "Move this task to another list",
|
||||||
"reminder": "Manage reminders of this task"
|
"reminder": "Manage reminders of this task",
|
||||||
|
"description": "Toggle editing of the task description"
|
||||||
},
|
},
|
||||||
"list": {
|
"list": {
|
||||||
"title": "List Views",
|
"title": "List Views",
|
||||||
|
|
|
@ -172,6 +172,7 @@
|
||||||
"search": "Écris pour rechercher une liste…",
|
"search": "Écris pour rechercher une liste…",
|
||||||
"searchSelect": "Clique ou appuie sur la touche Entrée pour sélectionner cette liste",
|
"searchSelect": "Clique ou appuie sur la touche Entrée pour sélectionner cette liste",
|
||||||
"shared": "Listes partagées",
|
"shared": "Listes partagées",
|
||||||
|
"noDescriptionAvailable": "No list description is available.",
|
||||||
"create": {
|
"create": {
|
||||||
"header": "Nouvelle liste",
|
"header": "Nouvelle liste",
|
||||||
"titlePlaceholder": "Entre le nom de la liste…",
|
"titlePlaceholder": "Entre le nom de la liste…",
|
||||||
|
@ -242,7 +243,9 @@
|
||||||
"remove": "Retirer un lien de partage",
|
"remove": "Retirer un lien de partage",
|
||||||
"removeText": "Retirer ce partage de lien ? Il ne sera plus possible d’accéder à cette liste avec ce partage de lien. Cette opération ne peut être annulée !",
|
"removeText": "Retirer ce partage de lien ? Il ne sera plus possible d’accéder à cette liste avec ce partage de lien. Cette opération ne peut être annulée !",
|
||||||
"createSuccess": "Partage créé.",
|
"createSuccess": "Partage créé.",
|
||||||
"deleteSuccess": "Lien supprimé"
|
"deleteSuccess": "Lien supprimé",
|
||||||
|
"view": "View",
|
||||||
|
"sharedBy": "Shared by {0}"
|
||||||
},
|
},
|
||||||
"userTeam": {
|
"userTeam": {
|
||||||
"typeUser": "utilisateur·rice | utilisateur·rice·s",
|
"typeUser": "utilisateur·rice | utilisateur·rice·s",
|
||||||
|
@ -264,9 +267,6 @@
|
||||||
},
|
},
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"link": "Lien",
|
"link": "Lien",
|
||||||
"name": "Nom",
|
|
||||||
"sharedBy": "Partagé par",
|
|
||||||
"right": "Droit",
|
|
||||||
"delete": "Supprimer"
|
"delete": "Supprimer"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -870,7 +870,8 @@
|
||||||
"related": "Modifier les tâches connexes de cette tâche",
|
"related": "Modifier les tâches connexes de cette tâche",
|
||||||
"color": "Changer la couleur de cette tâche",
|
"color": "Changer la couleur de cette tâche",
|
||||||
"move": "Déplacer cette tâche dans une autre liste",
|
"move": "Déplacer cette tâche dans une autre liste",
|
||||||
"reminder": "Manage reminders of this task"
|
"reminder": "Manage reminders of this task",
|
||||||
|
"description": "Toggle editing of the task description"
|
||||||
},
|
},
|
||||||
"list": {
|
"list": {
|
||||||
"title": "Vues en liste",
|
"title": "Vues en liste",
|
||||||
|
|
|
@ -87,7 +87,7 @@
|
||||||
"language": "Lingua",
|
"language": "Lingua",
|
||||||
"defaultList": "Lista predefinita",
|
"defaultList": "Lista predefinita",
|
||||||
"timezone": "Fuso Orario",
|
"timezone": "Fuso Orario",
|
||||||
"overdueTasksRemindersTime": "Orario email del promemoria attività in ritardo"
|
"overdueTasksRemindersTime": "Orario email attività in scadute"
|
||||||
},
|
},
|
||||||
"totp": {
|
"totp": {
|
||||||
"title": "Autenticazione a due fattori",
|
"title": "Autenticazione a due fattori",
|
||||||
|
@ -172,6 +172,7 @@
|
||||||
"search": "Digita per cercare una lista…",
|
"search": "Digita per cercare una lista…",
|
||||||
"searchSelect": "Fare clic o premere invio per selezionare questa lista",
|
"searchSelect": "Fare clic o premere invio per selezionare questa lista",
|
||||||
"shared": "Liste Condivise",
|
"shared": "Liste Condivise",
|
||||||
|
"noDescriptionAvailable": "Nessuna descrizione della lista disponibile.",
|
||||||
"create": {
|
"create": {
|
||||||
"header": "Nuova lista",
|
"header": "Nuova lista",
|
||||||
"titlePlaceholder": "Il titolo della lista va qui…",
|
"titlePlaceholder": "Il titolo della lista va qui…",
|
||||||
|
@ -242,7 +243,9 @@
|
||||||
"remove": "Rimuovi un link di condivisione",
|
"remove": "Rimuovi un link di condivisione",
|
||||||
"removeText": "Sei sicuro di voler rimuovere questo link di condivisione? Non sarà più possibile accedere a questa lista con questo link. Non può essere ripristinato!",
|
"removeText": "Sei sicuro di voler rimuovere questo link di condivisione? Non sarà più possibile accedere a questa lista con questo link. Non può essere ripristinato!",
|
||||||
"createSuccess": "Link di condivisione creato.",
|
"createSuccess": "Link di condivisione creato.",
|
||||||
"deleteSuccess": "Link di condivisione elimitato"
|
"deleteSuccess": "Link di condivisione elimitato",
|
||||||
|
"view": "Mostra",
|
||||||
|
"sharedBy": "Condiviso da {0}"
|
||||||
},
|
},
|
||||||
"userTeam": {
|
"userTeam": {
|
||||||
"typeUser": "utente | utenti",
|
"typeUser": "utente | utenti",
|
||||||
|
@ -264,9 +267,6 @@
|
||||||
},
|
},
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"link": "Link",
|
"link": "Link",
|
||||||
"name": "Nome",
|
|
||||||
"sharedBy": "Condiviso da",
|
|
||||||
"right": "Permessi",
|
|
||||||
"delete": "Elimina"
|
"delete": "Elimina"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -562,12 +562,12 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"datemathHelp": {
|
"datemathHelp": {
|
||||||
"canuse": "You can use date math to filter for relative dates.",
|
"canuse": "Puoi usare le date calcolate per filtrare per date relative.",
|
||||||
"learnhow": "Scopri come funziona",
|
"learnhow": "Scopri come funziona",
|
||||||
"title": "Date Math",
|
"title": "Date Calcolate",
|
||||||
"intro": "Date Math allows you to specify relative dates which are resolved on the fly by Vikunja when applying the filter.",
|
"intro": "Le Date Calcolate ti permettono di specificare date relative che vengono calcolate al volo da Vikunja quando viene applicato il filtro.",
|
||||||
"expression": "Each Date Math expression starts with an anchor date, which can either be {0}, or a date string ending with {1}. This anchor date can optionally be followed by one or more maths expressions.",
|
"expression": "Ogni Data Calcolata inizia con una data base, che può essere {0}, o una data con {1} alla fine. Questa data base può essere seguita da una o più espressioni matematiche.",
|
||||||
"similar": "These expressions are similar to the ones provided by {0} and {1}.",
|
"similar": "Queste espressioni sono simili a quelle fornite da {0} e {1}.",
|
||||||
"add1Day": "Aggiungi un giorno",
|
"add1Day": "Aggiungi un giorno",
|
||||||
"minus1Day": "Sottrai un giorno",
|
"minus1Day": "Sottrai un giorno",
|
||||||
"roundDay": "Arrotonda per difetto al giorno più vicino",
|
"roundDay": "Arrotonda per difetto al giorno più vicino",
|
||||||
|
@ -781,7 +781,7 @@
|
||||||
"weeks": "Settimane",
|
"weeks": "Settimane",
|
||||||
"months": "Mesi",
|
"months": "Mesi",
|
||||||
"years": "Anni",
|
"years": "Anni",
|
||||||
"invalidAmount": "Please enter more than 0."
|
"invalidAmount": "Inserisci più di 0."
|
||||||
},
|
},
|
||||||
"quickAddMagic": {
|
"quickAddMagic": {
|
||||||
"hint": "Puoi usare l'Aggiunta Rapida Magica",
|
"hint": "Puoi usare l'Aggiunta Rapida Magica",
|
||||||
|
@ -791,15 +791,15 @@
|
||||||
"multiple": "Puoi usarlo più volte.",
|
"multiple": "Puoi usarlo più volte.",
|
||||||
"label1": "Per aggiungere un'etichetta, basta aggiungere il nome dell'etichetta preceduto da {prefix}.",
|
"label1": "Per aggiungere un'etichetta, basta aggiungere il nome dell'etichetta preceduto da {prefix}.",
|
||||||
"label2": "Vikunja controllerà prima se l'etichetta esiste già e nel caso la creerà.",
|
"label2": "Vikunja controllerà prima se l'etichetta esiste già e nel caso la creerà.",
|
||||||
"label3": "To use spaces, simply add a \" or ' around the label name.",
|
"label3": "Per usare gli spazi, basta aggiungere un \" o ' prima e dopo il nome dell'etichetta.",
|
||||||
"label4": "Per esempio: {prefix}\"Etichetta con spazi\".",
|
"label4": "Per esempio: {prefix}\"Etichetta con spazi\".",
|
||||||
"priority1": "Per impostare la priorità di un'attività, aggiungi un numero 1-5, preceduto da {prefix}.",
|
"priority1": "Per impostare la priorità di un'attività, aggiungi un numero 1-5, preceduto da {prefix}.",
|
||||||
"priority2": "Più alto è il numero, più alta è la priorità.",
|
"priority2": "Più alto è il numero, più alta è la priorità.",
|
||||||
"assignees": "Per assegnare direttamente l'attività a un utente, aggiungere il suo nome utente preceduto da {prefix} all'attività.",
|
"assignees": "Per assegnare direttamente l'attività a un utente, aggiungere il suo nome utente preceduto da {prefix} all'attività.",
|
||||||
"list1": "Per impostare una lista di appartenenza all'attività, inserisci il suo nome prefisso con {prefix}.",
|
"list1": "Per impostare una lista di appartenenza all'attività, inserisci il suo nome prefisso con {prefix}.",
|
||||||
"list2": "Ciò restituirà un errore se la lista non esiste.",
|
"list2": "Ciò restituirà un errore se la lista non esiste.",
|
||||||
"list3": "To use spaces, simply add a \" or ' around the list name.",
|
"list3": "Per usare gli spazi, basta aggiungere un \" o ' prima e dopo il nome della lista.",
|
||||||
"list4": "For example: {prefix}\"List with spaces\".",
|
"list4": "Per esempio: {prefix}\"Etichetta con spazi\".",
|
||||||
"dateAndTime": "Data e ora",
|
"dateAndTime": "Data e ora",
|
||||||
"date": "Qualsiasi data verrà utilizzata come data di scadenza della nuova attività. È possibile utilizzare le date in uno qualsiasi di questi formati:",
|
"date": "Qualsiasi data verrà utilizzata come data di scadenza della nuova attività. È possibile utilizzare le date in uno qualsiasi di questi formati:",
|
||||||
"dateWeekday": "qualsiasi giorno della settimana, userà la data più vicina",
|
"dateWeekday": "qualsiasi giorno della settimana, userà la data più vicina",
|
||||||
|
@ -870,7 +870,8 @@
|
||||||
"related": "Modifica le attività collegate a questa",
|
"related": "Modifica le attività collegate a questa",
|
||||||
"color": "Cambia il colore di questa attività",
|
"color": "Cambia il colore di questa attività",
|
||||||
"move": "Sposta questa attività in un altro elenco",
|
"move": "Sposta questa attività in un altro elenco",
|
||||||
"reminder": "Gestisci i promemoria di questa attività"
|
"reminder": "Gestisci i promemoria di questa attività",
|
||||||
|
"description": "Attiva/Disattiva modifica della descrizione dell'attività"
|
||||||
},
|
},
|
||||||
"list": {
|
"list": {
|
||||||
"title": "Viste Liste",
|
"title": "Viste Liste",
|
||||||
|
|
|
@ -172,6 +172,7 @@
|
||||||
"search": "Typ om naar een lijst te zoeken…",
|
"search": "Typ om naar een lijst te zoeken…",
|
||||||
"searchSelect": "Klik of druk op enter om deze lijst te selecteren",
|
"searchSelect": "Klik of druk op enter om deze lijst te selecteren",
|
||||||
"shared": "Gedeelde lijsten",
|
"shared": "Gedeelde lijsten",
|
||||||
|
"noDescriptionAvailable": "No list description is available.",
|
||||||
"create": {
|
"create": {
|
||||||
"header": "Nieuwe lijst",
|
"header": "Nieuwe lijst",
|
||||||
"titlePlaceholder": "De titel van de lijst komt hier…",
|
"titlePlaceholder": "De titel van de lijst komt hier…",
|
||||||
|
@ -242,7 +243,9 @@
|
||||||
"remove": "Remove a link share",
|
"remove": "Remove a link share",
|
||||||
"removeText": "Are you sure you want to remove this link share? It will no longer be possible to access this list with this link share. This cannot be undone!",
|
"removeText": "Are you sure you want to remove this link share? It will no longer be possible to access this list with this link share. This cannot be undone!",
|
||||||
"createSuccess": "The link share was successfully created.",
|
"createSuccess": "The link share was successfully created.",
|
||||||
"deleteSuccess": "The link share was successfully deleted"
|
"deleteSuccess": "The link share was successfully deleted",
|
||||||
|
"view": "View",
|
||||||
|
"sharedBy": "Shared by {0}"
|
||||||
},
|
},
|
||||||
"userTeam": {
|
"userTeam": {
|
||||||
"typeUser": "gebruiker | gebruikers",
|
"typeUser": "gebruiker | gebruikers",
|
||||||
|
@ -264,9 +267,6 @@
|
||||||
},
|
},
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"link": "Link",
|
"link": "Link",
|
||||||
"name": "Naam",
|
|
||||||
"sharedBy": "Gedeeld door",
|
|
||||||
"right": "Rechten",
|
|
||||||
"delete": "Verwijderen"
|
"delete": "Verwijderen"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -870,7 +870,8 @@
|
||||||
"related": "Modify related tasks of this task",
|
"related": "Modify related tasks of this task",
|
||||||
"color": "Change the color of this task",
|
"color": "Change the color of this task",
|
||||||
"move": "Move this task to another list",
|
"move": "Move this task to another list",
|
||||||
"reminder": "Manage reminders of this task"
|
"reminder": "Manage reminders of this task",
|
||||||
|
"description": "Toggle editing of the task description"
|
||||||
},
|
},
|
||||||
"list": {
|
"list": {
|
||||||
"title": "List Views",
|
"title": "List Views",
|
||||||
|
|
|
@ -172,6 +172,7 @@
|
||||||
"search": "Wpisz, aby wyszukać listę…",
|
"search": "Wpisz, aby wyszukać listę…",
|
||||||
"searchSelect": "Kliknij lub naciśnij Enter, aby wybrać tę listę",
|
"searchSelect": "Kliknij lub naciśnij Enter, aby wybrać tę listę",
|
||||||
"shared": "Współdzielone listy",
|
"shared": "Współdzielone listy",
|
||||||
|
"noDescriptionAvailable": "No list description is available.",
|
||||||
"create": {
|
"create": {
|
||||||
"header": "Nowa lista",
|
"header": "Nowa lista",
|
||||||
"titlePlaceholder": "Tu wpisz tytuł listy…",
|
"titlePlaceholder": "Tu wpisz tytuł listy…",
|
||||||
|
@ -242,7 +243,9 @@
|
||||||
"remove": "Usuń link",
|
"remove": "Usuń link",
|
||||||
"removeText": "Czy na pewno chcesz usunąć ten link? Dostęp do tej listy z tym linkiem nie będzie już możliwy. Tego nie da się cofnąć!",
|
"removeText": "Czy na pewno chcesz usunąć ten link? Dostęp do tej listy z tym linkiem nie będzie już możliwy. Tego nie da się cofnąć!",
|
||||||
"createSuccess": "Pomyślnie utworzono udostępniony link.",
|
"createSuccess": "Pomyślnie utworzono udostępniony link.",
|
||||||
"deleteSuccess": "Udostępniony link został pomyślnie usunięty"
|
"deleteSuccess": "Udostępniony link został pomyślnie usunięty",
|
||||||
|
"view": "View",
|
||||||
|
"sharedBy": "Shared by {0}"
|
||||||
},
|
},
|
||||||
"userTeam": {
|
"userTeam": {
|
||||||
"typeUser": "użytkownik(a) | użytkownikom",
|
"typeUser": "użytkownik(a) | użytkownikom",
|
||||||
|
@ -264,9 +267,6 @@
|
||||||
},
|
},
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"link": "Link",
|
"link": "Link",
|
||||||
"name": "Nazwa",
|
|
||||||
"sharedBy": "Udostępniony przez",
|
|
||||||
"right": "Uprawnienia",
|
|
||||||
"delete": "Usuń"
|
"delete": "Usuń"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -870,7 +870,8 @@
|
||||||
"related": "Zmodyfikuj zadania powiązane z tym zadaniem",
|
"related": "Zmodyfikuj zadania powiązane z tym zadaniem",
|
||||||
"color": "Zmień kolor tego zadania",
|
"color": "Zmień kolor tego zadania",
|
||||||
"move": "Przenieś to zadanie do innej listy",
|
"move": "Przenieś to zadanie do innej listy",
|
||||||
"reminder": "Zarządzaj przypomnieniami o tym zadaniu"
|
"reminder": "Zarządzaj przypomnieniami o tym zadaniu",
|
||||||
|
"description": "Toggle editing of the task description"
|
||||||
},
|
},
|
||||||
"list": {
|
"list": {
|
||||||
"title": "Widoki listy",
|
"title": "Widoki listy",
|
||||||
|
|
|
@ -172,6 +172,7 @@
|
||||||
"search": "Type to search for a list…",
|
"search": "Type to search for a list…",
|
||||||
"searchSelect": "Click or press enter to select this list",
|
"searchSelect": "Click or press enter to select this list",
|
||||||
"shared": "Shared Lists",
|
"shared": "Shared Lists",
|
||||||
|
"noDescriptionAvailable": "No list description is available.",
|
||||||
"create": {
|
"create": {
|
||||||
"header": "New list",
|
"header": "New list",
|
||||||
"titlePlaceholder": "The list's title goes here…",
|
"titlePlaceholder": "The list's title goes here…",
|
||||||
|
@ -242,7 +243,9 @@
|
||||||
"remove": "Remove a link share",
|
"remove": "Remove a link share",
|
||||||
"removeText": "Are you sure you want to remove this link share? It will no longer be possible to access this list with this link share. This cannot be undone!",
|
"removeText": "Are you sure you want to remove this link share? It will no longer be possible to access this list with this link share. This cannot be undone!",
|
||||||
"createSuccess": "The link share was successfully created.",
|
"createSuccess": "The link share was successfully created.",
|
||||||
"deleteSuccess": "The link share was successfully deleted"
|
"deleteSuccess": "The link share was successfully deleted",
|
||||||
|
"view": "View",
|
||||||
|
"sharedBy": "Shared by {0}"
|
||||||
},
|
},
|
||||||
"userTeam": {
|
"userTeam": {
|
||||||
"typeUser": "user | users",
|
"typeUser": "user | users",
|
||||||
|
@ -264,9 +267,6 @@
|
||||||
},
|
},
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"link": "Link",
|
"link": "Link",
|
||||||
"name": "Name",
|
|
||||||
"sharedBy": "Shared by",
|
|
||||||
"right": "Right",
|
|
||||||
"delete": "Delete"
|
"delete": "Delete"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -870,7 +870,8 @@
|
||||||
"related": "Modify related tasks of this task",
|
"related": "Modify related tasks of this task",
|
||||||
"color": "Change the color of this task",
|
"color": "Change the color of this task",
|
||||||
"move": "Move this task to another list",
|
"move": "Move this task to another list",
|
||||||
"reminder": "Manage reminders of this task"
|
"reminder": "Manage reminders of this task",
|
||||||
|
"description": "Toggle editing of the task description"
|
||||||
},
|
},
|
||||||
"list": {
|
"list": {
|
||||||
"title": "List Views",
|
"title": "List Views",
|
||||||
|
|
|
@ -172,6 +172,7 @@
|
||||||
"search": "Escreve para pesquisar por uma lista…",
|
"search": "Escreve para pesquisar por uma lista…",
|
||||||
"searchSelect": "Clica ou pressiona Enter para selecionar esta lista",
|
"searchSelect": "Clica ou pressiona Enter para selecionar esta lista",
|
||||||
"shared": "Listas Partilhadas",
|
"shared": "Listas Partilhadas",
|
||||||
|
"noDescriptionAvailable": "Não está disponível nenhuma descrição da lista.",
|
||||||
"create": {
|
"create": {
|
||||||
"header": "Nova lista",
|
"header": "Nova lista",
|
||||||
"titlePlaceholder": "O título da lista será aqui…",
|
"titlePlaceholder": "O título da lista será aqui…",
|
||||||
|
@ -242,7 +243,9 @@
|
||||||
"remove": "Remover um link partilhado",
|
"remove": "Remover um link partilhado",
|
||||||
"removeText": "Tens a certeza que queres remover este link partilhado? Não será mais possível aceder a esta lista utilizando este link partilhado. Isto não pode ser revertido!",
|
"removeText": "Tens a certeza que queres remover este link partilhado? Não será mais possível aceder a esta lista utilizando este link partilhado. Isto não pode ser revertido!",
|
||||||
"createSuccess": "O link partilhado foi criado com sucesso.",
|
"createSuccess": "O link partilhado foi criado com sucesso.",
|
||||||
"deleteSuccess": "O link partilhado foi eliminado com sucesso"
|
"deleteSuccess": "O link partilhado foi eliminado com sucesso",
|
||||||
|
"view": "Visualizar",
|
||||||
|
"sharedBy": "Partilhado por {0}"
|
||||||
},
|
},
|
||||||
"userTeam": {
|
"userTeam": {
|
||||||
"typeUser": "utilizador | utilizadores",
|
"typeUser": "utilizador | utilizadores",
|
||||||
|
@ -264,9 +267,6 @@
|
||||||
},
|
},
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"link": "Link",
|
"link": "Link",
|
||||||
"name": "Nome",
|
|
||||||
"sharedBy": "Partilhado por",
|
|
||||||
"right": "Permissões",
|
|
||||||
"delete": "Eliminar"
|
"delete": "Eliminar"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -781,7 +781,7 @@
|
||||||
"weeks": "Semanas",
|
"weeks": "Semanas",
|
||||||
"months": "Meses",
|
"months": "Meses",
|
||||||
"years": "Anos",
|
"years": "Anos",
|
||||||
"invalidAmount": "Please enter more than 0."
|
"invalidAmount": "Por favor, insere mais do que 0."
|
||||||
},
|
},
|
||||||
"quickAddMagic": {
|
"quickAddMagic": {
|
||||||
"hint": "Podes utilizar a Introdução Mágica Rápida",
|
"hint": "Podes utilizar a Introdução Mágica Rápida",
|
||||||
|
@ -870,7 +870,8 @@
|
||||||
"related": "Modificar as tarefas relacionadas desta tarefa",
|
"related": "Modificar as tarefas relacionadas desta tarefa",
|
||||||
"color": "Alterar a cor desta tarefa",
|
"color": "Alterar a cor desta tarefa",
|
||||||
"move": "Mover esta tarefa para outra lista",
|
"move": "Mover esta tarefa para outra lista",
|
||||||
"reminder": "Gerir lembretes desta tarefa"
|
"reminder": "Gerir lembretes desta tarefa",
|
||||||
|
"description": "Alternar edição da descrição da tarefa"
|
||||||
},
|
},
|
||||||
"list": {
|
"list": {
|
||||||
"title": "Visualização em Lista",
|
"title": "Visualização em Lista",
|
||||||
|
|
|
@ -172,6 +172,7 @@
|
||||||
"search": "Type to search for a list…",
|
"search": "Type to search for a list…",
|
||||||
"searchSelect": "Click or press enter to select this list",
|
"searchSelect": "Click or press enter to select this list",
|
||||||
"shared": "Shared Lists",
|
"shared": "Shared Lists",
|
||||||
|
"noDescriptionAvailable": "No list description is available.",
|
||||||
"create": {
|
"create": {
|
||||||
"header": "New list",
|
"header": "New list",
|
||||||
"titlePlaceholder": "The list's title goes here…",
|
"titlePlaceholder": "The list's title goes here…",
|
||||||
|
@ -242,7 +243,9 @@
|
||||||
"remove": "Remove a link share",
|
"remove": "Remove a link share",
|
||||||
"removeText": "Are you sure you want to remove this link share? It will no longer be possible to access this list with this link share. This cannot be undone!",
|
"removeText": "Are you sure you want to remove this link share? It will no longer be possible to access this list with this link share. This cannot be undone!",
|
||||||
"createSuccess": "The link share was successfully created.",
|
"createSuccess": "The link share was successfully created.",
|
||||||
"deleteSuccess": "The link share was successfully deleted"
|
"deleteSuccess": "The link share was successfully deleted",
|
||||||
|
"view": "View",
|
||||||
|
"sharedBy": "Shared by {0}"
|
||||||
},
|
},
|
||||||
"userTeam": {
|
"userTeam": {
|
||||||
"typeUser": "user | users",
|
"typeUser": "user | users",
|
||||||
|
@ -264,9 +267,6 @@
|
||||||
},
|
},
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"link": "Link",
|
"link": "Link",
|
||||||
"name": "Name",
|
|
||||||
"sharedBy": "Shared by",
|
|
||||||
"right": "Right",
|
|
||||||
"delete": "Delete"
|
"delete": "Delete"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -870,7 +870,8 @@
|
||||||
"related": "Modify related tasks of this task",
|
"related": "Modify related tasks of this task",
|
||||||
"color": "Change the color of this task",
|
"color": "Change the color of this task",
|
||||||
"move": "Move this task to another list",
|
"move": "Move this task to another list",
|
||||||
"reminder": "Manage reminders of this task"
|
"reminder": "Manage reminders of this task",
|
||||||
|
"description": "Toggle editing of the task description"
|
||||||
},
|
},
|
||||||
"list": {
|
"list": {
|
||||||
"title": "List Views",
|
"title": "List Views",
|
||||||
|
|
|
@ -172,6 +172,7 @@
|
||||||
"search": "Введи запрос для поиска списка…",
|
"search": "Введи запрос для поиска списка…",
|
||||||
"searchSelect": "Кликни или нажми Enter для выбора этого списка",
|
"searchSelect": "Кликни или нажми Enter для выбора этого списка",
|
||||||
"shared": "Общие списки",
|
"shared": "Общие списки",
|
||||||
|
"noDescriptionAvailable": "No list description is available.",
|
||||||
"create": {
|
"create": {
|
||||||
"header": "New list",
|
"header": "New list",
|
||||||
"titlePlaceholder": "Введи имя списка…",
|
"titlePlaceholder": "Введи имя списка…",
|
||||||
|
@ -242,7 +243,9 @@
|
||||||
"remove": "Удалить ссылку для обмена",
|
"remove": "Удалить ссылку для обмена",
|
||||||
"removeText": "Удалить эту ссылку для обмена? Больше не удастся получить доступ к списку через эту ссылку. Это действие отменить нельзя!",
|
"removeText": "Удалить эту ссылку для обмена? Больше не удастся получить доступ к списку через эту ссылку. Это действие отменить нельзя!",
|
||||||
"createSuccess": "Ссылка создана.",
|
"createSuccess": "Ссылка создана.",
|
||||||
"deleteSuccess": "Ссылка удалена"
|
"deleteSuccess": "Ссылка удалена",
|
||||||
|
"view": "View",
|
||||||
|
"sharedBy": "Shared by {0}"
|
||||||
},
|
},
|
||||||
"userTeam": {
|
"userTeam": {
|
||||||
"typeUser": "пользователь | пользователи",
|
"typeUser": "пользователь | пользователи",
|
||||||
|
@ -264,9 +267,6 @@
|
||||||
},
|
},
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"link": "Ссылка",
|
"link": "Ссылка",
|
||||||
"name": "Имя",
|
|
||||||
"sharedBy": "Создатель",
|
|
||||||
"right": "Права",
|
|
||||||
"delete": "Удалить"
|
"delete": "Удалить"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -870,7 +870,8 @@
|
||||||
"related": "Изменить связанные задачи",
|
"related": "Изменить связанные задачи",
|
||||||
"color": "Change the color of this task",
|
"color": "Change the color of this task",
|
||||||
"move": "Move this task to another list",
|
"move": "Move this task to another list",
|
||||||
"reminder": "Manage reminders of this task"
|
"reminder": "Manage reminders of this task",
|
||||||
|
"description": "Toggle editing of the task description"
|
||||||
},
|
},
|
||||||
"list": {
|
"list": {
|
||||||
"title": "List Views",
|
"title": "List Views",
|
||||||
|
|
|
@ -172,6 +172,7 @@
|
||||||
"search": "Type to search for a list…",
|
"search": "Type to search for a list…",
|
||||||
"searchSelect": "Click or press enter to select this list",
|
"searchSelect": "Click or press enter to select this list",
|
||||||
"shared": "Shared Lists",
|
"shared": "Shared Lists",
|
||||||
|
"noDescriptionAvailable": "No list description is available.",
|
||||||
"create": {
|
"create": {
|
||||||
"header": "New list",
|
"header": "New list",
|
||||||
"titlePlaceholder": "The list's title goes here…",
|
"titlePlaceholder": "The list's title goes here…",
|
||||||
|
@ -242,7 +243,9 @@
|
||||||
"remove": "Remove a link share",
|
"remove": "Remove a link share",
|
||||||
"removeText": "Are you sure you want to remove this link share? It will no longer be possible to access this list with this link share. This cannot be undone!",
|
"removeText": "Are you sure you want to remove this link share? It will no longer be possible to access this list with this link share. This cannot be undone!",
|
||||||
"createSuccess": "The link share was successfully created.",
|
"createSuccess": "The link share was successfully created.",
|
||||||
"deleteSuccess": "The link share was successfully deleted"
|
"deleteSuccess": "The link share was successfully deleted",
|
||||||
|
"view": "View",
|
||||||
|
"sharedBy": "Shared by {0}"
|
||||||
},
|
},
|
||||||
"userTeam": {
|
"userTeam": {
|
||||||
"typeUser": "user | users",
|
"typeUser": "user | users",
|
||||||
|
@ -264,9 +267,6 @@
|
||||||
},
|
},
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"link": "Link",
|
"link": "Link",
|
||||||
"name": "Name",
|
|
||||||
"sharedBy": "Shared by",
|
|
||||||
"right": "Right",
|
|
||||||
"delete": "Delete"
|
"delete": "Delete"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -870,7 +870,8 @@
|
||||||
"related": "Modify related tasks of this task",
|
"related": "Modify related tasks of this task",
|
||||||
"color": "Change the color of this task",
|
"color": "Change the color of this task",
|
||||||
"move": "Move this task to another list",
|
"move": "Move this task to another list",
|
||||||
"reminder": "Manage reminders of this task"
|
"reminder": "Manage reminders of this task",
|
||||||
|
"description": "Toggle editing of the task description"
|
||||||
},
|
},
|
||||||
"list": {
|
"list": {
|
||||||
"title": "List Views",
|
"title": "List Views",
|
||||||
|
|
|
@ -172,6 +172,7 @@
|
||||||
"search": "Type to search for a list…",
|
"search": "Type to search for a list…",
|
||||||
"searchSelect": "Click or press enter to select this list",
|
"searchSelect": "Click or press enter to select this list",
|
||||||
"shared": "Shared Lists",
|
"shared": "Shared Lists",
|
||||||
|
"noDescriptionAvailable": "No list description is available.",
|
||||||
"create": {
|
"create": {
|
||||||
"header": "New list",
|
"header": "New list",
|
||||||
"titlePlaceholder": "The list's title goes here…",
|
"titlePlaceholder": "The list's title goes here…",
|
||||||
|
@ -242,7 +243,9 @@
|
||||||
"remove": "Remove a link share",
|
"remove": "Remove a link share",
|
||||||
"removeText": "Are you sure you want to remove this link share? It will no longer be possible to access this list with this link share. This cannot be undone!",
|
"removeText": "Are you sure you want to remove this link share? It will no longer be possible to access this list with this link share. This cannot be undone!",
|
||||||
"createSuccess": "The link share was successfully created.",
|
"createSuccess": "The link share was successfully created.",
|
||||||
"deleteSuccess": "The link share was successfully deleted"
|
"deleteSuccess": "The link share was successfully deleted",
|
||||||
|
"view": "View",
|
||||||
|
"sharedBy": "Shared by {0}"
|
||||||
},
|
},
|
||||||
"userTeam": {
|
"userTeam": {
|
||||||
"typeUser": "user | users",
|
"typeUser": "user | users",
|
||||||
|
@ -264,9 +267,6 @@
|
||||||
},
|
},
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"link": "Link",
|
"link": "Link",
|
||||||
"name": "Name",
|
|
||||||
"sharedBy": "Shared by",
|
|
||||||
"right": "Right",
|
|
||||||
"delete": "Delete"
|
"delete": "Delete"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -870,7 +870,8 @@
|
||||||
"related": "Modify related tasks of this task",
|
"related": "Modify related tasks of this task",
|
||||||
"color": "Change the color of this task",
|
"color": "Change the color of this task",
|
||||||
"move": "Move this task to another list",
|
"move": "Move this task to another list",
|
||||||
"reminder": "Manage reminders of this task"
|
"reminder": "Manage reminders of this task",
|
||||||
|
"description": "Toggle editing of the task description"
|
||||||
},
|
},
|
||||||
"list": {
|
"list": {
|
||||||
"title": "List Views",
|
"title": "List Views",
|
||||||
|
|
|
@ -172,6 +172,7 @@
|
||||||
"search": "Type to search for a list…",
|
"search": "Type to search for a list…",
|
||||||
"searchSelect": "Click or press enter to select this list",
|
"searchSelect": "Click or press enter to select this list",
|
||||||
"shared": "Shared Lists",
|
"shared": "Shared Lists",
|
||||||
|
"noDescriptionAvailable": "No list description is available.",
|
||||||
"create": {
|
"create": {
|
||||||
"header": "New list",
|
"header": "New list",
|
||||||
"titlePlaceholder": "The list's title goes here…",
|
"titlePlaceholder": "The list's title goes here…",
|
||||||
|
@ -242,7 +243,9 @@
|
||||||
"remove": "Remove a link share",
|
"remove": "Remove a link share",
|
||||||
"removeText": "Are you sure you want to remove this link share? It will no longer be possible to access this list with this link share. This cannot be undone!",
|
"removeText": "Are you sure you want to remove this link share? It will no longer be possible to access this list with this link share. This cannot be undone!",
|
||||||
"createSuccess": "The link share was successfully created.",
|
"createSuccess": "The link share was successfully created.",
|
||||||
"deleteSuccess": "The link share was successfully deleted"
|
"deleteSuccess": "The link share was successfully deleted",
|
||||||
|
"view": "View",
|
||||||
|
"sharedBy": "Shared by {0}"
|
||||||
},
|
},
|
||||||
"userTeam": {
|
"userTeam": {
|
||||||
"typeUser": "user | users",
|
"typeUser": "user | users",
|
||||||
|
@ -264,9 +267,6 @@
|
||||||
},
|
},
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"link": "Link",
|
"link": "Link",
|
||||||
"name": "Name",
|
|
||||||
"sharedBy": "Shared by",
|
|
||||||
"right": "Right",
|
|
||||||
"delete": "Delete"
|
"delete": "Delete"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -870,7 +870,8 @@
|
||||||
"related": "Modify related tasks of this task",
|
"related": "Modify related tasks of this task",
|
||||||
"color": "Change the color of this task",
|
"color": "Change the color of this task",
|
||||||
"move": "Move this task to another list",
|
"move": "Move this task to another list",
|
||||||
"reminder": "Manage reminders of this task"
|
"reminder": "Manage reminders of this task",
|
||||||
|
"description": "Toggle editing of the task description"
|
||||||
},
|
},
|
||||||
"list": {
|
"list": {
|
||||||
"title": "List Views",
|
"title": "List Views",
|
||||||
|
|
|
@ -172,6 +172,7 @@
|
||||||
"search": "Gõ để tìm kiếm danh sách…",
|
"search": "Gõ để tìm kiếm danh sách…",
|
||||||
"searchSelect": "Nhấp hoặc nhấn enter để chọn danh sách này",
|
"searchSelect": "Nhấp hoặc nhấn enter để chọn danh sách này",
|
||||||
"shared": "Đang tham gia",
|
"shared": "Đang tham gia",
|
||||||
|
"noDescriptionAvailable": "No list description is available.",
|
||||||
"create": {
|
"create": {
|
||||||
"header": "Danh sách mới",
|
"header": "Danh sách mới",
|
||||||
"titlePlaceholder": "Tên danh sách ở đây…",
|
"titlePlaceholder": "Tên danh sách ở đây…",
|
||||||
|
@ -242,7 +243,9 @@
|
||||||
"remove": "Gỡ liên kết chia sẻ",
|
"remove": "Gỡ liên kết chia sẻ",
|
||||||
"removeText": "Bạn có chắc chắn muốn xóa liên kết chia sẻ này không? Không ai có thể truy cập liên kết này được nữa. Điều này không thể hoàn tác!",
|
"removeText": "Bạn có chắc chắn muốn xóa liên kết chia sẻ này không? Không ai có thể truy cập liên kết này được nữa. Điều này không thể hoàn tác!",
|
||||||
"createSuccess": "Liên kết chia sẻ đã được tạo thành công.",
|
"createSuccess": "Liên kết chia sẻ đã được tạo thành công.",
|
||||||
"deleteSuccess": "Liên kết chia sẽ đã được xóa rồi"
|
"deleteSuccess": "Liên kết chia sẽ đã được xóa rồi",
|
||||||
|
"view": "View",
|
||||||
|
"sharedBy": "Shared by {0}"
|
||||||
},
|
},
|
||||||
"userTeam": {
|
"userTeam": {
|
||||||
"typeUser": "người dùng | người dùng",
|
"typeUser": "người dùng | người dùng",
|
||||||
|
@ -264,9 +267,6 @@
|
||||||
},
|
},
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"link": "Liên kết",
|
"link": "Liên kết",
|
||||||
"name": "Tên",
|
|
||||||
"sharedBy": "Chia sẻ bởi",
|
|
||||||
"right": "Quyền hạn",
|
|
||||||
"delete": "Xóa"
|
"delete": "Xóa"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -870,7 +870,8 @@
|
||||||
"related": "Sửa đổi các công việc liên kết",
|
"related": "Sửa đổi các công việc liên kết",
|
||||||
"color": "Thay đổi màu công việc này",
|
"color": "Thay đổi màu công việc này",
|
||||||
"move": "Dời công việc này sang danh sách khác",
|
"move": "Dời công việc này sang danh sách khác",
|
||||||
"reminder": "Manage reminders of this task"
|
"reminder": "Manage reminders of this task",
|
||||||
|
"description": "Toggle editing of the task description"
|
||||||
},
|
},
|
||||||
"list": {
|
"list": {
|
||||||
"title": "Xem danh sách",
|
"title": "Xem danh sách",
|
||||||
|
|
|
@ -172,6 +172,7 @@
|
||||||
"search": "Type to search for a list…",
|
"search": "Type to search for a list…",
|
||||||
"searchSelect": "Click or press enter to select this list",
|
"searchSelect": "Click or press enter to select this list",
|
||||||
"shared": "Shared Lists",
|
"shared": "Shared Lists",
|
||||||
|
"noDescriptionAvailable": "No list description is available.",
|
||||||
"create": {
|
"create": {
|
||||||
"header": "New list",
|
"header": "New list",
|
||||||
"titlePlaceholder": "The list's title goes here…",
|
"titlePlaceholder": "The list's title goes here…",
|
||||||
|
@ -242,7 +243,9 @@
|
||||||
"remove": "Remove a link share",
|
"remove": "Remove a link share",
|
||||||
"removeText": "Are you sure you want to remove this link share? It will no longer be possible to access this list with this link share. This cannot be undone!",
|
"removeText": "Are you sure you want to remove this link share? It will no longer be possible to access this list with this link share. This cannot be undone!",
|
||||||
"createSuccess": "The link share was successfully created.",
|
"createSuccess": "The link share was successfully created.",
|
||||||
"deleteSuccess": "The link share was successfully deleted"
|
"deleteSuccess": "The link share was successfully deleted",
|
||||||
|
"view": "View",
|
||||||
|
"sharedBy": "Shared by {0}"
|
||||||
},
|
},
|
||||||
"userTeam": {
|
"userTeam": {
|
||||||
"typeUser": "user | users",
|
"typeUser": "user | users",
|
||||||
|
@ -264,9 +267,6 @@
|
||||||
},
|
},
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"link": "Link",
|
"link": "Link",
|
||||||
"name": "Name",
|
|
||||||
"sharedBy": "Shared by",
|
|
||||||
"right": "Right",
|
|
||||||
"delete": "Delete"
|
"delete": "Delete"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -870,7 +870,8 @@
|
||||||
"related": "Modify related tasks of this task",
|
"related": "Modify related tasks of this task",
|
||||||
"color": "Change the color of this task",
|
"color": "Change the color of this task",
|
||||||
"move": "Move this task to another list",
|
"move": "Move this task to another list",
|
||||||
"reminder": "Manage reminders of this task"
|
"reminder": "Manage reminders of this task",
|
||||||
|
"description": "Toggle editing of the task description"
|
||||||
},
|
},
|
||||||
"list": {
|
"list": {
|
||||||
"title": "List Views",
|
"title": "List Views",
|
||||||
|
|
|
@ -2,6 +2,7 @@ import {createApp} from 'vue'
|
||||||
|
|
||||||
import App from './App.vue'
|
import App from './App.vue'
|
||||||
import router from './router'
|
import router from './router'
|
||||||
|
import {createPinia} from 'pinia'
|
||||||
|
|
||||||
import {error, success} from './message'
|
import {error, success} from './message'
|
||||||
|
|
||||||
|
@ -57,7 +58,7 @@ app.directive('shortcut', shortcut)
|
||||||
app.directive('cy', cypress)
|
app.directive('cy', cypress)
|
||||||
|
|
||||||
// global components
|
// global components
|
||||||
import FontAwesomeIcon from './icons'
|
import FontAwesomeIcon from '@/components/misc/Icon'
|
||||||
import Button from '@/components/input/button.vue'
|
import Button from '@/components/input/button.vue'
|
||||||
import Modal from '@/components/misc/modal.vue'
|
import Modal from '@/components/misc/modal.vue'
|
||||||
import Card from '@/components/misc/card.vue'
|
import Card from '@/components/misc/card.vue'
|
||||||
|
@ -104,8 +105,8 @@ if (window.SENTRY_ENABLED) {
|
||||||
import('./sentry').then(sentry => sentry.default(app, router))
|
import('./sentry').then(sentry => sentry.default(app, router))
|
||||||
}
|
}
|
||||||
|
|
||||||
import ganttastic from '@infectoone/vue-ganttastic'
|
const pinia = createPinia()
|
||||||
app.use(ganttastic)
|
app.use(pinia)
|
||||||
|
|
||||||
app.use(store, key) // pass the injection key
|
app.use(store, key) // pass the injection key
|
||||||
app.use(router)
|
app.use(router)
|
||||||
|
|
|
@ -31,7 +31,7 @@ export interface ITask extends IAbstract {
|
||||||
parentTaskId: ITask['id']
|
parentTaskId: ITask['id']
|
||||||
hexColor: string
|
hexColor: string
|
||||||
percentDone: number
|
percentDone: number
|
||||||
relatedTasks: Partial<Record<IRelationKind, ITask>>,
|
relatedTasks: Partial<Record<IRelationKind, ITask[]>>,
|
||||||
attachments: IAttachment[]
|
attachments: IAttachment[]
|
||||||
identifier: string
|
identifier: string
|
||||||
index: number
|
index: number
|
||||||
|
|
|
@ -5,7 +5,7 @@ import type { IUser } from '@/modelTypes/IUser'
|
||||||
import type { IFile } from '@/modelTypes/IFile'
|
import type { IFile } from '@/modelTypes/IFile'
|
||||||
import type { IAttachment } from '@/modelTypes/IAttachment'
|
import type { IAttachment } from '@/modelTypes/IAttachment'
|
||||||
|
|
||||||
export default class AttachmentModel extends AbstractModel implements IAttachment {
|
export default class AttachmentModel extends AbstractModel<IAttachment> implements IAttachment {
|
||||||
id = 0
|
id = 0
|
||||||
taskId = 0
|
taskId = 0
|
||||||
createdBy: IUser = UserModel
|
createdBy: IUser = UserModel
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import AbstractModel from './abstractModel'
|
import AbstractModel from './abstractModel'
|
||||||
import type { IAvatar } from '@/modelTypes/IAvatar'
|
import type { IAvatar } from '@/modelTypes/IAvatar'
|
||||||
|
|
||||||
export default class AvatarModel extends AbstractModel implements IAvatar {
|
export default class AvatarModel extends AbstractModel<IAvatar> implements IAvatar {
|
||||||
avatarProvider: IAvatar['avatarProvider'] = 'default'
|
avatarProvider: IAvatar['avatarProvider'] = 'default'
|
||||||
|
|
||||||
constructor(data: Partial<IAvatar>) {
|
constructor(data: Partial<IAvatar>) {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import AbstractModel from './abstractModel'
|
import AbstractModel from './abstractModel'
|
||||||
import type {IBackgroundImage} from '@/modelTypes/IBackgroundImage'
|
import type {IBackgroundImage} from '@/modelTypes/IBackgroundImage'
|
||||||
|
|
||||||
export default class BackgroundImageModel extends AbstractModel implements IBackgroundImage {
|
export default class BackgroundImageModel extends AbstractModel<IBackgroundImage> implements IBackgroundImage {
|
||||||
id = 0
|
id = 0
|
||||||
url = ''
|
url = ''
|
||||||
thumb = ''
|
thumb = ''
|
||||||
|
|
|
@ -6,14 +6,14 @@ import type {IBucket} from '@/modelTypes/IBucket'
|
||||||
import type {ITask} from '@/modelTypes/ITask'
|
import type {ITask} from '@/modelTypes/ITask'
|
||||||
import type {IUser} from '@/modelTypes/IUser'
|
import type {IUser} from '@/modelTypes/IUser'
|
||||||
|
|
||||||
export default class BucketModel extends AbstractModel implements IBucket {
|
export default class BucketModel extends AbstractModel<IBucket> implements IBucket {
|
||||||
id = 0
|
id = 0
|
||||||
title = ''
|
title = ''
|
||||||
listId = ''
|
listId = ''
|
||||||
limit = 0
|
limit = 0
|
||||||
tasks: ITask[] = []
|
tasks: ITask[] = []
|
||||||
isDoneBucket: false
|
isDoneBucket = false
|
||||||
position: 0
|
position = 0
|
||||||
|
|
||||||
createdBy: IUser = null
|
createdBy: IUser = null
|
||||||
created: Date = null
|
created: Date = null
|
||||||
|
|
|
@ -2,7 +2,7 @@ import AbstractModel from './abstractModel'
|
||||||
|
|
||||||
import type {ICaldavToken} from '@/modelTypes/ICaldavToken'
|
import type {ICaldavToken} from '@/modelTypes/ICaldavToken'
|
||||||
|
|
||||||
export default class CaldavTokenModel extends AbstractModel implements ICaldavToken {
|
export default class CaldavTokenModel extends AbstractModel<ICaldavToken> implements ICaldavToken {
|
||||||
id: number
|
id: number
|
||||||
created: Date
|
created: Date
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ import AbstractModel from './abstractModel'
|
||||||
|
|
||||||
import type {IEmailUpdate} from '@/modelTypes/IEmailUpdate'
|
import type {IEmailUpdate} from '@/modelTypes/IEmailUpdate'
|
||||||
|
|
||||||
export default class EmailUpdateModel extends AbstractModel implements IEmailUpdate {
|
export default class EmailUpdateModel extends AbstractModel<IEmailUpdate> implements IEmailUpdate {
|
||||||
newEmail = ''
|
newEmail = ''
|
||||||
password = ''
|
password = ''
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import AbstractModel from './abstractModel'
|
import AbstractModel from './abstractModel'
|
||||||
import type {IFile} from '@/modelTypes/IFile'
|
import type {IFile} from '@/modelTypes/IFile'
|
||||||
|
|
||||||
export default class FileModel extends AbstractModel implements IFile {
|
export default class FileModel extends AbstractModel<IFile> implements IFile {
|
||||||
id = 0
|
id = 0
|
||||||
mime = ''
|
mime = ''
|
||||||
name = ''
|
name = ''
|
||||||
|
|
|
@ -8,7 +8,7 @@ import {colorIsDark} from '@/helpers/color/colorIsDark'
|
||||||
|
|
||||||
const DEFAULT_LABEL_BACKGROUND_COLOR = 'e8e8e8'
|
const DEFAULT_LABEL_BACKGROUND_COLOR = 'e8e8e8'
|
||||||
|
|
||||||
export default class LabelModel extends AbstractModel implements ILabel {
|
export default class LabelModel extends AbstractModel<ILabel> implements ILabel {
|
||||||
id = 0
|
id = 0
|
||||||
title = ''
|
title = ''
|
||||||
// FIXME: this should be empty and be definied in the client.
|
// FIXME: this should be empty and be definied in the client.
|
||||||
|
@ -22,7 +22,7 @@ export default class LabelModel extends AbstractModel implements ILabel {
|
||||||
created: Date = null
|
created: Date = null
|
||||||
updated: Date = null
|
updated: Date = null
|
||||||
|
|
||||||
constructor(data: Partial<ILabel>) {
|
constructor(data: Partial<ILabel> = {}) {
|
||||||
super()
|
super()
|
||||||
this.assignData(data)
|
this.assignData(data)
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ import AbstractModel from './abstractModel'
|
||||||
|
|
||||||
import type { ILabelTask } from '@/modelTypes/ILabelTask'
|
import type { ILabelTask } from '@/modelTypes/ILabelTask'
|
||||||
|
|
||||||
export default class LabelTask extends AbstractModel implements ILabelTask {
|
export default class LabelTask extends AbstractModel<ILabelTask> implements ILabelTask {
|
||||||
id = 0
|
id = 0
|
||||||
taskId = 0
|
taskId = 0
|
||||||
labelId = 0
|
labelId = 0
|
||||||
|
|
|
@ -5,7 +5,7 @@ import {RIGHTS, type Right} from '@/constants/rights'
|
||||||
import type {ILinkShare} from '@/modelTypes/ILinkShare'
|
import type {ILinkShare} from '@/modelTypes/ILinkShare'
|
||||||
import type {IUser} from '@/modelTypes/IUser'
|
import type {IUser} from '@/modelTypes/IUser'
|
||||||
|
|
||||||
export default class LinkShareModel extends AbstractModel implements ILinkShare {
|
export default class LinkShareModel extends AbstractModel<ILinkShare> implements ILinkShare {
|
||||||
id = 0
|
id = 0
|
||||||
hash = ''
|
hash = ''
|
||||||
right: Right = RIGHTS.READ
|
right: Right = RIGHTS.READ
|
||||||
|
|
|
@ -11,7 +11,7 @@ import type {ISubscription} from '@/modelTypes/ISubscription'
|
||||||
|
|
||||||
import {getSavedFilterIdFromListId} from '@/helpers/savedFilter'
|
import {getSavedFilterIdFromListId} from '@/helpers/savedFilter'
|
||||||
|
|
||||||
export default class ListModel extends AbstractModel implements IList {
|
export default class ListModel extends AbstractModel<IList> implements IList {
|
||||||
id = 0
|
id = 0
|
||||||
title = ''
|
title = ''
|
||||||
description = ''
|
description = ''
|
||||||
|
@ -30,7 +30,7 @@ export default class ListModel extends AbstractModel implements IList {
|
||||||
created: Date = null
|
created: Date = null
|
||||||
updated: Date = null
|
updated: Date = null
|
||||||
|
|
||||||
constructor(data: Partial<IList>) {
|
constructor(data: Partial<IList> = {}) {
|
||||||
super()
|
super()
|
||||||
this.assignData(data)
|
this.assignData(data)
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ import type {IListDuplicate} from '@/modelTypes/IListDuplicate'
|
||||||
import type {INamespace} from '@/modelTypes/INamespace'
|
import type {INamespace} from '@/modelTypes/INamespace'
|
||||||
import type {IList} from '@/modelTypes/IList'
|
import type {IList} from '@/modelTypes/IList'
|
||||||
|
|
||||||
export default class ListDuplicateModel extends AbstractModel implements IListDuplicate {
|
export default class ListDuplicateModel extends AbstractModel<IListDuplicate> implements IListDuplicate {
|
||||||
listId = 0
|
listId = 0
|
||||||
namespaceId: INamespace['id'] = 0
|
namespaceId: INamespace['id'] = 0
|
||||||
list: IList = ListModel
|
list: IList = ListModel
|
||||||
|
|
|
@ -8,7 +8,7 @@ import type {IUser} from '@/modelTypes/IUser'
|
||||||
import type {IList} from '@/modelTypes/IList'
|
import type {IList} from '@/modelTypes/IList'
|
||||||
import type {ISubscription} from '@/modelTypes/ISubscription'
|
import type {ISubscription} from '@/modelTypes/ISubscription'
|
||||||
|
|
||||||
export default class NamespaceModel extends AbstractModel implements INamespace {
|
export default class NamespaceModel extends AbstractModel<INamespace> implements INamespace {
|
||||||
id = 0
|
id = 0
|
||||||
title = ''
|
title = ''
|
||||||
description = ''
|
description = ''
|
||||||
|
@ -21,7 +21,7 @@ export default class NamespaceModel extends AbstractModel implements INamespace
|
||||||
created: Date = null
|
created: Date = null
|
||||||
updated: Date = null
|
updated: Date = null
|
||||||
|
|
||||||
constructor(data: Partial<INamespace>) {
|
constructor(data: Partial<INamespace> = {}) {
|
||||||
super()
|
super()
|
||||||
this.assignData(data)
|
this.assignData(data)
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ import TeamModel from '@/models/team'
|
||||||
|
|
||||||
import {NOTIFICATION_NAMES, type INotification} from '@/modelTypes/INotification'
|
import {NOTIFICATION_NAMES, type INotification} from '@/modelTypes/INotification'
|
||||||
|
|
||||||
export default class NotificationModel extends AbstractModel implements INotification {
|
export default class NotificationModel extends AbstractModel<INotification> implements INotification {
|
||||||
id = 0
|
id = 0
|
||||||
name = ''
|
name = ''
|
||||||
notification: INotification['notification'] = null
|
notification: INotification['notification'] = null
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue