Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15443877
D18479.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
10 KB
Referenced Files
None
Subscribers
None
D18479.id.diff
View Options
diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -9,8 +9,8 @@
'names' => array(
'conpherence.pkg.css' => 'e68cf1fa',
'conpherence.pkg.js' => 'b5b51108',
- 'core.pkg.css' => '291cbd98',
- 'core.pkg.js' => '6c085267',
+ 'core.pkg.css' => 'fd507b0c',
+ 'core.pkg.js' => '548919aa',
'darkconsole.pkg.js' => '1f9a31bc',
'differential.pkg.css' => '45951e9e',
'differential.pkg.js' => 'b71b8c5d',
@@ -40,7 +40,7 @@
'rsrc/css/application/almanac/almanac.css' => 'dbb9b3af',
'rsrc/css/application/auth/auth.css' => '0877ed6e',
'rsrc/css/application/base/main-menu-view.css' => '1802a242',
- 'rsrc/css/application/base/notification-menu.css' => '73fefdfa',
+ 'rsrc/css/application/base/notification-menu.css' => 'ff978cad',
'rsrc/css/application/base/phui-theme.css' => '9f261c6b',
'rsrc/css/application/base/standard-page-view.css' => '34ee718b',
'rsrc/css/application/chatlog/chatlog.css' => 'd295b020',
@@ -374,7 +374,7 @@
'rsrc/image/texture/table_header_hover.png' => '038ec3b9',
'rsrc/image/texture/table_header_tall.png' => 'd56b434f',
'rsrc/js/application/aphlict/Aphlict.js' => 'e1d4b11a',
- 'rsrc/js/application/aphlict/behavior-aphlict-dropdown.js' => 'caade6f2',
+ 'rsrc/js/application/aphlict/behavior-aphlict-dropdown.js' => 'bba86888',
'rsrc/js/application/aphlict/behavior-aphlict-listen.js' => 'a14cbdfc',
'rsrc/js/application/aphlict/behavior-aphlict-status.js' => '5e2634b9',
'rsrc/js/application/aphlict/behavior-desktop-notifications-control.js' => '27ca6289',
@@ -586,7 +586,7 @@
'inline-comment-summary-css' => 'f23d4e8f',
'javelin-aphlict' => 'e1d4b11a',
'javelin-behavior' => '61cbc29a',
- 'javelin-behavior-aphlict-dropdown' => 'caade6f2',
+ 'javelin-behavior-aphlict-dropdown' => 'bba86888',
'javelin-behavior-aphlict-listen' => 'a14cbdfc',
'javelin-behavior-aphlict-status' => '5e2634b9',
'javelin-behavior-aphront-basic-tokenizer' => 'b3a4b884',
@@ -793,7 +793,7 @@
'phabricator-nav-view-css' => 'faf6a6fc',
'phabricator-notification' => '5c3349b2',
'phabricator-notification-css' => '3f6c89c9',
- 'phabricator-notification-menu-css' => '73fefdfa',
+ 'phabricator-notification-menu-css' => 'ff978cad',
'phabricator-object-selector-css' => '85ee8ce6',
'phabricator-phtize' => 'd254d646',
'phabricator-prefab' => 'c5af80a2',
@@ -1844,6 +1844,17 @@
'javelin-vector',
'javelin-install',
),
+ 'bba86888' => array(
+ 'javelin-behavior',
+ 'javelin-request',
+ 'javelin-stratcom',
+ 'javelin-vector',
+ 'javelin-dom',
+ 'javelin-uri',
+ 'javelin-behavior-device',
+ 'phabricator-title',
+ 'phabricator-favicon',
+ ),
'bcaccd64' => array(
'javelin-behavior',
'javelin-behavior-device',
@@ -1951,17 +1962,6 @@
'phabricator-shaped-request',
'conpherence-thread-manager',
),
- 'caade6f2' => array(
- 'javelin-behavior',
- 'javelin-request',
- 'javelin-stratcom',
- 'javelin-vector',
- 'javelin-dom',
- 'javelin-uri',
- 'javelin-behavior-device',
- 'phabricator-title',
- 'phabricator-favicon',
- ),
'cae95e89' => array(
'syntax-default-css',
),
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -3215,6 +3215,7 @@
'PhabricatorNotificationTestFeedStory' => 'applications/notification/feed/PhabricatorNotificationTestFeedStory.php',
'PhabricatorNotificationUIExample' => 'applications/uiexample/examples/PhabricatorNotificationUIExample.php',
'PhabricatorNotificationsApplication' => 'applications/notification/application/PhabricatorNotificationsApplication.php',
+ 'PhabricatorNotificationsMarkReadSetting' => 'applications/settings/setting/PhabricatorNotificationsMarkReadSetting.php',
'PhabricatorNotificationsSetting' => 'applications/settings/setting/PhabricatorNotificationsSetting.php',
'PhabricatorNotificationsSettingsPanel' => 'applications/settings/panel/PhabricatorNotificationsSettingsPanel.php',
'PhabricatorNuanceApplication' => 'applications/nuance/application/PhabricatorNuanceApplication.php',
@@ -8585,6 +8586,7 @@
'PhabricatorNotificationTestFeedStory' => 'PhabricatorFeedStory',
'PhabricatorNotificationUIExample' => 'PhabricatorUIExample',
'PhabricatorNotificationsApplication' => 'PhabricatorApplication',
+ 'PhabricatorNotificationsMarkReadSetting' => 'PhabricatorInternalSetting',
'PhabricatorNotificationsSetting' => 'PhabricatorInternalSetting',
'PhabricatorNotificationsSettingsPanel' => 'PhabricatorSettingsPanel',
'PhabricatorNuanceApplication' => 'PhabricatorApplication',
diff --git a/src/applications/notification/controller/PhabricatorNotificationClearController.php b/src/applications/notification/controller/PhabricatorNotificationClearController.php
--- a/src/applications/notification/controller/PhabricatorNotificationClearController.php
+++ b/src/applications/notification/controller/PhabricatorNotificationClearController.php
@@ -7,7 +7,9 @@
$viewer = $request->getViewer();
$chrono_key = $request->getStr('chronoKey');
- if ($request->isDialogFormPost()) {
+ if ($request->isDialogFormPost() ||
+ $request->isAjax() && !$request->isWorkflow()) {
+
$table = new PhabricatorFeedStoryNotification();
queryfx(
diff --git a/src/applications/notification/controller/PhabricatorNotificationPanelController.php b/src/applications/notification/controller/PhabricatorNotificationPanelController.php
--- a/src/applications/notification/controller/PhabricatorNotificationPanelController.php
+++ b/src/applications/notification/controller/PhabricatorNotificationPanelController.php
@@ -13,8 +13,12 @@
$stories = $query->execute();
+ $mark_all_key = PhabricatorNotificationsMarkReadSetting::SETTINGKEY;
+ $mark_all_value = $viewer->getUserSetting($mark_all_key);
+
$clear_ui_class = 'phabricator-notification-clear-all';
$clear_uri = id(new PhutilURI('/notification/clear/'));
+
if ($stories) {
$builder = id(new PhabricatorNotificationBuilder($stories))
->setUser($viewer);
@@ -30,14 +34,29 @@
pht('You have no notifications.'));
$clear_ui_class .= ' disabled';
}
- $clear_ui = javelin_tag(
- 'a',
- array(
- 'sigil' => 'workflow',
- 'href' => (string)$clear_uri,
- 'class' => $clear_ui_class,
- ),
- pht('Mark All Read'));
+
+ if ($mark_all_value) {
+ $chrono_key = head($stories)->getChronologicalKey();
+ $clear_ui = phabricator_form(
+ $viewer,
+ array(
+ 'method' => 'POST',
+ 'action' => '/notification/clear/?chronoKey='.$chrono_key,
+ 'sigil' => 'notifications-clear-all-form',
+ 'class' => $clear_ui_class,
+ 'id' => 'notifications-mark-read',
+ ),
+ pht('Mark All Read'));
+ } else {
+ $clear_ui = javelin_tag(
+ 'a',
+ array(
+ 'sigil' => 'workflow',
+ 'href' => (string)$clear_uri,
+ 'class' => $clear_ui_class,
+ ),
+ pht('Mark All Read'));
+ }
$notifications_link = phutil_tag(
'a',
diff --git a/src/applications/settings/panel/PhabricatorNotificationsSettingsPanel.php b/src/applications/settings/panel/PhabricatorNotificationsSettingsPanel.php
--- a/src/applications/settings/panel/PhabricatorNotificationsSettingsPanel.php
+++ b/src/applications/settings/panel/PhabricatorNotificationsSettingsPanel.php
@@ -32,6 +32,9 @@
$notifications_key = PhabricatorNotificationsSetting::SETTINGKEY;
$notifications_value = $preferences->getSettingValue($notifications_key);
+ $mark_all_key = PhabricatorNotificationsMarkReadSetting::SETTINGKEY;
+ $mark_all_value = $preferences->getSettingValue($mark_all_key);
+
if ($request->isFormPost()) {
$this->writeSetting(
@@ -39,6 +42,11 @@
$notifications_key,
$request->getInt($notifications_key));
+ $this->writeSetting(
+ $preferences,
+ $mark_all_key,
+ $request->getBool($mark_all_key));
+
return id(new AphrontRedirectResponse())
->setURI($this->getPanelURI('?saved=true'));
}
@@ -149,6 +157,15 @@
'desktop-notifications-control',
$control_config))
->appendChild(
+ id(new AphrontFormCheckboxControl())
+ ->setLabel('Mark All Read')
+ ->setName($mark_all_key)
+ ->addCheckbox(
+ $mark_all_key,
+ $mark_all_value,
+ pht('Do not prompt before marking all notifications read'),
+ $mark_all_value))
+ ->appendChild(
id(new AphrontFormSubmitControl())
->setValue(pht('Save Preference')));
diff --git a/src/applications/settings/setting/PhabricatorNotificationsMarkReadSetting.php b/src/applications/settings/setting/PhabricatorNotificationsMarkReadSetting.php
new file mode 100644
--- /dev/null
+++ b/src/applications/settings/setting/PhabricatorNotificationsMarkReadSetting.php
@@ -0,0 +1,12 @@
+<?php
+
+final class PhabricatorNotificationsMarkReadSetting
+ extends PhabricatorInternalSetting {
+
+ const SETTINGKEY = 'notifications-mark-read';
+
+ public function getSettingName() {
+ return pht('Notifications Mark all Read');
+ }
+
+}
diff --git a/webroot/rsrc/css/application/base/notification-menu.css b/webroot/rsrc/css/application/base/notification-menu.css
--- a/webroot/rsrc/css/application/base/notification-menu.css
+++ b/webroot/rsrc/css/application/base/notification-menu.css
@@ -102,6 +102,11 @@
font-weight: normal;
}
+.phabricator-notification-header .phabricator-notification-clear-all:hover {
+ text-decoration: underline;
+ cursor: pointer;
+}
+
.phabricator-notification-footer {
background: {$greybackground};
border-top: 1px solid {$thinblueborder};
diff --git a/webroot/rsrc/js/application/aphlict/behavior-aphlict-dropdown.js b/webroot/rsrc/js/application/aphlict/behavior-aphlict-dropdown.js
--- a/webroot/rsrc/js/application/aphlict/behavior-aphlict-dropdown.js
+++ b/webroot/rsrc/js/application/aphlict/behavior-aphlict-dropdown.js
@@ -234,4 +234,21 @@
JX.Stratcom.listen('notification-panel-close', null, function() {
set_visible(null);
});
+
+ function _clearAllNotifications(e) {
+ e.kill();
+
+ var form = e.getNode('tag:form');
+ var uri = JX.$U(window.location);
+ new JX.Request(form.getAttribute('action'), function () {
+ uri.go();
+ }).send();
+
+ }
+
+ JX.Stratcom.listen(
+ 'click',
+ 'notifications-clear-all-form',
+ _clearAllNotifications);
+
});
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 28, 6:41 AM (3 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7718841
Default Alt Text
D18479.id.diff (10 KB)
Attached To
Mode
D18479: Add a setting for 'mark all read' notifications
Attached
Detach File
Event Timeline
Log In to Comment