-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modular configurable message panel #197
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #197 +/- ##
==========================================
+ Coverage 81.53% 81.95% +0.41%
==========================================
Files 29 31 +2
Lines 390 399 +9
==========================================
+ Hits 318 327 +9
Misses 72 72 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Majority of the duplicated css in the controller index page can be removed but that's all..
@@ -2,3 +2,121 @@ | |||
{% block title %} | |||
Controller | |||
{% endblock title %} | |||
{% block extra_css %} | |||
<style> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the things copied over don't do anything in this context. I've marked those that do, we can remove the rest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of this copied over CSS is what I mentioned in this comment on the PR that introduced it. We should probably find a better way to include it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened #214.
# ALL matches all topics. | ||
"ALL": "^.*$", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this used anywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's used as the default value for topic
in messages.html
main/templates/main/messages.html
Outdated
@@ -0,0 +1,30 @@ | |||
{% load tz %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think this is needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a {% now "e (O)" as server_time %}
that I think needs this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think now
is one of the tags provided by tz
- https://docs.djangoproject.com/en/5.1/topics/i18n/timezones/#template-tags
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing seems to break if I remove it. I'll take it out for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
I'll use this as the starting point for my issues on the controller.
main/templates/main/messages.html
Outdated
@@ -0,0 +1,30 @@ | |||
{% load tz %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a {% now "e (O)" as server_time %}
that I think needs this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me! I have some questions, but it seems to work (I can't fully confirm because I have no ERS messages in my feed)
@@ -2,3 +2,121 @@ | |||
{% block title %} | |||
Controller | |||
{% endblock title %} | |||
{% block extra_css %} | |||
<style> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of this copied over CSS is what I mentioned in this comment on the PR that introduced it. We should probably find a better way to include it.
# ALL matches all topics. | ||
"ALL": "^.*$", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's used as the default value for topic
in messages.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just a missing curly bracket is all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM. I noticed that the decorator I added in #195 is not merged with this, so that would need to be done. MY current work also alters the partials file, so this would need to be updated before I can continue working on my issue.
@AdrianDAlessandro, I added a django command to populate arbitrary messages to arbitrary topics, if you want to have a check. Run it using e.g.: docker compose exec app python manage.py store_message -m "My test message." -t "erskafka-reporting" |
This should be ready to merge whenever you wish to. @Sahil590, I have moved your error wrapper into main/views/utils, and did the same with tests. This is because the message panel (uses the wrapper) is now a main partial. Looks like a big diff, but just file moving. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
Refactors the
messages
partial for use with both process manager and controller. The Kafka topic of messages to be displayed can be set by usingwith
when including the messages partial template -- e.g.{% include "main/messages.html" with topic="PROCMAN" %}
-- using the topic key defined in settings.py.Issues:
Fixes #162
Type of change
Key checklist
python -m pytest
)python -m sphinx -b html docs docs/build
)pre-commit run --all-files
)Further checks