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

[front] feat: add pages Top Videos, For You and Search #1984

Merged
merged 113 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from 94 commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
05afdb5
[front] feat: add pages Top Videos, For You and Search
GresilleSiffle Jun 13, 2024
f7610a9
front: display a friendly "no items" message in FeedForYou.tsx
GresilleSiffle Jun 13, 2024
bc88777
back: add the settings for the front end feed For You
GresilleSiffle Jun 17, 2024
eadd304
front: use the new settings in the feed For You
GresilleSiffle Jun 17, 2024
d317274
front: remove a call to console.log
GresilleSiffle Jun 17, 2024
d9bfa77
front: replace the recommendation fields by For You
GresilleSiffle Jun 17, 2024
9f1982b
front: factorize the code related to the feed For You
GresilleSiffle Jun 17, 2024
e894c6c
Merge branch 'main' into 1983-new_reco_pages
GresilleSiffle Jun 17, 2024
89fc50c
front: update the description of the section For you
GresilleSiffle Jun 17, 2024
1efbbae
front: move the FeedForYou fieldset in the middle of the page Prefere…
GresilleSiffle Jun 17, 2024
4aedde4
Merge branch 'main' into 1983-new_reco_pages
GresilleSiffle Jun 18, 2024
8b618e3
front: add the page For you to the menu
GresilleSiffle Jun 18, 2024
2a6aa18
front: add Top videos to the side bar
GresilleSiffle Jun 18, 2024
ce092f0
front: add a draft of the page Top videos
GresilleSiffle Jun 18, 2024
4c6e1f5
front: add the field topVideosLanguages in the page Preferences
GresilleSiffle Jun 18, 2024
97204d2
front: update translation keys
GresilleSiffle Jun 18, 2024
d30c49a
front: add the setting feed_foryou__languages
GresilleSiffle Jun 19, 2024
d9dded7
front: add fieldset FeedTopItems in settings/preferences
GresilleSiffle Jun 19, 2024
41f23cd
front: rename topVideos -> topItems
GresilleSiffle Jun 19, 2024
9742b6d
front: sidebar item Top videos now uses getFeedTopItemsSearchParams
GresilleSiffle Jun 19, 2024
93b7c7a
front: set the default date of Top items to Month
GresilleSiffle Jun 19, 2024
f157020
front: harmonize func name in userSettings.ts
GresilleSiffle Jun 19, 2024
99ca43d
front: add the search filters to the page Top items
GresilleSiffle Jun 19, 2024
f6418fc
front: use a allow list restrict the number of params in FeedTopItems…
GresilleSiffle Jun 20, 2024
0f20016
front: fix missing translation
GresilleSiffle Jun 20, 2024
45bb4fa
front: add a draft of the search page
GresilleSiffle Jun 20, 2024
95b166c
Merge branch 'main' into 1983-new_reco_pages
GresilleSiffle Jun 24, 2024
3e1a0f1
feat: SearchIconButtonLink now handles search parameters
GresilleSiffle Jun 24, 2024
1edf173
front: FeedForYou displays a link to Search with search params
GresilleSiffle Jun 24, 2024
e07aaca
front: add the back button
GresilleSiffle Jun 24, 2024
5b3efa3
front: do not leak the user's preferences in the URL parameters
GresilleSiffle Jun 25, 2024
1f766c9
front: clear the back button global state when it is unmounted
GresilleSiffle Jun 25, 2024
97e20f9
ext: remove the loading of the legacy recommendationsLanguages storag…
GresilleSiffle Jun 25, 2024
66d4878
front: refactor the language detection (wip)
GresilleSiffle Jun 25, 2024
121448f
front: /recommendations now redirects to /search
GresilleSiffle Jun 26, 2024
c6f7163
front: harmonize default languages initializationg in all feeds
GresilleSiffle Jun 26, 2024
e65d895
front: delete FeedCollectiveRecommendations.tsx and fix TournesolUser…
GresilleSiffle Jun 26, 2024
ff41152
front: delete legacy functions from recommendationsLanguages.ts
GresilleSiffle Jun 26, 2024
524e63f
front: fix most of the failing tests of TournesolUserSettingsForm.spe…
GresilleSiffle Jun 26, 2024
b3946f2
front: fix test App.test.tsx
GresilleSiffle Jun 26, 2024
860f266
Merge branch 'main' into 1983-new_reco_pages
GresilleSiffle Jun 27, 2024
3102f9f
front: remove useless title in VideosPollUserSettingsForm.tsx and upd…
GresilleSiffle Jun 27, 2024
84ad5bd
back: explicitly state that we want to keep the legacy settings
GresilleSiffle Jun 27, 2024
8d86941
tests: add e2e test for the page Top items
GresilleSiffle Jun 27, 2024
f291fce
e2e: add tests for the page For you
GresilleSiffle Jun 27, 2024
7871de0
e2e: add tests related to the action bar in feedForYouPage.cy.ts and …
GresilleSiffle Jun 27, 2024
260e2e7
front: remove useless code in SearchPage.tsx
GresilleSiffle Jun 27, 2024
3b06aa5
tests: more robust tests in feedForYouPage.cy.ts
GresilleSiffle Jun 27, 2024
663da97
tests: fix the preferences page e2e tests
GresilleSiffle Jun 27, 2024
b3264e8
tests: delete obsolete feedRecommendationsPage.cy.ts
GresilleSiffle Jun 27, 2024
52dcf7b
tests: fix the tests of RecommendationPage.tsx
GresilleSiffle Jun 27, 2024
a5e10a1
front: remove extra import
GresilleSiffle Jun 27, 2024
fcbbc98
tests: fix e2e preview
GresilleSiffle Jun 27, 2024
fe2835d
back: add /search to the preview URLs
GresilleSiffle Jul 1, 2024
e890c30
back: add preview of the front end page feed/top
GresilleSiffle Jul 1, 2024
92b073f
back: fix failing tests
GresilleSiffle Jul 1, 2024
6ab87f8
front: fix test TournesolUserSettingsForm.spec.tsx
GresilleSiffle Jul 2, 2024
006ac97
back: fix bad comments in test_user_settings.py
GresilleSiffle Jul 2, 2024
bea77b8
front: BackIconButton can be imported from components/index.ts
GresilleSiffle Jul 2, 2024
38776de
front: update SearchFilter.spec.tsx to test the prop onLanguagesChange
GresilleSiffle Jul 2, 2024
dd87649
ext: use the new setting feed_foryou__languages
GresilleSiffle Jul 2, 2024
7be9dac
front: simplify recommendationsLanguages.ts
GresilleSiffle Jul 2, 2024
e7f6c7b
tests: add missing assertions for the test "Setting - unsafe"
GresilleSiffle Jul 2, 2024
d4fcc07
tests: add missing assertions for the test "Setting - exclude compare…
GresilleSiffle Jul 3, 2024
9f05661
tests: add missing assertion in test "Setting - upload date"
GresilleSiffle Jul 3, 2024
8333af2
front: add subtitles to Top videos, Search and For you
GresilleSiffle Jul 3, 2024
32638a5
front: make the filters open by default in SearchPage
GresilleSiffle Jul 3, 2024
47fad4c
front: add a share button in the feed Top items
GresilleSiffle Jul 3, 2024
c66a308
tests: fix some e2e tests
GresilleSiffle Jul 3, 2024
93454d6
front: add a new PWA entry page
GresilleSiffle Jul 4, 2024
1180029
front: fix the default value feed_foryou__exclude_compared_entities
GresilleSiffle Jul 4, 2024
ec4e8bc
tests: properly delete users in the teardown of the tests
GresilleSiffle Jul 4, 2024
9e401c4
front: fix a bug in buildVideosFeedForYouSearchParams
GresilleSiffle Jul 4, 2024
128787f
front: make TournesolUserSettingsForm.tsx aware of the poll config yt…
GresilleSiffle Jul 4, 2024
494957f
front: fix buildVideosFeedForYouSearchParams not working properly
GresilleSiffle Jul 4, 2024
f7c10a0
front: replace /recommendations by /search
GresilleSiffle Jul 4, 2024
90ceee0
tests: attempt to fix the failing e2e test
GresilleSiffle Jul 4, 2024
b7df70d
Merge branch 'main' into 1983-new_reco_pages
GresilleSiffle Jul 15, 2024
001aae2
front: initialize the state forYouUploadDate with the config in Tourn…
GresilleSiffle Jul 17, 2024
1fd302f
front: handle error during the loading of the feed for you
GresilleSiffle Jul 17, 2024
d01dddc
front: simplify overwriteDateURLParameter
GresilleSiffle Jul 17, 2024
1bfa03f
back: migrate the settings
GresilleSiffle Jul 17, 2024
272d8a1
front: make errors explicit in FeedTopItems.tsx
GresilleSiffle Jul 18, 2024
a2a97af
front: make errors explicit in SearchPage.tsx
GresilleSiffle Jul 18, 2024
e84b415
Merge branch 'main' into 1983-new_reco_pages
GresilleSiffle Aug 7, 2024
ffdeee3
tests: fix the cache problem of the test "handles the value true (exc…
GresilleSiffle Sep 19, 2024
aeb6d54
tests: re-enable the test "handles the value false (include)"
GresilleSiffle Sep 26, 2024
07993e7
Merge branch 'main' into 1983-new_reco_pages
GresilleSiffle Sep 26, 2024
8986354
tests: (attempt) to fix the tests
GresilleSiffle Sep 26, 2024
9ae779a
tests: make the tests wait for the API before trying to perform asser…
GresilleSiffle Sep 26, 2024
0c37963
Merge branch 'main' into 1983-new_reco_pages
GresilleSiffle Oct 31, 2024
c8d84a1
Merge branch 'main' into 1983-new_reco_pages
GresilleSiffle Dec 5, 2024
f4ac456
tests: fix tests related to Filter - upload date
GresilleSiffle Dec 5, 2024
9672396
ext: bump version to 3.7.0
GresilleSiffle Dec 5, 2024
507d619
front: restore deprecated url feed/recommendations for backward compa…
GresilleSiffle Dec 19, 2024
cc6c089
front: simplify data type in ContentHeader.tsx
GresilleSiffle Dec 19, 2024
d2337bc
Update frontend/public/locales/fr/translation.json
GresilleSiffle Dec 19, 2024
28fcd0b
Update frontend/public/locales/fr/translation.json
GresilleSiffle Dec 19, 2024
53c04e6
Update frontend/src/features/settings/preferences/fields/FeedForYouDa…
GresilleSiffle Dec 19, 2024
7d6bf43
back: do no migrate the default_unsafe setting
GresilleSiffle Dec 19, 2024
ab65e38
back: reduce migration memory usage by using .iterator() instead of .…
GresilleSiffle Dec 19, 2024
9ebc727
tests: more explicit test assertions in settingsPreferencesPage.cy.ts
GresilleSiffle Dec 19, 2024
0646878
Update frontend/src/pages/feed/FeedTopItems.tsx
GresilleSiffle Dec 19, 2024
7d286f8
Update frontend/src/pages/search/SearchPage.tsx
GresilleSiffle Dec 19, 2024
80addc9
front: fix language query parem not present in RecommendationsSection…
GresilleSiffle Dec 19, 2024
e415133
front: sync language between RecommendationsSection.tsx and Recommend…
GresilleSiffle Dec 19, 2024
1331217
front: clear backPath & backParam on logout
GresilleSiffle Dec 19, 2024
8c3f5f4
front: do not forward the offset param to the search page (but restor…
GresilleSiffle Dec 19, 2024
d6d35f6
front: more explicit function name in recommendationsLanguages.ts
GresilleSiffle Dec 19, 2024
9535c2d
Merge branch 'main' into 1983-new_reco_pages
GresilleSiffle Dec 19, 2024
b384266
front: update open api schema
GresilleSiffle Dec 19, 2024
daf9560
front: fix initialization of a PaginatedContributorRatingList
GresilleSiffle Dec 19, 2024
b2f3168
front: update obsolete translations
GresilleSiffle Dec 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions backend/core/migrations/0016_migrate_reco_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Generated by Django 4.2.14 on 2024-07-17 12:44

from django.db import migrations


def copy_setting(user, from_key, to_key):
try:
value = user.settings["videos"][from_key]
except KeyError:
return False

user.settings["videos"][to_key] = value
return True


def migrate_reco_settings_forward(apps, schema_editor):
User = apps.get_model("core", "User")
for user in User.objects.all():
if "videos" not in user.settings:
continue

copied = map(
copy_setting,
[user] * 5,
[
"recommendations__default_date",
"recommendations__default_languages",
"recommendations__default_unsafe",
"recommendations__default_exclude_compared_entities",
"recommendations__default_languages",
],
[
"feed_foryou__date",
"feed_foryou__languages",
"feed_foryou__unsafe",
"feed_foryou__exclude_compared_entities",
"feed_topitems__languages",
],
)

if any(list(copied)):
user.save(update_fields=["settings"])


class Migration(migrations.Migration):

dependencies = [
("core", "0015_use_unlogged_cache_table"),
]

operations = [
migrations.RunPython(
code=migrate_reco_settings_forward, reverse_code=migrations.RunPython.noop
),
]
29 changes: 28 additions & 1 deletion backend/core/serializers/user_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ class VideosPollUserSettingsSerializer(GenericPollUserSettingsSerializer):
),
)

# Settings starting with `recommendations__` are deprecated.
#
# They are kept for backward compatibility, mainly for older versions of
# the browser extension. They are replaced by settings dedicated to
# specific recommendation feeds.
recommendations__default_date = serializers.ChoiceField(
choices=DEFAULT_DATE_CHOICES, allow_blank=True, required=False
)
Expand All @@ -103,13 +108,35 @@ class VideosPollUserSettingsSerializer(GenericPollUserSettingsSerializer):
recommendations__default_unsafe = serializers.BooleanField(required=False)
recommendations__default_exclude_compared_entities = serializers.BooleanField(required=False)

def validate_recommendations__default_languages(self, default_languages):
feed_foryou__date = serializers.ChoiceField(
choices=DEFAULT_DATE_CHOICES, allow_blank=True, required=False
)
feed_foryou__languages = serializers.ListField(
child=serializers.CharField(), allow_empty=True, required=False
)
feed_foryou__unsafe = serializers.BooleanField(required=False)
feed_foryou__exclude_compared_entities = serializers.BooleanField(required=False)

feed_topitems__languages = serializers.ListField(
child=serializers.CharField(), allow_empty=True, required=False
)

def _validate_languages(self, default_languages):
for lang in default_languages:
if lang not in ACCEPTED_LANGUAGE_CODES:
raise ValidationError(_("Unknown language code: %(lang)s.") % {"lang": lang})

return default_languages

def validate_recommendations__default_languages(self, default_languages):
return self._validate_languages(default_languages)

def validate_feed_foryou__languages(self, default_languages):
return self._validate_languages(default_languages)

def validate_feed_topitems__languages(self, default_languages):
return self._validate_languages(default_languages)


class TournesolUserSettingsSerializer(serializers.Serializer):
"""
Expand Down
90 changes: 51 additions & 39 deletions backend/core/tests/serializers/test_user_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,57 +107,69 @@ class VideosPollUserSettingsSerializerTestCase(TestCase):
TestCase of the `VideosPollUserSettingsSerializer` serializer.
"""

def test_validate_recommendations__default_languages(self):
def test_validate_feed__languages(self):
"""
The `validate_recommendations__default_languages` setting must raise
The `validate_feed_foryou__languages` setting and similar must raise
an error for unknown languages.
"""

serializer = VideosPollUserSettingsSerializer(
data={"recommendations__default_languages": []}
)
self.assertEqual(serializer.is_valid(), True)
# Also test the deprecated `recommendations__default_languages`
# setting, until its removal.
for setting in [
"feed_foryou__languages",
"feed_topitems__languages",
"recommendations__default_languages"
]:

serializer = VideosPollUserSettingsSerializer(
data={"recommendations__default_languages": ["fr"]}
)
self.assertEqual(serializer.is_valid(), True)
serializer = VideosPollUserSettingsSerializer(
data={setting: []}
)
self.assertEqual(serializer.is_valid(), True)

serializer = VideosPollUserSettingsSerializer(
data={"recommendations__default_languages": ["fr", "en"]}
)
self.assertEqual(serializer.is_valid(), True)
serializer = VideosPollUserSettingsSerializer(
data={setting: ["fr"]}
)
self.assertEqual(serializer.is_valid(), True)

serializer = VideosPollUserSettingsSerializer(
data={"recommendations__default_languages": ["not_a_language"]}
)
self.assertEqual(serializer.is_valid(), False)
self.assertIn("recommendations__default_languages", serializer.errors)
serializer = VideosPollUserSettingsSerializer(
data={setting: ["fr", "en"]}
)
self.assertEqual(serializer.is_valid(), True)

serializer = VideosPollUserSettingsSerializer(
data={"recommendations__default_languages": ["en", "not_a_language"]}
)
self.assertEqual(serializer.is_valid(), False)
self.assertIn("recommendations__default_languages", serializer.errors)
serializer = VideosPollUserSettingsSerializer(
data={setting: ["not_a_language"]}
)
self.assertEqual(serializer.is_valid(), False)
self.assertIn(setting, serializer.errors)

def test_validate_recommendations__default_date(self):
serializer = VideosPollUserSettingsSerializer(
data={setting: ["en", "not_a_language"]}
)
self.assertEqual(serializer.is_valid(), False)
self.assertIn(setting, serializer.errors)

def test_validate_feed_foryou__date(self):
"""
The `validate_recommendations__default_date` setting must accept only
The `validate_feed_foryou__date` setting must accept only
a specific set of date.
"""

for date in ["TODAY", "WEEK", "MONTH", "YEAR", "ALL_TIME"]:
serializer = VideosPollUserSettingsSerializer(
data={"recommendations__default_date": date}
)
self.assertEqual(serializer.is_valid(), True)
# Also test the deprecated `recommendations__default_date`
# setting, until its removal.
for setting in ["feed_foryou__date", "recommendations__default_date"]:

# A blank value means no default date.
serializer = VideosPollUserSettingsSerializer(data={"recommendations__default_date": ""})
self.assertEqual(serializer.is_valid(), True)
for date in ["TODAY", "WEEK", "MONTH", "YEAR", "ALL_TIME"]:
serializer = VideosPollUserSettingsSerializer(
data={setting: date}
)
self.assertEqual(serializer.is_valid(), True)

serializer = VideosPollUserSettingsSerializer(
data={"recommendations__default_date": ["not_a_valid_date"]}
)
self.assertEqual(serializer.is_valid(), False)
self.assertIn("recommendations__default_date", serializer.errors)
# A blank value means no default date.
serializer = VideosPollUserSettingsSerializer(data={setting: ""})
self.assertEqual(serializer.is_valid(), True)

serializer = VideosPollUserSettingsSerializer(
data={setting: ["not_a_valid_date"]}
)
self.assertEqual(serializer.is_valid(), False)
self.assertIn(setting, serializer.errors)
16 changes: 9 additions & 7 deletions backend/core/tests/test_api_user_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ def setUp(self):
"videos": {
"comparison__criteria_order": ["reliability"],
"rate_later__auto_remove": 16,
"recommendation__default_languages": ["en"],
"recommendation__default_date": "Week",
"recommendation__default_unsafe": False,
"feed_foryou__languages": ["en"],
"feed_foryou__date": "Week",
"feed_foryou__unsafe": False,
"feed_topitems__languages": ["en", "fr"],
}
}

Expand Down Expand Up @@ -52,10 +53,11 @@ def test_auth_200_get(self):
"comparison_ui__weekly_collective_goal_mobile": True,
"extension__search_reco": True,
"rate_later__auto_remove": 99,
"recommendations__default_languages": ["en"],
"recommendations__default_date": "WEEK",
"recommendations__default_exclude_compared_entities": False,
"recommendations__default_unsafe": False,
"feed_foryou__languages": ["en"],
"feed_foryou__date": "WEEK",
"feed_foryou__exclude_compared_entities": False,
"feed_foryou__unsafe": False,
"feed_topitems__languages": ["en", "fr"],
},
}
self.user.settings = new_settings
Expand Down
51 changes: 29 additions & 22 deletions backend/tournesol/tests/test_api_preview.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,35 +453,42 @@ def test_anon_200_get_with_yt_connection_error(self):
class DynamicRecommendationsPreviewTestCase(TestCase):
def setUp(self):
self.client = APIClient()
self.preview_url = "/preview/recommendations"
self.preview_internal_url = "/preview/_recommendations"
self.preview_urls = [
"/preview/search",
"/preview/feed/top",
"/preview/recommendations",
]

def test_recommendations_preview_query_redirection(self):
response = self.client.get(f"{self.preview_url}/?language=fr&date=Month")
self.assertEqual(response.status_code, 302)
self.assertRegex(
response.headers["location"],
rf"{self.preview_internal_url}/\?metadata%5Blanguage%5D=fr&date_gte=.*",
)

def test_recommendations_preview_query_redirection_all_languages_filter(self):
response = self.client.get(f"{self.preview_url}/?language=")
self.assertEqual(response.status_code, 302)
# No filter should be present in the redirection
self.assertEqual(response.headers["location"], f"{self.preview_internal_url}/?")

def test_recommendations_preview_empty_fields(self):
response = self.client.get(f"{self.preview_url}/?duration_lte&duration_gte")
self.assertEqual(response.status_code, 302)
self.assertEqual(response.headers["location"], f"{self.preview_internal_url}/?")

def test_recommendations_preview_internal_route(self):
def test_preview_internal_route(self):
response = self.client.get(f"{self.preview_internal_url}/?metadata[language]=fr")
self.assertEqual(response.status_code, 200)
self.assertEqual(response.headers["Content-Type"], "image/jpeg")
self.assertNotIn("Content-Disposition", response.headers)

def test_recommendations_preview_without_tournesol_score(self):
def test_preview_redirection(self):
for url in self.preview_urls:
response = self.client.get(f"{url}/?language=fr&date=Month")
self.assertEqual(response.status_code, 302)
self.assertRegex(
response.headers["location"],
rf"{self.preview_internal_url}/\?metadata%5Blanguage%5D=fr&date_gte=.*",
)

def test_preview_redirection_with_all_languages(self):
for url in self.preview_urls:
response = self.client.get(f"{url}/?language=")
self.assertEqual(response.status_code, 302)
# No filter should be present in the redirection
self.assertEqual(response.headers["location"], f"{self.preview_internal_url}/?")

def test_preview_redirection_with_empty_parameters(self):
for url in self.preview_urls:
response = self.client.get(f"{url}/?duration_lte&duration_gte")
self.assertEqual(response.status_code, 302)
self.assertEqual(response.headers["location"], f"{self.preview_internal_url}/?")

def test_preview_entities_without_tournesol_score(self):
"""
The API shouldn't fail when displaying entities without computed
Tournesol score.
Expand Down
20 changes: 15 additions & 5 deletions backend/tournesol/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
path(
"users/me/suggestions/<str:poll_name>/tocompare/",
SuggestionsToCompare.as_view(),
name="suggestions_me_to_compare"
name="suggestions_me_to_compare",
),
# Sub-samples API
path(
Expand Down Expand Up @@ -228,16 +228,26 @@
DynamicWebsitePreviewFAQ.as_view(),
name="website_preview_faq",
),
# This route show the preview for the recommendations page
# after preview/recommendations route rewrite the url paramaters
# to match backend parameters and redirect
# This route creates the preview of an entity list.
path(
"preview/_recommendations/",
DynamicWebsitePreviewRecommendations.as_view(),
name="website_preview_recommendations_internal",
),
# This route rewrite the url for the recommendations page preview
# These routes rewrite the URL parameters to match those used by the
# recommendations of the polls API.
re_path(
r"^preview/search/?$",
get_preview_recommendations_redirect_params,
name="website_preview_search_redirect",
),
re_path(
r"^preview/feed/top/?$",
get_preview_recommendations_redirect_params,
name="website_preview_feed_topitems_redirect",
),
re_path(
# kept for backward compatibility, replaced by preview/search/
r"^preview/recommendations/?$",
get_preview_recommendations_redirect_params,
name="website_preview_recommendations_redirect",
Expand Down
4 changes: 3 additions & 1 deletion backend/tournesol/views/previews/recommendations.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@
def get_preview_recommendations_redirect_params(request):
"""
Preview of a Recommendations page.
Returns HTTP redirection to transform the query parameters into the format used by the backend.

Returns a HTTP redirection to format the query parameters to match those
used by the polls API.
"""
# pylint: disable=too-many-branches
params = request.GET
Expand Down
2 changes: 1 addition & 1 deletion browser-extension/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tournesol-extension",
"version": "3.6.1",
"version": "3.7.0",
"license": "AGPL-3.0-or-later",
"type": "module",
"scripts": {
Expand Down
5 changes: 1 addition & 4 deletions browser-extension/prepareExtension.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,7 @@ const manifest = {
production: ['https://tournesol.app/*'],
'dev-env': ['http://localhost:3000/*'],
}),
js: [
'fetchTournesolToken.js',
'fetchTournesolRecommendationsLanguages.js',
],
js: ['fetchTournesolToken.js'],
run_at: 'document_end',
all_frames: true,
},
Expand Down
Loading
Loading