@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Make AphrontErrorView work on devices

Summary:
This is the last Paste UI element that doesn't work properly on tablets/phones. Make it flexible.

Also add empty states to Paste.

Test Plan: Viewed various errors, and `/uiexample/errors/`.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D3429

+73 -86
+26 -26
src/__celerity_resource_map__.php
··· 553 553 ), 554 554 'aphront-error-view-css' => 555 555 array( 556 - 'uri' => '/res/369e35eb/rsrc/css/aphront/error-view.css', 556 + 'uri' => '/res/7c143698/rsrc/css/aphront/error-view.css', 557 557 'type' => 'css', 558 558 'requires' => 559 559 array( ··· 2944 2944 ), array( 2945 2945 'packages' => 2946 2946 array( 2947 - 'ba3255ee' => 2947 + '1db83c80' => 2948 2948 array( 2949 2949 'name' => 'core.pkg.css', 2950 2950 'symbols' => ··· 2973 2973 21 => 'phabricator-flag-css', 2974 2974 22 => 'aphront-error-view-css', 2975 2975 ), 2976 - 'uri' => '/res/pkg/ba3255ee/core.pkg.css', 2976 + 'uri' => '/res/pkg/1db83c80/core.pkg.css', 2977 2977 'type' => 'css', 2978 2978 ), 2979 2979 '3a455e4f' => ··· 3140 3140 'reverse' => 3141 3141 array( 3142 3142 'aphront-attached-file-view-css' => '7839ae2d', 3143 - 'aphront-crumbs-view-css' => 'ba3255ee', 3144 - 'aphront-dialog-view-css' => 'ba3255ee', 3145 - 'aphront-error-view-css' => 'ba3255ee', 3146 - 'aphront-form-view-css' => 'ba3255ee', 3143 + 'aphront-crumbs-view-css' => '1db83c80', 3144 + 'aphront-dialog-view-css' => '1db83c80', 3145 + 'aphront-error-view-css' => '1db83c80', 3146 + 'aphront-form-view-css' => '1db83c80', 3147 3147 'aphront-headsup-action-list-view-css' => '2ba14b3d', 3148 - 'aphront-headsup-view-css' => 'ba3255ee', 3149 - 'aphront-list-filter-view-css' => 'ba3255ee', 3150 - 'aphront-pager-view-css' => 'ba3255ee', 3151 - 'aphront-panel-view-css' => 'ba3255ee', 3152 - 'aphront-side-nav-view-css' => 'ba3255ee', 3153 - 'aphront-table-view-css' => 'ba3255ee', 3154 - 'aphront-tokenizer-control-css' => 'ba3255ee', 3155 - 'aphront-tooltip-css' => 'ba3255ee', 3156 - 'aphront-typeahead-control-css' => 'ba3255ee', 3148 + 'aphront-headsup-view-css' => '1db83c80', 3149 + 'aphront-list-filter-view-css' => '1db83c80', 3150 + 'aphront-pager-view-css' => '1db83c80', 3151 + 'aphront-panel-view-css' => '1db83c80', 3152 + 'aphront-side-nav-view-css' => '1db83c80', 3153 + 'aphront-table-view-css' => '1db83c80', 3154 + 'aphront-tokenizer-control-css' => '1db83c80', 3155 + 'aphront-tooltip-css' => '1db83c80', 3156 + 'aphront-typeahead-control-css' => '1db83c80', 3157 3157 'differential-changeset-view-css' => '2ba14b3d', 3158 3158 'differential-core-view-css' => '2ba14b3d', 3159 3159 'differential-inline-comment-editor' => '670ad7f1', ··· 3219 3219 'javelin-workflow' => '3a455e4f', 3220 3220 'maniphest-task-summary-css' => '7839ae2d', 3221 3221 'maniphest-transaction-detail-css' => '7839ae2d', 3222 - 'phabricator-app-buttons-css' => 'ba3255ee', 3222 + 'phabricator-app-buttons-css' => '1db83c80', 3223 3223 'phabricator-content-source-view-css' => '2ba14b3d', 3224 - 'phabricator-core-buttons-css' => 'ba3255ee', 3225 - 'phabricator-core-css' => 'ba3255ee', 3226 - 'phabricator-directory-css' => 'ba3255ee', 3224 + 'phabricator-core-buttons-css' => '1db83c80', 3225 + 'phabricator-core-css' => '1db83c80', 3226 + 'phabricator-directory-css' => '1db83c80', 3227 3227 'phabricator-drag-and-drop-file-upload' => '670ad7f1', 3228 3228 'phabricator-dropdown-menu' => '3a455e4f', 3229 - 'phabricator-flag-css' => 'ba3255ee', 3230 - 'phabricator-jump-nav' => 'ba3255ee', 3229 + 'phabricator-flag-css' => '1db83c80', 3230 + 'phabricator-jump-nav' => '1db83c80', 3231 3231 'phabricator-keyboard-shortcut' => '3a455e4f', 3232 3232 'phabricator-keyboard-shortcut-manager' => '3a455e4f', 3233 3233 'phabricator-menu-item' => '3a455e4f', ··· 3235 3235 'phabricator-paste-file-upload' => '3a455e4f', 3236 3236 'phabricator-prefab' => '3a455e4f', 3237 3237 'phabricator-project-tag-css' => '7839ae2d', 3238 - 'phabricator-remarkup-css' => 'ba3255ee', 3238 + 'phabricator-remarkup-css' => '1db83c80', 3239 3239 'phabricator-shaped-request' => '670ad7f1', 3240 - 'phabricator-standard-page-view' => 'ba3255ee', 3240 + 'phabricator-standard-page-view' => '1db83c80', 3241 3241 'phabricator-tooltip' => '3a455e4f', 3242 - 'phabricator-transaction-view-css' => 'ba3255ee', 3243 - 'syntax-highlighting-css' => 'ba3255ee', 3242 + 'phabricator-transaction-view-css' => '1db83c80', 3243 + 'syntax-highlighting-css' => '1db83c80', 3244 3244 ), 3245 3245 ));
-1
src/applications/differential/controller/DifferentialRevisionViewController.php
··· 184 184 $warning = new AphrontErrorView(); 185 185 $warning->setTitle('Very Large Diff'); 186 186 $warning->setSeverity(AphrontErrorView::SEVERITY_WARNING); 187 - $warning->setWidth(AphrontErrorView::WIDTH_WIDE); 188 187 $warning->appendChild( 189 188 "<p>This diff is very large and affects {$count} files. Load ". 190 189 "each file individually. ".
-1
src/applications/differential/field/specification/DifferentialLintFieldSpecification.php
··· 247 247 } 248 248 $lint_warning = id(new AphrontErrorView()) 249 249 ->setSeverity(AphrontErrorView::SEVERITY_ERROR) 250 - ->setWidth(AphrontErrorView::WIDTH_WIDE) 251 250 ->appendChild($content) 252 251 ->setTitle(idx($titles, $diff->getLintStatus(), 'Warning')); 253 252 }
-1
src/applications/differential/field/specification/DifferentialUnitFieldSpecification.php
··· 222 222 } 223 223 $unit_warning = id(new AphrontErrorView()) 224 224 ->setSeverity(AphrontErrorView::SEVERITY_ERROR) 225 - ->setWidth(AphrontErrorView::WIDTH_WIDE) 226 225 ->appendChild($content) 227 226 ->setTitle(idx($titles, $diff->getUnitStatus(), 'Warning')); 228 227 }
-1
src/applications/differential/view/DifferentialAddCommentView.php
··· 64 64 65 65 $warning = new AphrontErrorView(); 66 66 $warning->setSeverity(AphrontErrorView::SEVERITY_ERROR); 67 - $warning->setWidth(AphrontErrorView::WIDTH_WIDE); 68 67 $warning->setID($id); 69 68 $warning->appendChild($content); 70 69 $warning->setTitle(idx($titles, $status, 'Warning'));
-3
src/applications/diffusion/controller/DiffusionCommitController.php
··· 72 72 $subpath = $commit_data->getCommitDetail('svn-subpath'); 73 73 74 74 $error_panel = new AphrontErrorView(); 75 - $error_panel->setWidth(AphrontErrorView::WIDTH_WIDE); 76 75 $error_panel->setTitle('Commit Not Tracked'); 77 76 $error_panel->setSeverity(AphrontErrorView::SEVERITY_WARNING); 78 77 $error_panel->appendChild( ··· 156 155 $pane_id = null; 157 156 if ($bad_commit) { 158 157 $error_panel = new AphrontErrorView(); 159 - $error_panel->setWidth(AphrontErrorView::WIDTH_WIDE); 160 158 $error_panel->setTitle('Bad Commit'); 161 159 $error_panel->appendChild( 162 160 phutil_escape_html($bad_commit['description'])); ··· 166 164 // Don't render anything else. 167 165 } else if (!count($changes)) { 168 166 $no_changes = new AphrontErrorView(); 169 - $no_changes->setWidth(AphrontErrorView::WIDTH_WIDE); 170 167 $no_changes->setSeverity(AphrontErrorView::SEVERITY_WARNING); 171 168 $no_changes->setTitle('Not Yet Parsed'); 172 169 // TODO: This can also happen with weird SVN changes that don't do
+5 -3
src/applications/paste/controller/PhabricatorPasteListController.php
··· 37 37 switch ($filter) { 38 38 case 'my': 39 39 $query->withAuthorPHIDs(array($user->getPHID())); 40 - $title = 'My Pastes'; 40 + $title = pht('My Pastes'); 41 + $nodata = pht("You haven't created any Pastes yet."); 41 42 break; 42 43 case 'all': 43 - $title = 'All Pastes'; 44 + $title = pht('All Pastes'); 45 + $nodata = pht("There are no Pastes yet."); 44 46 break; 45 47 } 46 48 ··· 48 50 $pager->readFromRequest($request); 49 51 $pastes = $query->executeWithCursorPager($pager); 50 52 51 - 52 53 $list = $this->buildPasteList($pastes); 53 54 $list->setHeader($title); 54 55 $list->setPager($pager); 56 + $list->setNoDataString($nodata); 55 57 56 58 $nav->appendChild($list); 57 59
-5
src/applications/project/controller/PhabricatorProjectCreateController.php
··· 105 105 ->setValue($profile->getBlurb())); 106 106 107 107 if ($request->isAjax()) { 108 - 109 - if ($error_view) { 110 - $error_view->setWidth(AphrontErrorView::WIDTH_DIALOG); 111 - } 112 - 113 108 $dialog = id(new AphrontDialogView()) 114 109 ->setUser($user) 115 110 ->setWidth(AphrontDialogView::WIDTH_FORM)
-1
src/applications/settings/panel/PhabricatorSettingsPanelEmailAddresses.php
··· 222 222 223 223 if ($errors) { 224 224 $errors = id(new AphrontErrorView()) 225 - ->setWidth(AphrontErrorView::WIDTH_DIALOG) 226 225 ->setErrors($errors); 227 226 } 228 227
+12 -14
src/view/form/AphrontErrorView.php
··· 23 23 const SEVERITY_NOTICE = 'notice'; 24 24 const SEVERITY_NODATA = 'nodata'; 25 25 26 - const WIDTH_DEFAULT = 'default'; 27 - const WIDTH_WIDE = 'wide'; 28 - const WIDTH_DIALOG = 'dialog'; 29 - 30 26 private $title; 31 27 private $errors; 32 28 private $severity; 33 - private $width; 34 29 private $id; 35 30 36 31 public function setTitle($title) { ··· 48 43 return $this; 49 44 } 50 45 51 - public function setWidth($width) { 52 - $this->width = $width; 53 - return $this; 54 - } 55 - 56 46 public function setID($id) { 57 47 $this->id = $id; 58 48 return $this; ··· 71 61 array(), 72 62 phutil_escape_html($error)); 73 63 } 74 - $list = '<ul>'.implode("\n", $list).'</ul>'; 64 + $list = phutil_render_tag( 65 + 'ul', 66 + array( 67 + 'class' => 'aphront-error-view-list', 68 + ), 69 + implode("\n", $list)); 75 70 } else { 76 71 $list = null; 77 72 } 78 73 79 74 $title = $this->title; 80 75 if (strlen($title)) { 81 - $title = '<h1>'.phutil_escape_html($title).'</h1>'; 76 + $title = phutil_render_tag( 77 + 'h1', 78 + array( 79 + 'class' => 'aphront-error-view-head', 80 + ), 81 + phutil_escape_html($title)); 82 82 } else { 83 83 $title = null; 84 84 } 85 85 86 86 $this->severity = nonempty($this->severity, self::SEVERITY_ERROR); 87 - $this->width = nonempty($this->width, self::WIDTH_DEFAULT); 88 87 89 88 $more_classes = array(); 90 89 $more_classes[] = 'aphront-error-severity-'.$this->severity; 91 - $more_classes[] = 'aphront-error-width-'.$this->width; 92 90 $more_classes = implode(' ', $more_classes); 93 91 94 92 return
+16 -1
src/view/layout/PhabricatorObjectItemListView.php
··· 21 21 private $header; 22 22 private $items; 23 23 private $pager; 24 + private $noDataString; 24 25 25 26 public function setHeader($header) { 26 27 $this->header = $header; ··· 29 30 30 31 public function setPager($pager) { 31 32 $this->pager = $pager; 33 + return $this; 34 + } 35 + 36 + public function setNoDataString($no_data_string) { 37 + $this->noDataString = $no_data_string; 32 38 return $this; 33 39 } 34 40 ··· 46 52 'class' => 'phabricator-object-item-list-header', 47 53 ), 48 54 phutil_escape_html($this->header)); 49 - $items = $this->renderSingleView($this->items); 55 + 56 + if ($this->items) { 57 + $items = $this->renderSingleView($this->items); 58 + } else { 59 + $string = nonempty($this->noDataString, pht('No data.')); 60 + $items = id(new AphrontErrorView()) 61 + ->setSeverity(AphrontErrorView::SEVERITY_NODATA) 62 + ->appendChild(phutil_escape_html($string)) 63 + ->render(); 64 + } 50 65 51 66 $pager = null; 52 67 if ($this->pager) {
+14 -29
webroot/rsrc/css/aphront/error-view.css
··· 3 3 */ 4 4 5 5 .aphront-error-view { 6 - margin: 1em auto; 7 - 8 - -webkit-box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1); 9 - -mox-box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1); 10 - box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1); 6 + margin: 1em 2%; 7 + box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1); 8 + border-style: solid; 9 + border-width: 1px; 11 10 } 12 11 13 12 .aphront-error-view-body { ··· 16 15 line-height: 1.6em; 17 16 } 18 17 19 - .aphront-error-view h1 { 18 + .aphront-error-view-head { 20 19 font-size: 13px; 21 20 padding: 0.5em 1em; 22 21 font-weight: bold; 23 22 color: #333333; 24 23 } 25 24 26 - .aphront-error-view-body ul { 25 + .aphront-error-view-list { 27 26 margin: 0.2em 0 0.2em 2em; 28 27 list-style: disc; 29 28 } 30 29 31 - .aphront-error-width-default { 32 - width: 720px; 33 - } 34 - 35 - .aphront-error-width-dialog { 36 - width: 300px; 37 - } 38 - 39 - .aphront-error-width-wide { 40 - width: 95%; 41 - } 42 - 43 30 .aphront-error-severity-error { 44 - border: 1px solid #aa0000; 31 + border-color: #aa0000; 45 32 background: #fff3f3; 46 33 } 47 34 48 - .aphront-error-severity-error h1 { 35 + .aphront-error-severity-error .aphront-error-view-head { 49 36 background: #ffe3e3; 50 37 } 51 38 52 39 .aphront-error-severity-warning { 53 - border: 1px solid #888800; 40 + border-color: #888800; 54 41 background: #ffffee; 55 42 } 56 43 57 - .aphront-error-severity-warning h1 { 44 + .aphront-error-severity-warning .aphront-error-view-head { 58 45 background: #ffffcc; 59 46 } 60 47 61 48 .aphront-error-severity-notice { 62 - border: 1px solid #000088; 49 + border-color: #000088; 63 50 background: #f3f3ff; 64 51 } 65 52 66 - .aphront-error-severity-notice h1 { 53 + .aphront-error-severity-notice .aphront-error-view-head { 67 54 background: #e3e3ff; 68 55 } 69 56 70 57 .aphront-error-severity-nodata { 71 - border: 1px solid #dfdfdf; 58 + border-color: #dfdfdf; 72 59 background: #f3f3f3; 73 60 74 61 color: #666666; 75 62 76 - -webkit-box-shadow: 0px 0px 0px #000; 77 - -mox-box-shadow: 0px 0px 0px #000; 78 63 box-shadow: 0px 0px 0px #000; 79 64 } 80 65 81 - .aphront-error-severity-nodata h1 { 66 + .aphront-error-severity-nodata .aphront-error-view-head { 82 67 background: #e3e3e3; 83 68 }