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

SIMSBIOHUB-620: Manage System Alerts #1401

Merged
merged 22 commits into from
Nov 15, 2024
Merged

SIMSBIOHUB-620: Manage System Alerts #1401

merged 22 commits into from
Nov 15, 2024

Conversation

mauberti-bc
Copy link
Collaborator

@mauberti-bc mauberti-bc commented Oct 18, 2024

Links to Jira Tickets

Description of Changes

  • Adds the ability for system admins to create Alerts that all users see
  • Displays alerts on relevant pages, with each page requesting only relevant alerts (eg. alerts of type "Survey" for Survey page)
  • Repurposes Manage Users page to generic Admin page with controls for managing users and alerts
  • Adds system alerts to the database seeds

Testing Notes

  • Should be able to create, edit and delete alerts
  • Alerts should only display on the appropriate pages (eg. General on the Survey page)

@mauberti-bc mauberti-bc added the Early Feedback Welcome PR is not finished, but early review feedback is welcomed label Oct 18, 2024
@mauberti-bc mauberti-bc added Ready For Review PR is ready for review and removed Early Feedback Welcome PR is not finished, but early review feedback is welcomed labels Oct 31, 2024
Copy link

codecov bot commented Oct 31, 2024

Codecov Report

Attention: Patch coverage is 43.00254% with 224 lines in your changes missing coverage. Please review.

Project coverage is 45.43%. Comparing base (365ce92) to head (2aab4c8).
Report is 1 commits behind head on dev.

Files with missing lines Patch % Lines
app/src/features/admin/alert/edit/EditAlert.tsx 0.00% 30 Missing ⚠️
...pp/src/features/admin/alert/create/CreateAlert.tsx 0.00% 26 Missing ⚠️
app/src/features/admin/alert/AlertContainer.tsx 0.00% 25 Missing ⚠️
...pp/src/features/admin/alert/delete/DeleteAlert.tsx 0.00% 25 Missing ⚠️
app/src/hooks/api/useAlertApi.ts 5.26% 18 Missing ⚠️
app/src/features/admin/AdminManagePage.tsx 0.00% 17 Missing ⚠️
...pp/src/features/alert/banner/SystemAlertBanner.tsx 44.82% 15 Missing and 1 partial ⚠️
app/src/features/admin/alert/table/AlertTable.tsx 0.00% 12 Missing ⚠️
...n/alert/table/components/AlertTableActionsMenu.tsx 0.00% 12 Missing ⚠️
api/src/repositories/alert-repository.ts 74.35% 6 Missing and 4 partials ⚠️
... and 11 more
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1401      +/-   ##
==========================================
- Coverage   45.70%   45.43%   -0.28%     
==========================================
  Files         802      817      +15     
  Lines       21650    21973     +323     
  Branches     3248     3270      +22     
==========================================
+ Hits         9895     9983      +88     
- Misses      11166    11395     +229     
- Partials      589      595       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mauberti-bc mauberti-bc removed the Ready For Review PR is ready for review label Oct 31, 2024
@mauberti-bc mauberti-bc added the Ready For Review PR is ready for review label Oct 31, 2024
@mauberti-bc mauberti-bc marked this pull request as ready for review October 31, 2024 23:44
@NickPhura NickPhura marked this pull request as draft November 8, 2024 17:17
@NickPhura
Copy link
Collaborator

Converting to draft temporarily to save Openshift resources.

api/src/paths/alert/{alertId}/index.ts Outdated Show resolved Hide resolved
api/src/paths/alert/{alertId}/index.ts Outdated Show resolved Hide resolved
api/src/paths/alert/{alertId}/index.ts Outdated Show resolved Hide resolved
api/src/paths/alert/{alertId}/index.ts Outdated Show resolved Hide resolved
api/src/paths/alert/{alertId}/index.ts Show resolved Hide resolved
api/src/repositories/alert-repository.ts Outdated Show resolved Hide resolved
api/src/services/alert-service.ts Outdated Show resolved Hide resolved
@NickPhura
Copy link
Collaborator

NickPhura commented Nov 13, 2024

@mauberti-bc Really slick in general, nice work! I like the way the alerts are displayed in the admin page and form (with the preview).

2 things I noticed when adding/editing/deleting alerts in the UI:

  • The alert name has a max length of 50 in the UI, but max length of 100 in the database. Not a major issue, but maybe they were both meant to be 50 or 100?
  • When I edit an alert, if I clear the expiration date, I can't save (I get an 'Invalid date' error).

Regarding CSS:
Also, was dabbling with some CSS tweaks, if you're interested. Just on my local.

@NickPhura NickPhura marked this pull request as ready for review November 13, 2024 00:42
@mauberti-bc
Copy link
Collaborator Author

@mauberti-bc Really slick in general, nice work! I like the way the alerts are displayed in the admin page and form (with the preview).

2 things I noticed when adding/editing/deleting alerts in the UI:

* The alert name has a max length of 50 in the UI, but max length of 100 in the database. Not a major issue, but maybe they were both meant to be 50 or 100?

* When I edit an alert, if I clear the expiration date, I can't save (I get an 'Invalid date' error).

Regarding CSS: Also, was dabbling with some CSS tweaks, if you're interested. Just on my local.

Fixed the bug preventing end dates from being removed by updating the DateField component to correctly catch invalid dates. Also changed the max length of alert name to 50 in the database.

Copy link
Collaborator

@NickPhura NickPhura left a comment

Choose a reason for hiding this comment

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

⚠️ 👍

@mauberti-bc mauberti-bc merged commit 3b86c70 into dev Nov 15, 2024
21 of 23 checks passed
@mauberti-bc mauberti-bc deleted the SIMSBIOHUB-620 branch November 15, 2024 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready For Review PR is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants