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

feat: add initial structure for Alert System #13382

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

vinistevam
Copy link
Contributor

@vinistevam vinistevam commented Feb 6, 2025

Description

This PR aims to add the initial structure to support the new alert system.
There are no functional changes at this point.

Related issues

Fixes: https://github.com/MetaMask/mobile-planning/issues/2130

Manual testing steps

  1. E2E tests

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@vinistevam vinistevam added the team-confirmations Push issues to confirmations team label Feb 6, 2025
Copy link
Contributor

github-actions bot commented Feb 6, 2025

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@vinistevam vinistevam added the Run Smoke E2E Triggers smoke e2e on Bitrise label Feb 11, 2025
Copy link
Contributor

github-actions bot commented Feb 11, 2025

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 4708c65
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/b73bf541-83db-4bf6-93db-4886001dfcc4

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@vinistevam vinistevam marked this pull request as ready for review February 11, 2025 14:07
@vinistevam vinistevam requested review from a team as code owners February 11, 2025 14:07
setAlertKey,
unconfirmedDangerAlerts,
unconfirmedFieldDangerAlerts,
]);
Copy link
Contributor

@jpuri jpuri Feb 11, 2025

Choose a reason for hiding this comment

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

Nit: I am not sure if useMemo above is useful.

Copy link
Contributor

@jpuri jpuri left a comment

Choose a reason for hiding this comment

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

Great work @vinistevam

@jpuri
Copy link
Contributor

jpuri commented Feb 11, 2025

Small thing context needs more text coverage, but may be in PRs to come:

Screenshot 2025-02-11 at 9 20 43 PM

}));

describe('AlertsContext', () => {
const alert1: Alert = {
Copy link
Member

Choose a reason for hiding this comment

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

Minor, would it make sense to rename them dangerAlertMock warningAlertMock etc?

[Severity.Warning]: 2,
[Severity.Info]: 1,
};
return alerts.sort((a, b) => severityOrder[b.severity] - severityOrder[a.severity]);
Copy link
Member

Choose a reason for hiding this comment

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

Would it make sense to avoid mutating alerts array since this is passed by a result of an hook (useConfirmationAlerts)?

Suggested change
return alerts.sort((a, b) => severityOrder[b.severity] - severityOrder[a.severity]);
return [...alerts].sort((a, b) => severityOrder[b.severity] - severityOrder[a.severity]);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Run Smoke E2E Triggers smoke e2e on Bitrise team-confirmations Push issues to confirmations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants