-
-
Notifications
You must be signed in to change notification settings - Fork 287
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
feat: Add btn to finish adding new product #4706
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #4706 +/- ##
==========================================
- Coverage 9.90% 9.83% -0.08%
==========================================
Files 310 313 +3
Lines 15808 15916 +108
==========================================
- Hits 1566 1565 -1
- Misses 14242 14351 +109
... and 30 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Heyy @WildOrangutan the screenshot looks good to me, why is this Pull Request wip |
@M123-dev it's ready. I marked it as a draft, because you said to wait for the other MR 🙂 I will mark it as ready. |
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.
Heyy @WildOrangutan sorry for the late review, I added a small comment regarding the translation string, otherwise the code looks good to me. Feel free to ping me when its fixed then we can merge before the October ends
OpenFoodAPIConfiguration.globalUser?.userId ?? | ||
localizations.user_profile_title_guest), |
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.
"user_profile_title_guest" will just be Welcome!
The sentence
Thanks for your contribution "welcome!"! doesn't make sense.
I'd suggest to create a new no user string in app_en.arb
Something like
"new_product_done_msg_no_user": "Thanks for your contribution !",
packages/smooth_app/lib/pages/product/add_new_product_page.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/product/add_new_product_page.dart
Outdated
Show resolved
Hide resolved
d72c2d5
to
70cd4a3
Compare
String? _getRegisteredUserName() { | ||
final String? userId = OpenFoodAPIConfiguration.globalUser?.userId; | ||
if (userId == null || userId.toLowerCase().contains('welcome')) { | ||
return null; | ||
} else { | ||
return userId; | ||
} | ||
} |
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.
Any more appropriate place to put this helper function?
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.
Don't think so, we have a similar code for the settings page but its fine to leave it here
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.
Ok will leave it here for now. I guess it could be moved to UserManagementHelper
, so we can remove this duplicate logic.
@M123-dev no worries. I've updated with suggested changes. Please check again. |
String? _getRegisteredUserName() { | ||
final String? userId = OpenFoodAPIConfiguration.globalUser?.userId; | ||
if (userId == null || userId.toLowerCase().contains('welcome')) { | ||
return null; | ||
} else { | ||
return userId; | ||
} | ||
} |
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.
Don't think so, we have a similar code for the settings page but its fine to leave it here
packages/smooth_app/lib/pages/product/add_new_product_page.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/product/add_new_product_page.dart
Outdated
Show resolved
Hide resolved
70cd4a3
to
069fb12
Compare
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.
Perfect, thanks a lot @WildOrangutan
What
Add btn on the end of product page, when adding a new product.
Marking as draft for now - waiting #4698 to merge and resolve conflicts after.
Screenshot
Fixes bug(s)
Fixes #4670