1
0

Colors for lists and namespaces (#74)

Show colors for namespaces bigger

Show colors for lists and namespaces

Add changing color for lists

Add changing color for namespace

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/74
This commit is contained in:
konrad
2020-03-25 21:27:29 +00:00
parent 51de1fe880
commit cafb960c8d
8 changed files with 84 additions and 6 deletions

View File

@ -6,7 +6,11 @@ export default class ListModel extends AbstractModel {
constructor(data) {
super(data)
if (this.hex_color !== '' && this.hex_color.substring(0, 1) !== '#') {
this.hex_color = '#' + this.hex_color
}
// Make all tasks to task models
this.tasks = this.tasks.map(t => {
return new TaskModel(t)
@ -28,6 +32,7 @@ export default class ListModel extends AbstractModel {
tasks: [],
namespaceID: 0,
is_archived: false,
hex_color: '',
created: null,
updated: null,

View File

@ -6,6 +6,10 @@ export default class NamespaceModel extends AbstractModel {
constructor(data) {
super(data)
if (this.hex_color !== '' && this.hex_color.substring(0, 1) !== '#') {
this.hex_color = '#' + this.hex_color
}
this.lists = this.lists.map(l => {
return new ListModel(l)
})
@ -24,6 +28,7 @@ export default class NamespaceModel extends AbstractModel {
owner: UserModel,
lists: [],
is_archived: false,
hex_color: '',
created: null,
updated: null,