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
7d9d1058
Commit
7d9d1058
authored
May 02, 2018
by
Ash McKenzie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show Geo node details, regardless of HTTP status
This also effectively renders the edit, disable and remove buttons
parent
f43f4197
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
8 deletions
+28
-8
ee/app/assets/javascripts/geo_nodes/components/app.vue
ee/app/assets/javascripts/geo_nodes/components/app.vue
+1
-2
ee/changelogs/unreleased/5351-geo-don-t-block-edit-and-remove-buttons-while-status-is-loading.yml
...block-edit-and-remove-buttons-while-status-is-loading.yml
+5
-0
spec/javascripts/geo_nodes/components/app_spec.js
spec/javascripts/geo_nodes/components/app_spec.js
+22
-6
No files found.
ee/app/assets/javascripts/geo_nodes/components/app.vue
View file @
7d9d1058
<
script
>
<
script
>
import
{
s__
}
from
'
~/locale
'
;
import
{
s__
}
from
'
~/locale
'
;
import
Flash
from
'
~/flash
'
;
import
Flash
from
'
~/flash
'
;
import
statusCodes
from
'
~/lib/utils/http_status
'
;
import
loadingIcon
from
'
~/vue_shared/components/loading_icon.vue
'
;
import
loadingIcon
from
'
~/vue_shared/components/loading_icon.vue
'
;
import
DeprecatedModal
from
'
~/vue_shared/components/deprecated_modal.vue
'
;
import
DeprecatedModal
from
'
~/vue_shared/components/deprecated_modal.vue
'
;
import
SmartInterval
from
'
~/smart_interval
'
;
import
SmartInterval
from
'
~/smart_interval
'
;
...
@@ -116,7 +115,7 @@ export default {
...
@@ -116,7 +115,7 @@ export default {
);
);
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
if
(
err
.
response
&&
err
.
response
.
status
===
statusCodes
.
NOT_FOUND
)
{
if
(
err
.
response
&&
err
.
response
.
data
)
{
this
.
store
.
setNodeDetails
(
nodeId
,
{
this
.
store
.
setNodeDetails
(
nodeId
,
{
geo_node_id
:
nodeId
,
geo_node_id
:
nodeId
,
health
:
err
.
message
,
health
:
err
.
message
,
...
...
ee/changelogs/unreleased/5351-geo-don-t-block-edit-and-remove-buttons-while-status-is-loading.yml
0 → 100644
View file @
7d9d1058
---
title
:
Ability to edit, disable or remove Geo Nodes is now always available
merge_request
:
author
:
type
:
changed
spec/javascripts/geo_nodes/components/app_spec.js
View file @
7d9d1058
...
@@ -124,21 +124,25 @@ describe('AppComponent', () => {
...
@@ -124,21 +124,25 @@ describe('AppComponent', () => {
},
0
);
},
0
);
});
});
it
(
'
emits `nodeDetailsLoad
Failed` event on
failure
'
,
(
done
)
=>
{
it
(
'
emits `nodeDetailsLoad
ed` event with fake nodeDetails object on 404
failure
'
,
(
done
)
=>
{
spyOn
(
eventHub
,
'
$emit
'
);
spyOn
(
eventHub
,
'
$emit
'
);
mock
.
onGet
(
mockNode
.
statusPath
).
reply
(
500
,
{});
mock
.
onGet
(
mockNode
.
statusPath
).
reply
(
404
,
{});
spyOn
(
vm
.
service
,
'
getGeoNodeDetails
'
).
and
.
callThrough
();
spyOn
(
vm
.
service
,
'
getGeoNodeDetails
'
).
and
.
callThrough
();
vm
.
fetchNodeDetails
(
mockNode
);
vm
.
fetchNodeDetails
(
mockNode
);
setTimeout
(()
=>
{
setTimeout
(()
=>
{
expect
(
eventHub
.
$emit
).
toHaveBeenCalledWith
(
'
nodeDetailsLoadFailed
'
,
mockNode
.
id
,
jasmine
.
any
(
Object
));
expect
(
eventHub
.
$emit
).
toHaveBeenCalledWith
(
'
nodeDetailsLoaded
'
,
jasmine
.
any
(
Object
));
const
nodeDetails
=
vm
.
store
.
state
.
nodeDetails
[
'
1
'
];
expect
(
nodeDetails
).
toBeDefined
();
expect
(
nodeDetails
.
syncStatusUnavailable
).
toBe
(
true
);
expect
(
nodeDetails
.
health
).
toBe
(
'
Request failed with status code 404
'
);
done
();
done
();
},
0
);
},
0
);
});
});
it
(
'
emits `nodeDetailsLoaded` event with fake nodeDetails object on
404
failure
'
,
(
done
)
=>
{
it
(
'
emits `nodeDetailsLoaded` event with fake nodeDetails object on
500
failure
'
,
(
done
)
=>
{
spyOn
(
eventHub
,
'
$emit
'
);
spyOn
(
eventHub
,
'
$emit
'
);
mock
.
onGet
(
mockNode
.
statusPath
).
reply
(
404
,
{});
mock
.
onGet
(
mockNode
.
statusPath
).
reply
(
500
,
{});
spyOn
(
vm
.
service
,
'
getGeoNodeDetails
'
).
and
.
callThrough
();
spyOn
(
vm
.
service
,
'
getGeoNodeDetails
'
).
and
.
callThrough
();
vm
.
fetchNodeDetails
(
mockNode
);
vm
.
fetchNodeDetails
(
mockNode
);
...
@@ -147,7 +151,19 @@ describe('AppComponent', () => {
...
@@ -147,7 +151,19 @@ describe('AppComponent', () => {
const
nodeDetails
=
vm
.
store
.
state
.
nodeDetails
[
'
1
'
];
const
nodeDetails
=
vm
.
store
.
state
.
nodeDetails
[
'
1
'
];
expect
(
nodeDetails
).
toBeDefined
();
expect
(
nodeDetails
).
toBeDefined
();
expect
(
nodeDetails
.
syncStatusUnavailable
).
toBe
(
true
);
expect
(
nodeDetails
.
syncStatusUnavailable
).
toBe
(
true
);
expect
(
nodeDetails
.
health
).
toBe
(
'
Request failed with status code 404
'
);
expect
(
nodeDetails
.
health
).
toBe
(
'
Request failed with status code 500
'
);
done
();
},
0
);
});
it
(
'
emits `nodeDetailsLoadFailed` event on failure when there is no response
'
,
(
done
)
=>
{
spyOn
(
eventHub
,
'
$emit
'
);
mock
.
onGet
(
mockNode
.
statusPath
).
reply
(
500
,
null
);
spyOn
(
vm
.
service
,
'
getGeoNodeDetails
'
).
and
.
callThrough
();
vm
.
fetchNodeDetails
(
mockNode
);
setTimeout
(()
=>
{
expect
(
eventHub
.
$emit
).
toHaveBeenCalledWith
(
'
nodeDetailsLoadFailed
'
,
mockNode
.
id
,
jasmine
.
any
(
Object
));
done
();
done
();
},
0
);
},
0
);
});
});
...
...
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