flutter icon indicating copy to clipboard operation
flutter copied to clipboard

Block user from accessing exercise contribution page

Open rolandgeider opened this issue 3 years ago • 7 comments

If a user has not confirmed their email (user provider, Profile), they should't be able to access the page to contribute exercises (AddExerciseScreen, Workout tab -> three dot menu). Instead, we should show a simple info text and a button that opens the user pofile form (UserProfileForm) where it is possible to confirm it

rolandgeider avatar Oct 12 '22 10:10 rolandgeider

Can i work on this issue as i have did the same in my app.

Hirdey-1999 avatar Oct 12 '22 14:10 Hirdey-1999

Hi! Sure, it's yours

rolandgeider avatar Oct 12 '22 14:10 rolandgeider

Thanks for assigning

Hirdey-1999 avatar Oct 12 '22 15:10 Hirdey-1999

can I work on this issue, I can resolve it.

Arnav2001 avatar Oct 13 '22 08:10 Arnav2001

Hey! @Hirdey-1999 is already working on this

rolandgeider avatar Oct 13 '22 08:10 rolandgeider

do you have anything else for me

Arnav2001 avatar Oct 13 '22 08:10 Arnav2001

@Arnav2001 perhaps #254 ?

rolandgeider avatar Oct 13 '22 08:10 rolandgeider

Hey can you please assign me on this issue?

Harshit933 avatar Jan 27 '23 12:01 Harshit933

Hi @Harshit933 , sure!

If you need help setting up a backend or want to use the test server, just ping me

rolandgeider avatar Jan 27 '23 12:01 rolandgeider

@rolandgeider when I am running pub get i am getting this error, error is thrown from the l10n folder

Screenshot from 2023-01-27 19-14-37

I am quite new in open source any help would be much appreciated.

Harshit933 avatar Jan 27 '23 13:01 Harshit933

it seems there's something wrong with the translation files, let me take a look

rolandgeider avatar Jan 27 '23 14:01 rolandgeider

Okay, let me know whether should I file this as an issue.

Harshit933 avatar Jan 27 '23 14:01 Harshit933

It seems the placeholders in the translations were translated as well, if you pull from master it should work

rolandgeider avatar Jan 27 '23 14:01 rolandgeider

BTW, you can use this server, just click on custom server in the login screen

https://wger-master.rge.uber.space/ username: user password: flutteruser

(this is reset every 24h so feel free to change things)

rolandgeider avatar Jan 27 '23 14:01 rolandgeider

@rolandgeider There are still some issues. Screenshot from 2023-01-27 21-32-00

Harshit933 avatar Jan 27 '23 16:01 Harshit933

fixed, now the app starts 😇

Just had corrected those three errors from the first screenshot

rolandgeider avatar Jan 27 '23 18:01 rolandgeider

@rolandgeider created my first PR. Review it please.

Harshit933 avatar Jan 27 '23 23:01 Harshit933

Oh I forgot to run test cases on my local system. Can you please help me with the errors i am getting on my local system

Screenshot from 2023-01-29 18-31-13

Harshit933 avatar Jan 29 '23 13:01 Harshit933

that's a bit strange, in my machine only the only test that fails is the same as here on actions with the local preferences and which I still need to fix. Are you using flutter 3.7?

rolandgeider avatar Jan 30 '23 08:01 rolandgeider

yes, i've recently updated to 3.7

Harshit933 avatar Jan 30 '23 11:01 Harshit933

(I just pushed a commit that fixed the failing local preferences test) But I see now that I also get a warning a bout Tapping on a widget, the tests pass though, so everyting should be fine

rolandgeider avatar Jan 30 '23 12:01 rolandgeider

Warning: A call to tap() with finder "exactly one widget with key [<'submit-button'>] (ignoring offstage widgets): ElevatedButton-[<'submit-button'>](dependencies: [MediaQuery, _InheritedTheme, _LocalizationsScope-[GlobalKey#47808]], state: _ButtonStyleState#9ef25)" derived an Offset (Offset(400.0, 244.0)) that would not hit test on the specified widget.
Maybe the widget is actually off-screen, or another widget is obscuring it, or the widget cannot receive pointer events.
The finder corresponds to this RenderBox: RenderSemanticsAnnotations#60240 relayoutBoundary=up7
The hit test result at that offset is: HitTestResult(HitTestEntry<HitTestTarget>#94b29(TextSpan(debugLabel: ((englishLike bodyMedium 2014).merge(blackMountainView bodyMedium)).merge(unknown), inherit: false, color: Color(0xffd32f2f), family: Roboto, size: 14.0, weight: 400, baseline: alphabetic, decoration: TextDecoration.none, "Error: MissingStubError: 'searchExercise'\nNo stub was found which matches the arguments of this method call:\nsearchExercise('exercise', 'en')\n\nAdd a stub for this method using Mockito's 'when' API, or generate the MockExercisesProvider mock with the @GenerateNiceMocks annotation (see https://pub.dev/documentation/mockito/latest/annotations/MockSpec-class.html).")), RenderParagraph#9cd8c@Offset(380.0, 91.0), RenderPadding#73775@Offset(388.0, 99.0), RenderConstrainedBox#9dd85@Offset(388.0, 99.0), _RenderInkFeatures#2468b@Offset(388.0, 99.0), RenderPhysicalModel#dec0b@Offset(388.0, 99.0), _RenderTheatre#efde2@Offset(400.0, 244.0), RenderAbsorbPointer#c7079@Offset(400.0, 244.0), RenderPointerListener#38f11@Offset(400.0, 244.0), RenderSemanticsAnnotations#91fc7@Offset(400.0, 244.0), RenderCustomPaint#2d47a@Offset(400.0, 244.0), RenderSemanticsAnnotations#0ef43@Offset(400.0, 244.0), RenderSemanticsAnnotations#fb9a2@Offset(400.0, 244.0), RenderTapRegionSurface#82d98@Offset(400.0, 244.0), RenderSemanticsAnnotations#45637@Offset(400.0, 244.0), RenderSemanticsAnnotations#09e5e@Offset(400.0, 244.0), RenderSemanticsAnnotations#e6290@Offset(400.0, 244.0), HitTestEntry<HitTestTarget>#28b58(RenderView#70b7c), HitTestEntry<HitTestTarget>#5fbe7(<AutomatedTestWidgetsFlutterBinding>))
#0      WidgetController._getElementPoint (package:flutter_test/src/controller.dart:1280:25)
#1      WidgetController.getCenter (package:flutter_test/src/controller.dart:1163:12)
#2      WidgetController.tap (package:flutter_test/src/controller.dart:504:18)
#3      main.<anonymous closure> (file:///data/entwicklung/wger/flutter/test/workout/workout_set_form_test.dart:98:18)
<asynchronous suspension>

rolandgeider avatar Jan 30 '23 12:01 rolandgeider

Still having the same issue. App is not running on my device. Should I downgrade my flutter version?

Harshit933 avatar Jan 30 '23 12:01 Harshit933

No, I'm using 3.7 as well

rolandgeider avatar Jan 30 '23 12:01 rolandgeider

@rolandgeider seems like I was using a beta version of flutter 3.7, though I have fixed the issue. This is the UI which I have built let me know if any changes needs to be done (also it passes all the test cases). One more thing is that should I make a new pull request or is there any other option to modify the previous PR that i've made.

WhatsApp Image 2023-01-30 at 6 54 19 PM

Screenshot from 2023-01-30 18-54-26

Harshit933 avatar Jan 30 '23 13:01 Harshit933

If you pushed the changes to the same branch, the PR gets updated, no need to close it or anything

rolandgeider avatar Jan 30 '23 13:01 rolandgeider

Great! thanks for the help @rolandgeider.

Harshit933 avatar Jan 30 '23 13:01 Harshit933