From b9345b3fc60c5d48828af422d3ee027abc2dea82 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 2 Mar 2017 19:24:12 +0100 Subject: Fix #620 - Add confirmation dialog for notifications clear --- app/assets/javascripts/components/features/notifications/index.jsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'app/assets/javascripts/components/features/notifications/index.jsx') diff --git a/app/assets/javascripts/components/features/notifications/index.jsx b/app/assets/javascripts/components/features/notifications/index.jsx index 0da3544f6..8d3f4233d 100644 --- a/app/assets/javascripts/components/features/notifications/index.jsx +++ b/app/assets/javascripts/components/features/notifications/index.jsx @@ -13,7 +13,8 @@ import LoadMore from '../../components/load_more'; import ClearColumnButton from './components/clear_column_button'; const messages = defineMessages({ - title: { id: 'column.notifications', defaultMessage: 'Notifications' } + title: { id: 'column.notifications', defaultMessage: 'Notifications' }, + confirm: { id: 'confirmation.label', defaultMessage: 'Are you sure?' } }); const getNotifications = createSelector([ @@ -72,7 +73,9 @@ const Notifications = React.createClass({ }, handleClear () { - this.props.dispatch(clearNotifications()); + if (window.confirm(this.props.intl.formatMessage(messages.confirm))) { + this.props.dispatch(clearNotifications()); + } }, setRef (c) { -- cgit From 46902367247cdb9644d47d4ac9c94d8225b86569 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 2 Mar 2017 19:25:11 +0100 Subject: Make confirmation text more specific --- app/assets/javascripts/components/features/notifications/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/assets/javascripts/components/features/notifications/index.jsx') diff --git a/app/assets/javascripts/components/features/notifications/index.jsx b/app/assets/javascripts/components/features/notifications/index.jsx index 8d3f4233d..74b914ffd 100644 --- a/app/assets/javascripts/components/features/notifications/index.jsx +++ b/app/assets/javascripts/components/features/notifications/index.jsx @@ -14,7 +14,7 @@ import ClearColumnButton from './components/clear_column_button'; const messages = defineMessages({ title: { id: 'column.notifications', defaultMessage: 'Notifications' }, - confirm: { id: 'confirmation.label', defaultMessage: 'Are you sure?' } + confirm: { id: 'notifications.clear_confirmation', defaultMessage: 'Are you sure you want to clear all your notifications?' } }); const getNotifications = createSelector([ -- cgit