From 3eb4e0ce9cebabea5c3162dc761bf462ea6177f5 Mon Sep 17 00:00:00 2001 From: Yusuf Musleh Date: Fri, 15 Sep 2023 18:58:50 +0300 Subject: [PATCH] feat: Update new files notification banner styles (#33197) Uses the updated styles for the notification based on the new designs. Includes a button to open view the files directly in the notification. This also fix a bug where the notification was not appearing when paste a whole Unit. --- .../contentstore/tests/test_contentstore.py | 7 +++- .../views/tests/test_container_page.py | 15 ++++++-- cms/static/js/views/course_outline.js | 27 ++++++++++++--- cms/static/js/views/pages/container.js | 22 ++++++++++-- .../sass/elements/_system-feedback.scss | 34 +++++++++++++++++-- cms/templates/container.html | 6 +++- cms/templates/course_outline.html | 3 +- .../components/views/feedback_notification.js | 2 +- .../components/system-feedback.underscore | 4 +-- 9 files changed, 101 insertions(+), 19 deletions(-) diff --git a/cms/djangoapps/contentstore/tests/test_contentstore.py b/cms/djangoapps/contentstore/tests/test_contentstore.py index 9162598645..1eb7034739 100644 --- a/cms/djangoapps/contentstore/tests/test_contentstore.py +++ b/cms/djangoapps/contentstore/tests/test_contentstore.py @@ -1406,11 +1406,16 @@ class ContentStoreTest(ContentStoreTestCase): self.assertEqual(resp.status_code, 404) return + assets_url = reverse_course_url( + 'assets_handler', + course.location.course_key + ) self.assertContains( resp, - '
'.format( # lint-amnesty, pylint: disable=line-too-long + '
'.format( # lint-amnesty, pylint: disable=line-too-long locator=str(course.location), course_key=str(course.id), + assets_url=assets_url, ), status_code=200, html=True diff --git a/cms/djangoapps/contentstore/views/tests/test_container_page.py b/cms/djangoapps/contentstore/views/tests/test_container_page.py index d3bf988d2a..b78c0cce83 100644 --- a/cms/djangoapps/contentstore/views/tests/test_container_page.py +++ b/cms/djangoapps/contentstore/views/tests/test_container_page.py @@ -9,6 +9,7 @@ from unittest.mock import Mock, patch from django.http import Http404 from django.test.client import RequestFactory +from django.urls import reverse from pytz import UTC from urllib.parse import quote @@ -57,11 +58,16 @@ class ContainerPageTestCase(StudioPageTestCase, LibraryTestCase): self.store.publish(self.vertical.location, self.user.id) def test_container_html(self): + assets_url = reverse( + 'assets_handler', kwargs={'course_key_string': str(self.child_container.location.course_key)} + ) self._test_html_content( self.child_container, expected_section_tag=( '