-
-
Notifications
You must be signed in to change notification settings - Fork 383
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: make improvements to org table #10679
feat: make improvements to org table #10679
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10679 +/- ##
==========================================
- Coverage 49.54% 49.22% -0.33%
==========================================
Files 67 77 +10
Lines 20650 22093 +1443
Branches 4980 5277 +297
==========================================
+ Hits 10231 10875 +644
- Misses 9131 9890 +759
- Partials 1288 1328 +40 ☔ View full report in Codecov by Sentry. |
cgi/display_org_table.pl
Outdated
SCRIPTS | ||
; | ||
|
||
$request_ref->{header} .= <<HEADER | ||
<link rel="stylesheet" href="https://static.openfoodfacts.org/js/datatables.min.css"> | ||
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.3.6/css/buttons.dataTables.min.css"> |
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.
Could you create a new version of the datatables.css and so on, which include the buttons? Alternatively, move DataTables to be downloaded from npm
and bundled with webpack
. We should ensure we use a consistent version, and we want to avoid using CDNs our assets.
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.
I'm not sure how to go about this @hangy
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.
@TheSussex When you look at https://github.com/TheSussex/openfoodfacts-server/blob/9e1dd240ce9a1b4e51e7a3dcd8ac6f03aeaaf57b/html/js/datatables.css#L7-L10, you can see that the datatables we currently publish with some specific settings. If you go to that link, you can select the buttons component to be bundled, too. The simplest version would be to simply download the modified CSS and JS files from the datatables site and then replace the ones currently in git.
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.
I did this and it's not showing the column visibility button anymore. Am I supposed to rebuild or what?
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.
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.
I did this and it's not showing the column visibility button anymore. Am I supposed to rebuild or what?
Yes, can you try rebuilding, please? Just the frontend (make front_build
if you're using docker) should be enough.
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.
This did not work @hangy
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.
@hangy @TheSussex I updated the JS files and included the ordering etc. buttons. They were also loaded with a hardcoded path to static.openfoodfacts.org, that's why they were not picked in a local dev environment.
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.
Oh nice. Thanks for the update @stephanegigandet
Quality Gate passedIssues Measures |
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 @TheSussex !
🤖 I have created a release *beep* *boop* --- ## [2.45.0](v2.44.0...v2.45.0) (2024-10-02) ### Features * Add short name, value and evaluation to knowledge panels ([#9683](#9683)) ([bb5c3e2](bb5c3e2)) * enable attributes / personal search on OBF, OPF, OPFF, new config + logos for OPF & OPFF ([#10757](#10757)) ([7e25d9a](7e25d9a)) * make improvements to org table ([#10679](#10679)) ([b0cfea1](b0cfea1)) * Small fixes + improvements ([#10818](#10818)) ([bd91419](bd91419)) ### Bug Fixes * add Moji server IP to rate-limit allow-list ([#10785](#10785)) ([065e0ab](065e0ab)) * add more nutrients to test, to test more things ([#10834](#10834)) ([42b341d](42b341d)) * also check .pot GetText files in addition to .po files ([#10827](#10827)) ([bb87197](bb87197)) * Determine obsolete and deleted from the product revision ([#10791](#10791)) ([508d767](508d767)) * do not localize ecoscore on obf,opf,opff ([#10837](#10837)) ([2f93877](2f93877)) * docs Adding closing ) to generate proper internal link ([#10850](#10850)) ([492d6d9](492d6d9)) * docs Fixed proper denomination of product in query ([#10853](#10853)) ([428dbb3](428dbb3)) * improve OCR JSON generation script ([#10802](#10802)) ([3e8fee7](3e8fee7)) * incorrect self-reference in ingredient.yaml ([#10786](#10786)) ([2757699](2757699)) * indicate some attributes have only mandatory / not_important options ([#10846](#10846)) ([258dc8f](258dc8f)) * invalid type in product_misc.yaml ([#10787](#10787)) ([21920a1](21920a1)) * new mongodb exports for obsolete products collection ([#10794](#10794)) ([c22fc42](c22fc42)) * permissions for check-translations.sh ([#10838](#10838)) ([62e12d6](62e12d6)) * YAML syntax in schema files. ([#10783](#10783)) ([959c74c](959c74c)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
What
templates/web/common/site_layout.tt.html
file to include a link only visible to admins and moderators in the homepage menu, this link leads to the organization table page./cgi/display_org_table.pl
file to persist search queries values in the form after submission.creator
field withcreator_email
Screenshot