From 160b792a6f3c935f8ab4132bc37937201bae7195 Mon Sep 17 00:00:00 2001 From: Charles Nepote Date: Mon, 9 Sep 2024 11:54:26 +0200 Subject: [PATCH] feat: Open folksonomies for all connected users (#10771) Fix https://github.com/openfoodfacts/openfoodfacts-server/issues/10360 Will make some issues more annoying: * https://github.com/openfoodfacts/folksonomy_api/issues/128 * https://github.com/openfoodfacts/openfoodfacts-server/issues/6169 --------- Co-authored-by: Open Food Facts Bot --- html/js/folksonomy.js | 4 +++- templates/web/common/includes/folksonomy_script.tt.html | 4 ++-- .../page_crawler/crawler-access-product-page.html | 1 + .../page_crawler/normal-user-access-product-page.html | 1 + .../product_read/get-existing-product.html | 1 + .../expected_test_results/web_html/fr-product-2.html | 1 + .../expected_test_results/web_html/fr-product.html | 1 + .../expected_test_results/web_html/world-product.html | 1 + 8 files changed, 11 insertions(+), 3 deletions(-) diff --git a/html/js/folksonomy.js b/html/js/folksonomy.js index 644e9d9fe8df4..851466bcd4d8c 100644 --- a/html/js/folksonomy.js +++ b/html/js/folksonomy.js @@ -155,8 +155,10 @@ function displayFolksonomyPropertyValues() { '

Personalized properties (beta)

' + '

' + "

These properties are created and filed by users for any kind of usages. Feel free to add your own. " + + "The properties and values you create must be factual. " + "You can dive into the list of properties already used by the community " + - "or explore the properties' documentation and its search engine.

" + + "or explore the properties' documentation and its search engine. " + + "

" + "

Be aware the data model might be modified. Use at your own risk.

" + "

This is brought by the folksonomy engine project. Don't hesitate to participate or give feedback.

" + '
' + diff --git a/templates/web/common/includes/folksonomy_script.tt.html b/templates/web/common/includes/folksonomy_script.tt.html index d55da2a904650..c6fa84a21c107 100644 --- a/templates/web/common/includes/folksonomy_script.tt.html +++ b/templates/web/common/includes/folksonomy_script.tt.html @@ -1,5 +1,5 @@ -[% IF moderator %] +[% IF user_id.defined %] @@ -8,4 +8,4 @@ folskonomy_engine_init(); [% END %] - \ No newline at end of file + diff --git a/tests/integration/expected_test_results/page_crawler/crawler-access-product-page.html b/tests/integration/expected_test_results/page_crawler/crawler-access-product-page.html index a0e259e3ae304..6e2c061a3caca 100644 --- a/tests/integration/expected_test_results/page_crawler/crawler-access-product-page.html +++ b/tests/integration/expected_test_results/page_crawler/crawler-access-product-page.html @@ -3569,6 +3569,7 @@

Data sources

+ diff --git a/tests/integration/expected_test_results/page_crawler/normal-user-access-product-page.html b/tests/integration/expected_test_results/page_crawler/normal-user-access-product-page.html index a0e259e3ae304..6e2c061a3caca 100644 --- a/tests/integration/expected_test_results/page_crawler/normal-user-access-product-page.html +++ b/tests/integration/expected_test_results/page_crawler/normal-user-access-product-page.html @@ -3569,6 +3569,7 @@

Data sources

+ diff --git a/tests/integration/expected_test_results/product_read/get-existing-product.html b/tests/integration/expected_test_results/product_read/get-existing-product.html index 1885df42bc7b0..cfd4bb8d0bc60 100644 --- a/tests/integration/expected_test_results/product_read/get-existing-product.html +++ b/tests/integration/expected_test_results/product_read/get-existing-product.html @@ -4730,6 +4730,7 @@

Data sources

+ diff --git a/tests/integration/expected_test_results/web_html/fr-product-2.html b/tests/integration/expected_test_results/web_html/fr-product-2.html index 293550ba10ce7..e8bf1b8985fec 100644 --- a/tests/integration/expected_test_results/web_html/fr-product-2.html +++ b/tests/integration/expected_test_results/web_html/fr-product-2.html @@ -3789,6 +3789,7 @@

Sources de données

+ diff --git a/tests/integration/expected_test_results/web_html/fr-product.html b/tests/integration/expected_test_results/web_html/fr-product.html index a2c5ae6885e11..ea584abaf73ca 100644 --- a/tests/integration/expected_test_results/web_html/fr-product.html +++ b/tests/integration/expected_test_results/web_html/fr-product.html @@ -3803,6 +3803,7 @@

Sources de données

+ diff --git a/tests/integration/expected_test_results/web_html/world-product.html b/tests/integration/expected_test_results/web_html/world-product.html index 539296c2f4bb3..c8d4f82320cf5 100644 --- a/tests/integration/expected_test_results/web_html/world-product.html +++ b/tests/integration/expected_test_results/web_html/world-product.html @@ -4300,6 +4300,7 @@

Data sources

+