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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
c6978285
Commit
c6978285
authored
Jan 23, 2018
by
Kushal Pandya
Committed by
Kushal Pandya
Jan 26, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show empty state when timestamp is not present
parent
238f2081
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
15 deletions
+34
-15
ee/app/assets/javascripts/geo_nodes/components/geo_node_event_status.vue
...avascripts/geo_nodes/components/geo_node_event_status.vue
+18
-10
ee/app/assets/javascripts/geo_nodes/store/geo_nodes_store.js
ee/app/assets/javascripts/geo_nodes/store/geo_nodes_store.js
+2
-2
spec/javascripts/geo_nodes/components/geo_node_event_status_spec.js
...cripts/geo_nodes/components/geo_node_event_status_spec.js
+14
-3
No files found.
ee/app/assets/javascripts/geo_nodes/components/geo_node_event_status.vue
View file @
c6978285
...
@@ -35,16 +35,24 @@
...
@@ -35,16 +35,24 @@
<div
<div
class=
"node-detail-value"
class=
"node-detail-value"
>
>
<strong>
<template
v-if=
"eventTimeStamp"
>
{{
eventId
}}
<strong>
</strong>
{{
eventId
}}
<span
</strong>
v-tooltip
<span
class=
"event-status-timestamp"
v-tooltip
data-placement=
"bottom"
v-if=
"eventTimeStamp"
:title=
"timeStampString"
class=
"event-status-timestamp"
data-placement=
"bottom"
:title=
"timeStampString"
>
(
{{
timeFormated
(
timeStamp
)
}}
)
</span>
</
template
>
<strong
v-else
>
>
(
{{
timeFormated
(
timeStamp
)
}}
)
{{ __('Not available') }}
</s
pan
>
</s
trong
>
</div>
</div>
</template>
</template>
ee/app/assets/javascripts/geo_nodes/store/geo_nodes_store.js
View file @
c6978285
...
@@ -74,11 +74,11 @@ export default class GeoNodesStore {
...
@@ -74,11 +74,11 @@ export default class GeoNodesStore {
failureCount
:
rawNodeDetails
.
attachments_failed_count
||
0
,
failureCount
:
rawNodeDetails
.
attachments_failed_count
||
0
,
},
},
lastEvent
:
{
lastEvent
:
{
id
:
rawNodeDetails
.
last_event_id
,
id
:
rawNodeDetails
.
last_event_id
||
0
,
timeStamp
:
rawNodeDetails
.
last_event_timestamp
,
timeStamp
:
rawNodeDetails
.
last_event_timestamp
,
},
},
cursorLastEvent
:
{
cursorLastEvent
:
{
id
:
rawNodeDetails
.
cursor_last_event_id
,
id
:
rawNodeDetails
.
cursor_last_event_id
||
0
,
timeStamp
:
rawNodeDetails
.
cursor_last_event_timestamp
,
timeStamp
:
rawNodeDetails
.
cursor_last_event_timestamp
,
},
},
namespaces
:
rawNodeDetails
.
namespaces
,
namespaces
:
rawNodeDetails
.
namespaces
,
...
...
spec/javascripts/geo_nodes/components/geo_node_event_status_spec.js
View file @
c6978285
...
@@ -5,12 +5,15 @@ import { mockNodeDetails } from '../mock_data';
...
@@ -5,12 +5,15 @@ import { mockNodeDetails } from '../mock_data';
import
mountComponent
from
'
../../helpers/vue_mount_component_helper
'
;
import
mountComponent
from
'
../../helpers/vue_mount_component_helper
'
;
const
createComponent
=
()
=>
{
const
createComponent
=
(
eventId
=
mockNodeDetails
.
lastEvent
.
id
,
eventTimeStamp
=
mockNodeDetails
.
lastEvent
.
timeStamp
,
)
=>
{
const
Component
=
Vue
.
extend
(
geoNodeEventStatusComponent
);
const
Component
=
Vue
.
extend
(
geoNodeEventStatusComponent
);
return
mountComponent
(
Component
,
{
return
mountComponent
(
Component
,
{
eventId
:
mockNodeDetails
.
lastEvent
.
id
,
eventId
,
eventTimeStamp
:
mockNodeDetails
.
lastEvent
.
timeStamp
,
eventTimeStamp
,
});
});
};
};
...
@@ -46,5 +49,13 @@ describe('GeoNodeEventStatus', () => {
...
@@ -46,5 +49,13 @@ describe('GeoNodeEventStatus', () => {
expect
(
vm
.
$el
.
querySelector
(
'
strong
'
).
innerText
.
trim
()).
toBe
(
`
${
mockNodeDetails
.
lastEvent
.
id
}
`
);
expect
(
vm
.
$el
.
querySelector
(
'
strong
'
).
innerText
.
trim
()).
toBe
(
`
${
mockNodeDetails
.
lastEvent
.
id
}
`
);
expect
(
vm
.
$el
.
querySelector
(
'
.event-status-timestamp
'
).
innerText
).
toContain
(
'
ago
'
);
expect
(
vm
.
$el
.
querySelector
(
'
.event-status-timestamp
'
).
innerText
).
toContain
(
'
ago
'
);
});
});
it
(
'
renders empty state when timestamp is not present
'
,
()
=>
{
const
vmWithoutTimestamp
=
createComponent
(
0
,
0
);
expect
(
vmWithoutTimestamp
.
$el
.
querySelectorAll
(
'
strong
'
).
length
).
not
.
toBe
(
0
);
expect
(
vmWithoutTimestamp
.
$el
.
querySelectorAll
(
'
.event-status-timestamp
'
).
length
).
toBe
(
0
);
expect
(
vmWithoutTimestamp
.
$el
.
querySelector
(
'
strong
'
).
innerText
.
trim
()).
toBe
(
'
Not available
'
);
vmWithoutTimestamp
.
$destroy
();
});
});
});
});
});
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