[BB-2450] Notice board
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:
Different types of notifications:
Testing Instructions:
- Checkout this branch.
- Enter new frontend subdirectory:
cd frontend
- Build Ocim API client:
./scripts/build-api-client.sh
- Reinstall dependencies:
npm install
- Run frontend,
npm start
. - Go to
http://localhost:3000/
- Log in as user that have instance and at least one deployment.
- You should see, that
Status & Notifications
navigation link is enabled now:Click on it, you should see at least one deployment notification.
- [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