From 7589eca47011e6a391fe27ab39da7c05873cc141 Mon Sep 17 00:00:00 2001 From: liyuchun Date: Tue, 9 Nov 2021 09:50:00 +0800 Subject: [PATCH 1/6] * Finish task #43954. --- module/execution/css/kanban.css | 5 ++++- module/execution/js/kanban.js | 3 +++ module/kanban/lang/en.php | 2 ++ module/kanban/lang/zh-cn.php | 4 ++-- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/module/execution/css/kanban.css b/module/execution/css/kanban.css index 09258a333c..daa4d7b0d7 100644 --- a/module/execution/css/kanban.css +++ b/module/execution/css/kanban.css @@ -36,7 +36,10 @@ #kanbans .kanban-lane {min-height: 150px;} #kanbans .kanban-affixed > .kanban-header {top: 100px;} +#type_chosen .icon-kanban {padding-right: 10px; font-size: 15px;} + .dropdown-menu a {text-align: left;} .scrollbar-hover {max-height: 2000px; overflow: scroll !important;} -.c-type, .c-group {width: 150px !important; overflow: unset;} +.c-type {width: 150px !important; overflow: unset;} +.c-group {width: 190px !important; overflow: unset;} .c-type {margin-left: 0px !important;} diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index 204d6504d3..7452b364a2 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -755,6 +755,9 @@ $(function() location.href = createLink('execution', 'importPlanStories', 'executionID=' + executionID + '&planID=' + planID + '&productID=0&fromMethod=kanban'); } }) + + $('#type_chosen .chosen-single span').prepend(''); + $('#group_chosen .chosen-single span').prepend(kanbanLang.laneGroup + ': '); }); $('#type').change(function() diff --git a/module/kanban/lang/en.php b/module/kanban/lang/en.php index 7555d2a66c..11446d7afc 100644 --- a/module/kanban/lang/en.php +++ b/module/kanban/lang/en.php @@ -49,7 +49,9 @@ $lang->kanban->noColumnUniqueName = 'The Kanban column name already exists.'; $lang->kanban->moveUp = 'Swimlane Up'; $lang->kanban->moveDown = 'Swimlane Down'; $lang->kanban->laneMove = 'Swimlane Sorting'; +$lang->kanban->laneGroup = 'Lane Group'; $lang->kanban->moreAction = 'More Action'; +$lang->kanban->noGroup = 'None'; $lang->kanban->error = new stdclass(); $lang->kanban->error->mustBeInt = 'The WIPs must be positive integer.'; diff --git a/module/kanban/lang/zh-cn.php b/module/kanban/lang/zh-cn.php index 3bfa0eb6bb..2fb74a7285 100644 --- a/module/kanban/lang/zh-cn.php +++ b/module/kanban/lang/zh-cn.php @@ -49,7 +49,9 @@ $lang->kanban->noColumnUniqueName = '看板列名称已存在'; $lang->kanban->moveUp = '泳道上移'; $lang->kanban->moveDown = '泳道下移'; $lang->kanban->laneMove = '泳道排序'; +$lang->kanban->laneGroup = '泳道分组'; $lang->kanban->moreAction = '更多操作'; +$lang->kanban->noGroup = '无'; $lang->kanban->error = new stdclass(); $lang->kanban->error->mustBeInt = '在制品数量必须是正整数。'; @@ -94,8 +96,6 @@ $lang->kanban->taskColumn['pause'] = '已暂停'; $lang->kanban->taskColumn['canceled'] = '已取消'; $lang->kanban->taskColumn['closed'] = '已关闭'; -$lang->kanban->noGroup = '无'; - $lang->kanbancolumn = new stdclass(); $lang->kanbancolumn->limit = $lang->kanban->WIPCount; From 954221334bfaa3982f8b29ce03514d2f252a5010 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=B9=BF=E6=98=8E?= Date: Tue, 9 Nov 2021 10:38:09 +0800 Subject: [PATCH 2/6] * Finish task #43955. --- module/execution/js/kanban.js | 31 +++++++++++---------------- module/execution/view/kanban.html.php | 1 + 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index 204d6504d3..23bcad2369 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -11,25 +11,20 @@ function changeView(view) */ function renderUserAvatar(user, objectType, objectID) { + if(objectType == 'task') var link = createLink('task', 'assignto', 'executionID=' + executionID + '&id=' + objectID, '', true); + if(objectType == 'story') var link = createLink('story', 'assignto', 'id=' + objectID, '', true); + if(objectType == 'bug') var link = createLink('bug', 'assignto', 'id=' + objectID, '', true); + + if(!user) return $(''); + if(typeof user === 'string') user = {account: user}; if(!user.avatar && window.userList && window.userList[user.account]) user = window.userList[user.account]; var $noPrivAvatar = $('
').avatar({user: user}); - if(objectType == 'task') - { - if(!priv.canAssignTask) return $noPrivAvatar; - var link = createLink('task', 'assignto', 'executionID=' + executionID + '&id=' + objectID, '', true); - } - else if(objectType == 'story') - { - if(!priv.canAssignStory) return $noPrivAvatar; - var link = createLink('story', 'assignto', 'id=' + objectID, '', true); - } - else if(objectType == 'bug') - { - if(!priv.canAssignBug) return $noPrivAvatar; - var link = createLink('bug', 'assignto', 'id=' + objectID, '', true); - } + if(objectType == 'task' && !priv.canAssignTask) return $noPrivAvatar; + if(objectType == 'task' && !priv.canAssignStory) return $noPrivAvatar; + if(objectType == 'bug' && !priv.canAssignBug) return $noPrivAvatar; + return $('').avatar({user: user}); } @@ -84,7 +79,7 @@ function renderStoryItem(item, $item, col) '' + item.pri + '', item.estimate ? '' + item.estimate + 'h' : '', ].join('')); - if(item.assignedTo) $infos.append(renderUserAvatar(item.assignedTo, 'story', item.id)); + $infos.append(renderUserAvatar(item.assignedTo, 'story', item.id)); var $actions = $item.find('.actions'); if(!$actions.length && item.menus.length) @@ -133,7 +128,7 @@ function renderBugItem(item, $item, col) '' + item.pri + '', ].join('')); if(item.deadline) $infos.append(renderDeadline(item.deadline)); - if(item.assignedTo) $infos.append(renderUserAvatar(item.assignedTo, 'bug', item.id)); + $infos.append(renderUserAvatar(item.assignedTo, 'bug', item.id)); var $actions = $item.find('.actions'); if(!$actions.length && item.menus.length) @@ -182,7 +177,7 @@ function renderTaskItem(item, $item, col) item.estimate ? '' + item.estimate + 'h' : '', ].join('')); if(item.deadline) $infos.append(renderDeadline(item.deadline)); - if(item.assignedTo) $infos.append(renderUserAvatar(item.assignedTo, 'task', item.id)); + $infos.append(renderUserAvatar(item.assignedTo, 'task', item.id)); var $actions = $item.find('.actions'); if(!$actions.length && item.menus.length) diff --git a/module/execution/view/kanban.html.php b/module/execution/view/kanban.html.php index 422ae7163a..8fffbce417 100644 --- a/module/execution/view/kanban.html.php +++ b/module/execution/view/kanban.html.php @@ -149,5 +149,6 @@ js::set('priv', execution->sortColumn);?> kanban);?> task->deadlineAB);?> +task->noAssigned);?> From 7e9f72ab57d5fad06937ccceb5bda22863a17f3e Mon Sep 17 00:00:00 2001 From: Hao Sun Date: Tue, 9 Nov 2021 13:38:37 +0800 Subject: [PATCH 3/6] * improve UI for dropdown menu in doc side tree. --- module/doc/css/objectlibs.css | 15 ++++++++++++--- module/doc/model.php | 8 ++++++-- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/module/doc/css/objectlibs.css b/module/doc/css/objectlibs.css index e70a6841af..8656d576da 100644 --- a/module/doc/css/objectlibs.css +++ b/module/doc/css/objectlibs.css @@ -2,7 +2,7 @@ .addbtn {padding-top: 22px; height: 63px; border: 1px dashed #ddd; width: 60px;} .addbtn .icon-plus {font-size: 18px; display: block; opacity: 0.5; transition: opacity .2s; text-shadow: 1px 1px 3px rgba(0,0,0,.2);} .addbtn:hover .icon-plus {opacity: .9; animation: flash-icon 1s linear alternate infinite;} -#subHeader #dropMenu {min-width: 250px; box-sizing: inhert; max-height: inherit;} +#subHeader #dropMenu {min-width: 250px; box-sizing: inherit; max-height: inherit;} #subHeader #dropMenu .table-col .list-group {padding-top: 10px;} .main-col .block-files .panel-heading {padding-right: 20px;} .main-col .block-files .panel-heading .panel-title {height: 35px; line-height: 30px;} @@ -42,5 +42,14 @@ .title {font-size: 20px !important;} .article-content.comment {width: 100% !important;} -.tree-group .tree-actions{display: none} -.tree-group:hover .tree-actions{display: inline} +#custom, .tree {overflow: visible} +.tree li>.list-toggle {left: -4px; top: 0;} +.tree-group {position: relative;} +.tree-group > .module-name {white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; display: block;} +.tree-group .tree-actions {display: none; position: absolute; right: 0; top: 0; background-color: #fff; white-space: nowrap;} +.tree-group:hover > .module-name {width: calc(100% - 84px);} +.tree-group:hover .tree-actions {display: block} +.tree-group .tree-actions > .dropdown {display: inline-block;} +.tree-group .dropdown-menu {position: absolute; right: 0; left: auto; margin-top: -2px;} +.tree-group .dropdown-menu > li > a {max-width: 100%; color: #3c4353!important; font-weight: normal!important;} +.tree-group .dropdown-menu > li > a:hover {color: #fff;} diff --git a/module/doc/model.php b/module/doc/model.php index cbcf52e068..648ff9e34a 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -2373,8 +2373,9 @@ EOT; if($currentMethod == 'objectlibs') { $treeMenu[$module->id] .= "
" . html::a(inlink('objectLibs', "type=$type&objectID=$objectID&libID=$libID&docID={$doc->id}"), "  " . $doc->title, '', "data-app='{$this->app->tab}' class='doc-title' title='{$doc->title}'") . ''; - $treeMenu[$module->id] .= "
"; + $treeMenu[$module->id] .= "
"; $treeMenu[$module->id] .= html::a(helper::createLink('doc', 'edit', "docID=$docID&comment=false&objectType=$type&objectID=$objectID&libID=$libID"), "", '', "title={$this->lang->doc->edit}"); + $treeMenu[$module->id] .= '"; $treeMenu[$module->id] .= "lang->tree->dragAndSort}>"; $treeMenu[$module->id] .= '
'; } @@ -2419,9 +2421,10 @@ EOT; else { $li = "
" . $module->name . ''; - $li .= "
"; + $li .= "
"; $li .= html::a(helper::createLink('tree', 'edit', "module=$module->id&type=doc"), "", '', "data-toggle='modal' title={$this->lang->doc->editType}"); $li .= html::a(helper::createLink('tree', 'browse', "rootID=$libID&type=doc&module=$module->id", '', 1), "", '', "class='iframe' title={$this->lang->doc->editType}"); + $li .=''; $li .= "lang->tree->dragAndSort}>"; $li .= '
'; } From 21d6cbd16081bc6520a5dc2c708917396aefe2e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=B9=BF=E6=98=8E?= Date: Tue, 9 Nov 2021 14:24:49 +0800 Subject: [PATCH 4/6] * Fix logic error. --- module/execution/js/kanban.js | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index 23bcad2369..451f1bef31 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -11,9 +11,22 @@ function changeView(view) */ function renderUserAvatar(user, objectType, objectID) { - if(objectType == 'task') var link = createLink('task', 'assignto', 'executionID=' + executionID + '&id=' + objectID, '', true); - if(objectType == 'story') var link = createLink('story', 'assignto', 'id=' + objectID, '', true); - if(objectType == 'bug') var link = createLink('bug', 'assignto', 'id=' + objectID, '', true); + var $noPrivAndNoAssigned = $('
'); + if(objectType == 'task') + { + if(!priv.canAssignTask && !user) return $noPrivAndNoAssigned; + var link = createLink('task', 'assignto', 'executionID=' + executionID + '&id=' + objectID, '', true); + } + if(objectType == 'story') + { + if(!priv.canAssignStory && !user) return $noPrivAndNoAssigned; + var link = createLink('story', 'assignto', 'id=' + objectID, '', true); + } + if(objectType == 'bug') + { + if(!priv.canAssignBug && !user) return $noPrivAndNoAssigned; + var link = createLink('bug', 'assignto', 'id=' + objectID, '', true); + } if(!user) return $(''); @@ -21,9 +34,9 @@ function renderUserAvatar(user, objectType, objectID) if(!user.avatar && window.userList && window.userList[user.account]) user = window.userList[user.account]; var $noPrivAvatar = $('
').avatar({user: user}); - if(objectType == 'task' && !priv.canAssignTask) return $noPrivAvatar; - if(objectType == 'task' && !priv.canAssignStory) return $noPrivAvatar; - if(objectType == 'bug' && !priv.canAssignBug) return $noPrivAvatar; + if(objectType == 'task' && !priv.canAssignTask) return $noPrivAvatar; + if(objectType == 'story' && !priv.canAssignStory) return $noPrivAvatar; + if(objectType == 'bug' && !priv.canAssignBug) return $noPrivAvatar; return $('').avatar({user: user}); From 521a8e871d29cad0ab5e26299daad2c55058c003 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=B9=BF=E6=98=8E?= Date: Tue, 9 Nov 2021 14:39:07 +0800 Subject: [PATCH 5/6] * Finish task #44139. --- module/execution/js/kanban.js | 1 - module/story/control.php | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index c55ff68665..87fbade59d 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -38,7 +38,6 @@ function renderUserAvatar(user, objectType, objectID) if(objectType == 'story' && !priv.canAssignStory) return $noPrivAvatar; if(objectType == 'bug' && !priv.canAssignBug) return $noPrivAvatar; - return $('').avatar({user: user}); } diff --git a/module/story/control.php b/module/story/control.php index d9cf6ad772..13545833b1 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -1793,6 +1793,7 @@ class story extends control } $stories = $this->story->getProductStoryPairs($productID, $branch ? "0,$branch" : $branch, $moduleID, $storyStatus, 'id_desc', $limit, $type, 'story', $hasParent); + if(empty($stories)) $stories = $this->story->getProductStoryPairs($productID, $branch ? "0,$branch" : $branch, 0, $storyStatus, 'id_desc', $limit, $type, 'story', $hasParent); $storyID = isset($stories[$storyID]) ? $storyID : 0; $select = html::select('story', empty($stories) ? array('' => '') : $stories, $storyID, "class='form-control'"); From dc2e2cba795787584e2eb690eb512e13bae55466 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=B9=BF=E6=98=8E?= Date: Tue, 9 Nov 2021 14:57:42 +0800 Subject: [PATCH 6/6] * Adjust doc css. --- module/doc/css/objectlibs.css | 8 ++++---- module/doc/model.php | 14 ++------------ 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/module/doc/css/objectlibs.css b/module/doc/css/objectlibs.css index 8656d576da..e5a12a8689 100644 --- a/module/doc/css/objectlibs.css +++ b/module/doc/css/objectlibs.css @@ -46,10 +46,10 @@ .tree li>.list-toggle {left: -4px; top: 0;} .tree-group {position: relative;} .tree-group > .module-name {white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; display: block;} -.tree-group .tree-actions {display: none; position: absolute; right: 0; top: 0; background-color: #fff; white-space: nowrap;} +.tree-group .treeActions {display: none; position: absolute; right: 0; top: 0; background-color: #fff; white-space: nowrap;} .tree-group:hover > .module-name {width: calc(100% - 84px);} -.tree-group:hover .tree-actions {display: block} -.tree-group .tree-actions > .dropdown {display: inline-block;} +.tree-group:hover .treeActions {display: block} +.tree-group .treeActions > .dropdown {display: inline-block;} .tree-group .dropdown-menu {position: absolute; right: 0; left: auto; margin-top: -2px;} .tree-group .dropdown-menu > li > a {max-width: 100%; color: #3c4353!important; font-weight: normal!important;} -.tree-group .dropdown-menu > li > a:hover {color: #fff;} +.tree-group .dropdown-menu > li > a:hover {color: #fff !important;} diff --git a/module/doc/model.php b/module/doc/model.php index 648ff9e34a..a03eccaf74 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -2373,7 +2373,7 @@ EOT; if($currentMethod == 'objectlibs') { $treeMenu[$module->id] .= "
" . html::a(inlink('objectLibs', "type=$type&objectID=$objectID&libID=$libID&docID={$doc->id}"), "  " . $doc->title, '', "data-app='{$this->app->tab}' class='doc-title' title='{$doc->title}'") . ''; - $treeMenu[$module->id] .= "
"; + $treeMenu[$module->id] .= "
"; $treeMenu[$module->id] .= html::a(helper::createLink('doc', 'edit', "docID=$docID&comment=false&objectType=$type&objectID=$objectID&libID=$libID"), "", '', "title={$this->lang->doc->edit}"); $treeMenu[$module->id] .= '"; $treeMenu[$module->id] .= "lang->tree->dragAndSort}>"; @@ -2421,7 +2416,7 @@ EOT; else { $li = "
" . $module->name . ''; - $li .= "
"; + $li .= "
"; $li .= html::a(helper::createLink('tree', 'edit', "module=$module->id&type=doc"), "", '', "data-toggle='modal' title={$this->lang->doc->editType}"); $li .= html::a(helper::createLink('tree', 'browse', "rootID=$libID&type=doc&module=$module->id", '', 1), "", '', "class='iframe' title={$this->lang->doc->editType}"); $li .=''; $li .= "lang->tree->dragAndSort}>";