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

Add contribution counts #2973

Closed
1 task
teolemon opened this issue Sep 8, 2022 · 21 comments
Closed
1 task

Add contribution counts #2973

teolemon opened this issue Sep 8, 2022 · 21 comments
Assignees
Labels
🐛 bug Something isn't working gamification good first issue Good for newcomers P3

Comments

@teolemon
Copy link
Member

teolemon commented Sep 8, 2022

What

Part of

@teolemon teolemon added 🐛 bug Something isn't working good first issue Good for newcomers labels Sep 8, 2022
@teolemon teolemon changed the title Add contributor count (Grace Hopper) Add contributor count Sep 18, 2022
@AshAman999 AshAman999 changed the title Add contributor count Add contribution counts Sep 20, 2022
@prathamsoni11
Copy link
Contributor

I want to work on this issue but I need some help.

@VaiTon
Copy link
Member

VaiTon commented Oct 10, 2022

Hey @prathamsoni11! I think we first need to wait for the SDK to allow fetching the contribution counts. Then we can implement the UI for it.

@monsieurtanuki
Copy link
Contributor

@VaiTon @prathamsoni11 Actually we don't need to wait, we can already compute the contribution count with a method like that:

    /// Returns the number of contributions of a [type] by a [userId].
    Future<int?> _getMyCount(
      final String userId,
      final UserProductSearchType type,
      final OpenFoodFactsLanguage language,
    ) async {
      final UserProductSearchQueryConfiguration configuration =
          UserProductSearchQueryConfiguration(
        type: type,
        userId: userId,
        pageSize: 1,
        language: language,
        fields: [],
      );

      final SearchResult result;
      try {
        result = await OpenFoodAPIClient.searchProducts(
          OpenFoodAPIConfiguration.globalUser,
          configuration,
          queryType: OpenFoodAPIConfiguration.globalQueryType,
        );
      } catch (e) {
        return null;
      }
      return result.count;
    }

@prathamsoni11
Copy link
Contributor

Can we show a dialogue box for the contribution count for this?

@teolemon
Copy link
Member Author

Screenshot_20221028-075425.png

@teolemon
Copy link
Member Author

Inline here ?

@prathamsoni11
Copy link
Contributor

Inline here ?

Yes, In this section I think so?

@prathamsoni11
Copy link
Contributor

prathamsoni11 commented Oct 28, 2022

Or we can add it under username like a subtitle in AppBar section

@teolemon
Copy link
Member Author

Screenshot_20221028-082505.png

@teolemon
Copy link
Member Author

We have at least 3 to display

@prathamsoni11
Copy link
Contributor

We have at least 3 to display

Should we display these 3 in their section only in AppBar like a subtitle?

@prathamsoni11
Copy link
Contributor

We have at least 3 to display

Should we display these 3 in their section only in AppBar like a subtitle?

@teolemon I tried this but it is not looking good. Should we go for a dialogue box for all 3?

@teolemon
Copy link
Member Author

I think simply showing within the view, above the items would be good, and that was the intent of my screenshot, which I realize was ambiguous.

@prathamsoni11
Copy link
Contributor

I think simply showing the within the view, above the items would be good, and that was the intent of my screenshot, which I realize was ambiguous.

ok, now I understand. Sorry, I thought you were asking for a suggestion it's my bad that I didn't understand.
ok it will be implemented above the items.

@prathamsoni11
Copy link
Contributor

Something like this?

@M123-dev
Copy link
Member

M123-dev commented Nov 2, 2022

Heyy, looks good to me, we have no mockup of a Design so this is good

But we now have the "edited products" and "Products I photographed" section twice
Lets put the count in the same widget as the buttons

@prathamsoni11
Copy link
Contributor

Heyy, looks good to me, we have no mockup of a Design so this is good

But we now have the "edited products" and "Products I photographed" section twice
Lets put the count in the same widget as the buttons

As a trailing or subtitle??

@M123-dev
Copy link
Member

M123-dev commented Nov 3, 2022

Trailing is good 👍🏻

@prathamsoni11
Copy link
Contributor

@M123-dev Done with the final implementation. Please have a look to

@M123-dev
Copy link
Member

M123-dev commented Nov 4, 2022

Look great

@monsieurtanuki
Copy link
Contributor

Fixed by #3267.

Repository owner moved this from To discuss and validate to Done in 🤳🥫 The Open Food Facts mobile app (Android & iOS) Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working gamification good first issue Good for newcomers P3
Development

No branches or pull requests

5 participants