Make error views look less awful
Summary: These elements look heavy and out of place right now. Test Plan: Looked at error views in uiexample page. Reviewers: btrahan, vrana, jungejason Reviewed By: jungejason CC: aran Differential Revision: https://secure.phabricator.com/D2144
This commit is contained in:
@@ -63,7 +63,7 @@ celerity_register_resource_map(array(
|
||||
),
|
||||
'aphront-error-view-css' =>
|
||||
array(
|
||||
'uri' => '/res/038f6022/rsrc/css/aphront/error-view.css',
|
||||
'uri' => '/res/369e35eb/rsrc/css/aphront/error-view.css',
|
||||
'type' => 'css',
|
||||
'requires' =>
|
||||
array(
|
||||
|
||||
@@ -562,6 +562,7 @@ phutil_register_library_map(array(
|
||||
'PhabricatorEmailTokenController' => 'applications/auth/controller/emailtoken',
|
||||
'PhabricatorEnv' => 'infrastructure/env',
|
||||
'PhabricatorEnvTestCase' => 'infrastructure/env/__tests__',
|
||||
'PhabricatorErrorExample' => 'applications/uiexample/examples/error',
|
||||
'PhabricatorEvent' => 'infrastructure/events/event',
|
||||
'PhabricatorEventEngine' => 'infrastructure/events/engine',
|
||||
'PhabricatorEventType' => 'infrastructure/events/constant/type',
|
||||
@@ -1422,6 +1423,7 @@ phutil_register_library_map(array(
|
||||
'PhabricatorEmailLoginController' => 'PhabricatorAuthController',
|
||||
'PhabricatorEmailTokenController' => 'PhabricatorAuthController',
|
||||
'PhabricatorEnvTestCase' => 'PhabricatorTestCase',
|
||||
'PhabricatorErrorExample' => 'PhabricatorUIExample',
|
||||
'PhabricatorEvent' => 'PhutilEvent',
|
||||
'PhabricatorEventType' => 'PhutilEventType',
|
||||
'PhabricatorFeedController' => 'PhabricatorController',
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright 2012 Facebook, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
final class PhabricatorErrorExample extends PhabricatorUIExample {
|
||||
|
||||
public function getName() {
|
||||
return 'Errors';
|
||||
}
|
||||
|
||||
public function getDescription() {
|
||||
return 'Use <tt>AphrontErrorView</tt> 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;
|
||||
}
|
||||
}
|
||||
13
src/applications/uiexample/examples/error/__init__.php
Normal file
13
src/applications/uiexample/examples/error/__init__.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is automatically generated. Lint this module to rebuild it.
|
||||
* @generated
|
||||
*/
|
||||
|
||||
|
||||
|
||||
phutil_require_module('phabricator', 'applications/uiexample/examples/base');
|
||||
phutil_require_module('phabricator', 'view/form/error');
|
||||
|
||||
|
||||
phutil_require_source('PhabricatorErrorExample.php');
|
||||
@@ -99,7 +99,12 @@ final class AphrontErrorView extends AphrontView {
|
||||
'class' => 'aphront-error-view '.$more_classes,
|
||||
),
|
||||
$title.
|
||||
$this->renderChildren().
|
||||
$list);
|
||||
phutil_render_tag(
|
||||
'div',
|
||||
array(
|
||||
'class' => 'aphront-error-view-body',
|
||||
),
|
||||
$this->renderChildren().
|
||||
$list));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user