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
775c9f68
Commit
775c9f68
authored
Sep 29, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed specs when merged event was empty
parent
e178eb78
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
app/assets/javascripts/vue_merge_request_widget/stores/mr_widget_store.js
...cripts/vue_merge_request_widget/stores/mr_widget_store.js
+10
-4
No files found.
app/assets/javascripts/vue_merge_request_widget/stores/mr_widget_store.js
View file @
775c9f68
...
@@ -117,11 +117,9 @@ export default class MergeRequestStore {
...
@@ -117,11 +117,9 @@ export default class MergeRequestStore {
}
}
static
getEventObject
(
event
)
{
static
getEventObject
(
event
)
{
if
(
!
event
)
return
null
;
return
{
return
{
author
:
MergeRequestStore
.
getAuthorObject
(
event
),
author
:
MergeRequestStore
.
getAuthorObject
(
event
),
updatedAt
:
gl
.
utils
.
formatDate
(
event
.
updated_at
),
updatedAt
:
gl
.
utils
.
formatDate
(
MergeRequestStore
.
getEventUpdatedAtDate
(
event
)
),
formattedUpdatedAt
:
MergeRequestStore
.
getEventDate
(
event
),
formattedUpdatedAt
:
MergeRequestStore
.
getEventDate
(
event
),
};
};
}
}
...
@@ -139,6 +137,14 @@ export default class MergeRequestStore {
...
@@ -139,6 +137,14 @@ export default class MergeRequestStore {
};
};
}
}
static
getEventUpdatedAtDate
(
event
)
{
if
(
!
event
)
{
return
''
;
}
return
event
.
updated_at
;
}
static
getEventDate
(
event
)
{
static
getEventDate
(
event
)
{
const
timeagoInstance
=
new
Timeago
();
const
timeagoInstance
=
new
Timeago
();
...
@@ -146,7 +152,7 @@ export default class MergeRequestStore {
...
@@ -146,7 +152,7 @@ export default class MergeRequestStore {
return
''
;
return
''
;
}
}
return
timeagoInstance
.
format
(
event
.
updated_at
);
return
timeagoInstance
.
format
(
MergeRequestStore
.
getEventUpdatedAtDate
(
event
)
);
}
}
}
}
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