Page MenuHomePhabricator

D19908.diff
No OneTemporary

D19908.diff

diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -9,7 +9,7 @@
'names' => array(
'conpherence.pkg.css' => 'e68cf1fa',
'conpherence.pkg.js' => '15191c65',
- 'core.pkg.css' => '9d1148a4',
+ 'core.pkg.css' => '47535fd5',
'core.pkg.js' => 'bd89cb1d',
'differential.pkg.css' => '06dc617c',
'differential.pkg.js' => 'ef0b989b',
@@ -151,7 +151,7 @@
'rsrc/css/phui/phui-document.css' => 'c4ac41f9',
'rsrc/css/phui/phui-feed-story.css' => '44a9c8e9',
'rsrc/css/phui/phui-fontkit.css' => '1320ed01',
- 'rsrc/css/phui/phui-form-view.css' => '2f43fae7',
+ 'rsrc/css/phui/phui-form-view.css' => 'b04e08d9',
'rsrc/css/phui/phui-form.css' => '7aaa04e3',
'rsrc/css/phui/phui-head-thing.css' => 'fd311e5f',
'rsrc/css/phui/phui-header-view.css' => '1ba8b707',
@@ -819,7 +819,7 @@
'phui-font-icon-base-css' => '870a7360',
'phui-fontkit-css' => '1320ed01',
'phui-form-css' => '7aaa04e3',
- 'phui-form-view-css' => '2f43fae7',
+ 'phui-form-view-css' => 'b04e08d9',
'phui-head-thing-view-css' => 'fd311e5f',
'phui-header-view-css' => '1ba8b707',
'phui-hovercard' => '1bd28176',
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -1946,6 +1946,7 @@
'PHUIFormInsetView' => 'view/form/PHUIFormInsetView.php',
'PHUIFormLayoutView' => 'view/form/PHUIFormLayoutView.php',
'PHUIFormNumberControl' => 'view/form/control/PHUIFormNumberControl.php',
+ 'PHUIFormTimerControl' => 'view/form/control/PHUIFormTimerControl.php',
'PHUIHandleListView' => 'applications/phid/view/PHUIHandleListView.php',
'PHUIHandleTagListView' => 'applications/phid/view/PHUIHandleTagListView.php',
'PHUIHandleView' => 'applications/phid/view/PHUIHandleView.php',
@@ -7574,6 +7575,7 @@
'PHUIFormInsetView' => 'AphrontView',
'PHUIFormLayoutView' => 'AphrontView',
'PHUIFormNumberControl' => 'AphrontFormControl',
+ 'PHUIFormTimerControl' => 'AphrontFormControl',
'PHUIHandleListView' => 'AphrontTagView',
'PHUIHandleTagListView' => 'AphrontTagView',
'PHUIHandleView' => 'AphrontView',
diff --git a/src/applications/auth/factor/PhabricatorAuthFactor.php b/src/applications/auth/factor/PhabricatorAuthFactor.php
--- a/src/applications/auth/factor/PhabricatorAuthFactor.php
+++ b/src/applications/auth/factor/PhabricatorAuthFactor.php
@@ -190,16 +190,25 @@
$error = $result->getErrorMessage();
- return id(new AphrontFormMarkupControl())
- ->setValue($error)
+ $icon = id(new PHUIIconView())
+ ->setIcon('fa-clock-o', 'red');
+
+ return id(new PHUIFormTimerControl())
+ ->setIcon($icon)
+ ->appendChild($error)
->setError(pht('Wait'));
}
private function newAnsweredControl(
PhabricatorAuthFactorResult $result) {
- return id(new AphrontFormMarkupControl())
- ->setValue(pht('Answered!'));
+ $icon = id(new PHUIIconView())
+ ->setIcon('fa-check-circle-o', 'green');
+
+ return id(new PHUIFormTimerControl())
+ ->setIcon($icon)
+ ->appendChild(
+ pht('You responded to this challenge correctly.'));
}
diff --git a/src/infrastructure/internationalization/translation/PhabricatorUSEnglishTranslation.php b/src/infrastructure/internationalization/translation/PhabricatorUSEnglishTranslation.php
--- a/src/infrastructure/internationalization/translation/PhabricatorUSEnglishTranslation.php
+++ b/src/infrastructure/internationalization/translation/PhabricatorUSEnglishTranslation.php
@@ -1673,6 +1673,51 @@
'pass: %2$s.',
),
+ 'This factor recently issued a challenge to a different login '.
+ 'session. Wait %s second(s) for the code to cycle, then try '.
+ 'again.' => array(
+ 'This factor recently issued a challenge to a different login '.
+ 'session. Wait %s second for the code to cycle, then try '.
+ 'again.',
+ 'This factor recently issued a challenge to a different login '.
+ 'session. Wait %s seconds for the code to cycle, then try '.
+ 'again.',
+ ),
+
+ 'This factor recently issued a challenge for a different '.
+ 'workflow. Wait %s second(s) for the code to cycle, then try '.
+ 'again.' => array(
+ 'This factor recently issued a challenge for a different '.
+ 'workflow. Wait %s second for the code to cycle, then try '.
+ 'again.',
+ 'This factor recently issued a challenge for a different '.
+ 'workflow. Wait %s seconds for the code to cycle, then try '.
+ 'again.',
+ ),
+
+
+ 'This factor recently issued a challenge which has expired. '.
+ 'A new challenge can not be issued yet. Wait %s second(s) for '.
+ 'the code to cycle, then try again.' => array(
+ 'This factor recently issued a challenge which has expired. '.
+ 'A new challenge can not be issued yet. Wait %s second for '.
+ 'the code to cycle, then try again.',
+ 'This factor recently issued a challenge which has expired. '.
+ 'A new challenge can not be issued yet. Wait %s seconds for '.
+ 'the code to cycle, then try again.',
+ ),
+
+ 'You recently provided a response to this factor. Responses '.
+ 'may not be reused. Wait %s second(s) for the code to cycle, '.
+ 'then try again.' => array(
+ 'You recently provided a response to this factor. Responses '.
+ 'may not be reused. Wait %s second for the code to cycle, '.
+ 'then try again.',
+ 'You recently provided a response to this factor. Responses '.
+ 'may not be reused. Wait %s seconds for the code to cycle, '.
+ 'then try again.',
+ ),
+
);
}
diff --git a/src/view/form/control/PHUIFormTimerControl.php b/src/view/form/control/PHUIFormTimerControl.php
new file mode 100644
--- /dev/null
+++ b/src/view/form/control/PHUIFormTimerControl.php
@@ -0,0 +1,40 @@
+<?php
+
+final class PHUIFormTimerControl extends AphrontFormControl {
+
+ private $icon;
+
+ public function setIcon(PHUIIconView $icon) {
+ $this->icon = $icon;
+ return $this;
+ }
+
+ public function getIcon() {
+ return $this->icon;
+ }
+
+ protected function getCustomControlClass() {
+ return 'phui-form-timer';
+ }
+
+ protected function renderInput() {
+ $icon_cell = phutil_tag(
+ 'td',
+ array(
+ 'class' => 'phui-form-timer-icon',
+ ),
+ $this->getIcon());
+
+ $content_cell = phutil_tag(
+ 'td',
+ array(
+ 'class' => 'phui-form-timer-content',
+ ),
+ $this->renderChildren());
+
+ $row = phutil_tag('tr', array(), array($icon_cell, $content_cell));
+
+ return phutil_tag('table', array(), $row);
+ }
+
+}
diff --git a/webroot/rsrc/css/phui/phui-form-view.css b/webroot/rsrc/css/phui/phui-form-view.css
--- a/webroot/rsrc/css/phui/phui-form-view.css
+++ b/webroot/rsrc/css/phui/phui-form-view.css
@@ -556,3 +556,21 @@
.phuix-form-checkbox-label {
margin-left: 4px;
}
+
+.phui-form-timer-icon {
+ width: 28px;
+ height: 28px;
+ padding: 4px;
+ font-size: 18px;
+ background: {$greybackground};
+ border-radius: 4px;
+ text-align: center;
+ vertical-align: middle;
+ text-shadow: 1px 1px rgba(0, 0, 0, 0.05);
+}
+
+.phui-form-timer-content {
+ padding: 4px 8px;
+ color: {$darkgreytext};
+ vertical-align: middle;
+}

File Metadata

Mime Type
text/plain
Expires
Oct 17 2024, 12:12 AM (4 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6719779
Default Alt Text
D19908.diff (7 KB)

Event Timeline