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

Changing uc link to open in app page #1035

Merged
merged 8 commits into from
Feb 29, 2024
Merged

Changing uc link to open in app page #1035

merged 8 commits into from
Feb 29, 2024

Conversation

adriannalmeida
Copy link
Contributor

Closes #913

Review checklist

  • Terms and conditions reflect the current change
  • Contains enough appropriate tests
  • If aimed at production, writes a new summary in whatsnew/whatsnew-pt-PT
  • Properly adds an entry in changelog.md with the change
  • If PR includes UI updates/additions, its description has screenshots
  • Behavior is as expected
  • Clean, well-structured code

Copy link

codecov bot commented Nov 17, 2023

Codecov Report

Merging #1035 (2d0c6c2) into develop (2e17df2) will decrease coverage by 0%.
Report is 1 commits behind head on develop.
The diff coverage is 35%.

Additional details and impacted files
@@           Coverage Diff           @@
##           develop   #1035   +/-   ##
=======================================
- Coverage       16%     15%   -0%     
=======================================
  Files          228     228           
  Lines         6888    6899   +11     
=======================================
- Hits          1083    1020   -63     
- Misses        5805    5879   +74     

Copy link
Collaborator

@bdmendes bdmendes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! Left a few comments that should be easy to address.

uni/lib/view/schedule/widgets/schedule_slot.dart Outdated Show resolved Hide resolved
uni/lib/view/schedule/widgets/schedule_slot.dart Outdated Show resolved Hide resolved
@adriannalmeida adriannalmeida self-assigned this Dec 5, 2023
@adriannalmeida adriannalmeida force-pushed the feature/uc-button branch 2 times, most recently from be3ea97 to ca7a80a Compare December 5, 2023 00:32
Copy link
Collaborator

@bdmendes bdmendes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, some SDK/git issues to address.
The main point of the feature is done, though!

uni/lib/generated/intl/messages_all.dart Outdated Show resolved Hide resolved
uni/lib/generated/intl/messages_en.dart Show resolved Hide resolved
uni/lib/view/schedule/widgets/schedule_slot.dart Outdated Show resolved Hide resolved
@bdmendes bdmendes requested a review from vitormpp December 8, 2023 14:32
@adriannalmeida adriannalmeida force-pushed the feature/uc-button branch 5 times, most recently from d058b08 to 9f45374 Compare December 22, 2023 18:12
Copy link
Collaborator

@bdmendes bdmendes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work!

uni/lib/view/schedule/widgets/schedule_slot.dart Outdated Show resolved Hide resolved
uni/lib/view/schedule/widgets/schedule_slot.dart Outdated Show resolved Hide resolved
Copy link
Collaborator

@bdmendes bdmendes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bit weird that we're creating a sentinel course unit if we can't find one. I think we should simply use something like findOrNull (if that is the correct name) and simply display an error.

Copy link
Member

@limwa limwa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, I just have a few suggestions I thought would be useful!

uni/lib/l10n/intl_en.arb Outdated Show resolved Hide resolved
uni/lib/l10n/intl_pt_PT.arb Outdated Show resolved Hide resolved
Comment on lines 114 to 123
final courseUnits =
Provider.of<ProfileProvider>(context, listen: false).state!.courseUnits;
final notFound =
CourseUnit(abbreviation: 'NF', name: 'not found', occurrId: 0);
final correspondingCourseUnit = courseUnits.firstWhere(
(courseUnit) => courseUnit.occurrId == occurrId,
orElse: () => notFound,
);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't there a way to pass down the courseUnit from the parent that build the schedule slot?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to avoid sentinel values. Return null in case of error.

uni/lib/view/schedule/widgets/schedule_slot.dart Outdated Show resolved Hide resolved
Comment on lines 138 to 140
if (correspondingCourseUnit(context).name == 'not found') {
return const Column(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you can't find a way to pass down the course unit from the parent of the schedule slot, you could run this in the initState method so that this doesn't every time the component is rebuilt!

@thePeras thePeras self-requested a review February 24, 2024 16:19
@limwa limwa force-pushed the feature/uc-button branch from 568d250 to 1a6983b Compare February 28, 2024 15:12
@limwa limwa force-pushed the feature/uc-button branch from 1a6983b to 519da09 Compare February 28, 2024 15:46
Comment on lines 114 to 123
final courseUnits =
Provider.of<ProfileProvider>(context, listen: false).state!.courseUnits;
final notFound =
CourseUnit(abbreviation: 'NF', name: 'not found', occurrId: 0);
final correspondingCourseUnit = courseUnits.firstWhere(
(courseUnit) => courseUnit.occurrId == occurrId,
orElse: () => notFound,
);

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to avoid sentinel values. Return null in case of error.

Copy link
Member

@limwa limwa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@bdmendes bdmendes merged commit fc08b02 into develop Feb 29, 2024
6 checks passed
@bdmendes bdmendes deleted the feature/uc-button branch February 29, 2024 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make schedule UC link button open in-app UC page
6 participants