Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F18821984
D8684.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
5 KB
Referenced Files
None
Subscribers
None
D8684.diff
View Options
diff --git a/src/aphront/configuration/AphrontDefaultApplicationConfiguration.php b/src/aphront/configuration/AphrontDefaultApplicationConfiguration.php
--- a/src/aphront/configuration/AphrontDefaultApplicationConfiguration.php
+++ b/src/aphront/configuration/AphrontDefaultApplicationConfiguration.php
@@ -112,13 +112,10 @@
}
if ($ex instanceof PhabricatorSystemActionRateLimitException) {
- $error_view = id(new AphrontErrorView())
- ->setErrors(array(pht('You are being rate limited.')));
-
$dialog = id(new AphrontDialogView())
->setTitle(pht('Slow Down!'))
->setUser($user)
- ->appendChild($error_view)
+ ->setErrors(array(pht('You are being rate limited.')))
->appendParagraph($ex->getMessage())
->appendParagraph($ex->getRateExplanation())
->addCancelButton('/', pht('Okaaaaaaaaaaaaaay...'));
diff --git a/src/applications/conpherence/controller/ConpherenceUpdateController.php b/src/applications/conpherence/controller/ConpherenceUpdateController.php
--- a/src/applications/conpherence/controller/ConpherenceUpdateController.php
+++ b/src/applications/conpherence/controller/ConpherenceUpdateController.php
@@ -156,8 +156,6 @@
if ($errors) {
$error_view = id(new AphrontErrorView())
- ->setTitle(pht('Errors editing conpherence.'))
- ->setInsideDialogue(true)
->setErrors($errors);
}
diff --git a/src/applications/system/engine/PhabricatorSystemActionEngine.php b/src/applications/system/engine/PhabricatorSystemActionEngine.php
--- a/src/applications/system/engine/PhabricatorSystemActionEngine.php
+++ b/src/applications/system/engine/PhabricatorSystemActionEngine.php
@@ -15,7 +15,7 @@
foreach ($blocked as $actor => $actor_score) {
throw new PhabricatorSystemActionRateLimitException(
$action,
- $actor_score + ($score / self::getWindow()));
+ $actor_score);
}
}
}
@@ -25,14 +25,17 @@
public static function loadBlockedActors(
array $actors,
- PhabricatorSystemAction $action) {
+ PhabricatorSystemAction $action,
+ $score) {
$scores = self::loadScores($actors, $action);
+ $window = self::getWindow();
$blocked = array();
- foreach ($scores as $actor => $score) {
- if ($action->shouldBlockActor($actor, $score)) {
- $blocked[$actor] = $score;
+ foreach ($scores as $actor => $actor_score) {
+ $actor_score = $actor_score + ($score / $window);
+ if ($action->shouldBlockActor($actor, $actor_score)) {
+ $blocked[$actor] = $actor_score;
}
}
diff --git a/src/view/AphrontDialogView.php b/src/view/AphrontDialogView.php
--- a/src/view/AphrontDialogView.php
+++ b/src/view/AphrontDialogView.php
@@ -19,6 +19,7 @@
private $disableWorkflowOnSubmit;
private $disableWorkflowOnCancel;
private $width = 'default';
+ private $errors;
const WIDTH_DEFAULT = 'default';
const WIDTH_FORM = 'form';
@@ -34,6 +35,11 @@
return $this;
}
+ public function setErrors(array $errors) {
+ $this->errors = $errors;
+ return $this;
+ }
+
public function getIsStandalone() {
return $this->isStandalone;
}
@@ -252,6 +258,12 @@
$children = $this->renderChildren();
+ if ($this->errors) {
+ $children = array(
+ id(new AphrontErrorView())->setErrors($this->errors),
+ $children);
+ }
+
$header = new PhabricatorActionHeaderView();
$header->setHeaderTitle($this->title);
$header->setHeaderColor($this->headerColor);
diff --git a/src/view/form/AphrontErrorView.php b/src/view/form/AphrontErrorView.php
--- a/src/view/form/AphrontErrorView.php
+++ b/src/view/form/AphrontErrorView.php
@@ -11,15 +11,6 @@
private $errors;
private $severity;
private $id;
- private $insideDialogue;
-
- public function setInsideDialogue($inside_dialogue) {
- $this->insideDialogue = $inside_dialogue;
- return $this;
- }
- public function getInsideDialogue() {
- return $this->insideDialogue;
- }
public function setTitle($title) {
$this->title = $title;
@@ -41,15 +32,6 @@
return $this;
}
- private function getBaseClass() {
- if ($this->getInsideDialogue()) {
- $class = 'aphront-error-view-dialogue';
- } else {
- $class = 'aphront-error-view';
- }
- return $class;
- }
-
final public function render() {
require_celerity_resource('aphront-error-view-css');
@@ -88,7 +70,7 @@
$this->severity = nonempty($this->severity, self::SEVERITY_ERROR);
$classes = array();
- $classes[] = $this->getBaseClass();
+ $classes[] = 'aphront-error-view';
$classes[] = 'aphront-error-severity-'.$this->severity;
$classes = implode(' ', $classes);
diff --git a/webroot/rsrc/css/aphront/error-view.css b/webroot/rsrc/css/aphront/error-view.css
--- a/webroot/rsrc/css/aphront/error-view.css
+++ b/webroot/rsrc/css/aphront/error-view.css
@@ -2,22 +2,14 @@
* @provides aphront-error-view-css
*/
-.aphront-error-view,
-.aphront-error-view-dialogue {
+.aphront-error-view {
border-style: solid;
border-width: 1px;
}
-form.aphront-dialog-view .aphront-error-view {
- margin: 0 0 12px 0;
-}
-
.aphront-error-view {
margin: 16px;
}
-.aphront-error-view-dialogue {
- margin: 0 0 16px 0;
-}
.device-phone .aphront-error-view {
margin: 8px;
@@ -84,3 +76,14 @@
color: {$greytext};
background-color: #fff;
}
+
+.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;
+}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Oct 24 2025, 3:19 AM (8 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
9113599
Default Alt Text
D8684.diff (5 KB)
Attached To
Mode
D8684: Make errors in dialogs look reasonable instead of hideous
Attached
Detach File
Event Timeline
Log In to Comment