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

@ -28,6 +28,12 @@ export default class ListService extends AbstractService {
model.tasks = model.tasks.map(task => {
return taskService.beforeUpdate(task)
})
model.hex_color = model.hex_color.substring(1, 7)
return model
}
beforeCreate(list) {
list.hex_color = list.hex_color.substring(1, 7)
return list
}
}

View File

@ -22,4 +22,14 @@ export default class NamespaceService extends AbstractService {
modelFactory(data) {
return new NamespaceModel(data)
}
beforeUpdate(namespace) {
namespace.hex_color = namespace.hex_color.substring(1, 7)
return namespace
}
beforeCreate(namespace) {
namespace.hex_color = namespace.hex_color.substring(1, 7)
return namespace
}
}