Rename namespace name and task text to title
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
46fc580b7b
commit
68d3ffd30d
|
@ -41,7 +41,7 @@ class TaskTileState extends State<TaskTile> {
|
||||||
strokeWidth: 2.0,
|
strokeWidth: 2.0,
|
||||||
)),
|
)),
|
||||||
),
|
),
|
||||||
title: Text(_currentTask.text),
|
title: Text(_currentTask.title),
|
||||||
subtitle:
|
subtitle:
|
||||||
_currentTask.description == null || _currentTask.description.isEmpty
|
_currentTask.description == null || _currentTask.description.isEmpty
|
||||||
? null
|
? null
|
||||||
|
@ -54,7 +54,7 @@ class TaskTileState extends State<TaskTile> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return CheckboxListTile(
|
return CheckboxListTile(
|
||||||
title: Text(_currentTask.text),
|
title: Text(_currentTask.title),
|
||||||
controlAffinity: ListTileControlAffinity.leading,
|
controlAffinity: ListTileControlAffinity.leading,
|
||||||
value: _currentTask.done ?? false,
|
value: _currentTask.done ?? false,
|
||||||
subtitle:
|
subtitle:
|
||||||
|
@ -83,7 +83,7 @@ class TaskTileState extends State<TaskTile> {
|
||||||
return VikunjaGlobal.of(context).taskService.update(Task(
|
return VikunjaGlobal.of(context).taskService.update(Task(
|
||||||
id: task.id,
|
id: task.id,
|
||||||
done: checked,
|
done: checked,
|
||||||
text: task.text,
|
title: task.title,
|
||||||
description: task.description,
|
description: task.description,
|
||||||
owner: null,
|
owner: null,
|
||||||
));
|
));
|
||||||
|
|
|
@ -4,19 +4,19 @@ import 'package:meta/meta.dart';
|
||||||
class Namespace {
|
class Namespace {
|
||||||
final int id;
|
final int id;
|
||||||
final DateTime created, updated;
|
final DateTime created, updated;
|
||||||
final String name, description;
|
final String title, description;
|
||||||
final User owner;
|
final User owner;
|
||||||
|
|
||||||
Namespace(
|
Namespace(
|
||||||
{@required this.id,
|
{@required this.id,
|
||||||
this.created,
|
this.created,
|
||||||
this.updated,
|
this.updated,
|
||||||
@required this.name,
|
@required this.title,
|
||||||
this.description,
|
this.description,
|
||||||
this.owner});
|
this.owner});
|
||||||
|
|
||||||
Namespace.fromJson(Map<String, dynamic> json)
|
Namespace.fromJson(Map<String, dynamic> json)
|
||||||
: name = json['name'],
|
: title = json['title'],
|
||||||
description = json['description'],
|
description = json['description'],
|
||||||
id = json['id'],
|
id = json['id'],
|
||||||
created = DateTime.parse(json['created']),
|
created = DateTime.parse(json['created']),
|
||||||
|
@ -26,7 +26,7 @@ class Namespace {
|
||||||
toJSON() => {
|
toJSON() => {
|
||||||
"created": created?.toIso8601String(),
|
"created": created?.toIso8601String(),
|
||||||
"updated": updated?.toIso8601String(),
|
"updated": updated?.toIso8601String(),
|
||||||
"name": name,
|
"title": title,
|
||||||
"owner": owner?.toJSON(),
|
"owner": owner?.toJSON(),
|
||||||
"description": description
|
"description": description
|
||||||
};
|
};
|
||||||
|
|
|
@ -5,7 +5,7 @@ class Task {
|
||||||
final int id;
|
final int id;
|
||||||
final DateTime created, updated, due;
|
final DateTime created, updated, due;
|
||||||
final List<DateTime> reminders;
|
final List<DateTime> reminders;
|
||||||
final String text, description;
|
final String title, description;
|
||||||
final bool done;
|
final bool done;
|
||||||
final User owner;
|
final User owner;
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ class Task {
|
||||||
this.updated,
|
this.updated,
|
||||||
this.reminders,
|
this.reminders,
|
||||||
this.due,
|
this.due,
|
||||||
@required this.text,
|
@required this.title,
|
||||||
this.description,
|
this.description,
|
||||||
@required this.done,
|
@required this.done,
|
||||||
@required this.owner});
|
@required this.owner});
|
||||||
|
@ -29,7 +29,7 @@ class Task {
|
||||||
?.toList(),
|
?.toList(),
|
||||||
due = DateTime.parse(json['dueDate']),
|
due = DateTime.parse(json['dueDate']),
|
||||||
description = json['description'],
|
description = json['description'],
|
||||||
text = json['text'],
|
title = json['title'],
|
||||||
done = json['done'],
|
done = json['done'],
|
||||||
owner = User.fromJson(json['createdBy']);
|
owner = User.fromJson(json['createdBy']);
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ class Task {
|
||||||
reminders?.map((date) => date.toIso8601String())?.toList(),
|
reminders?.map((date) => date.toIso8601String())?.toList(),
|
||||||
'dueDate': due?.toIso8601String(),
|
'dueDate': due?.toIso8601String(),
|
||||||
'description': description,
|
'description': description,
|
||||||
'text': text,
|
'title': title,
|
||||||
'done': done ?? false,
|
'done': done ?? false,
|
||||||
'createdBy': owner?.toJSON()
|
'createdBy': owner?.toJSON()
|
||||||
};
|
};
|
||||||
|
|
|
@ -37,7 +37,7 @@ class HomePageState extends State<HomePage> with AfterLayoutMixin<HomePage> {
|
||||||
.asMap()
|
.asMap()
|
||||||
.forEach((i, namespace) => namespacesList.add(new ListTile(
|
.forEach((i, namespace) => namespacesList.add(new ListTile(
|
||||||
leading: const Icon(Icons.folder),
|
leading: const Icon(Icons.folder),
|
||||||
title: new Text(namespace.name),
|
title: new Text(namespace.title),
|
||||||
selected: i == _selectedDrawerIndex,
|
selected: i == _selectedDrawerIndex,
|
||||||
onTap: () => _onSelectItem(i),
|
onTap: () => _onSelectItem(i),
|
||||||
)));
|
)));
|
||||||
|
@ -72,7 +72,7 @@ class HomePageState extends State<HomePage> with AfterLayoutMixin<HomePage> {
|
||||||
|
|
||||||
return new Scaffold(
|
return new Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: new Text(_currentNamespace?.name ?? 'Vikunja'),
|
title: new Text(_currentNamespace?.title ?? 'Vikunja'),
|
||||||
actions: _currentNamespace == null
|
actions: _currentNamespace == null
|
||||||
? null
|
? null
|
||||||
: <Widget>[
|
: <Widget>[
|
||||||
|
@ -156,7 +156,7 @@ class HomePageState extends State<HomePage> with AfterLayoutMixin<HomePage> {
|
||||||
_addNamespace(String name, BuildContext context) {
|
_addNamespace(String name, BuildContext context) {
|
||||||
VikunjaGlobal.of(context)
|
VikunjaGlobal.of(context)
|
||||||
.namespaceService
|
.namespaceService
|
||||||
.create(Namespace(id: null, name: name))
|
.create(Namespace(id: null, title: name))
|
||||||
.then((_) {
|
.then((_) {
|
||||||
_loadNamespaces();
|
_loadNamespaces();
|
||||||
Scaffold.of(context).showSnackBar(SnackBar(
|
Scaffold.of(context).showSnackBar(SnackBar(
|
||||||
|
|
|
@ -111,7 +111,7 @@ class _ListPageState extends State<ListPage> {
|
||||||
_addItem(String name, BuildContext context) {
|
_addItem(String name, BuildContext context) {
|
||||||
var globalState = VikunjaGlobal.of(context);
|
var globalState = VikunjaGlobal.of(context);
|
||||||
var newTask =
|
var newTask =
|
||||||
Task(id: null, text: name, owner: globalState.currentUser, done: false);
|
Task(id: null, title: name, owner: globalState.currentUser, done: false);
|
||||||
setState(() => _loadingTasks.add(newTask));
|
setState(() => _loadingTasks.add(newTask));
|
||||||
globalState.taskService.add(_list.id, newTask).then((task) {
|
globalState.taskService.add(_list.id, newTask).then((task) {
|
||||||
setState(() {
|
setState(() {
|
||||||
|
|
|
@ -36,7 +36,7 @@ class _NamespaceEditPageState extends State<NamespaceEditPage> {
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
maxLines: null,
|
maxLines: null,
|
||||||
keyboardType: TextInputType.multiline,
|
keyboardType: TextInputType.multiline,
|
||||||
initialValue: widget.namespace.name,
|
initialValue: widget.namespace.title,
|
||||||
onSaved: (name) => _name = name,
|
onSaved: (name) => _name = name,
|
||||||
validator: (name) {
|
validator: (name) {
|
||||||
if (name.length < 3 || name.length > 250) {
|
if (name.length < 3 || name.length > 250) {
|
||||||
|
@ -98,7 +98,7 @@ class _NamespaceEditPageState extends State<NamespaceEditPage> {
|
||||||
// aka updating the existing namespace we got from context (setters?)
|
// aka updating the existing namespace we got from context (setters?)
|
||||||
Namespace updatedNamespace = Namespace(
|
Namespace updatedNamespace = Namespace(
|
||||||
id: widget.namespace.id,
|
id: widget.namespace.id,
|
||||||
name: _name,
|
title: _name,
|
||||||
description: _description,
|
description: _description,
|
||||||
owner: widget.namespace.owner);
|
owner: widget.namespace.owner);
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ var _users = {1: User(1, 'test@testuser.org', 'test1')};
|
||||||
var _namespaces = {
|
var _namespaces = {
|
||||||
1: Namespace(
|
1: Namespace(
|
||||||
id: 1,
|
id: 1,
|
||||||
name: 'Test 1',
|
title: 'Test 1',
|
||||||
created: DateTime.now(),
|
created: DateTime.now(),
|
||||||
updated: DateTime.now(),
|
updated: DateTime.now(),
|
||||||
description: 'A namespace for testing purposes',
|
description: 'A namespace for testing purposes',
|
||||||
|
@ -38,7 +38,7 @@ var _lists = {
|
||||||
var _tasks = {
|
var _tasks = {
|
||||||
1: Task(
|
1: Task(
|
||||||
id: 1,
|
id: 1,
|
||||||
text: 'Task 1',
|
title: 'Task 1',
|
||||||
owner: _users[1],
|
owner: _users[1],
|
||||||
updated: DateTime.now(),
|
updated: DateTime.now(),
|
||||||
created: DateTime.now(),
|
created: DateTime.now(),
|
||||||
|
|
Reference in New Issue