Skip to content

Commit

Permalink
Merge pull request #302 from andygup/v2.5.1
Browse files Browse the repository at this point in the history
V2.5.1
  • Loading branch information
andygup committed Apr 7, 2015
2 parents 75a9a55 + 5e43ced commit baa52f0
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 25 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# offline-editor-js - Changelog

## Version 2.5.1 - April 7, 2015

Closes #301 - OfflineFeaturesManager failed on _validateFeature during an attachment ADD operation.

## Version 2.5.0.2 - April 2, 2015

Minor doc update. Clarification in OfflineFeaturesManager on requiring `mode` be set to `FeatureLayer.MODE_SNAPSHOT`.
Expand Down
2 changes: 1 addition & 1 deletion dist/offline-edit-min.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions dist/offline-edit-src.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! offline-editor-js - v2.5 - 2015-03-27
/*! offline-editor-js - v2.5.1 - 2015-04-07
* Copyright (c) 2015 Environmental Systems Research Institute, Inc.
* Apache License*/
define([
Expand Down Expand Up @@ -790,7 +790,7 @@ define([
if(result.operation == self._editStore.ADD){
// If we are deleting a new feature that has not been added to the
// server yet we need to delete it and its phantom graphic.
self._deleteTemporaryFeature(graphic,function(success){
layer._deleteTemporaryFeature(graphic,function(success){
if(success == false){
resolved = false;
}
Expand Down Expand Up @@ -1013,12 +1013,12 @@ define([
}
})
}
else if(result == false){
callback(false, error);
}
else if(result == true){
else if(result){
callback(true, null);
}
else{
callback(false, error);
}
});
},

Expand Down
2 changes: 1 addition & 1 deletion dist/offline-tiles-advanced-src.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! offline-editor-js - v2.5 - 2015-03-27
/*! offline-editor-js - v2.5.1 - 2015-04-07
* Copyright (c) 2015 Environmental Systems Research Institute, Inc.
* Apache License*/
define([
Expand Down
2 changes: 1 addition & 1 deletion dist/offline-tiles-basic-src.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! offline-editor-js - v2.5 - 2015-03-27
/*! offline-editor-js - v2.5.1 - 2015-04-07
* Copyright (c) 2015 Environmental Systems Research Institute, Inc.
* Apache License*/
define([
Expand Down
2 changes: 1 addition & 1 deletion dist/offline-tpk-src.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! offline-editor-js - v2.5 - 2015-03-27
/*! offline-editor-js - v2.5.1 - 2015-04-07
* Copyright (c) 2015 Environmental Systems Research Institute, Inc.
* Apache License*/
/**
Expand Down
10 changes: 5 additions & 5 deletions lib/edit/offlineFeaturesManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ define([
if(result.operation == self._editStore.ADD){
// If we are deleting a new feature that has not been added to the
// server yet we need to delete it and its phantom graphic.
self._deleteTemporaryFeature(graphic,function(success){
layer._deleteTemporaryFeature(graphic,function(success){
if(success == false){
resolved = false;
}
Expand Down Expand Up @@ -1010,12 +1010,12 @@ define([
}
})
}
else if(result == false){
callback(false, error);
}
else if(result == true){
else if(result){
callback(true, null);
}
else{
callback(false, error);
}
});
},

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "offline-editor-js",
"version": "2.5",
"version": "2.5.1",
"description": "Lightweight set of libraries for working offline with map tiles and ArcGIS feature services",
"author": "Andy Gup <[email protected]> (http://blog.andygup.net)",
"license": "Apache 2",
Expand Down
2 changes: 1 addition & 1 deletion samples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"appHomePage": "appcache-features.html",
"optimizedApiURL": "../samples/jsolib",
"arcGISBaseURL": "http://js.arcgis.com/3.11",
"version": "2.5",
"version": "2.5.1",
"private": true,
"description": "manifest generator project",
"repository": {
Expand Down
8 changes: 6 additions & 2 deletions test/SpecRunner.offlineAttachments.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"esri/layers/FeatureLayer", "esri/geometry", "esri/request",
"dojo/dom", "dojo/on", "dojo/query",
"dojo/dom-construct",
"../dist/offline-edit-min.js",
"../dist/offline-edit-src.js",
"dojo/domReady!"],
function(Map,
GraphicsLayer, Graphic,
Expand Down Expand Up @@ -90,7 +90,11 @@
{
g_featureLayers.forEach(function(layer)
{
g_offlineFeaturesManager.extend(layer);
g_offlineFeaturesManager.extend(layer,function(success,message){
if(!success){
alert("There was a problem extending the layer: " + layer);
}
});
});
}
catch(err)
Expand Down
13 changes: 7 additions & 6 deletions test/spec/offlineAttachmentsSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ describe("Attachments", function()
});
});

it("go Online", function(done)
async.it("go Online", function(done)
{
expect(g_featureLayers[3].graphics.length).toBe(2);

Expand All @@ -477,8 +477,8 @@ describe("Attachments", function()
expect(attachmentResults[1].addAttachmentResult).not.toBeUndefined();
expect(attachmentResults[1].addAttachmentResult.success).toBeTruthy();

expect(result.features.responses[g_featureLayers[3].url]).not.toBeUndefined();
var featureResults = result.features.responses[g_featureLayers[3].url];
expect(result.features.responses[0]).not.toBeUndefined();
var featureResults = result.features.responses[0];
expect(featureResults.addResults.length).toBe(1);
expect(featureResults.updateResults.length).toBe(0);
expect(featureResults.deleteResults.length).toBe(0);
Expand All @@ -492,16 +492,17 @@ describe("Attachments", function()
{
expect(success).toBeTruthy();
expect(result.count).toBe(2);
// done();
done();
});
});
expect(g_offlineFeaturesManager.getOnlineStatus()).toBe(g_offlineFeaturesManager.RECONNECTING);
});

it("no edits pending", function(done)
{
expect(g_editsStore.pendingEditsCount()).toBe(0);
// done();
expect(g_featureLayers[3].pendingEditsCount(function(count){
expect(count).toBe(0);
}));
});

it("no attachments pending", function(done)
Expand Down

0 comments on commit baa52f0

Please sign in to comment.