From 3da38c74da2153944161f1b96b1491acb960e2aa Mon Sep 17 00:00:00 2001 From: Chad Little Date: Sun, 1 Feb 2015 20:14:56 -0800 Subject: [PATCH] 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 --- resources/celerity/map.php | 24 ++--- resources/celerity/packages.php | 2 +- src/__phutil_library_map__.php | 8 +- ...AphrontDefaultApplicationConfiguration.php | 2 +- .../almanac/controller/AlmanacController.php | 4 +- .../controller/PhabricatorAuthController.php | 2 +- ...bricatorAuthNeedsMultiFactorController.php | 8 +- .../PhabricatorAuthRegisterController.php | 4 +- .../PhabricatorEmailLoginController.php | 2 +- .../PhabricatorMustVerifyEmailController.php | 4 +- .../config/PhabricatorAuthListController.php | 6 +- .../provider/PhabricatorLDAPAuthProvider.php | 2 +- .../PhabricatorPasswordAuthProvider.php | 2 +- ...PhabricatorCalendarEventEditController.php | 2 +- .../PhabricatorCalendarViewController.php | 28 ++--- .../PhabricatorConfigEditController.php | 10 +- .../PhabricatorConfigIssueViewController.php | 4 +- .../ConpherenceUpdateController.php | 2 +- .../PhabricatorWorkerTaskDetailController.php | 4 +- .../PhabricatorDashboardManageController.php | 4 +- .../PhabricatorDashboardViewController.php | 4 +- .../DifferentialDiffViewController.php | 4 +- .../DifferentialRevisionLandController.php | 2 +- .../DifferentialRevisionViewController.php | 12 +-- .../view/DifferentialAddCommentView.php | 2 +- .../DiffusionBrowseFileController.php | 8 +- .../DiffusionBrowseSearchController.php | 2 +- .../controller/DiffusionCommitController.php | 10 +- .../controller/DiffusionController.php | 4 +- .../DiffusionExternalController.php | 4 +- .../DiffusionMirrorEditController.php | 2 +- .../DiffusionRepositoryController.php | 4 +- .../DiffusionSetPasswordSettingsPanel.php | 4 +- .../view/DiffusionEmptyResultView.php | 10 +- .../controller/DivinerAtomController.php | 4 +- .../PhabricatorFactHomeController.php | 4 +- .../HarbormasterPlanRunController.php | 2 +- .../HarbormasterStepAddController.php | 2 +- .../controller/HeraldTranscriptController.php | 12 +-- .../LegalpadDocumentSignController.php | 14 +-- .../LegalpadDocumentSignatureSearchEngine.php | 4 +- .../controller/ManiphestReportController.php | 4 +- .../ManiphestTaskEditController.php | 4 +- ...bricatorApplicationEditEmailController.php | 2 +- ...habricatorNotificationStatusController.php | 2 +- .../PhabricatorOAuthServerController.php | 4 +- .../PassphraseCredentialEditController.php | 2 +- .../PhabricatorPeopleLdapController.php | 4 +- .../PhabricatorPeopleRenameController.php | 2 +- .../phame/controller/PhameController.php | 4 +- .../post/PhamePostNewController.php | 4 +- .../post/PhamePostViewController.php | 8 +- .../controller/PhortuneCartViewController.php | 4 +- .../PhortunePaymentMethodCreateController.php | 2 +- .../controller/PhragmentController.php | 4 +- .../controller/PhragmentCreateController.php | 2 +- .../controller/PhragmentUpdateController.php | 2 +- .../PhrictionDocumentController.php | 24 ++--- .../controller/PhrictionEditController.php | 4 +- .../PhabricatorPolicyEditController.php | 2 +- .../PonderQuestionViewController.php | 4 +- .../request/ReleephRequestEditController.php | 4 +- ...PhabricatorApplicationSearchController.php | 2 +- ...ricatorConduitCertificateSettingsPanel.php | 4 +- ...PhabricatorEmailAddressesSettingsPanel.php | 2 +- .../PhabricatorUIExampleRenderController.php | 1 + .../uiexample/examples/PHUIErrorExample.php | 69 ++++++++++++ .../examples/PhabricatorErrorUIExample.php | 42 -------- src/view/AphrontDialogView.php | 2 +- ...AphrontErrorView.php => PHUIErrorView.php} | 33 +++--- src/view/phui/PHUIObjectBoxView.php | 10 +- src/view/phui/PHUIObjectItemListView.php | 4 +- src/view/phui/PHUIPinboardView.php | 4 +- .../phui/calendar/PHUICalendarMonthView.php | 10 ++ webroot/rsrc/css/aphront/error-view.css | 95 ---------------- .../css/application/dashboard/dashboard.css | 2 +- webroot/rsrc/css/application/phame/phame.css | 2 +- webroot/rsrc/css/phui/phui-error-view.css | 102 ++++++++++++++++++ webroot/rsrc/css/phui/phui-object-box.css | 2 +- .../css/phui/phui-object-item-list-view.css | 6 +- 80 files changed, 388 insertions(+), 334 deletions(-) create mode 100644 src/applications/uiexample/examples/PHUIErrorExample.php delete mode 100644 src/applications/uiexample/examples/PhabricatorErrorUIExample.php rename src/view/form/{AphrontErrorView.php => PHUIErrorView.php} (73%) delete mode 100644 webroot/rsrc/css/aphront/error-view.css create mode 100644 webroot/rsrc/css/phui/phui-error-view.css diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 3889e72aea..3a47f08008 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -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', diff --git a/resources/celerity/packages.php b/resources/celerity/packages.php index 1ab48eb2fc..359098499b 100644 --- a/resources/celerity/packages.php +++ b/resources/celerity/packages.php @@ -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', diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index ac1565dab7..1b8df8a31a 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -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', diff --git a/src/aphront/configuration/AphrontDefaultApplicationConfiguration.php b/src/aphront/configuration/AphrontDefaultApplicationConfiguration.php index ea6f3757d0..8d18837d5c 100644 --- a/src/aphront/configuration/AphrontDefaultApplicationConfiguration.php +++ b/src/aphront/configuration/AphrontDefaultApplicationConfiguration.php @@ -205,7 +205,7 @@ class AphrontDefaultApplicationConfiguration } if ($ex instanceof AphrontUsageException) { - $error = new AphrontErrorView(); + $error = new PHUIErrorView(); $error->setTitle($ex->getTitle()); $error->appendChild($ex->getMessage()); diff --git a/src/applications/almanac/controller/AlmanacController.php b/src/applications/almanac/controller/AlmanacController.php index cf1cda6902..4bf82a1580 100644 --- a/src/applications/almanac/controller/AlmanacController.php +++ b/src/applications/almanac/controller/AlmanacController.php @@ -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), diff --git a/src/applications/auth/controller/PhabricatorAuthController.php b/src/applications/auth/controller/PhabricatorAuthController.php index 91030d5749..e62f4e29af 100644 --- a/src/applications/auth/controller/PhabricatorAuthController.php +++ b/src/applications/auth/controller/PhabricatorAuthController.php @@ -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); diff --git a/src/applications/auth/controller/PhabricatorAuthNeedsMultiFactorController.php b/src/applications/auth/controller/PhabricatorAuthNeedsMultiFactorController.php index 86b96cead7..6647330ca4 100644 --- a/src/applications/auth/controller/PhabricatorAuthNeedsMultiFactorController.php +++ b/src/applications/auth/controller/PhabricatorAuthNeedsMultiFactorController.php @@ -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( diff --git a/src/applications/auth/controller/PhabricatorAuthRegisterController.php b/src/applications/auth/controller/PhabricatorAuthRegisterController.php index 53adf6be0d..a359305b6b 100644 --- a/src/applications/auth/controller/PhabricatorAuthRegisterController.php +++ b/src/applications/auth/controller/PhabricatorAuthRegisterController.php @@ -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( diff --git a/src/applications/auth/controller/PhabricatorEmailLoginController.php b/src/applications/auth/controller/PhabricatorEmailLoginController.php index 92067fc3a3..7ddd618f73 100644 --- a/src/applications/auth/controller/PhabricatorEmailLoginController.php +++ b/src/applications/auth/controller/PhabricatorEmailLoginController.php @@ -128,7 +128,7 @@ EOBODY; $error_view = null; if ($errors) { - $error_view = new AphrontErrorView(); + $error_view = new PHUIErrorView(); $error_view->setErrors($errors); } diff --git a/src/applications/auth/controller/PhabricatorMustVerifyEmailController.php b/src/applications/auth/controller/PhabricatorMustVerifyEmailController.php index 8a1978750b..0b610bc8e9 100644 --- a/src/applications/auth/controller/PhabricatorMustVerifyEmailController.php +++ b/src/applications/auth/controller/PhabricatorMustVerifyEmailController.php @@ -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( diff --git a/src/applications/auth/controller/config/PhabricatorAuthListController.php b/src/applications/auth/controller/config/PhabricatorAuthListController.php index 672bd868f0..fcf8ec3556 100644 --- a/src/applications/auth/controller/config/PhabricatorAuthListController.php +++ b/src/applications/auth/controller/config/PhabricatorAuthListController.php @@ -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( diff --git a/src/applications/auth/provider/PhabricatorLDAPAuthProvider.php b/src/applications/auth/provider/PhabricatorLDAPAuthProvider.php index e722cb1db8..e90301571e 100644 --- a/src/applications/auth/provider/PhabricatorLDAPAuthProvider.php +++ b/src/applications/auth/provider/PhabricatorLDAPAuthProvider.php @@ -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); diff --git a/src/applications/auth/provider/PhabricatorPasswordAuthProvider.php b/src/applications/auth/provider/PhabricatorPasswordAuthProvider.php index 84e53dd501..1d583e1096 100644 --- a/src/applications/auth/provider/PhabricatorPasswordAuthProvider.php +++ b/src/applications/auth/provider/PhabricatorPasswordAuthProvider.php @@ -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()) diff --git a/src/applications/calendar/controller/PhabricatorCalendarEventEditController.php b/src/applications/calendar/controller/PhabricatorCalendarEventEditController.php index 67842084bc..d6f70b6a72 100644 --- a/src/applications/calendar/controller/PhabricatorCalendarEventEditController.php +++ b/src/applications/calendar/controller/PhabricatorCalendarEventEditController.php @@ -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); } diff --git a/src/applications/calendar/controller/PhabricatorCalendarViewController.php b/src/applications/calendar/controller/PhabricatorCalendarViewController.php index f7a0bdd0ff..625b9a393e 100644 --- a/src/applications/calendar/controller/PhabricatorCalendarViewController.php +++ b/src/applications/calendar/controller/PhabricatorCalendarViewController.php @@ -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( diff --git a/src/applications/config/controller/PhabricatorConfigEditController.php b/src/applications/config/controller/PhabricatorConfigEditController.php index 648bf820fd..12ee0be40a 100644 --- a/src/applications/config/controller/PhabricatorConfigEditController.php +++ b/src/applications/config/controller/PhabricatorConfigEditController.php @@ -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)); } diff --git a/src/applications/config/controller/PhabricatorConfigIssueViewController.php b/src/applications/config/controller/PhabricatorConfigIssueViewController.php index aecc94840d..6c169e82a9 100644 --- a/src/applications/config/controller/PhabricatorConfigIssueViewController.php +++ b/src/applications/config/controller/PhabricatorConfigIssueViewController.php @@ -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( diff --git a/src/applications/conpherence/controller/ConpherenceUpdateController.php b/src/applications/conpherence/controller/ConpherenceUpdateController.php index 4ed523bef4..9ab4cd68d9 100644 --- a/src/applications/conpherence/controller/ConpherenceUpdateController.php +++ b/src/applications/conpherence/controller/ConpherenceUpdateController.php @@ -165,7 +165,7 @@ final class ConpherenceUpdateController } if ($errors) { - $error_view = id(new AphrontErrorView()) + $error_view = id(new PHUIErrorView()) ->setErrors($errors); } diff --git a/src/applications/daemon/controller/PhabricatorWorkerTaskDetailController.php b/src/applications/daemon/controller/PhabricatorWorkerTaskDetailController.php index f562522b68..8f88c7f29b 100644 --- a/src/applications/daemon/controller/PhabricatorWorkerTaskDetailController.php +++ b/src/applications/daemon/controller/PhabricatorWorkerTaskDetailController.php @@ -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 { diff --git a/src/applications/dashboard/controller/PhabricatorDashboardManageController.php b/src/applications/dashboard/controller/PhabricatorDashboardManageController.php index f4c08f5555..904be4b898 100644 --- a/src/applications/dashboard/controller/PhabricatorDashboardManageController.php +++ b/src/applications/dashboard/controller/PhabricatorDashboardManageController.php @@ -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))); } diff --git a/src/applications/dashboard/controller/PhabricatorDashboardViewController.php b/src/applications/dashboard/controller/PhabricatorDashboardViewController.php index 1517d064b5..bda1bf0516 100644 --- a/src/applications/dashboard/controller/PhabricatorDashboardViewController.php +++ b/src/applications/dashboard/controller/PhabricatorDashboardViewController.php @@ -66,8 +66,8 @@ final class PhabricatorDashboardViewController $id = $this->id; $manage_uri = $this->getApplicationURI("manage/{$id}/"); - return id(new AphrontErrorView()) - ->setSeverity(AphrontErrorView::SEVERITY_NODATA) + return id(new PHUIErrorView()) + ->setSeverity(PHUIErrorView::SEVERITY_NODATA) ->appendChild( pht('This dashboard has no panels '. 'yet. Use %s to add panels.', diff --git a/src/applications/differential/controller/DifferentialDiffViewController.php b/src/applications/differential/controller/DifferentialDiffViewController.php index 39f2d18b15..b923afd64a 100644 --- a/src/applications/differential/controller/DifferentialDiffViewController.php +++ b/src/applications/differential/controller/DifferentialDiffViewController.php @@ -24,8 +24,8 @@ final class DifferentialDiffViewController extends DifferentialController { return new Aphront404Response(); } - $error_view = id(new AphrontErrorView()) - ->setSeverity(AphrontErrorView::SEVERITY_NOTICE); + $error_view = id(new PHUIErrorView()) + ->setSeverity(PHUIErrorView::SEVERITY_NOTICE); if ($diff->getRevisionID()) { $error_view->appendChild( pht( diff --git a/src/applications/differential/controller/DifferentialRevisionLandController.php b/src/applications/differential/controller/DifferentialRevisionLandController.php index 36ebf5fb90..aafadcfb11 100644 --- a/src/applications/differential/controller/DifferentialRevisionLandController.php +++ b/src/applications/differential/controller/DifferentialRevisionLandController.php @@ -52,7 +52,7 @@ final class DifferentialRevisionLandController extends DifferentialController { } else { $text = phutil_tag('pre', array(), $ex->getMessage()); } - $text = id(new AphrontErrorView()) + $text = id(new PHUIErrorView()) ->appendChild($text); } diff --git a/src/applications/differential/controller/DifferentialRevisionViewController.php b/src/applications/differential/controller/DifferentialRevisionViewController.php index 3ff07524ff..5a2e4dd79d 100644 --- a/src/applications/differential/controller/DifferentialRevisionViewController.php +++ b/src/applications/differential/controller/DifferentialRevisionViewController.php @@ -137,9 +137,9 @@ final class DifferentialRevisionViewController extends DifferentialController { $large = $request->getStr('large'); if (count($changesets) > $limit && !$large) { $count = count($changesets); - $warning = new AphrontErrorView(); + $warning = new PHUIErrorView(); $warning->setTitle('Very Large Diff'); - $warning->setSeverity(AphrontErrorView::SEVERITY_WARNING); + $warning->setSeverity(PHUIErrorView::SEVERITY_WARNING); $warning->appendChild(hsprintf( '%s %s', pht( @@ -258,8 +258,8 @@ final class DifferentialRevisionViewController extends DifferentialController { $warning_handle_map, $handles); if ($revision_warnings) { - $revision_warnings = id(new AphrontErrorView()) - ->setSeverity(AphrontErrorView::SEVERITY_WARNING) + $revision_warnings = id(new PHUIErrorView()) + ->setSeverity(PHUIErrorView::SEVERITY_WARNING) ->setErrors($revision_warnings); $revision_detail_box->setErrorView($revision_warnings); } @@ -386,8 +386,8 @@ final class DifferentialRevisionViewController extends DifferentialController { $review_warnings = array_mergev($review_warnings); if ($review_warnings) { - $review_warnings_panel = id(new AphrontErrorView()) - ->setSeverity(AphrontErrorView::SEVERITY_WARNING) + $review_warnings_panel = id(new PHUIErrorView()) + ->setSeverity(PHUIErrorView::SEVERITY_WARNING) ->setErrors($review_warnings); $comment_form->setErrorView($review_warnings_panel); } diff --git a/src/applications/differential/view/DifferentialAddCommentView.php b/src/applications/differential/view/DifferentialAddCommentView.php index acb657bd2e..19de41fabc 100644 --- a/src/applications/differential/view/DifferentialAddCommentView.php +++ b/src/applications/differential/view/DifferentialAddCommentView.php @@ -10,7 +10,7 @@ final class DifferentialAddCommentView extends AphrontView { private $ccs = array(); private $errorView; - public function setErrorView(AphrontErrorView $error_view) { + public function setErrorView(PHUIErrorView $error_view) { $this->errorView = $error_view; return $this; } diff --git a/src/applications/diffusion/controller/DiffusionBrowseFileController.php b/src/applications/diffusion/controller/DiffusionBrowseFileController.php index ce0b1f81b1..bba7832952 100644 --- a/src/applications/diffusion/controller/DiffusionBrowseFileController.php +++ b/src/applications/diffusion/controller/DiffusionBrowseFileController.php @@ -118,8 +118,8 @@ final class DiffusionBrowseFileController extends DiffusionBrowseController { $follow = $request->getStr('follow'); if ($follow) { - $notice = new AphrontErrorView(); - $notice->setSeverity(AphrontErrorView::SEVERITY_WARNING); + $notice = new PHUIErrorView(); + $notice->setSeverity(PHUIErrorView::SEVERITY_WARNING); $notice->setTitle(pht('Unable to Continue')); switch ($follow) { case 'first': @@ -138,8 +138,8 @@ final class DiffusionBrowseFileController extends DiffusionBrowseController { $renamed = $request->getStr('renamed'); if ($renamed) { - $notice = new AphrontErrorView(); - $notice->setSeverity(AphrontErrorView::SEVERITY_NOTICE); + $notice = new PHUIErrorView(); + $notice->setSeverity(PHUIErrorView::SEVERITY_NOTICE); $notice->setTitle(pht('File Renamed')); $notice->appendChild( pht("File history passes through a rename from '%s' to '%s'.", diff --git a/src/applications/diffusion/controller/DiffusionBrowseSearchController.php b/src/applications/diffusion/controller/DiffusionBrowseSearchController.php index 5c9c633aa5..1070ec1bfd 100644 --- a/src/applications/diffusion/controller/DiffusionBrowseSearchController.php +++ b/src/applications/diffusion/controller/DiffusionBrowseSearchController.php @@ -81,7 +81,7 @@ final class DiffusionBrowseSearchController extends DiffusionBrowseController { } catch (ConduitException $ex) { $err = $ex->getErrorDescription(); if ($err != '') { - return id(new AphrontErrorView()) + return id(new PHUIErrorView()) ->setTitle(pht('Search Error')) ->appendChild($err); } diff --git a/src/applications/diffusion/controller/DiffusionCommitController.php b/src/applications/diffusion/controller/DiffusionCommitController.php index 920b0c2e2c..2e0a9931e9 100644 --- a/src/applications/diffusion/controller/DiffusionCommitController.php +++ b/src/applications/diffusion/controller/DiffusionCommitController.php @@ -52,7 +52,7 @@ final class DiffusionCommitController extends DiffusionController { return new Aphront404Response(); } - $error = id(new AphrontErrorView()) + $error = id(new PHUIErrorView()) ->setTitle(pht('Commit Still Parsing')) ->appendChild( pht( @@ -79,9 +79,9 @@ final class DiffusionCommitController extends DiffusionController { if ($is_foreign) { $subpath = $commit_data->getCommitDetail('svn-subpath'); - $error_panel = new AphrontErrorView(); + $error_panel = new PHUIErrorView(); $error_panel->setTitle(pht('Commit Not Tracked')); - $error_panel->setSeverity(AphrontErrorView::SEVERITY_WARNING); + $error_panel->setSeverity(PHUIErrorView::SEVERITY_WARNING); $error_panel->appendChild( pht("This Diffusion repository is configured to track only one ". "subdirectory of the entire Subversion repository, and this commit ". @@ -251,8 +251,8 @@ final class DiffusionCommitController extends DiffusionController { ->setTag('a') ->setIcon($icon); - $warning_view = id(new AphrontErrorView()) - ->setSeverity(AphrontErrorView::SEVERITY_WARNING) + $warning_view = id(new PHUIErrorView()) + ->setSeverity(PHUIErrorView::SEVERITY_WARNING) ->setTitle('Very Large Commit') ->appendChild( pht('This commit is very large. Load each file individually.')); diff --git a/src/applications/diffusion/controller/DiffusionController.php b/src/applications/diffusion/controller/DiffusionController.php index a65ef58d65..f3d84b6790 100644 --- a/src/applications/diffusion/controller/DiffusionController.php +++ b/src/applications/diffusion/controller/DiffusionController.php @@ -243,8 +243,8 @@ abstract class DiffusionController extends PhabricatorController { } protected function renderStatusMessage($title, $body) { - return id(new AphrontErrorView()) - ->setSeverity(AphrontErrorView::SEVERITY_WARNING) + return id(new PHUIErrorView()) + ->setSeverity(PHUIErrorView::SEVERITY_WARNING) ->setTitle($title) ->appendChild($body); } diff --git a/src/applications/diffusion/controller/DiffusionExternalController.php b/src/applications/diffusion/controller/DiffusionExternalController.php index 18b15c967f..8dd9dd366c 100644 --- a/src/applications/diffusion/controller/DiffusionExternalController.php +++ b/src/applications/diffusion/controller/DiffusionExternalController.php @@ -69,9 +69,9 @@ final class DiffusionExternalController extends DiffusionController { } $desc .= $id; - $content = id(new AphrontErrorView()) + $content = id(new PHUIErrorView()) ->setTitle(pht('Unknown External')) - ->setSeverity(AphrontErrorView::SEVERITY_WARNING) + ->setSeverity(PHUIErrorView::SEVERITY_WARNING) ->appendChild(phutil_tag( 'p', array(), diff --git a/src/applications/diffusion/controller/DiffusionMirrorEditController.php b/src/applications/diffusion/controller/DiffusionMirrorEditController.php index a45b24bcdf..07bc174821 100644 --- a/src/applications/diffusion/controller/DiffusionMirrorEditController.php +++ b/src/applications/diffusion/controller/DiffusionMirrorEditController.php @@ -84,7 +84,7 @@ final class DiffusionMirrorEditController $form_errors = null; if ($errors) { - $form_errors = id(new AphrontErrorView()) + $form_errors = id(new PHUIErrorView()) ->setErrors($errors); } diff --git a/src/applications/diffusion/controller/DiffusionRepositoryController.php b/src/applications/diffusion/controller/DiffusionRepositoryController.php index 69946f271a..f0fd121719 100644 --- a/src/applications/diffusion/controller/DiffusionRepositoryController.php +++ b/src/applications/diffusion/controller/DiffusionRepositoryController.php @@ -68,9 +68,9 @@ final class DiffusionRepositoryController extends DiffusionController { if ($page_has_content) { $content[] = $this->buildNormalContent($drequest); } else { - $content[] = id(new AphrontErrorView()) + $content[] = id(new PHUIErrorView()) ->setTitle($empty_title) - ->setSeverity(AphrontErrorView::SEVERITY_WARNING) + ->setSeverity(PHUIErrorView::SEVERITY_WARNING) ->setErrors(array($empty_message)); } diff --git a/src/applications/diffusion/panel/DiffusionSetPasswordSettingsPanel.php b/src/applications/diffusion/panel/DiffusionSetPasswordSettingsPanel.php index 5e0c6647ab..2202029106 100644 --- a/src/applications/diffusion/panel/DiffusionSetPasswordSettingsPanel.php +++ b/src/applications/diffusion/panel/DiffusionSetPasswordSettingsPanel.php @@ -258,8 +258,8 @@ final class DiffusionSetPasswordSettingsPanel extends PhabricatorSettingsPanel { $saved = null; if ($request->getBool('saved')) { - $saved = id(new AphrontErrorView()) - ->setSeverity(AphrontErrorView::SEVERITY_NOTICE) + $saved = id(new PHUIErrorView()) + ->setSeverity(PHUIErrorView::SEVERITY_NOTICE) ->setTitle(pht('Password Updated')) ->appendChild(pht('Your VCS password has been updated.')); } diff --git a/src/applications/diffusion/view/DiffusionEmptyResultView.php b/src/applications/diffusion/view/DiffusionEmptyResultView.php index e8a8de7641..4066c03fe1 100644 --- a/src/applications/diffusion/view/DiffusionEmptyResultView.php +++ b/src/applications/diffusion/view/DiffusionEmptyResultView.php @@ -33,12 +33,12 @@ final class DiffusionEmptyResultView extends DiffusionView { // TODO: Under git, this error message should be more specific. It // may exist on some other branch. $body = pht('This path does not exist anywhere.'); - $severity = AphrontErrorView::SEVERITY_ERROR; + $severity = PHUIErrorView::SEVERITY_ERROR; break; case DiffusionBrowseResultSet::REASON_IS_EMPTY: $title = pht('Empty Directory'); $body = pht("This path was an empty directory at %s.\n", $commit); - $severity = AphrontErrorView::SEVERITY_NOTICE; + $severity = PHUIErrorView::SEVERITY_NOTICE; break; case DiffusionBrowseResultSet::REASON_IS_DELETED: $deleted = $this->browseResultSet->getDeletedAtCommit(); @@ -60,7 +60,7 @@ final class DiffusionEmptyResultView extends DiffusionView { self::linkCommit($drequest->getRepository(), $deleted), $browse, "r{$callsign}{$existed}"); - $severity = AphrontErrorView::SEVERITY_WARNING; + $severity = PHUIErrorView::SEVERITY_WARNING; break; case DiffusionBrowseResultSet::REASON_IS_UNTRACKED_PARENT: $subdir = $drequest->getRepository()->getDetail('svn-subpath'); @@ -70,13 +70,13 @@ final class DiffusionEmptyResultView extends DiffusionView { "of the entire repository ('%s'), ". "but you aren't looking at something in that subdirectory, so no ". "information is available.", $subdir); - $severity = AphrontErrorView::SEVERITY_WARNING; + $severity = PHUIErrorView::SEVERITY_WARNING; break; default: throw new Exception("Unknown failure reason: $reason"); } - $error_view = new AphrontErrorView(); + $error_view = new PHUIErrorView(); $error_view->setSeverity($severity); $error_view->setTitle($title); $error_view->appendChild(phutil_tag('p', array(), $body)); diff --git a/src/applications/diviner/controller/DivinerAtomController.php b/src/applications/diviner/controller/DivinerAtomController.php index 749d689ead..49471d28dc 100644 --- a/src/applications/diviner/controller/DivinerAtomController.php +++ b/src/applications/diviner/controller/DivinerAtomController.php @@ -92,10 +92,10 @@ final class DivinerAtomController extends DivinerController { $warnings = $atom->getWarnings(); if ($warnings) { - $warnings = id(new AphrontErrorView()) + $warnings = id(new PHUIErrorView()) ->setErrors($warnings) ->setTitle(pht('Documentation Warnings')) - ->setSeverity(AphrontErrorView::SEVERITY_WARNING); + ->setSeverity(PHUIErrorView::SEVERITY_WARNING); } $methods = $this->composeMethods($symbol); diff --git a/src/applications/fact/controller/PhabricatorFactHomeController.php b/src/applications/fact/controller/PhabricatorFactHomeController.php index e5479e659d..6f4be4b94d 100644 --- a/src/applications/fact/controller/PhabricatorFactHomeController.php +++ b/src/applications/fact/controller/PhabricatorFactHomeController.php @@ -97,8 +97,8 @@ final class PhabricatorFactHomeController extends PhabricatorFactController { } if (!$options) { - return id(new AphrontErrorView()) - ->setSeverity(AphrontErrorView::SEVERITY_NOTICE) + return id(new PHUIErrorView()) + ->setSeverity(PHUIErrorView::SEVERITY_NOTICE) ->setTitle(pht('No Chartable Facts')) ->appendChild(phutil_tag( 'p', diff --git a/src/applications/harbormaster/controller/HarbormasterPlanRunController.php b/src/applications/harbormaster/controller/HarbormasterPlanRunController.php index 9eeabfc29d..0997464284 100644 --- a/src/applications/harbormaster/controller/HarbormasterPlanRunController.php +++ b/src/applications/harbormaster/controller/HarbormasterPlanRunController.php @@ -63,7 +63,7 @@ final class HarbormasterPlanRunController extends HarbormasterController { } if ($errors) { - $errors = id(new AphrontErrorView())->setErrors($errors); + $errors = id(new PHUIErrorView())->setErrors($errors); } $title = pht('Run Build Plan Manually'); diff --git a/src/applications/harbormaster/controller/HarbormasterStepAddController.php b/src/applications/harbormaster/controller/HarbormasterStepAddController.php index 0d02713091..2bdbd2f790 100644 --- a/src/applications/harbormaster/controller/HarbormasterStepAddController.php +++ b/src/applications/harbormaster/controller/HarbormasterStepAddController.php @@ -50,7 +50,7 @@ final class HarbormasterStepAddController extends HarbormasterController { } if ($errors) { - $errors = id(new AphrontErrorView()) + $errors = id(new PHUIErrorView()) ->setErrors($errors); } diff --git a/src/applications/herald/controller/HeraldTranscriptController.php b/src/applications/herald/controller/HeraldTranscriptController.php index 0d46421a02..7d5aa7b6ec 100644 --- a/src/applications/herald/controller/HeraldTranscriptController.php +++ b/src/applications/herald/controller/HeraldTranscriptController.php @@ -42,8 +42,8 @@ final class HeraldTranscriptController extends HeraldController { $object_xscript = $xscript->getObjectTranscript(); if (!$object_xscript) { - $notice = id(new AphrontErrorView()) - ->setSeverity(AphrontErrorView::SEVERITY_NOTICE) + $notice = id(new PHUIErrorView()) + ->setSeverity(PHUIErrorView::SEVERITY_NOTICE) ->setTitle(pht('Old Transcript')) ->appendChild(phutil_tag( 'p', @@ -75,8 +75,8 @@ final class HeraldTranscriptController extends HeraldController { $this->handles = $handles; if ($xscript->getDryRun()) { - $notice = new AphrontErrorView(); - $notice->setSeverity(AphrontErrorView::SEVERITY_NOTICE); + $notice = new PHUIErrorView(); + $notice->setSeverity(PHUIErrorView::SEVERITY_NOTICE); $notice->setTitle(pht('Dry Run')); $notice->appendChild(pht('This was a dry run to test Herald '. 'rules, no actions were executed.')); @@ -319,8 +319,8 @@ final class HeraldTranscriptController extends HeraldController { } else { return $panel; } - $panel = id(new AphrontErrorView()) - ->setSeverity(AphrontErrorView::SEVERITY_WARNING) + $panel = id(new PHUIErrorView()) + ->setSeverity(PHUIErrorView::SEVERITY_WARNING) ->setTitle($title) ->appendChild($body); } diff --git a/src/applications/legalpad/controller/LegalpadDocumentSignController.php b/src/applications/legalpad/controller/LegalpadDocumentSignController.php index 88f76cc0c2..080b6dd594 100644 --- a/src/applications/legalpad/controller/LegalpadDocumentSignController.php +++ b/src/applications/legalpad/controller/LegalpadDocumentSignController.php @@ -65,8 +65,8 @@ final class LegalpadDocumentSignController extends LegalpadController { // If they aren't logged in, we can't be as sure, so don't show // anything. if ($viewer->isLoggedIn()) { - $signed_status = id(new AphrontErrorView()) - ->setSeverity(AphrontErrorView::SEVERITY_WARNING) + $signed_status = id(new PHUIErrorView()) + ->setSeverity(PHUIErrorView::SEVERITY_WARNING) ->setErrors( array( pht('You have not signed this document yet.'), @@ -95,8 +95,8 @@ final class LegalpadDocumentSignController extends LegalpadController { phabricator_datetime($signed_at, $viewer)); } - $signed_status = id(new AphrontErrorView()) - ->setSeverity(AphrontErrorView::SEVERITY_NOTICE) + $signed_status = id(new PHUIErrorView()) + ->setSeverity(PHUIErrorView::SEVERITY_NOTICE) ->setErrors(array($signed_text)); } @@ -121,8 +121,8 @@ final class LegalpadDocumentSignController extends LegalpadController { $login_text = pht( 'This document requires a corporate signatory. You must log in to '. 'accept this document on behalf of a company you represent.'); - $signed_status = id(new AphrontErrorView()) - ->setSeverity(AphrontErrorView::SEVERITY_WARNING) + $signed_status = id(new PHUIErrorView()) + ->setSeverity(PHUIErrorView::SEVERITY_WARNING) ->setErrors(array($login_text)); } @@ -254,7 +254,7 @@ final class LegalpadDocumentSignController extends LegalpadController { if (!$has_signed) { $error_view = null; if ($errors) { - $error_view = id(new AphrontErrorView()) + $error_view = id(new PHUIErrorView()) ->setErrors($errors); } diff --git a/src/applications/legalpad/query/LegalpadDocumentSignatureSearchEngine.php b/src/applications/legalpad/query/LegalpadDocumentSignatureSearchEngine.php index bed390bdb3..6ff09f412c 100644 --- a/src/applications/legalpad/query/LegalpadDocumentSignatureSearchEngine.php +++ b/src/applications/legalpad/query/LegalpadDocumentSignatureSearchEngine.php @@ -293,8 +293,8 @@ final class LegalpadDocumentSignatureSearchEngine ->appendChild($table); if (!$this->document) { - $policy_notice = id(new AphrontErrorView()) - ->setSeverity(AphrontErrorView::SEVERITY_NOTICE) + $policy_notice = id(new PHUIErrorView()) + ->setSeverity(PHUIErrorView::SEVERITY_NOTICE) ->setErrors( array( pht( diff --git a/src/applications/maniphest/controller/ManiphestReportController.php b/src/applications/maniphest/controller/ManiphestReportController.php index e5c94ee368..bc27adf906 100644 --- a/src/applications/maniphest/controller/ManiphestReportController.php +++ b/src/applications/maniphest/controller/ManiphestReportController.php @@ -261,9 +261,9 @@ final class ManiphestReportController extends ManiphestController { } if ($caption) { - $caption = id(new AphrontErrorView()) + $caption = id(new PHUIErrorView()) ->appendChild($caption) - ->setSeverity(AphrontErrorView::SEVERITY_NOTICE); + ->setSeverity(PHUIErrorView::SEVERITY_NOTICE); } $panel = new PHUIObjectBoxView(); diff --git a/src/applications/maniphest/controller/ManiphestTaskEditController.php b/src/applications/maniphest/controller/ManiphestTaskEditController.php index c48be33099..08d5ab9ba4 100644 --- a/src/applications/maniphest/controller/ManiphestTaskEditController.php +++ b/src/applications/maniphest/controller/ManiphestTaskEditController.php @@ -522,7 +522,7 @@ final class ManiphestTaskEditController extends ManiphestController { $error_view = null; if ($errors) { - $error_view = new AphrontErrorView(); + $error_view = new PHUIErrorView(); $error_view->setErrors($errors); } @@ -692,7 +692,7 @@ final class ManiphestTaskEditController extends ManiphestController { $field_list->appendFieldsToForm($form); - require_celerity_resource('aphront-error-view-css'); + require_celerity_resource('phui-error-view-css'); Javelin::initBehavior('project-create', array( 'tokenizerID' => $project_tokenizer_id, diff --git a/src/applications/meta/controller/PhabricatorApplicationEditEmailController.php b/src/applications/meta/controller/PhabricatorApplicationEditEmailController.php index 8b37289e1a..d18d28098e 100644 --- a/src/applications/meta/controller/PhabricatorApplicationEditEmailController.php +++ b/src/applications/meta/controller/PhabricatorApplicationEditEmailController.php @@ -247,7 +247,7 @@ final class PhabricatorApplicationEditEmailController } if ($errors) { - $errors = id(new AphrontErrorView()) + $errors = id(new PHUIErrorView()) ->setErrors($errors); } diff --git a/src/applications/notification/controller/PhabricatorNotificationStatusController.php b/src/applications/notification/controller/PhabricatorNotificationStatusController.php index d3585876b6..209f21ad3e 100644 --- a/src/applications/notification/controller/PhabricatorNotificationStatusController.php +++ b/src/applications/notification/controller/PhabricatorNotificationStatusController.php @@ -8,7 +8,7 @@ final class PhabricatorNotificationStatusController $status = PhabricatorNotificationClient::getServerStatus(); $status = $this->renderServerStatus($status); } catch (Exception $ex) { - $status = new AphrontErrorView(); + $status = new PHUIErrorView(); $status->setTitle('Notification Server Issue'); $status->appendChild(hsprintf( 'Unable to determine server status. This probably means the server '. diff --git a/src/applications/oauthserver/controller/PhabricatorOAuthServerController.php b/src/applications/oauthserver/controller/PhabricatorOAuthServerController.php index 10fd1436ac..a7de3ef258 100644 --- a/src/applications/oauthserver/controller/PhabricatorOAuthServerController.php +++ b/src/applications/oauthserver/controller/PhabricatorOAuthServerController.php @@ -55,8 +55,8 @@ abstract class PhabricatorOAuthServerController } protected function buildErrorView($error_message) { - $error = new AphrontErrorView(); - $error->setSeverity(AphrontErrorView::SEVERITY_ERROR); + $error = new PHUIErrorView(); + $error->setSeverity(PHUIErrorView::SEVERITY_ERROR); $error->setTitle($error_message); return $error; diff --git a/src/applications/passphrase/controller/PassphraseCredentialEditController.php b/src/applications/passphrase/controller/PassphraseCredentialEditController.php index 7a2f4c99ff..a589106eff 100644 --- a/src/applications/passphrase/controller/PassphraseCredentialEditController.php +++ b/src/applications/passphrase/controller/PassphraseCredentialEditController.php @@ -322,7 +322,7 @@ final class PassphraseCredentialEditController extends PassphraseController { if ($request->isAjax()) { if ($errors) { - $errors = id(new AphrontErrorView())->setErrors($errors); + $errors = id(new PHUIErrorView())->setErrors($errors); } $dialog = id(new AphrontDialogView()) diff --git a/src/applications/people/controller/PhabricatorPeopleLdapController.php b/src/applications/people/controller/PhabricatorPeopleLdapController.php index 78d6150ff6..0f51e8f388 100644 --- a/src/applications/people/controller/PhabricatorPeopleLdapController.php +++ b/src/applications/people/controller/PhabricatorPeopleLdapController.php @@ -69,8 +69,8 @@ final class PhabricatorPeopleLdapController $emails = $request->getArr('email'); $names = $request->getArr('name'); - $notice_view = new AphrontErrorView(); - $notice_view->setSeverity(AphrontErrorView::SEVERITY_NOTICE); + $notice_view = new PHUIErrorView(); + $notice_view->setSeverity(PHUIErrorView::SEVERITY_NOTICE); $notice_view->setTitle(pht('Import Successful')); $notice_view->setErrors(array( pht('Successfully imported users from LDAP'), diff --git a/src/applications/people/controller/PhabricatorPeopleRenameController.php b/src/applications/people/controller/PhabricatorPeopleRenameController.php index aef56c295e..c112a7d0a7 100644 --- a/src/applications/people/controller/PhabricatorPeopleRenameController.php +++ b/src/applications/people/controller/PhabricatorPeopleRenameController.php @@ -101,7 +101,7 @@ final class PhabricatorPeopleRenameController ->setError($e_username)); if ($errors) { - $errors = id(new AphrontErrorView())->setErrors($errors); + $errors = id(new PHUIErrorView())->setErrors($errors); } return $this->newDialog() diff --git a/src/applications/phame/controller/PhameController.php b/src/applications/phame/controller/PhameController.php index 60b73b7572..0f6ef6d704 100644 --- a/src/applications/phame/controller/PhameController.php +++ b/src/applications/phame/controller/PhameController.php @@ -95,8 +95,8 @@ abstract class PhameController extends PhabricatorController { } if (empty($stories)) { - return id(new AphrontErrorView()) - ->setSeverity(AphrontErrorView::SEVERITY_NODATA) + return id(new PHUIErrorView()) + ->setSeverity(PHUIErrorView::SEVERITY_NODATA) ->appendChild($nodata); } diff --git a/src/applications/phame/controller/post/PhamePostNewController.php b/src/applications/phame/controller/post/PhamePostNewController.php index 99e4b77e97..bc63ba0c5c 100644 --- a/src/applications/phame/controller/post/PhamePostNewController.php +++ b/src/applications/phame/controller/post/PhamePostNewController.php @@ -70,8 +70,8 @@ final class PhamePostNewController extends PhameController { $nav->appendChild($crumbs); if (!$blogs) { - $notification = id(new AphrontErrorView()) - ->setSeverity(AphrontErrorView::SEVERITY_NODATA) + $notification = id(new PHUIErrorView()) + ->setSeverity(PHUIErrorView::SEVERITY_NODATA) ->appendChild( pht('You do not have permission to join any blogs. Create a blog '. 'first, then you can post to it.')); diff --git a/src/applications/phame/controller/post/PhamePostViewController.php b/src/applications/phame/controller/post/PhamePostViewController.php index 37c0b809fd..92cf7a05c0 100644 --- a/src/applications/phame/controller/post/PhamePostViewController.php +++ b/src/applications/phame/controller/post/PhamePostViewController.php @@ -49,8 +49,8 @@ final class PhamePostViewController extends PhameController { if ($post->isDraft()) { $object_box->appendChild( - id(new AphrontErrorView()) - ->setSeverity(AphrontErrorView::SEVERITY_NOTICE) + id(new PHUIErrorView()) + ->setSeverity(PHUIErrorView::SEVERITY_NOTICE) ->setTitle(pht('Draft Post')) ->appendChild( pht('Only you can see this draft until you publish it. '. @@ -59,8 +59,8 @@ final class PhamePostViewController extends PhameController { if (!$post->getBlog()) { $object_box->appendChild( - id(new AphrontErrorView()) - ->setSeverity(AphrontErrorView::SEVERITY_WARNING) + id(new PHUIErrorView()) + ->setSeverity(PHUIErrorView::SEVERITY_WARNING) ->setTitle(pht('Not On A Blog')) ->appendChild( pht('This post is not associated with a blog (the blog may have '. diff --git a/src/applications/phortune/controller/PhortuneCartViewController.php b/src/applications/phortune/controller/PhortuneCartViewController.php index fb6dc70884..e11d539fb4 100644 --- a/src/applications/phortune/controller/PhortuneCartViewController.php +++ b/src/applications/phortune/controller/PhortuneCartViewController.php @@ -86,8 +86,8 @@ final class PhortuneCartViewController } break; case PhortuneCart::STATUS_PURCHASED: - $error_view = id(new AphrontErrorView()) - ->setSeverity(AphrontErrorView::SEVERITY_NOTICE) + $error_view = id(new PHUIErrorView()) + ->setSeverity(PHUIErrorView::SEVERITY_NOTICE) ->appendChild(pht('This purchase has been completed.')); break; diff --git a/src/applications/phortune/controller/PhortunePaymentMethodCreateController.php b/src/applications/phortune/controller/PhortunePaymentMethodCreateController.php index 831f3983b0..3fbf9c5649 100644 --- a/src/applications/phortune/controller/PhortunePaymentMethodCreateController.php +++ b/src/applications/phortune/controller/PhortunePaymentMethodCreateController.php @@ -125,7 +125,7 @@ final class PhortunePaymentMethodCreateController $dialog = id(new AphrontDialogView()) ->setUser($viewer) ->setTitle(pht('Error Adding Payment Method')) - ->appendChild(id(new AphrontErrorView())->setErrors($errors)) + ->appendChild(id(new PHUIErrorView())->setErrors($errors)) ->addCancelButton($request->getRequestURI()); return id(new AphrontDialogResponse())->setDialog($dialog); diff --git a/src/applications/phragment/controller/PhragmentController.php b/src/applications/phragment/controller/PhragmentController.php index 254444928b..2a47c3a1b1 100644 --- a/src/applications/phragment/controller/PhragmentController.php +++ b/src/applications/phragment/controller/PhragmentController.php @@ -204,9 +204,9 @@ abstract class PhragmentController extends PhabricatorController { public function renderConfigurationWarningIfRequired() { $alt = PhabricatorEnv::getEnvConfig('security.alternate-file-domain'); if ($alt === null) { - return id(new AphrontErrorView()) + return id(new PHUIErrorView()) ->setTitle(pht('security.alternate-file-domain must be configured!')) - ->setSeverity(AphrontErrorView::SEVERITY_ERROR) + ->setSeverity(PHUIErrorView::SEVERITY_ERROR) ->appendChild(phutil_tag('p', array(), pht( 'Because Phragment generates files (such as ZIP archives and '. 'patches) as they are requested, it requires that you configure '. diff --git a/src/applications/phragment/controller/PhragmentCreateController.php b/src/applications/phragment/controller/PhragmentCreateController.php index 9f2543a59d..605b2f9c5e 100644 --- a/src/applications/phragment/controller/PhragmentCreateController.php +++ b/src/applications/phragment/controller/PhragmentCreateController.php @@ -64,7 +64,7 @@ final class PhragmentCreateController extends PhragmentController { return id(new AphrontRedirectResponse()) ->setURI('/phragment/browse/'.trim($parent_path.'/'.$v_name, '/')); } else { - $error_view = id(new AphrontErrorView()) + $error_view = id(new PHUIErrorView()) ->setErrors($errors) ->setTitle(pht('Errors while creating fragment')); } diff --git a/src/applications/phragment/controller/PhragmentUpdateController.php b/src/applications/phragment/controller/PhragmentUpdateController.php index 0c70442312..ea51ad3fb9 100644 --- a/src/applications/phragment/controller/PhragmentUpdateController.php +++ b/src/applications/phragment/controller/PhragmentUpdateController.php @@ -43,7 +43,7 @@ final class PhragmentUpdateController extends PhragmentController { return id(new AphrontRedirectResponse()) ->setURI('/phragment/browse/'.$fragment->getPath()); } else { - $error_view = id(new AphrontErrorView()) + $error_view = id(new PHUIErrorView()) ->setErrors($errors) ->setTitle(pht('Errors while updating fragment')); } diff --git a/src/applications/phriction/controller/PhrictionDocumentController.php b/src/applications/phriction/controller/PhrictionDocumentController.php index 084763334c..b09c8ef321 100644 --- a/src/applications/phriction/controller/PhrictionDocumentController.php +++ b/src/applications/phriction/controller/PhrictionDocumentController.php @@ -42,8 +42,8 @@ final class PhrictionDocumentController $create_uri = '/phriction/edit/?slug='.$slug; - $notice = new AphrontErrorView(); - $notice->setSeverity(AphrontErrorView::SEVERITY_NODATA); + $notice = new PHUIErrorView(); + $notice->setSeverity(PHUIErrorView::SEVERITY_NODATA); $notice->setTitle(pht('No content here!')); $notice->appendChild( pht( @@ -67,8 +67,8 @@ final class PhrictionDocumentController if ($content->getID() != $document->getContentID()) { $vdate = phabricator_datetime($content->getDateCreated(), $user); - $version_note = new AphrontErrorView(); - $version_note->setSeverity(AphrontErrorView::SEVERITY_NOTICE); + $version_note = new PHUIErrorView(); + $version_note->setSeverity(PHUIErrorView::SEVERITY_NOTICE); $version_note->appendChild( pht('You are viewing an older version of this document, as it '. 'appeared on %s.', $vdate)); @@ -88,16 +88,16 @@ final class PhrictionDocumentController $core_content = $content->renderContent($user); } else if ($current_status == PhrictionChangeType::CHANGE_DELETE) { - $notice = new AphrontErrorView(); - $notice->setSeverity(AphrontErrorView::SEVERITY_NOTICE); + $notice = new PHUIErrorView(); + $notice->setSeverity(PHUIErrorView::SEVERITY_NOTICE); $notice->setTitle(pht('Document Deleted')); $notice->appendChild( pht('This document has been deleted. You can edit it to put new '. 'content here, or use history to revert to an earlier version.')); $core_content = $notice->render(); } else if ($current_status == PhrictionChangeType::CHANGE_STUB) { - $notice = new AphrontErrorView(); - $notice->setSeverity(AphrontErrorView::SEVERITY_NOTICE); + $notice = new PHUIErrorView(); + $notice->setSeverity(PHUIErrorView::SEVERITY_NOTICE); $notice->setTitle(pht('Empty Document')); $notice->appendChild( pht('This document is empty. You can edit it to put some proper '. @@ -119,8 +119,8 @@ final class PhrictionDocumentController $slug_uri = PhrictionDocument::getSlugURI($new_doc->getSlug()); } - $notice = id(new AphrontErrorView()) - ->setSeverity(AphrontErrorView::SEVERITY_NOTICE); + $notice = id(new PHUIErrorView()) + ->setSeverity(PHUIErrorView::SEVERITY_NOTICE); if ($slug_uri) { $notice->appendChild( @@ -164,8 +164,8 @@ final class PhrictionDocumentController $slug_uri = PhrictionDocument::getSlugURI($from_doc->getSlug()); } - $move_notice = id(new AphrontErrorView()) - ->setSeverity(AphrontErrorView::SEVERITY_NOTICE); + $move_notice = id(new PHUIErrorView()) + ->setSeverity(PHUIErrorView::SEVERITY_NOTICE); if ($slug_uri) { $move_notice->appendChild( diff --git a/src/applications/phriction/controller/PhrictionEditController.php b/src/applications/phriction/controller/PhrictionEditController.php index 8433640040..fa520d5ce5 100644 --- a/src/applications/phriction/controller/PhrictionEditController.php +++ b/src/applications/phriction/controller/PhrictionEditController.php @@ -94,8 +94,8 @@ final class PhrictionEditController ), pht('discard this draft')); - $draft_note = new AphrontErrorView(); - $draft_note->setSeverity(AphrontErrorView::SEVERITY_NOTICE); + $draft_note = new PHUIErrorView(); + $draft_note->setSeverity(PHUIErrorView::SEVERITY_NOTICE); $draft_note->setTitle('Recovered Draft'); $draft_note->appendChild(hsprintf( '

Showing a saved draft of your edits, you can %s.

', diff --git a/src/applications/policy/controller/PhabricatorPolicyEditController.php b/src/applications/policy/controller/PhabricatorPolicyEditController.php index fc104647ff..240770ec14 100644 --- a/src/applications/policy/controller/PhabricatorPolicyEditController.php +++ b/src/applications/policy/controller/PhabricatorPolicyEditController.php @@ -138,7 +138,7 @@ final class PhabricatorPolicyEditController )); if ($errors) { - $errors = id(new AphrontErrorView()) + $errors = id(new PHUIErrorView()) ->setErrors($errors); } diff --git a/src/applications/ponder/controller/PonderQuestionViewController.php b/src/applications/ponder/controller/PonderQuestionViewController.php index b827252fd9..f81ecfadc4 100644 --- a/src/applications/ponder/controller/PonderQuestionViewController.php +++ b/src/applications/ponder/controller/PonderQuestionViewController.php @@ -30,8 +30,8 @@ final class PonderQuestionViewController extends PonderController { $authors = mpull($question->getAnswers(), null, 'getAuthorPHID'); if (isset($authors[$user->getPHID()])) { - $answer_add_panel = id(new AphrontErrorView()) - ->setSeverity(AphrontErrorView::SEVERITY_NODATA) + $answer_add_panel = id(new PHUIErrorView()) + ->setSeverity(PHUIErrorView::SEVERITY_NODATA) ->appendChild( pht( 'You have already answered this question. You can not answer '. diff --git a/src/applications/releeph/controller/request/ReleephRequestEditController.php b/src/applications/releeph/controller/request/ReleephRequestEditController.php index acbf5246ba..41bf8cd650 100644 --- a/src/applications/releeph/controller/request/ReleephRequestEditController.php +++ b/src/applications/releeph/controller/request/ReleephRequestEditController.php @@ -210,8 +210,8 @@ final class ReleephRequestEditController extends ReleephBranchController { $age_string, $handles[$pull->getRequestUserPHID()]->renderLink()), ); - $notice_view = id(new AphrontErrorView()) - ->setSeverity(AphrontErrorView::SEVERITY_NOTICE) + $notice_view = id(new PHUIErrorView()) + ->setSeverity(PHUIErrorView::SEVERITY_NOTICE) ->setErrors($notice_messages); } diff --git a/src/applications/search/controller/PhabricatorApplicationSearchController.php b/src/applications/search/controller/PhabricatorApplicationSearchController.php index 53594ae51b..3df7781ba7 100644 --- a/src/applications/search/controller/PhabricatorApplicationSearchController.php +++ b/src/applications/search/controller/PhabricatorApplicationSearchController.php @@ -161,7 +161,7 @@ final class PhabricatorApplicationSearchController $errors = $engine->getErrors(); if ($errors) { $run_query = false; - $errors = id(new AphrontErrorView()) + $errors = id(new PHUIErrorView()) ->setTitle(pht('Query Errors')) ->setErrors($errors); } diff --git a/src/applications/settings/panel/PhabricatorConduitCertificateSettingsPanel.php b/src/applications/settings/panel/PhabricatorConduitCertificateSettingsPanel.php index d06b018799..d72df74deb 100644 --- a/src/applications/settings/panel/PhabricatorConduitCertificateSettingsPanel.php +++ b/src/applications/settings/panel/PhabricatorConduitCertificateSettingsPanel.php @@ -61,8 +61,8 @@ final class PhabricatorConduitCertificateSettingsPanel } if ($request->getStr('regenerated')) { - $notice = new AphrontErrorView(); - $notice->setSeverity(AphrontErrorView::SEVERITY_NOTICE); + $notice = new PHUIErrorView(); + $notice->setSeverity(PHUIErrorView::SEVERITY_NOTICE); $notice->setTitle(pht('Certificate Regenerated')); $notice->appendChild(phutil_tag( 'p', diff --git a/src/applications/settings/panel/PhabricatorEmailAddressesSettingsPanel.php b/src/applications/settings/panel/PhabricatorEmailAddressesSettingsPanel.php index 4794814592..845295d0ca 100644 --- a/src/applications/settings/panel/PhabricatorEmailAddressesSettingsPanel.php +++ b/src/applications/settings/panel/PhabricatorEmailAddressesSettingsPanel.php @@ -228,7 +228,7 @@ final class PhabricatorEmailAddressesSettingsPanel } if ($errors) { - $errors = id(new AphrontErrorView()) + $errors = id(new PHUIErrorView()) ->setErrors($errors); } diff --git a/src/applications/uiexample/controller/PhabricatorUIExampleRenderController.php b/src/applications/uiexample/controller/PhabricatorUIExampleRenderController.php index 14063c7a51..b05a625a36 100644 --- a/src/applications/uiexample/controller/PhabricatorUIExampleRenderController.php +++ b/src/applications/uiexample/controller/PhabricatorUIExampleRenderController.php @@ -41,6 +41,7 @@ final class PhabricatorUIExampleRenderController extends PhabricatorController { require_celerity_resource('phabricator-ui-example-css'); $crumbs = $this->buildApplicationCrumbs(); + $crumbs->setBorder(true); $crumbs->addTextCrumb($example->getName()); $header = id(new PHUIHeaderView()) diff --git a/src/applications/uiexample/examples/PHUIErrorExample.php b/src/applications/uiexample/examples/PHUIErrorExample.php new file mode 100644 index 0000000000..72d4c3bbe0 --- /dev/null +++ b/src/applications/uiexample/examples/PHUIErrorExample.php @@ -0,0 +1,69 @@ +PHUIErrorView to render errors, warnings and notices.'); + } + + public function renderExample() { + $request = $this->getRequest(); + $user = $request->getUser(); + + $sevs = array( + PHUIErrorView::SEVERITY_ERROR => 'Error', + PHUIErrorView::SEVERITY_WARNING => 'Warning', + PHUIErrorView::SEVERITY_NOTICE => 'Notice', + PHUIErrorView::SEVERITY_NODATA => 'No Data', + ); + + $views = array(); + // Only Title + foreach ($sevs as $sev => $title) { + $view = new PHUIErrorView(); + $view->setSeverity($sev); + $view->setTitle($title); + $views[] = $view; + } + // Only Body + foreach ($sevs as $sev => $title) { + $view = new PHUIErrorView(); + $view->setSeverity($sev); + $view->appendChild('Several issues were encountered.'); + $views[] = $view; + } + // Only Errors + foreach ($sevs as $sev => $title) { + $view = new PHUIErrorView(); + $view->setSeverity($sev); + $view->setErrors( + array( + 'Overcooked.', + 'Too much salt.', + 'Full of sand.', + )); + $views[] = $view; + } + // All + foreach ($sevs as $sev => $title) { + $view = new PHUIErrorView(); + $view->setSeverity($sev); + $view->setTitle($title); + $view->appendChild('Several issues were encountered.'); + $view->setErrors( + array( + 'Overcooked.', + 'Too much salt.', + 'Full of sand.', + )); + $views[] = $view; + } + + return $views; + } +} diff --git a/src/applications/uiexample/examples/PhabricatorErrorUIExample.php b/src/applications/uiexample/examples/PhabricatorErrorUIExample.php deleted file mode 100644 index 1bde0d6f2b..0000000000 --- a/src/applications/uiexample/examples/PhabricatorErrorUIExample.php +++ /dev/null @@ -1,42 +0,0 @@ -AphrontErrorView to render errors, warnings and notices.'); - } - - public function renderExample() { - $request = $this->getRequest(); - $user = $request->getUser(); - - $sevs = array( - AphrontErrorView::SEVERITY_ERROR => 'Error', - AphrontErrorView::SEVERITY_WARNING => 'Warning', - AphrontErrorView::SEVERITY_NOTICE => 'Notice', - AphrontErrorView::SEVERITY_NODATA => 'No Data', - ); - - $views = array(); - foreach ($sevs as $sev => $title) { - $view = new AphrontErrorView(); - $view->setSeverity($sev); - $view->setTitle($title); - $view->appendChild('Several issues were encountered.'); - $view->setErrors( - array( - 'Overcooked.', - 'Too much salt.', - 'Full of sand.', - )); - $views[] = $view; - } - - return $views; - } -} diff --git a/src/view/AphrontDialogView.php b/src/view/AphrontDialogView.php index 878ab77109..beef711654 100644 --- a/src/view/AphrontDialogView.php +++ b/src/view/AphrontDialogView.php @@ -292,7 +292,7 @@ final class AphrontDialogView extends AphrontView { if ($errors) { $children = array( - id(new AphrontErrorView())->setErrors($errors), + id(new PHUIErrorView())->setErrors($errors), $children, ); } diff --git a/src/view/form/AphrontErrorView.php b/src/view/form/PHUIErrorView.php similarity index 73% rename from src/view/form/AphrontErrorView.php rename to src/view/form/PHUIErrorView.php index 393cbe9739..b8a29941a0 100644 --- a/src/view/form/AphrontErrorView.php +++ b/src/view/form/PHUIErrorView.php @@ -1,6 +1,6 @@ errors; if ($errors) { @@ -48,7 +48,7 @@ final class AphrontErrorView extends AphrontView { $list = phutil_tag( 'ul', array( - 'class' => 'aphront-error-view-list', + 'class' => 'phui-error-view-list', ), $list); } else { @@ -60,7 +60,7 @@ final class AphrontErrorView extends AphrontView { $title = phutil_tag( 'h1', array( - 'class' => 'aphront-error-view-head', + 'class' => 'phui-error-view-head', ), $title); } else { @@ -70,12 +70,24 @@ final class AphrontErrorView extends AphrontView { $this->severity = nonempty($this->severity, self::SEVERITY_ERROR); $classes = array(); - $classes[] = 'aphront-error-view'; - $classes[] = 'aphront-error-severity-'.$this->severity; + $classes[] = 'phui-error-view'; + $classes[] = 'phui-error-severity-'.$this->severity; $classes = implode(' ', $classes); $children = $this->renderChildren(); - $children[] = $list; + if ($list) { + $children[] = $list; + } + + $body = null; + if (!empty($children)) { + $body = phutil_tag( + 'div', + array( + 'class' => 'phui-error-view-body', + ), + $children); + } return phutil_tag( 'div', @@ -85,12 +97,7 @@ final class AphrontErrorView extends AphrontView { ), array( $title, - phutil_tag( - 'div', - array( - 'class' => 'aphront-error-view-body', - ), - $children), + $body, )); } } diff --git a/src/view/phui/PHUIObjectBoxView.php b/src/view/phui/PHUIObjectBoxView.php index 50615a96c5..c5f1d0fcb1 100644 --- a/src/view/phui/PHUIObjectBoxView.php +++ b/src/view/phui/PHUIObjectBoxView.php @@ -93,7 +93,7 @@ final class PHUIObjectBoxView extends AphrontView { public function setFormErrors(array $errors, $title = null) { if ($errors) { - $this->formErrors = id(new AphrontErrorView()) + $this->formErrors = id(new PHUIErrorView()) ->setTitle($title) ->setErrors($errors); } @@ -105,15 +105,15 @@ final class PHUIObjectBoxView extends AphrontView { $text = pht('Changes saved.'); } if ($saved) { - $save = id(new AphrontErrorView()) - ->setSeverity(AphrontErrorView::SEVERITY_NOTICE) + $save = id(new PHUIErrorView()) + ->setSeverity(PHUIErrorView::SEVERITY_NOTICE) ->appendChild($text); $this->formSaved = $save; } return $this; } - public function setErrorView(AphrontErrorView $view) { + public function setErrorView(PHUIErrorView $view) { $this->errorView = $view; return $this; } @@ -192,7 +192,7 @@ final class PHUIObjectBoxView extends AphrontView { $messages[] = $error->getMessage(); } if ($messages) { - $exception_errors = id(new AphrontErrorView()) + $exception_errors = id(new PHUIErrorView()) ->setErrors($messages); } } diff --git a/src/view/phui/PHUIObjectItemListView.php b/src/view/phui/PHUIObjectItemListView.php index 0a29e62ce9..9e3872ff11 100644 --- a/src/view/phui/PHUIObjectItemListView.php +++ b/src/view/phui/PHUIObjectItemListView.php @@ -108,8 +108,8 @@ final class PHUIObjectItemListView extends AphrontTagView { $items = null; } else { $string = nonempty($this->noDataString, pht('No data.')); - $string = id(new AphrontErrorView()) - ->setSeverity(AphrontErrorView::SEVERITY_NODATA) + $string = id(new PHUIErrorView()) + ->setSeverity(PHUIErrorView::SEVERITY_NODATA) ->appendChild($string); $items = phutil_tag( 'li', diff --git a/src/view/phui/PHUIPinboardView.php b/src/view/phui/PHUIPinboardView.php index 55c61ed423..21cceb6abb 100644 --- a/src/view/phui/PHUIPinboardView.php +++ b/src/view/phui/PHUIPinboardView.php @@ -20,8 +20,8 @@ final class PHUIPinboardView extends AphrontView { if (!$this->items) { $string = nonempty($this->noDataString, pht('No data.')); - return id(new AphrontErrorView()) - ->setSeverity(AphrontErrorView::SEVERITY_NODATA) + return id(new PHUIErrorView()) + ->setSeverity(PHUIErrorView::SEVERITY_NODATA) ->appendChild($string) ->render(); } diff --git a/src/view/phui/calendar/PHUICalendarMonthView.php b/src/view/phui/calendar/PHUICalendarMonthView.php index 17e9fd420b..cb8bd94746 100644 --- a/src/view/phui/calendar/PHUICalendarMonthView.php +++ b/src/view/phui/calendar/PHUICalendarMonthView.php @@ -9,6 +9,7 @@ final class PHUICalendarMonthView extends AphrontView { private $events = array(); private $browseURI; private $image; + private $error; public function setBrowseURI($browse_uri) { $this->browseURI = $browse_uri; @@ -28,6 +29,11 @@ final class PHUICalendarMonthView extends AphrontView { return $this; } + public function setErrorView(PHUIErrorView $error) { + $this->error = $error; + return $this; + } + public function setHolidays(array $holidays) { assert_instances_of($holidays, 'PhabricatorCalendarHoliday'); $this->holidays = mpull($holidays, null, 'getDay'); @@ -185,6 +191,10 @@ final class PHUICalendarMonthView extends AphrontView { $box = id(new PHUIObjectBoxView()) ->setHeader($this->renderCalendarHeader($first)) ->appendChild($table); + if ($this->error) { + $box->setErrorView($this->error); + + } return $box; } diff --git a/webroot/rsrc/css/aphront/error-view.css b/webroot/rsrc/css/aphront/error-view.css deleted file mode 100644 index 930cbcb977..0000000000 --- a/webroot/rsrc/css/aphront/error-view.css +++ /dev/null @@ -1,95 +0,0 @@ -/** - * @provides aphront-error-view-css - */ - -.aphront-error-view { - border-style: solid; - border-width: 1px; -} - -.aphront-error-view { - margin: 16px; -} - -.device-phone .aphront-error-view { - margin: 8px; -} - -.aphront-error-view .phui-form-view { - padding: 0; -} - -.aphront-error-view-body { - padding: 12px; -} - -.aphront-panel-plain .aphront-error-view { - margin-left: 0; - margin-right: 0; -} - -h1.aphront-error-view-head { - padding: 12px 8px 0 12px; - font-weight: bold; - font-size: 15px; - color: {$darkgreytext}; -} - -.aphront-error-view-list { - margin: 0 0 0 16px; - list-style: disc; -} - -.aphront-error-severity-error { - color: {$red}; - border-color: {$red}; - background: {$lightred}; -} - -.aphront-error-severity-error .aphront-error-view-head { - color: {$red}; -} - -.aphront-error-severity-warning { - color: #bc7837; - border-color: {$yellow}; - background: {$lightyellow}; -} - -.aphront-error-severity-warning .aphront-error-view-head { - color: #bc7837; -} - -.aphront-error-severity-notice { - color: {$blue}; - border-color: {$blue}; - background: {$lightblue}; -} - -.aphront-error-severity-notice .aphront-error-view-head { - color: {$blue}; -} - -.aphront-error-severity-nodata { - border-color: {$lightgreyborder}; - border-bottom: 1px solid {$greyborder}; - color: {$greytext}; - background-color: #fff; -} - -.legalpad .aphront-error-view { - margin: 0; - border-width: 0 0 1px 0; - border-bottom: 1px solid {$lightblueborder}; -} - -.aphront-dialog-body .aphront-error-view { - margin: -16px -16px 16px -16px; - border-width: 0 0 1px 0; - border-bottom: 1px solid {$lightblueborder}; -} - -.aphront-dialog-body .aphront-error-view .aphront-error-view-list { - margin: 0 0 0 16px; - list-style: disc; -} diff --git a/webroot/rsrc/css/application/dashboard/dashboard.css b/webroot/rsrc/css/application/dashboard/dashboard.css index 1266186953..5988aef8c3 100644 --- a/webroot/rsrc/css/application/dashboard/dashboard.css +++ b/webroot/rsrc/css/application/dashboard/dashboard.css @@ -66,7 +66,7 @@ .aphront-multi-column-fluid .aphront-multi-column-column-outer -.aphront-multi-column-column .aphront-error-view { +.aphront-multi-column-column .phui-error-view { margin: 0; } diff --git a/webroot/rsrc/css/application/phame/phame.css b/webroot/rsrc/css/application/phame/phame.css index 625c3ff186..1b1be0b2df 100644 --- a/webroot/rsrc/css/application/phame/phame.css +++ b/webroot/rsrc/css/application/phame/phame.css @@ -25,7 +25,7 @@ max-width: 600px; } -.phame-post-list .aphront-error-view { +.phame-post-list .phui-error-view { margin: 0; } diff --git a/webroot/rsrc/css/phui/phui-error-view.css b/webroot/rsrc/css/phui/phui-error-view.css new file mode 100644 index 0000000000..29d90e5bd3 --- /dev/null +++ b/webroot/rsrc/css/phui/phui-error-view.css @@ -0,0 +1,102 @@ +/** + * @provides phui-error-view-css + */ + +.phui-error-view { + border-style: solid; + border-left-width: 4px; +} + +.phui-error-view { + margin: 16px; + padding: 12px; +} + +.device-phone .phui-error-view { + margin: 8px; +} + +.phui-error-view .phui-form-view { + padding: 0; +} + +.phui-error-view-body { + line-height: 1.45em; +} + +.phui-error-view-head + .phui-error-view-body { + padding-top: 4px; +} + +.aphront-panel-plain .phui-error-view { + margin-left: 0; + margin-right: 0; +} + +h1.phui-error-view-head { + font-weight: bold; + font-size: 15px; +} + +.phui-error-view-list { + margin: 0 0 0 16px; + list-style: disc; + line-height: 1.5em; +} + +.phui-error-severity-error { + border-color: {$red}; + background: {$lightred}; +} + +.phui-error-severity-warning { + border-color: {$yellow}; + background: {$lightyellow}; +} + +.phui-error-severity-notice { + border-color: {$blue}; + background: {$lightblue}; +} + +.phui-error-severity-nodata { + border-color: {$lightgreyborder}; + background-color: #fff; +} + +.legalpad .phui-error-view { + margin: 0; + border-width: 0 0 1px 0; + border-bottom: 1px solid {$lightblueborder}; +} + +.aphront-dialog-body .phui-error-view { + margin: -16px -16px 16px -16px; + border-width: 0 0 1px 0; + border-bottom: 1px solid {$lightblueborder}; +} + +.aphront-dialog-body .phui-error-view .phui-error-view-list { + margin: 0 0 0 16px; + list-style: disc; +} + +.phui-object-box .phui-error-severity-error { + color: {$red}; +} + +.phui-object-box .phui-error-severity-warning { + color: #bc7837; +} + +.phui-object-box .phui-error-severity-notice { + color: {$blue}; +} + +.phui-crumbs-view + .phui-error-view { + margin-top: 0; +} + +.phui-crumbs-view.phui-crumbs-border + .phui-error-view { + margin-top: 16px; +} diff --git a/webroot/rsrc/css/phui/phui-object-box.css b/webroot/rsrc/css/phui/phui-object-box.css index a074d62208..f9c7a90490 100644 --- a/webroot/rsrc/css/phui/phui-object-box.css +++ b/webroot/rsrc/css/phui/phui-object-box.css @@ -21,7 +21,7 @@ div.phui-object-box.phui-object-box-flush { padding: 8px 0; } -.phui-object-box .phui-header-shell + .aphront-error-view { +.phui-object-box .phui-header-shell + .phui-error-view { margin: 0; border-width: 0; border-bottom: 1px solid {$lightblueborder}; diff --git a/webroot/rsrc/css/phui/phui-object-item-list-view.css b/webroot/rsrc/css/phui/phui-object-item-list-view.css index 756df13770..7e8558e128 100644 --- a/webroot/rsrc/css/phui/phui-object-item-list-view.css +++ b/webroot/rsrc/css/phui/phui-object-item-list-view.css @@ -28,7 +28,7 @@ ul.phui-object-item-list-view { margin: 0; } -.phui-object-item-list-view .aphront-error-view { +.phui-object-item-list-view .phui-error-view { margin: 4px 0 8px 0; color: {$greytext}; } @@ -631,7 +631,7 @@ ul.phui-object-item-icons { padding: 0; } -.phui-object-list-states .aphront-error-view { +.phui-object-list-states .phui-error-view { margin: 0; border: none; } @@ -670,7 +670,7 @@ ul.phui-object-item-icons { -webkit-font-smoothing: antialiased; } -.dashboard-panel .phui-object-item-empty .aphront-error-view { +.dashboard-panel .phui-object-item-empty .phui-error-view { border: none; border-bottom: 1px solid {$thinblueborder}; }