django-DefectDojo
django-DefectDojo copied to clipboard
Global Announcement Banner
Getting this PR draft started to ensure feedback can be delivered early. This is in response to feedback on: https://github.com/DefectDojo/django-DefectDojo/pull/5648
Goal
Enable administrators to optionally show system-wide notifications to users.
Allow users to dismiss the banner
Functionality should be similar to Jira's implementation of an "announcement banner" that is visible on all pages.
Decisions Made
Please feel free to contradict any of these decisions to ensure the best result.
- Announcement will be displayed beneath and beside navigation components but above page content. This was due to the use of hard-coded locations in sb-admin-2 for the top and left nav components.
- Announcement dismissal state should be stored in the database. This is similar (but inverted) to how alerts are handled now. A UI based approach with cookies or local storage would always have a minor delay that could be jarring to a user to constantly and dramatically pop the announcement in/out. Django should handle what is rendered
- Style should be select-able to influence the gravity of the announcement. Utilized built-in alert-{style} from bootstrap.
Todo
- [x] Basic idea implemented
- [ ] Dismiss-ability should come from Django, JS on page load is too slow and distracting
- [ ] Unit tests
- [ ] Integration tests
UI
Please help me ensure all cases are covered.
Short messages messages
Wrapping/long messages
Correct sizing with minimized left nav
Correct sizing when "mobile"/small screen width
Hidden with other 'global' elements on metrics dashboard
This pull request has conflicts, please resolve those before we can evaluate the pull request.
Conflicts have been resolved. A maintainer will review the pull request shortly.
This pull request has conflicts, please resolve those before we can evaluate the pull request.
@CharlieSears we like this PR. Are you ready to move it from draft to actual?
@devGregA sorry for the late reply. I'll get this up to snuff and a merge prepped. I don't believe I'll have it ready for 2.16.0 given how close that is.
Conflicts have been resolved. A maintainer will review the pull request shortly.
This pull request has conflicts, please resolve those before we can evaluate the pull request.
~I added translations since the initial state of this branch is so old. However there are massive changes in the en django.po file. I'm happy to revert those changes or include them as part of a separate PR if anyone prefers.~
~I simply ran django-admin makemessages -l en
from the ./dojo
folder with [email protected]
~
Edit: Removed
Conflicts have been resolved. A maintainer will review the pull request shortly.
Happy with the functionality at this point. Going to get some tests thrown together and turn this into a proper PR from draft.
Sounds great @CharlieSears !
@CharlieSears just looked through everything since it was marked as ready and all looks great! No changes from me :) I see you've got some empty checkboxes for unit/integration tests. Do you think those would be ready for the 2.17.0 release that is planned for December 7th? If not, I will bump the milestone up
@CharlieSears just looked through everything since it was marked as ready and all looks great! No changes from me :) I see you've got some empty checkboxes for unit/integration tests. Do you think those would be ready for the 2.17.0 release that is planned for December 7th? If not, I will bump the milestone up
@Maffooch , unfortunately not. I'm in the middle of a move and won't have time to complete that. I'll defer to y'all as maintainers. I'm happy to merge this in without and add the tests later, but I'm not a fan of creating something without tests if I can help it :)
Added integration tests, removed unit test task due to minimal business logic which is fully covered by integration tests.
Happy to add them if yall see fit.
~I added translations since the initial state of this branch is so old. However there are massive changes in the en django.po file. I'm happy to revert those changes or include them as part of a separate PR if anyone prefers.~
~I simply ran
django-admin makemessages -l en
from the./dojo
folder with[email protected]
~Edit: Removed
Solution and prevention are coming: https://github.com/DefectDojo/django-DefectDojo/pull/7457
This pull request has conflicts, please resolve those before we can evaluate the pull request.
Conflicts have been resolved. A maintainer will review the pull request shortly.
Going for longest lived branch here but I'm sure I'm not even close 😆
Thank you all for your patience and interest. Excited to get this in and in use.
Besides my two suggested changes above, everything else looks great!
Besides my two suggested changes above, everything else looks great!
Thank you! Not sure how I missed the internationalization tag, added both your suggestions and ~testing locally now with latest from dev
merged~ edit: done.
@Maffooch / @blakeaowens , are either of you able to re-run tests?
Integration tests are passing locally, but getting intermittent failures on test_test and findings_test in the actions. A re-run usually solves things, but I have to wait for an update to dev so I can merge a change and avoid a change for the sake of a change. Plus I'd rather re-run intermittent failures than the whole suite to avoid heating the universe too much haha.
Sorry for re-send