Merge branch 'master' into upgrade-camshaft
Conflicts: NEWS.md
This commit is contained in:
commit
19f39b87f5
3
NEWS.md
3
NEWS.md
@ -7,6 +7,9 @@ Released 2016-mm-dd
|
|||||||
Announcements:
|
Announcements:
|
||||||
- Upgrades camshaft to [0.29.2](https://github.com/CartoDB/camshaft/releases/tag/0.29.2).
|
- Upgrades camshaft to [0.29.2](https://github.com/CartoDB/camshaft/releases/tag/0.29.2).
|
||||||
|
|
||||||
|
Bug fixes:
|
||||||
|
- Return full list of nodes in response metadata.
|
||||||
|
|
||||||
|
|
||||||
## 2.57.0
|
## 2.57.0
|
||||||
|
|
||||||
|
@ -330,7 +330,7 @@ function getLastUpdatedTime(analysesResults, lastUpdateTime) {
|
|||||||
return lastUpdateTime;
|
return lastUpdateTime;
|
||||||
}
|
}
|
||||||
return analysesResults.reduce(function(lastUpdateTime, analysis) {
|
return analysesResults.reduce(function(lastUpdateTime, analysis) {
|
||||||
return analysis.getSortedNodes().reduce(function(lastNodeUpdatedAtTime, node) {
|
return analysis.getNodes().reduce(function(lastNodeUpdatedAtTime, node) {
|
||||||
var nodeUpdatedAtDate = node.getUpdatedAt();
|
var nodeUpdatedAtDate = node.getUpdatedAt();
|
||||||
var nodeUpdatedTimeAt = (nodeUpdatedAtDate && nodeUpdatedAtDate.getTime()) || 0;
|
var nodeUpdatedTimeAt = (nodeUpdatedAtDate && nodeUpdatedAtDate.getTime()) || 0;
|
||||||
return nodeUpdatedTimeAt > lastNodeUpdatedAtTime ? nodeUpdatedTimeAt : lastNodeUpdatedAtTime;
|
return nodeUpdatedTimeAt > lastNodeUpdatedAtTime ? nodeUpdatedTimeAt : lastNodeUpdatedAtTime;
|
||||||
@ -344,7 +344,7 @@ function addAnalysesMetadata(username, layergroup, analysesResults, includeQuery
|
|||||||
layergroup.metadata.analyses = [];
|
layergroup.metadata.analyses = [];
|
||||||
|
|
||||||
analysesResults.forEach(function(analysis) {
|
analysesResults.forEach(function(analysis) {
|
||||||
var nodes = analysis.getSortedNodes();
|
var nodes = analysis.getNodes();
|
||||||
layergroup.metadata.analyses.push({
|
layergroup.metadata.analyses.push({
|
||||||
nodes: nodes.reduce(function(nodesIdMap, node) {
|
nodes: nodes.reduce(function(nodesIdMap, node) {
|
||||||
if (node.params.id) {
|
if (node.params.id) {
|
||||||
|
@ -202,7 +202,7 @@ describe('analysis-layers', function() {
|
|||||||
assert.equal(analyses.length, 1, 'Invalid number of analyses in metadata');
|
assert.equal(analyses.length, 1, 'Invalid number of analyses in metadata');
|
||||||
var nodes = analyses[0].nodes;
|
var nodes = analyses[0].nodes;
|
||||||
var nodesIds = Object.keys(nodes);
|
var nodesIds = Object.keys(nodes);
|
||||||
assert.deepEqual(nodesIds, ['2570e105-7b37-40d2-bdf4-1af889598745', 'HEAD']);
|
assert.deepEqual(nodesIds, ['HEAD', '2570e105-7b37-40d2-bdf4-1af889598745']);
|
||||||
nodesIds.forEach(function(nodeId) {
|
nodesIds.forEach(function(nodeId) {
|
||||||
var node = nodes[nodeId];
|
var node = nodes[nodeId];
|
||||||
assert.ok(node.hasOwnProperty('url'), 'Missing "url" attribute in node');
|
assert.ok(node.hasOwnProperty('url'), 'Missing "url" attribute in node');
|
||||||
|
@ -141,7 +141,7 @@ describe('named-maps analysis', function() {
|
|||||||
assert.equal(analyses.length, 1, 'Invalid number of analyses in metadata');
|
assert.equal(analyses.length, 1, 'Invalid number of analyses in metadata');
|
||||||
var nodes = analyses[0].nodes;
|
var nodes = analyses[0].nodes;
|
||||||
var nodesIds = Object.keys(nodes);
|
var nodesIds = Object.keys(nodes);
|
||||||
assert.deepEqual(nodesIds, ['2570e105-7b37-40d2-bdf4-1af889598745', 'HEAD']);
|
assert.deepEqual(nodesIds, ['HEAD', '2570e105-7b37-40d2-bdf4-1af889598745']);
|
||||||
nodesIds.forEach(function(nodeId) {
|
nodesIds.forEach(function(nodeId) {
|
||||||
var node = nodes[nodeId];
|
var node = nodes[nodeId];
|
||||||
assert.ok(node.hasOwnProperty('url'), 'Missing "url" attribute in node');
|
assert.ok(node.hasOwnProperty('url'), 'Missing "url" attribute in node');
|
||||||
|
@ -100,10 +100,13 @@ describe('analysis-layers regressions', function() {
|
|||||||
assert.equal(analyses.length, 1);
|
assert.equal(analyses.length, 1);
|
||||||
|
|
||||||
var expectedIds = ['customer_home_locations', 'b0', 'b1', 'a2', 'a3', 'a4'];
|
var expectedIds = ['customer_home_locations', 'b0', 'b1', 'a2', 'a3', 'a4'];
|
||||||
assert.equal(Object.keys(analyses[0].nodes).length, expectedIds.length, Object.keys(analyses[0].nodes));
|
|
||||||
expectedIds.forEach(function(expectedId) {
|
expectedIds.forEach(function(expectedId) {
|
||||||
analyses[0].nodes.hasOwnProperty(expectedId);
|
assert.ok(
|
||||||
|
analyses[0].nodes.hasOwnProperty(expectedId),
|
||||||
|
'Missing "' + expectedId + '" from node list.'
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
assert.equal(Object.keys(analyses[0].nodes).length, expectedIds.length, Object.keys(analyses[0].nodes));
|
||||||
|
|
||||||
testClient.drain(done);
|
testClient.drain(done);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user