Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump logger from 1.4.0 to 2.0.1 in /uni #893

Closed
wants to merge 78 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
6478dde
Restaurant card on the widgets menu
DGoiana Mar 1, 2023
e2261e3
Merge branch 'develop' into fix/restaurant-card-visibility
DGoiana Mar 1, 2023
72f1fd0
Merge branch 'refactor/state-providers' into fix/restaurant-card-visi…
DGoiana Mar 3, 2023
e0df756
Restaurants data connected to the home card
DGoiana Mar 3, 2023
88e3800
Merge branch 'develop' into fix/restaurant-card-visibility
DGoiana Mar 6, 2023
a407001
Merge branch 'develop' into fix/restaurant-card-visibility
DGoiana Mar 16, 2023
d179dce
Favorite restaurants feature
DGoiana Mar 16, 2023
6d83bc7
Lint fixing
DGoiana Mar 16, 2023
f9c2cfa
Minor redesign
DGoiana Mar 16, 2023
ed476fe
Merge branch 'develop' into fix/restaurant-card-visibility
DGoiana Mar 16, 2023
2c396e9
Bug fixing
DGoiana Mar 16, 2023
ebdacb8
Merge branch 'develop' into fix/restaurant-card-visibility
DGoiana Mar 18, 2023
24227fe
Implementation of card action
DGoiana Mar 21, 2023
439e177
Merge branch 'develop' into fix/restaurant-card-visibility
DGoiana Mar 21, 2023
d32009b
Cleaning codespace
DGoiana Mar 21, 2023
8faa31d
Minor fixings
DGoiana Mar 23, 2023
9b30a28
Lint fixing
DGoiana Mar 23, 2023
2c746ca
Name changes
DGoiana May 2, 2023
36ca905
Restaurant card redesign
DGoiana Jul 14, 2023
c2d1c1f
Restaurants titles redesign
DGoiana Jul 15, 2023
003666b
Card redesign
DGoiana Jul 20, 2023
f271385
Lazy providers merge
DGoiana Jul 20, 2023
cb08d22
Merge branch 'develop' into fix/restaurant-card-visibility
DGoiana Jul 20, 2023
bf6ce4d
Merge branch 'develop' into fix/restaurant-card-visibility
DGoiana Jul 20, 2023
98f2169
Weekday and restart bug fix
DGoiana Jul 24, 2023
03b3d33
Conflicts solving
DGoiana Jul 24, 2023
59abeb9
Format fix
DGoiana Jul 24, 2023
b1f2725
Merge branch 'develop' into fix/restaurant-card-visibility
Sirze01 Jul 24, 2023
afd66c3
Merge branch 'develop' into fix/restaurant-card-visibility
Sirze01 Jul 27, 2023
c8bd612
Refactor helper functions in calendar
thePeras Jul 28, 2023
d873b75
Refactor helper functions in calendar
thePeras Jul 28, 2023
dc33944
Make build run on dev and master pushes
bdmendes Aug 1, 2023
1066db9
Add code cov to test step
bdmendes Aug 1, 2023
5e3295d
Add ignore yaml
bdmendes Aug 1, 2023
27cd1bb
Add coverage badge
bdmendes Aug 1, 2023
8f659ff
Setup PR coverage comments
bdmendes Aug 1, 2023
d49b169
Make build run on dev and master pushes (#897)
LuisDuarte1 Aug 10, 2023
12eecac
Bump app version [no ci]
LuisDuarte1 Aug 10, 2023
88ea2e5
Merge branch 'develop' into ci/codecov
bdmendes Aug 10, 2023
919518b
Add code cov to test step (#898)
LuisDuarte1 Aug 10, 2023
bea33b7
Bump app version [no ci]
LuisDuarte1 Aug 10, 2023
8a0a19c
Removing useless methods and completers
DGoiana Aug 11, 2023
5a1071c
Conflicts solving
DGoiana Aug 11, 2023
77631b1
Update sentry version.
LuisDuarte1 Aug 14, 2023
805af28
Update sentry version (#915)
bdmendes Aug 18, 2023
712ff54
Bump app version [no ci]
bdmendes Aug 18, 2023
632c61e
Remove splash screen
bdmendes Aug 19, 2023
3749251
Tweak eager providers initialization logic
bdmendes Aug 19, 2023
d88a7bb
Move terms check to page transition
bdmendes Aug 19, 2023
b051cf9
Remove profile image provider
bdmendes Aug 19, 2023
766fb6b
Refactor/remove splash (#919)
thePeras Aug 20, 2023
8dc036b
Bump app version [no ci]
thePeras Aug 20, 2023
9295cdf
Fixed hover error
DGoiana Aug 20, 2023
1f673bd
Merge branch 'develop' into fix/hover-error-restaurants-page
DGoiana Aug 20, 2023
913d188
Tab hover artifact restaurants page (#923)
LuisDuarte1 Aug 21, 2023
39f86c2
Bump app version [no ci]
LuisDuarte1 Aug 21, 2023
af9d64f
Fix theme issues on login page
bdmendes Aug 19, 2023
192deef
Fix theme issues on login page (#922)
bdmendes Aug 22, 2023
8518f37
Bump app version [no ci]
bdmendes Aug 22, 2023
8c1a759
Relax codecov config
bdmendes Aug 19, 2023
14a7eb6
Hide "Impressão" link from "Outros links" card.
Process-ing Aug 17, 2023
7dc87c8
Add "Consultas SASUP" link to "Outros links" card.
Process-ing Aug 17, 2023
9acbe3f
Add 'Consultas SASUP' to Useful links and hide prints link under "Úte…
Process-ing Aug 22, 2023
b03270d
Bump app version [no ci]
Process-ing Aug 22, 2023
d30ffb8
Merge branch 'refactor/calendar-helper-functions' of github.com:NIAEF…
thePeras Aug 22, 2023
ba72588
Merge branch 'develop' into refactor/calendar-helper-functions
thePeras Aug 22, 2023
40311a2
Merge branch 'develop' into ci/relax-codecov-check
thePeras Aug 22, 2023
d4a5be7
Relax codecov config (#921)
LuisDuarte1 Aug 24, 2023
3943c02
Bump app version [no ci]
LuisDuarte1 Aug 24, 2023
d7769fb
Restaurant widget moved to the bottom
DGoiana Aug 25, 2023
2a120a4
Merge branch 'develop' into fix/restaurant-card-visibility
DGoiana Aug 25, 2023
6a0cf07
Restaurant card on the widgets menu (#738)
bdmendes Aug 25, 2023
db339bf
Bump app version [no ci]
bdmendes Aug 25, 2023
fe7c7de
Gitignore Podfile generated by CocoaPods
thePeras Aug 25, 2023
078d9e3
Merge branch 'develop' into refactor/calendar-helper-functions
thePeras Aug 25, 2023
026038c
Refactor helper functions in calendar (#880)
LuisDuarte1 Aug 26, 2023
543a363
Bump app version [no ci]
LuisDuarte1 Aug 26, 2023
3a20f43
Bump logger from 1.4.0 to 2.0.1 in /uni
dependabot[bot] Aug 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/app_version_integrity.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ on: pull_request

jobs:
app_version_integrity:
name: "Check for app version change"
name: "Version integrity"
runs-on: ubuntu-latest
env:
APP_VERSION_PATH: "uni/app_version.txt"
Expand Down
24 changes: 17 additions & 7 deletions .github/workflows/format_lint_test.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
on: pull_request
on:
pull_request:
push:
branches: [master, develop]

env:
FLUTTER_VERSION: 3.7.2
JAVA_VERSION: 11.x

jobs:
format:
name: 'Format'
name: "Format"
runs-on: ubuntu-latest
defaults:
run:
Expand All @@ -20,7 +23,7 @@ jobs:
- run: dart format $(find . -type f -name "*.dart" -a -not -name "*.g.dart") --set-exit-if-changed

lint:
name: 'Lint'
name: "Lint"
runs-on: ubuntu-latest
needs: format
defaults:
Expand All @@ -31,7 +34,7 @@ jobs:
- uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'zulu'
distribution: "zulu"
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
Expand All @@ -46,7 +49,7 @@ jobs:
- run: flutter analyze .

test:
name: 'Test'
name: "Test"
runs-on: ubuntu-latest
needs: lint
defaults:
Expand All @@ -57,9 +60,16 @@ jobs:
- uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'zulu'
distribution: "zulu"
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}

- run: flutter test --no-sound-null-safety
- name: Test with coverage
run: flutter test --coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
<br>
<br>

[![Build badge](https://img.shields.io/github/actions/workflow/status/NIAEFEUP/uni/format_lint_test.yaml?style=for-the-badge)](https://github.com/NIAEFEUP/uni/actions)
[![Deploy badge](https://img.shields.io/github/actions/workflow/status/NIAEFEUP/uni/deploy.yaml?label=Deploy&style=for-the-badge)](https://github.com/NIAEFEUP/uni/actions)
[![Build badge](https://img.shields.io/github/actions/workflow/status/NIAEFEUP/uni/format_lint_test.yaml?style=for-the-badge&branch=develop)](https://github.com/NIAEFEUP/uni/actions)
[![Deploy badge](https://img.shields.io/github/actions/workflow/status/NIAEFEUP/uni/deploy.yaml?label=Deploy&style=for-the-badge&branch=develop)](https://github.com/NIAEFEUP/uni/actions)
[![Codecov branch](https://img.shields.io/codecov/c/github/NIAEFEUP/uni/develop?style=for-the-badge)](https://app.codecov.io/gh/NIAEFEUP/uni/)

[![style: very good analysis](https://img.shields.io/badge/style-very_good_analysis-B22C89.svg?style=for-the-badge)](https://pub.dev/packages/very_good_analysis)
[![License badge](https://img.shields.io/github/license/NIAEFEUP/uni?style=for-the-badge)](https://github.com/NIAEFEUP/uni/blob/develop/LICENSE)
Expand Down
37 changes: 37 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# see https://docs.codecov.io/docs/codecov-yaml
# Validation check:
# $ curl --data-binary @codecov.yml https://codecov.io/validate

ignore:
- "**/*.g.dart"
- "!**/lib/**" # ignore all files outside of lib

codecov:
require_ci_to_pass: yes
notify:
wait_for_ci: yes

coverage:
precision: 0 # 2 = xx.xx%, 0 = xx%
round: up # how coverage is rounded: down/up/nearest
range: 40...100 # custom range of coverage colors from red -> yellow -> green
status:
project:
default:
informational: true
target: 70% # specify the target coverage for each commit status
threshold: 10% # allow this decrease on project
if_ci_failed: error
patch:
default:
informational: true
threshold: 50% # allow this decrease on patch
changes: false

github_checks:
annotations: false

comment:
layout: header, diff
require_changes: false
behavior: default
2 changes: 2 additions & 0 deletions uni/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,14 @@ unlinked_spec.ds
**/ios/Flutter/flutter_export_environment.sh
**/ios/ServiceDefinitions.json
**/ios/Runner/GeneratedPluginRegistrant.*
**/ios/Podfile

# macOS
**/Flutter/ephemeral/
**/Pods/
**/macos/Flutter/GeneratedPluginRegistrant.swift
**/macos/Flutter/ephemeral
**/macos/Podfile
**/xcuserdata/

# Windows
Expand Down
4 changes: 1 addition & 3 deletions uni/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ include: package:very_good_analysis/analysis_options.yaml
analyzer:
# Exclude auto-generated files from dart analysis
exclude:
- '**.g.dart'
- '**.freezed.dart'
- "**.g.dart"

# Custom linter rules. A list of all rules can be found at
# https://dart-lang.github.io/linter/lints/options/options.html
Expand All @@ -13,4 +12,3 @@ linter:
public_member_api_docs: false
avoid_equals_and_hash_code_on_mutable_classes: false
one_member_abstracts: false

2 changes: 1 addition & 1 deletion uni/app_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.5.46+164
1.5.56+174
41 changes: 0 additions & 41 deletions uni/ios/Podfile

This file was deleted.

10 changes: 6 additions & 4 deletions uni/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 51;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -199,6 +199,7 @@
/* Begin PBXShellScriptBuildPhase section */
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
Expand All @@ -213,6 +214,7 @@
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
Expand Down Expand Up @@ -339,7 +341,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down Expand Up @@ -418,7 +420,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -467,7 +469,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down
2 changes: 2 additions & 0 deletions uni/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,7 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ import 'package:uni/controller/local_storage/app_shared_preferences.dart';
import 'package:uni/controller/local_storage/app_user_database.dart';
import 'package:uni/controller/networking/network_router.dart';
import 'package:uni/model/providers/state_providers.dart';
import 'package:uni/view/common_widgets/pages_layouts/general/general.dart';

Future<void> logout(BuildContext context) async {
Future<void> cleanupStoredData(BuildContext context) async {
StateProviders.fromContext(context).markAsNotInitialized();

final prefs = await SharedPreferences.getInstance();
Expand All @@ -41,6 +40,4 @@ Future<void> logout(BuildContext context) async {
if (directory.existsSync()) {
directory.deleteSync(recursive: true);
}
GeneralPageViewState.profileImageProvider = null;
PaintingBinding.instance.imageCache.clear();
}
15 changes: 15 additions & 0 deletions uni/lib/controller/local_storage/app_shared_preferences.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class AppSharedPreferences {
FavoriteWidgetType.busStops
];
static const String hiddenExams = 'hidden_exams';
static const String favoriteRestaurants = 'favorite_restaurants';
static const String filteredExamsTypes = 'filtered_exam_types';
static final List<String> defaultFilteredExamTypes = Exam.displayedTypes;

Expand Down Expand Up @@ -183,6 +184,20 @@ class AppSharedPreferences {
.toList();
}

static Future<void> saveFavoriteRestaurants(
List<String> newFavoriteRestaurants,
) async {
final prefs = await SharedPreferences.getInstance();
await prefs.setStringList(favoriteRestaurants, newFavoriteRestaurants);
}

static Future<List<String>> getFavoriteRestaurants() async {
final prefs = await SharedPreferences.getInstance();
final storedFavoriteRestaurants =
prefs.getStringList(favoriteRestaurants) ?? [];
return storedFavoriteRestaurants;
}

static Future<void> saveHiddenExams(List<String> newHiddenExams) async {
final prefs = await SharedPreferences.getInstance();
await prefs.setStringList(hiddenExams, newHiddenExams);
Expand Down
33 changes: 27 additions & 6 deletions uni/lib/controller/local_storage/file_offline_storage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,26 @@ import 'dart:io';

import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:http/http.dart' as http;
import 'package:logger/logger.dart';
import 'package:path_provider/path_provider.dart';
import 'package:uni/controller/networking/network_router.dart';

import 'package:uni/model/entities/session.dart';

/// The offline image storage location on the device.
Future<String> get _localPath async {
final directory = await getTemporaryDirectory();
return directory.path;
}

/// Gets cached image named [localFileName].
/// If not found or too old, downloads it from [url] with [headers].
/// If not found or too old, downloads it from [url].
/// The headers are retrieved from [session], then [headers] if provided.
Future<File?> loadFileFromStorageOrRetrieveNew(
String localFileName,
String url,
Map<String, String> headers, {
Session? session, {
Map<String, String>? headers,
int staleDays = 7,
bool forceRetrieval = false,
}) async {
Expand All @@ -32,27 +37,43 @@ Future<File?> loadFileFromStorageOrRetrieveNew(
.lastModifiedSync()
.add(Duration(days: staleDays))
.isBefore(DateTime.now()));

if (fileExists && !fileIsStale) {
return file;
}

if (await Connectivity().checkConnectivity() != ConnectivityResult.none) {
final downloadedFile = await _downloadAndSaveFile(targetPath, url, headers);
final downloadedFile =
await _downloadAndSaveFile(targetPath, url, session, headers);
if (downloadedFile != null) {
Logger().d('Downloaded $localFileName from remote');
return downloadedFile;
}
}
return fileExists ? file : null;

if (fileExists) {
Logger().d('Loaded stale $localFileName from local storage');
return file;
}

Logger().w('Failed to load $localFileName');
return null;
}

/// Downloads the image located at [url] and saves it in [filePath].
Future<File?> _downloadAndSaveFile(
String filePath,
String url,
Map<String, String> headers,
Session? session,
Map<String, String>? headers,
) async {
final response = await http.get(url.toUri(), headers: headers);
final response = session == null
? await http.get(url.toUri(), headers: headers)
: await NetworkRouter.getWithCookies(url, {}, session);

if (response.statusCode == 200) {
return File(filePath).writeAsBytes(response.bodyBytes);
}

return null;
}
2 changes: 1 addition & 1 deletion uni/lib/controller/networking/network_router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class NetworkRouter {
final newSession = await reLoginFromSession(session);

if (newSession == null) {
NavigationService.logout();
NavigationService.logoutAndPopHistory(null);
return Future.error('Login failed');
}
session
Expand Down
Loading
Loading