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: destroy-all function in stacked notification #2289

Merged
merged 10 commits into from
Apr 5, 2024

Conversation

ironAiken2
Copy link
Contributor

@ironAiken2 ironAiken2 commented Apr 2, 2024

This PR Resolves #2281 Issue

Feature

  • you can delete all notification in active, by clicking clear button in notification drawer.
image

Checklist: (if applicable)

  • Mention to the original issue
  • Documentation
  • Minium required manager version
  • Specific setting for review (eg., KB link, endpoint or how to setup)
  • Minimum requirements to check during review
  • Test case(s) to demonstrate the difference of before/after

@github-actions github-actions bot added size:M 30~100 LoC area:ux UI / UX issue. effort:easy Need to understand only a specific region of codes (good first issue, easy). field:UI / UX impact:visible This change is visible to users. platform:general type:enhance Add new features urgency:2 With time limit, it should be finished within it; otherwise, resolve it when no other chores. labels Apr 2, 2024
Copy link

github-actions bot commented Apr 2, 2024

Coverage report for ./react

St.
Category Percentage Covered / Total
🔴 Statements
3.13% (-0% 🔻)
117/3740
🔴 Branches
3.56% (+0% 🔼)
87/2447
🔴 Functions
1.53% (+0% 🔼)
19/1240
🔴 Lines
3.08% (-0% 🔻)
113/3667

Test suite run success

32 tests passing in 4 suites.

Report generated by 🧪jest coverage report action from cb51e3a

@github-actions github-actions bot added field:localization size:L 100~500 LoC and removed size:M 30~100 LoC labels Apr 2, 2024
Copy link
Contributor

Choose a reason for hiding this comment

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

How about displaying Destroy All button when only destroyAll is not undefined?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@agatha197 Resolved.

Copy link
Contributor

@agatha197 agatha197 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@yomybaby yomybaby left a comment

Choose a reason for hiding this comment

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

The position of the "Destroy all" button is not appropriate.

image

@@ -18,7 +18,8 @@ const BAINotificationItem: React.FC<{
notification: NotificationState,
) => void;
showDate?: boolean;
}> = ({ notification, onClickAction, showDate }) => {
destroyAll?: () => void | undefined;
Copy link
Member

Choose a reason for hiding this comment

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

This prop is function type, it's better to use onClickDestroyAll name patter

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Resolved

@@ -1276,7 +1276,8 @@
"Notifications": "Notifications",
"NoNotification": "No Notification.",
"ClearNotifications": "Clear Notifications",
"AreYouSureToClearAllNotifications": "Are you sure to clear all notifications?"
"AreYouSureToClearAllNotifications": "Are you sure to clear all notifications?",
"DestroyAll": "Destroy All"
Copy link
Member

Choose a reason for hiding this comment

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

I know the API name is destroy, How about using Close instead of Destroy for a user? @agatha197 @ironAiken2

Copy link
Contributor

@agatha197 agatha197 Apr 3, 2024

Choose a reason for hiding this comment

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

image

How about clear? lol

Copy link
Contributor Author

Choose a reason for hiding this comment

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

'clear' is fine, but I think it feels more like 'closing' an open popup, rather than clearing space, so 'close' seems more better. How about it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Resolved

@github-actions github-actions bot added size:M 30~100 LoC and removed size:L 100~500 LoC labels Apr 3, 2024
@ironAiken2
Copy link
Contributor Author

If antd config provider is provided (codes) and configured via notification.config(), it seems to refer to that config when opening the notification, but it doesn't work properly.

Related links : ant-design/ant-design#42799

Copy link
Member

@yomybaby yomybaby left a comment

Choose a reason for hiding this comment

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

LGTM!

@yomybaby yomybaby merged commit 337ad7f into main Apr 5, 2024
8 checks passed
@yomybaby yomybaby deleted the feat/close-all-in-notification branch April 5, 2024 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:ux UI / UX issue. effort:easy Need to understand only a specific region of codes (good first issue, easy). impact:visible This change is visible to users. platform:general size:S 10~30 LoC type:enhance Add new features urgency:2 With time limit, it should be finished within it; otherwise, resolve it when no other chores.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: the "close all" button in Notification
3 participants