Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
78de5251
Commit
78de5251
authored
Mar 21, 2018
by
George Tsiolis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move TimeTrackingCollapsedState vue component
parent
8ff2d899
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
109 additions
and
98 deletions
+109
-98
app/assets/javascripts/sidebar/components/time_tracking/collapsed_state.js
...ripts/sidebar/components/time_tracking/collapsed_state.js
+0
-96
app/assets/javascripts/sidebar/components/time_tracking/collapsed_state.vue
...ipts/sidebar/components/time_tracking/collapsed_state.vue
+102
-0
app/assets/javascripts/sidebar/components/time_tracking/time_tracker.vue
...scripts/sidebar/components/time_tracking/time_tracker.vue
+2
-2
changelogs/unreleased/refactor-move-time-tracking-vue-components.yml
...unreleased/refactor-move-time-tracking-vue-components.yml
+5
-0
No files found.
app/assets/javascripts/sidebar/components/time_tracking/collapsed_state.js
deleted
100644 → 0
View file @
8ff2d899
import
stopwatchSvg
from
'
icons/_icon_stopwatch.svg
'
;
import
{
abbreviateTime
}
from
'
../../../lib/utils/pretty_time
'
;
export
default
{
name
:
'
time-tracking-collapsed-state
'
,
props
:
{
showComparisonState
:
{
type
:
Boolean
,
required
:
true
,
},
showSpentOnlyState
:
{
type
:
Boolean
,
required
:
true
,
},
showEstimateOnlyState
:
{
type
:
Boolean
,
required
:
true
,
},
showNoTimeTrackingState
:
{
type
:
Boolean
,
required
:
true
,
},
timeSpentHumanReadable
:
{
type
:
String
,
required
:
false
,
default
:
''
,
},
timeEstimateHumanReadable
:
{
type
:
String
,
required
:
false
,
default
:
''
,
},
},
computed
:
{
timeSpent
()
{
return
this
.
abbreviateTime
(
this
.
timeSpentHumanReadable
);
},
timeEstimate
()
{
return
this
.
abbreviateTime
(
this
.
timeEstimateHumanReadable
);
},
divClass
()
{
if
(
this
.
showComparisonState
)
{
return
'
compare
'
;
}
else
if
(
this
.
showEstimateOnlyState
)
{
return
'
estimate-only
'
;
}
else
if
(
this
.
showSpentOnlyState
)
{
return
'
spend-only
'
;
}
else
if
(
this
.
showNoTimeTrackingState
)
{
return
'
no-tracking
'
;
}
return
''
;
},
spanClass
()
{
if
(
this
.
showComparisonState
)
{
return
''
;
}
else
if
(
this
.
showEstimateOnlyState
||
this
.
showSpentOnlyState
)
{
return
'
bold
'
;
}
else
if
(
this
.
showNoTimeTrackingState
)
{
return
'
no-value
'
;
}
return
''
;
},
text
()
{
if
(
this
.
showComparisonState
)
{
return
`
${
this
.
timeSpent
}
/
${
this
.
timeEstimate
}
`
;
}
else
if
(
this
.
showEstimateOnlyState
)
{
return
`-- /
${
this
.
timeEstimate
}
`
;
}
else
if
(
this
.
showSpentOnlyState
)
{
return
`
${
this
.
timeSpent
}
/ --`
;
}
else
if
(
this
.
showNoTimeTrackingState
)
{
return
'
None
'
;
}
return
''
;
},
},
methods
:
{
abbreviateTime
(
timeStr
)
{
return
abbreviateTime
(
timeStr
);
},
},
template
:
`
<div class="sidebar-collapsed-icon">
${
stopwatchSvg
}
<div class="time-tracking-collapsed-summary">
<div :class="divClass">
<span :class="spanClass">
{{ text }}
</span>
</div>
</div>
</div>
`
,
};
app/assets/javascripts/sidebar/components/time_tracking/collapsed_state.vue
0 → 100644
View file @
78de5251
<
script
>
import
icon
from
'
../../../vue_shared/components/icon.vue
'
;
import
{
abbreviateTime
}
from
'
../../../lib/utils/pretty_time
'
;
export
default
{
name
:
'
TimeTrackingCollapsedState
'
,
components
:
{
icon
,
},
props
:
{
showComparisonState
:
{
type
:
Boolean
,
required
:
true
,
},
showSpentOnlyState
:
{
type
:
Boolean
,
required
:
true
,
},
showEstimateOnlyState
:
{
type
:
Boolean
,
required
:
true
,
},
showNoTimeTrackingState
:
{
type
:
Boolean
,
required
:
true
,
},
timeSpentHumanReadable
:
{
type
:
String
,
required
:
false
,
default
:
''
,
},
timeEstimateHumanReadable
:
{
type
:
String
,
required
:
false
,
default
:
''
,
},
},
computed
:
{
timeSpent
()
{
return
this
.
abbreviateTime
(
this
.
timeSpentHumanReadable
);
},
timeEstimate
()
{
return
this
.
abbreviateTime
(
this
.
timeEstimateHumanReadable
);
},
divClass
()
{
if
(
this
.
showComparisonState
)
{
return
'
compare
'
;
}
else
if
(
this
.
showEstimateOnlyState
)
{
return
'
estimate-only
'
;
}
else
if
(
this
.
showSpentOnlyState
)
{
return
'
spend-only
'
;
}
else
if
(
this
.
showNoTimeTrackingState
)
{
return
'
no-tracking
'
;
}
return
''
;
},
spanClass
()
{
if
(
this
.
showComparisonState
)
{
return
''
;
}
else
if
(
this
.
showEstimateOnlyState
||
this
.
showSpentOnlyState
)
{
return
'
bold
'
;
}
else
if
(
this
.
showNoTimeTrackingState
)
{
return
'
no-value
'
;
}
return
''
;
},
text
()
{
if
(
this
.
showComparisonState
)
{
return
`
${
this
.
timeSpent
}
/
${
this
.
timeEstimate
}
`
;
}
else
if
(
this
.
showEstimateOnlyState
)
{
return
`-- /
${
this
.
timeEstimate
}
`
;
}
else
if
(
this
.
showSpentOnlyState
)
{
return
`
${
this
.
timeSpent
}
/ --`
;
}
else
if
(
this
.
showNoTimeTrackingState
)
{
return
'
None
'
;
}
return
''
;
},
},
methods
:
{
abbreviateTime
(
timeStr
)
{
return
abbreviateTime
(
timeStr
);
},
},
};
</
script
>
<
template
>
<div
class=
"sidebar-collapsed-icon"
>
<icon
name=
"timer"
/>
<div
class=
"time-tracking-collapsed-summary"
>
<div
:class=
"divClass"
>
<span
:class=
"spanClass"
>
{{
text
}}
</span>
</div>
</div>
</div>
</
template
>
app/assets/javascripts/sidebar/components/time_tracking/time_tracker.vue
View file @
78de5251
<
script
>
<
script
>
import
timeTrackingHelpState
from
'
./help_state
'
;
import
timeTrackingHelpState
from
'
./help_state
'
;
import
timeTrackingCollapsedState
from
'
./collapsed_stat
e
'
;
import
TimeTrackingCollapsedState
from
'
./collapsed_state.vu
e
'
;
import
timeTrackingSpentOnlyPane
from
'
./spent_only_pane
'
;
import
timeTrackingSpentOnlyPane
from
'
./spent_only_pane
'
;
import
timeTrackingNoTrackingPane
from
'
./no_tracking_pane
'
;
import
timeTrackingNoTrackingPane
from
'
./no_tracking_pane
'
;
import
timeTrackingEstimateOnlyPane
from
'
./estimate_only_pane
'
;
import
timeTrackingEstimateOnlyPane
from
'
./estimate_only_pane
'
;
...
@@ -11,7 +11,7 @@ import eventHub from '../../event_hub';
...
@@ -11,7 +11,7 @@ import eventHub from '../../event_hub';
export
default
{
export
default
{
name
:
'
IssuableTimeTracker
'
,
name
:
'
IssuableTimeTracker
'
,
components
:
{
components
:
{
'
time-tracking-collapsed-state
'
:
t
imeTrackingCollapsedState
,
T
imeTrackingCollapsedState
,
'
time-tracking-estimate-only-pane
'
:
timeTrackingEstimateOnlyPane
,
'
time-tracking-estimate-only-pane
'
:
timeTrackingEstimateOnlyPane
,
'
time-tracking-spent-only-pane
'
:
timeTrackingSpentOnlyPane
,
'
time-tracking-spent-only-pane
'
:
timeTrackingSpentOnlyPane
,
'
time-tracking-no-tracking-pane
'
:
timeTrackingNoTrackingPane
,
'
time-tracking-no-tracking-pane
'
:
timeTrackingNoTrackingPane
,
...
...
changelogs/unreleased/refactor-move-time-tracking-vue-components.yml
0 → 100644
View file @
78de5251
---
title
:
Move TimeTrackingCollapsedState vue component
merge_request
:
17399
author
:
George Tsiolis
type
:
performance
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment