Skip to content

[BB-2450] Notice board

Boros Gábor requested to merge 0x29a/bb2450/add_notice_board into master

Created by: 0x29a

This PR adds new page with name Notice Board that contains notifications about deployments and implements list endpoint for Open edX deployments.

Mockup itself: https://app.zeplin.io/project/5de4bac9fca2e1782d7245af/screen/5de4c06d0a6f456dd207ed62

Issue: BB-2450

Screenshots:

Notification expand and collapse:

Peek 2020-07-01 11-19

Different types of notifications:

Screenshot_2020-07-01_11-32-54

Testing Instructions:

  1. Checkout this branch.
  2. Enter new frontend subdirectory: cd frontend
  3. Build Ocim API client: ./scripts/build-api-client.sh
  4. Reinstall dependencies: npm install
  5. Run frontend, npm start.
  6. Go to http://localhost:3000/
  7. Log in as user that have instance and at least one deployment.
  8. You should see, that Status & Notifications navigation link is enabled now: Screenshot_2020-06-15_12-51-46 Click on it, you should see at least one deployment notification.
  9. [optional] To test different types of notifications, consider this change:
diff --git a/registration/api/v2/views.py b/registration/api/v2/views.py
index 2e580b40..527831d9 100644
--- a/registration/api/v2/views.py
+++ b/registration/api/v2/views.py
@@ -211,7 +211,30 @@ class NotificationsViewSet(GenericViewSet):
 
         undeployed_changes = build_instance_config_diff(application)
 
-        notifications = []
+        diff = [
+            ("change", "some_var1", ("test", "test1")),
+            ("change", "theme_config.btn-secondary-bg", ("#000000", "#FFFFFF")),
+            ("add", "theme_config", [("added-bg", "#FFFFFF")]),
+            ("remove", "theme_config", [("removed-bg", "#FFFFFF")]),
+            (
+                "add",
+                "static_content_overrides",
+                [
+                    ("version", 0),
+                    (
+                        "homepage_overlay_html",
+                        "<h1>Welcome to Wonderland</h1><p>It works! Powered by Open edX®</p>",
+                    ),
+                ],
+            ),
+            ("change", "some_dict.version", (0, 1)),
+            ("add", "", [("instance_name", "Wonderland")]),
+            ("remove", "", [("some_var2", "test")]),
+        ]
+        notifications = [
+            {"deployed_changes": diff, "date": application.instance.created, "status": status}
+            for status in DeploymentState
+        ]
         for deployment in deployments:
             deployment_status = deployment.status()
             notifications.append({

Gist with code of endpoint with this change.

Reviewers

Merge request reports