Re-implemented getting tasks with the new seperate endpoint #39
|
@ -70,7 +70,7 @@ steps:
|
||||||
image: plugins/s3:1
|
image: plugins/s3:1
|
||||||
pull: true
|
pull: true
|
||||||
settings:
|
settings:
|
||||||
bucket: vikunja-app
|
bucket: vikunja
|
||||||
access_key:
|
access_key:
|
||||||
from_secret: aws_access_key_id
|
from_secret: aws_access_key_id
|
||||||
secret_key:
|
secret_key:
|
||||||
|
@ -79,7 +79,7 @@ steps:
|
||||||
path_style: true
|
path_style: true
|
||||||
strip_prefix: apks/
|
strip_prefix: apks/
|
||||||
source: apks/*
|
source: apks/*
|
||||||
target: /master
|
target: /app/master
|
||||||
|
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
|
@ -114,7 +114,7 @@ steps:
|
||||||
image: plugins/s3:1
|
image: plugins/s3:1
|
||||||
pull: true
|
pull: true
|
||||||
settings:
|
settings:
|
||||||
bucket: vikunja-app
|
bucket: vikunja
|
||||||
access_key:
|
access_key:
|
||||||
from_secret: aws_access_key_id
|
from_secret: aws_access_key_id
|
||||||
secret_key:
|
secret_key:
|
||||||
|
@ -123,4 +123,4 @@ steps:
|
||||||
path_style: true
|
path_style: true
|
||||||
strip_prefix: apks/
|
strip_prefix: apks/
|
||||||
source: apks/*
|
source: apks/*
|
||||||
target: /${DRONE_TAG##v}
|
target: /app/${DRONE_TAG##v}
|
||||||
|
|
|
@ -120,9 +120,9 @@ class VikunjaGlobalState extends State<VikunjaGlobal> {
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
loadedCurrentUser = User(int.tryParse(currentUser), "", "", "");
|
loadedCurrentUser = User(int.tryParse(currentUser), "", "");
|
||||||
} catch (otherExceptions) {
|
} catch (otherExceptions) {
|
||||||
loadedCurrentUser = User(int.tryParse(currentUser), "", "", "");
|
loadedCurrentUser = User(int.tryParse(currentUser), "", "");
|
||||||
}
|
}
|
||||||
setState(() {
|
setState(() {
|
||||||
_client = client;
|
_client = client;
|
||||||
|
|
|
@ -20,8 +20,8 @@ class TaskList {
|
||||||
owner = User.fromJson(json['owner']),
|
owner = User.fromJson(json['owner']),
|
||||||
description = json['description'],
|
description = json['description'],
|
||||||
title = json['title'],
|
title = json['title'],
|
||||||
updated = DateTime.fromMillisecondsSinceEpoch(json['updated']),
|
updated = DateTime.parse(json['updated']),
|
||||||
created = DateTime.fromMillisecondsSinceEpoch(json['created']);
|
created = DateTime.parse(json['created']);
|
||||||
|
|
||||||
toJSON() {
|
toJSON() {
|
||||||
return {
|
return {
|
||||||
|
@ -29,8 +29,8 @@ class TaskList {
|
||||||
"title": this.title,
|
"title": this.title,
|
||||||
"description": this.description,
|
"description": this.description,
|
||||||
"owner": this.owner?.toJSON(),
|
"owner": this.owner?.toJSON(),
|
||||||
"created": this.created?.millisecondsSinceEpoch,
|
"created": this.created?.toIso8601String(),
|
||||||
"updated": this.updated?.millisecondsSinceEpoch,
|
"updated": this.updated?.toIso8601String(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,13 +19,13 @@ class Namespace {
|
||||||
: name = json['name'],
|
: name = json['name'],
|
||||||
description = json['description'],
|
description = json['description'],
|
||||||
id = json['id'],
|
id = json['id'],
|
||||||
created = DateTime.fromMillisecondsSinceEpoch(json['created']),
|
created = DateTime.parse(json['created']),
|
||||||
updated = DateTime.fromMillisecondsSinceEpoch(json['updated']),
|
updated = DateTime.parse(json['updated']),
|
||||||
owner = User.fromJson(json['owner']);
|
owner = User.fromJson(json['owner']);
|
||||||
|
|
||||||
toJSON() => {
|
toJSON() => {
|
||||||
"created": created?.millisecondsSinceEpoch,
|
"created": created?.toIso8601String(),
|
||||||
"updated": updated?.millisecondsSinceEpoch,
|
"updated": updated?.toIso8601String(),
|
||||||
"name": name,
|
"name": name,
|
||||||
"owner": owner?.toJSON(),
|
"owner": owner?.toJSON(),
|
||||||
"description": description
|
"description": description
|
||||||
|
|
|
@ -22,12 +22,12 @@ class Task {
|
||||||
|
|
||||||
Task.fromJson(Map<String, dynamic> json)
|
Task.fromJson(Map<String, dynamic> json)
|
||||||
: id = json['id'],
|
: id = json['id'],
|
||||||
updated = DateTime.fromMillisecondsSinceEpoch(json['updated']),
|
updated = DateTime.parse(json['updated']),
|
||||||
created = DateTime.fromMillisecondsSinceEpoch(json['created']),
|
created = DateTime.parse(json['created']),
|
||||||
reminders = (json['reminderDates'] as List<dynamic>)
|
reminders = (json['reminderDates'] as List<dynamic>)
|
||||||
?.map((milli) => DateTime.fromMillisecondsSinceEpoch(milli))
|
?.map((r) => DateTime.parse(r))
|
||||||
?.toList(),
|
?.toList(),
|
||||||
due = DateTime.fromMillisecondsSinceEpoch(json['dueDate']),
|
due = DateTime.parse(json['dueDate']),
|
||||||
description = json['description'],
|
description = json['description'],
|
||||||
text = json['text'],
|
text = json['text'],
|
||||||
done = json['done'],
|
done = json['done'],
|
||||||
|
@ -38,11 +38,11 @@ class Task {
|
||||||
|
|
||||||
toJSON() => {
|
toJSON() => {
|
||||||
'id': id,
|
'id': id,
|
||||||
'updated': updated?.millisecondsSinceEpoch,
|
'updated': updated?.toIso8601String(),
|
||||||
'created': created?.millisecondsSinceEpoch,
|
'created': created?.toIso8601String(),
|
||||||
'reminderDates':
|
'reminderDates':
|
||||||
reminders?.map((date) => date.millisecondsSinceEpoch)?.toList(),
|
reminders?.map((date) => date.toIso8601String())?.toList(),
|
||||||
'dueDate': due?.millisecondsSinceEpoch,
|
'dueDate': due?.toIso8601String(),
|
||||||
'description': description,
|
'description': description,
|
||||||
'text': text,
|
'text': text,
|
||||||
'done': done ?? false,
|
'done': done ?? false,
|
||||||
|
|
|
@ -1,18 +1,20 @@
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:vikunja_app/global.dart';
|
||||||
|
|
||||||
class User {
|
class User {
|
||||||
final int id;
|
final int id;
|
||||||
final String email, username, avatarHash;
|
final String email, username;
|
||||||
|
|
||||||
User(this.id, this.email, this.username, this.avatarHash);
|
User(this.id, this.email, this.username);
|
||||||
User.fromJson(Map<String, dynamic> json)
|
User.fromJson(Map<String, dynamic> json)
|
||||||
: id = json['id'],
|
: id = json['id'],
|
||||||
email = json.containsKey('email') ? json['email'] : '',
|
email = json.containsKey('email') ? json['email'] : '',
|
||||||
username = json['username'],
|
username = json['username'];
|
||||||
avatarHash = json['avatarUrl'];
|
|
||||||
|
|
||||||
toJSON() => {"id": this.id, "email": this.email, "username": this.username};
|
toJSON() => {"id": this.id, "email": this.email, "username": this.username};
|
||||||
|
|
||||||
String avatarUrl() {
|
String avatarUrl(BuildContext context) {
|
||||||
return "https://secure.gravatar.com/avatar/" + this.avatarHash;
|
return VikunjaGlobal.of(context).client.base + "/" + this.username + "/avatar";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -101,7 +101,7 @@ class HomePageState extends State<HomePage> with AfterLayoutMixin<HomePage> {
|
||||||
currentAccountPicture: currentUser == null
|
currentAccountPicture: currentUser == null
|
||||||
? null
|
? null
|
||||||
: CircleAvatar(
|
: CircleAvatar(
|
||||||
backgroundImage: NetworkImage(currentUser.avatarUrl()),
|
backgroundImage: NetworkImage(currentUser.avatarUrl(context)),
|
||||||
),
|
),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
image: DecorationImage(
|
image: DecorationImage(
|
||||||
|
|
|
@ -7,7 +7,7 @@ import 'package:vikunja_app/models/user.dart';
|
||||||
import 'package:vikunja_app/service/services.dart';
|
import 'package:vikunja_app/service/services.dart';
|
||||||
|
|
||||||
// Data for mocked services
|
// Data for mocked services
|
||||||
var _users = {1: User(1, 'test@testuser.org', 'test1', '')};
|
var _users = {1: User(1, 'test@testuser.org', 'test1')};
|
||||||
|
|
||||||
var _namespaces = {
|
var _namespaces = {
|
||||||
1: Namespace(
|
1: Namespace(
|
||||||
|
|
Reference in New Issue
Block a user