-
Notifications
You must be signed in to change notification settings - Fork 960
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
feat: Aggregating Alerts Feature #2230
Conversation
Congratulations on your first Pull Request and welcome to Amundsen community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/amundsen-io/amundsen/blob/main/CONTRIBUTING.md) |
ed3a3b7
to
d54dbe4
Compare
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 overall! just had one comment that I realized based on your screenshot of the grouped notices
const { messageHtml, severity, payload } = notice; | ||
|
||
if (payload) { | ||
accum[messageHtml] ??= { |
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 just noticed this in your screenshot in the PR description where it groups the notices with the same message but different severities into 1 - I'm thinking if the severity is different we should group those separately if possible, so by unique message and severity? I don't think that would happen for us in our cases, but not sure if it might for others who use this feature
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.
Ah this is a great point. Yeah I can group them by message + severity, let me get a fix up. Thanks for the find!
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.
Alright, took a few days to get back to this but the changes are now up and screenshots are updated. So it will now group by message and then sub-group by severity, which is then sorted to show up
fc13bc5
to
7b6cb9a
Compare
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
if (notice) { | ||
const { messageHtml, severity, payload } = notice; | ||
|
||
/* eslint-disable no-param-reassign */ |
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.
We could get rid of this rule, we have better things to care about!
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.
Sounds good!
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.
Adjusted the rule to turn it off
} | ||
|
||
const aggregateNotices = (notices) => | ||
notices.reduce((accum, notice: any) => { |
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.
Any way to avoid this 'any'?
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.
Yeah should be able to, might've just been leftover from my first implementation :)
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.
Mapped it to NoticeType
Maybe I would add a count on the aggregated notices, something like a (X) at the end of the text. |
the feature looks great! |
Ooh that's a good idea, yeah I can do that! |
Signed-off-by: Josh Slaughter <[email protected]>
Signed-off-by: Josh Slaughter <[email protected]>
- Sorting of notices by severity - Added a number next to show details if # of notices > 1 - Adjusted css for info-svg-icon to align it with others - Turned off param-reassign rule Signed-off-by: Josh Slaughter <[email protected]>
3d33552
to
a420234
Compare
if (notice) { | ||
const { messageHtml, severity, payload } = notice; | ||
|
||
if (typeof messageHtml !== 'function') { |
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.
Only case I'm not sure of is when messageHtml
is a function and takes a resourceName
. Not really sure what I would use for that case but if anyone has any ideas I can do it or if we assume it's not happening for this we can just ignore it I guess.
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 question, I just checked and we have one instance where we were using this functionality at Lyft. I looked into this a bit and I don't think it would ever be a function type at this point. I included my investigation below, but TLDR I think this is fine to leave as you have it here
in the table detail page it passes the results from this function aggregateResourceNotices to the AlertList, and that function calls getResourceNotices. in there it transforms the notices that have function types as their messageHtml to call the function and set set the field to its string message. I investigated backward from the original implementation of function messageHtml fields 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.
looks great, thanks for all the updates!
I see there is a failure from betterer as the last thing, you can run npm run betterer
under the directory frontend/amundsen_application/static
to test locally. I'm not sure what the best solution is for this case bc I think this is what you tried to turn off...if it is too much of a pain to fix, I'm fine with you using the comment like you had before to bypass
Signed-off-by: Josh Slaughter <[email protected]>
Awesome work, congrats on your first merged pull request! |
Description
Aggregates alert notices that are passed into the AlertList component and then parses them in the DefinitionList.
Motivation and Context
The UI is cluttered when there are numerous alerts taking up space, especially when many of them have the same title. Aggregating them into one modal alleviates this and reduces the visual strain on the user.
Screenshots (Before)
Notices
Modal
Info SVG Icon Alignment
Screenshots (After)
Notices
Modal
Storybook
Info SVG Icon Alignment
How Has This Been Tested?
CheckList