Skip to content
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

Global notifications #970

Merged
merged 5 commits into from
Sep 4, 2023
Merged

Global notifications #970

merged 5 commits into from
Sep 4, 2023

Conversation

cmeessen
Copy link
Contributor

@cmeessen cmeessen commented Aug 28, 2023

Changes proposed in this pull request:

  • administrators can create global notifications via the admin interface, e.g. to notify visitors about upcoming downtimes

How to test:

  • make start to build app and generate test data
  • login as rsd_admin to be able to access admin section
  • navigate to Anouncement section of admin page
  • Fill in info in the form and hit save button
  • Reload RSD to view notification. It will be shown on every page. After using X button it will be hidden. This flag is only in memory and if you reload RSD the notification will appear again.
  • The notification uses warning colors defined in the settings (light theme).

Example admin section

image

Example announcement

image

PR Checklist:

  • Increase version numbers in docker-compose.yml
  • Link to a GitHub issue
  • Update documentation
  • Tests

@dmijatovic dmijatovic force-pushed the maintenance-notice branch 3 times, most recently from c9e98ac to 4d87b72 Compare August 28, 2023 16:55
@dmijatovic dmijatovic marked this pull request as ready for review August 29, 2023 07:45
Copy link
Contributor

@dmijatovic dmijatovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look good as first (minimal) version of the feature.

Copy link
Member

@jmaassen jmaassen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well from a user (admin) perspective.

Copy link
Collaborator

@ewan-escience ewan-escience left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments/suggestions, but non are deal breaking, so let me know if and what you want to do with them.

  1. Since the text is set by admins only, consider removing the 200 char limit.
  2. In the frontend, I cannot fully remove the text, I can only make it invisible, is this intentional?
  3. Consider enforcing allowing only one row to exist in this table, see e.g. 017-create-narcis-table.sql for how to to this, this also allows you to drop the UUID column.

@sonarcloud
Copy link

sonarcloud bot commented Sep 4, 2023

[rsd-database] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@cmeessen
Copy link
Contributor Author

cmeessen commented Sep 4, 2023

@ewan-escience thank you for the suggestions. I applied the database trick which is quite neat. As for the text, I think it does make sense to not be able to completely remove it in the frontend. Otherwise, one might accidentally end up with an empty notification bar.

If there is nothing else, this PR is ready to be merged.

@sonarcloud
Copy link

sonarcloud bot commented Sep 4, 2023

[rsd-frontend] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

48.0% 48.0% Coverage
0.0% 0.0% Duplication

@cmeessen cmeessen merged commit 56634b3 into rsd-v2-release Sep 4, 2023
7 checks passed
@dmijatovic dmijatovic deleted the maintenance-notice branch September 4, 2023 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants