Skip to content

Commit

Permalink
Merge pull request #2141 from openedx/eahmadjaved/ENT-8967
Browse files Browse the repository at this point in the history
feat: Added a new field show_videos_in_learner_portal_search_results …
  • Loading branch information
jajjibhai008 authored Jun 13, 2024
2 parents 958e932 + 27c974d commit 4f95649
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ Unreleased
----------
* nothing unreleased

[4.20.0]
---------
* feat: Added a new field show_videos_in_learner_portal_search_results in the EnterpriseCustomer model.

[4.19.17]
---------
* feat: Adds new fields enable_learner_portal_sidebar_message and learner_portal_sidebar_content in EnterpriseCustomer.
Expand Down
2 changes: 1 addition & 1 deletion enterprise/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
Your project description goes here.
"""

__version__ = "4.19.17"
__version__ = "4.20.0"
3 changes: 2 additions & 1 deletion enterprise/admin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ class EnterpriseCustomerAdmin(DjangoObjectActions, SimpleHistoryAdmin):
'enable_executive_education_2U_fulfillment',
'enable_career_engagement_network_on_learner_portal',
'career_engagement_network_message', 'enable_pathways', 'enable_programs',
'enable_demo_data_for_analytics_and_lpr', 'enable_academies', 'enable_one_academy'),
'enable_demo_data_for_analytics_and_lpr', 'enable_academies', 'enable_one_academy',
'show_videos_in_learner_portal_search_results'),
'description': ('The following default settings should be the same for '
'the majority of enterprise customers, '
'and are either rarely used, unlikely to be sold, '
Expand Down
1 change: 1 addition & 0 deletions enterprise/admin/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ class Meta:
"enable_universal_link",
"enable_browse_and_request",
"enable_slug_login",
"show_videos_in_learner_portal_search_results",
"contact_email",
"default_contract_discount",
"default_language",
Expand Down
2 changes: 1 addition & 1 deletion enterprise/api/v1/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ class Meta:
'modified', 'enable_universal_link', 'enable_browse_and_request', 'admin_users',
'enable_career_engagement_network_on_learner_portal', 'career_engagement_network_message',
'enable_pathways', 'enable_programs', 'enable_demo_data_for_analytics_and_lpr', 'enable_academies',
'enable_one_academy', 'active_integrations',
'enable_one_academy', 'active_integrations', 'show_videos_in_learner_portal_search_results',
)

identity_providers = EnterpriseCustomerIdentityProviderSerializer(many=True, read_only=True)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 4.2.13 on 2024-06-12 07:54

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('enterprise', '0210_enterprisecustomer_enable_learner_portal_sidebar_message_and_more'),
]

operations = [
migrations.AddField(
model_name='enterprisecustomer',
name='show_videos_in_learner_portal_search_results',
field=models.BooleanField(default=False, help_text='If checked, videos will be displayed in the search results on the learner portal.', verbose_name='Show videos in learner portal search results'),
),
migrations.AddField(
model_name='historicalenterprisecustomer',
name='show_videos_in_learner_portal_search_results',
field=models.BooleanField(default=False, help_text='If checked, videos will be displayed in the search results on the learner portal.', verbose_name='Show videos in learner portal search results'),
),
]
6 changes: 6 additions & 0 deletions enterprise/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,12 @@ class Meta:
)
)

show_videos_in_learner_portal_search_results = models.BooleanField(
verbose_name="Show videos in learner portal search results",
default=False,
help_text=_("If checked, videos will be displayed in the search results on the learner portal.")
)

enable_analytics_screen = models.BooleanField(
verbose_name="Display analytics page",
default=True,
Expand Down
8 changes: 7 additions & 1 deletion tests/test_enterprise/api/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1449,6 +1449,7 @@ class TestEnterpriseCustomerViewSet(BaseTestEnterpriseAPIViews):
'enable_academies': False,
'enable_one_academy': False,
'active_integrations': [],
'show_videos_in_learner_portal_search_results': False,
}],
),
(
Expand Down Expand Up @@ -1511,6 +1512,7 @@ class TestEnterpriseCustomerViewSet(BaseTestEnterpriseAPIViews):
'enable_academies': False,
'enable_one_academy': False,
'active_integrations': [],
'show_videos_in_learner_portal_search_results': False,
},
'enterprise_group': [],
'active': True, 'user_id': 0, 'user': None,
Expand Down Expand Up @@ -1611,6 +1613,7 @@ class TestEnterpriseCustomerViewSet(BaseTestEnterpriseAPIViews):
'enable_academies': False,
'enable_one_academy': False,
'active_integrations': [],
'show_videos_in_learner_portal_search_results': False,
}],
),
(
Expand Down Expand Up @@ -1681,6 +1684,7 @@ class TestEnterpriseCustomerViewSet(BaseTestEnterpriseAPIViews):
'enable_academies': False,
'enable_one_academy': False,
'active_integrations': [],
'show_videos_in_learner_portal_search_results': False,
}],
),
(
Expand Down Expand Up @@ -1777,7 +1781,8 @@ class TestEnterpriseCustomerViewSet(BaseTestEnterpriseAPIViews):
'enable_demo_data_for_analytics_and_lpr': False,
'enable_academies': False,
'enable_one_academy': False,
'active_integrations': ['BLACKBOARD']
'active_integrations': ['BLACKBOARD'],
'show_videos_in_learner_portal_search_results': False
}],
),
)
Expand Down Expand Up @@ -2020,6 +2025,7 @@ def test_enterprise_customer_with_access_to(
'enable_academies': False,
'enable_one_academy': False,
'active_integrations': [],
'show_videos_in_learner_portal_search_results': False,
}
else:
mock_empty_200_success_response = {
Expand Down
1 change: 1 addition & 0 deletions tests/test_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ def setUp(self):
"enable_demo_data_for_analytics_and_lpr",
"enable_academies",
"enable_one_academy",
"show_videos_in_learner_portal_search_results",
"groups",
]
),
Expand Down

0 comments on commit 4f95649

Please sign in to comment.