-
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
Kafka message sidebar panel #109
Conversation
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.
I'd suggest we add Prettier code formatter to VScode and the following lines to the settings - for those using it.
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
And also to think on a pre-commit hook for HTML. Now that we have more "complex" HTML, we need to worry about its format as well.
main/templates/main/base.html
Outdated
@@ -8,6 +8,7 @@ | |||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |||
{% bootstrap_css %} | |||
{% bootstrap_javascript %} | |||
{% block extra_css %}{% endblock %} |
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.
Why do we need this empty extra css block here?
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 is where I injected the custom CSS into the head in the index template. The contents of extra_css
in index.html are substituted into extra_css
in the <main>
section of base.html.
Not sure if there's a more proper way to do it.
Oopp. I think |
main/templates/main/base.html
Outdated
{% load static %} | ||
{% load django_bootstrap5 %} | ||
<!DOCTYPE html> | ||
{% load static %} {% load django_bootstrap5 %} |
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'd suggest to revert running prettrier and add a few tags to tell it to ignore some parts. This headers just look much better if each is int its line. So, leave this as:
{% load static %} {% load django_bootstrap5 %} | |
<!-- prettier-ignore --> | |
{% load static %} | |
{% load django_bootstrap5 %} |
And the same with the other HTML files. These {%...
lines are just not understood by prettier as HTML because they are django stuff. Check this commit in Paricia where I've done the change and avoided the reformatting of the django tags.
The I'm wondering whether I should revive it though... Don't think it would take much work and I do like the results better than the other hooks. Maybe could be a Hacktoberfest project? |
This reverts commit 170eaef.
prettier-plugin-jinja-template looks like it may have the same problem in reverse, where style tags must be ignored. I'll try out djLint. If not I'll just use ignores as in @dalonsoa's comment. For now it's reverted. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #109 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 5 5
Lines 44 44
=========================================
Hits 44 44 ☔ 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.
LGTM 👍
Playing around with djLint and the layout is not bad. Had to add some extra stuff to keep it happy, such as meta fields. A couple of nags I hid for now:
One final note to factor in is the repo doesn't look especially busy. |
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.
Good stuff. I like having linting for the templates is a real step forward. I had a play and that orphaned tag one is caused by that stray comma in the form tag.
Curious what others think but because the nature of html leads to lots of indentation I'd prefer to just use 2 spaces instead of 4.
Otherwise this looks like a good first stab at the layout.
Stray comma gone. I went ahead and turn indentation down to 2 also. |
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.
Nice. I'm afraid the pedant in me can't help but suggest that it would be slightly nicer to put the indent config in pyproject.toml. In case anyone wants to run it outside of pre-commit.
All good. Will wait a bit and merge later in case someone else wants a looksee. |
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 - and have stolen the djlint stuff for Paricia :)
Description
Adds a panel on the right to display Kafka messages.
Messages are scrollable when they won't fit.
I wasn't able to reliably set
max-size
to something that fits the window, so I just set it to 85% viewport height. I think the issue is the main container, which includes the main table, does not yet have its height fixed, so I cannot inherit it's max height minus top bars, padding, etcetera. Is this something you want tackled now, or later?Else all good to go.
Fixes #92
Type of change
Key checklist
python -m pytest
)python -m sphinx -b html docs docs/build
)pre-commit run --all-files
)Further checks