Skip to content

Commit

Permalink
feat: add enable_pathways field in enterprisecustomer model
Browse files Browse the repository at this point in the history
  • Loading branch information
muhammad-ammar committed Oct 2, 2023
1 parent 1386fde commit 4da232c
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ Change Log
Unreleased
----------

[4.4.0]
-------
feat: Add the ``enable_pathways`` field for EnterpriseCustomer

[4.3.4]
-------
feat: add migrations for Django 4.2
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ upgrade: requirements check_pins ## update the requirements/*.txt files with the
requirements.js: ## install JS requirements for local development
npm ci

requirements: requirements.js ## install development environment requirements
requirements: ## install development environment requirements
pip install -qr requirements/dev.txt --exists-action w
pip-sync requirements/test-master.txt requirements/dev.txt requirements/private.* requirements/test.txt

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.3.4"
__version__ = "4.4.0"
2 changes: 1 addition & 1 deletion enterprise/admin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ class EnterpriseCustomerAdmin(DjangoObjectActions, SimpleHistoryAdmin):
'enable_audit_data_reporting', 'enable_learner_portal_offers',
'enable_executive_education_2U_fulfillment',
'enable_career_engagement_network_on_learner_portal',
'career_engagement_network_message'),
'career_engagement_network_message', 'enable_pathways'),
'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 @@ -405,6 +405,7 @@ class Meta:
"enable_integrated_customer_learner_portal_search",
"enable_career_engagement_network_on_learner_portal",
"career_engagement_network_message",
"enable_pathways",
"enable_analytics_screen",
"enable_portal_reporting_config_screen",
"enable_portal_saml_configuration_screen",
Expand Down
3 changes: 2 additions & 1 deletion enterprise/api/v1/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@ class Meta:
'enable_portal_lms_configurations_screen', 'sender_alias', 'identity_providers',
'enterprise_customer_catalogs', 'reply_to', 'enterprise_notification_banner', 'hide_labor_market_data',
'modified', 'enable_universal_link', 'enable_browse_and_request', 'admin_users',
'enable_career_engagement_network_on_learner_portal', 'career_engagement_network_message'
'enable_career_engagement_network_on_learner_portal', 'career_engagement_network_message',
'enable_pathways'
)

identity_providers = EnterpriseCustomerIdentityProviderSerializer(many=True, read_only=True)
Expand Down
23 changes: 23 additions & 0 deletions enterprise/migrations/0189_auto_20231002_0902.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 3.2.21 on 2023-10-02 09:02

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('enterprise', '0188_alter_learnercreditenterprisecourseenrollment_enterprise_course_enrollment_and_more'),
]

operations = [
migrations.AddField(
model_name='enterprisecustomer',
name='enable_pathways',
field=models.BooleanField(default=True, help_text='If checked, the learners will be able to see the pathways on the learner portal dashboard.', verbose_name='Display pathways screen'),
),
migrations.AddField(
model_name='historicalenterprisecustomer',
name='enable_pathways',
field=models.BooleanField(default=True, help_text='If checked, the learners will be able to see the pathways on the learner portal dashboard.', verbose_name='Display pathways screen'),
),
]
8 changes: 8 additions & 0 deletions enterprise/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,14 @@ class Meta:
)
)

enable_pathways = models.BooleanField(
verbose_name="Display pathways screen",
default=True,
help_text=_(
"If checked, the learners will be able to see the pathways on the learner portal dashboard."
)
)

enable_analytics_screen = models.BooleanField(
verbose_name="Display analytics page",
default=True,
Expand Down
5 changes: 5 additions & 0 deletions tests/test_enterprise/api/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1194,6 +1194,7 @@ class TestEnterpriseCustomerViewSet(BaseTestEnterpriseAPIViews):
'admin_users': [],
'enable_generation_of_api_credentials': False,
'career_engagement_network_message': 'Test message',
'enable_pathways': True,
}],
),
(
Expand Down Expand Up @@ -1249,6 +1250,7 @@ class TestEnterpriseCustomerViewSet(BaseTestEnterpriseAPIViews):
'admin_users': [],
'enable_generation_of_api_credentials': False,
'career_engagement_network_message': 'Test message',
'enable_pathways': True,
},
'active': True, 'user_id': 0, 'user': None,
'data_sharing_consent_records': [], 'groups': [],
Expand Down Expand Up @@ -1336,6 +1338,7 @@ class TestEnterpriseCustomerViewSet(BaseTestEnterpriseAPIViews):
'admin_users': [],
'enable_generation_of_api_credentials': False,
'career_engagement_network_message': 'Test message',
'enable_pathways': True,
}],
),
(
Expand Down Expand Up @@ -1399,6 +1402,7 @@ class TestEnterpriseCustomerViewSet(BaseTestEnterpriseAPIViews):
'admin_users': [],
'enable_generation_of_api_credentials': False,
'career_engagement_network_message': 'Test message',
'enable_pathways': True,
}],
),
(
Expand Down Expand Up @@ -1633,6 +1637,7 @@ def test_enterprise_customer_with_access_to(
'admin_users': [],
'enable_generation_of_api_credentials': False,
'career_engagement_network_message': 'Test message',
'enable_pathways': True,
}
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 @@ -173,6 +173,7 @@ def setUp(self):
"enable_generation_of_api_credentials",
"career_engagement_network_message",
"sso_orchestration_records",
"enable_pathways"
]
),
(
Expand Down

0 comments on commit 4da232c

Please sign in to comment.