-
Notifications
You must be signed in to change notification settings - Fork 3
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
CMM #461
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #461 +/- ##
==========================================
- Coverage 54.18% 54.09% -0.09%
==========================================
Files 169 169
Lines 3739 3745 +6
==========================================
Hits 2026 2026
- Misses 1713 1719 +6 ☔ View full report in Codecov by Sentry. |
> [!IMPORTANT] > We really need to release new versions **soon**, as we have not for several months and there's some time needed to test in alpha before prod. This goes hand in hand with the **major version bump** [for Hyperion](../../Hyperion/pull/642). Both PRs are ready, and _seemingly_ waiting for some more **breaking changes** to be merged, including (by likelihood): - [x] Support Flutter 3.27: #464 - [ ] Allow students from other Schools to have a MyECL account: #447 - [ ] MyECLPay: #72 (old PR but recent branch) - [ ] "_Centrale Mega Meme_" Meme module: #461 - [x] External Notifications: #448
final isCMMAdminProvider = StateProvider<bool>((ref) { | ||
final me = ref.watch(userProvider); | ||
for (final group in me.groups) { | ||
if (group.name == "CMM") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You better have to check with the group.id instead of the name, because nothing is preventing another group to be named CMM, thus giving its members the visual of the admin panel, even if Hyperion will block their requests
Future<List<CMM>> getCMM() async { | ||
//return (await getList(suffix: '')).map((e) => CMM.fromJson(e)).toList(); | ||
return [ | ||
CMM( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider unmocking when going from Draft to PR and to test with the backend
CMMScore(value: 1, user: user, position: 3), | ||
]; | ||
// return List<CMMScore>.from( | ||
// (await getList(suffix: "CMMScores")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same goes here
Future<List<CMM>> getMyCMM() async { | ||
//return (await getList(suffix: '')).map((e) => CMM.fromJson(e)).toList(); | ||
return [ | ||
CMM( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to avoid missing one in the process
path: add, | ||
builder: () => const AddCMMPage(), | ||
), | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should also use the DeferredLoadingMiddleware here, to further improve loading time
lib/CMM/ui/components/cmm_card.dart
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about the relevance of the comments in this file
decoration: BoxDecoration( | ||
border: Border.all(color: Colors.black, width: 2), | ||
borderRadius: const BorderRadius.only( | ||
topLeft: Radius.circular(20), // Rounded top-left corner |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't clearly see the purpose of the comment here, the code speaks for itself i my opinion
style: (score.position == 1 || | ||
score.position == 2 || | ||
score.position == 3) | ||
? const TextStyle( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't score.position <= 3
can just sum all of this up ?
FormField<File>( | ||
validator: (e) { | ||
if (poster.value == null) { | ||
return "Choix poster"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe go for a more explicit message : "Aucun fichier choisis"
child: posterFile.value != null | ||
? | ||
// ? Container( | ||
// decoration: BoxDecoration( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just don't forget to delete it if you are certain not to use it anymore, it should not stay in the PR in the end
No description provided.