Skip to content

Commit

Permalink
Merge branch 'master' into chris/FAL-3921-remove-unpublished-collections
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisChV authored Nov 1, 2024
2 parents 3166da0 + de55da2 commit a4f60b4
Show file tree
Hide file tree
Showing 27 changed files with 1,021 additions and 636 deletions.
4 changes: 1 addition & 3 deletions cms/static/js/factories/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ define([
], function($, CourseDetailsModel, MainView) {
'use strict';

return function(detailsUrl, showMinGradeWarning, showCertificateAvailableDate, upgradeDeadline, useV2CertDisplaySettings) {
return function(detailsUrl, showMinGradeWarning, showCertificateAvailableDate, upgradeDeadline) {
var model;
// highlighting labels when fields are focused in
$('form :input')
Expand All @@ -23,7 +23,6 @@ define([
model = new CourseDetailsModel();
model.urlRoot = detailsUrl;
model.showCertificateAvailableDate = showCertificateAvailableDate;
model.useV2CertDisplaySettings = useV2CertDisplaySettings;
model.set('upgrade_deadline', upgradeDeadline);
model.fetch({
// eslint-disable-next-line no-shadow
Expand All @@ -33,7 +32,6 @@ define([
model: model,
showMinGradeWarning: showMinGradeWarning
});
editor.useV2CertDisplaySettings = useV2CertDisplaySettings;
editor.render();
},
reset: true,
Expand Down
54 changes: 26 additions & 28 deletions cms/static/js/models/settings/course_details.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,35 +84,33 @@ function(Backbone, _, gettext, ValidationHelpers, DateUtils, StringUtils) {
);
}

if (this.useV2CertDisplaySettings) {
if (
newattrs.certificates_display_behavior
&& !(Object.values(CERTIFICATES_DISPLAY_BEHAVIOR_OPTIONS).includes(newattrs.certificates_display_behavior))
) {
errors.certificates_display_behavior = StringUtils.interpolate(
gettext(
'The certificate display behavior must be one of: {behavior_options}'
),
{
behavior_options: Object.values(CERTIFICATES_DISPLAY_BEHAVIOR_OPTIONS).join(', ')
}
);
}
if (
newattrs.certificates_display_behavior
&& !(Object.values(CERTIFICATES_DISPLAY_BEHAVIOR_OPTIONS).includes(newattrs.certificates_display_behavior))
) {
errors.certificates_display_behavior = StringUtils.interpolate(
gettext(
'The certificate display behavior must be one of: {behavior_options}'
),
{
behavior_options: Object.values(CERTIFICATES_DISPLAY_BEHAVIOR_OPTIONS).join(', ')
}
);
}

// Throw error if there's a value for certificate_available_date
if (
(newattrs.certificate_available_date && newattrs.certificates_display_behavior != CERTIFICATES_DISPLAY_BEHAVIOR_OPTIONS.END_WITH_DATE)
|| (!newattrs.certificate_available_date && newattrs.certificates_display_behavior == CERTIFICATES_DISPLAY_BEHAVIOR_OPTIONS.END_WITH_DATE)
) {
errors.certificates_display_behavior = StringUtils.interpolate(
gettext(
'The certificates display behavior must be {valid_option} if certificate available date is set.'
),
{
valid_option: CERTIFICATES_DISPLAY_BEHAVIOR_OPTIONS.END_WITH_DATE
}
);
}
// Throw error if there's a value for certificate_available_date
if (
(newattrs.certificate_available_date && newattrs.certificates_display_behavior != CERTIFICATES_DISPLAY_BEHAVIOR_OPTIONS.END_WITH_DATE)
|| (!newattrs.certificate_available_date && newattrs.certificates_display_behavior == CERTIFICATES_DISPLAY_BEHAVIOR_OPTIONS.END_WITH_DATE)
) {
errors.certificates_display_behavior = StringUtils.interpolate(
gettext(
'The certificates display behavior must be {valid_option} if certificate available date is set.'
),
{
valid_option: CERTIFICATES_DISPLAY_BEHAVIOR_OPTIONS.END_WITH_DATE
}
);
}

if (newattrs.intro_video && newattrs.intro_video !== this.get('intro_video')) {
Expand Down
3 changes: 0 additions & 3 deletions cms/static/js/views/settings/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,6 @@ function(ValidatingView, CodeMirror, _, $, ui, DateUtils, FileUploadModel,
Hides and clears the certificate available date field if a display behavior that doesn't use it is
chosen. Because we are clearing it, toggling back to "end_with_date" will require re-entering the date
*/
if (!this.useV2CertDisplaySettings) {
return;
}
// eslint-disable-next-line prefer-const
let showDatepicker = this.model.get('certificates_display_behavior') == 'end_with_date';
// eslint-disable-next-line prefer-const
Expand Down
2 changes: 0 additions & 2 deletions common/djangoapps/util/tests/test_db.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Tests for util.db module."""

from io import StringIO
import unittest

import ddt
from django.core.management import call_command
Expand Down Expand Up @@ -121,7 +120,6 @@ class MigrationTests(TestCase):
Tests for migrations.
"""

@unittest.skip('Skipping temporarily to drop column in table')
@override_settings(MIGRATION_MODULES={})
def test_migrations_are_in_sync(self):
"""
Expand Down
20 changes: 20 additions & 0 deletions lms/djangoapps/courseware/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3814,6 +3814,26 @@ def test_is_mfe_search_waffle_disabled(self):
self.assertEqual(response.status_code, 200)
self.assertEqual(body, {'enabled': False})

@patch.dict('django.conf.settings.FEATURES', {'COURSEWARE_SEARCH_INCLUSION_DATE': '2020'})
@ddt.data(
(datetime(2013, 9, 18, 11, 30, 00), False),
(None, False),
(datetime(2024, 9, 18, 11, 30, 00), True),
)
@ddt.unpack
def test_inclusion_date_greater_than_course_start(self, start_date, expected_enabled):
course_with_start = CourseFactory.create(start=start_date)
api_url = reverse('courseware_search_enabled_view', kwargs={'course_id': str(course_with_start.id)})

user_staff = UserFactory(is_staff=True)

self.client.login(username=user_staff.username, password=TEST_PASSWORD)
response = self.client.get(api_url, content_type='application/json')
body = json.loads(response.content.decode('utf-8'))

self.assertEqual(response.status_code, 200)
self.assertEqual(body, {'enabled': expected_enabled})


class TestCoursewareMFENavigationSidebarTogglesAPI(SharedModuleStoreTestCase):
"""
Expand Down
7 changes: 7 additions & 0 deletions lms/djangoapps/courseware/views/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2317,6 +2317,13 @@ def courseware_mfe_search_enabled(request, course_id=None):
else:
enabled = True

inclusion_date = settings.FEATURES.get('COURSEWARE_SEARCH_INCLUSION_DATE')
start_date = CourseOverview.get_from_id(course_key).start

# only include courses that have a start date later than the setting-defined inclusion date
if inclusion_date:
enabled = enabled and (start_date and start_date.strftime('%Y-%m-%d') > inclusion_date)

payload = {"enabled": courseware_mfe_search_is_enabled(course_key) if enabled else False}
return JsonResponse(payload)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% for notification_app in email_content %}
<h3 style="font-size: 1.375rem; font-weight:700; line-height:28px; margin: 0.75rem 0 0;">
<h3 style="font-size: 22px; font-weight:700; line-height:28px; margin: 0.75rem 0 0;">
{{ notification_app.title }}
</h3>
{% if notification_app.help_text %}
Expand Down Expand Up @@ -28,16 +28,17 @@ <h3 style="font-size: 1.375rem; font-weight:700; line-height:28px; margin: 0.75r
style="max-height: 28px; max-width: 28px; margin: 0.75rem 1rem 0.75rem 0"
/>
</td>
<td class="notification-content" width="100%" align="left" valign="top" style=" padding: 1rem 1rem 1rem 0.5rem">
<blockquote style="font-size: 0.875rem; font-weight:400; line-height:24px; color:#454545; margin: 0 0 0.5rem 0;">
<td class="notification-content" width="100%" align="left" valign="top" style="padding: 1rem 1rem 1rem 0.5rem;">
<blockquote style="font-size: 14px; font-weight:400; line-height:24px; color:#454545; margin: 0 0 0.5rem 0;">
<style> strong {color: #00262B; font-weight:500} </style>
{{ notification.email_content | truncatechars_html:600 | safe }}
</blockquote>
{% if notification.details %}
<blockquote style="color:#454545; margin: 0 0 0.5rem 0; font-size: 14px; font-style: normal; font-weight: 400; line-height: 24px;">
{{ notification.details | safe }}
</blockquote>
{% endif %}
<blockquote style="color:#707070; margin: 0">
<blockquote style="color:#707070; margin: 0; font-size: 14px; font-style: normal; font-weight: 400; line-height: 24px;">
<span style="float: left">
<span>{{ notification.course_name }}</span>
<span style="padding: 0 0.375rem">{{ "&middot;"|safe }}</span>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<table cellpadding="0" cellspacing="0" style="color:black; font-weight:400; font-size:0.75rem;line-height:20px" width="100%">
<table cellpadding="0" cellspacing="0" style="color:black; font-weight:400; font-size:12px;line-height:20px" width="100%">
<tbody>
<tr>
<td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</tr>
<tr style="height: 20px"></tr>
<tr align="center">
<td style="font-family: Inter; font-size: 32px; font-style: normal; font-weight: 700; line-height: 36px">
<td style="font-family: Inter, Arial, Verdana, sans-serif; font-size: 32px; font-style: normal; font-weight: 700; line-height: 36px">
{{ digest_frequency }} email digest
</td>
</tr>
Expand All @@ -28,7 +28,7 @@
<td
style="
color: #bfc9ca;
font-family: Inter;
font-family: Inter, Arial, Verdana, sans-serif;
font-size: 14px;
font-style: normal;
font-weight: 400;
Expand All @@ -54,7 +54,7 @@
</td>
</tr>
<tr align="center">
<td style="font-weight: 600; font-size: 0.875rem; line-height: 20px; padding: 0">
<td style="font-weight: 600; font-size: 14px; line-height: 20px; padding: 0">
{{update.title}}
</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<div style="margin:0; padding:0; min-width: 100%; background-color:#C9C9C9">
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="line-height:1.5; max-width:600px; font-family:Inter">
<head>
<link href="https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap'" rel="stylesheet" type="text/css">
</head>

<div style="margin:0; padding:0; min-width: 100%; background-color:#C9C9C9; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-smooth: never;">
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="line-height:1.5; max-width:600px; font-family:Inter, Arial, Verdana, sans-serif">
<tbody style="background-color:#f5f5f5">
<tr>
<td>
Expand Down
2 changes: 1 addition & 1 deletion requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ django-storages<1.14.4
# The team that owns this package will manually bump this package rather than having it pulled in automatically.
# This is to allow them to better control its deployment and to do it in a process that works better
# for them.
edx-enterprise==4.30.0
edx-enterprise==4.30.1

# Date: 2024-05-09
# This has to be constrained as well because newer versions of edx-i18n-tools need the
Expand Down
2 changes: 1 addition & 1 deletion requirements/edx/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ edx-drf-extensions==10.5.0
# edx-when
# edxval
# openedx-learning
edx-enterprise==4.30.0
edx-enterprise==4.30.1
# via
# -c requirements/edx/../constraints.txt
# -r requirements/edx/kernel.in
Expand Down
2 changes: 1 addition & 1 deletion requirements/edx/development.txt
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ edx-drf-extensions==10.5.0
# edx-when
# edxval
# openedx-learning
edx-enterprise==4.30.0
edx-enterprise==4.30.1
# via
# -c requirements/edx/../constraints.txt
# -r requirements/edx/doc.txt
Expand Down
2 changes: 1 addition & 1 deletion requirements/edx/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ edx-drf-extensions==10.5.0
# edx-when
# edxval
# openedx-learning
edx-enterprise==4.30.0
edx-enterprise==4.30.1
# via
# -c requirements/edx/../constraints.txt
# -r requirements/edx/base.txt
Expand Down
2 changes: 1 addition & 1 deletion requirements/edx/testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ edx-drf-extensions==10.5.0
# edx-when
# edxval
# openedx-learning
edx-enterprise==4.30.0
edx-enterprise==4.30.1
# via
# -c requirements/edx/../constraints.txt
# -r requirements/edx/base.txt
Expand Down
6 changes: 0 additions & 6 deletions xmodule/assets/HtmlBlockDisplay.scss

This file was deleted.

7 changes: 0 additions & 7 deletions xmodule/assets/HtmlBlockEditor.scss

This file was deleted.

3 changes: 0 additions & 3 deletions xmodule/assets/PollBlockDisplay.scss

This file was deleted.

12 changes: 6 additions & 6 deletions xmodule/assets/editor/_edit.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
@include linear-gradient(top, #d4dee8, #c9d5e2);

position: relative;
padding: ($baseline/4);
padding: calc(var(--baseline)/4);
border-bottom-color: #a5aaaf;

button {
display: inline-block;

@include float(left);

padding: 3px ($baseline/2) 5px;
padding: 3px calc(var(--baseline)/2) 5px;
margin-left: 7px;
border: 0;
border-radius: 2px;
Expand All @@ -53,7 +53,7 @@

li {
@include float(left);
@include margin-right($baseline/4);
@include margin-right(calc(var(--baseline)/4));

&:last-child {
@include margin-right(0);
Expand All @@ -67,16 +67,16 @@
border: 1px solid #a5aaaf;
border-radius: 3px 3px 0 0;

@include linear-gradient(top, $transparent 87%, rgba(0, 0, 0, .06));
@include linear-gradient(top, var(--transparent) 87%, rgba(0, 0, 0, .06));

background-color: #e5ecf3;
font-size: 13px;
color: #3c3c3c;
box-shadow: 1px -1px 1px rgba(0, 0, 0, .05);

&.current {
background: $white;
border-bottom-color: $white;
background: var(--white);
border-bottom-color: var(--white);
}
}
}
Expand Down
Loading

0 comments on commit a4f60b4

Please sign in to comment.