Christopher Johnson (WMDE) has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/190191

Change subject: adds a burndown exception for sprints without a board
......................................................................

adds a burndown exception for sprints without a board

Bug:T89282
Change-Id: I20cbdc0b9973d3d3d19a7e546e4a31b7ae67798a
---
M src/query/SprintQuery.php
1 file changed, 13 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/phabricator/extensions/Sprint 
refs/changes/91/190191/1

diff --git a/src/query/SprintQuery.php b/src/query/SprintQuery.php
index 32a76b7..e133cd1 100644
--- a/src/query/SprintQuery.php
+++ b/src/query/SprintQuery.php
@@ -45,7 +45,7 @@
       $start = idx($aux_fields, 'isdc:sprint:startdate')
           ->getProxy()->getFieldValue();
     if (is_null($start)) {
-      $help = 'To do this, go to the Project Edit Details Page';
+      $help = pht('To do this, go to the Project Edit Details Page');
       throw new BurndownException("The project \"".$this->project->getName()
           ."\" is not set up for Sprint because "
           ."it has not been assigned a start date\n", $help);
@@ -58,7 +58,7 @@
     $end = idx($aux_fields, 'isdc:sprint:enddate')
         ->getProxy()->getFieldValue();
     if (is_null($end)) {
-      $help = 'To do this, go to the Project Edit Details Page';
+      $help = pht('To do this, go to the Project Edit Details Page');
       throw new BurndownException("The project \"".$this->project->getName()
           ."\" is not set up for Sprint because "
           ."it has not been assigned an end date\n", $help);
@@ -74,8 +74,8 @@
         ->needProjectPHIDs(true)
         ->execute();
     if (empty($tasks)) {
-      $help = 'To Create a Task, go to the Sprint Board and select the '
-      .'column header menu';
+      $help = pht('To Create a Task, go to the Sprint Board and select the '
+      .'column header menu');
       throw new BurndownException("The project \"".$this->project->getName()
           ."\" is not set up for Sprint because "
           ."it has no tasks\n", $help);
@@ -122,8 +122,8 @@
         $sprint_phids[] = $value->getObjectPHID();
       }
     if (empty($sprint_phids)) {
-      $help = 'To Create a Sprint, go to /project/create/ and make sure that'
-          .' the "Is Sprint" box has been checked';
+      $help = pht('To Create a Sprint, go to /project/create/ and make sure 
that'
+          .' the "Is Sprint" box has been checked');
       throw new BurndownException("There are no Sprints to show yet\n", $help);
     } else {
       return $sprint_phids;
@@ -238,7 +238,13 @@
         ->withProjectPHIDs(array($this->project_phid))
         ->execute();
     $columns = msort($columns, 'getSequence');
-    return $columns;
+    if (!$columns) {
+      $help = pht('To Create a Sprint Board, go to the Project profile page'
+          .' and select the Sprint Board icon from the left side bar');
+      throw new BurndownException("There is no Sprint Board yet\n", $help);
+    } else {
+      return $columns;
+    }
   }
 
   public function getColumnforPHID($column_phid) {

-- 
To view, visit https://gerrit.wikimedia.org/r/190191
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I20cbdc0b9973d3d3d19a7e546e4a31b7ae67798a
Gerrit-PatchSet: 1
Gerrit-Project: phabricator/extensions/Sprint
Gerrit-Branch: master
Gerrit-Owner: Christopher Johnson (WMDE) <christopher.john...@wikimedia.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to