Conflict window option to export
This commit is contained in:
@@ -22,7 +22,7 @@ class ConflictResolutionModal {
|
||||
}
|
||||
}
|
||||
|
||||
controller($scope, modelManager, syncManager) {
|
||||
controller($scope, modelManager, syncManager, archiveManager) {
|
||||
'ngInject';
|
||||
|
||||
$scope.createContentString = function(item) {
|
||||
@@ -65,6 +65,10 @@ class ConflictResolutionModal {
|
||||
$scope.dismiss();
|
||||
}
|
||||
|
||||
$scope.export = function() {
|
||||
archiveManager.downloadBackupOfItems([$scope.item1, $scope.item2], true);
|
||||
}
|
||||
|
||||
$scope.applyCallback = function() {
|
||||
$scope.callback && $scope.callback();
|
||||
}
|
||||
|
||||
@@ -11,6 +11,10 @@ class ArchiveManager {
|
||||
*/
|
||||
|
||||
async downloadBackup(encrypted) {
|
||||
return this.downloadBackupOfItems(this.modelManager.allItems, encrypted);
|
||||
}
|
||||
|
||||
async downloadBackupOfItems(items, encrypted) {
|
||||
// download in Standard File format
|
||||
var keys, authParams;
|
||||
if(encrypted) {
|
||||
@@ -22,7 +26,7 @@ class ArchiveManager {
|
||||
authParams = await this.authManager.getAuthParams();
|
||||
}
|
||||
}
|
||||
this.__itemsData(keys, authParams).then((data) => {
|
||||
this.__itemsData(items, keys, authParams).then((data) => {
|
||||
this.__downloadData(data, `SN Archive - ${new Date()}.txt`);
|
||||
|
||||
// download as zipped plain text files
|
||||
@@ -37,8 +41,8 @@ class ArchiveManager {
|
||||
Private
|
||||
*/
|
||||
|
||||
async __itemsData(keys, authParams) {
|
||||
let data = await this.modelManager.getAllItemsJSONData(keys, authParams);
|
||||
async __itemsData(items, keys, authParams) {
|
||||
let data = await this.modelManager.getJSONDataForItems(items, keys, authParams);
|
||||
let blobData = new Blob([data], {type: 'text/json'});
|
||||
return blobData;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user