Commit 50d6fc2f authored by Tristan Cavelier's avatar Tristan Cavelier

Fix bug: solve conflict by removing document works correctly now

parent 7cbd4552
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
</div> </div>
<div class="row-fluid"> <div class="row-fluid">
<div class="span12"> <div class="span12">
<button>Abort</button> <button onclick="basic_conflict_solver.abort()">Abort</button>
</div> </div>
</div> </div>
</div> </div>
...@@ -35,10 +35,13 @@ window.basic_conflict_solver = { ...@@ -35,10 +35,13 @@ window.basic_conflict_solver = {
'<div>Removed</div>'+ '<div>Removed</div>'+
'<div><button onclick="'+ '<div><button onclick="'+
//'console.log('+"'"+revision+"'"+');'+ //'console.log('+"'"+revision+"'"+');'+
"basic_conflict_solver.keepRevision('"+doc.revision+"');"+ "basic_conflict_solver.removeRevision();"+
'">Save this one</button></div><hr/>'+ '">Save this one</button></div><hr/>'+
'</div></div>'; '</div></div>';
}, },
removeRevision: function () {
OfficeJS.solveConflict(this.conflict_object);
},
keepRevision: function (revision) { keepRevision: function (revision) {
OfficeJS.solveConflict( OfficeJS.solveConflict(
this.conflict_object, this.conflict_object,
...@@ -46,7 +49,7 @@ window.basic_conflict_solver = { ...@@ -46,7 +49,7 @@ window.basic_conflict_solver = {
); );
}, },
abort: function () { abort: function () {
// TODO : OfficeJS.abortSolveConflict();
} }
}; };
......
...@@ -245,8 +245,6 @@ ...@@ -245,8 +245,6 @@
error: function (error) { error: function (error) {
var doc = { var doc = {
path:param.conflict_object.path, path:param.conflict_object.path,
last_modified:result.last_modified,
creation_date:result.creation_date,
revision:rev revision:rev
}; };
window.basic_conflict_solver. window.basic_conflict_solver.
...@@ -744,6 +742,11 @@ ...@@ -744,6 +742,11 @@
}); });
}; };
that.abortSolveConflict = function () {
that.closeGadgetId (priv.data_object.currentSolver.gadget_id);
priv.data_object.currentSolver = null;
};
/** /**
* Get current activity. * Get current activity.
* @method getActivity * @method getActivity
......
/*! JIO Storage - v0.1.0 - 2012-08-06 /*! JIO Storage - v0.1.0 - 2012-08-07
* Copyright (c) 2012 Nexedi; Licensed */ * Copyright (c) 2012 Nexedi; Licensed */
(function(LocalOrCookieStorage, $, Base64, sjcl, hex_sha256, Jio) { (function(LocalOrCookieStorage, $, Base64, sjcl, hex_sha256, Jio) {
...@@ -1465,8 +1465,11 @@ var newConflictManagerStorage = function ( spec, my ) { ...@@ -1465,8 +1465,11 @@ var newConflictManagerStorage = function ( spec, my ) {
return this.revision_object; return this.revision_object;
}, },
solveConflict: function (content,option) { solveConflict: function (content,option) {
if (metadata[revision].deleted) { if (typeof content === 'undefined') {
option = option || content || {}; option = option || {};
option.deleted = true;
} else if (typeof content === 'object') {
option = content;
option.deleted = true; option.deleted = true;
} else { } else {
option = option || {}; option = option || {};
......
This diff is collapsed.
...@@ -232,8 +232,11 @@ var newConflictManagerStorage = function ( spec, my ) { ...@@ -232,8 +232,11 @@ var newConflictManagerStorage = function ( spec, my ) {
return this.revision_object; return this.revision_object;
}, },
solveConflict: function (content,option) { solveConflict: function (content,option) {
if (metadata[revision].deleted) { if (typeof content === 'undefined') {
option = option || content || {}; option = option || {};
option.deleted = true;
} else if (typeof content === 'object') {
option = content;
option.deleted = true; option.deleted = true;
} else { } else {
option = option || {}; option = option || {};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment