* Fix show grade bug.

This commit is contained in:
sunguangming
2024-03-27 15:32:29 +08:00
parent 1b60255446
commit 6d19c9e61c
4 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -65,7 +65,7 @@ window.renderCell = function(result, info)
if(story.parent > 0) if($.cookie.get('tab') == 'project') html += story.parentName + ' / ';
let gradeLabel = gradeGroup[story.type][story.grade];
if(!showGrade && story.grade < 2) gradeLabel = '';
if(!showGrade && story.grade < 2 && storyType == story.type) gradeLabel = '';
if(gradeLabel) html += "<span class='label gray-pale rounded-xl clip'>" + gradeLabel + "</span> ";
if(story.color) result[0].props.style = 'color: ' + story.color;
if(html) result.unshift({html});
+2 -1
View File
@@ -18,6 +18,7 @@ jsVar('URChanged', $this->lang->story->URChanged);
jsVar('gradeGroup', $gradeGroup);
jsVar('showGrade', $showGrade);
jsVar('oldShowGrades', $showGrades);
jsVar('storyType', $storyType);
$storyCommon = $storyType == 'requirement' ? $lang->URCommon : $lang->SRCommon;
$isProjectStory = $this->app->rawModule == 'projectstory';
@@ -320,7 +321,7 @@ if($isProjectStory and $storyType == 'requirement')
$queryMenuLink = createLink($app->rawModule, $app->rawMethod, $projectIDParam . "productID=$productID&branch=$branch&browseType=bySearch&param={queryID}");
featureBar
(
$showGrade ? to::leading
($showGrade || $storyType != 'story') ? to::leading
(
picker
(
+1 -1
View File
@@ -1470,7 +1470,7 @@ class productZen extends product
$this->view->project = $project;
$this->view->stories = $stories;
$this->view->gradeGroup = $gradeGroup;
$this->view->showGrade = count($gradeGroup[$storyType]) > 1;
$this->view->showGrade = count($gradeGroup[$storyType]) > 2;
$this->view->gradeMenu = $this->loadModel('story')->getGradeMenu($storyType);
$this->view->showGrades = isset($this->config->{$storyType}->showGrades) ? $this->config->{$storyType}->showGrades : $this->story->getDefaultShowGrades($this->view->gradeMenu);
$this->view->storyType = $storyType;
+2
View File
@@ -5011,6 +5011,8 @@ class storyModel extends model
{
$grades = $this->getGradePairs($storyType);
if($this->config->edition == 'open') return false;
return count($grades) > 1;
}