1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-18 19:40:55 +01:00

Move Setup Issues into it's own notification style menu

Summary: Ref T11132. This gets rid of the red bar for admins and instead shows a new menu item next to notifications/chat if there are unresolved configuration issues. Menu goes away if there are no issues. May move this later into the bell icon, but think think might be the right place to start especially for NUX and updates. Maybe limit the number of items?

Test Plan:
Tested with some, lots, and no config issues.

{F1790156}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T11132

Differential Revision: https://secure.phabricator.com/D16461
This commit is contained in:
Chad Little 2016-08-27 19:00:35 -07:00
parent 86231a9d6d
commit 00796e592b
16 changed files with 227 additions and 102 deletions

View file

@ -7,8 +7,8 @@
*/
return array(
'names' => array(
'core.pkg.css' => '25e4069a',
'core.pkg.js' => 'b562c3db',
'core.pkg.css' => '7d178771',
'core.pkg.js' => '2b8af4e4',
'darkconsole.pkg.js' => 'e7393ebb',
'differential.pkg.css' => '3fb7f532',
'differential.pkg.js' => '634399e9',
@ -32,11 +32,11 @@ return array(
'rsrc/css/aphront/typeahead.css' => 'd4f16145',
'rsrc/css/application/almanac/almanac.css' => 'dbb9b3af',
'rsrc/css/application/auth/auth.css' => '0877ed6e',
'rsrc/css/application/base/main-menu-view.css' => '3b0d39f7',
'rsrc/css/application/base/notification-menu.css' => 'f31c0bde',
'rsrc/css/application/base/main-menu-view.css' => 'e862571a',
'rsrc/css/application/base/notification-menu.css' => 'b3ab500d',
'rsrc/css/application/base/phabricator-application-launch-view.css' => '95351601',
'rsrc/css/application/base/phui-theme.css' => '027ba77e',
'rsrc/css/application/base/standard-page-view.css' => 'e709f6d0',
'rsrc/css/application/base/standard-page-view.css' => '99a7d403',
'rsrc/css/application/chatlog/chatlog.css' => 'd295b020',
'rsrc/css/application/conduit/conduit-api.css' => '7bc725c4',
'rsrc/css/application/config/config-options.css' => '0ede4c9b',
@ -45,12 +45,12 @@ return array(
'rsrc/css/application/config/setup-issue.css' => 'f794cfc3',
'rsrc/css/application/config/unhandled-exception.css' => '4c96257a',
'rsrc/css/application/conpherence/durable-column.css' => '86396117',
'rsrc/css/application/conpherence/menu.css' => 'f99fee4c',
'rsrc/css/application/conpherence/message-pane.css' => '5897d3ac',
'rsrc/css/application/conpherence/menu.css' => '90bdf85c',
'rsrc/css/application/conpherence/message-pane.css' => '5c7b7b17',
'rsrc/css/application/conpherence/notification.css' => '6cdcc253',
'rsrc/css/application/conpherence/transaction.css' => '85d0974c',
'rsrc/css/application/conpherence/update.css' => 'faf6be09',
'rsrc/css/application/conpherence/widget-pane.css' => '775eaaba',
'rsrc/css/application/conpherence/widget-pane.css' => 'c5b74f9e',
'rsrc/css/application/contentsource/content-source-view.css' => '4b8b05d4',
'rsrc/css/application/countdown/timer.css' => '16c52f5c',
'rsrc/css/application/daemon/bulk-job.css' => 'df9c1d4a',
@ -107,7 +107,7 @@ return array(
'rsrc/css/core/core.css' => 'd0801452',
'rsrc/css/core/remarkup.css' => '5ed06ed8',
'rsrc/css/core/syntax.css' => '769d3498',
'rsrc/css/core/z-index.css' => '5b6fcf3f',
'rsrc/css/core/z-index.css' => '2b01a823',
'rsrc/css/diviner/diviner-shared.css' => 'aa3656aa',
'rsrc/css/font/font-aleo.css' => '8bdb2835',
'rsrc/css/font/font-awesome.css' => '2b7ebbcc',
@ -160,7 +160,7 @@ return array(
'rsrc/css/phui/phui-timeline-view.css' => 'bc523970',
'rsrc/css/phui/phui-two-column-view.css' => '5afdf637',
'rsrc/css/phui/workboards/phui-workboard-color.css' => 'ac6fe6a7',
'rsrc/css/phui/workboards/phui-workboard.css' => 'e6d89647',
'rsrc/css/phui/workboards/phui-workboard.css' => 'bda3ef58',
'rsrc/css/phui/workboards/phui-workcard.css' => '0c62d7c5',
'rsrc/css/phui/workboards/phui-workpanel.css' => '92197373',
'rsrc/css/sprite-login.css' => '60e8560e',
@ -357,7 +357,7 @@ return array(
'rsrc/image/texture/table_header_hover.png' => '038ec3b9',
'rsrc/image/texture/table_header_tall.png' => 'd56b434f',
'rsrc/js/application/aphlict/Aphlict.js' => '5359e785',
'rsrc/js/application/aphlict/behavior-aphlict-dropdown.js' => '031cee25',
'rsrc/js/application/aphlict/behavior-aphlict-dropdown.js' => '49e20786',
'rsrc/js/application/aphlict/behavior-aphlict-listen.js' => 'fb20ac8d',
'rsrc/js/application/aphlict/behavior-aphlict-status.js' => 'ea681761',
'rsrc/js/application/aphlict/behavior-desktop-notifications-control.js' => 'edd1ba66',
@ -549,13 +549,13 @@ return array(
'config-options-css' => '0ede4c9b',
'config-welcome-css' => '035aa483',
'conpherence-durable-column-view' => '86396117',
'conpherence-menu-css' => 'f99fee4c',
'conpherence-message-pane-css' => '5897d3ac',
'conpherence-menu-css' => '90bdf85c',
'conpherence-message-pane-css' => '5c7b7b17',
'conpherence-notification-css' => '6cdcc253',
'conpherence-thread-manager' => '01774ab2',
'conpherence-transaction-css' => '85d0974c',
'conpherence-update-css' => 'faf6be09',
'conpherence-widget-pane-css' => '775eaaba',
'conpherence-widget-pane-css' => 'c5b74f9e',
'd3' => 'a11a5ff2',
'differential-changeset-view-css' => '9ef7d354',
'differential-core-view-css' => '5b7b8ff4',
@ -580,7 +580,7 @@ return array(
'inline-comment-summary-css' => '51efda3a',
'javelin-aphlict' => '5359e785',
'javelin-behavior' => '61cbc29a',
'javelin-behavior-aphlict-dropdown' => '031cee25',
'javelin-behavior-aphlict-dropdown' => '49e20786',
'javelin-behavior-aphlict-listen' => 'fb20ac8d',
'javelin-behavior-aphlict-status' => 'ea681761',
'javelin-behavior-aphront-basic-tokenizer' => 'b3a4b884',
@ -784,11 +784,11 @@ return array(
'phabricator-flag-css' => '5337623f',
'phabricator-keyboard-shortcut' => '1ae869f2',
'phabricator-keyboard-shortcut-manager' => '4a021c10',
'phabricator-main-menu-view' => '3b0d39f7',
'phabricator-main-menu-view' => 'e862571a',
'phabricator-nav-view-css' => 'b29426e9',
'phabricator-notification' => 'ccf1cbf8',
'phabricator-notification-css' => '3f6c89c9',
'phabricator-notification-menu-css' => 'f31c0bde',
'phabricator-notification-menu-css' => 'b3ab500d',
'phabricator-object-selector-css' => '85ee8ce6',
'phabricator-phtize' => 'd254d646',
'phabricator-prefab' => 'cfd23f37',
@ -797,7 +797,7 @@ return array(
'phabricator-shaped-request' => '7cbe244b',
'phabricator-slowvote-css' => 'a94b7230',
'phabricator-source-code-view-css' => 'cbeef983',
'phabricator-standard-page-view' => 'e709f6d0',
'phabricator-standard-page-view' => '99a7d403',
'phabricator-textareautils' => '320810c8',
'phabricator-title' => 'df5e11d2',
'phabricator-tooltip' => '6323f942',
@ -812,7 +812,7 @@ return array(
'phabricator-uiexample-reactor-select' => 'a155550f',
'phabricator-uiexample-reactor-sendclass' => '1def2711',
'phabricator-uiexample-reactor-sendproperties' => 'b1f0ccee',
'phabricator-zindex-css' => '5b6fcf3f',
'phabricator-zindex-css' => '2b01a823',
'phame-css' => '8efb0729',
'pholio-css' => 'ca89d380',
'pholio-edit-css' => '07676f51',
@ -870,7 +870,7 @@ return array(
'phui-timeline-view-css' => 'bc523970',
'phui-two-column-view-css' => '5afdf637',
'phui-workboard-color-css' => 'ac6fe6a7',
'phui-workboard-view-css' => 'e6d89647',
'phui-workboard-view-css' => 'bda3ef58',
'phui-workcard-view-css' => '0c62d7c5',
'phui-workpanel-view-css' => '92197373',
'phuix-action-list-view' => 'b5c256b8',
@ -931,16 +931,6 @@ return array(
'javelin-dom',
'phabricator-keyboard-shortcut',
),
'031cee25' => array(
'javelin-behavior',
'javelin-request',
'javelin-stratcom',
'javelin-vector',
'javelin-dom',
'javelin-uri',
'javelin-behavior-device',
'phabricator-title',
),
'05270951' => array(
'javelin-util',
'javelin-magical-init',
@ -1164,9 +1154,6 @@ return array(
'javelin-dom',
'javelin-magical-init',
),
'3b0d39f7' => array(
'phui-theme-css',
),
'3cb0b2fc' => array(
'javelin-behavior',
'javelin-dom',
@ -1242,6 +1229,16 @@ return array(
'javelin-dom',
'javelin-stratcom',
),
'49e20786' => array(
'javelin-behavior',
'javelin-request',
'javelin-stratcom',
'javelin-vector',
'javelin-dom',
'javelin-uri',
'javelin-behavior-device',
'phabricator-title',
),
'4a021c10' => array(
'javelin-install',
'javelin-util',
@ -2097,6 +2094,9 @@ return array(
'e6e25838' => array(
'javelin-install',
),
'e862571a' => array(
'phui-theme-css',
),
'e9581f08' => array(
'javelin-behavior',
'javelin-stratcom',

View file

@ -2170,6 +2170,7 @@ phutil_register_library_map(array(
'PhabricatorConfigHistoryController' => 'applications/config/controller/PhabricatorConfigHistoryController.php',
'PhabricatorConfigIgnoreController' => 'applications/config/controller/PhabricatorConfigIgnoreController.php',
'PhabricatorConfigIssueListController' => 'applications/config/controller/PhabricatorConfigIssueListController.php',
'PhabricatorConfigIssuePanelController' => 'applications/config/controller/PhabricatorConfigIssuePanelController.php',
'PhabricatorConfigIssueViewController' => 'applications/config/controller/PhabricatorConfigIssueViewController.php',
'PhabricatorConfigJSON' => 'applications/config/json/PhabricatorConfigJSON.php',
'PhabricatorConfigJSONOptionType' => 'applications/config/custom/PhabricatorConfigJSONOptionType.php',
@ -6915,6 +6916,7 @@ phutil_register_library_map(array(
'PhabricatorConfigHistoryController' => 'PhabricatorConfigController',
'PhabricatorConfigIgnoreController' => 'PhabricatorConfigController',
'PhabricatorConfigIssueListController' => 'PhabricatorConfigController',
'PhabricatorConfigIssuePanelController' => 'PhabricatorConfigController',
'PhabricatorConfigIssueViewController' => 'PhabricatorConfigController',
'PhabricatorConfigJSON' => 'Phobject',
'PhabricatorConfigJSONOptionType' => 'PhabricatorConfigOptionType',

View file

@ -55,6 +55,7 @@ final class PhabricatorConfigApplication extends PhabricatorApplication {
=> 'PhabricatorConfigIgnoreController',
'issue/' => array(
'' => 'PhabricatorConfigIssueListController',
'panel/' => 'PhabricatorConfigIssuePanelController',
'(?P<key>[^/]+)/' => 'PhabricatorConfigIssueViewController',
),
'cache/' => array(

View file

@ -0,0 +1,68 @@
<?php
final class PhabricatorConfigIssuePanelController
extends PhabricatorConfigController {
public function handleRequest(AphrontRequest $request) {
$viewer = $request->getViewer();
$open_items = PhabricatorSetupCheck::getOpenSetupIssueKeys();
$issues = PhabricatorSetupCheck::runAllChecks();
PhabricatorSetupCheck::setOpenSetupIssueKeys(
PhabricatorSetupCheck::getUnignoredIssueKeys($issues),
$update_database = true);
if ($issues) {
require_celerity_resource('phabricator-notification-menu-css');
$items = array();
foreach ($issues as $issue) {
$classes = array();
$classes[] = 'phabricator-notification';
if ($issue->getIsIgnored()) {
$classes[] = 'phabricator-notification-read';
} else {
$classes[] = 'phabricator-notification-unread';
}
$uri = '/config/issue/'.$issue->getIssueKey().'/';
$title = $issue->getName();
$summary = $issue->getSummary();
$items[] = javelin_tag(
'div',
array(
'class' => implode(' ', $classes),
'sigil' => 'notification',
'meta' => array(
'href' => $uri,
),
),
$title);
}
$content = phutil_tag_div('setup-issue-menu', $items);
} else {
$content = phutil_tag_div(
'phabricator-notification no-notifications',
pht('You have no unresolved setup issues.'));
}
$content = hsprintf(
'<div class="phabricator-notification-header">%s</div>'.
'%s',
phutil_tag(
'a',
array(
'href' => '/config/issue/',
),
pht('Unresolved Setup Issues')),
$content);
$unresolved_count = count($open_items);
$json = array(
'content' => $content,
'number' => (int)$unresolved_count,
);
return id(new AphrontAjaxResponse())->setContent($json);
}
}

View file

@ -538,11 +538,6 @@ final class PhabricatorUSEnglishTranslation
'PHP also loaded these configuration files:',
),
'You have %d unresolved setup issue(s)...' => array(
'You have an unresolved setup issue...',
'You have %d unresolved setup issues...',
),
'%s added %d inline comment(s).' => array(
array(
'%s added an inline comment.',

View file

@ -459,24 +459,6 @@ final class PhabricatorStandardPageView extends PhabricatorBarePageView
'or the error log.'));
}
// Render the "you have unresolved setup issues..." warning.
$setup_warning = null;
if ($user && $user->getIsAdmin()) {
$open = PhabricatorSetupCheck::getOpenSetupIssueKeys();
if ($open) {
$classes[] = 'page-has-warning';
$setup_warning = phutil_tag_div(
'setup-warning-callout',
phutil_tag(
'a',
array(
'href' => '/config/issue/',
'title' => implode(', ', $open),
),
pht('You have %d unresolved setup issue(s)...', count($open))));
}
}
$main_page = phutil_tag(
'div',
array(
@ -486,7 +468,6 @@ final class PhabricatorStandardPageView extends PhabricatorBarePageView
array(
$developer_warning,
$header_chrome,
$setup_warning,
phutil_tag(
'div',
array(

View file

@ -531,15 +531,100 @@ final class PhabricatorMainMenuView extends AphrontView {
'');
}
// Admin Level Urgent Notification Channel
$setup_tag = '';
$setup_notification_dropdown = '';
if ($viewer && $viewer->getIsAdmin()) {
$open = PhabricatorSetupCheck::getOpenSetupIssueKeys();
if ($open) {
$setup_id = celerity_generate_unique_node_id();
$setup_count_id = celerity_generate_unique_node_id();
$setup_dropdown_id = celerity_generate_unique_node_id();
$setup_count_number = count($open);
if ($setup_count_number) {
$aural[] = phutil_tag(
'a',
array(
'href' => '/config/issue/',
),
pht(
'%s unresolved issues.',
new PhutilNumber($setup_count_number)));
} else {
$aural[] = pht('No issues.');
}
$setup_count_tag = phutil_tag(
'span',
array(
'id' => $setup_count_id,
'class' => 'phabricator-main-menu-setup-count',
),
$setup_count_number);
$setup_icon_tag = javelin_tag(
'span',
array(
'class' => 'phabricator-main-menu-setup-icon phui-icon-view '.
'phui-font-fa fa-exclamation-circle',
'sigil' => 'menu-icon',
),
'');
if ($setup_count_number) {
$container_classes[] = 'setup-unread';
}
$setup_tag = phutil_tag(
'a',
array(
'href' => '/config/issue/',
'class' => implode(' ', $container_classes),
'id' => $setup_id,
),
array(
$setup_icon_tag,
$setup_count_tag,
));
Javelin::initBehavior(
'aphlict-dropdown',
array(
'bubbleID' => $setup_id,
'countID' => $setup_count_id,
'dropdownID' => $setup_dropdown_id,
'loadingText' => pht('Loading...'),
'uri' => '/config/issue/panel/',
'countType' => null,
'countNumber' => null,
'unreadClass' => 'setup-unread',
));
$setup_notification_dropdown = javelin_tag(
'div',
array(
'id' => $setup_dropdown_id,
'class' => 'phabricator-notification-menu',
'sigil' => 'phabricator-notification-menu',
'style' => 'display: none;',
),
'');
}
}
$dropdowns = array(
$notification_dropdown,
$message_notification_dropdown,
$setup_notification_dropdown,
);
return array(
array(
$bubble_tag,
$message_tag,
$setup_tag,
),
$dropdowns,
$aural,

View file

@ -376,7 +376,8 @@ button.phabricator-main-menu-search-dropdown .caret:before {
}
.phabricator-main-menu-alert-icon,
.phabricator-main-menu-message-icon {
.phabricator-main-menu-message-icon,
.phabricator-main-menu-setup-icon {
width: 18px;
height: 18px;
float: left;
@ -396,8 +397,25 @@ button.phabricator-main-menu-search-dropdown .caret:before {
margin-top: 2px;
}
.setup-unread .phui-icon-view.phabricator-main-menu-setup-icon {
color: #ecf36c;
font-size: 16px;
margin-top: 2px;
width: 15px;
}
.setup-unread .phabricator-main-menu-setup-count {
color: #ecf36c;
margin-top: 10px;
}
.device-desktop .alert-notifications.setup-unread:hover .phui-icon-view {
color: #ecf36c;
}
.phabricator-main-menu-alert-count,
.phabricator-main-menu-message-count {
.phabricator-main-menu-message-count,
.phabricator-main-menu-setup-count {
color: #fff;
text-align: center;
display: none;
@ -407,17 +425,20 @@ button.phabricator-main-menu-search-dropdown .caret:before {
}
.device-phone .alert-unread .phabricator-main-menu-alert-count,
.device-phone .message-unread .phabricator-main-menu-message-count {
.device-phone .message-unread .phabricator-main-menu-message-count,
.device-phone .setup-unread .phabricator-main-menu-setup-count {
display: none;
}
.alert-unread .phabricator-main-menu-alert-icon,
.message-unread .phabricator-main-menu-message-icon {
.message-unread .phabricator-main-menu-message-icon,
.setup-unread .phabricator-main-menu-setup-icon {
color: #fff;
}
.alert-unread .phabricator-main-menu-alert-count,
.message-unread .phabricator-main-menu-message-count {
.message-unread .phabricator-main-menu-message-count,
.setup-unread .phabricator-main-menu-setup-count {
display: block;
}

View file

@ -37,7 +37,6 @@
top: 42px !important;
left: 3% !important;
position: absolute;
}
.phabricator-notification-list.pm {
@ -78,6 +77,10 @@
background: {$hoverblue};
}
.phabricator-notification-read {
color: {$lightgreytext};
}
.phabricator-notification-header {
font-weight: bold;
padding: 10px 8px;

View file

@ -105,17 +105,6 @@ a.handle-availability-disabled {
font-size: {$smallerfontsize};
}
.setup-warning-callout {
padding: 8px 16px;
background: {$lightred};
border-bottom: 1px solid {$sh-redborder};
position: relative;
}
.setup-warning-callout a {
color: {$red};
}
.phui-handle .phui-icon-view {
display: inline-block;
margin: 2px 2px -2px 0;

View file

@ -11,10 +11,6 @@
background: #fff;
}
.page-has-warning .conpherence-layout {
top: 76px;
}
.conpherence-layout .conpherence-no-threads {
text-align: center;
position: fixed;

View file

@ -65,10 +65,6 @@
bottom: 42px;
}
.page-has-warning .conpherence-message-pane .conpherence-messages {
top: 110px;
}
.conpherence-messages.jx-scrollbar-frame {
overflow-y: hidden;
}

View file

@ -15,12 +15,6 @@
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
.page-has-warning .conpherence-widget-pane,
.page-had-warning .loading .widgets-loading-mask {
top: 110px;
}
.device .conpherence-widget-pane,
.device .loading .widgets-loading-mask {
top: 44px;
@ -91,10 +85,6 @@
width: 240px;
}
.device-desktop .page-has-warning .conpherence-widget-pane .widgets-body {
top: 142px;
}
.conpherence-widget-pane .widget-icon {
display: block;
height: 14px;

View file

@ -68,10 +68,6 @@ div.phui-calendar-day-event {
z-index: 4;
}
.setup-warning-callout {
z-index: 5;
}
.loading .messages-loading-mask,
.loading .widgets-loading-mask {
z-index: 5;

View file

@ -22,10 +22,6 @@
background-color: #fff;
}
.device-desktop .page-has-warning .phui-workboard-view-shadow {
top: 113px;
}
.device-desktop.with-durable-column .phui-workboard-view-shadow {
right: 300px;
}

View file

@ -26,10 +26,16 @@ JX.behavior('aphlict-dropdown', function(config, statics) {
var request = null;
var dirty = config.local ? false : true;
JX.Title.setCount(config.countType, config.countNumber);
if (config.countType) {
JX.Title.setCount(config.countType, config.countNumber);
}
function _updateCount(number) {
JX.Title.setCount(config.countType, number);
if (config.countType) {
JX.Title.setCount(config.countType, number);
} else {
return;
}
JX.DOM.setContent(count, number);
if (number === 0) {