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
511738f0
Commit
511738f0
authored
Mar 06, 2018
by
Kushal Pandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Render `Unknown` for sync settings when `syncStatusUnavailable` is true
parent
1397e92b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
1 deletion
+23
-1
ee/app/assets/javascripts/geo_nodes/components/geo_node_sync_settings.vue
...vascripts/geo_nodes/components/geo_node_sync_settings.vue
+12
-0
spec/javascripts/geo_nodes/components/geo_node_sync_settings_spec.js
...ripts/geo_nodes/components/geo_node_sync_settings_spec.js
+11
-1
No files found.
ee/app/assets/javascripts/geo_nodes/components/geo_node_sync_settings.vue
View file @
511738f0
...
@@ -14,6 +14,11 @@
...
@@ -14,6 +14,11 @@
icon
,
icon
,
},
},
props
:
{
props
:
{
syncStatusUnavailable
:
{
type
:
Boolean
,
required
:
false
,
default
:
false
,
},
selectiveSyncType
:
{
selectiveSyncType
:
{
type
:
String
,
type
:
String
,
required
:
false
,
required
:
false
,
...
@@ -105,6 +110,13 @@
...
@@ -105,6 +110,13 @@
class=
"node-detail-value"
class=
"node-detail-value"
>
>
<span
<span
v-if=
"syncStatusUnavailable"
class=
"node-detail-value-bold"
>
{{
__
(
'
Unknown
'
)
}}
</span>
<span
v-else
v-tooltip
v-tooltip
class=
"node-sync-settings inline"
class=
"node-sync-settings inline"
data-placement=
"bottom"
data-placement=
"bottom"
...
...
spec/javascripts/geo_nodes/components/geo_node_sync_settings_spec.js
View file @
511738f0
...
@@ -5,12 +5,14 @@ import mountComponent from 'spec/helpers/vue_mount_component_helper';
...
@@ -5,12 +5,14 @@ import mountComponent from 'spec/helpers/vue_mount_component_helper';
import
{
mockNodeDetails
}
from
'
../mock_data
'
;
import
{
mockNodeDetails
}
from
'
../mock_data
'
;
const
createComponent
=
(
const
createComponent
=
(
syncStatusUnavailable
=
false
,
selectiveSyncType
=
mockNodeDetails
.
selectiveSyncType
,
selectiveSyncType
=
mockNodeDetails
.
selectiveSyncType
,
lastEvent
=
mockNodeDetails
.
lastEvent
,
lastEvent
=
mockNodeDetails
.
lastEvent
,
cursorLastEvent
=
mockNodeDetails
.
cursorLastEvent
)
=>
{
cursorLastEvent
=
mockNodeDetails
.
cursorLastEvent
)
=>
{
const
Component
=
Vue
.
extend
(
geoNodeSyncSettingsComponent
);
const
Component
=
Vue
.
extend
(
geoNodeSyncSettingsComponent
);
return
mountComponent
(
Component
,
{
return
mountComponent
(
Component
,
{
syncStatusUnavailable
,
selectiveSyncType
,
selectiveSyncType
,
lastEvent
,
lastEvent
,
cursorLastEvent
,
cursorLastEvent
,
...
@@ -29,7 +31,7 @@ describe('GeoNodeSyncSettingsComponent', () => {
...
@@ -29,7 +31,7 @@ describe('GeoNodeSyncSettingsComponent', () => {
describe
(
'
eventTimestampEmpty
'
,
()
=>
{
describe
(
'
eventTimestampEmpty
'
,
()
=>
{
it
(
'
returns `true` if one of the event timestamp is empty
'
,
()
=>
{
it
(
'
returns `true` if one of the event timestamp is empty
'
,
()
=>
{
const
vmEmptyTimestamp
=
createComponent
(
mockNodeDetails
.
namespaces
,
{
const
vmEmptyTimestamp
=
createComponent
(
false
,
mockNodeDetails
.
namespaces
,
{
id
:
0
,
id
:
0
,
timeStamp
:
0
,
timeStamp
:
0
,
},
{
},
{
...
@@ -87,4 +89,12 @@ describe('GeoNodeSyncSettingsComponent', () => {
...
@@ -87,4 +89,12 @@ describe('GeoNodeSyncSettingsComponent', () => {
});
});
});
});
});
});
describe
(
'
template
'
,
()
=>
{
it
(
'
renders `Unknown` when `syncStatusUnavailable` prop is true
'
,
()
=>
{
const
vmSyncUnavailable
=
createComponent
(
true
);
expect
(
vmSyncUnavailable
.
$el
.
innerText
.
trim
()).
toBe
(
'
Unknown
'
);
vmSyncUnavailable
.
$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