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
Léo-Paul Géneau
gitlab-ce
Commits
14eb2aba
Commit
14eb2aba
authored
Jul 22, 2017
by
Fatih Acet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IssueNotesRefactor: Implement time tracking sidebar integration with slash commands.
parent
8fa1f65e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
9 deletions
+20
-9
app/assets/javascripts/notes/stores/issue_notes_store.js
app/assets/javascripts/notes/stores/issue_notes_store.js
+16
-9
app/assets/javascripts/sidebar/components/time_tracking/sidebar_time_tracking.js
...sidebar/components/time_tracking/sidebar_time_tracking.js
+4
-0
No files found.
app/assets/javascripts/notes/stores/issue_notes_store.js
View file @
14eb2aba
...
...
@@ -3,6 +3,7 @@
import
service
from
'
../services/issue_notes_service
'
;
import
utils
from
'
./issue_notes_utils
'
;
import
loadAwardsHandler
from
'
../../awards_handler
'
;
import
sidebarTimeTrackingEventHub
from
'
../../sidebar/event_hub
'
;
const
state
=
{
notes
:
[],
...
...
@@ -233,7 +234,8 @@ const actions = {
Flash
(
'
Commands applied
'
,
'
notice
'
,
$
(
noteData
.
flashContainer
));
}
if
(
commandsChanges
&&
commandsChanges
.
emoji_award
)
{
if
(
commandsChanges
)
{
if
(
commandsChanges
.
emoji_award
)
{
const
votesBlock
=
$
(
'
.js-awards-block
'
).
eq
(
0
);
loadAwardsHandler
().
then
((
awardsHandler
)
=>
{
...
...
@@ -245,6 +247,11 @@ const actions = {
});
}
if
(
commandsChanges
.
spend_time
||
commandsChanges
.
time_estimate
)
{
sidebarTimeTrackingEventHub
.
$emit
(
'
timeTrackingUpdated
'
,
res
);
}
}
if
(
errors
&&
errors
.
commands_only
)
{
Flash
(
errors
.
commands_only
,
'
notice
'
,
$
(
noteData
.
flashContainer
));
}
...
...
app/assets/javascripts/sidebar/components/time_tracking/sidebar_time_tracking.js
View file @
14eb2aba
...
...
@@ -4,6 +4,7 @@ import timeTracker from './time_tracker';
import
Store
from
'
../../stores/sidebar_store
'
;
import
Mediator
from
'
../../sidebar_mediator
'
;
import
eventHub
from
'
../../event_hub
'
;
export
default
{
data
()
{
...
...
@@ -18,6 +19,9 @@ export default {
methods
:
{
listenForQuickActions
()
{
$
(
document
).
on
(
'
ajax:success
'
,
'
.gfm-form
'
,
this
.
quickActionListened
);
eventHub
.
$on
(
'
timeTrackingUpdated
'
,
(
data
)
=>
{
this
.
quickActionListened
(
null
,
data
);
});
},
quickActionListened
(
e
,
data
)
{
const
subscribedCommands
=
[
'
spend_time
'
,
'
time_estimate
'
];
...
...
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