Commit 3da38c74 authored by Chad Little's avatar Chad Little
Browse files

PHUIErrorView

Summary: Clean up the error view styling.

Test Plan:
Tested as many as I could find, built additional tests in UIExamples

{F280452}

{F280453}

Reviewers: btrahan, epriestley

Reviewed By: epriestley

Subscribers: hach-que, Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11605
parent 33c0b942
......@@ -7,7 +7,7 @@
*/
return array(
'names' => array(
'core.pkg.css' => '024a3170',
'core.pkg.css' => '44f5d60d',
'core.pkg.js' => '65e04767',
'darkconsole.pkg.js' => '8ab24e01',
'differential.pkg.css' => '8af45893',
......@@ -20,7 +20,6 @@ return array(
'rsrc/css/aphront/context-bar.css' => '1c3b0529',
'rsrc/css/aphront/dark-console.css' => '6378ef3d',
'rsrc/css/aphront/dialog-view.css' => '4dbbe3bb',
'rsrc/css/aphront/error-view.css' => '3462dbee',
'rsrc/css/aphront/lightbox-attachment.css' => '7acac05d',
'rsrc/css/aphront/list-filter-view.css' => '2ae43867',
'rsrc/css/aphront/multi-column.css' => '41a848c0',
......@@ -53,7 +52,7 @@ return array(
'rsrc/css/application/conpherence/widget-pane.css' => '3d575438',
'rsrc/css/application/contentsource/content-source-view.css' => '4b8b05d4',
'rsrc/css/application/countdown/timer.css' => '86b7b0a0',
'rsrc/css/application/dashboard/dashboard.css' => 'a2bfdcbf',
'rsrc/css/application/dashboard/dashboard.css' => 'ec324e2a',
'rsrc/css/application/diff/inline-comment-summary.css' => '8cfd34e8',
'rsrc/css/application/differential/add-comment.css' => 'c478bcaa',
'rsrc/css/application/differential/changeset-view.css' => 'b2b71e76',
......@@ -80,7 +79,7 @@ return array(
'rsrc/css/application/owners/owners-path-editor.css' => '2f00933b',
'rsrc/css/application/paste/paste.css' => 'aa1767d1',
'rsrc/css/application/people/people-profile.css' => '25970776',
'rsrc/css/application/phame/phame.css' => '19ecc703',
'rsrc/css/application/phame/phame.css' => 'db5682e3',
'rsrc/css/application/pholio/pholio-edit.css' => '3ad9d1ee',
'rsrc/css/application/pholio/pholio-inline-comments.css' => '8e545e49',
'rsrc/css/application/pholio/pholio.css' => '95174bdd',
......@@ -127,6 +126,7 @@ return array(
'rsrc/css/phui/phui-button.css' => '008ba5e2',
'rsrc/css/phui/phui-crumbs-view.css' => '646a8830',
'rsrc/css/phui/phui-document.css' => 'a494bdf8',
'rsrc/css/phui/phui-error-view.css' => '6b660bbc',
'rsrc/css/phui/phui-feed-story.css' => 'c9f3a0b5',
'rsrc/css/phui/phui-fontkit.css' => '9ae12677',
'rsrc/css/phui/phui-form-view.css' => 'aad06f2a',
......@@ -136,8 +136,8 @@ return array(
'rsrc/css/phui/phui-image-mask.css' => '5a8b09c8',
'rsrc/css/phui/phui-info-panel.css' => '27ea50a1',
'rsrc/css/phui/phui-list.css' => '53deb25c',
'rsrc/css/phui/phui-object-box.css' => '0d47b3c8',
'rsrc/css/phui/phui-object-item-list-view.css' => '2686a80e',
'rsrc/css/phui/phui-object-box.css' => 'b8b7fd78',
'rsrc/css/phui/phui-object-item-list-view.css' => '9626caac',
'rsrc/css/phui/phui-pinboard-view.css' => '3dd4a269',
'rsrc/css/phui/phui-property-list-view.css' => '51480060',
'rsrc/css/phui/phui-remarkup-preview.css' => '19ad512b',
......@@ -496,7 +496,6 @@ return array(
'aphront-contextbar-view-css' => '1c3b0529',
'aphront-dark-console-css' => '6378ef3d',
'aphront-dialog-view-css' => '4dbbe3bb',
'aphront-error-view-css' => '3462dbee',
'aphront-list-filter-view-css' => '2ae43867',
'aphront-multi-column-view-css' => '41a848c0',
'aphront-pager-view-css' => '2e3539af',
......@@ -712,7 +711,7 @@ return array(
'phabricator-content-source-view-css' => '4b8b05d4',
'phabricator-core-css' => 'd7f6ec35',
'phabricator-countdown-css' => '86b7b0a0',
'phabricator-dashboard-css' => 'a2bfdcbf',
'phabricator-dashboard-css' => 'ec324e2a',
'phabricator-drag-and-drop-file-upload' => '8c49f386',
'phabricator-draggable-list' => 'a16ec1c6',
'phabricator-fatal-config-template-css' => '25d446d6',
......@@ -756,7 +755,7 @@ return array(
'phabricator-uiexample-reactor-sendclass' => '1def2711',
'phabricator-uiexample-reactor-sendproperties' => 'b1f0ccee',
'phabricator-zindex-css' => '40eb7003',
'phame-css' => '19ecc703',
'phame-css' => 'db5682e3',
'pholio-css' => '95174bdd',
'pholio-edit-css' => '3ad9d1ee',
'pholio-inline-comments-css' => '8e545e49',
......@@ -774,6 +773,7 @@ return array(
'phui-calendar-month-css' => 'a92e47d2',
'phui-crumbs-view-css' => '646a8830',
'phui-document-view-css' => 'a494bdf8',
'phui-error-view-css' => '6b660bbc',
'phui-feed-story-css' => 'c9f3a0b5',
'phui-font-icon-base-css' => '3dad2ae3',
'phui-fontkit-css' => '9ae12677',
......@@ -784,8 +784,8 @@ return array(
'phui-image-mask-css' => '5a8b09c8',
'phui-info-panel-css' => '27ea50a1',
'phui-list-view-css' => '53deb25c',
'phui-object-box-css' => '0d47b3c8',
'phui-object-item-list-view-css' => '2686a80e',
'phui-object-box-css' => 'b8b7fd78',
'phui-object-item-list-view-css' => '9626caac',
'phui-pinboard-view-css' => '3dd4a269',
'phui-property-list-view-css' => '51480060',
'phui-remarkup-preview-css' => '19ad512b',
......@@ -2018,7 +2018,7 @@ return array(
'phabricator-transaction-view-css',
'aphront-tooltip-css',
'phabricator-flag-css',
'aphront-error-view-css',
'phui-error-view-css',
'sprite-gradient-css',
'sprite-menu-css',
'phabricator-main-menu-view',
......
......@@ -94,7 +94,7 @@ return array(
'phabricator-transaction-view-css',
'aphront-tooltip-css',
'phabricator-flag-css',
'aphront-error-view-css',
'phui-error-view-css',
'sprite-gradient-css',
'sprite-menu-css',
......
......@@ -107,7 +107,6 @@ phutil_register_library_map(array(
'AphrontDefaultApplicationConfiguration' => 'aphront/configuration/AphrontDefaultApplicationConfiguration.php',
'AphrontDialogResponse' => 'aphront/response/AphrontDialogResponse.php',
'AphrontDialogView' => 'view/AphrontDialogView.php',
'AphrontErrorView' => 'view/form/AphrontErrorView.php',
'AphrontException' => 'aphront/exception/AphrontException.php',
'AphrontFileResponse' => 'aphront/response/AphrontFileResponse.php',
'AphrontFormCheckboxControl' => 'view/form/control/AphrontFormCheckboxControl.php',
......@@ -1140,6 +1139,8 @@ phutil_register_library_map(array(
'PHUIDocumentExample' => 'applications/uiexample/examples/PHUIDocumentExample.php',
'PHUIDocumentView' => 'view/phui/PHUIDocumentView.php',
'PHUIDurableColumn' => 'view/phui/PHUIDurableColumn.php',
'PHUIErrorExample' => 'applications/uiexample/examples/PHUIErrorExample.php',
'PHUIErrorView' => 'view/form/PHUIErrorView.php',
'PHUIFeedStoryExample' => 'applications/uiexample/examples/PHUIFeedStoryExample.php',
'PHUIFeedStoryView' => 'view/phui/PHUIFeedStoryView.php',
'PHUIFormDividerControl' => 'view/form/control/PHUIFormDividerControl.php',
......@@ -1698,7 +1699,6 @@ phutil_register_library_map(array(
'PhabricatorEnglishTranslation' => 'infrastructure/internationalization/translation/PhabricatorEnglishTranslation.php',
'PhabricatorEnv' => 'infrastructure/env/PhabricatorEnv.php',
'PhabricatorEnvTestCase' => 'infrastructure/env/__tests__/PhabricatorEnvTestCase.php',
'PhabricatorErrorUIExample' => 'applications/uiexample/examples/PhabricatorErrorUIExample.php',
'PhabricatorEvent' => 'infrastructure/events/PhabricatorEvent.php',
'PhabricatorEventEngine' => 'infrastructure/events/PhabricatorEventEngine.php',
'PhabricatorEventListener' => 'infrastructure/events/PhabricatorEventListener.php',
......@@ -3230,7 +3230,6 @@ phutil_register_library_map(array(
'AphrontDefaultApplicationConfiguration' => 'AphrontApplicationConfiguration',
'AphrontDialogResponse' => 'AphrontResponse',
'AphrontDialogView' => 'AphrontView',
'AphrontErrorView' => 'AphrontView',
'AphrontException' => 'Exception',
'AphrontFileResponse' => 'AphrontResponse',
'AphrontFormCheckboxControl' => 'AphrontFormControl',
......@@ -4337,6 +4336,8 @@ phutil_register_library_map(array(
'PHUIDocumentExample' => 'PhabricatorUIExample',
'PHUIDocumentView' => 'AphrontTagView',
'PHUIDurableColumn' => 'AphrontTagView',
'PHUIErrorExample' => 'PhabricatorUIExample',
'PHUIErrorView' => 'AphrontView',
'PHUIFeedStoryExample' => 'PhabricatorUIExample',
'PHUIFeedStoryView' => 'AphrontView',
'PHUIFormDividerControl' => 'AphrontFormControl',
......@@ -4937,7 +4938,6 @@ phutil_register_library_map(array(
'PhabricatorEmptyQueryException' => 'Exception',
'PhabricatorEnglishTranslation' => 'PhabricatorBaseEnglishTranslation',
'PhabricatorEnvTestCase' => 'PhabricatorTestCase',
'PhabricatorErrorUIExample' => 'PhabricatorUIExample',
'PhabricatorEvent' => 'PhutilEvent',
'PhabricatorEventListener' => 'PhutilEventListener',
'PhabricatorEventType' => 'PhutilEventType',
......
......@@ -205,7 +205,7 @@ class AphrontDefaultApplicationConfiguration
}
if ($ex instanceof AphrontUsageException) {
$error = new AphrontErrorView();
$error = new PHUIErrorView();
$error->setTitle($ex->getTitle());
$error->appendChild($ex->getMessage());
......
......@@ -188,8 +188,8 @@ abstract class AlmanacController
),
pht('Learn More'));
$error_view = id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_WARNING)
$error_view = id(new PHUIErrorView())
->setSeverity(PHUIErrorView::SEVERITY_WARNING)
->setErrors(
array(
array($message, ' ', $doc_link),
......
......@@ -15,7 +15,7 @@ abstract class PhabricatorAuthController extends PhabricatorController {
}
protected function renderErrorPage($title, array $messages) {
$view = new AphrontErrorView();
$view = new PHUIErrorView();
$view->setTitle($title);
$view->setErrors($messages);
......
......@@ -29,9 +29,9 @@ final class PhabricatorAuthNeedsMultiFactorController
$viewer->updateMultiFactorEnrollment();
if (!$viewer->getIsEnrolledInMultiFactor()) {
$help = id(new AphrontErrorView())
$help = id(new PHUIErrorView())
->setTitle(pht('Add Multi-Factor Authentication To Your Account'))
->setSeverity(AphrontErrorView::SEVERITY_WARNING)
->setSeverity(PHUIErrorView::SEVERITY_WARNING)
->setErrors(
array(
pht(
......@@ -53,9 +53,9 @@ final class PhabricatorAuthNeedsMultiFactorController
'account.'),
));
} else {
$help = id(new AphrontErrorView())
$help = id(new PHUIErrorView())
->setTitle(pht('Multi-Factor Authentication Configured'))
->setSeverity(AphrontErrorView::SEVERITY_NOTICE)
->setSeverity(PHUIErrorView::SEVERITY_NOTICE)
->setErrors(
array(
pht(
......
......@@ -444,8 +444,8 @@ final class PhabricatorAuthRegisterController
$welcome_view = null;
if ($is_setup) {
$welcome_view = id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_NOTICE)
$welcome_view = id(new PHUIErrorView())
->setSeverity(PHUIErrorView::SEVERITY_NOTICE)
->setTitle(pht('Welcome to Phabricator'))
->appendChild(
pht(
......
......@@ -128,7 +128,7 @@ EOBODY;
$error_view = null;
if ($errors) {
$error_view = new AphrontErrorView();
$error_view = new PHUIErrorView();
$error_view->setErrors($errors);
}
......
......@@ -28,8 +28,8 @@ final class PhabricatorMustVerifyEmailController
$sent = null;
if ($request->isFormPost()) {
$email->sendVerificationEmail($user);
$sent = new AphrontErrorView();
$sent->setSeverity(AphrontErrorView::SEVERITY_NOTICE);
$sent = new PHUIErrorView();
$sent->setSeverity(PHUIErrorView::SEVERITY_NOTICE);
$sent->setTitle(pht('Email Sent'));
$sent->appendChild(
pht(
......
......@@ -103,11 +103,11 @@ final class PhabricatorAuthListController
),
$config_name);
$warning = new AphrontErrorView();
$warning = new PHUIErrorView();
$email_domains = PhabricatorEnv::getEnvConfig($config_name);
if ($email_domains) {
$warning->setSeverity(AphrontErrorView::SEVERITY_NOTICE);
$warning->setSeverity(PHUIErrorView::SEVERITY_NOTICE);
$warning->setTitle(pht('Registration is Restricted'));
$warning->appendChild(
pht(
......@@ -116,7 +116,7 @@ final class PhabricatorAuthListController
$config_link,
phutil_tag('strong', array(), implode(', ', $email_domains))));
} else {
$warning->setSeverity(AphrontErrorView::SEVERITY_WARNING);
$warning->setSeverity(PHUIErrorView::SEVERITY_WARNING);
$warning->setTitle(pht('Anyone Can Register an Account'));
$warning->appendChild(
pht(
......
......@@ -121,7 +121,7 @@ final class PhabricatorLDAPAuthProvider extends PhabricatorAuthProvider {
->setError($e_pass));
if ($errors) {
$errors = id(new AphrontErrorView())->setErrors($errors);
$errors = id(new PHUIErrorView())->setErrors($errors);
}
$dialog->appendChild($errors);
......
......@@ -194,7 +194,7 @@ final class PhabricatorPasswordAuthProvider extends PhabricatorAuthProvider {
}
if ($errors) {
$errors = id(new AphrontErrorView())->setErrors($errors);
$errors = id(new PHUIErrorView())->setErrors($errors);
}
$form = id(new PHUIFormLayoutView())
......
......@@ -103,7 +103,7 @@ final class PhabricatorCalendarEventEditController
$error_view = null;
if ($errors) {
$error_view = id(new AphrontErrorView())
$error_view = id(new PHUIErrorView())
->setTitle(pht('Status can not be set!'))
->setErrors($errors);
}
......
......@@ -41,6 +41,9 @@ final class PhabricatorCalendarViewController
$month_view->setBrowseURI($request->getRequestURI());
$month_view->setUser($user);
$month_view->setHolidays($holidays);
if ($this->getNoticeView()) {
$month_view->setErrorView($this->getNoticeView());
}
$phids = mpull($statuses, 'getUserPHID');
$handles = $this->loadViewerHandles($phids);
......@@ -65,7 +68,6 @@ final class PhabricatorCalendarViewController
$nav->appendChild(
array(
$crumbs,
$this->getNoticeView(),
$month_view,
));
......@@ -81,23 +83,23 @@ final class PhabricatorCalendarViewController
$view = null;
if ($request->getExists('created')) {
$view = id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_NOTICE)
->setTitle(pht('Successfully created your status.'));
$view = id(new PHUIErrorView())
->setSeverity(PHUIErrorView::SEVERITY_NOTICE)
->appendChild(pht('Successfully created your status.'));
} else if ($request->getExists('updated')) {
$view = id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_NOTICE)
->setTitle(pht('Successfully updated your status.'));
$view = id(new PHUIErrorView())
->setSeverity(PHUIErrorView::SEVERITY_NOTICE)
->appendChild(pht('Successfully updated your status.'));
} else if ($request->getExists('deleted')) {
$view = id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_NOTICE)
->setTitle(pht('Successfully deleted your status.'));
$view = id(new PHUIErrorView())
->setSeverity(PHUIErrorView::SEVERITY_NOTICE)
->appendChild(pht('Successfully deleted your status.'));
} else if (!$request->getUser()->isLoggedIn()) {
$login_uri = id(new PhutilURI('/auth/start/'))
->setQueryParam('next', '/calendar/');
$view = id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_NOTICE)
->setTitle(
$view = id(new PHUIErrorView())
->setSeverity(PHUIErrorView::SEVERITY_NOTICE)
->appendChild(
pht(
'You are not logged in. %s to see your calendar events.',
phutil_tag(
......
......@@ -108,23 +108,23 @@ final class PhabricatorConfigEditController
$error_view = null;
if ($errors) {
$error_view = id(new AphrontErrorView())
$error_view = id(new PHUIErrorView())
->setErrors($errors);
} else if ($option->getHidden()) {
$msg = pht(
'This configuration is hidden and can not be edited or viewed from '.
'the web interface.');
$error_view = id(new AphrontErrorView())
$error_view = id(new PHUIErrorView())
->setTitle(pht('Configuration Hidden'))
->setSeverity(AphrontErrorView::SEVERITY_WARNING)
->setSeverity(PHUIErrorView::SEVERITY_WARNING)
->appendChild(phutil_tag('p', array(), $msg));
} else if ($option->getLocked()) {
$msg = $option->getLockedMessage();
$error_view = id(new AphrontErrorView())
$error_view = id(new PHUIErrorView())
->setTitle(pht('Configuration Locked'))
->setSeverity(AphrontErrorView::SEVERITY_NOTICE)
->setSeverity(PHUIErrorView::SEVERITY_NOTICE)
->appendChild(phutil_tag('p', array(), $msg));
}
......
......@@ -18,8 +18,8 @@ final class PhabricatorConfigIssueViewController
PhabricatorSetupCheck::countUnignoredIssues($issues));
if (empty($issues[$this->issueKey])) {
$content = id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_NOTICE)
$content = id(new PHUIErrorView())
->setSeverity(PHUIErrorView::SEVERITY_NOTICE)
->setTitle(pht('Issue Resolved'))
->appendChild(pht('This setup issue has been resolved. '))
->appendChild(
......
......@@ -165,7 +165,7 @@ final class ConpherenceUpdateController
}
if ($errors) {
$error_view = id(new AphrontErrorView())
$error_view = id(new PHUIErrorView())
->setErrors($errors);
}
......
......@@ -24,13 +24,13 @@ final class PhabricatorWorkerTaskDetailController
if (!$task) {
$title = pht('Task Does Not Exist');
$error_view = new AphrontErrorView();
$error_view = new PHUIErrorView();
$error_view->setTitle(pht('No Such Task'));
$error_view->appendChild(phutil_tag(
'p',
array(),
pht('This task may have recently been garbage collected.')));
$error_view->setSeverity(AphrontErrorView::SEVERITY_NODATA);
$error_view->setSeverity(PHUIErrorView::SEVERITY_NODATA);
$content = $error_view;
} else {
......
......@@ -56,8 +56,8 @@ final class PhabricatorDashboardManageController
'make changes, make a copy first.');
$box->setErrorView(
id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_NOTICE)
id(new PHUIErrorView())
->setSeverity(PHUIErrorView::SEVERITY_NOTICE)
->setErrors(array($no_edit)));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment