Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
5b28ee5f
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5b28ee5f
编写于
4月 09, 2019
作者:
K
Kushal Pandya
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add time tracking information to Issue Boards sidebar
Add time tracking progress bar to Issue Boards sidebar.
上级
026c92d5
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
58 addition
and
13 deletion
+58
-13
app/assets/javascripts/boards/components/board_sidebar.js
app/assets/javascripts/boards/components/board_sidebar.js
+13
-11
app/assets/javascripts/boards/index.js
app/assets/javascripts/boards/index.js
+22
-2
app/serializers/issue_board_entity.rb
app/serializers/issue_board_entity.rb
+1
-0
app/views/shared/boards/components/_sidebar.html.haml
app/views/shared/boards/components/_sidebar.html.haml
+1
-0
app/views/shared/boards/components/sidebar/_time_tracker.html.haml
.../shared/boards/components/sidebar/_time_tracker.html.haml
+6
-0
spec/features/boards/sidebar_spec.rb
spec/features/boards/sidebar_spec.rb
+15
-0
未找到文件。
app/assets/javascripts/boards/components/board_sidebar.js
浏览文件 @
5b28ee5f
...
...
@@ -2,18 +2,19 @@
import
$
from
'
jquery
'
;
import
Vue
from
'
vue
'
;
import
Flash
from
'
../../flash
'
;
import
{
sprintf
,
__
}
from
'
../../locale
'
;
import
Sidebar
from
'
../../right_sidebar
'
;
import
eventHub
from
'
../../sidebar/event_hub
'
;
import
AssigneeTitle
from
'
../../sidebar/components/assignees/assignee_title.vue
'
;
import
Assignees
from
'
../../sidebar/components/assignees/assignees.vue
'
;
import
DueDateSelectors
from
'
../../due_date_select
'
;
import
Flash
from
'
~/flash
'
;
import
{
sprintf
,
__
}
from
'
~/locale
'
;
import
Sidebar
from
'
~/right_sidebar
'
;
import
eventHub
from
'
~/sidebar/event_hub
'
;
import
DueDateSelectors
from
'
~/due_date_select
'
;
import
IssuableContext
from
'
~/issuable_context
'
;
import
LabelsSelect
from
'
~/labels_select
'
;
import
AssigneeTitle
from
'
~/sidebar/components/assignees/assignee_title.vue
'
;
import
Assignees
from
'
~/sidebar/components/assignees/assignees.vue
'
;
import
Subscriptions
from
'
~/sidebar/components/subscriptions/subscriptions.vue
'
;
import
TimeTracker
from
'
~/sidebar/components/time_tracking/time_tracker.vue
'
;
import
MilestoneSelect
from
'
~/milestone_select
'
;
import
RemoveBtn
from
'
./sidebar/remove_issue.vue
'
;
import
IssuableContext
from
'
../../issuable_context
'
;
import
LabelsSelect
from
'
../../labels_select
'
;
import
Subscriptions
from
'
../../sidebar/components/subscriptions/subscriptions.vue
'
;
import
MilestoneSelect
from
'
../../milestone_select
'
;
import
boardsStore
from
'
../stores/boards_store
'
;
export
default
Vue
.
extend
({
...
...
@@ -22,6 +23,7 @@ export default Vue.extend({
Assignees
,
RemoveBtn
,
Subscriptions
,
TimeTracker
,
},
props
:
{
currentUser
:
{
...
...
app/assets/javascripts/boards/index.js
浏览文件 @
5b28ee5f
...
...
@@ -24,7 +24,11 @@ import BoardSidebar from './components/board_sidebar';
import
initNewListDropdown
from
'
./components/new_list_dropdown
'
;
import
BoardAddIssuesModal
from
'
./components/modal/index.vue
'
;
import
'
~/vue_shared/vue_resource_interceptor
'
;
import
{
NavigationType
,
parseBoolean
}
from
'
~/lib/utils/common_utils
'
;
import
{
NavigationType
,
convertObjectPropsToCamelCase
,
parseBoolean
,
}
from
'
~/lib/utils/common_utils
'
;
let
issueBoardsApp
;
...
...
@@ -133,9 +137,25 @@ export default () => {
BoardService
.
getIssueInfo
(
sidebarInfoEndpoint
)
.
then
(
res
=>
res
.
data
)
.
then
(
data
=>
{
const
{
subscribed
,
totalTimeSpent
,
timeEstimate
,
humanTimeEstimate
,
humanTotalTimeSpent
,
weight
,
epic
,
}
=
convertObjectPropsToCamelCase
(
data
);
newIssue
.
setFetchingState
(
'
subscriptions
'
,
false
);
newIssue
.
updateData
({
subscribed
:
data
.
subscribed
,
humanTimeSpent
:
humanTotalTimeSpent
,
timeSpent
:
totalTimeSpent
,
humanTimeEstimate
,
timeEstimate
,
subscribed
,
weight
,
epic
,
});
})
.
catch
(()
=>
{
...
...
app/serializers/issue_board_entity.rb
浏览文件 @
5b28ee5f
...
...
@@ -12,6 +12,7 @@ class IssueBoardEntity < Grape::Entity
expose
:due_date
expose
:project_id
expose
:relative_position
expose
:time_estimate
expose
:project
do
|
issue
|
API
::
Entities
::
Project
.
represent
issue
.
project
,
only:
[
:id
,
:path
]
...
...
app/views/shared/boards/components/_sidebar.html.haml
浏览文件 @
5b28ee5f
...
...
@@ -20,6 +20,7 @@
=
render
"shared/boards/components/sidebar/assignee"
=
render_if_exists
"shared/boards/components/sidebar/epic"
=
render
"shared/boards/components/sidebar/milestone"
=
render
"shared/boards/components/sidebar/time_tracker"
=
render
"shared/boards/components/sidebar/due_date"
=
render
"shared/boards/components/sidebar/labels"
=
render_if_exists
"shared/boards/components/sidebar/weight"
...
...
app/views/shared/boards/components/sidebar/_time_tracker.html.haml
0 → 100644
浏览文件 @
5b28ee5f
.block.time-tracking
%time-tracker
{
":time-estimate"
=>
"issue.timeEstimate || 0"
,
":time-spent"
=>
"issue.timeSpent || 0"
,
":human-time-estimate"
=>
"issue.humanTimeEstimate"
,
":human-time-spent"
=>
"issue.humanTimeSpent"
,
"root-path"
=>
"#{root_url}"
}
spec/features/boards/sidebar_spec.rb
浏览文件 @
5b28ee5f
...
...
@@ -222,6 +222,21 @@ describe 'Issue Boards', :js do
end
end
context
'time tracking'
do
before
do
issue2
.
timelogs
.
create
(
time_spent:
14400
,
user:
user
)
issue2
.
update!
(
time_estimate:
28800
)
end
it
'shows time tracking progress bar'
do
click_card
(
card
)
page
.
within
(
'.time-tracking'
)
do
expect
(
find
(
'.time-tracking-content .compare-meter'
)[
'data-original-title'
]).
to
eq
(
'Time remaining: 4h'
)
end
end
end
context
'due date'
do
it
'updates due date'
do
click_card
(
card
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录