django-DefectDojo icon indicating copy to clipboard operation
django-DefectDojo copied to clipboard

Global Announcement Banner

Open CharlieSears opened this issue 3 years ago • 3 comments

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 image

Wrapping/long messages image

Correct sizing with minimized left nav image

Correct sizing when "mobile"/small screen width image

Hidden with other 'global' elements on metrics dashboard image

CharlieSears avatar Jan 21 '22 19:01 CharlieSears

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Mar 04 '22 13:03 github-actions[bot]

Conflicts have been resolved. A maintainer will review the pull request shortly.

github-actions[bot] avatar Apr 26 '22 01:04 github-actions[bot]

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Jun 21 '22 15:06 github-actions[bot]

@CharlieSears we like this PR. Are you ready to move it from draft to actual?

devGregA avatar Sep 30 '22 18:09 devGregA

@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.

CharlieSears avatar Oct 26 '22 12:10 CharlieSears

Conflicts have been resolved. A maintainer will review the pull request shortly.

github-actions[bot] avatar Oct 26 '22 12:10 github-actions[bot]

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Oct 27 '22 00:10 github-actions[bot]

~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

CharlieSears avatar Oct 27 '22 00:10 CharlieSears

Conflicts have been resolved. A maintainer will review the pull request shortly.

github-actions[bot] avatar Oct 28 '22 02:10 github-actions[bot]

Happy with the functionality at this point. Going to get some tests thrown together and turn this into a proper PR from draft.

CharlieSears avatar Oct 28 '22 03:10 CharlieSears

Sounds great @CharlieSears !

Maffooch avatar Oct 28 '22 03:10 Maffooch

@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 avatar Nov 20 '22 22:11 Maffooch

@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 :)

CharlieSears avatar Nov 29 '22 15:11 CharlieSears

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.

CharlieSears avatar Jan 19 '23 03:01 CharlieSears

~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

kiblik avatar Jan 19 '23 15:01 kiblik

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Jan 20 '23 18:01 github-actions[bot]

Conflicts have been resolved. A maintainer will review the pull request shortly.

github-actions[bot] avatar Jan 20 '23 21:01 github-actions[bot]

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.

CharlieSears avatar Jan 31 '23 14:01 CharlieSears

Besides my two suggested changes above, everything else looks great!

blakeaowens avatar Feb 06 '23 00:02 blakeaowens

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.

CharlieSears avatar Feb 06 '23 12:02 CharlieSears

@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

CharlieSears avatar Feb 06 '23 14:02 CharlieSears