-
-
Notifications
You must be signed in to change notification settings - Fork 277
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: Create a screen listing all attributes for a product #4714
feat: Create a screen listing all attributes for a product #4714
Conversation
- resolves: openfoodfacts#4673 - I have just added a simple button in edit product page just to test the new page. It will be removed and added in the paticular screen. - taking `edit_product_page.dart` as a base `product_attribute_page.dart` is designed as suggested by teolemon. - Added all the mentioned section field in the issue.
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.
Hi @Sudhanva-Nadiger, and thank you for your PR!
I have many comments: please have a look at them. And fix the 2 lint check errors, too.
I'll have more comments later, but I need you to refactor the code first.
packages/smooth_app/lib/pages/product/common/product_app_bar.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/product/common/product_app_bar.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/product/common/product_app_bar.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/product/product_attributes_page.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/product/product_attributes_page.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/product/product_attributes_page.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/product/product_attributes_page.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/product/product_attributes_page.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/product/common/product_app_bar.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/product/product_attributes_page.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/product/product_attributes_page.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/product/product_attributes_page.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/product/product_attributes_page.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/product/product_attributes_page.dart
Outdated
Show resolved
Hide resolved
@g123k Next time please don't involve me in an issue if you're already reviewing the PR yourself; I have already enough work to do. |
- created seperte file for `svg_icon.dar` - created newFile for `attribute_first_row_widget.dart` - removed refreshIndicator - useed stringbuffer for string concatenation - fix: linting errors
Oops, I'm really sorry, for me, my comments were complementary to yours. |
Yeah Sure ! I have pushed the new commit ! @g123k
|
- to avoid recalculation on every build
@monsieurtanuki what do you think code wise |
packages/smooth_app/lib/pages/product/product_attributes_page.dart
Outdated
Show resolved
Hide resolved
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.
Hi @Sudhanva-Nadiger!
I'm sorry I couldn't follow your code changes. I'm more available now.
Could you please make sure that the tests are OK: https://github.com/openfoodfacts/smooth-app/actions/runs/6615121230/job/17966602417?pr=4714. That's the first step.
82b5095
to
9253381
Compare
Codecov Report
@@ Coverage Diff @@
## develop #4714 +/- ##
==========================================
- Coverage 9.90% 9.89% -0.01%
==========================================
Files 310 312 +2
Lines 15808 15809 +1
==========================================
- Hits 1566 1565 -1
- Misses 14242 14244 +2
... and 38 files with indirect coverage changes 📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today! |
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.
Thank you for your work!
Unfortunately you've put too much effort on something we actually don't need regarding UI. Please rollback
- edit_product_page.dart
- product_app_bar.dart
- product_attributes_page.dart
while keepingsvg_icon.dart
in a specific file as "not private anymore" (which makes sense).
Please create a new class StringPair
with final String first
and final String? second
fields.
To be used instead of pasting 2 strings with a separator, as luckily we're coding in OOP and not in shell.
Please have a look at my comments for attribute_first_row_widget.dart.
Please create the file attribute_first_row_helper.dart
with
- abstract class
AttributeFirstRowHelper
in it, with methodList<StringPair> getTerms();
- class
AttributeFirstRowSimpleHelper
, that takes anAbstractSimpleInputPageHelper
in the constructor - class
AttributeFirstRowNutritionHelper
, that takes theProduct
in the constructor - class
AttributeFirstRowIngredientsHelper
, that takes theProduct
in the constructor
With that you may say: "hey, we're not displaying anything!". That's correct. We'll deal with that once you're done with my suggestions.
packages/smooth_app/lib/pages/product/attribute_first_row_widget.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/product/attribute_first_row_widget.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/product/attribute_first_row_widget.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/product/attribute_first_row_widget.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/product/attribute_first_row_widget.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/product/attribute_first_row_widget.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/product/attribute_first_row_widget.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/product/attribute_first_row_widget.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/product/attribute_first_row_widget.dart
Outdated
Show resolved
Hide resolved
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.
Thank you @Sudhanva-Nadiger, it's much better now!
My main new comment would be that in AttributeFirstRowHelper
you should add something like that:
Future<void> onTap({
required final BuildContext context,
required final Product product,
})
In addition to that:
- please remove
product_app_bar.dart
- please remove
product_attributes_page.dart
- please rollback
edit_product_page.dart
This PR will focus on building the tools (basically AttributeFirstRowHelper
and AttributeFirstRowWidget
), without display.
If you don't mind once this PR is approved and merged we'll focus on where and when we should display the data.
packages/smooth_app/lib/pages/product/attribute_first_row_widget.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/product/atrribute_first_row_helper.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/product/atrribute_first_row_helper.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/product/attribute_first_row_widget.dart
Outdated
Show resolved
Hide resolved
Ok cool I will do that 👍🏻! |
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.
@Sudhanva-Nadiger We're getting closer!
Please have a look at my comments, and we'll probably be good for an approved PR ;)
packages/smooth_app/lib/pages/product/attribute_first_row_helper.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/product/attribute_first_row_helper.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/product/attribute_first_row_helper.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/pages/product/attribute_first_row_widget.dart
Outdated
Show resolved
Hide resolved
@monsieurtanuki done ! |
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.
Thank you @Sudhanva-Nadiger, that's very good now!
packages/smooth_app/lib/pages/product/attribute_first_row_helper.dart
Outdated
Show resolved
Hide resolved
@g123k Please consider approving this excellent PR, as the merge button is blocked by your long-time-ago change request. |
@g123k I didn't know I had the power to dismiss change requests. Given the context it looked like an appropriate action. |
No problem! |
I havent added the Expand word to the translation ! there is one more pr continuation of this pr i am working on it ! i will add that in the next pr ! |
What
edit_product_page.dart
as a baseproduct_attribute_page.dart
is designed as suggested by teolemon.Screenshot
Part of