Skip to content
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
94d7863
Add personal information to settings page. Add new atributes to the p…
muralhaplays Feb 11, 2026
97ba368
Add new attributes to profile. Fetch the attributes that were added.
muralhaplays Feb 16, 2026
6540a69
Format the files
muralhaplays Feb 16, 2026
334be34
Change profile to store the type of the address as well. Create the p…
muralhaplays Feb 17, 2026
9e63020
Rebuild everything because the sigarra page can have more entries tha…
muralhaplays Feb 23, 2026
79b9c31
Format a few things and remove unused imports
muralhaplays Feb 23, 2026
df9e586
Restore the duration of profile cache
muralhaplays Feb 24, 2026
6c9f56f
Change the didChangeDependencies() from the courses page to the home …
muralhaplays Feb 25, 2026
d21890a
Change the profile button
muralhaplays Feb 25, 2026
2349b62
Merge branch 'develop' into feat/personal_info
muralhaplays Mar 2, 2026
c269147
formatted
muralhaplays Mar 2, 2026
2335518
Add shimmer and no content widgets to the personal info page.
muralhaplays Mar 4, 2026
7068f1f
Format files
muralhaplays Mar 5, 2026
bae44e3
Remove a folder that was mistakenly created
muralhaplays Mar 8, 2026
78e69e2
Merge branch 'develop' into feat/personal_info
muralhaplays Mar 9, 2026
b5db565
Change the way we save the profile info
muralhaplays Mar 12, 2026
2fea347
Put the ProfileInfo into the database
muralhaplays Mar 12, 2026
1ea25ae
Fix copilot suggestions. Save profile info into the database
muralhaplays Mar 23, 2026
3232ce3
Change profile info cache duration to 30 days
muralhaplays Mar 25, 2026
6c95cb8
Merge branch 'develop' into feat/personal_info
pedroafmonteiro Mar 31, 2026
ac00ee0
Merge branch 'develop' into feat/personal_info
muralhaplays Apr 20, 2026
5d74d9c
Change the personal info button to above the settings heading
muralhaplays Apr 21, 2026
4258db6
Merge remote-tracking branch 'refs/remotes/origin/feat/personal_info'…
muralhaplays Apr 21, 2026
abbfa47
Fix the request changes
muralhaplays Apr 22, 2026
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
63 changes: 63 additions & 0 deletions lib/generated/intl/messages_all.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart
// This is a library that looks up messages for specific locales by
// delegating to the appropriate library.

// Ignore issues from commonly used lints in this file.
// ignore_for_file:implementation_imports, file_names, unnecessary_new
// ignore_for_file:unnecessary_brace_in_string_interps, directives_ordering
// ignore_for_file:argument_type_not_assignable, invalid_assignment
// ignore_for_file:prefer_single_quotes, prefer_generic_function_type_aliases
// ignore_for_file:comment_references

import 'dart:async';

import 'package:intl/intl.dart';
import 'package:intl/message_lookup_by_library.dart';
import 'package:intl/src/intl_helpers.dart';

import 'messages_en.dart' as messages_en;

typedef Future<dynamic> LibraryLoader();
Map<String, LibraryLoader> _deferredLibraries = {
'en': () => new Future.value(null),
};

MessageLookupByLibrary? _findExact(String localeName) {
switch (localeName) {
case 'en':
return messages_en.messages;
default:
return null;
}
}

/// User programs should call this before using [localeName] for messages.
Future<bool> initializeMessages(String localeName) async {
var availableLocale = Intl.verifiedLocale(
localeName,
(locale) => _deferredLibraries[locale] != null,
onFailure: (_) => null);
if (availableLocale == null) {
return new Future.value(false);
}
var lib = _deferredLibraries[availableLocale];
await (lib == null ? new Future.value(false) : lib());
initializeInternalMessageLookup(() => new CompositeMessageLookup());
messageLookup.addLocale(availableLocale, _findGeneratedMessagesFor);
return new Future.value(true);
}

bool _messagesExistFor(String locale) {
try {
return _findExact(locale) != null;
} catch (e) {
return false;
}
}

MessageLookupByLibrary? _findGeneratedMessagesFor(String locale) {
var actualLocale = Intl.verifiedLocale(locale, _messagesExistFor,
onFailure: (_) => null);
if (actualLocale == null) return null;
return _findExact(actualLocale);
}
26 changes: 26 additions & 0 deletions lib/generated/intl/messages_en.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart
// This is a library that provides messages for a en locale. All the
// messages from the main program should be duplicated here with the same
// function name.

// Ignore issues from commonly used lints in this file.
// ignore_for_file:unnecessary_brace_in_string_interps, unnecessary_new
// ignore_for_file:prefer_single_quotes,comment_references, directives_ordering
// ignore_for_file:annotate_overrides,prefer_generic_function_type_aliases
// ignore_for_file:unused_import, file_names

import 'package:intl/intl.dart';
import 'package:intl/message_lookup_by_library.dart';

final messages = new MessageLookup();

typedef String MessageIfAbsent(String messageStr, List<dynamic> args);

class MessageLookup extends MessageLookupByLibrary {
String get localeName => 'en';

final messages = _notInlinedMessages(_notInlinedMessages);
static _notInlinedMessages(_) => <String, Function> {

};
}
77 changes: 77 additions & 0 deletions lib/generated/l10n.dart

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

1 change: 1 addition & 0 deletions lib/l10n/intl_en.arb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Comment thread
pedroafmonteiro marked this conversation as resolved.
3 changes: 3 additions & 0 deletions packages/uni_app/lib/controller/fetchers/profile_fetcher.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:uni/controller/fetchers/courses_fetcher.dart';
import 'package:uni/controller/fetchers/profile_info_fetcher.dart';
import 'package:uni/controller/fetchers/session_dependant_fetcher.dart';
import 'package:uni/controller/networking/network_router.dart';
import 'package:uni/controller/parsers/parser_courses.dart';
Expand Down Expand Up @@ -45,6 +46,8 @@ class ProfileFetcher implements SessionDependantFetcher {
profile.courses.add(course);
}

profile.profileInfo = await ProfileInfoFetcher.fetchProfileInfo(session);

return profile;
}
}
36 changes: 36 additions & 0 deletions packages/uni_app/lib/controller/fetchers/profile_info_fetcher.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import 'package:uni/controller/fetchers/session_dependant_fetcher.dart';
import 'package:uni/controller/networking/network_router.dart';
import 'package:uni/controller/parsers/parser_profile_info.dart';
import 'package:uni/model/entities/profile_info.dart';
import 'package:uni/session/flows/base/session.dart';

class ProfileInfoFetcher implements SessionDependantFetcher {
@override
List<String> getEndpoints(Session session) {
final url = NetworkRouter.getBaseUrlsFromSession(
session,
)[0]; // user profile is the same on all faculties
return [url];
}

/// Returns the user's [ProfileInfo].
static Future<ProfileInfo?> fetchProfileInfo(Session session) async {
final now = DateTime.now();
final dummy =
'${now.year}-${now.month}-${now.day}T${now.hour}:${now.minute}:${now.second}.${now.millisecond}Z';
final urlProfileInfo =
'${NetworkRouter.getBaseUrlsFromSession(session, languageSensitive: true)[0]}'
'fest_geral.info_pessoal_view?';
final responseProfileInfo = await NetworkRouter.getWithCookies(
urlProfileInfo,
{'pv_num_unico': session.username, 'pv_dummy': dummy},
session,
);

Comment thread
muralhaplays marked this conversation as resolved.
final data = parseProfileDetails(responseProfileInfo);

final profileInfo = ProfileInfo.fromList(data);

return profileInfo;
}
}
24 changes: 24 additions & 0 deletions packages/uni_app/lib/controller/parsers/parser_profile_info.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import 'package:html/parser.dart' show parse;
import 'package:http/http.dart' as http;

List<List<List<String>>> parseProfileDetails(http.Response response) {
final document = parse(response.body);
final tables = document.querySelectorAll('table');
final List<List<List<String>>> eachTable = [];

for (final tableRaw in tables) {
final table = tableRaw
.querySelectorAll('td')
.map((cell) => cell.text.trim().replaceAll(':', ''))
.where((cell) => cell.isNotEmpty)
.toList();
final List<List<String>> tableWithPairs = [];
for (var i = 0; i < table.length; i += 2) {
Comment thread
muralhaplays marked this conversation as resolved.
tableWithPairs.add(table.sublist(i, i + 2));
Comment thread
muralhaplays marked this conversation as resolved.
Outdated
}

eachTable.add(tableWithPairs);
}

return eachTable;
}
10 changes: 3 additions & 7 deletions packages/uni_app/lib/generated/intl/messages_all.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ Future<bool> initializeMessages(String localeName) async {
var availableLocale = Intl.verifiedLocale(
localeName,
(locale) => _deferredLibraries[locale] != null,
onFailure: (_) => null,
);
onFailure: (_) => null);
if (availableLocale == null) {
return new Future.value(false);
}
Expand All @@ -61,11 +60,8 @@ bool _messagesExistFor(String locale) {
}

MessageLookupByLibrary? _findGeneratedMessagesFor(String locale) {
var actualLocale = Intl.verifiedLocale(
locale,
_messagesExistFor,
onFailure: (_) => null,
);
var actualLocale = Intl.verifiedLocale(locale, _messagesExistFor,
onFailure: (_) => null);
if (actualLocale == null) return null;
return _findExact(actualLocale);
}
Loading