konrad
4b3f92ae34
All checks were successful
continuous-integration/drone/push Build is passing
Make backgrounds list responsive Show initial collection of backgrounds Remove test data Fix "backgroundInformation is null" when navigating Fix kanban height Remove debug log Move list title to top header Add styling for title in top header Set the current list (and background) when loading settings Only load the background if it changed Make task detail view look good again Fix bottom spacing Make list and table view look good again Make pages with background at least 100vh Fix kanban height Make extra buttons look good again Move list title and view-switcher in one row Add styling for backgrounds Set background globally Add getting list background and putting it in vuex Add setting list background Move list background setting to seperate list Add search timeout to not search on every keypress Add getting thumbnails through api Add basic search for unsplash backgrounds Co-authored-by: kolaente <k@knt.li> Reviewed-on: #144
43 lines
860 B
JavaScript
43 lines
860 B
JavaScript
import AbstractModel from './abstractModel'
|
|
import TaskModel from './task'
|
|
import UserModel from './user'
|
|
|
|
export default class ListModel extends AbstractModel {
|
|
|
|
constructor(data) {
|
|
super(data)
|
|
|
|
if (this.hexColor !== '' && this.hexColor.substring(0, 1) !== '#') {
|
|
this.hexColor = '#' + this.hexColor
|
|
}
|
|
|
|
// Make all tasks to task models
|
|
this.tasks = this.tasks.map(t => {
|
|
return new TaskModel(t)
|
|
})
|
|
|
|
this.owner = new UserModel(this.owner)
|
|
|
|
this.created = new Date(this.created)
|
|
this.updated = new Date(this.updated)
|
|
}
|
|
|
|
// Default attributes that define the "empty" state.
|
|
defaults() {
|
|
return {
|
|
id: 0,
|
|
title: '',
|
|
description: '',
|
|
owner: UserModel,
|
|
tasks: [],
|
|
namespaceId: 0,
|
|
isArchived: false,
|
|
hexColor: '',
|
|
identifier: '',
|
|
backgroundInformation: null,
|
|
|
|
created: null,
|
|
updated: null,
|
|
}
|
|
}
|
|
} |