Improve several Diffusion UI error states
Summary: Give users better errors and UI: - For subpath SVN repositories, default the path to the subdirectory, not to "/". This makes the home screen useful and things generally less confusing. - For unparsed commits, show a more descriptive error message without the "blah blah" silliness. - For paths outside of the subpath parse tree, short circuit into an appropriate error message. - For foreign SVN stub commits (see D892), show an explicit message. Test Plan: Looked at unparsed commits, subpath repositories, foreign stub commits, and paths outside of the subpath parse tree. Received sensible error messages. Reviewers: jungejason, nh, tuomaspelkonen, aran Reviewed By: jungejason CC: aran, jungejason Differential Revision: 894
This commit is contained in:
@@ -75,6 +75,16 @@ class DiffusionBrowseController extends DiffusionController {
|
||||
$controller->setDiffusionRequest($drequest);
|
||||
return $this->delegateToController($controller);
|
||||
break;
|
||||
case DiffusionBrowseQuery::REASON_IS_UNTRACKED_PARENT:
|
||||
$subdir = $drequest->getRepository()->getDetail('svn-subpath');
|
||||
$title = 'Directory Not Tracked';
|
||||
$body =
|
||||
"This repository is configured to track only one subdirectory ".
|
||||
"of the entire repository ('".phutil_escape_html($subdir)."'), ".
|
||||
"but you aren't looking at something in that subdirectory, so no ".
|
||||
"information is available.";
|
||||
$severity = AphrontErrorView::SEVERITY_WARNING;
|
||||
break;
|
||||
default:
|
||||
throw new Exception("Unknown failure reason!");
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ phutil_require_module('phabricator', 'applications/phid/handle/data');
|
||||
phutil_require_module('phabricator', 'view/form/error');
|
||||
phutil_require_module('phabricator', 'view/layout/panel');
|
||||
|
||||
phutil_require_module('phutil', 'markup');
|
||||
phutil_require_module('phutil', 'utils');
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user