Compare commits

...

57 Commits

Author SHA1 Message Date
Dominik Pschenitschni c1f5f92fa1
fix: improve some types
continuous-integration/drone/pr Build is failing Details
2022-08-04 22:40:02 +02:00
Dominik Pschenitschni 091599bdf0
fix: createNewTask typing 2022-08-04 22:40:02 +02:00
Dominik Pschenitschni e6654140c7
fix: merge duplicate types 2022-08-04 22:40:02 +02:00
Dominik Pschenitschni 305bfac578
fix: use correct model for generics 2022-08-04 22:40:02 +02:00
Dominik Pschenitschni d6b0f26bd1
feat: improve store typing 2022-08-04 22:40:02 +02:00
Dominik Pschenitschni fcdb704152
feat: extend mode interface from class instead from interface 2022-08-04 22:40:01 +02:00
Dominik Pschenitschni 5d3571449b
fix: add lodash.clonedeep types 2022-08-04 22:40:01 +02:00
Dominik Pschenitschni af804525d5
feat: use lib ESNext setting for typescript 2022-08-04 22:40:01 +02:00
Dominik Pschenitschni 767c95522d
feat: improve store and model typing 2022-08-04 22:40:01 +02:00
Dominik Pschenitschni b642c66f5d
feat: improve types 2022-08-04 22:38:12 +02:00
Dominik Pschenitschni a423577229
chore: better variable typing 2022-08-04 22:38:12 +02:00
Dominik Pschenitschni 674d94f914
chore: remove unnecessary defineComponent 2022-08-04 22:38:12 +02:00
Dominik Pschenitschni b4724a987a
chore: remove global mixing 2022-08-04 22:38:12 +02:00
Dominik Pschenitschni 55ae90e8d8
chore: remove date mixins 2022-08-04 22:38:11 +02:00
Dominik Pschenitschni e5f272c29c
feat: function attribute typing 2022-08-04 22:38:10 +02:00
Dominik Pschenitschni becbed9c1c
feat: constants 2022-08-04 22:17:33 +02:00
Dominik Pschenitschni 4059f1c088
chore: improve type imports 2022-08-04 22:17:33 +02:00
Dominik Pschenitschni f1b8f0658c
feat: add properties to models 2022-08-04 22:17:33 +02:00
Dominik Pschenitschni 6e255c865c
feat: convert abstractService to ts 2022-08-04 22:17:33 +02:00
renovate 4994db4f77 fix(deps): update vueuse to v9.1.0 (#2220)
continuous-integration/drone/push Build is passing Details
Reviewed-on: #2220
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-08-04 07:18:47 +00:00
renovate 35d3cd6e83 chore(deps): update dependency sass to v1.54.2 (#2219)
continuous-integration/drone/push Build is passing Details
Reviewed-on: #2219
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-08-04 07:15:52 +00:00
kolaente 7a46843a28
chore: release preparations
continuous-integration/drone/push Build is passing Details
2022-08-03 20:17:37 +02:00
kolaente bafef06e90
chore: add git-cliff config 2022-08-03 20:10:39 +02:00
renovate d5445e0298 chore(deps): update dependency esbuild to v0.14.53 (#2217)
continuous-integration/drone/push Build is passing Details
Reviewed-on: #2217
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-08-03 17:14:28 +00:00
renovate 9bbaa67eec chore(deps): update dependency sass to v1.54.1 (#2218)
continuous-integration/drone/push Build was killed Details
Reviewed-on: #2218
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-08-03 17:14:23 +00:00
renovate 1f14e7bee8 chore(deps): update dependency cypress to v10.4.0 (#2216)
continuous-integration/drone/push Build is passing Details
Reviewed-on: #2216
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-08-02 17:49:29 +00:00
renovate e05b729c21 chore(deps): update dependency vitest to v0.20.3 (#2215)
continuous-integration/drone/push Build is passing Details
Reviewed-on: #2215
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-08-02 16:19:17 +00:00
kolaente ad7ed86d36
fix: don't replace the last edited task with the one currently editing
continuous-integration/drone/push Build is passing Details
2022-08-02 15:27:24 +02:00
kolaente e82a83c8cf
fix: properly parse dates or null
continuous-integration/drone/push Build is passing Details
Resolves #2214
2022-08-02 15:19:58 +02:00
kolaente 31480eae72
fix: default label color in dark mode
continuous-integration/drone/push Build is failing Details
Resolves #2200
2022-08-02 15:05:33 +02:00
renovate c8162728b7 chore(deps): update workbox monorepo to v6.5.4 (#2204)
continuous-integration/drone/push Build is passing Details
Reviewed-on: #2204
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-08-02 11:40:56 +00:00
kolaente 8b3072672a
fix: progress bar color in dark mode
continuous-integration/drone/push Build is passing Details
Resolves #2194
2022-08-02 13:02:19 +02:00
renovate 0e09f9fded chore(deps): update typescript-eslint monorepo to v5.32.0 (#2213)
continuous-integration/drone/push Build is failing Details
Reviewed-on: #2213
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-08-01 18:49:08 +00:00
renovate ab406f00d9 fix(deps): update sentry-javascript monorepo to v7.8.1 (#2212)
continuous-integration/drone/push Build is failing Details
Reviewed-on: #2212
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-08-01 15:21:05 +00:00
renovate 2507f661e8 chore(deps): update dependency eslint to v8.21.0 (#2211)
continuous-integration/drone/push Build is failing Details
Reviewed-on: #2211
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-08-01 13:41:42 +00:00
renovate cf27131e48 fix(deps): update dependency vue-i18n to v9.2.0 (#2210)
continuous-integration/drone/push Build is failing Details
Reviewed-on: #2210
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-08-01 13:40:14 +00:00
drone 54d8e341ab [skip ci] Updated translations via Crowdin 2022-08-01 00:13:27 +00:00
renovate 7b17ccbf1f fix(deps): update sentry-javascript monorepo to v7.8.0 (#2208)
continuous-integration/drone/push Build is passing Details
Reviewed-on: #2208
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-07-31 18:45:49 +00:00
renovate ce7563ea4c fix(deps): update vueuse to v9 (major) (#2209)
continuous-integration/drone/push Build is passing Details
Reviewed-on: #2209
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-07-31 17:39:53 +00:00
renovate d9f3555d8d fix(deps): update dependency vue-router to v4.1.3 (#2206)
continuous-integration/drone/push Build is passing Details
Reviewed-on: #2206
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-07-31 17:14:05 +00:00
renovate b2dd63630c chore(deps): update typescript-eslint monorepo to v5.31.0 (#2207)
continuous-integration/drone/push Build is passing Details
Reviewed-on: #2207
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-07-31 17:12:34 +00:00
renovate db1a41f845 fix(deps): update dependency @kyvg/vue3-notification to v2.3.6 (#2205)
continuous-integration/drone/push Build is passing Details
Reviewed-on: #2205
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-07-31 17:01:26 +00:00
renovate 08ae0046de chore(deps): update dependency vue-tsc to v0.39.4 (#2187)
continuous-integration/drone/push Build is failing Details
Reviewed-on: #2187
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-07-31 16:21:19 +00:00
renovate c173542b23 chore(deps): update dependency rollup to v2.77.2 (#2203)
continuous-integration/drone/push Build is passing Details
Reviewed-on: #2203
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-07-31 16:19:32 +00:00
kolaente 518417c0de
feat: add more testcases for parsing weekdays
continuous-integration/drone/push Build is passing Details
Related to vikunja/api#1223
2022-07-31 18:16:31 +02:00
renovate c2e58a2320 chore(deps): update dependency autoprefixer to v10.4.8 (#2202)
continuous-integration/drone/push Build is passing Details
Reviewed-on: #2202
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-07-31 16:09:59 +00:00
renovate d94a25c83f fix(deps): update dependency date-fns to v2.29.1 (#2185)
continuous-integration/drone/push Build is passing Details
Reviewed-on: #2185
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-07-31 13:48:43 +00:00
renovate ad9ca61969 chore(deps): update dependency sass to v1.54.0 (#2186)
continuous-integration/drone/push Build is failing Details
Reviewed-on: #2186
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-07-31 13:48:12 +00:00
renovate d28d9218bd chore(deps): update caniuse-and-related (#2189)
continuous-integration/drone/push Build is passing Details
Reviewed-on: #2189
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-07-31 13:47:43 +00:00
renovate af08713bf0 chore(deps): update dependency netlify-cli to v10.13.0 (#2190)
continuous-integration/drone/push Build is passing Details
Reviewed-on: #2190
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-07-31 13:47:11 +00:00
renovate 0b01f2aace chore(deps): update dependency esbuild to v0.14.51 (#2191)
continuous-integration/drone/push Build is passing Details
Reviewed-on: #2191
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-07-31 13:46:22 +00:00
renovate 579de70a7a chore(deps): update dependency eslint-plugin-vue to v9.3.0 (#2192)
continuous-integration/drone/push Build is passing Details
Reviewed-on: #2192
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-07-31 13:45:46 +00:00
renovate 660ab928a2 chore(deps): update dependency vite to v3.0.4 (#2193)
continuous-integration/drone/push Build is failing Details
Reviewed-on: #2193
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-07-31 13:44:53 +00:00
renovate 9394f57fc9 chore(deps): update font awesome to v6.1.2 (#2198)
continuous-integration/drone/push Build is passing Details
Reviewed-on: #2198
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
2022-07-31 13:44:12 +00:00
konrad 873169c371 chore(deps): update dependency vitest to v0.20.2 (#2188)
continuous-integration/drone/push Build is passing Details
Reviewed-on: #2188
2022-07-31 13:43:34 +00:00
renovate 098fd0a875 chore(deps): update dependency vitest to v0.20.2
continuous-integration/drone/pr Build is passing Details
2022-07-31 12:02:53 +00:00
drone c0cd69dd82 [skip ci] Updated translations via Crowdin 2022-07-23 00:15:10 +00:00
218 changed files with 5753 additions and 1568 deletions

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,7 @@
[![Build Status](https://drone.kolaente.de/api/badges/vikunja/frontend/status.svg)](https://drone.kolaente.de/vikunja/frontend)
[![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](LICENSE)
[![Download](https://img.shields.io/badge/download-v0.18.2-brightgreen.svg)](https://dl.vikunja.io)
[![Download](https://img.shields.io/badge/download-v0.19.0-brightgreen.svg)](https://dl.vikunja.io)
[![Translation](https://badges.crowdin.net/vikunja/localized.svg)](https://crowdin.com/project/vikunja)
This is the web frontend for Vikunja, written in Vue.js.

59
cliff.toml Normal file
View File

@ -0,0 +1,59 @@
[changelog]
body = """
{% if version %}\
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
{% else %}\
## [unreleased]
{% endif %}\
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | upper_first }}
{% for commit in commits
| filter(attribute="scope")
| sort(attribute="scope") %}
* *({{commit.scope}})* {{ commit.message | upper_first }}
{%- if commit.breaking %}
{% raw %} {% endraw %}- **BREAKING**: {{commit.breaking_description}}
{%- endif -%}
{%- endfor -%}
{%- for commit in commits %}
{%- if commit.scope -%}
{% else -%}
* {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}]({{ commit.id }}))
{% if commit.breaking -%}
{% raw %} {% endraw %}- **BREAKING**: {{commit.breaking_description}}
{% endif -%}
{% endif -%}
{% endfor -%}
{% raw %}\n{% endraw %}\
{% endfor %}\n
"""
#{% for group, commits in commits | group_by(attribute="group") %}
# ### {{ group | upper_first }}
# {% for commit in commits %}\
# - {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}]({{ commit.id }}))
# {% endfor %}\
#{% endfor %}\n
# remove the leading and trailing whitespace from the template
trim = true
[git]
conventional_commits = true
filter_unconventional = false
commit_parsers = [
{ message = ".*(deps).*", group = "Dependencies"},
{ message = "^feat", group = "Features"},
{ message = "^fix", group = "Bug Fixes"},
{ message = "^doc", group = "Documentation"},
{ message = "^perf", group = "Performance"},
{ message = "^refactor", group = "Refactor"},
{ message = "^style", group = "Styling"},
{ message = "^test", group = "Testing"},
{ message = "^chore\\(release\\): prepare for", skip = true},
{ message = "^chore", group = "Miscellaneous Tasks"},
{ body = ".*security", group = "Security"},
{ message = ".*", group = "Other", default_scope = "other"}, # Everything that's not a conventional commit goes into the "Other" category
]

View File

@ -19,17 +19,18 @@
},
"dependencies": {
"@github/hotkey": "2.0.1",
"@kyvg/vue3-notification": "2.3.5",
"@sentry/tracing": "7.7.0",
"@sentry/vue": "7.7.0",
"@kyvg/vue3-notification": "2.3.6",
"@sentry/tracing": "7.8.1",
"@sentry/vue": "7.8.1",
"@types/is-touch-device": "1.0.0",
"@types/lodash.clonedeep": "^4.5.7",
"@types/sortablejs": "1.13.0",
"@vueuse/core": "8.9.4",
"@vueuse/router": "8.9.4",
"@vueuse/core": "9.1.0",
"@vueuse/router": "9.1.0",
"blurhash": "1.1.5",
"bulma-css-variables": "0.9.33",
"camel-case": "4.1.2",
"date-fns": "2.28.0",
"date-fns": "2.29.1",
"dompurify": "2.3.10",
"easymde": "2.16.1",
"flatpickr": "4.6.13",
@ -48,10 +49,10 @@
"vue-advanced-cropper": "2.8.3",
"vue-drag-resize": "2.0.3",
"vue-flatpickr-component": "9.0.6",
"vue-i18n": "9.2.0-beta.40",
"vue-router": "4.1.2",
"vue-i18n": "9.2.0",
"vue-router": "4.1.3",
"vuex": "4.0.2",
"workbox-precaching": "6.5.3",
"workbox-precaching": "6.5.4",
"zhyswan-vuedraggable": "4.1.3"
},
"devDependencies": {
@ -59,42 +60,42 @@
"@cypress/vite-dev-server": "3.0.0",
"@cypress/vue": "4.0.0",
"@faker-js/faker": "7.3.0",
"@fortawesome/fontawesome-svg-core": "6.1.1",
"@fortawesome/free-regular-svg-icons": "6.1.1",
"@fortawesome/free-solid-svg-icons": "6.1.1",
"@fortawesome/fontawesome-svg-core": "6.1.2",
"@fortawesome/free-regular-svg-icons": "6.1.2",
"@fortawesome/free-solid-svg-icons": "6.1.2",
"@fortawesome/vue-fontawesome": "3.0.1",
"@types/flexsearch": "0.7.3",
"@typescript-eslint/eslint-plugin": "5.30.7",
"@typescript-eslint/parser": "5.30.7",
"@typescript-eslint/eslint-plugin": "5.32.0",
"@typescript-eslint/parser": "5.32.0",
"@vitejs/plugin-legacy": "2.0.0",
"@vitejs/plugin-vue": "3.0.1",
"@vue/eslint-config-typescript": "11.0.0",
"@vue/test-utils": "2.0.2",
"@vue/tsconfig": "0.1.3",
"autoprefixer": "10.4.7",
"autoprefixer": "10.4.8",
"axios": "0.27.2",
"browserslist": "4.21.1",
"caniuse-lite": "1.0.30001363",
"cypress": "10.3.1",
"esbuild": "0.14.49",
"eslint": "8.20.0",
"eslint-plugin-vue": "9.2.0",
"browserslist": "4.21.3",
"caniuse-lite": "1.0.30001373",
"cypress": "10.4.0",
"esbuild": "0.14.53",
"eslint": "8.21.0",
"eslint-plugin-vue": "9.3.0",
"express": "4.18.1",
"happy-dom": "6.0.4",
"netlify-cli": "10.9.0",
"netlify-cli": "10.13.0",
"postcss": "8.4.14",
"postcss-preset-env": "7.7.2",
"rollup": "2.77.0",
"rollup": "2.77.2",
"rollup-plugin-visualizer": "5.7.1",
"sass": "1.53.0",
"sass": "1.54.2",
"typescript": "4.7.4",
"vite": "3.0.2",
"vite": "3.0.4",
"vite-plugin-pwa": "0.12.3",
"vite-svg-loader": "3.4.0",
"vitest": "0.18.1",
"vue-tsc": "0.38.9",
"vitest": "0.20.3",
"vue-tsc": "0.39.4",
"wait-on": "6.0.1",
"workbox-cli": "6.5.3"
"workbox-cli": "6.5.4"
},
"postcss": {
"plugins": {

View File

@ -15,10 +15,10 @@
</template>
<script lang="ts" setup>
import {computed, watch, Ref} from 'vue'
import {computed, watch, type Ref} from 'vue'
import {useRouter} from 'vue-router'
import {useRouteQuery} from '@vueuse/router'
import {useStore} from 'vuex'
import {useStore} from '@/store'
import {useI18n} from 'vue-i18n'
import isTouchDevice from 'is-touch-device'
import {success} from '@/message'

View File

@ -12,12 +12,7 @@
</template>
<script lang="ts">
import {defineComponent} from 'vue'
// see https://v3.vuejs.org/api/sfc-script-setup.html#usage-alongside-normal-script
export default defineComponent({
inheritAttrs: false,
})
export default { inheritAttrs: false }
</script>
<script lang="ts" setup>

View File

@ -110,10 +110,10 @@
</template>
<script lang="ts" setup>
import {format} from 'date-fns'
import { formatDate } from '@/helpers/time/formatDate'
import BaseButton from '@/components/base/BaseButton.vue'
const exampleDate = format(new Date(), 'yyyy-MM-dd')
const exampleDate = formatDate(new Date(), 'yyyy-MM-dd')
</script>
<style scoped>

View File

@ -71,7 +71,7 @@
<script lang="ts" setup>
import {computed, ref, watch} from 'vue'
import {useStore} from 'vuex'
import {useStore} from '@/store'
import {useI18n} from 'vue-i18n'
import flatPickr from 'vue-flatpickr-component'

View File

@ -11,7 +11,7 @@
<script setup lang="ts">
import {computed} from 'vue'
import {useStore} from 'vuex'
import {useStore} from '@/store'
import BaseButton from '@/components/base/BaseButton.vue'

View File

@ -88,11 +88,11 @@
<script setup lang="ts">
import {ref, computed, onMounted, nextTick} from 'vue'
import {useStore} from 'vuex'
import {useStore} from '@/store'
import {useRouter} from 'vue-router'
import {QUICK_ACTIONS_ACTIVE} from '@/store/mutation-types'
import Rights from '@/models/constants/rights.json'
import {RIGHTS as Rights} from '@/models/constants/rights'
import Update from '@/components/home/update.vue'
import ListSettingsDropdown from '@/components/list/list-settings-dropdown.vue'
@ -103,6 +103,8 @@ import Logo from '@/components/home/Logo.vue'
import BaseButton from '@/components/base/BaseButton.vue'
import MenuButton from '@/components/home/MenuButton.vue'
import {getListTitle} from '@/helpers/getListTitle'
const store = useStore()
const userInfo = computed(() => store.state.auth.info)

View File

@ -60,8 +60,8 @@
</template>
<script lang="ts" setup>
import {watch, computed, shallowRef, watchEffect, VNode, h} from 'vue'
import {useStore} from 'vuex'
import {watch, computed, shallowRef, watchEffect, type VNode, h} from 'vue'
import {useStore} from '@/store'
import {useRoute, useRouter} from 'vue-router'
import {useEventListener} from '@vueuse/core'

View File

@ -23,7 +23,7 @@
<script lang="ts" setup>
import {computed} from 'vue'
import {useStore} from 'vuex'
import {useStore} from '@/store'
import Logo from '@/components/home/Logo.vue'
import PoweredByLink from './PoweredByLink.vue'

View File

@ -141,9 +141,9 @@
<script setup lang="ts">
import {ref, computed, onMounted, onBeforeMount} from 'vue'
import {useStore} from 'vuex'
import {useStore} from '@/store'
import draggable from 'zhyswan-vuedraggable'
import {SortableEvent} from 'sortablejs'
import type {SortableEvent} from 'sortablejs'
import BaseButton from '@/components/base/BaseButton.vue'
import ListSettingsDropdown from '@/components/list/list-settings-dropdown.vue'
@ -154,9 +154,10 @@ import Logo from '@/components/home/Logo.vue'
import {MENU_ACTIVE} from '@/store/mutation-types'
import {calculateItemPosition} from '@/helpers/calculateItemPosition'
import {getNamespaceTitle} from '@/helpers/getNamespaceTitle'
import {getListTitle} from '@/helpers/getListTitle'
import {useEventListener} from '@vueuse/core'
import NamespaceModel from '@/models/namespace'
import ListModel from '@/models/list'
import type { IList } from '@/models/list'
import type { INamespace } from '@/models/namespace'
const drag = ref(false)
const dragOptions = {
@ -171,7 +172,7 @@ const loading = computed(() => store.state.loading && store.state.loadingModule
const namespaces = computed(() => {
return (store.state.namespaces.namespaces as NamespaceModel[]).filter(n => !n.isArchived)
return (store.state.namespaces.namespaces as INamespace[]).filter(n => !n.isArchived)
})
const activeLists = computed(() => {
return namespaces.value.map(({lists}) => {
@ -194,7 +195,7 @@ useEventListener('resize', resize)
onMounted(() => resize())
function toggleFavoriteList(list: ListModel) {
function toggleFavoriteList(list: IList) {
// The favorites pseudo list is always favorite
// Archived lists cannot be marked favorite
if (list.id === -1 || list.isArchived) {
@ -208,14 +209,14 @@ function resize() {
store.commit(MENU_ACTIVE, window.innerWidth >= 770)
}
function toggleLists(namespaceId: number) {
function toggleLists(namespaceId: INamespace['id']) {
listsVisible.value[namespaceId] = !listsVisible.value[namespaceId]
}
const listsVisible = ref<{ [id: NamespaceModel['id']]: boolean }>({})
const listsVisible = ref<{ [id: INamespace['id']]: boolean }>({})
// FIXME: async action will be unfinished when component mounts
onBeforeMount(async () => {
const namespaces = await store.dispatch('namespaces/loadNamespaces') as NamespaceModel[]
const namespaces = await store.dispatch('namespaces/loadNamespaces') as INamespace[]
namespaces.forEach(n => {
if (typeof listsVisible.value[n.id] === 'undefined') {
listsVisible.value[n.id] = true
@ -223,7 +224,7 @@ onBeforeMount(async () => {
})
})
function updateActiveLists(namespace: NamespaceModel, activeLists: ListModel[]) {
function updateActiveLists(namespace: INamespace, activeLists: IList[]) {
// This is a bit hacky: since we do have to filter out the archived items from the list
// for vue draggable updating it is not as simple as replacing it.
// To work around this, we merge the active lists with the archived ones. Doing so breaks the order
@ -240,7 +241,7 @@ function updateActiveLists(namespace: NamespaceModel, activeLists: ListModel[])
})
}
const listUpdating = ref<{ [id: NamespaceModel['id']]: boolean }>({})
const listUpdating = ref<{ [id: INamespace['id']]: boolean }>({})
async function saveListPosition(e: SortableEvent) {
if (!e.newIndex) return

View File

@ -18,15 +18,11 @@
</template>
<script lang="ts">
import {defineComponent} from 'vue'
export default defineComponent({
name: 'x-button',
})
export default { name: 'x-button' }
</script>
<script setup lang="ts">
import {computed, useSlots, PropType} from 'vue'
import {computed, useSlots, type PropType} from 'vue'
import BaseButton from '@/components/base/BaseButton.vue'
const BUTTON_TYPES_MAP = Object.freeze({

View File

@ -97,7 +97,7 @@ import {i18n} from '@/i18n'
import BaseButton from '@/components/base/BaseButton.vue'
import {format} from 'date-fns'
import {formatDate, formatDateShort} from '@/helpers/time/formatDate'
import {calculateDayInterval} from '@/helpers/time/calculateDayInterval'
import {calculateNearestHours} from '@/helpers/time/calculateNearestHours'
import {closeWhenClickedOutside} from '@/helpers/closeWhenClickedOutside'
@ -170,11 +170,12 @@ export default defineComponent({
return ''
}
return format(this.date, 'yyy-LL-dd H:mm')
return formatDate(this.date, 'yyy-LL-dd H:mm')
},
},
},
methods: {
formatDateShort,
setDateValue(newVal) {
if (newVal === null) {
this.date = null
@ -233,7 +234,7 @@ export default defineComponent({
const interval = calculateDayInterval(date)
const newDate = new Date()
newDate.setDate(newDate.getDate() + interval)
return format(newDate, 'E')
return formatDate(newDate, 'E')
},
},
})

View File

@ -53,7 +53,7 @@ export default defineComponent({
},
},
methods: {
updateData(checked) {
updateData(checked: boolean) {
this.checked = checked
this.$emit('update:modelValue', checked)
this.$emit('change', checked)

View File

@ -76,24 +76,24 @@
</template>
<script setup lang="ts">
import {ref, computed, watchEffect} from 'vue'
import {useStore} from 'vuex'
import {ref, computed, watchEffect, type PropType} from 'vue'
import {useStore} from '@/store'
import {getSavedFilterIdFromListId} from '@/helpers/savedFilter'
import Dropdown from '@/components/misc/dropdown.vue'
import DropdownItem from '@/components/misc/dropdown-item.vue'
import TaskSubscription from '@/components/misc/subscription.vue'
import ListModel from '@/models/list'
import SubscriptionModel from '@/models/subscription'
import type {IList} from '@/models/list'
import type { ISubscription } from '@/models/subscription'
const props = defineProps({
list: {
type: ListModel,
type: Object as PropType<IList>,
required: true,
},
})
const subscription = ref<SubscriptionModel | null>(null)
const subscription = ref<ISubscription | null>(null)
watchEffect(() => {
subscription.value = props.list.subscription ?? null
})

View File

@ -186,8 +186,8 @@
<script lang="ts">
import {defineComponent} from 'vue'
import DatepickerWithRange from '@/components/date/datepickerWithRange'
import Fancycheckbox from '../../input/fancycheckbox'
import DatepickerWithRange from '@/components/date/datepickerWithRange.vue'
import Fancycheckbox from '@/components/input/fancycheckbox.vue'
import {includesById} from '@/helpers/utils'
import PrioritySelect from '@/components/tasks/partials/prioritySelect.vue'

View File

@ -36,16 +36,16 @@
</template>
<script lang="ts" setup>
import {PropType, ref, watch} from 'vue'
import {useStore} from 'vuex'
import {type PropType, ref, watch} from 'vue'
import {useStore} from '@/store'
import ListService from '@/services/list'
import {getBlobFromBlurHash} from '@/helpers/getBlobFromBlurHash'
import {colorIsDark} from '@/helpers/color/colorIsDark'
import ListModel from '@/models/list'
import BaseButton from '@/components/base/BaseButton.vue'
import type { IList } from '@/models/list'
const background = ref<string | null>(null)
const backgroundLoading = ref(false)
@ -53,7 +53,7 @@ const blurHashUrl = ref('')
const props = defineProps({
list: {
type: Object as PropType<ListModel>,
type: Object as PropType<IList>,
required: true,
},
showArchived: {
@ -86,7 +86,7 @@ async function loadBackground() {
const store = useStore()
function toggleFavoriteList(list: ListModel) {
function toggleFavoriteList(list: IList) {
// The favorites pseudo list is always favorite
// Archived lists cannot be marked favorite
if (list.id === -1 || list.isArchived) {

View File

@ -9,7 +9,7 @@
</template>
<script lang="ts" setup>
import {PropType} from 'vue'
import type {PropType} from 'vue'
type Variants = 'default' | 'small'
defineProps({

View File

@ -33,7 +33,7 @@
</template>
<script lang="ts" setup>
import {useStore} from 'vuex'
import {useStore} from '@/store'
import Shortcut from '@/components/misc/shortcut.vue'
import Message from '@/components/misc/message.vue'

View File

@ -8,7 +8,7 @@
<script lang="ts" setup>
import {computed} from 'vue'
import {useStore} from 'vuex'
import {useStore} from '@/store'
import BaseButton from '@/components/base/BaseButton.vue'

View File

@ -7,7 +7,7 @@
</template>
<script lang="ts" setup>
import {computed, PropType} from 'vue'
import {computed, type PropType} from 'vue'
const TEXT_ALIGN_MAP = Object.freeze({
left: '',

View File

@ -30,7 +30,7 @@ import Logo from '@/components/home/Logo.vue'
import Message from '@/components/misc/message.vue'
import Legal from '@/components/misc/legal.vue'
import ApiConfig from '@/components/misc/api-config.vue'
import {useStore} from 'vuex'
import {useStore} from '@/store'
import {computed} from 'vue'
import {useRoute} from 'vue-router'
import {useI18n} from 'vue-i18n'

View File

@ -42,7 +42,7 @@
<script lang="ts" setup>
import {ref, computed} from 'vue'
import {useStore} from 'vuex'
import {useStore} from '@/store'
import Logo from '@/assets/logo.svg?component'
import ApiConfig from '@/components/misc/api-config.vue'

View File

@ -32,27 +32,32 @@
</template>
<script lang="ts" setup>
import {computed, shallowRef} from 'vue'
import {computed, shallowRef, type PropType} from 'vue'
import {useI18n} from 'vue-i18n'
import BaseButton from '@/components/base/BaseButton.vue'
import DropdownItem from '@/components/misc/dropdown-item.vue'
import SubscriptionService from '@/services/subscription'
import SubscriptionModel from '@/models/subscription'
import SubscriptionModel, { type ISubscription } from '@/models/subscription'
import {success} from '@/message'
interface Props {
entity: string
entityId: number
subscription: SubscriptionModel | null
type?: 'button' | 'dropdown' | null
}
const props = withDefaults(defineProps<Props>(), {
subscription: null,
type: 'button',
const props = defineProps({
entity: String,
entityId: Number,
isButton: {
type: Boolean,
default: true,
},
subscription: {
type: Object as PropType<ISubscription>,
default: null,
},
type: {
type: String as PropType<'button' | 'dropdown' | 'null'>,
default: 'button',
},
})
const subscriptionEntity = computed<string | null>(() => props.subscription?.entity ?? null)

View File

@ -54,15 +54,16 @@
</template>
<script setup lang="ts">
import {ref, onMounted} from 'vue'
import {ref, onMounted, type PropType} from 'vue'
import Dropdown from '@/components/misc/dropdown.vue'
import DropdownItem from '@/components/misc/dropdown-item.vue'
import TaskSubscription from '@/components/misc/subscription.vue'
import type { INamespace } from '@/models/namespace'
const props = defineProps({
namespace: {
type: Object, // NamespaceModel
type: Object as PropType<INamespace>,
required: true,
},
})

View File

@ -30,7 +30,7 @@
{{ n.toText(userInfo) }}
</BaseButton>
</div>
<span class="created" v-tooltip="formatDate(n.created)">
<span class="created" v-tooltip="formatDateLong(n.created)">
{{ formatDateSince(n.created) }}
</span>
</div>
@ -52,17 +52,18 @@ import {computed, onMounted, onUnmounted, ref} from 'vue'
import NotificationService from '@/services/notification'
import BaseButton from '@/components/base/BaseButton.vue'
import User from '@/components/misc/user.vue'
import names from '@/models/constants/notificationNames.json'
import { NOTIFICATION_NAMES as names, type INotification} from '@/models/notification'
import {closeWhenClickedOutside} from '@/helpers/closeWhenClickedOutside'
import {useStore} from 'vuex'
import {useStore} from '@/store'
import {useRouter} from 'vue-router'
import {formatDateLong, formatDateSince} from '@/helpers/time/formatDate'
const LOAD_NOTIFICATIONS_INTERVAL = 10000
const store = useStore()
const router = useRouter()
const allNotifications = ref([])
const allNotifications = ref<INotification[]>([])
const showNotifications = ref(false)
const popup = ref(null)

View File

@ -177,16 +177,17 @@
<script setup lang="ts">
import {ref, watch, computed, shallowReactive} from 'vue'
import {useStore} from 'vuex'
import {useStore} from '@/store'
import {useI18n} from 'vue-i18n'
import RIGHTS from '@/models/constants/rights.json'
import LinkShareModel from '@/models/linkShare'
import {RIGHTS} from '@/models/constants/rights'
import LinkShareModel, { type ILinkShare } from '@/models/linkShare'
import LinkShareService from '@/services/linkShare'
import {useCopyToClipboard} from '@/composables/useCopyToClipboard'
import {success} from '@/message'
import type { IList } from '@/models/list'
const props = defineProps({
listId: {
@ -197,7 +198,7 @@ const props = defineProps({
const {t} = useI18n({useScope: 'global'})
const linkShares = ref([])
const linkShares = ref<ILinkShare[]>([])
const linkShareService = shallowReactive(new LinkShareService())
const selectedRight = ref(RIGHTS.READ)
const name = ref('')
@ -216,7 +217,7 @@ watch(
const store = useStore()
const frontendUrl = computed(() => store.state.config.frontendUrl)
async function load(listId) {
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) {
return
@ -225,7 +226,7 @@ async function load(listId) {
linkShares.value = await linkShareService.getAll({listId})
}
async function add(listId) {
async function add(listId: IList['id']) {
const newLinkShare = new LinkShareModel({
right: selectedRight.value,
listId,
@ -241,7 +242,7 @@ async function add(listId) {
await load(listId)
}
async function remove(listId) {
async function remove(listId: IList['id']) {
try {
await linkShareService.delete(new LinkShareModel({
id: linkIdToDelete.value,

View File

@ -133,32 +133,34 @@
</template>
<script lang="ts">
import {defineComponent} from 'vue'
export default defineComponent({name: 'userTeamShare'})
export default {name: 'userTeamShare'}
</script>
<script setup lang="ts">
import {ref, reactive, computed, shallowReactive, ShallowReactive, Ref} from 'vue'
import {ref, reactive, computed, shallowReactive, type Ref} from 'vue'
import type {PropType} from 'vue'
import {useStore} from 'vuex'
import {useStore} from '@/store'
import {useI18n} from 'vue-i18n'
import UserNamespaceService from '@/services/userNamespace'
import UserNamespaceModel from '@/models/userNamespace'
import UserListModel from '@/models/userList'
import UserNamespaceModel, { type IUserNamespace } from '@/models/userNamespace'
import UserListService from '@/services/userList'
import UserListModel, { type IUserList } from '@/models/userList'
import UserService from '@/services/user'
import UserModel from '@/models/user'
import UserModel, { type IUser } from '@/models/user'
import TeamNamespaceService from '@/services/teamNamespace'
import TeamNamespaceModel from '@/models/teamNamespace'
import TeamListModel from '@/models/teamList'
import TeamListService from '@/services/teamList'
import TeamService from '@/services/team'
import TeamModel from '@/models/team'
import TeamNamespaceModel, { type ITeamNamespace } from '@/models/teamNamespace'
import RIGHTS from '@/models/constants/rights.json'
import TeamListService from '@/services/teamList'
import TeamListModel, { type ITeamList } from '@/models/teamList'
import TeamService from '@/services/team'
import TeamModel, { type ITeam } from '@/models/team'
import {RIGHTS} from '@/models/constants/rights'
import Multiselect from '@/components/input/multiselect.vue'
import Nothing from '@/components/misc/nothing.vue'
import {success} from '@/message'
@ -185,10 +187,10 @@ const props = defineProps({
const {t} = useI18n({useScope: 'global'})
// This user service is either a userNamespaceService or a userListService, depending on the type we are using
let stuffService: ShallowReactive<UserNamespaceService | UserListService | TeamListService | TeamNamespaceService>
let stuffModel: UserNamespaceModel | UserListModel | TeamListModel | TeamNamespaceModel
let searchService: ShallowReactive<UserService | TeamService>
let sharable: Ref<UserModel | TeamModel>
let stuffService: UserNamespaceService | UserListService | TeamListService | TeamNamespaceService
let stuffModel: IUserNamespace | IUserList | ITeamList | ITeamNamespace
let searchService: UserService | TeamService
let sharable: Ref<IUser | ITeam>
const searchLabel = ref('')
const selectedRight = ref({})
@ -355,7 +357,7 @@ async function toggleType(sharable) {
const found = ref([])
const currentUserId = computed(() => store.state.auth.info.id)
async function find(query) {
async function find(query: string) {
if (query === '') {
found.value = []
return

View File

@ -43,8 +43,8 @@
<script setup lang="ts">
import {ref, watch, unref, shallowReactive} from 'vue'
import {useI18n} from 'vue-i18n'
import {useStore} from 'vuex'
import {tryOnMounted, debouncedWatch, useWindowSize, MaybeRef} from '@vueuse/core'
import {useStore} from '@/store'
import {tryOnMounted, debouncedWatch, useWindowSize, type MaybeRef} from '@vueuse/core'
import TaskService from '@/services/task'
import QuickAddMagic from '@/components/tasks/partials/quick-add-magic.vue'
@ -200,7 +200,7 @@ function handleEnter(e: KeyboardEvent) {
}
function focusTaskInput() {
newTaskInput.value.focus()
newTaskInput.value?.focus()
}
defineExpose({

View File

@ -76,14 +76,14 @@
</template>
<script setup lang="ts">
import {ref, reactive, computed, shallowReactive, watch, nextTick} from 'vue'
import {ref, reactive, computed, shallowReactive, watch, nextTick, type PropType} from 'vue'
import {useRouter} from 'vue-router'
import {useI18n} from 'vue-i18n'
import Editor from '@/components/input/AsyncEditor'
import TaskService from '@/services/task'
import TaskModel from '@/models/task'
import TaskModel, { type ITask } from '@/models/task'
import EditLabels from './partials/editLabels.vue'
import Reminders from './partials/reminders.vue'
import ColorPicker from '../input/colorPicker.vue'
@ -95,15 +95,14 @@ const router = useRouter()
const props = defineProps({
task: {
type: TaskModel,
required: true,
type: Object as PropType<ITask | null>,
},
})
const taskService = shallowReactive(new TaskService())
const editorActive = ref(false)
let taskEditTask: TaskModel | undefined
let taskEditTask: ITask | undefined
// FIXME: this initialization should not be necessary here

View File

@ -175,19 +175,20 @@
import {defineComponent} from 'vue'
import VueDragResize from 'vue-drag-resize'
import EditTask from './edit-task'
import EditTask from './edit-task.vue'
import TaskService from '../../services/task'
import TaskModel from '../../models/task'
import priorities from '../../models/constants/priorities'
import PriorityLabel from './partials/priorityLabel'
import {PRIORITIES as priorities} from '@/models/constants/priorities'
import PriorityLabel from './partials/priorityLabel.vue'
import TaskCollectionService from '../../services/taskCollection'
import {mapState} from 'vuex'
import Rights from '../../models/constants/rights.json'
import {RIGHTS as Rights} from '@/models/constants/rights'
import FilterPopup from '@/components/list/partials/filter-popup.vue'
import BaseButton from '@/components/base/BaseButton.vue'
import {colorIsDark} from '@/helpers/color/colorIsDark'
import {formatDate} from '@/helpers/time/formatDate'
export default defineComponent({
name: 'GanttChart',
@ -439,7 +440,7 @@ export default defineComponent({
formatMonthAndYear(year, month) {
month = month < 10 ? '0' + month : month
const date = new Date(`${year}-${month}-01`)
return this.format(date, 'MMMM, yyyy')
return formatDate(date, 'MMMM, yyyy')
},
},
})

View File

@ -39,7 +39,7 @@
<div class="info">
<p class="attachment-info-meta">
<i18n-t keypath="task.attachment.createdBy">
<span v-tooltip="formatDate(a.created)">
<span v-tooltip="formatDateLong(a.created)">
{{ formatDateSince(a.created) }}
</span>
<user
@ -147,14 +147,16 @@
import {defineComponent} from 'vue'
import AttachmentService from '../../../services/attachment'
import AttachmentModel from '../../../models/attachment'
import User from '../../misc/user'
import AttachmentModel, { type IAttachment } from '@/models/attachment'
import User from '@/components/misc/user.vue'
import {mapState} from 'vuex'
import { useCopyToClipboard } from '@/composables/useCopyToClipboard'
import { uploadFiles, generateAttachmentUrl } from '@/helpers/attachments'
import {formatDate, formatDateSince, formatDateLong} from '@/helpers/time/formatDate'
import BaseButton from '@/components/base/BaseButton'
import type { IFile } from '@/models/file'
export default defineComponent({
name: 'attachments',
@ -190,7 +192,7 @@ export default defineComponent({
setup(props) {
const copy = useCopyToClipboard()
function copyUrl(attachment: AttachmentModel) {
function copyUrl(attachment: IAttachment) {
copy(generateAttachmentUrl(props.taskId, attachment.id))
}
@ -229,7 +231,11 @@ export default defineComponent({
})
},
methods: {
downloadAttachment(attachment) {
formatDate,
formatDateSince,
formatDateLong,
downloadAttachment(attachment: IAttachment) {
this.attachmentService.download(attachment)
},
uploadNewAttachment() {
@ -239,7 +245,7 @@ export default defineComponent({
this.uploadFiles(this.$refs.files.files)
},
uploadFiles(files) {
uploadFiles(files: IFile[]) {
uploadFiles(this.attachmentService, this.taskId, files)
},
async deleteAttachment() {

View File

@ -10,15 +10,15 @@
</template>
<script setup lang="ts">
import {computed} from 'vue'
import {computed, type PropType} from 'vue'
import { useI18n } from 'vue-i18n'
import {getChecklistStatistics} from '@/helpers/checklistFromText'
import TaskModel from '@/models/task'
import type {ITask} from '@/models/task'
const props = defineProps({
task: {
type: TaskModel,
type: Object as PropType<ITask>,
required: true,
},
})

View File

@ -34,12 +34,12 @@
width="20"
/>
<strong>{{ c.author.getDisplayName() }}</strong>&nbsp;
<span v-tooltip="formatDate(c.created)" class="has-text-grey">
<span v-tooltip="formatDateLong(c.created)" class="has-text-grey">
{{ formatDateSince(c.created) }}
</span>
<span
v-if="+new Date(c.created) !== +new Date(c.updated)"
v-tooltip="formatDate(c.updated)"
v-tooltip="formatDateLong(c.updated)"
>
· {{ $t('task.comment.edited', {date: formatDateSince(c.updated)}) }}
</span>
@ -153,16 +153,18 @@
<script setup lang="ts">
import {ref, reactive, computed, shallowReactive, watch, nextTick} from 'vue'
import {useStore} from 'vuex'
import {useStore} from '@/store'
import {useI18n} from 'vue-i18n'
import Editor from '@/components/input/AsyncEditor'
import TaskCommentService from '@/services/taskComment'
import TaskCommentModel from '@/models/taskComment'
import TaskCommentModel, { type ITaskComment } from '@/models/taskComment'
import {uploadFile} from '@/helpers/attachments'
import {success} from '@/message'
import {formatDateLong, formatDateSince} from '@/helpers/time/formatDate'
import type { ITask } from '@/models/task'
const props = defineProps({
taskId: {
type: Number,
@ -176,7 +178,7 @@ const props = defineProps({
const {t} = useI18n({useScope: 'global'})
const store = useStore()
const comments = ref<TaskCommentModel[]>([])
const comments = ref<ITaskComment[]>([])
const showDeleteModal = ref(false)
const commentToDelete = reactive(new TaskCommentModel())
@ -186,8 +188,8 @@ const commentEdit = reactive(new TaskCommentModel())
const newComment = reactive(new TaskCommentModel())
const saved = ref(null)
const saving = ref(null)
const saved = ref<ITask['id'] | null>(null)
const saving = ref<ITask['id'] | null>(null)
const userAvatar = computed(() => store.state.auth.info.getAvatarUrl(48))
const currentUserId = computed(() => store.state.auth.info.id)
@ -213,7 +215,7 @@ function attachmentUpload(...args) {
const taskCommentService = shallowReactive(new TaskCommentService())
async function loadComments(taskId) {
async function loadComments(taskId: ITask['id']) {
if (!enabled.value) {
return
}
@ -257,12 +259,12 @@ async function addComment() {
}
}
function toggleEdit(comment: TaskCommentModel) {
function toggleEdit(comment: ITaskComment) {
isCommentEdit.value = !isCommentEdit.value
Object.assign(commentEdit, comment)
}
function toggleDelete(commentId) {
function toggleDelete(commentId: ITaskComment['id']) {
showDeleteModal.value = !showDeleteModal.value
commentToDelete.id = commentId
}
@ -292,7 +294,7 @@ async function editComment() {
}
}
async function deleteComment(commentToDelete: TaskCommentModel) {
async function deleteComment(commentToDelete: ITaskComment) {
try {
await taskCommentService.delete(commentToDelete)
const index = comments.value.findIndex(({id}) => id === commentToDelete.id)

View File

@ -1,6 +1,6 @@
<template>
<p class="created">
<time :datetime="formatISO(task.created)" v-tooltip="formatDate(task.created)">
<time :datetime="formatISO(task.created)" v-tooltip="formatDateLong(task.created)">
<i18n-t keypath="task.detail.created">
<span>{{ formatDateSince(task.created) }}</span>
{{ task.createdBy.getDisplayName() }}
@ -27,13 +27,13 @@
</template>
<script lang="ts" setup>
import {computed, toRefs} from 'vue'
import TaskModel from '@/models/task'
import {formatDateLong, formatDateSince} from '@/helpers/time/formatDate'
import {computed, toRefs, type PropType} from 'vue'
import type { ITask } from '@/models/task'
import {formatISO, formatDateLong, formatDateSince} from '@/helpers/time/formatDate'
const props = defineProps({
task: {
type: TaskModel,
type: Object as PropType<ITask>,
required: true,
},
})

View File

@ -1,12 +1,14 @@
<template>
<td v-tooltip="+date === 0 ? '' : formatDate(date)">
<time :datetime="date ? formatISO(date) : null">
<td v-tooltip="+date === 0 ? '' : formatDateLong(date)">
<time :datetime="date ? formatISO(date) : undefined">
{{ +date === 0 ? '-' : formatDateSince(date) }}
</time>
</td>
</template>
<script setup lang="ts">
import {formatISO, formatDateLong, formatDateSince} from '@/helpers/time/formatDate'
defineProps({
date: {
type: Date,

View File

@ -38,17 +38,17 @@
</template>
<script setup lang="ts">
import {ref, shallowReactive, computed, watch, onMounted, onBeforeUnmount} from 'vue'
import {useStore} from 'vuex'
import {ref, shallowReactive, computed, watch, onMounted, onBeforeUnmount, type PropType} from 'vue'
import {useStore} from '@/store'
import {useI18n} from 'vue-i18n'
import flatPickr from 'vue-flatpickr-component'
import TaskService from '@/services/task'
import TaskModel from '@/models/task'
import { type ITask } from '@/models/task'
const props = defineProps({
modelValue: {
type: TaskModel,
type: Object as PropType<ITask>,
required: true,
},
})
@ -58,7 +58,7 @@ const {t} = useI18n({useScope: 'global'})
const store = useStore()
const taskService = shallowReactive(new TaskService())
const task = ref<TaskModel>()
const task = ref<ITask>()
// We're saving the due date seperately to prevent null errors in very short periods where the task is null.
const dueDate = ref<Date>()

View File

@ -30,30 +30,31 @@
</template>
<script setup lang="ts">
import {ref,computed, watch} from 'vue'
import {useStore} from 'vuex'
import {ref,computed, watch, type PropType} from 'vue'
import {useStore} from '@/store'
import Editor from '@/components/input/AsyncEditor'
import TaskModel from '@/models/task'
import type { ITask } from '@/models/task'
const props = defineProps({
modelValue: {
type: TaskModel,
type: Object as PropType<ITask>,
required: true,
},
attachmentUpload: {
required: true,
},
canWrite: {
type: Boolean,
required: true,
},
})
const emit = defineEmits(['update:modelValue'])
const task = ref<TaskModel>({description: ''})
const task = ref<ITask>({description: ''})
const saved = ref(false)
// Since loading is global state, this variable ensures we're only showing the saving icon when saving the description.

View File

@ -28,8 +28,8 @@
</template>
<script setup lang="ts">
import {ref, shallowReactive, watch, PropType} from 'vue'
import {useStore} from 'vuex'
import {ref, shallowReactive, watch, type PropType} from 'vue'
import {useStore} from '@/store'
import {useI18n} from 'vue-i18n'
import User from '@/components/misc/user.vue'
@ -37,9 +37,9 @@ import Multiselect from '@/components/input/multiselect.vue'
import BaseButton from '@/components/base/BaseButton.vue'
import {includesById} from '@/helpers/utils'
import UserModel from '@/models/user'
import ListUserService from '@/services/listUsers'
import {success} from '@/message'
import type { IUser } from '@/models/user'
const props = defineProps({
taskId: {
@ -54,7 +54,7 @@ const props = defineProps({
default: false,
},
modelValue: {
type: Array as PropType<UserModel[]>,
type: Array as PropType<IUser[]>,
default: () => [],
},
})
@ -65,7 +65,7 @@ const {t} = useI18n({useScope: 'global'})
const listUserService = shallowReactive(new ListUserService())
const foundUsers = ref([])
const assignees = ref<UserModel[]>([])
const assignees = ref<IUser[]>([])
watch(
() => props.modelValue,
@ -78,13 +78,13 @@ watch(
},
)
async function addAssignee(user: UserModel) {
async function addAssignee(user: IUser) {
await store.dispatch('tasks/addAssignee', {user: user, taskId: props.taskId})
emit('update:modelValue', assignees.value)
success({message: t('task.assignee.assignSuccess')})
}
async function removeAssignee(user: UserModel) {
async function removeAssignee(user: IUser) {
await store.dispatch('tasks/removeAssignee', {user: user, taskId: props.taskId})
// Remove the assignee from the list

View File

@ -39,11 +39,11 @@
</template>
<script setup lang="ts">
import {PropType, ref, computed, shallowReactive, watch} from 'vue'
import {useStore} from 'vuex'
import {type PropType, ref, computed, shallowReactive, watch} from 'vue'
import {useStore} from '@/store'
import {useI18n} from 'vue-i18n'
import LabelModel from '@/models/label'
import LabelModel, { type ILabel } from '@/models/label'
import LabelTaskService from '@/services/labelTask'
import {success} from '@/message'
@ -52,7 +52,7 @@ import Multiselect from '@/components/input/multiselect.vue'
const props = defineProps({
modelValue: {
type: Array as PropType<LabelModel[]>,
type: Array as PropType<ILabel[]>,
default: () => [],
},
taskId: {
@ -71,7 +71,7 @@ const store = useStore()
const {t} = useI18n({useScope: 'global'})
const labelTaskService = shallowReactive(new LabelTaskService())
const labels = ref<LabelModel[]>([])
const labels = ref<ILabel[]>([])
const query = ref('')
watch(
@ -92,7 +92,7 @@ function findLabel(newQuery: string) {
query.value = newQuery
}
async function addLabel(label: LabelModel, showNotification = true) {
async function addLabel(label: ILabel, showNotification = true) {
const bubble = () => {
emit('update:modelValue', labels.value)
emit('change', labels.value)
@ -110,14 +110,14 @@ async function addLabel(label: LabelModel, showNotification = true) {
}
}
async function removeLabel(label: LabelModel) {
async function removeLabel(label: ILabel) {
if (props.taskId !== 0) {
await store.dispatch('tasks/removeLabel', {label, taskId: props.taskId})
}
for (const l in labels.value) {
if (labels.value[l].id === label.id) {
labels.value.splice(l, 1)
labels.value.splice(l, 1) // FIXME: l should be index
}
}
emit('update:modelValue', labels.value)

View File

@ -32,18 +32,18 @@
</template>
<script setup lang="ts">
import {ref, computed} from 'vue'
import {useStore} from 'vuex'
import {ref, computed, type PropType} from 'vue'
import {useStore} from '@/store'
import BaseButton from '@/components/base/BaseButton.vue'
import Done from '@/components/misc/Done.vue'
import TaskModel from '@/models/task'
import type {ITask} from '@/models/task'
import { useRouter } from 'vue-router'
import { useCopyToClipboard } from '@/composables/useCopyToClipboard'
const props = defineProps({
task: {
type: TaskModel,
type: Object as PropType<ITask>,
required: true,
},
canWrite: {

View File

@ -24,7 +24,7 @@
:class="{'overdue': task.dueDate <= new Date() && !task.done}"
class="due-date"
v-if="task.dueDate > 0"
v-tooltip="formatDate(task.dueDate)">
v-tooltip="formatDateLong(task.dueDate)">
<span class="icon">
<icon :icon="['far', 'calendar-alt']"/>
</span>
@ -66,16 +66,17 @@
</template>
<script lang="ts">
import {defineComponent} from 'vue'
import {defineComponent, type PropType} from 'vue'
import {playPop} from '../../../helpers/playPop'
import PriorityLabel from '../../../components/tasks/partials/priorityLabel'
import User from '../../../components/misc/user'
import PriorityLabel from '../../../components/tasks/partials/priorityLabel.vue'
import User from '../../../components/misc/user.vue'
import Done from '@/components/misc/Done.vue'
import Labels from '../../../components/tasks/partials/labels'
import ChecklistSummary from './checklist-summary'
import {TASK_DEFAULT_COLOR} from '@/models/task'
import Labels from '../../../components/tasks/partials/labels.vue'
import ChecklistSummary from './checklist-summary.vue'
import {TASK_DEFAULT_COLOR, type ITask} from '@/models/task'
import {formatDateLong, formatISO, formatDateSince} from '@/helpers/time/formatDate'
import {colorIsDark} from '@/helpers/color/colorIsDark'
export default defineComponent({
@ -95,6 +96,7 @@ export default defineComponent({
},
props: {
task: {
type: Object as PropType<ITask>,
required: true,
},
loading: {
@ -111,8 +113,11 @@ export default defineComponent({
},
},
methods: {
formatDateLong,
formatISO,
formatDateSince,
colorIsDark,
async toggleTaskDone(task) {
async toggleTaskDone(task: ITask) {
this.loadingInternal = true
try {
const done = !task.done

View File

@ -11,8 +11,12 @@
</template>
<script setup lang="ts">
import type { PropType } from 'vue'
import type { ILabel } from '@/models/label'
defineProps({
labels: {
type: Array as PropType<ILabel[]>,
required: true,
},
})

View File

@ -1,5 +1,5 @@
<template>
<multiselect
<Multiselect
class="control is-expanded"
:placeholder="$t('list.search')"
@search="findLists"
@ -13,23 +13,20 @@
<span class="list-namespace-title search-result">{{ namespace(props.option.namespaceId) }} ></span>
{{ props.option.title }}
</template>
</multiselect>
</Multiselect>
</template>
<script lang="ts" setup>
import {reactive, ref, watch} from 'vue'
import type {PropType} from 'vue'
import {useStore} from 'vuex'
import {useStore} from '@/store'
import {useI18n} from 'vue-i18n'
import ListModel from '@/models/list'
import ListModel, { type IList } from '@/models/list'
import Multiselect from '@/components/input/multiselect.vue'
const props = defineProps({
modelValue: {
type: Object as PropType<ListModel>,
validator(value) {
return value instanceof ListModel
},
type: Object as PropType<IList>,
required: false,
},
})
@ -38,7 +35,7 @@ const emit = defineEmits(['update:modelValue'])
const store = useStore()
const {t} = useI18n({useScope: 'global'})
const list = reactive<ListModel>(new ListModel())
const list: IList = reactive(new ListModel())
watch(
() => props.modelValue,
@ -57,7 +54,7 @@ function findLists(query: string) {
foundLists.value = store.getters['lists/searchList'](query)
}
function select(l: ListModel | null) {
function select(l: IList | null) {
Object.assign(list, l)
emit('update:modelValue', list)
}

View File

@ -21,7 +21,7 @@
</template>
<script setup lang="ts">
import priorities from '@/models/constants/priorities'
import {PRIORITIES as priorities} from '@/models/constants/priorities'
defineProps({
priority: {

View File

@ -5,19 +5,19 @@
@change="updateData"
:disabled="disabled || undefined"
>
<option :value="priorities.UNSET">{{ $t('task.priority.unset') }}</option>
<option :value="priorities.LOW">{{ $t('task.priority.low') }}</option>
<option :value="priorities.MEDIUM">{{ $t('task.priority.medium') }}</option>
<option :value="priorities.HIGH">{{ $t('task.priority.high') }}</option>
<option :value="priorities.URGENT">{{ $t('task.priority.urgent') }}</option>
<option :value="priorities.DO_NOW">{{ $t('task.priority.doNow') }}</option>
<option :value="PRIORITIES.UNSET">{{ $t('task.priority.unset') }}</option>
<option :value="PRIORITIES.LOW">{{ $t('task.priority.low') }}</option>
<option :value="PRIORITIES.MEDIUM">{{ $t('task.priority.medium') }}</option>
<option :value="PRIORITIES.HIGH">{{ $t('task.priority.high') }}</option>
<option :value="PRIORITIES.URGENT">{{ $t('task.priority.urgent') }}</option>
<option :value="PRIORITIES.DO_NOW">{{ $t('task.priority.doNow') }}</option>
</select>
</div>
</template>
<script setup lang="ts">
import {ref, watch} from 'vue'
import priorities from '@/models/constants/priorities.json'
import {PRIORITIES} from '@/models/constants/priorities'
const priority = ref(0)

View File

@ -144,8 +144,7 @@ import {defineComponent} from 'vue'
import TaskService from '../../../services/task'
import TaskModel from '../../../models/task'
import TaskRelationService from '../../../services/taskRelation'
import relationKinds from '../../../models/constants/relationKinds'
import TaskRelationModel from '../../../models/taskRelation'
import TaskRelationModel, {RELATION_KINDS} from '@/models/taskRelation'
import BaseButton from '@/components/base/BaseButton.vue'
import Multiselect from '@/components/input/multiselect.vue'
@ -157,7 +156,7 @@ export default defineComponent({
relatedTasks: {},
taskService: new TaskService(),
foundTasks: [],
relationKinds: relationKinds,
relationKinds: RELATION_KINDS,
newTaskRelationTask: new TaskModel(),
newTaskRelationKind: 'related',
taskRelationService: new TaskRelationService(),
@ -221,7 +220,7 @@ export default defineComponent({
},
},
methods: {
async findTasks(query) {
async findTasks(query: string) {
this.query = query
this.foundTasks = await this.taskService.getAll({}, {s: query})
},

View File

@ -26,7 +26,7 @@
</template>
<script setup lang="ts">
import {PropType, ref, onMounted, watch} from 'vue'
import {type PropType, ref, onMounted, watch} from 'vue'
import BaseButton from '@/components/base/BaseButton.vue'
import Datepicker from '@/components/input/datepicker.vue'
@ -45,8 +45,8 @@ const props = defineProps({
return false
}
const isDate = (e: any) => e instanceof Date
const isString = (e: any) => typeof e === 'string'
const isDate = (e: unknown) => e instanceof Date
const isString = (e: unknown) => typeof e === 'string'
for (const e of prop) {
if (!isDate(e) && !isString(e)) {

View File

@ -18,17 +18,14 @@
<div class="control">
<div class="select">
<select @change="updateData" v-model="task.repeatMode" id="repeatMode">
<option :value="repeatModes.REPEAT_MODE_DEFAULT">{{ $t('misc.default') }}</option>
<option :value="repeatModes.REPEAT_MODE_MONTH">{{ $t('task.repeat.monthly') }}</option>
<option :value="repeatModes.REPEAT_MODE_FROM_CURRENT_DATE">{{
$t('task.repeat.fromCurrentDate')
}}
</option>
<option :value="TASK_REPEAT_MODES.REPEAT_MODE_DEFAULT">{{ $t('misc.default') }}</option>
<option :value="TASK_REPEAT_MODES.REPEAT_MODE_MONTH">{{ $t('task.repeat.monthly') }}</option>
<option :value="TASK_REPEAT_MODES.REPEAT_MODE_FROM_CURRENT_DATE">{{ $t('task.repeat.fromCurrentDate') }}</option>
</select>
</div>
</div>
</div>
<div class="is-flex" v-if="task.repeatMode !== repeatModes.REPEAT_MODE_MONTH">
<div class="is-flex" v-if="task.repeatMode !== TASK_REPEAT_MODES.REPEAT_MODE_MONTH">
<p class="pr-4">
{{ $t('task.repeat.each') }}
</p>
@ -65,14 +62,15 @@
</template>
<script setup lang="ts">
import {ref, reactive, watch} from 'vue'
import repeatModes from '@/models/constants/taskRepeatModes.json'
import TaskModel from '@/models/task'
import {error} from '@/message'
import {ref, reactive, watch, type PropType} from 'vue'
import {useI18n} from 'vue-i18n'
import {error} from '@/message'
import {TASK_REPEAT_MODES, type ITask, type RepeatAfter} from '@/models/task'
const props = defineProps({
modelValue: {
type: Object as PropType<ITask>,
default: () => ({}),
required: true,
},
@ -86,7 +84,7 @@ const {t} = useI18n()
const emit = defineEmits(['update:modelValue', 'change'])
const task = ref<TaskModel>()
const task = ref<ITask>()
const repeatAfter = reactive({
amount: 0,
type: '',
@ -104,7 +102,7 @@ watch(
)
function updateData() {
if (task.value.repeatMode !== repeatModes.REPEAT_MODE_DEFAULT && repeatAfter.amount === 0) {
if (!task.value || task.value.repeatMode !== TASK_REPEAT_MODES.REPEAT_MODE_DEFAULT && repeatAfter.amount === 0) {
return
}
@ -118,8 +116,8 @@ function updateData() {
emit('change')
}
function setRepeatAfter(amount: number, type) {
Object.assign(repeatAfter, {amount, type})
function setRepeatAfter(amount: number, type: RepeatAfter['type']) {
Object.assign(repeatAfter, { amount, type})
updateData()
}
</script>

View File

@ -30,7 +30,7 @@
{{ task.title }}
</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
:avatar-size="27"
:is-inline="true"
@ -43,7 +43,7 @@
v-if="+new Date(task.dueDate) > 0"
class="dueDate"
@click.prevent.stop="showDefer = !showDefer"
v-tooltip="formatDate(task.dueDate)"
v-tooltip="formatDateLong(task.dueDate)"
>
<time
:datetime="formatISO(task.dueDate)"
@ -96,19 +96,20 @@
</template>
<script lang="ts">
import {defineComponent} from 'vue'
import {defineComponent, type PropType} from 'vue'
import TaskModel from '../../../models/task'
import PriorityLabel from './priorityLabel'
import TaskModel, { type ITask } from '../../../models/task'
import PriorityLabel from './priorityLabel.vue'
import TaskService from '../../../services/task'
import Labels from './labels'
import User from '../../misc/user'
import Labels from '@/components/tasks/partials/labels.vue'
import User from '@/components/misc/user.vue'
import BaseButton from '@/components/base/BaseButton.vue'
import Fancycheckbox from '../../input/fancycheckbox'
import DeferTask from './defer-task'
import Fancycheckbox from '../../input/fancycheckbox.vue'
import DeferTask from './defer-task.vue'
import {closeWhenClickedOutside} from '@/helpers/closeWhenClickedOutside'
import {playPop} from '@/helpers/playPop'
import ChecklistSummary from './checklist-summary'
import ChecklistSummary from './checklist-summary.vue'
import {formatDateSince, formatISO, formatDateLong} from '@/helpers/time/formatDate'
export default defineComponent({
name: 'singleTaskInList',
@ -130,7 +131,7 @@ export default defineComponent({
},
props: {
theTask: {
type: TaskModel,
type: Object as PropType<ITask>,
required: true,
},
isArchived: {
@ -188,7 +189,11 @@ export default defineComponent({
},
},
methods: {
async markAsDone(checked) {
formatDateSince,
formatISO,
formatDateLong,
async markAsDone(checked: boolean) {
const updateFunc = async () => {
const task = await this.taskService.update(this.task)
if (this.task.done) {
@ -213,7 +218,7 @@ export default defineComponent({
}
},
undoDone(checked) {
undoDone(checked: boolean) {
this.task.done = !this.task.done
this.markAsDone(!checked)
},

View File

@ -7,7 +7,7 @@
</template>
<script setup lang="ts">
import {PropType} from 'vue'
import type {PropType} from 'vue'
import BaseButton from '@/components/base/BaseButton.vue'
type Order = 'asc' | 'desc' | 'none'

View File

@ -1,5 +1,5 @@
import {ref, computed} from 'vue'
import {useStore} from 'vuex'
import {useStore} from '@/store'
export function useNameSpaceSearch() {
const query = ref('')

View File

@ -1,22 +1,27 @@
import AttachmentModel from '@/models/attachment'
import FileModel from '@/models/file'
import AttachmentModel, { type IAttachment } from '@/models/attachment'
import type {IFile} from '@/models/file'
import AttachmentService from '@/services/attachment'
import { store } from '@/store'
export function uploadFile(taskId: number, file: FileModel, onSuccess: () => Function) {
export function uploadFile(taskId: number, file: IFile, onSuccess: () => Function) {
const attachmentService = new AttachmentService()
const files = [file]
return uploadFiles(attachmentService, taskId, files, onSuccess)
}
export async function uploadFiles(attachmentService: AttachmentService, taskId: number, files: FileModel[], onSuccess : Function = () => {}) {
export async function uploadFiles(
attachmentService: AttachmentService,
taskId: number,
files: IFile[],
onSuccess: Function = () => {},
) {
const attachmentModel = new AttachmentModel({taskId})
const response = await attachmentService.create(attachmentModel, files)
console.debug(`Uploaded attachments for task ${taskId}, response was`, response)
response.success?.map((attachment: AttachmentModel) => {
response.success?.map((attachment: IAttachment) => {
store.dispatch('tasks/addTaskAttachment', {
taskId,
attachment,
@ -29,6 +34,6 @@ export async function uploadFiles(attachmentService: AttachmentService, taskId:
}
}
export function generateAttachmentUrl(taskId: number, attachmentId: number) : any {
export function generateAttachmentUrl(taskId: number, attachmentId: number) {
return `${window.API_URL}/tasks/${taskId}/attachments/${attachmentId}`
}

View File

@ -1,8 +1,7 @@
import {i18n} from '@/i18n'
import type { IList } from '@/models/list'
import type ListModal from '@/models/list'
export function getListTitle(l: ListModal) {
export function getListTitle(l: IList) {
if (l.id === -1) {
return i18n.global.t('list.pseudo.favorites.title')
}

View File

@ -1,7 +1,7 @@
import {i18n} from '@/i18n'
import NamespaceModel from '@/models/namespace'
import type {INamespace} from '@/models/namespace'
export const getNamespaceTitle = (n: NamespaceModel) => {
export const getNamespaceTitle = (n: INamespace) => {
if (n.id === -1) {
return i18n.global.t('namespace.pseudo.sharedLists.title')
}

View File

@ -1,18 +1,10 @@
import {createNewIndexer} from '../indexes'
import type {LabelState} from '@/store/types'
import type {ILabel} from '@/models/label'
const {search} = createNewIndexer('labels', ['title', 'description'])
export interface label {
id: number,
title: string,
}
interface labelState {
labels: {
[k: number]: label,
},
}
/**
* Checks if a list of labels is available in the store and filters them then query
* @param {Object} state
@ -20,7 +12,7 @@ interface labelState {
* @param {String} query
* @returns {Array}
*/
export function filterLabelsByQuery(state: labelState, labelsToHide: label[], query: string) {
export function filterLabelsByQuery(state: LabelState, labelsToHide: ILabel[], query: string) {
const labelIdsToHide: number[] = labelsToHide.map(({id}) => id)
return search(query)
@ -36,6 +28,6 @@ export function filterLabelsByQuery(state: labelState, labelsToHide: label[], qu
* @param {Array} ids
* @returns {Array}
*/
export function getLabelsByIds(state: labelState, ids: number[]) {
export function getLabelsByIds(state: LabelState, ids: ILabel['id'][]) {
return Object.values(state.labels).filter(({id}) => ids.includes(id))
}

View File

@ -1,13 +1,14 @@
/**
* Make date objects from timestamps
*/
*/
export function parseDateOrNull(date) {
if (date instanceof Date) {
return date
}
if (date && !date.startsWith('0001')) {
if ((typeof date === 'string' || date instanceof String) && !date.startsWith('0001')) {
return new Date(date)
}
return null
}

View File

@ -1,7 +1,7 @@
import {createRandomID} from '@/helpers/randomId'
import {parseURL} from 'ufo'
interface Provider {
export interface Provider {
name: string
key: string
authUrl: string

View File

@ -1,4 +1,4 @@
import ListModel from '@/models/list'
import type {IList} from '@/models/list'
const key = 'collapsedBuckets'
@ -11,7 +11,10 @@ const getAllState = () => {
return JSON.parse(saved)
}
export const saveCollapsedBucketState = (listId: ListModel['id'], collapsedBuckets) => {
export const saveCollapsedBucketState = (
listId: IList['id'],
collapsedBuckets,
) => {
const state = getAllState()
state[listId] = collapsedBuckets
for (const bucketId in state[listId]) {
@ -22,7 +25,7 @@ export const saveCollapsedBucketState = (listId: ListModel['id'], collapsedBucke
localStorage.setItem(key, JSON.stringify(state))
}
export const getCollapsedBucketState = (listId : ListModel['id']) => {
export const getCollapsedBucketState = (listId : IList['id']) => {
const state = getAllState()
if (typeof state[listId] !== 'undefined') {
return state[listId]

View File

@ -1,6 +1,6 @@
import ListModel from '@/models/list'
import type {IList} from '@/models/list'
export function getSavedFilterIdFromListId(listId: ListModel['id']) {
export function getSavedFilterIdFromListId(listId: IList['id']) {
let filterId = listId * -1 - 1
// FilterIds from listIds are always positive
if (filterId < 0) {

View File

@ -1,8 +1,8 @@
export function findIndexById(array : [], id : string | number) {
export function findIndexById<T extends {id: string | number}>(array : T[], id : string | number) {
return array.findIndex(({id: currentId}) => currentId === id)
}
export function findById(array : [], id : string | number) {
export function findById<T extends {id: string | number}>(array : T[], id : string | number) {
return array.find(({id: currentId}) => currentId === id)
}
@ -11,11 +11,11 @@ export function includesById(array: [], id: string | number) {
}
// https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore#_isnil
export function isNil(value: any) {
export function isNil(value: unknown) {
return value == null
}
export function omitBy(obj: {}, check: (value: any) => boolean): {} {
export function omitBy(obj: {}, check: (value: unknown) => boolean) {
if (isNil(obj)) {
return {}
}

View File

@ -780,7 +780,8 @@
"days": "Days",
"weeks": "Weeks",
"months": "Months",
"years": "Years"
"years": "Years",
"invalidAmount": "Please enter more than 0."
},
"quickAddMagic": {
"hint": "You can use Quick Add Magic",

View File

@ -780,7 +780,8 @@
"days": "Dnů",
"weeks": "Týdny",
"months": "Měsíce",
"years": "Roky"
"years": "Roky",
"invalidAmount": "Please enter more than 0."
},
"quickAddMagic": {
"hint": "Můžeš použít Kouzelné rychlé přidání",

View File

@ -780,7 +780,8 @@
"days": "Tage",
"weeks": "Wochen",
"months": "Monate",
"years": "Jahre"
"years": "Jahre",
"invalidAmount": "Bitte mehr als 0 eingeben."
},
"quickAddMagic": {
"hint": "Du kannst Quick Add Magic verwenden",

View File

@ -780,7 +780,8 @@
"days": "Tääg",
"weeks": "Wuchä",
"months": "Monet",
"years": "Jahr"
"years": "Jahr",
"invalidAmount": "Bitte mehr als 0 eingeben."
},
"quickAddMagic": {
"hint": "Du chasch Quick Add Magic verwendä",

View File

@ -780,7 +780,8 @@
"days": "Days",
"weeks": "Weeks",
"months": "Months",
"years": "Years"
"years": "Years",
"invalidAmount": "Please enter more than 0."
},
"quickAddMagic": {
"hint": "You can use Quick Add Magic",

View File

@ -780,7 +780,8 @@
"days": "Jours",
"weeks": "Semaines",
"months": "Mois",
"years": "Années"
"years": "Années",
"invalidAmount": "Please enter more than 0."
},
"quickAddMagic": {
"hint": "Tu peux utiliser Quick Add Magic",

View File

@ -780,7 +780,8 @@
"days": "Giorni",
"weeks": "Settimane",
"months": "Mesi",
"years": "Anni"
"years": "Anni",
"invalidAmount": "Please enter more than 0."
},
"quickAddMagic": {
"hint": "Puoi usare l'Aggiunta Rapida Magica",

View File

@ -780,7 +780,8 @@
"days": "Dagen",
"weeks": "Weken",
"months": "Maanden",
"years": "Jaren"
"years": "Jaren",
"invalidAmount": "Please enter more than 0."
},
"quickAddMagic": {
"hint": "You can use Quick Add Magic",

View File

@ -780,7 +780,8 @@
"days": "Dni",
"weeks": "Tygodnie",
"months": "Miesiące",
"years": "Lata"
"years": "Lata",
"invalidAmount": "Please enter more than 0."
},
"quickAddMagic": {
"hint": "Możesz użyć Quick Add Magic",

View File

@ -780,7 +780,8 @@
"days": "Days",
"weeks": "Weeks",
"months": "Months",
"years": "Years"
"years": "Years",
"invalidAmount": "Please enter more than 0."
},
"quickAddMagic": {
"hint": "You can use Quick Add Magic",

View File

@ -780,7 +780,8 @@
"days": "Dias",
"weeks": "Semanas",
"months": "Meses",
"years": "Anos"
"years": "Anos",
"invalidAmount": "Please enter more than 0."
},
"quickAddMagic": {
"hint": "Podes utilizar a Introdução Mágica Rápida",

View File

@ -780,7 +780,8 @@
"days": "Days",
"weeks": "Weeks",
"months": "Months",
"years": "Years"
"years": "Years",
"invalidAmount": "Please enter more than 0."
},
"quickAddMagic": {
"hint": "You can use Quick Add Magic",

View File

@ -780,7 +780,8 @@
"days": "Дней",
"weeks": "Недель",
"months": "Месяцев",
"years": "Лет"
"years": "Лет",
"invalidAmount": "Please enter more than 0."
},
"quickAddMagic": {
"hint": "Вы можете использовать Волшебное Быстрое Добавление",

View File

@ -780,7 +780,8 @@
"days": "Days",
"weeks": "Weeks",
"months": "Months",
"years": "Years"
"years": "Years",
"invalidAmount": "Please enter more than 0."
},
"quickAddMagic": {
"hint": "You can use Quick Add Magic",

View File

@ -780,7 +780,8 @@
"days": "Days",
"weeks": "Weeks",
"months": "Months",
"years": "Years"
"years": "Years",
"invalidAmount": "Please enter more than 0."
},
"quickAddMagic": {
"hint": "You can use Quick Add Magic",

View File

@ -780,7 +780,8 @@
"days": "Days",
"weeks": "Weeks",
"months": "Months",
"years": "Years"
"years": "Years",
"invalidAmount": "Please enter more than 0."
},
"quickAddMagic": {
"hint": "You can use Quick Add Magic",

View File

@ -780,7 +780,8 @@
"days": "Ngày",
"weeks": "Tuần",
"months": "Tháng",
"years": "Năm"
"years": "Năm",
"invalidAmount": "Please enter more than 0."
},
"quickAddMagic": {
"hint": "Bạn có thể sử dụng Quick Add Magic",

1032
src/i18n/lang/zh-CN.json Normal file

File diff suppressed because it is too large Load Diff

View File

@ -5,8 +5,6 @@ import router from './router'
import {error, success} from './message'
import {formatDate, formatDateShort, formatDateLong, formatDateSince, formatISO} from '@/helpers/time/formatDate'
import {VERSION} from './version.json'
// Notifications
@ -16,7 +14,7 @@ import Notifications from '@kyvg/vue3-notification'
import './registerServiceWorker'
// Vuex
import {store} from './store'
import { store, key } from './store'
// i18n
import {i18n} from './i18n'
@ -69,24 +67,6 @@ app.component('x-button', Button)
app.component('modal', Modal)
app.component('card', Card)
// Mixins
import {getNamespaceTitle} from './helpers/getNamespaceTitle'
import {getListTitle} from './helpers/getListTitle'
import {setTitle} from './helpers/setTitle'
app.mixin({
methods: {
formatDateSince,
format: formatDate,
formatDate: formatDateLong,
formatDateShort: formatDateShort,
formatISO,
getNamespaceTitle,
getListTitle,
setTitle,
},
})
app.config.errorHandler = (err, vm, info) => {
if (import.meta.env.DEV) {
console.error(err, vm, info)
@ -124,7 +104,7 @@ if (window.SENTRY_ENABLED) {
import('./sentry').then(sentry => sentry.default(app, router))
}
app.use(store)
app.use(store, key) // pass the injection key
app.use(router)
app.use(i18n)

View File

@ -1,12 +1,17 @@
import {objectToCamelCase} from '@/helpers/case'
import {omitBy, isNil} from '@/helpers/utils'
import type {Right} from '@/models/constants/rights'
export default class AbstractModel {
export interface IAbstract {
maxRight: Right | null
}
export default class AbstractModel implements IAbstract {
/**
* The max right the user has on this object, as returned by the x-max-right header from the api.
*/
maxRight: number | null = null
maxRight: Right | null = null
/**
* The abstract constructor takes an object and merges its data with the default data of this model.

View File

@ -1,24 +1,35 @@
import AbstractModel from './abstractModel'
import UserModel from './user'
import FileModel from './file'
import UserModel, {type IUser} from './user'
import FileModel, {type IFile} from './file'
export interface IAttachment extends AbstractModel {
id: number
taskId: number
createdBy: IUser
file: IFile
created: Date
}
export default class AttachmentModel extends AbstractModel implements IAttachment {
declare id: number
declare taskId: number
createdBy: IUser
file: IFile
created: Date
export default class AttachmentModel extends AbstractModel {
constructor(data) {
super(data)
this.createdBy = new UserModel(this.createdBy)
this.file = new FileModel(this.file)
this.created = new Date(this.created)
/** @type {number} */
this.id
}
defaults() {
return {
id: 0,
taskId: 0,
file: FileModel,
createdBy: UserModel,
file: FileModel,
created: null,
}
}

View File

@ -1,6 +1,14 @@
import AbstractModel from './abstractModel'
export default class AvatarModel extends AbstractModel {
export type AvatarProvider = 'default' | 'initials' | 'gravatar' | 'marble' | 'upload'
export interface IAvatar extends AbstractModel {
avatarProvider: AvatarProvider
}
export default class AvatarModel extends AbstractModel implements IAvatar {
declare avatarProvider: AvatarProvider
defaults() {
return {
avatarProvider: '',

View File

@ -1,6 +1,26 @@
import AbstractModel from './abstractModel'
export default class BackgroundImageModel extends AbstractModel {
export interface IBackgroundImage extends AbstractModel {
id: number
url: string
thumb: string
info: {
author: string
authorName: string
}
blurHash: string
}
export default class BackgroundImageModel extends AbstractModel implements IBackgroundImage {
declare id: number
declare url: string
declare thumb: string
declare info: {
author: string
authorName: string
}
declare blurHash: string
defaults() {
return {
id: 0,

View File

@ -1,8 +1,34 @@
import AbstractModel from './abstractModel'
import UserModel from './user'
import TaskModel from './task'
import UserModel, { type IUser } from './user'
import TaskModel, { type ITask } from './task'
export interface IBucket extends AbstractModel {
id: number
title: string
listId: number
limit: number
tasks: ITask[]
isDoneBucket: boolean
position: number
createdBy: IUser
created: Date
updated: Date
}
export default class BucketModel extends AbstractModel implements IBucket {
declare id: number
declare title: string
declare listId: number
declare limit: number
declare tasks: ITask[]
declare isDoneBucket: boolean
declare position: number
createdBy: IUser
created: Date
updated: Date
export default class BucketModel extends AbstractModel {
constructor(bucket) {
super(bucket)

View File

@ -1,14 +1,20 @@
import AbstractModel from './abstractModel'
export default class CaldavTokenModel extends AbstractModel {
export interface ICaldavToken extends AbstractModel {
id: number;
created: Date;
}
export default class CaldavTokenModel extends AbstractModel implements ICaldavToken {
declare id: number
declare created: Date
constructor(data? : Object) {
super(data)
/** @type {number} */
this.id
if (this.created) {
/** @type {Date} */
this.created = new Date(this.created)
}
}

View File

@ -1,7 +0,0 @@
{
"TASK_COMMENT": "task.comment",
"TASK_ASSIGNED": "task.assigned",
"TASK_DELETED": "task.deleted",
"LIST_CREATED": "list.created",
"TEAM_MEMBER_ADDED": "team.member.added"
}

View File

@ -1,8 +0,0 @@
{
"UNSET": 0,
"LOW": 1,
"MEDIUM": 2,
"HIGH": 3,
"URGENT": 4,
"DO_NOW": 5
}

View File

@ -0,0 +1,10 @@
export const PRIORITIES = {
'UNSET': 0,
'LOW': 1,
'MEDIUM': 2,
'HIGH': 3,
'URGENT': 4,
'DO_NOW': 5,
} as const
export type Priority = typeof PRIORITIES[keyof typeof PRIORITIES]

View File

@ -1,12 +0,0 @@
[
"subtask",
"parenttask",
"related",
"duplicates",
"blocking",
"blocked",
"precedes",
"follows",
"copiedfrom",
"copiedto"
]

View File

@ -1,5 +0,0 @@
{
"READ": 0,
"READ_WRITE": 1,
"ADMIN": 2
}

View File

@ -0,0 +1,7 @@
export const RIGHTS = {
'READ': 0,
'READ_WRITE': 1,
'ADMIN': 2,
} as const
export type Right = typeof RIGHTS[keyof typeof RIGHTS]

View File

@ -1,5 +0,0 @@
{
"REPEAT_MODE_DEFAULT": 0,
"REPEAT_MODE_MONTH": 1,
"REPEAT_MODE_FROM_CURRENT_DATE": 2
}

View File

@ -1,6 +1,14 @@
import AbstractModel from './abstractModel'
export default class EmailUpdateModel extends AbstractModel {
interface IEmailUpdate extends AbstractModel {
newEmail: string
password: string
}
export default class EmailUpdateModel extends AbstractModel implements IEmailUpdate {
declare newEmail: string
declare password: string
defaults() {
return {
newEmail: '',

View File

@ -1,6 +1,20 @@
import AbstractModel from './abstractModel'
export default class FileModel extends AbstractModel {
export interface IFile extends AbstractModel {
id: number
mime: string
name: string
size: number
created: Date
}
export default class FileModel extends AbstractModel implements IFile {
declare id: number
declare mime: string
declare name: string
declare size: number
created: Date
constructor(data) {
super(data)
this.created = new Date(this.created)

View File

@ -1,9 +1,34 @@
import AbstractModel from './abstractModel'
import UserModel from './user'
import UserModel, { type IUser } from './user'
import {colorIsDark} from '@/helpers/color/colorIsDark'
const DEFAULT_LABEL_BACKGROUND_COLOR = 'e8e8e8'
export default class LabelModel extends AbstractModel {
export interface ILabel extends AbstractModel {
id: number
title: string
hexColor: string
description: string
createdBy: IUser
listId: number
textColor: string
created: Date
updated: Date
}
export default class LabelModel extends AbstractModel implements ILabel {
declare id: number
declare title: string
declare hexColor: string
declare description: string
declare createdBy: IUser
declare listId: number
declare textColor: string
created: Date
updated: Date
constructor(data) {
super(data)
// FIXME: this should be empty and be definied in the client.

View File

@ -1,6 +1,16 @@
import AbstractModel from './abstractModel'
export default class LabelTask extends AbstractModel {
export interface ILabelTask extends AbstractModel {
id: number
taskId: number
labelId: number
}
export default class LabelTask extends AbstractModel implements ILabelTask {
declare id: number
declare taskId: number
declare labelId: number
defaults() {
return {
id: 0,

View File

@ -1,7 +1,31 @@
import AbstractModel from './abstractModel'
import UserModel from './user'
import UserModel, { type IUser } from './user'
import {RIGHTS, type Right} from '@/models/constants/rights'
export default class LinkShareModel extends AbstractModel {
export interface ILinkShare extends AbstractModel {
id: number
hash: string
right: Right
sharedBy: IUser
sharingType: number // FIXME: use correct numbers
listId: number
name: string
password: string
created: Date
updated: Date
}
export default class LinkShareModel extends AbstractModel implements ILinkShare {
declare id: number
declare hash: string
declare right: Right
sharedBy: IUser
declare sharingType: number // FIXME: use correct numbers
declare listId: number
declare name: string
declare password: string
created: Date
updated: Date
constructor(data) {
// The constructor of AbstractModel handles all the default parsing.
@ -18,7 +42,7 @@ export default class LinkShareModel extends AbstractModel {
return {
id: 0,
hash: '',
right: 0,
right: RIGHTS.READ,
sharedBy: UserModel,
sharingType: 0,
listId: 0,

Some files were not shown because too many files have changed in this diff Show More