feat: improve models

This commit is contained in:
Dominik Pschenitschni 2022-09-06 11:36:01 +02:00 committed by Gitea
parent 61427987c2
commit 1a11b43ca8
95 changed files with 198 additions and 139 deletions

View file

@ -156,8 +156,8 @@ 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'
const drag = ref(false) const drag = ref(false)
const dragOptions = { const dragOptions = {

View file

@ -83,8 +83,8 @@ 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'
const props = defineProps({ const props = defineProps({
list: { list: {

View file

@ -45,7 +45,7 @@ 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'
const background = ref<string | null>(null) const background = ref<string | null>(null)
const backgroundLoading = ref(false) const backgroundLoading = ref(false)

View file

@ -39,7 +39,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'

View file

@ -59,7 +59,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 +69,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
}) })

View file

@ -181,13 +181,15 @@ 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'
const props = defineProps({ const props = defineProps({
listId: { listId: {

View file

@ -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'

View file

@ -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'

View file

@ -147,7 +147,8 @@
import {defineComponent} from 'vue' import {defineComponent} from 'vue'
import AttachmentService from '../../../services/attachment' import AttachmentService from '../../../services/attachment'
import AttachmentModel, { type IAttachment } from '@/models/attachment' import AttachmentModel from '@/models/attachment'
import type {IAttachment} from '@/modelTypes/IAttachment'
import User from '@/components/misc/user.vue' import User from '@/components/misc/user.vue'
import {mapState} from 'vuex' import {mapState} from 'vuex'
@ -155,8 +156,8 @@ import { useCopyToClipboard } from '@/composables/useCopyToClipboard'
import { uploadFiles, generateAttachmentUrl } from '@/helpers/attachments' import { uploadFiles, generateAttachmentUrl } from '@/helpers/attachments'
import {formatDate, formatDateSince, formatDateLong} from '@/helpers/time/formatDate' import {formatDate, formatDateSince, formatDateLong} from '@/helpers/time/formatDate'
import BaseButton from '@/components/base/BaseButton' import BaseButton from '@/components/base/BaseButton.vue'
import type { IFile } from '@/models/file' import type { IFile } from '@/modelTypes/IFile'
import { getHumanSize } from '@/helpers/getHumanSize' import { getHumanSize } from '@/helpers/getHumanSize'
export default defineComponent({ export default defineComponent({

View file

@ -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: {

View file

@ -159,12 +159,15 @@ 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 type { ITask } from '@/models/task'
const props = defineProps({ const props = defineProps({
taskId: { taskId: {
type: Number, type: Number,

View file

@ -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({

View file

@ -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: {

View file

@ -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({

View file

@ -34,12 +34,14 @@
<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'
const props = defineProps({ const props = defineProps({
task: { task: {

View file

@ -74,7 +74,8 @@ 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'

View file

@ -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: {

View file

@ -21,7 +21,8 @@ import {reactive, ref, watch} from 'vue'
import type {PropType} from 'vue' import type {PropType} from 'vue'
import {useStore} from '@/store' 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'
const props = defineProps({ const props = defineProps({

View file

@ -98,7 +98,8 @@
<script lang="ts"> <script lang="ts">
import {defineComponent, type PropType} from 'vue' import {defineComponent, type PropType} from 'vue'
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'

View file

@ -1,5 +1,6 @@
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 type {IFile} from '@/modelTypes/IFile'
import AttachmentService from '@/services/attachment' import AttachmentService from '@/services/attachment'
import { store } from '@/store' import { store } from '@/store'

View file

@ -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) {

View file

@ -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) {

View file

@ -1,7 +1,7 @@
import {createNewIndexer} from '../indexes' import {createNewIndexer} from '../indexes'
import type {LabelState} from '@/store/types' import type {LabelState} from '@/store/types'
import type {ILabel} from '@/models/label' import type {ILabel} from '@/modelTypes/ILabel'
const {search} = createNewIndexer('labels', ['title', 'description']) const {search} = createNewIndexer('labels', ['title', 'description'])

View file

@ -1,4 +1,4 @@
import type {IList} from '@/models/list' import type {IList} from '@/modelTypes/IList'
const key = 'collapsedBuckets' const key = 'collapsedBuckets'

View file

@ -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

View file

@ -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

View file

@ -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>) {

View file

@ -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 = ''

View file

@ -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

View file

@ -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

View file

@ -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 = ''

View file

@ -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 = ''

View file

@ -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.

View file

@ -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

View file

@ -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

View file

@ -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)

View file

@ -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

View file

@ -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)

View file

@ -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

View file

@ -2,7 +2,7 @@ import AbstractModel from './abstractModel'
import type {IPasswordReset} from '@/modelTypes/IPasswordReset' import type {IPasswordReset} from '@/modelTypes/IPasswordReset'
export default class PasswordResetModel extends AbstractModel implements IPasswordReset { export default class PasswordResetModel extends AbstractModel<IPasswordReset> implements IPasswordReset {
token = '' token = ''
newPassword = '' newPassword = ''
email = '' email = ''

View file

@ -2,7 +2,7 @@ import AbstractModel from './abstractModel'
import type {IPasswordUpdate} from '@/modelTypes/IPasswordUpdate' import type {IPasswordUpdate} from '@/modelTypes/IPasswordUpdate'
export default class PasswordUpdateModel extends AbstractModel implements IPasswordUpdate { export default class PasswordUpdateModel extends AbstractModel<IPasswordUpdate> implements IPasswordUpdate {
newPassword = '' newPassword = ''
oldPassword = '' oldPassword = ''

View file

@ -4,7 +4,7 @@ import UserModel from '@/models/user'
import type {ISavedFilter} from '@/modelTypes/ISavedFilter' import type {ISavedFilter} from '@/modelTypes/ISavedFilter'
import type {IUser} from '@/modelTypes/IUser' import type {IUser} from '@/modelTypes/IUser'
export default class SavedFilterModel extends AbstractModel implements ISavedFilter { export default class SavedFilterModel extends AbstractModel<ISavedFilter> implements ISavedFilter {
id = 0 id = 0
title = '' title = ''
description = '' description = ''

View file

@ -4,7 +4,7 @@ import UserModel from '@/models/user'
import type {ISubscription} from '@/modelTypes/ISubscription' import type {ISubscription} from '@/modelTypes/ISubscription'
import type {IUser} from '@/modelTypes/IUser' import type {IUser} from '@/modelTypes/IUser'
export default class SubscriptionModel extends AbstractModel implements ISubscription { export default class SubscriptionModel extends AbstractModel<ISubscription> implements ISubscription {
id = 0 id = 0
entity = '' entity = ''
entityId = 0 entityId = 0

View file

@ -32,7 +32,7 @@ export function getHexColor(hexColor: string) {
return hexColor return hexColor
} }
export default class TaskModel extends AbstractModel implements ITask { export default class TaskModel extends AbstractModel<ITask> implements ITask {
id = 0 id = 0
title = '' title = ''
description = '' description = ''

View file

@ -4,7 +4,7 @@ import type {ITaskAssignee} from '@/modelTypes/ITaskAssignee'
import type {IUser} from '@/modelTypes/IUser' import type {IUser} from '@/modelTypes/IUser'
import type {ITask} from '@/modelTypes/ITask' import type {ITask} from '@/modelTypes/ITask'
export default class TaskAssigneeModel extends AbstractModel implements ITaskAssignee { export default class TaskAssigneeModel extends AbstractModel<ITaskAssignee> implements ITaskAssignee {
created: Date = null created: Date = null
userId: IUser['id'] = 0 userId: IUser['id'] = 0
taskId: ITask['id'] = 0 taskId: ITask['id'] = 0

View file

@ -5,7 +5,7 @@ import type {ITaskComment} from '@/modelTypes/ITaskComment'
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 TaskCommentModel extends AbstractModel implements ITaskComment { export default class TaskCommentModel extends AbstractModel<ITaskComment> implements ITaskComment {
id = 0 id = 0
taskId: ITask['id'] = 0 taskId: ITask['id'] = 0
comment = '' comment = ''

View file

@ -6,7 +6,7 @@ import type {ITask} from '@/modelTypes/ITask'
import type {IUser} from '@/modelTypes/IUser' import type {IUser} from '@/modelTypes/IUser'
import type {IRelationKind} from '@/types/IRelationKind' import type {IRelationKind} from '@/types/IRelationKind'
export default class TaskRelationModel extends AbstractModel implements ITaskRelation { export default class TaskRelationModel extends AbstractModel<ITaskRelation> implements ITaskRelation {
id = 0 id = 0
otherTaskId: ITask['id'] = 0 otherTaskId: ITask['id'] = 0
taskId: ITask['id'] = 0 taskId: ITask['id'] = 0

View file

@ -7,7 +7,7 @@ import type {ITeam} from '@/modelTypes/ITeam'
import type {ITeamMember} from '@/modelTypes/ITeamMember' import type {ITeamMember} from '@/modelTypes/ITeamMember'
import type {IUser} from '@/modelTypes/IUser' import type {IUser} from '@/modelTypes/IUser'
export default class TeamModel extends AbstractModel implements ITeam { export default class TeamModel extends AbstractModel<ITeam> implements ITeam {
id = 0 id = 0
name = '' name = ''
description = '' description = ''

View file

@ -8,7 +8,7 @@ import type {ITeam} from '@/modelTypes/ITeam'
* This class is a base class for common team sharing model. * This class is a base class for common team sharing model.
* It is extended in a way so it can be used for namespaces as well for lists. * It is extended in a way so it can be used for namespaces as well for lists.
*/ */
export default class TeamShareBaseModel extends AbstractModel implements ITeamShareBase { export default class TeamShareBaseModel extends AbstractModel<ITeamShareBase> implements ITeamShareBase {
teamId: ITeam['id'] = 0 teamId: ITeam['id'] = 0
right: Right = RIGHTS.READ right: Right = RIGHTS.READ

View file

@ -2,7 +2,7 @@ import AbstractModel from './abstractModel'
import type {ITotp} from '@/modelTypes/ITotp' import type {ITotp} from '@/modelTypes/ITotp'
export default class TotpModel extends AbstractModel implements ITotp { export default class TotpModel extends AbstractModel<ITotp> implements ITotp {
secret = '' secret = ''
enabled = false enabled = false
url = '' url = ''

View file

@ -4,7 +4,7 @@ import UserSettingsModel from '@/models/userSettings'
import type { IUser } from '@/modelTypes/IUser' import type { IUser } from '@/modelTypes/IUser'
import type { IUserSettings } from '@/modelTypes/IUserSettings' import type { IUserSettings } from '@/modelTypes/IUserSettings'
export default class UserModel extends AbstractModel implements IUser { export default class UserModel extends AbstractModel<IUser> implements IUser {
id = 0 id = 0
email = '' email = ''
username = '' username = ''

View file

@ -4,7 +4,7 @@ import AbstractModel from './abstractModel'
import type {IUserSettings} from '@/modelTypes/IUserSettings' import type {IUserSettings} from '@/modelTypes/IUserSettings'
import type {IList} from '@/modelTypes/IList' import type {IList} from '@/modelTypes/IList'
export default class UserSettingsModel extends AbstractModel implements IUserSettings { export default class UserSettingsModel extends AbstractModel<IUserSettings> implements IUserSettings {
name = '' name = ''
emailRemindersEnabled = true emailRemindersEnabled = true
discoverableByName = false discoverableByName = false

View file

@ -4,7 +4,7 @@ import {RIGHTS, type Right} from '@/constants/rights'
import type {IUserShareBase} from '@/modelTypes/IUserShareBase' import type {IUserShareBase} from '@/modelTypes/IUserShareBase'
import type {IUser} from '@/modelTypes/IUser' import type {IUser} from '@/modelTypes/IUser'
export default class UserShareBaseModel extends AbstractModel implements IUserShareBase { export default class UserShareBaseModel extends AbstractModel<IUserShareBase> implements IUserShareBase {
userId: IUser['id'] = '' userId: IUser['id'] = ''
right: Right = RIGHTS.READ right: Right = RIGHTS.READ

View file

@ -1,6 +1,6 @@
import {beforeEach, afterEach, describe, it, expect, vi} from 'vitest' import {beforeEach, afterEach, describe, it, expect, vi} from 'vitest'
import {parseTaskText} from './parseTaskText' import {parseTaskText, PrefixMode} from './parseTaskText'
import {getDateFromText, getDateFromTextIn} from '../helpers/time/parseDate' import {getDateFromText, getDateFromTextIn} from '../helpers/time/parseDate'
import {calculateDayInterval} from '../helpers/time/calculateDayInterval' import {calculateDayInterval} from '../helpers/time/calculateDayInterval'
import {PRIORITIES} from '@/constants/priorities' import {PRIORITIES} from '@/constants/priorities'
@ -20,13 +20,13 @@ describe('Parse Task Text', () => {
it('should not parse text when disabled', () => { it('should not parse text when disabled', () => {
const text = 'Lorem Ipsum today *label +list !2 @user' const text = 'Lorem Ipsum today *label +list !2 @user'
const result = parseTaskText(text, 'disabled') const result = parseTaskText(text, PrefixMode.Disabled)
expect(result.text).toBe(text) expect(result.text).toBe(text)
}) })
it('should parse text in todoist mode when configured', () => { it('should parse text in todoist mode when configured', () => {
const result = parseTaskText('Lorem Ipsum today @label #list !2 +user', 'todoist') const result = parseTaskText('Lorem Ipsum today @label #list !2 +user', PrefixMode.Todoist)
expect(result.text).toBe('Lorem Ipsum') expect(result.text).toBe('Lorem Ipsum')
const now = new Date() const now = new Date()
@ -84,7 +84,7 @@ describe('Parse Task Text', () => {
'at 3am': '3:0', 'at 3am': '3:0',
'at 3:12 am': '3:12', 'at 3:12 am': '3:12',
'at 3:12 pm': '15:12', 'at 3:12 pm': '15:12',
} } as const
for (const c in cases) { for (const c in cases) {
it(`should recognize today with a time ${c}`, () => { it(`should recognize today with a time ${c}`, () => {
@ -95,7 +95,7 @@ describe('Parse Task Text', () => {
expect(result.date.getFullYear()).toBe(now.getFullYear()) expect(result.date.getFullYear()).toBe(now.getFullYear())
expect(result.date.getMonth()).toBe(now.getMonth()) expect(result.date.getMonth()).toBe(now.getMonth())
expect(result.date.getDate()).toBe(now.getDate()) expect(result.date.getDate()).toBe(now.getDate())
expect(`${result.date.getHours()}:${result.date.getMinutes()}`).toBe(cases[c]) expect(`${result.date.getHours()}:${result.date.getMinutes()}`).toBe(cases[c as keyof typeof cases])
expect(result.date.getSeconds()).toBe(0) expect(result.date.getSeconds()).toBe(0)
}) })
} }

View file

@ -4,7 +4,7 @@ import type {Method} from 'axios'
import {objectToSnakeCase} from '@/helpers/case' import {objectToSnakeCase} from '@/helpers/case'
import AbstractModel, { type IAbstract } from '@/models/abstractModel' import AbstractModel, { type IAbstract } from '@/models/abstractModel'
import type { Right } from '@/constants/rights' import type { Right } from '@/constants/rights'
import type { IFile } from '@/models/file' import type {IFile} from '@/modelTypes/IFile'
interface Paths { interface Paths {
create : string create : string

View file

@ -1,8 +1,12 @@
import AbstractService from './abstractService'
import AttachmentModel, { type IAttachment } from '../models/attachment'
import {formatISO} from 'date-fns' import {formatISO} from 'date-fns'
import AbstractService from './abstractService'
import AttachmentModel from '../models/attachment'
import type { IAttachment } from '@/modelTypes/IAttachment'
import type { IFile } from '@/modelTypes/IFile'
import {downloadBlob} from '@/helpers/downloadBlob' import {downloadBlob} from '@/helpers/downloadBlob'
import type { IFile } from '@/models/file'
export default class AttachmentService extends AbstractService<AttachmentModel> { export default class AttachmentService extends AbstractService<AttachmentModel> {
constructor() { constructor() {
@ -22,7 +26,7 @@ export default class AttachmentService extends AbstractService<AttachmentModel>
return false return false
} }
modelFactory(data) { modelFactory(data: Partial<IAttachment>) {
return new AttachmentModel(data) return new AttachmentModel(data)
} }

View file

@ -1,5 +1,6 @@
import AbstractService from './abstractService' import AbstractService from './abstractService'
import AvatarModel, { type IAvatar } from '../models/avatar' import AvatarModel from '@/models/avatar'
import type { IAvatar } from '@/modelTypes/IAvatar'
export default class AvatarService extends AbstractService<IAvatar> { export default class AvatarService extends AbstractService<IAvatar> {
constructor() { constructor() {
@ -10,7 +11,7 @@ export default class AvatarService extends AbstractService<IAvatar> {
}) })
} }
modelFactory(data) { modelFactory(data: Partial<IAvatar>) {
return new AvatarModel(data) return new AvatarModel(data)
} }

View file

@ -1,6 +1,7 @@
import AbstractService from './abstractService' import AbstractService from './abstractService'
import BackgroundImageModel, { type IBackgroundImage } from '../models/backgroundImage' import BackgroundImageModel from '../models/backgroundImage'
import ListModel from '@/models/list' import ListModel from '@/models/list'
import type { IBackgroundImage } from '@/modelTypes/IBackgroundImage'
export default class BackgroundUnsplashService extends AbstractService<IBackgroundImage> { export default class BackgroundUnsplashService extends AbstractService<IBackgroundImage> {
constructor() { constructor() {
@ -10,7 +11,7 @@ export default class BackgroundUnsplashService extends AbstractService<IBackgrou
}) })
} }
modelFactory(data) { modelFactory(data: Partial<IBackgroundImage>) {
return new BackgroundImageModel(data) return new BackgroundImageModel(data)
} }

View file

@ -1,6 +1,8 @@
import AbstractService from './abstractService' import AbstractService from './abstractService'
import ListModel, { type IList } from '../models/list' import ListModel from '@/models/list'
import type { IFile } from '@/models/file'
import type { IList } from '@/modelTypes/IList'
import type { IFile } from '@/modelTypes/IFile'
export default class BackgroundUploadService extends AbstractService { export default class BackgroundUploadService extends AbstractService {
constructor() { constructor() {
@ -13,14 +15,12 @@ export default class BackgroundUploadService extends AbstractService {
return false return false
} }
modelCreateFactory(data) { modelCreateFactory(data: Partial<IList>) {
return new ListModel(data) return new ListModel(data)
} }
/** /**
* Uploads a file to the server * Uploads a file to the server
* @param file
* @returns {Promise<any|never>}
*/ */
create(listId: IList['id'], file: IFile) { create(listId: IList['id'], file: IFile) {
return this.uploadFile( return this.uploadFile(

View file

@ -1,6 +1,7 @@
import AbstractService from './abstractService' import AbstractService from './abstractService'
import BucketModel, { type IBucket } from '../models/bucket' import BucketModel from '../models/bucket'
import TaskService from '@/services/task' import TaskService from '@/services/task'
import type { IBucket } from '@/modelTypes/IBucket'
export default class BucketService extends AbstractService<IBucket> { export default class BucketService extends AbstractService<IBucket> {
constructor() { constructor() {
@ -12,7 +13,7 @@ export default class BucketService extends AbstractService<IBucket> {
}) })
} }
modelFactory(data) { modelFactory(data: Partial<IBucket>) {
return new BucketModel(data) return new BucketModel(data)
} }

View file

@ -1,5 +1,6 @@
import {formatISO} from 'date-fns' import {formatISO} from 'date-fns'
import CaldavTokenModel, {type ICaldavToken} from '../models/caldavToken' import CaldavTokenModel from '@/models/caldavToken'
import type {ICaldavToken} from '@/modelTypes/ICaldavToken'
import AbstractService from './abstractService' import AbstractService from './abstractService'
export default class CaldavTokenService extends AbstractService<ICaldavToken> { export default class CaldavTokenService extends AbstractService<ICaldavToken> {

View file

@ -1,5 +1,6 @@
import AbstractService from './abstractService' import AbstractService from './abstractService'
import LabelModel, { type ILabel } from '@/models/label' import LabelModel from '@/models/label'
import type {ILabel} from '@/modelTypes/ILabel'
import {formatISO} from 'date-fns' import {formatISO} from 'date-fns'
import {colorFromHex} from '@/helpers/color/colorFromHex' import {colorFromHex} from '@/helpers/color/colorFromHex'

View file

@ -1,5 +1,6 @@
import AbstractService from './abstractService' import AbstractService from './abstractService'
import LabelTask, {type ILabelTask} from '@/models/labelTask' import LabelTask from '@/models/labelTask'
import type {ILabelTask} from '@/modelTypes/ILabelTask'
export default class LabelTaskService extends AbstractService<ILabelTask> { export default class LabelTaskService extends AbstractService<ILabelTask> {
constructor() { constructor() {

View file

@ -1,5 +1,6 @@
import AbstractService from './abstractService' import AbstractService from './abstractService'
import LinkShareModel, { type ILinkShare } from '@/models/linkShare' import LinkShareModel from '@/models/linkShare'
import type {ILinkShare} from '@/modelTypes/ILinkShare'
import {formatISO} from 'date-fns' import {formatISO} from 'date-fns'
export default class LinkShareService extends AbstractService<ILinkShare> { export default class LinkShareService extends AbstractService<ILinkShare> {

View file

@ -1,5 +1,6 @@
import AbstractService from './abstractService' import AbstractService from './abstractService'
import ListModel, { type IList } from '@/models/list' import ListModel from '@/models/list'
import type {IList} from '@/modelTypes/IList'
import TaskService from './task' import TaskService from './task'
import {formatISO} from 'date-fns' import {formatISO} from 'date-fns'
import {colorFromHex} from '@/helpers/color/colorFromHex' import {colorFromHex} from '@/helpers/color/colorFromHex'

View file

@ -1,5 +1,6 @@
import AbstractService from './abstractService' import AbstractService from './abstractService'
import listDuplicateModel, {type IListDuplicate} from '../models/listDuplicateModel' import listDuplicateModel from '@/models/listDuplicateModel'
import type {IListDuplicate} from '@/modelTypes/IListDuplicate'
export default class ListDuplicateService extends AbstractService<IListDuplicate> { export default class ListDuplicateService extends AbstractService<IListDuplicate> {
constructor() { constructor() {

View file

@ -1,3 +1,4 @@
import type {IFile} from '@/modelTypes/IFile'
import AbstractService from '../abstractService' import AbstractService from '../abstractService'
// This service builds on top of the abstract service and basically just hides away method names. // This service builds on top of the abstract service and basically just hides away method names.
@ -5,7 +6,7 @@ import AbstractService from '../abstractService'
export default class AbstractMigrationFileService extends AbstractService { export default class AbstractMigrationFileService extends AbstractService {
serviceUrlKey = '' serviceUrlKey = ''
constructor(serviceUrlKey) { constructor(serviceUrlKey: '') {
super({ super({
create: '/migration/' + serviceUrlKey + '/migrate', create: '/migration/' + serviceUrlKey + '/migrate',
}) })
@ -20,7 +21,7 @@ export default class AbstractMigrationFileService extends AbstractService {
return false return false
} }
migrate(file) { migrate(file: IFile) {
console.log(file) console.log(file)
return this.uploadFile( return this.uploadFile(
this.paths.create, this.paths.create,

View file

@ -1,5 +1,6 @@
import AbstractService from './abstractService' import AbstractService from './abstractService'
import NamespaceModel, { type INamespace } from '../models/namespace' import NamespaceModel from '../models/namespace'
import type {INamespace} from '@/modelTypes/INamespace'
import {formatISO} from 'date-fns' import {formatISO} from 'date-fns'
import {colorFromHex} from '@/helpers/color/colorFromHex' import {colorFromHex} from '@/helpers/color/colorFromHex'

View file

@ -1,6 +1,7 @@
import AbstractService from '@/services/abstractService' import AbstractService from '@/services/abstractService'
import {formatISO} from 'date-fns' import {formatISO} from 'date-fns'
import NotificationModel, { type INotification } from '@/models/notification' import NotificationModel from '@/models/notification'
import type {INotification} from '@/modelTypes/INotification'
export default class NotificationService extends AbstractService<INotification> { export default class NotificationService extends AbstractService<INotification> {
constructor() { constructor() {

View file

@ -1,5 +1,6 @@
import AbstractService from './abstractService' import AbstractService from './abstractService'
import PasswordResetModel, { type IPasswordReset } from '../models/passwordReset' import PasswordResetModel from '@/models/passwordReset'
import type {IPasswordReset} from '@/modelTypes/IPasswordReset'
export default class PasswordResetService extends AbstractService<IPasswordReset> { export default class PasswordResetService extends AbstractService<IPasswordReset> {

View file

@ -1,5 +1,5 @@
import type { IPasswordUpdate } from '@/models/passwordUpdate'
import AbstractService from './abstractService' import AbstractService from './abstractService'
import type {IPasswordUpdate} from '@/modelTypes/IPasswordUpdate'
export default class PasswordUpdateService extends AbstractService<IPasswordUpdate> { export default class PasswordUpdateService extends AbstractService<IPasswordUpdate> {
constructor() { constructor() {

View file

@ -1,5 +1,6 @@
import AbstractService from '@/services/abstractService' import AbstractService from '@/services/abstractService'
import SavedFilterModel, { type ISavedFilter } from '@/models/savedFilter' import SavedFilterModel from '@/models/savedFilter'
import type {ISavedFilter} from '@/modelTypes/ISavedFilter'
import {objectToCamelCase} from '@/helpers/case' import {objectToCamelCase} from '@/helpers/case'
export default class SavedFilterService extends AbstractService<ISavedFilter> { export default class SavedFilterService extends AbstractService<ISavedFilter> {

View file

@ -1,5 +1,6 @@
import AbstractService from '@/services/abstractService' import AbstractService from '@/services/abstractService'
import SubscriptionModel, { type ISubscription } from '@/models/subscription' import SubscriptionModel from '@/models/subscription'
import type {ISubscription} from '@/modelTypes/ISubscription'
export default class SubscriptionService extends AbstractService<ISubscription> { export default class SubscriptionService extends AbstractService<ISubscription> {
constructor() { constructor() {

View file

@ -1,5 +1,6 @@
import AbstractService from './abstractService' import AbstractService from './abstractService'
import TaskModel, { type ITask } from '../models/task' import TaskModel from '@/models/task'
import type {ITask} from '@/modelTypes/ITask'
import AttachmentService from './attachment' import AttachmentService from './attachment'
import LabelService from './label' import LabelService from './label'

View file

@ -1,5 +1,6 @@
import AbstractService from './abstractService' import AbstractService from './abstractService'
import TaskAssigneeModel, { type ITaskAssignee } from '../models/taskAssignee' import TaskAssigneeModel from '@/models/taskAssignee'
import type {ITaskAssignee} from '@/modelTypes/ITaskAssignee'
import {formatISO} from 'date-fns' import {formatISO} from 'date-fns'
export default class TaskAssigneeService extends AbstractService<ITaskAssignee> { export default class TaskAssigneeService extends AbstractService<ITaskAssignee> {

View file

@ -1,5 +1,6 @@
import AbstractService from './abstractService' import AbstractService from './abstractService'
import TaskCommentModel, { type ITaskComment } from '../models/taskComment' import TaskCommentModel from '@/models/taskComment'
import type {ITaskComment} from '@/modelTypes/ITaskComment'
import {formatISO} from 'date-fns' import {formatISO} from 'date-fns'
export default class TaskCommentService extends AbstractService<ITaskComment> { export default class TaskCommentService extends AbstractService<ITaskComment> {

View file

@ -1,7 +1,8 @@
import {formatISO} from 'date-fns' import {formatISO} from 'date-fns'
import AbstractService from './abstractService' import AbstractService from './abstractService'
import TaskRelationModel, {type ITaskRelation} from '@/models/taskRelation' import TaskRelationModel from '@/models/taskRelation'
import type {ITaskRelation} from '@/modelTypes/ITaskRelation'
export default class TaskRelationService extends AbstractService<ITaskRelation> { export default class TaskRelationService extends AbstractService<ITaskRelation> {
constructor() { constructor() {

View file

@ -1,5 +1,6 @@
import AbstractService from './abstractService' import AbstractService from './abstractService'
import TeamModel, { type ITeam } from '../models/team' import TeamModel from '@/models/team'
import type { ITeam } from '@/modelTypes/ITeam'
import {formatISO} from 'date-fns' import {formatISO} from 'date-fns'
export default class TeamService extends AbstractService<ITeam> { export default class TeamService extends AbstractService<ITeam> {

View file

@ -1,6 +1,7 @@
import AbstractService from './abstractService' import AbstractService from './abstractService'
import TeamListModel, { type ITeamList } from '../models/teamList' import TeamListModel from '@/models/teamList'
import TeamModel from '../models/team' import type {ITeamList} from '@/modelTypes/ITeamList'
import TeamModel from '@/models/team'
import {formatISO} from 'date-fns' import {formatISO} from 'date-fns'
export default class TeamListService extends AbstractService<ITeamList> { export default class TeamListService extends AbstractService<ITeamList> {

View file

@ -1,5 +1,6 @@
import AbstractService from './abstractService' import AbstractService from './abstractService'
import TeamMemberModel, { type ITeamMember } from '../models/teamMember' import TeamMemberModel from '@/models/teamMember'
import type {ITeamMember} from '@/modelTypes/ITeamMember'
import {formatISO} from 'date-fns' import {formatISO} from 'date-fns'
export default class TeamMemberService extends AbstractService<ITeamMember> { export default class TeamMemberService extends AbstractService<ITeamMember> {

View file

@ -1,6 +1,7 @@
import AbstractService from './abstractService' import AbstractService from './abstractService'
import TeamNamespaceModel, { type ITeamNamespace } from '../models/teamNamespace' import TeamNamespaceModel from '@/models/teamNamespace'
import TeamModel from '../models/team' import type {ITeamNamespace} from '@/modelTypes/ITeamNamespace'
import TeamModel from '@/models/team'
import {formatISO} from 'date-fns' import {formatISO} from 'date-fns'
export default class TeamNamespaceService extends AbstractService<ITeamNamespace> { export default class TeamNamespaceService extends AbstractService<ITeamNamespace> {

View file

@ -1,5 +1,6 @@
import AbstractService from './abstractService' import AbstractService from './abstractService'
import TotpModel, { type ITotp } from '@/models/totp' import TotpModel from '@/models/totp'
import type {ITotp} from '@/modelTypes/ITotp'
export default class TotpService extends AbstractService<ITotp> { export default class TotpService extends AbstractService<ITotp> {
urlPrefix = '/user/settings/totp' urlPrefix = '/user/settings/totp'

View file

@ -1,5 +1,6 @@
import AbstractService from './abstractService' import AbstractService from './abstractService'
import UserModel, { type IUser } from '../models/user' import UserModel from '@/models/user'
import type {IUser} from '@/modelTypes/IUser'
import {formatISO} from 'date-fns' import {formatISO} from 'date-fns'
export default class UserService extends AbstractService<IUser> { export default class UserService extends AbstractService<IUser> {

View file

@ -1,8 +1,10 @@
import AbstractService from './abstractService'
import UserListModel, { type IUserList } from '../models/userList'
import UserModel from '../models/user'
import {formatISO} from 'date-fns' import {formatISO} from 'date-fns'
import AbstractService from './abstractService'
import UserListModel from '@/models/userList'
import type {IUserList} from '@/modelTypes/IUserList'
import UserModel from '@/models/user'
export default class UserListService extends AbstractService<IUserList> { export default class UserListService extends AbstractService<IUserList> {
constructor() { constructor() {
super({ super({

View file

@ -1,8 +1,10 @@
import AbstractService from './abstractService'
import UserNamespaceModel, { type IUserNamespace } from '../models/userNamespace'
import UserModel from '../models/user'
import {formatISO} from 'date-fns' import {formatISO} from 'date-fns'
import AbstractService from './abstractService'
import UserNamespaceModel from '@/models/userNamespace'
import type {IUserNamespace} from '@/modelTypes/IUserNamespace'
import UserModel from '@/models/user'
export default class UserNamespaceService extends AbstractService<IUserNamespace> { export default class UserNamespaceService extends AbstractService<IUserNamespace> {
constructor() { constructor() {
super({ super({

View file

@ -1,5 +1,4 @@
import type {IUserSettings} from '@/modelTypes/IUserSettings'
import type { IUserSettings } from '@/models/userSettings'
import AbstractService from './abstractService' import AbstractService from './abstractService'
export default class UserSettingsService extends AbstractService<IUserSettings> { export default class UserSettingsService extends AbstractService<IUserSettings> {

View file

@ -68,7 +68,7 @@ import SavedFilterService from '@/services/savedFilter'
import {objectToSnakeCase} from '@/helpers/case' import {objectToSnakeCase} from '@/helpers/case'
import {getSavedFilterIdFromListId} from '@/helpers/savedFilter' import {getSavedFilterIdFromListId} from '@/helpers/savedFilter'
import type { IList } from '@/models/list' import type {IList} from '@/modelTypes/IList'
const {t} = useI18n({useScope: 'global'}) const {t} = useI18n({useScope: 'global'})

View file

@ -113,7 +113,8 @@
import {defineComponent} from 'vue' import {defineComponent} from 'vue'
import {mapState} from 'vuex' import {mapState} from 'vuex'
import LabelModel, { type ILabel } from '../../models/label' import LabelModel from '@/models/label'
import type {ILabel} from '@/modelTypes/ILabel'
import {LOADING, LOADING_MODULE} from '@/store/mutation-types' import {LOADING, LOADING_MODULE} from '@/store/mutation-types'
import BaseButton from '@/components/base/BaseButton.vue' import BaseButton from '@/components/base/BaseButton.vue'

View file

@ -153,7 +153,7 @@ import {ALPHABETICAL_SORT} from '@/components/list/partials/filters.vue'
import draggable from 'zhyswan-vuedraggable' import draggable from 'zhyswan-vuedraggable'
import {calculateItemPosition} from '../../helpers/calculateItemPosition' import {calculateItemPosition} from '../../helpers/calculateItemPosition'
import type { ITask } from '@/models/task' import type {ITask} from '@/modelTypes/ITask'
function sortTasks(tasks: ITask[]) { function sortTasks(tasks: ITask[]) {
if (tasks === null || Array.isArray(tasks) && tasks.length === 0) { if (tasks === null || Array.isArray(tasks) && tasks.length === 0) {

View file

@ -197,7 +197,7 @@ import Pagination from '@/components/misc/pagination.vue'
import Popup from '@/components/misc/popup.vue' import Popup from '@/components/misc/popup.vue'
import {useTaskList} from '@/composables/taskList' import {useTaskList} from '@/composables/taskList'
import type { ITask } from '@/models/task' import type {ITask} from '@/modelTypes/ITask'
const ACTIVE_COLUMNS_DEFAULT = { const ACTIVE_COLUMNS_DEFAULT = {
id: true, id: true,

View file

@ -58,7 +58,7 @@ import DatepickerWithRange from '@/components/date/datepickerWithRange.vue'
import {DATE_RANGES} from '@/components/date/dateRanges' import {DATE_RANGES} from '@/components/date/dateRanges'
import {LOADING, LOADING_MODULE} from '@/store/mutation-types' import {LOADING, LOADING_MODULE} from '@/store/mutation-types'
import LlamaCool from '@/assets/llama-cool.svg?component' import LlamaCool from '@/assets/llama-cool.svg?component'
import type { ITask } from '@/models/task' import type {ITask} from '@/modelTypes/ITask'
const store = useStore() const store = useStore()
const route = useRoute() const route = useRoute()

View file

@ -426,7 +426,8 @@ import {defineComponent} from 'vue'
import cloneDeep from 'lodash.clonedeep' import cloneDeep from 'lodash.clonedeep'
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 { PRIORITIES as priorites } from '@/constants/priorities' import { PRIORITIES as priorites } from '@/constants/priorities'
import {RIGHTS as rights} from '@/constants/rights' import {RIGHTS as rights} from '@/constants/rights'
@ -456,7 +457,7 @@ import CreatedUpdated from '@/components/tasks/partials/createdUpdated.vue'
import { setTitle } from '@/helpers/setTitle' import { setTitle } from '@/helpers/setTitle'
import {getNamespaceTitle} from '@/helpers/getNamespaceTitle' import {getNamespaceTitle} from '@/helpers/getNamespaceTitle'
import {getListTitle} from '@/helpers/getListTitle' import {getListTitle} from '@/helpers/getListTitle'
import type { IList } from '@/models/list' import type { IList } from '@/modelTypes/IList'
function scrollIntoView(el) { function scrollIntoView(el) {
if (!el) { if (!el) {

View file

@ -177,9 +177,9 @@ import Multiselect from '@/components/input/multiselect.vue'
import {useRoute, useRouter} from 'vue-router' import {useRoute, useRouter} from 'vue-router'
import {useTitle} from '@/composables/useTitle' import {useTitle} from '@/composables/useTitle'
import {success} from '@/message' import {success} from '@/message'
import type { ITeam } from '@/models/team' import type {ITeam} from '@/modelTypes/ITeam'
import type { IUser } from '@/models/user' import type {IUser} from '@/modelTypes/IUser'
import type { ITeamMember } from '@/models/teamMember' import type {ITeamMember} from '@/modelTypes/ITeamMember'
const store = useStore() const store = useStore()
const route = useRoute() const route = useRoute()

View file

@ -78,7 +78,7 @@ import BaseButton from '@/components/base/BaseButton.vue'
import Message from '@/components/misc/message.vue' import Message from '@/components/misc/message.vue'
import CaldavTokenService from '@/services/caldavToken' import CaldavTokenService from '@/services/caldavToken'
import { formatDateShort } from '@/helpers/time/formatDate' import { formatDateShort } from '@/helpers/time/formatDate'
import type { ICaldavToken } from '@/models/caldavToken' import type {ICaldavToken} from '@/modelTypes/ICaldavToken'
const copy = useCopyToClipboard() const copy = useCopyToClipboard()

View file

@ -16,5 +16,8 @@
"paths": { "paths": {
"@/*": ["./src/*"] "@/*": ["./src/*"]
} }
},
"vueCompilerOptions": {
"strictTemplates": true
} }
} }