feat(views): crud in frontend
This commit is contained in:
@ -7,6 +7,7 @@ import type {IProject} from '@/modelTypes/IProject'
|
||||
import type {IUser} from '@/modelTypes/IUser'
|
||||
import type {ITask} from '@/modelTypes/ITask'
|
||||
import type {ISubscription} from '@/modelTypes/ISubscription'
|
||||
import ProjectViewModel from '@/models/projectView'
|
||||
|
||||
export default class ProjectModel extends AbstractModel<IProject> implements IProject {
|
||||
id = 0
|
||||
@ -25,6 +26,7 @@ export default class ProjectModel extends AbstractModel<IProject> implements IPr
|
||||
parentProjectId = 0
|
||||
doneBucketId = 0
|
||||
defaultBucketId = 0
|
||||
views = []
|
||||
|
||||
created: Date = null
|
||||
updated: Date = null
|
||||
@ -48,6 +50,8 @@ export default class ProjectModel extends AbstractModel<IProject> implements IPr
|
||||
this.subscription = new SubscriptionModel(this.subscription)
|
||||
}
|
||||
|
||||
this.views = this.views.map(v => new ProjectViewModel(v))
|
||||
|
||||
this.created = new Date(this.created)
|
||||
this.updated = new Date(this.updated)
|
||||
}
|
||||
|
30
frontend/src/models/projectView.ts
Normal file
30
frontend/src/models/projectView.ts
Normal file
@ -0,0 +1,30 @@
|
||||
import type {IProjectView, ProjectViewBucketConfigurationMode, ProjectViewKind} from '@/modelTypes/IProjectView'
|
||||
import AbstractModel from '@/models/abstractModel'
|
||||
|
||||
export default class ProjectViewModel extends AbstractModel<IProjectView> implements IProjectView {
|
||||
id = 0
|
||||
title = ''
|
||||
projectId = 0
|
||||
viewKind: ProjectViewKind = 'list'
|
||||
|
||||
filter = ''
|
||||
position = 0
|
||||
|
||||
bucketConfiguration = []
|
||||
bucketConfigurationMode: ProjectViewBucketConfigurationMode = 'manual'
|
||||
defaultBucketId = 0
|
||||
doneBucketId = 0
|
||||
|
||||
created: Date = new Date()
|
||||
updated: Date = new Date()
|
||||
|
||||
constructor(data: Partial<IProjectView>) {
|
||||
super()
|
||||
this.assignData(data)
|
||||
|
||||
|
||||
if (!this.bucketConfiguration) {
|
||||
this.bucketConfiguration = []
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user