From ef5d4ce887c8679c1afeae011862000744ad7b33 Mon Sep 17 00:00:00 2001 From: niaefeup-admin Date: Wed, 18 Sep 2024 20:09:22 +0000 Subject: [PATCH 1/8] Bump app version [no ci] --- packages/uni_app/app_version.txt | 2 +- packages/uni_app/pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/uni_app/app_version.txt b/packages/uni_app/app_version.txt index cb83f6b04..543c2b5b3 100644 --- a/packages/uni_app/app_version.txt +++ b/packages/uni_app/app_version.txt @@ -1 +1 @@ -1.10.0-beta.7+304 +1.10.0-beta.8+306 diff --git a/packages/uni_app/pubspec.yaml b/packages/uni_app/pubspec.yaml index ac2b5c544..1ad2dc965 100644 --- a/packages/uni_app/pubspec.yaml +++ b/packages/uni_app/pubspec.yaml @@ -7,7 +7,7 @@ publish_to: "none" # We do not publish to pub.dev # To change it manually, override the value in app_version.txt. # The app version code is automatically also bumped by CI. # Do not change it manually. -version: 1.10.0-beta.7+304 +version: 1.10.0-beta.8+306 environment: sdk: ">=3.4.0 <4.0.0" From 4538f7c36a23862076e414a2f7e4f28bd350ac73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Lima?= Date: Thu, 19 Sep 2024 00:52:11 +0100 Subject: [PATCH 2/8] fix: forbidden error on calendar fetching --- .../lib/controller/networking/network_router.dart | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/uni_app/lib/controller/networking/network_router.dart b/packages/uni_app/lib/controller/networking/network_router.dart index e78f43b9d..d6a8bf379 100644 --- a/packages/uni_app/lib/controller/networking/network_router.dart +++ b/packages/uni_app/lib/controller/networking/network_router.dart @@ -11,6 +11,10 @@ extension UriString on String { Uri toUri() => Uri.parse(this); } +extension SigarraUriEncoding on Uri { + Uri normalizeQueryComponent() => replace(query: query.replaceAll('+', '%20')); +} + /// Manages the networking of the app. class NetworkRouter { /// The HTTP client used for all requests. @@ -65,6 +69,10 @@ class NetworkRouter { ]; } - return client.get(parsedUrl.replace(queryParameters: allQueryParameters)); + final requestUri = parsedUrl + .replace(queryParameters: allQueryParameters) + .normalizeQueryComponent(); + + return client.get(requestUri); } } From 346dce2bc253a40d4818044e754ef94a2c30402b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Lima?= Date: Thu, 19 Sep 2024 01:07:02 +0100 Subject: [PATCH 3/8] refactor: deduplicate logic --- .../uni_app/lib/app_links/uni_app_links.dart | 9 ++------- .../controller/networking/network_router.dart | 5 +---- packages/uni_app/lib/utils/uri.dart | 16 ++++++++++++++++ 3 files changed, 19 insertions(+), 11 deletions(-) create mode 100644 packages/uni_app/lib/utils/uri.dart diff --git a/packages/uni_app/lib/app_links/uni_app_links.dart b/packages/uni_app/lib/app_links/uni_app_links.dart index e0a7c5a20..c168dcda9 100644 --- a/packages/uni_app/lib/app_links/uni_app_links.dart +++ b/packages/uni_app/lib/app_links/uni_app_links.dart @@ -1,15 +1,10 @@ import 'dart:async'; import 'package:app_links/app_links.dart'; +import 'package:uni/utils/uri.dart'; final _authUri = Uri(scheme: 'pt.up.fe.ni.uni', host: 'auth'); -extension _StripQueryParameters on Uri { - Uri stripQueryParameters() { - return Uri(scheme: scheme, host: host, path: path); - } -} - class UniAppLinks { final login = _AuthenticationAppLink( redirectUri: _authUri.replace(path: '/login'), @@ -30,7 +25,7 @@ class _AuthenticationAppLink { FutureOr Function(Uri redirectUri) callback, ) async { final interceptedUri = _appLinks.uriLinkStream - .firstWhere((uri) => redirectUri == uri.stripQueryParameters()); + .firstWhere((uri) => redirectUri == uri.stripQueryComponent()); await callback(redirectUri); final data = await interceptedUri; diff --git a/packages/uni_app/lib/controller/networking/network_router.dart b/packages/uni_app/lib/controller/networking/network_router.dart index d6a8bf379..7fcff1dcc 100644 --- a/packages/uni_app/lib/controller/networking/network_router.dart +++ b/packages/uni_app/lib/controller/networking/network_router.dart @@ -5,16 +5,13 @@ import 'package:uni/http/client/authenticated.dart'; import 'package:uni/http/client/timeout.dart'; import 'package:uni/session/authentication_controller.dart'; import 'package:uni/session/flows/base/session.dart'; +import 'package:uni/utils/uri.dart'; extension UriString on String { /// Converts a [String] to an [Uri]. Uri toUri() => Uri.parse(this); } -extension SigarraUriEncoding on Uri { - Uri normalizeQueryComponent() => replace(query: query.replaceAll('+', '%20')); -} - /// Manages the networking of the app. class NetworkRouter { /// The HTTP client used for all requests. diff --git a/packages/uni_app/lib/utils/uri.dart b/packages/uni_app/lib/utils/uri.dart new file mode 100644 index 000000000..29cebecb2 --- /dev/null +++ b/packages/uni_app/lib/utils/uri.dart @@ -0,0 +1,16 @@ +extension UriUtils on Uri { + Uri stripQueryComponent() { + return Uri( + scheme: scheme, + userInfo: userInfo, + host: host, + port: port, + path: path, + fragment: fragment, + ); + } + + Uri normalizeQueryComponent() => query.isNotEmpty + ? replace(query: query.replaceAll('+', '%20')) + : stripQueryComponent(); +} From 5515d1dde6d66ef50faa018cce5483de05914889 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Lima?= Date: Thu, 19 Sep 2024 14:58:29 +0100 Subject: [PATCH 4/8] fix: app link not being intercepted --- packages/uni_app/lib/utils/uri.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/uni_app/lib/utils/uri.dart b/packages/uni_app/lib/utils/uri.dart index 29cebecb2..c2f140ba9 100644 --- a/packages/uni_app/lib/utils/uri.dart +++ b/packages/uni_app/lib/utils/uri.dart @@ -6,7 +6,7 @@ extension UriUtils on Uri { host: host, port: port, path: path, - fragment: fragment, + fragment: fragment.isNotEmpty ? fragment : null, ); } From 6d67b6fa2f8461282b4c2e1146df8a7c99849135 Mon Sep 17 00:00:00 2001 From: limwa Date: Fri, 20 Sep 2024 08:40:36 +0000 Subject: [PATCH 5/8] Bump app version [no ci] --- packages/uni_app/app_version.txt | 2 +- packages/uni_app/pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/uni_app/app_version.txt b/packages/uni_app/app_version.txt index 543c2b5b3..7e44e6946 100644 --- a/packages/uni_app/app_version.txt +++ b/packages/uni_app/app_version.txt @@ -1 +1 @@ -1.10.0-beta.8+306 +1.10.0-beta.9+307 diff --git a/packages/uni_app/pubspec.yaml b/packages/uni_app/pubspec.yaml index 1ad2dc965..c9ff63acc 100644 --- a/packages/uni_app/pubspec.yaml +++ b/packages/uni_app/pubspec.yaml @@ -7,7 +7,7 @@ publish_to: "none" # We do not publish to pub.dev # To change it manually, override the value in app_version.txt. # The app version code is automatically also bumped by CI. # Do not change it manually. -version: 1.10.0-beta.8+306 +version: 1.10.0-beta.9+307 environment: sdk: ">=3.4.0 <4.0.0" From 67e8ccec6b086168948b4dad852dc033adca014e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Lima?= Date: Fri, 20 Sep 2024 22:07:45 +0100 Subject: [PATCH 6/8] fix: exams background --- packages/uni_app/lib/view/exams/exams.dart | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/uni_app/lib/view/exams/exams.dart b/packages/uni_app/lib/view/exams/exams.dart index 207b0fa55..40ecde31f 100644 --- a/packages/uni_app/lib/view/exams/exams.dart +++ b/packages/uni_app/lib/view/exams/exams.dart @@ -139,9 +139,7 @@ class ExamsPageViewState extends SecondaryPageViewState { key: Key('$exam-exam'), margin: const EdgeInsets.fromLTRB(12, 4, 12, 0), child: RowContainer( - color: isHidden - ? Theme.of(context).hintColor - : Theme.of(context).scaffoldBackgroundColor, + color: isHidden ? Theme.of(context).hintColor : null, child: ExamRow( exam: exam, teacher: '', From c66f7a73f73747340fce5457718da34539fac27a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Lima?= Date: Fri, 20 Sep 2024 22:08:39 +0100 Subject: [PATCH 7/8] fix: transports background --- .../bus_stop_next_arrivals/bus_stop_next_arrivals.dart | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/uni_app/lib/view/bus_stop_next_arrivals/bus_stop_next_arrivals.dart b/packages/uni_app/lib/view/bus_stop_next_arrivals/bus_stop_next_arrivals.dart index 85705edac..4271c9182 100644 --- a/packages/uni_app/lib/view/bus_stop_next_arrivals/bus_stop_next_arrivals.dart +++ b/packages/uni_app/lib/view/bus_stop_next_arrivals/bus_stop_next_arrivals.dart @@ -132,11 +132,9 @@ class NextArrivalsState extends State { ), ), constraints: const BoxConstraints(maxHeight: 150), - child: Material( - child: TabBar( - isScrollable: true, - tabs: createTabs(queryData), - ), + child: TabBar( + isScrollable: true, + tabs: createTabs(queryData), ), ), Expanded( From 69ff45e2d46e6d21bbeff362dadb61ce50bcafc5 Mon Sep 17 00:00:00 2001 From: limwa Date: Sun, 22 Sep 2024 19:15:03 +0000 Subject: [PATCH 8/8] Bump app version [no ci] --- packages/uni_app/app_version.txt | 2 +- packages/uni_app/pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/uni_app/app_version.txt b/packages/uni_app/app_version.txt index 7e44e6946..db8d561b6 100644 --- a/packages/uni_app/app_version.txt +++ b/packages/uni_app/app_version.txt @@ -1 +1 @@ -1.10.0-beta.9+307 +1.10.0-beta.10+308 diff --git a/packages/uni_app/pubspec.yaml b/packages/uni_app/pubspec.yaml index c9ff63acc..d9f4fa559 100644 --- a/packages/uni_app/pubspec.yaml +++ b/packages/uni_app/pubspec.yaml @@ -7,7 +7,7 @@ publish_to: "none" # We do not publish to pub.dev # To change it manually, override the value in app_version.txt. # The app version code is automatically also bumped by CI. # Do not change it manually. -version: 1.10.0-beta.9+307 +version: 1.10.0-beta.10+308 environment: sdk: ">=3.4.0 <4.0.0"