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

Redesign/course unit #1407

Draft
wants to merge 51 commits into
base: ui/redesign
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
bd57543
September 2024 Release (#1321)
limwa Sep 13, 2024
70f4980
Bump app version [no ci]
limwa Sep 13, 2024
f560739
Merge branch 'master' into release/v1.9.1
limwa Sep 17, 2024
4efa3bb
release: v1.9.1 (#1330)
limwa Sep 18, 2024
ddae50e
Bump app version [no ci]
limwa Sep 18, 2024
8bedc62
Merge branch 'master' into release/v1.9.2
limwa Sep 23, 2024
0e4a08f
release: v1.9.2 (#1336)
DGoiana Sep 25, 2024
1785d0a
Bump app version [no ci]
DGoiana Sep 25, 2024
8a2b558
Merge branch 'master' into release/v1.9.3
DGoiana Sep 27, 2024
3c04ebc
Release/v1.9.3 (#1340)
DGoiana Sep 29, 2024
a408de1
Bump app version [no ci]
DGoiana Sep 29, 2024
e2eb66e
Merge branch 'master' into fix/v1.9.4
DGoiana Oct 6, 2024
6b7d2ee
Release v1.9.4 (#1349)
DGoiana Oct 6, 2024
7a51b5b
Bump app version [no ci]
DGoiana Oct 6, 2024
5045832
Merge branch 'master' into feature/v1.9.5
DGoiana Oct 10, 2024
cf96484
Release v1.9.5 (#1354)
DGoiana Oct 11, 2024
155d114
Bump app version [no ci]
DGoiana Oct 11, 2024
dfecd7c
fixing casts
DGoiana Oct 14, 2024
5a19e13
release: v1.9.6 (#1363)
thePeras Oct 16, 2024
549a43e
Bump app version [no ci]
thePeras Oct 16, 2024
0c090f3
added icons to TabBar
simaopsbarbosa Nov 8, 2024
5e21fe6
added icons to TabBar
simaopsbarbosa Nov 8, 2024
94b5d53
Merge branch 'redesign/course-unit' of github.com:NIAEFEUP/uni into r…
simaopsbarbosa Nov 8, 2024
8765eae
changed TabIcon to look more similar to mockups
simaopsbarbosa Nov 8, 2024
c020069
added Professor Info modal
simaopsbarbosa Nov 8, 2024
91dcba4
added placeholder on professor info modal
simaopsbarbosa Nov 10, 2024
62a9881
Update provider to fetch exams by course
Adriano-7 Nov 18, 2024
428bcc4
Merge branch 'master' into redesign/course-unit-exams
Adriano-7 Dec 4, 2024
84b694e
Started displaying the exams on the course unit
Adriano-7 Dec 6, 2024
b0fe929
Merge branch 'redesign/course-unit-exams' into redesign/course-unit
Adriano-7 Dec 6, 2024
00f0fc2
Removed the SizedBox on the exams col
Adriano-7 Dec 6, 2024
affe5e1
Merge branch 'develop' into redesign/course-unit
Adriano-7 Dec 9, 2024
40e323b
Merge branch 'develop' into redesign/course-unit
Adriano-7 Dec 26, 2024
8a0d8fb
Implemented exams row in course unit information
Adriano-7 Dec 27, 2024
bc4a2f8
Fixed bug causing books to be cropped on the course unit page
Adriano-7 Dec 27, 2024
0789f7b
Added date info to the exams widget
Adriano-7 Dec 27, 2024
cc9b5f8
Changed the format to pass the linter test
Adriano-7 Dec 27, 2024
4b0c272
Merge branch 'ui/redesign' into redesign/course-unit
Adriano-7 Dec 27, 2024
8ff66e7
Updated the way we use the icons
Adriano-7 Dec 27, 2024
df17ed3
Started working on the new professors widget
Adriano-7 Dec 28, 2024
ca22403
Started the logic of expanded/collapsed instructors
Adriano-7 Dec 28, 2024
32bb719
Extracted some logic from buildIntructorsRow
Adriano-7 Dec 28, 2024
7ae22ab
Handle books with empty ISBN
Adriano-7 Dec 28, 2024
a9f3d4e
Added Eligibility for exams section to course unit
Adriano-7 Dec 28, 2024
973bcd9
Add information indicating whether the professor is a regent
Adriano-7 Dec 28, 2024
814c44e
Added translations to course unit sheet
Adriano-7 Jan 7, 2025
a0f668c
Merge branch 'ui/redesign' into redesign/course-unit
Adriano-7 Jan 7, 2025
6c98fc8
Corrected some merge conflicts
Adriano-7 Jan 7, 2025
86f59a0
Added textTheme to professor's modal
Adriano-7 Jan 7, 2025
e07695f
Corrected an error regarding the exams
Adriano-7 Jan 8, 2025
1ecda0e
Refactored course_unit_sheet
Adriano-7 Jan 8, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ class CourseUnitsInfoFetcher implements SessionDependantFetcher {
? parseSheet(bestResponse)
: Sheet(
professors: [],
regents: [],
content: '',
evaluation: '',
frequency: '',
books: [],
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,17 @@ Future<Sheet> parseSheet(http.Response response) async {
return Professor.fromJson(element as Map<String, dynamic>);
}).toList();

for (final regent in regents) {
professors.firstWhere(
(professor) => professor.code == regent.code,
orElse: () {
regent.isRegent = true;
professors.add(regent);
return regent;
},
).isRegent = true;
}

final books = (json['bibliografia'] as List? ?? [])
.map((element) => element as Map<String, dynamic>)
.map<Book>((element) {
Expand All @@ -71,7 +82,7 @@ Future<Sheet> parseSheet(http.Response response) async {
professors: professors,
content: json['conteudo'].toString(),
evaluation: json['for_avaliacao'].toString(),
regents: regents,
frequency: json['cond_frequencia'].toString(),
books: books,
);
}
Expand Down
15 changes: 13 additions & 2 deletions packages/uni_app/lib/generated/intl/messages_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ class MessageLookup extends MessageLookupByLibrary {
static m1(time) =>
"${Intl.plural(time, zero: 'Refreshed ${time} minutes ago', one: 'Refreshed ${time} minute ago', other: 'Refreshed ${time} minutes ago')}";

static m2(title) => "${Intl.select(title, {
static m2(number) => "${number} more";

static m3(title) => "${Intl.select(title, {
'horario': 'Schedule',
'exames': 'Exams',
'area': 'Personal Area',
Expand Down Expand Up @@ -54,6 +56,7 @@ class MessageLookup extends MessageLookupByLibrary {
"By entering you agree with these"),
"all_widgets_added": MessageLookupByLibrary.simpleMessage(
"All available widgets have already been added to your personal area!"),
"assessments": MessageLookupByLibrary.simpleMessage("Assessments"),
"at_least_one_college":
MessageLookupByLibrary.simpleMessage("Select at least one college"),
"available_amount":
Expand Down Expand Up @@ -101,6 +104,7 @@ class MessageLookup extends MessageLookupByLibrary {
"copy_center": MessageLookupByLibrary.simpleMessage("Copy center"),
"copy_center_building": MessageLookupByLibrary.simpleMessage(
"Floor -1 of building B | AEFEUP building"),
"courseRegent": MessageLookupByLibrary.simpleMessage("Course Regent"),
"course_class": MessageLookupByLibrary.simpleMessage("Classes"),
"course_info": MessageLookupByLibrary.simpleMessage("Info"),
"courses": MessageLookupByLibrary.simpleMessage("Courses"),
Expand Down Expand Up @@ -146,13 +150,17 @@ class MessageLookup extends MessageLookupByLibrary {
"floors": MessageLookupByLibrary.simpleMessage("Floors"),
"forgot_password":
MessageLookupByLibrary.simpleMessage("Forgot password?"),
"frequency":
MessageLookupByLibrary.simpleMessage("Eligibility for exams"),
"generate_reference":
MessageLookupByLibrary.simpleMessage("Generate reference"),
"geral_registration":
MessageLookupByLibrary.simpleMessage("General Registration"),
"improvement_registration":
MessageLookupByLibrary.simpleMessage("Enrollment for Improvement"),
"increment": MessageLookupByLibrary.simpleMessage("Increment 1,00€"),
"instructor": MessageLookupByLibrary.simpleMessage("Instructor"),
"instructors": MessageLookupByLibrary.simpleMessage("Instructors"),
"internet_status_exception": MessageLookupByLibrary.simpleMessage(
"Check your internet connection"),
"invalid_credentials":
Expand All @@ -176,11 +184,14 @@ class MessageLookup extends MessageLookupByLibrary {
"menus": MessageLookupByLibrary.simpleMessage("Menus"),
"min_value_reference":
MessageLookupByLibrary.simpleMessage("Minimum value: 1,00 €"),
"moreInstructors": m2,
"multimedia_center":
MessageLookupByLibrary.simpleMessage("Multimedia center"),
"nav_title": m2,
"nav_title": m3,
"news": MessageLookupByLibrary.simpleMessage("News"),
"no": MessageLookupByLibrary.simpleMessage("No"),
"noExamsScheduled":
MessageLookupByLibrary.simpleMessage("No exams scheduled"),
"no_app": MessageLookupByLibrary.simpleMessage(
"No app found to open the file"),
"no_bus": MessageLookupByLibrary.simpleMessage("Don\'t miss any bus!"),
Expand Down
16 changes: 14 additions & 2 deletions packages/uni_app/lib/generated/intl/messages_pt_PT.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ class MessageLookup extends MessageLookupByLibrary {
static m1(time) =>
"${Intl.plural(time, zero: 'Atualizado há ${time} minutos', one: 'Atualizado há ${time} minuto', other: 'Atualizado há ${time} minutos')}";

static m2(title) => "${Intl.select(title, {
static m2(number) => "+${number} mais";

static m3(title) => "${Intl.select(title, {
'horario': 'Horário',
'exames': 'Exames',
'area': 'Área Pessoal',
Expand Down Expand Up @@ -54,6 +56,7 @@ class MessageLookup extends MessageLookupByLibrary {
"Ao entrares confirmas que concordas com estes"),
"all_widgets_added": MessageLookupByLibrary.simpleMessage(
"Todos os widgets disponíveis já foram adicionados à tua área pessoal!"),
"assessments": MessageLookupByLibrary.simpleMessage("Avaliações"),
"at_least_one_college": MessageLookupByLibrary.simpleMessage(
"Seleciona pelo menos uma faculdade"),
"available_amount":
Expand Down Expand Up @@ -101,6 +104,8 @@ class MessageLookup extends MessageLookupByLibrary {
"copy_center": MessageLookupByLibrary.simpleMessage("Centro de cópias"),
"copy_center_building": MessageLookupByLibrary.simpleMessage(
"Piso -1 do edifício B | Edifício da AEFEUP"),
"courseRegent":
MessageLookupByLibrary.simpleMessage("Regente da Cadeira"),
"course_class": MessageLookupByLibrary.simpleMessage("Turmas"),
"course_info": MessageLookupByLibrary.simpleMessage("Ficha"),
"courses": MessageLookupByLibrary.simpleMessage("Cursos"),
Expand Down Expand Up @@ -145,13 +150,17 @@ class MessageLookup extends MessageLookupByLibrary {
"floors": MessageLookupByLibrary.simpleMessage("Pisos"),
"forgot_password":
MessageLookupByLibrary.simpleMessage("Esqueceu a palavra-passe?"),
"frequency":
MessageLookupByLibrary.simpleMessage("Obtenção de Frequência"),
"generate_reference":
MessageLookupByLibrary.simpleMessage("Gerar referência"),
"geral_registration":
MessageLookupByLibrary.simpleMessage("Inscrição Geral"),
"improvement_registration":
MessageLookupByLibrary.simpleMessage("Inscrição para Melhoria"),
"increment": MessageLookupByLibrary.simpleMessage("Incrementar 1,00€"),
"instructor": MessageLookupByLibrary.simpleMessage("Docente"),
"instructors": MessageLookupByLibrary.simpleMessage("Docentes"),
"internet_status_exception": MessageLookupByLibrary.simpleMessage(
"Verifique sua conexão com a internet"),
"invalid_credentials":
Expand All @@ -175,11 +184,14 @@ class MessageLookup extends MessageLookupByLibrary {
"menus": MessageLookupByLibrary.simpleMessage("Ementas"),
"min_value_reference":
MessageLookupByLibrary.simpleMessage("Valor mínimo: 1,00 €"),
"moreInstructors": m2,
"multimedia_center":
MessageLookupByLibrary.simpleMessage("Centro de multimédia"),
"nav_title": m2,
"nav_title": m3,
"news": MessageLookupByLibrary.simpleMessage("Notícias"),
"no": MessageLookupByLibrary.simpleMessage("Não"),
"noExamsScheduled":
MessageLookupByLibrary.simpleMessage("Não há exames agendados"),
"no_app": MessageLookupByLibrary.simpleMessage(
"Nenhuma aplicação encontrada para abrir o ficheiro"),
"no_bus": MessageLookupByLibrary.simpleMessage(
Expand Down
70 changes: 70 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.

20 changes: 20 additions & 0 deletions packages/uni_app/lib/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@
"@empty_text": {},
"evaluation": "Evaluation",
"@evaluation": {},
"frequency": "Eligibility for exams",
"@frequency": {},
"exams_filter": "Exams Filter Settings",
"@exams_filter": {},
"expired_password": "Your password has expired",
Expand Down Expand Up @@ -342,6 +344,24 @@
"@wrong_credentials_exception": {},
"internet_status_exception": "Check your internet connection",
"@internet_status_exception": {},
"instructors": "Instructors",
"@instructors": {},
"assessments": "Assessments",
"@assessments": {},
"noExamsScheduled": "No exams scheduled",
"@noExamsScheduled": {},
"bibliography": "Bibliography",
"@bibliography": {},
"moreInstructors": "{number} more",
"@moreInstructors": {
"placeholders": {
"number": {}
}
},
"courseRegent": "Course Regent",
"@courseRegent": {},
"instructor": "Instructor",
"@instructor": {},
"lectures": "Lectures",
"@lectures": {},
"exams": "Exams",
Expand Down
20 changes: 20 additions & 0 deletions packages/uni_app/lib/l10n/intl_pt_PT.arb
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@
"@empty_text": {},
"evaluation": "Avaliação",
"@evaluation": {},
"frequency": "Obtenção de Frequência",
"@frequency": {},
"exams_filter": "Definições Filtro de Exames",
"@exams_filter": {},
"expired_password": "A tua palavra-passe expirou",
Expand Down Expand Up @@ -342,6 +344,24 @@
"@wrong_credentials_exception": {},
"internet_status_exception": "Verifique sua conexão com a internet",
"@internet_status_exception": {},
"instructors": "Docentes",
"@instructors": {},
"assessments": "Avaliações",
"@assessments": {},
"noExamsScheduled": "Não há exames agendados",
"@noExamsScheduled": {},
"bibliography": "Bibliografia",
"@bibliography": {},
"moreInstructors": "+{number} mais",
"@moreInstructors": {
"placeholders": {
"number": {}
}
},
"courseRegent": "Regente da Cadeira",
"@courseRegent": {},
"instructor": "Docente",
"@instructor": {},
"lectures": "Aulas",
"@lectures": {},
"exams": "Exames",
Expand Down
6 changes: 4 additions & 2 deletions packages/uni_app/lib/model/entities/course_units/sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ class Sheet {
required this.professors,
required this.content,
required this.evaluation,
required this.regents,
required this.frequency,
required this.books,
});
List<Professor> professors;
List<Professor> regents;
String content;
String evaluation;
String frequency;
List<Book> books;
}

Expand All @@ -30,6 +30,7 @@ class Professor {
required this.name,
required this.classes,
this.picture,
this.isRegent = false,
});

factory Professor.fromJson(Map<String, dynamic> json) {
Expand All @@ -44,6 +45,7 @@ class Professor {
String code;
String name;
List<String> classes;
bool isRegent;

@override
bool operator ==(Object other) {
Expand Down
4 changes: 4 additions & 0 deletions packages/uni_app/lib/model/entities/exam.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ class Exam {
.MONTHS[start.month - 1];
}

String monthAcronym(AppLocale locale) {
return DateFormat.MMM(locale.localeCode.languageCode).format(start);
}

String get startTime => formatTime(start);

String get finishTime => formatTime(finish);
Expand Down
11 changes: 5 additions & 6 deletions packages/uni_app/lib/view/academic_path/academic_path.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:uni/generated/l10n.dart';
import 'package:uni/utils/navigation_items.dart';
import 'package:uni/view/academic_path/exam_page.dart';
import 'package:uni/view/academic_path/widgets/course_units_card.dart';
import 'package:uni/view/common_widgets/pages_layouts/general/general.dart';
import 'package:uni_ui/icons.dart';
import 'package:uni_ui/tabs/tab_icon.dart';
Expand Down Expand Up @@ -53,14 +54,12 @@ class AcademicPathPageViewState extends GeneralPageViewState
Widget getBody(BuildContext context) {
return TabBarView(
controller: tabController,
children: const [
Center(
child: Text('To be implemented'),
),
ExamsPage(),
Center(
children: [
const Center(
child: Text('To be implemented'),
),
const ExamsPage(),
CourseUnitsCard(),
],
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class GenericExpandable extends StatelessWidget {
return ExpandablePanel(
header: Align(
alignment: Alignment.centerLeft,
child: Text(title, style: const TextStyle(fontSize: 20)),
child: Text(title, style: Theme.of(context).textTheme.headlineLarge),
),
collapsed: ShaderMask(
shaderCallback: (bounds) => const LinearGradient(
Expand Down
Loading
Loading