From ca094bb9b1a78303b7f29afaaa23771ef239424e Mon Sep 17 00:00:00 2001 From: wangyuting Date: Tue, 27 Jun 2023 16:18:11 +0800 Subject: [PATCH] * Add testreport view page. --- module/testreport/css/view.ui.css | 3 + module/testreport/js/common.ui.js | 8 ++ module/testreport/js/create.ui.js | 9 -- module/testreport/js/edit.ui.js | 8 -- module/testreport/lang/zh-cn.php | 8 +- module/testreport/ui/create.html.php | 2 +- module/testreport/ui/edit.html.php | 4 +- module/testreport/ui/view.html.php | 147 +++++++++++++++++++++++++++ 8 files changed, 165 insertions(+), 24 deletions(-) create mode 100644 module/testreport/css/view.ui.css create mode 100644 module/testreport/js/common.ui.js create mode 100644 module/testreport/ui/view.html.php diff --git a/module/testreport/css/view.ui.css b/module/testreport/css/view.ui.css new file mode 100644 index 0000000000..78647c7ce1 --- /dev/null +++ b/module/testreport/css/view.ui.css @@ -0,0 +1,3 @@ +.detail-body .tabs {padding: 12px 24px 8px 24px;background: #fff;} +.detail-body .section-list {padding-left: 0px; padding-right: 0px;} +.detail-body .history {padding: 0px;} diff --git a/module/testreport/js/common.ui.js b/module/testreport/js/common.ui.js new file mode 100644 index 0000000000..5433c359fd --- /dev/null +++ b/module/testreport/js/common.ui.js @@ -0,0 +1,8 @@ +$().ready(function() +{ + if($('#goalTip').length) new zui.Tooltip('#goalTip', {title: goalTip, trigger: 'hover', placement: 'top', type: 'black', 'className': 'border border-light'}); + if($('#foundBugTip').length) new zui.Tooltip('#foundBugTip', {title: foundBugTip, trigger: 'hover', placement: 'top', type: 'black', 'className': 'border border-light'}); + if($('#legacyBugTip').length) new zui.Tooltip('#legacyBugTip', {title: legacyBugTip, trigger: 'hover', placement: 'top', type: 'black', 'className': 'border border-light'}); + if($('#activatedBugTip').length) new zui.Tooltip('#activatedBugTip', {title: activatedBugTip, trigger: 'hover', placement: 'top', type: 'black', 'className': 'border border-light'}); + if($('#fromCaseBugTip').length) new zui.Tooltip('#fromCaseBugTip', {title: fromCaseBugTip, trigger: 'hover', placement: 'top', type: 'black', 'className': 'border border-light'}); +}); diff --git a/module/testreport/js/create.ui.js b/module/testreport/js/create.ui.js index 3f652e84f1..0b77a8e1c8 100644 --- a/module/testreport/js/create.ui.js +++ b/module/testreport/js/create.ui.js @@ -1,12 +1,3 @@ -$().ready(function() -{ - if($('#goalTip').length) new zui.Tooltip('#goalTip', {title: goalTip, trigger: 'hover', placement: 'top', type: 'black', 'className': 'border border-light'}); - new zui.Tooltip('#foundBugTip', {title: foundBugTip, trigger: 'hover', placement: 'top', type: 'black', 'className': 'border border-light'}); - new zui.Tooltip('#legacyBugTip', {title: legacyBugTip, trigger: 'hover', placement: 'top', type: 'black', 'className': 'border border-light'}); - new zui.Tooltip('#activatedBugTip', {title: activatedBugTip, trigger: 'hover', placement: 'top', type: 'black', 'className': 'border border-light'}); - new zui.Tooltip('#fromCaseBugTip', {title: fromCaseBugTip, trigger: 'hover', placement: 'top', type: 'black', 'className': 'border border-light'}); -}); - function changeTesttask(event) { const taskID = $(event.target).val(); diff --git a/module/testreport/js/edit.ui.js b/module/testreport/js/edit.ui.js index 6f7ce9c6be..e69de29bb2 100644 --- a/module/testreport/js/edit.ui.js +++ b/module/testreport/js/edit.ui.js @@ -1,8 +0,0 @@ -$().ready(function() -{ - if($('#goalTip').length) new zui.Tooltip('#goalTip', {title: goalTip, trigger: 'hover', placement: 'top', type: 'black', 'className': 'border border-light'}); - new zui.Tooltip('#foundBugTip', {title: foundBugTip, trigger: 'hover', placement: 'top', type: 'black', 'className': 'border border-light'}); - new zui.Tooltip('#legacyBugTip', {title: legacyBugTip, trigger: 'hover', placement: 'top', type: 'black', 'className': 'border border-light'}); - new zui.Tooltip('#activatedBugTip', {title: activatedBugTip, trigger: 'hover', placement: 'top', type: 'black', 'className': 'border border-light'}); - new zui.Tooltip('#fromCaseBugTip', {title: fromCaseBugTip, trigger: 'hover', placement: 'top', type: 'black', 'className': 'border border-light'}); -}); diff --git a/module/testreport/lang/zh-cn.php b/module/testreport/lang/zh-cn.php index 3913857cef..acd0fbcd41 100644 --- a/module/testreport/lang/zh-cn.php +++ b/module/testreport/lang/zh-cn.php @@ -90,9 +90,9 @@ $lang->testreport->hiddenCase = "隐藏 %s 个用例"; $lang->testreport->goalTip = "该版本所属{$lang->execution->common}的描述信息"; $lang->testreport->bugSummary = <<%s个Bug , -遗留%s个Bug 。 -重新激活%s个Bug 。 -用例执行产生%s个Bug 。 +共发现%s个Bug , +遗留%s个Bug 。 +重新激活%s个Bug 。 +用例执行产生%s个Bug 。 有效Bug率(方案为已解决或延期 / 状态为已解决或已关闭):%s,用例发现Bug率(用例创建的Bug / 发现Bug数):%s EOD; diff --git a/module/testreport/ui/create.html.php b/module/testreport/ui/create.html.php index 14ee4be354..4e4ec12d6e 100644 --- a/module/testreport/ui/create.html.php +++ b/module/testreport/ui/create.html.php @@ -128,7 +128,7 @@ formPanel 'help', set('data-toggle', 'tooltip'), set('id', 'goalTip'), - set('class', 'text-warning') + set('class', 'text-light') ), $execution->desc ) diff --git a/module/testreport/ui/edit.html.php b/module/testreport/ui/edit.html.php index 76e6d2903f..fdea7999ca 100644 --- a/module/testreport/ui/edit.html.php +++ b/module/testreport/ui/edit.html.php @@ -1,7 +1,7 @@ @@ -102,7 +102,7 @@ formPanel 'help', set('data-toggle', 'tooltip'), set('id', 'goalTip'), - set('class', 'text-warning') + set('class', 'text-light') ), $execution->desc ) diff --git a/module/testreport/ui/view.html.php b/module/testreport/ui/view.html.php new file mode 100644 index 0000000000..28757dd3dc --- /dev/null +++ b/module/testreport/ui/view.html.php @@ -0,0 +1,147 @@ + + * @package testreport + * @link https://www.zentao.net + */ +namespace zin; +jsVar('goalTip', $lang->testreport->goalTip); +jsVar('foundBugTip', $lang->testreport->foundBugTip); +jsVar('legacyBugTip', $lang->testreport->legacyBugTip); +jsVar('activatedBugTip', $lang->testreport->activatedBugTip); +jsVar('fromCaseBugTip', $lang->testreport->fromCaseBugTip); + +detailHeader +( + to::title + ( + entityLabel + ( + set::entityID($report->id), + set::level(1), + set::text($report->title) + ) + ) +); + +$members = ''; +foreach(explode(',', $report->members) as $member) $members .= zget($users, $member) . ' '; + +div +( + set::class('detail-body rounded flex gap-1'), + div + ( + set::class('col gap-1 grow'), + tabs + ( + tabPane + ( + set::key('basic'), + set::title($lang->testreport->view), + set::active(true), + sectionList + ( + section + ( + set::title($lang->testreport->legendBasic), + set::useHtml(true), + tableData + ( + item(set::name($lang->testreport->startEnd), $report->begin . ' ~ ' . $report->end), + item(set::name($lang->testreport->owner), zget($users, $report->owner)), + item(set::name($lang->testreport->members), $members), + !empty($execution->desc) ? item + ( + set::name($lang->testreport->goal), + icon + ( + 'help', + set('data-toggle', 'tooltip'), + set('id', 'goalTip'), + set('class', 'text-light') + ), + $execution->desc + ) : null, + item + ( + set::name($lang->testreport->profile), + div + ( + div(html($storySummary)), + div(html(sprintf($lang->testreport->buildSummary, empty($builds) ? 1 : count($builds)) . $caseSummary)), + div(html(sprintf($lang->testreport->bugSummary, $bugSummary['foundBugs'], count($legacyBugs), $bugSummary['activatedBugs'], $bugSummary['countBugByTask'], $bugSummary['bugConfirmedRate'] . '%', $bugSummary['bugCreateByCaseRate'] . '%'))) + ) + ), + item(set::name($lang->testreport->legendComment), empty($report->report) ? $lang->testreport->none : $report->report), + ) + ), + $report->files ? section + ( + set::title($lang->files), + fileList + ( + set::files($report->files), + set::fieldset(false) + ) + ) : null, + history() + ) + ), + tabPane + ( + set::key('storyAndBug'), + set::title($lang->testreport->legendStoryAndBug), + tableData + ( + ) + ), + tabPane + ( + set::key('tabBuild'), + set::title($lang->testreport->legendBuild), + tableData + ( + ) + ), + tabPane + ( + set::key('tabCase'), + set::title($lang->testreport->legendCase), + tableData + ( + ) + ), + tabPane + ( + set::key('tabLegacyBugs'), + set::title($lang->testreport->legendLegacyBugs), + tableData + ( + ) + ), + tabPane + ( + set::key('tabReport'), + set::title($lang->testreport->legendReport), + tableData + ( + ) + ), + tabPane + ( + set::key('legendMore'), + set::title($lang->testreport->tabMore), + tableData + ( + ) + ) + ) + ) +); + +render();