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

release: v1.9.1 #1330

Merged
merged 30 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
a17eca4
Bump app version [no ci]
niaefeup-admin Sep 13, 2024
10af0cb
fixing and modifying ios build for next release
DGoiana Sep 14, 2024
09d1d07
fix a null uc id error
DGoiana Sep 15, 2024
f077d5f
changing db schema
DGoiana Sep 15, 2024
2454eaf
Fix a null course unit id error (#1327)
limwa Sep 15, 2024
ee1ae83
Bump app version [no ci]
limwa Sep 15, 2024
80bff0c
Merge branch 'develop' into fix/ios-build
DGoiana Sep 15, 2024
b4d58da
fix: no information for mobility students
limwa Sep 15, 2024
f323bde
Fixing IOS build (#1326)
limwa Sep 15, 2024
67f1005
Bump app version [no ci]
limwa Sep 15, 2024
d9c75b6
refactor: remove profile from lecture provider
limwa Sep 15, 2024
1e26ab7
refactor: remove more profile references from lecture provider
limwa Sep 15, 2024
9cc9a7d
Merge branch 'develop' into limwa/fix/no-information-for-mobility-stu…
limwa Sep 15, 2024
170cf91
fix: no information for mobility students (#1328)
limwa Sep 16, 2024
22a6719
Bump app version [no ci]
limwa Sep 16, 2024
d859048
refactor: remove profile from lecture provider (#1329)
limwa Sep 16, 2024
8dbc59e
Bump app version [no ci]
limwa Sep 16, 2024
fc9e349
fix: add mobility course name
limwa Sep 16, 2024
64cee74
fix: add mobility course name (#1331)
limwa Sep 16, 2024
0e46476
Bump app version [no ci]
limwa Sep 16, 2024
61b3ecb
adding null information check
DGoiana Sep 16, 2024
112df65
Merge branch 'develop' into fix/course-unit-null-info
DGoiana Sep 16, 2024
f514661
localizing
DGoiana Sep 16, 2024
5bc73f9
formatting
DGoiana Sep 16, 2024
00fc389
Adding null course units information check (#1332)
limwa Sep 16, 2024
837c1c7
Bump app version [no ci]
limwa Sep 16, 2024
1fc65d3
fix: unit info error on relogin
limwa Sep 17, 2024
e8952e4
fix: unit info error on relogin (#1333)
limwa Sep 17, 2024
0abc077
Bump app version [no ci]
limwa Sep 17, 2024
f560739
Merge branch 'master' into release/v1.9.1
limwa Sep 17, 2024
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 packages/uni_app/ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>11.0</string>
<string>12.0</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion packages/uni_app/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
end
2 changes: 1 addition & 1 deletion packages/uni_app/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1430;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "";
TargetAttributes = {
378A17102ACF02E100B89C1C = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import 'package:uni/controller/fetchers/session_dependant_fetcher.dart';
import 'package:uni/model/entities/lecture.dart';
import 'package:uni/model/entities/profile.dart';
import 'package:uni/model/utils/time/week.dart';
import 'package:uni/session/flows/base/session.dart';

/// Class for fetching the user's schedule.
abstract class ScheduleFetcher extends SessionDependantFetcher {
// Returns the user's lectures.
Future<List<Lecture>> getLectures(Session session, Profile profile);
Future<List<Lecture>> getLectures(Session session);

List<Week> getWeeks(DateTime now) {
final week = Week(start: now);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import 'package:uni/controller/fetchers/schedule_fetcher/schedule_fetcher.dart';
import 'package:uni/controller/networking/network_router.dart';
import 'package:uni/controller/parsers/schedule/api/parser.dart';
import 'package:uni/model/entities/lecture.dart';
import 'package:uni/model/entities/profile.dart';
import 'package:uni/model/utils/time/week.dart';
import 'package:uni/session/flows/base/session.dart';

Expand All @@ -19,7 +18,7 @@ class ScheduleFetcherApi extends ScheduleFetcher {

/// Fetches the user's lectures from the faculties' API.
@override
Future<List<Lecture>> getLectures(Session session, Profile profile) async {
Future<List<Lecture>> getLectures(Session session) async {
final dates = getDates();

final urls = getEndpoints(session);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import 'package:uni/controller/fetchers/schedule_fetcher/schedule_fetcher.dart';
import 'package:uni/controller/networking/network_router.dart';
import 'package:uni/controller/parsers/schedule/new_api/parser.dart';
import 'package:uni/model/entities/lecture.dart';
import 'package:uni/model/entities/profile.dart';
import 'package:uni/session/flows/base/session.dart';

/// Class for fetching the user's lectures from the schedule's HTML page.
Expand All @@ -17,7 +16,7 @@ class ScheduleFetcherNewApi extends ScheduleFetcher {

/// Fetches the user's lectures from the schedule's HTML page.
@override
Future<List<Lecture>> getLectures(Session session, Profile profile) async {
Future<List<Lecture>> getLectures(Session session) async {
final endpoints = getEndpoints(session);
final lectiveYear = getLectiveYear(DateTime.now());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,21 @@ class AppCourseUnitsDatabase extends AppDatabase<List<CourseUnit>> {
: super(
'course_units.db',
[createScript],
onUpgrade: migrate,
version: 2,
);
static const String createScript =
'''CREATE TABLE course_units(ucurr_id INTEGER, ucurr_codigo TEXT, ucurr_sigla TEXT , '''
'''ucurr_nome TEXT, ano INTEGER, ocorr_id INTEGER, per_codigo TEXT, '''
'''per_nome TEXT, tipo TEXT, estado TEXT, resultado_melhor TEXT, resultado_ects TEXT, '''
'''resultado_insc TEXT, creditos_ects REAL, schoolYear TEXT)''';
'''ectsGrade TEXT, resultado_insc TEXT, creditos_ects REAL, schoolYear TEXT)''';

Future<List<CourseUnit>> courseUnits() async {
final db = await getDatabase();
final List<Map<String, dynamic>> maps = await db.query('course_units');
return List.generate(maps.length, (i) {
return CourseUnit(
id: maps[i]['ucurr_id'] as int,
id: maps[i]['ucurr_id'] as int?,
code: maps[i]['ucurr_codigo'] as String,
abbreviation: maps[i]['ucurr_sigla'] as String,
name: maps[i]['ucurr_nome'] as String,
Expand Down Expand Up @@ -55,6 +57,17 @@ class AppCourseUnitsDatabase extends AppDatabase<List<CourseUnit>> {
await db.delete('course_units');
}

static FutureOr<void> migrate(
Database db,
int oldVersion,
int newVersion,
) async {
final batch = db.batch()
..execute('DROP TABLE IF EXISTS course_units')
..execute(createScript);
await batch.commit();
}

@override
Future<void> saveToDatabase(List<CourseUnit> data) async {
await deleteCourseUnits();
Expand Down
3 changes: 3 additions & 0 deletions packages/uni_app/lib/generated/intl/messages_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class MessageLookup extends MessageLookupByLibrary {
"balance": MessageLookupByLibrary.simpleMessage("Balance:"),
"banner_info": MessageLookupByLibrary.simpleMessage(
"We do now collect anonymous usage statistics in order to improve your experience. You can change it in settings."),
"bibliography": MessageLookupByLibrary.simpleMessage("Bibliography"),
"bs_description": MessageLookupByLibrary.simpleMessage(
"Did you find any bugs in the application?\nDo you have any suggestions for the app?\nTell us so we can improve!"),
"bug_description": MessageLookupByLibrary.simpleMessage(
Expand Down Expand Up @@ -120,6 +121,7 @@ class MessageLookup extends MessageLookupByLibrary {
"edit_on": MessageLookupByLibrary.simpleMessage("Finish editing"),
"empty_text":
MessageLookupByLibrary.simpleMessage("Please fill in this field"),
"evaluation": MessageLookupByLibrary.simpleMessage("Evaluation"),
"exams_filter":
MessageLookupByLibrary.simpleMessage("Exams Filter Settings"),
"exit_confirm":
Expand Down Expand Up @@ -248,6 +250,7 @@ class MessageLookup extends MessageLookupByLibrary {
"prints": MessageLookupByLibrary.simpleMessage("Prints"),
"problem_id": MessageLookupByLibrary.simpleMessage(
"Brief identification of the problem"),
"program": MessageLookupByLibrary.simpleMessage("Program"),
"reference_sigarra_help": MessageLookupByLibrary.simpleMessage(
"The generated reference data will appear in Sigarra, checking account.\nProfile > Checking Account"),
"reference_success": MessageLookupByLibrary.simpleMessage(
Expand Down
3 changes: 3 additions & 0 deletions packages/uni_app/lib/generated/intl/messages_pt_PT.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class MessageLookup extends MessageLookupByLibrary {
"balance": MessageLookupByLibrary.simpleMessage("Saldo:"),
"banner_info": MessageLookupByLibrary.simpleMessage(
"Agora recolhemos estatísticas de uso anónimas para melhorar a tua experiência. Podes alterá-lo nas definições."),
"bibliography": MessageLookupByLibrary.simpleMessage("Bibliografia"),
"bs_description": MessageLookupByLibrary.simpleMessage(
"Encontraste algum bug na aplicação?\nTens alguma sugestão para a app?\nConta-nos para que possamos melhorar!"),
"bug_description": MessageLookupByLibrary.simpleMessage(
Expand Down Expand Up @@ -119,6 +120,7 @@ class MessageLookup extends MessageLookupByLibrary {
"edit_on": MessageLookupByLibrary.simpleMessage("Concluir edição"),
"empty_text": MessageLookupByLibrary.simpleMessage(
"Por favor preenche este campo"),
"evaluation": MessageLookupByLibrary.simpleMessage("Avaliação"),
"exams_filter":
MessageLookupByLibrary.simpleMessage("Definições Filtro de Exames"),
"exit_confirm": MessageLookupByLibrary.simpleMessage(
Expand Down Expand Up @@ -249,6 +251,7 @@ class MessageLookup extends MessageLookupByLibrary {
"prints": MessageLookupByLibrary.simpleMessage("Impressões"),
"problem_id": MessageLookupByLibrary.simpleMessage(
"Breve identificação do problema"),
"program": MessageLookupByLibrary.simpleMessage("Programa"),
"reference_sigarra_help": MessageLookupByLibrary.simpleMessage(
"Os dados da referência gerada aparecerão no Sigarra, conta corrente. Perfil > Conta Corrente"),
"reference_success": MessageLookupByLibrary.simpleMessage(
Expand Down
30 changes: 30 additions & 0 deletions packages/uni_app/lib/generated/l10n.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions packages/uni_app/lib/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
"@banner_info": {},
"balance": "Balance:",
"@balance": {},
"bibliography": "Bibliography",
"@bibliography": {},
"bs_description": "Did you find any bugs in the application?\nDo you have any suggestions for the app?\nTell us so we can improve!",
"@bs_description": {},
"bug_description": "Bug found, how to reproduce it, etc.",
Expand Down Expand Up @@ -106,6 +108,8 @@
"@edit_on": {},
"empty_text": "Please fill in this field",
"@empty_text": {},
"evaluation": "Evaluation",
"@evaluation": {},
"exams_filter": "Exams Filter Settings",
"@exams_filter": {},
"expired_password": "Your password has expired",
Expand Down Expand Up @@ -248,6 +252,8 @@
"@successful_open": {},
"permission_denied": "Permission denied",
"@permission_denied": {},
"program": "Program",
"@program": {},
"open_error": "Error opening the file",
"@open_error": {},
"no_app": "No app found to open the file",
Expand Down
6 changes: 6 additions & 0 deletions packages/uni_app/lib/l10n/intl_pt_PT.arb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
"@banner_info": {},
"balance": "Saldo:",
"@balance": {},
"bibliography": "Bibliografia",
"@bibliography": {},
"bs_description": "Encontraste algum bug na aplicação?\nTens alguma sugestão para a app?\nConta-nos para que possamos melhorar!",
"@bs_description": {},
"bug_description": "Bug encontrado, como o reproduzir, etc",
Expand Down Expand Up @@ -108,6 +110,8 @@
"@edit_on": {},
"empty_text": "Por favor preenche este campo",
"@empty_text": {},
"evaluation": "Avaliação",
"@evaluation": {},
"exams_filter": "Definições Filtro de Exames",
"@exams_filter": {},
"expired_password": "A tua palavra-passe expirou",
Expand Down Expand Up @@ -252,6 +256,8 @@
"@personal_assistance": {},
"press_again": "Pressione novamente para sair",
"@press_again": {},
"program": "Programa",
"@program": {},
"print": "Impressão",
"@print": {},
"prints": "Impressões",
Expand Down
15 changes: 10 additions & 5 deletions packages/uni_app/lib/model/entities/course.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ part '../../generated/model/entities/course.g.dart';
@JsonSerializable(createFactory: false)
class Course {
Course({
required this.id,
this.id,
this.festId,
this.name,
this.abbreviation,
Expand All @@ -27,10 +27,15 @@ class Course {
});

factory Course.fromJson(Map<String, dynamic> json) {
var name = json['cur_nome'] as String?;
if (name == null || name.isEmpty) {
name = json['fest_tipo_descr'] as String?;
}

return Course(
id: json['cur_id'] as int,
id: json['cur_id'] as int?,
festId: json['fest_id'] as int?,
name: json['cur_nome'] as String?,
name: name,
abbreviation: json['abbreviation'] as String?,
currYear: json['ano_curricular'] as String?,
firstEnrollment: json['fest_a_lect_1_insc'] as int?,
Expand All @@ -41,8 +46,8 @@ class Course {
);
}
@JsonKey(name: 'cur_id')
final int id;
@JsonKey(name: 'fest_id ')
final int? id;
@JsonKey(name: 'fest_id')
final int? festId;
@JsonKey(name: 'cur_nome')
final String? name;
Expand Down
17 changes: 6 additions & 11 deletions packages/uni_app/lib/model/providers/lazy/lecture_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import 'package:uni/controller/fetchers/schedule_fetcher/schedule_fetcher_api.da
import 'package:uni/controller/fetchers/schedule_fetcher/schedule_fetcher_new_api.dart';
import 'package:uni/controller/local_storage/database/app_lectures_database.dart';
import 'package:uni/model/entities/lecture.dart';
import 'package:uni/model/entities/profile.dart';
import 'package:uni/model/providers/state_provider_notifier.dart';
import 'package:uni/model/providers/state_providers.dart';
import 'package:uni/session/flows/base/session.dart';
Expand All @@ -23,17 +22,14 @@ class LectureProvider extends StateProviderNotifier<List<Lecture>> {
Future<List<Lecture>> loadFromRemote(StateProviders stateProviders) async {
return fetchUserLectures(
stateProviders.sessionProvider.state!,
stateProviders.profileProvider.state!,
);
}

Future<List<Lecture>> fetchUserLectures(
Session session,
Profile profile, {
Session session, {
ScheduleFetcher? fetcher,
}) async {
final lectures =
await getLecturesFromFetcherOrElse(fetcher, session, profile);
final lectures = await getLecturesFromFetcherOrElse(fetcher, session);

final db = AppLecturesDatabase();
await db.saveIfPersistentSession(lectures);
Expand All @@ -44,13 +40,12 @@ class LectureProvider extends StateProviderNotifier<List<Lecture>> {
Future<List<Lecture>> getLecturesFromFetcherOrElse(
ScheduleFetcher? fetcher,
Session session,
Profile profile,
) =>
fetcher?.getLectures(session, profile) ?? getLectures(session, profile);
fetcher?.getLectures(session) ?? getLectures(session);

Future<List<Lecture>> getLectures(Session session, Profile profile) {
return ScheduleFetcherApi().getLectures(session, profile).catchError(
(e) => ScheduleFetcherNewApi().getLectures(session, profile),
Future<List<Lecture>> getLectures(Session session) {
return ScheduleFetcherApi().getLectures(session).catchError(
(e) => ScheduleFetcherNewApi().getLectures(session),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@ abstract class StateProviderNotifier<T> extends ChangeNotifier {
RequestStatus initialStatus = RequestStatus.busy,
T? initialState,
}) : _requestStatus = initialStatus,
_initialState = initialState,
_state = initialState;

/// The initial state of the model.
final T? _initialState;

/// The model that this notifier provides.
/// This future will throw if the data loading fails.
T? _state;
Expand Down Expand Up @@ -68,7 +72,7 @@ abstract class StateProviderNotifier<T> extends ChangeNotifier {
/// Makes the state null, as if the model has never been loaded,
/// so that consumers may trigger the loading again.
void invalidate() {
_state = null;
_state = _initialState;
notifyListeners();
}

Expand Down
Loading