learningequality / kolibri

Kolibri Learning Platform: the offline app for universal education
https://learningequality.org/kolibri/
MIT License
810 stars 684 forks source link

Remove the channel labels from the non-public ContentNode API #12842

Open nucleogenesis opened 1 week ago

nucleogenesis commented 1 week ago

[General guidance: Product issues should describe the feature, but are not actually technically specced for dev work.]

Overview

Following-up from #12759 - there is no longer a need for the ContentNode API to provide a list of labels for the channels as we have removed the ability to select a Channel to search by through the filters interface. The user's search will be filtered instead, automatically, by scoping to the channel (or topic) they're currently in.

Guidance

We need to be sure that the channel labels are still made available through the public API so that older Kolibris which do have the option to search by a particular Channel will not run into any issues.

For searching the user's local Kolibri, however, from here on the labels are unnecessary data and processing.

A good place to start might be:

https://github.com/learningequality/kolibri/blob/458bd6032e918f3b1405a40f83df5893fb7ffaaa/kolibri/core/content/utils/search.py#L140

and the _get_available_channels function there.

Additionally, you'll see that the labels are generated in a method in the OptionalContentNodePagination class:

https://github.com/learningequality/kolibri/blob/458bd6032e918f3b1405a40f83df5893fb7ffaaa/kolibri/core/content/api.py#L841

which is used both in the public and private APIs' pagination_class field.

It could perhaps be as simple as adding a flag use_deprecated_channels_labels=False to that class, then handling the True case within the existing OptionalContentNodePagination class -- then subclassing it and setting that subclass's field to True to pass it into the public content node viewset's pagination_class field.

Acceptance criteria