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

feat: allow barcode and edit link in search results #6486

Closed
wants to merge 3 commits into from

Conversation

alexgarel
Copy link
Member

Description

Now in search preferences you can ask to have barcode and to have edit link.
It displays them in search results.

Screenshot

Capture d’écran de 2022-03-14 19-05-36

Then:
Capture d’écran de 2022-03-14 19-08-26

The pen links to edition.

Related issue(s) and discussion

@alexgarel alexgarel requested a review from a team as a code owner March 14, 2022 18:19
@github-actions github-actions bot added Attributes https://wiki.openfoodfacts.org/Product_Attributes CSS Translations We use a non-standard version of GetText, lack language variants support translate.openfoodfacts.org labels Mar 14, 2022
Copy link
Member

@teolemon teolemon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stephanegigandet
Copy link
Contributor

Hi @alexgarel, thanks for adding the possibility to display barcode and an edit button.

I think it would be best not to include in the attributes options that affect only the website behaviour. The Smoothie app for instance is going to get those preferences, even though they won't be meaningful for Smoothie. It may also break some logic for the ranking of products according to attributes.

The best place to add the website preferences would be in the user settings I think. We already have ways to display checkboxes that could be used for this feature. e.g.
image

The drawback is that only logged in users would get those features, but those are contributors features anyway.

Also in the current code, the radio buttons for the normal attributes are not displayed anymore.

Regarding the icons, it would be best to reuse the existing edit icon we have (shown at top of product page) as @teolemon mentions.

For the barcode icon, we use material design icons (or material design like icons), can you use this one, so that we can use it in the same way as the other icons? https://materialdesignicons.com/icon/barcode

@stephanegigandet
Copy link
Contributor

For the name of the section "Search preferences": I would just rename it to "Preferences", those 2 options affect the behaviour of all lists of product pages, not just search results. And later we could add other preferences.

@github-actions github-actions bot added the 🐋 Docker https://docker-curriculum.com/ label Mar 15, 2022
@sonarcloud
Copy link

sonarcloud bot commented Mar 15, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@alexgarel
Copy link
Member Author

  • I would strongly recommend something visually more in line with other icons. The pencil looks like a knife.

    * https://thenounproject.com/search/icons/?iconspage=1&q=barcode
    * https://thenounproject.com/search/icons/?iconspage=1&q=edit
    
    • What about an image of the barcode ?

The problem of nounproject icons is that they are not CC-0 but CC-by.
Or is there a specific page where to put those credits ?

The two icons, I designed myself 😬

@stephanegigandet
Copy link
Contributor

The two icons, I designed myself grimacing

:)

Using Inkscape? For the icons I create, I try to mimmick the Material design icons, with a 24x24 grid.

@alexgarel
Copy link
Member Author

I close this PR, I will do a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Attributes https://wiki.openfoodfacts.org/Product_Attributes CSS 🐋 Docker https://docker-curriculum.com/ Translations We use a non-standard version of GetText, lack language variants support translate.openfoodfacts.org
Projects
None yet
3 participants