Fixed some bugs and added more locales
All checks were successful
ci/woodpecker/pr/flutterBuild Pipeline was successful

This commit is contained in:
Balazs Toldi 2022-05-22 22:02:06 +02:00
parent 48f97d73a4
commit aed1d96a21
Signed by: Bazsalanszky
GPG key ID: 6C7D440036F99D58
5 changed files with 22 additions and 9 deletions

View file

@ -69,6 +69,11 @@
"description": "No issues found for the current repo",
"context": "Repo issue page"
},
"nopr": "No pull requests found",
"@nopr": {
"description": "No Pull requests found for the current repo",
"context": "Repo issue page"
},
"login": "Login",
"@login": {
"description": "Login page title",

View file

@ -13,6 +13,7 @@
"noreadme": "Nem található README file!",
"nofiles": "Nem található fájl ebben a könyvtárban",
"noissues": "Nincsenek hibajegyek",
"nopr": "Nincsenek egyesítési kérések",
"login": "Bejelentkezés",
"otherInstance": "Egy másik példány",
"instanceUrl": "Példány címe",

View file

@ -13,7 +13,7 @@ class PullRequest {
List<Labels>? labels;
Milestone? milestone;
User? assignee;
User? assignees;
List<User>? assignees;
String state;
bool isLocked;
int comments;
@ -90,8 +90,13 @@ class PullRequest {
milestone = json['milestone'] != null
? Milestone.fromJson(json['milestone'])
: null;
assignee = json['assignee'];
assignees = json['assignees'];
assignee = (json['assignee'] != null) ? User.fromJson(json['assignee']) : null;
if (json['assignees'] != null) {
assignees = <User>[];
json['assignees'].forEach((v) {
assignees!.add( User.fromJson(v));
});
}
mergeable = json['mergeable'];
mergedAt = json['merged_at'];
mergeCommitSha = json['merge_commit_sha'];

View file

@ -64,6 +64,7 @@ class GiteaService {
Uri.https(apiAccess.instance, "api/v1/repos/$owner/$repo/issues", {
"token": apiAccess.token,
"state": state,
"type": "issues",
"page" : page.toString(),
"limit" : limit.toString(),
}),

View file

@ -504,6 +504,7 @@ class _RepoPullRequests extends State<RepoPullRequests> {
@override
Widget build(BuildContext context) {
final media = MediaQuery.of(context).size;
final l10n = L10n.of(context)!;
return DefaultTabController(
length: 2,
child: DefaultTabController(
@ -517,8 +518,8 @@ class _RepoPullRequests extends State<RepoPullRequests> {
child: Column(
children: <Widget>[
Expanded(child: Container()),
const TabBar(
tabs: [Text("Open"), Text("Closed")],
TabBar(
tabs: [Text(l10n.open), Text(l10n.closed)],
),
],
),
@ -546,8 +547,8 @@ class _RepoPullRequests extends State<RepoPullRequests> {
return Center(child: Text('failed to fetch $error_message'));
case PullRequestStatus.success:
if (state.pulls.isEmpty) {
return const Center(
child: Text('No issues found'));
return Center(
child: Text(l10n.nopr));
}
return ListView.builder(
@ -589,8 +590,8 @@ class _RepoPullRequests extends State<RepoPullRequests> {
return Center(child: Text('failed to fetch $error_message'));
case PullRequestStatus.success:
if (state.pulls.isEmpty) {
return const Center(
child: Text('No issues found'));
return Center(
child: Text(l10n.nopr));
}
return ListView.builder(